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

Implicit columns are shown when Jdbc plugin is enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.8.0
    • 1.11.0
    • None
    • None

    Description

      When any Jdbc Plugin enabled (ex: MySql) implicit columns are returned as part of select * query.
      Simple json:

      {id: 1, name: "Bob"}
      

      When Jdbc plugin is enabled:

      0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`;
      +----------------------------------+----------------------+--------------+---------+-----+-------+
      |               fqn                |       filepath       |   filename   | suffix  | id  | name  |
      +----------------------------------+----------------------+--------------+---------+-----+-------+
      | /home/osboxes/files/simple.json  | /home/osboxes/files  | simple.json  | json    | 1   | Bob   |
      +----------------------------------+----------------------+--------------+---------+-----+-------+
      1 row selected (0.203 seconds)
      0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`;
      +------+------+
      | text | json |
      +------+------+
      | 00-00    Screen
      00-01      Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]])
      

      When Jdbc plugin is disabled:

      0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`;
      +-----+-------+
      | id  | name  |
      +-----+-------+
      | 1   | Bob   |
      +-----+-------+
      1 row selected (0.547 seconds)
      0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`;
      +------+------+
      | text | json |
      +------+------+
      | 00-00    Screen
      00-01      Project(*=[$0])
      00-02        Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]])
      

      The problem is that implicit columns are removed from queries with select * clause during project stage. But JdbcStoragePlugin adds ProjectRemoveRules.class to rules which simplifies query plan and removes project stage.

      https://github.com/apache/drill/blob/master/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java#L140

      Attachments

        Issue Links

          Activity

            People

              arina Arina Ielchiieva
              arina Arina Ielchiieva
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: