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
remove conf
  • Loading branch information
Ngone51 committed Feb 17, 2020
commit 1abe474ba2bb5821fdbb1e33bded8cf0ba9aeecb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ case class DataSourceAnalysis(conf: SQLConf) extends Rule[LogicalPlan] with Cast
sourceAttributes: Seq[Attribute],
providedPartitions: Map[String, Option[String]],
targetAttributes: Seq[Attribute],
targetPartitionSchema: StructType,
conf: SQLConf): Seq[NamedExpression] = {
targetPartitionSchema: StructType): Seq[NamedExpression] = {

assert(providedPartitions.exists(_._2.isDefined))

Expand Down Expand Up @@ -184,8 +183,7 @@ case class DataSourceAnalysis(conf: SQLConf) extends Rule[LogicalPlan] with Cast
sourceAttributes = query.output,
providedPartitions = parts,
targetAttributes = l.output,
targetPartitionSchema = t.partitionSchema,
conf)
targetPartitionSchema = t.partitionSchema)
Project(projectList, query)
} else {
query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int, 'f.int),
providedPartitions = Map("b" -> None, "c" -> None),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}
}

Expand All @@ -81,8 +80,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int),
providedPartitions = Map("b" -> Some("1"), "c" -> None),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}
}

Expand All @@ -93,8 +91,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int, 'f.int),
providedPartitions = Map("b" -> Some("1")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}

// Missing partitioning columns.
Expand All @@ -103,8 +100,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int, 'f.int, 'g.int),
providedPartitions = Map("b" -> Some("1")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}

// Wrong partitioning columns.
Expand All @@ -113,8 +109,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int, 'f.int),
providedPartitions = Map("b" -> Some("1"), "d" -> None),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}
}

Expand All @@ -125,8 +120,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int, 'f.int),
providedPartitions = Map("b" -> Some("1"), "d" -> Some("2")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}

// Wrong partitioning columns.
Expand All @@ -135,8 +129,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int),
providedPartitions = Map("b" -> Some("1"), "c" -> Some("3"), "d" -> Some("2")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}

if (caseSensitive) {
Expand All @@ -146,8 +139,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int, 'f.int),
providedPartitions = Map("b" -> Some("1"), "C" -> Some("3")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}
}
}
Expand All @@ -161,8 +153,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = Seq('e.int, 'f.int),
providedPartitions = Map("b" -> None, "c" -> Some("3")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
}
}

Expand All @@ -175,8 +166,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = nonPartitionedAttributes,
providedPartitions = Map("b" -> Some("1"), "C" -> Some("3")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
checkProjectList(actual, expected)
}

Expand All @@ -188,8 +178,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = nonPartitionedAttributes,
providedPartitions = Map("b" -> Some("1"), "c" -> Some("3")),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
checkProjectList(actual, expected)
}

Expand All @@ -201,8 +190,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = nonPartitionedAttributes,
providedPartitions = Map("b" -> Some("1")),
targetAttributes = Seq('a.int, 'd.int, 'b.int),
targetPartitionSchema = new StructType().add("b", IntegerType),
conf)
targetPartitionSchema = new StructType().add("b", IntegerType))
checkProjectList(actual, expected)
}
}
Expand All @@ -218,8 +206,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll {
sourceAttributes = nonPartitionedAttributes ++ dynamicPartitionAttributes,
providedPartitions = Map("b" -> Some("1"), "c" -> None),
targetAttributes = targetAttributes,
targetPartitionSchema = targetPartitionSchema,
conf)
targetPartitionSchema = targetPartitionSchema)
checkProjectList(actual, expected)
}
}
Expand Down