Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17406#discussion_r108434080
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeSuite.scala ---
    @@ -169,30 +169,76 @@ class DataTypeSuite extends SparkFunSuite {
         assert(!arrayType.existsRecursively(_.isInstanceOf[IntegerType]))
       }
     
    -  def checkDataTypeJsonRepr(dataType: DataType): Unit = {
    -    test(s"JSON - $dataType") {
    +  def checkDataTypeFromJson(dataType: DataType): Unit = {
    +    test(s"from Json - $dataType") {
           assert(DataType.fromJson(dataType.json) === dataType)
         }
       }
     
    -  checkDataTypeJsonRepr(NullType)
    -  checkDataTypeJsonRepr(BooleanType)
    -  checkDataTypeJsonRepr(ByteType)
    -  checkDataTypeJsonRepr(ShortType)
    -  checkDataTypeJsonRepr(IntegerType)
    -  checkDataTypeJsonRepr(LongType)
    -  checkDataTypeJsonRepr(FloatType)
    -  checkDataTypeJsonRepr(DoubleType)
    -  checkDataTypeJsonRepr(DecimalType(10, 5))
    -  checkDataTypeJsonRepr(DecimalType.SYSTEM_DEFAULT)
    -  checkDataTypeJsonRepr(DateType)
    -  checkDataTypeJsonRepr(TimestampType)
    -  checkDataTypeJsonRepr(StringType)
    -  checkDataTypeJsonRepr(BinaryType)
    -  checkDataTypeJsonRepr(ArrayType(DoubleType, true))
    -  checkDataTypeJsonRepr(ArrayType(StringType, false))
    -  checkDataTypeJsonRepr(MapType(IntegerType, StringType, true))
    -  checkDataTypeJsonRepr(MapType(IntegerType, ArrayType(DoubleType), false))
    +  def checkDataTypeFromDDL(dataType: DataType, ignoreNullability: Boolean 
= false): Unit = {
    --- End diff --
    
    why do we have the `ignoreNullability` parameter? `DataType.sql` doesn't 
contains nullability information so we should not expect to retain the 
nullability here. We should always compare the types by `sameType`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to