You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/07/28 00:31:25 UTC

[GitHub] [pinot] siddharthteotia commented on a diff in pull request #9114: Added Base64 Encoding/Decoding Scalar Functions

siddharthteotia commented on code in PR #9114:
URL: https://github.com/apache/pinot/pull/9114#discussion_r931683324


##########
pinot-broker/src/test/java/org/apache/pinot/broker/requesthandler/LiteralOnlyBrokerRequestTest.java:
##########
@@ -211,6 +219,59 @@ public void testBrokerRequestHandlerWithAsFunction()
     Assert.assertEquals(brokerResponse.getResultTable().getRows().get(0)[1].toString(),
         "key1=value 1&key2=value@!$2&key3=value%3");
     Assert.assertEquals(brokerResponse.getTotalDocs(), 0);
+
+    request = JsonUtils.stringToJsonNode(
+        "{\"sql\":\"SELECT toBase64('hello!') AS encoded, " + "fromBase64('aGVsbG8h') AS decoded\"}");
+    requestStats = Tracing.getTracer().createRequestScope();
+    brokerResponse = requestHandler.handleRequest(request, null, requestStats);
+    System.out.println(brokerResponse.getResultTable());

Review Comment:
   (nit) this code can be made slightly more readable imho by doing get on the resultTable , dataSchema and getRows exactly once. 



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org