Merge "Merge branch 'gerrit/trinity' into 'gerrit/goldfish'" into goldfish
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/delta/AwsS3DeltaReaderFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/delta/AwsS3DeltaReaderFactory.java
index 8dc820b..d29cd40 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/delta/AwsS3DeltaReaderFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/aws/delta/AwsS3DeltaReaderFactory.java
@@ -91,7 +91,7 @@
throws AlgebricksException, HyracksDataException {
this.configuration = configuration;
Configuration conf = new Configuration();
- configurationBuilder(configuration, conf);
+ applyConfiguration(configuration, conf);
String tableMetadataPath = S3Constants.HADOOP_S3_PROTOCOL + "://"
+ configuration.get(ExternalDataConstants.CONTAINER_NAME_FIELD_NAME) + '/'
+ configuration.get(ExternalDataConstants.DEFINITION_FIELD_NAME);
@@ -189,7 +189,7 @@
partitionWorkLoadsBasedOnSize.addAll(workloadQueue);
}
- public static void configurationBuilder(Map<String, String> configuration, Configuration conf) {
+ public static void applyConfiguration(Map<String, String> configuration, Configuration conf) {
conf.set(S3Constants.HADOOP_ACCESS_KEY_ID, configuration.get(S3Constants.ACCESS_KEY_ID_FIELD_NAME));
conf.set(S3Constants.HADOOP_SECRET_ACCESS_KEY, configuration.get(S3Constants.SECRET_ACCESS_KEY_FIELD_NAME));
if (configuration.get(S3Constants.SESSION_TOKEN_FIELD_NAME) != null) {
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
index 19c1979..12ce22d 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/ExternalDataUtils.java
@@ -519,11 +519,16 @@
String tableMetadataPath = null;
if (configuration.get(ExternalDataConstants.KEY_EXTERNAL_SOURCE_TYPE)
.equals(ExternalDataConstants.KEY_ADAPTER_NAME_AWS_S3)) {
- AwsS3DeltaReaderFactory.configurationBuilder(configuration, conf);
+ AwsS3DeltaReaderFactory.applyConfiguration(configuration, conf);
tableMetadataPath = S3Constants.HADOOP_S3_PROTOCOL + "://"
+ configuration.get(ExternalDataConstants.CONTAINER_NAME_FIELD_NAME) + '/'
+ configuration.get(ExternalDataConstants.DEFINITION_FIELD_NAME);
+ } else {
+ throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR,
+ "Delta format is not supported for the external source type: "
+ + configuration.get(ExternalDataConstants.KEY_EXTERNAL_SOURCE_TYPE));
}
+
Engine engine = DefaultEngine.create(conf);
io.delta.kernel.Table table = io.delta.kernel.Table.forPath(engine, tableMetadataPath);
try {