-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](hive) support hive serde dialect for FE (#49931) #50875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. In apache#49036, we only support hive serde dialect in BE side. But some constant expr will be evaluated and output in FE side, need to support it too. 2. Refactor the method of getting string format value for all type of literals in FE side. There are 2 kind of string format value for literal. One is for Query, the other is for Stream Load. Here is some difference: - NullLiteral For query, it should be `null`. For load, it should be `\N`. - StructLiteral For query, it should be `{"k1":"v1", "k2":null, "k3":"", "k4":"a"}`. For load, it should be `{"v1", null, "", "a"}` So we need 2 different methods to distinguish them: `getStringValueForQuery` and `getStringValueForStreamLoad`. And I removed or renamed some old and messy methods. **Exmples** - `Doris/Hive/Presto` means when setting `serde_dialect` to these types, the format of query result for different column types. - `Stream Load ` means what format should be like in csv format when loading to the table | Type | Doris | Hive | Presto | Stream Load | Comment | | --- | --- | --- | --- | --- | --- | | Bool | `1`, `0` | `1`, `0` | `1`, `0` | `1|0`, `true|false` || | Integer | `1`, `1000` | `1`, `1000` | `1`, `1000` | `1|1000` | | | Float/Decimal | `1.2`, `3.00` | `1.2`, `3.00` | `1.2`, `3.00` | `1.2|3.00` | | | Date/Datetime | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01`, `2025-01-01 10:11:11` | `2025-01-01|2025-01-01 10:11:11` | | | String | `abc`, `中国` | `abc`, `中国` | `abc`, `中国` | `abc,中国` | | | Null | `null` | `null` | `NULL` | `\N` || | Array<bool> | `[1, 0]` | `[true,false]` | `[1, 0]` | `[1, 0]`, `[true, false]` || | Array<int> | `[1, 1000]` | `[1,1000]` | `[1, 1000]` | `[1, 1000]` || | Array<string> | `["abc", "中国"]` | `["abc","中国"]` | `["abc", "中国"]` | `["abc", "中国"]` | | | Array<date/datetime> | `["2025-01-01", "2025-01-01 10:11:11"]` | `["2025-01-01","2025-01-01 10:11:11"]` | `["2025-01-01", "2025-01-01 10:11:11"]` | `["2025-01-01", "2025-01-01 10:11:11"]` || | Array<null> | `[null]` | `[null]` | `[NULL]` | `[null]` | | | Map<int, string> | `{1:"abc", 2:"中国"}` |`{1:"abc",2:"中国"}` |`{1=abc, 2=中国}` | `{1:"abc", 2:"中国"}` | | | Map<string, date/datetime> | `{"k1":"2022-10-01", "k2":"2022-10-01 10:10:10"}` | `{"k1":"2022-10-01","k2":"2022-10-01 10:10:10"}` | `{k1=2022-10-01, k2=2022-10-01 10:10:10}` | `{"k1":"2022-10-01", "k2":"2022-10-01 10:10:10"}` | | | Map<int, null> | `{1:null, 2:null}` | `{1:null,2:null}` | `{1=NULL, 2=NULL}` | `{1:null, 2:null}` | | | Struct<> | Same as map | Same as map | Same as map | Same as map | | 3. Fix a bug that for batch insert transaction, the `trim_double_quotas` should be set to false
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 40426 ms |
TPC-DS: Total hot run time: 197737 ms |
ClickBench: Total hot run time: 33.04 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
dataroaring
approved these changes
May 14, 2025
Contributor
dataroaring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bp #49931