github-actions[bot] commented on code in PR #70812:
URL: https://github.com/apache/doris/pull/70812#discussion_r4641867419
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergExternalMetaCache.java:
##########
@@ -471,6 +473,34 @@ public View getIcebergView(ExternalTable dorisTable) {
return viewEntry.get(nameMapping.getCtlId()).get(nameMapping);
}
+ public IcebergSchemaCacheValue
getIcebergViewSchemaCacheValue(ExternalTable dorisTable, long schemaId) {
+ try {
+ return
dorisTable.getCatalog().getExecutionAuthenticator().execute(() -> {
+ View view = getIcebergView(dorisTable);
+ Schema viewSchema = schemaId == IcebergUtils.NEWEST_SCHEMA_ID
+ ? view.schema() : view.schemas().get((int) schemaId);
+ Preconditions.checkNotNull(viewSchema,
+ "Schema for view %s.%s is null",
dorisTable.getDbName(), dorisTable.getName());
+ NameMapping nameMapping = dorisTable.getOrBuildNameMapping();
+ boolean enableMappingVarbinary =
dorisTable.getCatalog().getEnableMappingVarbinary();
+ boolean enableMappingTimestampTz =
dorisTable.getCatalog().getEnableMappingTimestampTz();
+ // View UUIDs isolate recreated views; mapping options
identify the schema projection.
+ IcebergSchemaCacheKey key = new IcebergSchemaCacheKey(
+ nameMapping, "view:" + view.uuid(),
viewSchema.schemaId(),
+ enableMappingVarbinary, enableMappingTimestampTz);
Review Comment:
[P2] Keep the update-time contract for view schema loads. This custom miss
loader parses and validates the schema but never calls
`dorisTable.setUpdateTime(...)`, unlike
`loadSchemaCacheValue`/`initSchemaAndUpdateTime`. After a view schema change,
the IcebergExternalTable can continue reporting its old (or initial) update
time to FE metadata and statistics consumers. Set the update time in this path
(and add a regression assertion).
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergExternalTable.java:
##########
@@ -288,6 +306,10 @@ public List<Column> getFullSchema() {
@Override
public List<Column> getFullSchema(Optional<MvccSnapshot> snapshot) {
return withMissingTableRepair(() -> {
+ // Views have no physical row-id or row-lineage metadata.
+ if (isView()) {
+ return new ArrayList<>(IcebergUtils.getIcebergSchema(this,
snapshot));
+ }
return IcebergUtils.withSnapshotCacheValue(snapshot, this,
this::projectFullSchema);
});
Review Comment:
[P1] Complete the view bypass for table-only metadata.
`supportInternalPartitionPruned()` now returns false for views, but
`isPartitionedTable()` still calls `withIcebergTable(...table.spec())`, and
`fetchRowCount()` still calls `getIcebergRowCount(this)`.
`StatisticsAutoCollector` calls `isPartitionedTable()` before its
Iceberg-specific branch, so a valid Iceberg view reaches the table endpoint and
fails (the same applies to other generic metadata/statistics callers). Guard
these methods or skip view analysis, with regression coverage.
--
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]