Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-16732

Failed to call Hive UDF with constant return value

    XMLWordPrintableJSON

Details

    Description

      The following test fails:

      	@Test
      	public void test() throws Exception {
      		tableEnv.unloadModule("core");
      		tableEnv.loadModule("hive", new HiveModule());
      		tableEnv.loadModule("core", CoreModule.INSTANCE);
      		System.out.println(TableUtils.collectToList(tableEnv.sqlQuery("select str_to_map('a:1,b:2,c:3',',',':')")));
      	}
      

      With exception:

      Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.hadoop.io.Text
      	at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector.getPrimitiveJavaObject(WritableStringObjectInspector.java:46)
      	at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableStringObjectInspector.getPrimitiveJavaObject(WritableStringObjectInspector.java:26)
      	at org.apache.flink.table.functions.hive.conversion.HiveInspectors.toFlinkObject(HiveInspectors.java:277)
      	at org.apache.flink.table.functions.hive.conversion.HiveInspectors.toFlinkObject(HiveInspectors.java:319)
      	at org.apache.flink.table.functions.hive.HiveGenericUDF.evalInternal(HiveGenericUDF.java:86)
      	at org.apache.flink.table.functions.hive.HiveScalarFunction.eval(HiveScalarFunction.java:100)
      ......
      

      Attachments

        Issue Links

          Activity

            People

              lirui Rui Li
              lirui Rui Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m