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 2019/07/16 16:21:54 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #285: Update metadata tables for unpartitioned tables

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

 ##########
 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:
   These IDs are [part of the spec](http://iceberg.apache.org/spec/#manifests), so I think it is better to use the IDs than to use names. That's why I added a comment to explain which field is being removed.

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


With regards,
Apache Git Services

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