Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ClickHouse launches Claude-powered Agents and House Mates partner program at Open House 2026 Read more →
介绍如何在 ClickHouse 中使用 Avro、Arrow 和 ORC 数据的页面
INSERT
INSERT INTO sometable FROM INFILE 'data.avro' FORMAT Avro
SELECT path, hits FROM file('data.avro', Avro) ORDER BY hits DESC LIMIT 5;
┌─path────────────┬──hits─┐ │ Amy_Poehler │ 62732 │ │ Adam_Goldberg │ 42338 │ │ Aaron_Spelling │ 25128 │ │ Absence_seizure │ 18152 │ │ Ammon_Bundy │ 11890 │ └─────────────────┴───────┘
SELECT * FROM sometable INTO OUTFILE 'export.avro' FORMAT Avro;
SELECT date, toDate(date) FROM file('data.avro', Avro) LIMIT 3;
┌──date─┬─toDate(date)─┐ │ 16556 │ 2015-05-01 │ │ 16556 │ 2015-05-01 │ │ 16556 │ 2015-05-01 │ └───────┴──────────────┘
CREATE TABLE some_topic_stream ( field1 UInt32, field2 String ) ENGINE = Kafka() SETTINGS kafka_broker_list = 'localhost', kafka_topic_list = 'some_topic', kafka_group_name = 'some_group', kafka_format = 'AvroConfluent';
INSERT INTO sometable FROM INFILE 'data.arrow' FORMAT Arrow
SELECT * FROM sometable INTO OUTFILE 'export.arrow' FORMAT Arrow
import sys, pyarrow as pa with pa.ipc.open_stream(sys.stdin.buffer) as reader: print(reader.read_pandas())
clickhouse-client -q "SELECT path, hits FROM some_data LIMIT 3 FORMAT ArrowStream" | python3 arrow.py
path hits 0 b'Akiba_Hebrew_Academy' 241 1 b'Aegithina_tiphia' 34 2 b'1971-72_Utah_Stars_season' 1
arrow-stream | clickhouse-client -q "INSERT INTO sometable FORMAT ArrowStream"
arrow-stream
SELECT * FROM sometable INTO OUTFILE 'data.orc' FORMAT ORC; INSERT INTO sometable FROM INFILE 'data.orc' FORMAT ORC;
此页面对您有帮助吗?