-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Support query dump for materialized view #26431
Conversation
fe/fe-core/src/main/java/com/starrocks/http/HttpServerHandler.java
Outdated
Show resolved
Hide resolved
@@ -243,7 +243,9 @@ public static void analyze(InsertStmt insertStmt, ConnectContext session) { | |||
insertStmt.setTargetTable(table); | |||
insertStmt.setTargetPartitionIds(targetPartitionIds); | |||
insertStmt.setTargetColumns(targetColumns); | |||
session.getDumpInfo().addTable(database.getFullName(), table); | |||
if (session.getDumpInfo() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why check this?
why not check this before ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before queries always put the related tables/views/... into DumpInfo.
I've changed this to only save related infos when it's from HTTP query dump or enable_query_dump
is true. I think this is more reasonable.
fd9d1a0
to
07fef0f
Compare
Signed-off-by: Kevin Li <[email protected]>
Signed-off-by: Kevin Li <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
[FE PR Coverage Check]😍 pass : 107 / 127 (84.25%) file detail
|
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
To support query dump which query's table may contain mv, I did the changes: - Add "``" for output columns of Materialized View because mv's column may contain complex expressions (eg, `bitmap_union()`; - Only add dump info into QueryDumpInfo only when it's from HTTP query dump or `enable_query_dump` is true; - When adding mv into dump info, optimize the mv again because tables in query may be only a part of mv, and mv may contain other unique/foreign constraints in its properties. - Make the `tableMap ` in QueryDumpInfo ordered by the insert time because MV's replay needs the basic tables are created. - Mock some places to support MVs with external tables. To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include. (cherry picked from commit 4f6a915) # Conflicts: # fe/fe-core/src/test/java/com/starrocks/analysis/ShowCreateViewStmtTest.java
To support query dump which query's table may contain mv, I did the changes: - Add "``" for output columns of Materialized View because mv's column may contain complex expressions (eg, `bitmap_union()`; - Only add dump info into QueryDumpInfo only when it's from HTTP query dump or `enable_query_dump` is true; - When adding mv into dump info, optimize the mv again because tables in query may be only a part of mv, and mv may contain other unique/foreign constraints in its properties. - Make the `tableMap ` in QueryDumpInfo ordered by the insert time because MV's replay needs the basic tables are created. - Mock some places to support MVs with external tables. To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include. Signed-off-by: silverbullet233 <[email protected]>
To support query dump which query's table may contain mv, I did the changes: - Add "``" for output columns of Materialized View because mv's column may contain complex expressions (eg, `bitmap_union()`; - Only add dump info into QueryDumpInfo only when it's from HTTP query dump or `enable_query_dump` is true; - When adding mv into dump info, optimize the mv again because tables in query may be only a part of mv, and mv may contain other unique/foreign constraints in its properties. - Make the `tableMap ` in QueryDumpInfo ordered by the insert time because MV's replay needs the basic tables are created. - Mock some places to support MVs with external tables. To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include.
To support query dump which query's table may contain mv, I did the changes: - Add "``" for output columns of Materialized View because mv's column may contain complex expressions (eg, `bitmap_union()`; - Only add dump info into QueryDumpInfo only when it's from HTTP query dump or `enable_query_dump` is true; - When adding mv into dump info, optimize the mv again because tables in query may be only a part of mv, and mv may contain other unique/foreign constraints in its properties. - Make the `tableMap ` in QueryDumpInfo ordered by the insert time because MV's replay needs the basic tables are created. - Mock some places to support MVs with external tables. To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include. Signed-off-by: Kevin Li <[email protected]>
…) (#27154) To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include.
…Rocks#26431) (StarRocks#27154) To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include. Signed-off-by: Kevin Li <[email protected]>
…Rocks#26431) (StarRocks#27154) To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include. Signed-off-by: Kevin Li <[email protected]>
…Rocks#26431) (StarRocks#27154) To support dump mv on mv queries, I added two invisible session variables: - query_excluding_mv_names indicates Query's candidate mvs should exculde. - query_including_mv_names indicates Query's candidate mvs should include. Signed-off-by: Kevin Li <[email protected]>
To support query dump which query's table may contain mv, I did the changes:
bitmap_union()
;enable_query_dump
is true;tableMap
in QueryDumpInfo ordered by the insert time because MV's replay needs the basic tables are created.To support dump mv on mv queries, I added two invisible session variables:
I added three cases:
What type of PR is this:
Checklist:
Bugfix cherry-pick branch check: