[SPARK-10463] [SQL] remove PromotePrecision during optimization

PromotePrecision is not necessary after HiveTypeCoercion done.

Jira:
https://issues.apache.org/jira/browse/SPARK-10463

Author: Daoyuan Wang <daoyuan.wang@intel.com>

Closes #8621 from adrian-wang/promoterm.
This commit is contained in:
Daoyuan Wang 2015-10-20 09:20:35 -07:00 committed by Davies Liu
parent 60851bc7bf
commit 94139557c5

View file

@ -57,7 +57,7 @@ object DefaultOptimizer extends Optimizer {
ConstantFolding,
LikeSimplification,
BooleanSimplification,
RemovePositive,
RemoveDispensable,
SimplifyFilters,
SimplifyCasts,
SimplifyCaseConversionExpressions) ::
@ -784,11 +784,12 @@ object SimplifyCasts extends Rule[LogicalPlan] {
}
/**
* Removes [[UnaryPositive]] identify function
* Removes nodes that are not necessary.
*/
object RemovePositive extends Rule[LogicalPlan] {
object RemoveDispensable extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transformAllExpressions {
case UnaryPositive(child) => child
case PromotePrecision(child) => child
}
}