You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Michael Smith (Code Review)" <ge...@cloudera.org> on 2024/08/20 21:29:14 UTC

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Michael Smith has uploaded this change for review. ( http://gerrit.cloudera.org:8080/21698


Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds QueryOptionScope to describe the scope of each query option. Uses
this to include relevant query option values in tuple cache calculation.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 456 insertions(+), 303 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/1
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <mi...@cloudera.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 11:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/11/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS11: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/11/common/thrift/Query.thrift@149
PS11, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/11/common/thrift/Query.thrift@150
PS11, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 11
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 21:39:03 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#4).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds QueryOptionScope to describe the scope of each query option. Uses
this to include relevant query option values in tuple cache calculation
via TQueryOptionsHash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 463 insertions(+), 304 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/4
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 4:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/21698/4/common/thrift/Query.thrift
File common/thrift/Query.thrift:

http://gerrit.cloudera.org:8080/#/c/21698/4/common/thrift/Query.thrift@149
PS4, Line 149:   1: required i64 hi
> Modifying/adding this required field might break the compatibility between 
False positive.


http://gerrit.cloudera.org:8080/#/c/21698/4/common/thrift/Query.thrift@150
PS4, Line 150:   2: required i64 lo
> Modifying/adding this required field might break the compatibility between 
False positive.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 29 Aug 2024 23:34:38 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 8:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/8/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS8: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/8/common/thrift/Query.thrift@149
PS8, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/8/common/thrift/Query.thrift@150
PS8, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 8
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 03 Oct 2024 19:02:32 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#11).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 221 insertions(+), 119 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/11
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 11
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Constructs a hash of non-default query options that are relevant to
query results; by default query options are included in the hash.
Passes this hash to the frontend for inclusion in the tuple cache key
on plan leaf nodes (which will be included in parent key calculation).

Modifies MurmurHash3 to be re-entrant so the backend can construct a
hash incrementally. This is slightly slower but more memory efficient
than accumulating all hash inputs in a contiguous array first.

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Adds startup flag 'tuple_cache_exempt_query_options' as a safety valve
for query options that might be important to exempt that we missed.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries. Adds startup flag
'tuple_cache_ignore_query_options' to omit query options for testing
certain tuple cache failure modes, where we need to use debug actions.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Reviewed-on: http://gerrit.cloudera.org:8080/21698
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 277 insertions(+), 124 deletions(-)

Approvals:
  Joe McDonnell: Looks good to me, approved
  Impala Public Jenkins: Verified

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 18
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 4:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/4/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS4: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/4/common/thrift/Query.thrift@149
PS4, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/4/common/thrift/Query.thrift@150
PS4, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 29 Aug 2024 23:33:28 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 5:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/16887/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 05 Sep 2024 22:40:11 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 4:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/16843/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 30 Aug 2024 00:03:10 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 17:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17123/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 17
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 08 Oct 2024 19:24:19 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#13).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries. Adds startup flag
tuple_cache_ignore_query_options to omit query options for testing
certain tuple cache failure modes, where we need to use debug actions.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 230 insertions(+), 124 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/13
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 13
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#9).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 211 insertions(+), 117 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/9
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 9
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 6:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/6/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS6: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/6/common/thrift/Query.thrift@149
PS6, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/6/common/thrift/Query.thrift@150
PS6, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 6
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 12 Sep 2024 18:31:43 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#3).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds QueryOptionScope to describe the scope of each query option. Uses
this to include relevant query option values in tuple cache calculation.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 455 insertions(+), 304 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/3
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 10:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17105/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 21:44:42 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 11:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17106/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 11
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 22:03:10 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 17:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/11007/ DRY_RUN=true


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 17
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Wed, 09 Oct 2024 02:38:29 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 11:

(1 comment)

Let's say that we have low cache hit rates. Is there a way we could tell whether it is related to different query options? Do we want a way to tune this at startup (i.e. a list of additional query options to exempt)?

If we wanted an approximation of how many distinct query option hashes there are, we could maintain an HLL sketch.

http://gerrit.cloudera.org:8080/#/c/21698/11/fe/src/main/java/org/apache/impala/planner/PlanNode.java
File fe/src/main/java/org/apache/impala/planner/PlanNode.java:

http://gerrit.cloudera.org:8080/#/c/21698/11/fe/src/main/java/org/apache/impala/planner/PlanNode.java@1388
PS11, Line 1388:     tupleCacheInfo_.hashThrift(queryOptsHash);
Nit: What do you think about incorporating it once (i.e. at leaf nodes) and then skipping it for higher up the tree?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 11
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Sat, 05 Oct 2024 00:00:36 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 12:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/12/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS12: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/12/common/thrift/Query.thrift@149
PS12, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/12/common/thrift/Query.thrift@150
PS12, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 12
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Mon, 07 Oct 2024 18:37:23 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 3:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@24
PS1, Line 24: 
> Seems no need
Done


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@79
PS1, Line 79:       TQueryOptionLevel::REGULAR, QueryOptionScope::Results)                             \
            :   REMOVED_QUERY_OPT_FN(allow_unsupported_formats, ALLOW_UNSUPPORTED_FORMATS)             \
> Here's a scenario:
Sure, seems like a reasonable concern.


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@405
PS1, Line 405: ionLevel::ADVANCED, Qu
> Could this also affect the result? As the mem_limit_executors is QueryOptio
I'm not sure. It looked mostly related to whether a query was admitted.


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.cc
File be/src/service/query-options.cc:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.cc@1428
PS1, Line 1428: HashState hash{
> Do you think one line like this is better?
Done


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h
File be/src/thirdparty/datasketches/MurmurHash3.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h@91
PS1, Line 91: MURMUR3_FORCE_INLINE void MurmurHash3_x64_128(const void* key, int lenBytes, HashState& out) {
> Using MurmurHash3 makes sense. It is ok to make MurmurHash3 more usable for
Ack


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h@99
PS1, Line 99: 
> nit. no need space
Done



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 29 Aug 2024 22:55:08 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 3:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/16842/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 29 Aug 2024 23:26:16 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 1:

(3 comments)

I'll do a pass on the individual query options, but here are some first thoughts.

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@44
PS1, Line 44: // Scope descriptor for each query option to help with evaluating how different aspects of
            : // query execution are affected. Defined as a bitmask for options that affect multiple.
            : enum class QueryOptionScope : uint8_t {
            :   None        = 0,      // Not part of any known scope
            :   Performance = 1 << 0, // Solely impacts performance without changing plan or results
            :   Plan        = 1 << 1, // Can result in a different query plan
            :   Results     = 1 << 2, // Can produce different results in fragments of a query plan
            :   All         = 0xFF    // Can affect any scope (mainly used for DEBUG_ACTION)
            : };
My first thought is that this is somewhat abstract. I'm concerned a developer may not recognize the importance of getting it right. I do think having some categorization of options is useful, independent of tuple caching.

An alternative would be to hash all options unless the option specifies a reason that it doesn't need to be included. Some valid reasons:
1. This option is never used outside the planner / coordinator. If we didn't send this to the executors, it wouldn't notice. A bunch of options fit here. (This is also something we could think about enforcing.)
2. It does go to the executor, but it has no impact on the results (including whether or not errors are generated).

The default for any new option is to not specify one of these reasons, so it would be hashed. Hashing too much is relatively harmless unless the query option is changing a lot.


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@79
PS1, Line 79:   QUERY_OPT_FN(abort_on_error, ABORT_ON_ERROR,                                           \
            :       TQueryOptionLevel::REGULAR, QueryOptionScope::None)                                \
Here's a scenario:
1. User runs query with ABORT_ON_ERROR=false and it runs into errors but continues and produces results.
2. User runs the same query with ABORT_ON_ERROR=true. If it hits the cache, the result would be from a run with ABORT_ON_ERROR=false and the query might succeed when it otherwise should fail.


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h
File be/src/thirdparty/datasketches/MurmurHash3.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h@91
PS1, Line 91: MURMUR3_FORCE_INLINE void MurmurHash3_x64_128(const void* key, int lenBytes, HashState& out) {
> I guess I could use HashUtil instead, just seemed like I'd want to also use
Using MurmurHash3 makes sense. It is ok to make MurmurHash3 more usable for our purpose.

At some point we may end up moving the datasketches code to the native toolchain. (They have done changes on top of this file.)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 29 Aug 2024 18:45:13 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 17: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 17
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Wed, 09 Oct 2024 07:40:17 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 11:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/10999/ DRY_RUN=true


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 11
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 21:57:00 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 16:

> Patch Set 16:
> 
> > (6 comments)
>  > 
>  > > Patch Set 11:
>  > >
>  > > (1 comment)
>  > >
>  > > Let's say that we have low cache hit rates. Is there a way we
>  > could tell whether it is related to different query options? Do we
>  > want a way to tune this at startup (i.e. a list of additional query
>  > options to exempt)?
>  > >
>  > > If we wanted an approximation of how many distinct query option
>  > hashes there are, we could maintain an HLL sketch.
>  > 
>  > I don't think it makes sense as a startup option, that could lead
>  > to selecting options that aren't actually safe.
>  > 
>  > I don't see a good way to track whether low hit rate is related to
>  > query options without grabbing a bunch of queries. Other options
>  > would require tracking the query options cache key as a separate
>  > component and making it part of the cache key, with a metric we
>  > update based on misses. And it would make the cache more
>  > complicated to identify that a miss was specifically due to the
>  > query options cache key. I think reviewing profiles will be
>  > sufficient.
> 
> If we diagnose low hit rate to be related to differences in query options and those differences are not related to correctness, the startup option would give us a way to workaround it without a new build / release. Someone could use it to blow themselves up, but it also could save someone a lot of hassle waiting for a new build / release.
> 
> If you don't want to do that in this change, we can file a separate JIRA.

I can add a hidden flag.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 16
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 08 Oct 2024 16:50:07 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 10:

Another rebase for merge conflicts.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 21:19:19 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 9:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17095/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 9
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 03 Oct 2024 21:11:53 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 10:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/10/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS10: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/10/common/thrift/Query.thrift@149
PS10, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/10/common/thrift/Query.thrift@150
PS10, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 21:20:07 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#8).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 199 insertions(+), 117 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/8
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 8
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/16738/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 20 Aug 2024 22:00:16 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 8:

Rebased to resolve merge conflicts. Had to update test_tuple_cache a little.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 8
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 03 Oct 2024 19:02:06 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 16:

> (6 comments)
 > 
 > > Patch Set 11:
 > >
 > > (1 comment)
 > >
 > > Let's say that we have low cache hit rates. Is there a way we
 > could tell whether it is related to different query options? Do we
 > want a way to tune this at startup (i.e. a list of additional query
 > options to exempt)?
 > >
 > > If we wanted an approximation of how many distinct query option
 > hashes there are, we could maintain an HLL sketch.
 > 
 > I don't think it makes sense as a startup option, that could lead
 > to selecting options that aren't actually safe.
 > 
 > I don't see a good way to track whether low hit rate is related to
 > query options without grabbing a bunch of queries. Other options
 > would require tracking the query options cache key as a separate
 > component and making it part of the cache key, with a metric we
 > update based on misses. And it would make the cache more
 > complicated to identify that a miss was specifically due to the
 > query options cache key. I think reviewing profiles will be
 > sufficient.

If we diagnose low hit rate to be related to differences in query options and those differences are not related to correctness, the startup option would give us a way to workaround it without a new build / release. Someone could use it to blow themselves up, but it also could save someone a lot of hassle waiting for a new build / release.

If you don't want to do that in this change, we can file a separate JIRA.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 16
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 08 Oct 2024 00:06:14 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#14).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries. Adds startup flag
'tuple_cache_ignore_query_options' to omit query options for testing
certain tuple cache failure modes, where we need to use debug actions.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 230 insertions(+), 124 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/14
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 14
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 5:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc
File be/src/service/query-options.cc:

http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@120
PS5, Line 120: \
> nit. unnecessary change
Oops, I missed some cleanup. Done.


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@138
PS5, Line 138: \
> nit. unnecessary change
Done


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@165
PS5, Line 165: \
> nit. unnecessary change
Done


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@1398
PS5, Line 1398: template<typename T, typename std::enable_if_t<std::is_enum<T>::value>* = nullptr>
              : static void HashQueryOptionValue(const T& option, HashState& hash) {
              :   MurmurHash3_x64_128(&option, sizeof(option), hash);
              : }
              : 
              : template<typename T, typename std::enable_if_t<std::is_arithmetic<T>::value>* = nullptr>
              : static void HashQueryOptionValue(const T& option, HashState& hash) {
              :   MurmurHash3_x64_128(&option, sizeof(option), hash);
              : }
> Seems merging the two into one is possible.
Done


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@1450
PS5, Line 1450: \
> nit. unnecessary change
Done


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@1454
PS5, Line 1454: auto
> Is the original 'int' not working?
TImpalaQueryOptions::type would be the correct option. I think I meant to avoid having to change the '\' indentation. Switched to the correct type.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 12 Sep 2024 18:31:13 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 17: Code-Review+2

Thanks, this looks good


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 17
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Wed, 09 Oct 2024 02:36:58 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 6:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/16940/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 6
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 12 Sep 2024 19:02:11 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 6: Code-Review+1

(1 comment)

Thanks Michael. LGTM.

http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc
File be/src/service/query-options.cc:

http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@1454
PS5, Line 1454: }   
> TImpalaQueryOptions::type would be the correct option. I think I meant to a
Done



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 6
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 12 Sep 2024 21:28:50 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@24
PS1, Line 24: vector
Seems no need


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@405
PS1, Line 405: mem_limit_coordinators
Could this also affect the result? As the mem_limit_executors is QueryOptionScope::Results, I'll take a closer look at it.


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.cc
File be/src/service/query-options.cc:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.cc@1428
PS1, Line 1428: HashState hash;
Do you think one line like this is better?
HashState hash = {QUERY_OPTION_HASH_SEED, QUERY_OPTION_HASH_SEED};


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.cc@1431
PS1, Line 1431: (SCOPE) & QueryOptionScope::Results
It seems like the code could potentially support hashing more types in the future. For example, the codegen caching might use a more refined key that combines with the query options, so it can use here to do some similar hasing. However, it's a good to focus on hashing just the results in this patch


http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h
File be/src/thirdparty/datasketches/MurmurHash3.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h@99
PS1, Line 99:  
nit. no need space



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 29 Aug 2024 18:56:00 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#12).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 230 insertions(+), 124 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/12
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 12
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 12: Code-Review+1

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21698/12//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/21698/12//COMMIT_MSG@9
PS12, Line 9: Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
Maybe also mention the new added start flag tuple_cache_ignore_query_options



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 12
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Mon, 07 Oct 2024 22:29:00 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#17).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Constructs a hash of non-default query options that are relevant to
query results; by default query options are included in the hash.
Passes this hash to the frontend for inclusion in the tuple cache key
on plan leaf nodes (which will be included in parent key calculation).

Modifies MurmurHash3 to be re-entrant so the backend can construct a
hash incrementally. This is slightly slower but more memory efficient
than accumulating all hash inputs in a contiguous array first.

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Adds startup flag 'tuple_cache_exempt_query_options' as a safety valve
for query options that might be important to exempt that we missed.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries. Adds startup flag
'tuple_cache_ignore_query_options' to omit query options for testing
certain tuple cache failure modes, where we need to use debug actions.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 277 insertions(+), 124 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/17
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 17
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 17:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/17/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS17: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/17/common/thrift/Query.thrift@149
PS17, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/17/common/thrift/Query.thrift@150
PS17, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 17
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 08 Oct 2024 18:58:38 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 7:

Rebased.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 7
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 01 Oct 2024 16:33:55 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 5:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/5/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS5: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/5/common/thrift/Query.thrift@149
PS5, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/5/common/thrift/Query.thrift@150
PS5, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 05 Sep 2024 22:09:09 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h
File be/src/thirdparty/datasketches/MurmurHash3.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h@91
PS1, Line 91: MURMUR3_FORCE_INLINE void MurmurHash3_x64_128(const void* key, int lenBytes, HashState& out) {
> Alternative to making this interface re-entrant is to construct a single ve
I guess I could use HashUtil instead, just seemed like I'd want to also use MurmurHash3 in the backend because that's what we used in the frontend.

https://gerrit.cloudera.org/c/21541/8/be/src/exec/tuple-cache-node.cc#257 is using HashUtil.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 27 Aug 2024 20:42:40 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h
File be/src/thirdparty/datasketches/MurmurHash3.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/thirdparty/datasketches/MurmurHash3.h@91
PS1, Line 91: MURMUR3_FORCE_INLINE void MurmurHash3_x64_128(const void* key, int lenBytes, HashState& out) {
Alternative to making this interface re-entrant is to construct a single vector of all the data we want to hash first, then run through this function. That seemed less efficient.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 20 Aug 2024 21:31:14 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#5).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 204 insertions(+), 122 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/5
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#7).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 204 insertions(+), 126 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/7
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 7
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#16).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Constructs a hash of non-default query options that are relevant to
query results; by default query options are included in the hash.
Passes this hash to the frontend for inclusion in the tuple cache key
on plan leaf nodes (which will be included in parent key calculation).

Modifies MurmurHash3 to be re-entrant so the backend can construct a
hash incrementally. This is slightly slower but more memory efficient
than accumulating all hash inputs in a contiguous array first.

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries. Adds startup flag
'tuple_cache_ignore_query_options' to omit query options for testing
certain tuple cache failure modes, where we need to use debug actions.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 230 insertions(+), 124 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/16
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 16
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 7:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/7/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS7: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/7/common/thrift/Query.thrift@149
PS7, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/7/common/thrift/Query.thrift@150
PS7, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 7
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 01 Oct 2024 16:34:51 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 8:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17091/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 8
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 03 Oct 2024 19:28:35 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 9:

(3 comments)

gerrit-auto-critic failed. You can reproduce it locally using command:

  python2 bin/jenkins/critique-gerrit-review.py --dryrun

To run it, you might need a virtual env with virtualenv installed.

http://gerrit.cloudera.org:8080/#/c/21698/9/common/thrift/Query.thrift
File common/thrift/Query.thrift:

PS9: 
This file is used in communication between impalad and catalogd/statestore. Please make sure impalads can still work with new/old versions of catalogd and statestore. Basically only new optional fields can be added.


http://gerrit.cloudera.org:8080/#/c/21698/9/common/thrift/Query.thrift@149
PS9, Line 149:   1: required i64 hi
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade


http://gerrit.cloudera.org:8080/#/c/21698/9/common/thrift/Query.thrift@150
PS9, Line 150:   2: required i64 lo
Modifying/adding this required field might break the compatibility between impalad and catalogd/statestore during upgrade



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 9
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 03 Oct 2024 20:46:57 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 9:

(5 comments)

Thinking about which query options should be exempt, I'm trying to think about which ones could vary from session to session or query to query. That could happen if sessions map to a different resource pool (which can specify default query options for that resource pool). That makes me think that we should exempt mem_limit.

I'm looking through the list to see if others stand out.

The general risk is that some customer could have lots of query option variability and have bad cache hit rate.

http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@77
PS9, Line 77:   QUERY_OPT_FN(mem_limit, MEM_LIMIT, TQueryOptionLevel::REGULAR)                         \
I could see this one being different across different queries or changing over time. I think we want to share results across queries with different values for this.

I think we should make this exempt.


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@83
PS9, Line 83:   QUERY_OPT_FN(request_pool, REQUEST_POOL, TQueryOptionLevel::REGULAR)                   \
I think we want to share results across different request pools. I think we should make this exempt.


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@194
PS9, Line 194:   QUERY_OPT_FN(statement_expression_limit, STATEMENT_EXPRESSION_LIMIT,                   \
             :       TQueryOptionLevel::REGULAR)                                                        \
Let's make this exempt. It applies a limit, but it otherwise has no impact on execution.


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@211
PS9, Line 211:   QUERY_OPT_FN(mem_limit_executors, MEM_LIMIT_EXECUTORS, TQueryOptionLevel::ADVANCED)    \
Same as mem_limit


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@326
PS9, Line 326:   QUERY_OPT_FN(mem_limit_coordinators, MEM_LIMIT_COORDINATORS,                           \
             :       TQueryOptionLevel::ADVANCED) 
I think we should exempt this



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 9
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 23:34:29 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 5:

(6 comments)

LGTM, some minor stuff

http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc
File be/src/service/query-options.cc:

http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@120
PS5, Line 120: \
nit. unnecessary change


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@138
PS5, Line 138: \
nit. unnecessary change


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@165
PS5, Line 165: \
nit. unnecessary change


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@1398
PS5, Line 1398: template<typename T, typename std::enable_if_t<std::is_enum<T>::value>* = nullptr>
              : static void HashQueryOptionValue(const T& option, HashState& hash) {
              :   MurmurHash3_x64_128(&option, sizeof(option), hash);
              : }
              : 
              : template<typename T, typename std::enable_if_t<std::is_arithmetic<T>::value>* = nullptr>
              : static void HashQueryOptionValue(const T& option, HashState& hash) {
              :   MurmurHash3_x64_128(&option, sizeof(option), hash);
              : }
Seems merging the two into one is possible.
template<typename T, typename std::enable_if_t<std::is_enum<T>::value || std::is_arithmetic<T>::value>* = nullptr>
static void HashQueryOptionValue(const T& option, HashState& hash) {
  MurmurHash3_x64_128(&option, sizeof(option), hash);
}


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@1450
PS5, Line 1450: \
nit. unnecessary change


http://gerrit.cloudera.org:8080/#/c/21698/5/be/src/service/query-options.cc@1454
PS5, Line 1454: auto
Is the original 'int' not working?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 12 Sep 2024 18:19:43 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#6).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 204 insertions(+), 126 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/6
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 6
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 7:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17078/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 7
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Tue, 01 Oct 2024 16:58:36 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#10).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 213 insertions(+), 118 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/10
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 10:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21698/10/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/10/be/src/service/query-options.h@61
PS10, Line 61:   QUERY_OPT_FN(debug_action, DEBUG_ACTION, TQueryOptionLevel::DEVELOPMENT)               \
This causes some issues with debug actions that are trying to test tuple caching specifically. I think I need a mode that ignores debug_action for tuple caching.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Fri, 04 Oct 2024 21:22:42 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 11:

(6 comments)

> Patch Set 11:
> 
> (1 comment)
> 
> Let's say that we have low cache hit rates. Is there a way we could tell whether it is related to different query options? Do we want a way to tune this at startup (i.e. a list of additional query options to exempt)?
> 
> If we wanted an approximation of how many distinct query option hashes there are, we could maintain an HLL sketch.

I don't think it makes sense as a startup option, that could lead to selecting options that aren't actually safe.

I don't see a good way to track whether low hit rate is related to query options without grabbing a bunch of queries. Other options would require tracking the query options cache key as a separate component and making it part of the cache key, with a metric we update based on misses. And it would make the cache more complicated to identify that a miss was specifically due to the query options cache key. I think reviewing profiles will be sufficient.

http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@77
PS9, Line 77:   QUERY_OPT_FN(mem_limit, MEM_LIMIT, TQueryOptionLevel::REGULAR)                         \
> I could see this one being different across different queries or changing o
Done


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@83
PS9, Line 83:   QUERY_OPT_FN(request_pool, REQUEST_POOL, TQueryOptionLevel::REGULAR)                   \
> I think we want to share results across different request pools. I think we
Done


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@194
PS9, Line 194:   QUERY_OPT_FN(statement_expression_limit, STATEMENT_EXPRESSION_LIMIT,                   \
             :       TQueryOptionLevel::REGULAR)                                                        \
> Let's make this exempt. It applies a limit, but it otherwise has no impact 
Done


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@211
PS9, Line 211:   QUERY_OPT_FN(mem_limit_executors, MEM_LIMIT_EXECUTORS, TQueryOptionLevel::ADVANCED)    \
> Same as mem_limit
Done


http://gerrit.cloudera.org:8080/#/c/21698/9/be/src/service/query-options.h@326
PS9, Line 326:   QUERY_OPT_FN(mem_limit_coordinators, MEM_LIMIT_COORDINATORS,                           \
             :       TQueryOptionLevel::ADVANCED) 
> I think we should exempt this
Done


http://gerrit.cloudera.org:8080/#/c/21698/11/fe/src/main/java/org/apache/impala/planner/PlanNode.java
File fe/src/main/java/org/apache/impala/planner/PlanNode.java:

http://gerrit.cloudera.org:8080/#/c/21698/11/fe/src/main/java/org/apache/impala/planner/PlanNode.java@1388
PS11, Line 1388:     tupleCacheInfo_.hashThrift(queryOptsHash);
> Nit: What do you think about incorporating it once (i.e. at leaf nodes) and
Done



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 11
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Mon, 07 Oct 2024 18:38:33 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 12:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17113/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 12
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Mon, 07 Oct 2024 19:01:46 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Hello Kurt Deschler, Yida Wu, Joe McDonnell, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/21698

to look at the new patch set (#15).

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................

IMPALA-13186: Tag query option scope for tuple cache

Adds TUPLE_CACHE_EXEMPT_QUERY_OPT_FN to mark query options that can be
ignored when calculating a tuple cache hash.

Modifies MurmurHash3 to be re-entrant so we can construct a hash
incrementally. This is slightly slower but more memory efficient.

Removes duplicate printing logic for query options from child-query.cc
in favor of re-using TQueryOptionsToMap, which does the same thing.

Cleans up query-options.cc helpers so they're static and reduces
duplicate printing logic.

Adds test that different values for a relevant query option use
different cache entries. Adds startup flag
'tuple_cache_ignore_query_options' to omit query options for testing
certain tuple cache failure modes, where we need to use debug actions.

Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
---
M be/src/service/child-query.cc
M be/src/service/impala-server.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/thirdparty/datasketches/MurmurHash3.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/TupleCachePlanner.java
M tests/custom_cluster/test_tuple_cache.py
10 files changed, 230 insertions(+), 124 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/21698/15
-- 
To view, visit http://gerrit.cloudera.org:8080/21698
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 15
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Yida Wu (Code Review)" <ge...@cloudera.org>.
Yida Wu has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 16: Code-Review+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 16
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Mon, 07 Oct 2024 22:47:45 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Joe McDonnell (Code Review)" <ge...@cloudera.org>.
Joe McDonnell has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@44
PS1, Line 44: // Scope descriptor for each query option to help with evaluating how different aspects of
            : // query execution are affected. Defined as a bitmask for options that affect multiple.
            : enum class QueryOptionScope : uint8_t {
            :   None        = 0,      // Not part of any known scope
            :   Performance = 1 << 0, // Solely impacts performance without changing plan or results
            :   Plan        = 1 << 1, // Can result in a different query plan
            :   Results     = 1 << 2, // Can produce different results in fragments of a query plan
            :   All         = 0xFF    // Can affect any scope (mainly used for DEBUG_ACTION)
            : };
> So maybe invert Results to ResultsUnaffected? We could also skip this whole
I think having an extra argument on each of these is fine. We have to maintain a list somehow, and this seems like a reasonable place to do it.

I think I would make the enum specific to tuple caching and whether something doesn't need to be considered for tuple caching. We can use that sparingly to start, and the comment can explain the conditions when it is important to use it. I would leave the generic tagging for another time.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Wed, 04 Sep 2024 18:14:46 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@44
PS1, Line 44: // Macro to help generate functions that use or manipulate query options.
            : // If the DCHECK is hit then handle the missing query option below and update
            : // the DCHECK.
            : // Specifically, the DCHECK will make sure that the number of elements in
            : // the map _TImpalaQueryOptions_VALUES_TO_NAMES automatically generated in
            : // ImpalaService_types.cpp is equal to the largest integer associated with an
            : // option in the enum TImpalaQueryOptions (defined in ImpalaService.thrift)
            : // plus one. Thus, the second argument to the DCHECK has to be updated every
            : //
> I think having an extra argument on each of these is fine. We have to maint
Done



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 5
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 05 Sep 2024 22:08:17 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 11: Verified-1

Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/10999/


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 11
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Sat, 05 Oct 2024 03:18:02 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13186: Tag query option scope for tuple cache

Posted by "Michael Smith (Code Review)" <ge...@cloudera.org>.
Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21698 )

Change subject: IMPALA-13186: Tag query option scope for tuple cache
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h
File be/src/service/query-options.h:

http://gerrit.cloudera.org:8080/#/c/21698/1/be/src/service/query-options.h@44
PS1, Line 44: // Scope descriptor for each query option to help with evaluating how different aspects of
            : // query execution are affected. Defined as a bitmask for options that affect multiple.
            : enum class QueryOptionScope : uint8_t {
            :   None        = 0,      // Not part of any known scope
            :   Performance = 1 << 0, // Solely impacts performance without changing plan or results
            :   Plan        = 1 << 1, // Can result in a different query plan
            :   Results     = 1 << 2, // Can produce different results in fragments of a query plan
            :   All         = 0xFF    // Can affect any scope (mainly used for DEBUG_ACTION)
            : };
> My first thought is that this is somewhat abstract. I'm concerned a develop
So maybe invert Results to ResultsUnaffected? We could also skip this whole idea and just have a list of query options that are safe to cache.

Some are safe to cache but also change the plan, so they'd automatically have a different plan structure. It probably doesn't matter much whether they're directly included or not.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1f4802ad9548749cd43df8848b6f46dca3739ae7
Gerrit-Change-Number: 21698
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Yida Wu <wy...@gmail.com>
Gerrit-Comment-Date: Thu, 29 Aug 2024 22:41:07 +0000
Gerrit-HasComments: Yes