Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Impala 2.7.0
    • Fix Version/s: None
    • Component/s: Frontend
    • Labels:

      Description

      As of 2.0, Impala supports query hints in a number of different places, and in different formats. Standardizing these would make for a cleaner implementation.

      Proposal
      Adopt Oracle hint grammar:
      The hint syntax must follow immediately after a CREATE, INSERT, UPDATE, DELETE, SELECT, or MERGE keyword that begins the statement block.

      /*+ hint [ string ] [ hint [ string ] ]... */
      --+ hint [ string ] [ hint [ string ] ]...
      

      where:

      • The plus sign (+) causes Oracle to interpret the comment as a list of hints. The plus sign must follow immediately after the comment delimiter. No space is permitted.
      • hint is one of the hints discussed in this section. The space between the plus sign and the hint is optional. If the comment contains multiple hints, then separate the hints by at least one space.
      • string is other commenting text that can be interspersed with the hints.

      Given hints appear within a SQL comment, this should also reduce incompatibilities with other engines that may share query text or things like SQL views that may contain embedded hints.

      Examples (from Oracle)

      INSERT /*+ APPEND PARALLEL(target_table, 16) PQ_DISTRIBUTE(target_table, NONE) */
      INTO target_table
      SELECT * FROM source_table;
      
      CREATE /*+ PQ_DISTRIBUTE(target_table, PARTITION) */ TABLE target_table
      NOLOGGING PARALLEL 16
      PARTITION BY HASH (l_orderkey) PARTITIONS 512
      AS SELECT * FROM source_table;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                grahn Greg Rahn
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: