diff --git a/cpp/src/arrow/compute/cast.cc b/cpp/src/arrow/compute/cast.cc index 8a091f2355d..5e48b896d86 100644 --- a/cpp/src/arrow/compute/cast.cc +++ b/cpp/src/arrow/compute/cast.cc @@ -55,6 +55,7 @@ void InitCastTable() { AddCastFunctions(GetNestedCasts()); AddCastFunctions(GetNumericCasts()); AddCastFunctions(GetTemporalCasts()); + AddCastFunctions(GetDictionaryCasts()); } void EnsureInitCastTable() { std::call_once(cast_table_initialized, InitCastTable); } diff --git a/cpp/src/arrow/compute/cast_internal.h b/cpp/src/arrow/compute/cast_internal.h index c152d10bd86..0105d08a573 100644 --- a/cpp/src/arrow/compute/cast_internal.h +++ b/cpp/src/arrow/compute/cast_internal.h @@ -36,6 +36,7 @@ std::vector> GetNumericCasts(); std::vector> GetTemporalCasts(); std::vector> GetBinaryLikeCasts(); std::vector> GetNestedCasts(); +std::vector> GetDictionaryCasts(); } // namespace internal } // namespace compute diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_dictionary.cc b/cpp/src/arrow/compute/kernels/scalar_cast_dictionary.cc new file mode 100644 index 00000000000..e58ba57e75b --- /dev/null +++ b/cpp/src/arrow/compute/kernels/scalar_cast_dictionary.cc @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Implementation of casting to dictionary type + +#include "arrow/array/builder_primitive.h" +#include "arrow/compute/kernels/common.h" +#include "arrow/compute/kernels/scalar_cast_internal.h" +#include "arrow/compute/kernels/util_internal.h" +#include "arrow/util/int_util.h" + +namespace arrow { + +using internal::CheckIntegersInRange; + +namespace compute { +namespace internal + +Status CastDictionaryIndices(KernelContext* ctx, const ExecBatch& batch, Datum* out) { +return Status::OK(); +} + +} // namespace internal +} // namespace compute +} // namespace arrow