Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streaming_load just lost first 'N' #6353

Closed
wubx opened this issue Jun 30, 2022 · 5 comments · Fixed by #6385
Closed

streaming_load just lost first 'N' #6353

wubx opened this issue Jun 30, 2022 · 5 comments · Fixed by #6385
Assignees
Labels
C-bug Category: something isn't working prio: high High priority

Comments

@wubx
Copy link
Member

wubx commented Jun 30, 2022

Summary

$cat 11.csv
NONE
NNNN
N1

curl -H "insert_sql:insert into t1 format CSV" -H "skip_header:0" -F "upload=@./11.csv" -XPUT http://wubx:wubxwubx@192.168.1.100:8000/v1/streaming_load
{"id":"4104b51a-c1d5-42f3-b054-39faa69b64c1","state":"SUCCESS","stats":{"rows":3,"bytes":39},"error":null}

MySQL [(none)]> desc t1;
+-------+---------+------+---------+-------+
| Field | Type    | Null | Default | Extra |
+-------+---------+------+---------+-------+
| c1    | VARCHAR | YES  | NULL    |       |
+-------+---------+------+---------+-------+
1 row in set (0.006 sec)
MySQL [(none)]> select * from  t1;
+------+
| c1   |
+------+
| ONE  |
| NNN  |
| 1    |
+------+
3 rows in set (0.009 sec)

@wubx wubx added the C-bug Category: something isn't working label Jun 30, 2022
@BohuTANG
Copy link
Member

BohuTANG commented Jun 30, 2022

cc @youngsofun @sundy-li

@xudong963
Copy link
Member

xudong963 commented Jun 30, 2022

It's ok in my local

➜  ~ sudo curl -s -u root: -XPUT "http://localhost:8000/v1/streaming_load" -H 'insert_sql: insert into t format CSV' -H 'skip_header:0' -F "upload=@./test.csv"
Password:
{"id":"d420e070-6fa4-4d6c-a7ea-903de96e8bd9","state":"SUCCESS","stats":{"rows":3,"bytes":42},"error":null}%
➜  ~ cat test.csv
NONE
NNNN
N1

mysql> select * from t;
+------+
| c    |
+------+
| NONE |
| NNNN |
| N1   |
+------+
3 rows in set (0.03 sec)
Read 3 rows, 42.00 B in 0.003 sec., 864.65 rows/sec., 11.82 KiB/sec.

Update: when the field is nullable, I met the bug.
Btw, the bug is case-insensitive, the following case also lost the first char.

➜  ~ cat test.csv
nONE
nNNN
n1

@BohuTANG
Copy link
Member

This is a terrible bug :/

@BohuTANG BohuTANG added the prio: high High priority label Jun 30, 2022
@sundy-li
Copy link
Member

ignore_insensitive_bytes("null") will eat the matched bytes , so 'n' is eaten.

We should use CheckpointReader to save the state.

@youngsofun
Copy link
Member

already find a way to fix it,I will continue tomorrow morning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working prio: high High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants