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

Create TopProject with validatedNodeType after PHYSICAL phase

    XMLWordPrintableJSON

Details

    Description

      When RDBMS storage plugin is enabled, during query execution certain JDBC rules are added.
      One of the rules is ProjectRemoveRule. Drill also uses this rule but during phases when it considers it useful, for example, during LOGICAL and JOIN_PLANNING. On the contrary, storage plugin rules are added to any phase of query planning. Thus it results to project stage to be removed when actually it is needed.

      Sometimes when ProjectRemoveRule decides that project is trivial and removes it, during this stage Drill added column alias or removed implicit columns.

      For example, with RDBMS plugin enabled, alias is not displayed for simple query:

      0: jdbc:drill:zk=local> create temporary table t as select * from sys.version;
      SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
      SLF4J: Defaulting to no-operation (NOP) logger implementation
      SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
      +-----------+----------------------------+
      | Fragment  | Number of records written  |
      +-----------+----------------------------+
      | 0_0       | 1                          |
      +-----------+----------------------------+
      1 row selected (0.623 seconds)
      0: jdbc:drill:zk=local> select version as current_version from t;
      +------------------+
      |     version      |
      +------------------+
      | 1.11.0-SNAPSHOT  |
      +------------------+
      1 row selected (0.28 seconds)
      

      Proposed fix is to move the creating of TopProject with validatedNodeType after physical planning is done.

      Attachments

        Issue Links

          Activity

            People

              arina Arina Ielchiieva
              arina Arina Ielchiieva
              Jinfeng Ni Jinfeng Ni
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: