Phoenix500526 commented on issue #26877: URL: https://github.com/apache/datafusion/issues/26877#issuecomment-6495889560
Hi, @H4kor This is existing, documented behavior: strings passed as table references are parsed as SQL identifiers, so unquoted names such as `Example` are normalized to lowercase. See the [TableReference documentation](https://docs.rs/datafusion/latest/datafusion/common/enum.TableReference.html#creating-tablereference) To preserve the name’s case, I’d recommend using `TableReference::bare`: ```rust use datafusion::common::TableReference; ctx.register_csv( TableReference::bare("Example"), "cars.csv", CsvReadOptions::new(), ) .await?; let df = ctx.sql(r#"SELECT MAX(speed) FROM "Example""#).await?; df.show().await?; ``` The documentation recommends `bare` for programmatic use. It would also help to mention this behavior and add an example in the `register_csv` documentation, where it’s easier to discover. -- 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]
