thomasrebele commented on code in PR #6986: URL: https://github.com/apache/hive/pull/6986#discussion_r4708856255
########## 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: Not related to the PR: Couldn't we simplify this to `CASE WHEN mv.s IS NULL THEN source.s`? I haven't found yet whether that's just an explanatory comment, or whether (and where) the CASE statement is actually generated. -- 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]
