goel-skd commented on code in PR #50347:
URL: https://github.com/apache/arrow/pull/50347#discussion_r3649442098
##########
cpp/src/arrow/scalar.cc:
##########
@@ -770,54 +770,56 @@
DictionaryScalar::DictionaryScalar(std::shared_ptr<DataType> type)
0)
.ValueOrDie()} {}
+namespace {
+
+struct DictionaryIndexValueImpl {
+ int64_t value = 0;
+
+ Status Visit(const Scalar&) {
+ return Status::TypeError("Not implemented dictionary index type");
+ }
+
+ template <typename ScalarType, typename Type = typename
ScalarType::TypeClass>
+ enable_if_integer<Type, Status> Visit(const ScalarType& scalar) {
+ value = static_cast<int64_t>(scalar.value);
+ return Status::OK();
+ }
+};
+
+Result<int64_t> DictionaryIndexValue(const Scalar& index) {
+ DictionaryIndexValueImpl impl;
+ RETURN_NOT_OK(VisitScalarInline(index, &impl));
Review Comment:
Tracking this via GH-50595, which I've picked up. VisitIntegerType should
cover the DictionaryIndexValue rewrite here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]