taepper commented on code in PR #50653:
URL: https://github.com/apache/arrow/pull/50653#discussion_r3664391797


##########
cpp/src/arrow/json/from_string.cc:
##########
@@ -62,32 +64,85 @@ using ::arrow::internal::checked_pointer_cast;
 
 namespace {
 
-constexpr auto kParseFlags = rj::kParseFullPrecisionFlag | 
rj::kParseNanAndInfFlag;
-
-const char* JsonTypeName(rj::Type json_type) {
-  switch (json_type) {
-    case rapidjson::kNullType:
-      return "null";
-    case rapidjson::kFalseType:
-      return "false";
-    case rapidjson::kTrueType:
-      return "true";
-    case rapidjson::kObjectType:
-      return "object";
-    case rapidjson::kArrayType:
+const char* JsonTypeName(sj::json_type type) {
+  switch (type) {
+    case sj::json_type::array:
       return "array";
-    case rapidjson::kStringType:
-      return "string";
-    case rapidjson::kNumberType:
+    case sj::json_type::object:
+      return "object";
+    case sj::json_type::number:
       return "number";
+    case sj::json_type::string:
+      return "string";
+    case sj::json_type::boolean:
+      return "boolean";
+    case sj::json_type::null:
+      return "null";
     default:
       return "unknown";
   }
 }
 
-Status JSONTypeError(const char* expected_type, rj::Type json_type) {
-  return Status::Invalid("Expected ", expected_type, " or null, got JSON type 
",
-                         JsonTypeName(json_type));
+template <typename>
+inline constexpr bool kAlwaysFalse = false;

Review Comment:
   I see in the CI run that the way I solved it is indeed not portable:
   ```
   /Users/runner/work/arrow/arrow/cpp/src/arrow/json/from_string.cc:109:5: 
error: static assertion failed: unmapped simdjson value type
       static_assert(false, "unmapped simdjson value type");
       ^             ~~~~~
   ```
   



-- 
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]

Reply via email to