[
https://issues.apache.org/jira/browse/ARROW-13381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17383446#comment-17383446
]
Eduardo Ponce edited comment on ARROW-13381 at 7/19/21, 4:47 PM:
-----------------------------------------------------------------
The error occurs because there is no floating-point case for dict converter in
[*ipc/json_simple.cc*|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L779-L798].
Nevertheless, there exists an implementation for [floating-point
converters|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L273-L295].
The code path is as follows: *Call to ArrayFromJSON(...)* ->
[ArrayFromJSON(DataType,
string_view)|https://github.com/apache/arrow/blob/master/cpp/src/arrow/testing/gtest_util.cc#L406]
-> [ArrayFromJSON(DataType, string_view,
Array)|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L870]
-> [GetConverter(DataType,
Converter)|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L808]
->
[GetDictConverter|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L763]
was (Author: edponce):
The error occurs because there is no dict converter implemented for
floating-point types in
[*ipc/json_simple.cc*|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L779-L798].
The code path is as follows: *Call to ArrayFromJSON(...)* ->
[ArrayFromJSON(DataType,
string_view)|https://github.com/apache/arrow/blob/master/cpp/src/arrow/testing/gtest_util.cc#L406]
-> [ArrayFromJSON(DataType, string_view,
Array)|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L870]
-> [GetConverter(DataType,
Converter)|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L808]
->
[GetDictConverter|https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple.cc#L763]
> [C++][Flight] ArrayFromJSON doesn't work for float value dictionary type
> ------------------------------------------------------------------------
>
> Key: ARROW-13381
> URL: https://issues.apache.org/jira/browse/ARROW-13381
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++, FlightRPC
> Reporter: Niranda Perera
> Priority: Minor
>
> The following code returns a NotImplemented error. It works without a problem
> for int/ string type values.
> {code:java}
> auto arr = ArrayFromJSON(dictionary(int32(), float32()), "[1, 1000]");
> // output
> -- Arrow Fatal Error --
> NotImplemented: JSON conversion to dictionary<values=float, indices=int32,
> ordered=0> not implemented
> Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)