andygrove commented on issue #3002:
URL: 
https://github.com/apache/arrow-datafusion/issues/3002#issuecomment-1201307867

   The issue seems to be related to having relations containing columns with 
the same name as the relation.
   
   ```
   $ cat /tmp/a.csv
   foo
   1
   
   $ cat /tmp/b.csv
   bar
   1
   
   DataFusion CLI v10.0.0
   ❯ create external table a stored as csv with header row location 
'/tmp/a.csv';
   0 rows in set. Query took 0.017 seconds.
   ❯ create external table b stored as csv with header row location 
'/tmp/b.csv';
   0 rows in set. Query took 0.003 seconds.
   ❯ create external table bar stored as csv with header row location 
'/tmp/bar.csv';
   IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
   ❯ create external table bar stored as csv with header row location 
'/tmp/b.csv';
   0 rows in set. Query took 0.003 seconds.
   ❯ select a.foo, b.bar from a join b on a.foo = b.bar;
   +-----+-----+
   | foo | bar |
   +-----+-----+
   | 1   | 1   |
   +-----+-----+
   1 row in set. Query took 0.038 seconds.
   ❯ select a.foo, bar.bar from a join b on a.foo = bar.bar;
   Plan("The expression to get an indexed field is only valid for `List` types")
   ❯ 
   ```
   
   The first query works but the second query fails. The queries are identical 
except for the name used to register the table. In the second case the table 
name is the same as the column name in the table.


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