AngersZhuuuu commented on a change in pull request #34848:
URL: https://github.com/apache/spark/pull/34848#discussion_r783581981
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala
##########
@@ -480,23 +498,56 @@ abstract class StringPredicate extends BinaryExpression
false
> SELECT _FUNC_('Spark SQL', null);
NULL
+ > SELECT _FUNC_(encode('Spark SQL', 'utf-8'), 'Spark');
Review comment:
Done
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala
##########
@@ -450,20 +451,37 @@ case class Lower(child: Expression)
override protected def withNewChildInternal(newChild: Expression): Lower =
copy(child = newChild)
}
-/** A base trait for functions that compare two strings, returning a boolean.
*/
-abstract class StringPredicate extends BinaryExpression
+/** A base trait for functions that compare two strings or binaries, returning
a boolean. */
+abstract class BinaryPredicate[T] extends BinaryExpression
Review comment:
Done
##########
File path: sql/core/src/test/resources/sql-tests/inputs/string-functions.sql
##########
@@ -124,4 +124,27 @@ SELECT endswith('Spark SQL', 'QL');
SELECT endswith('Spark SQL', 'Spa');
SELECT endswith(null, 'Spark');
SELECT endswith('Spark', null);
-SELECT endswith(null, null);
\ No newline at end of file
+SELECT endswith(null, null);
+
+SELECT contains(encode('Spark SQL', 'utf-8'), 'Spark');
Review comment:
Doen
--
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]