You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by pr...@apache.org on 2014/12/31 07:12:50 UTC

incubator-lens git commit: LENS-71:Document details of how to pass timerange in cube QL(Raju Bairishetty via prongs)

Repository: incubator-lens
Updated Branches:
  refs/heads/master 8455a9798 -> 5e6d8623a


LENS-71:Document details of how to pass timerange in cube QL(Raju Bairishetty via prongs)


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

Branch: refs/heads/master
Commit: 5e6d8623a834ae03602947785f2c5b57f7843297
Parents: 8455a97
Author: Rajat Khandelwal <ra...@inmobi.com>
Authored: Wed Dec 31 11:42:43 2014 +0530
Committer: Rajat Khandelwal <ra...@inmobi.com>
Committed: Wed Dec 31 11:42:43 2014 +0530

----------------------------------------------------------------------
 src/site/apt/user/olap-cube.apt | 67 ++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/5e6d8623/src/site/apt/user/olap-cube.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/user/olap-cube.apt b/src/site/apt/user/olap-cube.apt
index 824bd01..87fd659 100644
--- a/src/site/apt/user/olap-cube.apt
+++ b/src/site/apt/user/olap-cube.apt
@@ -189,6 +189,73 @@ QUARTERLY, YEARLY update periods.
   
   Various configurations available for running an OLAP query are documented at {{{./olap-query-conf.html} OLAP query configurations}} 
 
+<<How to pass timerange in cubeQL>>
+
+ Users have the capability to specify the time range as absolute and relative time in lens cube query.
+ Lens cube query language allows passing timerange at different granularities like secondly, minutely, hourly, daily, weekly, monthly and yearly.
+ Relative timerange is helpful to the users in scheduling their queries
+
+ User can specify the HOURLY granularity with 'now.hour'.
+
+ The follwong table tells the available <<unit granularities>> and how to specify those granualarities for relative timerange
+
+*--+--+--+
+||UNIT||Specification||Relative time||
+*--+--+--+
+|Secondly | now.second | now.second{+/-}30seconds|
+*--+--+--+
+|Minutely | now.minute | now.minute{+/-}30minutes|
+*--+--+--+
+|Hourly | now.hour | now.hour{+/-}3hours|
+*--+--+--+
+|Daily | now.day  | now.day{+/-}3days|
+*--+--+--+
+|Weekly | now.week | now.week{+/-}3weeks|
+*--+--+--+
+|Monthly | now.month | now.month{+/-}3months|
+*--+--+--+
+|Yearly | now.year | now.year{+/-}2years|
+*--+--+--+
+
+<<Example queries with relative timerange>>:
+
++---+
+
+ query execute cube select col1 from cube where TIME_RANGE_IN(col2, "now.hour-4hours", "now.hour")
+
+ The above queries for the last 4hours data.
++---+
+
+ Users can query the data with absolute timerange at different granularities.
+ The following table describes how to specify absoulte timerange at different granularities
+
+*--+--+
+||UNIT||Absolute time specification||
+*--+--+
+|Secondly | yyyy-MM-dd-HH:mm:ss|
+*--+--+
+|Minutely | yyyy-MM-dd-HH:mm|
+*--+--+
+|Hourly | yyyy-MM-dd-HH|
+*--+--+
+|Daily | yyyy-MM-dd|
+*--+--+
+|Monthly | yyyy-MM|
+*--+--+
+|Yearly | yyyy|
+*--+--+
+
+<<Example queries with absolute timerange>>:
+
++---+
+
+ query execute cube select col1 from cube where TIME_RANGE_IN(it, "2014-12-29-07", "2014-12-29-11")
+
+ query execute cube select col1 from cube where TIME_RANGE_IN(it, "2014-12-29", "2014-12-30")
+
+ It queries the data between 29th Dec 2014 and 30th Dec 2014.
+
++---+
 * Query API
 
   LENS provides {{{../resource_QueryServiceResource.html} REST api}},