gpt4 book ai didi

Can't import CSV to ClickHouse(无法将CSV导入ClickHouse)

转载 作者:bug小助手 更新时间:2023-10-22 16:11:35 41 4
gpt4 key购买 nike



I'm trying to import CSV file to ClickHouse table:
INSERT INTO default.tags FROM INFILE '/home/sergey/test/tags_202309081557.csv' FORMAT CSV;
but got strange error:
SQL Error [78] [07000]: Code: 78. DB::Exception: Query has infile and was send directly to server. (UNKNOWN_TYPE_OF_QUERY) (version 23.8.2.7 (official build)) , server ClickHouseNode [uri=http://localhost:8123/default, options={use_server_time_zone=false,use_time_zone=false}]@207775645

我正在尝试将CSV文件导入ClickHouse表:INSERT INTO default.tags FROM INFILE'/home/sergey/test/tags_202309081557.CSV'FORMAT CSV;但得到了一个奇怪的错误:SQL错误[78][07000]:代码:78。DB::异常:查询有内讧,直接发送到服务器。(UNKNOWN_TYPE_OF_QUERY)(版本23.8.2.7(官方版本)),服务器ClickHouseNode[uri=http://localhost:8123/default,options={use_server_time_zone=false,use_time_gone=false}]@207775645


Maybe smbd faced such problem?

也许smbd面临这样的问题?


Thanks

谢谢


I tried many times with different options? but result was the same

我尝试了很多次不同的选择?但结果是一样的


更多回答
优秀答案推荐

Where are you running this from? This is a clickhouse-client feature (also Java client supports i believe). Its not a server function and wont work over other clients.

你从哪里跑来的?这是一个clickhouse客户端功能(我相信Java客户端也支持)。它不是一个服务器功能,不会在其他客户端上工作。



FROM INFILE is for the clickhouse-client. If you're using Python, you can use the insert_file function. Check the docs here: https://clickhouse.com/docs/en/integrations/python#file-inserts

FROM INFILE适用于clickhouse客户端。如果您使用的是Python,则可以使用insert_file函数。查看此处的文档:https://clickhouse.com/docs/en/integrations/python#file-插入件


更多回答

Hmmm... thanks anyway, i tried such also with a python client with the same result

嗯…无论如何,谢谢,我也用python客户端尝试过,结果也是一样的

Thanks! I tried to use this function; yes file became visible, but it doesn't process csv correctly and raises an error

谢谢我试着使用这个功能;yes文件可见,但它不能正确处理csv并引发错误

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com