Skip to content

Alter table does not seem to work #481

@rstpv

Description

@rstpv

What happened?

Adding columns or dropping or renaming does fail / internal schema doesn't seem to pick the changes

What did you expect to happen?

As the table was modified through either adding a column, renaming a column or dropping a column I would expect those changes to be reflected

How can we reproduce it (as minimally and precisely as possible)?

            bigQuery.query(QueryJobConfiguration.of(
                "CREATE TABLE `$DATASET_NAME.customers` (name STRING)"
            ))
            bigQuery.query(
            QueryJobConfiguration.of(
                "ALTER TABLE `$DATASET_NAME.customers` ADD COLUMN age INTEGER"
            )
        )
        bigQuery.query(
            QueryJobConfiguration.of(
                "INSERT INTO `$DATASET_NAME.customers` (name, age) VALUES ('Alice', 30)"
            )
        )

Fails with

com.google.cloud.bigquery.BigQueryException: failed to analyze: Column age is not present in table test-project_test_12345_customers [at 1:72]

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions