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/08/28 00:14:47 UTC
[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9287: Fix transformation to string for BOOLEAN and TIMESTAMP
Jackie-Jiang commented on code in PR #9287:
URL: https://github.com/apache/pinot/pull/9287#discussion_r956644345
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/BaseTransformFunction.java:
##########
@@ -324,6 +339,17 @@ public String[] transformToStringValuesSV(ProjectionBlock projectionBlock) {
BigDecimal[] bigDecimalValues = transformToBigDecimalValuesSV(projectionBlock);
ArrayCopyUtils.copy(bigDecimalValues, _stringValuesSV, length);
break;
+ case BOOLEAN:
+ intValues = transformToIntValuesSV(projectionBlock);
+ for (int i = 0; i < length; i++) {
+ _stringValuesSV[i] = Boolean.toString(intValues[i] == 1);
+ }
+ break;
+ case TIMESTAMP:
+ longValues = transformToLongValuesSV(projectionBlock);
+ for (int i = 0; i < length; i++) {
+ _stringValuesSV[i] = new Timestamp(longValues[i]).toString();
+ }
Review Comment:
We don't really need break for default branch. Changed it to if-else branches for clarity
--
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