github-actions[bot] commented on code in PR #68667:
URL: https://github.com/apache/doris/pull/68667#discussion_r4215994109
##########
fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlQuerySchema.java:
##########
@@ -371,13 +373,18 @@ private static void resolveNamespace(ConnectContext
context, Plan plan, Map<Stri
}
}
- private static Field field(String name, Type type, boolean nullable,
boolean topLevel, String timezone) {
+ private static Field field(String name, Type type, boolean nullable,
boolean topLevel, String timezone,
+ boolean nativeVariant) {
// group_concat uses IAggregateFunction's string serialization, unlike
fixed-size states
// such as sum/count. Match that BE wire type instead of treating
every AGG_STATE as Null.
if (type instanceof AggStateType &&
"group_concat".equals(((AggStateType) type).getFunctionName())) {
type = Type.STRING;
}
PrimitiveType primitive = type.getPrimitiveType();
+ if (nativeVariant && primitive == PrimitiveType.VARIANT) {
Review Comment:
[P2] Reject legacy Variant during native schema discovery. With
`enable_variant_v2=false` (the FE default) and this session option enabled,
`GetSchemaStatement` and Prepare call `FlightSqlQuerySchema.analyze`; this
branch advertises `arrow.parquet.variant` for `SELECT CAST(42 AS VARIANT)` even
though the BE rejects its `DataTypeVariant` with `only supports Variant V2`.
The new V1 Groovy branch expects those RPCs to return that error, so it fails,
and clients receive a schema for a query that cannot run. Use the same
legacy/V2 decision as execution, including nested leaves, before publishing
metadata.
--
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]