I have a pipe defined like this:
CREATE OR REPLACE PIPE PIPE_NAME
AUTO_INGEST=TRUE
AWS_SNS_TOPIC= 'arn:aws:sns:...'
AS COPY INTO TABLE1
FROM '@STAGE/TABLE1'
FILE_FORMAT = (TYPE = 'csv' FIELD_DELIMITER = ';' SKIP_HEADER = 1 EMPTY_FIELD_AS_NULL = TRUE NULL_IF = ('') RECORD_DELIMITER = '\n' FIELD_OPTIONALLY_ENCLOSED_BY = '"' ESCAPE_UNENCLOSED_FIELD ='\\')
ON_ERROR = CONTINUE;
After the copy, that goes well (some rows are bad formatted so this is what i want to validate in the VALIDATE function), i executed this:
SELECT * FROM TABLE(VALIDATE(TABLE1, JOB_ID => '_last'));
But I'm getting this error:
Invalid argument [The specified Job UUID does not load into the specified table] for table function. Table function argument is required to be a constant.
I'm doing something wrong? It's like when you execute the copy into command manually works but when you call the VALIDATE function inside a stored procedures doesn't.
Also, I would love to use the most recent query_id/job_id of the copy into of this specific table and not the '_last' condition, but i haven't been able to found it, any thoughts?
Thank you