github-actions[bot] commented on code in PR #69032:
URL: https://github.com/apache/doris/pull/69032#discussion_r4417164349


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ConnectorChangelogPlanBuilder.java:
##########
@@ -207,6 +208,7 @@ private static ExpressionAnalyzer analyzer(LogicalPlan 
plan, CascadesContext con
 
     private static Alias bindColumn(ExpressionAnalyzer analyzer, Expression 
expression, Column column) {
         Expression value = analyzer.analyze(expression);

Review Comment:
   [P2] Normalize nested spatial NULLs before changelog casts. `bindColumn` 
validates the expression and immediately calls 
`TypeCoercionUtils.castIfNotSameType`; the MergeBuilder branch loop repeats the 
same order. For a target `ARRAY<GEOMETRY('OGC:CRS84')>`, an expression such as 
`ARRAY(CAST(NULL AS INT))` is a NULL-only value that the existing 
`ConnectorSpatialWriteNormalizer` retags for INSERT/row-level MERGE, but this 
changelog UPDATE/MERGE path reaches the validator/cast as `ARRAY<INT>` and 
fails with an INT-to-GEOMETRY conversion error. Apply the normalizer before 
validation/casting in both paths while preserving non-NULL spatial identity.



##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorMetadata.java:
##########
@@ -1146,6 +1146,15 @@ public void createTable(ConnectorSession session, 
ConnectorCreateTableRequest re
         rejectReservedRowLineageColumns(request);
         validateSortOrder(request);
         Schema schema = IcebergSchemaBuilder.buildSchema(request.getColumns());
+        boolean spatial = false;
+        for (Types.NestedField field : schema.columns()) {
+            spatial |= 
IcebergSpatialSchemaValidator.containsSpatial(field.type());
+        }
+        if (spatial) {
+            IcebergSpatialSchemaValidator.validateTable(

Review Comment:
   [P2] Apply the spatial format gate to property updates. This new validation 
runs for CREATE and schema changes, but `ALTER TABLE ... SET 
('write.format.default'='orc')` still goes through `setTableProperties` without 
checking the existing schema. The next INSERT reads that property, selects 
`VOrcTransformer`, and fails building the schema because GEOMETRY/GEOGRAPHY has 
no ORC type. Reject effective non-Parquet format changes whenever the current 
table schema contains spatial leaves, so a valid spatial table cannot be made 
unwritable.



-- 
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]

Reply via email to