Skip to content

Commit d9f0b2b

Browse files
committed
Use verified_stmt and drop comments in COPY INTO cast test
1 parent 32a3470 commit d9f0b2b

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

tests/sqlparser_snowflake.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,16 +2449,6 @@ fn test_copy_into_with_transformations() {
24492449

24502450
#[test]
24512451
fn test_copy_into_with_cast_transformation() {
2452-
// Snowflake `COPY INTO` transformation lists support casts like
2453-
// `$1:"col"::TYPE` and `$1::TYPE`. These are distinct from the bare
2454-
// `$<n>[.<col>][:<elem>]` stage-load-select-item shape, so the parser
2455-
// must fall through to the generic select-item parser to handle the
2456-
// `::` cast operator.
2457-
//
2458-
// Regression: the Snowflake-specific parser used to successfully
2459-
// consume `$1:"col"` as a stage-load-select-item, leaving `::TYPE`
2460-
// behind and causing "Expected: FROM, found: ::" once the COPY INTO
2461-
// body tried to expect `FROM`.
24622452
let variants = [
24632453
concat!(
24642454
"COPY INTO my_company.emp_basic (a) FROM ",
@@ -2476,17 +2466,13 @@ fn test_copy_into_with_cast_transformation() {
24762466
"COPY INTO my_company.emp_basic (a, b) FROM ",
24772467
r#"(SELECT $1:"A"::VARIANT, $1:"B"::TEXT FROM @stg)"#,
24782468
),
2479-
// Mix with an ordinary stage-load-select-item in the same list,
2480-
// so we don't over-correct and break the existing shape.
24812469
concat!(
24822470
"COPY INTO my_company.emp_basic (a, b) FROM ",
24832471
r#"(SELECT t.$1:plain AS plain, $1:"B"::TEXT FROM @stg AS t)"#,
24842472
),
24852473
];
24862474
for sql in variants {
2487-
snowflake().parse_sql_statements(sql).unwrap_or_else(|e| {
2488-
panic!("expected {sql:?} to parse, got {e}");
2489-
});
2475+
snowflake().verified_stmt(sql);
24902476
}
24912477
}
24922478

0 commit comments

Comments
 (0)