You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Maryann Xue (JIRA)" <ji...@apache.org> on 2017/01/10 21:01:58 UTC

[jira] [Created] (CALCITE-1571) Could not resolve VIEW with SimpleCalciteSchema

Maryann Xue created CALCITE-1571:
------------------------------------

             Summary: Could not resolve VIEW with SimpleCalciteSchema
                 Key: CALCITE-1571
                 URL: https://issues.apache.org/jira/browse/CALCITE-1571
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.11.0
            Reporter: Maryann Xue
            Assignee: Maryann Xue


The current implementation (ever since its first version) of SimpleCalciteSchema.getImplicitTableBasedOnNullaryFunction() is wrong, but  it was not revealed until [~julianhyde]'s check-in for CALCITE-1563.
The implementation 1) did not use "tableName" in finding the functions at all; 2) was caching based.
{code}
  protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName,
      boolean caseSensitive) {
    for (String s : schema.getFunctionNames()) {
      for (Function function : schema.getFunctions(s)) {
        if (function instanceof TableMacro
            && function.getParameters().isEmpty()) {
          final Table table = ((TableMacro) function).apply(ImmutableList.of());
          return tableEntry(tableName, table);
        }
      }
    }
    return null;
  }
{code}



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