Jackie-Jiang commented on code in PR #18872:
URL: https://github.com/apache/pinot/pull/18872#discussion_r3706585333
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/CastTransformFunction.java:
##########
@@ -300,13 +310,76 @@ public String[] transformToStringValuesSV(ValueBlock
valueBlock) {
byte[][] bytesValues = transformToBytesValuesSV(valueBlock);
ArrayCopyUtils.copy(bytesValues, _stringValuesSV, length);
break;
+ case UUID:
+ ArrayCopyUtils.copyFromUuid(transformToBytesValuesSV(valueBlock),
_stringValuesSV, length);
+ break;
default:
throw new IllegalStateException(String.format("Cannot cast from SV
%s to STRING", resultDataType));
}
}
return _stringValuesSV;
}
+ @Override
+ public byte[][] transformToBytesValuesSV(ValueBlock valueBlock) {
+ DataType resultDataType = _resultMetadata.getDataType();
+ if (resultDataType != DataType.UUID) {
+ if (resultDataType.getStoredType() == DataType.BYTES) {
+ return _transformFunction.transformToBytesValuesSV(valueBlock);
+ }
+ return super.transformToBytesValuesSV(valueBlock);
+ }
+
+ int length = valueBlock.getNumDocs();
+ initBytesValuesSV(length);
+ switch (_sourceDataType.getStoredType()) {
+ case STRING:
+
ArrayCopyUtils.copyToUuid(_transformFunction.transformToStringValuesSV(valueBlock),
_bytesValuesSV, length);
+ return _bytesValuesSV;
+ case BYTES:
+ byte[][] bytesValues =
_transformFunction.transformToBytesValuesSV(valueBlock);
+ for (int i = 0; i < length; i++) {
+ _bytesValuesSV[i] = UuidUtils.toBytes(bytesValues[i]);
Review Comment:
Add `ArrayCopyUtils.copyToUuid()` from `bytes[][]` to `UUID[]`. Same for MV
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]