[Feature] Select outfile support parquet format#5938
Merged
morningman merged 3 commits intoapache:masterfrom Jun 10, 2021
Merged
[Feature] Select outfile support parquet format#5938morningman merged 3 commits intoapache:masterfrom
morningman merged 3 commits intoapache:masterfrom
Conversation
fb6a36e to
2d923b5
Compare
morningman
reviewed
Jun 5, 2021
| fileFormatType = TFileFormatType.FORMAT_PARQUET; | ||
| break; | ||
| default: | ||
| throw new AnalysisException("format:"+this.format+" not be supported."); |
Contributor
There was a problem hiding this comment.
Suggested change
| throw new AnalysisException("format:"+this.format+" not be supported."); | |
| throw new AnalysisException("format:" + this.format + " is supported."); |
| brokerDesc = new BrokerDesc(brokerName, brokerProps); | ||
| } | ||
|
|
||
| private void getParquetProperties(Set<String> processedPropKeys) throws AnalysisException { |
Contributor
There was a problem hiding this comment.
Better add comment with an example to explain what kind of property format does this method parsed
be/src/exec/parquet_writer.cpp
Outdated
| << _str_schema[index][2] << " is " << _str_schema[index][1]; | ||
| return Status::InvalidArgument(ss.str()); | ||
| } | ||
| LOG(WARNING) << "wangxixu-write-one-data:"; |
Contributor
There was a problem hiding this comment.
Suggested change
| LOG(WARNING) << "wangxixu-write-one-data:"; |
| } | ||
| break; | ||
| } | ||
| case TYPE_LARGEINT: { |
Contributor
There was a problem hiding this comment.
I think this should be checked on FE side, and reject request with LARGEINT column
be/src/exec/parquet_writer.cpp
Outdated
| return Status::OK(); | ||
| } | ||
|
|
||
| int64_t ParquetWriterWrapper::getWritedLen() { |
Contributor
There was a problem hiding this comment.
Suggested change
| int64_t ParquetWriterWrapper::getWritedLen() { | |
| int64_t ParquetWriterWrapper::get_written_len() { |
| _outstream->Close(); | ||
| } catch (const std::exception& e) { | ||
| _rg_writer = nullptr; | ||
| LOG(WARNING) <<"Parquet writer close error: " << e.what(); |
Contributor
There was a problem hiding this comment.
Suggested change
| LOG(WARNING) <<"Parquet writer close error: " << e.what(); | |
| LOG(WARNING) << "Parquet writer close error: " << e.what(); |
added 2 commits
June 8, 2021 14:25
2d923b5 to
f70b2f1
Compare
morningman
reviewed
Jun 9, 2021
| Status FileResultWriter::_close_file_writer(bool done, bool only_close) { | ||
| if (_parquet_writer != nullptr) { | ||
| _parquet_writer->close(); | ||
| _current_written_bytes = _parquet_writer->get_writed_len(); |
Contributor
There was a problem hiding this comment.
Suggested change
| _current_written_bytes = _parquet_writer->get_writed_len(); | |
| _current_written_bytes = _parquet_writer->_written_len(); |
5a84c39 to
e78db50
Compare
Closed
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
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.
Proposed changes
Select outfile intocurrently only supports to export data with CSV format. This patch extends the feature to supports parquet format.Usage:
LocaFile:
SELECT citycode FROM table1 INTO OUTFILE "file:///root/doris/" FORMAT AS PARQUET PROPERTIES ("schema"="required,int32,siteid;", "parquet.compression"="snappy");BrokerFile:
SELECT siteid FROM table1 INTO OUTFILE "hdfs://host/test_sql_prc_2019_02_19/" FORMAT AS PARQUET PROPERTIES ( "broker.name" = "hdfs_broker", "broker.hadoop.security.authentication" = "kerberos", "broker.kerberos_principal" = "test", "broker.kerberos_keytab_content" = "base64" , "schema"="required,int32,siteid;");Field
schemais requied, whick defines the schema of a parquet file. Prefixparquet.is the parquet file properties, like compression, version, enable_dictionary.Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...