Skip to content

Commit

Permalink
tweak test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dantengsky committed Nov 4, 2024
1 parent 3a78a09 commit 32ec2cc
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 98 deletions.
5 changes: 0 additions & 5 deletions src/query/ast/tests/it/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ fn test_statement() {
r#"create table a.b like c.d;"#,
r#"create table t like t2 engine = memory;"#,
r#"create table if not exists a.b (a int) 's3://testbucket/admin/data/' connection=(aws_key_id='minioadmin' aws_secret_key='minioadmin' endpoint_url='http://127.0.0.1:9900');"#,
r#"
create table if not exists a.b (a int) 's3://testbucket/admin/data/'
connection=(aws_key_id='minioadmin' aws_secret_key='minioadmin' endpoint_url='http://127.0.0.1:9900')
location_prefix = 'db';
"#,
r#"truncate table a;"#,
r#"truncate table "a".b;"#,
r#"drop table a;"#,
Expand Down
2 changes: 1 addition & 1 deletion src/query/ast/tests/it/testdata/stmt-error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ error:
--> SQL:1:38
|
1 | COPY INTO mytable FROM 's3://bucket' CONECTION= ();
| ^^^^^^^^^ unexpected `CONECTION`, expecting `CONNECTION`, `ON_ERROR`, `RETURN_FAILED_ONLY`, `LOCATION_PREFIX`, `FORMAT`, `VALIDATION_MODE`, `FORCE`, `PATTERN`, `FILES`, `PURGE`, `SIZE_LIMIT`, `FILE_FORMAT`, `MAX_FILES`, `DISABLE_VARIANT_CHECK`, `SPLIT_SIZE`, or `;`
| ^^^^^^^^^ unexpected `CONECTION`, expecting `CONNECTION`, `ON_ERROR`, `RETURN_FAILED_ONLY`, `FORMAT`, `VALIDATION_MODE`, `FORCE`, `PATTERN`, `FILES`, `PURGE`, `SIZE_LIMIT`, `FILE_FORMAT`, `MAX_FILES`, `DISABLE_VARIANT_CHECK`, `SPLIT_SIZE`, or `;`


---------- Input ----------
Expand Down
91 changes: 0 additions & 91 deletions src/query/ast/tests/it/testdata/stmt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2759,81 +2759,6 @@ CreateTable(
protocol: "s3",
name: "testbucket",
path: "/admin/data/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
"aws_key_id": "minioadmin",
"aws_secret_key": "minioadmin",
"endpoint_url": "http://127.0.0.1:9900",
},
},
},
),
cluster_by: None,
table_options: {},
as_query: None,
table_type: Normal,
},
)


---------- Input ----------
create table if not exists a.b (a int) 's3://testbucket/admin/data/'
connection=(aws_key_id='minioadmin' aws_secret_key='minioadmin' endpoint_url='http://127.0.0.1:9900')
location_prefix = 'db';
---------- Output ---------
CREATE TABLE IF NOT EXISTS a.b (a Int32) 's3://testbucket/admin/data/' CONNECTION = ( aws_key_id = 'minioadmin', aws_secret_key = 'minioadmin', endpoint_url = 'http://127.0.0.1:9900' ) LOCATION_PREFIX = 'db'
---------- AST ------------
CreateTable(
CreateTableStmt {
create_option: CreateIfNotExists,
catalog: None,
database: Some(
Identifier {
span: Some(
27..28,
),
name: "a",
quote: None,
ident_type: None,
},
),
table: Identifier {
span: Some(
29..30,
),
name: "b",
quote: None,
ident_type: None,
},
source: Some(
Columns(
[
ColumnDefinition {
name: Identifier {
span: Some(
32..33,
),
name: "a",
quote: None,
ident_type: None,
},
data_type: Int32,
expr: None,
comment: None,
},
],
None,
),
),
engine: None,
uri_location: Some(
UriLocation {
protocol: "s3",
name: "testbucket",
path: "/admin/data/",
part_prefix: "db",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -11299,7 +11224,6 @@ CreateStage(
protocol: "s3",
name: "load",
path: "/files/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -11344,7 +11268,6 @@ CreateStage(
protocol: "s3",
name: "load",
path: "/files/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -11389,7 +11312,6 @@ CreateStage(
protocol: "azblob",
name: "load",
path: "/files/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -11434,7 +11356,6 @@ CreateStage(
protocol: "azblob",
name: "load",
path: "/files/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -14050,7 +13971,6 @@ CopyIntoTable(
protocol: "s3",
name: "mybucket",
path: "/data.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {},
Expand Down Expand Up @@ -14127,7 +14047,6 @@ CopyIntoTable(
protocol: "s3",
name: "mybucket",
path: "/data.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {},
Expand Down Expand Up @@ -14206,7 +14125,6 @@ CopyIntoTable(
protocol: "s3",
name: "mybucket",
path: "/data.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -14287,7 +14205,6 @@ CopyIntoTable(
protocol: "s3",
name: "mybucket",
path: "/data.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -14358,7 +14275,6 @@ CopyIntoTable(
protocol: "https",
name: "127.0.0.1:9900",
path: "/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {},
Expand Down Expand Up @@ -14414,7 +14330,6 @@ CopyIntoTable(
protocol: "https",
name: "127.0.0.1",
path: "/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {},
Expand Down Expand Up @@ -14562,7 +14477,6 @@ CopyIntoLocation(
protocol: "s3",
name: "mybucket",
path: "/data.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {},
Expand Down Expand Up @@ -14728,7 +14642,6 @@ CopyIntoTable(
protocol: "s3",
name: "mybucket",
path: "/data.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -15009,7 +14922,6 @@ CopyIntoTable(
protocol: "fs",
name: "",
path: "/path/to/data.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {},
Expand Down Expand Up @@ -15084,7 +14996,6 @@ CopyIntoTable(
protocol: "s3",
name: "databend",
path: "/books.csv",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down Expand Up @@ -17249,7 +17160,6 @@ Query(
protocol: "s3",
name: "test",
path: "/bucket",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {},
Expand Down Expand Up @@ -22350,7 +22260,6 @@ AttachTable(
protocol: "s3",
name: "a",
path: "/",
part_prefix: "",
connection: Connection {
visited_keys: {},
conns: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ query T
explain syntax copy into 's3://mybucket/data.csv' from t1 file_format = ( type = CSV field_delimiter = ',' record_delimiter = '\n' skip_header = 1)
----
COPY
INTO Uri(UriLocation { protocol: "s3", name: "mybucket", path: "/data.csv", part_prefix: "", connection: Connection { visited_keys: {}, conns: {} } })
INTO Uri(UriLocation { protocol: "s3", name: "mybucket", path: "/data.csv", connection: Connection { visited_keys: {}, conns: {} } })
FROM t1
FILE_FORMAT = (
field_delimiter = ',',
Expand Down

0 comments on commit 32ec2cc

Please sign in to comment.