-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Describe the bug
There is inconsistency with datafusion.sql_parser.enable_ident_normalization, when set to false, disabling normalisation.
To Reproduce
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:
root of the issue is at:
| Self::parse_str_normalized(s, false) |
where normalisation is enforced as second parameter is false (based on docs)
EDIT: there is workaround to make this working, adding quotes to table name will do the trick
ctx.register_csv( "`DATA`", "data.csv",Default::default(),).await?;Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed