Skip to content

Commit 3efe9f5

Browse files
committed
Address comments.
1 parent 2264b57 commit 3efe9f5

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

R/pkg/inst/worker/worker.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ broadcastElap <- elapsedSecs()
8484
# as number of partitions to create.
8585
numPartitions <- SparkR:::readInt(inputCon)
8686

87-
# If true, working for RDD
88-
# If false, working for DataFrame
8987
isDataFrame <- as.logical(SparkR:::readInt(inputCon))
9088

9189
# If isDataFrame, then read column names

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ object EliminateSerialization extends Rule[LogicalPlan] {
158158
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
159159
case d @ DeserializeToObject(_, _, s: SerializeFromObject)
160160
if d.outputObjectType == s.inputObjectType =>
161-
// A workaround for SPARK-14803. Remove this after it is fixed.
162-
if (d.outputObjectType.isInstanceOf[ObjectType] &&
163-
d.outputObjectType.asInstanceOf[ObjectType].cls == classOf[org.apache.spark.sql.Row]) {
164-
s.child
165-
} else {
166-
// Adds an extra Project here, to preserve the output expr id of `DeserializeToObject`.
167-
val objAttr = Alias(s.child.output.head, "obj")(exprId = d.output.head.exprId)
168-
Project(objAttr :: Nil, s.child)
169-
}
161+
// A workaround for SPARK-14803. Remove this after it is fixed.
162+
if (d.outputObjectType.isInstanceOf[ObjectType] &&
163+
d.outputObjectType.asInstanceOf[ObjectType].cls == classOf[org.apache.spark.sql.Row]) {
164+
s.child
165+
} else {
166+
// Adds an extra Project here, to preserve the output expr id of `DeserializeToObject`.
167+
val objAttr = Alias(s.child.output.head, "obj")(exprId = d.output.head.exprId)
168+
Project(objAttr :: Nil, s.child)
169+
}
170170
case a @ AppendColumns(_, _, _, s: SerializeFromObject)
171171
if a.deserializer.dataType == s.inputObjectType =>
172172
AppendColumnsWithObject(a.func, s.serializer, a.serializer, s.child)

0 commit comments

Comments
 (0)