Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      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.

      1. DRILL-307.patch
        41 kB
        Mehant Baid

        Activity

        Hide
        Jacques Nadeau added a comment -

        Resolved in recent commit as part of JDBC thinning

        Show
        Jacques Nadeau added a comment - Resolved in recent commit as part of JDBC thinning
        Hide
        Jacques Nadeau added a comment -

        Please rebase on latest master, complete reviews and then transition to Patch Available.

        Show
        Jacques Nadeau added a comment - Please rebase on latest master, complete reviews and then transition to Patch Available.
        Hide
        Jacques Nadeau added a comment -

        I might suggest that we hold it in Drill for the next couple months and work the kinks out of it before we do a pull request. I think there are probably some edge cases that cause pain that we haven't yet figured out and it'll be easier for us iterate in Drill until we get things stabilized.

        Show
        Jacques Nadeau added a comment - I might suggest that we hold it in Drill for the next couple months and work the kinks out of it before we do a pull request. I think there are probably some edge cases that cause pain that we haven't yet figured out and it'll be easier for us iterate in Drill until we get things stabilized.
        Hide
        Mehant Baid added a comment -

        https://github.com/mehant/incubator-drill-1/blob/master/sqlparser/src/main/java/org/apache/drill/jdbc/RelDataTypeDrillImpl.java is the file that implements the RelDataType. Other than the fact that it uses the word 'drill' in a few places, as such doesn't have a dependency on Drill code. I will clean up the code and submit a pull request.

        Show
        Mehant Baid added a comment - https://github.com/mehant/incubator-drill-1/blob/master/sqlparser/src/main/java/org/apache/drill/jdbc/RelDataTypeDrillImpl.java is the file that implements the RelDataType. Other than the fact that it uses the word 'drill' in a few places, as such doesn't have a dependency on Drill code. I will clean up the code and submit a pull request.
        Hide
        Julian Hyde added a comment -

        The behavior that you want is potentially generic. If you can convert your changes into a form that does not depend on Drill, I would be happy to include in Optiq along with a new concept called "variant record type" or something like that. This will be more maintainable in the long run; I will run tests to make sure that validation works on tables with such a record type.

        Show
        Julian Hyde added a comment - The behavior that you want is potentially generic. If you can convert your changes into a form that does not depend on Drill, I would be happy to include in Optiq along with a new concept called "variant record type" or something like that. This will be more maintainable in the long run; I will run tests to make sure that validation works on tables with such a record type.
        Hide
        Mehant Baid added a comment -

        There are couple of known issues with this iteration of the patch. Tracked as separate JIRA's : https://issues.apache.org/jira/browse/DRILL-308 , https://issues.apache.org/jira/browse/DRILL-310

        Show
        Mehant Baid added a comment - There are couple of known issues with this iteration of the patch. Tracked as separate JIRA's : https://issues.apache.org/jira/browse/DRILL-308 , https://issues.apache.org/jira/browse/DRILL-310
        Hide
        Mehant Baid added a comment -

        Link to reviewboard: https://reviews.apache.org/r/15822/
        Link to private repo: https://github.com/mehant/incubator-drill-1

        Private repo contains two additional bug fixes for JIRA's 265, 297

        Show
        Mehant Baid added a comment - Link to reviewboard: https://reviews.apache.org/r/15822/ Link to private repo: https://github.com/mehant/incubator-drill-1 Private repo contains two additional bug fixes for JIRA's 265, 297

          People

          • Assignee:
            Mehant Baid
            Reporter:
            Mehant Baid
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development