[ 
https://issues.apache.org/jira/browse/DRILL-7578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17038835#comment-17038835
 ] 

ASF GitHub Bot commented on DRILL-7578:
---------------------------------------

paul-rogers commented on pull request #1978: DRILL-7578: HDF5 Metadata Queries 
Fail with Large Files
URL: https://github.com/apache/drill/pull/1978#discussion_r380488669
 
 

 ##########
 File path: 
contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/HDF5BatchReader.java
 ##########
 @@ -1069,26 +1125,30 @@ private void getAndMapCompoundData(String path, 
List<String> fieldNames, IHDF5Re
           for (int col = 0; col < values[row].length; col++) {
             assert fieldNames != null;
             currentFieldName = fieldNames.get(col);
-            ArrayWriter innerWriter = listWriter.array(currentFieldName);
-            if (values[row][col] instanceof Integer) {
-              innerWriter.scalar().setInt((Integer) values[row][col]);
-            } else if (values[row][col] instanceof Short) {
-              innerWriter.scalar().setInt((Short) values[row][col]);
-            } else if (values[row][col] instanceof Byte) {
-              innerWriter.scalar().setInt((Byte) values[row][col]);
-            } else if (values[row][col] instanceof Long) {
-              innerWriter.scalar().setLong((Long) values[row][col]);
-            } else if (values[row][col] instanceof Float) {
-              innerWriter.scalar().setDouble((Float) values[row][col]);
-            } else if (values[row][col] instanceof Double) {
-              innerWriter.scalar().setDouble((Double) values[row][col]);
-            } else if (values[row][col] instanceof BitSet || values[row][col] 
instanceof Boolean) {
-              innerWriter.scalar().setBoolean((Boolean) values[row][col]);
-            } else if (values[row][col] instanceof String) {
-              innerWriter.scalar().setString((String) values[row][col]);
-            }
-            if (col == values[row].length) {
-              innerWriter.save();
+            try {
+              ArrayWriter innerWriter = listWriter.array(currentFieldName);
+              if (values[row][col] instanceof Integer) {
 
 Review comment:
   I realize that this is existing code, but boxing and comparing each value 
will be slow and will thrash the heap. Far better if we can use "shims" that 
can read the data as the Java primitive type and write it directly to the 
corresponding `set()` method without boxing.
 
----------------------------------------------------------------
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]


> HDF5 Metadata Queries Fail with Large Files
> -------------------------------------------
>
>                 Key: DRILL-7578
>                 URL: https://issues.apache.org/jira/browse/DRILL-7578
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.18.0
>            Reporter: Charles Givre
>            Assignee: Charles Givre
>            Priority: Major
>             Fix For: 1.18.0
>
>
> With large files, Drill runs out of memory when attempting to project large 
> datasets in the metadata.  
> This PR adds a configuration option which removes the dataset projection from 
> metadata queries and fixes this issue.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to