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

Views created in dfs (with no workspace subschema) schema are not be found when queried

    XMLWordPrintableJSON

Details

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

    Description

      USE dfs;
      +------------+------------+
      |     ok     |  summary   |
      +------------+------------+
      | true       | Default schema changed to 'dfs' |
      +------------+------------+
      1 row selected (0.098 seconds)
      
      0: jdbc:drill:schema=hivestg> create view myView as select * from dfs.`/opt/drill/raw-files/testTypes.json`;
      +------------+------------+
      |     ok     |  summary   |
      +------------+------------+
      | true       | View 'myView' created successfully in 'dfs' schema |
      +------------+------------+
      1 row selected (0.128 seconds)
      0: jdbc:drill:schema=hivestg> select * from myView;
      Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "45b96c5d-5e37-4d9d-96bf-4a7c88be859b"
      endpoint {
        address: "localhost"
        user_port: 31010
        control_port: 31011
        data_port: 31012
      }
      error_type: 0
      message: "Failure while parsing sql. < ValidationException:[ org.eigenbase.util.EigenbaseContextException: From line 1, column 15 to line 1, column 20 ] < EigenbaseContextException:[ From line 1, column 15 to line 1, column 20 ] < SqlValidatorException:[ Table \'myView\' not found ]"
      ]
      

      The problem is when you are using the 'dfs' as the current schema, view table is created as part of the "dfs" schema in ViewStore. But when searching for a table (or view) in "dfs" schema it looks at the tables in "default" schema which has the schema path "dfs.default". As there is no view table with "dfs.default" in ViewStore, it throws table not found error.

      Attachments

        1. DRILL-675-1.patch
          4 kB
          Venki Korukanti

        Issue Links

          Activity

            People

              vkorukanti Venki Korukanti
              vkorukanti Venki Korukanti
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: