drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bridg...@apache.org
Subject drill git commit: minor edit
Date Fri, 30 Oct 2015 23:27:52 GMT
Repository: drill
Updated Branches:
  refs/heads/gh-pages 6e5a2f93d -> 6b234a9b2


minor edit

typos, add direct to drillbit connection

add example of flatten

formatting


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/6b234a9b
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/6b234a9b
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/6b234a9b

Branch: refs/heads/gh-pages
Commit: 6b234a9b20d6b9bcf0d69f8131fbbb7bb9439042
Parents: 6e5a2f9
Author: Kristine Hahn <khahn@maprtech.com>
Authored: Tue Oct 27 16:34:06 2015 -0700
Committer: Kristine Hahn <khahn@maprtech.com>
Committed: Fri Oct 30 16:08:51 2015 -0700

----------------------------------------------------------------------
 .../050-json-data-model.md                            | 14 ++++++++++++--
 .../install/050-starting-drill-in-distributed-mode.md | 11 +++++++++++
 .../sql-reference/sql-functions/010-math-and-trig.md  |  2 +-
 3 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/6b234a9b/_docs/data-sources-and-file-formats/050-json-data-model.md
----------------------------------------------------------------------
diff --git a/_docs/data-sources-and-file-formats/050-json-data-model.md b/_docs/data-sources-and-file-formats/050-json-data-model.md
index b7c0b91..5c2147b 100644
--- a/_docs/data-sources-and-file-formats/050-json-data-model.md
+++ b/_docs/data-sources-and-file-formats/050-json-data-model.md
@@ -12,7 +12,7 @@ Semi-structured JSON data often consists of complex, nested elements having
sche
 
 Using Drill you can natively query dynamic JSON data sets using SQL. Drill treats a JSON
object as a SQL record. One object equals one row in a Drill table.
 
-You can also [query compressed .gz files]({{ site.baseurl }}/docs/querying-plain-text-files/#querying-compressed-files)
having JSON as well as uncompressed .json files.
+You can also [query compressed .gz JSON files]({{ site.baseurl }}/docs/querying-plain-text-files/#querying-compressed-files).
 
 In addition to the examples presented later in this section, see ["How to Analyze Highly
Dynamic Datasets with Apache Drill"](https://www.mapr.com/blog/how-analyze-highly-dynamic-datasets-apache-drill)
for information about how to analyze a JSON data set.
 
@@ -70,7 +70,17 @@ Drill reads tuples defined in single objects, having no comma between objects.
A
     { name: "Apples", desc: "Delicious" }
     { name: "Oranges", desc: "Florida Navel" }
 
-To read and [analyze complex JSON]({{ site.baseurl }}/docs/json-data-model#analyzing-json)
files, use the FLATTEN and KVGEN functions.
+To read and [analyze complex JSON]({{ site.baseurl }}/docs/json-data-model#analyzing-json)
files, use the FLATTEN and KVGEN functions. For example, you need to flatten the data to read
all the names in this JSON file:
+
+     {"Fruits: [{"name":"Apples", "quantity":115},
+                {"name":"Oranges","quantity":199},
+                {"name":"Peaches", "quantity":116}
+               ]
+     }
+
+To flatten the data and read the names, use a subquery that flattens the complex nesting.
Use table aliases, t and flatdata, to resolve ambiguities.
+
+     SELECT t.flatdata.name FROM (select flatten(Fruits) AS flatdata FROM dfs.`/Users/path/fruits.json`)
t;
 
 ## Writing JSON
 You can write data from Drill to a JSON file. The following setup is required:

http://git-wip-us.apache.org/repos/asf/drill/blob/6b234a9b/_docs/install/050-starting-drill-in-distributed-mode.md
----------------------------------------------------------------------
diff --git a/_docs/install/050-starting-drill-in-distributed-mode.md b/_docs/install/050-starting-drill-in-distributed-mode.md
index 56e0cfc..9bdae82 100644
--- a/_docs/install/050-starting-drill-in-distributed-mode.md
+++ b/_docs/install/050-starting-drill-in-distributed-mode.md
@@ -65,6 +65,17 @@ The following command starts the Drill shell in a cluster configured to
run ZooK
 
 `bin/sqlline –u jdbc:drill:zk=cento23,zk=centos24,zk=centos26:5181`
 
+## Making a Direct Drillbit Connection
+
+If you want to connect directly to a Drillbit instead of using ZooKeeper to choose the Drillbit,
replace `zk=<zk name>` with `drillbit=<node>` as shown in the following URL.
+
+`jdbc:drill:[schema=<storage plugin>;]drillbit=<node name>[:<port>][,<node
name2>[:<port>]... `  
+  `]<directory>/<cluster ID>`
+
+where
+
+`drillbit=<node name>` specifies one or more host names or IP addresses of cluster
nodes running Drill. 
+
 ## Exiting the Drill Shell
 
 To exit the Drill shell, issue the following command:

http://git-wip-us.apache.org/repos/asf/drill/blob/6b234a9b/_docs/sql-reference/sql-functions/010-math-and-trig.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-functions/010-math-and-trig.md b/_docs/sql-reference/sql-functions/010-math-and-trig.md
index ec9c168..bcec990 100644
--- a/_docs/sql-reference/sql-functions/010-math-and-trig.md
+++ b/_docs/sql-reference/sql-functions/010-math-and-trig.md
@@ -37,7 +37,7 @@ Exceptions are the LSHIFT and RSHIFT functions, which take all types except
FLOA
 | RADIANS      | FLOAT8        | Converts x degress to radians.                         
                  |
 | RAND         | FLOAT8        | Returns a random number from 0-1.                      
                  |
 | ROUND(x)     | Same as input | Rounds to the nearest integer.                         
                  |
-| ROUND(x, y)  | DECIMAL       | Rounds x to s decimal places.                          
                  |
+| ROUND(x, y)  | DECIMAL       | Rounds x to y decimal places.                          
                  |
 | RSHIFT(x, y) | Same as input | Shifts the binary x by y times to the right.           
                  |
 | SIGN(x)      | INT           | Returns the sign of x.                                 
                  |
 | SQRT(x)      | Same as input | Returns the square root of x.                          
                  |


Mime
View raw message