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/04/27 15:56:21 UTC

[GitHub] [arrow-datafusion] andygrove opened a new issue, #2358: Subquery aliases should not be case-sensitive

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

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


[GitHub] [arrow-datafusion] alamb closed issue #2358: Subquery aliases should not be case-sensitive

Posted by GitBox <gi...@apache.org>.
alamb closed issue #2358: Subquery aliases should not be case-sensitive
URL: https://github.com/apache/arrow-datafusion/issues/2358


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