You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/27 19:45:21 UTC

[GitHub] [arrow-datafusion] mcassels opened a new issue, #2978: SELECT on column with uppercase column name fails with FieldNotFound error

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

   **Describe the bug**
   
   `select UPPERCASE_NAME from t;` fails with a FieldNotFound SchemaError like this:
   ```
   SchemaError(FieldNotFound { qualifier: None, name: "uppercase_name", valid_fields: Some(["t.UPPERCASE_NAME"]) })
   ```
   The name in the FieldNotFound error is the lower-case version of the selected column name.
   
   **To Reproduce**
   
   Using datafusion-cli on the attached test parquet file:
   ```
   ❯ CREATE EXTERNAL TABLE t STORED AS PARQUET LOCATION 'test.parquet';
   0 rows in set. Query took 0.004 seconds.
   ❯ select * from t;
   +----------------+--------------------+
   | UPPERCASE_NAME | not_uppercase_name |
   +----------------+--------------------+
   | 3              | 3                  |
   | 2              | 2                  |
   | 1              | 1                  |
   | 0              | 0                  |
   +----------------+--------------------+
   4 rows in set. Query took 0.008 seconds.
   ❯ select not_uppercase_name from t;
   +--------------------+
   | not_uppercase_name |
   +--------------------+
   | 3                  |
   | 2                  |
   | 1                  |
   | 0                  |
   +--------------------+
   4 rows in set. Query took 0.007 seconds.
   ❯ select UPPERCASE_NAME from t;
   SchemaError(FieldNotFound { qualifier: None, name: "uppercase_name", valid_fields: Some(["t.UPPERCASE_NAME", "t.not_uppercase_name"]) })
   ❯ 
   ```
   
   **Expected behavior**
   
   Expected that SELECTs on columns with uppercase names would behave the same as SELECTs on columns with lowercase names.
   
   **Additional context**
   
   Test parquet to reproduce the issue:
   [test.parquet.zip](https://github.com/apache/arrow-datafusion/files/9203091/test.parquet.zip)
   
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] mcassels closed issue #2978: SELECT on column with uppercase column name fails with FieldNotFound error

Posted by GitBox <gi...@apache.org>.
mcassels closed issue #2978: SELECT on column with uppercase column name fails with FieldNotFound error
URL: https://github.com/apache/arrow-datafusion/issues/2978


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] ray-andrew commented on issue #2978: SELECT on column with uppercase column name fails with FieldNotFound error

Posted by GitBox <gi...@apache.org>.
ray-andrew commented on issue #2978:
URL: https://github.com/apache/arrow-datafusion/issues/2978#issuecomment-1239624939

   I have this problem as well. It's works to use this "fileld_name" as a quoted identifier.  Is there a plan to support backtick (`) for "Quoted identifier"?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] mcassels commented on issue #2978: SELECT on column with uppercase column name fails with FieldNotFound error

Posted by GitBox <gi...@apache.org>.
mcassels commented on issue #2978:
URL: https://github.com/apache/arrow-datafusion/issues/2978#issuecomment-1197366647

   Thanks @alamb  ! That does work and it looks like this behaviour is consistent with postgres as well. I'm closing this issue.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on issue #2978: SELECT on column with uppercase column name fails with FieldNotFound error

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #2978:
URL: https://github.com/apache/arrow-datafusion/issues/2978#issuecomment-1197382852

   > Thanks @alamb ! That does work and it looks like this behaviour is consistent with postgres as well. I'm closing this issue.
   
   Yeah, it is part of the SQL standard which is somewhat archaic 🤷 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on issue #2978: SELECT on column with uppercase column name fails with FieldNotFound error

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #2978:
URL: https://github.com/apache/arrow-datafusion/issues/2978#issuecomment-1197357183

   I think you may need to use `"` to surround the identifier. Does this work?
   
   ```sql
   select "UPPERCASE_NAME" from t;
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb commented on issue #2978: SELECT on column with uppercase column name fails with FieldNotFound error

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #2978:
URL: https://github.com/apache/arrow-datafusion/issues/2978#issuecomment-1241162837

   >  Is there a plan to support backtick (`) for "Quoted identifier"?
   
   I don't know of any plans @ray-andrew  -- I think the backtick is a mysql syntax  where the postgres dialect, that DataFusion follows,  uses `"`
   
   Here is mysql:
   
   ```sql
   mysql> select * from bar;
   +------+
   | x    |
   +------+
   |    1 |
   | NULL |
   +------+
   2 rows in set (0.01 sec)
   
   mysql> select `x` from bar;
   +------+
   | x    |
   +------+
   |    1 |
   | NULL |
   +------+
   2 rows in set (0.00 sec)
   
   mysql> select "x" from bar;
   +---+
   | x |
   +---+
   | x |
   | x |
   +---+
   2 rows in set (0.00 sec)
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org