Questions regarding werid lookup, TIME_FORMAT

I have some questions regarding lookups and sql. Few days ago, I found a weird problem. Let’s say I had a lookup table named currency in postgres. This table was generated by the spark workflow. The table’s schema looked like this:

Table “currency”

Column | Type | Collation | Nullable | Default

We resolved this issue. The problem was we mix TIME_FORMAT(__time,‘YYYY_MM_dd’) and TIME_FORMAT(“__time”,‘Y_MM_dd’) in the sql