Skip to content

Commit

Permalink
compact test code
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-toth committed Mar 19, 2021
1 parent 9711da0 commit d782723
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions sql/core/src/test/scala/org/apache/spark/sql/FileScanSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan
import org.apache.spark.sql.execution.datasources.v2.text.TextScan
import org.apache.spark.sql.sources.Filter
import org.apache.spark.sql.test.SharedSparkSession
import org.apache.spark.sql.types.{IntegerType, StructField, StructType}
import org.apache.spark.sql.types.StructType
import org.apache.spark.sql.util.CaseInsensitiveStringMap

trait FileScanSuiteBase extends SharedSparkSession {
Expand Down Expand Up @@ -71,23 +71,12 @@ trait FileScanSuiteBase extends SharedSparkSession {
Seq[Expression]) => FileScan

def run(scanBuilders: Seq[(String, ScanBuilder, Seq[String])]): Unit = {
val dataSchema = StructType(Seq(
StructField("data", IntegerType, false),
StructField("partition", IntegerType, false),
StructField("other", IntegerType, false)))
val dataSchemaNotEqual = StructType(Seq(
StructField("data", IntegerType, false),
StructField("partition", IntegerType, false),
StructField("other", IntegerType, false),
StructField("new", IntegerType, false)))
val readDataSchema = StructType(Seq(StructField("data", IntegerType, false)))
val readDataSchemaNotEqual = StructType(Seq(
StructField("data", IntegerType, false),
StructField("other", IntegerType, false)))
val readPartitionSchema = StructType(Seq(StructField("partition", IntegerType, false)))
val readPartitionSchemaNotEqual = StructType(Seq(
StructField("partition", IntegerType, false),
StructField("other", IntegerType, false)))
val dataSchema = StructType.fromDDL("data INT, partition INT, other INT")
val dataSchemaNotEqual = StructType.fromDDL("data INT, partition INT, other INT, new INT")
val readDataSchema = StructType.fromDDL("data INT")
val readDataSchemaNotEqual = StructType.fromDDL("data INT, other INT")
val readPartitionSchema = StructType.fromDDL("partition INT")
val readPartitionSchemaNotEqual = StructType.fromDDL("partition INT, other INT")
val pushedFilters =
Array[Filter](sources.And(sources.IsNull("data"), sources.LessThan("data", 0)))
val pushedFiltersNotEqual =
Expand Down

0 comments on commit d782723

Please sign in to comment.