Hi team,

We are facing a scenario where two tables are outer joined but only fields
from the outer side table are used and the join key of the inner side table
is guaranteed to be unique. Take the following simplified query as an
example, where s.id is guaranteed to be unique:

select t.* from t left join s on t.s_id = s.id;

I noticed that Impala has supported a nonforced primary key in the create
table statement (Ihttps://issues.apache.org/jira/browse/IMPALA-3531), we
can utilize the nonforced primary key as a hint to eliminate the outer join
to a simple scan on the outer side table. i.e, the above example can be
optimized to:

select t.* from t;

Is there a plan to support this optimization in the community? If not, I'm
willing to contribute to this.

Best regards,
Jian.

Reply via email to