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

SqlValidatorImpl.findTable() method incorrectly handles table schema with few schema levels

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.16.0
    • None
    • None

    Description

      SqlValidatorImpl.findTable() method contains code

          String schemaName = names.get(0);
          String tableName = names.get(1);
      
          CalciteSchema schema = catalogReader.getRootSchema().getSubSchemaMap().get(schemaName);
      
          if (schema == null) {
            return null;
          }
      
          CalciteSchema.TableEntry entry = schema.getTable(tableName,
                  catalogReader.nameMatcher().isCaseSensitive());
      

      where names is a list with schema paths and table name.

      For the cases when a table in the schema, which nested into another schema (schema1.schema2.table, etc), a required table could not be found.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            volodymyr Vova Vysotskyi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: