           }
           break;
         default: // To eliminate error for unhandled enumerant N_GDF_AGG_OPS
-          return GDF_INVALID_API_CALL;
+          gdf_error_code = GDF_INVALID_API_CALL;
         }
 
       if( out_col_values )

#include "sqls_rtti_comp.hpp"
#include "groupby/groupby.cuh"
#include "groupby/hash/aggregation_operations.cuh"

//using IndexT = int;//okay...
using IndexT = size_t;

    }
    return GDF_SUCCESS;
  }

  gdf_error gdf_error_code{GDF_SUCCESS};
  
  PUSH_RANGE("LIBGDF_GROUPBY", GROUPBY_COLOR);
  
  if( ctxt->flag_method == GDF_SORT )
    {
