ydb
ydb copied to clipboard
`ReadRows` ignores nullability of columns
When we have a table with nullable columns - readRows
returns the same protobuf message for empty and null values. For example, I can execute next bulkUpsert
on a simple table with two columns - not null id
and nullable text
.
rows {
type { list_type { item { struct_type {
members { name: "id" type { type_id: UINT32 } }
members { name: "text" type { type_id: UTF8 } }
} } } }
value {
items { items { uint32_value: 1 } items { text_value: "id1" } }
items { items { uint32_value: 2 } items { text_value: "" } }
items { items { uint32_value: 3 } items { null_flag_value: NULL_VALUE } }
}
}
After that, when I read these rows via readTable
method I got a message
result_set {
columns { name: "id" type { optional_type { item { type_id: UINT32 } } } }
columns { name: "text" type { optional_type { item { type_id: UTF8 } } } }
rows { items { uint32_value: 1 } items { text_value: "id1" } }
rows { items { uint32_value: 2 } items { text_value: "" } }
rows { items { uint32_value: 3 } items { null_flag_value: NULL_VALUE } }
truncated: true
}
All three rows have different values for column text
But if I read these rows via readRows
method - I got next response
result_set {
columns { name: "id" type { type_id: UINT32 } }
columns { name: "text" type { type_id: UTF8 } }
rows { items { uint32_value: 1 } items { text_value: "id1" } }
rows { items { uint32_value: 2 } items { text_value: "" } }
rows { items { uint32_value: 3 } items { text_value: "" } }
}
Second and third rows have the equals values for column text