BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Combine SQL Server with Hadoop Using PolyBase

Combine SQL Server with Hadoop Using PolyBase

Leia em Português

This item in japanese

With the recently released SQL Server 2016, you can now use SQL queries against Hadoop and Azure blob storage. The technology, known as PolyBase, was previously available in SQL Server Parallel Data Warehouse.

As with linked servers, PolyBase attempts to offload as much of the processing as it can onto the source database. Then means that when executing a query against Hadoop or Azure blob storage, it will generate the appropriate map/reduce operations. This is known as a “pushdown” and it has limitations that the developer needs to be aware of:

SQL Server allows the following basic expressions and operators for predicate pushdown.

  • Binary comparison operators ( <, >, =, !=, <>, >=, <= ) for numeric, date, and time values.
  • Arithmetic operators ( +, -, *, /, % ).
  • Logical operators (AND, OR).
  • Unary operators (NOT, IS NULL, IS NOT NULL).

The documentation goes on to say that,

The operators BETWEEN, NOT, IN, and LIKE might be pushed-down. This depends on how the query optimizer rewrites them as a series of statements that use basic relational operators.

Pushdowns can be explicitly forced or disabled using OPTION (FORCE EXTERNALPUSHDOWN) and OPTION (DISABLE EXTERNALPUSHDOWN) respectively.

Combining Relational and Non-Relational Data

Since PolyBase is based on normal T-SQL, developers have access to the usual operations such as joins. This means you can execute a map-reduce operation against a Hadoop cluster, and then join the results to tables in your SQL Server database in a single query.

Import/Export

Moving data between SQL Server, Hadoop, and Azure blob storage no longer requires external ETL processes or tools. Instead, you use the same INSERT INTO/SELECT FROM syntax that you would use between any two normal tables. From a developer perspective, Hadoop and Azure blob storage are just two more table types to choose from when provisioning a database. (From an operations standpoint, you still need to manage security and backups separately.)

Rate this Article

Adoption
Style

BT