Conversation
fc16163 to
a55690c
Compare
|
2500 lines of a PR are a bit too many, could you fracture this down into smaller reviewable units? |
@LucaCappelletti94 Of course, I would do that later and add more info in issue link #2379 |
ecca2d6 to
bffa3fd
Compare
@LucaCappelletti94 Done. Could you please take a look? |
8f0906f to
7ff24be
Compare
|
@alamb @benesch @LucaCappelletti94 Hi team, any improvement should I have? |
LucaCappelletti94
left a comment
There was a problem hiding this comment.
This is the sort of PR that would really benefit from GitHub stabilizing stacked PR also for forks' branches. Let's hope that happens soon. In the meantime, here are a few notes on this first PR in the chain.
| #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
| pub struct DorisDialect {} | ||
|
|
||
| impl Dialect for DorisDialect { |
There was a problem hiding this comment.
I believe you are still currently missing:
supports_limit_commaparse_infix(theDIV)supports_group_by_with_modifier
I am not familiar enough with Doris to say anything about the other methods, but I suggest you audit them against the engine.
| } | ||
|
|
||
| fn is_identifier_start(&self, ch: char) -> bool { | ||
| ch.is_ascii_alphabetic() || ch == '_' || !ch.is_ascii() |
There was a problem hiding this comment.
Since these methods at this time are extensively identical and meant to be identical to the MySqlDialect, I suggest they are kept aligned by using the same approach used with redshift and postgres and dispatch the method call to MySqlDialect. When they are strictly distinct, a comment with a documentation link may be desirable.
| } | ||
|
|
||
| #[test] | ||
| fn doris_identifier_and_string_literal_gates() { |
There was a problem hiding this comment.
I am unsure such a test is necessary
|
|
||
| #[test] | ||
| fn parse_doris_strings_and_identifiers() { | ||
| doris().verified_stmt( |
There was a problem hiding this comment.
I believe here you may want to use verified_only_select
|
|
||
| #[test] | ||
| fn doris_and_generic_parse_common_sql_identically() { | ||
| doris_and_generic().verified_stmt("SELECT 1 AS properties FROM t"); |
There was a problem hiding this comment.
I imagine this will be more relevant in a later PR in this series where you add the keyword PROPERTIES?
There was a problem hiding this comment.
I imagine this will be more relevant in a later PR in this series where you add the keyword
PROPERTIES?
@LucaCappelletti94 sorry for the late reply. I've read all your comments here and try to improve these points. Could you take an another look plz?
…ESC / GET_DDL (apache#2380) * task LAV-1891: WIP — commit stranded agent work * task LAV-1891: WIP — commit stranded agent work * Task LAV-1891: emit queryContext + error positions for ALERT drop/desc/schedule/undrop
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2380 +/- ##
==========================================
+ Coverage 81.09% 81.11% +0.02%
==========================================
Files 42 43 +1
Lines 33684 33726 +42
Branches 33684 33726 +42
==========================================
+ Hits 27316 27358 +42
Misses 2798 2798
Partials 3570 3570 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LucaCappelletti94
left a comment
There was a problem hiding this comment.
You should trim the description to what this PR contains. It still lists CREATE TABLE models, LOAD DATA INFILE, CREATE ROUTINE LOAD and new AST structures, none of which are in this diff.
| #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
| pub struct DorisDialect {} | ||
|
|
||
| impl Dialect for DorisDialect { |
There was a problem hiding this comment.
You should also add DorisDialect to the dialect arrays in fuzz/fuzz_targets/fuzz_parse_sql.rs and fuzz/fuzz_targets/fuzz_parse_roundtrip.rs, and bump the [&dyn Dialect; 16] length. Without that, Doris is the only dialect that is never fuzzed.
| #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
| pub struct DorisDialect {} | ||
|
|
||
| impl Dialect for DorisDialect { |
There was a problem hiding this comment.
You should add a { label: "Doris", stems: ["doris"], pattern: /\bdoris\b/i } entry to DIALECTS in .github/workflows/labeler/label_dialects.js. Otherwise the follow-up PRs titled Doris: ... get no dialect label and the bot asks their author for one.
Co-authored-by: Luca Cappelletti <cappelletti.luca94@gmail.com>
Co-authored-by: Luca Cappelletti <cappelletti.luca94@gmail.com>
Summary
Introduce
DorisDialectas the first step toward Apache Doris support (#2379).Previously, callers could not select a Doris dialect by name.
CREATE TABLE extensions and load statements are left to follow-up PRs.
Reference: Doris lexer.
Validation
Passed all-feature tests, formatting, Clippy, labeler tests, and compilation checks for both fuzz targets.
Fuzzing was not run locally.
AI assistance was used for implementation and validation.