Alteryx Designer Desktop Discussions

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

Simba Presto SQL error in the workflow

tahirlone
6 - Meteoroid

I am trying to run a workflow where I have a couple of macros running with different SQL scripts where I am replacing a part of an SQL string to get dynamic values. 
The SQL script is very simple in each of them. As simple as the following:

 

 

select distinct designated_market_area_id 
from "hive-mdl".tam_npm_mch_tv_aggregate_prod_v.household_characteristic 
where 
Cast(broadcast_yyyymmdd as Int) Between 20231101 and 20231130 
and viewer_assignment_type = 'LPM'
	

 

 But whenever I call these macros from my main workflow where I am trying to feed the results to a python tool to carry out analysis, I get the error from each of the macros 

location_person_intab_flags (79) Record #2: Tool #1: Error SQLPrepare: [Simba][Presto] (1060) Presto Query Error: line 7:2: mismatched input 'and'. Expecting: <expression> (1)

 

The process continues to stay like that and the workflow never ends unless I press the stop button. 

The SQL query editor parses and passes the script when I test the query in the SQL query editor. 

I am uploading screenshots of 

1. The SQL query test from the input tool

2. How each of the macro looks

3. Main workflow where the macros throw errors and my process is stuck

 

 Do I need to modify the queries which is Presto friendly? Or what am I doing wrong here?

2 REPLIES 2
apathetichell
18 - Pollux

You skipped the important screengrabs - the config of your action tools

tahirlone
6 - Meteoroid

I have uploaded it too

Labels