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.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to