-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Invoking OwnedTableReference::from("schema.1table") produces an invalid TableReference if the "table name" starts with a number. In this example the result would be
Bare { table: "schema.1table" }
when in fact the correct result should be
Partial { schema: "schema", table: "1table" }
To Reproduce
A simple test can be added to datafusion/common/src/utils.rs to reproduce the bug.
#[test]
fn test_split_names() -> Result<()> {
let result = parse_identifiers_normalized("schema.1table");
assert_eq!(result.len(), 2);
Ok(())
}
Expected behavior
Invoking OwnedTableReference::from("schema.1table") should produce the result
Partial { schema: "schema", table: "1table" }
Additional context
I have traced the issue to sqlparser-rs returning a Token::Word rather than expected Token::Period at https://github.com/apache/arrow-datafusion/blob/main/datafusion/common/src/utils.rs#L200
My main question is should be be handled in DataFusion or sqlparser-rs?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working