You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@auron.apache.org by "richox (via GitHub)" <gi...@apache.org> on 2025/09/18 09:22:43 UTC
[I] Supports trimming when casting strings to numbers/booleans [auron]
richox opened a new issue, #1316:
URL: https://github.com/apache/auron/issues/1316
**Is your feature request related to a problem? Please describe.**
<!--
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-->
currently, auron does not support casting strings to numbers with whitespaces. like `cast(" 1.234 " as double)` is returning NULL.
spark and hive have supported this feature in newer versions:
https://issues.apache.org/jira/browse/SPARK-28023
https://issues.apache.org/jira/browse/SPARK-28023
**Describe the solution you'd like**
<!--
A clear and concise description of what you want to happen.
-->
auron should also support this feature, for keeping backward compatibility with older spark/hive version, we can provide an conf to enable or disable it.
**Describe alternatives you've considered**
<!--
A clear and concise description of any alternative solutions or features you've considered.
-->
**Additional context**
<!--
Add any other context or screenshots about the feature request here.
-->
--
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: commits-unsubscribe@auron.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Supports trimming when casting strings to numbers/booleans [auron]
Posted by "hhhizzz (via GitHub)" <gi...@apache.org>.
hhhizzz commented on issue #1316:
URL: https://github.com/apache/auron/issues/1316#issuecomment-3310420081
Casting in Spark is very complex. Auron's current implementation doesn't fully cover it.
I think we can start by implementing **a simple handling for trim** to solve this issue first.
And later port Spark's expression tests over completely to gradually address the differences in Spark expressions.
Ref:
Spark's trim logic PR for int/long: https://github.com/apache/spark/commit/2dd6807e421c96d0aaafc57ceb48f50f66f9d2e7#diff-5db49949ea798670cfe18d6dfd43621eec9c2745164f1e9e58217b2725bebc92
And Spark's trim logic for float/double is depend on the JDK's implement: https://github.com/openjdk/jdk/blob/5855fd2f654175c05341cc03ebf188d4db3e407d/src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java#L1789C9-L1789C63
--
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: commits-unsubscribe@auron.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Supports trimming when casting strings to numbers/booleans [auron]
Posted by "richox (via GitHub)" <gi...@apache.org>.
richox closed issue #1316: Supports trimming when casting strings to numbers/booleans
URL: https://github.com/apache/auron/issues/1316
--
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: commits-unsubscribe@auron.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Supports trimming when casting strings to numbers/booleans [auron]
Posted by "hhhizzz (via GitHub)" <gi...@apache.org>.
hhhizzz commented on issue #1316:
URL: https://github.com/apache/auron/issues/1316#issuecomment-3316092683
manually testing result(first 2 rows have whitespace):

--
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: commits-unsubscribe@auron.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org