Friday, July 22, 2016

EXASOL - Query Tool Options

Tools to see inside EXASOL -  query and data


From what we have discovered, EXASOL has a split management approach.  General administrative functions are managed using a web portal, while data related functions are handled by a SQL query tool.  For this post our focus covers traditional DDL/DML tasks using a query styled tool.  In a future post, we'll look deeper into the web portal  'EXAoperation'  that supports general administration and operations.

If you are a SQL Server shop, and you use SQL Server Management Studio you already know that it is focused on SQL Server.  For EXASOL, SSMS is not an option.  So, while EXASOL provides the EXAplus query tool, we wanted to find out if other tools could be used to query EXASOL - from our experience, developers like to stay with the tools they have.  Plus, before moving into a new data framework, we like to know our options.  This is not by any means an exhaustive list. Just a short list of tools we have worked with in the past that we have found useful. Plus, the other tools are free.  

Summary

    Connecting to EXASOL:
Tool
Ubuntu
Windows 10
EXAplus, v 5.0.15
Success
Success
DBeaver, v3.7.1
Success (1)
Success (1)
SQuirreL SQL, v3.7.1
Success (2)
Success (2)
Oracle SQL Developer, v 4.1.3.20
n/a
Not Successful (3)

n/a:  at this time, we don't have these tools installed on the listed OS.

(1)  DBeaver had the EXASOL jdbc driver installed and/or recognized the existing driver.
(2)  We had to install the EXASOL jdbc driver manually
        see - 
SQuirreL SQL - Install JDBC Drivers to make the connection to EXASOL
(3)   SQL Developer is Java based, and supports third party JDBC drivers, so we are not sure
        why it could not make a connection.   (see the SQL Developer menu item:  
          Tools | Preferences | Database | Third Party JDBC Drivers)


Consider


For general query building, data review and general DDL/DML tasks, both EXAplus or DBeaver are good choices. And EXASOL's EXAplus tool has some nice data import and export tools, and it's good to spend some time with it since it is the provided tool. But, if you want to get a deeper look inside EXASOL, also consider SQuirreL SQL. It has a lot going on, so it might be confusing at first, but its object explorer gives you insight into the EXASOL system that EXAplus just does not have. The downside of SQuirreL SQL is that it's not user friendly when building complex SQL. Realistically, expect to use more than one tool.

EXASOL does have a metadata viewer, called the "Data Provider Metadata Viewer." According to the manual, it is installed when you install the ADO.NET driver.  This tool, rather than SQuirrel SQL might be the tool for you to explore the internals.

Other Tools

The three additional tools we looked at are Java based and use JDBC. EXASOL supports ADO.NET, ODBC and JDBC to connect to the database.  Based on this limited review, we suspect that if your tool is configured to support multiple databases using one of these protocols, there is a good chance it will work with EXASOL.

Thursday, July 21, 2016

EXASOL - Getting Started

Getting Started

EXASOL makes it easy, and inexpensive to get started. You can set it up on Azure or AWS, or download the free Community Edition VM download. We chose the VM. See EXASOL, an in-memory, MPP analytic database, for our overview of EXASOL and why we are taking a look at it.

VM Download

The EXASOL virtual machine download comes as an .ova file, compatible with VirtualBox, VMware Player or KVM.  Internally, the VM is running 64-bit CentOS. Using VirtualBox, we changed a few of the default configurations. The Community version supports up to 10GB of database memory, so we upgraded the default memory configuration to support 15GB, along with 4 processors. We also placed the VM on a dedicated spindle to minimize disk contention.

You can find the Community Edition here:   EXASOL DOWNLOAD Free Trial.

Drivers

Before you get started, download the associated drivers and tools. Find the Download Section here:  
EXASOL Download Section. These are ordered by version, so make a note of the version you just downloaded.

