jonkeane commented on a change in pull request #10780:
URL: https://github.com/apache/arrow/pull/10780#discussion_r675084799



##########
File path: r/R/alchemize.R
##########
@@ -0,0 +1,81 @@
+# 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.
+
+#' Transform a data structure from one engine to another

Review comment:
       🤔 I'm working on this right now and I'm torn. I like the idea of having 
one function / family of them that clearly do this kind of transformation 
(right now it's relatively limited, but we've got 2 already!).
   
   `tbl` works pretty well, though right now I'm trying to figure out what the 
right answer is for `tbl(..., .engine = "arrow")`. In an ideal world(?) duckdb 
would also expose a C-interface for us to get Arrow data out of, such that one 
could pull data back in to Arrow without needing to route via R which this 
would be exactly that (though AFAICT that doesn't currently exist).
   
   I have right now (with the comment in the middle not totally sure what to do)
   ```
   tbl.arrow_dplyr_query <- function(src, ..., .engine = c("arrow", "duckdb")) {
     engine <- match.arg(.engine)
   
     if (engine == "arrow") {
       # What should we do here? Possibilities:
       # stop("not yet implemented")?
       # return(src) # no-op + maybe a warning that we did nothing
       # return(arrow_dplyr_query(src)) # this is the most tbl like thing for 
an Arrow object
     } else if (engine == "duckdb") {
       .alchemize_to_duckdb(src = src, ...)
     }
   }
   ```
   
   So maybe it is worth waiting until some of those other features exist (or 
the next hand-over integration comes up) before we come up with a grand scheme 
that unifies these kinds of hand offs. 




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