[
https://issues.apache.org/jira/browse/HIVE-30201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ruben Q L updated HIVE-30201:
-----------------------------
Attachment: HIVE-30201_proposal.patch
> UDFArgumentLengthException error while compiling the statement
> --------------------------------------------------------------
>
> Key: HIVE-30201
> URL: https://issues.apache.org/jira/browse/HIVE-30201
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Reporter: Dayakar M
> Assignee: Ruben Q L
> Priority: Major
> Labels: pull-request-available
> Attachments: HIVE-30201_proposal.patch
>
>
> UDFArgumentLengthException error while compiling the statement
> +Steps to reproduce:+
> *test.q* file
> {code:java}
> create table test(id int, name string);
> select t1.id, t2.name, (case when (t1.id = 1 and t2.id = 1) then 'One' else
> null end) mycase
> from test t1 join test t2 on t1.name = t2.name where t1.id =1 and t2.id = 1;
> {code}
> Exception Stacktrace:
> {code:java}
> 2026-10-19T00:43:08,501 ERROR [ccdd2a1e-c388-47ea-a343-c4eeac0f1579 main]
> optimizer.ConstantPropagateProcFactory: Evaluation function
> org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd([GenericUDFOPEqual(Const
> int 1, Const int 1)]) failed in Constant Propagation
> Optimizer.2026-10-19T00:43:08,502 ERROR [ccdd2a1e-c388-47ea-a343-c4eeac0f1579
> main] parse.CalcitePlanner: CBO failed, skipping CBO.
> org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException: The operator 'AND'
> accepts at least 2 argument. at
> org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPAnd.initialize(GenericUDFOPAnd.java:53)
> at
> org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.evaluateFunction(ConstantPropagateProcFactory.java:876)
> at
> org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.foldExpr(ConstantPropagateProcFactory.java:239)
> at
> org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.evaluateFunction(ConstantPropagateProcFactory.java:857)
> at
> org.apache.hadoop.hive.ql.optimizer.ConstantPropagateProcFactory.foldExpr(ConstantPropagateProcFactory.java:239)
> at
> org.apache.hadoop.hive.ql.optimizer.calcite.HiveRexExecutorImpl.reduce(HiveRexExecutorImpl.java:61)
> at
> org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressionsInternal(ReduceExpressionsRule.java:783)
> at
> org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:723)
> at
> org.apache.calcite.rel.rules.ReduceExpressionsRule$ProjectReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:315)
> at
> org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:380)
> at
> org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:682)
> at org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:539)
> at
> org.apache.calcite.plan.hep.HepPlanner.executeRuleCollection(HepPlanner.java:398)
> at
> org.apache.calcite.plan.hep.HepInstruction$RuleCollection$State.execute(HepInstruction.java:105)
> at
> org.apache.calcite.plan.hep.HepPlanner.lambda$executeProgram$0(HepPlanner.java:323)
> at
> org.apache.hive.com.google.common.collect.ImmutableList.forEach(ImmutableList.java:397)
> at
> org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:322)
> at org.apache.calcite.plan.hep.HepProgram$State.execute(HepProgram.java:118)
> at
> org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:317)
> at org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:288)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.executeProgram(CalcitePlanner.java:2512)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.executeProgram(CalcitePlanner.java:2472)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.executeProgram(CalcitePlanner.java:2466)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.applyPreJoinOrderingTransforms(CalcitePlanner.java:1938)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1660)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner$CalcitePlannerAction.apply(CalcitePlanner.java:1523)
> at
> org.apache.calcite.tools.Frameworks.lambda$withPlanner$0(Frameworks.java:141)
> at
> org.apache.calcite.prepare.CalcitePrepareImpl.perform(CalcitePrepareImpl.java:979)
> at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:192) at
> org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:136) at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner.logicalPlan(CalcitePlanner.java:1301)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:574)
> at
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:13311)
> at
> org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:467)
> at
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:360)
> at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:225) at
> org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:110) at
> org.apache.hadoop.hive.ql.Driver.compile(Driver.java:500) at
> org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:452) at
> org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:416) at
> org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:410) at
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:127)
> at
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:235)
> at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:260)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd1(CliDriver.java:204) at
> org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:130) at
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:433) at
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:361) at
> org.apache.hadoop.hive.ql.QTestUtil.executeClientInternal(QTestUtil.java:795)
> at
> org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:765)
> at
> org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:116)
> at
> org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:140)
> at
> org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver(TestMiniLlapLocalCliDriver.java:63)
> at
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
> at java.base/java.lang.reflect.Method.invoke(Method.java:580) at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> org.apache.hadoop.hive.cli.control.CliAdapter$2$1.evaluate(CliAdapter.java:119)
> at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
> at
> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
> at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at
> org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at
> org.junit.runners.ParentRunner.run(ParentRunner.java:413) at
> org.junit.runners.Suite.runChild(Suite.java:128) at
> org.junit.runners.Suite.runChild(Suite.java:27) at
> org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at
> org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at
> org.apache.hadoop.hive.cli.control.CliAdapter$1$1.evaluate(CliAdapter.java:90)
> at org.junit.rules.RunRules.evaluate(RunRules.java:20) at
> org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at
> org.junit.runners.ParentRunner.run(ParentRunner.java:413) at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
> at
> org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
> at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
> at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)