dongjoon-hyun commented on a change in pull request #25924:
[SPARK-29237][SQL][DOC] Avoid usage of function names in expression examples
URL: https://github.com/apache/spark/pull/25924#discussion_r328080003
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -115,6 +115,30 @@ class SQLQuerySuite extends QueryTest with
SharedSparkSession {
}
}
+ test("using _FUNC_ instead of function names in examples") {
+ val exampleRe = "(>.*;)".r
+ val ignoreSet = Set(
+ // Examples for CaseWhen show simpler syntax:
+ // `CASE WHEN ... THEN ... WHEN ... THEN ... END`
+ "org.apache.spark.sql.catalyst.expressions.CaseWhen",
+ // _FUNC_ is replaced by `locate` but `locate(... IN ...)` is not
supported
+ "org.apache.spark.sql.catalyst.expressions.StringLocate",
+ // _FUNC_ is replaced by `%` which causes a parsing error on `SELECT
%(2, 1.8)`
+ "org.apache.spark.sql.catalyst.expressions.Remainder",
+ // Examples demonstrate alternative names, see SPARK-20749
+ "org.apache.spark.sql.catalyst.expressions.Length")
+ spark.sessionState.functionRegistry.listFunction().foreach { funcId =>
Review comment:
Thank you, @MaxGekk . This is super useful.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]