Skip to main content
Question

UDTF JAVA SDK has no UUID support. How to read UUID from PartitionReader?

  • August 11, 2021
  • 3 replies
  • 10 views

BHIFP
Forum|alt.badge.img+1
  • Participating Frequently

PartitionReader, for example, does not have native getUUID function. Any suggestion how to get UUID from input?
As an example, for int column, one would do: inputReader.getLong(argCols.get(0));

Same question for PartitionWriter.
Thanks

3 replies

BHIFP
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • August 13, 2021

To answer my own question. The following works, but probably not most efficient:

SELECT UDTF(UUID:VARCHAR) FROM T;

Then in java code, use functions like isVarchar(), addVarchar(36, "uuid")


Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • August 13, 2021

BHIFP
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • August 14, 2021

This is way I figured out. If you have better way, please let me know.