hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject [41/50] [abbrv] hive git commit: HIVE-11158 Add tests for HPL/SQL (Dmitry Tolpeko via gates)
Date Thu, 16 Jul 2015 04:41:28 GMT
HIVE-11158 Add tests for HPL/SQL (Dmitry Tolpeko via gates)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/7338d8e1
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/7338d8e1
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/7338d8e1

Branch: refs/heads/beeline-cli
Commit: 7338d8e11983bfe7a63aadfd82b64adef765cb67
Parents: 240097b
Author: Alan Gates <gates@hortonworks.com>
Authored: Wed Jul 15 17:09:12 2015 -0700
Committer: Alan Gates <gates@hortonworks.com>
Committed: Wed Jul 15 17:09:12 2015 -0700

----------------------------------------------------------------------
 hplsql/pom.xml                                  |   9 +-
 .../main/java/org/apache/hive/hplsql/Exec.java  |  11 +-
 .../org/apache/hive/hplsql/TestHplsqlLocal.java | 330 +++++++++++++++++++
 hplsql/src/test/queries/local/add.sql           |   2 +
 hplsql/src/test/queries/local/assign.sql        |   7 +
 hplsql/src/test/queries/local/bool_expr.sql     |  47 +++
 hplsql/src/test/queries/local/break.sql         |  10 +
 hplsql/src/test/queries/local/case.sql          |  35 ++
 hplsql/src/test/queries/local/cast.sql          |   4 +
 hplsql/src/test/queries/local/char.sql          |   1 +
 hplsql/src/test/queries/local/coalesce.sql      |   4 +
 hplsql/src/test/queries/local/concat.sql        |   2 +
 .../src/test/queries/local/create_function.sql  |  11 +
 .../src/test/queries/local/create_function2.sql |  11 +
 .../src/test/queries/local/create_procedure.sql |   9 +
 hplsql/src/test/queries/local/date.sql          |   5 +
 hplsql/src/test/queries/local/dbms_output.sql   |   6 +
 hplsql/src/test/queries/local/declare.sql       |  16 +
 .../test/queries/local/declare_condition.sql    |   8 +
 .../test/queries/local/declare_condition2.sql   |  10 +
 hplsql/src/test/queries/local/decode.sql        |  10 +
 hplsql/src/test/queries/local/equal.sql         |  55 ++++
 hplsql/src/test/queries/local/exception.sql     |  14 +
 hplsql/src/test/queries/local/exception2.sql    |  10 +
 hplsql/src/test/queries/local/exception3.sql    |   5 +
 hplsql/src/test/queries/local/exception4.sql    |   7 +
 hplsql/src/test/queries/local/exception5.sql    |  10 +
 hplsql/src/test/queries/local/exit.sql          |  31 ++
 hplsql/src/test/queries/local/expr.sql          |  21 ++
 hplsql/src/test/queries/local/for_range.sql     |  20 ++
 hplsql/src/test/queries/local/if.sql            |  68 ++++
 hplsql/src/test/queries/local/instr.sql         |  49 +++
 hplsql/src/test/queries/local/interval.sql      |  15 +
 hplsql/src/test/queries/local/lang.sql          |  57 ++++
 hplsql/src/test/queries/local/leave.sql         |  33 ++
 hplsql/src/test/queries/local/len.sql           |   1 +
 hplsql/src/test/queries/local/length.sql        |   1 +
 hplsql/src/test/queries/local/lower.sql         |   1 +
 hplsql/src/test/queries/local/nvl.sql           |   4 +
 hplsql/src/test/queries/local/nvl2.sql          |   2 +
 hplsql/src/test/queries/local/print.sql         |   5 +
 hplsql/src/test/queries/local/return.sql        |   3 +
 hplsql/src/test/queries/local/seterror.sql      |  10 +
 hplsql/src/test/queries/local/sub.sql           |   1 +
 hplsql/src/test/queries/local/substr.sql        |   2 +
 hplsql/src/test/queries/local/substring.sql     |   8 +
 hplsql/src/test/queries/local/timestamp.sql     |   4 +
 hplsql/src/test/queries/local/timestamp_iso.sql |   2 +
 hplsql/src/test/queries/local/to_char.sql       |   1 +
 hplsql/src/test/queries/local/to_timestamp.sql  |   5 +
 hplsql/src/test/queries/local/trim.sql          |   1 +
 hplsql/src/test/queries/local/twopipes.sql      |   1 +
 hplsql/src/test/queries/local/upper.sql         |   1 +
 hplsql/src/test/queries/local/values_into.sql   |   6 +
 hplsql/src/test/queries/local/while.sql         |  20 ++
 hplsql/src/test/results/local/add.out.txt       |   2 +
 hplsql/src/test/results/local/assign.out.txt    |   8 +
 hplsql/src/test/results/local/bool_expr.out.txt |  32 ++
 hplsql/src/test/results/local/break.out.txt     |  29 ++
 hplsql/src/test/results/local/case.out.txt      |  12 +
 hplsql/src/test/results/local/cast.out.txt      |   8 +
 hplsql/src/test/results/local/char.out.txt      |   1 +
 hplsql/src/test/results/local/coalesce.out.txt  |   4 +
 hplsql/src/test/results/local/concat.out.txt    |   2 +
 .../test/results/local/create_function.out.txt  |   9 +
 .../test/results/local/create_function2.out.txt |  10 +
 .../test/results/local/create_procedure.out.txt |   8 +
 hplsql/src/test/results/local/date.out.txt      |   4 +
 .../src/test/results/local/dbms_output.out.txt  |   3 +
 hplsql/src/test/results/local/declare.out.txt   |  13 +
 .../results/local/declare_condition.out.txt     |   7 +
 .../results/local/declare_condition2.out.txt    |  12 +
 hplsql/src/test/results/local/decode.out.txt    |  13 +
 hplsql/src/test/results/local/equal.out.txt     |  48 +++
 hplsql/src/test/results/local/exception.out.txt |  13 +
 .../src/test/results/local/exception2.out.txt   |   5 +
 hplsql/src/test/results/local/exit.out.txt      |  42 +++
 hplsql/src/test/results/local/expr.out.txt      |  29 ++
 hplsql/src/test/results/local/for_range.out.txt |  65 ++++
 hplsql/src/test/results/local/if.out.txt        |  40 +++
 hplsql/src/test/results/local/instr.out.txt     |  33 ++
 hplsql/src/test/results/local/interval.out.txt  |  11 +
 hplsql/src/test/results/local/lang.out.txt      |  34 ++
 hplsql/src/test/results/local/leave.out.txt     |  42 +++
 hplsql/src/test/results/local/len.out.txt       |   1 +
 hplsql/src/test/results/local/length.out.txt    |   1 +
 hplsql/src/test/results/local/lower.out.txt     |   1 +
 hplsql/src/test/results/local/nvl.out.txt       |   4 +
 hplsql/src/test/results/local/nvl2.out.txt      |   2 +
 .../test/results/local/plhqlexception.out.txt   |   6 +
 .../test/results/local/plhqlexception1.out.txt  |  10 +
 .../test/results/local/plhqlexception2.out.txt  | 106 ++++++
 hplsql/src/test/results/local/print.out.txt     |   6 +
 hplsql/src/test/results/local/return.out.txt    |   3 +
 .../results/local/select_conversion.out.txt     |   9 +
 hplsql/src/test/results/local/seterror.out.txt  |   6 +
 hplsql/src/test/results/local/sub.out.txt       |   1 +
 hplsql/src/test/results/local/substr.out.txt    |   2 +
 hplsql/src/test/results/local/substring.out.txt |   8 +
 hplsql/src/test/results/local/timestamp.out.txt |   4 +
 .../test/results/local/timestamp_iso.out.txt    |   2 +
 hplsql/src/test/results/local/to_char.out.txt   |   1 +
 .../src/test/results/local/to_timestamp.out.txt |   4 +
 hplsql/src/test/results/local/trim.out.txt      |   1 +
 hplsql/src/test/results/local/twopipes.out.txt  |   1 +
 hplsql/src/test/results/local/upper.out.txt     |   1 +
 .../src/test/results/local/values_into.out.txt  |  11 +
 hplsql/src/test/results/local/while.out.txt     |  72 ++++
 108 files changed, 1821 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/pom.xml
----------------------------------------------------------------------
diff --git a/hplsql/pom.xml b/hplsql/pom.xml
index d096e90..fc1c527 100644
--- a/hplsql/pom.xml
+++ b/hplsql/pom.xml
@@ -58,7 +58,6 @@
       <artifactId>commons-logging</artifactId>
       <version>${commons-logging.version}</version>
     </dependency>
-
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
@@ -74,6 +73,12 @@
        <artifactId>antlr4-runtime</artifactId>
        <version>4.5</version>
     </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <profiles>
@@ -103,7 +108,7 @@
   
   <build>
     <plugins>
