Skip to main content

Library for read and write clickhouse native format.

Project description

NativeLib

Library for working with Clickhouse Native Format

Description of the format on the official website:

The most efficient format. Data is written and read by blocks in binary format.
For each block, the number of rows, number of columns, column names and types,
and parts of columns in this block are recorded one after another. In other words,
this format is “columnar” – it does not convert columns to rows.
This is the format used in the native interface for interaction between servers,
for using the command-line client, and for C++ clients.

You can use this format to quickly generate dumps that can only be read by the ClickHouse DBMS.
It does not make sense to work with this format yourself.

This library allows for data exchange between Clickhouse Native Format and python/pandas.DataFrame/polars.DataFrame.

Unsupported data types (at the moment)

  • Time
  • Time64
  • Tuple # Tuple(T1, T2, ...).
  • Map # Map(K, V).
  • Variant # Variant(T1, T2, ...).
  • AggregateFunction # (name, types_of_arguments...) — parametric data type.
  • SimpleAggregateFunction # (name, types_of_arguments...) data type stores current value (intermediate state) of the aggregate function.
  • Point # stored as a Tuple(Float64, Float64).
  • Ring # stored as an array of points: Array(Point).
  • LineString # stored as an array of points: Array(Point).
  • MultiLineString # is multiple lines stored as an array of LineString: Array(LineString).
  • Polygon # stored as an array of rings: Array(Ring).
  • MultiPolygon # stored as an array of polygons: Array(Polygon).
  • Expression # used for representing lambdas in high-order functions.
  • Set # Used for the right half of an IN expression.
  • Domains # You can use domains anywhere corresponding base type can be used.
  • Nested # Nested(name1 Type1, Name2 Type2, ...).
  • Dynamic # This type allows to store values of any type inside it without knowing all of them in advance.
  • JSON # Stores JavaScript Object Notation (JSON) documents in a single column.

Supported data types

Clickhouse data type Read Write Python data type (Read/Write)
UInt8 + + int
UInt16 + + int
UInt32 + + int
UInt64 + + int
UInt128 + + int
UInt256 + + int
Int8 + + int
Int16 + + int
Int32 + + int
Int64 + + int
Int128 + + int
Int256 + + int
Float32 + + float
Float64 + + float
BFloat16 + + float
Decimal(P, S) + + decimal.Decimal
String + + str
FixedString(N) + + str
Date + + date
Date32 + + date
DateTime + + datetime
DateTime64 + + datetime
Enum + + str/Union[int,Enum, str]
Bool + + bool
UUID + + UUID
IPv4 + + IPv4Address
IPv6 + + IPv6Address
Array(T) + + List[T*]
LowCardinality(T) + + Union[str,date,datetime,int,float]
Nullable(T) + + Optional[T*]
Nothing + + None

*T - any simple data type from those listed in the table

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nativelib-0.2.0.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nativelib-0.2.0.0-cp310-cp310-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file nativelib-0.2.0.0.tar.gz.

File metadata

  • Download URL: nativelib-0.2.0.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nativelib-0.2.0.0.tar.gz
Algorithm Hash digest
SHA256 125a498fb4d6154b11cd0b38938733b7c814a9d850f229e6e6a8efba869c4297
MD5 3842ca9346990d223a8cdc0e3d5eff53
BLAKE2b-256 43e45d5b659de1bdff4a3dc0149c4593212ae80d1eb0a1e7cf43772b1de268dc

See more details on using hashes here.

File details

Details for the file nativelib-0.2.0.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for nativelib-0.2.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 297d96842c4d45bc316a7d295bbc5b36e3f23551a2e990a4b4180507917c74e5
MD5 070aa6a94fcb1028ef3e98b7f0d06f66
BLAKE2b-256 5d913bf3e4a0486ba303b9519ff5c8bc8afae7e3e0b98e55a825e64dc96f0946

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page