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

Could not resolve VIEW with SimpleCalciteSchema

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11.0
    • Fix Version/s: 1.12.0
    • Component/s: core
    • Labels:
      None

      Description

      The current implementation (ever since its first version) of SimpleCalciteSchema.getImplicitTableBasedOnNullaryFunction() is wrong, but it was not revealed until Julian Hyde'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

            • Assignee:
              maryannxue Maryann Xue
              Reporter:
              maryannxue Maryann Xue
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: