xitep commented on code in PR #2101:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2101#discussion_r2559364090
##########
src/dialect/mod.rs:
##########
@@ -601,13 +601,122 @@ pub trait Dialect: Debug + Any {
false
}
- /// Return true if the dialect supports specifying multiple options
+ /// Returns true if the dialect supports specifying multiple options
/// in a `CREATE TABLE` statement for the structure of the new table. For
example:
/// `CREATE TABLE t (a INT, b INT) AS SELECT 1 AS b, 2 AS a`
fn supports_create_table_multi_schema_info_sources(&self) -> bool {
false
}
+ /// Returns `true` if the dialect supports qualified column names
Review Comment:
* postgresql (https://www.postgresql.org/docs/current/sql-merge.html) ...
"[..] The name of a column in the target table. The column name can be
qualified with a subfield name or array subscript, if needed. (Inserting into
only some fields of a composite column leaves the other fields null.) Do not
include the table's name in the specification of a target column. [..]" (this
is the allowed "appendage" to an "insert column"
https://github.com/postgres/postgres/blob/3df4df53b06df2a2af56a77bf44cffa6393534fe/src/backend/parser/gram.y#L17091-L17118)
* mssql:
https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-ver17
... "[..] Columns must be specified as a single-part name. [..]"
* snowflakes' document
(https://docs.snowflake.com/en/sql-reference/sql/merge) is not really clear on
the details apart of "... specifies one or more columns in the target table to
be inserted ..." :/
* databricks:
https://docs.databricks.com/aws/en/sql/language-manual/delta-merge-into ... is
also not very clear, but i get that it's column names of the target table.
* duckdb: https://duckdb.org/docs/stable/sql/statements/merge_into ... looks
like a plain old column name, ie. a plain identifier.
* bigquery:
https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#merge_statement
... looks like plain "column name"
* redshift: https://docs.aws.amazon.com/redshift/latest/dg/r_MERGE.html ...
One or more column names that you want to modify. Don't include the table name
when specifying the target column.
* hive: https://hive.apache.org/docs/latest/language/languagemanual-dml/
seems to not to support a columns list in the first place
so, a qualified identifier (ie. `ObjectName`) should be just fine. this
would allow me to off-load the entire validation from `sqlparser-rs` into the
client program, which i believe is desirable.
--
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]