crepererum opened a new issue, #4872:
URL: https://github.com/apache/arrow-datafusion/issues/4872

   **Describe the bug**
   Columns in `WHERE` clauses cannot be qualified by table or schema.
   
   **To Reproduce**
   These tests are added to 
[`information_schema.slt`](https://github.com/apache/arrow-datafusion/blob/556282a8b6da6cb7d41d8c311211ae49b7ed82a7/datafusion/core/tests/sqllogictests/test_files/information_schema.slt).
   
   This works:
   
   ```text
   query CCC rowsort
   SELECT * from information_schema.tables WHERE 
table_schema='information_schema';
   ----
   datafusion information_schema columns VIEW
   datafusion information_schema df_settings VIEW
   datafusion information_schema tables VIEW
   datafusion information_schema views VIEW
   ```
   
   ---
   
   This fails:
   
   ```text
   query CCC rowsort
   SELECT * from information_schema.tables WHERE 
tables.table_schema='information_schema';
   ----
   datafusion information_schema columns VIEW
   datafusion information_schema df_settings VIEW
   datafusion information_schema tables VIEW
   datafusion information_schema views VIEW
   ```
   
   with
   
   ```text
   Error: SqlLogicTest(query failed: DataFusion error: Schema error: No field 
named 'tables'.'table_schema'. Valid fields are 
'information_schema.tables'.'table_catalog', 
'information_schema.tables'.'table_schema', 
'information_schema.tables'.'table_name', 
'information_schema.tables'.'table_type'.
   ````
   
   ---
   
   This fails:
   
   ```text
   query CCC rowsort
   SELECT * from information_schema.tables WHERE 
information_schema.tables.table_schema='information_schema';
   ----
   datafusion information_schema columns VIEW
   datafusion information_schema df_settings VIEW
   datafusion information_schema tables VIEW
   datafusion information_schema views VIEW
   ```
   
   with
   
   ```text
   Error: SqlLogicTest(query failed: DataFusion error: Error during planning: 
Unsupported compound identifier 'Full { catalog: "information_schema", schema: 
"tables", table: "table_schema" }'
   ```
   
   ---
   
   This fails:
   
   ```text
   query CCC rowsort
   SELECT * from information_schema.tables WHERE 
datafusion.information_schema.tables.table_schema='information_schema';
   ----
   datafusion information_schema columns VIEW
   datafusion information_schema df_settings VIEW
   datafusion information_schema tables VIEW
   datafusion information_schema views VIEW
   ```
   
   with
   
   ```text
   Error: SqlLogicTest(query failed: DataFusion error: Error during planning: 
Unsupported compound identifier '[Ident { value: "datafusion", quote_style: 
None }, Ident { value: "information_schema", quote_style: None }, Ident { 
value: "tables", quote_style: None }, Ident { value: "table_schema", 
quote_style: None }]'
   ```
   
   **Expected behavior**
   All tests pass.
   
   **Additional context**
   Tested w/ commit 
https://github.com/apache/arrow-datafusion/commit/556282a8b6da6cb7d41d8c311211ae49b7ed82a7
 .
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to