@@ -305,11 +305,14 @@ HandleGroupByAggregateCuDF(vector<shared_ptr<GPUColumn>> &group_by_keys, vector<
305305 agg_mode[agg_idx] = AggregationType::SUM ;
306306 } else if (expr.function .name .compare (" sum_no_overflow" ) == 0 && aggregate_keys[agg_idx]->data_wrapper .data != nullptr ) {
307307 agg_mode[agg_idx] = AggregationType::SUM ;
308- uint64_t * temp = gpuBufferManager->customCudaMalloc <uint64_t >(aggregate_keys[agg_idx]->column_length , 0 , 0 );
309- convertInt32ToInt64 (aggregate_keys[agg_idx]->data_wrapper .data , reinterpret_cast <uint8_t *>(temp), aggregate_keys[agg_idx]->column_length );
310- aggregate_keys[agg_idx]->data_wrapper .data = reinterpret_cast <uint8_t *>(temp);
311- aggregate_keys[agg_idx]->data_wrapper .type = ColumnType::INT64 ;
312- aggregate_keys[agg_idx]->data_wrapper .num_bytes = aggregate_keys[agg_idx]->data_wrapper .num_bytes * 2 ;
308+ if (aggregate_keys[agg_idx]->data_wrapper .type .id () == GPUColumnTypeId::INT32 ) {
309+ SIRIUS_LOG_DEBUG (" Converting INT32 to INT64 for sum_no_overflow" );
310+ uint64_t * temp = gpuBufferManager->customCudaMalloc <uint64_t >(aggregate_keys[agg_idx]->column_length , 0 , 0 );
311+ convertInt32ToInt64 (aggregate_keys[agg_idx]->data_wrapper .data , reinterpret_cast <uint8_t *>(temp), aggregate_keys[agg_idx]->column_length );
312+ aggregate_keys[agg_idx]->data_wrapper .data = reinterpret_cast <uint8_t *>(temp);
313+ aggregate_keys[agg_idx]->data_wrapper .type = GPUColumnType (GPUColumnTypeId::INT64 );
314+ aggregate_keys[agg_idx]->data_wrapper .num_bytes = aggregate_keys[agg_idx]->data_wrapper .num_bytes * 2 ;
315+ }
313316 } else if (expr.function .name .compare (" avg" ) == 0 && aggregate_keys[agg_idx]->data_wrapper .data != nullptr ) {
314317 agg_mode[agg_idx] = AggregationType::AVERAGE ;
315318 } else if (expr.function .name .compare (" max" ) == 0 && aggregate_keys[agg_idx]->data_wrapper .data != nullptr ) {
0 commit comments