Andy Grove created CALCITE-933:
----------------------------------

             Summary: RelBuilder.scan() throws NPE if relation does not exist
                 Key: CALCITE-933
                 URL: https://issues.apache.org/jira/browse/CALCITE-933
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.5.0
            Reporter: Andy Grove
            Assignee: Julian Hyde
            Priority: Trivial


RelBuilder.scan() throws NPE if relation does not exist. The fix is simple to 
add a null check and throw an appropriate exception.

I will be submitting a pull request once I know the preferred approach to 
exception classes to use.

{code:title=Bar.java|borderStyle=solid}
  public RelBuilder scan(String tableName) throws InvalidRelException {
    final RelOptTable relOptTable =
        relOptSchema.getTableForMember(ImmutableList.of(tableName));
    if (relOptTable == null) {
      throw new RuntimeException(String.format("Table '%s' not found", 
tableName));
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to