This is an automated email from the ASF dual-hosted git repository.
myui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hivemall.git
The following commit(s) were added to refs/heads/master by this push:
new 1054a4a Fixed to update generic_func.md properly
1054a4a is described below
commit 1054a4aa478bd4eb2f2f62bd98562061db95ebdb
Author: Makoto Yui <[email protected]>
AuthorDate: Wed Jan 9 16:00:53 2019 +0900
Fixed to update generic_func.md properly
---
bin/update_func_md.sh | 4 +++-
docs/gitbook/misc/generic_funcs.md | 32 +++++++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/bin/update_func_md.sh b/bin/update_func_md.sh
index bb590e5..6a6f5aa 100755
--- a/bin/update_func_md.sh
+++ b/bin/update_func_md.sh
@@ -32,6 +32,8 @@ fi
cd $HIVEMALL_HOME
HIVEMALL_HOME=`pwd`
+VERSION=`cat VERSION`
+
# Deploy to local Maven repos
export MAVEN_OPTS="-XX:MaxPermSize=256m
-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2"
@@ -39,7 +41,7 @@ mvn clean install -DskipTests=true -Dmaven.test.skip=true -pl
'.,core,nlp,xgboos
# Generate docs
-mvn org.apache.hivemall:hivemall-docs:generate-funcs-list -pl
'.,core,nlp,xgboost,tools/hivemall-docs' -X
+mvn org.apache.hivemall:hivemall-docs:${VERSION}:generate-funcs-list -pl
'.,core,nlp,xgboost,tools/hivemall-docs' -X
# Run HTTP server on localhost:4000
diff --git a/docs/gitbook/misc/generic_funcs.md
b/docs/gitbook/misc/generic_funcs.md
index f429980..e99594b 100644
--- a/docs/gitbook/misc/generic_funcs.md
+++ b/docs/gitbook/misc/generic_funcs.md
@@ -64,7 +64,7 @@ This page describes a list of useful Hivemall generic
functions. See also a [lis
- `array_slice(array<ANY> values, int offset [, int length])` - Slices the
given array by the given offset and length parameters.
```sql
SELECT
- array_slice(array(1,2,3,4,5,6), 2,4),
+ array_slice(array(1,2,3,4,5,6),2,4),
array_slice(
array("zero", "one", "two", "three", "four", "five", "six", "seven",
"eight", "nine", "ten"),
0, -- offset
@@ -173,6 +173,36 @@ This page describes a list of useful Hivemall generic
functions. See also a [lis
[-2,1,3,10]
```
+- `subarray(array<ANY> values, int fromIndex [, int toIndex])`- Returns a
slice of the original array between the inclusive fromIndex and the exclusive
toIndex.
+ ```sql
+ SELECT
+ subarray(array(0,1,2,3,4,5),4),
+ subarray(array(0,1,2,3,4,5),3,4),
+ subarray(array(0,1,2,3,4,5),3,3),
+ subarray(array(0,1,2,3,4,5),3,2),
+ subarray(array(0,1,2,3,4,5),0,2),
+ subarray(array(0,1,2,3,4,5),-1,2),
+ subarray(array(1,2,3,4,5,6),4),
+ subarray(array(1,2,3,4,5,6),4,6),
+ subarray(array(1,2,3,4,5,6),2,4),
+ subarray(array(1,2,3,4,5,6),0,2),
+ subarray(array(1,2,3,4,5,6),4,6),
+ subarray(array(1,2,3,4,5,6),4,7);
+
+ [4,5]
+ [3]
+ []
+ []
+ [0,1]
+ [0,1]
+ [5,6]
+ [5,6]
+ [3,4]
+ [1,2]
+ [5,6]
+ [5,6]
+ ```
+
- `subarray_endwith(array<int|text> original, int|text key)` - Returns an
array that ends with the specified key
```sql
SELECT subarray_endwith(array(1,2,3,4), 3);