Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2361

Column aliases cannot include dots

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.7.0, 0.8.0
    • 1.2.0
    • None

    Description

      The Drill query engine rejects column aliases for aggregates or group by fields where the alias includes a dot.

      For example:

      select count(*) as `test.field` from cp.`employee.json`;

      throws an error with "Field references must be singular names."

      Having reviewed the code, I can't quite see a reason for it, and when using FieldReference.getWithQuotedRef instead in AggPrelBase, the issue is alleviated with no visible side effects.

      I'm sure there was a reason for this code in FieldReference, but I can't seem to work out why, and it seems entirely reasonable to allow a dot in a column alias.

      Attachments

        1. DRILL-2361.1.patch.txt
          3 kB
          Adam Gilmore
        2. DRILL-2361.2.patch.txt
          6 kB
          Adam Gilmore

        Issue Links

          Activity

            People

              dragoncurve Adam Gilmore
              dragoncurve Adam Gilmore
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: