You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2017/11/21 12:38:15 UTC

[GitHub] spark pull request #19389: [SPARK-22165][SQL] Fixes type conflicts between d...

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

    https://github.com/apache/spark/pull/19389#discussion_r152262352
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala ---
    @@ -372,11 +367,28 @@ object PartitioningUtils {
           suspiciousPaths.map("\t" + _).mkString("\n", "\n", "")
       }
     
    +  // scalastyle:off line.size.limit
       /**
    -   * Converts a string to a [[Literal]] with automatic type inference.  Currently only supports
    -   * [[IntegerType]], [[LongType]], [[DoubleType]], [[DecimalType]], [[DateType]]
    +   * Converts a string to a [[Literal]] with automatic type inference. Currently only supports
    +   * [[NullType]], [[IntegerType]], [[LongType]], [[DoubleType]], [[DecimalType]], [[DateType]]
        * [[TimestampType]], and [[StringType]].
    +   *
    +   * When resolving conflicts, it follows the table below:
    +   *
    +   * +-----------------+-----------------+-----------------+-----------------+-----------------+----------+-------------+-------------+----------+
    +   * |InputA \ InputB  |NullType         |IntegerType      |LongType         |DecimalType(38,0)|DoubleType|DateType     |TimestampType|StringType|
    +   * +-----------------+-----------------+-----------------+-----------------+-----------------+----------+-------------+-------------+----------+
    +   * |NullType         |NullType         |IntegerType      |LongType         |DecimalType(38,0)|DoubleType|DateType     |TimestampType|StringType|
    +   * |IntegerType      |IntegerType      |IntegerType      |LongType         |DecimalType(38,0)|DoubleType|StringType   |StringType   |StringType|
    +   * |LongType         |LongType         |LongType         |LongType         |DecimalType(38,0)|StringType|StringType   |StringType   |StringType|
    +   * |DecimalType(38,0)|DecimalType(38,0)|DecimalType(38,0)|DecimalType(38,0)|DecimalType(38,0)|StringType|StringType   |StringType   |StringType|
    +   * |DoubleType       |DoubleType       |DoubleType       |StringType       |StringType       |DoubleType|StringType   |StringType   |StringType|
    +   * |DateType         |DateType         |StringType       |StringType       |StringType       |StringType|DateType     |TimestampType|StringType|
    +   * |TimestampType    |TimestampType    |StringType       |StringType       |StringType       |StringType|TimestampType|TimestampType|StringType|
    +   * |StringType       |StringType       |StringType       |StringType       |StringType       |StringType|StringType   |StringType   |StringType|
    +   * +-----------------+-----------------+-----------------+-----------------+-----------------+----------+-------------+-------------+----------+
    --- End diff --
    
    we should also put this table in sql-programming-guide and sql migration guide.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org