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 the Arrow Flight SQL protocol to enhance data transfer efficiency #50199

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

liubotao
Copy link
Contributor

@liubotao liubotao commented Aug 23, 2024

Why I'm doing:

Significantly enhance data transfer efficiency when using StarRocks for data science computations.

What I'm doing:

This PR adds support for Apache Arrow Flight SQL to StarRocks. Arrow Flight is a high-performance remote procedure call (RPC) framework specifically designed for large-scale data set transmission. By integrating Arrow Flight SQL, StarRocks can achieve more efficient data transfer and query execution, with expected data transfer speed improvements of up to 10 to 100 times. Additionally, StarRocks' Arrow Flight SQL service supports connections through the Python ADBC (Arrow Database Connectivity) standard interface and JDBC (Java Database Connectivity) drivers. This allows significant acceleration of queries and data transfers without needing to modify existing SQL statements, thereby greatly enhancing data analysis performance and user experience

Fix: #50285

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.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@liubotao liubotao requested review from a team as code owners August 23, 2024 08:50
@wanpengfei-git wanpengfei-git requested a review from a team August 23, 2024 08:50
@liubotao liubotao changed the title starrocks support arrow flight sql [Feature] Supports the Arrow Flight SQL protocol to enhance data transfer efficiency Aug 23, 2024
@kangkaisen
Copy link
Collaborator

would better give the performance report

@alvin-celerdata
Copy link
Contributor

@liubotao
Thank you very much for your contribution. However this change is super large, to make everyone on the same page, could you create a feature request GitHub Issue to track this feature? And you should give the design details in that ticket to let others know how this feature works.

@liubotao
Copy link
Contributor Author

@liubotao Thank you very much for your contribution. However this change is super large, to make everyone on the same page, could you create a feature request GitHub Issue to track this feature? And you should give the design details in that ticket to let others know how this feature works.

Related Issue:#50285

@liubotao liubotao changed the title [Feature] Supports the Arrow Flight SQL protocol to enhance data transfer efficiency [Feature] Support the Arrow Flight SQL protocol to enhance data transfer efficiency Aug 27, 2024
@liubotao liubotao requested review from a team as code owners September 13, 2024 05:57
@liubotao liubotao requested review from a team as code owners September 13, 2024 05:57
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 13, 2024
@wanpengfei-git wanpengfei-git removed the request for review from a team September 13, 2024 05:58
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Sep 13, 2024
@wanpengfei-git wanpengfei-git requested a review from a team September 13, 2024 06:09
Copy link

[BE Incremental Coverage Report]

