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

[GitHub] [arrow-datafusion] andygrove commented on issue #2374: Identifiers are made lower-case in SQL query

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

   @dbr Unquoted SQL identifiers are case-insensitive by design (to match ANSI and Postgres). SQL identifiers in double quotes are case-sensitive. If you put double quotes around the identifier in the SQL query then it works as expected.
   
   ```
   diff --git a/datafusion-examples/examples/memtable.rs b/datafusion-examples/examples/memtable.rs
   index 11793a837f..b04f5424a1 100644
   --- a/datafusion-examples/examples/memtable.rs
   +++ b/datafusion-examples/examples/memtable.rs
   @@ -36,7 +36,7 @@ async fn main() -> Result<()> {
        // Register the in-memory table containing the data
        ctx.register_table("users", Arc::new(mem_table))?;
    
   -    let dataframe = ctx.sql("SELECT * FROM users;").await?;
   +    let dataframe = ctx.sql("SELECT \"Bank_Account\" FROM users;").await?;
    
        timeout(Duration::from_secs(10), async move {
            let result = dataframe.collect().await.unwrap();
   @@ -71,6 +71,6 @@ fn create_record_batch() -> Result<RecordBatch> {
    fn get_schema() -> SchemaRef {
        SchemaRef::new(Schema::new(vec![
            Field::new("id", DataType::UInt8, false),
   -        Field::new("bank_account", DataType::UInt64, true),
   +        Field::new("Bank_Account", DataType::UInt64, true),
        ]))
    }
   ```


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