You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "waynexia (via GitHub)" <gi...@apache.org> on 2023/04/17 12:51:19 UTC

[GitHub] [arrow-datafusion] waynexia commented on a diff in pull request #6031: Minor: port more create_drop table tests to sqllogictests

waynexia commented on code in PR #6031:
URL: https://github.com/apache/arrow-datafusion/pull/6031#discussion_r1168633003


##########
datafusion/core/tests/sqllogictests/test_files/ddl.slt:
##########
@@ -580,4 +601,4 @@ select * from t;
 0 years 0 mons 5 days 0 hours 0 mins 0.000000003 secs 1
 
 statement ok
-drop table t;
+drop table t;

Review Comment:
   nit: add empty line
   ```suggestion
   drop table t;
   
   ```



##########
datafusion/core/tests/sql/create_drop.rs:
##########
@@ -21,90 +21,6 @@ use datafusion::test_util::TestTableFactory;
 
 use super::*;
 
-#[tokio::test]
-async fn sql_create_table_if_not_exists() -> Result<()> {
-    // the information schema used to introduce cyclic Arcs
-    let ctx =
-        SessionContext::with_config(SessionConfig::new().with_information_schema(true));
-
-    // Create table
-    ctx.sql("CREATE TABLE y AS VALUES (1,2,3)")
-        .await?
-        .collect()
-        .await?;
-
-    // Create table again
-    let result = ctx
-        .sql("CREATE TABLE IF NOT EXISTS y AS VALUES (1,2,3)")
-        .await?
-        .collect()
-        .await?;
-
-    assert_eq!(result, Vec::new());

Review Comment:
   These cases are covered by existing slt :+1: 



##########
datafusion/core/tests/sqllogictests/test_files/ddl.slt:
##########
@@ -448,6 +448,16 @@ CREATE TABLE table_without_values(field1 BIGINT NULL, field2 BIGINT NULL);
 statement ok
 CREATE TABLE IF NOT EXISTS table_without_values(field1 BIGINT, field2 BIGINT);
 
+statement ok
+CREATE EXTERNAL TABLE aggregate_simple STORED AS CSV WITH HEADER ROW LOCATION 'tests/data/aggregate_simple.csv'
+
+statement ok
+CREATE EXTERNAL TABLE IF NOT EXISTS aggregate_simple STORED AS CSV WITH HEADER ROW LOCATION 'tests/data/aggregate_simple.csv'

Review Comment:
   According to the previous cases I think we need to create this table again without `IF NOT EXIST` and expect an error



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org