>From Hussain Towaileb <[email protected]>:
Hussain Towaileb has uploaded this change for review. (
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17400 )
Change subject: [NO ISSUE]: Properly report error for buckets with dot (.) in
the name (Parquet only)
......................................................................
[NO ISSUE]: Properly report error for buckets with dot (.) in the name (Parquet
only)
Change-Id: I67c784f617144cd9e828307b832a4d217c450ea1
---
M
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/HDFSDataSourceFactory.java
1 file changed, 27 insertions(+), 2 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/00/17400/1
diff --git
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/HDFSDataSourceFactory.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/HDFSDataSourceFactory.java
index 419782f..b190e33 100644
---
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/HDFSDataSourceFactory.java
+++
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/HDFSDataSourceFactory.java
@@ -18,6 +18,10 @@
*/
package org.apache.asterix.external.input;
+import static
org.apache.asterix.external.util.ExternalDataConstants.CONTAINER_NAME_FIELD_NAME;
+import static
org.apache.asterix.external.util.ExternalDataConstants.FORMAT_PARQUET;
+import static org.apache.hyracks.api.util.ExceptionUtils.getMessageOrToString;
+
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
@@ -101,6 +105,7 @@
}
protected void configureHdfsConf(JobConf conf, Map<String, String>
configuration) throws AlgebricksException {
+ String formatString =
configuration.get(ExternalDataConstants.KEY_FORMAT);
try {
confFactory = new ConfFactory(conf);
clusterLocations = getPartitionConstraint();
@@ -120,7 +125,6 @@
inputSplitsFactory = new InputSplitsFactory(inputSplits);
read = new boolean[readSchedule.length];
Arrays.fill(read, false);
- String formatString =
configuration.get(ExternalDataConstants.KEY_FORMAT);
if (formatString == null ||
formatString.equals(ExternalDataConstants.FORMAT_HDFS_WRITABLE)) {
RecordReader<?, ?> reader =
conf.getInputFormat().getRecordReader(inputSplits[0], conf, Reporter.NULL);
this.recordClass = reader.createValue().getClass();
@@ -132,7 +136,19 @@
this.recordClass = char[].class;
}
} catch (IOException e) {
- throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, e);
+ throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, e,
getMessageOrToString(e));
+ } catch (Exception e) {
+ if (FORMAT_PARQUET.equals(formatString)) {
+ String containerName =
configuration.get(CONTAINER_NAME_FIELD_NAME);
+ if (containerName != null && containerName.contains(".")) {
+ throw new
CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR, e,
+ getMessageOrToString(e) + " Buckets with '.' in
the name can cause issues.");
+ } else {
+ throw e;
+ }
+ } else {
+ throw e;
+ }
}
}
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17400
To unsubscribe, or for help writing mail filters, visit
https://asterix-gerrit.ics.uci.edu/settings
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I67c784f617144cd9e828307b832a4d217c450ea1
Gerrit-Change-Number: 17400
Gerrit-PatchSet: 1
Gerrit-Owner: Hussain Towaileb <[email protected]>
Gerrit-MessageType: newchange