-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](hive) support hive serde dialect for FE #49931
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
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34113 ms |
TPC-DS: Total hot run time: 193494 ms |
ClickBench: Total hot run time: 31.17 s |
BePPPower
approved these changes
Apr 10, 2025
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34624 ms |
TPC-DS: Total hot run time: 170289 ms |
ClickBench: Total hot run time: 31.05 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34120 ms |
TPC-DS: Total hot run time: 193258 ms |
ClickBench: Total hot run time: 31.01 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34160 ms |
TPC-DS: Total hot run time: 193383 ms |
ClickBench: Total hot run time: 31.42 s |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
wuwenchi
approved these changes
Apr 16, 2025
hubgeter
approved these changes
Apr 16, 2025
CalvinKirs
approved these changes
Apr 16, 2025
Contributor
|
PR approved by at least one committer and no changes requested. |
kaka11chen
approved these changes
Apr 16, 2025
seawinde
pushed a commit
to seawinde/doris
that referenced
this pull request
Apr 17, 2025
### What problem does this PR solve? 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
morningman
added a commit
to morningman/doris
that referenced
this pull request
May 14, 2025
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
dataroaring
pushed a commit
that referenced
this pull request
May 14, 2025
koarz
pushed a commit
to koarz/doris
that referenced
this pull request
Jun 4, 2025
### What problem does this PR solve? 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
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approved
Indicates a PR has been approved by one committer.
dev/3.0.6-merged
reviewed
usercase
Important user case type label
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.
What problem does this PR solve?
In #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.
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:
getStringValueForQueryandgetStringValueForStreamLoad.And I removed or renamed some old and messy methods.
Exmples
Doris/Hive/Prestomeans when settingserde_dialectto these types, the format of query result for different column types.Stream Loadmeans what format should be like in csv format when loading to the table1,01,01,0,true1,10001,10001,10001.2,3.001.2,3.001.2,3.002025-01-01,2025-01-01 10:11:112025-01-01,2025-01-01 10:11:112025-01-01,2025-01-01 10:11:11abc,中国abc,中国abc,中国abc,中国nullnullNULL\N[1, 0][true,false][1, 0][1, 0],[true, false][1, 1000][1,1000][1, 1000][1, 1000]["abc", "中国"]["abc","中国"]["abc", "中国"]["abc", "中国"]["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"][null][null][NULL][null]{1:"abc", 2:"中国"}{1:"abc",2:"中国"}{1=abc, 2=中国}{1:"abc", 2:"中国"}{"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"}{1:null, 2:null}{1:null,2:null}{1=NULL, 2=NULL}{1:null, 2:null}trim_double_quotasshould be set to falseRelease note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)