-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIVE-28560: AssertionError in SqlImplementor when query over JDBC tab…
…le contains LIMIT (Soumyakanti Das reviewed by Stamatis Zampetakis) Close #5491
- Loading branch information
1 parent
a64a4f6
commit 771b003
Showing
4 changed files
with
95 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
ql/src/test/queries/clientpositive/jdbc_table_limit_postgres.q
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--! qt:database:postgres:q_test_country_table.sql | ||
|
||
CREATE EXTERNAL TABLE country (id int, name varchar(20)) | ||
STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' | ||
TBLPROPERTIES ( | ||
"hive.sql.database.type" = "POSTGRES", | ||
"hive.sql.jdbc.driver" = "org.postgresql.Driver", | ||
"hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", | ||
"hive.sql.dbcp.username" = "qtestuser", | ||
"hive.sql.dbcp.password" = "qtestpassword", | ||
"hive.sql.table" = "country"); | ||
|
||
EXPLAIN CBO SELECT * FROM country ORDER BY id LIMIT 2; | ||
EXPLAIN SELECT * FROM country ORDER BY id LIMIT 2; | ||
SELECT * FROM country ORDER BY id LIMIT 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
ql/src/test/results/clientpositive/llap/jdbc_table_limit_postgres.q.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
PREHOOK: query: CREATE EXTERNAL TABLE country (id int, name varchar(20)) | ||
STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' | ||
TBLPROPERTIES ( | ||
"hive.sql.database.type" = "POSTGRES", | ||
"hive.sql.jdbc.driver" = "org.postgresql.Driver", | ||
"hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", | ||
"hive.sql.dbcp.username" = "qtestuser", | ||
"hive.sql.dbcp.password" = "qtestpassword", | ||
"hive.sql.table" = "country") | ||
PREHOOK: type: CREATETABLE | ||
PREHOOK: Output: database:default | ||
PREHOOK: Output: default@country | ||
POSTHOOK: query: CREATE EXTERNAL TABLE country (id int, name varchar(20)) | ||
STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler' | ||
TBLPROPERTIES ( | ||
"hive.sql.database.type" = "POSTGRES", | ||
"hive.sql.jdbc.driver" = "org.postgresql.Driver", | ||
"hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB", | ||
"hive.sql.dbcp.username" = "qtestuser", | ||
"hive.sql.dbcp.password" = "qtestpassword", | ||
"hive.sql.table" = "country") | ||
POSTHOOK: type: CREATETABLE | ||
POSTHOOK: Output: database:default | ||
POSTHOOK: Output: default@country | ||
PREHOOK: query: EXPLAIN CBO SELECT * FROM country ORDER BY id LIMIT 2 | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@country | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: EXPLAIN CBO SELECT * FROM country ORDER BY id LIMIT 2 | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@country | ||
#### A masked pattern was here #### | ||
CBO PLAN: | ||
HiveJdbcConverter(convention=[JDBC.POSTGRES]) | ||
JdbcSort(sort0=[$0], dir0=[ASC], fetch=[2]) | ||
JdbcHiveTableScan(table=[[default, country]], table:alias=[country]) | ||
|
||
PREHOOK: query: EXPLAIN SELECT * FROM country ORDER BY id LIMIT 2 | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@country | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: EXPLAIN SELECT * FROM country ORDER BY id LIMIT 2 | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@country | ||
#### A masked pattern was here #### | ||
STAGE DEPENDENCIES: | ||
Stage-0 is a root stage | ||
|
||
STAGE PLANS: | ||
Stage: Stage-0 | ||
Fetch Operator | ||
limit: -1 | ||
Processor Tree: | ||
TableScan | ||
alias: country | ||
properties: | ||
hive.sql.query SELECT "id", "name" | ||
FROM (SELECT "id", "name" | ||
FROM "country" | ||
ORDER BY "id" | ||
FETCH NEXT 2 ROWS ONLY) AS "t" | ||
hive.sql.query.fieldNames id,name | ||
hive.sql.query.fieldTypes int,varchar(20) | ||
hive.sql.query.split false | ||
Select Operator | ||
expressions: id (type: int), name (type: varchar(20)) | ||
outputColumnNames: _col0, _col1 | ||
ListSink | ||
|
||
PREHOOK: query: SELECT * FROM country ORDER BY id LIMIT 2 | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@country | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: SELECT * FROM country ORDER BY id LIMIT 2 | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@country | ||
#### A masked pattern was here #### | ||
1 India | ||
2 Russia |