maropu commented on a change in pull request #27540: Revert "[SPARK-28093][SQL] 
Fix TRIM/LTRIM/RTRIM function parameter order issue"
URL: https://github.com/apache/spark/pull/27540#discussion_r377975783
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala
 ##########
 @@ -719,7 +719,7 @@ object StringTrim {
 
     _FUNC_(TRAILING FROM str) - Removes the trailing space characters from 
`str`.
 
-    _FUNC_(str, trimStr) - Remove the leading and trailing `trimStr` 
characters from `str`.
+    _FUNC_(trimStr, str) - Remove the leading and trailing `trimStr` 
characters from `str`.
 
 Review comment:
   I personally like the explicit format like `trimStr FROM str` and the idea 
to hide the api in future releases look reasonable to me. If we fix it that 
way, I think its better to fix the other string functions consistently, e.g., 
`substring` and `overlay`.
   
   These string functions are pretty common in dbms-like systems, so I feel 
throwing an exception is better than returning a wrong answer when users just 
copy&paste a query including these string functions from another system.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to