Fokko commented on issue #1560:
URL: https://github.com/apache/iceberg-rust/issues/1560#issuecomment-3149975806

   > I think a better approach is to match array just by order and array type?
   
   I think this is typically the approach for SQL:
   
   ```
   spark-sql (default)> CREATE TABLE vo (a string, b int);
   Time taken: 0.516 seconds
   
   spark-sql (default)> insert into vo SELECT 1 as b, 'one' as a;
   25/08/04 12:16:51 WARN TableOutputResolver: The query columns and the table 
columns have same names but different orders. You can use INSERT [INTO | 
OVERWRITE] BY NAME to reorder the query columns to align with the table columns.
   [INCOMPATIBLE_DATA_FOR_TABLE.CANNOT_SAFELY_CAST] Cannot write incompatible 
data for the table `spark_catalog`.`default`.`vo`: Cannot safely cast `b` 
"STRING" to "INT". SQLSTATE: KD000
   
   spark-sql (default)> insert into vo VALUES ('one', 1);
   Time taken: 0.895 seconds
   ```
   
   If we want to map names to field-IDs, we should use name-mapping: 
https://iceberg.apache.org/spec/#column-projection


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