Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimahriman committed Sep 23, 2024
1 parent a571476 commit aab856b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import org.apache.spark.sql.vectorized.ColumnarBatch
import org.apache.spark.util.Utils



/**
* Python UDF Runner for grouped udfs.
*/
Expand Down Expand Up @@ -103,7 +102,7 @@ abstract class BaseGroupedArrowPythonRunner[IN](
group: Iterator[InternalRow],
schema: StructType,
dataOut: DataOutputStream,
name: String): Unit = {
name: Option[String] = None): Unit = {
val arrowSchema = ArrowUtils.toArrowSchema(
schema, timeZoneId, errorOnDuplicatedFieldNames = true, largeVarTypes)
val allocator = ArrowUtils.rootAllocator.newChildAllocator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ class CoGroupedArrowPythonRunner(
pythonMetrics, jobArtifactUUID, profiler) {

override protected def writeNextGroup(
group: (Iterator[InternalRow],
Iterator[InternalRow]),
group: (Iterator[InternalRow], Iterator[InternalRow]),
dataOut: DataOutputStream): Unit = {
val (leftGroup, rightGroup) = group

dataOut.writeInt(2)
writeSingleStream(leftGroup, leftSchema, dataOut, "left")
writeSingleStream(rightGroup, rightSchema, dataOut, "right")
writeSingleStream(leftGroup, leftSchema, dataOut, Some("left"))
writeSingleStream(rightGroup, rightSchema, dataOut, Some("right"))
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.apache.spark.sql.execution.metric.SQLMetric
import org.apache.spark.sql.types.StructType



/**
* Python UDF Runner for grouped udfs.
*/
Expand All @@ -49,6 +48,6 @@ class GroupedArrowPythonRunner(
group: Iterator[InternalRow],
dataOut: DataOutputStream): Unit = {
dataOut.writeInt(1)
writeSingleStream(group, schema, dataOut, "batch")
writeSingleStream(group, schema, dataOut)
}
}

0 comments on commit aab856b

Please sign in to comment.