drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bridg...@apache.org
Subject [5/5] drill git commit: 1.1 update
Date Wed, 01 Jul 2015 01:33:27 GMT
1.1 update

fix cosmetics

DRILL-3438

Bridget's 1.1 updates


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

Branch: refs/heads/gh-pages
Commit: 3a9872370100d7145d41d97c10b99d3ca99fb990
Parents: 951a7b2
Author: Kristine Hahn <khahn@maprtech.com>
Authored: Tue Jun 30 16:14:45 2015 -0700
Committer: Kristine Hahn <khahn@maprtech.com>
Committed: Tue Jun 30 18:29:12 2015 -0700

----------------------------------------------------------------------
 _data/docs.json                                 | 284 +++++++++++++++++--
 ...ser-impersonation-with-hive-authorization.md | 227 +++++++++++++++
 ...ser-impersonation-with-hive-authorization.md |  15 -
 _docs/getting-started/010-drill-introduction.md |   8 +
 _docs/img/18.png                                | Bin 66175 -> 65920 bytes
 ...0-using-tibco-spotfire-desktop-with-drill.md |  10 +-
 .../sql-commands/080-select-list.md             |   2 +-
 .../010-sql-window-functions-introduction.md    | 183 ++++++++++++
 .../020-aggregate-window-functions.md           | 186 ++++++++++++
 .../030-ranking-window-functions.md             | 152 ++++++++++
 .../040-sql-window-functions-examples.md        |  92 ++++++
 11 files changed, 1121 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_data/docs.json
----------------------------------------------------------------------
diff --git a/_data/docs.json b/_data/docs.json
index 8a8b834..819b1f2 100644
--- a/_data/docs.json
+++ b/_data/docs.json
@@ -135,6 +135,27 @@
             "title": "Adding Custom Functions to Drill", 
             "url": "/docs/adding-custom-functions-to-drill/"
         }, 
+        "Aggregate Window Functions": {
+            "breadcrumbs": [
+                {
+                    "title": "SQL Window Functions", 
+                    "url": "/docs/sql-window-functions/"
+                }, 
+                {
+                    "title": "SQL Reference", 
+                    "url": "/docs/sql-reference/"
+                }
+            ], 
+            "children": [], 
+            "next_title": "Ranking Window Functions", 
+            "next_url": "/docs/ranking-window-functions/", 
+            "parent": "SQL Window Functions", 
+            "previous_title": "SQL Window Functions Introduction", 
+            "previous_url": "/docs/sql-window-functions-introduction/", 
+            "relative_path": "_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md", 
+            "title": "Aggregate Window Functions", 
+            "url": "/docs/aggregate-window-functions/"
+        }, 
         "Aggregate and Aggregate Statistical": {
             "breadcrumbs": [
                 {
@@ -940,7 +961,7 @@
                     "parent": "Configure Drill", 
                     "previous_title": "Configuring User Authentication", 
                     "previous_url": "/docs/configuring-user-authentication/", 
-                    "relative_path": "_docs/configure-drill/077-configuring-user-impersonation-with-hive-authorization.md", 
+                    "relative_path": "_docs/configure-drill/076-configuring-user-impersonation-with-hive-authorization.md", 
                     "title": "Configuring User Impersonation with Hive Authorization", 
                     "url": "/docs/configuring-user-impersonation-with-hive-authorization/"
                 }, 
@@ -1441,7 +1462,7 @@
             "parent": "Configure Drill", 
             "previous_title": "Configuring User Authentication", 
             "previous_url": "/docs/configuring-user-authentication/", 
-            "relative_path": "_docs/configure-drill/077-configuring-user-impersonation-with-hive-authorization.md", 
+            "relative_path": "_docs/configure-drill/076-configuring-user-impersonation-with-hive-authorization.md", 
             "title": "Configuring User Impersonation with Hive Authorization", 
             "url": "/docs/configuring-user-impersonation-with-hive-authorization/"
         }, 
@@ -4899,8 +4920,8 @@
             "next_title": "Nested Data Limitations", 
             "next_url": "/docs/nested-data-limitations/", 
             "parent": "SQL Reference", 
-            "previous_title": "SQL Window Functions Introduction", 
-            "previous_url": "/docs/sql-window-functions-introduction/", 
+            "previous_title": "SQL Window Functions Examples", 
+            "previous_url": "/docs/sql-window-functions-examples/", 
             "relative_path": "_docs/sql-reference/060-nested-data-functions.md", 
             "title": "Nested Data Functions", 
             "url": "/docs/nested-data-functions/"
@@ -7430,6 +7451,27 @@
             "title": "RPC Overview", 
             "url": "/docs/rpc-overview/"
         }, 
+        "Ranking Window Functions": {
+            "breadcrumbs": [
+                {
+                    "title": "SQL Window Functions", 
+                    "url": "/docs/sql-window-functions/"
+                }, 
+                {
+                    "title": "SQL Reference", 
+                    "url": "/docs/sql-reference/"
+                }
+            ], 
+            "children": [], 
+            "next_title": "SQL Window Functions Examples", 
+            "next_url": "/docs/sql-window-functions-examples/", 
+            "parent": "SQL Window Functions", 
+            "previous_title": "Aggregate Window Functions", 
+            "previous_url": "/docs/aggregate-window-functions/", 
+            "relative_path": "_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md", 
+            "title": "Ranking Window Functions", 
+            "url": "/docs/ranking-window-functions/"
+        }, 
         "Release Notes": {
             "breadcrumbs": [], 
             "children": [
@@ -8798,14 +8840,77 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "Nested Data Functions", 
-                            "next_url": "/docs/nested-data-functions/", 
+                            "next_title": "Aggregate Window Functions", 
+                            "next_url": "/docs/aggregate-window-functions/", 
                             "parent": "SQL Window Functions", 
                             "previous_title": "SQL Window Functions", 
                             "previous_url": "/docs/sql-window-functions/", 
                             "relative_path": "_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md", 
                             "title": "SQL Window Functions Introduction", 
                             "url": "/docs/sql-window-functions-introduction/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Window Functions", 
+                                    "url": "/docs/sql-window-functions/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "Ranking Window Functions", 
+                            "next_url": "/docs/ranking-window-functions/", 
+                            "parent": "SQL Window Functions", 
+                            "previous_title": "SQL Window Functions Introduction", 
+                            "previous_url": "/docs/sql-window-functions-introduction/", 
+                            "relative_path": "_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md", 
+                            "title": "Aggregate Window Functions", 
+                            "url": "/docs/aggregate-window-functions/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Window Functions", 
+                                    "url": "/docs/sql-window-functions/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "SQL Window Functions Examples", 
+                            "next_url": "/docs/sql-window-functions-examples/", 
+                            "parent": "SQL Window Functions", 
+                            "previous_title": "Aggregate Window Functions", 
+                            "previous_url": "/docs/aggregate-window-functions/", 
+                            "relative_path": "_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md", 
+                            "title": "Ranking Window Functions", 
+                            "url": "/docs/ranking-window-functions/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Window Functions", 
+                                    "url": "/docs/sql-window-functions/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "Nested Data Functions", 
+                            "next_url": "/docs/nested-data-functions/", 
+                            "parent": "SQL Window Functions", 
+                            "previous_title": "Ranking Window Functions", 
+                            "previous_url": "/docs/ranking-window-functions/", 
+                            "relative_path": "_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md", 
+                            "title": "SQL Window Functions Examples", 
+                            "url": "/docs/sql-window-functions-examples/"
                         }
                     ], 
                     "next_title": "SQL Window Functions Introduction", 
@@ -8934,8 +9039,8 @@
                     "next_title": "Nested Data Limitations", 
                     "next_url": "/docs/nested-data-limitations/", 
                     "parent": "SQL Reference", 
-                    "previous_title": "SQL Window Functions Introduction", 
-                    "previous_url": "/docs/sql-window-functions-introduction/", 
+                    "previous_title": "SQL Window Functions Examples", 
+                    "previous_url": "/docs/sql-window-functions-examples/", 
                     "relative_path": "_docs/sql-reference/060-nested-data-functions.md", 
                     "title": "Nested Data Functions", 
                     "url": "/docs/nested-data-functions/"
