Issue with 'COPY' statement with SQL MAGIC inside a formatted string #1276
-
Hello, We encounter an unexpected behavior when using the 'COPY' statement inside a formatted string. Database: For our example, we use a csv file structured as follows:
Code :
This code generates this error: PermissionDenied: Severity: ERROR, Message: Permission denied for storage location [Files/z-err_log.txt], Sqlstate: 42501, Routine: report_no_priv, File: /data/jenkins/workspace/RE-ReleaseBuilds/RE-Knuckleboom_2/server/vertica/Commands/GrantRevoke.cpp, Line: 525, Error Code: 4368, SQL: "COPY ***.test FROM STDIN PARSER public.fcsvparser(type='rfc4180', header=True, reject_on_materialized_type_error=True) REJECTMAX 1 REJECTED DATA 'Files/z-err.txt' EXCEPTIONS 'Files/z-err_log.txt'" Temporary Solution: For this code to work, it would appear that a line break is required at the beginning of the formatted string containing the SQL command :
Would it be possible for you to look into this issue to fix it or make the error message more explicit to avoid similar errors in the future? Thank you for your attention to this matter ! Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Thanks for reporting this issue, I'll do some tests and come back to you. |
Beta Was this translation helpful? Give feedback.
-
Now, there is an stdin option that allows you to deactivate the auto parsing and replacing: #1326 , it should close your issue. |
Beta Was this translation helpful? Give feedback.
Now, there is an stdin option that allows you to deactivate the auto parsing and replacing: #1326 , it should close your issue.
Usage:
%sql ... -stdin False
.