Repository: drill Updated Branches: refs/heads/gh-pages f1c6b8dea -> c8e1e6b2a
minor doc changes Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/c8e1e6b2 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/c8e1e6b2 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/c8e1e6b2 Branch: refs/heads/gh-pages Commit: c8e1e6b2a74562b8ed962918ffcc6cdfca712391 Parents: f1c6b8d Author: Kristine Hahn <kh...@maprtech.com> Authored: Mon Apr 6 16:45:42 2015 -0700 Committer: Bridget Bevens <bbev...@maprtech.com> Committed: Mon Apr 6 17:42:45 2015 -0700 ---------------------------------------------------------------------- _docs/connect/009-mapr-db-plugin.md | 2 +- _docs/query/003-query-hbase.md | 4 +- _docs/sql-ref/001-data-types.md | 2 +- _docs/sql-ref/003-operators.md | 2 +- _docs/sql-ref/data-types/001-date.md | 2 +- _docs/sql-ref/functions/002-conversion.md | 8 +-- _docs/sql-ref/functions/005-aggregate.md | 91 ++++++++++++++++++++++++-- _docs/sql-ref/functions/006-nulls.md | 40 +++++------ 8 files changed, 115 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/connect/009-mapr-db-plugin.md ---------------------------------------------------------------------- diff --git a/_docs/connect/009-mapr-db-plugin.md b/_docs/connect/009-mapr-db-plugin.md index 62aa068..e6a45c2 100644 --- a/_docs/connect/009-mapr-db-plugin.md +++ b/_docs/connect/009-mapr-db-plugin.md @@ -21,7 +21,7 @@ in the Web UI of the Drill Sandbox to view the configuration for the `dfs` insta  -The examples of the [CONVERT_TO/FROM functions](/docs/conversion#convert-to-and-convert-from) show how to adapt the `dfs` storage plugin to use the `maprdb` format plugin to query HBase tables on the Sandbox. +The examples of the [CONVERT_TO/FROM functions](/docs/data-type-conversion#convert-to-and-convert-from) show how to adapt the `dfs` storage plugin to use the `maprdb` format plugin to query HBase tables on the Sandbox. You modify the `dfs` storage plugin to create a table mapping to a directory in the MapR-FS file system. You then select the table by name. http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/query/003-query-hbase.md ---------------------------------------------------------------------- diff --git a/_docs/query/003-query-hbase.md b/_docs/query/003-query-hbase.md index bdfbb8a..a4e8bc5 100644 --- a/_docs/query/003-query-hbase.md +++ b/_docs/query/003-query-hbase.md @@ -11,9 +11,9 @@ steps: 1. Pipe the following commands to the HBase shell to create students and clicks tables in HBase: - echo "create 'students','account','address'" | hbase shell + echo "create 'students','account','address'" | hbase shell - echo "create 'clicks','clickinfo','iteminfo'" | hbase shell + echo "create 'clicks','clickinfo','iteminfo'" | hbase shell On the Drill Sandbox, HBase tables are located in: http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/sql-ref/001-data-types.md ---------------------------------------------------------------------- diff --git a/_docs/sql-ref/001-data-types.md b/_docs/sql-ref/001-data-types.md index 5607c85..73aedc8 100644 --- a/_docs/sql-ref/001-data-types.md +++ b/_docs/sql-ref/001-data-types.md @@ -119,7 +119,7 @@ The following table lists data types top to bottom, in descending order of prece In a textual file, such as CSV, Drill interprets every field as a VARCHAR, as previously mentioned. To handle textual data, you can use the following functions to cast and convert compatible data types: -* [CAST](/docs/conversion#cast) +* [CAST](/docs/data-type-conversion#cast) Casts data from one data type to another. * [CONVERT_TO and CONVERT_FROM](/docs/conversion#convert-to-and-convert-from) Converts data, including binary data, from one data type to another. http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/sql-ref/003-operators.md ---------------------------------------------------------------------- diff --git a/_docs/sql-ref/003-operators.md b/_docs/sql-ref/003-operators.md index b9a95e7..88b7284 100644 --- a/_docs/sql-ref/003-operators.md +++ b/_docs/sql-ref/003-operators.md @@ -71,5 +71,5 @@ You can use the following string operators in your Drill queries to concatenate The concatenate operator is an alternative to the [concat function](/docs/string-manipulation#concat). -The concat function treets NULL as an empty string. The concatenate operator (||) returns NULL if any input is NULL. +The concat function treats NULL as an empty string. The concatenate operator (||) returns NULL if any input is NULL. http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/sql-ref/data-types/001-date.md ---------------------------------------------------------------------- diff --git a/_docs/sql-ref/data-types/001-date.md b/_docs/sql-ref/data-types/001-date.md index ec97e3b..7115d11 100644 --- a/_docs/sql-ref/data-types/001-date.md +++ b/_docs/sql-ref/data-types/001-date.md @@ -95,6 +95,6 @@ You can run the query described earlier to check the formatting of the fields. T +------------+ 1 row selected (0.076 seconds) -For information about casting interval data, see the ["CAST"](/docs/conversion#cast) function. +For information about casting interval data, see the ["CAST"](/docs/data-type-conversion#cast) function. http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/sql-ref/functions/002-conversion.md ---------------------------------------------------------------------- diff --git a/_docs/sql-ref/functions/002-conversion.md b/_docs/sql-ref/functions/002-conversion.md index 64fc25c..0bc0d66 100644 --- a/_docs/sql-ref/functions/002-conversion.md +++ b/_docs/sql-ref/functions/002-conversion.md @@ -4,9 +4,9 @@ parent: "SQL Functions" --- Drill supports the following functions for casting and converting data types: -* [CAST](/docs/conversion#cast) -* [CONVERT TO/FROM](/docs/conversion#convert-to-and-convert-from) -* [Other data type conversion functions](/docs/conversion#other-data-type-conversion-functions) +* [CAST](/docs/data-type-conversion#cast) +* [CONVERT_TO and CONVERT_FROM](/docs/data-type-conversion#convert-to-and-convert-from) +* [Other data type conversion functions](/docs/data-type-conversion#functions-for-handling-nulls) ## CAST @@ -173,7 +173,7 @@ Use the CONVERT_TO function to change the data type to binary when sending data ### Examples -This example shows how to use the CONVERT_FROM function to convert complex HBase data to a readable type. The example summarizes and continues the ["Query HBase"](/docs/query-hbase) example. The ["Query HBase"](/docs/query-hbase) example stores the following data in the students table on the Drill Sandbox: +This example shows how to use the CONVERT_FROM function to convert complex HBase data to a readable type. The example summarizes and continues the ["Query HBase"](/docs/querying-hbase) example. The ["Query HBase"](/docs/querying-hbase) example stores the following data in the students table on the Drill Sandbox: USE maprdb; http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/sql-ref/functions/005-aggregate.md ---------------------------------------------------------------------- diff --git a/_docs/sql-ref/functions/005-aggregate.md b/_docs/sql-ref/functions/005-aggregate.md index 250527f..eda1049 100644 --- a/_docs/sql-ref/functions/005-aggregate.md +++ b/_docs/sql-ref/functions/005-aggregate.md @@ -10,12 +10,91 @@ Drill queries: **Function** | **Argument Type** | **Return Type** -------- | ------------- | ----------- -avg(expression)| smallint, int, bigint, real, double precision, numeric, or interval| numeric for any integer-type argument, double precision for a floating-point argument, otherwise the same as the argument data type -count(*)| _-_| bigint -count([DISTINCT] expression)| any| bigint -max(expression)| any array, numeric, string, or date/time type| same as argument type -min(expression)| any array, numeric, string, or date/time type| same as argument type -sum(expression)| smallint, int, bigint, real, double precision, numeric, or interval| bigint for smallint or int arguments, numeric for bigint arguments, double precision for floating-point arguments, otherwise the same as the argument data type +AVG(expression)| smallint, int, bigint, real, double precision, numeric, or interval| numeric for any integer-type argument, double precision for a floating-point argument, otherwise the same as the argument data type +COUNT(*)| _-_| bigint +COUNT([DISTINCT] expression)| any| bigint +MAX(expression)| any array, numeric, string, or date/time type| same as argument type +MIN(expression)| any array, numeric, string, or date/time type| same as argument type +SUM(expression)| smallint, int, bigint, real, double precision, numeric, or interval| bigint for smallint or int arguments, numeric for bigint arguments, double precision for floating-point arguments, otherwise the same as the argument data type + +MIN, MAX, COUNT, AVG, SUM accept ALL and DISTINCT keywords. The default is ALL. + +### Examples + + SELECT a2 FROM t2; + +------------+ + | a2 | + +------------+ + | 0 | + | 1 | + | 2 | + | 2 | + | 2 | + | 3 | + | 4 | + | 5 | + | 6 | + | 7 | + | 7 | + | 8 | + | 9 | + +------------+ + 13 rows selected (0.056 seconds) + + SELECT AVG(ALL a2) FROM t2; + +------------+ + | EXPR$0 | + +------------+ + | 4.3076923076923075 | + +------------+ + 1 row selected (0.084 seconds) + + SELECT AVG(DISTINCT a2) FROM t2; + +------------+ + | EXPR$0 | + +------------+ + | 4.5 | + +------------+ + 1 row selected (0.079 seconds) + + SELECT SUM(ALL a2) FROM t2; + +------------+ + | EXPR$0 | + +------------+ + | 56 | + +------------+ + 1 row selected (0.086 seconds) + + SELECT SUM(DISTINCT a2) FROM t2; + +------------+ + | EXPR$0 | + +------------+ + | 45 | + +------------+ + 1 row selected (0.078 seconds) + + +------------+ + | EXPR$0 | + +------------+ + | 13 | + +------------+ + 1 row selected (0.056 seconds) + + SELECT COUNT(ALL a2) FROM t2; + +------------+ + | EXPR$0 | + +------------+ + | 13 | + +------------+ + 1 row selected (0.056 seconds) + + SELECT COUNT(DISTINCT a2) FROM t2; + +------------+ + | EXPR$0 | + +------------+ + | 10 | + +------------+ + 1 row selected (0.074 seconds) ## Aggregate Statistical Functions http://git-wip-us.apache.org/repos/asf/drill/blob/c8e1e6b2/_docs/sql-ref/functions/006-nulls.md ---------------------------------------------------------------------- diff --git a/_docs/sql-ref/functions/006-nulls.md b/_docs/sql-ref/functions/006-nulls.md index 9041e49..bc98b63 100644 --- a/_docs/sql-ref/functions/006-nulls.md +++ b/_docs/sql-ref/functions/006-nulls.md @@ -34,23 +34,23 @@ This function returns the same type as the first expression. ### Example -SELECT d9, d18 FROM alltypes LIMIT 1; -+------------+------------+ -| d9 | d18 | -+------------+------------+ -| 1032.65 | 1032.6516 | -+------------+------------+ -1 row selected (0.081 seconds) - -SELECT NULLIF(d9, d18) FROM alltypes limit 1; -+------------+ -| EXPR$0 | -+------------+ -| 1032.65 | -+------------+ -1 row selected (0.079 seconds) - -SELECT NULLIF(d9, d9) FROM alltypes limit 1; -+------------+ -| EXPR$0 | -+------------+ \ No newline at end of file + SELECT d9, d18 FROM alltypes LIMIT 1; + +------------+------------+ + | d9 | d18 | + +------------+------------+ + | 1032.65 | 1032.6516 | + +------------+------------+ + 1 row selected (0.081 seconds) + + SELECT NULLIF(d9, d18) FROM alltypes limit 1; + +------------+ + | EXPR$0 | + +------------+ + | 1032.65 | + +------------+ + 1 row selected (0.079 seconds) + + SELECT NULLIF(d9, d9) FROM alltypes limit 1; + +------------+ + | EXPR$0 | + +------------+ \ No newline at end of file