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



##########
File path: r/R/query-engine.R
##########
@@ -20,11 +20,36 @@ do_exec_plan <- function(.data) {
   final_node <- plan$Build(.data)
   tab <- plan$Run(final_node)
 
+  # If arrange() created $temp_columns, make sure to omit them from the result
+  # We can't currently handle this in the ExecPlan itself because sorting
+  # happens in the end (SinkNode) so nothing comes after it.
   if (length(final_node$sort$temp_columns) > 0) {
-    # If arrange() created $temp_columns, make sure to omit them from the 
result
     tab <- tab[, setdiff(names(tab), final_node$sort$temp_columns), drop = 
FALSE]
   }
 
+  if (ncol(tab)) {
+    # Apply any column metadata from the original schema, where appropriate
+    original_schema <- source_data(.data)$schema
+    # TODO: do we care about other (non-R) metadata preservation?

Review comment:
       Could we detect that it is there and warn/message that we've discarded 
it? It might be a little bit confusing, but I think that would be preferable to 
"Arrow lost all my metadata!"




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