You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by ry...@apache.org on 2016/11/24 06:23:09 UTC

[1/2] incubator-trafodion git commit: Implement builtin function SOUNDEX

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 609482f47 -> 70980957c


Implement builtin function SOUNDEX


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/c9385f62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/c9385f62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/c9385f62

Branch: refs/heads/master
Commit: c9385f6294bb06da350a5d7d60e90ea6d900bd0e
Parents: bbbd26e
Author: ryzuo <jo...@gmail.com>
Authored: Sat Nov 12 06:23:44 2016 +0000
Committer: ryzuo <jo...@gmail.com>
Committed: Mon Nov 21 14:30:32 2016 +0000

----------------------------------------------------------------------
 core/sql/exp/ExpPackDefs.cpp                |   5 +
 core/sql/exp/exp_clause.cpp                 |   6 ++
 core/sql/exp/exp_clause.h                   |   3 +-
 core/sql/exp/exp_function.cpp               | 122 +++++++++++++++++++++++
 core/sql/exp/exp_function.h                 |  29 ++++++
 core/sql/generator/GenItemFunc.cpp          |   9 ++
 core/sql/optimizer/BindItemExpr.cpp         |   1 +
 core/sql/optimizer/ItemExpr.cpp             |   1 +
 core/sql/optimizer/SynthType.cpp            |  24 +++++
 core/sql/parser/ParKeyWords.cpp             |   1 +
 core/sql/parser/sqlparser.y                 |   9 ++
 core/sql/regress/compGeneral/EXPECTED006.SB | 104 +++++++++++++++++++
 core/sql/regress/compGeneral/TEST006        |  34 +++++++
 13 files changed, 347 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/exp/ExpPackDefs.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpPackDefs.cpp b/core/sql/exp/ExpPackDefs.cpp
index d87497a..2ec546b 100644
--- a/core/sql/exp/ExpPackDefs.cpp
+++ b/core/sql/exp/ExpPackDefs.cpp
@@ -611,6 +611,11 @@ NA_EIDPROC Long ExFunctionIsIP::pack(void * space)
   return packClause(space, sizeof(ExFunctionIsIP));
 }
 
+NA_EIDPROC Long ExFunctionSoundex::pack(void * space)
+{
+  return packClause(space, sizeof(ExFunctionSoundex));
+}
+
 NA_EIDPROC Long ExFunctionInetAton::pack(void * space)
 {
   return packClause(space, sizeof(ExFunctionInetAton));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/exp/exp_clause.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_clause.cpp b/core/sql/exp/exp_clause.cpp
index c527c77..f52162a 100644
--- a/core/sql/exp/exp_clause.cpp
+++ b/core/sql/exp/exp_clause.cpp
@@ -535,6 +535,9 @@ ex_clause::ex_clause(clause_type type,
 	case ITM_HBASE_VERSION:
 	  setClassID(FUNC_HBASE_VERSION);
 	  break;
+	case ITM_SOUNDEX:
+	  setClassID(FUNC_SOUNDEX_ID);
+	  break;
 	default:
 	  GenAssert(0, "ex_clause: Unknown Class ID.");
 	  break;
@@ -1023,6 +1026,9 @@ NA_EIDPROC char *ex_clause::findVTblPtr(short classID)
     case ex_clause::FUNC_INETNTOA_ID:
       GetVTblPtr(vtblPtr, ExFunctionInetNtoa);
       break;
+    case ex_clause::FUNC_SOUNDEX_ID:
+      GetVTblPtr(vtblPtr, ExFunctionSoundex);
+      break;
      default:
       GetVTblPtr(vtblPtr, ex_clause);
       break;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/exp/exp_clause.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_clause.h b/core/sql/exp/exp_clause.h
index 275914b..a3ac13c 100644
--- a/core/sql/exp/exp_clause.h
+++ b/core/sql/exp/exp_clause.h
@@ -207,7 +207,8 @@ public:
     FUNC_CRC32_ID            = 122,
     FUNC_MD5_ID              = 123,
     FUNC_SHA1_ID             = 124,
-    FUNC_SHA2_ID             = 125
+    FUNC_SHA2_ID             = 125,
+    FUNC_SOUNDEX_ID          = 126
   };
 
   // max number of operands (including result) in a clause.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/exp/exp_function.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_function.cpp b/core/sql/exp/exp_function.cpp
index 22fef99..af9845b 100644
--- a/core/sql/exp/exp_function.cpp
+++ b/core/sql/exp/exp_function.cpp
@@ -213,6 +213,8 @@ ExFunctionSha2::ExFunctionSha2(){};
 ExFunctionIsIP::ExFunctionIsIP(){};
 ExFunctionInetAton::ExFunctionInetAton(){};
 ExFunctionInetNtoa::ExFunctionInetNtoa(){};
+ExFunctionSoundex::ExFunctionSoundex(){};
+
 ExFunctionAscii::ExFunctionAscii(OperatorTypeEnum oper_type,
 				 Attributes ** attr, Space * space)
      : ex_function_clause(oper_type, 2, attr, space)
@@ -759,6 +761,13 @@ ExFunctionInternalTimestamp::ExFunctionInternalTimestamp(OperatorTypeEnum oper_t
   : ex_function_clause(oper_type, 1, attr, space)
 {}
 
+ExFunctionSoundex::ExFunctionSoundex(OperatorTypeEnum oper_type,
+			       Attributes ** attr, Space * space)
+     : ex_function_clause(oper_type, 2, attr, space)
+{
+
+};
+
 
 // Triggers
 ex_expr::exp_return_type ex_function_get_bit_value_at::eval(char *op_data[],
@@ -8235,5 +8244,118 @@ ex_expr::exp_return_type ExFunctionIsIP::eval(char * op_data[],
   }
 }
 
+/*
+ * SOUNDEX(str) returns a character string containing the phonetic
+ * representation of the input string. It lets you compare words that
+ * are spelled differently, but sound alike in English.
+ * The phonetic representation is defined in "The Art of Computer Programming",
+ * Volume 3: Sorting and Searching, by Donald E. Knuth, as follows:
+ *
+ *  1. Retain the first letter of the string and remove all other occurrences
+ *  of the following letters: a, e, h, i, o, u, w, y.
+ *
+ *  2. Assign numbers to the remaining letters (after the first) as follows:
+ *        b, f, p, v = 1
+ *        c, g, j, k, q, s, x, z = 2
+ *        d, t = 3
+ *        l = 4
+ *        m, n = 5
+ *        r = 6
+ *
+ *  3. If two or more letters with the same number were adjacent in the original
+ *  name (before step 1), or adjacent except for any intervening h and w, then
+ *  omit all but the first.
+ *
+ *  4. Return the first four bytes padded with 0.
+ * */
+ex_expr::exp_return_type ExFunctionSoundex::eval(char *op_data[],
+						     CollHeap *heap,
+						     ComDiagsArea** diagsArea)
+{
+    ULng32 previous = 0;
+    ULng32 current = 0;
+
+    char *srcStr = op_data[1];
+    char *tgtStr = op_data[0];
+    Lng32 srcLen = getOperand(1)->getLength(op_data[-MAX_OPERANDS+1]);
+    Lng32 tgtLen = getOperand(0)->getLength();
+    
+    CharInfo::CharSet cs = ((SimpleType *)getOperand(1))->getCharSet();
+
+    str_pad(tgtStr, tgtLen, '\0');
+
+    tgtStr[0] = toupper(srcStr[0]);    // Retain the first letter, convert to capital anyway
+    Int16 setLen = 1;                  // The first character is set already
+
+    for(int i=1; i < srcLen; ++i)
+    {
+        char chr = toupper(srcStr[i]);
+        switch(chr)
+        {
+            case 'A':
+            case 'E':
+            case 'H':
+            case 'I':
+            case 'O':
+            case 'U':
+            case 'W':
+            case 'Y':
+                current = 0;
+                break;
+            case 'B':
+            case 'F':
+            case 'P':
+            case 'V':
+                current = 1;
+                break;
+            case 'C':
+            case 'G':
+            case 'J':
+            case 'K':
+            case 'Q':
+            case 'S':
+            case 'X':
+            case 'Z':
+                current = 2;
+                break;
+            case 'D':
+            case 'T':
+                current = 3;
+                break;
+            case 'L':
+                current = 4;
+                break;
+            case 'M':
+            case 'N':
+                current = 5;
+                break;
+            case 'R':
+                current = 6;
+                break;
+            default:
+                break;
+        }
+
+        if(current)    // Only non-zero valued letter shall ve retained, 0 will be discarded
+        {
+            if(previous != current)
+            {
+                str_itoa(current, &tgtStr[setLen]);
+                setLen++;    // A new character is set in target
+            }
+        }
+
+        previous = current;
+
+        if(setLen == tgtLen)    // Don't overhit the target string
+            break;
+    } // end of for loop
+
+    if(setLen < tgtLen)
+        str_pad(tgtStr+setLen, (tgtLen - setLen), '0');
+    
+    return ex_expr::EXPR_OK;
+}
+
 // LCOV_EXCL_STOP
 #pragma warn(1506)  // warning elimination 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/exp/exp_function.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_function.h b/core/sql/exp/exp_function.h
index cfa5907..8131fa2 100644
--- a/core/sql/exp/exp_function.h
+++ b/core/sql/exp/exp_function.h
@@ -943,6 +943,35 @@ public:
   // ---------------------------------------------------------------------
 };
 
+class SQLEXP_LIB_FUNC ExFunctionSoundex: public ex_function_clause {
+public:
+  NA_EIDPROC ExFunctionSoundex(OperatorTypeEnum oper_type,
+				Attributes ** attr,
+				Space * space);
+  NA_EIDPROC ExFunctionSoundex();
+
+  NA_EIDPROC ex_expr::exp_return_type eval(char *op_data[], CollHeap*, 
+					   ComDiagsArea** = 0);  
+  NA_EIDPROC Long pack(void *);
+
+  // ---------------------------------------------------------------------
+  // Redefinition of methods inherited from NAVersionedObject.
+  // ---------------------------------------------------------------------
+  NA_EIDPROC virtual unsigned char getClassVersionID()
+  {
+    return 1;
+  }
+
+  NA_EIDPROC virtual void populateImageVersionIDArray()
+  {
+    setImageVersionID(2,getClassVersionID());
+    ex_function_clause::populateImageVersionIDArray();
+  }
+
+  NA_EIDPROC virtual short getClassSize() { return (short)sizeof(*this); }
+  // ---------------------------------------------------------------------
+};
+
 class SQLEXP_LIB_FUNC ExFunctionMd5: public ex_function_clause {
 public:
   NA_EIDPROC ExFunctionMd5(OperatorTypeEnum oper_type,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/generator/GenItemFunc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenItemFunc.cpp b/core/sql/generator/GenItemFunc.cpp
index 77d9913..6418980 100644
--- a/core/sql/generator/GenItemFunc.cpp
+++ b/core/sql/generator/GenItemFunc.cpp
@@ -627,6 +627,15 @@ short BuiltinFunction::codeGen(Generator * generator)
 							space);
       }
     break;
+   
+    case ITM_SOUNDEX:
+    {
+        function_clause =
+            new(generator->getSpace()) ExFunctionSoundex(getOperatorType(),
+                    attr,
+                    space);
+    }
+    break;
       
     default:
       break;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index d145a18..2b3dba6 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -3167,6 +3167,7 @@ ItemExpr *BuiltinFunction::bindNode(BindWA *bindWA)
     case ITM_CRC32:
     case ITM_SHA1:
     case ITM_SHA2:
+    case ITM_SOUNDEX:
       {
          break;
       }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/optimizer/ItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp
index aa0b722..23206a6 100644
--- a/core/sql/optimizer/ItemExpr.cpp
+++ b/core/sql/optimizer/ItemExpr.cpp
@@ -7785,6 +7785,7 @@ ItemExpr * BuiltinFunction::copyTopNode(ItemExpr * derivedNode,
       switch (getOperatorType())
 	{
 	case ITM_NULLIFZERO:
+	case ITM_SOUNDEX:
 	  {
 	    result = new (outHeap) BuiltinFunction(getOperatorType(),
 						   outHeap, 1, child(0));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/optimizer/SynthType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp
index 8c78d85..742d188 100644
--- a/core/sql/optimizer/SynthType.cpp
+++ b/core/sql/optimizer/SynthType.cpp
@@ -1277,6 +1277,30 @@ const NAType *BuiltinFunction::synthesizeType()
       }
       break;
 
+    case ITM_SOUNDEX:
+      {
+          // type cast any params
+          ValueId vid1 = child(0)->getValueId();
+          SQLChar c1(ComSqlId::MAX_QUERY_ID_LEN);
+          vid1.coerceType(c1, NA_CHARACTER_TYPE);
+          
+          //input type must be string
+          const NAType &typ1 = vid1.getType();
+
+          if (typ1.getTypeQualifier() != NA_CHARACTER_TYPE)
+          {
+              *CmpCommon::diags() << DgSqlCode(-4067) << DgString0("SOUNDEX");
+              return NULL;
+          }
+
+          retType = new HEAP SQLChar(4, FALSE);
+          if (typ1.supportsSQLnull())
+          {
+              retType->setNullable(TRUE);
+          }
+      }
+      break;
+
     default:
       {
 	retType = (NAType *)ItemExpr::synthesizeType();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/parser/ParKeyWords.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/ParKeyWords.cpp b/core/sql/parser/ParKeyWords.cpp
index 0cb1aec..1173b38 100644
--- a/core/sql/parser/ParKeyWords.cpp
+++ b/core/sql/parser/ParKeyWords.cpp
@@ -1005,6 +1005,7 @@ ParKeyWord ParKeyWords::keyWords_[] = {
   ParKeyWord("SNAPSHOT",           TOK_SNAPSHOT,    NONRESTOKEN_),
   ParKeyWord("SOFTWARE",           TOK_SOFTWARE,    NONRESTOKEN_),
   ParKeyWord("SOME",               TOK_SOME,        ANS_|RESWORD_|MPWORD_),
+  ParKeyWord("SOUNDEX",            TOK_SOUNDEX,     NONRESTOKEN_),
   ParKeyWord("SORT",               TOK_SORT,        NONRESTOKEN_),
   ParKeyWord("SORT_KEY",           TOK_SORT_KEY,    NONRESTOKEN_),
   ParKeyWord("SOURCE",             TOK_SOURCE,      NONRESTOKEN_),

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index f1cbee2..cf433ed 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -1075,6 +1075,7 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %token <tokval> TOK_SPACE
 %token <tokval> TOK_SMALLINT
 %token <tokval> TOK_SOME
+%token <tokval> TOK_SOUNDEX
 %token <tokval> TOK_SORT                /* Tandem extension non-reserved word */
 %token <tokval> TOK_SORT_KEY
 %token <tokval> TOK_SP_RESULT_SET
@@ -9801,6 +9802,13 @@ misc_function :
                                   $$ = new (PARSERHEAP())
                                     CompEncode ( $3, NOT $4 );
                                 }
+     | TOK_SOUNDEX '(' value_expression ')'
+                {
+                    $$ = new (PARSERHEAP())
+                    BuiltinFunction(ITM_SOUNDEX,
+                            CmpCommon::statementHeap(),
+                            1, $3);
+                }
      | TOK_SORT_KEY '(' value_expression optional_Collation_type optional_sort_direction ')'
                                 {
                                   if ($5 != CollationInfo::DefaultDir  && $4 != CollationInfo::Sort)
@@ -33805,6 +33813,7 @@ nonreserved_func_word:  TOK_ABS
                       | TOK_SIGN
                       | TOK_SIN
                       | TOK_SINH
+                      | TOK_SOUNDEX
                       | TOK_SORT_KEY
                       | TOK_SPACE
                       | TOK_SQRT

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/regress/compGeneral/EXPECTED006.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/EXPECTED006.SB b/core/sql/regress/compGeneral/EXPECTED006.SB
index 2afa934..67a57da 100644
--- a/core/sql/regress/compGeneral/EXPECTED006.SB
+++ b/core/sql/regress/compGeneral/EXPECTED006.SB
@@ -158,7 +158,34 @@
 
 --- 16 row(s) inserted.
 >>
+>>-- Used for builtin function SOUNDEX() tests
+>>create table t006emp1(name varchar(20));
+
+--- SQL operation complete.
 >>
+>>create table t006emp2(name varchar(20) character set UCS2);
+
+--- SQL operation complete.
+>>
+>>insert into t006emp1 values
++>('Smith'),
++>('Lynn'),
++>('Ruoyu'),
++>('John'),
++>('Lane')
++>;
+
+--- 5 row(s) inserted.
+>>
+>>insert into t006emp2 values
++>('Smith'),
++>('Lynn'),
++>('Ruoyu'),
++>('John'),
++>('Lane')
++>;
+
+--- 5 row(s) inserted.
 >>
 >>obey TEST006(negative_tests);
 >>
@@ -1675,4 +1702,81 @@ d3d9446802a44259755d38e6d163e820   852952723  b1d5781111d84f7b3fe45a0852e59758cd
 
 *** ERROR[8822] The statement was not prepared.
 
+>>
+>>select SOUNDEX('Jon') from dual;
+
+(EXPR)
+------
+
+J500
+
+--- 1 row(s) selected.
+>>select SOUNDEX('Roy') from dual;
+
+(EXPR)
+------
+
+R000
+
+--- 1 row(s) selected.
+>>select SOUNDEX('Lynn') from dual;
+
+(EXPR)
+------
+
+L500
+
+--- 1 row(s) selected.
+>>
+>>select name, SOUNDEX(name) from t006emp1 where SOUNDEX(name)=SOUNDEX('Jon');
+
+NAME (EXPR)
+----------
+
+John J500
+
+--- 1 row(s) selected.
+>>select name, SOUNDEX(name) from t006emp1 where SOUNDEX(name)=SOUNDEX('Roy');
+
+NAME (EXPR)
+----------
+
+Ruoyu R000
+
+--- 1 row(s) selected.
+>>select name, SOUNDEX(name) from t006emp1 where SOUNDEX(name)=SOUNDEX('Lynn');
+
+NAME (EXPR)
+----------
+
+Lane L500
+Lynn L500
+
+--- 2 row(s) selected.
+>>
+>>select name, SOUNDEX(name) from t006emp2 where SOUNDEX(name)=SOUNDEX('Jon');
+
+NAME (EXPR)
+----------
+
+John J500
+
+--- 1 row(s) selected.
+>>select name, SOUNDEX(name) from t006emp2 where SOUNDEX(name)=SOUNDEX('Roy');
+
+NAME (EXPR)
+----------
+
+Ruoyu R000
+
+--- 1 row(s) selected.
+>>select name, SOUNDEX(name) from t006emp2 where SOUNDEX(name)=SOUNDEX('Lynn');
+
+NAME (EXPR)
+----------
+
+Lane L500
+Lynn L500
+
+--- 2 row(s) selected.
 >>log;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c9385f62/core/sql/regress/compGeneral/TEST006
----------------------------------------------------------------------
diff --git a/core/sql/regress/compGeneral/TEST006 b/core/sql/regress/compGeneral/TEST006
index 96d6508..2ee1598 100644
--- a/core/sql/regress/compGeneral/TEST006
+++ b/core/sql/regress/compGeneral/TEST006
@@ -60,6 +60,9 @@ drop mv mvx cascade;
 drop table t006tao;
 drop table t006_employees;
 drop table t006taoc;
+-- Used for builtin function SOUNDEX() tests
+drop table t006emp1;
+drop table t006emp2;
 
 ?section create_tables
 
@@ -170,7 +173,26 @@ insert into t006taoc values
 ('10','14','9')
 ;
 
+-- Used for builtin function SOUNDEX() tests
+create table t006emp1(name varchar(20));
 
+create table t006emp2(name varchar(20) character set UCS2);
+
+insert into t006emp1 values
+('Smith'),
+('Lynn'),
+('Ruoyu'),
+('John'),
+('Lane')
+;
+
+insert into t006emp2 values
+('Smith'),
+('Lynn'),
+('Ruoyu'),
+('John'),
+('Lane')
+;
 
 ?section negative_tests
 
@@ -639,3 +661,15 @@ from T006_EMPLOYEES <<+ cardinality 10e6 >> order by emp_name;
 select md5('10'), crc32(10), sha('10') from dual;
 select md5(10) from dual;
 select sha1(10) from dual;
+
+select SOUNDEX('Jon') from dual;
+select SOUNDEX('Roy') from dual;
+select SOUNDEX('Lynn') from dual;
+
+select name, SOUNDEX(name) from t006emp1 where SOUNDEX(name)=SOUNDEX('Jon');
+select name, SOUNDEX(name) from t006emp1 where SOUNDEX(name)=SOUNDEX('Roy');
+select name, SOUNDEX(name) from t006emp1 where SOUNDEX(name)=SOUNDEX('Lynn');
+
+select name, SOUNDEX(name) from t006emp2 where SOUNDEX(name)=SOUNDEX('Jon');
+select name, SOUNDEX(name) from t006emp2 where SOUNDEX(name)=SOUNDEX('Roy');
+select name, SOUNDEX(name) from t006emp2 where SOUNDEX(name)=SOUNDEX('Lynn');


[2/2] incubator-trafodion git commit: Merge [TRAFODION-2358] Implement builtin function SOUNDEX

Posted by ry...@apache.org.
Merge [TRAFODION-2358] Implement builtin function SOUNDEX


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/70980957
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/70980957
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/70980957

Branch: refs/heads/master
Commit: 70980957cdc0db79b8d3651ffb5ab51a30add6e4
Parents: 609482f c9385f6
Author: ryzuo <jo...@gmail.com>
Authored: Thu Nov 24 06:20:22 2016 +0000
Committer: ryzuo <jo...@gmail.com>
Committed: Thu Nov 24 06:20:22 2016 +0000

----------------------------------------------------------------------
 core/sql/exp/ExpPackDefs.cpp                |   5 +
 core/sql/exp/exp_clause.cpp                 |   6 ++
 core/sql/exp/exp_clause.h                   |   3 +-
 core/sql/exp/exp_function.cpp               | 122 +++++++++++++++++++++++
 core/sql/exp/exp_function.h                 |  29 ++++++
 core/sql/generator/GenItemFunc.cpp          |   9 ++
 core/sql/optimizer/BindItemExpr.cpp         |   1 +
 core/sql/optimizer/ItemExpr.cpp             |   1 +
 core/sql/optimizer/SynthType.cpp            |  24 +++++
 core/sql/parser/ParKeyWords.cpp             |   1 +
 core/sql/parser/sqlparser.y                 |   9 ++
 core/sql/regress/compGeneral/EXPECTED006.SB | 104 +++++++++++++++++++
 core/sql/regress/compGeneral/TEST006        |  34 +++++++
 13 files changed, 347 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/70980957/core/sql/parser/sqlparser.y
----------------------------------------------------------------------