uros-db commented on code in PR #45791:
URL: https://github.com/apache/spark/pull/45791#discussion_r1546340273
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -1476,9 +1476,11 @@ case class StringLocate(substr: Expression, str:
Expression, start: Expression)
override def third: Expression = start
override def nullable: Boolean = substr.nullable || str.nullable
override def dataType: DataType = IntegerType
- override def inputTypes: Seq[DataType] = Seq(StringType, StringType,
IntegerType)
+ override def inputTypes: Seq[AbstractDataType] =
+ Seq(StringTypeAnyCollation, StringTypeAnyCollation, IntegerType)
override def eval(input: InternalRow): Any = {
+ val collationId = first.dataType.asInstanceOf[StringType].collationId
Review Comment:
consider moving this out and making it:
`final lazy val collationId: Int =
first.dataType.asInstanceOf[StringType].collationId`
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]