Data Formats
When it comes to data formats, chDB is 100% feature compatible with ClickHouse.
Input formats are used to parse the data provided to INSERT and SELECT from a file-backed table such as File, URL or S3.
Output formats are used to arrange the results of a SELECT, and to perform INSERTs into a file-backed table.
As well as the data formats that ClickHouse supports, chDB also supports:
ArrowTableas an output format, the type is Pythonpyarrow.TableDataFrameas an input and output format, the type is Pythonpandas.DataFrame. For examples, seetest_joindf.pyDebugas ab output (as an alias ofCSV), but with enabled debug verbose output from ClickHouse.
The supported data formats from ClickHouse are:
| Format | Input | Output |
|---|---|---|
| TabSeparated | ✔ | ✔ |
| TabSeparatedRaw | ✔ | ✔ |
| TabSeparatedWithNames | ✔ | ✔ |
| TabSeparatedWithNamesAndTypes | ✔ | ✔ |
| TabSeparatedRawWithNames | ✔ | ✔ |
| TabSeparatedRawWithNamesAndTypes | ✔ | ✔ |
| Template | ✔ | ✔ |
| TemplateIgnoreSpaces | ✔ | ✗ |
| CSV | ✔ | ✔ |
| CSVWithNames | ✔ | ✔ |
| CSVWithNamesAndTypes | ✔ | ✔ |
| CustomSeparated | ✔ | ✔ |
| CustomSeparatedWithNames | ✔ | ✔ |
| CustomSeparatedWithNamesAndTypes | ✔ | ✔ |
| SQLInsert | ✗ | ✔ |
| Values | ✔ | ✔ |
| Vertical | ✗ | ✔ |
| JSON | ✔ | ✔ |
| JSONAsString | ✔ | ✗ |
| JSONStrings | ✔ | ✔ |
| JSONColumns | ✔ | ✔ |
| JSONColumnsWithMetadata | ✔ | ✔ |
| JSONCompact | ✔ | ✔ |
| JSONCompactStrings | ✗ | ✔ |
| JSONCompactColumns | ✔ | ✔ |
| JSONEachRow | ✔ | ✔ |
| PrettyJSONEachRow | ✗ | ✔ |
| JSONEachRowWithProgress | ✗ | ✔ |
| JSONStringsEachRow | ✔ | ✔ |
| JSONStringsEachRowWithProgress | ✗ | ✔ |
| JSONCompactEachRow | ✔ | ✔ |
| JSONCompactEachRowWithNames | ✔ | ✔ |
| JSONCompactEachRowWithNamesAndTypes | ✔ | ✔ |
| JSONCompactStringsEachRow | ✔ | ✔ |
| JSONCompactStringsEachRowWithNames | ✔ | ✔ |
| JSONCompactStringsEachRowWithNamesAndTypes | ✔ | ✔ |
| JSONObjectEachRow | ✔ | ✔ |
| BSONEachRow | ✔ | ✔ |
| TSKV | ✔ | ✔ |
| Pretty | ✗ | ✔ |
| PrettyNoEscapes | ✗ | ✔ |
| PrettyMonoBlock | ✗ | ✔ |
| PrettyNoEscapesMonoBlock | ✗ | ✔ |
| PrettyCompact | ✗ | ✔ |
| PrettyCompactNoEscapes | ✗ | ✔ |
| PrettyCompactMonoBlock | ✗ | ✔ |
| PrettyCompactNoEscapesMonoBlock | ✗ | ✔ |
| PrettySpace | ✗ | ✔ |
| PrettySpaceNoEscapes | ✗ | ✔ |
| PrettySpaceMonoBlock | ✗ | ✔ |
| PrettySpaceNoEscapesMonoBlock | ✗ | ✔ |
| Prometheus | ✗ | ✔ |
| Protobuf | ✔ | ✔ |
| ProtobufSingle | ✔ | ✔ |
| Avro | ✔ | ✔ |
| AvroConfluent | ✔ | ✗ |
| Parquet | ✔ | ✔ |
| ParquetMetadata | ✔ | ✗ |
| Arrow | ✔ | ✔ |
| ArrowStream | ✔ | ✔ |
| ORC | ✔ | ✔ |
| One | ✔ | ✗ |
| RowBinary | ✔ | ✔ |
| RowBinaryWithNames | ✔ | ✔ |
| RowBinaryWithNamesAndTypes | ✔ | ✔ |
| RowBinaryWithDefaults | ✔ | ✔ |
| Native | ✔ | ✔ |
| Null | ✗ | ✔ |
| XML | ✗ | ✔ |
| CapnProto | ✔ | ✔ |
| LineAsString | ✔ | ✔ |
| Regexp | ✔ | ✗ |
| RawBLOB | ✔ | ✔ |
| MsgPack | ✔ | ✔ |
| MySQLDump | ✔ | ✗ |
| Markdown | ✗ | ✔ |
For further information and examples, see ClickHouse formats for input and output data.