You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Andy Grove (JIRA)" <ji...@apache.org> on 2015/10/22 23:46:27 UTC

[jira] [Updated] (CALCITE-933) RelBuilder.scan() throws NPE if relation does not exist

     [ https://issues.apache.org/jira/browse/CALCITE-933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Grove updated CALCITE-933:
-------------------------------
    Description: 
RelBuilder.scan() throws NPE if relation does not exist. The fix is simple to add a null check and throw an appropriate exception.

Pull request: https://github.com/apache/incubator-calcite/pull/159

  was:
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}


> 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
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> RelBuilder.scan() throws NPE if relation does not exist. The fix is simple to add a null check and throw an appropriate exception.
> Pull request: https://github.com/apache/incubator-calcite/pull/159



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