-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feature](hive)support create hive table for text format #41860
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
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
|
|
||
| @VariableMgr.VarAttr(name = HIVE_TEXT_COMPRESSION, needForward = true) | ||
| private String hiveTextCompression = "uncompressed"; | ||
| private String hiveTextCompression = "plain"; |
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.
change default value? what will happen when upgrade from older version?
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.
I did the compatible process. If user set "uncompressed", it will change to plain
| return HiveMetaStoreClientHelper.firstPresentOrDefault(DEFAULT_NULL_FORMAT, nullFormat); | ||
| } | ||
|
|
||
| public static void updateProperties(Table table, Map<String, String> properties) { |
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.
Add comment to explain this method
| case FORMAT_CSV_PLAIN: | ||
| compressType = ConnectContext.get().getSessionVariable().hiveTextCompression(); | ||
| compressType = targetTable.getRemoteTable().getParameters().get("text.compression"); | ||
| if (compressType == null) { |
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.
| if (compressType == null) { | |
| if (Strings.isNullOrEmpty(compressType)) { |
6c03485 to
0a38900
Compare
|
run buildall |
suxiaogang223
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
|
PR approved by anyone and no changes requested. |
morningman
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
We can create hive table for text format with `'file_format'='text'`,
and set related properties:
```sql
create table tb (
id int,
`name` string
) PROPERTIES (
'file_format'='text',
'compression'='gzip',
'field.delim'='\t',
'line.delim'='\n',
'collection.delim'=';',
'mapkey.delim'=':',
'serialization.null.format'='\\N',
'escape.delim'='\\'
);
```
---------
Co-authored-by: morningman <morningman@163.com>
We can create hive table for text format with `'file_format'='text'`,
and set related properties:
```sql
create table tb (
id int,
`name` string
) PROPERTIES (
'file_format'='text',
'compression'='gzip',
'field.delim'='\t',
'line.delim'='\n',
'collection.delim'=';',
'mapkey.delim'=':',
'serialization.null.format'='\\N',
'escape.delim'='\\'
);
```
---------
Co-authored-by: morningman <morningman@163.com>
We can create hive table for text format with
'file_format'='text', and set related properties: