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

Suspicious code in org.apache.calcite.materialize.Lattice constructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      https://github.com/apache/calcite/blob/d59b639d27da704f00eff616324a2c04aa06f84c/core/src/main/java/org/apache/calcite/materialize/Lattice.java#L111-L114

      The contents of nameList is updated, but it is never queried

          List<String> nameList = new ArrayList<>();
          for (Column column : columns) {
            nameList.add(column.alias);
          }
          uniqueColumnNames =
              ImmutableList.copyOf(
                  SqlValidatorUtil.uniquify(
                      Lists.transform(columns, input -> input.alias), true));
      

      julianhyde, should nameList be just removed?
      It looks like Lists.transform(columns, input -> input.alias) and nameList are the same thing.

      Attachments

        Activity

          People

            Unassigned Unassigned
            vladimirsitnikov Vladimir Sitnikov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: