fmguerreiro commented on code in PR #2515:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2515#discussion_r4104409061
##########
src/ast/spans.rs:
##########
@@ -3167,6 +3168,20 @@ WHERE id = 1
);
}
+ #[test]
+ fn test_create_foreign_table_span_includes_quoted_option_value() {
+ let dialect = &crate::dialect::PostgreSqlDialect {};
+ let sql = "CREATE FOREIGN TABLE ft (a INT) SERVER s OPTIONS
(schema_name 'public')";
+ let mut test = SpanTest::new(dialect, sql);
+
+ // Span reaches through the quoted value but not the closing paren.
+ let stmt = test.0.parse_statement().unwrap();
+ assert_eq!(
+ test.get_source(stmt.span()),
+ "ft (a INT) SERVER s OPTIONS (schema_name 'public'"
+ );
+ }
Review Comment:
done in 88cbb5db, asserting the key and value spans directly.
--
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]