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

   ### Describe the bug
   
   There is inconsistency with  
`datafusion.sql_parser.enable_ident_normalization`, when set to `false`, 
disabling normalisation. 
   
   ### To Reproduce
   
   ```rust
   use datafusion::{error::Result, prelude::SessionContext};
   
   #[tokio::main]
   async fn main() -> Result<()> {
       let ctx = SessionContext::new();
   
       ctx.sql("SET datafusion.sql_parser.enable_ident_normalization=false")
           .await?
           .collect()
           .await?;
   
       ctx.register_csv(
           "DATA",
           "data.csv",
           Default::default(),
       )
       .await?;
   
       ctx.sql("select * from DATA").await?.show().await?;
   
       Ok(())
   }
   
   ```
   
   (note all caps table name `DATA`)
   
   will fail with error: 
   
   
   ```
   Error: Diagnostic(Diagnostic { kind: Error, message: "table 'DATA' not 
found", span: Some(Span(Location(1,15)..Location(1,19))), notes: [], helps: [] 
}, Plan("table 'datafusion.public.DATA' not found"))
   ```
   
   ### Expected behavior
   
   Expected behaviour would be to find table `datafusion.public.DATA`.
   
   I'm not sure if DATA (name) should be normalised to lower-case, I would 
argue not, but some consistency is needed.
   
   ### Additional context
   
   Issue starts at `register_csv` table (actually, `register_table`) where 
table name is converted to lover case at: 
   
   
https://github.com/milenkovicm/datafusion/blob/377c0fce481d561d58e3a6fad2dca18cb1d58384/datafusion/core/src/execution/context/mod.rs#L1609-L1610
   
   root of the  issue is at: 
   
   
https://github.com/apache/datafusion/blob/377c0fce481d561d58e3a6fad2dca18cb1d58384/datafusion/common/src/table_reference.rs#L281
   
   where normalisation is enforced as second parameter is `false` (based on docs


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