hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mykhailo Kysliuk (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-19911) Hive delete queries fail with Invalid table alias or column reference
Date Thu, 21 Jun 2018 18:13:00 GMT

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

Mykhailo Kysliuk updated HIVE-19911:
------------------------------------
    Status: In Progress  (was: Patch Available)

> Hive delete queries fail with Invalid table alias or column reference
> ---------------------------------------------------------------------
>
>                 Key: HIVE-19911
>                 URL: https://issues.apache.org/jira/browse/HIVE-19911
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>    Affects Versions: 2.3.3
>            Reporter: Mykhailo Kysliuk
>            Assignee: Mykhailo Kysliuk
>            Priority: Major
>         Attachments: HIVE-19911.1-branch-2.3.patch
>
>
> Env:
> hadoop-2.7.0
> hive-2.3.3
> OS:
> centos-release-7-5.1804.el7.centos.x86_64
> Steps to reproduce (at hive cli):
> {code}
> set hive.support.concurrency=true;
> set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
> DROP TABLE IF EXISTS detaillineitem_all;
> DROP TABLE IF EXISTS detaillineitem_all_delete_1526330755128;
> CREATE TABLE `detaillineitem_all`(
>   `detailid` decimal(20,0),
>   `branchnumber` varchar(3)
> ) PARTITIONED BY (
>   `branchnumber_p` varchar(3))
> CLUSTERED BY (
>   detailid)
> INTO 25 BUCKETS
> STORED AS ORC
> TBLPROPERTIES (
>   'orc.compress'='NONE',
>   'transactional'='true');
> CREATE TABLE `detaillineitem_all_delete_1526330755128`(
>   `detailid` decimal(20,0),
>   `branchnumber` varchar(3),
>   `branchnumber_p` varchar(3));
> DELETE from detaillineitem_all WHERE EXISTS (
>     SELECT
>         1
>     FROM
>         detaillineitem_all_delete_1526330755128 AS t1
>     WHERE
>         (detaillineitem_all.detailid = t1.detailid)
>       AND
>         (detaillineitem_all.branchnumber = CAST(t1.branchnumber AS STRING)));
> {code}
> Exception:
> {code}
> 2018-06-15T16:51:48,625 ERROR [f6bd86a7-04e5-4284-9031-3b9a0ccc80f3 main] ql.Driver:
FAILED: SemanticException Line 0:-1 Invalid table alias or column reference 'sq_1': (possible
column names are: mber)) sq_corr_1)) (tok_where (= 1 1), (. (tok_table_or_col sq_1) sq_corr_1))
> org.apache.hadoop.hive.ql.parse.SemanticException: Line 0:-1 Invalid table alias or column
reference 'sq_1': (possible column names are: mber)) sq_corr_1)) (tok_where (= 1 1), (. (tok_table_or_col
sq_1) sq_corr_1))
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:11620)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:11568)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:11536)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:11514)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genMapGroupByForSemijoin(SemanticAnalyzer.java:8416)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genJoinOperator(SemanticAnalyzer.java:8305)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genFilterPlan(SemanticAnalyzer.java:3278)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:9592)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:10549)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:10427)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genOPTree(SemanticAnalyzer.java:11125)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:11138)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10807)
>         at org.apache.hadoop.hive.ql.parse.UpdateDeleteSemanticAnalyzer.analyzeInternal(UpdateDeleteSemanticAnalyzer.java:73)
>         at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
>         at org.apache.hadoop.hive.ql.parse.UpdateDeleteSemanticAnalyzer.reparseAndSuperAnalyze(UpdateDeleteSemanticAnalyzer.java:462)
>         at org.apache.hadoop.hive.ql.parse.UpdateDeleteSemanticAnalyzer.analyzeDelete(UpdateDeleteSemanticAnalyzer.java:111)
>         at org.apache.hadoop.hive.ql.parse.UpdateDeleteSemanticAnalyzer.analyzeInternal(UpdateDeleteSemanticAnalyzer.java:81)
>         at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:258)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:512)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1317)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1457)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1227)
>         at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
>         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:821)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
> {code}
> After some debugging, I investigated that start and end indexes of ASTNode to retrieve
string is incorrect. It happens at genFilterPlan after rewriting the where expression. When
ASTNode tries to retrieve string representation of current node it returns incorrect string
because of incorrect indexes and therefore the query crashes. 
> If we rewrite the astStr inside debugging, then all query string becomes correct and
query runs fine.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message