difin commented on code in PR #6789:
URL: https://github.com/apache/hive/pull/6789#discussion_r4300410648
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveTableUtil.java:
##########
@@ -259,6 +261,71 @@ public static Table deserializeTable(Configuration config,
String name) {
return table;
}
+ /**
+ * Resolves the Iceberg {@link Table} for split generation ({@code
IcebergInputFormat#getSplits}).
+ *
+ * <p>Serialized tables ({@link SerializableTable}) only carry a metadata
snapshot and produce
+ * {@link org.apache.iceberg.DataTableScan} (client-side manifest planning).
When REST catalog
+ * server-side scan planning is enabled, reload the live table from the
catalog so
+ * {@code table.newScan()} returns {@link
org.apache.iceberg.rest.RESTTableScan} and issues
+ * {@code POST /plan} on the REST server.
+ *
+ * <p>Intra-transaction read-after-write ({@link
InputFormatConfig#TABLE_METADATA_LOCATION}) still
+ * uses the deserialized snapshot so uncommitted metadata is visible.
+ */
+ public static Table resolveTableForScanPlanning(Configuration conf, String
tableIdentifier) {
+ if (shouldReloadForServerSideScanPlanning(conf)) {
+ Table table = Catalogs.loadTable(conf);
+ checkAndSetIoConfig(conf, table);
+ IcebergVendedCredentialUtil.applyFromJobConf(table,
resolveCatalogName(conf), conf);
+ return table;
+ }
+
+ Table table = deserializeTable(conf, tableIdentifier);
+ if (table == null) {
+ table = Catalogs.loadTable(conf);
Review Comment:
Simplified instead of unifying: removed `resolveTableForScanPlanning`. The
only catalog load the PR adds is the server-side reload in `getSplits` (inside
`try (CloseableRestCatalog …))`, and it no longer calls `applyFromJobConf`.
That table is only used for POST /plan, which is pure REST, so the AM doesn't
read storage with it. The no-serialized-table fallback is back to master's
`Catalogs.loadTable(conf)`. So both load paths now treat credentials the same
way.
On your two questions:
- applyFromJobConf is a no-op when there are no serialized creds and no
delegation header. It's no longer called on either load path, only from
`deserializeTable` as before.
- Executors read through the deserialized compile-time table, so the creds
HS2 vended at compile time are the ones used. Creds on the AM's fresh
`LoadTableResponse` don't reach the readers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]