Gabriel39 commented on code in PR #66413:
URL: https://github.com/apache/doris/pull/66413#discussion_r3762301055
##########
regression-test/suites/external_table_p0/iceberg/test_iceberg_varbinary.groovy:
##########
@@ -22,20 +22,26 @@ suite("test_iceberg_varbinary", "p0,external") {
logger.info("disable iceberg test.")
return
}
+ sql "SET ENABLE_VARIANT_V2=true"
Review Comment:
Fixed in cdcfea49315. Removed the invalid enable_variant_v2 SET statements
from the Iceberg varbinary, Iceberg Variant read, and Paimon Variant suites so
they exercise the execution carrier under the intended default-off FE
configuration.
##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergWritePlanProvider.java:
##########
@@ -366,6 +373,53 @@ private static boolean hasMeaningfulTypeParameters(String
typeName) {
|| "TIMESTAMPTZ".equals(typeName);
}
+ static void validateWriteSchema(List<ConnectorColumn> columns, boolean
writesDataFiles) {
+ if (!writesDataFiles) {
+ return;
+ }
+ if (columns.stream().anyMatch(column ->
containsVariant(column.getType()))) {
+ // Reject the whole data-file write: validating only selected
columns would let an
+ // unchanged Variant target flow through a writer that cannot
preserve its physical identity.
+ throw new DorisConnectorException(
+ "Iceberg VARIANT columns are read-only and cannot be
written");
+ }
+ }
+
+ static void validateWriteSchema(ConnectorWriteHandle handle) {
+ // The explicit INSERT column list can omit an unchanged Variant
column, but the data writer
+ // still binds the complete target schema and therefore must validate
that complete shape.
+ validateWriteSchema(handle.getBoundTargetColumns(),
handle.isWritesDataFiles());
+ }
+
+ private static void validateNestedPartitionWriteCompatibility(
+ ConnectorWriteHandle handle, IcebergWriteSchemaContext
schemaContext) {
+ WriteOperation operation = handle.getWriteOperation();
+ boolean writesDataFiles = operation != WriteOperation.DELETE
+ && ((operation != WriteOperation.UPDATE && operation !=
WriteOperation.MERGE)
+ || handle.isWritesDataFiles());
+ if (!writesDataFiles || schemaContext == null
Review Comment:
Fixed in cdcfea49315. REWRITE now validates nested-partition compatibility
after constructing the rewrite schema context used by the sink. Added coverage
proving execution version 11 is rejected and version 12 is accepted.
--
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]