[GitHub] incubator-trafodion pull request #888: [TRAFODION-2417] Installer pre-work f...

2016-12-22 Thread mkby
Github user mkby commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/888#discussion_r93724802
  
--- Diff: core/sqf/sqenvcom.sh ---
@@ -139,6 +139,10 @@ else
 fi
 export TRAF_HOME=$PWD
 
+# normal installed location, can be overridden in .trafodion
+export DCS_INSTALL_DIR=$TRAF_HOME/dcs-$TRAFODION_VER
+export REST_INSTALL_DIR=$TRAF_HOME/rest-$TRAFODION_VER
+
--- End diff --

I like this idea, but where does `$TRAFODION_VER` variable come from?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #683: [TRAFODION-2329]New SPJ to create int...

2016-12-22 Thread orrk
Github user orrk closed the pull request at:

https://github.com/apache/incubator-trafodion/pull/683


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #891: [TRAFODION-2411] Conn aborted when co...

2016-12-22 Thread arvind-narain
GitHub user arvind-narain opened a pull request:

https://github.com/apache/incubator-trafodion/pull/891

[TRAFODION-2411] Conn aborted when connecting with a reregisterd user

APIs used to clear compiler caches had changed, leading to syntax errors.

Modified the following -
DELETE ALL FROM TABLE(QUERYCACHE());
to
DELETE ALL FROM TABLE(QUERYCACHE('ALL','LOCAL'));


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/arvind-narain/incubator-trafodion clearcache

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/891.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #891


commit 35e928be46167deb381faa5ad0318e99a2433c0a
Author: Arvind Narain 
Date:   2016-12-23T00:03:12Z

[TRAFODION-2411] Conn aborted when connecting with a reregisterd user

APIs used to clear compiler caches had changed, leading to syntax
errors.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #883: [TRAFODION-2403] update sql reference...

2016-12-22 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/883#discussion_r93706480
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -3352,6 +3353,59 @@ The escape character indicates that the underscore 
in 'FLOPPY_DISK' is
 part of the string to search for, not a wild-card character.
 
 <<<
+[[regexp_predicate]]
+=== REGEXP Predicate
+
+Performs a pattern match of a string expression against a pattern . 
+The pattern can be an extended regular expression. 
+Returns 1 if expression matches pattern; otherwise it returns 0. 
+If either expression or pattern is NULL, the result is NULL.
+
+[[regexp_syntax]]
+ Syntax
+```
+match-value [NOT] REGEXP regular-expression
+```
+
+* `_match-value_`
++
+is a character value expression that specifies a set of strings to
+search for that match the _pattern_.
+
+* `_pattern_`
++
+is a character value expression that specifies a regular expression. 
+Trafodion regular expressions follow POSIX regular expression rules.
+
+
+[[using_not]]
+= Using NOT
+
+If you specify NOT, the predicate is true if the _pattern_ does not
--- End diff --

Should say _regular-expression_ here instead of _pattern_.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #883: [TRAFODION-2403] update sql reference...

2016-12-22 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/883#discussion_r93706427
  
--- Diff: 
docs/sql_reference/src/asciidoc/_chapters/sql_language_elements.adoc ---
@@ -3352,6 +3353,59 @@ The escape character indicates that the underscore 
in 'FLOPPY_DISK' is
 part of the string to search for, not a wild-card character.
 
 <<<
+[[regexp_predicate]]
+=== REGEXP Predicate
+
+Performs a pattern match of a string expression against a pattern . 
+The pattern can be an extended regular expression. 
+Returns 1 if expression matches pattern; otherwise it returns 0. 
+If either expression or pattern is NULL, the result is NULL.
+
+[[regexp_syntax]]
+ Syntax
+```
+match-value [NOT] REGEXP regular-expression
+```
+
+* `_match-value_`
++
+is a character value expression that specifies a set of strings to
+search for that match the _pattern_.
+
+* `_pattern_`
--- End diff --

Should change this to `_regular-expression_` to match the syntax on line 
3367.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #890: [TRAFODION-2394] Add documentation fo...

2016-12-22 Thread DaveBirdsall
GitHub user DaveBirdsall opened a pull request:

https://github.com/apache/incubator-trafodion/pull/890

[TRAFODION-2394] Add documentation for TO_CHAR + fix some bugs in it

This set of changes does the following:

1. Adds documentation for the TO_CHAR function to the SQL Reference Manual.
2. Fixes four bugs:
a. TO_CHAR(x), where x is a TIME column, would sometimes have garbage 
characters at the end of it. This has been fixed.
b. TO_CHAR(x,'YY/MM/DD') produces garbage output when x is a TIME column, 
because x has no date fields. This has been fixed. A 4072 error is now raised 
instead.
c. TO_CHAR(DATE '2016-03-01', 'MMDDHH24MISS') returns an incorrectly 
formatted value, '2016030100:00:'. This has been fixed; it now returns the 
correct value '2016030100'.
d. DATEFORMAT(5,USA) returns an error 4071 (as it should), but the error 
message text says "TO_CHAR" instead of "DATEFORMAT". This has been fixed.
3. Updates to regression test seabase/TEST030 and its expected results to 
cover the bugs above.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/DaveBirdsall/incubator-trafodion Trafodion2394

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/890.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #890


commit 93bd6bcd1c24c779a45af55bb31898a2f1f01e2f
Author: Dave Birdsall 
Date:   2016-12-22T22:10:04Z

[TRAFODION-2394] Add documentation for TO_CHAR + fix some bugs in it




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #885: [TRAFODION-2414] enhance 8616 commit ...

2016-12-22 Thread selvaganesang
Github user selvaganesang commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/885#discussion_r93672570
  
--- Diff: core/sqf/src/seatrans/tm/hbasetmlib2/javaobjectinterfacetm.cpp ---
@@ -428,6 +428,42 @@ bool  
JavaObjectInterfaceTM::getExceptionDetails(JNIEnv *jenv)
return true;
 }
 
--- End diff --

It would be better use the existing getExceptionDetails function to avoid 
duplication of code. You can either to choose to have default parameter or make 
the existing getExceptionDetails to call the new functions with retCode passed 
in 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #885: [TRAFODION-2414] enhance 8616 commit ...

2016-12-22 Thread selvaganesang
Github user selvaganesang commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/885#discussion_r93671479
  
--- Diff: core/sqf/inc/cextdecs/cextdecs.h ---
@@ -289,6 +289,10 @@ _declspec(dllimport) short   DNUMOUT
 
 _declspec(dllimport) short   ENDTRANSACTION();
 
+//errStr is allocated if errlen is not zero. Caller must deallocate errStr.
+//Rest of functionality same as ENDTRANSACTION();
+_declspec(dllimport) short   ENDTRANSACTION_ERR(char *, int 
);
--- End diff --

This would mean that the errStr is allocated by the TM functions using its 
own heap management scheme or the system memory. The caller wouldn't be aware 
of how to deallocate if it is anything other than system memory


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #882: TMUDF fixes and related changes

2016-12-22 Thread zellerh
Github user zellerh commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/882#discussion_r93665587
  
--- Diff: core/sql/src/main/java/org/trafodion/sql/udr/TupleInfo.java ---
@@ -1079,19 +1230,48 @@ else if (t.getByteLength() == 8)
 row_.putLong(t.getDataOffset(), val);
 break;
 
