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

SUM on varchar column produces incorrect error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.2.0
    • Execution - Codegen
    • None

    Description

      With the implementation of DRILL-3319, a bug was introduced whereby the codegen for an aggregate when SUMing a varchar column fails:

      0: jdbc:drill:zk=local> select sum(full_name) from cp.`employee.json`;
      java.lang.RuntimeException: java.sql.SQLException: SYSTEM ERROR: CompileException: Line 57, Column 177: Unknown variable or type "logger"
      
      Fragment 0:0
      
      [Error Id: 8d5585c4-620c-4275-b0c5-8bc4cbc2da90 on pharma-lap14.ad.pharmadata.net.au:31010]
              at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)
              at sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:87)
              at sqlline.TableOutputFormat.print(TableOutputFormat.java:118)
              at sqlline.SqlLine.print(SqlLine.java:1583)
              at sqlline.Commands.execute(Commands.java:852)
              at sqlline.Commands.sql(Commands.java:751)
              at sqlline.SqlLine.dispatch(SqlLine.java:738)
              at sqlline.SqlLine.begin(SqlLine.java:612)
              at sqlline.SqlLine.start(SqlLine.java:366)
              at sqlline.SqlLine.main(SqlLine.java:259)
      

      This is due to the fact AggregateErrorFunctions now builds its errors with a "logger" static field, which does not exist in the codegenned code.

      We either need to include a static logger in codegen aggregates, or revert back to simpler exceptions for these functions.

      Attachments

        1. DRILL-3583.1.patch.txt
          4 kB
          Sudheesh Katkam

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: