@@ -90,12 +90,12 @@ GPUColumn::convertToCudfColumn() {
9090 return column;
9191 } else if (data_wrapper.type .id () == GPUColumnTypeId::VARCHAR ) {
9292 // convert offset to int32
93- int32_t * new_offset = convertSiriusOffsetToCudfOffset ();
93+ // int32_t* new_offset = convertSiriusOffsetToCudfOffset();
9494
9595 auto offsets_col = cudf::column_view (
96- cudf::data_type{cudf::type_id::INT32 },
96+ cudf::data_type{cudf::type_id::INT64 },
9797 size + 1 ,
98- reinterpret_cast <void *>(new_offset ),
98+ reinterpret_cast <void *>(data_wrapper. offset ),
9999 nullptr ,
100100 0
101101 );
@@ -132,16 +132,28 @@ GPUColumn::setFromCudfColumn(cudf::column& cudf_column, bool _is_unique, int32_t
132132 is_unique = _is_unique;
133133 // add data to allocation table in gpu buffer manager
134134 if (col_type == cudf::data_type (cudf::type_id::STRING )) {
135- cudf::column::contents child_cont = cont.children [0 ]->release ();
136- gpuBufferManager->rmm_stored_buffers .push_back (std::move (child_cont.data ));
137- data_wrapper.is_string_data = true ;
138- data_wrapper.type = GPUColumnType (GPUColumnTypeId::VARCHAR );
139- int32_t * temp_offset = reinterpret_cast <int32_t *>(gpuBufferManager->rmm_stored_buffers .back ()->data ());
140- convertCudfOffsetToSiriusOffset (temp_offset);
141- // copy data from offset to num_bytes
142- uint64_t * temp_num_bytes = gpuBufferManager->customCudaHostAlloc <uint64_t >(1 );
143- callCudaMemcpyDeviceToHost<uint64_t >(temp_num_bytes, data_wrapper.offset + column_length, 1 , 0 );
144- data_wrapper.num_bytes = temp_num_bytes[0 ];
135+ if (cont.children [0 ]->type ().id () == cudf::type_id::INT32 ) {
136+ cudf::column::contents child_cont = cont.children [0 ]->release ();
137+ gpuBufferManager->rmm_stored_buffers .push_back (std::move (child_cont.data ));
138+ data_wrapper.is_string_data = true ;
139+ data_wrapper.type = GPUColumnType (GPUColumnTypeId::VARCHAR );
140+ int32_t * temp_offset = reinterpret_cast <int32_t *>(gpuBufferManager->rmm_stored_buffers .back ()->data ());
141+ convertCudfOffsetToSiriusOffset (temp_offset);
142+ // copy data from offset to num_bytes
143+ uint64_t * temp_num_bytes = gpuBufferManager->customCudaHostAlloc <uint64_t >(1 );
144+ callCudaMemcpyDeviceToHost<uint64_t >(temp_num_bytes, data_wrapper.offset + column_length, 1 , 0 );
145+ data_wrapper.num_bytes = temp_num_bytes[0 ];
146+ } else if (cont.children [0 ]->type ().id () == cudf::type_id::INT64 ) {
147+ cudf::column::contents child_cont = cont.children [0 ]->release ();
148+ gpuBufferManager->rmm_stored_buffers .push_back (std::move (child_cont.data ));
149+ data_wrapper.is_string_data = true ;
150+ data_wrapper.type = GPUColumnType (GPUColumnTypeId::VARCHAR );
151+ data_wrapper.offset = reinterpret_cast <uint64_t *>(gpuBufferManager->rmm_stored_buffers .back ()->data ());
152+ // copy data from offset to num_bytes
153+ uint64_t * temp_num_bytes = gpuBufferManager->customCudaHostAlloc <uint64_t >(1 );
154+ callCudaMemcpyDeviceToHost<uint64_t >(temp_num_bytes, data_wrapper.offset + column_length, 1 , 0 );
155+ data_wrapper.num_bytes = temp_num_bytes[0 ];
156+ }
145157 } else if (col_type == cudf::data_type (cudf::type_id::UINT64 )) {
146158 data_wrapper.is_string_data = false ;
147159 data_wrapper.type = GPUColumnType (GPUColumnTypeId::INT64 );
0 commit comments