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-03-21 UTC."],[[["This webpage details the `ProfileQueryResult` class within the Google Cloud Spanner C++ library, showcasing the class's role in handling the stream of rows and profile statistics resulting from a `spanner::Client::ProfileQuery()` call."],["The `ProfileQueryResult` class allows iteration through a sequence of `StatusOr\u003cRow\u003e` objects, and it can be wrapped in a `StreamOf\u003cstd::tuple\u003c...\u003e\u003e` object for streamlined parsing into `std::tuple` types."],["The class offers methods like `begin()` and `end()` to define the range of the result set, with `RowStreamIterator` instances controlling the iteration process."],["It provides functions to access metadata like the `ReadTimestamp()`, `ExecutionStats()`, and `ExecutionPlan()`, all of which provide valuable insight into the query's execution."],["The page gives a list of versions of this `ProfileQueryResult` and corresponding documentation starting from `2.37.0-rc` to `2.11.0`."]]],[]]