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 2021/04/26 13:22:19 UTC

[GitHub] [arrow-datafusion] alamb opened a new issue #108: [Datafusion] Datafusion queries involving a column name that begins with a number produces unexpected results

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


   *Note*: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-10329
   
   This bug can be worked around by wrapping column names in quotes.
   
   Example:
   
   {{let query = "SELECT 16_20mph, 21_25mph FROM foo;"}}
   
   {{let logical_plan = ctx.create_logical_plan(query)?;}}
   
   {{logical_plan.schema().fields() now has fields: [_20mph, _25mph]}}
   
   The resulting table produced by this query looks like:
   ||{{_20mph}}||{{_25mph}}||
   |16|21|
   |16|21|
   
   Every row is identical, where the column value is equal to the initial number that appears in the column name.


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

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



[GitHub] [arrow-datafusion] alamb commented on issue #108: [Datafusion] Datafusion queries involving a column name that begins with a number produces unexpected results

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


   Comment from Ben Sully(sd2k) @ 2020-11-08T11:46:18.008+0000:
   <pre>This behaviour seems consistent with Postgres at least:
   
   
   {{❯ psql}}
   {{psql (12.4)}}
   {{Type "help" for help.}}
   
   {{ben=# create table foo ("16_20mph" integer, "21_25mph" integer);}}
   {{CREATE TABLE}}
   {{ben=# insert into foo values (1, 2), (3, 4);}}
   {{INSERT 0 2}}
   {{ben=# SELECT 16_20mph, 21_25mph FROM foo;}}
   {{ _20mph | _25mph }}
   {{--------+--------}}
   {{ 16 | 21}}
   {{ 16 | 21}}
   {{(2 rows)}}
   
   {{ben=# SELECT "16_20mph", "21_25mph" FROM foo;}}
   {{ 16_20mph | 21_25mph }}
   {{----------+----------}}
   {{ 1 | 2}}
   {{ 3 | 4}}
   {{(2 rows)}}</pre>


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

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