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 E15BB200C39 for ; Thu, 2 Mar 2017 03:20:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DFD3C160B78; Thu, 2 Mar 2017 02:20:36 +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 DB8B4160B70 for ; Thu, 2 Mar 2017 03:20:35 +0100 (CET) Received: (qmail 37378 invoked by uid 500); 2 Mar 2017 02:20:35 -0000 Mailing-List: contact commits-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list commits@hawq.incubator.apache.org Received: (qmail 37369 invoked by uid 99); 2 Mar 2017 02:20:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2017 02:20:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A04A9C135B for ; Thu, 2 Mar 2017 02:20:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.558 X-Spam-Level: X-Spam-Status: No, score=-3.558 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, T_MONEY_PERCENT=0.01] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id vGUVoUQzkzJt for ; Thu, 2 Mar 2017 02:20:32 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 109BB5FDD9 for ; Thu, 2 Mar 2017 02:20:30 +0000 (UTC) Received: (qmail 37342 invoked by uid 99); 2 Mar 2017 02:20:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2017 02:20:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3325DDFDE6; Thu, 2 Mar 2017 02:20:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hubertzhang@apache.org To: commits@hawq.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-hawq git commit: HAWQ-1359. Fix rat-check issues. Date: Thu, 2 Mar 2017 02:20:30 +0000 (UTC) archived-at: Thu, 02 Mar 2017 02:20:37 -0000 Repository: incubator-hawq Updated Branches: refs/heads/master 120892679 -> aece96726 HAWQ-1359. Fix rat-check issues. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/aece9672 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/aece9672 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/aece9672 Branch: refs/heads/master Commit: aece96726ae479677bcb2af0d41d6f962da3460a Parents: 1208926 Author: hubertzhang Authored: Thu Mar 2 10:19:05 2017 +0800 Committer: hubertzhang Committed: Thu Mar 2 10:19:05 2017 +0800 ---------------------------------------------------------------------- src/test/feature/Ranger/sql/init_file | 14 ++ src/test/feature/Ranger/sql/sqlsplit.cpp | 2 +- src/test/feature/Ranger/sql/sqlsplitinput | 142 --------------------- src/test/feature/Ranger/sql/sqlsplitinput.sql | 142 +++++++++++++++++++++ 4 files changed, 157 insertions(+), 143 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/aece9672/src/test/feature/Ranger/sql/init_file ---------------------------------------------------------------------- diff --git a/src/test/feature/Ranger/sql/init_file b/src/test/feature/Ranger/sql/init_file index 3c1fd76..5f4c68d 100644 --- a/src/test/feature/Ranger/sql/init_file +++ b/src/test/feature/Ranger/sql/init_file @@ -1,3 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -- start_matchignore m/You are now connected to database*/ s/public\|a\|table\|.*\|append only/public\|a\|table\|gpadmin\|append only/ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/aece9672/src/test/feature/Ranger/sql/sqlsplit.cpp ---------------------------------------------------------------------- diff --git a/src/test/feature/Ranger/sql/sqlsplit.cpp b/src/test/feature/Ranger/sql/sqlsplit.cpp index 61ea00e..785c297 100644 --- a/src/test/feature/Ranger/sql/sqlsplit.cpp +++ b/src/test/feature/Ranger/sql/sqlsplit.cpp @@ -23,7 +23,7 @@ int main() { FILE *fin, *fout, *foutsuper; - fin = fopen("sqlsplitinput", "r"); + fin = fopen("sqlsplitinput.sql", "r"); char line[1000]; int i = 0; int isnormalquery = 0; http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/aece9672/src/test/feature/Ranger/sql/sqlsplitinput ---------------------------------------------------------------------- diff --git a/src/test/feature/Ranger/sql/sqlsplitinput b/src/test/feature/Ranger/sql/sqlsplitinput deleted file mode 100644 index 564b0a0..0000000 --- a/src/test/feature/Ranger/sql/sqlsplitinput +++ /dev/null @@ -1,142 +0,0 @@ -1 -create table a(i int); -0 -create language plpythonu; -0 -CREATE OR REPLACE FUNCTION f4() RETURNS TEXT AS $$ plpy.execute("select * from a order by i") $$ LANGUAGE plpythonu VOLATILE; -1 -select * from f4(); -0 -drop function f4(); -0 -drop language plpythonu; -1 -CREATE OR REPLACE FUNCTION normalize_si(text) RETURNS text AS $$ BEGIN RETURN substring($1, 9, 2) || substring($1, 7, 2) || substring($1, 5, 2) || substring($1, 1, 4); END; $$LANGUAGE 'plpgsql' IMMUTABLE; -1 -CREATE OR REPLACE FUNCTION si_lt(text, text) RETURNS boolean AS $$ BEGIN RETURN normalize_si($1) < normalize_si($2); END; $$ LANGUAGE 'plpgsql' IMMUTABLE; -1 -CREATE OPERATOR <# ( PROCEDURE=si_lt,LEFTARG=text, RIGHTARG=text); -1 -CREATE OR REPLACE FUNCTION si_same(text, text) RETURNS int AS $$ BEGIN IF normalize_si($1) < normalize_si($2) THEN RETURN -1; END IF; END; $$ LANGUAGE 'plpgsql' IMMUTABLE; -0 -CREATE OPERATOR CLASS sva_special_ops FOR TYPE text USING btree AS OPERATOR 1 <#, FUNCTION 1 si_same(text, text); -0 -drop OPERATOR CLASS sva_special_ops USING btree; -1 -drop OPERATOR <# (text,text) CASCADE; -1 -drop FUNCTION si_same(text, text); -1 -drop FUNCTION si_lt(text, text); -1 -drop FUNCTION normalize_si(text); -0 -CREATE RESOURCE QUEUE myqueue WITH (PARENT='pg_root', ACTIVE_STATEMENTS=20, MEMORY_LIMIT_CLUSTER=50%, CORE_LIMIT_CLUSTER=50%); -0 -DROP RESOURCE QUEUE myqueue; -0 -CREATE TABLESPACE mytblspace FILESPACE dfs_system; -1 -CREATE TABLE foo(i int) TABLESPACE mytblspace; -1 -insert into foo(i) values(1234); -1 -drop table foo; -0 -drop tablespace mytblspace; -0 -COPY a FROM '/tmp/a.txt'; -1 -COPY a TO STDOUT WITH DELIMITER '|'; -1 -CREATE EXTERNAL TABLE ext_t ( N_NATIONKEY INTEGER ,N_NAME CHAR(25), N_REGIONKEY INTEGER ,N_COMMENT VARCHAR(152))location ('gpfdist://localhost:7070/nation_error50.tbl')FORMAT 'text' (delimiter '|')SEGMENT REJECT LIMIT 51; -1 -select * from ext_t order by N_NATIONKEY; -1 -CREATE WRITABLE EXTERNAL TABLE ext_t2 (i int) LOCATION ('gpfdist://localhost:7070/ranger2.out') FORMAT 'TEXT' ( DELIMITER '|' NULL ' '); -1 -insert into ext_t2(i) values(234); -1 -drop EXTERNAL TABLE ext_t; -1 -drop EXTERNAL TABLE ext_t2; -1 -create schema sa; -1 -create temp table ta(i int); -1 -create view av as select * from a order by i; -1 -create table aa as select * from a order by i; -1 -create table sa.t(a int, b int); -1 -CREATE SEQUENCE myseq START 1; -1 -insert into a values(1); -1 -insert into a values(1); -1 -insert into a VALUES (nextval('myseq')); -1 -select * from a order by i; -1 -select generate_series(1,3); -1 -select * from av; -1 -SELECT setval('myseq', 1); -1 -SELECT * INTO aaa FROM a WHERE i > 0 order by i; -1 -PREPARE fooplan (int) AS INSERT INTO a VALUES($1);EXECUTE fooplan(1);DEALLOCATE fooplan; -1 -explain select * from a; -1 -CREATE FUNCTION scube_accum(numeric, numeric) RETURNS numeric AS 'select $1 + $2 * $2 * $2' LANGUAGE SQL IMMUTABLE RETURNS NULL ON NULL INPUT; -1 -CREATE AGGREGATE scube(numeric) ( SFUNC = scube_accum, STYPE = numeric, INITCOND = 0 ); -1 -ALTER AGGREGATE scube(numeric) RENAME TO scube2; -1 -DROP AGGREGATE scube2(numeric); -1 -DROP FUNCTION scube_accum(numeric, numeric); -1 -CREATE TYPE mytype AS (f1 int, f2 int); -1 -CREATE FUNCTION getfoo() RETURNS SETOF mytype AS $$ SELECT i, i FROM a order by i $$ LANGUAGE SQL; -1 -select getfoo(); -1 -drop type mytype cascade; -1 -begin; DECLARE mycursor CURSOR FOR SELECT * FROM a order by i; FETCH FORWARD 2 FROM mycursor; commit; -1 -BEGIN; INSERT INTO a VALUES (1); SAVEPOINT my_savepoint; INSERT INTO a VALUES (1); RELEASE SAVEPOINT my_savepoint; COMMIT; -1 -\d -1 -analyze a; -1 -analyze; -1 -vacuum aa; -0 -vacuum analyze; -1 -truncate aa; -1 -alter table a rename column i to j; -1 -drop SEQUENCE myseq; -1 -drop view av; -1 -drop table aaa; -1 -drop table aa; -1 -drop table a; -1 -drop schema sa CASCADE; http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/aece9672/src/test/feature/Ranger/sql/sqlsplitinput.sql ---------------------------------------------------------------------- diff --git a/src/test/feature/Ranger/sql/sqlsplitinput.sql b/src/test/feature/Ranger/sql/sqlsplitinput.sql new file mode 100644 index 0000000..564b0a0 --- /dev/null +++ b/src/test/feature/Ranger/sql/sqlsplitinput.sql @@ -0,0 +1,142 @@ +1 +create table a(i int); +0 +create language plpythonu; +0 +CREATE OR REPLACE FUNCTION f4() RETURNS TEXT AS $$ plpy.execute("select * from a order by i") $$ LANGUAGE plpythonu VOLATILE; +1 +select * from f4(); +0 +drop function f4(); +0 +drop language plpythonu; +1 +CREATE OR REPLACE FUNCTION normalize_si(text) RETURNS text AS $$ BEGIN RETURN substring($1, 9, 2) || substring($1, 7, 2) || substring($1, 5, 2) || substring($1, 1, 4); END; $$LANGUAGE 'plpgsql' IMMUTABLE; +1 +CREATE OR REPLACE FUNCTION si_lt(text, text) RETURNS boolean AS $$ BEGIN RETURN normalize_si($1) < normalize_si($2); END; $$ LANGUAGE 'plpgsql' IMMUTABLE; +1 +CREATE OPERATOR <# ( PROCEDURE=si_lt,LEFTARG=text, RIGHTARG=text); +1 +CREATE OR REPLACE FUNCTION si_same(text, text) RETURNS int AS $$ BEGIN IF normalize_si($1) < normalize_si($2) THEN RETURN -1; END IF; END; $$ LANGUAGE 'plpgsql' IMMUTABLE; +0 +CREATE OPERATOR CLASS sva_special_ops FOR TYPE text USING btree AS OPERATOR 1 <#, FUNCTION 1 si_same(text, text); +0 +drop OPERATOR CLASS sva_special_ops USING btree; +1 +drop OPERATOR <# (text,text) CASCADE; +1 +drop FUNCTION si_same(text, text); +1 +drop FUNCTION si_lt(text, text); +1 +drop FUNCTION normalize_si(text); +0 +CREATE RESOURCE QUEUE myqueue WITH (PARENT='pg_root', ACTIVE_STATEMENTS=20, MEMORY_LIMIT_CLUSTER=50%, CORE_LIMIT_CLUSTER=50%); +0 +DROP RESOURCE QUEUE myqueue; +0 +CREATE TABLESPACE mytblspace FILESPACE dfs_system; +1 +CREATE TABLE foo(i int) TABLESPACE mytblspace; +1 +insert into foo(i) values(1234); +1 +drop table foo; +0 +drop tablespace mytblspace; +0 +COPY a FROM '/tmp/a.txt'; +1 +COPY a TO STDOUT WITH DELIMITER '|'; +1 +CREATE EXTERNAL TABLE ext_t ( N_NATIONKEY INTEGER ,N_NAME CHAR(25), N_REGIONKEY INTEGER ,N_COMMENT VARCHAR(152))location ('gpfdist://localhost:7070/nation_error50.tbl')FORMAT 'text' (delimiter '|')SEGMENT REJECT LIMIT 51; +1 +select * from ext_t order by N_NATIONKEY; +1 +CREATE WRITABLE EXTERNAL TABLE ext_t2 (i int) LOCATION ('gpfdist://localhost:7070/ranger2.out') FORMAT 'TEXT' ( DELIMITER '|' NULL ' '); +1 +insert into ext_t2(i) values(234); +1 +drop EXTERNAL TABLE ext_t; +1 +drop EXTERNAL TABLE ext_t2; +1 +create schema sa; +1 +create temp table ta(i int); +1 +create view av as select * from a order by i; +1 +create table aa as select * from a order by i; +1 +create table sa.t(a int, b int); +1 +CREATE SEQUENCE myseq START 1; +1 +insert into a values(1); +1 +insert into a values(1); +1 +insert into a VALUES (nextval('myseq')); +1 +select * from a order by i; +1 +select generate_series(1,3); +1 +select * from av; +1 +SELECT setval('myseq', 1); +1 +SELECT * INTO aaa FROM a WHERE i > 0 order by i; +1 +PREPARE fooplan (int) AS INSERT INTO a VALUES($1);EXECUTE fooplan(1);DEALLOCATE fooplan; +1 +explain select * from a; +1 +CREATE FUNCTION scube_accum(numeric, numeric) RETURNS numeric AS 'select $1 + $2 * $2 * $2' LANGUAGE SQL IMMUTABLE RETURNS NULL ON NULL INPUT; +1 +CREATE AGGREGATE scube(numeric) ( SFUNC = scube_accum, STYPE = numeric, INITCOND = 0 ); +1 +ALTER AGGREGATE scube(numeric) RENAME TO scube2; +1 +DROP AGGREGATE scube2(numeric); +1 +DROP FUNCTION scube_accum(numeric, numeric); +1 +CREATE TYPE mytype AS (f1 int, f2 int); +1 +CREATE FUNCTION getfoo() RETURNS SETOF mytype AS $$ SELECT i, i FROM a order by i $$ LANGUAGE SQL; +1 +select getfoo(); +1 +drop type mytype cascade; +1 +begin; DECLARE mycursor CURSOR FOR SELECT * FROM a order by i; FETCH FORWARD 2 FROM mycursor; commit; +1 +BEGIN; INSERT INTO a VALUES (1); SAVEPOINT my_savepoint; INSERT INTO a VALUES (1); RELEASE SAVEPOINT my_savepoint; COMMIT; +1 +\d +1 +analyze a; +1 +analyze; +1 +vacuum aa; +0 +vacuum analyze; +1 +truncate aa; +1 +alter table a rename column i to j; +1 +drop SEQUENCE myseq; +1 +drop view av; +1 +drop table aaa; +1 +drop table aa; +1 +drop table a; +1 +drop schema sa CASCADE;