BryanCutler commented on a change in pull request #24981: [SPARK-27463][PYTHON] 
Support Dataframe Cogroup via Pandas UDFs
URL: https://github.com/apache/spark/pull/24981#discussion_r326914754
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/python/BaseArrowPythonRunner.scala
 ##########
 @@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+package org.apache.spark.sql.execution.python
+
+import java.io._
+import java.net._
+import java.util.concurrent.atomic.AtomicBoolean
+
+import scala.collection.JavaConverters._
+
+import org.apache.arrow.vector.VectorSchemaRoot
+import org.apache.arrow.vector.ipc.ArrowStreamReader
+
+import org.apache.spark._
+import org.apache.spark.api.python._
+import org.apache.spark.sql.types.StructType
+import org.apache.spark.sql.util.ArrowUtils
+import org.apache.spark.sql.vectorized.{ArrowColumnVector, ColumnarBatch, 
ColumnVector}
+
+/**
+ * Common functionality for a udf runner that exchanges data with Python 
worker via Arrow stream.
+ */
+abstract class BaseArrowPythonRunner[T](
 
 Review comment:
   I think the changes were pretty straightforward to support the feature, 
mainly to be able to read back results the same way as group map udfs. I didn't 
consider this to be major refactoring, so making a complete copy of the python 
runner seemed a little excessive. Otherwise I would agree to keep things 
separate.
   
   >We should think about that before generalizing it - my goal was that 
deduplicating both code paths.
   
   This sounds like a good idea, it shouldn't really matter if writing to 
Python or R, and would be good to deduplicate.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to