Skip to content

Commit

Permalink
[SPARK-24012][SQL][TEST][FOLLOWUP] add unit test
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

a followup of apache#21100

## How was this patch tested?

N/A

Author: Wenchen Fan <wenchen@databricks.com>

Closes apache#21154 from cloud-fan/test.
  • Loading branch information
cloud-fan authored and gatorsmile committed Apr 25, 2018
1 parent 396938e commit ac4ca7c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,24 @@ class TypeCoercionSuite extends AnalysisTest {
Some(StructType(Seq(StructField("a", IntegerType), StructField("B", IntegerType)))),
isSymmetric = false)
}

widenTest(
ArrayType(IntegerType, containsNull = true),
ArrayType(IntegerType, containsNull = false),
Some(ArrayType(IntegerType, containsNull = true)))

widenTest(
MapType(IntegerType, StringType, valueContainsNull = true),
MapType(IntegerType, StringType, valueContainsNull = false),
Some(MapType(IntegerType, StringType, valueContainsNull = true)))

widenTest(
new StructType()
.add("arr", ArrayType(IntegerType, containsNull = true), nullable = false),
new StructType()
.add("arr", ArrayType(IntegerType, containsNull = false), nullable = true),
Some(new StructType()
.add("arr", ArrayType(IntegerType, containsNull = true), nullable = true)))
}

test("wider common type for decimal and array") {
Expand Down

0 comments on commit ac4ca7c

Please sign in to comment.