Skip to content

[default values] Change the error message when a column default does not fit - #913

Open
cbb330 wants to merge 1 commit into
chbush/read-bridge-default-binds-ahv5ffrom
chbush/read-bridge-misfit-message-ahv5f
Open

cbb330 wants to merge 1 commit into
chbush/read-bridge-default-binds-ahv5ffrom
chbush/read-bridge-misfit-message-ahv5f

Conversation

@cbb330

@cbb330 cbb330 commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR only changes an error message in the Java client.

A table can store a column default that does not fit the type its column had in an older schema version, such as 8000000000 on an int column later promoted to bigint. Every load of such a table fails, before and after this PR. #911 stops the server from accepting such a default. Tables stored before #911 can still have one, and need an operator to fix it.

  • Before: read-bridge: unusable config for table db.tbl
  • After: COLUMN_DEFAULT_UNUSABLE: OpenHouse cannot apply the column defaults declared on db.tbl (TYPE_MISMATCH, column n, field ID 2). The default does not fit int, the column's type in schema version 0.

The new message names the column, in the form the server uses when it refuses such a default (see SETUP.md).

Iceberg's own error, Cannot parse default as a int value: 8000000000, does not name the column. So before ReadBridge.apply sets a default on its column in a schema version, it checks that the default fits, with the steps Iceberg's SchemaParser takes for an initial-default. A default that fits loads as before.

A default that does not fit is thrown as ColumnDefaultDoesNotFitException, a ReadBridgeException whose message is the new one. OpenHouseTableOperations catches it before other ReadBridgeExceptions, which keep the old message.

Stacked on #911.

Changes

  • Client-facing API Changes
  • Internal API Changes
  • Bug Fixes
  • New Features
  • Performance Improvements
  • Code Style
  • Refactoring
  • Documentation
  • Tests

Testing Done

  • Manually Tested on local docker setup. Please include commands ran, and their output.

  • Added new tests for the changes made.

  • Updated existing tests to reflect the changes made.

  • No tests added or updated. Please explain why. If unsure, please feel free to ask for help.

  • Some other form of testing like staging or soak time in production. Please explain.

  • ReadBridgeTest: a default of 8000000000 on a column promoted from int to bigint fails with the message above.

  • OpenHouseTableOperationsTest: a refresh of a table whose int column id has the default 8000000000 fails with Tasks.UnrecoverableException and the COLUMN_DEFAULT_UNUSABLE message for db.tbl.

  • With JDK 17, ReadBridgeTest (12) and OpenHouseTableOperationsTest (41) pass on Iceberg 1.2 and 1.5.

  • A throwaway check, not committed, loaded the promoted table through OpenHouseTableOperations.doRefresh on this PR and on [default values] Follow Iceberg's column-default rules after the opt-in, and require defaults to fit every schema version #911. With the default 8000000000, both fail with the same root cause, IllegalArgumentException: Cannot parse default as a int value: 8000000000, and the Before and After messages above. With the default 7, both load, with the default in both schema versions.

Additional Information

@cbb330
cbb330 force-pushed the chbush/read-bridge-misfit-message-ahv5f branch from aba085d to bf35dde Compare November 21, 2026 01:06
@cbb330
cbb330 changed the base branch from main to chbush/read-bridge-default-binds-ahv5f November 21, 2026 01:06
@cbb330
cbb330 added this pull request to stack #915 November 21, 2026 01:06
@cbb330
cbb330 force-pushed the chbush/read-bridge-misfit-message-ahv5f branch from bf35dde to cdcc266 Compare November 21, 2026 01:14
cbb330

This comment was marked as outdated.

@cbb330
cbb330 force-pushed the chbush/read-bridge-misfit-message-ahv5f branch 2 times, most recently from b917790 to aeee99b Compare November 21, 2026 02:17
@cbb330 cbb330 changed the title [default values] Report a column default that does not bind as COLUMN_DEFAULT_UNUSABLE [default values] Change the error message when a column default does not fit Nov 21, 2026
@cbb330
cbb330 force-pushed the chbush/read-bridge-misfit-message-ahv5f branch 3 times, most recently from 7b495e9 to ee4ea04 Compare November 21, 2026 02:37
…not fit

A table can store a column default that does not fit the type its column
had in an older schema version, such as 8000000000 on an int column later
promoted to bigint. Every Java client load of such a table fails, before
and after this change. Only the error message changes.

Before: read-bridge: unusable config for table db.tbl
After:  COLUMN_DEFAULT_UNUSABLE: OpenHouse cannot apply the column defaults
        declared on db.tbl (TYPE_MISMATCH, column n, field ID 2). The
        default does not fit int, the column's type in schema version 0.

The new message names the column, in the form the server uses when it
refuses such a default. Iceberg's own error ("Cannot parse default as a
int value: 8000000000") does not. So before ReadBridge.apply sets a
default on its column in a schema version, it checks the default fits,
with the steps Iceberg's SchemaParser takes for an initial-default. A
default that fits loads as before.

A default that does not fit is thrown as ColumnDefaultDoesNotFitException,
a ReadBridgeException whose message is the new one. OpenHouseTableOperations
catches it before other ReadBridgeExceptions, which keep the old message.
@cbb330
cbb330 force-pushed the chbush/read-bridge-misfit-message-ahv5f branch from ee4ea04 to 9209720 Compare November 21, 2026 02:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant