Skip to content

Commit

Permalink
Test window function with codegen.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhuai committed Jul 31, 2015
1 parent d046347 commit ca80e07
Showing 1 changed file with 5 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import org.apache.spark.util.Utils
* for different tests and there are a few properties needed to let Hive generate golden
* files, every `createQueryTest` calls should explicitly set `reset` to `false`.
*/
abstract class HiveWindowFunctionQueryBaseSuite extends HiveComparisonTest with BeforeAndAfter {
class HiveWindowFunctionQuerySuite extends HiveComparisonTest with BeforeAndAfter {
private val originalTimeZone = TimeZone.getDefault
private val originalLocale = Locale.getDefault
private val testTempDir = Utils.createTempDir()
Expand Down Expand Up @@ -759,21 +759,7 @@ abstract class HiveWindowFunctionQueryBaseSuite extends HiveComparisonTest with
""".stripMargin, reset = false)
}

class HiveWindowFunctionQueryWithoutCodeGenSuite extends HiveWindowFunctionQueryBaseSuite {
var originalCodegenEnabled: Boolean = _
override def beforeAll(): Unit = {
super.beforeAll()
originalCodegenEnabled = conf.codegenEnabled
sql("set spark.sql.codegen=false")
}

override def afterAll(): Unit = {
sql(s"set spark.sql.codegen=$originalCodegenEnabled")
super.afterAll()
}
}

abstract class HiveWindowFunctionQueryFileBaseSuite
class HiveWindowFunctionQueryFileSuite
extends HiveCompatibilitySuite with BeforeAndAfter {
private val originalTimeZone = TimeZone.getDefault
private val originalLocale = Locale.getDefault
Expand All @@ -789,11 +775,11 @@ abstract class HiveWindowFunctionQueryFileBaseSuite
// The following settings are used for generating golden files with Hive.
// We have to use kryo to correctly let Hive serialize plans with window functions.
// This is used to generate golden files.
sql("set hive.plan.serialization.format=kryo")
// sql("set hive.plan.serialization.format=kryo")
// Explicitly set fs to local fs.
sql(s"set fs.default.name=file://$testTempDir/")
// sql(s"set fs.default.name=file://$testTempDir/")
// Ask Hive to run jobs in-process as a single map and reduce task.
sql("set mapred.job.tracker=local")
// sql("set mapred.job.tracker=local")
}

override def afterAll() {
Expand Down Expand Up @@ -838,17 +824,3 @@ abstract class HiveWindowFunctionQueryFileBaseSuite
case (name, _) => realWhiteList.contains(name)
}
}

class HiveWindowFunctionQueryFileWithoutCodeGenSuite extends HiveWindowFunctionQueryFileBaseSuite {
var originalCodegenEnabled: Boolean = _
override def beforeAll(): Unit = {
super.beforeAll()
originalCodegenEnabled = conf.codegenEnabled
sql("set spark.sql.codegen=false")
}

override def afterAll(): Unit = {
sql(s"set spark.sql.codegen=$originalCodegenEnabled")
super.afterAll()
}
}

0 comments on commit ca80e07

Please sign in to comment.