hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmtolp...@apache.org
Subject [1/3] hive git commit: HIVE-13367: Extending HPLSQL parser (Dmitry Tolpeko reviewed by Alan Gates)
Date Wed, 30 Mar 2016 07:24:54 GMT
Repository: hive
Updated Branches:
  refs/heads/master 8c1f055d9 -> 51efcb80e


http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/create_procedure_no_params.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/create_procedure_no_params.sql b/hplsql/src/test/queries/db/create_procedure_no_params.sql
new file mode 100644
index 0000000..bbacb29
--- /dev/null
+++ b/hplsql/src/test/queries/db/create_procedure_no_params.sql
@@ -0,0 +1,25 @@
+CREATE OR REPLACE PROCEDURE show_the_date
+IS
+today DATE DEFAULT DATE '2016-03-10';
+BEGIN
+-- Display the date.
+DBMS_OUTPUT.PUT_LINE ('Today is ' || today);
+END show_the_date;
+
+CREATE OR REPLACE PROCEDURE show_the_date2()
+IS
+today DATE DEFAULT DATE '2016-03-10';
+BEGIN
+-- Display the date.
+DBMS_OUTPUT.PUT_LINE ('Today is ' || today);
+END show_the_date2;
+
+call show_the_date;
+call show_the_date2;
+
+DECLARE
+today DATE DEFAULT DATE '2016-03-10';
+BEGIN
+-- Display the date.
+DBMS_OUTPUT.PUT_LINE ('Today is ' || today);
+END;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/describe.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/describe.sql b/hplsql/src/test/queries/db/describe.sql
new file mode 100644
index 0000000..f87b532
--- /dev/null
+++ b/hplsql/src/test/queries/db/describe.sql
@@ -0,0 +1,3 @@
+describe src;
+desc src;
+desc table src;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/execute.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/execute.sql b/hplsql/src/test/queries/db/execute.sql
new file mode 100644
index 0000000..abc23c4
--- /dev/null
+++ b/hplsql/src/test/queries/db/execute.sql
@@ -0,0 +1,7 @@
+DECLARE cnt INT;
+EXECUTE 'SELECT COUNT(*) FROM src' INTO cnt;
+PRINT cnt;
+
+DECLARE sql STRING = 'SELECT COUNT(*) FROM src';
+EXECUTE sql INTO cnt;
+PRINT cnt;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/expression.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/expression.sql b/hplsql/src/test/queries/db/expression.sql
new file mode 100644
index 0000000..cd82e7a
--- /dev/null
+++ b/hplsql/src/test/queries/db/expression.sql
@@ -0,0 +1 @@
+select 0.12*0.14, 0.13 / 0.11, 1 + 2, 1 - 2, (1-2)+3, 3 * (2-1) from src limit 1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/for.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/for.sql b/hplsql/src/test/queries/db/for.sql
new file mode 100644
index 0000000..19dac9a
--- /dev/null
+++ b/hplsql/src/test/queries/db/for.sql
@@ -0,0 +1 @@
+for item in (select code from sample_07 limit 10  ) loop print(cast(item.code as varchar2(100))+'
aa') end loop;

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/insert.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/insert.sql b/hplsql/src/test/queries/db/insert.sql
new file mode 100644
index 0000000..b67796a
--- /dev/null
+++ b/hplsql/src/test/queries/db/insert.sql
@@ -0,0 +1,3 @@
+insert overwrite table src_insert select value from src;
+
+insert into table src_insert select value from src;

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/insert_directory.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/insert_directory.sql b/hplsql/src/test/queries/db/insert_directory.sql
new file mode 100644
index 0000000..b9a58d1
--- /dev/null
+++ b/hplsql/src/test/queries/db/insert_directory.sql
@@ -0,0 +1,12 @@
+insert overwrite directory /tmp/src1
+  select * from src;
+  
+insert overwrite local directory /tmp/src2
+  select * from src;
+  
+insert overwrite local directory '/tmp/src3'
+  'select * from ' || 'src';
+  
+declare tabname string = 'src';
+insert overwrite local directory '/tmp/src_' || date '2016-03-28' 
+  'select * from ' || tabname;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/schema.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/schema.sql b/hplsql/src/test/queries/db/schema.sql
index 0c41569..e003934 100644
--- a/hplsql/src/test/queries/db/schema.sql
+++ b/hplsql/src/test/queries/db/schema.sql
@@ -29,4 +29,12 @@ select
   cast(key as double)/10 c10,
   date '2015-09-07' c11,
   cast(date '2015-09-07' as timestamp) c12
-from src;
\ No newline at end of file
+from src;
+
+create table if not exists src_empty (
+  c1 string)
+;
+
+create table if not exists src_insert (
+  c1 string)
+;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/db/truncate_table.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/db/truncate_table.sql b/hplsql/src/test/queries/db/truncate_table.sql
new file mode 100644
index 0000000..de2ac83
--- /dev/null
+++ b/hplsql/src/test/queries/db/truncate_table.sql
@@ -0,0 +1,2 @@
+truncate table src_empty;
+truncate src_empty;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/local/create_function3.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/create_function3.sql b/hplsql/src/test/queries/local/create_function3.sql
new file mode 100644
index 0000000..840c095
--- /dev/null
+++ b/hplsql/src/test/queries/local/create_function3.sql
@@ -0,0 +1,58 @@
+FUNCTION gettype(tag1 varchar2, srcvalue varchar2) return varchar2 as
+    tmpVar varchar2(10);
+  BEGIN
+
+    if srcvalue is null or srcvalue = '@I' then
+      return '@I';
+    end if;
+
+    if trim(tag1) = 'WHMM' then
+      return '002';
+    end if;
+
+    if trim(tag1) = 'TCPJ' and srcvalue = '010105' then
+      return '010105';
+    end if;
+
+    if trim(tag1) = 'TCPJ' and srcvalue != '010105' then
+      return '003';
+    end if;
+
+    if trim(tag1) = 'TCPJ' and srcvalue != '010105' then
+      return '003_ticket';
+    end if;
+
+    if trim(tag1) = 'TCJY' and srcvalue != '010105' then
+      return '003_ticket';
+    end if;
+
+    if trim(tag1) = 'TCJY' and srcvalue != '010105' then
+      return '003_ticket';
+    end if;
+
+    if trim(tag1) = 'YHHPD' then
+      return '002_foreign';
+    end if;
+
+    if trim(tag1) = 'WHWZ' then
+      return '002_foreign';
+    end if;
+
+    if trim(tag1) = 'WHLZ' then
+      return '002_foreign';
+    end if;
+
+    if trim(tag1) = 'DEWZ' then
+      return '024_out';
+    end if;
+
+    if trim(tag1) = 'DELZ' then
+      return '024_out';
+    end if;
+
+    return srcvalue;
+
+  END;
+  
+  gettype('YHHPD', 'a');
+  gettype('YHHPD', '@I');

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/local/create_function4.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/create_function4.sql b/hplsql/src/test/queries/local/create_function4.sql
new file mode 100644
index 0000000..21986e0
--- /dev/null
+++ b/hplsql/src/test/queries/local/create_function4.sql
@@ -0,0 +1,19 @@
+FUNCTION get(CODE VARCHAR2) RETURN VARCHAR2 AS
+    TMPVAR VARCHAR2(10);
+  BEGIN
+
+    TMPVAR := '';
+    
+    IF TRIM(TMPVAR) = '' THEN
+      RETURN '00080000';
+    ELSE
+      RETURN TRIM(TMPVAR);
+    END IF;
+  EXCEPTION
+    WHEN NO_DATA_FOUND THEN
+      RETURN '00080000';
+    WHEN OTHERS THEN
+      RAISE;
+  END;
+  
+get('abc');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/local/create_procedure3.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/create_procedure3.sql b/hplsql/src/test/queries/local/create_procedure3.sql
new file mode 100644
index 0000000..b4c9fad
--- /dev/null
+++ b/hplsql/src/test/queries/local/create_procedure3.sql
@@ -0,0 +1,29 @@
+create or replace procedure proc1(out v_msg string)
+declare
+  num1 int=0;
+  num2 int=10;
+  num3 int=30;
+begin
+  print num1;
+  print num2;
+  print num3;
+  set v_msg = 'Completed';
+end;
+
+create or replace procedure proc2(out v_msg string)
+is
+  num1 int=0;
+  num2 int=10;
+  num3 int=30;
+begin
+  print num1;
+  print num2;
+  print num3;
+  set v_msg = 'Completed';
+end;
+
+declare str string;
+call proc1(str);
+print str;
+call proc2(str);
+print str;

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/local/declare3.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/declare3.sql b/hplsql/src/test/queries/local/declare3.sql
new file mode 100644
index 0000000..09b94d6
--- /dev/null
+++ b/hplsql/src/test/queries/local/declare3.sql
@@ -0,0 +1,7 @@
+declare i2 int2 = 1; 
+declare i4 int4 = 1; 
+declare i8 int8 = 1;
+
+print i2+1; 
+print i4+1; 
+print i8+1; 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/local/if.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/if.sql b/hplsql/src/test/queries/local/if.sql
index 2de3045..4b3f161 100644
--- a/hplsql/src/test/queries/local/if.sql
+++ b/hplsql/src/test/queries/local/if.sql
@@ -4,9 +4,9 @@ DECLARE count INT;
 SET state = 'CA';
 SET count = 1;
 
-/*IF count = 1 THEN
+IF count = 1 THEN
   PRINT 'True block - Correct';
-END IF;*/
+END IF;
 
 IF state = 'CA' THEN
   PRINT 'True block - Correct';
@@ -54,7 +54,7 @@ IF state = 'CA'
 ELSE 
   PRINT 'False block - Incorrect'; 
 
-PRINT 'Transact-SQL - BEGIN-END block';
+PRINT 'Transact-SQL - BEGIN-END block'; 
   
 IF state = 'CA'
 BEGIN

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/local/interval.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/interval.sql b/hplsql/src/test/queries/local/interval.sql
index 7962f2d..e40fcbd 100644
--- a/hplsql/src/test/queries/local/interval.sql
+++ b/hplsql/src/test/queries/local/interval.sql
@@ -12,4 +12,6 @@ TIMESTAMP '2015-03-12 10:10:10.000' - 1 MICROSECOND;
 DATE '2015-03-12' - NVL(NULL, 3) DAYS;
 TIMESTAMP '2015-03-12' - NVL(NULL, 3) DAYS;
 
-TIMESTAMP '2015-03-12' - 1 DAY - 1 MICROSECOND;
\ No newline at end of file
+TIMESTAMP '2015-03-12' - 1 DAY - 1 MICROSECOND;
+
+date '2016-01-27' - interval '3' day;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/local/replace.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/replace.sql b/hplsql/src/test/queries/local/replace.sql
new file mode 100644
index 0000000..820aa06
--- /dev/null
+++ b/hplsql/src/test/queries/local/replace.sql
@@ -0,0 +1 @@
+replace('2016-03-03', '-', '');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/offline/create_table_mssql2.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/offline/create_table_mssql2.sql b/hplsql/src/test/queries/offline/create_table_mssql2.sql
new file mode 100644
index 0000000..d8a5805
--- /dev/null
+++ b/hplsql/src/test/queries/offline/create_table_mssql2.sql
@@ -0,0 +1,33 @@
+USE [mic.gr]
+GO
+
+/****** Object:  Table [dbo].[downloads]    Script Date: 03/11/2016 11:46:35 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+SET ANSI_PADDING ON
+GO
+
+CREATE TABLE [dbo].[downloads](
+	[id] [int] IDENTITY(1,1) NOT NULL,
+	[fileName] [char](255) NOT NULL,
+	[fileType] [char](10) NULL,
+	[downloads] [int] NULL,
+	[fromDate] [char](40) NULL,
+	[untilDate] [char](40) NULL,
+ CONSTRAINT [PK_downloads] PRIMARY KEY CLUSTERED 
+(
+	[id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS
 = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+SET ANSI_PADDING OFF
+GO
+
+ALTER TABLE [dbo].[downloads] ADD  CONSTRAINT [DF_downloads_downloads]  DEFAULT (0) FOR [downloads]
+GO

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/offline/create_table_mysql.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/offline/create_table_mysql.sql b/hplsql/src/test/queries/offline/create_table_mysql.sql
new file mode 100644
index 0000000..86afa28
--- /dev/null
+++ b/hplsql/src/test/queries/offline/create_table_mysql.sql
@@ -0,0 +1,5 @@
+CREATE TABLE IF NOT EXISTS `users` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `name` text NOT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='users table' AUTO_INCREMENT=20 ;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/offline/create_table_ora2.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/offline/create_table_ora2.sql b/hplsql/src/test/queries/offline/create_table_ora2.sql
new file mode 100644
index 0000000..028c9de
--- /dev/null
+++ b/hplsql/src/test/queries/offline/create_table_ora2.sql
@@ -0,0 +1,6 @@
+CREATE TABLE "default"."AUDIT_LOGS"
+ ( "RUN_ID" VARCHAR2(36) NOT NULL ENABLE,
+   "FILE_NAME" VARCHAR2(255) NOT NULL ENABLE,
+   "RUN_DATE" DATE NOT NULL ENABLE,
+   CONSTRAINT "AUDIT_LOGS_PK" PRIMARY KEY ("RUN_ID") ENABLE
+ ); 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/offline/create_table_pg.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/offline/create_table_pg.sql b/hplsql/src/test/queries/offline/create_table_pg.sql
new file mode 100644
index 0000000..e0068a4
--- /dev/null
+++ b/hplsql/src/test/queries/offline/create_table_pg.sql
@@ -0,0 +1,5 @@
+create table i1 (
+  c1 int2,
+  c2 int4,
+  c3 int8
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/queries/offline/update.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/offline/update.sql b/hplsql/src/test/queries/offline/update.sql
new file mode 100644
index 0000000..f40fb0f
--- /dev/null
+++ b/hplsql/src/test/queries/offline/update.sql
@@ -0,0 +1,33 @@
+UPDATE tab T SET (c1) = TRIM(c1) WHERE T.c2 = 'A';
+
+UPDATE tab T 
+  SET c1 = TRIM(c1) 
+  WHERE T.c2 = 'A';
+  
+UPDATE tab SET c1 = '0011' WHERE c1 = '0021';
+
+UPDATE tab T SET c1 = TRIM(c1), c3 = TRIM(c3) WHERE T.col2 = 'A';
+
+UPDATE tab T 
+  SET (c1, c3) = (TRIM(c1), TRIM(c3)) 
+  WHERE T.col2 = 'A';
+
+UPDATE tab T
+       SET (c1, c2, c3, c4) =
+           (SELECT c1,
+                   c2,
+                   TRIM(c3),
+                   c4
+              FROM tab2 C
+             WHERE C.c1 = T.c1)
+     WHERE T.c2 = 'A';
+     
+UPDATE tab T
+       SET (c1) =
+           (SELECT c1 FROM tab2 C WHERE C.c1 = T.c1)
+     WHERE T.c2 = 'a';
+       
+UPDATE tab T
+       SET c1 =
+           (SELECT c1 FROM tab2 C WHERE C.c1 = T.c1)
+     WHERE T.c2 = 'a';

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/create_drop_database.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/create_drop_database.out.txt b/hplsql/src/test/results/db/create_drop_database.out.txt
new file mode 100644
index 0000000..194fbe6
--- /dev/null
+++ b/hplsql/src/test/results/db/create_drop_database.out.txt
@@ -0,0 +1,8 @@
+Ln:1 CREATE DATABASE
+Ln:1 create database test20160303
+Ln:2 CREATE DATABASE
+Ln:2 create database if not exists test1 comment 'abc' location '/users'
+Ln:4 DROP
+Ln:4 DROP DATABASE IF EXISTS test20160303
+Ln:5 DROP
+Ln:5 DROP DATABASE test1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/create_procedure_mssql.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/create_procedure_mssql.out.txt b/hplsql/src/test/results/db/create_procedure_mssql.out.txt
index 187e5bb..5214aa9 100644
--- a/hplsql/src/test/results/db/create_procedure_mssql.out.txt
+++ b/hplsql/src/test/results/db/create_procedure_mssql.out.txt
@@ -37,7 +37,7 @@ Ln:38 SELECT 'Correct' FROM src LIMIT 1
 Ln:38 SELECT completed successfully
 Ln:38 Standalone SELECT executed: 1 columns in the result set
 Correct
-Ln:52 EXEC PROCEDURE spTest3
+Ln:51 EXEC PROCEDURE spTest3
 Ln:44 SELECT
 Ln:44 SELECT 'Correct' FROM src LIMIT 1
 Ln:44 SELECT completed successfully

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/create_procedure_no_params.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/create_procedure_no_params.out.txt b/hplsql/src/test/results/db/create_procedure_no_params.out.txt
new file mode 100644
index 0000000..005c4a6
--- /dev/null
+++ b/hplsql/src/test/results/db/create_procedure_no_params.out.txt
@@ -0,0 +1,10 @@
+Ln:1 CREATE PROCEDURE show_the_date
+Ln:9 CREATE PROCEDURE show_the_date2
+Ln:17 EXEC PROCEDURE show_the_date
+Ln:3 DECLARE today DATE = 2016-03-10
+Today is 2016-03-10
+Ln:18 EXEC PROCEDURE show_the_date2
+Ln:11 DECLARE today DATE = 2016-03-10
+Today is 2016-03-10
+Ln:21 DECLARE today DATE = 2016-03-10
+Today is 2016-03-10
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/create_procedure_return_cursor.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/create_procedure_return_cursor.out.txt b/hplsql/src/test/results/db/create_procedure_return_cursor.out.txt
index 81aa6c8..a4370fe 100644
--- a/hplsql/src/test/results/db/create_procedure_return_cursor.out.txt
+++ b/hplsql/src/test/results/db/create_procedure_return_cursor.out.txt
@@ -2,7 +2,7 @@ Ln:1 CREATE PROCEDURE spResultSet1
 Ln:9 CREATE PROCEDURE spResultSet2
 Ln:20 DECLARE v1 VARCHAR
 Ln:21 DECLARE v2 VARCHAR
-EXEC PROCEDURE spResultSet1
+Ln:23 EXEC PROCEDURE spResultSet1
 Ln:4 DECLARE CURSOR cur1
 Ln:6 OPEN
 Ln:6 cur1: SELECT 'A', 'A1' FROM src LIMIT 3
@@ -32,7 +32,7 @@ A - A1
 Ln:30 FETCH
 Ln:27 WHILE - LEFT
 Ln:32 CLOSE
-EXEC PROCEDURE spResultSet2
+Ln:34 EXEC PROCEDURE spResultSet2
 Ln:12 DECLARE CURSOR cur1
 Ln:14 DECLARE CURSOR cur2
 Ln:16 OPEN

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/create_procedure_return_cursor2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/create_procedure_return_cursor2.out.txt b/hplsql/src/test/results/db/create_procedure_return_cursor2.out.txt
index 40f2c33..853de2d 100644
--- a/hplsql/src/test/results/db/create_procedure_return_cursor2.out.txt
+++ b/hplsql/src/test/results/db/create_procedure_return_cursor2.out.txt
@@ -4,7 +4,7 @@ Ln:20 DECLARE v1 VARCHAR
 Ln:21 DECLARE v2 VARCHAR
 Ln:22 DECLARE loc1 RESULT_SET_LOCATOR VARYING
 Ln:23 DECLARE loc2 RESULT_SET_LOCATOR VARYING
-EXEC PROCEDURE spResultSet1
+Ln:25 EXEC PROCEDURE spResultSet1
 Ln:4 DECLARE CURSOR cur1
 Ln:6 OPEN
 Ln:6 cur1: SELECT 'A', 'A1' FROM src LIMIT 3
@@ -35,7 +35,7 @@ A - A1
 Ln:34 FETCH
 Ln:31 WHILE - LEFT
 Ln:36 CLOSE
-EXEC PROCEDURE spResultSet2
+Ln:38 EXEC PROCEDURE spResultSet2
 Ln:12 DECLARE CURSOR cur1
 Ln:14 DECLARE CURSOR cur2
 Ln:16 OPEN

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/describe.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/describe.out.txt b/hplsql/src/test/results/db/describe.out.txt
new file mode 100644
index 0000000..9772a1b
--- /dev/null
+++ b/hplsql/src/test/results/db/describe.out.txt
@@ -0,0 +1,12 @@
+Ln:1 DESCRIBE
+Ln:1 DESCRIBE src
+key	string	default
+value	string	default
+Ln:2 DESCRIBE
+Ln:2 DESCRIBE src
+key	string	default
+value	string	default
+Ln:3 DESCRIBE
+Ln:3 DESCRIBE src
+key	string	default
+value	string	default
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/execute.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/execute.out.txt b/hplsql/src/test/results/db/execute.out.txt
new file mode 100644
index 0000000..24fa646
--- /dev/null
+++ b/hplsql/src/test/results/db/execute.out.txt
@@ -0,0 +1,14 @@
+Ln:1 DECLARE cnt INT
+Ln:2 EXECUTE
+Ln:2 SQL statement: SELECT COUNT(*) FROM src
+Ln:2 COLUMN: _c0, bigint
+Ln:2 SET cnt = 500
+Ln:3 PRINT
+500
+Ln:5 DECLARE sql STRING = 'SELECT COUNT(*) FROM src'
+Ln:6 EXECUTE
+Ln:6 SQL statement: SELECT COUNT(*) FROM src
+Ln:6 COLUMN: _c0, bigint
+Ln:6 SET cnt = 500
+Ln:7 PRINT
+500
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/expression.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/expression.out.txt b/hplsql/src/test/results/db/expression.out.txt
new file mode 100644
index 0000000..2535464
--- /dev/null
+++ b/hplsql/src/test/results/db/expression.out.txt
@@ -0,0 +1,5 @@
+Ln:1 SELECT
+Ln:1 select 0.12 * 0.14, 0.13 / 0.11, 1 + 2, 1 - 2, (1 - 2) + 3, 3 * (2 - 1) from src LIMIT
1
+Ln:1 SELECT completed successfully
+Ln:1 Standalone SELECT executed: 6 columns in the result set
+0.016800000000000002	1.1818181818181819	3	-1	2	3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/for.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/for.out.txt b/hplsql/src/test/results/db/for.out.txt
new file mode 100644
index 0000000..e6730ba
--- /dev/null
+++ b/hplsql/src/test/results/db/for.out.txt
@@ -0,0 +1,44 @@
+Ln:1 FOR CURSOR - ENTERED
+Ln:1 select code from sample_07 LIMIT 10
+Ln:1 SELECT completed successfully
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 00-0000
+Ln:1 PRINT
+00-0000 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-0000
+Ln:1 PRINT
+11-0000 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-1011
+Ln:1 PRINT
+11-1011 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-1021
+Ln:1 PRINT
+11-1021 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-1031
+Ln:1 PRINT
+11-1031 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-2011
+Ln:1 PRINT
+11-2011 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-2021
+Ln:1 PRINT
+11-2021 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-2022
+Ln:1 PRINT
+11-2022 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-2031
+Ln:1 PRINT
+11-2031 aa
+Ln:1 COLUMN: code, string
+Ln:1 SET code = 11-3011
+Ln:1 PRINT
+11-3011 aa
+Ln:1 FOR CURSOR - LEFT
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/insert.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/insert.out.txt b/hplsql/src/test/results/db/insert.out.txt
new file mode 100644
index 0000000..e0362ae
--- /dev/null
+++ b/hplsql/src/test/results/db/insert.out.txt
@@ -0,0 +1,4 @@
+Ln:1 INSERT SELECT
+Ln:1 insert overwrite table src_insert select value from src
+Ln:3 INSERT SELECT
+Ln:3 insert into table src_insert select value from src
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/insert_directory.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/insert_directory.out.txt b/hplsql/src/test/results/db/insert_directory.out.txt
new file mode 100644
index 0000000..73f0b07
--- /dev/null
+++ b/hplsql/src/test/results/db/insert_directory.out.txt
@@ -0,0 +1,9 @@
+Ln:1 INSERT DIRECTORY
+Ln:1 insert overwrite directory '/tmp/src1' select * from src
+Ln:4 INSERT DIRECTORY
+Ln:4 insert overwrite local directory '/tmp/src2' select * from src
+Ln:7 INSERT DIRECTORY
+Ln:7 insert overwrite local directory '/tmp/src3' select * from src
+Ln:10 DECLARE tabname string = 'src'
+Ln:11 INSERT DIRECTORY
+Ln:11 insert overwrite local directory '/tmp/src_2016-03-28' select * from src
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/rowtype_attribute.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/rowtype_attribute.out.txt b/hplsql/src/test/results/db/rowtype_attribute.out.txt
index fc22370..e846d88 100644
--- a/hplsql/src/test/results/db/rowtype_attribute.out.txt
+++ b/hplsql/src/test/results/db/rowtype_attribute.out.txt
@@ -30,7 +30,7 @@ Ln:15 SET key = A
 Ln:15 COLUMN: value, string
 Ln:15 SET value = B
 Ln:17 PRINT
-null
+AB
 Ln:15 FOR CURSOR - LEFT
 Ln:20 EXECUTE
 Ln:20 SQL statement: SELECT 'A' AS key, 'B' AS value FROM src LIMIT 1

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/db/truncate_table.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/db/truncate_table.out.txt b/hplsql/src/test/results/db/truncate_table.out.txt
new file mode 100644
index 0000000..fa46916
--- /dev/null
+++ b/hplsql/src/test/results/db/truncate_table.out.txt
@@ -0,0 +1,4 @@
+Ln:1 TRUNCATE
+Ln:1 TRUNCATE TABLE src_empty
+Ln:2 TRUNCATE
+Ln:2 TRUNCATE TABLE src_empty
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/create_function3.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_function3.out.txt b/hplsql/src/test/results/local/create_function3.out.txt
new file mode 100644
index 0000000..90974ed
--- /dev/null
+++ b/hplsql/src/test/results/local/create_function3.out.txt
@@ -0,0 +1,22 @@
+Ln:1 CREATE FUNCTION gettype
+Ln:57 EXEC FUNCTION gettype
+Ln:57 SET PARAM tag1 = YHHPD
+Ln:57 SET PARAM srcvalue = a
+Ln:5 IF
+Ln:9 IF
+Ln:13 IF
+Ln:17 IF
+Ln:21 IF
+Ln:25 IF
+Ln:29 IF
+Ln:33 IF
+Ln:33 IF TRUE executed
+Ln:34 RETURN
+002_foreign
+Ln:58 EXEC FUNCTION gettype
+Ln:58 SET PARAM tag1 = YHHPD
+Ln:58 SET PARAM srcvalue = @I
+Ln:5 IF
+Ln:5 IF TRUE executed
+Ln:6 RETURN
+@I
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/create_function4.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_function4.out.txt b/hplsql/src/test/results/local/create_function4.out.txt
new file mode 100644
index 0000000..d8daae5
--- /dev/null
+++ b/hplsql/src/test/results/local/create_function4.out.txt
@@ -0,0 +1,9 @@
+Ln:1 CREATE FUNCTION get
+Ln:19 EXEC FUNCTION get
+Ln:19 SET PARAM CODE = abc
+Ln:5 SET TMPVAR = ''
+Ln:7 IF
+Ln:7 IF TRUE executed
+Ln:8 RETURN
+Ln:15 EXCEPTION HANDLER
+00080000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/create_package.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_package.out.txt b/hplsql/src/test/results/local/create_package.out.txt
index ee7a9a0..4b631e5 100644
--- a/hplsql/src/test/results/local/create_package.out.txt
+++ b/hplsql/src/test/results/local/create_package.out.txt
@@ -24,7 +24,7 @@ Ln:20 SET PARAM p1 = 3
 a: 3
 b: 1
 p1: 3
-Ln:21 EXEC PROCEDURE sp2
+EXEC PROCEDURE sp2
 Ln:21 SET PARAM p2 = 1
 pack1.a: 3
 p2: 1

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/create_procedure3.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_procedure3.out.txt b/hplsql/src/test/results/local/create_procedure3.out.txt
new file mode 100644
index 0000000..c2a7c79
--- /dev/null
+++ b/hplsql/src/test/results/local/create_procedure3.out.txt
@@ -0,0 +1,31 @@
+Ln:1 CREATE PROCEDURE proc1
+Ln:13 CREATE PROCEDURE proc2
+Ln:25 DECLARE str string
+Ln:26 EXEC PROCEDURE proc1
+Ln:26 SET PARAM v_msg = null
+Ln:3 DECLARE num1 int = 0
+Ln:4 DECLARE num2 int = 10
+Ln:5 DECLARE num3 int = 30
+Ln:7 PRINT
+0
+Ln:8 PRINT
+10
+Ln:9 PRINT
+30
+Ln:10 SET v_msg = 'Completed'
+Ln:27 PRINT
+Completed
+Ln:28 EXEC PROCEDURE proc2
+Ln:15 DECLARE num1 int = 0
+Ln:16 DECLARE num2 int = 10
+Ln:17 DECLARE num3 int = 30
+Ln:28 SET PARAM v_msg = Completed
+Ln:19 PRINT
+0
+Ln:20 PRINT
+10
+Ln:21 PRINT
+30
+Ln:22 SET v_msg = 'Completed'
+Ln:29 PRINT
+Completed
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/create_procedure_no_params.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_procedure_no_params.out.txt b/hplsql/src/test/results/local/create_procedure_no_params.out.txt
index 9e3bde9..9767e35 100644
--- a/hplsql/src/test/results/local/create_procedure_no_params.out.txt
+++ b/hplsql/src/test/results/local/create_procedure_no_params.out.txt
@@ -1,24 +1,24 @@
 Ln:1 CREATE PROCEDURE sp1
 Ln:6 CREATE PROCEDURE sp2
-EXEC PROCEDURE sp1
+Ln:11 EXEC PROCEDURE sp1
 Ln:3 PRINT
 a
-EXEC PROCEDURE sp1
+Ln:12 EXEC PROCEDURE sp1
 Ln:3 PRINT
 a
-EXEC PROCEDURE sp1
+Ln:13 EXEC PROCEDURE sp1
 Ln:3 PRINT
 a
 EXEC PROCEDURE sp1
 Ln:3 PRINT
 a
-EXEC PROCEDURE sp2
+Ln:16 EXEC PROCEDURE sp2
 Ln:8 PRINT
 b
-EXEC PROCEDURE sp2
+Ln:17 EXEC PROCEDURE sp2
 Ln:8 PRINT
 b
-EXEC PROCEDURE sp2
+Ln:18 EXEC PROCEDURE sp2
 Ln:8 PRINT
 b
 EXEC PROCEDURE sp2

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/declare3.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/declare3.out.txt b/hplsql/src/test/results/local/declare3.out.txt
new file mode 100644
index 0000000..f568aaa
--- /dev/null
+++ b/hplsql/src/test/results/local/declare3.out.txt
@@ -0,0 +1,9 @@
+Ln:1 DECLARE i2 int2 = 1
+Ln:2 DECLARE i4 int4 = 1
+Ln:3 DECLARE i8 int8 = 1
+Ln:5 PRINT
+2
+Ln:6 PRINT
+2
+Ln:7 PRINT
+2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/if.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/if.out.txt b/hplsql/src/test/results/local/if.out.txt
index 1da8142..b34c1fc 100644
--- a/hplsql/src/test/results/local/if.out.txt
+++ b/hplsql/src/test/results/local/if.out.txt
@@ -2,6 +2,10 @@ Ln:1 DECLARE state VARCHAR
 Ln:2 DECLARE count INT
 Ln:4 SET state = 'CA'
 Ln:5 SET count = 1
+Ln:7 IF
+Ln:7 IF TRUE executed
+Ln:8 PRINT
+True block - Correct
 Ln:11 IF
 Ln:11 IF TRUE executed
 Ln:12 PRINT

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/interval.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/interval.out.txt b/hplsql/src/test/results/local/interval.out.txt
index 2dcdcd5..9420877 100644
--- a/hplsql/src/test/results/local/interval.out.txt
+++ b/hplsql/src/test/results/local/interval.out.txt
@@ -9,3 +9,4 @@
 2015-03-09
 2015-03-09 00:00:00
 2015-03-10 23:59:59
+2016-01-24
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/local/replace.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/replace.out.txt b/hplsql/src/test/results/local/replace.out.txt
new file mode 100644
index 0000000..7c8bd69
--- /dev/null
+++ b/hplsql/src/test/results/local/replace.out.txt
@@ -0,0 +1 @@
+20160303
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/offline/create_table_mssql2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/offline/create_table_mssql2.out.txt b/hplsql/src/test/results/offline/create_table_mssql2.out.txt
new file mode 100644
index 0000000..a765c4a
--- /dev/null
+++ b/hplsql/src/test/results/offline/create_table_mssql2.out.txt
@@ -0,0 +1,10 @@
+Ln:1 USE
+Ln:1 SQL statement: USE `mic.gr`
+Ln:14 CREATE TABLE
+Ln:14 CREATE TABLE `downloads` (`id` int,
+`fileName` char(255),
+`fileType` char(10),
+`downloads` int,
+`fromDate` char(40),
+`untilDate` char(40)
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/offline/create_table_mysql.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/offline/create_table_mysql.out.txt b/hplsql/src/test/results/offline/create_table_mysql.out.txt
new file mode 100644
index 0000000..b835135
--- /dev/null
+++ b/hplsql/src/test/results/offline/create_table_mysql.out.txt
@@ -0,0 +1,4 @@
+Ln:1 CREATE TABLE
+Ln:1 CREATE TABLE `users` (`id` int,
+`name` STRING
+) COMMENT 'users table'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/offline/create_table_ora2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/offline/create_table_ora2.out.txt b/hplsql/src/test/results/offline/create_table_ora2.out.txt
new file mode 100644
index 0000000..5d4e107
--- /dev/null
+++ b/hplsql/src/test/results/offline/create_table_ora2.out.txt
@@ -0,0 +1,5 @@
+Ln:1 CREATE TABLE
+Ln:1 CREATE TABLE `default`.`AUDIT_LOGS` (`RUN_ID` STRING,
+`FILE_NAME` STRING,
+`RUN_DATE` DATE
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/offline/create_table_pg.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/offline/create_table_pg.out.txt b/hplsql/src/test/results/offline/create_table_pg.out.txt
new file mode 100644
index 0000000..cad5488
--- /dev/null
+++ b/hplsql/src/test/results/offline/create_table_pg.out.txt
@@ -0,0 +1,5 @@
+Ln:1 CREATE TABLE
+Ln:1 create table i1 (c1 SMALLINT,
+c2 INT,
+c3 BIGINT
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/39d66a43/hplsql/src/test/results/offline/update.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/offline/update.out.txt b/hplsql/src/test/results/offline/update.out.txt
new file mode 100644
index 0000000..fadaac0
--- /dev/null
+++ b/hplsql/src/test/results/offline/update.out.txt
@@ -0,0 +1,34 @@
+Ln:1 UPDATE
+Ln:1 UPDATE tab T SET (c1) = TRIM(c1) WHERE T.c2 = 'A'
+Ln:3 UPDATE
+Ln:3 UPDATE tab T 
+  SET c1 = TRIM(c1) 
+  WHERE T.c2 = 'A'
+Ln:7 UPDATE
+Ln:7 UPDATE tab SET c1 = '0011' WHERE c1 = '0021'
+Ln:9 UPDATE
+Ln:9 UPDATE tab T SET c1 = TRIM(c1), c3 = TRIM(c3) WHERE T.col2 = 'A'
+Ln:11 UPDATE
+Ln:11 UPDATE tab T 
+  SET (c1, c3) = (TRIM(c1), TRIM(c3)) 
+  WHERE T.col2 = 'A'
+Ln:15 UPDATE
+Ln:15 UPDATE tab T
+       SET (c1, c2, c3, c4) =
+           (SELECT c1,
+                   c2,
+                   TRIM(c3),
+                   c4
+              FROM tab2 C
+             WHERE C.c1 = T.c1)
+     WHERE T.c2 = 'A'
+Ln:25 UPDATE
+Ln:25 UPDATE tab T
+       SET (c1) =
+           (SELECT c1 FROM tab2 C WHERE C.c1 = T.c1)
+     WHERE T.c2 = 'a'
+Ln:30 UPDATE
+Ln:30 UPDATE tab T
+       SET c1 =
+           (SELECT c1 FROM tab2 C WHERE C.c1 = T.c1)
+     WHERE T.c2 = 'a'
\ No newline at end of file


Mime
View raw message