This is an automated email from the ASF dual-hosted git repository.
maxgekk pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new b469294 [SPARK-35735][SQL][FOLLOWUP] Remove unused method
`IntervalUtils.checkIntervalStringDataType()`
b469294 is described below
commit b4692949f802a01bcdd7364235ce9e7ed31ff14d
Author: Max Gekk <[email protected]>
AuthorDate: Tue Jul 13 15:11:21 2021 +0300
[SPARK-35735][SQL][FOLLOWUP] Remove unused method
`IntervalUtils.checkIntervalStringDataType()`
### What changes were proposed in this pull request?
Remove the private method `checkIntervalStringDataType()` from
`IntervalUtils` since it hasn't been used anymore after
https://github.com/apache/spark/pull/33242.
### Why are the changes needed?
To improve code maintenance.
### Does this PR introduce _any_ user-facing change?
No. The method is private, and it existing in code base for short time.
### How was this patch tested?
By existing GAs/tests.
Closes #33321 from MaxGekk/SPARK-35735-remove-unused-method.
Authored-by: Max Gekk <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
(cherry picked from commit 1ba3982d16f98601583520794b30fa6ad6d85cf0)
Signed-off-by: Max Gekk <[email protected]>
---
.../spark/sql/catalyst/util/IntervalUtils.scala | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
index e026266..dc6c02e 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
@@ -30,7 +30,7 @@ import
org.apache.spark.sql.catalyst.util.DateTimeUtils.millisToMicros
import org.apache.spark.sql.catalyst.util.IntervalStringStyles.{ANSI_STYLE,
HIVE_STYLE, IntervalStyle}
import org.apache.spark.sql.errors.QueryExecutionErrors
import org.apache.spark.sql.internal.SQLConf
-import org.apache.spark.sql.types.{DataType, DayTimeIntervalType => DT,
Decimal, YearMonthIntervalType => YM}
+import org.apache.spark.sql.types.{DayTimeIntervalType => DT, Decimal,
YearMonthIntervalType => YM}
import org.apache.spark.unsafe.types.{CalendarInterval, UTF8String}
// The style of textual representation of intervals
@@ -124,25 +124,6 @@ object IntervalUtils {
s"${fallBackNotice.map(s => s", $s").getOrElse("")}")
}
- private def checkIntervalStringDataType(
- input: UTF8String,
- targetStartField: Byte,
- targetEndField: Byte,
- inputIntervalType: DataType,
- fallBackNotice: Option[String] = None): Unit = {
- val (intervalStr, typeName, inputStartField, inputEndField) =
inputIntervalType match {
- case DT(startField, endField) =>
- ("day-time", DT(targetStartField, targetEndField).typeName,
startField, endField)
- case YM(startField, endField) =>
- ("year-month", YM(targetStartField, targetEndField).typeName,
startField, endField)
- }
- if (targetStartField != inputStartField || targetEndField !=
inputEndField) {
- throwIllegalIntervalFormatException(
- input, targetStartField, targetEndField, intervalStr, typeName,
fallBackNotice)
- }
- }
-
-
val supportedFormat = Map(
(YM.YEAR, YM.MONTH) -> Seq("[+|-]y-m", "INTERVAL [+|-]'[+|-]y-m' YEAR TO
MONTH"),
(YM.YEAR, YM.YEAR) -> Seq("[+|-]y", "INTERVAL [+|-]'[+|-]y' YEAR"),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]