kasakrisz opened a new pull request #1995: URL: https://github.com/apache/hive/pull/1995
### What changes were proposed in this pull request? When transforming plan of materialized view rebuild to incremental rebuild in case of the view definition has aggregate: * Use null safe equality operators in join condition instead of equality operators * Introduce a Project on top of MV scan having all columns from the view plus a boolean literal which indicates whether the row with the key values coming from the joinRightInput exists in the view. Use this flag in `CalcitePlanner.fixUpASTAggregateIncrementalRebuild` to decide which branch a row should go: update or insert. * Add null checks of aggregated values when calculated new aggregated values. ### Why are the changes needed? Rows with null aggregate keys and aggregated values was not handled by incremental MV rebuild and it could lead to data corruption. ### Does this PR introduce _any_ user-facing change? Yes. Query result changes. See jira for example. ### How was this patch tested? ``` mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=materialized_view_create_rewrite_nulls.q,materialized_view_create_rewrite_4.q,materialized_view_create_rewrite_one_key_gby.q -pl itests/qtest -Pitests ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
