apache / apache/datafusion-sqlparser-rs

tests/sqlparser_common.rs / parse_create_view_with_options gives different results with ClickHouseDialect

Đang mở
#1,449 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
3.5k
Fork
772
Merge trung bình
4 ngày 9 giờ
Pull request đã merge (30 ngày)
17

Mô tả

When changing the test to include ClickHouseDialect, it fails like so:

```
---- parse_create_view_with_columns stdout ----
thread 'parse_create_view_with_columns' panicked at src/test_utils.rs:77:21:
assertion `left == right` failed: Parse results with DatabricksDialect are different from ClickHouseDialect
left: Ok([CreateView { or_replace: false, materialized: false, name: ObjectName([Ident { value: "v", quote_style: None }]), columns: [ViewColumnDef { name: Ident { value: "has", quote_style: None }, data_type: None, options: None }, ViewColumnDef { name: Ident { value: "cols", quote_style: None }, data_type: None, options: None }], query: Query { with: None, body: Select(Select { distinct: None, top: None, projection: [UnnamedExpr(Value(Number("1", false))), UnnamedExpr(Value(Number("2", false)))], into: None, from: [], lateral_views: [], prewhere: None, selection: None, group_by: Expressions([], []), cluster_by: [], distribute_by: [], sort_by: [], having: None, named_window: [], qualify: None, window_before_qualify: false, value_table_mode: None, connect_by: None }), order_by: None, limit: None, limit_by: [], offset: None, fetch: None, locks: [], for_clause: None, settings: None, format_clause: None }, options: None, cluster_by: [], comment: None, with_no_schema_binding: false, if_not_exists: false, temporary: false, to: None }])
right: Err(ParserError("Expected: a data type name, found: ,"))
stack backtrace:
0: rust_begin_unwind
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:652:5
1: core::panicking::panic_fmt
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/panicking.rs:72:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/panicking.rs:363:5
4: sqlparser::test_utils::TestedDialects::one_of_identical_results::{{closure}}
at ./src/test_utils.rs:77:21
5: core::iter::adapters::map::map_fold::{{closure}}
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/iter/adapters/map.rs:89:21
6: as core::iter::traits::iterator::Iterator>::fold
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/slice/iter/macros.rs:230:27
7: as core::iter::traits::iterator::Iterator>::fold
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/iter/adapters/map.rs:129:9
8: sqlparser::test_utils::TestedDialects::one_of_identical_results
at ./src/test_utils.rs:74:9
9: sqlparser::test_utils::TestedDialects::parse_sql_statements
at ./src/test_utils.rs:101:9
10: sqlparser::test_utils::TestedDialects::one_statement_parses_to
at ./src/test_utils.rs:132:30
11: sqlparser::test_utils::TestedDialects::verified_stmt
at ./src/test_utils.rs:161:9
12: sqlparser_common::parse_create_view_with_columns
at ./tests/sqlparser_common.rs:6799:11
13: sqlparser_common::parse_create_view_with_columns::{{closure}}
at ./tests/sqlparser_common.rs:6796:36
14: core::ops::function::FnOnce::call_once
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/ops/function.rs:250:5
15: core::ops::function::FnOnce::call_once
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/ops/function.rs:250:5
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Run the parse_create_view_with_columns test in tests/sqlparser_common.rs and inspect the dialect comparison in src/test_utils.rs. Trace why ClickHouseDialect returns an error while DatabricksDialect returns a parsed CreateView; done means the test produces identical parse results for both dialects.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust, sql
Lĩnh vực
databases
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.