@@ -9599,14 +9704,77 @@
                         }
                     ], 
                     "children": [], 
-                    "next_title": "Nested Data Functions", 
-                    "next_url": "/docs/nested-data-functions/", 
+                    "next_title": "Aggregate Window Functions", 
+                    "next_url": "/docs/aggregate-window-functions/", 
                     "parent": "SQL Window Functions", 
                     "previous_title": "SQL Window Functions", 
                     "previous_url": "/docs/sql-window-functions/", 
                     "relative_path": "_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md", 
                     "title": "SQL Window Functions Introduction", 
                     "url": "/docs/sql-window-functions-introduction/"
+                }, 
+                {
+                    "breadcrumbs": [
+                        {
+                            "title": "SQL Window Functions", 
+                            "url": "/docs/sql-window-functions/"
+                        }, 
+                        {
+                            "title": "SQL Reference", 
+                            "url": "/docs/sql-reference/"
+                        }
+                    ], 
+                    "children": [], 
+                    "next_title": "Ranking Window Functions", 
+                    "next_url": "/docs/ranking-window-functions/", 
+                    "parent": "SQL Window Functions", 
+                    "previous_title": "SQL Window Functions Introduction", 
+                    "previous_url": "/docs/sql-window-functions-introduction/", 
+                    "relative_path": "_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md", 
+                    "title": "Aggregate Window Functions", 
+                    "url": "/docs/aggregate-window-functions/"
+                }, 
+                {
+                    "breadcrumbs": [
+                        {
+                            "title": "SQL Window Functions", 
+                            "url": "/docs/sql-window-functions/"
+                        }, 
+                        {
+                            "title": "SQL Reference", 
+                            "url": "/docs/sql-reference/"
+                        }
+                    ], 
+                    "children": [], 
+                    "next_title": "SQL Window Functions Examples", 
+                    "next_url": "/docs/sql-window-functions-examples/", 
+                    "parent": "SQL Window Functions", 
+                    "previous_title": "Aggregate Window Functions", 
+                    "previous_url": "/docs/aggregate-window-functions/", 
+                    "relative_path": "_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md", 
+                    "title": "Ranking Window Functions", 
+                    "url": "/docs/ranking-window-functions/"
+                }, 
+                {
+                    "breadcrumbs": [
+                        {
+                            "title": "SQL Window Functions", 
+                            "url": "/docs/sql-window-functions/"
+                        }, 
+                        {
+                            "title": "SQL Reference", 
+                            "url": "/docs/sql-reference/"
+                        }
+                    ], 
+                    "children": [], 
+                    "next_title": "Nested Data Functions", 
+                    "next_url": "/docs/nested-data-functions/", 
+                    "parent": "SQL Window Functions", 
+                    "previous_title": "Ranking Window Functions", 
+                    "previous_url": "/docs/ranking-window-functions/", 
+                    "relative_path": "_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md", 
+                    "title": "SQL Window Functions Examples", 
+                    "url": "/docs/sql-window-functions-examples/"
                 }
             ], 
             "next_title": "SQL Window Functions Introduction", 
@@ -9618,7 +9786,7 @@
             "title": "SQL Window Functions", 
             "url": "/docs/sql-window-functions/"
         }, 
