>From Shahrzad Shirazi <[email protected]>: Shahrzad Shirazi has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21008?usp=email )
Change subject: [ASTERIXDB-3717][COMP] Changing the error when updating a primary key ...................................................................... [ASTERIXDB-3717][COMP] Changing the error when updating a primary key - user model changes: yes - storage format changes: no - interface changes: no Ext-ref: MB-70790 Change-Id: Ic719d4b53ad12bd06f46db11803333a52c5f2982 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21008 Integration-Tests: Ali Alsuliman <[email protected]> Reviewed-by: Ali Alsuliman <[email protected]> Tested-by: Ali Alsuliman <[email protected]> --- 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-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppChangeExprToSelectExprVisitor.java 3 files changed, 3 insertions(+), 1 deletion(-) Approvals: Ali Alsuliman: Looks good to me, approved; Verified; Verified 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 45d7bb2..3bf2d49 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 @@ -349,6 +349,7 @@ INVALID_FRAME_BASED_MEMORY_BUDGET(1241), COLLECTION_IS_NOT_AN_ICEBERG_TABLE_COLLECTION(1242), NOT_ICEBERG_CATALOG(1243), + UPDATE_PRIMARY_KEY(1244), // Feed errors DATAFLOW_ILLEGAL_STATE(3001), 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 a4037ee..8a4a8fd 100644 --- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties +++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties @@ -351,6 +351,7 @@ 1241 = Invalid `%1$s` "%2$s" for frame size=%3$s. value should be >= %4$s * frame size: `%1$s` "%5$s" in %6$s 1242 = Collection '%1$s' is not an Iceberg table external collection. 1243 = Catalog '%1$s' is not an Iceberg catalog +1244 = Cannot update primary key '%1$s' # Feed Errors 3001 = Illegal state. diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppChangeExprToSelectExprVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppChangeExprToSelectExprVisitor.java index 90682ae..7d068e9 100644 --- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppChangeExprToSelectExprVisitor.java +++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppChangeExprToSelectExprVisitor.java @@ -164,7 +164,7 @@ for (Expression pathExpr : pathExprList) { try { if (isPrimaryKeyField(pathExpr, fieldPath)) { - throw new CompilationException("Cannot set primary key field: " + pathExpr); + throw new CompilationException(ErrorCode.UPDATE_PRIMARY_KEY, pathExpr.toString()); } } catch (AlgebricksException e) { throw new RuntimeException(e); -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21008?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: asterixdb Gerrit-Branch: lumina Gerrit-Change-Id: Ic719d4b53ad12bd06f46db11803333a52c5f2982 Gerrit-Change-Number: 21008 Gerrit-PatchSet: 13 Gerrit-Owner: Shahrzad Shirazi <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Shahrzad Shirazi <[email protected]> Gerrit-CC: Anon. E. Moose #1000171
