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] Add native format reader to access StarRocks data bypass BE Server. #54470

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

plotor
Copy link
Contributor

@plotor plotor commented Dec 28, 2024

Why I'm doing:

You can learn about the background from PR #52682.

What I'm doing:

In order to support bypassing the BE server, and directly reading and writing the data stored in the object storage in share-data mode, we extracted a format-sdk module. This SDK:

  • Provides the C++ version of Reader and Writer implementation, which can read and write StarRocks data files.
  • Provides the Java version of Reader and Writer (invokes the C++ Reader and Writer through JNI), which can be used by computing engines.
  • Implements data exchange through the Arrow format, making it easier for more programming languages to access.

This PR mainly contains the implementation of Reader. You can build it by:

mvn clean package -DskipTests

This will complete the compilation of C++ and Java codes, and finally generate the corresponding so and jar files. Then, you can call the SDK to perform data reading operations as follows (taking Java as an example):

// Create and open the Reader
StarRocksReader srReader = new StarRocksReader(...);
srReader.open();

// Read data iteratively, which organized in Arrow format
while (reader.hasNext) {
    VectorSchemaRoot vsr = reader.next();
    // consume vsr object
}

// Close and release the Reader
reader.close();
reader.release();

Fixes #52682

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.4
    • 3.3
    • 3.2
    • 3.1
    • 3.0

@mergify mergify bot assigned plotor Dec 28, 2024
@plotor plotor force-pushed the zhenchao-bypass-format-reader-20241219 branch from 2f0ec23 to ab97aef Compare December 31, 2024 03:07
@plotor plotor force-pushed the zhenchao-bypass-format-reader-20241219 branch 2 times, most recently from 426bd5d to bb7921b Compare December 31, 2024 10:57
@plotor plotor force-pushed the zhenchao-bypass-format-reader-20241219 branch from bb7921b to 0ec5ecf Compare December 31, 2024 12:05
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Supports reading and writing data files bypass BE Server
1 participant