What I donât understand why the iif statement is trying to evaluate the false part of expression. As shown with the first example, this should not happen.
As it is supposed to, according to the docs which I probably should have read more carefully.
Unlike as_timestamp, as_datetime doesnât raise an error if supplied an invalid date string, it returns null. I donât think this was always the case? Anyway, that was the source of my confusion.
Not only does it always evaluate the if_true and if_false expressions, it can be inconsistent in how it performs the evaluation.
I reported it earlier this year, in the Core repo, and everyone who replied misunderstood what the Issue was reporting.
They seized on âitâs documentedâ (if_true and if_false are always evaluated) and promptly closed the Issue. They completely overlooked the main point, and the supplied example, that the evaluation can be inconsistent. When pressed to comment on the inconsistency, they never replied.