Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I have a flow where I need to first check if a table exists, if not then run some SQL and create the table. If it does exist, I want to insert into the table only if new records arrive for the source tables that initially created the table.
Operating system used: Windows 10
Hoping i have understood your question correct.
If you wish to write your own code , you can have a look at the SQL Script recipe
here you can define you create table statement for snowflake as
CREATE TABLE IF NOT EXISTS "DB"."SCHEMA"."TABLE" ( "COLUMN1" VARCHAR(10) NULL );
This would create your table only if its doesnt exist. and you can also include an insert statement in the same recipe itself.
For visual recipe, have a look at the dataiku SYNC recipe with the insert instead of overwrite option.
I really should have been more clear. In my dataiku flow, I would like to have an IF statement that checks if the table exists and then route to different sub-flows depending on the result. I did figure out a way by feeding in a SQL query into my Python recipe as a dataset. But, it would be nice if this sort of conditional could be abstracted out from the Python recipe and into a stand alone dataiku node.