Ruslan Krylov created HIVE-24050: ------------------------------------ Summary: ParseException in query with subqueries Key: HIVE-24050 URL: https://issues.apache.org/jira/browse/HIVE-24050 Project: Hive Issue Type: Bug Components: Hive Affects Versions: 2.3.7, 3.1.2 Environment: Hadoop-3.0.0 Hive-2.3.7, Hive-3.1.2 Reporter: Ruslan Krylov Assignee: Eugene Koifman Fix For: 2.3.7
h2. The query which runs in hive 2.1 fails in hive 2.3 with ParseException. Hive-3.1.2 also has this issue. *STEPS TO REPRODUCE:* {code:java} 1. Create tables: CREATE TABLE IF NOT EXISTS t1 (id INT, c1 INT); CREATE TABLE IF NOT EXISTS t2 (id INT, c2 INT); 2. Run the query: SELECT * FROM ((SELECT c1 FROM t1) AS X) JOIN ((SELECT c2 FROM t2) AS Y) ON X.c1 = Y.c2; {code} {{}} *ACTUAL RESULT:* The query fails with an exception you can find below. {code:java} hive> CREATE TABLE IF NOT EXISTS t1 (id INT, c1 INT); OK Time taken: 0.348 seconds hive> CREATE TABLE IF NOT EXISTS t2 (id INT, c2 INT); OK Time taken: 0.186 seconds hive> SELECT * FROM > > ((SELECT c1 FROM t1) AS X) > > JOIN > > ((SELECT c2 FROM t2) AS Y) > > ON > > X.c1 = Y.c2; FAILED: ParseException line 7:21 missing ) at 'AS' near 'Y' line 7:25 missing EOF at ')' near 'Y'{code} -- This message was sent by Atlassian Jira (v8.3.4#803005)