@@ -154,6 +154,23 @@ GPUPhysicalMaterializedCollector::FinalMaterialize(GPUIntermediateRelation input
154154 case GPUColumnTypeId::VARCHAR :
155155 FinalMaterializeString (input_relation, output_relation, col);
156156 break ;
157+ case GPUColumnTypeId::DECIMAL : {
158+ switch (input_relation.columns [col]->data_wrapper .getColumnTypeSize ()) {
159+ case sizeof (int32_t ): {
160+ FinalMaterializeInternal<int32_t >(input_relation, output_relation, col);
161+ size_bytes = output_relation.columns [col]->column_length * sizeof (int32_t );
162+ break ;
163+ }
164+ case sizeof (int64_t ): {
165+ FinalMaterializeInternal<int64_t >(input_relation, output_relation, col);
166+ size_bytes = output_relation.columns [col]->column_length * sizeof (int64_t );
167+ break ;
168+ }
169+ throw NotImplementedException (" Unsupported sirius DECIMAL column type size in `FinalMaterialize`: %zu" ,
170+ input_relation.columns [col]->data_wrapper .getColumnTypeSize ());
171+ }
172+ break ;
173+ }
157174 default :
158175 throw NotImplementedException (" Unsupported sirius column type in `FinalMaterialize`: %d" ,
159176 static_cast <int >(input_relation.columns [col]->data_wrapper .type .id ()));
@@ -181,6 +198,13 @@ LogicalType ColumnTypeToLogicalType(const GPUColumnType& type) {
181198 return LogicalType::VARCHAR ;
182199 case GPUColumnTypeId::INT128 :
183200 return LogicalType::HUGEINT ;
201+ case GPUColumnTypeId::DECIMAL : {
202+ GPUDecimalTypeInfo* decimal_type_info = type.GetDecimalTypeInfo ();
203+ if (decimal_type_info == nullptr ) {
204+ throw InternalException (" `decimal_type_info` not set for DECIMAL type in `ColumnTypeToLogicalType`" );
205+ }
206+ return LogicalType::DECIMAL (decimal_type_info->width_ , decimal_type_info->scale_ );
207+ }
184208 default :
185209 throw NotImplementedException (" Unsupported sirius column type in `ColumnTypeToLogicalType`: %d" ,
186210 static_cast <int >(type.id ()));
@@ -203,6 +227,14 @@ Vector rawDataToVector(uint8_t* host_data, size_t vector_offset, const GPUColumn
203227 sizeof_type = sizeof (uint8_t ); break ;
204228 case GPUColumnTypeId::INT128 :
205229 sizeof_type = 2 * sizeof (uint64_t ); break ;
230+ case GPUColumnTypeId::DECIMAL : {
231+ GPUDecimalTypeInfo* decimal_type_info = type.GetDecimalTypeInfo ();
232+ if (decimal_type_info == nullptr ) {
233+ throw InternalException (" `decimal_type_info` not set for DECIMAL type in `rawDataToVector`" );
234+ }
235+ sizeof_type = decimal_type_info->GetDecimalTypeSize ();
236+ break ;
237+ }
206238 default :
207239 throw NotImplementedException (" Unsupported sirius column type in `rawDataToVector`: %d" ,
208240 static_cast <int >(type.id ()));
0 commit comments