feat: support INSERT INTO [TABLE] FUNCTION of Clickhouse (#1633)

Co-authored-by: Kermit <chenjiawei1@xiaohongshu.com>
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
This commit is contained in:
cjw 2025-01-10 22:23:56 +08:00 committed by GitHub
parent c54ba4dc41
commit b09514e492
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 147 additions and 53 deletions

View file

@ -1725,7 +1725,7 @@ fn parse_prepare() {
};
match sub_stmt.as_ref() {
Statement::Insert(Insert {
table_name,
table: table_name,
columns,
source: Some(source),
..
@ -4381,11 +4381,11 @@ fn test_simple_postgres_insert_with_alias() {
or: None,
ignore: false,
into: true,
table_name: ObjectName(vec![Ident {
table: TableObject::TableName(ObjectName(vec![Ident {
value: "test_tables".to_string(),
quote_style: None,
span: Span::empty(),
}]),
}])),
table_alias: Some(Ident {
value: "test_table".to_string(),
quote_style: None,
@ -4426,7 +4426,7 @@ fn test_simple_postgres_insert_with_alias() {
assignments: vec![],
partitioned: None,
after_columns: vec![],
table: false,
has_table_keyword: false,
on: None,
returning: None,
replace_into: false,
@ -4449,11 +4449,11 @@ fn test_simple_postgres_insert_with_alias() {
or: None,
ignore: false,
into: true,
table_name: ObjectName(vec![Ident {
table: TableObject::TableName(ObjectName(vec![Ident {
value: "test_tables".to_string(),
quote_style: None,
span: Span::empty(),
}]),
}])),
table_alias: Some(Ident {
value: "test_table".to_string(),
quote_style: None,
@ -4497,7 +4497,7 @@ fn test_simple_postgres_insert_with_alias() {
assignments: vec![],
partitioned: None,
after_columns: vec![],
table: false,
has_table_keyword: false,
on: None,
returning: None,
replace_into: false,
@ -4519,11 +4519,11 @@ fn test_simple_insert_with_quoted_alias() {
or: None,
ignore: false,
into: true,
table_name: ObjectName(vec![Ident {
table: TableObject::TableName(ObjectName(vec![Ident {
value: "test_tables".to_string(),
quote_style: None,
span: Span::empty(),
}]),
}])),
table_alias: Some(Ident {
value: "Test_Table".to_string(),
quote_style: Some('"'),
@ -4564,7 +4564,7 @@ fn test_simple_insert_with_quoted_alias() {
assignments: vec![],
partitioned: None,
after_columns: vec![],
table: false,
has_table_keyword: false,
on: None,
returning: None,
replace_into: false,