You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Kunal Khatua (JIRA)" <ji...@apache.org> on 2015/04/10 19:43:12 UTC

[jira] [Created] (DRILL-2749) Boolean test fails when querying to identify current Drillbit in SQLLine

Kunal Khatua created DRILL-2749:
-----------------------------------

             Summary: Boolean test fails when querying to identify current Drillbit in SQLLine
                 Key: DRILL-2749
                 URL: https://issues.apache.org/jira/browse/DRILL-2749
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 0.9.0
         Environment: RHEL 6.4
            Reporter: Kunal Khatua
             Fix For: 0.9.0


When trying to query and filter out the currently servicing Drillbit, 
e.g.
0: jdbc:drill:schema=dfs> select * from sys.drillbits;
+------------+------------+--------------+------------+------------+
|    host    | user_port  | control_port | data_port  |  current   |
+------------+------------+--------------+------------+------------+
| drlvm-123.qa.lab | 31010      | 31011        | 31012      | true       |
| drlvm-121.qa.lab | 31010      | 31011        | 31012      | false      |
| drlvm-122.qa.lab | 31010      | 31011        | 31012      | false      |
+------------+------------+--------------+------------+------------+

a SQL Parsing exception is thrown when running the following:
0: jdbc:drill:schema=dfs> select * from sys.drillbits where current = true;
Query failed: Query failed: Failure parsing SQL. Encountered "where current" at line 1, column 29.
Was expecting one of:
....
Error: exception while executing query: Failure while executing query. (state=,code=0)

The system table description is: 
0: jdbc:drill:schema=dfs> describe sys.drillbits;
+-------------+------------+-------------+
| COLUMN_NAME | DATA_TYPE  | IS_NULLABLE |
+-------------+------------+-------------+
| host        | VARCHAR    | NO          |
| user_port   | INTEGER    | NO          |
| control_port | INTEGER    | NO          |
| data_port   | INTEGER    | NO          |
| current     | BOOLEAN    | NO          |
+-------------+------------+-------------+

Alternatives also failed:
select * from sys.drillbits where current = `true`;
select * from sys.drillbits where current = 1;
select * from sys.drillbits where current = '1';
select * from sys.drillbits where current;

Interestingly, when testing against sys.options; the boolean predicates work as expected (in both formats):
select * from sys.options where bool_val = true;
select * from sys.options where bool_val;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)