This is an automated email from the ASF dual-hosted git repository.

mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit 594e7eca21e3374395934a2ab7ced3eef60b2ff3
Author: Ali Alsuliman <[email protected]>
AuthorDate: Thu May 14 18:19:59 2020 -0700

    [NO ISSUE][EXT] Minor refactoring of external datasets details validation
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    Minor refactoring of external datasets details validation.
    
    - Added a missing error message in Hyracks.
    
    Change-Id: I975228925366adc94f136bbbb014cb6817bf180e
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/6325
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Ali Alsuliman <[email protected]>
    Reviewed-by: Dmitry Lychagin <[email protected]>
---
 .../java/org/apache/asterix/app/translator/QueryTranslator.java   | 8 ++++----
 .../main/java/org/apache/asterix/common/exceptions/ErrorCode.java | 3 ++-
 .../asterix-common/src/main/resources/asx_errormsg/en.properties  | 5 +++--
 .../hyracks/hyracks-api/src/main/resources/errormsg/en.properties | 1 +
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index c2d50b3..93b36c5 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -730,7 +730,7 @@ public class QueryTranslator extends AbstractLangTranslator 
implements IStatemen
                             createExternalDatasetProperties(dataverseName, dd, 
metadataProvider, mdTxnCtx);
                     ExternalDataUtils.normalize(properties);
                     ExternalDataUtils.validate(properties);
-                    validateExternalDatasetDetails(externalDetails, 
properties);
+                    validateExternalDatasetProperties(externalDetails, 
properties, dd.getSourceLocation());
                     datasetDetails = new 
ExternalDatasetDetails(externalDetails.getAdapter(), properties, new Date(),
                             TransactionState.COMMIT);
                     break;
@@ -3210,13 +3210,13 @@ public class QueryTranslator extends 
AbstractLangTranslator implements IStatemen
         }
     }
 
-    protected void validateExternalDatasetDetails(ExternalDetailsDecl 
externalDetails, Map<String, String> properties)
-            throws RuntimeDataException {
+    protected void validateExternalDatasetProperties(ExternalDetailsDecl 
externalDetails,
+            Map<String, String> properties, SourceLocation srcLoc) throws 
CompilationException {
         String adapter = externalDetails.getAdapter();
         // "format" parameter is needed for "S3" data source
         if (ExternalDataConstants.KEY_ADAPTER_NAME_AWS_S3.equals(adapter)
                 && properties.get(ExternalDataConstants.KEY_FORMAT) == null) {
-            throw new RuntimeDataException(ErrorCode.PARAMETERS_REQUIRED, 
ExternalDataConstants.KEY_FORMAT);
+            throw new CompilationException(ErrorCode.PARAMETERS_REQUIRED, 
srcLoc, ExternalDataConstants.KEY_FORMAT);
         }
     }
 }
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index 6ec0ea2..37043b2 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -81,6 +81,8 @@ public class ErrorCode {
     public static final int INVALID_LIKE_PATTERN = 46;
     public static final int INVALID_REQ_PARAM_VAL = 47;
     public static final int INVALID_REQ_JSON_VAL = 48;
+    public static final int PARAMETERS_REQUIRED = 49;
+    public static final int INVALID_PARAM = 50;
 
     public static final int UNSUPPORTED_JRE = 100;
 
@@ -307,7 +309,6 @@ public class ErrorCode {
     public static final int FAILED_TO_PARSE_METADATA = 3115;
     public static final int INPUT_DECODE_FAILURE = 3116;
     public static final int FAILED_TO_PARSE_MALFORMED_LOG_RECORD = 3117;
-    public static final int PARAMETERS_REQUIRED = 3118;
 
     // Lifecycle management errors
     public static final int DUPLICATE_PARTITION_ID = 4000;
diff --git 
a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties 
b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index 37a8818..d3a2215 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -83,6 +83,8 @@
 46 = Invalid pattern \"%1$s\" for LIKE
 47 = Invalid value for parameter \"%1$s\": %2$s
 48 = Unable to process JSON content in request
+49 = Parameter(s) %1$s must be specified
+50 = Invalid parameter \"%1$s\"
 
 100 = Unsupported JRE: %1$s
 
@@ -227,7 +229,7 @@
 3035 = Feed already has an intake job
 3036 = Feed job already registered in intake jobs
 3037 = Feed job already registered in all jobs
-3038 = Record is too large!. Maximum record size is %1$s
+3038 = Record is too large. Maximum record size is %1$s
 3039 = Cannot parse list item of type %1$s
 3040 = Argument type: %1$s
 3041 = Unable to load/instantiate class %1$s
@@ -305,7 +307,6 @@
 3115 = Failed to parse record metadata
 3116 = Failed to decode input
 3117 = Failed to parse record, malformed log record
-3118 = Parameter(s) %1$s must be specified
 
 # Lifecycle management errors
 4000 = Partition id %1$s for node %2$s already in use by node %3$s
diff --git 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
index ec536c0..7423419 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
+++ 
b/hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties
@@ -20,6 +20,7 @@
 # 0 --- 9999: runtime errors
 1 = Unsupported operation %1$s in %2$s operator
 2 = Error in processing tuple %1$s in a frame
+3 = Failure on node %1$s
 4 = The file with absolute path %1$s is not within any of the current IO 
devices
 5 = Phrase search in Full-text is not supported. An expression should include 
only one word
 6 = Job queue is full with %1$s jobs

Reply via email to