Requirement: Returns all rows from the last query in the Snowflake SQL file
Issue: It's not returning all the rows , but only one row
Code
def get_ids(self):
snflk_hook = SnowflakeHook(snowflake_conn_id=self.snflk_conn_id)
with closing(snflk_hook.get_conn()) as conn:
with closing(conn.cursor(DictCursor)) as cur:
cur.execute(self.sql)
ids = []
for row in cur:
ids.append(row)
return mongo_ids
In the SQL File as
BEGIN
CREATE OR REPLACE TEMP TABLE ABC_ID AS
SELECT
*
FROM
XYZ;
SELECT
ID
FROM
ABC_ID;
END
The last query should return all the ID's
