ivoson commented on code in PR #59637:
URL: https://github.com/apache/spark/pull/59637#discussion_r4640770512
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExec.scala:
##########
@@ -186,6 +190,8 @@ object BatchEvalPythonExec {
estimatedBytes += (dataType match {
case _: StringType => row.getUTF8String(ordinal).numBytes.toLong
case BinaryType => row.getBinary(ordinal).length.toLong
+ case _: GeometryType | _: GeographyType =>
+ row.getBinaryView(ordinal).numBytes().toLong
Review Comment:
Fixed in dfceed40d8b. Documented that the estimate is a lower bound on
conversion memory, with a specific warning that geometry/geography parsing can
allocate object graphs much larger than stored bytes. Kept raw-byte accounting
rather than adding an uncalibrated multiplier.
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExec.scala:
##########
@@ -162,17 +163,20 @@ class BatchEvalPythonEvaluatorFactory(
}
object BatchEvalPythonExec {
+ private def isSupportedProjectedInputType(dataType: DataType): Boolean =
dataType match {
+ case _: StringType | BinaryType => true
+ case _: GeometryType | _: GeographyType => true
Review Comment:
Fixed in dfceed40d8b. Included VARIANT via PhysicalVariantType; its estimate
adds value and metadata byte lengths using Long arithmetic. Added coverage for
generic and unsafe rows, including nulls.
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExec.scala:
##########
@@ -162,17 +163,20 @@ class BatchEvalPythonEvaluatorFactory(
}
object BatchEvalPythonExec {
+ private def isSupportedProjectedInputType(dataType: DataType): Boolean =
dataType match {
+ case _: StringType | BinaryType => true
+ case _: GeometryType | _: GeographyType => true
+ case _ => false
Review Comment:
Fixed in dfceed40d8b. The sizer now recursively unwraps udt.sqlType before
selecting the storage accessor. Added tests for all supported storage types,
repeated UDT wrappers, and nulls.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -5554,9 +5554,9 @@ object SQLConf {
buildConf("spark.sql.execution.python.udf.rowSizeGuard.enabled")
.internal()
.doc("When true, guard pickle-serialized (non-Arrow) Python UDF
evaluation against " +
- "top-level string and binary argument payloads whose combined size
exceeds " +
- "rowSizeGuard.maxRowHeapFraction of executor heap. The guard checks
the projected " +
- "arguments before conversion and pickling. Nested inputs are not
estimated.")
+ "top-level string, binary, geometry, and geography argument payloads
whose combined " +
Review Comment:
Fixed in dfceed40d8b. Clarified that these configs cover scalar pickle
Python UDFs and exclude Python UDTFs. UDTF wiring remains separate.
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExec.scala:
##########
@@ -162,17 +163,20 @@ class BatchEvalPythonEvaluatorFactory(
}
object BatchEvalPythonExec {
+ private def isSupportedProjectedInputType(dataType: DataType): Boolean =
dataType match {
Review Comment:
Fixed in dfceed40d8b. Switched sizing dispatch to PhysicalDataType after UDT
unwrapping. PhysicalBinaryViewType covers both geo types, and
PhysicalVariantType counts both VARIANT buffers; the supported storage list is
documented once.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]