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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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));
      

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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vladimirsitnikov Vladimir Sitnikov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: