Home > Back-end >  Finding Jan 1st of current year in HQL
Finding Jan 1st of current year in HQL

Time:12-07

I have a python function that passes in a HQL query into a database and I need to use hive to find (currentYear)-01-01

def foo():
    return " SELECT variables \
        FROM bar \
        WHERE \
        fizz = buzz \
        AND to_date(somedate) > date_format(current_date,'yyyy-01-01') "

The last line is currently not working

CodePudding user response:

Ah embarrassing.

to_date(somedate) > date_format(current_date,'yyyy-01-01')

This works exactly as it is supposed to.

  • Related