This message was deleted.
# general
s
This message was deleted.
m
also:
Copy code
COALESCE(sum(X),0) ---> returns null
Some more details: The
useDefaultValueForNull
setting is disabled on our cluster, Also, it seems like the behavior I mentioned is a bug that was fixed in version
0.22
, but unfortunately we cannot upgrade to it at the moment. Any known workarounds except for enabling
useDefaultValueForNull
?
j
Hi Maor, I recall this discussion a while ago, you are right that the outer join "non-matched row" behavior in the native and MSQ engines has some variations. I can't find that thread right now so don't remember if we came up with a workaround. For now I would suggest try to wrap sum(x) in another expression (e.g. sum(x)+0) in both places to see if it helps.
m
@John Kowtko just tried,
sum(X) + 0
, unfortunately it doesn’t work 😞 (still returns null)
j
This might kill index usage, but how about
sum(nvl(x,0))
?
m
it works!! thanks 🙂
BTW also
sum(coalesce(x,0))
seems to work
🙌 1