Problem
You attempt to create a table using a cluster that has Table ACLs enabled, but the following error occurs:
Error in SQL statement: SecurityException: User does not have permission SELECT on any file.
Cause
This error occurs on a Table ACL-enabled cluster if you are not an administrator and you do not have sufficient privileges to create a table.
AWS
For example, in your notebook you attempt to create a table using a Parquet data source located on S3:
%sql CREATE TABLE mytable USING PARQUET OPTIONS (PATH='s3://my-root-bucket/subfolder/my-table')Delete
Azure
For example, in your notebook you attempt to create a table using a Parquet data source located on Azure Blob Storage:
%sql CREATE TABLE mytable USING PARQUET OPTIONS (PATH='wasbs://my-container@my-storage-account.blob.core.windows.net/my-table')Delete
Solution
You should ask your administrator to grant you access to the blob storage filesystem, using either of the following options. If an administrator cannot grant you access to the data object, you’ll have to ask an administrator to make the table for you.
- If you want to use a CTAS (CREATE TABLE AS SELECT) statement to create the table, the administrator should grant you SELECT privileges on the filesystem:
%sql GRANT SELECT ON ANY FILE TO `user1`
- Example CTAS statement:
AWS
%sql CREATE TABLE mytable AS SELECT * FROM parquet.`s3://my-root-bucket/subfolder/my-table`Delete
Azure
%sql CREATE TABLE mytable AS SELECT * FROM parquet.`wasbs://my-container@my-storage-account.blob.core.windows.net/my-table`Delete
- If you want to use a CTOP (CREATE TABLE OPTIONS PATH) statement to make the table, the administrator must elevate your privileges by granting MODIFY in addition to SELECT.
%sql GRANT SELECT, MODIFY ON ANY FILE TO `user1`
Example CTOP statement:
AWS
%sql CREATE TABLE mytable USING PARQUET OPTIONS (PATH='s3://my-root-bucket/subfolder/my-table')Delete
Azure
%sql CREATE TABLE mytable USING PARQUET OPTIONS (PATH='wasbs://my-container@my-storage-account.blob.core.windows.net/my-table')Delete
AWS
Granting the data access privileges described above does not supersede any underlying IAM roles or S3 bucket policies. For example, if a grant statement like GRANT SELECT, MODIFY ON ANY FILE TO user1 is executed but an IAM role attached to the cluster explicitly denies reads to the target S3 bucket, then the GRANT statement will not make the bucket or the objects within the bucket suddenly readable.
DeleteAzure
Granting the data access privileges described above does not supersede any underlying user permissions or Blob Storage container access control. For example, if a grant statement like GRANT SELECT, MODIFY ON ANY FILE TO user1 is executed but a user permission attached to the cluster explicitly denies reads to the target container, then the GRANT statement will not make the container or the objects within the container suddenly readable.
Delete