HuaHuaY commented on code in PR #55498:
URL: https://github.com/apache/arrow/pull/55498#discussion_r4547763691


##########
cpp/src/arrow/util/simdjson_internal.cc:
##########
@@ -515,13 +515,13 @@ const char* JsonTypeName(simdjson::ondemand::json_type 
type) {
 }
 
 Result<bool> IsJsonNull(simdjson::ondemand::value& value) {
-  bool is_null;
-  auto error_code = value.is_null().get(is_null);
+  simdjson::ondemand::json_type json_type;
+  auto error_code = value.type().get(json_type);
   if (error_code != simdjson::SUCCESS) {
-    return Status::Invalid("Error checking for JSON null: ",
+    return Status::Invalid("Error determining JSON type: ",
                            simdjson::error_message(error_code));
   }
-  return is_null;
+  return json_type == simdjson::ondemand::json_type::null;

Review Comment:
   According to the simdjson documentation, even if the `type()` method returns 
`null`, user must still use `is_null()` to verify whether it is truly `null`: 
https://github.com/simdjson/simdjson/blob/05da81d4539f6c41cd3993026a045d60bc96c2f1/include/simdjson/generic/ondemand/value.h#L601
   
   There are other instances in this PR where the same issue occurs.



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