paul-rogers commented on a change in pull request #1599: DRILL-6903:
SchemaBuilder code improvements
URL: https://github.com/apache/drill/pull/1599#discussion_r245888481
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/record/metadata/TupleSchema.java
##########
@@ -145,6 +145,11 @@ public boolean isEquivalent(TupleMetadata other) {
return cols;
}
+ @Override
+ public List<ColumnMetadata> toMetadataList() {
+ return new ArrayList<>(nameSpace.entries());
+ }
Review comment:
How will this be used? A list of metadata is OK for serialization. But, is
very awkward for semantic processing. On a large row, an O(n) lookup will turn
into an O(n^2) algorithm as each column is looked up. The tuple structure is
designed to provide both a name index and an order.
(By the way, if you have not already, the tuple schema class can be
simplified by the use of the LinkedHashMap class that I didn't know about at
the time...)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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