github-actions[bot] commented on code in PR #66007:
URL: https://github.com/apache/doris/pull/66007#discussion_r3651825755
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/FileQueryScanNode.java:
##########
@@ -174,7 +179,9 @@ protected void initSchemaParams() throws UserException {
params = new TFileScanRangeParams();
params.setDestTupleId(desc.getId().asInt());
List<String> partitionKeys = getPathPartitionKeys();
- List<Column> columns = desc.getTable().getBaseSchema(false);
+ List<Column> columns = desc.getTable() instanceof ExternalTable
+ ? ((ExternalTable)
desc.getTable()).getBaseSchema(getRelationSnapshot(), false)
Review Comment:
[P1] Build fallback defaults from this relation's field
Although `columns` now comes from `getRelationSnapshot()`,
`setDefaultValueExprs()` still walks the table-scoped no-argument schema and
matches defaults to slots by name. This matters when an old optional field `x`
had no initial default, was dropped, and a new `x` was added with default `B`:
if latest metadata is table-scoped while scanning the old snapshot, FE attaches
`B` to the old slot. Because the old field has no non-null history default for
BE to prefer, pre-add files read `B` instead of their historical NULL. Please
build the fallback expressions from the same relation schema and cover
drop/re-add name reuse with an absent old initial default.
--
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]