Repository: hive Updated Branches: refs/heads/master 2f7abcc60 -> b701720f5
HIVE-20830: JdbcStorageHandler range query assertion failure in some cases (Daniel Dai, reviewed by Thejas Nair) Signed-off-by: Thejas M Nair <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b701720f Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b701720f Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b701720f Branch: refs/heads/master Commit: b701720f5ea249b0a077ad6a0e51d3580b260bee Parents: 2f7abcc Author: Daniel Dai <[email protected]> Authored: Tue Oct 30 00:18:54 2018 -0700 Committer: Daniel Dai <[email protected]> Committed: Tue Oct 30 00:18:58 2018 -0700 ---------------------------------------------------------------------- .../hive/storage/jdbc/dao/GenericJdbcDatabaseAccessor.java | 2 +- .../test/queries/clientpositive/external_jdbc_table_partition.q | 2 +- .../clientpositive/llap/external_jdbc_table_partition.q.out | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/b701720f/jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/dao/GenericJdbcDatabaseAccessor.java ---------------------------------------------------------------------- diff --git a/jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/dao/GenericJdbcDatabaseAccessor.java b/jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/dao/GenericJdbcDatabaseAccessor.java index 607c45c..95d54b4 100644 --- a/jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/dao/GenericJdbcDatabaseAccessor.java +++ b/jdbc-handler/src/main/java/org/apache/hive/storage/jdbc/dao/GenericJdbcDatabaseAccessor.java @@ -59,7 +59,7 @@ public class GenericJdbcDatabaseAccessor implements DatabaseAccessor { protected static final int DEFAULT_FETCH_SIZE = 1000; protected static final Logger LOGGER = LoggerFactory.getLogger(GenericJdbcDatabaseAccessor.class); protected DataSource dbcpDataSource = null; - static final Pattern fromPattern = Pattern.compile("(.*?\\sfrom\\s)(.*+)", Pattern.CASE_INSENSITIVE); + static final Pattern fromPattern = Pattern.compile("(.*?\\sfrom\\s)(.*+)", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); public GenericJdbcDatabaseAccessor() { http://git-wip-us.apache.org/repos/asf/hive/blob/b701720f/ql/src/test/queries/clientpositive/external_jdbc_table_partition.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/external_jdbc_table_partition.q b/ql/src/test/queries/clientpositive/external_jdbc_table_partition.q index f285d17..4759af8 100644 --- a/ql/src/test/queries/clientpositive/external_jdbc_table_partition.q +++ b/ql/src/test/queries/clientpositive/external_jdbc_table_partition.q @@ -44,7 +44,7 @@ TBLPROPERTIES ( "hive.sql.numPartitions" = "2" ); -SELECT * FROM jdbc_partition_table1; +SELECT * FROM jdbc_partition_table1 where ikey > 1; -- decimal partition column -- lower/upper bound unset http://git-wip-us.apache.org/repos/asf/hive/blob/b701720f/ql/src/test/results/clientpositive/llap/external_jdbc_table_partition.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/llap/external_jdbc_table_partition.q.out b/ql/src/test/results/clientpositive/llap/external_jdbc_table_partition.q.out index 6119031..4445efa 100644 --- a/ql/src/test/results/clientpositive/llap/external_jdbc_table_partition.q.out +++ b/ql/src/test/results/clientpositive/llap/external_jdbc_table_partition.q.out @@ -93,15 +93,14 @@ TBLPROPERTIES ( POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@jdbc_partition_table1 -PREHOOK: query: SELECT * FROM jdbc_partition_table1 +PREHOOK: query: SELECT * FROM jdbc_partition_table1 where ikey > 1 PREHOOK: type: QUERY PREHOOK: Input: default@jdbc_partition_table1 #### A masked pattern was here #### -POSTHOOK: query: SELECT * FROM jdbc_partition_table1 +POSTHOOK: query: SELECT * FROM jdbc_partition_table1 where ikey > 1 POSTHOOK: type: QUERY POSTHOOK: Input: default@jdbc_partition_table1 #### A masked pattern was here #### -1 1000 20.0 40.0 aaa 3.142 2010-01-01 2018-01-01 20:00:00 3 4000 120.0 25.4 hello 2.718 2017-06-05 2011-11-11 02:00:08 4 8000 120.4 31.3 ccc NULL 2014-03-04 2018-07-08 18:00:00 5 9000 NULL 10.0 bbb 2.718 2018-01-01 2010-06-01 21:00:00
