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