Drivers and tools are available for Windows/Mac/Linux/UNIX shops, depending on your needs:

  • EXAplus    (a query tool, similar to DBeaver, Oracle SQL Developer, SQL Server Mgmt Studio)
  • ADO.NET
  • JDBC
  • ODBC     (both 32 bit & 64 bit for Windows)
  • User Manual
  • SDK


EXAplus is Java based. We were able to get it up and running on both Ubuntu and Windows 10 with no problem.  We were also able to connect to EXASOL from DBeaver from both Ubuntu and Windows 10.

License Notes:  Community vs. Trial

While it's billed as a 'Free Trial', officially it's listed as a Community Edition. And looking over the Software | License section in the administration portal, my version has an unlimited expiration date and an unlimited database size. It is limited to a single cluster node with a maximum database memory of 10 GB.  And my non-legal review of the EXASolo License Agreement does not seem to prohibit me from using it internally for real work. That is excellent.  I can setup alpha/beta/proto-types, using real data for real work without worrying that it will implode at midnight, turning into an unusable tech-pumpkin. This allows you to learn, experiment and get work done. So if/when the data workload calls for more database memory or additional cluster nodes, you can do it at your pace.

Here is a listing of the Software License section from our VM's admin portal:


EXASOL, an in-memory, MPP analytic database

EXASOL - Extreme Analytic Solution


This week we started to look into EXASOL, an in-memory, MPP database focused on analytics.  So the question might be - why EXASOL?  We already have HP's Vertica, Teradata, and Microsoft's Analytics Platform System to name just a few.  For EXASOL, it was a combination of factors.
[see EXASOL for our expanding coverage]

VM's, the Cloud and the need for speed


The long term future for much of the database analytic world points to the cloud. Today, managing small data sets just might be cheaper on-site. Especially if you already have an IT team. Longer term, the cloud costs will drop, while we can expect that local administration costs will increase.  But with large data sets, and complex SAN's and data-backup protocols - the cloud is looking increasingly better.

Consider email. How many of us manage our email server? Or your customer relationship management system. Salesforce does a big business managing CRM.  And that takes us back to EXASOL.  Historically, virtually all of our work at Realized Design focuses on the Microsoft BI tool kit. It's easy to use, generally inexpensive and supports both on-premises and cloud installations. And with the recent release of the updated Power BI,  and the updated SQL Server Reporting Services, it has a lot to offer.  And, if you are a Microsoft shop, chances are slim that either Oracle or Teradata provide cost-effective alternatives. 

EXASOL, on the other hand, intrigues us. We noticed that it officially supported SSAS ROLAP as the backend. ROLAP in theory was great.  Use SSAS as the middle tier connected to a real-time database. Data could be inserted and updated in real-time, allowing users to immediately see the committed updates. Unfortunately, row-oriented databases were not designed for analysis.  They were designed when accounting was the primary system in use and why the ACID protocol was so important.

We first heard about EXASOL from reports about its performance on the TPC-H decision support benchmark. (see http://www.tpc.org/tpch/default.asp)   Looking over the results,  from small data sets (100GB) to large (100,000 GB), EXASOL's performance was orders of magnitude better compared to other solutions.


The future is the cloud, and EXASOL supports Microsoft's Azure, Amazon's AWS, EXASOL's own cloud and bigstep.  [I did not know bigstep either, but it sounds good]. And for an onsite review, a free, fully useable virtual machine version is offered.  
[see EXASOL for our expanding coverage]

Wednesday, July 13, 2016

REGEX - Regular Expressions Tutorial

For database professionals, transitioning from the LIKE command to regular expressions is not easy. Fortunately, you can find a great tutorial, along with a complete PDF on regular expressions at:

         http://www.regular-expressions.info/print.html


Tuesday, July 5, 2016

PolyBase - user pdw_user

Whom or what is the Hadoop user pdw_user?


If you have started to use PolyBase to connect to your Hadoop installation, you may have noticed that the user name pdw_user shows up when you insert records back to Hadoop from PolyBase.  You find this value in the database DWConfiguration:


       
    SELECT * FROM [DWConfiguration].[dbo].[configuration_properties]
      where [key] = 'HadoopUserName';
       
 

Which returns:

id
key
value
default
protection
access
datatype
Hadoop
HadoopUserName
NULL
pdw_user
0
0
string


There is little documentation, so its best not to make a change to this, or other values in the tables.





Have PolyBase INSERT create a new Directory for you

You can use PolyBase to create a new directory for you when you plan on inserting records from SQL Server.

In our earlier example ( see PolyBase - Insert data into new Hadoop Directory) we first created a new Directory in Hue. To skip that step, all you need to do is to append the new directory name on the the location path when you create your new external table in PolyBase.

Location path to existing directory:

       
       WITH (LOCATION='/user/hue/AWDW2012_SalesData',
       
 

Location path to new directory to be created:

       
      WITH (LOCATION='/user/hue/AWDW2012_SalesData/AWDW_FileNameTest',
       
 

When you run the INSERT, PolyBase instructs Hue to create the new folder.

PolyBase - Insert data into a Hadoop Hue Directory

You can use PolyBase as an ETL tool to insert data into your Hadoop installation from SQL Server. For this example, we will insert data from the Adventure Works data warehouse into a new, empty Hue Directory on HortonWorks. Please Note: this example installs data into the Hadoop file repository. We are not inserting data into a Hive or HCat table.

Summary:


  1. Hadoop: Create a new Directory in Hue **
  2. PolyBase: Create a new External Table pointing to the Directory
  3. Run your INSERT command


The Details:

With PolyBase, it inserts records into a directory (folder) - not a file. 
Using Hue, go to the file browser, and create a new Directory.

We named our new Directory: AWDW2012_SalesData.  (we are using an old Adventure Works data warehouse database for this example. No reason, it was just there.)




Navigate to the directory, and you'll see that it is empty.


Using the full directory path from Hue, create a new external table.  
(see Have PolyBase INSERT create a new Directory for you on how you can use the Create External Table DDL to instruct Hue to create a new Directory for you). 
DataTypes:  For our external table, our data types match exactly the data types in our SQL Server data warehouse. 

       
  CREATE EXTERNAL TABLE [dbo].AWDW_CSV_Sales_Date (
  ModelName  nvarchar(200) NULL ,
  ShipDate  datetime      NULL ,
  ExtendedAmt  money         NULL ,
  OrderQty  smallint   NULL 
 )
 WITH (LOCATION='/user/hue/AWDW2012_SalesData',
    DATA_SOURCE = hdp23 ,
    FILE_FORMAT = CSVfile  
    );       
 


Test your new external table.  Results will return an empty set:

       
      select  * from  [dbo].AWDW_CSV_Sales_Date;

     ModelName,ShipDate,ExtendedAmt,OrderQty
     (0 row(s) affected)
       
 


Now, all we need to do is run the INSERT.

       
   INSERT INTO  [dbo].AWDW_CSV_Sales_Date (ModelName, ShipDate, ExtendedAmt, OrderQty)
   SELECT top 100 p.[ModelName], s.[ShipDate], s.[ExtendedAmount], s.[OrderQuantity]
     FROM [AdventureWorksDW2012].[dbo].[FactInternetSales] as s 
 left outer join [AdventureWorksDW2012].[dbo].[DimProduct] as p 
           on s.[ProductKey] = p.[ProductKey];


   Results:

   (100 row(s) affected)
       
 

To test, re-run the select query: 

       
      select  * from  [dbo].AWDW_CSV_Sales_Date;


      ModelName,ShipDate,ExtendedAmt,OrderQty
      Road-150,2005-07-26 00:00:00.000,3578.27,1
      Road-150,2005-07-26 00:00:00.000,3578.27,1
      Road-150,2005-07-26 00:00:00.000,3578.27,1
      ...
      ...
     (100 row(s) affected)
       
 

Let's go back to Hadoop, and review the contents of the Hue directory. PolyBase created eight (8) files to hold 100 records.




With the PolyBase external table setup, you can insert additional records.