-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Use table schema from the table handle #14076
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -312,7 +312,7 @@ else if (identity.getId() == TRINO_MERGE_PARTITION_DATA) { | |
| partitionSpec.specId(), | ||
| split.getPartitionDataJson(), | ||
| split.getFileFormat(), | ||
| split.getSchemaAsJson().map(SchemaParser::fromJson), | ||
| SchemaParser.fromJson(table.getTableSchemaJson()), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
is it testable?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it it testable through I was reluctant on squashing the two commits of this PR because they address different issues. The test |
||
| requiredColumns, | ||
| effectivePredicate, | ||
| table.getNameMappingJson().map(NameMappingParser::fromJson), | ||
|
|
@@ -495,7 +495,7 @@ private ConnectorPageSource openDeletes( | |
| 0, | ||
| "", | ||
| IcebergFileFormat.fromIceberg(delete.format()), | ||
| Optional.of(schemaFromHandles(columns)), | ||
| schemaFromHandles(columns), | ||
| columns, | ||
| tupleDomain, | ||
| Optional.empty(), | ||
|
|
@@ -513,7 +513,7 @@ public ReaderPageSourceWithRowPositions createDataPageSource( | |
| int partitionSpecId, | ||
| String partitionData, | ||
| IcebergFileFormat fileFormat, | ||
| Optional<Schema> fileSchema, | ||
| Schema fileSchema, | ||
| List<IcebergColumnHandle> dataColumns, | ||
| TupleDomain<IcebergColumnHandle> predicate, | ||
| Optional<NameMapping> nameMapping, | ||
|
|
@@ -564,7 +564,7 @@ public ReaderPageSourceWithRowPositions createDataPageSource( | |
| length, | ||
| partitionSpecId, | ||
| partitionData, | ||
| fileSchema.orElseThrow(), | ||
| fileSchema, | ||
| nameMapping, | ||
| dataColumns); | ||
| default: | ||
|
|
||
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.
this is a good change.
However, it looks like we call
SchemaParser.fromJson(tableHandle.getTableSchemaJson())multiple times on one table handle. Am i right?SchemaParser.fromJsondoes cache internally (on a static field).This isn't ideal, and we could better, caching within table handle object. Not sure it matters though -- depends how frequently this is called.
Uh oh!
There was an error while loading. Please reload this page.
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.
Should we switch to
SchemaParser.fromJson(JsonNode)?