chenzhx commented on code in PR #36330:
URL: https://github.com/apache/spark/pull/36330#discussion_r858366618
##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -200,6 +200,46 @@ class V2ExpressionBuilder(
} else {
None
}
+ case Substring(str, pos, len) =>
+ val s = generateExpression(str)
+ val p = generateExpression(pos)
+ val l = generateExpression(len)
+ if (s.isDefined && p.isDefined && l.isDefined) {
+ Some(new GeneralScalarExpression("SUBSTRING",
Array[V2Expression](s.get, p.get, l.get)))
+ } else {
+ None
+ }
+ case Upper(child) => generateExpression(child)
+ .map(v => new GeneralScalarExpression("UPPER", Array[V2Expression](v)))
+ case Lower(child) => generateExpression(child)
+ .map(v => new GeneralScalarExpression("LOWER", Array[V2Expression](v)))
+ case StringTranslate(str, matching, replace) =>
+ val s = generateExpression(str)
+ val m = generateExpression(matching)
+ val r = generateExpression(replace)
Review Comment:
OK
##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -200,6 +200,46 @@ class V2ExpressionBuilder(
} else {
None
}
+ case Substring(str, pos, len) =>
+ val s = generateExpression(str)
+ val p = generateExpression(pos)
+ val l = generateExpression(len)
Review Comment:
OK
--
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]