github-actions[bot] commented on code in PR #66413: URL: https://github.com/apache/doris/pull/66413#discussion_r3791188399
########## fe/fe-core/src/main/java/org/apache/doris/nereids/types/ConnectorComputeVariantType.java: ########## @@ -0,0 +1,44 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.nereids.types; + +import org.apache.doris.catalog.Type; + +/** Execution-only Variant marker retained while connector scan slots pass through Nereids. */ +public final class ConnectorComputeVariantType extends VariantType { + + public static final ConnectorComputeVariantType INSTANCE = new ConnectorComputeVariantType(); + + private ConnectorComputeVariantType() { + super(0); + } + + @Override + public DataType conversion() { + // Conversion is the durable-schema boundary used by CTAS and MTMV; the execution marker + // must not enter catalog metadata because persistence only registers the ordinary Variant type. + return super.conversion(); Review Comment: [P1] Keep normalized CTAS/MTMV targets executable This fixes persistence, but the materialization path remains incompatible under the default `enable_variant_v2=false`. CTAS derives an ordinary Variant target here, creates it, and then replans the original query as an INSERT; a root external Variant output still has `ConnectorComputeVariantType`. The exact-class type mismatch makes `BindSink` add a cast. The source Thrift type is forced to V2, while the ordinary target is legacy Variant by default, and BE rejects that V2-to-legacy cast. Consequently a CTAS such as `CREATE TABLE ... AS SELECT id, payload FROM <external Variant table>` fails in its insert phase (the CTAS error path then attempts to drop the just-created table), and an MTMV refresh that selects the root Variant fails at the same sink boundary. This is a follow-up to the resolved journal/Gson thread: metadata now replays, but root Variant rows still cannot be materialized. Please provide an executable carrier conversion (or reject before creation) and cover default-o ff root-Variant CTAS plus MTMV refresh; the new UT only round-trips schema, and the Paimon MTMV case casts a subpath to STRING. -- 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]
