Hi Xuyang, thanks for driving this valuable discussion.
I think it makes sense to improve batch processing capability for FlinkSQL.
Using Query hints can make the optimization more flexible and accurate.
After going through the design doc, I have some confusion maybe you can
help to clarify.

Firstly, table alias could be supported in the hint?

If users specify the left table as an alias called t_l and use t_l in the
hint, like /*+ SHUFFLE_HASH(t_l) */, as far as I know, we can not get the
relationship between t_l and the real table name from RelNode, could we
link the hint to the join node correctly?

Secondly, could you demonstrate more about '*Join Hint semantic check', *how
> could we check the table name or view name?

The Query hint will be propagated from the root node to the leaf node, and
the relationship will be recorded in 'inheritPath'. I think the
inherit info should also be used to check, not only using the table name.
What do you think about this?

best
zoucao

Jark Wu <imj...@gmail.com> 于2022年5月7日周六 12:46写道:

> Hi Xuyang,
>
> Thanks for starting this discussion. Join Hint is a long-time requested
> feature.
> I have briefly gone through the design doc. Join Hint is a public API for
> SQL syntax.
> It should work for both streaming and batch SQL. I understand some special
> hints
> may only work for batch SQL. Could you demonstrate how the hints affect
> stream SQL as well?
>
> Besides that, could you move your design docs into the wiki?
> Google docs are usually used for offline discussion.
> The discussion on google docs is not very visible to the community.
> So we would like to move designs to the wiki and move discussions to the
> mailing list.
>
> Best,
> Jark
>
>
>
>
> On Fri, 6 May 2022 at 11:07, Xuyang <xyzhong...@163.com> wrote:
>
> > Hi, all.
> >     I want to start a discussion about the FLIP-229: Introduces Join Hint
> > for Flink SQL Batch Job(The cwiki[1] is not ready completely but you can
> > see the whole details in docs[2]).
> > Join Hint is a common solution in many popular computing engines and DBs
> > to improve the shortcomings of the optimizer by intervening in optimizing
> > the plan. By Join Hint, users can intervene in the selection of the join
> > strategy in optimizer, and manually optimize the execution plan to
> improve
> > the performance of the query.
> >     In this FLIP, we propose some join hints by the existing join
> > strategies in Flink SQL for Batch job.
> > I'm look forward to your feedback about FLIP-229.
> >
> >
> >
> >
> > --
> >
> >     Best!
> >     Xuyang
> >
> >
> > [1]
> >
> https://cwiki.apache.org/confluence/display/FLINK/FLIP-229%3A+Introduces+Join+Hint+for+Flink+SQL+Batch+Job
> > [2]
> >
> https://docs.google.com/document/d/1IL00ME0Z0nlXGDWTUPODobVQMAm94PAPr9pw9EdGkoQ/edit?usp=sharing
>

Reply via email to