Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1571

Could not resolve VIEW with SimpleCalciteSchema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.11.0
    • 1.12.0
    • core
    • None

    Description

      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.

        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;
        }
      

      Attachments

        Activity

          People

            maryannxue Wei Xue
            maryannxue Wei Xue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: