[SPARK-9784] [SQL] Exchange.isUnsafe should check whether codegen and unsafe are enabled

Exchange.isUnsafe should check whether codegen and unsafe are enabled.

Author: Josh Rosen <joshrosen@databricks.com>

Closes #8073 from JoshRosen/SPARK-9784 and squashes the following commits:

7a1019f [Josh Rosen] [SPARK-9784] Exchange.isUnsafe should check whether codegen and unsafe are enabled
This commit is contained in:
Josh Rosen 2015-08-10 13:05:03 -07:00
parent d285212756
commit 0fe66744f1

View file

@ -46,7 +46,7 @@ case class Exchange(newPartitioning: Partitioning, child: SparkPlan) extends Una
* Returns true iff we can support the data type, and we are not doing range partitioning.
*/
private lazy val tungstenMode: Boolean = {
GenerateUnsafeProjection.canSupport(child.schema) &&
unsafeEnabled && codegenEnabled && GenerateUnsafeProjection.canSupport(child.schema) &&
!newPartitioning.isInstanceOf[RangePartitioning]
}