[vectorized](udf) java udf support with return map type (#22300)

This commit is contained in:
Mryange
2023-07-29 12:52:27 +08:00
committed by GitHub
parent 210f6661b4
commit 47c2cc5c74
12 changed files with 529 additions and 17 deletions

View File

@ -253,11 +253,11 @@ public class UdfUtils {
break;
}
case MAP: {
Preconditions.checkState(nodeIdx + 1 < typeDesc.getTypesSize());
Preconditions.checkState(nodeIdx + 2 < typeDesc.getTypesSize());
Pair<Type, Integer> keyType = fromThrift(typeDesc, nodeIdx + 1);
Pair<Type, Integer> valueType = fromThrift(typeDesc, nodeIdx + 1 + keyType.value());
type = new MapType(keyType.key(), valueType.key());
nodeIdx = 1 + keyType.value() + valueType.value();
Pair<Type, Integer> valueType = fromThrift(typeDesc, keyType.second);
type = new MapType(keyType.first, valueType.first);
nodeIdx = valueType.second;
break;
}