Skip to content

feat(spanner): add option for DataBoost#5447

Open
olavloite wants to merge 3 commits intogoogleapis:mainfrom
olavloite:spanner-data-boost
Open

feat(spanner): add option for DataBoost#5447
olavloite wants to merge 3 commits intogoogleapis:mainfrom
olavloite:spanner-data-boost

Conversation

@olavloite
Copy link
Copy Markdown
Contributor

Adds an option to use DataBoost with partitioned queries and partitioned reads.

@olavloite olavloite requested review from a team as code owners April 17, 2026 10:09
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Apr 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.73%. Comparing base (6da623f) to head (8783dd1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5447      +/-   ##
==========================================
- Coverage   97.73%   97.73%   -0.01%     
==========================================
  Files         217      217              
  Lines       48186    48243      +57     
==========================================
+ Hits        47096    47151      +55     
- Misses       1090     1092       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Adds an option to use DataBoost with partitioned queries and partitioned reads.
@olavloite olavloite force-pushed the spanner-data-boost branch from 890f875 to 992138e Compare April 17, 2026 10:21
/// // On a worker receiving a partition, execute it with Data Boost:
/// let options = PartitionExecuteOptions::default()
/// .with_data_boost(true);
/// let mut result_set = partitions[0].execute(&db_client, options).await?;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We tend to use builders so applications don't have to supply default options everywhere.

Maybe like p.execute(&db_client).set_data_boost(true).send().await

Thoughts?

Copy link
Copy Markdown
Contributor Author

@olavloite olavloite Apr 20, 2026

Choose a reason for hiding this comment

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

Fair point. However, our other execute(..) methods all really execute the statement, and I would prefer this method to be consistent with that pattern. So I've changed this so that Partition has a with_data_boost method (and could also hold more options in the future if needed). The call then looks like this:

    let mut result_set = partitions[0].clone()
        .with_data_boost(true)
        .execute(&db_client)
        .await?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants