devinjdangelo commented on code in PR #7276:
URL: https://github.com/apache/arrow-datafusion/pull/7276#discussion_r1294021333


##########
datafusion/sql/tests/sql_integration.rs:
##########
@@ -1796,11 +1796,15 @@ fn create_external_table_with_compression_type() {
 #[test]
 fn create_external_table_parquet() {
     let sql = "CREATE EXTERNAL TABLE t(c1 int) STORED AS PARQUET LOCATION 
'foo.parquet'";
-    let err = logical_plan(sql).expect_err("query should have failed");
-    assert_eq!(
-        "Plan(\"Column definitions can not be specified for PARQUET files.\")",
-        format!("{err:?}")
-    );
+    let expected = "CreateExternalTable: Bare { table: \"t\" }";
+    quick_test(sql, expected);
+}
+
+#[test]
+fn create_external_table_parquet_sort_order() {
+    let sql = "create external table foo(a varchar, b varchar, c timestamp) 
stored as parquet location '/tmp/foo' with order (c)";
+    let expected = "CreateExternalTable: Bare { table: \"foo\" }";
+    quick_test(sql, expected);

Review Comment:
   Yes, that second error I added intentionally. Inserting to a sorted table 
would work, but there is nothing to enforce that the sort order is preserved 
yet. So, my concern is a user inserts unsorted data to a sorted table, and then 
subsequent queries return incorrect results surprisingly. 
   
   We could add this as an issue to the streaming writes epic (support inserts 
to a sorted listingtable).



##########
datafusion/sql/tests/sql_integration.rs:
##########
@@ -1796,11 +1796,15 @@ fn create_external_table_with_compression_type() {
 #[test]
 fn create_external_table_parquet() {
     let sql = "CREATE EXTERNAL TABLE t(c1 int) STORED AS PARQUET LOCATION 
'foo.parquet'";
-    let err = logical_plan(sql).expect_err("query should have failed");
-    assert_eq!(
-        "Plan(\"Column definitions can not be specified for PARQUET files.\")",
-        format!("{err:?}")
-    );
+    let expected = "CreateExternalTable: Bare { table: \"t\" }";
+    quick_test(sql, expected);
+}
+
+#[test]
+fn create_external_table_parquet_sort_order() {
+    let sql = "create external table foo(a varchar, b varchar, c timestamp) 
stored as parquet location '/tmp/foo' with order (c)";
+    let expected = "CreateExternalTable: Bare { table: \"foo\" }";
+    quick_test(sql, expected);

Review Comment:
   Yes, that error I added intentionally. Inserting to a sorted table would 
work, but there is nothing to enforce that the sort order is preserved yet. So, 
my concern is a user inserts unsorted data to a sorted table, and then 
subsequent queries return incorrect results surprisingly. 
   
   We could add this as an issue to the streaming writes epic (support inserts 
to a sorted listingtable).



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

Reply via email to