-
Notifications
You must be signed in to change notification settings - Fork 90
feat: provide TableDefinition functions for Iceberg tables
#5881
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
Conversation
extensions/iceberg/src/main/java/io/deephaven/iceberg/util/IcebergCatalogAdapter.java
Show resolved
Hide resolved
| // Map all the column names in the schema to their legalized names. | ||
| final Map<String, String> legalizedColumnRenames = new HashMap<>(); | ||
|
|
||
| // Validate user-supplied names meet legalization instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Validate user-supplied names meet legalization instructions | |
| // Validate user-supplied names meet legalization rules |
| * @param instructions The instructions for customizations while reading | ||
| * @return The table definition as a Deephaven table | ||
| */ | ||
| @SuppressWarnings("unused") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we want @ScriptAPI annotations for this stuff?
extensions/iceberg/src/main/java/io/deephaven/iceberg/util/IcebergCatalogAdapter.java
Show resolved
Hide resolved
| final String destinationName = entry.getValue(); | ||
| if (!NameValidator.isValidColumnName(destinationName)) { | ||
| throw new TableDataException( | ||
| String.format("%s - invalid column name provided (%s)", table, destinationName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are losing the snapshotId that we had previously; we could still pass snapshotId, and have it be -1 when there is no snapshot, or something.
| uploadParquetFiles(new File(IcebergToolsTest.class.getResource("/warehouse/sales/sales_multi").getPath()), | ||
| warehousePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to upload parquet files to get the definition? I think it's all involved in the metadata (which we aren't uploading as part of this).
| tableDef.checkHasColumn("Region", String.class); | ||
| tableDef.checkHasColumn("Item_Type", String.class); | ||
| tableDef.checkHasColumn("Units_Sold", int.class); | ||
| tableDef.checkHasColumn("Unit_Price", double.class); | ||
| tableDef.checkHasColumn("Order_Date", Instant.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should prefer to model this as
TableDefinition expected = ...;
TableDefinition actual = adapter.getTableDefinition(...);
assertEquals(expected, actual);or something like that
|
Completed via #5891 |
Will close #5868 when merged (but needs reconciled with #5880)