From 27ce9d9091453b508194019a5732300c5bdaab25 Mon Sep 17 00:00:00 2001 From: Qiang Fu Date: Tue, 17 Sep 2024 15:33:24 -0700 Subject: [PATCH 1/2] Add EXTRACT_COLLECTION UDF to registry --- .../hive/hive2rel/functions/StaticHiveFunctionRegistry.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java index c7029f035..9c873e3c5 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java @@ -681,6 +681,8 @@ public boolean isOptional(int i) { SqlTypeFamily.BOOLEAN, SqlTypeFamily.ANY, SqlTypeFamily.ARRAY, SqlTypeFamily.STRING, SqlTypeFamily.STRING)); createAddUserDefinedFunction("com.linkedin.groot.runtime.udf.spark.GetMappedValueUDF", FunctionReturnTypes.STRING, family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)); + createAddUserDefinedFunction("com.linkedin.groot.runtime.udf.spark.ExtractCollectionUDF", + FunctionReturnTypes.arrayOfType(SqlTypeName.ANY, true), family(SqlTypeFamily.ANY, SqlTypeFamily.STRING)); // UDTFs addFunctionEntry("explode", new CoralSqlUnnestOperator(false)); From 40d7ad191b023a9ffe968f49a443082e9f2bf5fa Mon Sep 17 00:00:00 2001 From: Qiang Fu Date: Thu, 19 Sep 2024 11:57:54 -0700 Subject: [PATCH 2/2] Change return type to address comments --- .../hive/hive2rel/functions/StaticHiveFunctionRegistry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java index 9c873e3c5..1e331cba4 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java @@ -682,7 +682,7 @@ public boolean isOptional(int i) { createAddUserDefinedFunction("com.linkedin.groot.runtime.udf.spark.GetMappedValueUDF", FunctionReturnTypes.STRING, family(SqlTypeFamily.STRING, SqlTypeFamily.STRING)); createAddUserDefinedFunction("com.linkedin.groot.runtime.udf.spark.ExtractCollectionUDF", - FunctionReturnTypes.arrayOfType(SqlTypeName.ANY, true), family(SqlTypeFamily.ANY, SqlTypeFamily.STRING)); + FunctionReturnTypes.arrayOfType(SqlTypeName.VARCHAR, true), family(SqlTypeFamily.ANY, SqlTypeFamily.STRING)); // UDTFs addFunctionEntry("explode", new CoralSqlUnnestOperator(false));