Skip to main content

Making EXPORT TO PARQUET avaialable to all Vertica users

  • September 4, 2017
  • 1 reply
  • 4 views

DieterC
Forum|alt.badge.img+2

Hi Forum,
I am supporting a prospect in a Vertica POC. They are wanting to make EXPORT TO PARQUET available for all database users (not only dbadmin) but getting errors (see below text from an email).
Can you please share the statements required for this? I could not figure this on my own.
I see library ParquetExportLib containing 3 functions. So I need one grant for the library and three for each of the functions?
Can you please reply with the exact SQL, I could not get this working.
Thank you

Email from the prospect:
Hi Dieter,

We encountered another problem that we still were not able to solve:
The EXPORT TO PARQUET function seems to works only as dbadmin on the local filesystem for us:

dbadmin=> export to parquet(directory='/tmp/proc3') as select * from testuser00.proc3;

Rows Exported

         9

If we try to use the function as a regular user we get the following error message:

testuser00=> EXPORT TO PARQUET(directory='/tmp/proc3') AS SELECT * from proc3;
ERROR 3457: Function ParquetExportFinalize(int) does not exist, or permission is denied for ParquetExportFinalize(int)
HINT: No function matches the given name and argument types. You may need to add explicit type casts

The same holds for using a hdfs path as well as a custom USER storage location.

The documentation (https://my.vertica.com/docs/8.1.x/HTML/#Authoring/SQLReferenceManual/Statements/EXPORTTOPARQUET.htm) mentions no special needed Privileges.

1 reply

DieterC
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • September 7, 2017

Hi forum,
this is what I found so far

-- list all functions related to Parquet Export
SELECT * FROM USER_LIBRARY_MANIFEST WHERE lib_name = 'ParquetExportLib';

-- grant privilege to execute all functions in public (should have thought of this earlier); need to complement with grants on the Linux storage location
GRANT execute ON ALL FUNCTIONS IN SCHEMA public TO dieter;

-- very pragmatic (POC style) as dbadmin
grant pseudosuperuser to dieter;
-- as database user intended to run export to parquet
set role pseudosuperuser;
-- stop this
set role none;

Good exporting
Dieter