databendlabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.92k stars 752 forks source link

bug: OSS failed to execute 'bendsql --query='INSERT INTO default.t1 VALUES;' --format=csv --data=@t1.csv' #14192

Closed chzhewl closed 11 months ago

chzhewl commented 11 months ago

Search before asking

Version

databend-v1.2.275-x86_64-unknown-linux-musl

What's Wrong?

  1. oss storage: type = "oss"

[storage.oss] bucket = "databendxxx" endpoint_url = "https://oss-cn-qingdao.aliyuncs.com" access_key_id = "xxxx" access_key_secret = "xxx"

  1. create table ok: CREATE TABLE t1 ( a int );

  2. ready t1.csv : 111 222 333 444

  3. execute: bendsql --query='INSERT INTO default.t1 VALUES;' --format=csv --data=@t1.csv

  4. issue: Local file data import failed. “select * from t1” content is empty。 But changing to "minio" is correct。

How to Reproduce?

No response

Are you willing to submit PR?

b41sh commented 11 months ago

Hi @chzhewl Thanks for reporting the bug, is the cause of the error the following?

Error: APIError: ResponseError with 3902: storage doesn't support presign operation
chzhewl commented 11 months ago

你好@chzhewl感谢您报告该错误,请问错误原因如下?

Error: APIError: ResponseError with 3902: storage doesn't support presign operation

No error message

but, Still using aliyun oss, databend-query.toml storage type = "s3",storage.s3 is configured as follows. Executing the above bendsql to import this file can be successful.

[storage.s3] bucket = "xxx" endpoint_url = "http://oss-cn-qingdao-internal.aliyuncs.com" access_key_id = "xxxx" secret_access_key = "xxxx" enable_virtual_host_style = true

b41sh commented 11 months ago

你好@chzhewl感谢您报告该错误,请问错误原因如下?

Error: APIError: ResponseError with 3902: storage doesn't support presign operation

No error message

but, Still using aliyun oss, databend-query.toml storage type = "s3",storage.s3 is configured as follows. Executing the above bendsql to import this file can be successful.

[storage.s3] bucket = "xxx" endpoint_url = "http://oss-cn-qingdao-internal.aliyuncs.com" access_key_id = "xxxx" secret_access_key = "xxxx" enable_virtual_host_style = true

It looks like the storage type is s3 and minio both work. If the type is oss, will it fail?

chzhewl commented 11 months ago

你好@chzhewl感谢您报告该错误,请问错误原因如下?

Error: APIError: ResponseError with 3902: storage doesn't support presign operation

无错误信息 但是,仍然使用aliyun oss,databend-query.toml存储类型=“s3”,storage.s3配置如下。执行上面的bendsql导入该文件即可成功。 [storage.s3]bucket =“xxx”endpoint_url =“ http://oss-cn-qingdao-internal.aliyuncs.com ”access_key_id =“xxxx”secret_access_key =“xxxx”enable_virtual_host_style = true

看起来存储类型是s3并且minio两者都有效。如果类型是oss,会失败吗?

是的,类型为oss,执行“bendsql --query='INSERT INTO default.t1 VALUES;' --format=csv --data=@t1.csv” 会失败,且无任何错误提示。

b41sh commented 11 months ago

Hi, @chzhewl The oss storage insert bug has been fixed, you can verify it with the next version of bendsql, thanks again for reporting this bug, and welcome to continue using databend!