Hi All,
I am not sure if anyone has faced issue for a non-privileged HAWQ user
while access hive table using HCatalog. The issue is encountered when a
non-privileged user tries to query the hive table (hive_table) under any
database (default in this example) using hcatalog
(hcatalog.default.hive_table).
However, when you describe the table (\d) there is no issue encountered.
I have tested this on HDB 2.0.0 and HDB 2.0.1.
For the non-privileged user the following is the behavior when trying to
access the data using SELECT:
--------------------
postgres=> SELECT * FROM hcatalog.default.hive_table;
ERROR: permission denied for relation pg_authid
LINE 1: SELECT COUNT(*) FROM hcatalog.default.hive_table;
^
CONTEXT: SQL statement "SELECT max(oid) FROM (SELECT max(oid) AS oid FROM
pg_extprotocol UNION ALL SELECT max(oid) AS oid FROM pg_partition UNION ALL
SELECT max(oid) AS oid FROM pg_partition_rule UNION ALL SELECT max(oid) AS
oid FROM pg_filespace UNION ALL SELECT max(oid) AS oid FROM pg_compression
UNION ALL SELECT max(oid) AS oid FROM pg_filesystem UNION ALL SELECT
max(oid) AS oid FROM pg_foreign_data_wrapper UNION ALL SELECT max(oid) AS
oid FROM pg_foreign_server UNION ALL SELECT max(oid) AS oid FROM
pg_database UNION ALL SELECT max(oid) AS oid FROM pg_type UNION ALL SELECT
max(oid) AS oid FROM pg_proc UNION ALL SELECT max(oid) AS oid FROM pg_class
UNION ALL SELECT max(oid) AS oid FROM pg_attrdef UNION ALL SELECT max(oid)
AS oid FROM pg_constraint UNION ALL SELECT max(oid) AS oid FROM pg_operator
UNION ALL SELECT max(oid) AS oid FROM pg_opclass UNION ALL SELECT max(oid)
AS oid FROM pg_am UNION ALL SELECT max(oid) AS oid FROM pg_language UNION
ALL SELECT max(oid) AS oid FROM pg_rewrite UNION ALL SELECT max(oid) AS oid
FROM pg_trigger UNION ALL SELECT max(oid) AS oid FROM pg_cast UNION ALL
SELECT max(oid) AS oid FROM pg_namespace UNION ALL SELECT max(oid) AS oid
FROM pg_conversion UNION ALL SELECT max(oid) AS oid FROM pg_tablespace
UNION ALL SELECT max(oid) AS oid FROM pg_resqueue UNION ALL SELECT max(oid)
AS oid FROM pg_authid UNION ALL SELECT max(oid) AS oid FROM
pg_user_mapping) AS x"
postgres=> SELECT * FROM hcatalog.default.hive_table;
ERROR: database does not have enough available Oids to support HCatalog
queries
LINE 1: SELECT * FROM hcatalog.default.hive_table;
^
HINT: Database VACUUM may recycle unused Oids.
postgres=> \d hcatalog.default.hive_table
PXF Hive Table
"default.hive_table"
Column | Type
--------+------
id | int4
fname | text
lname | text
--------------------
I was able to get around this problem by granting SELECT on pg_authid and
pg_user_mapping table which fixes the underlying query to grab the max Oid.
Is this is a known issue or is there any better workaround for this
behavior? Or anything other than granting the user SUPERUSER privileges?
Regards,
Gagan Brahmi