MaxGekk opened a new pull request, #43196: URL: https://github.com/apache/spark/pull/43196
### What changes were proposed in this pull request? In the PR, I propose to fix the `sql()` method of the `Like` expression, and append the `ESCAPE` clause when the `escapeChar` is not the default one `\\`. ### Why are the changes needed? 1. To be consistent to the `toString()` method 2. To distinguish column names when the escape argument is set. Before the changes, the columns might conflict, and that could confuse users: ```sql spark-sql (default)> create temp view tbl as (SELECT 'a|_' like 'a||_' escape '|', 'a|_' like 'a||_' escape 'a'); [COLUMN_ALREADY_EXISTS] The column `a|_ like a||_` already exists. Consider to choose another name or rename the existing column. ``` ### Does this PR introduce _any_ user-facing change? Should not. ### How was this patch tested? Manually checking the column name by: ``` ``` ### Was this patch authored or co-authored using generative AI tooling? No. -- 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]
