Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
use simpler matchings
  • Loading branch information
kiszk committed Apr 16, 2017
commit 1b24be0ca52234997deb549a73cf227339d1ad37
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ case class NullPropagation(conf: SQLConf) extends Rule[LogicalPlan] {
case EqualNullSafe(Literal(null, _), r) => IsNull(r)
case EqualNullSafe(l, Literal(null, _)) => IsNull(l)

case a @ AssertNotNull(c, _) if !c.nullable => c
case _ @ AssertNotNull(c, _) if !c.nullable => c

// For Coalesce, remove null literals.
case e @ Coalesce(children) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,11 @@ object CombineTypedFilters extends Rule[LogicalPlan] {
* representation of data item. For example back to back map operations.
Copy link
Member

Choose a reason for hiding this comment

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

Is this comment broken?

*/
object EliminateMapObjects extends Rule[LogicalPlan] {
private def convertDataTypeToArrayClass(dt: DataType): Class[_] = dt match {
case IntegerType => classOf[Array[Int]]
case LongType => classOf[Array[Long]]
case DoubleType => classOf[Array[Double]]
case FloatType => classOf[Array[Float]]
case ShortType => classOf[Array[Short]]
case ByteType => classOf[Array[Byte]]
case BooleanType => classOf[Array[Boolean]]
}

def apply(plan: LogicalPlan): LogicalPlan = plan transform {
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we call plan.transformAllExpressions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, it works. done

case _ @ DeserializeToObject(_ @ Invoke(
MapObjects(_, _, _, LambdaVariable(_, _, _, _), inputData, customCollectionCls, _),
funcName, returnType @ ObjectType(returnCls), arguments, propagateNull, returnNullable),
outputObjAttr, child) if customCollectionCls.isEmpty =>
MapObjects(_, _, _, _ : LambdaVariable, inputData, None, _),
funcName, returnType @ ObjectType(_), arguments, propagateNull, returnNullable),
outputObjAttr, child) =>
DeserializeToObject(Invoke(
inputData, funcName, returnType, arguments, propagateNull, returnNullable),
outputObjAttr, child)
Expand Down