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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.16.0
    • Component/s: None
    • Labels:
      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

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              vvysotskyi Volodymyr Vysotskyi
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: