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:34:28 UTC
[jira] [Created] (CALCITE-933) RelBuilder.scan() throws NPE if
relation does not exist
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)