[ 
https://issues.apache.org/jira/browse/DRILL-6726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Hou updated DRILL-6726:
------------------------------
    Description: 
Drill 1.14 changes schemas to be case-insensitive (DRILL-6492). If an existing 
view was created before (DRILL-6492) was committed, and this view references a 
schema which has upper case letters, the view needs to be rebuilt.  There may 
be variations on this issue that I have not seen.

To reproduce this problem, create a workspace like this:
This is the workspace configuration I used:
{noformat}
    "drillTestDirP1": {
      "location": "/drill/testdata/p1tests",
      "writable": true,
      "defaultInputFormat": "parquet",
      "allowAccessOutsideWorkspace": false
    },
{noformat}


use Drill commit ddb35ce71837376c7caef28c25327ba556bb32f2 and execute this 
command:
{noformat}
create or replace view `dfs.drillTestDirP1`.student_parquet_v as select * from 
`dfs.drillTestDirP1`.student;
{noformat}
Then use Drill commit ddb35ce71837376c7caef28c25327ba556bb32f2 and execute this 
query:
{noformat}
select * from student_test_v;
{noformat}
Drill will return an exception:
{noformat}
Error: VALIDATION ERROR: Failure while attempting to expand view. Requested 
schema drillTestDirP1 not available in schema dfs.

View Context dfs, drillTestDirP1
View SQL SELECT *
FROM `dfs.drillTestDirP1`.`student`

[Error Id: 3f4594ee-b503-40db-8845-474b0ecb5feb on qa-node211.qa.lab:31010] 
(state=,code=0)
{noformat}

I have attached the student parquet file I used.



This is what the .view.drill file looks like:
{noformat}
{
  "name" : "student_test_v",
  "sql" : "SELECT *\nFROM `dfs.drillTestDirP1`.`student`",
  "fields" : [ {
    "name" : "**",
    "type" : "DYNAMIC_STAR",
    "isNullable" : true
  } ],
  "workspaceSchemaPath" : [ "dfs", "drillTestDirP1" ]
}
{noformat}

This means that users may not be able to access views that they have created 
using previous versions of Drill.  We should maintain backwards compatibiliity 
where possible.

As work-around, these views can be re-created.  It would be helpful to users if 
the error message explains that these views need to be re-created.

  was:
Drill 1.14 changes schemas to be case-insensitive (DRILL-6492). If an existing 
view was created before (DRILL-6492) was committed, and this view references a 
schema which has upper case letters, the view needs to be rebuilt.  There may 
be variations on this issue that I have not seen.

To reproduce this problem, use Drill commit 
ddb35ce71837376c7caef28c25327ba556bb32f2 and execute this command:
{noformat}
create or replace view `dfs.drillTestDirP1`.student_parquet_v as select * from 
`dfs.drillTestDirP1`.student;
{noformat}
Then use Drill commit ddb35ce71837376c7caef28c25327ba556bb32f2 and execute this 
query:
{noformat}
select * from student_test_v;
{noformat}
Drill will return an exception:
{noformat}
Error: VALIDATION ERROR: Failure while attempting to expand view. Requested 
schema drillTestDirP1 not available in schema dfs.

View Context dfs, drillTestDirP1
View SQL SELECT *
FROM `dfs.drillTestDirP1`.`student`

[Error Id: 3f4594ee-b503-40db-8845-474b0ecb5feb on qa-node211.qa.lab:31010] 
(state=,code=0)
{noformat}

I have attached the student parquet file I used.

This is the workspace configuration I used:
{noformat}
    "drillTestDirP1": {
      "location": "/drill/testdata/p1tests",
      "writable": true,
      "defaultInputFormat": "parquet",
      "allowAccessOutsideWorkspace": false
    },
{noformat}

This is what the .view.drill file looks like:
{noformat}
{
  "name" : "student_test_v",
  "sql" : "SELECT *\nFROM `dfs.drillTestDirP1`.`student`",
  "fields" : [ {
    "name" : "**",
    "type" : "DYNAMIC_STAR",
    "isNullable" : true
  } ],
  "workspaceSchemaPath" : [ "dfs", "drillTestDirP1" ]
}
{noformat}

This means that users may not be able to access views that they have created 
using previous versions of Drill.  We should maintain backwards compatibiliity 
where possible.

As work-around, these views can be re-created.  It would be helpful to users if 
the error message explains that these views need to be re-created.


> Drill should return a better error message when an existing view uses a table 
> that has a mixed case schema
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6726
>                 URL: https://issues.apache.org/jira/browse/DRILL-6726
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Relational Operators
>    Affects Versions: 1.15.0
>            Reporter: Robert Hou
>            Assignee: Arina Ielchiieva
>            Priority: Major
>             Fix For: 1.15.0
>
>         Attachments: student
>
>
> Drill 1.14 changes schemas to be case-insensitive (DRILL-6492). If an 
> existing view was created before (DRILL-6492) was committed, and this view 
> references a schema which has upper case letters, the view needs to be 
> rebuilt.  There may be variations on this issue that I have not seen.
> To reproduce this problem, create a workspace like this:
> This is the workspace configuration I used:
> {noformat}
>     "drillTestDirP1": {
>       "location": "/drill/testdata/p1tests",
>       "writable": true,
>       "defaultInputFormat": "parquet",
>       "allowAccessOutsideWorkspace": false
>     },
> {noformat}
> use Drill commit ddb35ce71837376c7caef28c25327ba556bb32f2 and execute this 
> command:
> {noformat}
> create or replace view `dfs.drillTestDirP1`.student_parquet_v as select * 
> from `dfs.drillTestDirP1`.student;
> {noformat}
> Then use Drill commit ddb35ce71837376c7caef28c25327ba556bb32f2 and execute 
> this query:
> {noformat}
> select * from student_test_v;
> {noformat}
> Drill will return an exception:
> {noformat}
> Error: VALIDATION ERROR: Failure while attempting to expand view. Requested 
> schema drillTestDirP1 not available in schema dfs.
> View Context dfs, drillTestDirP1
> View SQL SELECT *
> FROM `dfs.drillTestDirP1`.`student`
> [Error Id: 3f4594ee-b503-40db-8845-474b0ecb5feb on qa-node211.qa.lab:31010] 
> (state=,code=0)
> {noformat}
> I have attached the student parquet file I used.
> This is what the .view.drill file looks like:
> {noformat}
> {
>   "name" : "student_test_v",
>   "sql" : "SELECT *\nFROM `dfs.drillTestDirP1`.`student`",
>   "fields" : [ {
>     "name" : "**",
>     "type" : "DYNAMIC_STAR",
>     "isNullable" : true
>   } ],
>   "workspaceSchemaPath" : [ "dfs", "drillTestDirP1" ]
> }
> {noformat}
> This means that users may not be able to access views that they have created 
> using previous versions of Drill.  We should maintain backwards 
> compatibiliity where possible.
> As work-around, these views can be re-created.  It would be helpful to users 
> if the error message explains that these views need to be re-created.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to