Giter Club home page Giter Club logo

clickhouse-maxmind-geoip's Issues

V4 and V6 can be combined

I noticed that you do not have to split v4 and v6 in different dictionaries.

You can combine the v4 and v6 CSVs and still can lookup v4 and v6 addresses correctly. (Would reduce the dictionaries you need)

More effective data types

There's a possibility to use some more efficient data types for dictionaries' fields like is_anonymous_proxy or represented_country_geoname_id

Getting error when ip field have Nullable type

For example:

CREATE TABLE test_ip (
  `id` Int32,
  `ip` Nullable(String)
) ENGINE = MergeTree() ORDER BY (id)

INSERT INTO test_ip VALUES
    (1, '174.105.199.64'),
    (2, '40.107.219.92'),
    (3, '40.107.219.59'),
    (4, '65.246.27.210'),
    (5, '50.98.35.219'),
    (6, '70.67.156.137')

If try get data from dictionaries

SELECT 
    ip,
    dictGet('geoip_city_blocks_ipv4', 'geoname_id', tuple(IPv4StringToNum(ip))) AS geoname_id
FROM 
    test_ip

Request getting error:

Code: 53, e.displayText() = DB::Exception: Key does not match, expected either UInt32 or FixedString(16)

If change type just to String, the same request work correctly, do you know how to fix it without changing field type? Thanks

MaxMind CSV field 'prefix' has changed to 'network'

As of March 2022 these files (and maybe more) have a slightly different csv header to the ones they had when this project was created.

eg (note the very first field)
GeoLite2-City-Blocks-IPv4.csv
network,geoname_id,registered_country_geoname_id,represented_country_geoname_id,is_anonymous_proxy,is_satellite_provider,postal_code,latitude,longitude,accuracy_radius
1.0.0.0/24,2077456,2077456,,0,0,,-33.4940,143.2104,1000
1.0.1.0/24,1814991,1814991,,0,0,,34.7732,113.7220,1000
...

I believe these files are effected:
/clickhouse/geoip_asn_blocks_ipv6_dictionary.xml
/clickhouse/geoip_asn_blocks_ipv4_dictionary.xml
/clickhouse/geoip_country_blocks_ipv6_dictionary.xml
/clickhouse/geoip_country_blocks_ipv4_dictionary.xml
/clickhouse/geoip_city_blocks_ipv4_dictionary.xml
/clickhouse/geoip_city_blocks_ipv6_dictionary.xml

Happy to submit a pull if you'd like.

Single quote handling.

Hi, first of all, thanks for this example!

I made a PR to address an issue I ran into when upgrading Clickhouse from version 19 to version 21. The import from CSV stopped working because the escaping of apostrophes apparently changed.

Luckily, there is a format option for Clickhouse CSV that I think is an even cleaner solution.

#5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.