[ 
https://issues.apache.org/jira/browse/PHOENIX-6189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17216909#comment-17216909
 ] 

ASF GitHub Bot commented on PHOENIX-6189:
-----------------------------------------

ntshmah commented on a change in pull request #924:
URL: https://github.com/apache/phoenix/pull/924#discussion_r507911806



##########
File path: 
phoenix-core/src/test/java/org/apache/phoenix/schema/MutationTest.java
##########
@@ -92,18 +92,24 @@ public void testSizeConstraint() throws Exception {
                 fail();
             } catch (SQLException e) {
                 
assertEquals(SQLExceptionCode.DATA_EXCEEDS_MAX_CAPACITY.getErrorCode(),e.getErrorCode());
+                assertFalse(e.getMessage().contains("abcd"));
+                
assertTrue(e.getMessage().contains(String.valueOf(maxLength1)));
             }
             try {
                 conn.createStatement().execute("UPSERT INTO t1(k1,v2) 
VALUES('b','" + value + "')");
                 fail();
             } catch (SQLException e) {
                 
assertEquals(SQLExceptionCode.DATA_EXCEEDS_MAX_CAPACITY.getErrorCode(),e.getErrorCode());
+                assertFalse(e.getMessage().contains(value));
+                
assertTrue(e.getMessage().contains(String.valueOf(maxLength2)));

Review comment:
       nit: Same here.

##########
File path: 
phoenix-core/src/test/java/org/apache/phoenix/schema/MutationTest.java
##########
@@ -92,18 +92,24 @@ public void testSizeConstraint() throws Exception {
                 fail();
             } catch (SQLException e) {
                 
assertEquals(SQLExceptionCode.DATA_EXCEEDS_MAX_CAPACITY.getErrorCode(),e.getErrorCode());
+                assertFalse(e.getMessage().contains("abcd"));
+                
assertTrue(e.getMessage().contains(String.valueOf(maxLength1)));
             }
             try {
                 conn.createStatement().execute("UPSERT INTO t1(k1,v2) 
VALUES('b','" + value + "')");
                 fail();
             } catch (SQLException e) {
                 
assertEquals(SQLExceptionCode.DATA_EXCEEDS_MAX_CAPACITY.getErrorCode(),e.getErrorCode());
+                assertFalse(e.getMessage().contains(value));
+                
assertTrue(e.getMessage().contains(String.valueOf(maxLength2)));

Review comment:
       nit: Same here, and below.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> DATA_EXCEEDS_MAX_CAPACITY exception error string should contain column name 
> instead of actual value 
> ----------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6189
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6189
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.0.0, 4.14.3
>            Reporter: Xinyi Yan
>            Assignee: Xinyi Yan
>            Priority: Trivial
>
> UpsertCompiler raised DATA_EXCEEDS_MAX_CAPACITY exception that contains 
> column value instead of the column name.
> https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/compile/UpsertCompiler.java#L1263
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to