Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changed type to SQL_PANDAS_UDF
  • Loading branch information
BryanCutler committed Sep 12, 2017
commit 4a2fec2aca1998ad04862eeac60d54b088b99de5
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private[spark] case class ChainedPythonFunctions(funcs: Seq[PythonFunction])
private[spark] object PythonEvalType {
val NON_UDF = 0
val SQL_BATCHED_UDF = 1
val SQL_ARROW_UDF = 2
val SQL_PANDAS_UDF = 2
}

private[spark] object PythonRunner {
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SpecialLengths(object):
class PythonEvalType(object):
NON_UDF = 0
SQL_BATCHED_UDF = 1
SQL_ARROW_UDF = 2
SQL_PANDAS_UDF = 2


class Serializer(object):
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def read_udfs(pickleSer, infile, eval_type):

func = lambda _, it: map(mapper, it)

if eval_type == PythonEvalType.SQL_ARROW_UDF:
if eval_type == PythonEvalType.SQL_PANDAS_UDF:
ser = ArrowPandasSerializer()
else:
ser = BatchedSerializer(PickleSerializer(), 100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ case class ArrowEvalPythonExec(udfs: Seq[PythonUDF], output: Seq[Attribute], chi

// Output iterator for results from Python.
val outputIterator = new PythonRunner(
pyFuncs, bufferSize, reuseWorker, PythonEvalType.SQL_ARROW_UDF, argOffsets).
pyFuncs, bufferSize, reuseWorker, PythonEvalType.SQL_PANDAS_UDF, argOffsets).
compute(inputIterator, context.partitionId(), context)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we usually write it in a style as:

val outputIterator = new PythonRunner(
    pyFuncs, bufferSize, reuseWorker, PythonEvalType.SQL_PANDAS_UDF, argOffsets)
  .compute(inputIterator, context.partitionId(), context)

There are similar styles above, e.g. map { case (attr, i) => ... -> .map { case (attr, i) => ....


val joined = new JoinedRow
Expand Down