[
https://issues.apache.org/jira/browse/DRILL-8136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17602362#comment-17602362
]
ASF GitHub Bot commented on DRILL-8136:
---------------------------------------
jnturton commented on PR #2638:
URL: https://github.com/apache/drill/pull/2638#issuecomment-1242020822
> This is really a MAJOR usability improvement. Will it also be able to cast
`"true"` and `"false"` as boolean values? Likewise for:
>
> * True
>
> * TRUE
>
> * TrUe
>
>
> etc....
It's prepared to try. There situations in which things break elsewhere.
```
1 row selected (0.576 seconds)
apache drill> select not('true');
EXPR$0 false
1 row selected (0.184 seconds)
apache drill> select not('false');
EXPR$0 true
1 row selected (0.151 seconds)
apache drill> select not('False');
EXPR$0 true
1 row selected (0.142 seconds)
apache drill> select not('TRUE');
EXPR$0 false
1 row selected (0.12 seconds)
apache drill> select not('FaLsE');
EXPR$0 true
1 row selected (0.127 seconds)
apache drill> select and(true, 'false');
Error: SYSTEM ERROR: IllegalArgumentException: Input does not have type of
BitHolder or NullableBitHolder.
```
> Overhaul implict type casting logic
> -----------------------------------
>
> Key: DRILL-8136
> URL: https://issues.apache.org/jira/browse/DRILL-8136
> Project: Apache Drill
> Issue Type: Improvement
> Reporter: Esther Buchwalter
> Assignee: James Turton
> Priority: Minor
>
> The existing implicit casting system is built on simplistic total ordering of
> data types[1] that yields oddities such as TINYINT being regarded as the
> closest numeric type to VARCHAR or DATE the closest type to FLOAT8. This, in
> turn, hurts the range of data types with which SQL functions can be used.
> E.g. `select sqrt('3.1415926')` works in many RDBMSes but not in Drill while,
> confusingly, `select '123' + 456` does work in Drill. In addition the
> limitations of the existing type precedence list mean that it has been
> supplmented with ad hoc secondary casting rules that go in the opposite
> direction.
> This Issue proposes a new, more flexible definition of casting distance based
> on a weighted directed graph built over the Drill data types.
> [1]
> [https://drill.apache.org/docs/supported-data-types/#implicit-casting-precedence-of-data-types]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)