Gabriel39 commented on code in PR #67904:
URL: https://github.com/apache/doris/pull/67904#discussion_r4012041193
##########
fe/fe-connector/fe-connector-paimon/src/main/java/org/apache/doris/connector/paimon/PaimonScanPlanProvider.java:
##########
@@ -343,10 +344,43 @@ Table resolveTable(PaimonTableHandle paimonHandle) {
*/
Table resolveScanTable(PaimonTableHandle paimonHandle) {
Table table = resolveTable(paimonHandle);
- Map<String, String> scanOptions = paimonHandle.getScanOptions();
+ return withBoundSchemaAuthentication(paimonHandle, () ->
applyScanOptions(paimonHandle, table));
+ }
+
+ private <T> T withBoundSchemaAuthentication(PaimonTableHandle handle,
Supplier<T> action) {
+ if (context == null ||
!PaimonScanParams.preservesBoundSchema(handle.getScanOptions())) {
+ return action.get();
+ }
+ // Restoring a bound schema can read FileIO after table resolution has
left the authenticated scope.
+ try {
+ return context.executeAuthenticated(action::get);
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to restore Paimon statement
schema", e);
+ }
+ }
+
+ private Map<String, String> effectiveScanOptions(PaimonTableHandle handle)
{
+ Map<String, String> options = handle.getScanOptions();
+ return PaimonScanParams.preservesBoundSchema(options)
+ ? PaimonScanParams.withCatalogOptions(options,
PaimonTableOptions.extract(catalogProps.getRaw()))
Review Comment:
Fixed in 8c2b14c49d. This regression was introduced by the new restoration
path, so it is in scope. effectiveScanOptions now uses extractCompatible,
matching PaimonConnector's bind/replay policy; CREATE/ALTER validation remains
strict. Two tests reconstruct the connector twice from properties containing an
unknown or malformed legacy reader option, then verify ordinary scans and
backend-table preparation still read the expected row while valid catalog
options survive. Both failed before the change.
--
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]