stoty commented on code in PR #2020:
URL: https://github.com/apache/phoenix/pull/2020#discussion_r1842596834


##########
phoenix-core-client/src/main/java/org/apache/phoenix/expression/function/DecodeFunction.java:
##########
@@ -71,19 +71,25 @@ public boolean evaluate(Tuple tuple, ImmutableBytesWritable 
ptr) {
                .setMessage("Missing bytes encoding").build().buildException());
                }
 
-               type = encodingExpression.getDataType();
+               PDataType type = encodingExpression.getDataType();
                String encoding = ((String) type.toObject(ptr)).toUpperCase();
 
                byte out[];
 
                EncodeFormat format = EncodeFormat.valueOf(encoding);
-               switch (format) {
-                       case HEX:
-                               out = decodeHex(stringToDecode);
-                               break;
-                       default:
-                               throw new IllegalDataException("Unsupported 
encoding \"" + encoding + "\"");
-               }
+        switch (format) {
+            case HEX:
+                out = decodeHex(stringToDecode);
+                break;
+            case BASE64:
+                               out = 
Base64.getDecoder().decode(stringToDecode);

Review Comment:
   whitespaces



-- 
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: [email protected]

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

Reply via email to