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

   **Describe the bug**
   We have a customer with a table whose name contains a period
   
   In SQL you can refer to such tables using double quotes `"foo.bar"`.  
**Note** this is different than `foo.bar` which means table   named `bar` in 
the schema named `foo`.
   
   You can see how this works in postgres:
   ```sql
   postgres=# create table "foo.bar" as values (1), (2);
   SELECT 2
   postgres=# select * from foo.bar;
   ERROR:  relation "foo.bar" does not exist
   LINE 1: select * from foo.bar;
                         ^
   postgres=# select * from "foo.bar";
    column1 
   ---------
          1
          2
   (2 rows)
   
   postgres=# \d foo.bar
   Did not find any relation named "foo.bar".
   postgres=# \d "foo.bar"
                  Table "public.foo.bar"
    Column  |  Type   | Collation | Nullable | Default 
   ---------+---------+-----------+----------+---------
    column1 | integer |           |          | 
   
   
   **To Reproduce**
   Try to create (or query) tables with double quotes:
   
   From the error message it is clear that DataFusion is treating `"foo.bar"`  
as schema named `foo` table named `bar` 
   
   ```sql
   ❯ select * from "foo.bar";
   Plan("failed to resolve schema: foo")
   ❯ select * from foo.bar;
   Plan("failed to resolve schema: foo")
   ```
   
   ```sql
   ❯ create table "foo.bar" as values (1), (2);
   Plan("failed to resolve schema: \"foo")
   ```
   
   ```sql
   
   ```
   
   
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
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