OIiveirra commented on code in PR #69032:
URL: https://github.com/apache/doris/pull/69032#discussion_r4609006532


##########
be/src/format/transformer/viceberg_parquet_writer.cpp:
##########
@@ -104,6 +149,9 @@ Status VIcebergParquetWriter::write(const Block& block) {
     if (block.rows() == 0) {
         return Status::OK();
     }
+    ColumnNumbers column_numbers(block.columns());
+    std::iota(column_numbers.begin(), column_numbers.end(), 0);
+    RETURN_IF_ERROR(validate_spatial_wkb_inputs(block, column_numbers));

Review Comment:
   I ran the reported `INSERT INTO dst(items) SELECT array(s) FROM src WHERE s 
IS NULL` on `777b60645c5` against imported Iceberg V3 Parquet tables with an 
`ARRAY<STRUCT<g:GEOMETRY>>` column and a runtime NULL STRUCT in the source.
   
   - With `element-required=true`, Doris returned `[DATA_QUALITY_ERROR] Iceberg 
required field 'items.element' contains NULL at row 0, element 0`. The REST 
catalog showed the same current snapshot (`8891465728406491704`), snapshot 
list, and metadata location before and after the rejected INSERT. Only the seed 
row remained.
   - With `element-required=false`, the same INSERT committed one new snapshot 
and read back a one-element array containing NULL.
   
   The recursive `iceberg::validate_write_block()` call in 
`VIcebergTableWriter::_write_prepared_block()` is also present at the reviewed 
head. It checks the runtime element null map against the target Iceberg schema 
before Arrow conversion. The reported INSERT path is covered by that check.
   



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