The reason is that some expressions ignore the visibility and return non-null values for invisible rows. Examples include literal expression and simd-optimized expressions such as =. The CASE expression doesn't mask invisible rows in the condition result, so later values may override earlier ones.
Continuing on from this, for our data chunks, we should check if they contain any invisible records, before running any expressions on it.
https://github.com/risingwavelabs/risingwave/pull/13890#issue-2033777281
Continuing on from this, for our data chunks, we should check if they contain any invisible records, before running any expressions on it.