You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Ashutosh Chauhan (JIRA)" <ji...@apache.org> on 2012/12/19 08:03:19 UTC

[jira] [Updated] (HIVE-3493) aggName of SemanticAnalyzer.getGenericUDAFEvaluator is generated in two different ways

     [ https://issues.apache.org/jira/browse/HIVE-3493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashutosh Chauhan updated HIVE-3493:
-----------------------------------

    Fix Version/s: 0.10.0
    
> aggName of SemanticAnalyzer.getGenericUDAFEvaluator is generated in two different ways
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-3493
>                 URL: https://issues.apache.org/jira/browse/HIVE-3493
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.10.0
>            Reporter: Yin Huai
>            Assignee: Yin Huai
>            Priority: Minor
>             Fix For: 0.10.0
>
>         Attachments: HIVE-3493.1.patch.txt, HIVE-3493.2.patch.txt, HIVE-3493.3.patch.txt
>
>
> aggName in org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getGenericUDAFEvaluator(String, ArrayList<ExprNodeDesc>, ASTNode, boolean, boolean) is generated by two different ways. One is String aggName = value.getChild(0).getText(); and another is String aggName = unescapeIdentifier(value.getChild(0).getText());. When a aggregation function is involved in a view, we may get a error.
> You can try the query below (from create_view.q) to replay the error.
> {code:sql}
> set hive.map.aggr=false;
> CREATE TEMPORARY FUNCTION test_max AS
> 'org.apache.hadoop.hive.ql.udf.UDAFTestMax';
> CREATE VIEW view9(m) AS
> SELECT test_max(length(value))
> FROM src;
> DESCRIBE EXTENDED view9;
> DESCRIBE FORMATTED view9;
> SELECT * FROM view9;
> {code}
> Here is the log
> {code}
> 2012-09-20 07:26:15,176 DEBUG exec.FunctionRegistry (FunctionRegistry.java:getGenericUDAFResolver(849)) - Looking up GenericUDAF: `test_max`
> 2012-09-20 07:26:15,181 ERROR ql.Driver (SessionState.java:printError(400)) - FAILED: SemanticException Line 1:33 Function argument type mismatch '`test_max`' in definition of VIEW view9 [
> SELECT `_c0` AS `m` FROM (SELECT `test_max`(length(`src`.`value`))
> FROM `default`.`src`) `view9`
> ] used as view9 at Line 2:14: Looking for UDAF Evaluator"`test_max`" with parameters [org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableIntObjectInspector@5afa2b2b]
> org.apache.hadoop.hive.ql.parse.SemanticException: Line 1:33 Function argument type mismatch '`test_max`' in definition of VIEW view9 [
> SELECT `_c0` AS `m` FROM (SELECT `test_max`(length(`src`.`value`))
> FROM `default`.`src`) `view9`
> ] used as view9 at Line 2:14: Looking for UDAF Evaluator"`test_max`" with parameters [org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableIntObjectInspector@5afa2b2b]
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getGenericUDAFEvaluator(SemanticAnalyzer.java:2394)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlanGroupByOperator(SemanticAnalyzer.java:2561)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genGroupByPlan1MR(SemanticAnalyzer.java:3341)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:6140)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6903)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6843)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6864)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6843)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:6864)
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:7484)
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:245)
> 	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:431)
> 	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:335)
> 	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:903)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
> 	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:412)
> 	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:347)
> 	at org.apache.hadoop.hive.ql.QTestUtil.executeClient(QTestUtil.java:713)
> 	at org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_create_view(TestCliDriver.java:125)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at junit.framework.TestCase.runTest(TestCase.java:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:520)
> 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
> 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:911)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira