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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]