[
https://issues.apache.org/jira/browse/PHOENIX-6189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17215700#comment-17215700
]
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_r506773075
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/exception/DataExceedsCapacityException.java
##########
@@ -31,11 +31,26 @@ public DataExceedsCapacityException(String message) {
SQLExceptionCode.DATA_EXCEEDS_MAX_CAPACITY).setMessage(message).build().buildException());
}
+ @Deprecated
public DataExceedsCapacityException(PDataType type, Integer precision,
Integer scale, String columnName, ImmutableBytesWritable value) {
super(new
SQLExceptionInfo.Builder(SQLExceptionCode.DATA_EXCEEDS_MAX_CAPACITY)
.setMessage((columnName == null ? "" : columnName + " ") +
getTypeDisplayString(type, precision, scale, value))
.build().buildException());
}
+
Review comment:
You could instead add the new constructor as:
```
public DataExceedsCapacityException(PDataType type, Integer precision,
Integer scale, String columnName) {
super(new
SQLExceptionInfo.Builder(SQLExceptionCode.DATA_EXCEEDS_MAX_CAPACITY)
.setMessage((columnName == null ? "" : columnName + " ") +
getTypeDisplayString(type, precision, scale, null))
.build().buildException());
}
```
And, for example, throw the exception as:
```
throw new DataExceedsCapacityException(column.getDataType(),
column.getMaxLength(),
column.getScale(), column.getName().getString());
```
----------------------------------------------------------------
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)