-      <plugin>
+     <plugin>
         <groupId>org.antlr</groupId>
           <artifactId>antlr4-maven-plugin</artifactId>
           <version>4.5</version>

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
----------------------------------------------------------------------
diff --git a/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java b/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
index 9ec8959..40fdc82 100644
--- a/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
+++ b/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
@@ -1644,7 +1644,16 @@ public class Exec extends HplsqlBaseVisitor<Integer> {
    */
   @Override 
   public Integer visitLabel(HplsqlParser.LabelContext ctx) { 
-    exec.labels.push(ctx.L_ID().toString()); 
+    if (ctx.L_ID() != null) {
+      exec.labels.push(ctx.L_ID().toString());
+    }
+    else {
+      String label = ctx.L_LABEL().getText();
+      if (label.endsWith(":")) {
+        label = label.substring(0, label.length() - 1);
+      }
+      exec.labels.push(label);
+    }
     return 0;
   }
   

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/java/org/apache/hive/hplsql/TestHplsqlLocal.java
----------------------------------------------------------------------
diff --git a/hplsql/src/test/java/org/apache/hive/hplsql/TestHplsqlLocal.java b/hplsql/src/test/java/org/apache/hive/hplsql/TestHplsqlLocal.java
new file mode 100644
index 0000000..ee2be66
--- /dev/null
+++ b/hplsql/src/test/java/org/apache/hive/hplsql/TestHplsqlLocal.java
@@ -0,0 +1,330 @@
+/**
+ * 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.
+ */
+
+package org.apache.hive.hplsql;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.StringReader;
+import org.apache.commons.io.FileUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Unit tests for HPL/SQL (no Hive connection required)
+ */
+public class TestHplsqlLocal {
+
+  private final ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+  @Test
+  public void testAdd() throws Exception {
+    run("add");
+  }
+
+  @Test
+  public void testAssign() throws Exception {
+    run("assign");
+  }
+
+  @Test
+  public void testBoolExpr() throws Exception {
+    run("bool_expr");
+  }
+
+  @Test
+  public void testBreak() throws Exception {
+    run("break");
+  }
+
+  @Test
+  public void testCase() throws Exception {
+    run("case");
+  }
+
+  @Test
+  public void testCast() throws Exception {
+    run("cast");
+  }
+
+  @Test
+  public void testChar() throws Exception {
+    run("char");
+  }
+
+  @Test
+  public void testCoalesce() throws Exception {
+    run("coalesce");
+  }
+
+  @Test
+  public void testConcat() throws Exception {
+    run("concat");
+  }
+
+  @Test
+  public void testCreateFunction() throws Exception {
+    run("create_function");
+  }
+
+  @Test
+  public void testCreateFunction2() throws Exception {
+    run("create_function2");
+  }
+
+  @Test
+  public void testCreateProcedure() throws Exception {
+    run("create_procedure");
+  }
+
+  @Test
+  public void testDate() throws Exception {
+    run("date");
+  }
+
+  @Test
+  public void testDbmsOutput() throws Exception {
+    run("dbms_output");
+  }
+
+  @Test
+  public void testDeclare() throws Exception {
+    run("declare");
+  }
+
+  @Test
+  public void testDeclareCondition() throws Exception {
+    run("declare_condition");
+  }
+
+  @Test
+  public void testDeclareCondition2() throws Exception {
+    run("declare_condition2");
+  }
+
+  @Test
+  public void testDecode() throws Exception {
+    run("decode");
+  }
+
+  @Test
+  public void testEqual() throws Exception {
+    run("equal");
+  }
+
+  @Test
+  public void testException() throws Exception {
+    run("exception");
+  }
+
+  @Test
+  public void testException2() throws Exception {
+    run("exception2");
+  }
+
+  @Test
+  public void testException3() throws Exception {
+    run("exception2");
+  }
+
+  @Test
+  public void testException4() throws Exception {
+    run("exception2");
+  }
+
+  @Test
+  public void testException5() throws Exception {
+    run("exception2");
+  }
+
+  @Test
+  public void testExit() throws Exception {
+    run("exit");
+  }
+
+  @Test
+  public void testExpr() throws Exception {
+    run("expr");
+  }
+
+  @Test
+  public void testForRange() throws Exception {
+    run("for_range");
+  }
+
+  @Test
+  public void testIf() throws Exception {
+    run("if");
+  }
+
+  @Test
+  public void testInstr() throws Exception {
+    run("instr");
+  }
+
+  @Test
+  public void testInterval() throws Exception {
+    run("interval");
+  }
+
+  @Test
+  public void testLang() throws Exception {
+    run("lang");
+  }
+
+  @Test
+  public void testLeave() throws Exception {
+    run("leave");
+  }
+
+  @Test
+  public void testLength() throws Exception {
+    run("length");
+  }
+
+  @Test
+  public void testLen() throws Exception {
+    run("len");
+  }
+
+  @Test
+  public void testLower() throws Exception {
+    run("lower");
+  }
+
+  @Test
+  public void testNvl() throws Exception {
+    run("nvl");
+  }
+
+  @Test
+  public void testNvl2() throws Exception {
+    run("nvl2");
+  }
+
+  @Test
+  public void testPrint() throws Exception {
+    run("print");
+  }
+
+  @Test
+  public void testReturn() throws Exception {
+    run("return");
+  }
+
+  @Test
+  public void testSetError() throws Exception {
+    run("seterror");
+  }
+
+  @Test
+  public void testSub() throws Exception {
+    run("sub");
+  }
+
+  @Test
+  public void testSubstring() throws Exception {
+    run("substring");
+  }
+
+  @Test
+  public void testSubstr() throws Exception {
+    run("substr");
+  }
+
+  @Test
+  public void testTimestampIso() throws Exception {
+    run("timestamp_iso");
+  }
+
+  @Test
+  public void testTimestamp() throws Exception {
+    run("timestamp");
+  }
+
+  @Test
+  public void testToChar() throws Exception {
+    run("to_char");
+  }
+
+  @Test
+  public void testToTimestamp() throws Exception {
+    run("to_timestamp");
+  }
+
+  @Test
+  public void testTrim() throws Exception {
+    run("trim");
+  }
+
+  @Test
+  public void testTwoPipes() throws Exception {
+    run("twopipes");
+  }
+
+  @Test
+  public void testUpper() throws Exception {
+    run("upper");
+  }
+
+  @Test
+  public void testValuesInto() throws Exception {
+    run("values_into");
+  }
+
+  @Test
+  public void testWhile() throws Exception {
+    run("while");
+  }
+
+  /**
+   * Run a test file
+   */
+  void run(String testFile) throws Exception {
+    System.setOut(new PrintStream(out));
+    Exec exec = new Exec();
+    String[] args = { "-f", "src/test/queries/local/" + testFile + ".sql", "-trace" };
+    exec.init(args);
+    Var result = exec.run();
+    if (result != null) {
+      System.out.println(result.toString());
+    }
+    String s = getTestOutput(out.toString()).trim();
+    FileUtils.writeStringToFile(new java.io.File("target/tmp/log/" + testFile + ".out.txt"), s);
+    String t = FileUtils.readFileToString(new java.io.File("src/test/results/local/" + testFile + ".out.txt"), "utf-8").trim();
+    System.setOut(null);
+    Assert.assertEquals(s, t);
+  }
+
+  /**
+   * Get test output
+   */
+  String getTestOutput(String s) throws Exception {
+    StringBuilder sb = new StringBuilder();
+    BufferedReader reader = new BufferedReader(new StringReader(s));
+    String line = null;
+    while ((line = reader.readLine()) != null) {
+      if (!line.startsWith("log4j:")) {
+        sb.append(line);
+        sb.append("\n");
+      }
+    }
+    return sb.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/add.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/add.sql b/hplsql/src/test/queries/local/add.sql
new file mode 100644
index 0000000..2861a5f
--- /dev/null
+++ b/hplsql/src/test/queries/local/add.sql
@@ -0,0 +1,2 @@
+DATE '2014-12-31' + 1;
+1 + DATE '2014-12-31';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/assign.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/assign.sql b/hplsql/src/test/queries/local/assign.sql
new file mode 100644
index 0000000..67e6893
--- /dev/null
+++ b/hplsql/src/test/queries/local/assign.sql
@@ -0,0 +1,7 @@
+code := 'A';
+status := 1;
+count = 0;
+
+SET code = 'A';
+SET status = 1, count = 0;
+SET (count, limit) = (0, 100);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/bool_expr.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/bool_expr.sql b/hplsql/src/test/queries/local/bool_expr.sql
new file mode 100644
index 0000000..098096f
--- /dev/null
+++ b/hplsql/src/test/queries/local/bool_expr.sql
@@ -0,0 +1,47 @@
+IF 1=1 THEN
+  PRINT 'Correct';
+ELSE 
+  PRINT 'FAILED';
+END IF;
+
+IF 1=1 OR 2=2 THEN
+  PRINT 'Correct';
+ELSE 
+  PRINT 'FAILED';
+END IF;
+
+IF (1=1 OR 2=2) THEN
+  PRINT 'Correct';
+ELSE 
+  PRINT 'FAILED';
+END IF; 
+
+IF (1=1 AND 2=2 AND 3=4) THEN
+  PRINT 'FAILED';
+ELSE 
+  PRINT 'Correct';
+END IF; 
+
+IF ((1=1) AND (2=2)) THEN
+  PRINT 'Correct';
+ELSE 
+  PRINT 'FAILED';
+END IF;
+
+IF (1=1 AND (2=2)) THEN
+  PRINT 'Correct';
+ELSE 
+  PRINT 'FAILED';
+END IF;
+
+IF ((1=1) AND 2=2 AND 3=3) THEN
+  PRINT 'Correct';
+ELSE 
+  PRINT 'FAILED';
+END IF;
+
+IF ((1=1 OR 2=2) AND 2=2 AND 3=3 AND (1=2 OR 2=3)) THEN
+  PRINT 'FAILED';
+ELSE 
+  PRINT 'Correct';
+END IF;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/break.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/break.sql b/hplsql/src/test/queries/local/break.sql
new file mode 100644
index 0000000..c53535d
--- /dev/null
+++ b/hplsql/src/test/queries/local/break.sql
@@ -0,0 +1,10 @@
+DECLARE count INT DEFAULT 3;
+WHILE 1=1 BEGIN
+  PRINT 'Start of while block';
+  PRINT count;
+  SET count = count - 1;
+  IF count = 0
+    BREAK;
+  PRINT 'End of while block';
+END
+PRINT 'End of script';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/case.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/case.sql b/hplsql/src/test/queries/local/case.sql
new file mode 100644
index 0000000..5bbdda9
--- /dev/null
+++ b/hplsql/src/test/queries/local/case.sql
@@ -0,0 +1,35 @@
+PRINT CASE 1 
+        WHEN 0 THEN 'FAILED'
+        WHEN 1 THEN 'Correct' 
+        WHEN 2 THEN 'FAILED'
+        ELSE 'FAILED'
+      END 
+
+PRINT CASE 3 
+        WHEN 0 THEN 'FAILED'
+        WHEN 1 THEN 'FAILED'
+        ELSE 'Correct'
+      END       
+      
+PRINT NVL2(CASE 3 
+        WHEN 0 THEN 'FAILED'
+        WHEN 1 THEN 'FAILED'
+      END, 'FAILED', 'Correct')  
+      
+PRINT CASE  
+        WHEN 1=0 THEN 'FAILED'
+        WHEN 1=1 THEN 'Correct' 
+        WHEN 1=2 THEN 'FAILED'
+        ELSE 'FAILED'
+      END 
+
+PRINT CASE  
+        WHEN 3=0 THEN 'FAILED'
+        WHEN 3=1 THEN 'FAILED'
+        ELSE 'Correct'
+      END       
+      
+PRINT NVL2(CASE  
+        WHEN 3=0 THEN 'FAILED'
+        WHEN 3=1 THEN 'FAILED'
+      END, 'FAILED', 'Correct') 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/cast.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/cast.sql b/hplsql/src/test/queries/local/cast.sql
new file mode 100644
index 0000000..3adab22
--- /dev/null
+++ b/hplsql/src/test/queries/local/cast.sql
@@ -0,0 +1,4 @@
+CAST('Abc' AS CHAR(1));
+CAST('Abc' AS VARCHAR(2));
+CAST('Abc' AS CHAR);
+CAST(TIMESTAMP '2015-03-12 10:58:34.111' AS CHAR(10))

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/char.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/char.sql b/hplsql/src/test/queries/local/char.sql
new file mode 100644
index 0000000..2a4f779
--- /dev/null
+++ b/hplsql/src/test/queries/local/char.sql
@@ -0,0 +1 @@
+CHAR(1000)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/coalesce.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/coalesce.sql b/hplsql/src/test/queries/local/coalesce.sql
new file mode 100644
index 0000000..4b65d58
--- /dev/null
+++ b/hplsql/src/test/queries/local/coalesce.sql
@@ -0,0 +1,4 @@
+COALESCE('First non-null', 1);
+COALESCE(NULL, 'First non-null');
+COALESCE(NULL, 'First non-null', 1);
+COALESCE(NULL, NULL, 'First non-null', 1);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/concat.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/concat.sql b/hplsql/src/test/queries/local/concat.sql
new file mode 100644
index 0000000..b7769bb
--- /dev/null
+++ b/hplsql/src/test/queries/local/concat.sql
@@ -0,0 +1,2 @@
+CONCAT('a', 'b', NULL, 'c'); 
+NVL(CONCAT(NULL, NULL, NULL), 'NULL Value'); 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/create_function.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/create_function.sql b/hplsql/src/test/queries/local/create_function.sql
new file mode 100644
index 0000000..96bf290
--- /dev/null
+++ b/hplsql/src/test/queries/local/create_function.sql
@@ -0,0 +1,11 @@
+CREATE FUNCTION hello()
+ RETURNS STRING
+BEGIN
+ PRINT 'Start';
+ RETURN 'Hello, world';
+ PRINT 'Must not be printed';
+END;
+ 
+-- Call the function
+PRINT hello() || '!';
+PRINT 'End of script';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/create_function2.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/create_function2.sql b/hplsql/src/test/queries/local/create_function2.sql
new file mode 100644
index 0000000..744ea9e
--- /dev/null
+++ b/hplsql/src/test/queries/local/create_function2.sql
@@ -0,0 +1,11 @@
+CREATE FUNCTION hello2(text STRING)
+  RETURNS STRING
+BEGIN
+  PRINT 'Start';
+  RETURN 'Hello, ' || text || '!';
+  PRINT 'Must not be printed';
+END;
+ 
+-- Call the function
+PRINT hello2('wor' || 'ld');
+PRINT 'End of script';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/create_procedure.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/create_procedure.sql b/hplsql/src/test/queries/local/create_procedure.sql
new file mode 100644
index 0000000..28088a2
--- /dev/null
+++ b/hplsql/src/test/queries/local/create_procedure.sql
@@ -0,0 +1,9 @@
+CREATE PROCEDURE set_message(IN name STRING, OUT result STRING)
+BEGIN
+  SET result = 'Hello, ' || name || '!';
+END;
+ 
+DECLARE str STRING;
+CALL set_message('world', str);
+PRINT str;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/date.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/date.sql b/hplsql/src/test/queries/local/date.sql
new file mode 100644
index 0000000..2ef4743
--- /dev/null
+++ b/hplsql/src/test/queries/local/date.sql
@@ -0,0 +1,5 @@
+DATE '2014-12-20'
+
+DATE('2015-03-12');
+DATE('2015' || '-03-' || '12');
+DATE(TIMESTAMP '2015-03-12 10:58:34.111');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/dbms_output.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/dbms_output.sql b/hplsql/src/test/queries/local/dbms_output.sql
new file mode 100644
index 0000000..37d7313
--- /dev/null
+++ b/hplsql/src/test/queries/local/dbms_output.sql
@@ -0,0 +1,6 @@
+DECLARE
+  str VARCHAR(200) DEFAULT 'Hello, world!';
+BEGIN
+  DBMS_OUTPUT.PUT_LINE('Hello, world!');
+  DBMS_OUTPUT.PUT_LINE(str);
+END;

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/declare.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/declare.sql b/hplsql/src/test/queries/local/declare.sql
new file mode 100644
index 0000000..fd02da9
--- /dev/null
+++ b/hplsql/src/test/queries/local/declare.sql
@@ -0,0 +1,16 @@
+DECLARE
+  code CHAR(10);
+  status INT := 1;
+  count SMALLINT = 0;
+  limit INT DEFAULT 100;  
+  f UTL_FILE.FILE_TYPE;
+BEGIN
+  status := 2;
+END;
+  
+DECLARE code CHAR(10);
+DECLARE status, status2 INT DEFAULT 1;
+DECLARE count SMALLINT, limit INT DEFAULT 100;  
+
+DECLARE dt DATE DEFAULT '2015-05-13';
+DECLARE ts TIMESTAMP DEFAULT '2015-05-13 11:10:01';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/declare_condition.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/declare_condition.sql b/hplsql/src/test/queries/local/declare_condition.sql
new file mode 100644
index 0000000..8739499
--- /dev/null
+++ b/hplsql/src/test/queries/local/declare_condition.sql
@@ -0,0 +1,8 @@
+DECLARE cnt_condition CONDITION;
+DECLARE EXIT HANDLER FOR cnt_condition
+  PRINT 'Condition raised';  
+IF 1 <> 2 THEN
+  SIGNAL cnt_condition;
+END IF;
+PRINT 'Must not be printed 1';
+PRINT 'Must not be printed 2';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/declare_condition2.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/declare_condition2.sql b/hplsql/src/test/queries/local/declare_condition2.sql
new file mode 100644
index 0000000..d6a6461
--- /dev/null
+++ b/hplsql/src/test/queries/local/declare_condition2.sql
@@ -0,0 +1,10 @@
+DECLARE cnt_condition CONDITION;
+DECLARE CONTINUE HANDLER FOR cnt_condition
+  PRINT 'Wrong condition';  
+DECLARE CONTINUE HANDLER FOR cnt_condition2
+  PRINT 'Condition raised';  
+IF 1 <> 2 THEN
+  SIGNAL cnt_condition2;
+END IF;
+PRINT 'Executed 1';
+PRINT 'Executed 2';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/decode.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/decode.sql b/hplsql/src/test/queries/local/decode.sql
new file mode 100644
index 0000000..a9f7c0c
--- /dev/null
+++ b/hplsql/src/test/queries/local/decode.sql
@@ -0,0 +1,10 @@
+DECLARE var1 INT DEFAULT 3;
+PRINT DECODE (var1, 1, 'A', 2, 'B', 3, 'C');
+PRINT DECODE (var1, 1, 'A', 2, 'B', 'C');
+
+SET var1 := 1;
+PRINT DECODE (var1, 1, 'A', 2, 'B', 3, 'C');
+
+SET var1 := NULL;
+PRINT DECODE (var1, 1, 'A', 2, 'B', NULL, 'C');
+PRINT DECODE (var1, 1, 'A', 2, 'B', 'C');

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/equal.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/equal.sql b/hplsql/src/test/queries/local/equal.sql
new file mode 100644
index 0000000..0de2801
--- /dev/null
+++ b/hplsql/src/test/queries/local/equal.sql
@@ -0,0 +1,55 @@
+PRINT 'Case 1 = 1';
+IF 1 = 1 THEN
+  PRINT 'Equal - Correct';
+ELSE
+  PRINT 'Not equal - Incorrect';
+END IF;
+
+PRINT 'Case 1 == 1';
+IF 1 == 1 THEN
+  PRINT 'Equal - Correct';
+ELSE
+  PRINT 'Not equal - Incorrect';
+END IF;
+
+PRINT 'Case 1 <> 3';
+IF 1 <> 3 THEN
+  PRINT 'Not equal - Correct';
+ELSE
+  PRINT 'Equal - Incorrect';
+END IF;
+
+PRINT 'Case 1 != 3';
+IF 1 != 3 THEN
+  PRINT 'Not equal - Correct';
+ELSE
+  PRINT 'Equal - Incorrect';
+END IF;
+
+PRINT 'Case 3 > 1';
+IF 3 > 1 THEN
+  PRINT 'Greater - Correct';
+ELSE
+  PRINT 'Greater - Incorrect';
+END IF;
+
+PRINT 'Case 1 < 3';
+IF 1 < 3 THEN
+  PRINT 'Less - Correct';
+ELSE
+  PRINT 'Less - Incorrect';
+END IF;
+
+PRINT 'Case 3 >= 1';
+IF 3 >= 1 THEN
+  PRINT 'Greater or equal - Correct';
+ELSE
+  PRINT 'Greater or equal - Incorrect';
+END IF;
+
+PRINT 'Case 1 <= 3';
+IF 1 <= 3 THEN
+  PRINT 'Less or equal - Correct';
+ELSE
+  PRINT 'Less or equal - Incorrect';
+END IF;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/exception.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/exception.sql b/hplsql/src/test/queries/local/exception.sql
new file mode 100644
index 0000000..7ce7377
--- /dev/null
+++ b/hplsql/src/test/queries/local/exception.sql
@@ -0,0 +1,14 @@
+BEGIN
+  PRINT 'Correct';
+  WHILE 1=1 THEN
+    FETCH cur INTO v;
+    PRINT 'Incorrect - unreachable code, unknown cursor name, exception must be raised';
+  END WHILE;
+EXCEPTION WHEN OTHERS THEN
+  PRINT 'Correct';
+  PRINT 'Correct';
+  PRINT 'Correct - Exception raised';   
+  WHEN NO_DATA_FOUND THEN
+  PRINT 'Correct';
+END 
+

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/exception2.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/exception2.sql b/hplsql/src/test/queries/local/exception2.sql
new file mode 100644
index 0000000..3394da8
--- /dev/null
+++ b/hplsql/src/test/queries/local/exception2.sql
@@ -0,0 +1,10 @@
+DECLARE 
+  v VARCHAR(200);
+BEGIN
+  OPEN cur FOR 'SELECT c1 FROM t1';
+  FETCH cur INTO v;
+  CLOSE cur;
+EXCEPTION WHEN OTHERS THEN
+  DBMS_OUTPUT.PUT_LINE('Error');
+END 
+

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/exception3.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/exception3.sql b/hplsql/src/test/queries/local/exception3.sql
new file mode 100644
index 0000000..a12b853
--- /dev/null
+++ b/hplsql/src/test/queries/local/exception3.sql
@@ -0,0 +1,5 @@
+PRINT 'Correct';
+WHILE 1=1 THEN
+FETCH cur INTO v;
+PRINT 'Incorrect - unreachable code, unknown cursor name, exception must be raised';
+END WHILE;

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/exception4.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/exception4.sql b/hplsql/src/test/queries/local/exception4.sql
new file mode 100644
index 0000000..38d89b5
--- /dev/null
+++ b/hplsql/src/test/queries/local/exception4.sql
@@ -0,0 +1,7 @@
+PRINT 'Correct';
+DECLARE EXIT HANDLER FOR SQLEXCEPTION
+  PRINT 'Correct - Exception raised';    
+WHILE 1=1 THEN
+FETCH cur INTO v;
+PRINT 'Incorrect - unreachable code, unknown cursor name, exception must be raised';
+END WHILE;

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/exception5.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/exception5.sql b/hplsql/src/test/queries/local/exception5.sql
new file mode 100644
index 0000000..6232984
--- /dev/null
+++ b/hplsql/src/test/queries/local/exception5.sql
@@ -0,0 +1,10 @@
+DECLARE cnt INT := 0;
+PRINT 'Correct';
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+  PRINT 'Correct - Exception raised';    
+WHILE cnt < 10 THEN
+FETCH cur INTO v;
+PRINT cnt;
+PRINT 'Correct - exception handled';
+SET cnt = cnt + 1;
+END WHILE;

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/exit.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/exit.sql b/hplsql/src/test/queries/local/exit.sql
new file mode 100644
index 0000000..d0e432b
--- /dev/null
+++ b/hplsql/src/test/queries/local/exit.sql
@@ -0,0 +1,31 @@
+DECLARE count INT DEFAULT 3;
+
+WHILE 1=1 LOOP
+  PRINT 'Start of while block';
+  PRINT count;
+  count := count - 1;
+  EXIT WHEN count = 0;
+  PRINT 'End of while block';
+END LOOP;
+
+count := 3;
+
+<<lbl>>
+WHILE 1=1 LOOP
+  PRINT 'Start of outer while block';
+  
+  WHILE 1=1 LOOP
+    PRINT 'Start of 1st inner while block';
+    EXIT;
+    PRINT 'End of 1st inner while block (NEVER SHOWN)';
+  END LOOP;
+  
+  <<lbl2>>
+  WHILE 1=1 LOOP
+    PRINT 'Start of 2nd inner while block';
+    EXIT lbl;
+    PRINT 'End of 2nd inner while block (NEVER SHOWN)';
+  END LOOP;
+  PRINT 'End of outer while block (NEVER SHOWN)';
+END LOOP;
+PRINT 'End of script';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/expr.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/expr.sql b/hplsql/src/test/queries/local/expr.sql
new file mode 100644
index 0000000..33388a2
--- /dev/null
+++ b/hplsql/src/test/queries/local/expr.sql
@@ -0,0 +1,21 @@
+PRINT 'a' || 'b';
+PRINT 'a' || 1 || 'b';
+PRINT 1 || 'a' || 'b';
+PRINT 'a' || null || 'b';
+PRINT null || 'a' || 'b';
+PRINT null || null;
+
+DECLARE c INT;
+
+PRINT 'Integer increment'; 
+c := 3;
+c := c + 1;
+PRINT c;
+
+PRINT 'Integer decrement'; 
+c := 3;
+c := c - 1;
+PRINT c; 
+
+PRINT NVL(null - 3, 'Correct');
+PRINT NVL(null + 3, 'Correct');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/for_range.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/for_range.sql b/hplsql/src/test/queries/local/for_range.sql
new file mode 100644
index 0000000..b7af115
--- /dev/null
+++ b/hplsql/src/test/queries/local/for_range.sql
@@ -0,0 +1,20 @@
+DECLARE i INT = 3;
+PRINT i;
+
+FOR i IN 1..10 LOOP
+  PRINT i;
+END LOOP;
+
+PRINT i;
+
+FOR i IN REVERSE 10..1 LOOP
+  PRINT i;
+END LOOP;
+
+PRINT i;
+
+FOR i IN 1..10 BY 2 LOOP
+  PRINT i;
+END LOOP;
+
+PRINT i;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/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
new file mode 100644
index 0000000..2de3045
--- /dev/null
+++ b/hplsql/src/test/queries/local/if.sql
@@ -0,0 +1,68 @@
+DECLARE state VARCHAR;
+DECLARE count INT;
+
+SET state = 'CA';
+SET count = 1;
+
+/*IF count = 1 THEN
+  PRINT 'True block - Correct';
+END IF;*/
+
+IF state = 'CA' THEN
+  PRINT 'True block - Correct';
+ELSE
+  PRINT 'False block - Incorrect';
+END IF;
+
+IF state = 'MA' THEN
+  PRINT 'True block - Incorrect';
+ELSE
+  PRINT 'False block - Correct';
+END IF;
+
+IF count = 4 THEN
+  PRINT 'True block - Incorrect';  
+ELSIF count = 3 THEN
+  PRINT 'True block - Incorrect';  
+ELSIF count = 2 THEN
+  PRINT 'True block - Incorrect';  
+ELSE
+  PRINT 'False block - Correct'; 
+END IF;
+
+IF count = 3 THEN
+  PRINT 'True block - Incorrect';  
+ELSIF count = 2 THEN
+  PRINT 'True block - Incorrect';  
+ELSIF count = 1 THEN
+  PRINT 'True block - Correct';  
+ELSE
+  PRINT 'False block - Incorrect'; 
+END IF;
+
+PRINT 'IS NOT NULL AND BETWEEN';
+IF 1 IS NOT NULL AND 1 BETWEEN 0 AND 100 THEN
+  PRINT 'True block - Correct';  
+ELSE
+  PRINT 'False block - Incorrect'; 
+END IF;
+
+PRINT 'Transact-SQL - Single statement';
+
+IF state = 'CA'
+  PRINT 'True block - Correct';  
+ELSE 
+  PRINT 'False block - Incorrect'; 
+
+PRINT 'Transact-SQL - BEGIN-END block';
+  
+IF state = 'CA'
+BEGIN
+  PRINT 'True block - Correct'; 
+  PRINT 'True block - Correct'; 
+END
+ELSE 
+BEGIN
+  PRINT 'False block - Incorrect'; 
+  PRINT 'False block - Incorrect'; 
+END  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/instr.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/instr.sql b/hplsql/src/test/queries/local/instr.sql
new file mode 100644
index 0000000..9cd8dca
--- /dev/null
+++ b/hplsql/src/test/queries/local/instr.sql
@@ -0,0 +1,49 @@
+IF INSTR('abc', 'b') = 2 THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF;
+
+IF INSTR('abcabc', 'b', 3) = 5 THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF;
+
+IF INSTR('abcabcabc', 'b', 3, 2) = 8 THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF; 
+
+IF INSTR('abcabcabc', 'b', -3) = 5 THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF; 
+
+IF INSTR('abcabcabc', 'b', -3, 2) = 2 THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF;
+
+DECLARE c STRING;
+
+IF INSTR(c, 'b') IS NULL THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF;
+
+IF INSTR(NULL, 'b') IS NULL THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF;
+
+IF INSTR('', 'b') = 0 THEN
+  PRINT 'Correct';
+ELSE
+  PRINT 'Failed';
+END IF;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/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
new file mode 100644
index 0000000..7962f2d
--- /dev/null
+++ b/hplsql/src/test/queries/local/interval.sql
@@ -0,0 +1,15 @@
+DATE '2015-03-12' + 1 DAY;
+TIMESTAMP '2015-03-12' + 1 DAY;
+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;
+
+DATE '2015-03-12' - 1 DAY;
+TIMESTAMP '2015-03-12' - 1 DAY;
+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

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/lang.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/lang.sql b/hplsql/src/test/queries/local/lang.sql
new file mode 100644
index 0000000..56f8c33
--- /dev/null
+++ b/hplsql/src/test/queries/local/lang.sql
@@ -0,0 +1,57 @@
+-- Integer literals
++1;
+1;
+0;
+-1;
+
+-- Decimal literals
+1.0;
++1.0;
+-1.0;
+-- 1.;
+-- +1.;
+-- -1.;
+-- .1;
+-- +.1;
+-- -.1;
+
+-- Identifiers
+declare abc int;
+declare abc.abc int;
+declare abc . abc1 int;
+declare "abc" int;
+declare "abc".abc int;
+declare "abc"."abc" int;
+declare "abc" . "abc1" int;
+declare [abc] int;
+declare [abc].abc int;
+declare [abc].[abc] int;
+declare [abc] . [abc1] int;
+declare `abc` int;
+declare `abc`.abc int;
+declare `abc`.`abc` int;
+declare `abc` . `abc1` int;
+declare :new.abc int;
+declare @abc int;
+declare _abc int;
+declare #abc int;
+declare ##abc int;
+declare $abc int;
+declare abc_9 int;
+
+-- Operators and expressions
++1 + 1;                 -- 2
+1 + 1;                  -- 2
+1 + -1;                 -- 0
+-- 'a' + 'b';              -- ab    
+-- 'a''b' + 'c';           -- ab''c   
+-- 'a\'b' + 'c';           -- ab\'c   
+-- 1 + '1'                 -- 2        
+-- '1' + 1                 -- 2
+-- 1 + 'a'                 -- 1a     
+-- 'a' + 1                 -- a1
+
+-1 - 1;   -- -2
+-1 - -1;  -- 0
+
+ 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/leave.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/leave.sql b/hplsql/src/test/queries/local/leave.sql
new file mode 100644
index 0000000..a4fc0d5
--- /dev/null
+++ b/hplsql/src/test/queries/local/leave.sql
@@ -0,0 +1,33 @@
+DECLARE count INT DEFAULT 3;
+lbl:
+WHILE 1=1 DO
+  PRINT 'Start of while block';
+  PRINT count;
+  SET count = count - 1;
+  IF count = 0 THEN
+    LEAVE lbl;
+  END IF;
+  PRINT 'End of while block';
+END WHILE;
+
+SET count = 3;
+
+lbl3:
+WHILE 1=1 DO
+  PRINT 'Start of outer while block';
+  
+  lbl1:
+  WHILE 1=1 DO
+    PRINT 'Start of 1st inner while block';
+    LEAVE lbl1;
+    PRINT 'End of 1st inner while block (NEVER SHOWN)';
+  END WHILE;
+  
+  lbl2:
+  WHILE 1=1 DO
+    PRINT 'Start of 2nd inner while block';
+    LEAVE lbl3;
+    PRINT 'End of 2nd inner while block (NEVER SHOWN)';
+  END WHILE;
+  PRINT 'End of outer while block (NEVER SHOWN)';
+END WHILE;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/len.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/len.sql b/hplsql/src/test/queries/local/len.sql
new file mode 100644
index 0000000..9851c49
--- /dev/null
+++ b/hplsql/src/test/queries/local/len.sql
@@ -0,0 +1 @@
+LEN('Abc ');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/length.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/length.sql b/hplsql/src/test/queries/local/length.sql
new file mode 100644
index 0000000..42cf3cc
--- /dev/null
+++ b/hplsql/src/test/queries/local/length.sql
@@ -0,0 +1 @@
+LENGTH('Abc ');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/lower.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/lower.sql b/hplsql/src/test/queries/local/lower.sql
new file mode 100644
index 0000000..f29b0e9
--- /dev/null
+++ b/hplsql/src/test/queries/local/lower.sql
@@ -0,0 +1 @@
+LOWER('ABC');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/nvl.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/nvl.sql b/hplsql/src/test/queries/local/nvl.sql
new file mode 100644
index 0000000..1a843bc
--- /dev/null
+++ b/hplsql/src/test/queries/local/nvl.sql
@@ -0,0 +1,4 @@
+NVL('First non-null', 1);
+NVL(NULL, 'First non-null');
+NVL(NULL, 'First non-null', 1);
+NVL(NULL, NULL, 'First non-null', 1);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/nvl2.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/nvl2.sql b/hplsql/src/test/queries/local/nvl2.sql
new file mode 100644
index 0000000..70eeccb
--- /dev/null
+++ b/hplsql/src/test/queries/local/nvl2.sql
@@ -0,0 +1,2 @@
+NVL2('A', 'Correct', 'FAILED');
+NVL2(NULL, 'FAILED', 'Correct');

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/print.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/print.sql b/hplsql/src/test/queries/local/print.sql
new file mode 100644
index 0000000..095682b
--- /dev/null
+++ b/hplsql/src/test/queries/local/print.sql
@@ -0,0 +1,5 @@
+PRINT 1;
+PRINT 'abc';
+PRINT ('abc');
+
+

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/return.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/return.sql b/hplsql/src/test/queries/local/return.sql
new file mode 100644
index 0000000..c52e5c5
--- /dev/null
+++ b/hplsql/src/test/queries/local/return.sql
@@ -0,0 +1,3 @@
+PRINT 'Before return';
+RETURN; 
+PRINT 'Unreachable code';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/seterror.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/seterror.sql b/hplsql/src/test/queries/local/seterror.sql
new file mode 100644
index 0000000..4705677
--- /dev/null
+++ b/hplsql/src/test/queries/local/seterror.sql
@@ -0,0 +1,10 @@
+BEGIN
+SET plhql.onerror = SETERROR;
+ 
+HOST 'abcd';
+IF HOSTCODE <> 0 THEN
+  PRINT 'Correct';
+END IF;
+EXCEPTION WHEN OTHERS THEN
+  PRINT 'FAILED';
+END
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/sub.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/sub.sql b/hplsql/src/test/queries/local/sub.sql
new file mode 100644
index 0000000..a32bef7
--- /dev/null
+++ b/hplsql/src/test/queries/local/sub.sql
@@ -0,0 +1 @@
+DATE '2015-01-01' - 1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/substr.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/substr.sql b/hplsql/src/test/queries/local/substr.sql
new file mode 100644
index 0000000..7785e39
--- /dev/null
+++ b/hplsql/src/test/queries/local/substr.sql
@@ -0,0 +1,2 @@
+SUBSTR('FAILED Correct', 8);
+SUBSTR('FAILED Correct FAILED', 8, 7); 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/substring.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/substring.sql b/hplsql/src/test/queries/local/substring.sql
new file mode 100644
index 0000000..c94a191
--- /dev/null
+++ b/hplsql/src/test/queries/local/substring.sql
@@ -0,0 +1,8 @@
+SUBSTRING('FAILED Correct', 8);
+SUBSTRING('FAILED Correct FAILED', 8, 7); 
+
+SUBSTRING('FAILED Correct' FROM 8);
+SUBSTRING('FAILED Correct FAILED' FROM 8 FOR 7); 
+
+SUBSTRING('', 8);
+SUBSTRING(NULL, 8);

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/timestamp.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/timestamp.sql b/hplsql/src/test/queries/local/timestamp.sql
new file mode 100644
index 0000000..2971cea
--- /dev/null
+++ b/hplsql/src/test/queries/local/timestamp.sql
@@ -0,0 +1,4 @@
+TIMESTAMP '2015-03-03 11:39:31.123456';
+TIMESTAMP '2015-03-03 11:39:31.123';
+TIMESTAMP '2015-03-03 11:39:31';
+TIMESTAMP '2015-03-03-11.39.31.123';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/timestamp_iso.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/timestamp_iso.sql b/hplsql/src/test/queries/local/timestamp_iso.sql
new file mode 100644
index 0000000..9bcdfe0
--- /dev/null
+++ b/hplsql/src/test/queries/local/timestamp_iso.sql
@@ -0,0 +1,2 @@
+TIMESTAMP_ISO('2015-03-12');
+TIMESTAMP_ISO(DATE '2015-03-12');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/to_char.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/to_char.sql b/hplsql/src/test/queries/local/to_char.sql
new file mode 100644
index 0000000..339c7d6
--- /dev/null
+++ b/hplsql/src/test/queries/local/to_char.sql
@@ -0,0 +1 @@
+TO_CHAR(DATE '2015-04-02')
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/to_timestamp.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/to_timestamp.sql b/hplsql/src/test/queries/local/to_timestamp.sql
new file mode 100644
index 0000000..c18f1f4
--- /dev/null
+++ b/hplsql/src/test/queries/local/to_timestamp.sql
@@ -0,0 +1,5 @@
+TO_TIMESTAMP('2015-04-02', 'YYYY-MM-DD');
+TO_TIMESTAMP('2015-04-02', 'yyyy-mm-dd');
+TO_TIMESTAMP('04/02/2015', 'mm/dd/yyyy');
+
+TO_TIMESTAMP('2015-04-02 13:51:31', 'YYYY-MM-DD HH24:MI:SS');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/trim.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/trim.sql b/hplsql/src/test/queries/local/trim.sql
new file mode 100644
index 0000000..f8a2978
--- /dev/null
+++ b/hplsql/src/test/queries/local/trim.sql
@@ -0,0 +1 @@
+'#' || TRIM(' Hello ') || '#';
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/twopipes.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/twopipes.sql b/hplsql/src/test/queries/local/twopipes.sql
new file mode 100644
index 0000000..c1d6f1d
--- /dev/null
+++ b/hplsql/src/test/queries/local/twopipes.sql
@@ -0,0 +1 @@
+'a' || 'b' || 'c'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/upper.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/upper.sql b/hplsql/src/test/queries/local/upper.sql
new file mode 100644
index 0000000..9b3b522
--- /dev/null
+++ b/hplsql/src/test/queries/local/upper.sql
@@ -0,0 +1 @@
+UPPER('abc');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/values_into.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/values_into.sql b/hplsql/src/test/queries/local/values_into.sql
new file mode 100644
index 0000000..e49894a
--- /dev/null
+++ b/hplsql/src/test/queries/local/values_into.sql
@@ -0,0 +1,6 @@
+VALUES 'A' INTO code;
+VALUES (0, 100) INTO (limit, count); 
+
+PRINT code;
+PRINT count;
+PRINT limit;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/queries/local/while.sql
----------------------------------------------------------------------
diff --git a/hplsql/src/test/queries/local/while.sql b/hplsql/src/test/queries/local/while.sql
new file mode 100644
index 0000000..2dc4b54
--- /dev/null
+++ b/hplsql/src/test/queries/local/while.sql
@@ -0,0 +1,20 @@
+DECLARE count INT DEFAULT 7;
+
+WHILE count <> 0 LOOP
+  PRINT count;
+  count := count - 1;
+END LOOP;
+
+SET count = 7;
+
+WHILE count <> 0 DO
+  PRINT count;
+  SET count = count - 1;
+END WHILE;
+
+SET count = 7;
+
+WHILE count <> 0 BEGIN
+  PRINT count;
+  SET count = count - 1;
+END
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/add.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/add.out.txt b/hplsql/src/test/results/local/add.out.txt
new file mode 100644
index 0000000..37a195b
--- /dev/null
+++ b/hplsql/src/test/results/local/add.out.txt
@@ -0,0 +1,2 @@
+2015-01-01
+2015-01-01

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/assign.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/assign.out.txt b/hplsql/src/test/results/local/assign.out.txt
new file mode 100644
index 0000000..c01e270
--- /dev/null
+++ b/hplsql/src/test/results/local/assign.out.txt
@@ -0,0 +1,8 @@
+Ln:1 SET code = 'A'
+Ln:2 SET status = 1
+Ln:3 SET count = 0
+Ln:5 SET code = 'A'
+Ln:6 SET status = 1
+Ln:6 SET count = 0
+Ln:7 SET count = 0
+Ln:7 SET limit = 100

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/bool_expr.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/bool_expr.out.txt b/hplsql/src/test/results/local/bool_expr.out.txt
new file mode 100644
index 0000000..514f324
--- /dev/null
+++ b/hplsql/src/test/results/local/bool_expr.out.txt
@@ -0,0 +1,32 @@
+Ln:1 IF
+Ln:1 IF TRUE executed
+Ln:2 PRINT
+Correct
+Ln:7 IF
+Ln:7 IF TRUE executed
+Ln:8 PRINT
+Correct
+Ln:13 IF
+Ln:13 IF TRUE executed
+Ln:14 PRINT
+Correct
+Ln:19 IF
+Ln:19 ELSE executed
+Ln:22 PRINT
+Correct
+Ln:25 IF
+Ln:25 IF TRUE executed
+Ln:26 PRINT
+Correct
+Ln:31 IF
+Ln:31 IF TRUE executed
+Ln:32 PRINT
+Correct
+Ln:37 IF
+Ln:37 IF TRUE executed
+Ln:38 PRINT
+Correct
+Ln:43 IF
+Ln:43 ELSE executed
+Ln:46 PRINT
+Correct
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/break.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/break.out.txt b/hplsql/src/test/results/local/break.out.txt
new file mode 100644
index 0000000..cf907df
--- /dev/null
+++ b/hplsql/src/test/results/local/break.out.txt
@@ -0,0 +1,29 @@
+Ln:1 DECLARE count INT = 3
+Ln:2 WHILE - ENTERED
+Ln:3 PRINT
+Start of while block
+Ln:4 PRINT
+3
+Ln:5 SET count = 2
+Ln:6 IF
+Ln:8 PRINT
+End of while block
+Ln:3 PRINT
+Start of while block
+Ln:4 PRINT
+2
+Ln:5 SET count = 1
+Ln:6 IF
+Ln:8 PRINT
+End of while block
+Ln:3 PRINT
+Start of while block
+Ln:4 PRINT
+1
+Ln:5 SET count = 0
+Ln:6 IF
+Ln:6 IF TRUE executed
+Ln:7 BREAK
+Ln:2 WHILE - LEFT
+Ln:10 PRINT
+End of script
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/case.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/case.out.txt b/hplsql/src/test/results/local/case.out.txt
new file mode 100644
index 0000000..6062a1f
--- /dev/null
+++ b/hplsql/src/test/results/local/case.out.txt
@@ -0,0 +1,12 @@
+Ln:1 PRINT
+Correct
+Ln:8 PRINT
+Correct
+Ln:14 PRINT
+Correct
+Ln:19 PRINT
+Correct
+Ln:26 PRINT
+Correct
+Ln:32 PRINT
+Correct

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/cast.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/cast.out.txt b/hplsql/src/test/results/local/cast.out.txt
new file mode 100644
index 0000000..f3de493
--- /dev/null
+++ b/hplsql/src/test/results/local/cast.out.txt
@@ -0,0 +1,8 @@
+Ln:1 FUNC CAST
+A
+Ln:2 FUNC CAST
+Ab
+Ln:3 FUNC CAST
+Abc
+Ln:4 FUNC CAST
+2015-03-12

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/char.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/char.out.txt b/hplsql/src/test/results/local/char.out.txt
new file mode 100644
index 0000000..83b33d2
--- /dev/null
+++ b/hplsql/src/test/results/local/char.out.txt
@@ -0,0 +1 @@
+1000

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/coalesce.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/coalesce.out.txt b/hplsql/src/test/results/local/coalesce.out.txt
new file mode 100644
index 0000000..a111c85
--- /dev/null
+++ b/hplsql/src/test/results/local/coalesce.out.txt
@@ -0,0 +1,4 @@
+First non-null
+First non-null
+First non-null
+First non-null

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/concat.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/concat.out.txt b/hplsql/src/test/results/local/concat.out.txt
new file mode 100644
index 0000000..cdddd69
--- /dev/null
+++ b/hplsql/src/test/results/local/concat.out.txt
@@ -0,0 +1,2 @@
+abc
+NULL Value

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/create_function.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_function.out.txt b/hplsql/src/test/results/local/create_function.out.txt
new file mode 100644
index 0000000..b996ab4
--- /dev/null
+++ b/hplsql/src/test/results/local/create_function.out.txt
@@ -0,0 +1,9 @@
+Ln:1 CREATE FUNCTION hello
+Ln:10 PRINT
+Ln:10 EXEC FUNCTION hello
+Ln:4 PRINT
+Start
+Ln:5 RETURN
+Hello, world!
+Ln:11 PRINT
+End of script

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/create_function2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_function2.out.txt b/hplsql/src/test/results/local/create_function2.out.txt
new file mode 100644
index 0000000..c8fc993
--- /dev/null
+++ b/hplsql/src/test/results/local/create_function2.out.txt
@@ -0,0 +1,10 @@
+Ln:1 CREATE FUNCTION hello2
+Ln:10 PRINT
+Ln:10 EXEC FUNCTION hello2
+Ln:10 SET PARAM text = world
+Ln:4 PRINT
+Start
+Ln:5 RETURN
+Hello, world!
+Ln:11 PRINT
+End of script

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/create_procedure.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/create_procedure.out.txt b/hplsql/src/test/results/local/create_procedure.out.txt
new file mode 100644
index 0000000..1f86916
--- /dev/null
+++ b/hplsql/src/test/results/local/create_procedure.out.txt
@@ -0,0 +1,8 @@
+Ln:1 CREATE PROCEDURE set_message
+Ln:6 DECLARE str STRING
+Ln:7 EXEC PROCEDURE set_message
+Ln:7 SET PARAM name = world
+Ln:7 SET PARAM result = null
+Ln:3 SET result = 'Hello, world!'
+Ln:8 PRINT
+Hello, world!
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/date.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/date.out.txt b/hplsql/src/test/results/local/date.out.txt
new file mode 100644
index 0000000..118bd29
--- /dev/null
+++ b/hplsql/src/test/results/local/date.out.txt
@@ -0,0 +1,4 @@
+2014-12-20
+2015-03-12
+2015-03-12
+2015-03-12

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/dbms_output.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/dbms_output.out.txt b/hplsql/src/test/results/local/dbms_output.out.txt
new file mode 100644
index 0000000..b6ed0e0
--- /dev/null
+++ b/hplsql/src/test/results/local/dbms_output.out.txt
@@ -0,0 +1,3 @@
+Ln:2 DECLARE str VARCHAR = 'Hello, world!'
+Hello, world!
+Hello, world!

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/declare.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/declare.out.txt b/hplsql/src/test/results/local/declare.out.txt
new file mode 100644
index 0000000..2b7794e
--- /dev/null
+++ b/hplsql/src/test/results/local/declare.out.txt
@@ -0,0 +1,13 @@
+Ln:2 DECLARE code CHAR
+Ln:3 DECLARE status INT = 1
+Ln:4 DECLARE count SMALLINT = NULL
+Ln:5 DECLARE limit INT = 100
+Ln:6 DECLARE f UTL_FILE.FILE_TYPE
+Ln:8 SET status = 2
+Ln:11 DECLARE code CHAR
+Ln:12 DECLARE status INT = 1
+Ln:12 DECLARE status2 INT = 1
+Ln:13 DECLARE count SMALLINT
+Ln:13 DECLARE limit INT = 100
+Ln:15 DECLARE dt DATE = 2015-05-13
+Ln:16 DECLARE ts TIMESTAMP = 2015-05-13 11:10:01

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/declare_condition.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/declare_condition.out.txt b/hplsql/src/test/results/local/declare_condition.out.txt
new file mode 100644
index 0000000..4633c8d
--- /dev/null
+++ b/hplsql/src/test/results/local/declare_condition.out.txt
@@ -0,0 +1,7 @@
+Ln:2 DECLARE HANDLER
+Ln:4 IF
+Ln:4 IF TRUE executed
+Ln:5 SIGNAL
+Ln:2 EXIT HANDLER
+Ln:3 PRINT
+Condition raised
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/declare_condition2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/declare_condition2.out.txt b/hplsql/src/test/results/local/declare_condition2.out.txt
new file mode 100644
index 0000000..67da39d
--- /dev/null
+++ b/hplsql/src/test/results/local/declare_condition2.out.txt
@@ -0,0 +1,12 @@
+Ln:2 DECLARE HANDLER
+Ln:4 DECLARE HANDLER
+Ln:6 IF
+Ln:6 IF TRUE executed
+Ln:7 SIGNAL
+Ln:4 CONTINUE HANDLER
+Ln:5 PRINT
+Condition raised
+Ln:9 PRINT
+Executed 1
+Ln:10 PRINT
+Executed 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/decode.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/decode.out.txt b/hplsql/src/test/results/local/decode.out.txt
new file mode 100644
index 0000000..39b01bc
--- /dev/null
+++ b/hplsql/src/test/results/local/decode.out.txt
@@ -0,0 +1,13 @@
+Ln:1 DECLARE var1 INT = 3
+Ln:2 PRINT
+C
+Ln:3 PRINT
+C
+Ln:5 SET var1 = 1
+Ln:6 PRINT
+A
+Ln:8 SET var1 = NULL
+Ln:9 PRINT
+C
+Ln:10 PRINT
+C

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/equal.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/equal.out.txt b/hplsql/src/test/results/local/equal.out.txt
new file mode 100644
index 0000000..9c02e38
--- /dev/null
+++ b/hplsql/src/test/results/local/equal.out.txt
@@ -0,0 +1,48 @@
+Ln:1 PRINT
+Case 1 = 1
+Ln:2 IF
+Ln:2 IF TRUE executed
+Ln:3 PRINT
+Equal - Correct
+Ln:8 PRINT
+Case 1 == 1
+Ln:9 IF
+Ln:9 IF TRUE executed
+Ln:10 PRINT
+Equal - Correct
+Ln:15 PRINT
+Case 1 <> 3
+Ln:16 IF
+Ln:16 IF TRUE executed
+Ln:17 PRINT
+Not equal - Correct
+Ln:22 PRINT
+Case 1 != 3
+Ln:23 IF
+Ln:23 IF TRUE executed
+Ln:24 PRINT
+Not equal - Correct
+Ln:29 PRINT
+Case 3 > 1
+Ln:30 IF
+Ln:30 IF TRUE executed
+Ln:31 PRINT
+Greater - Correct
+Ln:36 PRINT
+Case 1 < 3
+Ln:37 IF
+Ln:37 IF TRUE executed
+Ln:38 PRINT
+Less - Correct
+Ln:43 PRINT
+Case 3 >= 1
+Ln:44 IF
+Ln:44 IF TRUE executed
+Ln:45 PRINT
+Greater or equal - Correct
+Ln:50 PRINT
+Case 1 <= 3
+Ln:51 IF
+Ln:51 IF TRUE executed
+Ln:52 PRINT
+Less or equal - Correct
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/exception.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/exception.out.txt b/hplsql/src/test/results/local/exception.out.txt
new file mode 100644
index 0000000..5de7998
--- /dev/null
+++ b/hplsql/src/test/results/local/exception.out.txt
@@ -0,0 +1,13 @@
+Ln:2 PRINT
+Correct
+Ln:3 WHILE - ENTERED
+Ln:4 FETCH
+Ln:4 Cursor not found: cur
+Ln:3 WHILE - LEFT
+Ln:7 EXCEPTION HANDLER
+Ln:8 PRINT
+Correct
+Ln:9 PRINT
+Correct
+Ln:10 PRINT
+Correct - Exception raised
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/exception2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/exception2.out.txt b/hplsql/src/test/results/local/exception2.out.txt
new file mode 100644
index 0000000..f56a326
--- /dev/null
+++ b/hplsql/src/test/results/local/exception2.out.txt
@@ -0,0 +1,5 @@
+Ln:2 DECLARE v VARCHAR
+Ln:4 OPEN
+Ln:4 cur: SELECT c1 FROM t1
+Ln:7 EXCEPTION HANDLER
+Error

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/exit.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/exit.out.txt b/hplsql/src/test/results/local/exit.out.txt
new file mode 100644
index 0000000..0352275
--- /dev/null
+++ b/hplsql/src/test/results/local/exit.out.txt
@@ -0,0 +1,42 @@
+Ln:1 DECLARE count INT = 3
+Ln:3 WHILE - ENTERED
+Ln:4 PRINT
+Start of while block
+Ln:5 PRINT
+3
+Ln:6 SET count = 2
+Ln:7 EXIT
+Ln:8 PRINT
+End of while block
+Ln:4 PRINT
+Start of while block
+Ln:5 PRINT
+2
+Ln:6 SET count = 1
+Ln:7 EXIT
+Ln:8 PRINT
+End of while block
+Ln:4 PRINT
+Start of while block
+Ln:5 PRINT
+1
+Ln:6 SET count = 0
+Ln:7 EXIT
+Ln:3 WHILE - LEFT
+Ln:11 SET count = 3
+Ln:14 WHILE - ENTERED
+Ln:15 PRINT
+Start of outer while block
+Ln:17 WHILE - ENTERED
+Ln:18 PRINT
+Start of 1st inner while block
+Ln:19 EXIT
+Ln:17 WHILE - LEFT
+Ln:24 WHILE - ENTERED
+Ln:25 PRINT
+Start of 2nd inner while block
+Ln:26 EXIT
+Ln:24 WHILE - LEFT
+Ln:14 WHILE - LEFT
+Ln:31 PRINT
+End of script

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/expr.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/expr.out.txt b/hplsql/src/test/results/local/expr.out.txt
new file mode 100644
index 0000000..a5377e3
--- /dev/null
+++ b/hplsql/src/test/results/local/expr.out.txt
@@ -0,0 +1,29 @@
+Ln:1 PRINT
+ab
+Ln:2 PRINT
+a1b
+Ln:3 PRINT
+1ab
+Ln:4 PRINT
+ab
+Ln:5 PRINT
+ab
+Ln:6 PRINT
+null
+Ln:8 DECLARE c INT
+Ln:10 PRINT
+Integer increment
+Ln:11 SET c = 3
+Ln:12 SET c = 4
+Ln:13 PRINT
+4
+Ln:15 PRINT
+Integer decrement
+Ln:16 SET c = 3
+Ln:17 SET c = 2
+Ln:18 PRINT
+2
+Ln:20 PRINT
+Correct
+Ln:21 PRINT
+Correct
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/for_range.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/for_range.out.txt b/hplsql/src/test/results/local/for_range.out.txt
new file mode 100644
index 0000000..dc29c95
--- /dev/null
+++ b/hplsql/src/test/results/local/for_range.out.txt
@@ -0,0 +1,65 @@
+Ln:1 DECLARE i INT = 3
+Ln:2 PRINT
+3
+Ln:4 FOR RANGE - ENTERED
+Ln:5 PRINT
+1
+Ln:5 PRINT
+2
+Ln:5 PRINT
+3
+Ln:5 PRINT
+4
+Ln:5 PRINT
+5
+Ln:5 PRINT
+6
+Ln:5 PRINT
+7
+Ln:5 PRINT
+8
+Ln:5 PRINT
+9
+Ln:5 PRINT
+10
+Ln:4 FOR RANGE - LEFT
+Ln:8 PRINT
+3
+Ln:10 FOR RANGE - ENTERED
+Ln:11 PRINT
+10
+Ln:11 PRINT
+9
+Ln:11 PRINT
+8
+Ln:11 PRINT
+7
+Ln:11 PRINT
+6
+Ln:11 PRINT
+5
+Ln:11 PRINT
+4
+Ln:11 PRINT
+3
+Ln:11 PRINT
+2
+Ln:11 PRINT
+1
+Ln:10 FOR RANGE - LEFT
+Ln:14 PRINT
+3
+Ln:16 FOR RANGE - ENTERED
+Ln:17 PRINT
+1
+Ln:17 PRINT
+3
+Ln:17 PRINT
+5
+Ln:17 PRINT
+7
+Ln:17 PRINT
+9
+Ln:16 FOR RANGE - LEFT
+Ln:20 PRINT
+3

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/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
new file mode 100644
index 0000000..1da8142
--- /dev/null
+++ b/hplsql/src/test/results/local/if.out.txt
@@ -0,0 +1,40 @@
+Ln:1 DECLARE state VARCHAR
+Ln:2 DECLARE count INT
+Ln:4 SET state = 'CA'
+Ln:5 SET count = 1
+Ln:11 IF
+Ln:11 IF TRUE executed
+Ln:12 PRINT
+True block - Correct
+Ln:17 IF
+Ln:17 ELSE executed
+Ln:20 PRINT
+False block - Correct
+Ln:23 IF
+Ln:23 ELSE executed
+Ln:30 PRINT
+False block - Correct
+Ln:33 IF
+Ln:33 ELSE IF executed
+Ln:38 PRINT
+True block - Correct
+Ln:43 PRINT
+IS NOT NULL AND BETWEEN
+Ln:44 IF
+Ln:44 IF TRUE executed
+Ln:45 PRINT
+True block - Correct
+Ln:50 PRINT
+Transact-SQL - Single statement
+Ln:52 IF
+Ln:52 IF TRUE executed
+Ln:53 PRINT
+True block - Correct
+Ln:57 PRINT
+Transact-SQL - BEGIN-END block
+Ln:59 IF
+Ln:59 IF TRUE executed
+Ln:61 PRINT
+True block - Correct
+Ln:62 PRINT
+True block - Correct
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/instr.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/instr.out.txt b/hplsql/src/test/results/local/instr.out.txt
new file mode 100644
index 0000000..a1ed71f
--- /dev/null
+++ b/hplsql/src/test/results/local/instr.out.txt
@@ -0,0 +1,33 @@
+Ln:1 IF
+Ln:1 IF TRUE executed
+Ln:2 PRINT
+Correct
+Ln:7 IF
+Ln:7 IF TRUE executed
+Ln:8 PRINT
+Correct
+Ln:13 IF
+Ln:13 IF TRUE executed
+Ln:14 PRINT
+Correct
+Ln:19 IF
+Ln:19 IF TRUE executed
+Ln:20 PRINT
+Correct
+Ln:25 IF
+Ln:25 IF TRUE executed
+Ln:26 PRINT
+Correct
+Ln:31 DECLARE c STRING
+Ln:33 IF
+Ln:33 IF TRUE executed
+Ln:34 PRINT
+Correct
+Ln:39 IF
+Ln:39 IF TRUE executed
+Ln:40 PRINT
+Correct
+Ln:45 IF
+Ln:45 IF TRUE executed
+Ln:46 PRINT
+Correct
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/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
new file mode 100644
index 0000000..2dcdcd5
--- /dev/null
+++ b/hplsql/src/test/results/local/interval.out.txt
@@ -0,0 +1,11 @@
+2015-03-13
+2015-03-13 00:00:00
+2015-03-12 10:10:10.001
+2015-03-15
+2015-03-15 00:00:00
+2015-03-11
+2015-03-11 00:00:00
+2015-03-12 10:10:09.999
+2015-03-09
+2015-03-09 00:00:00
+2015-03-10 23:59:59

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/lang.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/lang.out.txt b/hplsql/src/test/results/local/lang.out.txt
new file mode 100644
index 0000000..0047ec4
--- /dev/null
+++ b/hplsql/src/test/results/local/lang.out.txt
@@ -0,0 +1,34 @@
+1
+1
+0
+-1
+1.0
+1.0
+-1.0
+Ln:19 DECLARE abc int
+Ln:20 DECLARE abc.abc int
+Ln:21 DECLARE abc . abc1 int
+Ln:22 DECLARE "abc" int
+Ln:23 DECLARE "abc".abc int
+Ln:24 DECLARE "abc"."abc" int
+Ln:25 DECLARE "abc" . "abc1" int
+Ln:26 DECLARE [abc] int
+Ln:27 DECLARE [abc].abc int
+Ln:28 DECLARE [abc].[abc] int
+Ln:29 DECLARE [abc] . [abc1] int
+Ln:30 DECLARE `abc` int
+Ln:31 DECLARE `abc`.abc int
+Ln:32 DECLARE `abc`.`abc` int
+Ln:33 DECLARE `abc` . `abc1` int
+Ln:34 DECLARE :new.abc int
+Ln:35 DECLARE @abc int
+Ln:36 DECLARE _abc int
+Ln:37 DECLARE #abc int
+Ln:38 DECLARE ##abc int
+Ln:39 DECLARE $abc int
+Ln:40 DECLARE abc_9 int
+2
+2
+0
+-2
+0

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/leave.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/leave.out.txt b/hplsql/src/test/results/local/leave.out.txt
new file mode 100644
index 0000000..8e57245
--- /dev/null
+++ b/hplsql/src/test/results/local/leave.out.txt
@@ -0,0 +1,42 @@
+Ln:1 DECLARE count INT = 3
+Ln:3 WHILE - ENTERED
+Ln:4 PRINT
+Start of while block
+Ln:5 PRINT
+3
+Ln:6 SET count = 2
+Ln:7 IF
+Ln:10 PRINT
+End of while block
+Ln:4 PRINT
+Start of while block
+Ln:5 PRINT
+2
+Ln:6 SET count = 1
+Ln:7 IF
+Ln:10 PRINT
+End of while block
+Ln:4 PRINT
+Start of while block
+Ln:5 PRINT
+1
+Ln:6 SET count = 0
+Ln:7 IF
+Ln:7 IF TRUE executed
+Ln:8 LEAVE
+Ln:3 WHILE - LEFT
+Ln:13 SET count = 3
+Ln:16 WHILE - ENTERED
+Ln:17 PRINT
+Start of outer while block
+Ln:20 WHILE - ENTERED
+Ln:21 PRINT
+Start of 1st inner while block
+Ln:22 LEAVE
+Ln:20 WHILE - LEFT
+Ln:27 WHILE - ENTERED
+Ln:28 PRINT
+Start of 2nd inner while block
+Ln:29 LEAVE
+Ln:27 WHILE - LEFT
+Ln:16 WHILE - LEFT
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/len.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/len.out.txt b/hplsql/src/test/results/local/len.out.txt
new file mode 100644
index 0000000..00750ed
--- /dev/null
+++ b/hplsql/src/test/results/local/len.out.txt
@@ -0,0 +1 @@
+3

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/length.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/length.out.txt b/hplsql/src/test/results/local/length.out.txt
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/hplsql/src/test/results/local/length.out.txt
@@ -0,0 +1 @@
+4

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/lower.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/lower.out.txt b/hplsql/src/test/results/local/lower.out.txt
new file mode 100644
index 0000000..8baef1b
--- /dev/null
+++ b/hplsql/src/test/results/local/lower.out.txt
@@ -0,0 +1 @@
+abc

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/nvl.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/nvl.out.txt b/hplsql/src/test/results/local/nvl.out.txt
new file mode 100644
index 0000000..a111c85
--- /dev/null
+++ b/hplsql/src/test/results/local/nvl.out.txt
@@ -0,0 +1,4 @@
+First non-null
+First non-null
+First non-null
+First non-null

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/nvl2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/nvl2.out.txt b/hplsql/src/test/results/local/nvl2.out.txt
new file mode 100644
index 0000000..09acc48
--- /dev/null
+++ b/hplsql/src/test/results/local/nvl2.out.txt
@@ -0,0 +1,2 @@
+Correct
+Correct

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/plhqlexception.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/plhqlexception.out.txt b/hplsql/src/test/results/local/plhqlexception.out.txt
new file mode 100644
index 0000000..439cbbb
--- /dev/null
+++ b/hplsql/src/test/results/local/plhqlexception.out.txt
@@ -0,0 +1,6 @@
+Ln:1 PRINT
+Correct
+Ln:2 WHILE - ENTERED
+Ln:3 FETCH
+Ln:3 Cursor not found: cur
+Ln:2 WHILE - LEFT
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/plhqlexception1.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/plhqlexception1.out.txt b/hplsql/src/test/results/local/plhqlexception1.out.txt
new file mode 100644
index 0000000..9b88f62
--- /dev/null
+++ b/hplsql/src/test/results/local/plhqlexception1.out.txt
@@ -0,0 +1,10 @@
+Ln:1 PRINT
+Correct
+Ln:2 DECLARE HANDLER
+Ln:4 WHILE - ENTERED
+Ln:5 FETCH
+Ln:5 Cursor not found: cur
+Ln:4 WHILE - LEFT
+Ln:2 EXIT HANDLER
+Ln:3 PRINT
+Correct - Exception raised

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/plhqlexception2.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/plhqlexception2.out.txt b/hplsql/src/test/results/local/plhqlexception2.out.txt
new file mode 100644
index 0000000..74de5b2
--- /dev/null
+++ b/hplsql/src/test/results/local/plhqlexception2.out.txt
@@ -0,0 +1,106 @@
+Ln:1 DECLARE cnt INT = 0
+Ln:2 PRINT
+Correct
+Ln:3 DECLARE HANDLER
+Ln:5 WHILE - ENTERED
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+0
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 1
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+1
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 2
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+2
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 3
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+3
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 4
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+4
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 5
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+5
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 6
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+6
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 7
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+7
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 8
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+8
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 9
+Ln:6 FETCH
+Ln:6 Cursor not found: cur
+Ln:3 CONTINUE HANDLER
+Ln:4 PRINT
+Correct - Exception raised
+Ln:7 PRINT
+9
+Ln:8 PRINT
+Correct - exception handled
+Ln:9 SET cnt = 10
+Ln:5 WHILE - LEFT

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/print.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/print.out.txt b/hplsql/src/test/results/local/print.out.txt
new file mode 100644
index 0000000..65a1016
--- /dev/null
+++ b/hplsql/src/test/results/local/print.out.txt
@@ -0,0 +1,6 @@
+Ln:1 PRINT
+1
+Ln:2 PRINT
+abc
+Ln:3 PRINT
+abc
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/return.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/return.out.txt b/hplsql/src/test/results/local/return.out.txt
new file mode 100644
index 0000000..f4d5bc9
--- /dev/null
+++ b/hplsql/src/test/results/local/return.out.txt
@@ -0,0 +1,3 @@
+Ln:1 PRINT
+Before return
+Ln:2 RETURN
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/select_conversion.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/select_conversion.out.txt b/hplsql/src/test/results/local/select_conversion.out.txt
new file mode 100644
index 0000000..602304e
--- /dev/null
+++ b/hplsql/src/test/results/local/select_conversion.out.txt
@@ -0,0 +1,9 @@
+Ln:1 DECLARE v1 STRING = abc
+Ln:3 SELECT
+Ln:3 Statement:
+SELECT CONCAT('a', 'b', 'c'), CONCAT('a', 'b') FROM default.dual
+Ln:3 Not executed - offline mode set
+Ln:5 SELECT
+Ln:5 Statement:
+SELECT 'abc' AS c1, CONCAT('abc', 'abc'), NVL(NVL(CONCAT('abc', NVL(id, 1), id), 1), 1), 'abc', 'abc' AS c4 FROM default.dual t1 WHERE 'abc' = 'abc' AND (NVL(NVL('abc', 1), 1) = 'abc' or 'abc' = 'abc')
+Ln:5 Not executed - offline mode set
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/seterror.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/seterror.out.txt b/hplsql/src/test/results/local/seterror.out.txt
new file mode 100644
index 0000000..3c093cc
--- /dev/null
+++ b/hplsql/src/test/results/local/seterror.out.txt
@@ -0,0 +1,6 @@
+Ln:2 SET plhql.onerror = NULL
+Ln:4 HOST
+Ln:4 HOST Command: abcd
+Ln:8 EXCEPTION HANDLER
+Ln:9 PRINT
+FAILED
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/sub.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/sub.out.txt b/hplsql/src/test/results/local/sub.out.txt
new file mode 100644
index 0000000..c35d146
--- /dev/null
+++ b/hplsql/src/test/results/local/sub.out.txt
@@ -0,0 +1 @@
+2014-12-31
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/substr.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/substr.out.txt b/hplsql/src/test/results/local/substr.out.txt
new file mode 100644
index 0000000..09acc48
--- /dev/null
+++ b/hplsql/src/test/results/local/substr.out.txt
@@ -0,0 +1,2 @@
+Correct
+Correct

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/substring.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/substring.out.txt b/hplsql/src/test/results/local/substring.out.txt
new file mode 100644
index 0000000..820d65a
--- /dev/null
+++ b/hplsql/src/test/results/local/substring.out.txt
@@ -0,0 +1,8 @@
+Correct
+Correct
+Ln:4 FUNC SUBSTRING
+Correct
+Ln:5 FUNC SUBSTRING
+Correct
+
+null
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/timestamp.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/timestamp.out.txt b/hplsql/src/test/results/local/timestamp.out.txt
new file mode 100644
index 0000000..bb58d46
--- /dev/null
+++ b/hplsql/src/test/results/local/timestamp.out.txt
@@ -0,0 +1,4 @@
+2015-03-03 11:39:31.123
+2015-03-03 11:39:31.123
+2015-03-03 11:39:31
+2015-03-03 11:39:31.123
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/timestamp_iso.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/timestamp_iso.out.txt b/hplsql/src/test/results/local/timestamp_iso.out.txt
new file mode 100644
index 0000000..997df7f
--- /dev/null
+++ b/hplsql/src/test/results/local/timestamp_iso.out.txt
@@ -0,0 +1,2 @@
+2015-03-12 00:00:00
+2015-03-12 00:00:00

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/to_char.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/to_char.out.txt b/hplsql/src/test/results/local/to_char.out.txt
new file mode 100644
index 0000000..22e8cef
--- /dev/null
+++ b/hplsql/src/test/results/local/to_char.out.txt
@@ -0,0 +1 @@
+2015-04-02

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/to_timestamp.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/to_timestamp.out.txt b/hplsql/src/test/results/local/to_timestamp.out.txt
new file mode 100644
index 0000000..1ee7278
--- /dev/null
+++ b/hplsql/src/test/results/local/to_timestamp.out.txt
@@ -0,0 +1,4 @@
+2015-04-02 00:00:00
+2015-04-02 00:00:00
+2015-04-02 00:00:00
+2015-04-02 13:51:31

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/trim.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/trim.out.txt b/hplsql/src/test/results/local/trim.out.txt
new file mode 100644
index 0000000..bbf851d
--- /dev/null
+++ b/hplsql/src/test/results/local/trim.out.txt
@@ -0,0 +1 @@
+#Hello#

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/twopipes.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/twopipes.out.txt b/hplsql/src/test/results/local/twopipes.out.txt
new file mode 100644
index 0000000..f2ba8f8
--- /dev/null
+++ b/hplsql/src/test/results/local/twopipes.out.txt
@@ -0,0 +1 @@
+abc
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/upper.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/upper.out.txt b/hplsql/src/test/results/local/upper.out.txt
new file mode 100644
index 0000000..5da849b
--- /dev/null
+++ b/hplsql/src/test/results/local/upper.out.txt
@@ -0,0 +1 @@
+ABC

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/values_into.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/values_into.out.txt b/hplsql/src/test/results/local/values_into.out.txt
new file mode 100644
index 0000000..d698e88
--- /dev/null
+++ b/hplsql/src/test/results/local/values_into.out.txt
@@ -0,0 +1,11 @@
+Ln:1 VALUES statement
+Ln:1 SET code = A
+Ln:2 VALUES statement
+Ln:2 SET limit = 0
+Ln:2 SET count = 100
+Ln:4 PRINT
+A
+Ln:5 PRINT
+100
+Ln:6 PRINT
+0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/7338d8e1/hplsql/src/test/results/local/while.out.txt
----------------------------------------------------------------------
diff --git a/hplsql/src/test/results/local/while.out.txt b/hplsql/src/test/results/local/while.out.txt
new file mode 100644
index 0000000..4a3ca0e
--- /dev/null
+++ b/hplsql/src/test/results/local/while.out.txt
@@ -0,0 +1,72 @@
+Ln:1 DECLARE count INT = 7
+Ln:3 WHILE - ENTERED
+Ln:4 PRINT
+7
+Ln:5 SET count = 6
+Ln:4 PRINT
+6
+Ln:5 SET count = 5
+Ln:4 PRINT
+5
+Ln:5 SET count = 4
+Ln:4 PRINT
+4
+Ln:5 SET count = 3
+Ln:4 PRINT
+3
+Ln:5 SET count = 2
+Ln:4 PRINT
+2
+Ln:5 SET count = 1
+Ln:4 PRINT
+1
+Ln:5 SET count = 0
+Ln:3 WHILE - LEFT
+Ln:8 SET count = 7
+Ln:10 WHILE - ENTERED
+Ln:11 PRINT
+7
+Ln:12 SET count = 6
+Ln:11 PRINT
+6
+Ln:12 SET count = 5
+Ln:11 PRINT
+5
+Ln:12 SET count = 4
+Ln:11 PRINT
+4
+Ln:12 SET count = 3
+Ln:11 PRINT
+3
+Ln:12 SET count = 2
+Ln:11 PRINT
+2
+Ln:12 SET count = 1
+Ln:11 PRINT
+1
+Ln:12 SET count = 0
+Ln:10 WHILE - LEFT
+Ln:15 SET count = 7
+Ln:17 WHILE - ENTERED
+Ln:18 PRINT
+7
+Ln:19 SET count = 6
+Ln:18 PRINT
+6
+Ln:19 SET count = 5
+Ln:18 PRINT
+5
+Ln:19 SET count = 4
+Ln:18 PRINT
+4
+Ln:19 SET count = 3
+Ln:18 PRINT
+3
+Ln:19 SET count = 2
+Ln:18 PRINT
+2
+Ln:19 SET count = 1
+Ln:18 PRINT
+1
+Ln:19 SET count = 0
+Ln:17 WHILE - LEFT
\ No newline at end of file


Mime
View raw message