You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/09 17:02:38 UTC

[GitHub] [arrow] nealrichardson commented on a change in pull request #9950: ARROW-11468: [R] Allow user to pass schema to read_json_arrow()

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



##########
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:
       R's `NULL` is not the same as `nullptr`. It works in dataset___FileSystemDatasetFactory__Make2 because Make1 calls it with nullptr. (The nullptr check you just added in Make3 will never be nullptr (nor `NULL`) because it only is called from R if the input is a `Partitioning` object.




-- 
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:
users@infra.apache.org