Hi there – We’re seeing an issue where Metabase (0.32.5), looking at a MySQL 5.7 instance, isn’t properly returning datetime values; instead displaying null. Any function that manipulates the datetime value causes the value to render properly, (e.g., SELECT CONCAT(datetime) yields a value in the table, but simple SELECT datetime yields null).
Hi @dodongo
Do you see the same behavior in the latest release 0.32.9?
What is the exact MySQL version?
Do you see any errors in the Metabase log or browser console, when it’s empty?
Can you check the returned result to see if it this is a backend or frontend issue? Open browser console Network-tab and check Response data of the request.
Do you see the same behavior in the latest release 0.32.9?
Actually, I happen to be cookin' with the latest 0.33rc2 on my laptop, and it does not appear to exhibit this behavior. Maybe this accidentally got addressed
What is the exact MySQL version?
Unsure of sub-releases, but whatever is the current 5.7.x release is almost surely what we're running.
Do you see any errors in the Metabase log or browser console, when it’s empty?
Nope, nothing that seems indicative of an error.
Can you check the returned result to see if it this is a backend or frontend issue? Open browser console Network-tab and check Response data of the request.
@dodongo
Interesting. So all the null returns should be a datetime column value? And when you CONCAT(column), then you see the value in the response data?
Well, if it is fixed in 0.33.0-preview2, then it might have been an issue in the earlier 0.32.9, which has been fixed on master/notebook-mode and will end up in 0.33.0
Yeah, that’s exactly what I’m seeing. I don’t even have a good guess as to what might be at issue, but I’m encouraged seeing what sure looks like an improvement in the new version. Was already planning to move on the 0.33 release once it’s finalized; this just reaffirms that decision!
Just for the sake of closing the loop, and because this is a fun, obscure, what-the?? issue, I’ve been talking this morning with another engineer, and we’re now pretty sure that the column doesn’t render properly when datetime(6) entries with a non-zero decimal value are being chucked along. I completely understand if this will remain unaddressed in the 0.32.x cycle. Well worth it to see 0.33 ready to go!
@dodongo
Wait, so you’re using DATETIME(6) for the problematic column? Wouldn’t that only contain year-month? I’m not sure if Metabase can handle that. You might want to create a view for that table and just return a simple DATE column (year-month-01)
In MySQL (>= 5.6.4), datetime(6) is 6-decimal (microsecond) precision; it includes year / month / day values as well. It seems that having a nonzero value after the decimal is what’s causing the omission behavior.
@alfred There’s still an issue open about this, but I haven’t been able to reproduce (though I haven’t tested with Exasol): https://github.com/metabase/metabase/issues/10285
I think the current workaround is still to avoid the microseconds and just use milliseconds instead.