Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-06-03 Thread via GitHub
cloud-fan closed pull request #46474: [SPARK-47972][SQL] Restrict CAST expression for collations URL: https://github.com/apache/spark/pull/46474 -- 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

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-06-03 Thread via GitHub
cloud-fan commented on PR #46474: URL: https://github.com/apache/spark/pull/46474#issuecomment-2146281184 thanks, merging to master! -- 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

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-06-03 Thread via GitHub
mihailom-db commented on code in PR #46474: URL: https://github.com/apache/spark/pull/46474#discussion_r1625038412 ## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCasts.scala: ## @@ -152,6 +150,8 @@ object CollationTypeCasts extends

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-06-03 Thread via GitHub
cloud-fan commented on code in PR #46474: URL: https://github.com/apache/spark/pull/46474#discussion_r1624883928 ## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CollationTypeCasts.scala: ## @@ -152,6 +150,8 @@ object CollationTypeCasts extends

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-17 Thread via GitHub
mihailom-db commented on PR #46474: URL: https://github.com/apache/spark/pull/46474#issuecomment-2117197531 So in summary SQL will be fine, but we need to resolve dataframe API as well and think of the best unified solution. -- This is an automated message from the Apache Git Service. To

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-17 Thread via GitHub
mihailom-db commented on PR #46474: URL: https://github.com/apache/spark/pull/46474#issuecomment-2117193264 I would expect that behaviour, but the problem comes with this rewriting you suggested. When we create expressions, CAST expression does not remember identifier used during parsing,

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-17 Thread via GitHub
srielau commented on PR #46474: URL: https://github.com/apache/spark/pull/46474#issuecomment-2117161101 > @stefankandic SQL Standard does not support for casting to collated strings. I agree with the message thing. The standard only allows for CAST(1 AS STRING) COLLATE UNICODE, so that is

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-17 Thread via GitHub
mihailom-db commented on PR #46474: URL: https://github.com/apache/spark/pull/46474#issuecomment-2117149071 @stefankandic SQL Standard does not support for casting to collated strings. I agree with the message thing. The standard only allows for CAST(1 AS STRING) COLLATE UNICODE, so that

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-17 Thread via GitHub
stefankandic commented on code in PR #46474: URL: https://github.com/apache/spark/pull/46474#discussion_r1604633605 ## sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/DataTypeAstBuilder.scala: ## @@ -74,7 +74,10 @@ class DataTypeAstBuilder extends

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-17 Thread via GitHub
stefankandic commented on PR #46474: URL: https://github.com/apache/spark/pull/46474#issuecomment-2117114028 Why do we want to do this? Should it be a parser error? Also, I don't think the error message is very clear - we should at least let the user know how to perform the cast to another

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-16 Thread via GitHub
mihailom-db commented on PR #46474: URL: https://github.com/apache/spark/pull/46474#issuecomment-2114099921 @dbatomic @stefankandic @stevomitric @nikolamand-db could you take a look at this PR -- This is an automated message from the Apache Git Service. To respond to the message, please

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-14 Thread via GitHub
mihailom-db commented on code in PR #46474: URL: https://github.com/apache/spark/pull/46474#discussion_r1599507122 ## sql/core/src/test/scala/org/apache/spark/sql/CollationSuite.scala: ## @@ -851,6 +852,30 @@ class CollationSuite extends DatasourceV2SQLBase with

Re: [PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-14 Thread via GitHub
uros-db commented on code in PR #46474: URL: https://github.com/apache/spark/pull/46474#discussion_r1599500946 ## sql/core/src/test/scala/org/apache/spark/sql/CollationSuite.scala: ## @@ -851,6 +852,30 @@ class CollationSuite extends DatasourceV2SQLBase with

[PR] [SPARK-47972][SQL] Restrict CAST expression for collations [spark]

2024-05-08 Thread via GitHub
mihailom-db opened a new pull request, #46474: URL: https://github.com/apache/spark/pull/46474 ### What changes were proposed in this pull request? Block of syntax CAST(value AS STRING COLLATE collation_name). ### Why are the changes needed? Current state of code allows for