Skip to content

BulkUpsert without DEFAULT columns fills NULLs, not literals #27555

@dahbka-lis

Description

@dahbka-lis

Table:

CREATE TABLE `/Root/DefaultColumnAndBulkUpsert` (
    Key Uint32 NOT NULL,
    Value String DEFAULT "Default value",
    PRIMARY KEY (Key),
);

BulkUpsert fills NULLs for the Value column and not the "Default value" literal:

auto rowsBuilder = NYdb::TValueBuilder();
rowsBuilder.BeginList();
for (ui32 i = 10; i <= 15; ++i) {
    rowsBuilder.AddListItem()
        .BeginStruct()
        .AddMember("Key")
            .Uint32(i)
        .EndStruct();
}

rowsBuilder.EndList();
tableClient.BulkUpsert("/Root/DefaultColumnAndBulkUpsert", rowsBuilder.Build());
  • Add a new LOG_WARN when rows from BulkUpsert does not have DEFAULT columns. We're going to find out if anyone is using this bug as a feature.
  • Add a new feature flag DisableBulkUpsertWithoutDefaults to disable writing like above.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions