Hello, Can I combine <built-in json functions> wit...
# general
p
Hello, Can I combine built-in json functions within groovy scripts?
n
No that's not supported. However, a groovy script should be able to do all of the logic you need rt? What are you trying to achieve?
p
Groovy should be sufficient, yes, I'm actively trying it now. For context: A have a json field in my table, let's call it
result
I'm trying to retrieve a field from the
result
payload, called
duration
and parse it into a Long field in the Pinot Table to represent the duration in milliseconds. The value of the
duration
property in the
result
field can have multiple forms:
HH:MM:SS.SSSS / HH:MM:SS / HH:MM:SS.SSSSSSS
or simply not exist. To complicate matters, the key of
duration
is not consistent, when it appears, in some messages it may come as
Duration
and others as
duration
This is legacy and not something I can fix upstream unfortunately.
k
You can technically combine it but we don’t let groovy access any other classes for security reasons