Jefffrey commented on code in PR #5183:
URL: https://github.com/apache/arrow-datafusion/pull/5183#discussion_r1097860599
##########
datafusion/common/src/table_reference.rs:
##########
@@ -155,50 +178,110 @@ impl<'a> TableReference<'a> {
table,
},
Self::Partial { schema, table } => ResolvedTableReference {
- catalog: default_catalog,
+ catalog: default_catalog.into(),
schema,
table,
},
Self::Bare { table } => ResolvedTableReference {
- catalog: default_catalog,
- schema: default_schema,
+ catalog: default_catalog.into(),
+ schema: default_schema.into(),
table,
},
}
}
- /// Forms a [`TableReference`] by splitting `s` on periods `.`.
- ///
- /// Note that this function does NOT handle periods or name
- /// normalization correctly (e.g. `"foo.bar"` will be parsed as
- /// `"foo`.`bar"`. and `Foo` will be parsed as `Foo` (not `foo`).
- ///
- /// If you need to handle such identifiers correctly, you should
- /// use a SQL parser or form the [`OwnedTableReference`] directly.
+ /// Forms a [`TableReference`] by attempting to parse `s` as a multipart
identifier,
+ /// failing that then taking the entire input as the identifier itself.
///
- /// See more detail in
<https://github.com/apache/arrow-datafusion/issues/4532>
+ /// Will normalize (convert to lowercase) any unquoted identifiers.
+ /// e.g. `Foo` will be parsed as `foo`, and `"Foo"".bar"` will be parsed as
+ /// `Foo".bar` (note the preserved case and requiring two double quotes to
represent
Review Comment:
It needs to contain the single double quote since it was escaped by
prepending it with another double quote in the original, unless you mean to
change the example?
--
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]