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