2
votes

I am following this tutorial : https://docs.snowflake.net/manuals/user-guide/data-load-external-tutorial-resolve.html

to try and 'return errors by query ID and saves the results to a table for future reference'

the error is "Number of columns in file (11) does not match that of the corresponding table (10), use file format option error_on_column_count_mismatch=false to ignore this error"

This matches the tutorial, so per the tutorial I go and find the Query ID and input it into the query_id place holder in the statement below:

create or replace table save_copy_errors as select * from table(validate(mycsvtable, job_id=>'<query_id>'));

But it does not save the errors rather it returns a new error which is:

002018 (22023): SQL compilation error:
Invalid argument [Invalid Job UUID provided.] for table function. Table function
 argument is required to be a constant.

Not sure how to solve this, as I feel I am just mirroring the tutorial correct

1

1 Answers

0
votes

The tutorial has worked for me. Did you get the query id from the web interface history tab? Are you sure it is correct? You can also query it from history view in sql worksheets with this query:

select query_id, query_text
from table(information_schema.query_history_by_session())
where query_type='COPY'
order by start_time desc limit 10;

Make sure you get the query id from the COPY command row (query_type='COPY') and specify same tablename (+schema if necessary) in copy command and validate function parameter.