@@ -67,4 +67,57 @@ std::shared_ptr<arrow::Table> ResultSetTableToken::toArrow() const {
67
67
return res;
68
68
}
69
69
70
+ std::string ResultSetTableToken::description () const {
71
+ auto first_rs = resultSet (0 );
72
+ auto last_rs = resultSet (resultSetCount () - 1 );
73
+ size_t total_entries = first_rs->entryCount ();
74
+ for (size_t rs_idx = 1 ; rs_idx < resultSetCount (); ++rs_idx) {
75
+ total_entries += resultSet (rs_idx)->entryCount ();
76
+ }
77
+ std::ostringstream oss;
78
+ oss << " Result Set Table Info" << std::endl;
79
+ oss << " \t Fragments: " << resultSetCount () << std::endl;
80
+ oss << " \t Layout: " << first_rs->getQueryMemDesc ().queryDescTypeToString () << std::endl;
81
+ oss << " \t Columns: " << first_rs->colCount () << std::endl;
82
+ oss << " \t Rows: " << rowCount () << std::endl;
83
+ oss << " \t Entry count: " << total_entries << std::endl;
84
+ const std::string did_output_columnar =
85
+ first_rs->didOutputColumnar () ? " True" : " False;" ;
86
+ oss << " \t Columnar: " << did_output_columnar << std::endl;
87
+ oss << " \t Lazy-fetched columns: " << first_rs->getNumColumnsLazyFetched () << std::endl;
88
+ const std::string is_direct_columnar_conversion_possible =
89
+ first_rs->isDirectColumnarConversionPossible () ? " True" : " False" ;
90
+ oss << " \t Direct columnar conversion possible: "
91
+ << is_direct_columnar_conversion_possible << std::endl;
92
+
93
+ size_t num_columns_zero_copy_columnarizable{0 };
94
+ for (size_t col_idx = 0 ; col_idx < first_rs->colCount (); col_idx++) {
95
+ if (first_rs->isZeroCopyColumnarConversionPossible (col_idx)) {
96
+ num_columns_zero_copy_columnarizable++;
97
+ }
98
+ }
99
+ oss << " \t Zero-copy columnar conversion columns: "
100
+ << num_columns_zero_copy_columnarizable << std::endl;
101
+
102
+ oss << " \t Has permutation: "
103
+ << (first_rs->isPermutationBufferEmpty () ? " False" : " True" ) << std::endl;
104
+ auto limit =
105
+ last_rs->getLimit () ? row_count_ - last_rs->rowCount () + last_rs->getLimit () : 0 ;
106
+ oss << " \t Limit: " << limit << std::endl;
107
+ oss << " \t Offset: " << first_rs->getOffset () << std::endl;
108
+ return oss.str ();
109
+ }
110
+
111
+ std::string ResultSetTableToken::memoryDescription () const {
112
+ return resultSet (0 )->toString ();
113
+ }
114
+
115
+ std::string ResultSetTableToken::contentToString (bool header) const {
116
+ std::string res = resultSet (0 )->contentToString (header);
117
+ for (size_t rs_idx = 1 ; rs_idx < resultSetCount (); ++rs_idx) {
118
+ res += resultSet (rs_idx)->contentToString (false );
119
+ }
120
+ return res;
121
+ }
122
+
70
123
} // namespace hdk
0 commit comments