This is an automated email from the ASF dual-hosted git repository.
cgivre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git
The following commit(s) were added to refs/heads/master by this push:
new 9398083 DRILL-7894: Large Attributes Crash HDF5 Reader (#2196)
9398083 is described below
commit 9398083cc7ddbe57b37080443b73b191758199b3
Author: Charles S. Givre <[email protected]>
AuthorDate: Tue Apr 13 07:52:35 2021 -0400
DRILL-7894: Large Attributes Crash HDF5 Reader (#2196)
* DRILL-7894: Large Attributes Crash HDF5 Reader
* Removed unused import
---
.../java/org/apache/drill/exec/store/hdf5/HDF5BatchReader.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git
a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/HDF5BatchReader.java
b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/HDF5BatchReader.java
index 6305ddc..eaca6d9 100644
---
a/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/HDF5BatchReader.java
+++
b/contrib/format-hdf5/src/main/java/org/apache/drill/exec/store/hdf5/HDF5BatchReader.java
@@ -498,7 +498,7 @@ public class HDF5BatchReader implements
ManagedReader<FileSchemaNegotiator> {
* @return Map The attributes for the given path. Empty Map if no
attributes present
*/
private Map<String, HDF5Attribute> getAttributes(String path) {
-
+ Map<String, Attribute> attributeList;
// Remove trailing slashes
if (path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
@@ -516,7 +516,12 @@ public class HDF5BatchReader implements
ManagedReader<FileSchemaNegotiator> {
return attributes;
}
- Map<String, Attribute> attributeList = theNode.getAttributes();
+ try {
+ attributeList = theNode.getAttributes();
+ } catch (HdfException e) {
+ logger.warn("Unable to get attributes for {}: Only Huge objects BTrees
with 1 record are currently supported.", path);
+ return attributes;
+ }
logger.debug("Found {} attribtutes for {}", attributeList.size(), path);
for (Map.Entry<String, Attribute> attributeEntry :
attributeList.entrySet()) {