Xianqing He has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/18711 )

Change subject: IMPALA-11418: A statement that returns at most one row need not 
to spool results
......................................................................


Patch Set 8:

(3 comments)

> Patch Set 7:
>
> > Patch Set 7:
> >
> > > Patch Set 7:
> > >
> > > I found another way to optimize this. We can disable result spooling for 
> > > small queries and modify in 
> > > https://github.com/apache/impala/blob/f1420ae51b2e00ad093be64a0d2135ca36aa6514/fe/src/main/java/org/apache/impala/planner/Planner.java#L663-L667
> > > Is this way better?
> >
> > Or use the method SelectStmt#returnsExactlyOneRow, if the query return one 
> > row disable result spooling.
>
> If checkForSmallQueryOptimization is on, it implies that query will run in 
> single backend only. There might be a case later where we can extend this 
> spool disabling for large query that return only single row only. Checking 
> SelectStmt#returnsExactlyOneRow is probably a better alternative.

The final solution checks SelectStmt#returnsAtMostOneRow

http://gerrit.cloudera.org:8080/#/c/18711/4/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java
File fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java:

http://gerrit.cloudera.org:8080/#/c/18711/4/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java@474
PS4, Line 474: A statement that returns at most one row does not need to spool 
que
> nit: A statement that only selects constant does not need to spool query re
Done


http://gerrit.cloudera.org:8080/#/c/18711/4/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java@475
PS4, Line 475:
> nit: "result spooling is enabled"
Done


http://gerrit.cloudera.org:8080/#/c/18711/4/fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java@480
PS4, Line 480:             + "one row.");
> Can you add LOG.trace here? Like what we have in:
Done



--
To view, visit http://gerrit.cloudera.org:8080/18711
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icd4d73c21106048df68a270cf03d4abd56bd3aac
Gerrit-Change-Number: 18711
Gerrit-PatchSet: 8
Gerrit-Owner: Xianqing He <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>
Gerrit-Reviewer: Xianqing He <[email protected]>
Gerrit-Comment-Date: Fri, 09 Sep 2022 09:18:01 +0000
Gerrit-HasComments: Yes

Reply via email to