drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #729: Drill 1328: Support table statistics for Parquet
Date Fri, 24 Feb 2017 03:53:20 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/729#discussion_r102867030
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
---
    @@ -245,6 +247,18 @@ public SchemaPlus getRootSchema() {
       }
     
       /**
    +   * Returns the statement type (e.g. SELECT, CTAS, ANALYZE) from the query context.
    +   * @return query statement type {@link SqlStatementType}, if known.
    +   */
    +  public SqlStatementType getSQLStatementType() {
    +    if (queryContext == null) {
    +      fail(new UnsupportedOperationException("Statement type is only valid for root fragment.
" +
    --- End diff --
    
    The `fail()` call is for runtime errors due to external causes, user error, etc. Here,
we have a programming error. Better ways to handle this:
    
    ```
    if (queryContext == null) {
      throw new IllegalStateException("Statement type...");
    }
    ```
    Or just:
    
    ```
    Preconditions.checkNotNull(queryContext);
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message