thisisnic commented on a change in pull request #9950:
URL: https://github.com/apache/arrow/pull/9950#discussion_r610738117



##########
File path: r/src/json.cpp
##########
@@ -31,14 +31,24 @@ std::shared_ptr<arrow::json::ReadOptions> 
json___ReadOptions__initialize(bool us
 }
 
 // [[arrow::export]]
-std::shared_ptr<arrow::json::ParseOptions> json___ParseOptions__initialize(
+std::shared_ptr<arrow::json::ParseOptions> json___ParseOptions__initialize1(
     bool newlines_in_values) {
   auto res =
       
std::make_shared<arrow::json::ParseOptions>(arrow::json::ParseOptions::Defaults());
   res->newlines_in_values = newlines_in_values;
   return res;
 }
 
+// [[arrow::export]]
+std::shared_ptr<arrow::json::ParseOptions> json___ParseOptions__initialize2(
+    bool newlines_in_values, const std::shared_ptr<arrow::Schema>& 
explicit_schema) {
+  auto res =
+    
std::make_shared<arrow::json::ParseOptions>(arrow::json::ParseOptions::Defaults());
+  res->newlines_in_values = newlines_in_values;
+  res->explicit_schema = explicit_schema;
+  return res;
+}
+

Review comment:
       I gave this a try, but when I call `JsonParseOptions$create`, it results 
in the following error:
   ` Error: Invalid R object for std::shared_ptr<arrow::Schema>, must be an 
ArrowObject` 
   
   I am guessing it's because the code below passes in `NULL` as the schema 
argument, and even with `explicit_schema` defaulting to `nullptr`, that default 
value is never used?
   ```
   JsonParseOptions$create <- function(newlines_in_values = FALSE, schema = 
NULL) {
       json___ParseOptions__initialize(newlines_in_values, schema)
   }
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to