Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3AB7AD679 for ; Sun, 30 Sep 2012 05:03:09 +0000 (UTC) Received: (qmail 58785 invoked by uid 500); 30 Sep 2012 05:03:08 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 58726 invoked by uid 500); 30 Sep 2012 05:03:08 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 58705 invoked by uid 500); 30 Sep 2012 05:03:07 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 58693 invoked by uid 99); 30 Sep 2012 05:03:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2012 05:03:07 +0000 Date: Sun, 30 Sep 2012 16:03:07 +1100 (NCT) From: "Namit Jain (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: <1750966826.144870.1348981387557.JavaMail.jiratomcat@arcas> In-Reply-To: <1181754548.103089.1348152308281.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (HIVE-3493) aggName of SemanticAnalyzer.getGenericUDAFEvaluator is generated in two different ways MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-3493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Namit Jain updated HIVE-3493: ----------------------------- Status: Open (was: Patch Available) > 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 > Attachments: HIVE-3493.1.patch.txt, HIVE-3493.2.patch.txt > > > aggName in org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getGenericUDAFEvaluator(String, ArrayList, 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