@@ -35,6 +35,10 @@ class AggregationHook : public ValueHook {
3535 static constexpr Kind kFloatMin = 8 ;
3636 static constexpr Kind kDoubleMax = 9 ;
3737 static constexpr Kind kDoubleMin = 10 ;
38+ static constexpr Kind kShortDecimalMax = 11 ;
39+ static constexpr Kind kShortDecimalMin = 12 ;
40+ static constexpr Kind kLongDecimalMax = 13 ;
41+ static constexpr Kind kLongDecimalMin = 14 ;
3842
3943 // Make null behavior known at compile time. This is useful when
4044 // templating a column decoding loop with a hook.
@@ -53,6 +57,12 @@ class AggregationHook : public ValueHook {
5357 groups_(groups),
5458 numNulls_(numNulls) {}
5559
60+ std::string toString () const override {
61+ char buf[256 ];
62+ sprintf (buf, " AggregationHook kind:%d" , (int )kind ());
63+ return buf;
64+ }
65+
5666 bool acceptsNulls () const override final {
5767 return false ;
5868 }
@@ -119,6 +129,17 @@ class SumHook final : public AggregationHook {
119129 uint64_t * numNulls)
120130 : AggregationHook(offset, nullByte, nullMask, groups, numNulls) {}
121131
132+ std::string toString () const override {
133+ char buf[256 ];
134+ sprintf (
135+ buf,
136+ " SumHook kind:%d TValue:%s TAggregate:%s" ,
137+ (int )kind (),
138+ typeid (TValue).name (),
139+ typeid (TAggregate).name ());
140+ return buf;
141+ }
142+
122143 Kind kind () const override {
123144 if (std::is_same_v<TAggregate, double >) {
124145 if (std::is_same_v<TValue, double >) {
@@ -160,6 +181,18 @@ class SimpleCallableHook final : public AggregationHook {
160181 : AggregationHook(offset, nullByte, nullMask, groups, numNulls),
161182 updateSingleValue_ (updateSingleValue) {}
162183
184+ std::string toString () const override {
185+ char buf[256 ];
186+ sprintf (
187+ buf,
188+ " SimpleCallableHook kind:%d TValue:%s TAggregate:%s UpdateSingleValue:%s" ,
189+ (int )kind (),
190+ typeid (TValue).name (),
191+ typeid (TAggregate).name (),
192+ typeid (UpdateSingleValue).name ());
193+ return buf;
194+ }
195+
163196 Kind kind () const override {
164197 return kGeneric ;
165198 }
@@ -187,6 +220,17 @@ class MinMaxHook final : public AggregationHook {
187220 uint64_t * numNulls)
188221 : AggregationHook(offset, nullByte, nullMask, groups, numNulls) {}
189222
223+ std::string toString () const override {
224+ char buf[256 ];
225+ sprintf (
226+ buf,
227+ " MinMaxHook kind:%d T:%s isMin:%d" ,
228+ (int )kind (),
229+ typeid (T).name (),
230+ (int )isMin);
231+ return buf;
232+ }
233+
190234 Kind kind () const override {
191235 if (isMin) {
192236 if (std::is_same_v<T, int64_t >) {
@@ -198,6 +242,12 @@ class MinMaxHook final : public AggregationHook {
198242 if (std::is_same_v<T, double >) {
199243 return kDoubleMin ;
200244 }
245+ if (std::is_same_v<T, int64_t >) {
246+ return kShortDecimalMin ;
247+ }
248+ if (std::is_same_v<T, int128_t >) {
249+ return kLongDecimalMin ;
250+ }
201251 } else {
202252 if (std::is_same_v<T, int64_t >) {
203253 return kBigintMax ;
@@ -208,6 +258,12 @@ class MinMaxHook final : public AggregationHook {
208258 if (std::is_same_v<T, double >) {
209259 return kDoubleMax ;
210260 }
261+ if (std::is_same_v<T, int64_t >) {
262+ return kShortDecimalMax ;
263+ }
264+ if (std::is_same_v<T, int128_t >) {
265+ return kLongDecimalMax ;
266+ }
211267 }
212268 return kGeneric ;
213269 }
0 commit comments