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 2020/05/22 15:12:36 UTC

[GitHub] [arrow] nealrichardson commented on a change in pull request #7245: ARROW-8885: [R] Don't include everything everywhere

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



##########
File path: r/src/arrow_types.h
##########
@@ -176,64 +37,21 @@ inline constexpr Rbyte default_value<RAWSXP>() {
 
 }  // namespace Rcpp
 
-namespace arrow {
-namespace r {
-
-template <typename T>
-inline std::shared_ptr<T> extract(SEXP x) {
-  return Rcpp::ConstReferenceSmartPtrInputParameter<std::shared_ptr<T>>(x);
-}
-
-}  // namespace r
-}  // namespace arrow
-
 #if defined(ARROW_R_WITH_ARROW)
-#include <arrow/api.h>
-#include <arrow/c/bridge.h>
-#include <arrow/compute/api.h>
-#include <arrow/csv/reader.h>
-#include <arrow/dataset/api.h>
-#include <arrow/filesystem/filesystem.h>
-#include <arrow/filesystem/localfs.h>
-#include <arrow/filesystem/s3fs.h>
-#include <arrow/io/compressed.h>
-#include <arrow/io/file.h>
-#include <arrow/io/memory.h>
-#include <arrow/ipc/feather.h>
-#include <arrow/ipc/reader.h>
-#include <arrow/ipc/writer.h>
-#include <arrow/json/reader.h>
+#include <arrow/buffer.h>  // for RBuffer definition below
 #include <arrow/result.h>
-#include <arrow/type.h>
 #include <arrow/type_fwd.h>
-#include <arrow/util/checked_cast.h>
-#include <arrow/util/compression.h>
-#include <arrow/util/iterator.h>
+// Do we need ubsan always there?

Review comment:
       question

##########
File path: r/src/array_from_vector.cpp
##########
@@ -20,6 +20,11 @@
 #include "./arrow_types.h"
 
 #if defined(ARROW_R_WITH_ARROW)
+#include <arrow/array.h>
+#include <arrow/builder.h>
+#include <arrow/table.h>
+// This says "Private header, not to be exported"

Review comment:
       Is this ok?

##########
File path: r/src/arrow_types.h
##########
@@ -176,64 +37,21 @@ inline constexpr Rbyte default_value<RAWSXP>() {
 
 }  // namespace Rcpp
 
-namespace arrow {
-namespace r {
-
-template <typename T>
-inline std::shared_ptr<T> extract(SEXP x) {
-  return Rcpp::ConstReferenceSmartPtrInputParameter<std::shared_ptr<T>>(x);
-}
-
-}  // namespace r
-}  // namespace arrow
-
 #if defined(ARROW_R_WITH_ARROW)
-#include <arrow/api.h>
-#include <arrow/c/bridge.h>
-#include <arrow/compute/api.h>
-#include <arrow/csv/reader.h>
-#include <arrow/dataset/api.h>
-#include <arrow/filesystem/filesystem.h>
-#include <arrow/filesystem/localfs.h>
-#include <arrow/filesystem/s3fs.h>
-#include <arrow/io/compressed.h>
-#include <arrow/io/file.h>
-#include <arrow/io/memory.h>
-#include <arrow/ipc/feather.h>
-#include <arrow/ipc/reader.h>
-#include <arrow/ipc/writer.h>
-#include <arrow/json/reader.h>
+#include <arrow/buffer.h>  // for RBuffer definition below

Review comment:
       The RBuffer class definition should probably be moved to buffer.cpp but I didn't work out how to register it in the namespace in this file.

##########
File path: r/src/arrow_exports.h
##########
@@ -0,0 +1,56 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// This gets included in arrowExports.cpp
+
+#pragma once
+
+#include "arrow_rcpp.h"
+
+#if defined(ARROW_R_WITH_ARROW)
+#include <arrow/csv/reader.h>
+#include <arrow/dataset/api.h>

Review comment:
       I suspect if there were more type_fwd.h files (like for dataset), we could trim this file back further and shave off some more seconds. 




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