You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/06/25 09:04:37 UTC

[GitHub] [iceberg] openinx commented on issue #2738: What's the correct semantic when projecting a required nested field from an optional struct ?

openinx commented on issue #2738:
URL: https://github.com/apache/iceberg/issues/2738#issuecomment-868349637


   I had a test in spark3: 
   
   ```bash
   CREATE TABLE loc(
       id       LONG NOT NULL,
       location STRUCT<lat:DOUBLE NOT NULL, long:DOUBLE NOT NULL>
   );
   
   INSERT INTO loc VALUES (1, null);
   
   > SELECT * FROM loc;
   1	NULL
   Time taken: 0.374 seconds, Fetched 1 row(s)
   
   > SELECT location.lat FROM loc;
   NULL
   Time taken: 0.22 seconds, Fetched 1 row(s)
   ```
   
   So it will get a `NULL` value when projecting the required `location.lat` from optional `location` struct.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org