pmallex commented on code in PR #19339:
URL: https://github.com/apache/datafusion/pull/19339#discussion_r2677644659
##########
datafusion/sql/tests/sql_integration.rs:
##########
@@ -4522,6 +4522,42 @@ fn test_parse_escaped_string_literal_value() {
);
}
+#[test]
+fn test_parse_quoted_column_name_with_at_sign() {
+ let sql = r"SELECT `@column` FROM `@quoted_identifier_names_table`";
+ let plan = logical_plan(sql).unwrap();
+ assert_snapshot!(
+ plan,
+ @r#"
+ Projection: @quoted_identifier_names_table.@column
+ TableScan: @quoted_identifier_names_table
+ "#
+ );
+
+ let sql = r"SELECT `@quoted_identifier_names_table`.`@column` FROM
`@quoted_identifier_names_table`";
+ let plan = logical_plan(sql).unwrap();
+ assert_snapshot!(
+ plan,
+ @r#"
+ Projection: @quoted_identifier_names_table.@column
+ TableScan: @quoted_identifier_names_table
+ "#
+ );
+}
+
+#[test]
+fn test_variable_identifier() {
+ let sql = r"SELECT @variable = t_date32 FROM test";
+ let plan = logical_plan(sql).unwrap();
+ assert_snapshot!(
+ plan,
+ @r#"
+ Projection: @variable = test.t_date32
Review Comment:
Makes sense. I pushed a new revision that makes this clearer. If it was an
identifier then it would be qualified with the table name in the filter.
--
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]