waterlx edited a comment on pull request #1077:
URL: https://github.com/apache/iceberg/pull/1077#issuecomment-636478762


   @rdblue The PR is updated. 
   The following code you suggested
   ```
   Schema fileSchema = fileProjection != null ? new 
Schema(fileProjection.asStructType().fields()) new Schema();
   ```
   is updated as
   ```
   Schema fileSchema = fileProjection != null ? new 
Schema(fileProjection.asStructType().fields()) : null;
   ```
   When meeting the null file projection (yielded by projecting 0 columns), it 
returns null instead of an empty schema, to address the issue of `Missing 
required field: data_file` mentioned 
[here](https://github.com/apache/iceberg/pull/1077#issuecomment-636366663).
   The issue is quite weird to me as it does not break the UT while it only 
happends on my local test with master as local[]. 
   Returning an empty schema seems not work in 
[BaseManifestReader#projection()](https://github.com/apache/iceberg/blob/201f8bf0e5084daa9fcc1e8418762ecb10967036/core/src/main/java/org/apache/iceberg/BaseManifestReader.java#L237)
 when setting project as an empty  schema.
   But fixing it by returning null seems get back to way of not supporting 0 
columns.


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to