You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/06/30 07:21:47 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #28926: [SPARK-32133][SQL] Forbid time field steps for date start/end in Sequence

cloud-fan commented on a change in pull request #28926:
URL: https://github.com/apache/spark/pull/28926#discussion_r447464759



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
##########
@@ -2679,6 +2682,11 @@ object Sequence {
          |final int $stepDays = $step.days;
          |final long $stepMicros = $step.microseconds;
          |
+         |if (${scale}L == ${MICROS_PER_DAY}L && $stepMonths == 0 && $stepDays == 0) {

Review comment:
       the `scale` is known before generating the code. We can do better
   ```
   val check = if (scale == MICROS_PER_DAY) {
     s"""
       if ($stepMonths == 0 && $stepDays == 0) ...
      """
   } else {
     ""
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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