David Garrison
David Garrison

Reputation: 2880

Query to return the Target Table of a Snowpipe

I'm trying to write a script to retreive the COPY_HISTORY of tables that are target tables for my various pipes, but I can't find a way to start with a PIPE name and return the target table that I need to query.

Preferrably would like to avoid pulling out the pipe definition and regexing through it for the INTO clause.

I could not find a way to do it with SHOW PIPES, INFORMATION_SCHEMA.PIPES or INFORMATION_SCHEMA.LOAD_HISTORY.

Upvotes: 1

Views: 404

Answers (1)

Cristian Scutaru
Cristian Scutaru

Reputation: 1507

Try SNOWFLAKE.ACCOUNT_USAGE.COPY_HISTORY. I see PIPE_NAME and TABLE_NAME.

LOAD_HISTORY does not return the history of data loaded using Snowpipe.

Upvotes: 1

Related Questions