Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-26360 [Umbrella] Improvement for Hive Query Syntax Compatibility
  3. FLINK-26474

Fail to call hive udf when secondary parameter required constant but pass value like "-1"

    XMLWordPrintableJSON

Details

    Description

      The exception can be reproduced using following code in HiveDialectITCase

       HiveModule hiveModule = new HiveModule(hiveCatalog.getHiveVersion());
       CoreModule coreModule = CoreModule.INSTANCE;
       for (String loaded : tableEnv.listModules()) {
         tableEnv.unloadModule(loaded);
      }
      tableEnv.loadModule("hive", hiveModule);
      tableEnv.loadModule("core", coreModule);
      List<Row> results = CollectionUtil.iteratorToList(tableEnv.executeSql("select bround(55.0, -1)").collect());
      

      It will case such exception "BROUND second argument only takes constant", the reson is the parameter "-1" will be considered as function call instead of contant, we should fold it in HiveParserTypeCheckProcFactory#getXpathOrFuncExprNodeDesc.

      Attachments

        Issue Links

          Activity

            People

              luoyuxia luoyuxia
              luoyuxia luoyuxia
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: