Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Hadoop/Impala In-DB tool syntax for today's date

Adam_Dooley
8 - Asteroid

I'm using an In-DB tool to connect to an Impala/Hadoop database.  On my Connect In-DB tool what is the syntax for today's date?  I can't get now() and unix_timestamp to work.

Thanks

6 REPLIES 6
tcroberts
12 - Quasar

Does 'current_timestamp()' work? What sort of error are you getting when using now() or unix_timestamp()?

Adam_Dooley
8 - Asteroid

Current_timestamp() doesn't work either.  Actually it doesn't give an error, it just doesn't output any data to a Browse In-DB tool.  The only way I can get it to work is by keying in the date manually in format YYYY-MM-DD

Adam_Dooley
8 - Asteroid

Someone at my company helped me figure this out. 

The solution was:

 = to_date(from_unixtime(unix_timestamp()))

tcroberts
12 - Quasar

Wow, good to know. Any ideas why you need to do that to get it to show?

Adam_Dooley
8 - Asteroid

I think it was because the field in Hadoop was formatted as a date (without any time details).  So the now() and unix_timestamp trials were too specific and running on the exact second the workflow was run.  So it was good SQL but didn't spit out any results, but the to_date piece made it possible.

tcroberts
12 - Quasar

Makes a lot of sense, thanks for sharing!

Labels