danielcweeks commented on a change in pull request #285: Update metadata tables 
for unpartitioned tables
URL: https://github.com/apache/incubator-iceberg/pull/285#discussion_r303983877
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/DataFilesTable.java
 ##########
 @@ -51,12 +53,18 @@ String metadataTableName() {
 
   @Override
   public TableScan newScan() {
-    return new FilesTableScan(ops, table);
+    return new FilesTableScan(ops, table, schema());
   }
 
   @Override
   public Schema schema() {
-    return new Schema(DataFile.getType(table.spec().partitionType()).fields());
+    Schema schema = new 
Schema(DataFile.getType(table.spec().partitionType()).fields());
+    if (table.spec().fields().size() < 1) {
+      // avoid returning an empty struct, which is not always supported. 
instead, drop the partition field (id 102)
+      return TypeUtil.selectNot(schema, Sets.newHashSet(102));
 
 Review comment:
   Should we enumerate these fields rather than using magic numbers (i.e. 102)?

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


With regards,
Apache Git Services

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

Reply via email to