guiyanakuang commented on a change in pull request #810:
URL: https://github.com/apache/orc/pull/810#discussion_r682230563



##########
File path: java/core/src/java/org/apache/orc/impl/ReaderImpl.java
##########
@@ -569,7 +561,13 @@ public ReaderImpl(Path path, OrcFile.ReaderOptions 
options) throws IOException {
       this.rowIndexStride = tail.getFooter().getRowIndexStride();
       this.contentLength = tail.getFooter().getContentLength();
       this.numberOfRows = tail.getFooter().getNumberOfRows();
-      this.userMetadata = tail.getFooter().getMetadataList();
+      this.userMetadata = tail.getFooter().getMetadataList()
+              .stream().collect(Collectors.toMap(

Review comment:
       > If you don't mind, can we indent with `4-space` instead of `8-space`?
   
   I will fix

##########
File path: java/core/src/java/org/apache/orc/impl/ReaderImpl.java
##########
@@ -569,7 +561,13 @@ public ReaderImpl(Path path, OrcFile.ReaderOptions 
options) throws IOException {
       this.rowIndexStride = tail.getFooter().getRowIndexStride();
       this.contentLength = tail.getFooter().getContentLength();
       this.numberOfRows = tail.getFooter().getNumberOfRows();
-      this.userMetadata = tail.getFooter().getMetadataList();
+      this.userMetadata = tail.getFooter().getMetadataList()
+              .stream().collect(Collectors.toMap(

Review comment:
       > The java stream apis are very slow. It would perform better if you 
used a loop. This is especially important, because now the set is build 
preemptively, even if the user doesn't need the metadata values.
   
   How about lazy initialization of the set when the getMetadataValue and 
hasMetadataValue methods need to be called




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to