Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 2.7.0
-
None
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
- is related to
-
IMPALA-4167 Support insert plan hints for CREATE TABLE AS SELECT
- Resolved
-
IMPALA-2521 Introduce CLUSTERED plan hint for insert statements
- Resolved
- relates to
-
IMPALA-4168 Adopt Oracle-style hint placement for INSERT statements
- Resolved