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 pandas/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/int
UInt16 + + int/int
UInt32 + + int/int
UInt64 + + int/int
UInt128 + + int/int
UInt256 + + int/int
Int8 + + int/int
Int16 + + int/int
Int32 + + int/int
Int64 + + int/int
Int128 + + int/int
Int256 + + int/int
Float32 + + float/float
Float64 + + float/float
BFloat16 + + float/float
Decimal(P, S) + + decimal.Decimal/decimal.Decimal
String + + str/str
FixedString(N) + + str/str
Date + + date/date
Date32 + + date/date
DateTime + + datetime/datetime
DateTime64 + + datetime/datetime
Enum + + str/Union[int,Enum]
Bool + + bool/bool
UUID + + UUID/UUID
IPv4 + + IPv4Address/IPv4Address
IPv6 + + IPv6Address/IPv6Address
Array(T) + + List[T*]/List[T*]
LowCardinality(T) + - Union[str,date,datetime,int,float]/-
Nullable(T) + + Optional[T*]/Optional[T*]
Nothing + + None/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.0.1.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

nativelib-0.0.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nativelib-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3eadf193649f82a428abd30a2ae33ea802515cee5287ecfce70b1c9094a08fbd
MD5 acb9316dd044919448d07fcecc8841fa
BLAKE2b-256 cd4f3986ada3d15ae51697fec894dc0f373947424a17c71e3d5a9865dae351aa

See more details on using hashes here.

File details

Details for the file nativelib-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: nativelib-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nativelib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c2e949a3186309badc42bcf4e9f0b3f589d53b87f717430a901eaf9e7a23b8d
MD5 c80739885504bf41493e32fd7a383261
BLAKE2b-256 256e7af536f73679cde8cd838b7d964c6a76d83c0d56068690513335f4623c03

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