+case TINYINT_UNSIGNED:
+if (val < 0 || val > Byte.MAX_VALUE)
+if (val > (2 * Byte.MAX_VALUE + 1))
+throw new UDRException(
+38900,
+"Overflow/underflow when assigning to TINYINT 
UNSIGNED type");
+else
+// use the signed value that has the same bit
+// pattern as the desired unsigned value, since
+// Java doesn't support "unsigned" basic types
+val = val + Byte.MIN_VALUE + Byte.MIN_VALUE;
--- End diff --

Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #882: TMUDF fixes and related changes

2016-12-22 Thread zellerh
Github user zellerh commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/882#discussion_r93665561
  
--- Diff: core/sql/src/main/java/org/trafodion/sql/udr/TupleInfo.java ---
@@ -1079,19 +1230,48 @@ else if (t.getByteLength() == 8)
 row_.putLong(t.getDataOffset(), val);
 break;
 
+case TINYINT_UNSIGNED:
+if (val < 0 || val > Byte.MAX_VALUE)
+if (val > (2 * Byte.MAX_VALUE + 1))
+throw new UDRException(
+38900,
+"Overflow/underflow when assigning to TINYINT 
UNSIGNED type");
+else
--- End diff --

Thanks for finding this! Fixed in all three cases.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #882: TMUDF fixes and related changes

2016-12-22 Thread zellerh
Github user zellerh commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/882#discussion_r93661838
  
--- Diff: core/sql/optimizer/RelRoutine.cpp ---
@@ -1027,7 +1052,7 @@ OperatorTypeEnum 
PredefinedTableMappingFunction::nameIsAPredefinedTMF(const Corr
   const NAString  = qualName.getObjectName();
--- End diff --

Maybe small, but still a valid point! I stumbled over this while re-reading 
the code. Fixed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #882: TMUDF fixes and related changes

2016-12-22 Thread zellerh
Github user zellerh commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/882#discussion_r93661429
  
--- Diff: core/sql/generator/LmExpr.cpp ---
@@ -362,7 +362,7 @@ LmExprResult CreateLmOutputExpr(const NAType 
,
 // specified type t to be converted to/from C strings. The only 
 // SQL types that do not need to be converted to C strings are:
 // 
-//  INT, SMALLINT, LARGEINT, FLOAT, REAL, DOUBLE PRECISION
+//  INT, SMALLINT, LARGEINT, FLOAT, REAL, DOUBLE PRECISION, BOOLEAN
--- End diff --

Yes, good point, I'll add tinyint.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #888: [TRAFODION-2417] Installer pre-work f...

2016-12-22 Thread amandamoran
Github user amandamoran commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/888#discussion_r93659688
  
--- Diff: install/installer/dcs_installer ---
@@ -130,34 +130,12 @@ fi
 mkdir -p $DCS_INSTALL_PATH
 cd $DCS_INSTALL_PATH
 
-if [[ "$ONE_TAR_INSTALL" == "Y" ]]; then
-   DCS_DIR=$(ls $TRAF_HOME | grep dcs)
-   DCS_DIR=$TRAF_HOME/$DCS_DIR
-   echo "***INFO: DCS Install Directory: $DCS_DIR"
-else
-   # untar DCS build into install directory
-   echo "***INFO: untarring build file $DCS_BUILD_FILE"
-   tar -xzf $DCS_BUILD_FILE
-
-   # get the dcs install directory name which is imbedded in the tar file
-   DCS_DIR=$(tar -tf $DCS_BUILD_FILE | grep --max-count=1 bin | sed -e 
"s@\(^.*\)/bin/@\1@")
-
-   DCS_DIR=$DCS_INSTALL_PATH/$DCS_DIR
-fi
-
-# set env var in sqenvcom.sh for DCS install directory
-grep --invert-match "DCS_INSTALL_DIR=" $TRAF_HOME/sqenvcom.sh > 
$TRAF_HOME/sqenvcom.temp
-echo "export DCS_INSTALL_DIR=$DCS_DIR" >> $TRAF_HOME/sqenvcom.temp
-mv $TRAF_HOME/sqenvcom.temp $TRAF_HOME/sqenvcom.sh
+DCS_DIR=$(ls $TRAF_HOME | grep dcs)
--- End diff --

So happy to see $ONE_TAR_INSTALL being removed. +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #888: [TRAFODION-2417] Installer pre-work f...

2016-12-22 Thread svarnau
GitHub user svarnau opened a pull request:

https://github.com/apache/incubator-trafodion/pull/888

[TRAFODION-2417] Installer pre-work for ambari integration

Simplify install operations for dcs and rest by setting default values
in env files. Also make trafci use config files rather than have hard-coded
setting. This reduces code in existing command-line installers.

Add system setting files to RPM. These files are stored in 
core/sqf/sysinstall.
The existing command-line installers could also take advantage of these 
files,
but it is not required, and I have not made those changes in this commit.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/svarnau/incubator-trafodion install-2417

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/888.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #888






---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #887: [TRAFODION-2406] update sql reference...

2016-12-22 Thread traflm
GitHub user traflm opened a pull request:

https://github.com/apache/incubator-trafodion/pull/887

[TRAFODION-2406] update sql reference manual about INTERSECT/EXCEPT s…

…yntax

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/traflm/incubator-trafodion TRAFODION-2406

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/887.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #887


commit 7aa84e03ed3734835cd2f5033bc1219d82496bc3
Author: Liu Ming 
Date:   2016-12-22T15:05:29Z

[TRAFODION-2406] update sql reference manual about INTERSECT/EXCEPT syntax




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #882: TMUDF fixes and related changes

2016-12-22 Thread sureshsubbiah
Github user sureshsubbiah commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/882#discussion_r93637494
  
--- Diff: core/sql/generator/LmExpr.cpp ---
@@ -362,7 +362,7 @@ LmExprResult CreateLmOutputExpr(const NAType 
,
 // specified type t to be converted to/from C strings. The only 
 // SQL types that do not need to be converted to C strings are:
 // 
-//  INT, SMALLINT, LARGEINT, FLOAT, REAL, DOUBLE PRECISION
+//  INT, SMALLINT, LARGEINT, FLOAT, REAL, DOUBLE PRECISION, BOOLEAN
--- End diff --

Does Tinyint belong to this set of types? I suppose the answer is No, but 
thought it safer to check.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-trafodion pull request #882: TMUDF fixes and related changes

2016-12-22 Thread sureshsubbiah
Github user sureshsubbiah commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/882#discussion_r93589838
  
--- Diff: core/sql/optimizer/RelRoutine.cpp ---
@@ -1027,7 +1052,7 @@ OperatorTypeEnum 
PredefinedTableMappingFunction::nameIsAPredefinedTMF(const Corr
   const NAString  = qualName.getObjectName();
--- End diff --

This comment is for line 1047. It must be the smallest nit recorded. The 
comment could be changed to REL_ANY_TABLE_MAPPING_UDF from 
REL_TABLE_MAPPING_UDF.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---