ranganathg commented on code in PR #1937:
URL: https://github.com/apache/phoenix/pull/1937#discussion_r1675704572


##########
phoenix-core-client/src/main/java/org/apache/phoenix/expression/CoerceExpression.java:
##########
@@ -145,11 +147,30 @@ public void write(DataOutput output) throws IOException {
 
     @Override
     public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
-        if (getChild().evaluate(tuple, ptr)) {
-            getDataType().coerceBytes(ptr, null, getChild().getDataType(),
-                    getChild().getMaxLength(), null, 
getChild().getSortOrder(), 
-                    maxLength, null, getSortOrder(), rowKeyOrderOptimizable);
-            return true;
+        if (getChild() instanceof LiteralExpression
+            && getChild().getDataType() == PVarbinary.INSTANCE

Review Comment:
   what is this check fo?



##########
phoenix-core-client/src/main/java/org/apache/phoenix/expression/CoerceExpression.java:
##########
@@ -145,11 +147,30 @@ public void write(DataOutput output) throws IOException {
 
     @Override
     public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
-        if (getChild().evaluate(tuple, ptr)) {
-            getDataType().coerceBytes(ptr, null, getChild().getDataType(),
-                    getChild().getMaxLength(), null, 
getChild().getSortOrder(), 
-                    maxLength, null, getSortOrder(), rowKeyOrderOptimizable);
-            return true;
+        if (getChild() instanceof LiteralExpression
+            && getChild().getDataType() == PVarbinary.INSTANCE

Review Comment:
   what is this check for?



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to