H4kor opened a new issue, #26877:
URL: https://github.com/apache/datafusion/issues/26877

   ### Describe the bug
   
   When registering a table with a String name in a SessionContext the table 
name is passed through `parse_str_normalized` converting it into a lower case 
string. 
   
   This leads to confusion when the name is used "quoted" in a SQL query.
   
   ### To Reproduce
   
   ```rust
   use datafusion::execution::{context::SessionContext, 
options::CsvReadOptions};
   
   #[tokio::main]
   async fn main() -> datafusion::error::Result<()> {
       let ctx = SessionContext::new();
       // Register with an Upper case name
       ctx.register_csv("Example", "cars.csv", CsvReadOptions::new())
           .await
           .unwrap();
   
       // unquoted query works
       let df = ctx.sql("SELECT MAX(speed) FROM Example").await.unwrap();
       df.show().await.unwrap();
   
       // quoted query FAILS
       let df = ctx.sql("SELECT MAX(speed) FROM \"Example\"").await.unwrap();
       df.show().await.unwrap();
       Ok(())
   }
   ```
   
   ### Expected behavior
   
   Unsure what the wider consequences and decisions are.
   
   My expectation was that registering would preserve the case.
   
   ### Additional context
   
   _No response_
   
   ### Willingness to contribute
   
   I would like to contribute a fix for this bug, but request guidance from the 
DataFusion community


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to