Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-2749

Boolean test fails when querying to identify current Drillbit in SQLLine

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.9.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      RHEL 6.4

      Description

      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;

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kkhatua Kunal Khatua
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: