drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bridg...@apache.org
Subject [09/10] drill git commit: squash 9 commits DRILL-3078
Date Wed, 17 Jun 2015 00:10:44 GMT
squash 9 commits DRILL-3078


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

Branch: refs/heads/gh-pages
Commit: e3262a54dfcf84ad8c5a97a3ab7140909ee73225
Parents: e319955
Author: Kristine Hahn <khahn@maprtech.com>
Authored: Mon Jun 15 16:51:41 2015 -0700
Committer: Kristine Hahn <khahn@maprtech.com>
Committed: Mon Jun 15 16:51:41 2015 -0700

----------------------------------------------------------------------
 _data/docs.json                                 |  82 +++++++-------
 _docs/img/odbc-create-as.png                    | Bin 0 -> 18582 bytes
 _docs/img/odbc-define-view.png                  | Bin 0 -> 88744 bytes
 .../010-odbc-configuration-reference.md         |  12 ++-
 .../020-configuring-odbc-on-linux-mac-os-x.md   |  25 ++---
 .../010-installing-the-driver-on-linux.md       |  23 ++--
 .../020-connecting-drill-explorer-to-data.md    |   2 +-
 .../030-browsing-data-and-creating-views.md     | 107 ++++++++++++++-----
 8 files changed, 152 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_data/docs.json
----------------------------------------------------------------------
diff --git a/_data/docs.json b/_data/docs.json
index bf8a6d6..1e0c55c 100644
--- a/_data/docs.json
+++ b/_data/docs.json
@@ -547,6 +547,27 @@
             "title": "Archived Pages", 
             "url": "/docs/archived-pages/"
         }, 
+        "Browsing Data and Defining Views": {
+            "breadcrumbs": [
+                {
+                    "title": "Using Drill Explorer", 
+                    "url": "/docs/using-drill-explorer/"
+                }, 
+                {
+                    "title": "ODBC/JDBC Interfaces", 
+                    "url": "/docs/odbc-jdbc-interfaces/"
+                }
+            ], 
+            "children": [], 
+            "next_title": "Using Drill with BI Tools", 
+            "next_url": "/docs/using-drill-with-bi-tools/", 
+            "parent": "Using Drill Explorer", 
+            "previous_title": "Connecting Drill Explorer to Data", 
+            "previous_url": "/docs/connecting-drill-explorer-to-data/", 
+            "relative_path": "_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md",

+            "title": "Browsing Data and Defining Views", 
+            "url": "/docs/browsing-data-and-defining-views/"
+        }, 
         "CASE": {
             "breadcrumbs": [
                 {
@@ -1696,8 +1717,8 @@
                 }
             ], 
             "children": [], 
-            "next_title": "Using Drill Explorer to Browse Data", 
-            "next_url": "/docs/using-drill-explorer-to-browse-data/", 
+            "next_title": "Browsing Data and Defining Views", 
+            "next_url": "/docs/browsing-data-and-defining-views/", 
             "parent": "Using Drill Explorer", 
             "previous_title": "Drill Explorer Introduction", 
             "previous_url": "/docs/drill-explorer-introduction/", 
@@ -5107,8 +5128,8 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "Using Drill Explorer to Browse Data", 
-                            "next_url": "/docs/using-drill-explorer-to-browse-data/", 
+                            "next_title": "Browsing Data and Defining Views", 
+                            "next_url": "/docs/browsing-data-and-defining-views/", 
                             "parent": "Using Drill Explorer", 
                             "previous_title": "Drill Explorer Introduction", 
                             "previous_url": "/docs/drill-explorer-introduction/", 
@@ -5134,8 +5155,8 @@
                             "previous_title": "Connecting Drill Explorer to Data", 
                             "previous_url": "/docs/connecting-drill-explorer-to-data/", 
                             "relative_path": "_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md",

-                            "title": "Using Drill Explorer to Browse Data", 
-                            "url": "/docs/using-drill-explorer-to-browse-data/"
+                            "title": "Browsing Data and Defining Views", 
+                            "url": "/docs/browsing-data-and-defining-views/"
                         }
                     ], 
                     "next_title": "Drill Explorer Introduction", 
@@ -5285,8 +5306,8 @@
                     "next_title": "Using Drill with BI Tools Introduction", 
                     "next_url": "/docs/using-drill-with-bi-tools-introduction/", 
                     "parent": "ODBC/JDBC Interfaces", 
-                    "previous_title": "Using Drill Explorer to Browse Data", 
-                    "previous_url": "/docs/using-drill-explorer-to-browse-data/", 
+                    "previous_title": "Browsing Data and Defining Views", 
+                    "previous_url": "/docs/browsing-data-and-defining-views/", 
                     "relative_path": "_docs/odbc-jdbc-interfaces/060-using-drill-with-bi-tools.md",

                     "title": "Using Drill with BI Tools", 
                     "url": "/docs/using-drill-with-bi-tools/"
@@ -10270,8 +10291,8 @@
                         }
                     ], 
                     "children": [], 
-                    "next_title": "Using Drill Explorer to Browse Data", 
-                    "next_url": "/docs/using-drill-explorer-to-browse-data/", 
+                    "next_title": "Browsing Data and Defining Views", 
+                    "next_url": "/docs/browsing-data-and-defining-views/", 
                     "parent": "Using Drill Explorer", 
                     "previous_title": "Drill Explorer Introduction", 
                     "previous_url": "/docs/drill-explorer-introduction/", 
@@ -10297,8 +10318,8 @@
                     "previous_title": "Connecting Drill Explorer to Data", 
                     "previous_url": "/docs/connecting-drill-explorer-to-data/", 
                     "relative_path": "_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md",

-                    "title": "Using Drill Explorer to Browse Data", 
-                    "url": "/docs/using-drill-explorer-to-browse-data/"
+                    "title": "Browsing Data and Defining Views", 
+                    "url": "/docs/browsing-data-and-defining-views/"
                 }
             ], 
             "next_title": "Drill Explorer Introduction", 
@@ -10310,27 +10331,6 @@
             "title": "Using Drill Explorer", 
             "url": "/docs/using-drill-explorer/"
         }, 
-        "Using Drill Explorer to Browse Data": {
-            "breadcrumbs": [
-                {
-                    "title": "Using Drill Explorer", 
-                    "url": "/docs/using-drill-explorer/"
-                }, 
-                {
-                    "title": "ODBC/JDBC Interfaces", 
-                    "url": "/docs/odbc-jdbc-interfaces/"
-                }
-            ], 
-            "children": [], 
-            "next_title": "Using Drill with BI Tools", 
-            "next_url": "/docs/using-drill-with-bi-tools/", 
-            "parent": "Using Drill Explorer", 
-            "previous_title": "Connecting Drill Explorer to Data", 
-            "previous_url": "/docs/connecting-drill-explorer-to-data/", 
-            "relative_path": "_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md",

-            "title": "Using Drill Explorer to Browse Data", 
-            "url": "/docs/using-drill-explorer-to-browse-data/"
-        }, 
         "Using Drill with BI Tools": {
             "breadcrumbs": [
                 {
@@ -10469,8 +10469,8 @@
             "next_title": "Using Drill with BI Tools Introduction", 
             "next_url": "/docs/using-drill-with-bi-tools-introduction/", 
             "parent": "ODBC/JDBC Interfaces", 
-            "previous_title": "Using Drill Explorer to Browse Data", 
-            "previous_url": "/docs/using-drill-explorer-to-browse-data/", 
+            "previous_title": "Browsing Data and Defining Views", 
+            "previous_url": "/docs/browsing-data-and-defining-views/", 
             "relative_path": "_docs/odbc-jdbc-interfaces/060-using-drill-with-bi-tools.md",

             "title": "Using Drill with BI Tools", 
             "url": "/docs/using-drill-with-bi-tools/"
@@ -12143,8 +12143,8 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "Using Drill Explorer to Browse Data", 
-                            "next_url": "/docs/using-drill-explorer-to-browse-data/", 
+                            "next_title": "Browsing Data and Defining Views", 
+                            "next_url": "/docs/browsing-data-and-defining-views/", 
                             "parent": "Using Drill Explorer", 
                             "previous_title": "Drill Explorer Introduction", 
                             "previous_url": "/docs/drill-explorer-introduction/", 
@@ -12170,8 +12170,8 @@
                             "previous_title": "Connecting Drill Explorer to Data", 
                             "previous_url": "/docs/connecting-drill-explorer-to-data/", 
                             "relative_path": "_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md",

-                            "title": "Using Drill Explorer to Browse Data", 
-                            "url": "/docs/using-drill-explorer-to-browse-data/"
+                            "title": "Browsing Data and Defining Views", 
+                            "url": "/docs/browsing-data-and-defining-views/"
                         }
                     ], 
                     "next_title": "Drill Explorer Introduction", 
@@ -12321,8 +12321,8 @@
                     "next_title": "Using Drill with BI Tools Introduction", 
                     "next_url": "/docs/using-drill-with-bi-tools-introduction/", 
                     "parent": "ODBC/JDBC Interfaces", 
-                    "previous_title": "Using Drill Explorer to Browse Data", 
-                    "previous_url": "/docs/using-drill-explorer-to-browse-data/", 
+                    "previous_title": "Browsing Data and Defining Views", 
+                    "previous_url": "/docs/browsing-data-and-defining-views/", 
                     "relative_path": "_docs/odbc-jdbc-interfaces/060-using-drill-with-bi-tools.md",

                     "title": "Using Drill with BI Tools", 
                     "url": "/docs/using-drill-with-bi-tools/"

http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_docs/img/odbc-create-as.png
----------------------------------------------------------------------
diff --git a/_docs/img/odbc-create-as.png b/_docs/img/odbc-create-as.png
new file mode 100644
index 0000000..1abc793
Binary files /dev/null and b/_docs/img/odbc-create-as.png differ

http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_docs/img/odbc-define-view.png
----------------------------------------------------------------------
diff --git a/_docs/img/odbc-define-view.png b/_docs/img/odbc-define-view.png
new file mode 100644
index 0000000..70b4af8
Binary files /dev/null and b/_docs/img/odbc-define-view.png differ

http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_docs/odbc-jdbc-interfaces/configuring-odbc/010-odbc-configuration-reference.md
----------------------------------------------------------------------
diff --git a/_docs/odbc-jdbc-interfaces/configuring-odbc/010-odbc-configuration-reference.md
b/_docs/odbc-jdbc-interfaces/configuring-odbc/010-odbc-configuration-reference.md
index bf27f88..d5dbe0f 100644
--- a/_docs/odbc-jdbc-interfaces/configuring-odbc/010-odbc-configuration-reference.md
+++ b/_docs/odbc-jdbc-interfaces/configuring-odbc/010-odbc-configuration-reference.md
@@ -30,7 +30,7 @@ The following table provides a list of the configuration options and a brief
des
 
 ### Catalog
 
-This value defaults to DRILL and cannot be changed.
+This value defaults to DRILL and cannot be changed. The driver adds a synthetic catalog named
DRILL under which all of the schemas and databases are organized. The driver maps the ODBC
schema to the DRILL catalog.
 
 ### Connection Type
 
@@ -83,6 +83,16 @@ Views that you create using the Drill Explorer do not appear under the
schema
 associated with the data source type. Instead, the views can be accessed from
 the file-based schema that you selected when saving the view.
 
+The driver supports the following schema types:
+
+* HBase
+* Distributed File System (DFS), supporting the following file formats:
+  * Parquet  
+  * JSON
+  * CSV
+  * TSV
+* Hive
+
 ### Advanced Properties
 
 The Advanced Properties field allows you to customize the DSN.  

http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_docs/odbc-jdbc-interfaces/configuring-odbc/020-configuring-odbc-on-linux-mac-os-x.md
----------------------------------------------------------------------
diff --git a/_docs/odbc-jdbc-interfaces/configuring-odbc/020-configuring-odbc-on-linux-mac-os-x.md
b/_docs/odbc-jdbc-interfaces/configuring-odbc/020-configuring-odbc-on-linux-mac-os-x.md
index d9e85be..f8c122d 100644
--- a/_docs/odbc-jdbc-interfaces/configuring-odbc/020-configuring-odbc-on-linux-mac-os-x.md
+++ b/_docs/odbc-jdbc-interfaces/configuring-odbc/020-configuring-odbc-on-linux-mac-os-x.md
@@ -20,7 +20,7 @@ on Linux or Mac OS X, copy the following configuration files in `/opt/mapr/drill
 * `odbc.ini`
 * `odbcinst.ini`
 
-In your home directory, use sudo to rename the files as hidden files:
+In your home directory, rename the files as hidden files. Use sudo if necessary:
 
 * .mapr.drillodbc.ini
 * .odbc.ini
@@ -39,28 +39,17 @@ Depending on the driver manager you use, the user DSN in one of these
files will
 
 ### Linux
 
-Set the following environment variables to point to the `.odbc.ini`
-and `.mapr.drillodbc.ini` configuration files, respectively:
-
-  * `ODBCINI` (point to `.odbc.ini`)
-  * `MAPRDRILLINI` (point to `.mapr.drillodbc.ini`)
-
-The `LD_LIBRARY_PATH` environment variable must include the paths to the
-following:
-
-  * Installed ODBC driver manager libraries
-  * Installed MapR ODBC Driver for Apache Drill shared libraries
+1. Set the ODBCINI environment variable to point to the `.odbc.ini` in your home directory.
For example:  
+   `export ODBCINI=~/.odbc.ini`
+2. Set the MAPRDRILLINI environment variable to point to `.mapr.drillodbc.ini` in your home
directory. For example:  
+   `export MAPRDRILLINI=~/.mapr.drillodbc.ini`
+3. Set the LD_LIBRARY_PATH environment variable  to point to your ODBC driver manager libraries
and the MapR ODBC Driver for Apache Drill shared libraries. For example:  
+   `export LD_LIBRARY_PATH=/usr/local/lib:/opt/mapr/drillodbc/lib/64`
 
 You can have both 32- and 64-bit versions of the driver installed at the same time on the
same computer. 
 {% include startimportant.html %}Do not include the paths to both 32- and 64-bit shared libraries
in LD_LIBRARY PATH at the same time.{% include endimportant.html %}
 Only include the path to the shared libraries corresponding to the driver matching the bitness
of the client application used.
 
-For example, if you are using a 64-bit client application and ODBC driver
-manager libraries are installed in `/usr/local/lib`, then set
-`LD_LIBRARY_PATH` as follows:  
-
-`export LD_LIBRARY_PATH=/usr/local/lib:/opt/simba/drillodbc/lib/64`  
-
 ### Mac OS X
 
 Create or modify the `/etc/launchd.conf` file to set environment variables. Set the SIMBAINI
variable to point to the `.mapr.drillodbc.ini` file, the ODBCSYSINI varialbe to the `.odbcinst.ini`
file, the ODBCINI variable to the `.odbc.ini` file, and the DYLD_LIBRARY_PATH to the location
of the dynamic linker (DYLD) libraries and to the MapR Drill ODBC Driver. If you installed
the iODBC driver manager using the DMG, the DYLD libraries are installed in `/usr/local/iODBC/lib`.
The launchd.conf file should look something like this:

http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_docs/odbc-jdbc-interfaces/installing-the-odbc-driver/010-installing-the-driver-on-linux.md
----------------------------------------------------------------------
diff --git a/_docs/odbc-jdbc-interfaces/installing-the-odbc-driver/010-installing-the-driver-on-linux.md
b/_docs/odbc-jdbc-interfaces/installing-the-odbc-driver/010-installing-the-driver-on-linux.md
index a9d57ba..32a6719 100755
--- a/_docs/odbc-jdbc-interfaces/installing-the-odbc-driver/010-installing-the-driver-on-linux.md
+++ b/_docs/odbc-jdbc-interfaces/installing-the-odbc-driver/010-installing-the-driver-on-linux.md
@@ -27,6 +27,7 @@ Verify that your system meets the system requirements before you start.
     * iODBC 3.52.7 or above  
       OR 
     * unixODBC 2.2.12 or above
+    On Linux, 3.52.7 is available as a tarball. After unpacking the tarball, see the README
for instructions about building the driver manager.
   * The client must be able to resolve the actual hostname of the Drill node(s) with the
IP(s). Verify that a DNS entry was created on the client machine for the Drill node(s).  

 If not, create the following entry in `/etc/hosts` for the Drill node(s):  
 
@@ -37,10 +38,11 @@ To install the driver, you need Administrator privileges on the computer.
 
 ## Step 1: Download the MapR Drill ODBC Driver
 
-Click on a link below to download the driver:
+  * [MapR Drill ODBC Driver (32-bit)]
 
-  * [MapR Drill ODBC Driver (32-bit)](http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/MapRDrill_odbc_v1.0.0.1001/MapRDrillODBC-32bit-1.0.0.i686.rpm)
-  * [MapR Drill ODBC Driver (64-bit)](http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/MapRDrill_odbc_v1.0.0.1001/MapRDrillODBC-1.0.0.x86_64.rpm)
+         wget http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/MapRDrill_odbc_v1.0.0.1001/MapRDrillODBC-32bit-1.0.0.i686.rpm
+  * [MapR Drill ODBC Driver (64-bit)]
+         wget http://package.mapr.com/tools/MapR-ODBC/MapR_Drill/MapRDrill_odbc_v1.0.0.1001/MapRDrillODBC-1.0.0.x86_64.rpm
 
 ## Step 2: Install the MapR Drill ODBC Driver
 
@@ -52,23 +54,20 @@ To install the driver, complete the following steps:
 
      **RedHat/CentOS**
      
-     `yum localinstall --nogpgcheck RPMFileName`
+     `yum localinstall --nogpgcheck <RPMFileName>`
 
      **SUSE**
      
      `zypper install RPMFileName`
 
-{% include startnote.html %}The MapR Drill ODBC Driver dependencies need to be resolved.{%
include endnote.html %}
-
 The MapR Drill ODBC Driver depends on the following resources:
 
   * `cyrus-sasl-2.1.22-7` or above
   * `cyrus-sasl-gssapi-2.1.22-7` or above
   * `cyrus-sasl-plain-2.1.22-7` or above
 
-If the package manager in your Linux distribution cannot resolve the
-dependencies automatically when installing the driver, download and manually
-install the packages.
+The MapR Drill ODBC Driver typically resolves dependencies automatically. If not, error messages
during the installation indicate that the package manager in your Linux distribution cannot
resolve the
+dependencies automatically. In this case, manually install the packages.
 
 The following table provides a list of the MapR Drill ODBC Driver file
 locations and descriptions:
@@ -82,13 +81,13 @@ File| Description
   
 ## Step 3: Check the MapR Drill ODBC Driver version
 
-To check the version of the driver you installed, use the following command on the terminal
command line:
+To check the version of the driver you installed, use the following case-sensitive command
on the terminal command line:
 
-`yum list | grep maprdrillodbc`
+`yum list | grep MapRDrillODBC`
 
 or
 
-`rpm -qa | grep maprdrillodbc`
+`rpm -qa | grep MapRDrillodbc`
 
 
 ### Next Step

http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_docs/odbc-jdbc-interfaces/using-drill-explorer/020-connecting-drill-explorer-to-data.md
----------------------------------------------------------------------
diff --git a/_docs/odbc-jdbc-interfaces/using-drill-explorer/020-connecting-drill-explorer-to-data.md
b/_docs/odbc-jdbc-interfaces/using-drill-explorer/020-connecting-drill-explorer-to-data.md
index e901e79..81475bf 100644
--- a/_docs/odbc-jdbc-interfaces/using-drill-explorer/020-connecting-drill-explorer-to-data.md
+++ b/_docs/odbc-jdbc-interfaces/using-drill-explorer/020-connecting-drill-explorer-to-data.md
@@ -6,7 +6,7 @@ The way you start Drill Explorer differs depending on your platform, but regardl
 
 ## Connecting Drill Explorer to Data on Mac OS X
 
-1. On a node that is running Drill, go to the `/Applications` directory, and run the Drill
Explorer app.  
+1. On a node that is running Drill, run Drill Explorer.  The Drill Explorer app is located
in the `/Applications` directory.  
    The Drill Explorer console appears.  
 2. Click **Connect** on the console.  
    The Drill Explorer dialog appears.  

http://git-wip-us.apache.org/repos/asf/drill/blob/e3262a54/_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md
----------------------------------------------------------------------
diff --git a/_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md
b/_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md
index 3dd162c..aa215c5 100644
--- a/_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md
+++ b/_docs/odbc-jdbc-interfaces/using-drill-explorer/030-browsing-data-and-creating-views.md
@@ -1,43 +1,98 @@
 ---
-title: "Browsing Data and Creating Views"
+title: "Browsing Data and Defining Views"
 parent: "Using Drill Explorer"
 ---
-After connecting Drill Explorer to data, the Browse and SQL tab appear on the right side
of the console. On the Browse tab, you view any metadata that might exist for a schema that
you access with Drill. On the SQL tab, you preview the results
+After connecting Drill Explorer to data, the Browse and SQL tabs appear on the right side
of the console. On the Browse tab, you view any metadata that might exist for a schema that
you access with Drill. On the SQL tab, you preview the results
 of custom queries and save the results as a view.
 
 ## Browsing Data
 
-You can browse files and directories if you have permission to read them. The following example
shows how browse Drill sample data.
+You can browse files and directories if you have permission to read them. In the Schemas
pane, you expand branches until you find the file or table you want to view, and then select
it. 
+
+Tip: To avoid error messages, which you can ignore, expand directories carefully by clicking
on the arrow instead of the directory name until you find valid data. 
+
+In the Browse tab, the Metadata pane displays the structure, if there is any, of the selected
table or file. The Preview pane displays the actual data. The SQL tab displays the statement
that returns the data you see in the Browse tab.
+
+To update data after making changes in the data source, right-click a file, table, view,
schema, or directory in the Schemas pane, and select Refresh. The scope of the update is limited
to the item you right-click.
+
+The following example shows how to browse data using the sample MapR ODBC Driver DSN.
 
 1. Start Drill if necessary.  
-2. Check that the Schema property in the `.odbc.ini` is blank, which puts the default `dfs`
schema into effect.  
-3. Start Drill Explorer and connect to the sample DSN.  
-4. In the **Schemas** section of Drill Explorer, on the **Browse** tab, navigate to the `
Drill installation directory, to the `sample-data` directory. Click `nation.parquet`.  
+2. Start Drill Explorer and connect to the sample DSN.  
+3. In the **Schemas** pane of Drill Explorer, on the **Browse** tab, navigate to the `sample-data`
directory in the dfs.default schema. Click `nation.parquet`.  
+   The data from `nation.parquet` appears in the Preview pane.
    ![nation parquet]({{ site.baseurl }}/docs/img/explorer-nation-data.png) 
 
 
-## Creating a View
+## Defining a View
+After browsing data, you can define, preview, and save a view of file-based data. On the
SQL tab, modify the statement in View Definition SQL to select the data you want to view.
Click **Create As** to navigate to the location for saving the view. You need to save the
view to a location that you define as `writable` in the storage plugin definition. After saving
a view, a message is displayed about the status of the operation. Click **Copy** to copy the
message.
 
-1. Start Drill if necessary.  
-2. Check that the Schema property in the .odbc.ini is blank, which puts the default `dfs`schema
into effect.  
-3. Start Drill Explorer and connect to the sample DSN.  
-4. In the **Schemas** section on the **Browse** tab, navigate to the the data source that
you want to create a view for.  
-   After you select a data souce, the metadata and data displays on the Browse tab and the
SQL that is used to access the data displays on the SQL tab.  
-5. Click the **SQL** tab.  
-6. In the **View Definition SQL** field, enter the SQL query that you want to create a view
for.  
-7. Click **Preview**.   
-   If the results are not as expected, you can edit the SQL query and click
-Preview again.  
-8. Click **Create As**.  
-   The _Create As_ dialog displays.  
-9. In the **Schema** field, select the schema where you want to save the view.  
+The following example defines and saves a view of a few columns of `nation.parquet` data.
+
+1. Start Drill.  
+2. Start Drill Explorer and connect to the sample DSN.  
+3. In the **Schemas** section on the **Browse** tab, navigate to the `/sample-data/nation.parquet`
in the `dfs.default` schema. 
+4. On the **SQL** tab, in the **View Definition SQL** field, enter a query, as described
in the [Specifying Column Names](). For example, modify the SELECT statement as follows:
+
+        SELECT N_NAME, N_REGIONKEY FROM `dfs.default`.`./Users/drilluser/drill/apache-drill-1.0.0/sample-data/nation.parquet`
WHERE N_REGIONKEY IN (2, 4)
+   Do not put a semicolon at the end of the SQL statement.  
+5. Click **Preview**.
+   ![nation parquet]({{ site.baseurl }}/docs/img/odbc-define-view.png) 
+6. Click **Create As**.  
+   The _Create As_ dialog is displayed.
+   ![nation parquet]({{ site.baseurl }}/docs/img/odbc-create-as.png) 
+7. From the list of schemas, select the schema that defines the location for saving the view.
For example, accept the [dfs.tmp]({{site.baseurl}}/docs/query-directory-functions/#query-directory-function-example)
schema because the default `dfs` storage plugin defines the `tmp` directory as writable.
    You can save views only to file-based schemas.  
-10. In the **View Name** field, enter a descriptive name for the view.  
+8. In **View Name**, enter a name for the view.  
     Do not include spaces in the view name.  
-11. Click **Save**.   
-    The status and any error message associated with the view creation displays in
-the Create As dialog. When a view saves successfully, the Save button changes
-to a Close button.  
-12. Click **Close**.
+9. Click **Save** and check **Overwrite Existing Views** if you want to save over an existing
view.   
+    The status message associated appears.  
+10. Click **Close**.
+
+Views that you create using the Drill Explorer do not appear under the schema
+associated with the data source type. Access the views from
+the file-based schema that you selected when saving the view.
+
+## Specifying Column Names
+
+Use of the SQL asterisk (*) selector to return all columns in a table is limited. Tableau
might not connect to your Drill data source successfully using
+the SQL view that Drill Explorer creates. Modify the
+queries generated by Drill Explorer to specify columns to return based on the following
+syntax guidelines, depending on the schema type or file format.
+
+Specify individual columns when defining a view in Drill Explorer instead of attempting to
select all, as shown in the following examples.
+
+`SELECT CAST(account['name'] AS varchar(20)) FROM hbase.students`
+
+`SELECT CAST(column1 AS varchar(20)) FROM `dfs`.`default`.`./opt/drill/test.parquet``
+
+`SELECT column1 FROM `dfs`.`default`.`./opt/drill/interval.json``
+
+To query nested elements, use the following syntax, where menu is a child of column1:
+
+`SELECT column1['menu'] FROM `dfs`.`default`.`./opt/drill/interval.json``
+
+You can query elements that are multiple levels deep. Continuing the example, if
+menuitem is a child of menu, then use the following syntax:
+
+`SELECT column1['menu']['menuitem'] FROM `dfs`.`default`.`./opt/drill/interval.json``
+
+## Casting Data Requirements
+
+In SQL statements, you need to cast
+binary data to another format explicitly to view the data. For example, the following query
+displays results from an HBase database in binary format:  
+`SELECT account['name'] FROM hbase.students`
+
+The following query displays the same results in string format:  
+`SELECT CAST(account['name'] AS varchar(20)) FROM
+hbase.students`
+
+The following query displays results from a Parquet file in binary format:  
+`SELECT column1 FROM `dfs`.`default`.`./opt/drill/test.parquet``
+
+The following query displays the same results in string format:
 
+`SELECT CAST(column1 AS varchar(20)) FROM `dfs`.`default`.`./opt/drill/test.parquet``
 
+You can also cast the data as other data types, such as integer or date formats/


Mime
View raw message