-        "SQL Window Functions Introduction": {
+        "SQL Window Functions Examples": {
             "breadcrumbs": [
                 {
                     "title": "SQL Window Functions", 
@@ -9633,6 +9801,27 @@
             "next_title": "Nested Data Functions", 
             "next_url": "/docs/nested-data-functions/", 
             "parent": "SQL Window Functions", 
+            "previous_title": "Ranking Window Functions", 
+            "previous_url": "/docs/ranking-window-functions/", 
+            "relative_path": "_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md", 
+            "title": "SQL Window Functions Examples", 
+            "url": "/docs/sql-window-functions-examples/"
+        }, 
+        "SQL Window Functions Introduction": {
+            "breadcrumbs": [
+                {
+                    "title": "SQL Window Functions", 
+                    "url": "/docs/sql-window-functions/"
+                }, 
+                {
+                    "title": "SQL Reference", 
+                    "url": "/docs/sql-reference/"
+                }
+            ], 
+            "children": [], 
+            "next_title": "Aggregate Window Functions", 
+            "next_url": "/docs/aggregate-window-functions/", 
+            "parent": "SQL Window Functions", 
             "previous_title": "SQL Window Functions", 
             "previous_url": "/docs/sql-window-functions/", 
             "relative_path": "_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md", 
@@ -11905,7 +12094,7 @@
                     "parent": "Configure Drill", 
                     "previous_title": "Configuring User Authentication", 
                     "previous_url": "/docs/configuring-user-authentication/", 
-                    "relative_path": "_docs/configure-drill/077-configuring-user-impersonation-with-hive-authorization.md", 
+                    "relative_path": "_docs/configure-drill/076-configuring-user-impersonation-with-hive-authorization.md", 
                     "title": "Configuring User Impersonation with Hive Authorization", 
                     "url": "/docs/configuring-user-impersonation-with-hive-authorization/"
                 }, 
@@ -13985,14 +14174,77 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "Nested Data Functions", 
-                            "next_url": "/docs/nested-data-functions/", 
+                            "next_title": "Aggregate Window Functions", 
+                            "next_url": "/docs/aggregate-window-functions/", 
                             "parent": "SQL Window Functions", 
                             "previous_title": "SQL Window Functions", 
                             "previous_url": "/docs/sql-window-functions/", 
                             "relative_path": "_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md", 
                             "title": "SQL Window Functions Introduction", 
                             "url": "/docs/sql-window-functions-introduction/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Window Functions", 
+                                    "url": "/docs/sql-window-functions/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "Ranking Window Functions", 
+                            "next_url": "/docs/ranking-window-functions/", 
+                            "parent": "SQL Window Functions", 
+                            "previous_title": "SQL Window Functions Introduction", 
+                            "previous_url": "/docs/sql-window-functions-introduction/", 
+                            "relative_path": "_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md", 
+                            "title": "Aggregate Window Functions", 
+                            "url": "/docs/aggregate-window-functions/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Window Functions", 
+                                    "url": "/docs/sql-window-functions/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "SQL Window Functions Examples", 
+                            "next_url": "/docs/sql-window-functions-examples/", 
+                            "parent": "SQL Window Functions", 
+                            "previous_title": "Aggregate Window Functions", 
+                            "previous_url": "/docs/aggregate-window-functions/", 
+                            "relative_path": "_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md", 
+                            "title": "Ranking Window Functions", 
+                            "url": "/docs/ranking-window-functions/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Window Functions", 
+                                    "url": "/docs/sql-window-functions/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "Nested Data Functions", 
+                            "next_url": "/docs/nested-data-functions/", 
+                            "parent": "SQL Window Functions", 
+                            "previous_title": "Ranking Window Functions", 
+                            "previous_url": "/docs/ranking-window-functions/", 
+                            "relative_path": "_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md", 
+                            "title": "SQL Window Functions Examples", 
+                            "url": "/docs/sql-window-functions-examples/"
                         }
                     ], 
                     "next_title": "SQL Window Functions Introduction", 
@@ -14121,8 +14373,8 @@
                     "next_title": "Nested Data Limitations", 
                     "next_url": "/docs/nested-data-limitations/", 
                     "parent": "SQL Reference", 
-                    "previous_title": "SQL Window Functions Introduction", 
-                    "previous_url": "/docs/sql-window-functions-introduction/", 
+                    "previous_title": "SQL Window Functions Examples", 
+                    "previous_url": "/docs/sql-window-functions-examples/", 
                     "relative_path": "_docs/sql-reference/060-nested-data-functions.md", 
                     "title": "Nested Data Functions", 
                     "url": "/docs/nested-data-functions/"

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/configure-drill/076-configuring-user-impersonation-with-hive-authorization.md
----------------------------------------------------------------------
diff --git a/_docs/configure-drill/076-configuring-user-impersonation-with-hive-authorization.md b/_docs/configure-drill/076-configuring-user-impersonation-with-hive-authorization.md
new file mode 100644
index 0000000..d69cb9f
--- /dev/null
+++ b/_docs/configure-drill/076-configuring-user-impersonation-with-hive-authorization.md
@@ -0,0 +1,227 @@
+---
+title: "Configuring User Impersonation with Hive Authorization"
+parent: "Configure Drill"
+---
+As of Drill 1.1, you can enable impersonation in Drill and configure authorization in Hive version 1.0 to authorize access to metadata in the Hive metastore repository and data in the Hive warehouse. Impersonation allows a service to act on behalf of a client while performing the action requested by the client. See [Configuring User Impersonation]({{site.baseurl}}/docs/configuring-user-impersonation).
+
+There are two types of Hive authorizations that you can configure to work with impersonation in Drill: SQL standard based or storage based authorization.
+
+
+## Storage Based Authorization  
+  
+You can configure Hive storage-based authorization in Hive version 1.0 to work with impersonation in Drill 1.1. Hive storage-based authorization is a remote metastore server security feature that uses the underlying file system permissions to determine permissions on databases, tables, and partitions. The unit style read/write permissions or ACLs a user or group has on directories in the file system determine access to data. Because the file system controls access at the directory and file level, storage-based authorization cannot control access to data at the column or view level.
+
+You manage user and group privileges through permissions and ACLs in the distributed file system. You manage authorizations through the remote metastore server.
+
+DDL statements that manage permissions, such as GRANT and REVOKE, do not have any effect on permissions in the storage based authorization model.
+
+For more information, see [Storage Based Authorization in the Metastore Server](https://cwiki.apache.org/confluence/display/Hive/Storage+Based+Authorization+in+the+Metastore+Server).  
+
+## SQL Standard Based Authorization  
+
+You can configure Hive SQL standard based authorization in Hive version 1.0 to work with Drill impersonation. The SQL standard based authorization model can control which users have access to columns, rows, and views. Users with the appropriate permissions can issue the GRANT and REVOKE statements to manage privileges from Hive.
+
+For more information, see [SQL Standard Based Hive Authorization](https://cwiki.apache.org/confluence/display/HELIX/SQL+Standard+Based+Hive+Authorization).  
+
+
+## Configuration  
+
+Once you determine which type of Hive authorization model that you want to use, enable impersonation in Drill. Update hive-site.xml with the relevant parameters for the type of authorization that you have decided to implement. Modify the Hive storage plugin instance in Drill with the relevant settings for the type of authorization.  
+
+### Prerequisites  
+
+* Hive 1.0 installed
+* Drill 1.1 installed
+* Hive remote metastore repository configured  
+
+## Step 1: Enabling Drill Impersonation  
+
+Complete the following steps on each Drillbit node to enable user impersonation, and set the [maximum number of chained user hops]({{site.baseurl}}/docs/configuring-user-impersonation/#chained-impersonation) that Drill allows:  
+
+1. Navigate to `<drill_installation_directory>/conf/` and edit `drill-override.conf`.
+2. Under `drill.exe`, add the following:
+
+          drill.exec.impersonation: {
+                enabled: true,
+                 max_chained_user_hops: 3
+          }
+
+3. Verify that enabled is set to `‘true’`.
+4. Set the maximum number of chained user hops that you want Drill to allow.
+5. (MapR clusters only) Add the following lines to the `drill-env.sh` file:
+   * If the underlying file system is not secure, add the following line:
+   ` export MAPR_IMPERSONATION_ENABLED=true`
+   * If the underlying file system has MapR security enabled, add the following line:
+    `export MAPR_TICKETFILE_LOCATION=/opt/mapr/conf/mapruserticket`  
+   * If you are implementing Hive SQL standard based authorization, and you are running Drill     and Hive in a secure MapR cluster, add the following lines:  
+        `export DRILLBIT_JAVA_OPTS="$DRILLBIT_JAVA_OPTS -Dmapr_sec_enabled=true -Dhadoop.login=maprsasl -Dzookeeper.saslprovider=com.mapr.security.maprsasl.MaprSaslProvider -Dmapr.library.flatclass"`  
+       `export MAPR_IMPERSONATION_ENABLED=true`  
+       `export MAPR_TICKETFILE_LOCATION=/opt/mapr/conf/mapruserticket`
+
+6. Restart the Drillbit process on each Drill node.
+   * In a MapR cluster, run the following command:
+    `maprcli node services -name drill-bits -action restart -nodes <hostname> -f`
+   * In a non-MapR environment, run the following command:  
+     `<DRILLINSTALL_HOME>/bin/drillbit.sh restart`  
+
+##  Step 2:  Updating hive-site.xml  
+
+Update hive-site.xml with the parameters specific to the type of authorization that you are configuring and then restart Hive.  
+
+### Storage Based Authorization  
+
+Add the required parameters to the hive-site.xml file to configure storage based authentication.  
+
+The following table lists the required authorization parameters and their descriptions:  
+
+| Property                                         | Value                                                                                      | Description                                                                                                                                                                                                                                                                                                    |
+|--------------------------------------------------|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| hive.metastore.pre.event.listeners               | Set to: org.apache.hadoop.hive.ql.security.authorization.AuthorizationPreEventListener     | Turns on metastore-side security.                                                                                                                                                                                                                                                                              |
+| hive.security.metastore.authorization.manager    | Set to: org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider | Tells Hive which metastore-side authorization provider to use. The default setting uses DefaultHiveMetastoreAuthorizationProvider, which implements the standard Hive grant/revoke model. To use an HDFS permission-based model (recommended) to do your authorization, use StorageBasedAuthorizationProvider. |
+| hive.security.metastore.authenticator.manager    | Set to:org.apache.hadoop.hive.ql.security.HadoopDefaultMetastoreAuthenticator              | The authenticator manager class name in the metastore for authentication.                                                                                                                                                                                                                                      |
+| hive.security.metastore.authorization.auth.reads | Set to “true”.                                                                             | Tells Hive metastore authorization checks for read access.                                                                                                                                                                                                                                                     |
+| hive.metastore.execute.setugi                    | Set to “true”.                                                                             | Causes the metastore to execute file system operations using the client's reported user and group permissions. You must set this property on both the client and server sides. If client sets it to true and server sets it to false, the client setting is ignored.                                           |
+| hive.server2.enable.doAs                         | Set to “true”.                                                                             | Tells HiveServer2 to execute Hive operations as the user making the calls.                                                                                                                                                                                                                                     |  
+
+### Example hive-site.xml Settings for Storage Based Authorization  
+
+       <property>
+          <name>hive.metastore.pre.event.listeners</name>
+          <value>org.apache.hadoop.hive.ql.security.authorization.AuthorizationPreEventListener</value>
+        </property>
+        
+        <property>
+          <name>hive.security.metastore.authenticator.manager</name>
+          <value>org.apache.hadoop.hive.ql.security.HadoopDefaultMetastoreAuthenticator</value>
+        </property>
+        
+        <property>
+          <name>hive.security.metastore.authorization.manager</name>
+          <value>org.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider</value>
+        </property>
+        
+        <property>
+          <name>hive.security.metastore.authorization.auth.reads</name>
+          <value>true</value>
+        </property>
+        
+        <property>
+          <name>hive.metastore.execute.setugi</name>
+          <value>true</value>
+        </property>
+        
+        <property>
+          <name>hive.server2.enable.doAs</name>
+          <value>true</value>
+        </property>  
+
+## SQL Standard Based Authorization  
+
+Add the required parameters to the hive-site.xml file to configure SQL standard based authorization.  
+
+The following table lists the required authorization parameters and their descriptions:  
+
+| Property                            | Value                                                                                             | Description                                                                                                                                                                                                                                                                                                                  |
+|-------------------------------------|---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| hive.security.authorization.enabled | Set to true.                                                                                      | Enables/disables Hive security authorization.                                                                                                                                                                                                                                                                                |
+| hive.security.authenticator.manager | Set to:org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator                           | Class that implements HiveAuthenticationProvider to provide the client’s username and groups.                                                                                                                                                                                                                                |
+| hive.security.authorization.manager | Set to:org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory | The Hive client authorization manager class name.                                                                                                                                                                                                                                                                            |
+| hive.server2.enable.doAs            | Set to false.                                                                                     | Tells HiveServer2 to execute Hive operations as the user making the calls.                                                                                                                                                                                                                                                   |
+| hive.users.in.admin.role            | Set to the list of comma-separated users who need to be added to the admin role.                  | A comma separated list of users which gets added to the ADMIN role when the metastore starts up. You can add more uses at any time. Note that a user who belongs to the admin role needs to run the "set role" command before getting the privileges of the admin role, as this role is not in the current roles by default. |
+| hive.metastore.execute.setugi       | Set to false.                                                                                     | Causes the metastore to execute file system operations using the client's reported user and group permissions. You must set this property on both the client and server sides. If client sets it to true and server sets it to false, the client setting is ignored.                                                         |  
+
+### Example hive-site.xml Settings for SQL Standard Based Authorization   
+
+       <property>
+          <name>hive.security.authorization.enabled</name>
+          <value>true</value>
+        </property>
+        
+        <property>
+          <name>hive.security.authenticator.manager</name>
+          <value>org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator</value>
+        </property>
+        
+        <property>
+          <name>hive.security.authorization.manager</name>   
+          <value>org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory</value>
+        </property>
+        
+        <property>
+          <name>hive.server2.enable.doAs</name>
+          <value>false</value>
+        </property>
+        
+        <property>
+          <name>hive.users.in.admin.role</name>
+          <value>userA</value>
+        </property>
+        
+        <property>
+          <name>hive.metastore.execute.setugi</name>
+          <value>false</value>
+        </property>  
+
+## Step 3: Modifying the Hive Storage Plugin  
+
+Modify the Hive storage plugin instance in the Drill Web UI to include specific authorization settings. The Drillbit that you use to access the Web UI must be running. 
+
+Note: The metastore host port for MapR is typically 9083.  
+
+Complete the following steps to modify the Hive storage plugin:  
+
+1.  Navigate to http://<drillbit_hostname>:8047, and select the Storage tab.  
+2.  Click Update next to the hive instance.  
+3.  In the configuration window, add the configuration settings for the authorization type.  
+       * For storage based authorization, add the following settings:  
+
+              {
+               type:"hive",
+               enabled: true,
+               configProps : {
+                 "hive.metastore.uris" : "thrift://<metastore_host>:<port>",
+                 "fs.default.name" : "hdfs://<host>:<port>/",
+                 "hive.metastore.sasl.enabled" : "false",
+                 "hive.server2.enable.doAs" : "true",
+                 "hive.metastore.execute.setugi" : "true"
+               }
+              }  
+
+       * For SQL standard based authorization, add the following settings:  
+
+              {
+               type:"hive",
+               enabled: true,
+               configProps : {
+                 "hive.metastore.uris"
+              : "thrift://<metastore_host>:<port>",
+                 "fs.default.name"
+              : "hdfs://<host>:<port>/",
+                 "hive.security.authorization.enabled"
+              : "true",
+                 "hive.security.authenticator.manager"
+              : "org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator",
+                 "hive.security.authorization.manager"
+              :
+              "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory",
+                 "hive.metastore.sasl.enabled"
+              : "false",
+                 "hive.server2.enable.doAs"
+              : "false",
+                 "hive.metastore.execute.setugi"
+              : "false"
+               }
+              }
+
+
+
+
+
+
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/configure-drill/077-configuring-user-impersonation-with-hive-authorization.md
----------------------------------------------------------------------
diff --git a/_docs/configure-drill/077-configuring-user-impersonation-with-hive-authorization.md b/_docs/configure-drill/077-configuring-user-impersonation-with-hive-authorization.md
deleted file mode 100755
index d3b3377..0000000
--- a/_docs/configure-drill/077-configuring-user-impersonation-with-hive-authorization.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: "Configuring User Impersonation with Hive Authorization"
-parent: "Configure Drill"
----
-
-
-
-
-
-
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/getting-started/010-drill-introduction.md
----------------------------------------------------------------------
diff --git a/_docs/getting-started/010-drill-introduction.md b/_docs/getting-started/010-drill-introduction.md
index 770b5ad..68a0ae7 100644
--- a/_docs/getting-started/010-drill-introduction.md
+++ b/_docs/getting-started/010-drill-introduction.md
@@ -9,6 +9,14 @@ applications, while still providing the familiarity and ecosystem of ANSI SQL,
 the industry-standard query language. Drill provides plug-and-play integration
 with existing Apache Hive and Apache HBase deployments. 
 
+## What's New in Apache Drill 1.1
+
+Many enhancements in Apache Drill 1.1 include the following key features:
+
+* [SQL window functions]({{site.baseurl}}/docs/sql-window-functions)
+* [Automatic partitioning]({{site.baseurl}}) using the new [PARTITION BY]({{site.baseurl}}/docs/partition-by-clause) clause in the CTAS command
+* [User impersonation with Hive authorization](({{site.baseurl}})
+
 ## What's New in Apache Drill 1.0
 
 Apache Drill 1.0 offers the following new features:

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/img/18.png
----------------------------------------------------------------------
diff --git a/_docs/img/18.png b/_docs/img/18.png
index ebc7d81..a0ecc25 100644
Binary files a/_docs/img/18.png and b/_docs/img/18.png differ

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/odbc-jdbc-interfaces/using-drill-with-bi-tools/040-using-tibco-spotfire-desktop-with-drill.md
----------------------------------------------------------------------
diff --git a/_docs/odbc-jdbc-interfaces/using-drill-with-bi-tools/040-using-tibco-spotfire-desktop-with-drill.md b/_docs/odbc-jdbc-interfaces/using-drill-with-bi-tools/040-using-tibco-spotfire-desktop-with-drill.md
index 6f991de..62bed9f 100755
--- a/_docs/odbc-jdbc-interfaces/using-drill-with-bi-tools/040-using-tibco-spotfire-desktop-with-drill.md
+++ b/_docs/odbc-jdbc-interfaces/using-drill-with-bi-tools/040-using-tibco-spotfire-desktop-with-drill.md
@@ -18,12 +18,10 @@ Drill uses standard ODBC connectivity to provide easy data exploration capabilit
 
 Complete the following steps to install and configure the driver:
 
-1.    Download the 64-bit MapR Drill ODBC Driver for Windows from the following location:<br> [http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/](http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/)     
-**Note:** Spotfire Desktop 6.5.1 utilizes the 64-bit ODBC driver.
-2.    Complete steps 2-8 under on the following page to install the driver:<br> 
-[http://drill.apache.org/docs/step-1-install-the-mapr-drill-odbc-driver-on-windows/](http://drill.apache.org/docs/step-1-install-the-mapr-drill-odbc-driver-on-windows/)
-3.    Complete the steps on the following page to configure the driver:<br>
-[http://drill.apache.org/docs/step-2-configure-odbc-connections-to-drill-data-sources/](http://drill.apache.org/docs/step-2-configure-odbc-connections-to-drill-data-sources/)
+1. Download the 64-bit MapR Drill ODBC Driver for Windows from the following location:<br> [http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/](http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/)     
+   {% include startnote.html %}Spotfire Desktop 6.5.1 utilizes the 64-bit ODBC driver.{% include endnote.html %}
+2. [Install the driver]({{site.baseurl}}/docs/installing-the-driver-on-windows). 
+3. [Configure ODBC]({{site.baseurl}}/docs/configuring-odbc-on-windows).
 
 ----------
 

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/sql-reference/sql-commands/080-select-list.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/080-select-list.md b/_docs/sql-reference/sql-commands/080-select-list.md
old mode 100755
new mode 100644
index e5d0cac..fc9500d
--- a/_docs/sql-reference/sql-commands/080-select-list.md
+++ b/_docs/sql-reference/sql-commands/080-select-list.md
@@ -9,7 +9,7 @@ The SELECT list names the columns, functions, and expressions that you want the
 
 The SELECT list supports the following syntax:  
 
-       SELECT  [ DISTINCT ] columns[n] | * | expression [ AS column_alias ] [, ...]  
+       SELECT  [ DISTINCT ] COLUMNS[n] | * | expression [ AS column_alias ] [, ...]  
 
 ## Parameters
 COLUMNS[*n*]  

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md b/_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md
index cd2426a..f8f372f 100644
--- a/_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md
+++ b/_docs/sql-reference/sql-window-functions/010-sql-window-functions-introduction.md
@@ -2,3 +2,186 @@
 title: "SQL Window Functions Introduction"
 parent: "SQL Window Functions"
 ---
+
+Window functions operate on a set of rows and return a single value for each row from the underlying query. The term window describes the set of rows on which the function operates. A window function uses values from the rows in a window to calculate the returned values. 
+
+When you use a window function in a query, you specify a window using the OVER() clause. The OVER() clause differentiates window functions from other analytical and reporting functions. 
+
+The OVER() clause has the following capabilities:  
+
+* Defines window partitions to form groups of rows. (PARTITION BY clause)  
+* Orders rows within a partition. (ORDER BY clause)
+
+For example, the following query uses the AVG() window function to calculate the average sales for employees in Q1:  
+
+       select emp_name, dealer_id, sales, avg(sales) over() as avgsales from q1_sales;
+       +-----------------+------------+--------+-----------+
+       |    emp_name     | dealer_id  | sales  | avgsales  |
+       +-----------------+------------+--------+-----------+
+       | Beverly Lang    | 2          | 16233  | 13631     |
+       | Kameko French   | 2          | 16233  | 13631     |
+       | Ursa George     | 3          | 15427  | 13631     |
+       | Ferris Brown    | 1          | 19745  | 13631     |
+       | Noel Meyer      | 1          | 19745  | 13631     |
+       | Abel Kim        | 3          | 12369  | 13631     |
+       | Raphael Hull    | 1          | 8227   | 13631     |
+       | Jack Salazar    | 1          | 9710   | 13631     |
+       | May Stout       | 3          | 9308   | 13631     |
+       | Haviva Montoya  | 2          | 9308   | 13631     |
+       +-----------------+------------+--------+-----------+
+       10 rows selected (0.213 seconds)
+
+
+The AVG() window function operates on the rows defined in the window and returns a value for each row. 
+To compare, you can run a query using the AVG() function as a standard set function:  
+
+       select avg(sales) as avgsales from q1_sales;
+       +-----------+
+       | avgsales  |
+       +-----------+
+       | 13630.5   |
+       +-----------+
+       1 row selected (0.131 seconds)
+  
+
+The query returns one row with the average of all the values in the specified column instead of returning values for each row.  
+
+You can also include the optional PARTITION BY and ORDER BY clauses in a query. The PARTITION BY clause subdivides the window into partitions. The ORDER BY clause defines the logical order of the rows within each partition of the result set.  
+
+Window functions are applied to the rows within each partition and sorted according to the order specification.  
+
+The following query uses the AVG() window function with the PARTITION BY clause to determine the average car sales for each dealer in Q1:  
+
+       select emp_name, dealer_id, sales, avg(sales) over (PARTITION BY dealer_id) as avgsales from q1_sales;
+       +-----------------+------------+--------+-----------+
+       |    emp_name     | dealer_id  | sales  | avgsales  |
+       +-----------------+------------+--------+-----------+
+       | Ferris Brown    | 1          | 19745  | 14357     |
+       | Noel Meyer      | 1          | 19745  | 14357     |
+       | Raphael Hull    | 1          | 8227   | 14357     |
+       | Jack Salazar    | 1          | 9710   | 14357     |
+       | Beverly Lang    | 2          | 16233  | 13925     |
+       | Kameko French   | 2          | 16233  | 13925     |
+       | Haviva Montoya  | 2          | 9308   | 13925     |
+       | Ursa George     | 3          | 15427  | 12368     |
+       | Abel Kim        | 3          | 12369  | 12368     |
+       | May Stout       | 3          | 9308   | 12368     |
+       +-----------------+------------+--------+-----------+
+       10 rows selected (0.215 seconds)
+
+
+## Types of Window Functions  
+
+Currently, Drill supports the following aggregate and ranking window functions:  
+
+Aggregation  
+
+* AVG()
+* COUNT()
+* MAX()
+* MIN()
+* SUM()
+
+Ranking  
+
+* CUME_DIST()
+* DENSE_RANK()
+* PERCENT_RANK()
+* RANK()
+* ROW_NUMBER()
+
+All of the ranking functions listed depend on the sort ordering specified by the ORDER BY clause of the associated window definition. Rows that are not distinct in the ordering are called peers. The ranking functions are defined so that they give the same answer for any two peer rows.  
+
+## Syntax  
+
+       window_function (expression) 
+       OVER (
+       [ PARTITION BY expr_list ]
+       [ ORDER BY order_list ][ frame_clause ] )  
+
+where function is one of the functions described, such as AVG() and *expr_list* is:  
+
+       expression | column_name [, expr_list ]
+
+and *order_list* is:  
+
+       expression | column_name [ASC | DESC] [ NULLS { FIRST | LAST } ] [, order_list ]
+
+and the optional *frame_clause* is one of the following frames:
+
+       RANGE UNBOUNDED PRECEDING
+       RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+       RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+       ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  
+
+
+## Arguments  
+
+*window_function*  
+Any of the following functions used with the OVER clause to provide a window specification:  
+
+* AVG()
+* COUNT()
+* CUME_DIST()
+* MAX()
+* MIN()
+* SUM()
+* DENSE_RANK()
+* PERCENT_RANK()
+* RANK()
+* ROW_NUMBER()
+
+OVER()  
+OVER() is a mandatory clause that defines a window within a query result set. OVER() is a subset of SELECT and a part of the aggregate definition. A window function computes a value for each row in the window.  
+
+PARTITION BY *expr_list*  
+PARTITION BY is an optional clause that subdivides the data into partitions. Including the partition clause divides the query result set into partitions, and the window function is applied to each partition separately. Computation restarts for each partition. If you do not include a partition clause, the function calculates on the entire table or file.  
+
+ORDER BY *order_list*  
+The ORDER BY clause defines the logical order of the rows within each partition of the result set. If no PARTITION BY is specified, ORDER BY uses the entire table. ORDER BY is optional for the aggregation window functions, but required for the ranking functions. This ORDER BY clause does not relate to the ORDER BY clause that you use outside of the OVER clause.  
+
+The window function is applied to the rows within each partition sorted according to the order specification.  
+
+Column identifiers or expressions that evaluate to column identifiers are required in the order list. You can also use constants as substitutes for column names.  
+
+NULLS are treated as their own group, sorted and ranked last in ASC, and sorted and ranked first in DESC. ASC is the default sort order.  
+
+*column_name*  
+The name of a column to be partitioned by or ordered by.  
+
+ASC | DESC
+Specifies sort order, either ascending or descending.  
+
+*frame_clause*  
+The frame\_clause specifies the group of rows that create the window frame. Currently, Drill only supports the default frame RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, which sets the frame as all rows from the start of the partition through the current row's last peer in the ordering, as specified by the ORDER BY clause. The frame also includes ties when ordering is not unique. You cannot explicitly state the frame specification for ranking window functions.  
+
+When the OVER clause contains an ORDER BY clause, the following frames are equivalent to the default frame: 
+ 
+       RANGE UNBOUNDED PRECEDING
+       RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW  
+
+When OVER clause does not contain an ORDER BY clause, the following frames are equivalent to the default frame:  
+
+       RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
+       ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING  
+
+The following delimiters define the frame:  
+
+* UNBOUNDED PRECEDING means that the frame starts with the first row of the partition.
+* UNBOUNDED FOLLOWING means that the frame ends with the last row of the partition.
+* CURRENT ROW means that the frame starts or ends with the current row’s first or last peer in the ORDER BY list.  
+
+
+## Usage Notes  
+
+* You can only use window functions in the SELECT list and ORDER BY clauses of a query.  
+* Window functions precede ORDER BY.  
+* Drill processes window functions after the WHERE, GROUP BY, and HAVING clauses.  
+* Including the OVER() clause after an aggregate set function turns the function into an aggregate window function. 
+* You can use window functions to aggregate over any number of rows in the window frame. 
+
+
+
+
+
+                                                                                                                                                                                                                          
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md b/_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md
new file mode 100644
index 0000000..7b3922c
--- /dev/null
+++ b/_docs/sql-reference/sql-window-functions/020-aggregate-window-functions.md
@@ -0,0 +1,186 @@
+---
+title: "Aggregate Window Functions"
+parent: "SQL Window Functions"
+---
+
+## Aggregate Window Functions
+
+Window functions operate on a set of rows and return a single value for each row from the underlying query. See SQL Window Functions. You can use certain aggregate functions as window functions in Drill. The OVER() clause differentiates window functions from other analytical and reporting functions. 
+
+The following table lists the aggregate functions that you can use as window functions in Drill with supported data types and descriptions of each function:  
+
+
+| Window Function | Argument Type                                                                   | Return Type                                                                                                                                               | Description                                                                                                                                                                                                                                                 |
+|-----------------|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| AVG()           | SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL, INTERVALYEAR or INTERVALDAY  | DECIMAL for any integer-type argument, DOUBLE for a floating-point argument, otherwise the same as the argument data type                                 | The AVG window function returns the average value for the input expression values. The AVG function works with numeric values and ignores NULL values.                                                                                                      |
+| COUNT()         | All argument data types                                                         | BIGINT                                                                                                                                                    | The COUNT() window function counts the number of input rows. COUNT(*) counts all of the rows in the target table if they do or do not include nulls. COUNT(expression) computes the number of rows with non-NULL values in a specific column or expression. |
+| MAX()           | BINARY, DECIMAL, VARCHAR, DATE, TIME, or TIMESTAMP                              | Same as argument type                                                                                                                                     | The MAX() window function returns the maximum value of the expression across all input values. The MAX function works with numeric values and ignores NULL values.                                                                                          |
+| MIN()           | BINARY, DECIMAL, VARCHAR, DATE, TIME, or TIMESTAMP                              | Same as argument type                                                                                                                                     | The MIN () window function returns the minimum value of the expression across all input values. The MIN function works with numeric values and ignores NULL values.                                                                                         |
+| SUM()           | SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL, INTERVALDAY, or INTERVALYEAR | BIGINT for SMALLINT or INTEGER arguments, DECIMAL for BIGINT arguments, DOUBLE for floating-point arguments, otherwise the same as the argument data type | The SUM () window function returns the sum of the expression across all input values. The SUM function works with numeric values and ignores NULL values.                                                                                                   |
+
+## Syntax  
+       window_function ( [ ALL ] <expression> ) 
+       OVER ( [ PARTITION BY expr_list ] [ ORDER BY order_list frame_clause ] )
+
+
+
+## Arguments  
+
+*window_function*  
+One of the following supported aggregate functions:  
+AVG(), COUNT(), MAX(), MIN(), SUM() 
+ 
+*expression*  
+The target column or expression that the function operates on.  
+
+ALL  
+When you include ALL, the function retains all duplicate values from the expression. ALL is the default. DISTINCT is not supported.  
+
+OVER  
+Specifies the window clauses for the aggregation functions. The OVER clause distinguishes window aggregation functions from normal set aggregation functions.  
+
+PARTITION BY *expr_list*  
+Defines the window for the window function in terms of one or more expressions.  
+
+ORDER BY *order_list*  
+Sorts the rows within each partition. If PARTITION BY is not specified, ORDER BY uses the entire table.  
+
+*frame_clause*  
+If an ORDER BY clause is used for an aggregate function, an explicit frame clause is required. The frame clause refines the set of rows in a function's window, including or excluding sets of rows within the ordered result. The frame clause consists of the ROWS or RANGE keyword and associated specifiers.
+  
+
+
+## Examples  
+The following examples show queries that use each of the aggregate window functions in Drill. See Window Function Examples for information about the data and setup for these examples.
+ 
+
+### AVG()  
+The following query uses the AVG() window function with the PARTITION BY clause to calculate the average sales for each car dealer in Q1.  
+
+       select dealer_id, sales, avg(sales) over (partition by dealer_id) as avgsales from q1_sales;
+       +------------+--------+-----------+
+       | dealer_id  | sales  | avgsales  |
+       +------------+--------+-----------+
+       | 1          | 19745  | 14357     |
+       | 1          | 19745  | 14357     |
+       | 1          | 8227   | 14357     |
+       | 1          | 9710   | 14357     |
+       | 2          | 16233  | 13925     |
+       | 2          | 16233  | 13925     |
+       | 2          | 9308   | 13925     |
+       | 3          | 15427  | 12368     |
+       | 3          | 12369  | 12368     |
+       | 3          | 9308   | 12368     |
+       +------------+--------+-----------+
+       10 rows selected (0.455 seconds)
+
+### COUNT()  
+The following query uses the COUNT (*) window function to count the number of sales in Q1, ordered by dealer_id. The word count is enclosed in back ticks (``) because it is a reserved keyword in Drill.  
+
+       select dealer_id, sales, count(*) over(order by dealer_id) as `count` from q1_sales;
+       +------------+--------+--------+
+       | dealer_id  | sales  | count  |
+       +------------+--------+--------+
+       | 1          | 19745  | 4      |
+       | 1          | 19745  | 4      |
+       | 1          | 8227   | 4      |
+       | 1          | 9710   | 4      |
+       | 2          | 16233  | 7      |
+       | 2          | 16233  | 7      |
+       | 2          | 9308   | 7      |
+       | 3          | 15427  | 10     |
+       | 3          | 12369  | 10     |
+       | 3          | 9308   | 10     |
+       +------------+--------+--------+
+       10 rows selected (0.215 seconds) 
+
+The following query uses the COUNT() window function to count the total number of sales for each dealer in Q1. 
+
+       select dealer_id, sales, count(sales) over(partition by dealer_id) as `count` from q1_sales;
+       +------------+--------+--------+
+       | dealer_id  | sales  | count  |
+       +------------+--------+--------+
+       | 1          | 19745  | 4      |
+       | 1          | 19745  | 4      |
+       | 1          | 8227   | 4      |
+       | 1          | 9710   | 4      |
+       | 2          | 16233  | 3      |
+       | 2          | 16233  | 3      |
+       | 2          | 9308   | 3      |
+       | 3          | 15427  | 3      |
+       | 3          | 12369  | 3      |
+       | 3          | 9308   | 3      |
+       +------------+--------+--------+
+       10 rows selected (0.249 seconds)
+
+
+### MAX()  
+The following query uses the MAX() window function with the PARTITION BY clause to identify the employee with the maximum number of car sales in Q1 at each dealership. The word max is a reserved keyword in Drill and must be enclosed in back ticks (``).  
+
+       select emp_name, dealer_id, sales, max(sales) over(partition by dealer_id) as `max` from q1_sales;
+       +-----------------+------------+--------+--------+
+       |    emp_name     | dealer_id  | sales  |  max   |
+       +-----------------+------------+--------+--------+
+       | Ferris Brown    | 1          | 19745  | 19745  |
+       | Noel Meyer      | 1          | 19745  | 19745  |
+       | Raphael Hull    | 1          | 8227   | 19745  |
+       | Jack Salazar    | 1          | 9710   | 19745  |
+       | Beverly Lang    | 2          | 16233  | 16233  |
+       | Kameko French   | 2          | 16233  | 16233  |
+       | Haviva Montoya  | 2          | 9308   | 16233  |
+       | Ursa George     | 3          | 15427  | 15427  |
+       | Abel Kim        | 3          | 12369  | 15427  |
+       | May Stout       | 3          | 9308   | 15427  |
+       +-----------------+------------+--------+--------+
+       10 rows selected (0.402 seconds)
+
+
+### MIN()  
+
+The following query uses the MIN() window function with the PARTITION BY clause to identify the employee with the minimum number of car sales in Q1 at each dealership. The word min is a reserved keyword in Drill and must be enclosed in back ticks (``).  
+
+       select emp_name, dealer_id, sales, min(sales) over(partition by dealer_id) as `min` from q1_sales;
+       +-----------------+------------+--------+-------+
+       |    emp_name     | dealer_id  | sales  |  min  |
+       +-----------------+------------+--------+-------+
+       | Ferris Brown    | 1          | 19745  | 8227  |
+       | Noel Meyer      | 1          | 19745  | 8227  |
+       | Raphael Hull    | 1          | 8227   | 8227  |
+       | Jack Salazar    | 1          | 9710   | 8227  |
+       | Beverly Lang    | 2          | 16233  | 9308  |
+       | Kameko French   | 2          | 16233  | 9308  |
+       | Haviva Montoya  | 2          | 9308   | 9308  |
+       | Ursa George     | 3          | 15427  | 9308  |
+       | Abel Kim        | 3          | 12369  | 9308  |
+       | May Stout       | 3          | 9308   | 9308  |
+       +-----------------+------------+--------+-------+
+       10 rows selected (0.194 seconds)
+
+### SUM()  
+The following query uses the SUM() window function to total the amount of sales for each dealer in Q1. The word sum is a reserved keyword in Drill and must be enclosed in back ticks (``).  
+
+       select dealer_id, emp_name, sales, sum(sales) over(partition by dealer_id) as `sum` from q2_sales;
+       +------------+-----------------+--------+--------+
+       | dealer_id  |    emp_name     | sales  |  sum   |
+       +------------+-----------------+--------+--------+
+       | 1          | Ferris Brown    | 19745  | 57427  |
+       | 1          | Noel Meyer      | 19745  | 57427  |
+       | 1          | Raphael Hull    | 8227   | 57427  |
+       | 1          | Jack Salazar    | 9710   | 57427  |
+       | 2          | Beverly Lang    | 16233  | 41774  |
+       | 2          | Kameko French   | 16233  | 41774  |
+       | 2          | Haviva Montoya  | 9308   | 41774  |
+       | 3          | Ursa George     | 15427  | 37104  |
+       | 3          | Abel Kim        | 12369  | 37104  |
+       | 3          | May Stout       | 9308   | 37104  |
+       +------------+-----------------+--------+--------+
+       10 rows selected (0.198 seconds)
+       
+
+
+       
+              
+       
+       
+       
+       

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md b/_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md
new file mode 100644
index 0000000..fa9ebf9
--- /dev/null
+++ b/_docs/sql-reference/sql-window-functions/030-ranking-window-functions.md
@@ -0,0 +1,152 @@
+---
+title: "Ranking Window Functions"
+parent: "SQL Window Functions"
+---
+
+## Ranking Window Functions
+
+Window functions operate on a set of rows and return a single value for each row from the underlying query. See SQL Window Functions. The OVER() clause differentiates window functions from other analytical and reporting functions. 
+
+The following table lists the ranking window functions in Drill with return data types and descriptions of each function:  
+
+| Window Function | Return Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
+|-----------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| CUME_DIST()     | DOUBLE PRECISION | The CUME_DIST() window function calculates the relative rank of the current row within a window partition: (number of rows preceding or peer with current row) / (total rows in the window partition)                                                                                                                                                                                                                                                                                                                                                 |
+| DENSE_RANK()    | BIGINT           | The DENSE_RANK () window function determines the rank of a value in a group of values based on the ORDER BY expression and the OVER clause. Each value is ranked within its partition. Rows with equal values receive the same rank. There are no gaps in the sequence of ranked values if two or more rows have the same rank.                                                                                                                                                                                                                       |
+| PERCENT_RANK()  | DOUBLE PRECISION | The PERCENT_RANK () window function calculates the percent rank of the current row using the following formula: (x - 1) / (number of rows in window partition - 1) where x is the rank of the current row.                                                                                                                                                                                                                                                                                                                                            |
+| RANK()          | BIGINT           | The RANK window function determines the rank of a value in a group of values. The ORDER BY expression in the OVER clause determines the value. Each value is ranked within its partition. Rows with equal values for the ranking criteria receive the same rank. Drill adds the number of tied rows to the tied rank to calculate the next rank and thus the ranks might not be consecutive numbers. For example, if two rows are ranked 1, the next rank is 3. The DENSE_RANK window function differs in that no gaps exist if two or more rows tie. |
+| ROW_NUMBER()    | BIGINT           | The ROW_NUMBER window function determines the ordinal number of the current row within its partition. The ORDER BY expression in the OVER clause determines the number. Each value is ordered within its partition. Rows with equal values for the ORDER BY expressions receive different row numbers nondeterministically.                                                                                                                                                                                                                           |  
+
+## Syntax  
+
+       window_function () OVER clause
+
+
+
+## Arguments  
+
+*window_function*  
+One of the following supported ranking functions:  
+CUME_DIST(), DENSE_RANK(), PERCENT_RANK(), RANK(), ROW_NUMBER() 
+ 
+( )  
+The functions do not take arguments, however the empty parentheses are required.  
+
+OVER clause  
+The window clauses for the function. The OVER clause cannot contain an explicit frame specification, but must include an ORDER BY clause. See Window Function Syntax for OVER clause syntax.
+
+
+
+## Examples  
+The following examples show queries that use each of the ranking window functions in Drill. See Window Function Examples for information about the data and setup for these examples.
+ 
+
+### CUME_DIST()  
+The following query uses the CUME_DIST() window function to calculate the cumulative distribution of sales for each dealer in Q1.  
+
+       select dealer_id, sales, cume_dist() over(order by sales) as cumedist from q1_sales;
+       +------------+--------+-----------+
+       | dealer_id  | sales  | cumedist  |
+       +------------+--------+-----------+
+       | 1          | 8227   | 0.1       |
+       | 3          | 9308   | 0.3       |
+       | 2          | 9308   | 0.3       |
+       | 1          | 9710   | 0.4       |
+       | 3          | 12369  | 0.5       |
+       | 3          | 15427  | 0.6       |
+       | 2          | 16233  | 0.8       |
+       | 2          | 16233  | 0.8       |
+       | 1          | 19745  | 1.0       |
+       | 1          | 19745  | 1.0       |
+       +------------+--------+-----------+
+       10 rows selected (0.241 seconds)  
+
+### DENSE_RANK  
+
+The following query uses the DENSE_RANK() window function to rank the employee sales in Q1.  
+
+       select dealer_id, emp_name, sales, dense_rank() over(order by sales) as denserank from q1_sales; 
+       +------------+-----------------+--------+------------+
+       | dealer_id  |    emp_name     | sales  | denserank  |
+       +------------+-----------------+--------+------------+
+       | 1          | Raphael Hull    | 8227   | 1          |
+       | 3          | May Stout       | 9308   | 2          |
+       | 2          | Haviva Montoya  | 9308   | 2          |
+       | 1          | Jack Salazar    | 9710   | 3          |
+       | 3          | Abel Kim        | 12369  | 4          |
+       | 3          | Ursa George     | 15427  | 5          |
+       | 2          | Beverly Lang    | 16233  | 6          |
+       | 2          | Kameko French   | 16233  | 6          |
+       | 1          | Ferris Brown    | 19745  | 7          |
+       | 1          | Noel Meyer      | 19745  | 7          |
+       +------------+-----------------+--------+------------+
+       10 rows selected (0.198 seconds)
+
+### PERCENT_RANK()  
+
+The following query uses the PERCENT_RANK() window function to calculate the percent rank for employee sales in Q1.  
+
+       select dealer_id, emp_name, sales, percent_rank() over(order by sales) as perrank from q1_sales; 
+       +------------+-----------------+--------+---------------------+
+       | dealer_id  |    emp_name     | sales  |       perrank       |
+       +------------+-----------------+--------+---------------------+
+       | 1          | Raphael Hull    | 8227   | 0.0                 |
+       | 3          | May Stout       | 9308   | 0.1111111111111111  |
+       | 2          | Haviva Montoya  | 9308   | 0.1111111111111111  |
+       | 1          | Jack Salazar    | 9710   | 0.3333333333333333  |
+       | 3          | Abel Kim        | 12369  | 0.4444444444444444  |
+       | 3          | Ursa George     | 15427  | 0.5555555555555556  |
+       | 2          | Beverly Lang    | 16233  | 0.6666666666666666  |
+       | 2          | Kameko French   | 16233  | 0.6666666666666666  |
+       | 1          | Ferris Brown    | 19745  | 0.8888888888888888  |
+       | 1          | Noel Meyer      | 19745  | 0.8888888888888888  |
+       +------------+-----------------+--------+---------------------+
+       10 rows selected (0.169 seconds)
+
+### RANK()  
+
+The following query uses the RANK() window function to rank the employee sales for Q1. The word rank in Drill is a reserved keyword and must be enclosed in back ticks (``).
+ 
+       select dealer_id, emp_name, sales, rank() over(order by sales) as `rank` from q1_sales;
+       +------------+-----------------+--------+-------+
+       | dealer_id  |    emp_name     | sales  | rank  |
+       +------------+-----------------+--------+-------+
+       | 1          | Raphael Hull    | 8227   | 1     |
+       | 3          | May Stout       | 9308   | 2     |
+       | 2          | Haviva Montoya  | 9308   | 2     |
+       | 1          | Jack Salazar    | 9710   | 4     |
+       | 3          | Abel Kim        | 12369  | 5     |
+       | 3          | Ursa George     | 15427  | 6     |
+       | 2          | Beverly Lang    | 16233  | 7     |
+       | 2          | Kameko French   | 16233  | 7     |
+       | 1          | Ferris Brown    | 19745  | 9     |
+       | 1          | Noel Meyer      | 19745  | 9     |
+       +------------+-----------------+--------+-------+
+       10 rows selected (0.174 seconds)
+
+### ROW_NUMBER()  
+
+The following query uses the ROW_NUMBER() window function to number the sales for each dealer_id. The word rownum contains the reserved keyword row and must be enclosed in back ticks (``).  
+
+        select dealer_id, emp_name, sales, row_number() over(partition by dealer_id order by sales) as `rownum` from q1_sales;
+       +------------+-----------------+--------+---------+
+       | dealer_id  |    emp_name     | sales  | rownum  |
+       +------------+-----------------+--------+---------+
+       | 1          | Raphael Hull    | 8227   | 1       |
+       | 1          | Jack Salazar    | 9710   | 2       |
+       | 1          | Ferris Brown    | 19745  | 3       |
+       | 1          | Noel Meyer      | 19745  | 4       |
+       | 2          | Haviva Montoya  | 9308   | 1       |
+       | 2          | Beverly Lang    | 16233  | 2       |
+       | 2          | Kameko French   | 16233  | 3       |
+       | 3          | May Stout       | 9308   | 1       |
+       | 3          | Abel Kim        | 12369  | 2       |
+       | 3          | Ursa George     | 15427  | 3       |
+       +------------+-----------------+--------+---------+
+       10 rows selected (0.241 seconds)
+              
+       
+
+ 
+
+      
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/3a987237/_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md b/_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md
new file mode 100644
index 0000000..a9c1a28
--- /dev/null
+++ b/_docs/sql-reference/sql-window-functions/040-sql-window-functions-examples.md
@@ -0,0 +1,92 @@
+---
+title: "SQL Window Functions Examples"
+parent: "SQL Window Functions"
+---
+
+The window function examples use a view named q1\_sales that was created from a CSV file named emp_sales and stored in a directory on the local file system:
+ 
+The emp_sales.csv file contains the following information:  
+
+       +-----------------+-----------------+------------+--------+
+       |    emp_name     |     emp_mgr     | dealer_id  | sales  |
+       +-----------------+-----------------+------------+--------+
+       | Beverly Lang    | Mike Palomino   | 2          | 16233  |
+       | Kameko French   | Mike Palomino   | 2          | 16233  |
+       | Ursa George     | Rich Hernandez  | 3          | 15427  |
+       | Ferris Brown    | Dan Brodi       | 1          | 19745  |
+       | Noel Meyer      | Kari Phelps     | 1          | 19745  |
+       | Abel Kim        | Rich Hernandez  | 3          | 12369  |
+       | Raphael Hull    | Kari Phelps     | 1          | 8227   |
+       | Jack Salazar    | Kari Phelps     | 1          | 9710   |
+       | May Stout       | Rich Hernandez  | 3          | 9308   |
+       | Haviva Montoya  | Mike Palomino   | 2          | 9308   |
+       +-----------------+-----------------+------------+--------+
+You can create a CSV file named emp_sales with this data.
+
+Drill was installed locally and a workspace was created in the dfs storage plugin instance for the directory where the emp_sales.csv file is located. See [Installing Drill](https://drill.apache.org/docs/embedded-mode-prerequisites/).
+ 
+If you create a CSV file with the data provided, you can create workspace that points to the directory where you store the emp_sales.csv file. See [Configuring Storage Plugins](https://drill.apache.org/docs/file-system-storage-plugin/).
+ 
+When you run show schemas, Drill lists the workspace that you configured as a schema. In the following example, you can see dfs.emp listed. This is the workspace that points to the directory where the emp_sales.csv file is stored.
+
+       0: jdbc:drill:zk=local> show schemas;
+       +---------------------+
+       |     SCHEMA_NAME	 |
+       +---------------------+
+       | INFORMATION_SCHEMA  |
+       | cp.default     	 |
+       | dfs.default    	 |
+       | dfs.emp        	 |
+       | dfs.root       	 |
+       | dfs.tmp        	 |
+       | sys            	 |
+       +---------------------+  
+
+You can then run the USE command to change to the schema with the file. All queries are executed against the schema that you use.
+ 
+       0: jdbc:drill:zk=local> use dfs.emp;
+       +-------+--------------------------------------+
+       |  ok   |               summary           	 |
+       +-------+--------------------------------------+
+       | true  | Default schema changed to [dfs.emp]  |
+       +-------+--------------------------------------+
+ 
+To create the q1_sales view used in the examples, issue the following query with the CREATE VIEW command to Drill.
+
+Note: You must use column numbers when querying CSV files. Also, CAST the columns to a specific data type to avoid incorrect implicit casting by Drill. This can affect the accuracy of window function results. In Drill, the column array starts with 0 as the first column.
+ 
+       0: jdbc:drill:zk=local> create view q1_sales as select cast(columns[0] as varchar(30)) as emp_name, cast(columns[1] as varchar(30)) as emp_mgr, cast(columns[2] as int) as dealer_id, cast(columns[3] as int) as sales from `q1_sales.csv`;
+       +-------+-----------------------------------------------------------+
+       |  ok   |                          summary                     	 |
+       +-------+-----------------------------------------------------------+
+       | true  | View 'q1_sales' created successfully in 'dfs.emp' schema  |
+       +-------+-----------------------------------------------------------+
+       1 row selected (0.134 seconds)  
+
+Query the view to verify that all of the data appears correctly:  
+
+       select * from q1_sales; 
+       +-----------------+-----------------+------------+--------+
+       |    emp_name     |     emp_mgr     | dealer_id  | sales  |
+       +-----------------+-----------------+------------+--------+
+       | Beverly Lang    | Mike Palomino   | 2          | 16233  |
+       | Kameko French   | Mike Palomino   | 2          | 16233  |
+       | Ursa George     | Rich Hernandez  | 3          | 15427  |
+       | Ferris Brown    | Dan Brodi       | 1          | 19745  |
+       | Noel Meyer      | Kari Phelps     | 1          | 19745  |
+       | Abel Kim        | Rich Hernandez  | 3          | 12369  |
+       | Raphael Hull    | Kari Phelps     | 1          | 8227   |
+       | Jack Salazar    | Kari Phelps     | 1          | 9710   |
+       | May Stout       | Rich Hernandez  | 3          | 9308   |
+       | Haviva Montoya  | Mike Palomino   | 2          | 9308   |
+       +-----------------+-----------------+------------+--------+
+       10 rows selected (0.112 seconds)  
+
+Now, you can run the window function example queries on your machine.
+
+       
+       
+
+
+
+                                                                                                                                       
\ No newline at end of file


Mime
View raw message