You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Chun Chang (JIRA)" <ji...@apache.org> on 2015/04/28 21:10:06 UTC
[jira] [Closed] (DRILL-2827) Allow implicit cast from strings to
boolean
[ https://issues.apache.org/jira/browse/DRILL-2827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chun Chang closed DRILL-2827.
-----------------------------
Assignee: Chun Chang (was: Aman Sinha)
verified fix.
{code}
0: jdbc:drill:schema=dfs.drillTestDirAdvanced> select t.gbyt, count(t.id), max(t.id), min(t.id), avg(t.id) from `complex.json` t where t.bool = 'true' group by t.gbyt order by t.gbyt;
+------------+------------+------------+------------+------------+
| gbyt | EXPR$1 | EXPR$2 | EXPR$3 | EXPR$4 |
+------------+------------+------------+------------+------------+
| aaa | 27885 | 999984 | 11 | 502709.9194190425 |
| bool | 27749 | 999975 | 6 | 498296.41857364227 |
| fl | 27994 | 999920 | 127 | 501838.32917768095 |
| gbyi | 27685 | 999980 | 32 | 500964.92931190174 |
| gbyt | 27632 | 999927 | 31 | 500927.35940214247 |
| id | 27841 | 999972 | 17 | 501877.7468840918 |
| nul | 27826 | 999958 | 23 | 497109.76101487817 |
| ooa | 27837 | 999982 | 13 | 502178.930739663 |
| oooa | 27933 | 999986 | 2 | 501551.77324311744 |
| ooof | 27536 | 999856 | 34 | 497024.9862361999 |
| oooi | 27671 | 999983 | 50 | 501490.73687253805 |
| ooos | 28103 | 1000000 | 33 | 500430.64313418494 |
| saa | 27688 | 999968 | 19 | 497959.07992632187 |
| sba | 28025 | 999989 | 42 | 499305.7941480821 |
| sfa | 27833 | 999998 | 66 | 495910.7460927676 |
| sia | 27941 | 999962 | 51 | 498961.22855302243 |
| soa | 27478 | 999977 | 12 | 501030.2922701798 |
| str | 27904 | 999993 | 43 | 498966.9367115826 |
+------------+------------+------------+------------+------------+
{code}
added new test case - complex47.q
> Allow implicit cast from strings to boolean
> -------------------------------------------
>
> Key: DRILL-2827
> URL: https://issues.apache.org/jira/browse/DRILL-2827
> Project: Apache Drill
> Issue Type: Bug
> Components: Functions - Drill
> Affects Versions: 0.8.0
> Reporter: Aman Sinha
> Assignee: Chun Chang
> Fix For: 0.9.0
>
> Attachments: 0001-DRILL-2827-Allow-implicit-cast-from-string-to-boolea.patch
>
>
> The following query fails:
> {code}
> select * from dfs.`bool.json` where key = 'true';
> Error in expression at index -1. Error: Missing function implementation: [castINT(BIT-REQUIRED)]. Full expression: --UNKNOWN EXPRESSION--..
> {code}
> The reason is that a prior fix for DRILL-2590 removed the implicit casting from string literals to boolean. That fix is valid for non-string values.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)