andygrove opened a new issue, #2358:
URL: https://github.com/apache/arrow-datafusion/issues/2358
**Describe the bug**
SQL identifiers should be case-insensitive unless in double quotes. This is
not currently the case for subquery aliases.
**To Reproduce**
Add this test to `datafusion/core/tests/sql/projection.rs`
``` rust
#[tokio::test]
async fn subquery_alias_case_insensitive() -> Result<()> {
let partition_count = 1;
let results =
partitioned_csv::execute("SELECT V1.c1, v1.C2 FROM (SELECT test.C1,
TEST.c2 FROM test) V1 ORDER BY v1.c1, V1.C2 LIMIT 1", partition_count).await?;
let expected = vec![
"+----+----+",
"| c1 | c2 |",
"+----+----+",
"| 3 | 1 |",
"+----+----+",
];
assert_batches_sorted_eq!(expected, &results);
Ok(())
}
```
Fails with:
```
Error: Plan("No field named 'v1.c1'. Valid fields are 'V1.c1', 'V1.c2'.")
```
**Expected behavior**
SQL planner should normalize the identifier.
**Additional context**
None
--
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]