cloud-fan commented on a change in pull request #28926:
URL: https://github.com/apache/spark/pull/28926#discussion_r449456120
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
##########
@@ -2674,11 +2679,24 @@ object Sequence {
|${genSequenceLengthCode(ctx, startMicros, stopMicros,
intervalInMicros, arrLength)}
""".stripMargin
+ val check = if (scale == MICROS_PER_DAY) {
+ s"""
+ |if ($stepMonths == 0 && $stepDays == 0) {
+ | throw new IllegalArgumentException(
+ | "sequence step must be a day interval if start and end values
are dates");
+ |}
+ """.stripMargin
+ } else {
+ ""
+ }
+
s"""
|final int $stepMonths = $step.months;
|final int $stepDays = $step.days;
|final long $stepMicros = $step.microseconds;
|
+ | $check
Review comment:
nit: no need to add 2 space indentation here.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]