kasakrisz commented on code in PR #6986: URL: https://github.com/apache/hive/pull/6986#discussion_r4736462318
########## ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveAggregateInsertDeleteIncrementalRewritingRule.java: ########## @@ -76,11 +76,8 @@ * <pre> * FROM (select *, true flag from mv) mv right outer join _source_ source * ON (mv.a <=> source.a AND mv.b <=> source.b) - * INSERT INTO TABLE mv <- (insert new rows into the view) - * SELECT source.a, source.b, s, c - * WHERE mv.flag IS NULL - * INSERT INTO TABLE mv <- (update existing rows in the view) - * SELECT mv.ROW__ID, source.a, source.b, + * INSERT INTO TABLE mv <- (insert the new version of the updated rows) + * SELECT source.a, source.b, * CASE WHEN mv.s IS NULL AND source.s IS NULL THEN NULL <- (use case expression to handle nulls from both sides) * WHEN mv.s IS NULL THEN source.s Review Comment: Yes, it is simplified https://github.com/apache/hive/blob/c096b6758dbce31849f501d1daad069ca56dcef1/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveAggregateIncrementalRewritingRuleBase.java#L144-L150 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
