Fasih Khatib
12/07/2024, 2:28 PMimport java.math.BigInteger;
class Ideone {
static void main(String[] args) {
def number = "eA=="
if (number.toString() ==~ /\d+/) {
def bi = new BigInteger(number.toString())
// return bi
} else {
def bytes = Base64.getDecoder().decode(number)
def bi = new BigInteger(bytes)
// return bi
}
}
}
My question is: can Groovy scripts return BigIntegers for storage in Pinot or would they have to be converted into strings?Fasih Khatib
12/08/2024, 12:54 PMScalarFunctions , the following transformation could potentially work:
"bytesToBigDecimal(base64Decode(jsonPath(payload, '$.after.id')))"
However, the present implementation of base64Decode accepts byte array and not a string. Perhaps adding an overloaded version which accepts strings might do the trick? Happy to raise a PR.Xiang Fu
Xiang Fu
Fasih Khatib
12/11/2024, 3:26 AMBigDecimal and not a BigInteger. Could you please point me to the transformation function to convert an input value to string?Xiang Fu
Fasih Khatib
12/16/2024, 6:21 AMFasih Khatib
12/16/2024, 6:22 AMplugins folder of the cluster.Xiang Fu
org.apache.pinot.*.function.*