Insert records ,but lose some records #10286
Replies: 2 comments
-
I Solved |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
16601746291
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
like this create table sql:
create table yayatest.advertiser_view_record(
time date,
advertiser varchar(10),
channel varchar(10),
user_id int)
distributed by hash(time)
properties("replication_num" = "1");
desc yayatest.advertiser_view_record all , like below screenshot :
![image](https://user-images.githubusercontent.com/49640575/174704773-abbbfea6-52fa-4a0d-83e7-eb05286aea5d.png)
then, I insert some records ,use below sql:
insert into yayatest.advertiser_view_record (time,advertiser,channel,user_id) values
(current_date(),'LV','微信朋友圈',12344),
(current_date(),'LV','微信朋友圈',12312),
(current_date(),'COCO','微信朋友圈',8908),
(current_date(),'LV','小程序',3421),
(current_date(),'POLO','微信朋友圈',12344),
(current_date(),'POLO','天猫商城',3211),
(current_date(),'POLO','微信',33442);
execute log : 2 rows affected in 205 ms
![image](https://user-images.githubusercontent.com/49640575/174705424-d7471bed-dd31-425b-a9a9-08e90608014b.png)
but select table like below screenshot, due to execute 5 times ,so have 5 records duplicate, every time insert ,just retain 2 records in table:
When I try to insert one record,like this, but also failed :
mysql> insert into yayatest.advertiser_view_record (time,advertiser,channel,user_id) values (current_date(),'COCO','微信朋友圈',8908);
Query OK, 0 rows affected, 1 warning (0.02 sec)
{'label':'insert_2e2ea8bf93b244bc-99a74968df8bc38f', 'status':'VISIBLE', 'txnId':'7791'}
above the question , can someone explain ? Thanks alots!
Beta Was this translation helpful? Give feedback.
All reactions