Skip to content

Commit 19bcca1

Browse files
committed
TypeCollection should use simpleString
1 parent b4c5339 commit 19bcca1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ case class SpecifiedWindowFrame(
252252
case e: Expression if !frameType.inputType.acceptsType(e.dataType) =>
253253
TypeCheckFailure(
254254
s"The data type of the $location bound '${e.dataType} does not match " +
255-
s"the expected data type '${frameType.inputType}'.")
255+
s"the expected data type '${frameType.inputType.simpleString}'.")
256256
case _ => TypeCheckSuccess
257257
}
258258

sql/core/src/test/resources/sql-tests/results/typeCoercion/native/windowFrameCoercion.sql.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ SELECT COUNT(*) OVER (PARTITION BY 1 ORDER BY cast(1 as string) DESC RANGE BETWE
168168
struct<>
169169
-- !query 20 output
170170
org.apache.spark.sql.AnalysisException
171-
cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS STRING) FOLLOWING' due to data type mismatch: The data type of the upper bound 'StringType does not match the expected data type 'org.apache.spark.sql.types.TypeCollection@7ff36201'.; line 1 pos 21
171+
cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS STRING) FOLLOWING' due to data type mismatch: The data type of the upper bound 'StringType does not match the expected data type '(numeric or calendarinterval)'.; line 1 pos 21
172172

173173

174174
-- !query 21
@@ -186,7 +186,7 @@ SELECT COUNT(*) OVER (PARTITION BY 1 ORDER BY cast(1 as boolean) DESC RANGE BETW
186186
struct<>
187187
-- !query 22 output
188188
org.apache.spark.sql.AnalysisException
189-
cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS BOOLEAN) FOLLOWING' due to data type mismatch: The data type of the upper bound 'BooleanType does not match the expected data type 'org.apache.spark.sql.types.TypeCollection@7ff36201'.; line 1 pos 21
189+
cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS BOOLEAN) FOLLOWING' due to data type mismatch: The data type of the upper bound 'BooleanType does not match the expected data type '(numeric or calendarinterval)'.; line 1 pos 21
190190

191191

192192
-- !query 23

0 commit comments

Comments
 (0)