github-actions[bot] commented on code in PR #68667:
URL: https://github.com/apache/doris/pull/68667#discussion_r4217142151
##########
fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlSchemaHelper.java:
##########
@@ -341,13 +353,37 @@ private Map<String, List<Field>>
buildTableToFields(String dbName, TDescribeTabl
/** One column, with its nested types described down to the leaves. */
private static Field buildField(String dbName, String tableName,
TColumnDesc desc) {
+ if (desc.getColumnType() == TPrimitiveType.VARIANT) {
+ return nativeVariantField(desc.getColumnName(),
desc.isIsAllowNull(),
+ createFlightSqlColumnMetadata(dbName, tableName, desc));
+ }
ArrowType arrowType = columnDescToArrowType(desc);
return new Field(desc.getColumnName(),
new FieldType(desc.isIsAllowNull(), arrowType, null,
createFlightSqlColumnMetadata(dbName, tableName,
desc)),
arrowChildren(dbName, tableName, desc, arrowType));
}
Review Comment:
[P2] Gate Flight output on the actual Variant representation. Iceberg maps a
VARIANT column to `COMPUTE_V2_INSTANCE` even when `enable_variant_v2=false`;
that marker sets `variant_is_v2` in Thrift, so the BE creates
`DataTypeVariantV2` and returns a valid native schema. This global-only check
still rejects `SELECT variant_col FROM iceberg_catalog.db.table`: GetSchema and
Prepare fail in `nativeVariantField`, and direct execution fails when
`withDorisTypeMetadata` reaches the same check after fetching the BE schema.
GetTables schema discovery rejects the column too. Check the planned physical
Variant type (and carry it into GetTables descriptors) while continuing to
reject genuine legacy V1.
##########
be/src/format/arrow/arrow_row_batch.cpp:
##########
@@ -229,6 +245,25 @@ std::string
DorisArrowSchemaConvertor::timestamp_timezone(PrimitiveType) const {
return _timezone == "Z" ? "UTC" : _timezone;
}
Review Comment:
[P1] Preserve UTF8 Variant output for FEs that do not request native
Variant. During a BE-first rolling upgrade, an older FE still maps VARIANT to
UTF8 for GetSchema and Prepare, but this new override makes every upgraded BE
publish the `arrow.parquet.variant` struct. The older FE already sets
`enable_arrow_type_metadata=true`, so that bit does not identify native
support; even `LegacyArrowFlightSchemaConvertor` inherits this override. A
prepared V2 Variant query then fails the FE's prepared-versus-execution schema
check with all result BEs upgraded. Add a distinct FE native-Variant opt-in or
an older-FE output path. This is the reverse upgrade direction from existing P1
`4141016458` (new FE with old BEs).
--
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]