fail : 0 / 130 (00.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/util/uid_util.cpp 0 14 00.00% [96, 97, 99, 100, 102, 106, 107, 109, 110, 111, 112, 114, 115, 116]
🔵 be/src/runtime/arrow_result_writer.cpp 0 39 00.00% [37, 38, 39, 41, 42, 43, 44, 47, 48, 50, 52, 55, 56, 57, 58, 59, 60, 62, 63, 66, 67, 68, 71, 72, 73, 75, 76, 77, 79, 80, 83, 84, 85, 86, 87, 88, 89, 90, 93]
🔵 be/src/runtime/result_sink.h 0 1 00.00% [84]
🔵 be/src/service/internal_service.cpp 0 14 00.00% [887, 890, 891, 892, 893, 894, 895, 897, 899, 900, 901, 902, 904, 905]
🔵 be/src/exec/pipeline/result_sink_operator.h 0 5 00.00% [45, 46, 107, 108, 120]
🔵 be/src/exec/pipeline/result_sink_operator.cpp 0 3 00.00% [65, 66, 67]
🔵 be/src/runtime/result_sink.cpp 0 1 00.00% [57]
🔵 be/src/exec/data_sink.cpp 0 2 00.00% [280, 281]
🔵 be/src/runtime/result_buffer_mgr.cpp 0 15 00.00% [121, 122, 123, 124, 126, 127, 128, 130, 131, 132, 134, 135, 136, 137, 139]
🔵 be/src/runtime/buffer_control_block.cpp 0 29 00.00% [137, 138, 139, 140, 143, 144, 146, 147, 177, 178, 179, 311, 312, 313, 314, 316, 317, 320, 321, 324, 325, 328, 329, 330, 331, 334, 335, 338, 339]
🔵 be/src/util/arrow/row_batch.cpp 0 7 00.00% [224, 225, 226, 227, 230, 231, 232]

Copy link

[FE Incremental Coverage Report]

fail : 72 / 553 (13.02%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/service/arrow/flight/sql/ArrowFlightSqlConnectContext.java 0 68 00.00% [65, 66, 67, 68, 69, 70, 73, 77, 78, 81, 85, 86, 89, 93, 94, 97, 101, 102, 105, 106, 109, 113, 117, 118, 121, 125, 126, 129, 130, 133, 137, 138, 141, 145, 146, 149, 153, 154, 158, 159, 160, 162, 163, 165, 166, 168, 171, 172, 173, 174, 175, 177, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 192, 197, 198, 199]
🔵 com/starrocks/common/util/ArrowUtil.java 0 10 00.00% [31, 32, 36, 38, 39, 41, 42, 44, 45, 47]
🔵 com/starrocks/encryption/EncryptionUtil.java 0 56 00.00% [66, 67, 70, 71, 72, 74, 75, 77, 78, 79, 81, 82, 83, 84, 85, 87, 89, 90, 91, 92, 94, 96, 100, 101, 102, 105, 106, 107, 111, 112, 115, 116, 117, 118, 121, 122, 123, 124, 126, 127, 129, 131, 132, 134, 135, 136, 139, 140, 142, 146, 147, 148, 150, 151, 152, 155]
🔵 com/starrocks/service/arrow/flight/sql/ArrowFlightSqlConnectProcessor.java 0 59 00.00% [48, 51, 52, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 71, 72, 73, 76, 77, 78, 80, 81, 82, 83, 84, 85, 87, 88, 91, 92, 93, 95, 97, 100, 103, 104, 105, 109, 110, 111, 112, 113, 114, 115, 116, 119, 120, 121, 122, 125, 127, 128, 129, 130, 131, 133, 134]
🔵 com/starrocks/StarRocksFE.java 0 2 00.00% [170, 178]
🔵 com/starrocks/qe/DefaultCoordinator.java 0 1 00.00% [1302]
🔵 com/starrocks/service/arrow/flight/sql/auth/ArrowFlightSqlCredentialValidator.java 0 14 00.00% [30, 31, 32, 36, 37, 38, 39, 40, 43, 44, 48, 51, 56, 58]
🔵 com/starrocks/service/arrow/flight/sql/session/ArrowFlightSqlTokenInfo.java 0 7 00.00% [22, 29, 33, 34, 37, 41, 42]
🔵 com/starrocks/qe/ResultReceiver.java 0 1 00.00% [169]
🔵 com/starrocks/service/arrow/flight/sql/ArrowFlightSqlServiceImpl.java 18 160 11.25% [98, 100, 101, 103, 104, 109, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 125, 127, 128, 134, 135, 140, 141, 142, 149, 150, 151, 152, 153, 155, 161, 167, 168, 173, 174, 179, 186, 188, 189, 191, 192, 193, 194, 196, 197, 198, 199, 200, 201, 208, 209, 215, 221, 222, 227, 233, 239, 244, 250, 256, 262, 263, 264, 266, 272, 278, 283, 289, 295, 301, 307, 313, 319, 325, 331, 336, 337, 341, 345, 346, 347, 348, 351, 353, 354, 355, 356, 362, 363, 364, 365, 366, 367, 369, 371, 376, 377, 378, 379, 381, 383, 385, 386, 389, 390, 392, 393, 394, 396, 399, 400, 401, 403, 404, 405, 407, 409, 412, 414, 416, 417, 418, 419, 420, 421, 423, 430, 431, 432, 435, 436, 437, 441, 442, 444, 445, 446, 451, 452, 453]
🔵 com/starrocks/service/arrow/flight/sql/session/ArrowFlightSqlSessionManager.java 3 27 11.11% [38, 39, 41, 43, 44, 45, 46, 48, 49, 50, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 72]
🔵 com/starrocks/service/arrow/flight/sql/auth/ArrowFlightSqlAuthenticator.java 4 22 18.18% [39, 40, 41, 44, 46, 47, 50, 53, 58, 59, 60, 62, 63, 64, 69, 72, 77, 79]
🔵 com/starrocks/service/arrow/flight/sql/session/ArrowFlightSqlTokenManager.java 10 33 30.30% [49, 50, 51, 52, 54, 58, 64, 65, 66, 67, 68, 69, 70, 74, 75, 79, 80, 81, 82, 87, 88, 92, 93]
🔵 com/starrocks/qe/StmtExecutor.java 14 42 33.33% [848, 849, 1187, 1188, 1189, 1190, 1191, 1243, 1246, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1690, 1691, 1692, 2311, 2312, 2363, 2364, 2397]
🔵 com/starrocks/qe/ConnectScheduler.java 3 8 37.50% [174, 175, 201, 202, 218]
🔵 com/starrocks/service/arrow/flight/sql/ArrowFlightSqlService.java 16 38 42.11% [64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 76, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89]
🔵 com/starrocks/sql/StatementPlanner.java 1 2 50.00% [101]
🔵 com/starrocks/common/Config.java 3 3 100.00% []

Copy link

sonarcloud bot commented Sep 19, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)
D Security Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

[Java-Extensions 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]StarRocks Supports the Arrow Flight SQL protocol to enhance data transfer efficiency
4 participants