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

SqlValidatorUtil.uniquify() may not terminate under some conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.0-incubating
    • 0.9.2-incubating
    • None
    • None

    Description

      The uniquify(String, Set<String>, Suggester) method in SqlValidatorUtil tries to create a unique name for the supplied name. It does it inside the following loop which does not have an upper bound check. If the suggester returns a name that already exists in the nameList, then the loop will never terminate. I encountered this issue while doing some testing with a 3 way join query in Drill against text data.

          for (int j = 0;; j++) {
            name = suggester.apply(originalName, j, nameList.size());
            if (nameList.add(name)) {
              return name;
            }
          }
      

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            amansinha100 Aman Sinha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: