[
https://issues.apache.org/jira/browse/DRILL-3623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15014478#comment-15014478
]
ASF GitHub Bot commented on DRILL-3623:
---------------------------------------
Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/193#discussion_r45407282
--- Diff:
contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/TestHiveStorage.java
---
@@ -42,6 +43,25 @@ public void hiveReadWithDb() throws Exception {
}
@Test
+ public void simpleLimitZero() throws Exception {
+ testBuilder()
+ .sqlQuery("select * from hive.kv limit 0")
+ .expectsEmptyResultSet()
+ .baselineColumns("key", "value")
+ .go();
+ }
+
+ @Test
+ public void simpleLimitZeroPlan() throws Exception {
+ final String[] expectedPlan = {
+ ".*Limit.*\n" +
+ ".*Values.*"
+ };
+ final String[] excludedPlan = {};
+ PlanTestBase.testPlanMatchingPatterns("select * from hive.kv limit 0",
expectedPlan, excludedPlan);
+ }
+
--- End diff --
Also, you may consider adding a negative test, such as "schemed limit 0",
but select clause has a function.
select substr(char_col, 1, 5) from hive.table limit 0;
In such case, I assume this patch would not do the short cut, and the
function return type is not known for now in Drill's planning time.
> Hive query hangs with limit 0 clause
> ------------------------------------
>
> Key: DRILL-3623
> URL: https://issues.apache.org/jira/browse/DRILL-3623
> Project: Apache Drill
> Issue Type: Bug
> Components: Storage - Hive
> Affects Versions: 1.1.0
> Environment: MapR cluster
> Reporter: Andries Engelbrecht
> Assignee: Sudheesh Katkam
> Fix For: Future
>
>
> Running a select * from hive.table limit 0 does not return (hangs).
> Select * from hive.table limit 1 works fine
> Hive table is about 6GB with 330 files with parquet using snappy compression.
> Data types are int, bigint, string and double.
> Querying directory with parquet files through the DFS plugin works fine
> select * from dfs.root.`/user/hive/warehouse/database/table` limit 0;
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)