Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D9B43200C0C for ; Mon, 30 Jan 2017 20:07:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D67B4160B4D; Mon, 30 Jan 2017 19:07:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D3DD8160B35 for ; Mon, 30 Jan 2017 20:07:18 +0100 (CET) Received: (qmail 71928 invoked by uid 500); 30 Jan 2017 19:07:13 -0000 Mailing-List: contact user-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hawq.incubator.apache.org Delivered-To: mailing list user@hawq.incubator.apache.org Received: (qmail 71912 invoked by uid 99); 30 Jan 2017 19:07:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2017 19:07:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 965501A0285 for ; Mon, 30 Jan 2017 19:07:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.78 X-Spam-Level: * X-Spam-Status: No, score=1.78 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=pivotal-io.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id voA2Hdelb_yl for ; Mon, 30 Jan 2017 19:07:10 +0000 (UTC) Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 978035F253 for ; Mon, 30 Jan 2017 19:07:09 +0000 (UTC) Received: by mail-qk0-f180.google.com with SMTP id s140so140124702qke.0 for ; Mon, 30 Jan 2017 11:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pivotal-io.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/r5vKQMKndxRjGM5wPn1Q4OgmDC0HdsskXn1airlvxg=; b=0UvWWoDPsMylEYaAi3ll2y6w9I9Z/jaP8aBiBloG06xE3MvGivgMXj88UqrpZWwFhb QC6KELplCY/ZQN7DrA3A3ydohsxV6kwGFlgJ2Ms2qVx11KySmqsCM/9ZEL1MSHPBsYjH 0TRVDiOg8CE8C7p7wNZhhAtRCGYiQ+VOdoOnsXDzSZDI/yjndKeq0NtBjZrrS+xRwoBO moeARDEpwPbkynF4io1gJ2aRz5WoBLhltzhgPWdFWOMHgt4n3H3q+4En1facmOMVQkdJ z8TMJfDOXrH9M/lkEku86BpshJRGKcj5CjPUd2DdkiU9dwWqtQKVlM0tdXagyDAQFAA1 1sNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/r5vKQMKndxRjGM5wPn1Q4OgmDC0HdsskXn1airlvxg=; b=DSu5qtaSa4rn3sSIUQmR0uRRsCY77LXMilu3MmsMAEfxXKY7PB5oz6gf030E2BOwdD nd93bV6q2wWji6/u0IDMMe3YV8tHcnFAWQRKVQt5ERlY9191SMGqrwkap4HZGEullgCq 5Jxw/r8jhBbJwI4gAPcpfXnioeHJVx6byyrPwNZBjQRqbwd11gBaJxSby36IN52QE+Q5 tnwYb6T8d969N1eA6bFBV3LnTkCYubw06tHs1EFBbVzU6OPnC7HSPmv6VDLkSUjMa91j sLKD/kbY+I8go49YYscpp/v6NNWN7XtXyxsVmf53ARc8cM21skK9Nz07r+xbZBUZQC5Z cFVw== X-Gm-Message-State: AIkVDXJN9Y87LGPjcZEcZ30DeBzTjwSBTGMNk9Abm5xLXjsQB8YL9IQZ0OyVUDxfywaoRFKNBiJidWra6gCaVeWR X-Received: by 10.55.94.6 with SMTP id s6mr24698004qkb.166.1485803228558; Mon, 30 Jan 2017 11:07:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.55.81.135 with HTTP; Mon, 30 Jan 2017 11:07:08 -0800 (PST) In-Reply-To: References: From: "Alex (Oleksandr) Diachenko" Date: Mon, 30 Jan 2017 11:07:08 -0800 Message-ID: Subject: Re: PXF HCatalog Issue for Non-Super User To: dev@hawq.incubator.apache.org Cc: user@hawq.incubator.apache.org Content-Type: multipart/alternative; boundary=001a114e4fbca5236b0547548515 archived-at: Mon, 30 Jan 2017 19:07:20 -0000 --001a114e4fbca5236b0547548515 Content-Type: text/plain; charset=UTF-8 Hi Gagan, The issue you described was a real limitation before https://issues.apache. org/jira/browse/HAWQ-1130 was reported. As for now the issue was resolved and targeted for next 2.1.0.0-incubating open-source release. Regards, Alex. On Mon, Jan 30, 2017 at 10:08 AM, Gagan Brahmi wrote: > 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 > --001a114e4fbca5236b0547548515 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Gagan,

The issue you described was a= real limitation before=C2=A0https://issues.apache.org/jira/browse/= HAWQ-1130 was reported.
As for now the issue was resolved and= targeted for next=C2=A02.1.0.0-incubating open-source release.
<= br>
Regards, Alex.


On Mon, Jan 30, 2017 at 10:08 AM, Gag= an Brahmi <gaganbrahmi@gmail.com> wrote:
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=3D> SELECT * FROM hcatalog.default.hive_table;
ERROR:=C2=A0 permission denied for relation pg_authid
LINE 1: SELECT COUNT(*) FROM hcatalog.default.hive_table;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^
CONTEXT:=C2=A0 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<= br> oid FROM pg_filespace UNION ALL SELECT max(oid) AS oid FROM pg_compression<= br> 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<= br> 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)<= br> 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)<= br> 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=3D> SELECT * FROM hcatalog.default.hive_table;
ERROR:=C2=A0 database does not have enough available Oids to support HCatal= og
queries
LINE 1: SELECT * FROM hcatalog.default.hive_table;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ^
HINT:=C2=A0 Database VACUUM may recycle unused Oids.


postgres=3D> \d hcatalog.default.hive_table

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PXF Hive Table
"default.hive_table"
=C2=A0Column | Type
--------+------
=C2=A0id=C2=A0 =C2=A0 =C2=A0| int4
=C2=A0fname=C2=A0 | text
=C2=A0lname=C2=A0 | 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

--001a114e4fbca5236b0547548515--