wenxiaojie1 commented on code in PR #2395:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2395#discussion_r3733852986
##########
tests/sqlparser_hive.rs:
##########
@@ -226,6 +227,28 @@ fn create_table_with_clustered_by() {
);
}
+#[test]
+fn display_create_table_with_skewed_by() {
+ let column = |name| ColumnDef {
+ name: Ident::new(name),
+ data_type: DataType::String(None),
+ options: vec![],
+ };
+ let stmt =
CreateTableBuilder::new(ObjectName::from(vec![Ident::new("test")]))
+ .columns(vec![column("id")])
+ .hive_distribution(HiveDistributionStyle::SKEWED {
+ columns: vec![column("id")],
+ on: vec![column("id")],
+ stored_as_directories: true,
+ })
+ .build();
+
+ assert_eq!(
+ stmt.to_string(),
+ "CREATE TABLE test (id STRING) SKEWED BY (id STRING) ON (id STRING)
STORED AS DIRECTORIES"
+ );
Review Comment:
Thanks. I tried the erified_stmt form, but the current Hive parser rejects
this syntax with Expected: end of statement, found: SKEWED. That matches
#1499's note that SKEWED BY cannot currently be parsed. I kept the explicit AST
construction so the test remains scoped to the reported display bug rather than
adding parser support in this PR. The focused test still passes.
##########
tests/sqlparser_hive.rs:
##########
@@ -226,6 +227,28 @@ fn create_table_with_clustered_by() {
);
}
+#[test]
+fn display_create_table_with_skewed_by() {
Review Comment:
Applied in f6122ee.
--
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]