Alteryx Designer Desktop Discussions

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

Alteryx In-Database Hive Data Source Syntax

kylew9
5 - Atom

I am trying to write a dynamic date filter into my query within the WHERE clause of my In-Db tool but having issues specific to Hive Syntax. I have done this many times with SQL based data sources without issue, for example -

"dbo.RT_TRIP.ship_date_time >= DATEADD(day,-30,GETDATE())AND dbo.RT_TRIP.ship_date_time <= GETDATE()

For SQL based data sources it's pretty straight forward where GETDATE() retrieves current date and DATEADD once you specify date part you want to add/subtract with. But with Hive I have been unsuccessful in writing the syntax correctly. From everything I have found online it appears CURRENT_TIMESTAMP is the syntax in Hive to retrieve the current date. Additionally when I test this in Alteryx query builder I receive no errors. Screenshot for reference. But when trying to run the workflow I encounter an error and no data. 

 

Is anybody familiar with Hive syntax and writing dynamic date filters into the where clause? Any help here would be greatly appreciated!!


Test of query:

Hive query.png

 

Same query as above but the error received when ran:

Snag_cf9a668.png

2 REPLIES 2
apathetichell
18 - Pollux

I don't think the the timestamp is your problem - CURRENT_TIMESTAMP() should be proper HIVE syntax.

 

Try running it without that and then using that expression in a filter in-db downstream.

IraWatt
17 - Castor
17 - Castor

Hey @kylew9,

I believe both CURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are allowed, could try the first one as the error seems to be about brackets. Looking at the workflow it seems its the browse tool which is erroring, which is odd as that's not were your SQL is. do other tools work after the connect in DB tool?

Labels