id stringlengths 36 36 | document stringlengths 3 3k | metadata stringlengths 23 69 | embeddings listlengths 384 384 |
|---|---|---|---|
7d882271-49cc-4b03-9cc0-47fceb057661 | alias: []
description: 'Documentation for the One format'
input_format: true
keywords: ['One']
output_format: false
slug: /interfaces/formats/One
title: 'One'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
One
format is a special input format that doesn't read any data from file, and returns only one row with column of type
UInt8
, name
dummy
and value
0
(like the
system.one
table).
Can be used with virtual columns
_file/_path
to list all files without reading actual data.
Example usage {#example-usage}
Example:
sql title="Query"
SELECT _file FROM file('path/to/files/data*', One);
text title="Response"
ββ_fileβββββ
β data.csv β
ββββββββββββ
ββ_fileβββββββ
β data.jsonl β
ββββββββββββββ
ββ_fileβββββ
β data.tsv β
ββββββββββββ
ββ_fileβββββββββ
β data.parquet β
ββββββββββββββββ
Format settings {#format-settings} | {"source_file": "One.md"} | [
-0.02347741462290287,
0.029673369601368904,
-0.0991276428103447,
0.04330253601074219,
-0.0166927557438612,
-0.038328543305397034,
0.052958592772483826,
0.12496284395456314,
0.0014171343063935637,
0.050964560359716415,
-0.021943960338830948,
-0.006037520244717598,
0.05706476792693138,
0.007... |
83a7c535-3726-456f-8231-f92dce5af24e | alias: []
description: 'Documentation for the Native format'
input_format: true
keywords: ['Native']
output_format: true
slug: /interfaces/formats/Native
title: 'Native'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
Native
format is ClickHouse's most efficient format because it is truly "columnar"
in that it does not convert columns to rows.
In this format data is written and read by
blocks
in a binary format.
For each block, the number of rows, number of columns, column names and types, and parts of columns in the block are recorded one after another.
This is the format used in the native interface for interaction between servers, for using the command-line client, and for C++ clients.
:::tip
You can use this format to quickly generate dumps that can only be read by the ClickHouse DBMS.
It might not be practical to work with this format yourself.
:::
Example usage {#example-usage}
Format settings {#format-settings} | {"source_file": "Native.md"} | [
-0.03164563328027725,
0.01944146305322647,
-0.07313492894172668,
-0.00003105429277638905,
-0.014966924674808979,
-0.07808642834424973,
-0.04704807698726654,
0.07599397748708725,
0.008647925220429897,
0.018292956054210663,
-0.019847972318530083,
-0.015205779112875462,
0.03634808585047722,
-... |
9ec7fe0e-57af-4699-86d4-ab7b1db4376c | alias: []
description: 'Documentation for the XML format'
input_format: false
keywords: ['XML']
output_format: true
slug: /interfaces/formats/XML
title: 'XML'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
XML
format is suitable only for output, and not for parsing.
If the column name does not have an acceptable format, just 'field' is used as the element name. In general, the XML structure follows the JSON structure.
Just as for JSON, invalid UTF-8 sequences are changed to the replacement character
οΏ½
so the output text will consist of valid UTF-8 sequences.
In string values, the characters
<
and
&
are escaped as
<
and
&
.
Arrays are output as
<array><elem>Hello</elem><elem>World</elem>...</array>
,and tuples as
<tuple><elem>Hello</elem><elem>World</elem>...</tuple>
.
Example usage {#example-usage}
Example:
```xml
SearchPhrase
String
count()
UInt64
8267016
bathroom interior design
2166
clickhouse
1655
2014 spring fashion
1549
freeform photos
1480
angelina jolie
1245
omsk
1112
photos of dog breeds
1091
curtain designs
1064
baku
1000
10
141137
```
Format settings {#format-settings}
XML {#xml} | {"source_file": "XML.md"} | [
-0.053175341337919235,
0.06285571306943893,
0.01002141647040844,
-0.022685350850224495,
-0.019828807562589645,
-0.06548002362251282,
-0.029654035344719887,
0.06257189065217972,
0.023983484134078026,
-0.06303313374519348,
0.055469248443841934,
-0.028411295264959335,
0.0724366307258606,
-0.0... |
fa98e52a-f34f-44b0-808f-6ad4955d959e | alias: []
description: 'Documentation for the Null format'
input_format: false
keywords: ['Null', 'format']
output_format: true
slug: /interfaces/formats/Null
title: 'Null'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
In the
Null
format - nothing is output.
This may at first sound strange, but it's important to note that despite outputting nothing, the query is still processed,
and when using the command-line client, data is transmitted to the client.
:::tip
The
Null
format can be useful for performance testing.
:::
Example usage {#example-usage}
Reading data {#reading-data}
Consider a table
football
with the following data:
text
ββββββββdateββ¬βseasonββ¬βhome_teamββββββββββββββ¬βaway_teamββββββββββββ¬βhome_team_goalsββ¬βaway_team_goalsββ
1. β 2022-04-30 β 2021 β Sutton United β Bradford City β 1 β 4 β
2. β 2022-04-30 β 2021 β Swindon Town β Barrow β 2 β 1 β
3. β 2022-04-30 β 2021 β Tranmere Rovers β Oldham Athletic β 2 β 0 β
4. β 2022-05-02 β 2021 β Port Vale β Newport County β 1 β 2 β
5. β 2022-05-02 β 2021 β Salford City β Mansfield Town β 2 β 2 β
6. β 2022-05-07 β 2021 β Barrow β Northampton Town β 1 β 3 β
7. β 2022-05-07 β 2021 β Bradford City β Carlisle United β 2 β 0 β
8. β 2022-05-07 β 2021 β Bristol Rovers β Scunthorpe United β 7 β 0 β
9. β 2022-05-07 β 2021 β Exeter City β Port Vale β 0 β 1 β
10. β 2022-05-07 β 2021 β Harrogate Town A.F.C. β Sutton United β 0 β 2 β
11. β 2022-05-07 β 2021 β Hartlepool United β Colchester United β 0 β 2 β
12. β 2022-05-07 β 2021 β Leyton Orient β Tranmere Rovers β 0 β 1 β
13. β 2022-05-07 β 2021 β Mansfield Town β Forest Green Rovers β 2 β 2 β
14. β 2022-05-07 β 2021 β Newport County β Rochdale β 0 β 2 β
15. β 2022-05-07 β 2021 β Oldham Athletic β Crawley Town β 3 β 3 β
16. β 2022-05-07 β 2021 β Stevenage Borough β Salford City β 4 β 2 β
17. β 2022-05-07 β 2021 β Walsall β Swindon Town β 0 β 3 β
ββββββββββββββ΄βββββββββ΄ββββββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ
Read data using the
Null
format:
sql
SELECT *
FROM football
FORMAT Null
The query will process the data, but will not output anything. | {"source_file": "Null.md"} | [
0.02053156867623329,
0.06498467177152634,
-0.04141271486878395,
0.019025083631277084,
-0.02855772152543068,
-0.02286183461546898,
0.007902986370027065,
0.05779850482940674,
0.0371638685464859,
0.008571023121476173,
0.006757162511348724,
-0.06518455594778061,
0.07601582258939743,
-0.0280929... |
d7f2b4a4-5695-41c2-8eb9-abcd1b7cee47 | Read data using the
Null
format:
sql
SELECT *
FROM football
FORMAT Null
The query will process the data, but will not output anything.
response
0 rows in set. Elapsed: 0.154 sec.
Format settings {#format-settings} | {"source_file": "Null.md"} | [
0.09345028549432755,
0.03706960752606392,
-0.09521152824163437,
-0.011916895397007465,
-0.08962423354387283,
0.008297774009406567,
0.0022637690417468548,
0.059493277221918106,
0.00960166659206152,
0.013529072515666485,
0.0075011057779192924,
-0.07737554609775543,
-0.013831058517098427,
-0.... |
fa6f4246-7b8d-4618-8dfd-6e7bf32b0238 | description: 'List of third-party GUI tools and applications for working with ClickHouse'
sidebar_label: 'Visual Interfaces'
sidebar_position: 28
slug: /interfaces/third-party/gui
title: 'Visual Interfaces from Third-party Developers'
doc_type: 'reference'
Visual interfaces from third-party developers
Open-source {#open-source}
agx {#agx}
agx
is a desktop application built with Tauri and SvelteKit that provides a modern interface for exploring and querying data using ClickHouse's embedded database engine (chdb).
Leverage ch-db when running the native application.
Can connect to a Clickhouse instance when running the web instance.
Monaco editor so you'll feel at home.
Multiple and evolving data visualizations.
ch-ui {#ch-ui}
ch-ui
is a simple React.js app interface for ClickHouse databases designed for executing queries and visualizing data. Built with React and the ClickHouse client for web, it offers a sleek and user-friendly UI for easy database interactions.
Features:
ClickHouse Integration: Easily manage connections and execute queries.
Responsive Tab Management: Dynamically handle multiple tabs, such as query and table tabs.
Performance Optimizations: Utilizes Indexed DB for efficient caching and state management.
Local Data Storage: All data is stored locally in the browser, ensuring no data is sent anywhere else.
ChartDB {#chartdb}
ChartDB
is a free and open-source tool for visualizing and designing database schemas, including ClickHouse, with a single query. Built with React, it provides a seamless and user-friendly experience, requiring no database credentials or signup to get started.
Features:
Schema Visualization: Instantly import and visualize your ClickHouse schema, including ER diagrams with materialized views and standard views, showing references to tables.
AI-Powered DDL Export: Generate DDL scripts effortlessly for better schema management and documentation.
Multi-SQL Dialect Support: Compatible with a range of SQL dialects, making it versatile for various database environments.
No Signup or Credentials Needed: All functionality is accessible directly in the browser, keeping it frictionless and secure.
ChartDB Source Code
.
DataPup {#datapup}
DataPup
is a modern, AI-assisted, cross-platform database client with native ClickHouse support.
Features:
AI-powered SQL query assistance with intelligent suggestions
Native ClickHouse connection support with secure credential handling
Beautiful, accessible interface with multiple themes (Light, Dark, and colorful variants)
Advanced query result filtering and exploration
Cross-platform support (macOS, Windows, Linux)
Fast and responsive performance
Open-source and MIT licensed
ClickHouse Schema Flow Visualizer {#clickhouse-schemaflow-visualizer} | {"source_file": "gui.md"} | [
-0.023471752181649208,
-0.06721972674131393,
-0.049467138946056366,
0.045076098293066025,
-0.013959180563688278,
-0.026382004842162132,
-0.0002367908600717783,
0.08897265046834946,
-0.04830131679773331,
-0.042722415179014206,
-0.020312367007136345,
-0.02948087826371193,
0.03146135061979294,
... |
f3b9b353-2e9d-4a6c-b11f-a301622e18fe | Cross-platform support (macOS, Windows, Linux)
Fast and responsive performance
Open-source and MIT licensed
ClickHouse Schema Flow Visualizer {#clickhouse-schemaflow-visualizer}
ClickHouse Schema Flow Visualizer
is a powerful open-source web application for visualizing ClickHouse table relationships using Mermaid.js diagrams. Browse databases and tables with an intuitive interface, explore table metadata with optional row counts and size information, and export interactive schema diagrams.
Features:
Browse ClickHouse databases and tables with an intuitive interface
Visualize table relationships with Mermaid.js diagrams
Color-coded icons matching table types for better visualization
View direction of data flow between tables
Export diagrams as standalone HTML files
Toggle metadata visibility (table rows and size information)
Secure connection to ClickHouse with TLS support
Responsive web interface for all devices
ClickHouse Schema Flow Visualizer - source code
Tabix {#tabix}
Web interface for ClickHouse in the
Tabix
project.
Features:
Works with ClickHouse directly from the browser without the need to install additional software.
Query editor with syntax highlighting.
Auto-completion of commands.
Tools for graphical analysis of query execution.
Colour scheme options.
Tabix documentation
.
HouseOps {#houseops}
HouseOps
is a UI/IDE for OSX, Linux and Windows.
Features:
Query builder with syntax highlighting. View the response in a table or JSON view.
Export query results as CSV or JSON.
List of processes with descriptions. Write mode. Ability to stop (
KILL
) a process.
Database graph. Shows all tables and their columns with additional information.
A quick view of the column size.
Server configuration.
The following features are planned for development:
Database management.
User management.
Real-time data analysis.
Cluster monitoring.
Cluster management.
Monitoring replicated and Kafka tables.
LightHouse {#lighthouse}
LightHouse
is a lightweight web interface for ClickHouse.
Features:
Table list with filtering and metadata.
Table preview with filtering and sorting.
Read-only query execution.
Redash {#redash}
Redash
is a platform for data visualization.
Supports for multiple data sources including ClickHouse, Redash can join results of queries from different data sources into one final dataset.
Features:
Powerful editor of queries.
Database explorer.
Visualization tool that allows you to represent data in different forms.
Grafana {#grafana}
Grafana
is a platform for monitoring and visualization.
"Grafana allows you to query, visualize, alert on and understand your metrics no matter where they are stored. Create, explore, and share dashboards with your team and foster a data-driven culture. Trusted and loved by the community" β grafana.com. | {"source_file": "gui.md"} | [
0.010416987352073193,
-0.04274745658040047,
-0.02990340068936348,
-0.02465718612074852,
0.021463563665747643,
-0.0624200664460659,
-0.021223103627562523,
-0.006713721435517073,
-0.04145029932260513,
-0.03409021720290184,
0.00376523332670331,
-0.010546745732426643,
0.012633749283850193,
0.0... |
1cc741ec-f3a4-4ce2-8db7-e26d94f50053 | ClickHouse data source plugin provides support for ClickHouse as a backend database.
qryn {#qryn}
qryn
is a polyglot, high-performance observability stack for ClickHouse
(formerly cLoki)
with native Grafana integrations allowing users to ingest and analyze logs, metrics and telemetry traces from any agent supporting Loki/LogQL, Prometheus/PromQL, OTLP/Tempo, Elastic, InfluxDB and many more.
Features:
Built-in Explore UI and LogQL CLI for querying, extracting and visualizing data
Native Grafana APIs support for querying, processing, ingesting, tracing and alerting without plugins
Powerful pipeline to dynamically search, filter and extract data from logs, events, traces and beyond
Ingestion and PUSH APIs transparently compatible with LogQL, PromQL, InfluxDB, Elastic and many more
Ready to use with Agents such as Promtail, Grafana-Agent, Vector, Logstash, Telegraf and many others
DBeaver {#dbeaver}
DBeaver
- universal desktop database client with ClickHouse support.
Features:
Query development with syntax highlight and autocompletion.
Table list with filters and metadata search.
Table data preview.
Full-text search.
By default, DBeaver does not connect using a session (the CLI for example does). If you require session support (for example to set settings for your session), edit the driver connection properties and set
session_id
to a random string (it uses the http connection under the hood). Then you can use any setting from the query window.
clickhouse-cli {#clickhouse-cli}
clickhouse-cli
is an alternative command-line client for ClickHouse, written in Python 3.
Features:
Autocompletion.
Syntax highlighting for the queries and data output.
Pager support for the data output.
Custom PostgreSQL-like commands.
clickhouse-flamegraph {#clickhouse-flamegraph}
clickhouse-flamegraph
is a specialized tool to visualize the
system.trace_log
as
flamegraph
.
clickhouse-plantuml {#clickhouse-plantuml}
cickhouse-plantuml
is a script to generate
PlantUML
diagram of tables' schemes.
ClickHouse table graph {#clickhouse-table-graph}
ClickHouse table graph
is a simple CLI tool for visualizing dependencies between ClickHouse tables. This tool retrieves connections between tables from
system.tables
table and builds dependencies flowchart in
mermaid
format. With this tool you can easily visualize table dependencies and understand the data flow in your ClickHouse database. Thanks to mermaid, the resulting flowchart looks attractive and can be easily added to your markdown documentation.
xeus-clickhouse {#xeus-clickhouse}
xeus-clickhouse
is a Jupyter kernal for ClickHouse, which supports query CH data using SQL in Jupyter.
MindsDB Studio {#mindsdb} | {"source_file": "gui.md"} | [
-0.06778497993946075,
-0.05403819680213928,
-0.07485728710889816,
-0.009629054926335812,
-0.06921081990003586,
-0.07728064805269241,
0.05656404048204422,
-0.03578735888004303,
0.006441114004701376,
0.04493308812379837,
-0.004756508395075798,
-0.07558457553386688,
0.035653043538331985,
0.02... |
d8ab47a9-4deb-45c0-aea7-56a0730587ed | xeus-clickhouse {#xeus-clickhouse}
xeus-clickhouse
is a Jupyter kernal for ClickHouse, which supports query CH data using SQL in Jupyter.
MindsDB Studio {#mindsdb}
MindsDB
is an open-source AI layer for databases including ClickHouse that allows you to effortlessly develop, train and deploy state-of-the-art machine learning models. MindsDB Studio(GUI) allows you to train new models from database, interpret predictions made by the model, identify potential data biases, and evaluate and visualize model accuracy using the Explainable AI function to adapt and tune your Machine Learning models faster.
DBM {#dbm}
DBM
DBM is a visual management tool for ClickHouse!
Features:
Support query history (pagination, clear all, etc.)
Support selected sql clauses query
Support terminating query
Support table management (metadata, delete, preview)
Support database management (delete, create)
Support custom query
Support multiple data sources management(connection test, monitoring)
Support monitor (processor, connection, query)
Support migrating data
Bytebase {#bytebase}
Bytebase
is a web-based, open source schema change and version control tool for teams. It supports various databases including ClickHouse.
Features:
Schema review between developers and DBAs.
Database-as-Code, version control the schema in VCS such GitLab and trigger the deployment upon code commit.
Streamlined deployment with per-environment policy.
Full migration history.
Schema drift detection.
Backup and restore.
RBAC.
Zeppelin-Interpreter-for-ClickHouse {#zeppelin-interpreter-for-clickhouse}
Zeppelin-Interpreter-for-ClickHouse
is a
Zeppelin
interpreter for ClickHouse. Compared with the JDBC interpreter, it can provide better timeout control for long-running queries.
ClickCat {#clickcat}
ClickCat
is a friendly user interface that lets you search, explore and visualize your ClickHouse Data.
Features:
An online SQL editor which can run your SQL code without any installing.
You can observe all processes and mutations. For those unfinished processes, you can kill them in ui.
The Metrics contain Cluster Analysis, Data Analysis, and Query Analysis.
ClickVisual {#clickvisual}
ClickVisual
ClickVisual is a lightweight open source log query, analysis and alarm visualization platform.
Features:
Supports one-click creation of analysis log libraries
Supports log collection configuration management
Supports user-defined index configuration
Supports alarm configuration
Support permission granularity to library and table permission configuration
ClickHouse-Mate {#clickmate}
ClickHouse-Mate
is an angular web client + user interface to search and explore data in ClickHouse.
Features:
ClickHouse SQL Query autocompletion
Fast Database and Table tree navigation
Advanced result Filtering and Sorting
Inline ClickHouse SQL documentation
Query Presets and History | {"source_file": "gui.md"} | [
-0.0033622048795223236,
-0.08721162378787994,
-0.015302011743187904,
-0.0008929612231440842,
0.01367299072444439,
-0.04931408539414406,
0.03073188289999962,
-0.018077274784445763,
-0.04296059533953667,
0.021577466279268265,
-0.013038239441812038,
-0.01659858599305153,
0.09793383628129959,
... |
f175aa14-259b-43fc-8548-9a907c170b78 | Features:
ClickHouse SQL Query autocompletion
Fast Database and Table tree navigation
Advanced result Filtering and Sorting
Inline ClickHouse SQL documentation
Query Presets and History
100% browser based, no server/backend
The client is available for instant usage through github pages: https://metrico.github.io/clickhouse-mate/
Uptrace {#uptrace}
Uptrace
is an APM tool that provides distributed tracing and metrics powered by OpenTelemetry and ClickHouse.
Features:
OpenTelemetry tracing
, metrics, and logs.
Email/Slack/PagerDuty notifications using AlertManager.
SQL-like query language to aggregate spans.
Promql-like language to query metrics.
Pre-built metrics dashboards.
Multiple users/projects via YAML config.
clickhouse-monitoring {#clickhouse-monitoring}
clickhouse-monitoring
is a simple Next.js dashboard that relies on
system.*
tables to help monitor and provide an overview of your ClickHouse cluster.
Features:
Query monitor: current queries, query history, query resources (memory, parts read, file_open, ...), most expensive queries, most used tables or columns, etc.
Cluster monitor: total memory/CPU usage, distributed queue, global settings, mergetree settings, metrics, etc.
Tables and parts information: size, row count, compression, part size, etc., at the column level detail.
Useful tools: Zookeeper data exploration, query EXPLAIN, kill queries, etc.
Visualization metric charts: queries and resource usage, number of merges/mutation, merge performance, query performance, etc.
CKibana {#ckibana}
CKibana
is a lightweight service that allows you to effortlessly search, explore, and visualize ClickHouse data using the native Kibana UI.
Features:
Translates chart requests from the native Kibana UI into ClickHouse query syntax.
Supports advanced features such as sampling and caching to enhance query performance.
Minimizes the learning cost for users after migrating from ElasticSearch to ClickHouse.
Telescope {#telescope}
Telescope
is a modern web interface for exploring logs stored in ClickHouse. It provides a user-friendly UI for querying, visualizing, and managing log data with fine-grained access control.
Features:
Clean, responsive UI with powerful filters and customizable field selection.
FlyQL syntax for intuitive and expressive log filtering.
Time-based graph with group-by support, including nested JSON, Map, and Array fields.
Optional raw SQL
WHERE
query support for advanced filtering (with permission checks).
Saved Views: persist and share custom UI configurations for queries and layout.
Role-based access control (RBAC) and GitHub authentication integration.
No extra agents or components required on the ClickHouse side.
Telescope Source Code
Β·
Live Demo
Commercial {#commercial}
DataGrip {#datagrip} | {"source_file": "gui.md"} | [
-0.02571345679461956,
-0.0508996918797493,
-0.06698183715343475,
0.04274800792336464,
0.01602380909025669,
-0.038456030189991,
0.02933088131248951,
0.02321348339319229,
-0.032284632325172424,
0.03801263868808746,
-0.020204821601510048,
0.0030995639972388744,
0.013829600065946579,
0.0194310... |
f192ce1d-d2f2-41c2-b45a-469302dd38a5 | No extra agents or components required on the ClickHouse side.
Telescope Source Code
Β·
Live Demo
Commercial {#commercial}
DataGrip {#datagrip}
DataGrip
is a database IDE from JetBrains with dedicated support for ClickHouse. It is also embedded in other IntelliJ-based tools: PyCharm, IntelliJ IDEA, GoLand, PhpStorm and others.
Features:
Very fast code completion.
ClickHouse syntax highlighting.
Support for features specific to ClickHouse, for example, nested columns, table engines.
Data Editor.
Refactorings.
Search and Navigation.
Yandex DataLens {#yandex-datalens}
Yandex DataLens
is a service of data visualization and analytics.
Features:
Wide range of available visualizations, from simple bar charts to complex dashboards.
Dashboards could be made publicly available.
Support for multiple data sources including ClickHouse.
Storage for materialized data based on ClickHouse.
DataLens is
available for free
for low-load projects, even for commercial use.
DataLens documentation
.
Tutorial
on visualizing data from a ClickHouse database.
Holistics Software {#holistics-software}
Holistics
is a full-stack data platform and business intelligence tool.
Features:
Automated email, Slack and Google Sheet schedules of reports.
SQL editor with visualizations, version control, auto-completion, reusable query components and dynamic filters.
Embedded analytics of reports and dashboards via iframe.
Data preparation and ETL capabilities.
SQL data modelling support for relational mapping of data.
Looker {#looker}
Looker
is a data platform and business intelligence tool with support for 50+ database dialects including ClickHouse. Looker is available as a SaaS platform and self-hosted. Users can use Looker via the browser to explore data, build visualizations and dashboards, schedule reports, and share their insights with colleagues. Looker provides a rich set of tools to embed these features in other applications, and an API
to integrate data with other applications.
Features:
Easy and agile development using LookML, a language which supports curated
Data Modeling
to support report writers and end-users.
Powerful workflow integration via Looker's
Data Actions
.
How to configure ClickHouse in Looker.
SeekTable {#seektable}
SeekTable
is a self-service BI tool for data exploration and operational reporting. It is available both as a cloud service and a self-hosted version. Reports from SeekTable may be embedded into any web-app.
Features:
Business users-friendly reports builder.
Powerful report parameters for SQL filtering and report-specific query customizations.
Can connect to ClickHouse both with a native TCP/IP endpoint and a HTTP(S) interface (2 different drivers).
It is possible to use all power of ClickHouse SQL dialect in dimensions/measures definitions.
Web API
for automated reports generation. | {"source_file": "gui.md"} | [
-0.06273270398378372,
-0.0895334780216217,
-0.026584893465042114,
0.04236939549446106,
-0.03118516318500042,
-0.05852022022008896,
0.0226974468678236,
-0.014133676886558533,
-0.03354783356189728,
-0.03222297132015228,
-0.0007050349959172308,
-0.008755560964345932,
0.04861779138445854,
-0.0... |
5ce20ad2-cffa-46cc-813c-22ed870fb274 | It is possible to use all power of ClickHouse SQL dialect in dimensions/measures definitions.
Web API
for automated reports generation.
Supports reports development flow with account data
backup/restore
; data models (cubes) / reports configuration is a human-readable XML and can be stored under version control system.
SeekTable is
free
for personal/individual usage.
How to configure ClickHouse connection in SeekTable.
Chadmin {#chadmin}
Chadmin
is a simple UI where you can visualize your currently running queries on your ClickHouse cluster and info about them and kill them if you want.
TABLUM.IO {#tablum_io}
TABLUM.IO
β an online query and analytics tool for ETL and visualization. It allows connecting to ClickHouse, query data via a versatile SQL console as well as to load data from static files and 3rd party services. TABLUM.IO can visualize data results as charts and tables.
Features:
- ETL: data loading from popular databases, local and remote files, API invocations.
- Versatile SQL console with syntax highlight and visual query builder.
- Data visualization as charts and tables.
- Data materialization and sub-queries.
- Data reporting to Slack, Telegram or email.
- Data pipelining via proprietary API.
- Data export in JSON, CSV, SQL, HTML formats.
- Web-based interface.
TABLUM.IO can be run as a self-hosted solution (as a docker image) or in the cloud.
License:
commercial
product with 3-month free period.
Try it out for free
in the cloud
.
Learn more about the product at
TABLUM.IO
CKMAN {#ckman}
CKMAN
is a tool for managing and monitoring ClickHouse clusters!
Features:
Rapid and convenient automated deployment of clusters through a browser interface
Clusters can be scaled or scaled
Load balance the data of the cluster
Upgrade the cluster online
Modify the cluster configuration on the page
Provides cluster node monitoring and zookeeper monitoring
Monitor the status of tables and partitions, and monitor slow SQL statements
Provides an easy-to-use SQL execution page | {"source_file": "gui.md"} | [
0.029480203986167908,
-0.09001459181308746,
-0.11985109746456146,
0.04003918915987015,
-0.05721892789006233,
-0.043021030724048615,
0.023969294503331184,
0.0405598059296608,
-0.06403544545173645,
0.016274595633149147,
-0.026218131184577942,
-0.03307543322443962,
0.09363342821598053,
-0.026... |
179fda57-e782-4a1d-b7c3-0caea68c9de4 | description: 'Documentation on integrating ClickHouse with various third-party systems
and tools'
sidebar_label: 'Integrations'
sidebar_position: 27
slug: /interfaces/third-party/integrations
title: 'Integration Libraries from Third-party Developers'
doc_type: 'reference'
Integration libraries from third-party developers
:::warning Disclaimer
ClickHouse, Inc. does
not
maintain the tools and libraries listed below and haven't done extensive testing to ensure their quality.
For official integrations please see the
integrations page
.
:::
Infrastructure products {#infrastructure-products}
Relational database management systems
- [MySQL](https://www.mysql.com)
- [mysql2ch](https://github.com/long2ice/mysql2ch)
- [ProxySQL](https://github.com/sysown/proxysql/wiki/ClickHouse-Support)
- [clickhouse-mysql-data-reader](https://github.com/Altinity/clickhouse-mysql-data-reader)
- [horgh-replicator](https://github.com/larsnovikov/horgh-replicator)
- [PostgreSQL](https://www.postgresql.org)
- [clickhousedb_fdw](https://github.com/Percona-Lab/clickhousedb_fdw)
- [infi.clickhouse_fdw](https://github.com/Infinidat/infi.clickhouse_fdw) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm))
- [pg2ch](https://github.com/mkabilov/pg2ch)
- [clickhouse_fdw](https://github.com/adjust/clickhouse_fdw)
- [MSSQL](https://en.wikipedia.org/wiki/Microsoft_SQL_Server)
- [ClickHouseMigrator](https://github.com/zlzforever/ClickHouseMigrator)
Message queues
- [Kafka](https://kafka.apache.org)
- [clickhouse_sinker](https://github.com/housepower/clickhouse_sinker) (uses [Go client](https://github.com/ClickHouse/clickhouse-go/))
- [stream-loader-clickhouse](https://github.com/adform/stream-loader)
Batch processing
- [Spark](https://spark.apache.org)
- [spark-clickhouse-connector](https://github.com/housepower/spark-clickhouse-connector)
Stream processing
- [Flink](https://flink.apache.org)
- [flink-clickhouse-sink](https://github.com/ivi-ru/flink-clickhouse-sink)
Object storages
- [S3](https://en.wikipedia.org/wiki/Amazon_S3)
- [clickhouse-backup](https://github.com/AlexAkulov/clickhouse-backup)
Container orchestration
- [Kubernetes](https://kubernetes.io)
- [clickhouse-operator](https://github.com/Altinity/clickhouse-operator)
Configuration management
- [puppet](https://puppet.com)
- [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse)
- [mfedotov/clickhouse](https://forge.puppet.com/mfedotov/clickhouse)
Monitoring | {"source_file": "integrations.md"} | [
-0.027125904336571693,
-0.08467759191989899,
-0.06553833931684494,
-0.01618579588830471,
-0.038207195699214935,
-0.06449784338474274,
0.02824496291577816,
0.013018411584198475,
-0.06692085415124893,
0.0015796852530911565,
0.03304428979754448,
-0.024552475661039352,
0.12375915050506592,
-0.... |
0b34360a-12c6-41e0-9e26-8b5750693f4b | - [puppet](https://puppet.com)
- [innogames/clickhouse](https://forge.puppet.com/innogames/clickhouse)
- [mfedotov/clickhouse](https://forge.puppet.com/mfedotov/clickhouse)
Monitoring
- [Graphite](https://graphiteapp.org)
- [graphouse](https://github.com/ClickHouse/graphouse)
- [carbon-clickhouse](https://github.com/lomik/carbon-clickhouse)
- [graphite-clickhouse](https://github.com/lomik/graphite-clickhouse)
- [graphite-ch-optimizer](https://github.com/innogames/graphite-ch-optimizer) - optimizes staled partitions in [\*GraphiteMergeTree](/engines/table-engines/mergetree-family/graphitemergetree) if rules from [rollup configuration](../../engines/table-engines/mergetree-family/graphitemergetree.md#rollup-configuration) could be applied
- [Grafana](https://grafana.com/)
- [clickhouse-grafana](https://github.com/Altinity/clickhouse-grafana)
- [Prometheus](https://prometheus.io/)
- [clickhouse_exporter](https://github.com/f1yegor/clickhouse_exporter)
- [PromHouse](https://github.com/Percona-Lab/PromHouse)
- [clickhouse_exporter](https://github.com/hot-wifi/clickhouse_exporter) (uses [Go client](https://github.com/kshvakov/clickhouse/))
- [Nagios](https://www.nagios.org/)
- [check_clickhouse](https://github.com/exogroup/check_clickhouse/)
- [check_clickhouse.py](https://github.com/innogames/igmonplugins/blob/master/src/check_clickhouse.py)
- [Zabbix](https://www.zabbix.com)
- [clickhouse-zabbix-template](https://github.com/Altinity/clickhouse-zabbix-template)
- [Sematext](https://sematext.com/)
- [clickhouse integration](https://github.com/sematext/sematext-agent-integrations/tree/master/clickhouse)
Logging
- [rsyslog](https://www.rsyslog.com/)
- [omclickhouse](https://www.rsyslog.com/doc/master/configuration/modules/omclickhouse.html)
- [fluentd](https://www.fluentd.org)
- [loghouse](https://github.com/flant/loghouse) (for [Kubernetes](https://kubernetes.io))
- [logagent](https://www.sematext.com/logagent)
- [logagent output-plugin-clickhouse](https://sematext.com/docs/logagent/output-plugin-clickhouse/)
Geo
- [MaxMind](https://dev.maxmind.com/geoip/)
- [clickhouse-maxmind-geoip](https://github.com/AlexeyKupershtokh/clickhouse-maxmind-geoip)
AutoML
- [MindsDB](https://mindsdb.com/)
- [MindsDB](https://github.com/mindsdb/mindsdb) - Integrates with ClickHouse, making data from ClickHouse accessible to a diverse range of AI/ML models.
Programming language ecosystems {#programming-language-ecosystems}
Python
- [SQLAlchemy](https://www.sqlalchemy.org)
- [sqlalchemy-clickhouse](https://github.com/cloudflare/sqlalchemy-clickhouse) (uses [infi.clickhouse_orm](https://github.com/Infinidat/infi.clickhouse_orm))
- [PyArrow/Pandas](https://pandas.pydata.org)
- [Ibis](https://github.com/ibis-project/ibis)
PHP
- [Doctrine](https://www.doctrine-project.org/)
- [dbal-clickhouse](https://packagist.org/packages/friendsofdoctrine/dbal-clickhouse)
R | {"source_file": "integrations.md"} | [
-0.1009746789932251,
0.004851772915571928,
0.00817786157131195,
0.011456586420536041,
0.020380539819598198,
-0.064308762550354,
-0.02589709311723709,
-0.01313035562634468,
-0.10564658045768738,
0.058409225195646286,
0.05021653324365616,
-0.028368832543492317,
0.004541254602372646,
0.003765... |
a3871ae8-0143-4281-9fa7-8cf90c1826f6 | PHP
- [Doctrine](https://www.doctrine-project.org/)
- [dbal-clickhouse](https://packagist.org/packages/friendsofdoctrine/dbal-clickhouse)
R
- [dplyr](https://db.rstudio.com/dplyr/)
- [RClickHouse](https://github.com/IMSMWU/RClickHouse) (uses [clickhouse-cpp](https://github.com/artpaul/clickhouse-cpp))
Java
- [Hadoop](http://hadoop.apache.org)
- [clickhouse-hdfs-loader](https://github.com/jaykelin/clickhouse-hdfs-loader) (uses [JDBC](../../sql-reference/table-functions/jdbc.md))
Scala
- [Akka](https://akka.io)
- [clickhouse-scala-client](https://github.com/crobox/clickhouse-scala-client)
C#
- [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview)
- [ClickHouse.Ado](https://github.com/killwort/ClickHouse-Net)
- [ClickHouse.Client](https://github.com/DarkWanderer/ClickHouse.Client)
- [ClickHouse.Net](https://github.com/ilyabreev/ClickHouse.Net)
- [ClickHouse.Net.Migrations](https://github.com/ilyabreev/ClickHouse.Net.Migrations)
- [Linq To DB](https://github.com/linq2db/linq2db)
Elixir
- [Ecto](https://github.com/elixir-ecto/ecto)
- [clickhouse_ecto](https://github.com/appodeal/clickhouse_ecto)
Ruby
- [Ruby on Rails](https://rubyonrails.org/)
- [activecube](https://github.com/bitquery/activecube)
- [ActiveRecord](https://github.com/PNixx/clickhouse-activerecord)
- [GraphQL](https://github.com/graphql)
- [activecube-graphql](https://github.com/bitquery/activecube-graphql) | {"source_file": "integrations.md"} | [
-0.0783313438296318,
-0.07240021973848343,
-0.08312227576971054,
-0.035608962178230286,
-0.037516843527555466,
-0.03677879646420479,
-0.08244458585977554,
0.003925834782421589,
-0.059032198041677475,
0.02964567020535469,
0.028483858332037926,
-0.006317782215774059,
0.014311481267213821,
-0... |
9165e5d0-f117-49a1-95e8-b8198e4c606c | description: 'Overview of available third-party client libraries for different programming
languages'
sidebar_label: 'Client Libraries'
sidebar_position: 26
slug: /interfaces/third-party/client-libraries
title: 'Client Libraries from Third-party Developers'
doc_type: 'reference'
Client libraries from third-party developers
:::note
ClickHouse Inc does
not
maintain the libraries listed below and hasn't done any extensive testing to ensure their quality.
:::
Python {#python}
Moose OLAP
infi.clickhouse_orm
clickhouse-driver
clickhouse-client
aiochclient
asynch
PHP {#php}
smi2/phpclickhouse
8bitov/clickhouse-php-client
bozerkins/clickhouse-client
simpod/clickhouse-client
seva-code/php-click-house-client
SeasClick C++ client
one-ck
glushkovds/phpclickhouse-laravel
glushkovds/php-clickhouse-schema-builder
kolya7k ClickHouse PHP extension
hyvor/clickhouse-php
Go {#go}
clickhouse
go-clickhouse
chconn
mailrugo-clickhouse
golang-clickhouse
uptrace/go-clickhouse
Swift {#swift}
ClickHouseNIO
ClickHouseVapor ORM
NodeJs {#nodejs}
Moose OLAP
clickhouse (NodeJs)
node-clickhouse
nestjs-clickhouse
clickhouse-client
node-clickhouse-orm
clickhouse-ts
clickcache
Perl {#perl}
perl-DBD-ClickHouse
HTTP-ClickHouse
AnyEvent-ClickHouse
Ruby {#ruby}
ClickHouse (Ruby)
clickhouse-activerecord
Rust {#rust}
clickhouse.rs
clickhouse-rs
Klickhouse
R {#r}
RClickHouse
Java {#java}
clickhouse-client-java
clickhouse-client
Scala {#scala}
clickhouse-scala-client
Kotlin {#kotlin}
AORM
C# {#c}
Octonica.ClickHouseClient
ClickHouse.Ado
ClickHouse.Client
ClickHouse.Net
Elixir {#elixir}
clickhousex
pillar
ecto_ch
req_ch
Nim {#nim}
nim-clickhouse
Haskell {#haskell}
hdbc-clickhouse
ClickHaskell | {"source_file": "client-libraries.md"} | [
-0.12021806091070175,
-0.06139803305268288,
-0.04112749546766281,
-0.04279126226902008,
0.03273053839802742,
-0.036790020763874054,
-0.0013927805703133345,
-0.002428022213280201,
-0.014938749372959137,
-0.079933300614357,
0.018853668123483658,
0.010664827190339565,
-0.012394997291266918,
-... |
dfdeb4b9-cc6d-486a-a3a1-6c7c350dccfb | description: 'Overview of third-party tools, libraries and integrations available
for ClickHouse'
sidebar_position: 24
slug: /interfaces/third-party/
toc_folder_title: 'Third-Party'
title: 'Third-Party Interfaces'
doc_type: 'landing-page'
Third-party interfaces
This is a collection of links to third-party tools that provide some sort of interface to ClickHouse. It can be either visual interface, command-line interface or an API:
Client libraries
Integrations
GUI
Proxies
:::note
Generic tools that support common API like
ODBC
or
JDBC
usually can work with ClickHouse as well, but are not listed here because there are way too many of them.
::: | {"source_file": "index.md"} | [
-0.0937708169221878,
-0.12188712507486343,
-0.05128944292664528,
-0.025500163435935974,
0.009187037125229836,
-0.003538077464327216,
0.00466538593173027,
-0.018419237807393074,
-0.07453431934118271,
-0.0037722515407949686,
0.022441046312451363,
0.021781092509627342,
0.025206105783581734,
-... |
d0f27a63-b9bd-409a-b446-9bee0c90b474 | description: 'Describes available third-party proxy solutions for ClickHouse'
sidebar_label: 'Proxies'
sidebar_position: 29
slug: /interfaces/third-party/proxy
title: 'Proxy Servers from Third-party Developers'
doc_type: 'reference'
Proxy servers from third-party developers
chproxy {#chproxy}
chproxy
, is an HTTP proxy and load balancer for ClickHouse database.
Features:
Per-user routing and response caching.
Flexible limits.
Automatic SSL certificate renewal.
Implemented in Go.
KittenHouse {#kittenhouse}
KittenHouse
is designed to be a local proxy between ClickHouse and application server in case it's impossible or inconvenient to buffer INSERT data on your application side.
Features:
In-memory and on-disk data buffering.
Per-table routing.
Load-balancing and health checking.
Implemented in Go.
ClickHouse-Bulk {#clickhouse-bulk}
ClickHouse-Bulk
is a simple ClickHouse insert collector.
Features:
Group requests and send by threshold or interval.
Multiple remote servers.
Basic authentication.
Implemented in Go. | {"source_file": "proxy.md"} | [
-0.02635164000093937,
-0.029561126604676247,
-0.052823442965745926,
-0.04201970994472504,
-0.13380739092826843,
-0.05599578842520714,
-0.01180877536535263,
-0.03641856461763382,
-0.059818148612976074,
-0.0371381975710392,
0.0006641038926318288,
0.03953520208597183,
0.060676511377096176,
-0... |
ec78ce2e-d2e7-4ba6-b82e-67627824a5bb | alias: []
description: 'Documentation for the LineAsStringWithNames format'
input_format: true
keywords: ['LineAsStringWithNames']
output_format: true
slug: /interfaces/formats/LineAsStringWithNames
title: 'LineAsStringWithNames'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
LineAsStringWithNames
format is similar to the
LineAsString
format but prints the header row with column names.
Example usage {#example-usage}
```sql title="Query"
CREATE TABLE example (
name String,
value Int32
)
ENGINE = Memory;
INSERT INTO example VALUES ('John', 30), ('Jane', 25), ('Peter', 35);
SELECT * FROM example FORMAT LineAsStringWithNames;
```
response title="Response"
name value
John 30
Jane 25
Peter 35
Format settings {#format-settings} | {"source_file": "LineAsStringWithNames.md"} | [
-0.06383541971445084,
0.04437508061528206,
-0.04810044914484024,
0.037562284618616104,
-0.10320975631475449,
-0.01906702108681202,
0.06054799258708954,
0.11865975707769394,
-0.01061322633177042,
0.008911716751754284,
-0.03183950483798981,
-0.07371709495782852,
0.10750866681337357,
-0.06216... |
6e68ed3e-9a7d-4598-b790-96433392b231 | alias: []
description: 'Documentation for the LineAsStringWithNamesAndTypes format'
input_format: false
keywords: ['LineAsStringWithNamesAndTypes']
output_format: true
slug: /interfaces/formats/LineAsStringWithNamesAndTypes
title: 'LineAsStringWithNamesAndTypes'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
LineAsStringWithNames
format is similar to the
LineAsString
format
but prints two header rows: one with column names, the other with types.
Example usage {#example-usage}
```sql
CREATE TABLE example (
name String,
value Int32
)
ENGINE = Memory;
INSERT INTO example VALUES ('John', 30), ('Jane', 25), ('Peter', 35);
SELECT * FROM example FORMAT LineAsStringWithNamesAndTypes;
```
response title="Response"
name value
String Int32
John 30
Jane 25
Peter 35
Format settings {#format-settings} | {"source_file": "LineAsStringWithNamesAndTypes.md"} | [
-0.0644397884607315,
0.02083173394203186,
-0.009518914856016636,
0.030921749770641327,
-0.10288193821907043,
-0.03950021043419838,
0.09179401397705078,
0.10196812450885773,
-0.016739463433623314,
-0.004804554395377636,
-0.03578082099556923,
-0.07484816759824753,
0.116002656519413,
-0.04110... |
8ce76097-cd63-4878-b8df-765c681720da | alias: []
description: 'Documentation for the LineAsString format'
input_format: true
keywords: ['LineAsString']
output_format: true
slug: /interfaces/formats/LineAsString
title: 'LineAsString'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
LineAsString
format interprets every line of input data as a single string value.
This format can only be parsed for a table with a single field of type
String
.
The remaining columns must be set to
DEFAULT
,
MATERIALIZED
, or omitted.
Example usage {#example-usage}
sql title="Query"
DROP TABLE IF EXISTS line_as_string;
CREATE TABLE line_as_string (field String) ENGINE = Memory;
INSERT INTO line_as_string FORMAT LineAsString "I love apple", "I love banana", "I love orange";
SELECT * FROM line_as_string;
text title="Response"
ββfieldββββββββββββββββββββββββββββββββββββββββββββββ
β "I love apple", "I love banana", "I love orange"; β
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Format settings {#format-settings} | {"source_file": "LineAsString.md"} | [
-0.024232638999819756,
-0.01473273802548647,
-0.009823578409850597,
0.03912999853491783,
-0.12164278328418732,
-0.005127869546413422,
0.07456942647695541,
0.11490090191364288,
0.003363408148288727,
-0.0014351130230352283,
-0.04523048549890518,
-0.05810791626572609,
0.09182259440422058,
-0.... |
f1e7a6e1-d667-422f-9759-14bdb1cf21fc | alias: []
description: 'Documentation for the ArrowStream format'
input_format: true
keywords: ['ArrowStream']
output_format: true
slug: /interfaces/formats/ArrowStream
title: 'ArrowStream'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
ArrowStream
is Apache Arrow's "stream mode" format. It is designed for in-memory stream processing.
Example usage {#example-usage}
Format settings {#format-settings} | {"source_file": "ArrowStream.md"} | [
0.012425658293068409,
-0.057662252336740494,
-0.012005418539047241,
-0.003025483340024948,
-0.04158131033182144,
-0.004899292718619108,
-0.004234686493873596,
0.0446588397026062,
0.005173471290618181,
-0.071996308863163,
-0.016835356131196022,
0.055748771876096725,
0.0338105708360672,
0.03... |
61f3444a-6806-4df9-8c83-ddceec5b4c2e | alias: []
description: 'Documentation for the Arrow format'
input_format: true
keywords: ['Arrow']
output_format: true
slug: /interfaces/formats/Arrow
title: 'Arrow'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Apache Arrow
comes with two built-in columnar storage formats. ClickHouse supports read and write operations for these formats.
Arrow
is Apache Arrow's "file mode" format. It is designed for in-memory random access.
Data types matching {#data-types-matching}
The table below shows the supported data types and how they correspond to ClickHouse
data types
in
INSERT
and
SELECT
queries. | {"source_file": "Arrow.md"} | [
0.006726490333676338,
-0.07502484321594238,
-0.061511095613241196,
0.050685785710811615,
-0.05962108448147774,
-0.04167171195149422,
0.0036465406883507967,
0.011729237623512745,
0.032324016094207764,
-0.022943472489714622,
0.013984043151140213,
0.08358551561832428,
0.05886286869645119,
-0.... |
e100300c-d283-45f4-8ec6-a37ba9618f1b | | Arrow data type (
INSERT
) | ClickHouse data type | Arrow data type (
SELECT
) |
|-----------------------------------------|------------------------------------------------------------------------------------------------------------|----------------------------|
|
BOOL
|
Bool
|
BOOL
|
|
UINT8
,
BOOL
|
UInt8
|
UINT8
|
|
INT8
|
Int8
/
Enum8
|
INT8
|
|
UINT16
|
UInt16
|
UINT16
|
|
INT16
|
Int16
/
Enum16
|
INT16
|
|
UINT32
|
UInt32
|
UINT32
|
|
INT32
|
Int32
|
INT32
|
|
UINT64
|
UInt64
|
UINT64
|
|
INT64
|
Int64
|
INT64
|
|
FLOAT
,
HALF_FLOAT
|
Float32
|
FLOAT32
|
|
DOUBLE
|
Float64
|
FLOAT64
|
|
DATE32
|
Date32
|
UINT16
|
|
DATE64
|
DateTime
|
UINT32
|
|
TIMESTAMP
,
TIME32
,
TIME64
|
DateTime64
|
TIMESTAMP
|
|
STRING
,
BINARY
|
String
|
BINARY
|
|
STRING
,
BINARY
,
FIXED_SIZE_BINARY
|
FixedString
|
FIXED_SIZE_BINARY
|
|
DECIMAL
|
Decimal
|
DECIMAL
|
|
DECIMAL256
|
Decimal256
|
DECIMAL256
|
|
LIST
|
Array
|
LIST
|
|
STRUCT
|
Tuple
|
STRUCT
|
| | {"source_file": "Arrow.md"} | [
0.05654081329703331,
-0.016739042475819588,
-0.026810474693775177,
0.033542126417160034,
-0.07955534756183624,
-0.05700656771659851,
0.05882402881979942,
-0.035708095878362656,
0.00895437691360712,
0.016300613060593605,
0.0959007665514946,
-0.05077432468533516,
0.08396513760089874,
-0.0588... |
23b4592b-9811-4c3a-9d7e-fc4293c66691 | LIST
|
|
STRUCT
|
Tuple
|
STRUCT
|
|
MAP
|
Map
|
MAP
|
|
UINT32
|
IPv4
|
UINT32
|
|
FIXED_SIZE_BINARY
,
BINARY
|
IPv6
|
FIXED_SIZE_BINARY
|
|
FIXED_SIZE_BINARY
,
BINARY
|
Int128/UInt128/Int256/UInt256
|
FIXED_SIZE_BINARY
| | {"source_file": "Arrow.md"} | [
0.10286278277635574,
0.07464812695980072,
-0.04305563122034073,
-0.05927663668990135,
0.031140945851802826,
-0.02860947884619236,
-0.0195930078625679,
0.031153365969657898,
-0.1348375678062439,
-0.020457781851291656,
0.03649017959833145,
-0.03967136889696121,
-0.03095397911965847,
-0.02173... |
9af5bad4-54e9-438e-b1a8-40c74ff26ab3 | Arrays can be nested and can have a value of the
Nullable
type as an argument.
Tuple
and
Map
types can also be nested.
The
DICTIONARY
type is supported for
INSERT
queries, and for
SELECT
queries there is an
output_format_arrow_low_cardinality_as_dictionary
setting that allows to output
LowCardinality
type as a
DICTIONARY
type.
Unsupported Arrow data types:
-
FIXED_SIZE_BINARY
-
JSON
-
UUID
-
ENUM
.
The data types of ClickHouse table columns do not have to match the corresponding Arrow data fields. When inserting data, ClickHouse interprets data types according to the table above and then
casts
the data to the data type set for the ClickHouse table column.
Example usage {#example-usage}
Inserting data {#inserting-data}
You can insert Arrow data from a file into ClickHouse table using the following command:
bash
$ cat filename.arrow | clickhouse-client --query="INSERT INTO some_table FORMAT Arrow"
Selecting data {#selecting-data}
You can select data from a ClickHouse table and save it into some file in the Arrow format using the following command:
bash
$ clickhouse-client --query="SELECT * FROM {some_table} FORMAT Arrow" > {filename.arrow}
Format settings {#format-settings} | {"source_file": "Arrow.md"} | [
0.07236166298389435,
-0.04321640729904175,
-0.09229627996683121,
0.06185482442378998,
-0.08149958401918411,
-0.05837024748325348,
0.05474225804209709,
-0.009578565135598183,
-0.09569333493709564,
-0.02379262074828148,
0.041446998715400696,
-0.010228083468973637,
0.04220421984791756,
-0.005... |
24e3fc0f-2090-43cb-a86e-346dbc888f30 | Format settings {#format-settings}
| Setting | Description | Default |
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|--------------|
|
input_format_arrow_allow_missing_columns
| Allow missing columns while reading Arrow input formats |
1
|
|
input_format_arrow_case_insensitive_column_matching
| Ignore case when matching Arrow columns with CH columns. |
0
|
|
input_format_arrow_import_nested
| Obsolete setting, does nothing. |
0
|
|
input_format_arrow_skip_columns_with_unsupported_types_in_schema_inference
| Skip columns with unsupported types while schema inference for format Arrow |
0
|
|
output_format_arrow_compression_method
| Compression method for Arrow output format. Supported codecs: lz4_frame, zstd, none (uncompressed) |
lz4_frame
|
|
output_format_arrow_fixed_string_as_fixed_byte_array
| Use Arrow FIXED_SIZE_BINARY type instead of Binary for FixedString columns. |
1
|
|
output_format_arrow_low_cardinality_as_dictionary
| Enable output LowCardinality type as Dictionary Arrow type |
0
|
|
output_format_arrow_string_as_string
| Use Arrow String type instead of Binary for String columns |
1
|
|
output_format_arrow_use_64_bit_indexes_for_dictionary
| Always use 64 bit integers for dictionary indexes in Arrow format |
0
|
|
output_format_arrow_use_signed_indexes_for_dictionary
| Use signed integers for dictionary indexes in Arrow format |
1
| | {"source_file": "Arrow.md"} | [
0.04530865699052811,
0.034148428589105606,
-0.04679162800312042,
0.05231098458170891,
-0.08309914916753769,
0.06257691979408264,
-0.02220136672258377,
0.08141206949949265,
0.014146342873573303,
-0.00604072492569685,
-0.006007898133248091,
-0.03411654010415077,
0.013078879565000534,
-0.0590... |
72184bb5-78f2-4ef6-ae5d-cd4f4d05bb99 | alias: []
description: 'Documentation for the Template format'
input_format: true
keywords: ['Template']
output_format: true
slug: /interfaces/formats/Template
title: 'Template'
doc_type: 'guide'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
For cases where you need more customization than other standard formats offer,
the
Template
format allows the user to specify their own custom format string with placeholders for values,
and specifying escaping rules for the data.
It uses the following settings:
| Setting | Description |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
|
format_template_row
| Specifies the path to the file which contains format strings for rows. |
|
format_template_resultset
| Specifies the path to the file which contains format strings for rows |
|
format_template_rows_between_delimiter
| Specifies the delimiter between rows, which is printed (or expected) after every row except the last one (
\n
by default) |
|
format_template_row_format
| Specifies the format string for rows
in-line
. |
|
format_template_resultset_format
| Specifies the result set format string
in-line
. |
| Some settings of other formats (e.g.
output_format_json_quote_64bit_integers
when using
JSON
escaping | |
Settings and escaping rules {#settings-and-escaping-rules}
format_template_row {#format_template_row}
The setting
format_template_row
specifies the path to the file which contains format strings for rows with the following syntax:
text
delimiter_1${column_1:serializeAs_1}delimiter_2${column_2:serializeAs_2} ... delimiter_N
Where: | {"source_file": "Template.md"} | [
-0.007487548515200615,
0.09945366531610489,
0.07124112546443939,
0.03632158413529396,
-0.02062622457742691,
0.03988403081893921,
-0.013729175552725792,
0.07243472337722778,
0.023197941482067108,
-0.000731942243874073,
-0.06953248381614685,
-0.03321003541350365,
0.06767931580543518,
0.00914... |
35a8a1c7-29a2-4fda-a7a1-66d562034a1e | text
delimiter_1${column_1:serializeAs_1}delimiter_2${column_2:serializeAs_2} ... delimiter_N
Where:
| Part of syntax | Description |
|----------------|-------------------------------------------------------------------------------------------------------------------|
|
delimiter_i
| A delimiter between values (
$
symbol can be escaped as
$$
) |
|
column_i
| The name or index of a column whose values are to be selected or inserted (if empty, then the column will be skipped) |
|
serializeAs_i
| An escaping rule for the column values. |
The following escaping rules are supported:
| Escaping Rule | Description |
|----------------------|------------------------------------------|
|
CSV
,
JSON
,
XML
| Similar to the formats of the same names |
|
Escaped
| Similar to
TSV
|
|
Quoted
| Similar to
Values
|
|
Raw
| Without escaping, similar to
TSVRaw
|
|
None
| No escaping rule - see note below |
:::note
If an escaping rule is omitted, then
None
will be used.
XML
is suitable only for output.
:::
Let's look at an example. Given the following format string:
text
Search phrase: ${s:Quoted}, count: ${c:Escaped}, ad price: $$${p:JSON};
The following values will be printed (if using
SELECT
) or expected (if using
INPUT
),
between columns
Search phrase:
,
, count:
,
, ad price: $
and
;
delimiters respectively:
s
(with escape rule
Quoted
)
c
(with escape rule
Escaped
)
p
(with escape rule
JSON
)
For example:
If
INSERT
ing, the line below matches the expected template and would read values
bathroom interior design
,
2166
,
$3
into columns
Search phrase
,
count
,
ad price
.
If
SELECT
ing the line below is the output, assuming that values
bathroom interior design
,
2166
,
$3
are already stored in a table under columns
Search phrase
,
count
,
ad price
.
yaml
Search phrase: 'bathroom interior design', count: 2166, ad price: $3;
format_template_rows_between_delimiter {#format_template_rows_between_delimiter}
The setting
format_template_rows_between_delimiter
setting specifies the delimiter between rows, which is printed (or expected) after every row except the last one (
\n
by default)
format_template_resultset {#format_template_resultset}
The setting
format_template_resultset
specifies the path to the file, which contains a format string for the result set. | {"source_file": "Template.md"} | [
0.007227152120321989,
0.05631384998559952,
-0.02757796086370945,
0.042429301887750626,
-0.023777514696121216,
-0.003034044522792101,
0.031964339315891266,
0.01835237629711628,
0.006989817135035992,
0.010674080811440945,
0.036741048097610474,
-0.09395989775657654,
0.03530126065015793,
-0.10... |
3ab4a172-5b73-49eb-8eb1-ec30281d53d0 | format_template_resultset {#format_template_resultset}
The setting
format_template_resultset
specifies the path to the file, which contains a format string for the result set.
The format string for the result set has the same syntax as a format string for rows.
It allows for specifying a prefix, a suffix and a way to print some additional information and contains the following placeholders instead of column names:
data
is the rows with data in
format_template_row
format, separated by
format_template_rows_between_delimiter
. This placeholder must be the first placeholder in the format string.
totals
is the row with total values in
format_template_row
format (when using WITH TOTALS).
min
is the row with minimum values in
format_template_row
format (when extremes are set to 1).
max
is the row with maximum values in
format_template_row
format (when extremes are set to 1).
rows
is the total number of output rows.
rows_before_limit
is the minimal number of rows there would have been without LIMIT. Output only if the query contains LIMIT. If the query contains GROUP BY, rows_before_limit_at_least is the exact number of rows there would have been without a LIMIT.
time
is the request execution time in seconds.
rows_read
is the number of rows has been read.
bytes_read
is the number of bytes (uncompressed) has been read.
The placeholders
data
,
totals
,
min
and
max
must not have escaping rule specified (or
None
must be specified explicitly). The remaining placeholders may have any escaping rule specified.
:::note
If the
format_template_resultset
setting is an empty string,
${data}
is used as the default value.
:::
For insert queries format allows skipping some columns or fields if prefix or suffix (see example).
In-line specification {#inline_specification}
Often times it is challenging or not possible to deploy the format configurations
(set by
format_template_row
,
format_template_resultset
) for the template format to a directory on all nodes in a cluster.
Furthermore, the format may be so trivial that it does not require being placed in a file.
For these cases,
format_template_row_format
(for
format_template_row
) and
format_template_resultset_format
(for
format_template_resultset
) can be used to set the template string directly in the query,
rather than as a path to the file which contains it.
:::note
The rules for format strings and escape sequences are the same as those for:
-
format_template_row
when using
format_template_row_format
.
-
format_template_resultset
when using
format_template_resultset_format
.
:::
Example usage {#example-usage}
Let's look at two examples of how we can use the
Template
format, first for selecting data and then for inserting data.
Selecting data {#selecting-data} | {"source_file": "Template.md"} | [
0.0098393764346838,
0.0867355465888977,
-0.07836905866861343,
0.03053954243659973,
-0.05093444138765335,
0.03470810130238533,
-0.041309602558612823,
0.07941126823425293,
-0.015715019777417183,
0.034210462123155594,
0.03405880928039551,
0.004849820863455534,
0.05925089120864868,
-0.12825044... |
9d403ac0-0261-45fb-a7a9-31f9e5fb344c | Example usage {#example-usage}
Let's look at two examples of how we can use the
Template
format, first for selecting data and then for inserting data.
Selecting data {#selecting-data}
sql
SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase ORDER BY c DESC LIMIT 5 FORMAT Template SETTINGS
format_template_resultset = '/some/path/resultset.format', format_template_row = '/some/path/row.format', format_template_rows_between_delimiter = '\n '
```text title="/some/path/resultset.format"
Search phrases
Search phrases
Search phrase
Count
${data}
Max
${max}
Processed ${rows_read:XML} rows in ${time:XML} sec
```
```text title="/some/path/row.format"
${0:XML}
${1:XML}
```
Result:
```html
Search phrases
Search phrases
Search phrase
Count
8267016
bathroom interior design
2166
clickhouse
1655
spring 2014 fashion
1549
freeform photos
1480
Max
8873898
Processed 3095973 rows in 0.1569913 sec
```
Inserting data {#inserting-data}
text
Some header
Page views: 5, User id: 4324182021466249494, Useless field: hello, Duration: 146, Sign: -1
Page views: 6, User id: 4324182021466249494, Useless field: world, Duration: 185, Sign: 1
Total rows: 2
sql
INSERT INTO UserActivity SETTINGS
format_template_resultset = '/some/path/resultset.format', format_template_row = '/some/path/row.format'
FORMAT Template
text title="/some/path/resultset.format"
Some header\n${data}\nTotal rows: ${:CSV}\n
text title="/some/path/row.format"
Page views: ${PageViews:CSV}, User id: ${UserID:CSV}, Useless field: ${:CSV}, Duration: ${Duration:CSV}, Sign: ${Sign:CSV}
PageViews
,
UserID
,
Duration
and
Sign
inside placeholders are names of columns in the table. Values after
Useless field
in rows and after
\nTotal rows:
in suffix will be ignored.
All delimiters in the input data must be strictly equal to delimiters in specified format strings.
In-line specification {#in-line-specification}
Tired of manually formatting markdown tables? In this example we'll look at how we can use the
Template
format and in-line specification settings to achieve a simple task -
SELECT
ing the names of some ClickHouse formats from the
system.formats
table and formatting them as a markdown table. This can be easily achieved using the
Template
format and settings
format_template_row_format
and
format_template_resultset_format
. | {"source_file": "Template.md"} | [
0.004421605262905359,
0.042554210871458054,
-0.022540898993611336,
0.09903563559055328,
-0.046893246471881866,
0.06303033977746964,
-0.0037288591265678406,
0.06483455002307892,
0.0273425430059433,
0.002571746939793229,
0.06671800464391708,
0.0077669862657785416,
0.06657387316226959,
-0.106... |
d1863906-086a-488a-b28a-7501027ddaff | In previous examples we specified the result-set and row format strings in separate files, with the paths to those files specified using the
format_template_resultset
and
format_template_row
settings respectively. Here we'll do it in-line because our template is trivial, consisting only of a few
|
and
-
to make the markdown table. We'll specify our result-set template string using the setting
format_template_resultset_format
. To make the table header we've added
|ClickHouse Formats|\n|---|\n
before
${data}
. We use setting
format_template_row_format
to specify the template string
|`{0:XML}`|
for our rows. The
Template
format will insert our rows with the given format into placeholder
${data}
. In this example we have only one column, but if you wanted to add more you could do so by adding
{1:XML}
,
{2:XML}
... etc to your row template string, choosing the escaping rule as appropriate. In this example we've gone with escaping rule
XML
.
sql title="Query"
WITH formats AS
(
SELECT * FROM system.formats
ORDER BY rand()
LIMIT 5
)
SELECT * FROM formats
FORMAT Template
SETTINGS
format_template_row_format='|`${0:XML}`|',
format_template_resultset_format='|ClickHouse Formats|\n|---|\n${data}\n'
Look at that! We've saved ourselves the trouble of having to manually add all those
|
s and
-
s to make that markdown table:
response title="Response"
|ClickHouse Formats|
|---|
|`BSONEachRow`|
|`CustomSeparatedWithNames`|
|`Prometheus`|
|`DWARF`|
|`Avro`| | {"source_file": "Template.md"} | [
0.036675866693258286,
0.05297248810529709,
-0.051869556307792664,
0.06538797169923782,
-0.06963083148002625,
0.0775706097483635,
0.014284840784966946,
0.08063559979200363,
-0.04479030892252922,
0.028478343039751053,
-0.0016651537735015154,
-0.01163337379693985,
0.07747816294431686,
-0.1050... |
c5cc1c19-a7eb-4a9d-a096-4ff211cd78ee | alias: []
description: 'Documentation for the TemplateIgnoreSpaces format'
input_format: true
keywords: ['TemplateIgnoreSpaces']
output_format: false
slug: /interfaces/formats/TemplateIgnoreSpaces
title: 'TemplateIgnoreSpaces'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Similar to [
Template
], but skips whitespace characters between delimiters and values in the input stream.
However, if format strings contain whitespace characters, these characters will be expected in the input stream.
Also allows specifying empty placeholders (
${}
or
${:None}
) to split some delimiter into separate parts to ignore spaces between them.
Such placeholders are used only for skipping whitespace characters.
It's possible to read
JSON
using this format if the values of columns have the same order in all rows.
:::note
This format is suitable only for input.
:::
Example usage {#example-usage}
The following request can be used for inserting data from its output example of format
JSON
:
sql
INSERT INTO table_name
SETTINGS
format_template_resultset = '/some/path/resultset.format',
format_template_row = '/some/path/row.format',
format_template_rows_between_delimiter = ','
FORMAT TemplateIgnoreSpaces
text title="/some/path/resultset.format"
{${}"meta"${}:${:JSON},${}"data"${}:${}[${data}]${},${}"totals"${}:${:JSON},${}"extremes"${}:${:JSON},${}"rows"${}:${:JSON},${}"rows_before_limit_at_least"${}:${:JSON}${}}
text title="/some/path/row.format"
{${}"SearchPhrase"${}:${}${phrase:JSON}${},${}"c"${}:${}${cnt:JSON}${}}
Format settings {#format-settings} | {"source_file": "TemplateIgnoreSpaces.md"} | [
-0.04891256242990494,
0.04220372065901756,
0.04862832650542259,
0.0024571807589381933,
0.02611725404858589,
0.02565004862844944,
-0.017434921115636826,
0.0698501393198967,
0.07499547302722931,
-0.047342803329229355,
-0.008888826705515385,
-0.021729836240410805,
0.032303337007761,
0.0628862... |
a139489f-d633-4c77-8712-033139cbb0ac | alias: []
description: 'Documentation for the RowBinaryWithNamesAndTypes format'
input_format: true
keywords: ['RowBinaryWithNamesAndTypes']
output_format: true
slug: /interfaces/formats/RowBinaryWithNamesAndTypes
title: 'RowBinaryWithNamesAndTypes'
doc_type: 'reference'
import RowBinaryFormatSettings from './_snippets/common-row-binary-format-settings.md'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Similar to the
RowBinary
format, but with added header:
LEB128
-encoded number of columns (N).
N
String
s specifying column names.
N
String
s specifying column types.
Example usage {#example-usage}
Format settings {#format-settings}
:::note
If setting
input_format_with_names_use_header
is set to 1,
the columns from input data will be mapped to the columns from the table by their names, columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to 1.
Otherwise, the first row will be skipped.
If setting
input_format_with_types_use_header
is set to
1
,
the types from input data will be compared with the types of the corresponding columns from the table. Otherwise, the second row will be skipped.
::: | {"source_file": "RowBinaryWithNamesAndTypes.md"} | [
-0.025761505588889122,
0.01930908113718033,
-0.08753437548875809,
-0.010373692959547043,
-0.060509588569402695,
0.0106812110170722,
0.02996206283569336,
0.06379447877407074,
-0.09463214129209518,
0.0036702509969472885,
-0.07025031000375748,
-0.06132389232516289,
0.12170392274856567,
0.0046... |
d6707653-b3ac-4574-ae90-2ff9ac72a4ac | alias: []
description: 'Documentation for the RowBinaryWithDefaults format'
input_format: true
keywords: ['RowBinaryWithDefaults']
output_format: false
slug: /interfaces/formats/RowBinaryWithDefaults
title: 'RowBinaryWithDefaults'
doc_type: 'reference'
import RowBinaryFormatSettings from './_snippets/common-row-binary-format-settings.md'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Similar to the
RowBinary
format, but with an extra byte before each column that indicates if the default value should be used.
Example usage {#example-usage}
Examples:
sql title="Query"
SELECT * FROM FORMAT('RowBinaryWithDefaults', 'x UInt32 default 42, y UInt32', x'010001000000')
response title="Response"
βββxββ¬βyββ
β 42 β 1 β
ββββββ΄ββββ
For column
x
there is only one byte
01
that indicates that default value should be used and no other data after this byte is provided.
For column
y
data starts with byte
00
that indicates that column has actual value that should be read from the subsequent data
01000000
.
Format settings {#format-settings} | {"source_file": "RowBinaryWithDefaults.md"} | [
-0.02546810545027256,
0.01786162331700325,
-0.06682047247886658,
0.0214922484010458,
-0.06901606172323227,
-0.010944628156721592,
0.08614537119865417,
0.0324578583240509,
-0.05348987132310867,
-0.010124916210770607,
-0.062413282692432404,
-0.06101534143090248,
0.07459183782339096,
-0.00588... |
0644950f-698c-4690-92c1-e77853d71010 | description: 'Documentation for the RowBinaryWithNames format'
input_format: true
keywords: ['RowBinaryWithNames']
output_format: true
slug: /interfaces/formats/RowBinaryWithNames
title: 'RowBinaryWithNames'
doc_type: 'reference'
import RowBinaryFormatSettings from './_snippets/common-row-binary-format-settings.md'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Similar to the
RowBinary
format, but with added header:
LEB128
-encoded number of columns (N).
N
String
s specifying column names.
Example usage {#example-usage}
Format settings {#format-settings}
:::note
- If setting
input_format_with_names_use_header
is set to
1
,
the columns from input data will be mapped to the columns from the table by their names, columns with unknown names will be skipped.
- If setting
input_format_skip_unknown_fields
is set to
1
.
Otherwise, the first row will be skipped.
::: | {"source_file": "RowBinaryWithNames.md"} | [
-0.0390976145863533,
0.022823575884103775,
-0.09450485557317734,
0.01055888831615448,
-0.05239522084593773,
0.010830186307430267,
0.01283728051930666,
0.009274759329855442,
-0.09191344678401947,
-0.009882836602628231,
-0.052691273391246796,
-0.0669589638710022,
0.12810227274894714,
-0.0420... |
29efa31a-5f1c-43a8-a996-d67d454c8374 | alias: []
description: 'Documentation for the RowBinary format'
input_format: true
keywords: ['RowBinary']
output_format: true
slug: /interfaces/formats/RowBinary
title: 'RowBinary'
doc_type: 'reference'
import RowBinaryFormatSettings from './_snippets/common-row-binary-format-settings.md'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
RowBinary
format parses data by row in binary format.
Rows and values are listed consecutively, without separators.
Because data is in the binary format the delimiter after
FORMAT RowBinary
is strictly specified as follows:
Any number of whitespaces:
' '
(space - code
0x20
)
'\t'
(tab - code
0x09
)
'\f'
(form feed - code
0x0C
)
Followed by exactly one new line sequence:
Windows style
"\r\n"
or Unix style
'\n'
Immediately followed by binary data.
:::note
This format is less efficient than the
Native
format since it is row-based.
:::
For the following data types it is important to note that:
Integers
use fixed-length little-endian representation. For example,
UInt64
uses 8 bytes.
DateTime
is represented as
UInt32
containing the Unix timestamp as the value.
Date
is represented as a UInt16 object that contains the number of days since
1970-01-01
as the value.
String
is represented as a variable-width integer (varint) (unsigned
LEB128
), followed by the bytes of the string.
FixedString
is represented simply as a sequence of bytes.
Arrays
are represented as a variable-width integer (varint) (unsigned
LEB128
), followed by successive elements of the array.
For
NULL
support, an additional byte containing
1
or
0
is added before each
Nullable
value.
- If
1
, then the value is
NULL
and this byte is interpreted as a separate value.
- If
0
, the value after the byte is not
NULL
.
For a comparison of the
RowBinary
format and the
RawBlob
format see:
Raw Formats Comparison
Example usage {#example-usage}
Format settings {#format-settings} | {"source_file": "RowBinary.md"} | [
-0.024220872670412064,
0.015824219211935997,
-0.04894978180527687,
-0.021926963701844215,
-0.07151058316230774,
0.01046016439795494,
0.06104070693254471,
0.03738975524902344,
-0.05628461390733719,
0.00666275667026639,
-0.05623674765229225,
-0.05802870914340019,
0.0948212668299675,
-0.04378... |
7e12b625-a416-4e96-8493-35fa5a3c27fe | alias: []
description: 'Documentation for the CustomSeparatedWithNames format'
input_format: true
keywords: ['CustomSeparatedWithNames']
output_format: true
slug: /interfaces/formats/CustomSeparatedWithNames
title: 'CustomSeparatedWithNames'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Also prints the header row with column names, similar to
TabSeparatedWithNames
.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using the following txt file, named as
football.txt
:
text
row('date';'season';'home_team';'away_team';'home_team_goals';'away_team_goals'),row('2022-04-30';2021;'Sutton United';'Bradford City';1;4),row('2022-04-30';2021;'Swindon Town';'Barrow';2;1),row('2022-04-30';2021;'Tranmere Rovers';'Oldham Athletic';2;0),row('2022-05-02';2021;'Salford City';'Mansfield Town';2;2),row('2022-05-02';2021;'Port Vale';'Newport County';1;2),row('2022-05-07';2021;'Barrow';'Northampton Town';1;3),row('2022-05-07';2021;'Bradford City';'Carlisle United';2;0),row('2022-05-07';2021;'Bristol Rovers';'Scunthorpe United';7;0),row('2022-05-07';2021;'Exeter City';'Port Vale';0;1),row('2022-05-07';2021;'Harrogate Town A.F.C.';'Sutton United';0;2),row('2022-05-07';2021;'Hartlepool United';'Colchester United';0;2),row('2022-05-07';2021;'Leyton Orient';'Tranmere Rovers';0;1),row('2022-05-07';2021;'Mansfield Town';'Forest Green Rovers';2;2),row('2022-05-07';2021;'Newport County';'Rochdale';0;2),row('2022-05-07';2021;'Oldham Athletic';'Crawley Town';3;3),row('2022-05-07';2021;'Stevenage Borough';'Salford City';4;2),row('2022-05-07';2021;'Walsall';'Swindon Town';0;3)
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.txt' FORMAT CustomSeparatedWithNames;
Reading data {#reading-data}
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Read data using the
CustomSeparatedWithNames
format:
sql
SELECT *
FROM football
FORMAT CustomSeparatedWithNames
The output will be in the configured custom format: | {"source_file": "CustomSeparatedWithNames.md"} | [
0.012774956412613392,
0.0634988471865654,
-0.02458072081208229,
-0.0165682602673769,
0.00511466059833765,
0.03660382702946663,
0.052642542868852615,
0.10030397772789001,
-0.008123290725052357,
0.012158939614892006,
0.006080163177102804,
-0.07842638343572617,
0.10166802257299423,
-0.0076740... |
a70f9953-b12f-47bf-a7dc-4965aa2a49e9 | Read data using the
CustomSeparatedWithNames
format:
sql
SELECT *
FROM football
FORMAT CustomSeparatedWithNames
The output will be in the configured custom format:
text
row('date';'season';'home_team';'away_team';'home_team_goals';'away_team_goals'),row('2022-04-30';2021;'Sutton United';'Bradford City';1;4),row('2022-04-30';2021;'Swindon Town';'Barrow';2;1),row('2022-04-30';2021;'Tranmere Rovers';'Oldham Athletic';2;0),row('2022-05-02';2021;'Port Vale';'Newport County';1;2),row('2022-05-02';2021;'Salford City';'Mansfield Town';2;2),row('2022-05-07';2021;'Barrow';'Northampton Town';1;3),row('2022-05-07';2021;'Bradford City';'Carlisle United';2;0),row('2022-05-07';2021;'Bristol Rovers';'Scunthorpe United';7;0),row('2022-05-07';2021;'Exeter City';'Port Vale';0;1),row('2022-05-07';2021;'Harrogate Town A.F.C.';'Sutton United';0;2),row('2022-05-07';2021;'Hartlepool United';'Colchester United';0;2),row('2022-05-07';2021;'Leyton Orient';'Tranmere Rovers';0;1),row('2022-05-07';2021;'Mansfield Town';'Forest Green Rovers';2;2),row('2022-05-07';2021;'Newport County';'Rochdale';0;2),row('2022-05-07';2021;'Oldham Athletic';'Crawley Town';3;3),row('2022-05-07';2021;'Stevenage Borough';'Salford City';4;2),row('2022-05-07';2021;'Walsall';'Swindon Town';0;3)
Format settings {#format-settings}
:::note
If setting
input_format_with_names_use_header
is set to
1
,
the columns from the input data will be mapped to the columns from the table by their names,
columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to
1
.
Otherwise, the first row will be skipped.
::: | {"source_file": "CustomSeparatedWithNames.md"} | [
0.07844570279121399,
0.013218039646744728,
-0.02821827493607998,
-0.02083205245435238,
0.022028813138604164,
0.06635988503694534,
0.005309621337801218,
0.0043865772895514965,
-0.025512656196951866,
0.014096599072217941,
0.02505369856953621,
-0.09019676595926285,
0.05574210360646248,
-0.039... |
16c44e6f-01cf-47cc-a761-1e141b41a3ca | alias: []
description: 'Documentation for the CustomSeparated format'
input_format: true
keywords: ['CustomSeparated']
output_format: true
slug: /interfaces/formats/CustomSeparated
title: 'CustomSeparated'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Similar to
Template
, but it prints or reads all names and types of columns and uses escaping rule from
format_custom_escaping_rule
setting and delimiters from the following settings:
format_custom_field_delimiter
format_custom_row_before_delimiter
format_custom_row_after_delimiter
format_custom_row_between_delimiter
format_custom_result_before_delimiter
format_custom_result_after_delimiter
:::note
It does not use escaping rules settings and delimiters from format strings.
:::
There is also the
CustomSeparatedIgnoreSpaces
format, which is similar to
TemplateIgnoreSpaces
.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using the following txt file, named as
football.txt
:
text
row('2022-04-30';2021;'Sutton United';'Bradford City';1;4),row('2022-04-30';2021;'Swindon Town';'Barrow';2;1),row('2022-04-30';2021;'Tranmere Rovers';'Oldham Athletic';2;0),row('2022-05-02';2021;'Salford City';'Mansfield Town';2;2),row('2022-05-02';2021;'Port Vale';'Newport County';1;2),row('2022-05-07';2021;'Barrow';'Northampton Town';1;3),row('2022-05-07';2021;'Bradford City';'Carlisle United';2;0),row('2022-05-07';2021;'Bristol Rovers';'Scunthorpe United';7;0),row('2022-05-07';2021;'Exeter City';'Port Vale';0;1),row('2022-05-07';2021;'Harrogate Town A.F.C.';'Sutton United';0;2),row('2022-05-07';2021;'Hartlepool United';'Colchester United';0;2),row('2022-05-07';2021;'Leyton Orient';'Tranmere Rovers';0;1),row('2022-05-07';2021;'Mansfield Town';'Forest Green Rovers';2;2),row('2022-05-07';2021;'Newport County';'Rochdale';0;2),row('2022-05-07';2021;'Oldham Athletic';'Crawley Town';3;3),row('2022-05-07';2021;'Stevenage Borough';'Salford City';4;2),row('2022-05-07';2021;'Walsall';'Swindon Town';0;3)
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.txt' FORMAT CustomSeparated;
Reading data {#reading-data}
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Read data using the
CustomSeparated
format:
sql
SELECT *
FROM football
FORMAT CustomSeparated
The output will be in the configured custom format: | {"source_file": "CustomSeparated.md"} | [
-0.008251858875155449,
0.03909751772880554,
0.025588804855942726,
-0.005827514920383692,
-0.005223786924034357,
0.02989749237895012,
-0.012298273853957653,
0.07470375299453735,
0.004304876085370779,
-0.011165478266775608,
-0.01273138914257288,
-0.08571268618106842,
0.04549958184361458,
-0.... |
987edc8f-5a2d-4099-a28a-859022783a6a | Read data using the
CustomSeparated
format:
sql
SELECT *
FROM football
FORMAT CustomSeparated
The output will be in the configured custom format:
text
row('2022-04-30';2021;'Sutton United';'Bradford City';1;4),row('2022-04-30';2021;'Swindon Town';'Barrow';2;1),row('2022-04-30';2021;'Tranmere Rovers';'Oldham Athletic';2;0),row('2022-05-02';2021;'Port Vale';'Newport County';1;2),row('2022-05-02';2021;'Salford City';'Mansfield Town';2;2),row('2022-05-07';2021;'Barrow';'Northampton Town';1;3),row('2022-05-07';2021;'Bradford City';'Carlisle United';2;0),row('2022-05-07';2021;'Bristol Rovers';'Scunthorpe United';7;0),row('2022-05-07';2021;'Exeter City';'Port Vale';0;1),row('2022-05-07';2021;'Harrogate Town A.F.C.';'Sutton United';0;2),row('2022-05-07';2021;'Hartlepool United';'Colchester United';0;2),row('2022-05-07';2021;'Leyton Orient';'Tranmere Rovers';0;1),row('2022-05-07';2021;'Mansfield Town';'Forest Green Rovers';2;2),row('2022-05-07';2021;'Newport County';'Rochdale';0;2),row('2022-05-07';2021;'Oldham Athletic';'Crawley Town';3;3),row('2022-05-07';2021;'Stevenage Borough';'Salford City';4;2),row('2022-05-07';2021;'Walsall';'Swindon Town';0;3)
Format settings {#format-settings}
Additional settings:
| Setting | Description | Default |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|---------|
|
input_format_custom_detect_header
| enables automatic detection of header with names and types if any. |
true
|
|
input_format_custom_skip_trailing_empty_lines
| skip trailing empty lines at the end of file. |
false
|
|
input_format_custom_allow_variable_number_of_columns
| allow variable number of columns in CustomSeparated format, ignore extra columns and use default values for missing columns. |
false
| | {"source_file": "CustomSeparated.md"} | [
0.08715943992137909,
-0.012672183103859425,
-0.020973796024918556,
-0.038483794778585434,
0.016818203032016754,
0.06709978729486465,
-0.010467288084328175,
-0.014300918206572533,
-0.03887671232223511,
0.02824408747255802,
0.041012901812791824,
-0.08037395030260086,
0.032468508929014206,
-0... |
18366e52-beec-4bfe-829a-eb535ee64f1a | alias: []
description: 'Documentation for the CustomSeparatedWithNamesAndTypes format'
input_format: true
keywords: ['CustomSeparatedWithNamesAndTypes']
output_format: true
slug: /interfaces/formats/CustomSeparatedWithNamesAndTypes
title: 'CustomSeparatedWithNamesAndTypes'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Also prints two header rows with column names and types, similar to
TabSeparatedWithNamesAndTypes
.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using the following txt file, named as
football.txt
:
text
row('date';'season';'home_team';'away_team';'home_team_goals';'away_team_goals'),row('Date';'Int16';'LowCardinality(String)';'LowCardinality(String)';'Int8';'Int8'),row('2022-04-30';2021;'Sutton United';'Bradford City';1;4),row('2022-04-30';2021;'Swindon Town';'Barrow';2;1),row('2022-04-30';2021;'Tranmere Rovers';'Oldham Athletic';2;0),row('2022-05-02';2021;'Port Vale';'Newport County';1;2),row('2022-05-02';2021;'Salford City';'Mansfield Town';2;2),row('2022-05-07';2021;'Barrow';'Northampton Town';1;3),row('2022-05-07';2021;'Bradford City';'Carlisle United';2;0),row('2022-05-07';2021;'Bristol Rovers';'Scunthorpe United';7;0),row('2022-05-07';2021;'Exeter City';'Port Vale';0;1),row('2022-05-07';2021;'Harrogate Town A.F.C.';'Sutton United';0;2),row('2022-05-07';2021;'Hartlepool United';'Colchester United';0;2),row('2022-05-07';2021;'Leyton Orient';'Tranmere Rovers';0;1),row('2022-05-07';2021;'Mansfield Town';'Forest Green Rovers';2;2),row('2022-05-07';2021;'Newport County';'Rochdale';0;2),row('2022-05-07';2021;'Oldham Athletic';'Crawley Town';3;3),row('2022-05-07';2021;'Stevenage Borough';'Salford City';4;2),row('2022-05-07';2021;'Walsall';'Swindon Town';0;3)
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.txt' FORMAT CustomSeparatedWithNamesAndTypes;
Reading data {#reading-data}
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Read data using the
CustomSeparatedWithNamesAndTypes
format:
sql
SELECT *
FROM football
FORMAT CustomSeparatedWithNamesAndTypes
The output will be in the configured custom format: | {"source_file": "CustomSeparatedWithNamesAndTypes.md"} | [
0.005165866110473871,
0.06708738207817078,
-0.04029935970902443,
-0.018614767119288445,
0.011538991704583168,
0.01799152046442032,
0.06423906981945038,
0.09418830275535583,
-0.005239300429821014,
-0.0006897434359416366,
0.0069205183535814285,
-0.06142806261777878,
0.10584942996501923,
-0.0... |
16520766-658a-4e6e-8eff-40fcea03fd42 | Read data using the
CustomSeparatedWithNamesAndTypes
format:
sql
SELECT *
FROM football
FORMAT CustomSeparatedWithNamesAndTypes
The output will be in the configured custom format:
text
row('date';'season';'home_team';'away_team';'home_team_goals';'away_team_goals'),row('Date';'Int16';'LowCardinality(String)';'LowCardinality(String)';'Int8';'Int8'),row('2022-04-30';2021;'Sutton United';'Bradford City';1;4),row('2022-04-30';2021;'Swindon Town';'Barrow';2;1),row('2022-04-30';2021;'Tranmere Rovers';'Oldham Athletic';2;0),row('2022-05-02';2021;'Port Vale';'Newport County';1;2),row('2022-05-02';2021;'Salford City';'Mansfield Town';2;2),row('2022-05-07';2021;'Barrow';'Northampton Town';1;3),row('2022-05-07';2021;'Bradford City';'Carlisle United';2;0),row('2022-05-07';2021;'Bristol Rovers';'Scunthorpe United';7;0),row('2022-05-07';2021;'Exeter City';'Port Vale';0;1),row('2022-05-07';2021;'Harrogate Town A.F.C.';'Sutton United';0;2),row('2022-05-07';2021;'Hartlepool United';'Colchester United';0;2),row('2022-05-07';2021;'Leyton Orient';'Tranmere Rovers';0;1),row('2022-05-07';2021;'Mansfield Town';'Forest Green Rovers';2;2),row('2022-05-07';2021;'Newport County';'Rochdale';0;2),row('2022-05-07';2021;'Oldham Athletic';'Crawley Town';3;3),row('2022-05-07';2021;'Stevenage Borough';'Salford City';4;2),row('2022-05-07';2021;'Walsall';'Swindon Town';0;3)
Format settings {#format-settings}
:::note
If setting
input_format_with_names_use_header
is set to
1
,
the columns from input data will be mapped to the columns from the table by their names, columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to
1
.
Otherwise, the first row will be skipped.
:::
:::note
If setting
input_format_with_types_use_header
is set to
1
,
the types from input data will be compared with the types of the corresponding columns from the table. Otherwise, the second row will be skipped.
::: | {"source_file": "CustomSeparatedWithNamesAndTypes.md"} | [
0.11785587668418884,
0.025368334725499153,
-0.04269493743777275,
-0.024309027940034866,
0.00043140733032487333,
0.07319740951061249,
0.009965535253286362,
0.04248376190662384,
-0.02741759642958641,
0.01061732042580843,
0.021319247782230377,
-0.08817577362060547,
0.04338682070374489,
-0.036... |
0d901762-943e-4ebe-aa11-3adc508ed842 | description: 'Documentation for the CustomSeparatedIgnoreSpacesWithNamesAndTypes format'
keywords: ['CustomSeparatedIgnoreSpacesWithNamesAndTypes']
slug: /interfaces/formats/CustomSeparatedIgnoreSpacesWithNamesAndTypes
title: 'CustomSeparatedIgnoreSpacesWithNamesAndTypes'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | | |
Description {#description}
Example usage {#example-usage}
Inserting data {#inserting-data}
Using the following txt file, named as
football.txt
:
text
row('date'; 'season'; 'home_team'; 'away_team'; 'home_team_goals'; 'away_team_goals'), row('Date'; 'Int16'; 'LowCardinality(String)'; 'LowCardinality(String)'; 'Int8'; 'Int8'), row('2022-04-30'; 2021; 'Sutton United'; 'Bradford City'; 1; 4), row( '2022-04-30'; 2021; 'Swindon Town'; 'Barrow'; 2; 1), row( '2022-04-30'; 2021; 'Tranmere Rovers'; 'Oldham Athletic'; 2; 0), row('2022-05-02'; 2021; 'Salford City'; 'Mansfield Town'; 2; 2), row('2022-05-02'; 2021; 'Port Vale'; 'Newport County'; 1; 2), row('2022-05-07'; 2021; 'Barrow'; 'Northampton Town'; 1; 3), row('2022-05-07'; 2021; 'Bradford City'; 'Carlisle United'; 2; 0), row('2022-05-07'; 2021; 'Bristol Rovers'; 'Scunthorpe United'; 7; 0), row('2022-05-07'; 2021; 'Exeter City'; 'Port Vale'; 0; 1), row('2022-05-07'; 2021; 'Harrogate Town A.F.C.'; 'Sutton United'; 0; 2), row('2022-05-07'; 2021; 'Hartlepool United'; 'Colchester United'; 0; 2), row('2022-05-07'; 2021; 'Leyton Orient'; 'Tranmere Rovers'; 0; 1), row('2022-05-07'; 2021; 'Mansfield Town'; 'Forest Green Rovers'; 2; 2), row('2022-05-07'; 2021; 'Newport County'; 'Rochdale'; 0; 2), row('2022-05-07'; 2021; 'Oldham Athletic'; 'Crawley Town'; 3; 3), row('2022-05-07'; 2021; 'Stevenage Borough'; 'Salford City'; 4; 2), row('2022-05-07'; 2021; 'Walsall'; 'Swindon Town'; 0; 3)
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.txt' FORMAT CustomSeparatedIgnoreSpacesWithNamesAndTypes;
Format settings {#format-settings} | {"source_file": "CustomSeparatedIgnoreSpacesWithNamesAndTypes.md"} | [
0.018650641664862633,
0.042761363089084625,
-0.00562412990257144,
-0.0012397662503644824,
0.01624910533428192,
0.040055084973573685,
0.036536235362291336,
0.08351580053567886,
0.037342727184295654,
0.004263246897608042,
0.019605621695518494,
-0.08890380710363388,
0.09905378520488739,
-0.02... |
dba023bd-4454-4544-b749-d0b606770447 | description: 'Documentation for the CustomSeparatedIgnoreSpaces format'
keywords: ['CustomSeparatedIgnoreSpaces']
slug: /interfaces/formats/CustomSeparatedIgnoreSpaces
title: 'CustomSeparatedIgnoreSpaces'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | | |
Description {#description}
Example usage {#example-usage}
Inserting data {#inserting-data}
Using the following txt file, named as
football.txt
:
text
row('2022-04-30'; 2021; 'Sutton United'; 'Bradford City'; 1; 4), row( '2022-04-30'; 2021; 'Swindon Town'; 'Barrow'; 2; 1), row( '2022-04-30'; 2021; 'Tranmere Rovers'; 'Oldham Athletic'; 2; 0), row('2022-05-02'; 2021; 'Salford City'; 'Mansfield Town'; 2; 2), row('2022-05-02'; 2021; 'Port Vale'; 'Newport County'; 1; 2), row('2022-05-07'; 2021; 'Barrow'; 'Northampton Town'; 1; 3), row('2022-05-07'; 2021; 'Bradford City'; 'Carlisle United'; 2; 0), row('2022-05-07'; 2021; 'Bristol Rovers'; 'Scunthorpe United'; 7; 0), row('2022-05-07'; 2021; 'Exeter City'; 'Port Vale'; 0; 1), row('2022-05-07'; 2021; 'Harrogate Town A.F.C.'; 'Sutton United'; 0; 2), row('2022-05-07'; 2021; 'Hartlepool United'; 'Colchester United'; 0; 2), row('2022-05-07'; 2021; 'Leyton Orient'; 'Tranmere Rovers'; 0; 1), row('2022-05-07'; 2021; 'Mansfield Town'; 'Forest Green Rovers'; 2; 2), row('2022-05-07'; 2021; 'Newport County'; 'Rochdale'; 0; 2), row('2022-05-07'; 2021; 'Oldham Athletic'; 'Crawley Town'; 3; 3), row('2022-05-07'; 2021; 'Stevenage Borough'; 'Salford City'; 4; 2), row('2022-05-07'; 2021; 'Walsall'; 'Swindon Town'; 0; 3)
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.txt' FORMAT CustomSeparatedIgnoreSpaces;
Format settings {#format-settings} | {"source_file": "CustomSeparatedIgnoreSpaces.md"} | [
0.024513058364391327,
0.059306800365448,
0.013259091414511204,
0.007710540201514959,
0.0008117472170852125,
0.014026327058672905,
0.050025008618831635,
0.06055936589837074,
0.014714286662638187,
0.02319336123764515,
0.04477846249938011,
-0.0799667090177536,
0.09474973380565643,
-0.03715616... |
8cfb0101-2f58-4b9c-8dd1-7a13e71f2e27 | description: 'Documentation for the CustomSeparatedIgnoreSpacesWithNames format'
keywords: ['CustomSeparatedIgnoreSpacesWithNames']
slug: /interfaces/formats/CustomSeparatedIgnoreSpacesWithNames
title: 'CustomSeparatedIgnoreSpacesWithNames'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | | |
Description {#description}
Example usage {#example-usage}
Inserting data {#inserting-data}
Using the following txt file, named as
football.txt
:
text
row('date'; 'season'; 'home_team'; 'away_team'; 'home_team_goals'; 'away_team_goals'), row('2022-04-30'; 2021; 'Sutton United'; 'Bradford City'; 1; 4), row( '2022-04-30'; 2021; 'Swindon Town'; 'Barrow'; 2; 1), row( '2022-04-30'; 2021; 'Tranmere Rovers'; 'Oldham Athletic'; 2; 0), row('2022-05-02'; 2021; 'Salford City'; 'Mansfield Town'; 2; 2), row('2022-05-02'; 2021; 'Port Vale'; 'Newport County'; 1; 2), row('2022-05-07'; 2021; 'Barrow'; 'Northampton Town'; 1; 3), row('2022-05-07'; 2021; 'Bradford City'; 'Carlisle United'; 2; 0), row('2022-05-07'; 2021; 'Bristol Rovers'; 'Scunthorpe United'; 7; 0), row('2022-05-07'; 2021; 'Exeter City'; 'Port Vale'; 0; 1), row('2022-05-07'; 2021; 'Harrogate Town A.F.C.'; 'Sutton United'; 0; 2), row('2022-05-07'; 2021; 'Hartlepool United'; 'Colchester United'; 0; 2), row('2022-05-07'; 2021; 'Leyton Orient'; 'Tranmere Rovers'; 0; 1), row('2022-05-07'; 2021; 'Mansfield Town'; 'Forest Green Rovers'; 2; 2), row('2022-05-07'; 2021; 'Newport County'; 'Rochdale'; 0; 2), row('2022-05-07'; 2021; 'Oldham Athletic'; 'Crawley Town'; 3; 3), row('2022-05-07'; 2021; 'Stevenage Borough'; 'Salford City'; 4; 2), row('2022-05-07'; 2021; 'Walsall'; 'Swindon Town'; 0; 3)
Configure the custom delimiter settings:
sql
SET format_custom_row_before_delimiter = 'row(';
SET format_custom_row_after_delimiter = ')';
SET format_custom_field_delimiter = ';';
SET format_custom_row_between_delimiter = ',';
SET format_custom_escaping_rule = 'Quoted';
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.txt' FORMAT CustomSeparatedIgnoreSpacesWithNames;
Format settings {#format-settings} | {"source_file": "CustomSeparatedIgnoreSpacesWithNames.md"} | [
0.03066987544298172,
0.057355187833309174,
-0.0018128367373719811,
0.008192358538508415,
0.01935620792210102,
0.03392273932695389,
0.034306760877370834,
0.07209384441375732,
0.039299074560403824,
0.01377332117408514,
0.02511635236442089,
-0.0959492027759552,
0.0925726518034935,
-0.02885524... |
2533e0fb-c2e3-41ae-9672-c0e7187eb88c | alias: ['JSONEachRow', 'NDJSON']
description: 'Documentation for the JSONLines format'
keywords: ['JSONLines']
slug: /interfaces/formats/JSONLines
title: 'JSONLines'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-----------------------|
| β | β |
JSONEachRow
,
NDJSON
|
Description {#description}
In this format, ClickHouse outputs each row as a separated, newline-delimited JSON Object.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
{"date":"2022-04-30","season":2021,"home_team":"Sutton United","away_team":"Bradford City","home_team_goals":1,"away_team_goals":4}
{"date":"2022-04-30","season":2021,"home_team":"Swindon Town","away_team":"Barrow","home_team_goals":2,"away_team_goals":1}
{"date":"2022-04-30","season":2021,"home_team":"Tranmere Rovers","away_team":"Oldham Athletic","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-02","season":2021,"home_team":"Port Vale","away_team":"Newport County","home_team_goals":1,"away_team_goals":2}
{"date":"2022-05-02","season":2021,"home_team":"Salford City","away_team":"Mansfield Town","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Barrow","away_team":"Northampton Town","home_team_goals":1,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Bradford City","away_team":"Carlisle United","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Bristol Rovers","away_team":"Scunthorpe United","home_team_goals":7,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Exeter City","away_team":"Port Vale","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Harrogate Town A.F.C.","away_team":"Sutton United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Hartlepool United","away_team":"Colchester United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Leyton Orient","away_team":"Tranmere Rovers","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Mansfield Town","away_team":"Forest Green Rovers","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Newport County","away_team":"Rochdale","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Oldham Athletic","away_team":"Crawley Town","home_team_goals":3,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Stevenage Borough","away_team":"Salford City","home_team_goals":4,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Walsall","away_team":"Swindon Town","home_team_goals":0,"away_team_goals":3}
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONLines;
Reading data {#reading-data} | {"source_file": "JSONLines.md"} | [
-0.054957348853349686,
-0.002402047161012888,
-0.013356341049075127,
-0.031017227098345757,
-0.006218067370355129,
0.004990274552255869,
-0.022664012387394905,
0.03918042406439781,
0.001957763684913516,
-0.033710379153490067,
0.002697705291211605,
-0.016442887485027313,
-0.00484415702521801,... |
8eeb0375-75f0-472a-9d3c-9916dfd7c8ee | Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONLines;
Reading data {#reading-data}
Read data using the
JSONLines
format:
sql
SELECT *
FROM football
FORMAT JSONLines
The output will be in JSON format:
json
{"date":"2022-04-30","season":2021,"home_team":"Sutton United","away_team":"Bradford City","home_team_goals":1,"away_team_goals":4}
{"date":"2022-04-30","season":2021,"home_team":"Swindon Town","away_team":"Barrow","home_team_goals":2,"away_team_goals":1}
{"date":"2022-04-30","season":2021,"home_team":"Tranmere Rovers","away_team":"Oldham Athletic","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-02","season":2021,"home_team":"Port Vale","away_team":"Newport County","home_team_goals":1,"away_team_goals":2}
{"date":"2022-05-02","season":2021,"home_team":"Salford City","away_team":"Mansfield Town","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Barrow","away_team":"Northampton Town","home_team_goals":1,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Bradford City","away_team":"Carlisle United","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Bristol Rovers","away_team":"Scunthorpe United","home_team_goals":7,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Exeter City","away_team":"Port Vale","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Harrogate Town A.F.C.","away_team":"Sutton United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Hartlepool United","away_team":"Colchester United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Leyton Orient","away_team":"Tranmere Rovers","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Mansfield Town","away_team":"Forest Green Rovers","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Newport County","away_team":"Rochdale","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Oldham Athletic","away_team":"Crawley Town","home_team_goals":3,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Stevenage Borough","away_team":"Salford City","home_team_goals":4,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Walsall","away_team":"Swindon Town","home_team_goals":0,"away_team_goals":3}
Importing data columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to 1.
Format settings {#format-settings} | {"source_file": "JSONLines.md"} | [
0.020269280299544334,
-0.017799925059080124,
-0.007946401834487915,
-0.015343539416790009,
0.035703323781490326,
0.03763367608189583,
-0.019893398508429527,
0.08484403789043427,
-0.001777525176294148,
0.02196936495602131,
0.007570178713649511,
-0.03775445371866226,
0.024973589926958084,
-0... |
4eff62cd-ab0e-470a-b2a3-5f3668edbaf7 | alias: []
description: 'Documentation for the JSONCompactStringsEachRowWithProgress format'
input_format: true
keywords: ['JSONCompactStringsEachRowWithProgress']
output_format: true
slug: /interfaces/formats/JSONCompactStringsEachRowWithProgress
title: 'JSONCompactStringsEachRowWithProgress'
doc_type: 'reference'
| Input | Output | Alias |
|-------|---------|--------|
| β | β | |
Description {#description}
Similar to
JSONCompactEachRowWithProgress
, but all values are converted to strings.
This is useful when you need consistent string representation of all data types.
Key features:
- Same structure as
JSONCompactEachRowWithProgress
- All values are represented as strings (numbers, arrays, etc. are all quoted strings)
- Includes progress updates, totals, and exception handling
- Useful for clients that prefer or require string-based data
Example usage {#example-usage}
Inserting data {#inserting-data}
sql title="Query"
SELECT *
FROM generateRandom('a Array(Int8), d Decimal32(4), c Tuple(DateTime64(3), UUID)', 1, 10, 2)
LIMIT 5
FORMAT JSONCompactStringsEachRowWithProgress
response title="Response"
{"meta":[{"name":"a","type":"Array(Int8)"},{"name":"d","type":"Decimal(9, 4)"},{"name":"c","type":"Tuple(DateTime64(3), UUID)"}]}
{"row":["[-8]", "46848.5225", "('2064-06-11 14:00:36.578','b06f4fa1-22ff-f84f-a1b7-a5807d983ae6')"]}
{"row":["[-76]", "-85331.598", "('2038-06-16 04:10:27.271','2bb0de60-3a2c-ffc0-d7a7-a5c88ed8177c')"]}
{"row":["[-32]", "-31470.8994", "('2027-07-18 16:58:34.654','1cdbae4c-ceb2-1337-b954-b175f5efbef8')"]}
{"row":["[-116]", "32104.097", "('1979-04-27 21:51:53.321','66903704-3c83-8f8a-648a-da4ac1ffa9fc')"]}
{"row":["[]", "2427.6614", "('1980-04-24 11:30:35.487','fee19be8-0f46-149b-ed98-43e7455ce2b2')"]}
{"progress":{"read_rows":"5","read_bytes":"184","total_rows_to_read":"5","elapsed_ns":"191151"}}
{"rows_before_limit_at_least":5}
Format settings {#format-settings} | {"source_file": "JSONCompactStringsEachRowWithProgress.md"} | [
-0.04354181885719299,
0.039871711283922195,
0.0055893477983772755,
0.04657129943370819,
-0.043619394302368164,
0.028828272596001625,
0.004643450491130352,
0.0981740951538086,
0.0028945766389369965,
-0.06820522993803024,
-0.018602652475237846,
-0.02762330137193203,
0.05794829502701759,
0.06... |
26f566de-2763-477b-b286-e7ae431af573 | alias: []
description: 'Documentation for the JSONCompactEachRowWithNames format'
input_format: true
keywords: ['JSONCompactEachRowWithNames']
output_format: true
slug: /interfaces/formats/JSONCompactEachRowWithNames
title: 'JSONCompactEachRowWithNames'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from the
JSONCompactEachRow
format in that it also prints the header row with column names, similar to the
TabSeparatedWithNames
format.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
["date", "season", "home_team", "away_team", "home_team_goals", "away_team_goals"]
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4]
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1]
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0]
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2]
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2]
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3]
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0]
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0]
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1]
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2]
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2]
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1]
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2]
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2]
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3]
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2]
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONCompactEachRowWithNames;
Reading data {#reading-data}
Read data using the
JSONCompactEachRowWithNames
format:
sql
SELECT *
FROM football
FORMAT JSONCompactEachRowWithNames
The output will be in JSON format: | {"source_file": "JSONCompactEachRowWithNames.md"} | [
-0.04418005421757698,
0.021316565573215485,
-0.04146502539515495,
-0.007657031994313002,
0.027304520830512047,
-0.002677053911611438,
-0.013282808475196362,
0.10988397151231766,
0.028893286362290382,
-0.04360494017601013,
0.014226768165826797,
-0.007735831663012505,
0.058050088584423065,
0... |
70297123-e43e-42b3-90f8-a051516f5d88 | Reading data {#reading-data}
Read data using the
JSONCompactEachRowWithNames
format:
sql
SELECT *
FROM football
FORMAT JSONCompactEachRowWithNames
The output will be in JSON format:
json
["date", "season", "home_team", "away_team", "home_team_goals", "away_team_goals"]
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4]
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1]
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0]
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2]
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2]
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3]
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0]
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0]
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1]
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2]
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2]
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1]
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2]
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2]
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3]
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2]
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
Format settings {#format-settings}
:::note
If setting
input_format_with_names_use_header
is set to 1,
the columns from input data will be mapped to the columns from the table by their names, columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to 1.
Otherwise, the first row will be skipped.
::: | {"source_file": "JSONCompactEachRowWithNames.md"} | [
0.04894610866904259,
-0.029032858088612556,
-0.016061028465628624,
0.016117168590426445,
0.03713217005133629,
0.023984024301171303,
0.021616347134113312,
0.013435063883662224,
-0.02177610993385315,
-0.008094724267721176,
0.009009921923279762,
-0.041147809475660324,
0.002205230761319399,
0.... |
54c9b1fc-db3e-4604-b4cd-80e0143d2691 | alias: []
description: 'Documentation for the JSONStringsEachRow format'
input_format: false
keywords: ['JSONStringsEachRow']
output_format: true
slug: /interfaces/formats/JSONStringsEachRow
title: 'JSONStringsEachRow'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from the
JSONEachRow
only in that data fields are output in strings, not in typed JSON values.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
{"date":"2022-04-30","season":"2021","home_team":"Sutton United","away_team":"Bradford City","home_team_goals":"1","away_team_goals":"4"}
{"date":"2022-04-30","season":"2021","home_team":"Swindon Town","away_team":"Barrow","home_team_goals":"2","away_team_goals":"1"}
{"date":"2022-04-30","season":"2021","home_team":"Tranmere Rovers","away_team":"Oldham Athletic","home_team_goals":"2","away_team_goals":"0"}
{"date":"2022-05-02","season":"2021","home_team":"Port Vale","away_team":"Newport County","home_team_goals":"1","away_team_goals":"2"}
{"date":"2022-05-02","season":"2021","home_team":"Salford City","away_team":"Mansfield Town","home_team_goals":"2","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Barrow","away_team":"Northampton Town","home_team_goals":"1","away_team_goals":"3"}
{"date":"2022-05-07","season":"2021","home_team":"Bradford City","away_team":"Carlisle United","home_team_goals":"2","away_team_goals":"0"}
{"date":"2022-05-07","season":"2021","home_team":"Bristol Rovers","away_team":"Scunthorpe United","home_team_goals":"7","away_team_goals":"0"}
{"date":"2022-05-07","season":"2021","home_team":"Exeter City","away_team":"Port Vale","home_team_goals":"0","away_team_goals":"1"}
{"date":"2022-05-07","season":"2021","home_team":"Harrogate Town A.F.C.","away_team":"Sutton United","home_team_goals":"0","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Hartlepool United","away_team":"Colchester United","home_team_goals":"0","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Leyton Orient","away_team":"Tranmere Rovers","home_team_goals":"0","away_team_goals":"1"}
{"date":"2022-05-07","season":"2021","home_team":"Mansfield Town","away_team":"Forest Green Rovers","home_team_goals":"2","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Newport County","away_team":"Rochdale","home_team_goals":"0","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Oldham Athletic","away_team":"Crawley Town","home_team_goals":"3","away_team_goals":"3"}
{"date":"2022-05-07","season":"2021","home_team":"Stevenage Borough","away_team":"Salford City","home_team_goals":"4","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Walsall","away_team":"Swindon Town","home_team_goals":"0","away_team_goals":"3"}
Insert the data: | {"source_file": "JSONStringsEachRow.md"} | [
-0.01799839921295643,
0.009501609951257706,
0.024265240877866745,
-0.00834782887250185,
-0.009374412707984447,
0.014116491191089153,
-0.0034402089659124613,
0.10305716097354889,
0.060351401567459106,
-0.05009803920984268,
-0.01821298338472843,
-0.0020502794068306684,
0.015573966316878796,
... |
5ce4b12b-7a94-4ad1-ab87-f02b2d20fb00 | Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONStringsEachRow;
Reading data {#reading-data}
Read data using the
JSONStringsEachRow
format:
sql
SELECT *
FROM football
FORMAT JSONStringsEachRow
The output will be in JSON format:
json
{"date":"2022-04-30","season":"2021","home_team":"Sutton United","away_team":"Bradford City","home_team_goals":"1","away_team_goals":"4"}
{"date":"2022-04-30","season":"2021","home_team":"Swindon Town","away_team":"Barrow","home_team_goals":"2","away_team_goals":"1"}
{"date":"2022-04-30","season":"2021","home_team":"Tranmere Rovers","away_team":"Oldham Athletic","home_team_goals":"2","away_team_goals":"0"}
{"date":"2022-05-02","season":"2021","home_team":"Port Vale","away_team":"Newport County","home_team_goals":"1","away_team_goals":"2"}
{"date":"2022-05-02","season":"2021","home_team":"Salford City","away_team":"Mansfield Town","home_team_goals":"2","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Barrow","away_team":"Northampton Town","home_team_goals":"1","away_team_goals":"3"}
{"date":"2022-05-07","season":"2021","home_team":"Bradford City","away_team":"Carlisle United","home_team_goals":"2","away_team_goals":"0"}
{"date":"2022-05-07","season":"2021","home_team":"Bristol Rovers","away_team":"Scunthorpe United","home_team_goals":"7","away_team_goals":"0"}
{"date":"2022-05-07","season":"2021","home_team":"Exeter City","away_team":"Port Vale","home_team_goals":"0","away_team_goals":"1"}
{"date":"2022-05-07","season":"2021","home_team":"Harrogate Town A.F.C.","away_team":"Sutton United","home_team_goals":"0","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Hartlepool United","away_team":"Colchester United","home_team_goals":"0","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Leyton Orient","away_team":"Tranmere Rovers","home_team_goals":"0","away_team_goals":"1"}
{"date":"2022-05-07","season":"2021","home_team":"Mansfield Town","away_team":"Forest Green Rovers","home_team_goals":"2","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Newport County","away_team":"Rochdale","home_team_goals":"0","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Oldham Athletic","away_team":"Crawley Town","home_team_goals":"3","away_team_goals":"3"}
{"date":"2022-05-07","season":"2021","home_team":"Stevenage Borough","away_team":"Salford City","home_team_goals":"4","away_team_goals":"2"}
{"date":"2022-05-07","season":"2021","home_team":"Walsall","away_team":"Swindon Town","home_team_goals":"0","away_team_goals":"3"}
Format settings {#format-settings} | {"source_file": "JSONStringsEachRow.md"} | [
0.029654402285814285,
-0.02205962873995304,
-0.015498378314077854,
-0.010113478638231754,
0.037291742861270905,
0.06916493922472,
-0.02216511219739914,
0.08400899916887283,
0.0014106672024354339,
0.01097328495234251,
-0.008640248328447342,
-0.03819476440548897,
0.00968980509787798,
-0.0197... |
fc9cd14b-e918-4eac-ac15-017a4c70ae5f | alias: []
description: 'Documentation for the JSONCompactStringsEachRow format'
input_format: true
keywords: ['JSONCompactStringsEachRow']
output_format: true
slug: /interfaces/formats/JSONCompactStringsEachRow
title: 'JSONCompactStringsEachRow'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from
JSONCompactEachRow
only in that data fields are output as strings, not as typed JSON values.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
["2022-04-30", "2021", "Sutton United", "Bradford City", "1", "4"]
["2022-04-30", "2021", "Swindon Town", "Barrow", "2", "1"]
["2022-04-30", "2021", "Tranmere Rovers", "Oldham Athletic", "2", "0"]
["2022-05-02", "2021", "Port Vale", "Newport County", "1", "2"]
["2022-05-02", "2021", "Salford City", "Mansfield Town", "2", "2"]
["2022-05-07", "2021", "Barrow", "Northampton Town", "1", "3"]
["2022-05-07", "2021", "Bradford City", "Carlisle United", "2", "0"]
["2022-05-07", "2021", "Bristol Rovers", "Scunthorpe United", "7", "0"]
["2022-05-07", "2021", "Exeter City", "Port Vale", "0", "1"]
["2022-05-07", "2021", "Harrogate Town A.F.C.", "Sutton United", "0", "2"]
["2022-05-07", "2021", "Hartlepool United", "Colchester United", "0", "2"]
["2022-05-07", "2021", "Leyton Orient", "Tranmere Rovers", "0", "1"]
["2022-05-07", "2021", "Mansfield Town", "Forest Green Rovers", "2", "2"]
["2022-05-07", "2021", "Newport County", "Rochdale", "0", "2"]
["2022-05-07", "2021", "Oldham Athletic", "Crawley Town", "3", "3"]
["2022-05-07", "2021", "Stevenage Borough", "Salford City", "4", "2"]
["2022-05-07", "2021", "Walsall", "Swindon Town", "0", "3"]
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONCompactStringsEachRow;
Reading data {#reading-data}
Read data using the
JSONCompactStringsEachRow
format:
sql
SELECT *
FROM football
FORMAT JSONCompactStringsEachRow
The output will be in JSON format: | {"source_file": "JSONCompactStringsEachRow.md"} | [
-0.02316409908235073,
0.0028970034327358007,
0.018539661541581154,
-0.004398371558636427,
-0.024348754435777664,
-0.012308861128985882,
-0.004982942249625921,
0.08721848577260971,
0.03646671399474144,
-0.05522589385509491,
0.018896877765655518,
-0.020792199298739433,
0.05664115399122238,
0... |
3e9d8109-d2d1-4ca5-b602-c768b01bc90e | Reading data {#reading-data}
Read data using the
JSONCompactStringsEachRow
format:
sql
SELECT *
FROM football
FORMAT JSONCompactStringsEachRow
The output will be in JSON format:
json
["2022-04-30", "2021", "Sutton United", "Bradford City", "1", "4"]
["2022-04-30", "2021", "Swindon Town", "Barrow", "2", "1"]
["2022-04-30", "2021", "Tranmere Rovers", "Oldham Athletic", "2", "0"]
["2022-05-02", "2021", "Port Vale", "Newport County", "1", "2"]
["2022-05-02", "2021", "Salford City", "Mansfield Town", "2", "2"]
["2022-05-07", "2021", "Barrow", "Northampton Town", "1", "3"]
["2022-05-07", "2021", "Bradford City", "Carlisle United", "2", "0"]
["2022-05-07", "2021", "Bristol Rovers", "Scunthorpe United", "7", "0"]
["2022-05-07", "2021", "Exeter City", "Port Vale", "0", "1"]
["2022-05-07", "2021", "Harrogate Town A.F.C.", "Sutton United", "0", "2"]
["2022-05-07", "2021", "Hartlepool United", "Colchester United", "0", "2"]
["2022-05-07", "2021", "Leyton Orient", "Tranmere Rovers", "0", "1"]
["2022-05-07", "2021", "Mansfield Town", "Forest Green Rovers", "2", "2"]
["2022-05-07", "2021", "Newport County", "Rochdale", "0", "2"]
["2022-05-07", "2021", "Oldham Athletic", "Crawley Town", "3", "3"]
["2022-05-07", "2021", "Stevenage Borough", "Salford City", "4", "2"]
["2022-05-07", "2021", "Walsall", "Swindon Town", "0", "3"]
Format settings {#format-settings} | {"source_file": "JSONCompactStringsEachRow.md"} | [
0.05595278739929199,
-0.036582101136446,
0.018000097945332527,
-0.0014836561167612672,
0.006786186248064041,
0.01739712432026863,
0.034275297075510025,
0.011570480652153492,
-0.021823853254318237,
-0.010791298002004623,
0.013650752604007721,
-0.032507918775081635,
-0.004337802529335022,
0.... |
5f03b801-7fe7-43fd-9ea8-54c75ff23abb | alias: []
description: 'Documentation for the JSONColumnsWithMetadata format'
input_format: true
keywords: ['JSONColumnsWithMetadata']
output_format: true
slug: /interfaces/formats/JSONColumnsWithMetadata
title: 'JSONColumnsWithMetadata'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from the
JSONColumns
format in that it also contains some metadata and statistics (similar to the
JSON
format).
:::note
The
JSONColumnsWithMetadata
format buffers all data in memory and then outputs it as a single block, so, it can lead to high memory consumption.
:::
Example usage {#example-usage}
Example:
```json
{
"meta":
[
{
"name": "num",
"type": "Int32"
},
{
"name": "str",
"type": "String"
},
{
"name": "arr",
"type": "Array(UInt8)"
}
],
"data":
{
"num": [42, 43, 44],
"str": ["hello", "hello", "hello"],
"arr": [[0,1], [0,1,2], [0,1,2,3]]
},
"rows": 3,
"rows_before_limit_at_least": 3,
"statistics":
{
"elapsed": 0.000272376,
"rows_read": 3,
"bytes_read": 24
}
}
```
For the
JSONColumnsWithMetadata
input format, if setting
input_format_json_validate_types_from_metadata
is set to
1
,
the types from metadata in input data will be compared with the types of the corresponding columns from the table.
Format settings {#format-settings} | {"source_file": "JSONColumnsWithMetadata.md"} | [
-0.0057561988942325115,
0.053238946944475174,
-0.062090035527944565,
0.03167098015546799,
-0.0010408756788820028,
-0.04130806401371956,
-0.04470726475119591,
0.1022442951798439,
0.047583989799022675,
-0.004581610672175884,
-0.004412536043673754,
0.006870086304843426,
-0.007536608260124922,
... |
44a0e24f-6be6-47a8-bb0c-b2a39f21b874 | alias: []
description: 'Documentation for the JSONCompact format'
input_format: true
keywords: ['JSONCompact']
output_format: true
slug: /interfaces/formats/JSONCompact
title: 'JSONCompact'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from
JSON
only in that data rows are output as arrays, not as objects.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
{
"meta":
[
{
"name": "date",
"type": "Date"
},
{
"name": "season",
"type": "Int16"
},
{
"name": "home_team",
"type": "LowCardinality(String)"
},
{
"name": "away_team",
"type": "LowCardinality(String)"
},
{
"name": "home_team_goals",
"type": "Int8"
},
{
"name": "away_team_goals",
"type": "Int8"
}
],
"data":
[
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4],
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1],
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0],
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2],
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2],
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3],
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0],
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0],
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1],
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2],
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2],
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1],
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2],
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2],
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3],
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2],
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
]
}
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONCompact;
Reading data {#reading-data}
Read data using the
JSONCompact
format:
sql
SELECT *
FROM football
FORMAT JSONCompact
The output will be in JSON format: | {"source_file": "JSONCompact.md"} | [
-0.029483230784535408,
0.0486607626080513,
-0.008996465243399143,
-0.005580057390034199,
0.0005381300579756498,
-0.011981787160038948,
-0.007401932030916214,
0.08052043616771698,
0.03943660855293274,
-0.05220653861761093,
-0.012762940488755703,
-0.008672497235238552,
0.019555607810616493,
... |
e1bd022f-7662-4608-8cf1-749d7b443be9 | Reading data {#reading-data}
Read data using the
JSONCompact
format:
sql
SELECT *
FROM football
FORMAT JSONCompact
The output will be in JSON format:
```json
{
"meta":
[
{
"name": "date",
"type": "Date"
},
{
"name": "season",
"type": "Int16"
},
{
"name": "home_team",
"type": "LowCardinality(String)"
},
{
"name": "away_team",
"type": "LowCardinality(String)"
},
{
"name": "home_team_goals",
"type": "Int8"
},
{
"name": "away_team_goals",
"type": "Int8"
}
],
"data":
[
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4],
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1],
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0],
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2],
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2],
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3],
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0],
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0],
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1],
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2],
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2],
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1],
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2],
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2],
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3],
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2],
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
],
"rows": 17,
"statistics":
{
"elapsed": 0.223690876,
"rows_read": 0,
"bytes_read": 0
}
}
```
Format settings {#format-settings} | {"source_file": "JSONCompact.md"} | [
0.05327203869819641,
0.025518985465168953,
0.004640566185116768,
0.010027184151113033,
0.024873904883861542,
0.002170392544940114,
0.01598788984119892,
0.05963725596666336,
0.0007506046094931662,
-0.023745842278003693,
-0.031106652691960335,
-0.03778031840920448,
-0.003669189056381583,
0.0... |
727e6d53-2e4a-453c-bd3f-36297c6d0529 | alias: []
description: 'Documentation for the JSON format'
input_format: true
keywords: ['JSON']
output_format: true
slug: /interfaces/formats/JSON
title: 'JSON'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
JSON
format reads and outputs data in the JSON format.
The
JSON
format returns the following: | {"source_file": "JSON.md"} | [
-0.04406830295920372,
0.059943947941064835,
0.015079041942954063,
-0.008371562696993351,
-0.010267564095556736,
-0.02503344975411892,
-0.022792965173721313,
0.09308982640504837,
0.027720708400011063,
-0.044435661286115646,
0.03076353296637535,
0.004734918475151062,
0.024939198046922684,
0.... |
bc7b4110-2c4a-41ac-9da9-f6c6cb73a38a | Description {#description}
The
JSON
format reads and outputs data in the JSON format.
The
JSON
format returns the following:
| Parameter | Description |
|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
meta
| Column names and types. |
|
data
| Data tables |
|
rows
| The total number of output rows. |
|
rows_before_limit_at_least
| The lower estimate of the number of rows there would have been without LIMIT. Output only if the query contains LIMIT. This estimate is calculated from the blocks of data processed in the query pipeline before the limit transform, but could then be discarded by the limit transform. If the blocks didn't even reach the limit transform in the query pipeline, they don't participate in the estimation. |
|
statistics
| Statistics such as
elapsed
,
rows_read
,
bytes_read
. |
|
totals
| Total values (when using WITH TOTALS). |
|
extremes
| Extreme values (when extremes are set to 1). |
The
JSON
type is compatible with JavaScript. To ensure this, some characters are additionally escaped:
- the slash
/
is escaped as
\/ | {"source_file": "JSON.md"} | [
0.01340493280440569,
0.0817534476518631,
0.00559459812939167,
0.008571827784180641,
-0.07394587993621826,
-0.03582024201750755,
-0.018175408244132996,
0.0443650484085083,
0.01569117046892643,
-0.09923431277275085,
0.03847651183605194,
-0.02702206000685692,
-0.008822089992463589,
0.01333091... |
977b39df-595c-4dc5-b710-ac6f933134f8 | The
JSON
type is compatible with JavaScript. To ensure this, some characters are additionally escaped:
- the slash
/
is escaped as
\/
- alternative line breaks
U+2028
and
U+2029
, which break some browsers, are escaped as
\uXXXX
.
- ASCII control characters are escaped: backspace, form feed, line feed, carriage return, and horizontal tab are replaced with
\b
,
\f
,
\n
,
\r
,
\t
, as well as the remaining bytes in the 00-1F range using
\uXXXX
sequences.
- Invalid UTF-8 sequences are changed to the replacement character οΏ½ so the output text will consist of valid UTF-8 sequences.
For compatibility with JavaScript, Int64 and UInt64 integers are enclosed in double quotes by default.
To remove the quotes, you can set the configuration parameter
output_format_json_quote_64bit_integers
to
0
.
ClickHouse supports
NULL
, which is displayed as
null
in the JSON output. To enable
+nan
,
-nan
,
+inf
,
-inf
values in output, set the
output_format_json_quote_denormals
to
1
.
Example usage {#example-usage}
Example:
sql
SELECT SearchPhrase, count() AS c FROM test.hits GROUP BY SearchPhrase WITH TOTALS ORDER BY c DESC LIMIT 5 FORMAT JSON
```json
{
"meta":
[
{
"name": "num",
"type": "Int32"
},
{
"name": "str",
"type": "String"
},
{
"name": "arr",
"type": "Array(UInt8)"
}
],
"data":
[
{
"num": 42,
"str": "hello",
"arr": [0,1]
},
{
"num": 43,
"str": "hello",
"arr": [0,1,2]
},
{
"num": 44,
"str": "hello",
"arr": [0,1,2,3]
}
],
"rows": 3,
"rows_before_limit_at_least": 3,
"statistics":
{
"elapsed": 0.001137687,
"rows_read": 3,
"bytes_read": 24
}
}
```
Format settings {#format-settings}
For JSON input format, if setting
input_format_json_validate_types_from_metadata
is set to
1
,
the types from metadata in input data will be compared with the types of the corresponding columns from the table.
See also {#see-also}
JSONEachRow
format
output_format_json_array_of_rows
setting | {"source_file": "JSON.md"} | [
-0.0951397493481636,
0.03133395314216614,
-0.021272365003824234,
-0.00920610036700964,
-0.013173590414226055,
-0.04032646119594574,
-0.01833723485469818,
-0.017450861632823944,
-0.02042795717716217,
-0.03628533333539963,
0.018133627250790596,
-0.022157344967126846,
-0.015134771354496479,
0... |
fbe05c95-8538-4eb2-8cc7-f3f95f421d84 | alias: []
description: 'Documentation for the JSONCompactStringsEachRowWithNames format'
input_format: true
keywords: ['JSONCompactStringsEachRowWithNames']
output_format: true
slug: /interfaces/formats/JSONCompactStringsEachRowWithNames
title: 'JSONCompactStringsEachRowWithNames'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from the
JSONCompactEachRow
format in that it also prints the header row with column names, similar to the
TabSeparatedWithNames
format.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
["date", "season", "home_team", "away_team", "home_team_goals", "away_team_goals"]
["2022-04-30", "2021", "Sutton United", "Bradford City", "1", "4"]
["2022-04-30", "2021", "Swindon Town", "Barrow", "2", "1"]
["2022-04-30", "2021", "Tranmere Rovers", "Oldham Athletic", "2", "0"]
["2022-05-02", "2021", "Port Vale", "Newport County", "1", "2"]
["2022-05-02", "2021", "Salford City", "Mansfield Town", "2", "2"]
["2022-05-07", "2021", "Barrow", "Northampton Town", "1", "3"]
["2022-05-07", "2021", "Bradford City", "Carlisle United", "2", "0"]
["2022-05-07", "2021", "Bristol Rovers", "Scunthorpe United", "7", "0"]
["2022-05-07", "2021", "Exeter City", "Port Vale", "0", "1"]
["2022-05-07", "2021", "Harrogate Town A.F.C.", "Sutton United", "0", "2"]
["2022-05-07", "2021", "Hartlepool United", "Colchester United", "0", "2"]
["2022-05-07", "2021", "Leyton Orient", "Tranmere Rovers", "0", "1"]
["2022-05-07", "2021", "Mansfield Town", "Forest Green Rovers", "2", "2"]
["2022-05-07", "2021", "Newport County", "Rochdale", "0", "2"]
["2022-05-07", "2021", "Oldham Athletic", "Crawley Town", "3", "3"]
["2022-05-07", "2021", "Stevenage Borough", "Salford City", "4", "2"]
["2022-05-07", "2021", "Walsall", "Swindon Town", "0", "3"]
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONCompactStringsEachRowWithNames;
Reading data {#reading-data}
Read data using the
JSONCompactStringsEachRowWithNames
format:
sql
SELECT *
FROM football
FORMAT JSONCompactStringsEachRowWithNames
The output will be in JSON format: | {"source_file": "JSONCompactStringsEachRowWithNames.md"} | [
-0.03328109532594681,
0.025214577093720436,
-0.03576216846704483,
0.018230384215712547,
0.0066017452627420425,
0.0013683544239029288,
-0.018860137090086937,
0.11188120394945145,
0.019663309678435326,
-0.06267863512039185,
0.004890190903097391,
-0.020617850124835968,
0.05696520954370499,
0.... |
0011bac4-37dd-489a-8d0c-7b17c1777b74 | Read data using the
JSONCompactStringsEachRowWithNames
format:
sql
SELECT *
FROM football
FORMAT JSONCompactStringsEachRowWithNames
The output will be in JSON format:
json
["date", "season", "home_team", "away_team", "home_team_goals", "away_team_goals"]
["2022-04-30", "2021", "Sutton United", "Bradford City", "1", "4"]
["2022-04-30", "2021", "Swindon Town", "Barrow", "2", "1"]
["2022-04-30", "2021", "Tranmere Rovers", "Oldham Athletic", "2", "0"]
["2022-05-02", "2021", "Port Vale", "Newport County", "1", "2"]
["2022-05-02", "2021", "Salford City", "Mansfield Town", "2", "2"]
["2022-05-07", "2021", "Barrow", "Northampton Town", "1", "3"]
["2022-05-07", "2021", "Bradford City", "Carlisle United", "2", "0"]
["2022-05-07", "2021", "Bristol Rovers", "Scunthorpe United", "7", "0"]
["2022-05-07", "2021", "Exeter City", "Port Vale", "0", "1"]
["2022-05-07", "2021", "Harrogate Town A.F.C.", "Sutton United", "0", "2"]
["2022-05-07", "2021", "Hartlepool United", "Colchester United", "0", "2"]
["2022-05-07", "2021", "Leyton Orient", "Tranmere Rovers", "0", "1"]
["2022-05-07", "2021", "Mansfield Town", "Forest Green Rovers", "2", "2"]
["2022-05-07", "2021", "Newport County", "Rochdale", "0", "2"]
["2022-05-07", "2021", "Oldham Athletic", "Crawley Town", "3", "3"]
["2022-05-07", "2021", "Stevenage Borough", "Salford City", "4", "2"]
["2022-05-07", "2021", "Walsall", "Swindon Town", "0", "3"]
Format settings {#format-settings}
:::note
If setting
input_format_with_names_use_header
is set to
1
,
the columns from input data will be mapped to the columns from the table by their names, columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to
1
.
Otherwise, the first row will be skipped.
::: | {"source_file": "JSONCompactStringsEachRowWithNames.md"} | [
0.04072566330432892,
-0.03262745589017868,
-0.02174978144466877,
0.014891250059008598,
0.03770727664232254,
0.035896047949790955,
0.01010711956769228,
0.03411399573087692,
-0.0006044403417035937,
-0.010337786749005318,
0.006264714058488607,
-0.03824259713292122,
0.003029594197869301,
0.035... |
0bc0e16e-7753-40ae-a01e-1ce6d6242887 | alias: []
description: 'Documentation for the JSONAsObject format'
input_format: true
keywords: ['JSONAsObject']
output_format: false
slug: /interfaces/formats/JSONAsObject
title: 'JSONAsObject'
doc_type: 'reference'
Description {#description}
In this format, a single JSON object is interpreted as a single
JSON
value. If the input has several JSON objects (comma separated), they are interpreted as separate rows. If the input data is enclosed in square brackets, it is interpreted as an array of JSONs.
This format can only be parsed for a table with a single field of type
JSON
. The remaining columns must be set to
DEFAULT
or
MATERIALIZED
.
Example usage {#example-usage}
Basic example {#basic-example}
sql title="Query"
CREATE TABLE json_as_object (json JSON) ENGINE = Memory;
INSERT INTO json_as_object (json) FORMAT JSONAsObject {"foo":{"bar":{"x":"y"},"baz":1}},{},{"any json stucture":1}
SELECT * FROM json_as_object FORMAT JSONEachRow;
response title="Response"
{"json":{"foo":{"bar":{"x":"y"},"baz":"1"}}}
{"json":{}}
{"json":{"any json stucture":"1"}}
An array of JSON objects {#an-array-of-json-objects}
sql title="Query"
CREATE TABLE json_square_brackets (field JSON) ENGINE = Memory;
INSERT INTO json_square_brackets FORMAT JSONAsObject [{"id": 1, "name": "name1"}, {"id": 2, "name": "name2"}];
SELECT * FROM json_square_brackets FORMAT JSONEachRow;
response title="Response"
{"field":{"id":"1","name":"name1"}}
{"field":{"id":"2","name":"name2"}}
Columns with default values {#columns-with-default-values}
sql title="Query"
CREATE TABLE json_as_object (json JSON, time DateTime MATERIALIZED now()) ENGINE = Memory;
INSERT INTO json_as_object (json) FORMAT JSONAsObject {"foo":{"bar":{"x":"y"},"baz":1}};
INSERT INTO json_as_object (json) FORMAT JSONAsObject {};
INSERT INTO json_as_object (json) FORMAT JSONAsObject {"any json stucture":1}
SELECT time, json FROM json_as_object FORMAT JSONEachRow
response title="Response"
{"time":"2024-09-16 12:18:10","json":{}}
{"time":"2024-09-16 12:18:13","json":{"any json stucture":"1"}}
{"time":"2024-09-16 12:18:08","json":{"foo":{"bar":{"x":"y"},"baz":"1"}}}
Format settings {#format-settings} | {"source_file": "JSONAsObject.md"} | [
-0.027322720736265182,
0.011871302500367165,
-0.04405848681926727,
0.03734530881047249,
-0.10803281515836716,
0.003035958157852292,
0.008581791073083878,
0.10496018826961517,
-0.0019236705265939236,
-0.008643186651170254,
-0.03363344818353653,
-0.029650473967194557,
0.0465877503156662,
0.0... |
733e04cf-b525-40dd-bbdd-51f9562b9236 | description: 'List of format settings for the JSON format'
keywords: ['Format Settings', 'JSON']
slug: /interfaces/formats/JSON/format-settings
title: 'Format Settings For JSON'
doc_type: 'reference'
On this page you can find format settings common to all JSON formats. | {"source_file": "format-settings.md"} | [
0.015956910327076912,
0.014136658050119877,
-0.04545145481824875,
-0.005060394294559956,
-0.06257282942533493,
0.04009891301393509,
-0.11214333772659302,
0.06147804111242294,
-0.03870242461562157,
-0.0026323918718844652,
0.0037015313282608986,
0.0077309212647378445,
-0.040896981954574585,
... |
4ef692d6-361b-4c37-a8ea-746d5d4cf399 | | Setting | Description | Default | Note |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
input_format_import_nested_json
| Map nested JSON data to nested tables (it works for JSONEachRow format). |
false
| |
|
input_format_json_read_bools_as_numbers
| Allow to parse bools as numbers in JSON input formats. |
true
| |
|
input_format_json_read_bools_as_strings
| Allow to parse bools as strings in JSON input formats. |
true
| |
|
input_format_json_read_numbers_as_strings
| Allow to parse numbers as strings in JSON input formats. |
true
| |
|
input_format_json_read_arrays_as_strings | {"source_file": "format-settings.md"} | [
0.022060967981815338,
0.04900585114955902,
0.008427473716437817,
-0.007670189253985882,
-0.05401024594902992,
0.07124056667089462,
0.019960740581154823,
0.05033845826983452,
0.022779367864131927,
-0.04521459341049194,
0.024960732087492943,
-0.04907982423901558,
-0.031919945031404495,
-0.03... |
8d1de5b5-f6fc-46e9-aa26-d9350a9d93af | |
input_format_json_read_arrays_as_strings
| Allow to parse JSON arrays as strings in JSON input formats. |
true
| |
|
input_format_json_read_objects_as_strings
| Allow to parse JSON objects as strings in JSON input formats. |
true
| |
|
input_format_json_named_tuples_as_objects
| Parse named tuple columns as JSON objects. |
true
| |
|
input_format_json_try_infer_numbers_from_strings
| Try to infer numbers from string fields while schema inference. |
false
| |
|
input_format_json_try_infer_named_tuples_from_objects
| Try to infer named tuple from JSON objects during schema inference. |
true
| |
|
input_format_json_infer_incomplete_types_as_strings
| Use type String for keys that contains only Nulls or empty objects/arrays during schema inference in JSON input formats. |
true
| |
|
input_format_json_defaults_for_missing_elements_in_named_tuple
| Insert default values for missing elements in JSON object while parsing named tuple. |
true
| |
| | {"source_file": "format-settings.md"} | [
-0.005721475929021835,
-0.03014274872839451,
-0.04202527552843094,
0.02290867455303669,
0.0022576814517378807,
-0.01720403879880905,
-0.07433857768774033,
0.009168150834739208,
-0.0985991507768631,
-0.031777430325746536,
0.0029234092216938734,
-0.04433605819940567,
0.02336600422859192,
0.0... |
6d885f98-9788-44ff-b3ce-562e91497012 | | |
|
input_format_json_ignore_unknown_keys_in_named_tuple
| Ignore unknown keys in json object for named tuples. |
false
| |
|
input_format_json_compact_allow_variable_number_of_columns
| Allow variable number of columns in JSONCompact/JSONCompactEachRow format, ignore extra columns and use default values on missing columns. |
false
| |
|
input_format_json_throw_on_bad_escape_sequence
| Throw an exception if JSON string contains bad escape sequence. If disabled, bad escape sequences will remain as is in the data. |
true
| |
|
input_format_json_empty_as_default
| Treat empty fields in JSON input as default values. |
false
| For complex default expressions
input_format_defaults_for_omitted_fields
must be enabled too. |
|
output_format_json_quote_64bit_integers
| Controls quoting of 64-bit integers in JSON output format. |
true
| |
|
output_format_json_quote_64bit_floats
| Controls quoting of 64-bit floats in JSON output format. |
false
| |
|
output_format_json_quote_denormals
| Enables '+nan', '-nan', '+inf', '-inf' outputs in JSON output format. |
false | {"source_file": "format-settings.md"} | [
-0.03043965995311737,
0.005465464200824499,
-0.08577374368906021,
0.0770486369729042,
0.00487026572227478,
-0.009176586754620075,
-0.08821368962526321,
0.019081151112914085,
-0.09260125458240509,
-0.018838336691260338,
0.04202932119369507,
-0.03948403149843216,
0.053485509008169174,
-0.032... |
feef4a2c-1646-4f5e-b671-945159ed6ff6 | false
| |
|
output_format_json_quote_decimals
| Controls quoting of decimals in JSON output format. |
false
| |
|
output_format_json_escape_forward_slashes
| Controls escaping forward slashes for string outputs in JSON output format. |
true
| |
|
output_format_json_named_tuples_as_objects
| Serialize named tuple columns as JSON objects. |
true
| |
|
output_format_json_array_of_rows
| Output a JSON array of all rows in JSONEachRow(Compact) format. |
false
| |
|
output_format_json_validate_utf8
| Enables validation of UTF-8 sequences in JSON output formats |
false
| Note that it doesn't impact formats JSON/JSONCompact/JSONColumnsWithMetadata, they always validate utf8. | | {"source_file": "format-settings.md"} | [
-0.03518266603350639,
-0.007374642416834831,
-0.08736071735620499,
0.03698796406388283,
-0.027786966413259506,
-0.009718547575175762,
-0.09505656361579895,
-0.022476306185126305,
-0.027723684906959534,
-0.0012411598581820726,
0.015266654081642628,
-0.056402262300252914,
0.015823902562260628,... |
c9fd7d07-b821-454e-84f3-bbf75172f90f | alias: []
description: 'Documentation for the JSONObjectEachRow format'
input_format: true
keywords: ['JSONObjectEachRow']
output_format: true
slug: /interfaces/formats/JSONObjectEachRow
title: 'JSONObjectEachRow'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
In this format, all data is represented as a single JSON Object, with each row represented as a separate field of this object similar to the
JSONEachRow
format.
Example usage {#example-usage}
Basic example {#basic-example}
Given some JSON:
json
{
"row_1": {"num": 42, "str": "hello", "arr": [0,1]},
"row_2": {"num": 43, "str": "hello", "arr": [0,1,2]},
"row_3": {"num": 44, "str": "hello", "arr": [0,1,2,3]}
}
To use an object name as a column value you can use the special setting
format_json_object_each_row_column_for_object_name
.
The value of this setting is set to the name of a column, that is used as JSON key for a row in the resulting object.
Output {#output}
Let's say we have the table
test
with two columns:
text
ββobject_nameββ¬βnumberββ
β first_obj β 1 β
β second_obj β 2 β
β third_obj β 3 β
βββββββββββββββ΄βββββββββ
Let's output it in the
JSONObjectEachRow
format and use the
format_json_object_each_row_column_for_object_name
setting:
sql title="Query"
SELECT * FROM test SETTINGS format_json_object_each_row_column_for_object_name='object_name'
json title="Response"
{
"first_obj": {"number": 1},
"second_obj": {"number": 2},
"third_obj": {"number": 3}
}
Input {#input}
Let's say we stored the output from the previous example in a file named
data.json
:
sql title="Query"
SELECT * FROM file('data.json', JSONObjectEachRow, 'object_name String, number UInt64') SETTINGS format_json_object_each_row_column_for_object_name='object_name'
response title="Response"
ββobject_nameββ¬βnumberββ
β first_obj β 1 β
β second_obj β 2 β
β third_obj β 3 β
βββββββββββββββ΄βββββββββ
It also works for schema inference:
sql title="Query"
DESCRIBE file('data.json', JSONObjectEachRow) SETTING format_json_object_each_row_column_for_object_name='object_name'
response title="Response"
ββnameβββββββββ¬βtypeβββββββββββββ
β object_name β String β
β number β Nullable(Int64) β
βββββββββββββββ΄ββββββββββββββββββ
Inserting data {#json-inserting-data}
sql title="Query"
INSERT INTO UserActivity FORMAT JSONEachRow {"PageViews":5, "UserID":"4324182021466249494", "Duration":146,"Sign":-1} {"UserID":"4324182021466249494","PageViews":6,"Duration":185,"Sign":1}
ClickHouse allows:
Any order of key-value pairs in the object.
Omitting some values.
ClickHouse ignores spaces between elements and commas after the objects. You can pass all the objects in one line. You do not have to separate them with line breaks.
Omitted values processing {#omitted-values-processing} | {"source_file": "JSONObjectEachRow.md"} | [
-0.042630717158317566,
0.05144912004470825,
0.011191681027412415,
0.02534942887723446,
-0.04288291186094284,
0.0042592547833919525,
-0.0077628400176763535,
0.04923126846551895,
0.02388782799243927,
-0.02706005983054638,
-0.030899185687303543,
-0.008682899177074432,
0.010102445259690285,
0.... |
b112bb4d-df1f-4a20-bd21-6bcd871d35f5 | Omitted values processing {#omitted-values-processing}
ClickHouse substitutes omitted values with the default values for the corresponding
data types
.
If
DEFAULT expr
is specified, ClickHouse uses different substitution rules depending on the
input_format_defaults_for_omitted_fields
setting.
Consider the following table:
sql title="Query"
CREATE TABLE IF NOT EXISTS example_table
(
x UInt32,
a DEFAULT x * 2
) ENGINE = Memory;
If
input_format_defaults_for_omitted_fields = 0
, then the default value for
x
and
a
equals
0
(as the default value for the
UInt32
data type).
If
input_format_defaults_for_omitted_fields = 1
, then the default value for
x
equals
0
, but the default value of
a
equals
x * 2
.
:::note
When inserting data with
input_format_defaults_for_omitted_fields = 1
, ClickHouse consumes more computational resources, compared to insertion with
input_format_defaults_for_omitted_fields = 0
.
:::
Selecting data {#json-selecting-data}
Consider the
UserActivity
table as an example:
response
βββββββββββββββUserIDββ¬βPageViewsββ¬βDurationββ¬βSignββ
β 4324182021466249494 β 5 β 146 β -1 β
β 4324182021466249494 β 6 β 185 β 1 β
βββββββββββββββββββββββ΄ββββββββββββ΄βββββββββββ΄βββββββ
The query
SELECT * FROM UserActivity FORMAT JSONEachRow
returns:
response
{"UserID":"4324182021466249494","PageViews":5,"Duration":146,"Sign":-1}
{"UserID":"4324182021466249494","PageViews":6,"Duration":185,"Sign":1}
Unlike the
JSON
format, there is no substitution of invalid UTF-8 sequences. Values are escaped in the same way as for
JSON
.
:::info
Any set of bytes can be output in the strings. Use the
JSONEachRow
format if you are sure that the data in the table can be formatted as JSON without losing any information.
:::
Usage of Nested Structures {#jsoneachrow-nested}
If you have a table with the
Nested
data type columns, you can insert JSON data with the same structure. Enable this feature with the
input_format_import_nested_json
setting.
For example, consider the following table:
sql
CREATE TABLE json_each_row_nested (n Nested (s String, i Int32) ) ENGINE = Memory
As you can see in the
Nested
data type description, ClickHouse treats each component of the nested structure as a separate column (
n.s
and
n.i
for our table). You can insert data in the following way:
sql
INSERT INTO json_each_row_nested FORMAT JSONEachRow {"n.s": ["abc", "def"], "n.i": [1, 23]}
To insert data as a hierarchical JSON object, set
input_format_import_nested_json=1
.
json
{
"n": {
"s": ["abc", "def"],
"i": [1, 23]
}
}
Without this setting, ClickHouse throws an exception.
sql title="Query"
SELECT name, value FROM system.settings WHERE name = 'input_format_import_nested_json'
response title="Response"
ββnameβββββββββββββββββββββββββββββ¬βvalueββ
β input_format_import_nested_json β 0 β
βββββββββββββββββββββββββββββββββββ΄ββββββββ | {"source_file": "JSONObjectEachRow.md"} | [
-0.004522262141108513,
0.013202465139329433,
-0.024968648329377174,
0.08135589957237244,
-0.06230001896619797,
-0.06705258786678314,
0.01277003064751625,
-0.010707978159189224,
0.01252293586730957,
-0.006342532578855753,
0.08791758120059967,
-0.05516277626156807,
0.024012379348278046,
-0.0... |
d09bb1c6-b110-4f5f-a54a-24725858cb17 | response title="Response"
ββnameβββββββββββββββββββββββββββββ¬βvalueββ
β input_format_import_nested_json β 0 β
βββββββββββββββββββββββββββββββββββ΄ββββββββ
sql title="Query"
INSERT INTO json_each_row_nested FORMAT JSONEachRow {"n": {"s": ["abc", "def"], "i": [1, 23]}}
response title="Response"
Code: 117. DB::Exception: Unknown field found while parsing JSONEachRow format: n: (at row 1)
sql title="Query"
SET input_format_import_nested_json=1
INSERT INTO json_each_row_nested FORMAT JSONEachRow {"n": {"s": ["abc", "def"], "i": [1, 23]}}
SELECT * FROM json_each_row_nested
response title="Response"
ββn.sββββββββββββ¬βn.iβββββ
β ['abc','def'] β [1,23] β
βββββββββββββββββ΄βββββββββ
Format settings {#format-settings} | {"source_file": "JSONObjectEachRow.md"} | [
-0.0035183648578822613,
-0.006004157941788435,
0.028754232451319695,
0.04411999136209488,
-0.09353823214769363,
0.0015178886242210865,
-0.0679827630519867,
0.02103678323328495,
-0.024869147688150406,
-0.031449057161808014,
-0.018429456278681755,
-0.03129175305366516,
0.025462942197918892,
... |
1167ac3a-4144-4859-afa1-420fd1753fa6 | | Setting | Description | Default | Notes |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
input_format_import_nested_json
| map nested JSON data to nested tables (it works for JSONEachRow format). |
false
| |
|
input_format_json_read_bools_as_numbers
| allow to parse bools as numbers in JSON input formats. |
true
| |
|
input_format_json_read_bools_as_strings
| allow to parse bools as strings in JSON input formats. |
true
| |
|
input_format_json_read_numbers_as_strings
| allow to parse numbers as strings in JSON input formats. |
true
| |
| | {"source_file": "JSONObjectEachRow.md"} | [
-0.02901778183877468,
0.028109563514590263,
-0.003990069963037968,
-0.015314175747334957,
-0.07038140296936035,
0.09737928211688995,
0.013652482070028782,
0.04922390356659889,
0.015592038631439209,
-0.04112617298960686,
0.04333633556962013,
-0.025499677285552025,
-0.037826769053936005,
-0.... |
97b1993c-958e-4d95-baaa-8cc9d0ab40c7 | | |
|
input_format_json_read_arrays_as_strings
| allow to parse JSON arrays as strings in JSON input formats. |
true
| |
|
input_format_json_read_objects_as_strings
| allow to parse JSON objects as strings in JSON input formats. |
true
| |
|
input_format_json_named_tuples_as_objects
| parse named tuple columns as JSON objects. |
true
| |
|
input_format_json_try_infer_numbers_from_strings
| try to infer numbers from string fields while schema inference. |
false
| |
|
input_format_json_try_infer_named_tuples_from_objects
| try to infer named tuple from JSON objects during schema inference. |
true
| |
|
input_format_json_infer_incomplete_types_as_strings
| use type String for keys that contains only Nulls or empty objects/arrays during schema inference in JSON input formats. |
true
| |
| | {"source_file": "JSONObjectEachRow.md"} | [
-0.009267998859286308,
-0.023197462782263756,
-0.036493610590696335,
0.013133159838616848,
0.0014847296988591552,
-0.017109736800193787,
-0.061544787138700485,
0.005293153692036867,
-0.09630097448825836,
-0.03177689015865326,
-0.0041820453479886055,
-0.030460165813565254,
0.00983065366744995... |
89b9015a-dce0-4e10-912e-b13661a3b4c5 | | |
|
input_format_json_defaults_for_missing_elements_in_named_tuple
| insert default values for missing elements in JSON object while parsing named tuple. |
true
| |
|
input_format_json_ignore_unknown_keys_in_named_tuple
| ignore unknown keys in json object for named tuples. |
false
| |
|
input_format_json_compact_allow_variable_number_of_columns
| allow variable number of columns in JSONCompact/JSONCompactEachRow format, ignore extra columns and use default values on missing columns. |
false
| |
|
input_format_json_throw_on_bad_escape_sequence
| throw an exception if JSON string contains bad escape sequence. If disabled, bad escape sequences will remain as is in the data. |
true
| |
|
input_format_json_empty_as_default
| treat empty fields in JSON input as default values. |
false
. | For complex default expressions
input_format_defaults_for_omitted_fields
must be enabled too. |
|
output_format_json_quote_64bit_integers
| controls quoting of 64-bit integers in JSON output format. |
true
| |
|
output_format_json_quote_64bit_floats | {"source_file": "JSONObjectEachRow.md"} | [
-0.039569757878780365,
0.01182891707867384,
-0.04462398961186409,
0.07772110402584076,
0.005385734140872955,
-0.009345294907689095,
-0.09590870141983032,
0.010909601114690304,
-0.07407210022211075,
-0.02420123666524887,
0.05074618011713028,
-0.05617334693670273,
0.04618874937295914,
-0.042... |
986102ef-d6b9-4092-9b0d-afc360b91289 | |
output_format_json_quote_64bit_floats
| controls quoting of 64-bit floats in JSON output format. |
false
| |
|
output_format_json_quote_denormals
| enables '+nan', '-nan', '+inf', '-inf' outputs in JSON output format. |
false
| |
|
output_format_json_quote_decimals
| controls quoting of decimals in JSON output format. |
false
| |
|
output_format_json_escape_forward_slashes
| controls escaping forward slashes for string outputs in JSON output format. |
true
| |
|
output_format_json_named_tuples_as_objects
| serialize named tuple columns as JSON objects. |
true
| |
|
output_format_json_array_of_rows
| output a JSON array of all rows in JSONEachRow(Compact) format. |
false
| |
|
output_format_json_validate_utf8 | {"source_file": "JSONObjectEachRow.md"} | [
-0.026566363871097565,
-0.008779617957770824,
-0.08986124396324158,
0.0233372263610363,
-0.026236940175294876,
-0.04348386079072952,
-0.06612272560596466,
-0.011721236631274223,
-0.06490957736968994,
0.030422963201999664,
0.010797012597322464,
-0.08064272999763489,
-0.01947539672255516,
0.... |
c55f4de9-08e5-416a-a9bf-994ed3736a49 | |
output_format_json_validate_utf8
| enables validation of UTF-8 sequences in JSON output formats (note that it doesn't impact formats JSON/JSONCompact/JSONColumnsWithMetadata, they always validate utf8). |
false
| | | {"source_file": "JSONObjectEachRow.md"} | [
-0.02474149502813816,
0.014296007342636585,
-0.03501414880156517,
-0.03928409516811371,
-0.002728889463469386,
-0.0016231078188866377,
-0.07903388142585754,
-0.012124796397984028,
-0.007835006341338158,
-0.0360749326646328,
0.03909873589873314,
-0.0035877793561667204,
0.015372293069958687,
... |
cff26e6e-c4cb-487c-9aad-6412efa38e86 | description: 'Documentation for the JSONStringsEachRowWithProgress format'
keywords: ['JSONStringsEachRowWithProgress']
slug: /interfaces/formats/JSONStringsEachRowWithProgress
title: 'JSONStringsEachRowWithProgress'
doc_type: 'reference'
Description {#description}
Differs from
JSONEachRow
/
JSONStringsEachRow
in that ClickHouse will also yield progress information as JSON values.
Example usage {#example-usage}
json
{"row":{"num":42,"str":"hello","arr":[0,1]}}
{"row":{"num":43,"str":"hello","arr":[0,1,2]}}
{"row":{"num":44,"str":"hello","arr":[0,1,2,3]}}
{"progress":{"read_rows":"3","read_bytes":"24","written_rows":"0","written_bytes":"0","total_rows_to_read":"3"}}
Format settings {#format-settings} | {"source_file": "JSONStringsEachRowWithProgress.md"} | [
-0.029737019911408424,
0.04592830315232277,
-0.027690282091498375,
0.027736276388168335,
-0.04829244688153267,
0.0043571460992097855,
-0.019660256803035736,
-0.009839852340519428,
-0.013133938424289227,
-0.04851514846086502,
-0.050631795078516006,
0.014475256204605103,
-0.023787004873156548,... |
19204e70-a52a-4b6f-b129-96d93900667e | alias: []
description: 'Documentation for the JSONCompactEachRowWithNamesAndTypes format'
input_format: true
keywords: ['JSONCompactEachRowWithNamesAndTypes']
output_format: true
slug: /interfaces/formats/JSONCompactEachRowWithNamesAndTypes
title: 'JSONCompactEachRowWithNamesAndTypes'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from the
JSONCompactEachRow
format in that it also prints two header rows with column names and types, similar to the
TabSeparatedWithNamesAndTypes
format.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
["date", "season", "home_team", "away_team", "home_team_goals", "away_team_goals"]
["Date", "Int16", "LowCardinality(String)", "LowCardinality(String)", "Int8", "Int8"]
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4]
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1]
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0]
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2]
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2]
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3]
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0]
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0]
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1]
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2]
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2]
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1]
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2]
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2]
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3]
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2]
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONCompactEachRowWithNamesAndTypes;
Reading data {#reading-data}
Read data using the
JSONCompactEachRowWithNamesAndTypes
format:
sql
SELECT *
FROM football
FORMAT JSONCompactEachRowWithNamesAndTypes
The output will be in JSON format: | {"source_file": "JSONCompactEachRowWithNamesAndTypes.md"} | [
-0.03945286199450493,
0.005674260202795267,
-0.03949977830052376,
-0.00351484352722764,
0.019314218312501907,
-0.010058690793812275,
-0.019449833780527115,
0.08575597405433655,
0.019393211230635643,
-0.05901801958680153,
0.012673838995397091,
-0.015434764325618744,
0.04753510653972626,
0.0... |
2b1e9f77-f2b9-4ad5-8ed6-a6e707c4d0dc | Read data using the
JSONCompactEachRowWithNamesAndTypes
format:
sql
SELECT *
FROM football
FORMAT JSONCompactEachRowWithNamesAndTypes
The output will be in JSON format:
json
["date", "season", "home_team", "away_team", "home_team_goals", "away_team_goals"]
["Date", "Int16", "LowCardinality(String)", "LowCardinality(String)", "Int8", "Int8"]
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4]
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1]
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0]
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2]
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2]
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3]
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0]
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0]
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1]
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2]
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2]
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1]
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2]
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2]
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3]
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2]
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
Format settings {#format-settings}
:::note
If setting
input_format_with_names_use_header
is set to
1
,
the columns from input data will be mapped to the columns from the table by their names, columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to 1.
Otherwise, the first row will be skipped.
If setting
input_format_with_types_use_header
is set to
1
,
the types from input data will be compared with the types of the corresponding columns from the table. Otherwise, the second row will be skipped.
::: | {"source_file": "JSONCompactEachRowWithNamesAndTypes.md"} | [
0.0504864901304245,
-0.014211977832019329,
-0.016740282997488976,
0.009803966619074345,
0.036916907876729965,
0.028486475348472595,
0.0018709213472902775,
0.037116166204214096,
-0.0029163931030780077,
-0.016431204974651337,
-0.006002758163958788,
-0.03645893558859825,
-0.0031582252122461796,... |
142b1b22-be46-443d-83ad-5b4308996977 | alias: []
description: 'Documentation for the JSONCompactStrings format'
input_format: false
keywords: ['JSONCompactStrings']
output_format: true
slug: /interfaces/formats/JSONCompactStrings
title: 'JSONCompactStrings'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
The
JSONCompactStrings
format differs from
JSONStrings
only in that data rows are output as arrays, not as objects.
Example usage {#example-usage}
Reading data {#reading-data}
Read data using the
JSONCompactStrings
format:
sql
SELECT *
FROM football
FORMAT JSONCompactStrings
The output will be in JSON format:
```json
{
"meta":
[
{
"name": "date",
"type": "Date"
},
{
"name": "season",
"type": "Int16"
},
{
"name": "home_team",
"type": "LowCardinality(String)"
},
{
"name": "away_team",
"type": "LowCardinality(String)"
},
{
"name": "home_team_goals",
"type": "Int8"
},
{
"name": "away_team_goals",
"type": "Int8"
}
],
"data":
[
["2022-04-30", "2021", "Sutton United", "Bradford City", "1", "4"],
["2022-04-30", "2021", "Swindon Town", "Barrow", "2", "1"],
["2022-04-30", "2021", "Tranmere Rovers", "Oldham Athletic", "2", "0"],
["2022-05-02", "2021", "Port Vale", "Newport County", "1", "2"],
["2022-05-02", "2021", "Salford City", "Mansfield Town", "2", "2"],
["2022-05-07", "2021", "Barrow", "Northampton Town", "1", "3"],
["2022-05-07", "2021", "Bradford City", "Carlisle United", "2", "0"],
["2022-05-07", "2021", "Bristol Rovers", "Scunthorpe United", "7", "0"],
["2022-05-07", "2021", "Exeter City", "Port Vale", "0", "1"],
["2022-05-07", "2021", "Harrogate Town A.F.C.", "Sutton United", "0", "2"],
["2022-05-07", "2021", "Hartlepool United", "Colchester United", "0", "2"],
["2022-05-07", "2021", "Leyton Orient", "Tranmere Rovers", "0", "1"],
["2022-05-07", "2021", "Mansfield Town", "Forest Green Rovers", "2", "2"],
["2022-05-07", "2021", "Newport County", "Rochdale", "0", "2"],
["2022-05-07", "2021", "Oldham Athletic", "Crawley Town", "3", "3"],
["2022-05-07", "2021", "Stevenage Borough", "Salford City", "4", "2"],
["2022-05-07", "2021", "Walsall", "Swindon Town", "0", "3"]
],
"rows": 17,
"statistics":
{
"elapsed": 0.112012501,
"rows_read": 0,
"bytes_read": 0
}
}
```
Format settings {#format-settings} | {"source_file": "JSONCompactStrings.md"} | [
-0.018416985869407654,
0.000012823234101233538,
0.021516727283596992,
0.0330597348511219,
-0.024242479354143143,
-0.03707457706332207,
0.004039804916828871,
0.10711420327425003,
0.03217747062444687,
-0.047328703105449677,
-0.008327593095600605,
-0.014573496766388416,
0.0282426867634058,
0.... |
af07d525-8cb3-411d-a109-8a024b3a962d | alias: ['JSONLines', 'NDJSON']
description: 'Documentation for the JSONEachRow format'
keywords: ['JSONEachRow']
slug: /interfaces/formats/JSONEachRow
title: 'JSONEachRow'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-----------------------|
| β | β |
JSONLines
,
NDJSON
|
Description {#description}
In this format, ClickHouse outputs each row as a separated, newline-delimited JSON Object.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
{"date":"2022-04-30","season":2021,"home_team":"Sutton United","away_team":"Bradford City","home_team_goals":1,"away_team_goals":4}
{"date":"2022-04-30","season":2021,"home_team":"Swindon Town","away_team":"Barrow","home_team_goals":2,"away_team_goals":1}
{"date":"2022-04-30","season":2021,"home_team":"Tranmere Rovers","away_team":"Oldham Athletic","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-02","season":2021,"home_team":"Port Vale","away_team":"Newport County","home_team_goals":1,"away_team_goals":2}
{"date":"2022-05-02","season":2021,"home_team":"Salford City","away_team":"Mansfield Town","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Barrow","away_team":"Northampton Town","home_team_goals":1,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Bradford City","away_team":"Carlisle United","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Bristol Rovers","away_team":"Scunthorpe United","home_team_goals":7,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Exeter City","away_team":"Port Vale","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Harrogate Town A.F.C.","away_team":"Sutton United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Hartlepool United","away_team":"Colchester United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Leyton Orient","away_team":"Tranmere Rovers","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Mansfield Town","away_team":"Forest Green Rovers","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Newport County","away_team":"Rochdale","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Oldham Athletic","away_team":"Crawley Town","home_team_goals":3,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Stevenage Borough","away_team":"Salford City","home_team_goals":4,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Walsall","away_team":"Swindon Town","home_team_goals":0,"away_team_goals":3}
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONEachRow;
Reading data {#reading-data} | {"source_file": "JSONEachRow.md"} | [
-0.047639016062021255,
-0.0019652126356959343,
-0.02422293834388256,
-0.030811749398708344,
-0.016362473368644714,
0.0015810305485501885,
-0.026436781510710716,
0.027527030557394028,
0.000008850356607581489,
-0.033081717789173126,
0.0069432612508535385,
-0.01944604143500328,
-0.0015634133014... |
f02352c7-96a7-41eb-a265-84a04c2fd843 | Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONEachRow;
Reading data {#reading-data}
Read data using the
JSONEachRow
format:
sql
SELECT *
FROM football
FORMAT JSONEachRow
The output will be in JSON format:
json
{"date":"2022-04-30","season":2021,"home_team":"Sutton United","away_team":"Bradford City","home_team_goals":1,"away_team_goals":4}
{"date":"2022-04-30","season":2021,"home_team":"Swindon Town","away_team":"Barrow","home_team_goals":2,"away_team_goals":1}
{"date":"2022-04-30","season":2021,"home_team":"Tranmere Rovers","away_team":"Oldham Athletic","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-02","season":2021,"home_team":"Port Vale","away_team":"Newport County","home_team_goals":1,"away_team_goals":2}
{"date":"2022-05-02","season":2021,"home_team":"Salford City","away_team":"Mansfield Town","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Barrow","away_team":"Northampton Town","home_team_goals":1,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Bradford City","away_team":"Carlisle United","home_team_goals":2,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Bristol Rovers","away_team":"Scunthorpe United","home_team_goals":7,"away_team_goals":0}
{"date":"2022-05-07","season":2021,"home_team":"Exeter City","away_team":"Port Vale","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Harrogate Town A.F.C.","away_team":"Sutton United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Hartlepool United","away_team":"Colchester United","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Leyton Orient","away_team":"Tranmere Rovers","home_team_goals":0,"away_team_goals":1}
{"date":"2022-05-07","season":2021,"home_team":"Mansfield Town","away_team":"Forest Green Rovers","home_team_goals":2,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Newport County","away_team":"Rochdale","home_team_goals":0,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Oldham Athletic","away_team":"Crawley Town","home_team_goals":3,"away_team_goals":3}
{"date":"2022-05-07","season":2021,"home_team":"Stevenage Borough","away_team":"Salford City","home_team_goals":4,"away_team_goals":2}
{"date":"2022-05-07","season":2021,"home_team":"Walsall","away_team":"Swindon Town","home_team_goals":0,"away_team_goals":3}
Importing data columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to 1.
Format settings {#format-settings} | {"source_file": "JSONEachRow.md"} | [
0.02863660641014576,
-0.016808589920401573,
-0.008777845650911331,
-0.01855970174074173,
0.03583308309316635,
0.05476686358451843,
-0.029548993334174156,
0.07105011492967606,
-0.005260718986392021,
0.018470199778676033,
0.011196517385542393,
-0.0358392596244812,
0.013906578533351421,
-0.01... |
10034c5f-c418-437c-96a5-b703f6da5029 | alias: []
description: 'Documentation for the JSONEachRowWithProgress format'
input_format: false
keywords: ['JSONEachRowWithProgress']
output_format: true
slug: /interfaces/formats/JSONEachRowWithProgress
title: 'JSONEachRowWithProgress'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from
JSONEachRow
/
JSONStringsEachRow
in that ClickHouse will also yield progress information as JSON values.
Example usage {#example-usage}
json
{"row":{"num":42,"str":"hello","arr":[0,1]}}
{"row":{"num":43,"str":"hello","arr":[0,1,2]}}
{"row":{"num":44,"str":"hello","arr":[0,1,2,3]}}
{"progress":{"read_rows":"3","read_bytes":"24","written_rows":"0","written_bytes":"0","total_rows_to_read":"3"}}
Format settings {#format-settings} | {"source_file": "JSONEachRowWithProgress.md"} | [
-0.048108410090208054,
0.03378559648990631,
-0.04223011061549187,
0.014199400320649147,
-0.026753205806016922,
-0.0004781351890414953,
0.004478272050619125,
0.010901271365582943,
-0.004299357999116182,
-0.05605204403400421,
-0.024997452273964882,
-0.015509269200265408,
-0.0035361438058316708... |
0baed967-55b5-4e42-878d-12cd9185ba35 | alias: ['PrettyJSONLines', 'PrettyNDJSON']
description: 'Documentation for the PrettyJSONLines format'
input_format: false
keywords: ['PrettyJSONEachRow', 'PrettyJSONLines', 'PrettyNDJSON']
output_format: true
slug: /interfaces/formats/PrettyJSONEachRow
title: 'PrettyJSONEachRow'
doc_type: 'guide'
| Input | Output | Alias |
|-------|--------|-----------------------------------|
| β | β |
PrettyJSONLines
,
PrettyNDJSON
|
Description {#description}
Differs from
JSONEachRow
only in that JSON is pretty formatted with new line delimiters and 4 space indents.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
: | {"source_file": "PrettyJSONEachRow.md"} | [
-0.06959322839975357,
0.019289793446660042,
0.05236958712339401,
0.009705953299999237,
0.008549034595489502,
-0.009299647063016891,
-0.07320041209459305,
0.09251486510038376,
0.02453390322625637,
-0.055369388312101364,
-0.003922916483134031,
0.033829428255558014,
-0.03187517449259758,
0.04... |
d6989618-2df2-42c3-bf4f-5742adedc085 | Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
{
"date": "2022-04-30",
"season": 2021,
"home_team": "Sutton United",
"away_team": "Bradford City",
"home_team_goals": 1,
"away_team_goals": 4
}
{
"date": "2022-04-30",
"season": 2021,
"home_team": "Swindon Town",
"away_team": "Barrow",
"home_team_goals": 2,
"away_team_goals": 1
}
{
"date": "2022-04-30",
"season": 2021,
"home_team": "Tranmere Rovers",
"away_team": "Oldham Athletic",
"home_team_goals": 2,
"away_team_goals": 0
}
{
"date": "2022-05-02",
"season": 2021,
"home_team": "Port Vale",
"away_team": "Newport County",
"home_team_goals": 1,
"away_team_goals": 2
}
{
"date": "2022-05-02",
"season": 2021,
"home_team": "Salford City",
"away_team": "Mansfield Town",
"home_team_goals": 2,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Barrow",
"away_team": "Northampton Town",
"home_team_goals": 1,
"away_team_goals": 3
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Bradford City",
"away_team": "Carlisle United",
"home_team_goals": 2,
"away_team_goals": 0
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Bristol Rovers",
"away_team": "Scunthorpe United",
"home_team_goals": 7,
"away_team_goals": 0
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Exeter City",
"away_team": "Port Vale",
"home_team_goals": 0,
"away_team_goals": 1
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Harrogate Town A.F.C.",
"away_team": "Sutton United",
"home_team_goals": 0,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Hartlepool United",
"away_team": "Colchester United",
"home_team_goals": 0,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Leyton Orient",
"away_team": "Tranmere Rovers",
"home_team_goals": 0,
"away_team_goals": 1
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Mansfield Town",
"away_team": "Forest Green Rovers",
"home_team_goals": 2,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Newport County",
"away_team": "Rochdale",
"home_team_goals": 0,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Oldham Athletic",
"away_team": "Crawley Town",
"home_team_goals": 3,
"away_team_goals": 3
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Stevenage Borough",
"away_team": "Salford City",
"home_team_goals": 4,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Walsall",
"away_team": "Swindon Town",
"home_team_goals": 0,
"away_team_goals": 3
} | {"source_file": "PrettyJSONEachRow.md"} | [
-0.00042875579674728215,
0.028541384264826775,
-0.010230212472379208,
-0.020376838743686676,
0.03129515424370766,
0.01828739233314991,
-0.017747139558196068,
0.05312972888350487,
0.00832764059305191,
0.008791454136371613,
0.03935470059514046,
-0.021981768310070038,
0.01961740478873253,
0.0... |
5b35552f-b208-4e53-8122-d943f1fc4283 | Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT PrettyJSONEachRow;
Reading data {#reading-data}
Read data using the
PrettyJSONEachRow
format:
sql
SELECT *
FROM football
FORMAT PrettyJSONEachRow
The output will be in JSON format: | {"source_file": "PrettyJSONEachRow.md"} | [
0.024663308635354042,
0.010667934082448483,
-0.0044859363697469234,
-0.0068755499087274075,
-0.023806216195225716,
0.025290291756391525,
-0.02377275377511978,
0.10853752493858337,
-0.020141467452049255,
-0.00044547184370458126,
0.001971404068171978,
0.010924302041530609,
0.012726937420666218... |
88edc392-41cc-48c0-abf0-a040aa65a5e9 | sql
SELECT *
FROM football
FORMAT PrettyJSONEachRow
The output will be in JSON format:
json
{
"date": "2022-04-30",
"season": 2021,
"home_team": "Sutton United",
"away_team": "Bradford City",
"home_team_goals": 1,
"away_team_goals": 4
}
{
"date": "2022-04-30",
"season": 2021,
"home_team": "Swindon Town",
"away_team": "Barrow",
"home_team_goals": 2,
"away_team_goals": 1
}
{
"date": "2022-04-30",
"season": 2021,
"home_team": "Tranmere Rovers",
"away_team": "Oldham Athletic",
"home_team_goals": 2,
"away_team_goals": 0
}
{
"date": "2022-05-02",
"season": 2021,
"home_team": "Port Vale",
"away_team": "Newport County",
"home_team_goals": 1,
"away_team_goals": 2
}
{
"date": "2022-05-02",
"season": 2021,
"home_team": "Salford City",
"away_team": "Mansfield Town",
"home_team_goals": 2,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Barrow",
"away_team": "Northampton Town",
"home_team_goals": 1,
"away_team_goals": 3
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Bradford City",
"away_team": "Carlisle United",
"home_team_goals": 2,
"away_team_goals": 0
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Bristol Rovers",
"away_team": "Scunthorpe United",
"home_team_goals": 7,
"away_team_goals": 0
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Exeter City",
"away_team": "Port Vale",
"home_team_goals": 0,
"away_team_goals": 1
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Harrogate Town A.F.C.",
"away_team": "Sutton United",
"home_team_goals": 0,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Hartlepool United",
"away_team": "Colchester United",
"home_team_goals": 0,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Leyton Orient",
"away_team": "Tranmere Rovers",
"home_team_goals": 0,
"away_team_goals": 1
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Mansfield Town",
"away_team": "Forest Green Rovers",
"home_team_goals": 2,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Newport County",
"away_team": "Rochdale",
"home_team_goals": 0,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Oldham Athletic",
"away_team": "Crawley Town",
"home_team_goals": 3,
"away_team_goals": 3
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Stevenage Borough",
"away_team": "Salford City",
"home_team_goals": 4,
"away_team_goals": 2
}
{
"date": "2022-05-07",
"season": 2021,
"home_team": "Walsall",
"away_team": "Swindon Town",
"home_team_goals": 0,
"away_team_goals": 3
} | {"source_file": "PrettyJSONEachRow.md"} | [
0.024100162088871002,
0.008782151155173779,
0.03637721389532089,
0.01553754135966301,
0.06427739560604095,
0.049019020050764084,
-0.02794751711189747,
0.041995786130428314,
0.012917408719658852,
-0.012570430524647236,
-0.005483921151608229,
-0.04427099600434303,
-0.021565260365605354,
-0.0... |
6055dfd0-61c9-45e5-875f-8d40830eaf03 | Format settings {#format-settings} | {"source_file": "PrettyJSONEachRow.md"} | [
0.051783546805381775,
0.054093241691589355,
-0.06613917648792267,
0.06841904670000076,
-0.05773076042532921,
0.04394744336605072,
-0.006199544295668602,
0.01172659732401371,
-0.028338199481368065,
-0.005737470928579569,
-0.021762726828455925,
-0.0010634351056069136,
0.018173757940530777,
-... |
0d1332f6-ea74-42bd-86d7-31b9209ef002 | alias: []
description: 'Documentation for the JSONAsString format'
input_format: true
keywords: ['JSONAsString']
output_format: false
slug: /interfaces/formats/JSONAsString
title: 'JSONAsString'
doc_type: 'reference'
| Input | Output | Alias |
|-------|---------|-------|
| β | β | |
Description {#description}
In this format, a single JSON object is interpreted as a single value.
If the input has several JSON objects (which are comma separated), they are interpreted as separate rows.
If the input data is enclosed in square brackets, it is interpreted as an array of JSON objects.
:::note
This format can only be parsed for a table with a single field of type
String
.
The remaining columns must be set to either
DEFAULT
or
MATERIALIZED
,
or be omitted.
:::
Once you serialize the entire JSON object to a String you can use the
JSON functions
to process it.
Example usage {#example-usage}
Basic example {#basic-example}
sql title="Query"
DROP TABLE IF EXISTS json_as_string;
CREATE TABLE json_as_string (json String) ENGINE = Memory;
INSERT INTO json_as_string (json) FORMAT JSONAsString {"foo":{"bar":{"x":"y"},"baz":1}},{},{"any json stucture":1}
SELECT * FROM json_as_string;
response title="Response"
ββjsonβββββββββββββββββββββββββββββββ
β {"foo":{"bar":{"x":"y"},"baz":1}} β
β {} β
β {"any json stucture":1} β
βββββββββββββββββββββββββββββββββββββ
An array of JSON objects {#an-array-of-json-objects}
```sql title="Query"
CREATE TABLE json_square_brackets (field String) ENGINE = Memory;
INSERT INTO json_square_brackets FORMAT JSONAsString [{"id": 1, "name": "name1"}, {"id": 2, "name": "name2"}];
SELECT * FROM json_square_brackets;
```
response title="Response"
ββfieldβββββββββββββββββββββββ
β {"id": 1, "name": "name1"} β
β {"id": 2, "name": "name2"} β
ββββββββββββββββββββββββββββββ
Format settings {#format-settings} | {"source_file": "JSONAsString.md"} | [
-0.039334461092948914,
0.025974243879318237,
0.0003930235398001969,
0.01885261759161949,
-0.07051575928926468,
-0.023227404803037643,
0.027750391513109207,
0.0791143849492073,
0.022101346403360367,
-0.0396202988922596,
-0.01434026937931776,
-0.005486337002366781,
0.06026103347539902,
0.050... |
a5345da4-6640-4294-8ceb-d4ec100d4d4a | alias: []
description: 'Documentation for the JSONColumns format'
input_format: true
keywords: ['JSONColumns']
output_format: true
slug: /interfaces/formats/JSONColumns
title: 'JSONColumns'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
:::tip
The output of the JSONColumns* formats provides the ClickHouse field name and then the content of each row in the table for that field;
visually, the data is rotated 90 degrees to the left.
:::
In this format, all data is represented as a single JSON Object.
:::note
The
JSONColumns
format buffers all data in memory and then outputs it as a single block, so, it can lead to high memory consumption.
:::
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
{
"date": ["2022-04-30", "2022-04-30", "2022-04-30", "2022-05-02", "2022-05-02", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07"],
"season": [2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021],
"home_team": ["Sutton United", "Swindon Town", "Tranmere Rovers", "Port Vale", "Salford City", "Barrow", "Bradford City", "Bristol Rovers", "Exeter City", "Harrogate Town A.F.C.", "Hartlepool United", "Leyton Orient", "Mansfield Town", "Newport County", "Oldham Athletic", "Stevenage Borough", "Walsall"],
"away_team": ["Bradford City", "Barrow", "Oldham Athletic", "Newport County", "Mansfield Town", "Northampton Town", "Carlisle United", "Scunthorpe United", "Port Vale", "Sutton United", "Colchester United", "Tranmere Rovers", "Forest Green Rovers", "Rochdale", "Crawley Town", "Salford City", "Swindon Town"],
"home_team_goals": [1, 2, 2, 1, 2, 1, 2, 7, 0, 0, 0, 0, 2, 0, 3, 4, 0],
"away_team_goals": [4, 1, 0, 2, 2, 3, 0, 0, 1, 2, 2, 1, 2, 2, 3, 2, 3]
}
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONColumns;
Reading data {#reading-data}
Read data using the
JSONColumns
format:
sql
SELECT *
FROM football
FORMAT JSONColumns
The output will be in JSON format: | {"source_file": "JSONColumns.md"} | [
-0.03463570028543472,
0.03764542564749718,
-0.10583288967609406,
-0.006114584859460592,
-0.022575708106160164,
-0.022980308160185814,
-0.014380047097802162,
0.073582224547863,
0.02965327352285385,
-0.009187121875584126,
0.029554657638072968,
0.013730404898524284,
0.0385858379304409,
0.0375... |
c75d37e1-58fa-40c7-9ec2-76d365be46aa | Reading data {#reading-data}
Read data using the
JSONColumns
format:
sql
SELECT *
FROM football
FORMAT JSONColumns
The output will be in JSON format:
json
{
"date": ["2022-04-30", "2022-04-30", "2022-04-30", "2022-05-02", "2022-05-02", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07", "2022-05-07"],
"season": [2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021, 2021],
"home_team": ["Sutton United", "Swindon Town", "Tranmere Rovers", "Port Vale", "Salford City", "Barrow", "Bradford City", "Bristol Rovers", "Exeter City", "Harrogate Town A.F.C.", "Hartlepool United", "Leyton Orient", "Mansfield Town", "Newport County", "Oldham Athletic", "Stevenage Borough", "Walsall"],
"away_team": ["Bradford City", "Barrow", "Oldham Athletic", "Newport County", "Mansfield Town", "Northampton Town", "Carlisle United", "Scunthorpe United", "Port Vale", "Sutton United", "Colchester United", "Tranmere Rovers", "Forest Green Rovers", "Rochdale", "Crawley Town", "Salford City", "Swindon Town"],
"home_team_goals": [1, 2, 2, 1, 2, 1, 2, 7, 0, 0, 0, 0, 2, 0, 3, 4, 0],
"away_team_goals": [4, 1, 0, 2, 2, 3, 0, 0, 1, 2, 2, 1, 2, 2, 3, 2, 3]
}
Format settings {#format-settings}
During import, columns with unknown names will be skipped if setting
input_format_skip_unknown_fields
is set to
1
.
Columns that are not present in the block will be filled with default values (you can use the
input_format_defaults_for_omitted_fields
setting here) | {"source_file": "JSONColumns.md"} | [
0.0011904228013008833,
-0.01281738467514515,
0.004515655338764191,
0.0182753074914217,
0.02413676306605339,
0.055901072919368744,
-0.0006636841571889818,
0.03243139758706093,
-0.006560462526977062,
0.009534705430269241,
-0.02285398542881012,
-0.00497226370498538,
-0.026144154369831085,
0.0... |
bba60873-110f-41fc-9474-4c22e8082d33 | alias: []
description: 'Documentation for the JSONCompactEachRowWithProgress format'
input_format: false
keywords: ['JSONCompactEachRowWithProgress']
output_format: true
slug: /interfaces/formats/JSONCompactEachRowWithProgress
title: 'JSONCompactEachRowWithProgress'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
This format combines the compact row-by-row output of JSONCompactEachRow with streaming progress
information.
It outputs data as separate JSON objects for metadata, individual rows, progress updates,
totals, and exceptions. Values are represented in their native types.
Key features:
- Outputs metadata first with column names and types
- Each row is a separate JSON object with a "row" key containing an array of values
- Includes progress updates during query execution (as
{"progress":...}
objects)
- Supports totals and extremes
- Values keep their native types (numbers as numbers, strings as strings)
Example usage {#example-usage}
sql title="Query"
SELECT *
FROM generateRandom('a Array(Int8), d Decimal32(4), c Tuple(DateTime64(3), UUID)', 1, 10, 2)
LIMIT 5
FORMAT JSONCompactEachRowWithProgress
response title="Response"
{"meta":[{"name":"a","type":"Array(Int8)"},{"name":"d","type":"Decimal(9, 4)"},{"name":"c","type":"Tuple(DateTime64(3), UUID)"}]}
{"row":[[-8], 46848.5225, ["2064-06-11 14:00:36.578","b06f4fa1-22ff-f84f-a1b7-a5807d983ae6"]]}
{"row":[[-76], -85331.598, ["2038-06-16 04:10:27.271","2bb0de60-3a2c-ffc0-d7a7-a5c88ed8177c"]]}
{"row":[[-32], -31470.8994, ["2027-07-18 16:58:34.654","1cdbae4c-ceb2-1337-b954-b175f5efbef8"]]}
{"row":[[-116], 32104.097, ["1979-04-27 21:51:53.321","66903704-3c83-8f8a-648a-da4ac1ffa9fc"]]}
{"row":[[], 2427.6614, ["1980-04-24 11:30:35.487","fee19be8-0f46-149b-ed98-43e7455ce2b2"]]}
{"progress":{"read_rows":"5","read_bytes":"184","total_rows_to_read":"5","elapsed_ns":"335771"}}
{"rows_before_limit_at_least":5}
Format settings {#format-settings} | {"source_file": "JSONCompactEachRowWithProgress.md"} | [
-0.059324346482753754,
0.02701234631240368,
-0.04202363267540932,
0.03163726255297661,
-0.016969220712780952,
0.02071344293653965,
-0.02872568927705288,
0.040991563349962234,
-0.0056541115045547485,
-0.04542332887649536,
-0.01771879382431507,
-0.00974479503929615,
0.0069794622249901295,
0.... |
d5b28372-db9f-4f6b-89c6-12fe10bc7f1a | alias: []
description: 'Documentation for the JSONCompactEachRow format'
input_format: true
keywords: ['JSONCompactEachRow']
output_format: true
slug: /interfaces/formats/JSONCompactEachRow
title: 'JSONCompactEachRow'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from
JSONEachRow
only in that data rows are output as arrays, not as objects.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
:
json
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4]
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1]
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0]
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2]
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2]
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3]
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0]
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0]
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1]
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2]
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2]
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1]
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2]
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2]
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3]
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2]
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONCompactEachRow;
Reading data {#reading-data}
Read data using the
JSONCompactEachRow
format:
sql
SELECT *
FROM football
FORMAT JSONCompactEachRow
The output will be in JSON format:
json
["2022-04-30", 2021, "Sutton United", "Bradford City", 1, 4]
["2022-04-30", 2021, "Swindon Town", "Barrow", 2, 1]
["2022-04-30", 2021, "Tranmere Rovers", "Oldham Athletic", 2, 0]
["2022-05-02", 2021, "Port Vale", "Newport County", 1, 2]
["2022-05-02", 2021, "Salford City", "Mansfield Town", 2, 2]
["2022-05-07", 2021, "Barrow", "Northampton Town", 1, 3]
["2022-05-07", 2021, "Bradford City", "Carlisle United", 2, 0]
["2022-05-07", 2021, "Bristol Rovers", "Scunthorpe United", 7, 0]
["2022-05-07", 2021, "Exeter City", "Port Vale", 0, 1]
["2022-05-07", 2021, "Harrogate Town A.F.C.", "Sutton United", 0, 2]
["2022-05-07", 2021, "Hartlepool United", "Colchester United", 0, 2]
["2022-05-07", 2021, "Leyton Orient", "Tranmere Rovers", 0, 1]
["2022-05-07", 2021, "Mansfield Town", "Forest Green Rovers", 2, 2]
["2022-05-07", 2021, "Newport County", "Rochdale", 0, 2]
["2022-05-07", 2021, "Oldham Athletic", "Crawley Town", 3, 3]
["2022-05-07", 2021, "Stevenage Borough", "Salford City", 4, 2]
["2022-05-07", 2021, "Walsall", "Swindon Town", 0, 3]
Format settings {#format-settings} | {"source_file": "JSONCompactEachRow.md"} | [
-0.011785855516791344,
-0.006599097047001123,
0.006359472870826721,
-0.008113197982311249,
-0.02113596349954605,
-0.0031958171166479588,
-0.0171820055693388,
0.04889934882521629,
0.03583795577287674,
-0.03314054012298584,
-0.001219069818034768,
-0.011600133962929249,
0.028684886172413826,
... |
990995cf-0d27-4265-851c-fa75d9e652ea | alias: []
description: 'Documentation for the JSONStrings format'
input_format: true
keywords: ['JSONStrings']
output_format: true
slug: /interfaces/formats/JSONStrings
title: 'JSONStrings'
doc_type: 'reference'
| Input | Output | Alias |
|-------|--------|-------|
| β | β | |
Description {#description}
Differs from the
JSON
format only in that data fields are output as strings, not as typed JSON values.
Example usage {#example-usage}
Inserting data {#inserting-data}
Using a JSON file with the following data, named as
football.json
: | {"source_file": "JSONStrings.md"} | [
-0.04858113452792168,
0.0261205043643713,
0.0062745376490056515,
-0.025621389970183372,
-0.02574615739285946,
-0.010975681245326996,
0.019862381741404533,
0.12003032118082047,
0.04435618966817856,
-0.04231085628271103,
0.010572782717645168,
0.02801361121237278,
0.036488670855760574,
0.0958... |
d5b3196a-8221-4181-95d2-b61434b101ba | json
{
"meta":
[
{
"name": "date",
"type": "Date"
},
{
"name": "season",
"type": "Int16"
},
{
"name": "home_team",
"type": "LowCardinality(String)"
},
{
"name": "away_team",
"type": "LowCardinality(String)"
},
{
"name": "home_team_goals",
"type": "Int8"
},
{
"name": "away_team_goals",
"type": "Int8"
}
],
"data":
[
{
"date": "2022-04-30",
"season": "2021",
"home_team": "Sutton United",
"away_team": "Bradford City",
"home_team_goals": "1",
"away_team_goals": "4"
},
{
"date": "2022-04-30",
"season": "2021",
"home_team": "Swindon Town",
"away_team": "Barrow",
"home_team_goals": "2",
"away_team_goals": "1"
},
{
"date": "2022-04-30",
"season": "2021",
"home_team": "Tranmere Rovers",
"away_team": "Oldham Athletic",
"home_team_goals": "2",
"away_team_goals": "0"
},
{
"date": "2022-05-02",
"season": "2021",
"home_team": "Port Vale",
"away_team": "Newport County",
"home_team_goals": "1",
"away_team_goals": "2"
},
{
"date": "2022-05-02",
"season": "2021",
"home_team": "Salford City",
"away_team": "Mansfield Town",
"home_team_goals": "2",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Barrow",
"away_team": "Northampton Town",
"home_team_goals": "1",
"away_team_goals": "3"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Bradford City",
"away_team": "Carlisle United",
"home_team_goals": "2",
"away_team_goals": "0"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Bristol Rovers",
"away_team": "Scunthorpe United", | {"source_file": "JSONStrings.md"} | [
0.0419316403567791,
0.10651838779449463,
0.03218595311045647,
-0.009882329031825066,
-0.002751832827925682,
0.003006058745086193,
-0.03563787043094635,
0.03839629516005516,
0.015362009406089783,
-0.04059643670916557,
-0.045625049620866776,
-0.029674623161554337,
-0.016941189765930176,
0.05... |
a84d3599-3bab-484d-ac75-e2d22c757b65 | {
"date": "2022-05-07",
"season": "2021",
"home_team": "Bristol Rovers",
"away_team": "Scunthorpe United",
"home_team_goals": "7",
"away_team_goals": "0"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Exeter City",
"away_team": "Port Vale",
"home_team_goals": "0",
"away_team_goals": "1"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Harrogate Town A.F.C.",
"away_team": "Sutton United",
"home_team_goals": "0",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Hartlepool United",
"away_team": "Colchester United",
"home_team_goals": "0",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Leyton Orient",
"away_team": "Tranmere Rovers",
"home_team_goals": "0",
"away_team_goals": "1"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Mansfield Town",
"away_team": "Forest Green Rovers",
"home_team_goals": "2",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Newport County",
"away_team": "Rochdale",
"home_team_goals": "0",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Oldham Athletic",
"away_team": "Crawley Town",
"home_team_goals": "3",
"away_team_goals": "3"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Stevenage Borough",
"away_team": "Salford City",
"home_team_goals": "4",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Walsall",
"away_team": "Swindon Town",
"home_team_goals": "0",
"away_team_goals": "3"
}
]
} | {"source_file": "JSONStrings.md"} | [
0.00009132588456850499,
0.04822511598467827,
-0.04171590507030487,
0.0019110430730506778,
0.06497175991535187,
0.04949786886572838,
0.01316929329186678,
-0.0012961262837052345,
0.009518994018435478,
-0.011728250421583652,
-0.03971441462635994,
-0.06650417298078537,
-0.020196331664919853,
0... |
0e746233-24f7-4acf-93ab-fc272488d320 | Insert the data:
sql
INSERT INTO football FROM INFILE 'football.json' FORMAT JSONStrings;
Reading data {#reading-data}
Read data using the
JSONStrings
format:
sql
SELECT *
FROM football
FORMAT JSONStrings
The output will be in JSON format:
```json
{
"meta":
[
{
"name": "date",
"type": "Date"
},
{
"name": "season",
"type": "Int16"
},
{
"name": "home_team",
"type": "LowCardinality(String)"
},
{
"name": "away_team",
"type": "LowCardinality(String)"
},
{
"name": "home_team_goals",
"type": "Int8"
},
{
"name": "away_team_goals",
"type": "Int8"
}
], | {"source_file": "JSONStrings.md"} | [
0.056242335587739944,
0.03506509214639664,
-0.03186088800430298,
-0.020922983065247536,
0.023482054471969604,
0.029086338356137276,
-0.00042863318230956793,
0.1195726990699768,
-0.0010441160993650556,
-0.007886387407779694,
-0.020748570561408997,
-0.036503180861473083,
0.0075178868137300014,... |
33aa6497-37c3-4537-8046-90ba427438e2 | "data":
[
{
"date": "2022-04-30",
"season": "2021",
"home_team": "Sutton United",
"away_team": "Bradford City",
"home_team_goals": "1",
"away_team_goals": "4"
},
{
"date": "2022-04-30",
"season": "2021",
"home_team": "Swindon Town",
"away_team": "Barrow",
"home_team_goals": "2",
"away_team_goals": "1"
},
{
"date": "2022-04-30",
"season": "2021",
"home_team": "Tranmere Rovers",
"away_team": "Oldham Athletic",
"home_team_goals": "2",
"away_team_goals": "0"
},
{
"date": "2022-05-02",
"season": "2021",
"home_team": "Port Vale",
"away_team": "Newport County",
"home_team_goals": "1",
"away_team_goals": "2"
},
{
"date": "2022-05-02",
"season": "2021",
"home_team": "Salford City",
"away_team": "Mansfield Town",
"home_team_goals": "2",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Barrow",
"away_team": "Northampton Town",
"home_team_goals": "1",
"away_team_goals": "3"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Bradford City",
"away_team": "Carlisle United",
"home_team_goals": "2",
"away_team_goals": "0"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Bristol Rovers",
"away_team": "Scunthorpe United",
"home_team_goals": "7",
"away_team_goals": "0"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Exeter City",
"away_team": "Port Vale",
"home_team_goals": "0",
"away_team_goals": "1"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Harrogate Town A.F.C.",
"away_team": "Sutton United",
"home_team_goals": "0",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Hartlepool United",
"away_team": "Colchester United",
"home_team_goals": "0",
"away_team_goals": "2"
},
{
"date": "2022-05-07", | {"source_file": "JSONStrings.md"} | [
0.016149749979376793,
0.07339783757925034,
-0.013486191630363464,
0.0195295549929142,
0.05552845448255539,
0.025866614654660225,
0.0003458358987700194,
-0.009036151692271233,
-0.0003274706832598895,
-0.02452751435339451,
0.0007437152089551091,
-0.06629016250371933,
0.005806328728795052,
0.... |
109bfba9-9aa0-4784-bd19-7f0e95c4d19e | "away_team": "Colchester United",
"home_team_goals": "0",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Leyton Orient",
"away_team": "Tranmere Rovers",
"home_team_goals": "0",
"away_team_goals": "1"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Mansfield Town",
"away_team": "Forest Green Rovers",
"home_team_goals": "2",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Newport County",
"away_team": "Rochdale",
"home_team_goals": "0",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Oldham Athletic",
"away_team": "Crawley Town",
"home_team_goals": "3",
"away_team_goals": "3"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Stevenage Borough",
"away_team": "Salford City",
"home_team_goals": "4",
"away_team_goals": "2"
},
{
"date": "2022-05-07",
"season": "2021",
"home_team": "Walsall",
"away_team": "Swindon Town",
"home_team_goals": "0",
"away_team_goals": "3"
}
], | {"source_file": "JSONStrings.md"} | [
0.006347889546304941,
0.040333908051252365,
-0.04920930042862892,
0.004502184689044952,
0.0563911497592926,
0.06692767143249512,
0.014744932763278484,
0.010939606465399265,
0.01269687432795763,
-0.005454533733427525,
0.008084946312010288,
-0.08374273031949997,
-0.00010144715633941814,
0.01... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.