Skip to content

Commit

Permalink
Use Cast() instaed of CastTo
Browse files Browse the repository at this point in the history
  • Loading branch information
llama90 committed Dec 14, 2023
1 parent dbed728 commit e54044e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions c_glib/arrow-glib/scalar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <arrow-glib/interval.hpp>
#include <arrow-glib/scalar.hpp>

#include <arrow/compute/cast.h>

G_BEGIN_DECLS

/**
Expand Down Expand Up @@ -385,9 +387,9 @@ garrow_scalar_cast(GArrowScalar *scalar,
{
const auto arrow_scalar = garrow_scalar_get_raw(scalar);
const auto arrow_data_type = garrow_data_type_get_raw(data_type);
auto arrow_casted_scalar_result = arrow_scalar->CastTo(arrow_data_type);
auto arrow_casted_scalar_result = arrow::compute::Cast(*arrow_scalar, arrow_data_type);
if (garrow::check(error, arrow_casted_scalar_result, "[scalar][cast]")) {
auto arrow_casted_scalar = *arrow_casted_scalar_result;
auto arrow_casted_scalar = (*arrow_casted_scalar_result).scalar();
return garrow_scalar_new_raw(&arrow_casted_scalar,
"scalar", &arrow_casted_scalar,
"data-type", data_type,
Expand Down

0 comments on commit e54044e

Please sign in to comment.