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

Remove _MAP[] from Drill SQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.4.0
    • None
    • None

    Description

      Currently while executing SQL we need to use _MAP['columnname'] in the select statements.

      The problem while using select statements with columnnames instead of _MAP['columnname'] is that Optiq tries to verify that these columns exist in the schema and raises validation errors.

      The way we've solved the problem is to override the 'rowtype' returned to Optiq while creating a Drill table. We have defined a new class RelDataTypeDrillImpl which is the 'rowtype' returned to Optiq and will be invoked for any validation purposes. RelDataTypeDrillImpl always returns true when queried if a certain field exists in the table, with its type as 'ANY'. This gets us past the validation in Optiq and allows us to use column names directly in select statements.

      Attachments

        1. DRILL-307.patch
          41 kB
          Mehant Baid

        Activity

          People

            mehant Mehant Baid
            mehant Mehant Baid
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: