Skip to content
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

[Feature] Support orc_use_column_names property in session variable #42777

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

Smith-Cruise
Copy link
Contributor

@Smith-Cruise Smith-Cruise commented Mar 19, 2024

Why I'm doing:

We only support to mapping orc column by position, but we need also support mapping by column name(Support Hive schema evolution).

What I'm doing:

Support it by session variable.

If you want to mapping orc by column names, set orc_use_column_names=true in session variable.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@Smith-Cruise Smith-Cruise requested review from a team as code owners March 19, 2024 11:32
@Smith-Cruise Smith-Cruise changed the title [Feature] Support orc.use_column_names property in hive connector [Feature] Support orc_use_column_names property in session variable Mar 20, 2024
Signed-off-by: Smith Cruise <chendingchao1@126.com>
Signed-off-by: Smith Cruise <chendingchao1@126.com>
Signed-off-by: Smith Cruise <chendingchao1@126.com>
Copy link

sonarcloud bot commented Mar 20, 2024

Copy link

[FE Incremental Coverage Report]

pass : 2 / 2 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/qe/SessionVariable.java 2 2 100.00% []

Copy link

[BE Incremental Coverage Report]

pass : 84 / 101 (83.17%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/formats/orc/orc_chunk_reader.cpp 52 68 76.47% [225, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 504, 505, 1189, 1236, 1237]
🔵 be/src/exec/hdfs_scanner_orc.cpp 13 14 92.86% [177]
🔵 be/src/formats/orc/column_reader.cpp 5 5 100.00% []
🔵 be/src/connector/hive_connector.cpp 1 1 100.00% []
🔵 be/src/exec/hdfs_scanner.cpp 1 1 100.00% []
🔵 be/src/formats/orc/orc_chunk_reader.h 2 2 100.00% []
🔵 be/src/formats/orc/column_reader.h 2 2 100.00% []
🔵 be/src/formats/orc/orc_mapping.cpp 8 8 100.00% []

@@ -827,6 +827,7 @@ Status HiveDataSource::_init_scanner(RuntimeState* state) {
} else if (format == THdfsFileFormat::PARQUET) {
scanner = _pool.add(new HdfsParquetScanner());
} else if (format == THdfsFileFormat::ORC) {
scanner_params.orc_use_column_names = state->query_options().orc_use_column_names;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHECK IF SET or not. And bette put in the same aread as other query options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already defined the default value in thrift

@packy92 packy92 enabled auto-merge (squash) March 21, 2024 06:12
@packy92 packy92 merged commit b3abc68 into StarRocks:main Mar 21, 2024
59 of 65 checks passed
@Smith-Cruise Smith-Cruise deleted the orc-use-column-names branch March 21, 2024 06:34
@Smith-Cruise
Copy link
Contributor Author

@mergify backport branch-3.2 branch-3.1

Copy link
Contributor

mergify bot commented Mar 21, 2024

backport branch-3.2 branch-3.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Mar 21, 2024
…42777)

Signed-off-by: Smith Cruise <chendingchao1@126.com>
(cherry picked from commit b3abc68)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java
#	gensrc/thrift/InternalService.thrift
mergify bot pushed a commit that referenced this pull request Mar 21, 2024
…42777)

Signed-off-by: Smith Cruise <chendingchao1@126.com>
(cherry picked from commit b3abc68)

# Conflicts:
#	be/src/exec/hdfs_scanner.h
#	be/test/formats/orc/orc_chunk_reader_test.cpp
#	fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java
#	gensrc/thrift/InternalService.thrift
packy92 pushed a commit that referenced this pull request Mar 21, 2024
…rty in session variable (backport #42777) (#42904)

Signed-off-by: Smith Cruise <chendingchao1@126.com>
packy92 pushed a commit that referenced this pull request Mar 21, 2024
…rty in session variable (backport #42777)  (#42905)

Signed-off-by: Smith Cruise <chendingchao1@126.com>
@Smith-Cruise Smith-Cruise mentioned this pull request Mar 28, 2024
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants