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 2021/12/14 22:50:03 UTC

[GitHub] [arrow-datafusion] alamb commented on a change in pull request #1449: Support identifiers with `.` in them

alamb commented on a change in pull request #1449:
URL: https://github.com/apache/arrow-datafusion/pull/1449#discussion_r769107230



##########
File path: datafusion/src/sql/planner.rs
##########
@@ -1323,9 +1325,14 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
                     let var_names = vec![id.value.clone()];
                     Ok(Expr::ScalarVariable(var_names))
                 } else {
-                    // create a column expression based on raw user input, this column will be
-                    // normalized with qualifer later by the SQL planner.
-                    Ok(col(&id.value))
+                    // Don't use `col()` here because it will try to
+                    // interpret names with '.' as if they were
+                    // compound indenfiers, but this is not a compound
+                    // identifier. (e.g. it is "foo.bar" not foo.bar)
+                    Ok(Expr::Column(Column {

Review comment:
       This is the core change -- `col()` attempts to parse a string as a potentially compound identifier. For a `SQLExpr::Identifier` this should not be done and the value should be used as an unqualified relation




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