-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Enhancement] Support to recognize skip.header.line.count in hive's textfile #47001
Conversation
if (text_file_desc.__isset.compression_type) { | ||
_compression_type = CompressionUtils::to_compression_pb(text_file_desc.compression_type); | ||
compression_type = CompressionUtils::to_compression_pb(text_file_desc.compression_type); |
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.
👍
String mapkeyDelim = serdeParams.getOrDefault("mapkey.delim", ""); | ||
String lineDelim = parameters.getOrDefault(serdeConstants.LINE_DELIM, ""); | ||
String mapkeyDelim = parameters.getOrDefault(serdeConstants.MAPKEY_DELIM, ""); | ||
int skipHeaderLineCount = Integer.parseInt(parameters.getOrDefault(serdeConstants.HEADER_COUNT, "0")); |
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.
better check if it's legit, such as >= 0
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.
done
be/src/exec/hdfs_scanner_text.h
Outdated
Status _create_csv_reader(); | ||
Status _setup_compression_type(const TTextFileDesc& text_file_desc); | ||
Status _setup_delimiter(const TTextFileDesc& text_file_desc); | ||
StatusOr<bool> _has_uft8_bom() const; |
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.
typo for utf8
?
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.
done
Quality Gate passedIssues Measures |
[FE Incremental Coverage Report]✅ pass : 21 / 22 (95.45%) file detail
|
[BE Incremental Coverage Report]✅ pass : 57 / 57 (100.00%) file detail
|
@@ -627,4 +628,12 @@ void HdfsScanner::move_split_tasks(std::vector<pipeline::ScanSplitContextPtr>* s | |||
} | |||
} | |||
|
|||
CompressionTypePB HdfsScanner::get_compression_type_from_path(const std::string& filename) { |
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.
Duplicate with the function return_compression_type_from_filename of hdf_scanner_text.cpp ?
Make it to one common function?
@@ -100,6 +100,8 @@ struct TTextFileDesc { | |||
|
|||
// escape character | |||
8: optional i8 escape | |||
|
|||
9: optional i32 skip_header_line_count |
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.
After adding this Skip, will it cause problems with the optimizer, such as Limit 1. In the past, FE would select 1 file, but with this skip, problems may occur?
@Mergifyio backport branch-3.3 |
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
…extfile (#47001) Signed-off-by: Smith Cruise <chendingchao1@126.com> (cherry picked from commit 2c838f7) # Conflicts: # be/src/exec/hdfs_scanner_text.cpp # be/src/exec/hdfs_scanner_text.h # fe/fe-core/src/main/java/com/starrocks/connector/hive/TextFileFormatDesc.java # fe/fe-core/src/test/java/com/starrocks/connector/hive/HiveMetaClientTest.java # fe/fe-core/src/test/java/com/starrocks/connector/hive/TextFileFormatDescTest.java
…extfile (#47001) Signed-off-by: Smith Cruise <chendingchao1@126.com> (cherry picked from commit 2c838f7) # Conflicts: # be/src/exec/hdfs_scanner.cpp # be/src/exec/hdfs_scanner_text.cpp # be/src/exec/hdfs_scanner_text.h # be/test/exec/hdfs_scanner_test.cpp # fe/fe-core/src/main/java/com/starrocks/connector/hive/HiveMetastoreApiConverter.java # fe/fe-core/src/main/java/com/starrocks/connector/hive/TextFileFormatDesc.java # fe/fe-core/src/test/java/com/starrocks/connector/hive/HiveMetaClientTest.java # fe/fe-core/src/test/java/com/starrocks/connector/hive/TextFileFormatDescTest.java
… skip.header.line.count in hive's textfile (backport StarRocks#47001) (StarRocks#47082) Signed-off-by: Smith Cruise <chendingchao1@126.com>
Why I'm doing:
Support
skip.header.line.count
tblproperties in hive table.demo:
What I'm doing:
Support it
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: