Skip to content

Support nested column references in UpdateBuilder::set() #7420

Description

@jackye1995

UpdateBuilder::set() rejects any column name containing ., so a nested field cannot be updated directly — it can only be changed by setting its whole top-level struct column.

Location — rust/lance/src/dataset/write/update.rs, in set():

// TODO: support nested column references. This is mostly blocked on the
// ability to insert them into the RecordBatch properly.
if column.as_ref().contains('.') {
    return Err(Error::not_supported_source(
        format!(
            "Nested column references are not yet supported. Referenced: {}",
            column.as_ref(),
        )
        .into(),
    ));
}

Impact

  • To change s.x, callers must SET s = <whole struct>, which is awkward and rewrites the entire struct value.
  • This is what made fix(update): keep nested-field index correct when updating a struct column #7412 necessary: a whole-struct update resolves to the parent field id, so a scalar index on a nested child field (s.x) had to be handled specially to avoid being wrongly extended over the rewritten fragment.

Ask

Support set("s.x", <expr>) for nested leaf columns. The existing TODO notes this is mostly blocked on inserting nested columns into the RecordBatch properly. Once supported, the index-coverage logic can target the leaf field directly instead of conservatively expanding the whole struct subtree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions