Murtadha Hubail has submitted this change and it was merged. Change subject: [NO ISSUE][FAIL] Move Error Code To AsterixDB ......................................................................
[NO ISSUE][FAIL] Move Error Code To AsterixDB - user model changes: no - storage format changes: no - interface changes: no Details: - Move error CANNOT_COMPARE_COMPLEX to its proper place from Hyracks to AsterixDB. - Error messages clean up. Change-Id: I94408b687081af9bfe9efccefc123173ba4e7922 Reviewed-on: https://asterix-gerrit.ics.uci.edu/2760 Sonar-Qube: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Contrib: Jenkins <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> Reviewed-by: Till Westmann <[email protected]> --- M asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java M asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml M asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java M asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArrayAddRemoveEval.java M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArraySearchEval.java M hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java M hyracks-fullstack/hyracks/hyracks-api/src/main/resources/errormsg/en.properties 9 files changed, 26 insertions(+), 24 deletions(-) Approvals: Anon. E. Moose #1000171: Till Westmann: Looks good to me, approved Jenkins: Verified; No violations found; ; Verified Murtadha Hubail: Looks good to me, but someone else must approve diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java index 3150cb2..79c17c7 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCQueryServiceServlet.java @@ -100,7 +100,7 @@ cancelQuery(ncMb, ncCtx.getNodeId(), param.getClientContextID(), e, false); throw e; } catch (TimeoutException exception) { - RuntimeDataException hde = new RuntimeDataException(ErrorCode.QUERY_TIMEOUT); + RuntimeDataException hde = new RuntimeDataException(ErrorCode.REQUEST_TIMEOUT); hde.addSuppressed(exception); // cancel query cancelQuery(ncMb, ncCtx.getNodeId(), param.getClientContextID(), hde, true); diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java index 3d1175c..ce6185e 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java @@ -19,7 +19,7 @@ package org.apache.asterix.api.http.server; import static org.apache.asterix.common.exceptions.ErrorCode.ASTERIX; -import static org.apache.asterix.common.exceptions.ErrorCode.QUERY_TIMEOUT; +import static org.apache.asterix.common.exceptions.ErrorCode.REQUEST_TIMEOUT; import static org.apache.asterix.common.exceptions.ErrorCode.REJECT_BAD_CLUSTER_STATE; import static org.apache.asterix.common.exceptions.ErrorCode.REJECT_NODE_UNREGISTERED; @@ -602,8 +602,8 @@ } else if (t instanceof HyracksException) { HyracksException he = (HyracksException) t; switch (he.getComponent() + he.getErrorCode()) { - case ASTERIX + QUERY_TIMEOUT: - LOGGER.info("handleException: query execution timed out: {}", param); + case ASTERIX + REQUEST_TIMEOUT: + LOGGER.info("handleException: request execution timed out: {}", param); state.setStatus(ResultStatus.TIMEOUT, HttpResponseStatus.OK); break; case ASTERIX + REJECT_BAD_CLUSTER_STATE: diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml index 6b2ccb2..a8f15ab 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml @@ -1001,8 +1001,8 @@ <test-case FilePath="array_fun"> <compilation-unit name="array_position"> <output-dir compare="Text">array_position</output-dir> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> </compilation-unit> </test-case> <test-case FilePath="array_fun"> @@ -1018,8 +1018,8 @@ <test-case FilePath="array_fun"> <compilation-unit name="array_contains"> <output-dir compare="Text">array_contains</output-dir> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> </compilation-unit> </test-case> <test-case FilePath="array_fun"> @@ -1030,15 +1030,15 @@ <test-case FilePath="array_fun"> <compilation-unit name="array_put"> <output-dir compare="Text">array_put</output-dir> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> </compilation-unit> </test-case> <test-case FilePath="array_fun"> <compilation-unit name="array_remove"> <output-dir compare="Text">array_remove</output-dir> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> - <expected-error>HYR0115: Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> + <expected-error>Cannot compare non-primitive values (in line 22, at column 8)</expected-error> </compilation-unit> </test-case> </test-group> 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 e0c0d78..de91d13 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 @@ -70,12 +70,13 @@ public static final int OPERATION_NOT_SUPPORTED = 27; public static final int INVALID_DURATION = 28; public static final int UNKNOWN_DURATION_UNIT = 29; - public static final int QUERY_TIMEOUT = 30; + public static final int REQUEST_TIMEOUT = 30; public static final int INVALID_TYPE_CASTING_MATH_FUNCTION = 31; public static final int REJECT_BAD_CLUSTER_STATE = 32; public static final int REJECT_NODE_UNREGISTERED = 33; public static final int DIVISION_BY_ZERO = 34; public static final int UNSUPPORTED_MULTIPLE_STATEMENTS = 35; + public static final int CANNOT_COMPARE_COMPLEX = 36; public static final int UNSUPPORTED_JRE = 100; 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 46326e1..b042972 100644 --- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties +++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties @@ -63,12 +63,13 @@ 27 = Operation not supported 28 = Invalid duration \"%1$s\" 29 = Unknown duration unit %1$s -30 = Query timed out and will be cancelled +30 = Request timed out and will be cancelled 31 = Invalid type-casting math function: %1$s for converting %2$s to %3$s 32 = Cannot execute request, cluster is %1$s 33 = Node is not registered with the CC -34 = Division by Zero. +34 = Division by zero. 35 = Unsupported multiple statements. +36 = Cannot compare non-primitive values 100 = Unsupported JRE: %1$s @@ -147,7 +148,7 @@ 1076 = Cannot find dataset %1$s because there is no dataverse declared, nor an alias with name %1$s! 1077 = Cannot find dataset %1$s in dataverse %2$s nor an alias with name %1$s! 1078 = Unexpected operator %1$s in an OperatorExpr starting with %2$s -1079 = %1$s +1079 = Compilation error: %1$s 1080 = Cannot find node group with name %1$s 1081 = Cannot find function with name %1$s 1082 = Cannot find datatype wit name %1$s @@ -155,7 +156,7 @@ 1084 = An index with this name %1$s already exists 1085 = A datatype with this name %1$s already exists 1086 = No value for parameter: %1$s -1087 = Invalid number of arguments: at least %1$d arguments are required for function %2$s +1087 = Invalid number of arguments: at least %1$s arguments are required for function %2$s 1088 = Required field %1$s was not found 1089 = Field %1$s must be of type %2$s but found to be of type %3$s 1090 = Field %1$s must be of an array of type %2$s but found to contain an item of type %3$s @@ -272,4 +273,4 @@ 3112 = Array/Multiset item cannot be null # Lifecycle management errors -4000 = Partition id %1$d for node %2$s already in use by node %3$s +4000 = Partition id %1$s for node %2$s already in use by node %3$s diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArrayAddRemoveEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArrayAddRemoveEval.java index 3701ff5..a7363ab 100755 --- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArrayAddRemoveEval.java +++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArrayAddRemoveEval.java @@ -25,6 +25,8 @@ import org.apache.asterix.builders.IAsterixListBuilder; import org.apache.asterix.builders.OrderedListBuilder; import org.apache.asterix.builders.UnorderedListBuilder; +import org.apache.asterix.common.exceptions.ErrorCode; +import org.apache.asterix.common.exceptions.RuntimeDataException; import org.apache.asterix.om.pointables.base.DefaultOpenFieldType; import org.apache.asterix.om.types.ATypeTag; import org.apache.asterix.om.types.AbstractCollectionType; @@ -33,7 +35,6 @@ import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator; import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory; import org.apache.hyracks.api.context.IHyracksTaskContext; -import org.apache.hyracks.api.exceptions.ErrorCode; import org.apache.hyracks.api.exceptions.HyracksDataException; import org.apache.hyracks.api.exceptions.SourceLocation; import org.apache.hyracks.data.std.api.IPointable; @@ -148,7 +149,7 @@ } if (encounteredNonPrimitive) { - throw HyracksDataException.create(ErrorCode.CANNOT_COMPARE_COMPLEX, sourceLocation); + throw new RuntimeDataException(ErrorCode.CANNOT_COMPARE_COMPLEX, sourceLocation); } // all arguments are valid AbstractCollectionType listType = (AbstractCollectionType) argTypes[listOffset]; diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArraySearchEval.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArraySearchEval.java index e3490db..6677a1f 100755 --- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArraySearchEval.java +++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractArraySearchEval.java @@ -22,6 +22,8 @@ import java.io.IOException; +import org.apache.asterix.common.exceptions.ErrorCode; +import org.apache.asterix.common.exceptions.RuntimeDataException; import org.apache.asterix.dataflow.data.nontagged.comparators.AObjectAscBinaryComparatorFactory; import org.apache.asterix.om.base.AMutableInt32; import org.apache.asterix.runtime.evaluators.common.ListAccessor; @@ -29,7 +31,6 @@ import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory; import org.apache.hyracks.api.context.IHyracksTaskContext; import org.apache.hyracks.api.dataflow.value.IBinaryComparator; -import org.apache.hyracks.api.exceptions.ErrorCode; import org.apache.hyracks.api.exceptions.HyracksDataException; import org.apache.hyracks.api.exceptions.SourceLocation; import org.apache.hyracks.data.std.api.IPointable; @@ -76,7 +77,7 @@ // for now, we don't support deep equality of object/lists. Throw an error if the value is of these types if (ATYPETAGDESERIALIZER.deserialize(valueBytes[valueOffset]).isDerivedType()) { - throw HyracksDataException.create(ErrorCode.CANNOT_COMPARE_COMPLEX, sourceLocation); + throw new RuntimeDataException(ErrorCode.CANNOT_COMPARE_COMPLEX, sourceLocation); } if (!ATYPETAGDESERIALIZER.deserialize(listBytes[listOffset]).isListType()) { diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java index 5f91e89..b6d7cc7 100644 --- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java +++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/exceptions/ErrorCode.java @@ -148,7 +148,6 @@ public static final int CANNOT_ADD_ELEMENT_TO_INVERTED_INDEX_SEARCH_RESULT = 112; public static final int UNDEFINED_INVERTED_LIST_MERGE_TYPE = 113; public static final int NODE_IS_NOT_ACTIVE = 114; - public static final int CANNOT_COMPARE_COMPLEX = 115; // Compilation error codes. public static final int RULECOLLECTION_NOT_INSTANCE_OF_LIST = 10000; 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 ea58c3c..ef07038 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 @@ -131,7 +131,6 @@ 112 = Cannot add an element to an inverted-index search result. 113 = Undefined inverted-list merge type: %1$s 114 = Node (%1$s) is not active -115 = Cannot compare non-primitive values 10000 = The given rule collection %1$s is not an instance of the List class. 10001 = Cannot compose partition constraint %1$s with %2$s -- To view, visit https://asterix-gerrit.ics.uci.edu/2760 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94408b687081af9bfe9efccefc123173ba4e7922 Gerrit-PatchSet: 5 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]>
