For convenience, callers may wrap instances in a StreamOf<std::tuple<...>> object, which will automatically parse each Row into a std::tuple with the specified types.
Example:
namespace spanner =::google::cloud::spanner; spanner::SqlStatement select( "SELECT AlbumId, AlbumTitle, MarketingBudget" " FROM Albums" " WHERE AlbumTitle >= 'Aardvark' AND AlbumTitle < 'Goo'"); auto profile_query_result = client.ProfileQuery(std::move(select)); for(auto& row : profile_query_result){ if(!row)throw std::move(row).status(); // Discard rows for brevity in this example. }
// Stats are only available after all rows from the result have been read. auto execution_stats = profile_query_result.ExecutionStats(); if(execution_stats){ for(autoconst& stat :*execution_stats){ std::cout << stat.first <<":\t"<< stat.second <<"\n"; } }
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-23 UTC."],[[["This document outlines the `ProfileQueryResult` class, which represents the stream of rows and profile statistics returned from a `spanner::Client::ProfileQuery()`."],["The `ProfileQueryResult` can be iterated over directly to access a sequence of `StatusOr\u003cRow\u003e` objects, with `begin()` and `end()` functions returning a `RowStreamIterator` to define the result set's boundaries."],["After all rows are read, execution statistics are accessible through the `ExecutionStats()` function, and the `ExecutionPlan()` function reveals the SQL statement's execution strategy."],["The `ReadTimestamp()` method provides the timestamp of the read operation, but it's only available when using a read-only transaction."],["The content provides links to historical versions ranging from version 2.11.0 to the latest release candidate version 2.37.0-rc, all related to `ProfileQueryResult`."]]],[]]