-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: revisit column ID assignment #17340
Comments
Another factor to consider: In iceberg it's required to have a |
As discussed with @BugenZhao, the col id assignment for source is not very wrong for now: Things that matter
Table's implementation
So both the properties are ensured. Source's implementationSource doesn't persist data, so property 1 is not needed at all. (It seems safe to reuse used ID.)
So it looks correct now. Struct?Currently we didn't handle struct field's col id carefully. It might have problem in the future when we have alter struct column. Not sure now. |
During work in #17293, we can see it's a mess. It's error-prone and we cannot understand how it works precisely.
In some places, we use
ColumnId::placeholder()
, and usecol_id_gen
to fill it at the endIn other places, we create column id ad-hoc. AND MAY OR MAY NOT use
col_id_gen
again to assign the col id.For
TableVersion
we havenext_column_id
, but not forSourceVersion
. This meansDROP COLUMN
for source might be problematic (although we don't support it).However, it's also possible that it can work. As fix(source): fix panic for
ALTER SOURCE
with schema registry #17293 (comment), perhaps (fixed) column id for source is not relied on, but we have no clue yet.A little more background:
ColumnIdGenerator
is introduced in feat(frontend): introduce the skeleton of schema change #7083After the refactor refactor(binder): bind create table #10307, we introduced
ColumnId::placeholder()
. This makes coding easier, but also more error-prone.frontend: refactor source schema resolution #9828 also mentioned:
The text was updated successfully, but these errors were encountered: