yjhjstz commented on code in PR #1440:
URL: https://github.com/apache/cloudberry/pull/1440#discussion_r2540113054
##########
contrib/pax_storage/src/cpp/access/pax_access_handle.cc:
##########
@@ -64,6 +65,111 @@
// access methods that are implemented in C++
namespace pax {
+struct AnalyzeBlockItem {
+ int block;
+ int row_count;
+ int64 start_sample_block;
+ int64 end_sample_block;
+};
+
+static std::vector<AnalyzeBlockItem> extract_micro_partitions(Relation rel,
Snapshot snapshot, int64 *totalrows) {
+ auto iter = pax::MicroPartitionIterator::New(rel, snapshot);
+ std::vector<AnalyzeBlockItem> analyze_items;
+ int64 ntuples = 0;
+ while (iter->HasNext()) {
+ auto mp = iter->Next();
+ AnalyzeBlockItem item;
+ item.block = mp.GetMicroPartitionId();
+ item.row_count = mp.GetTupleCount();
+ Assert(item.row_count > 0);
+
+ ntuples += item.row_count;
+ analyze_items.emplace_back(item);
+ }
+ iter->Release();
+ *totalrows = ntuples;
+
+ std::sort(analyze_items.begin(), analyze_items.end(),
+ [](const AnalyzeBlockItem &a, const AnalyzeBlockItem &b) {
+ return a.block < b.block;
+ });
+ return analyze_items;
Review Comment:
analyze_items pushed all the tuples ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]