[ 
https://issues.apache.org/jira/browse/KUDU-3495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Song Jiacheng updated KUDU-3495:
--------------------------------
    Description: 
For table test with two column a(primary key), b.

If I do following operations in client side:
 # opentable(test) to get a kudu table object KuduTable1 whose schema is (a, b)
 # Add a column c to test.
 # opentable(test) to get another kudu table object KuduTable2 whose schema is 
(a, b, c)
 # Insert 1 row using KuduTable2 ("d", "e", "f")
 # Upsert 1 row using KuduTable1 ("d", "g")

The expected result is ("d", "g", "f") since I hope to keep the column which my 
request do not include.

But the result i got is ("d", "g", NULL)

After looking through the code, I think the original reason is that the 
isset_bitmap is not all 0 at start.

!image-2023-07-25-18-54-29-354.png!

So I initialize the bitmap like below: !image-2023-07-25-18-56-27-790.png!

After this modification, the result is as my expect. So I wonder if it is a bug 
since normally a user does not want to change the column which he did not 
request to.

  was:
For table test with two column a(primary key), b.

If I do following operations in client side:
 # opentable(test) to get a kudu table object KuduTable1 whose schema is (a, b)
 # Add a column c to test.
 # opentable(test) to get another kudu table object KuduTable2 whose schema is 
(a, b, c)
 # Insert 1 row using KuduTable2 ("d", "e", "f")
 # Upsert 1 row using KuduTable1 ("d", "g")

The expected result is ("d", "g", "f") since I hope to keep the column which my 
request do not include.

But the result i got is ("d", "g", NULL)

After looking through the code, I think the original reason is that the 
isset_bitmap is not all 0 at start.

!image-2023-07-25-18-54-29-354.png!


> TServer: Unexpected result of write with old schema.
> ----------------------------------------------------
>
>                 Key: KUDU-3495
>                 URL: https://issues.apache.org/jira/browse/KUDU-3495
>             Project: Kudu
>          Issue Type: Bug
>          Components: tserver
>    Affects Versions: 1.14.0
>            Reporter: Song Jiacheng
>            Priority: Major
>         Attachments: image-2023-07-25-18-54-29-354.png, 
> image-2023-07-25-18-56-27-790.png
>
>
> For table test with two column a(primary key), b.
> If I do following operations in client side:
>  # opentable(test) to get a kudu table object KuduTable1 whose schema is (a, 
> b)
>  # Add a column c to test.
>  # opentable(test) to get another kudu table object KuduTable2 whose schema 
> is (a, b, c)
>  # Insert 1 row using KuduTable2 ("d", "e", "f")
>  # Upsert 1 row using KuduTable1 ("d", "g")
> The expected result is ("d", "g", "f") since I hope to keep the column which 
> my request do not include.
> But the result i got is ("d", "g", NULL)
> After looking through the code, I think the original reason is that the 
> isset_bitmap is not all 0 at start.
> !image-2023-07-25-18-54-29-354.png!
> So I initialize the bitmap like below: !image-2023-07-25-18-56-27-790.png!
> After this modification, the result is as my expect. So I wonder if it is a 
> bug since normally a user does not want to change the column which he did not 
> request to.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to