spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-9069] [SPARK-9264] [SQL] remove unlimit...
Date Thu, 23 Jul 2015 17:40:30 GMT
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7605#discussion_r35349146
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/types/DecimalType.scala ---
    @@ -92,31 +94,47 @@ object DecimalType extends AbstractDataType {
     
       override private[sql] def simpleString: String = "decimal"
     
    -  val Unlimited: DecimalType = DecimalType(None)
    +  val Maximum: DecimalType = DecimalType(Some(PrecisionInfo(MAX_PRECISION, 18)))
    +
    +  val Default: DecimalType = DecimalType(Some(PrecisionInfo(10, 0)))
    +
    +  val Unlimited: DecimalType = Maximum  // backward compatibility
     
       private[sql] object Fixed {
         def unapply(t: DecimalType): Option[(Int, Int)] =
    -      t.precisionInfo.map(p => (p.precision, p.scale))
    +      t.precisionInfo.map(p => (p.precision, p.scale)).orElse(Some((10, 0)))
       }
     
       private[sql] object Expression {
         def unapply(e: Expression): Option[(Int, Int)] = e.dataType match {
    -      case t: DecimalType => t.precisionInfo.map(p => (p.precision, p.scale))
    +      case t: DecimalType => t.precisionInfo.map(p => (p.precision, p.scale)).orElse(Some((10,
0)))
           case _ => None
         }
       }
     
    -  def apply(): DecimalType = Unlimited
    +  def apply(): DecimalType = Default
     
       def apply(precision: Int, scale: Int): DecimalType =
         DecimalType(Some(PrecisionInfo(precision, scale)))
     
    +  // The decimal types compatible with IntegralTypes
    +  private[sql] val ByteDecimal = DecimalType(3, 0)
    --- End diff --
    
    these are used only once -- seem excessive to have top level variables for them


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message