Polybase and Time Travel (Temporal Tables) Stan Geiger #492 | Phoenix 2016.

Slides:



Advertisements
Similar presentations
Roger Breu SQL Server PDW Solution Sales Microsoft Western Europe Microsoft Solutions for Big Data | Oct 17th 2013 From Numbers.
Advertisements

Danny Tambs Solution Architect. VOLUME (Size) VARIETY (Structure) VELOCITY (Speed)
1.Increasing data volumes 2.New data sources and types 3.Real-time data 4.Cloud-born data 5.Hybrid infrastructures “…data warehousing has reached.
Microsoft Ignite /16/2017 5:47 PM
Microsoft SQL Server x 46% 900+ For Hosting Service Providers
4 New Insights through Big Data New World of Big Data & DW – Yet another ‘Hype’? 5 … data warehousing has reached the most significant tipping point.
SQL Server 2014: The Data Platform for the Cloud.
SQL Server 2016 : New Features
Sponsorzy strategiczni Sponsorzy srebrni. PolyBase – data beyond tables Hubert Kobierzewski.
PolyBase in SQL Server 16 David J. DeWitt Rimma V. Nehme
SQL Server 2016 New Innovations. Microsoft Data Platform Relational Beyond Relational On-premises Cloud Comprehensiv e Connected Choice SQL Server Azure.
PolyBase Query Hadoop with ease Sahaj Saini SQL Server, Microsoft.
Azure SQL DW – Elastic Data Analytics in the cloud Josh Sivey | Microsoft TSP #492 | Phoenix.
Consistent experience is everything End-to-end mobile BI Advanced Analytics Enterprise-grade DW Mission critical OLTP Speed Agility Proven Feedback.
The Data Warehouse of the Future Where to Now? 1.
MSBIC Hadoop Series Hadoop & Microsoft BI Bryan Smith
SQL Server Evolution New innovations Jen Underwood Sr. Program Manager of Business Intelligence & Analytics Microsoft George Walters Sr. Technical Solutions.
OM. Platinum Level Sponsors Gold Level Sponsors Pre Conference Sponsor Venue Sponsor Key Note Sponsor.
Making Data Work for Everyone Gordon Phillips May 28, 2014.
Apache Hadoop on Windows Azure Avkash Chauhan
PolyBase Query Hadoop with ease Sahaj Saini Program Manager, Microsoft.
SQL Server 2016 editions – what’s new Express Mission critical performance SecurityData warehousing Business intelligence Advanced Analytics Hybrid cloud.
New BI Features SQL 2016 New features of SQL 2016.
Performance Monitoring for SQL Server Analysis Services Stan Geiger #506 | Baltimore BI 2016.
HDC: SQL Server 2016 New Features & Demos. Phil Brammer
With Temporal Tables and More
4/18/2018 6:56 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Data Platform and Analytics Foundational Training
Temporal Tables Sam Nasr, MCSA, MVP NIS Technologies July 22, 2017
What Is The SSIS Catalog and Why Do I Care?
PolyBase: T-SQL Reaching Beyond the Database
Katowice,
Temporal Databases Microsoft SQL Server 2016
System Center Marketing
System Center Marketing
Microsoft /2/2018 3:42 PM BRK3129 Query Big Data using the Expanded T-SQL footprint with PolyBase in SQL Server 2016 Casey Karst Program Manager.
Temporal Databases Microsoft SQL Server 2016
Introduction to SQL 2016 Temporal Tables
The Model Architecture with SQL and Polybase
A time travel with temporal tables
Couchbase Server is a NoSQL Database with a SQL-Based Query Language
Example of a page header
Polybase Didn’t That Go Out in the 70’s Stan Geiger.
Machine Learning, Analytics, & Data Science Conference
The Data Warehouse of the Future
A developers guide to Azure SQL Data Warehouse
Purpose, Pitfalls and Performance Implications
Traveling in time with SQL Server 2017
Big Data - in Performance Engineering
Purpose, Pitfalls and Performance Implications
A developers guide to Azure SQL Data Warehouse
20 Questions with Azure SQL Data Warehouse
Power BI for large databases
Azure SQL DWH: Optimization
Managing batch processing Transient Azure SQL Warehouse Resource
Cloud Data Replication with SQL Data Sync
Adding history to crud (Really) DINO ESPOSITO
Chapter 11 Managing Databases with SQL Server 2000
Applying Data Warehouse Techniques
Data Time Travel with Temporal Tables
Michelle Haarhues Keeping up with SSMS.
Applying Data Warehouse Techniques
Moving your on-prem data warehouse to cloud. What are your options?
Reinhard Flügel Possiblities and Limitations of System-Versioned Temporal Tables beyond the Basics.
Reinhard Flügel Possiblities and Limitations of System-Versioned Temporal Tables beyond the Basics.
Data Time Travel with Temporal Tables
Reinhard Flügel Possiblities and Limitations of System-Versioned Temporal Tables beyond the Basics.
SQL Server 2019 Bringing Apache Spark to SQL Server
Data Time Travel with Temporal Tables
Implementing ETL solution for Incremental Data Load in Microsoft SQL Server Ganesh Lohani SR. Data Analyst Lockheed Martin
Presentation transcript:

Polybase and Time Travel (Temporal Tables) Stan Geiger #492 | Phoenix 2016

Platinum Level Sponsors Gold Level Sponsors Pre Conference Sponsor Venue Sponsor Key Note Sponsor

Silver Level Sponsors Bronze Level Sponsors

About Me Sr. Product Manager with Idera Performance Monitoring of Microsoft BI stack Backup and Recovery of Microsoft SQL Server Geek Sync Presenter Blog Contributor HSSUG presenter Over 25 years experience BI, Data Architect DBA.Net Developer Data Analyst

Where in the world are we? 5 … data warehousing has reached the most significant tipping point since its inception. The biggest, possibly most elaborate data management system in IT is changing. – Gartner, “The State of Data Warehousing in 2012” Data sources ETL Data warehouse BI and analytics

The Cool Kid’s Data Warehouse 6

The Data Warehouse of the Future? Diverse Big Data Workload Centric Approach Data stored on multiple platforms Physically distributed data warehouse data warehouse appliances columnar RDBMSs NoSQL databases MapReduce tools, and HDFS. 7

The Data Warehouse of the Future…Its Here! 8

SQL Server Technology Drivers PolyBase JSON Data Temporal Tables In Memory Table ColumnStore Index

PolyBase 10

PolyBase Use T-SQL to store data in SQL Server from Hadoop or Azure as tables. Knowledge of Hadoop or Azure is not required to use. Pushes computation to where data resides Export relational data into Hadoop or Azure 11

PolyBase - External Tables, Data Sources & File Formats 12 SQL Server w/ PolyBase Social Apps Sensor &RFID Mobile Apps Web Apps Data Scientists, BI Users, DB Admins Your Apps PowerPivot PowerView PolyBase Split-Based Query Processing External Table External Data Source External File Format Hadoop Relational DW

PolyBase Scenarios Querying Run T-SQL over HDFS Combine data from different Hadoop clusters Join relational with non-relational data ETL Subset of Hadoop in Columnar Format Enable data aging scenarios to more economic storage Allows building of multi-temperate DW platforms SQL Server acts as hot query engine processing most recent data sets Aged data immediately accessible via external tables No need to groom data Hybrid (Azure Integration) Mesh-up on-premise and cloud apps Bridge between on-premise and Azure 13

PolyBase 1.Create external data source (Hadoop). 2.Create external file format (delimited text file). 3.Create external table pointing to file stored in Hadoop. 14 CREATE EXTERNAL TABLE [dbo].[CarSensor_Data] ( [SensorKey] int NOT NULL, [CustomerKey] int NOT NULL, [GeographyKey] int NULL, [Speed] float NOT NULL, [YearMeasured] int NOT NULL ) WITH (LOCATION='/Demo/car_sensordata.tbl', DATA_SOURCE = hdp2, FILE_FORMAT = ff2, REJECT_TYPE = VALUE, REJECT_VALUE = 0 CREATE EXTERNAL DATA SOURCE hdp2 with ( TYPE = HADOOP, LOCATION ='hdfs://10.xxx.xx.xxx:xxxx', RESOURCE_MANAGER_LOCATION='10.xxx.xx.xxx:xxxx') CREATE EXTERNAL FILE FORMAT ff2 WITH ( FORMAT_TYPE = DELIMITEDTEXT, FORMAT_OPTIONS (FIELD_TERMINATOR ='|', USE_TYPE_DEFAULT = TRUE)

PolyBase - Ad-Hoc Query joining relational with Hadoop data Who drives faster than 35 Miles > joining structured customer data stored in SQL Server with sensor data 15 SELECT DISTINCT Insured_Customers.FirstName, Insured_Customers.LastName, Insured_Customers.YearlyIncome, Insured_Customers.MaritalStatus into Fast_Customers from Insured_Customers INNER JOIN ( select * from CarSensor_Data where Speed > 35 ) as SensorD ON Insured_Customers.CustomerKey = SensorD.CustomerKey ORDER BY YearlyIncome CREATE CLUSTERED COLUMNSTORE INDEX CCI_FastCustomers ON Fast_Customers;

CHANGE THE CONFIG FILE!!!!!!!!!!!!!!!!!! 16 The user that is used to access Hadoop has to be configured. This block will need to be inserted into the DWEngineService.exe.config file in the applicationSettings block which should already exist. Anything besides PDW_User

Demo

Temporal Tables Temporal Table is really two tables. Data Table Historical Table (PERIOD) A temporal table can be defined as a table for which PERIOD definition exists comprising of system columns Slowly Changing Dimension Data Table is Type 1 Historical Table is Type 2 Recover accidental data changes 18

TEMPORAL TABLES  Slowly Changing Dimensions Type 1 Records will be updated with no history log Type 2 Keep history with a From Date and To Date Set existing record as obsolete (with setting the To Date) Create a new record (with new From Date) Type 3 Limited History Type 4 Similar to Type 2 but broken out as 2 tables.

Temporal Tables Requirements/Limitations Primary Key Two columns (start and end date as datetime2) In-Memory tables cannot be used INSERT and UPDATE not allowed on SYSTEM_TIME period columns History Table data cannot be changed. Regular queries only affect data in the current table. 20

Temporal Tables Example: 21 CREATE TABLE dbo.TestTemporal (ID int primary key, A int, B int, C AS A*B, SysStartTime datetime2 GENERATED ALWAYS AS ROW START NOT NULL, SysEndTime datetime2 GENERATED ALWAYS AS ROW END NOT NULL, PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime) ) WITH (SYSTEM_VERSIONING = ON);

TEMPORAL TABLES  Creating through SSMS 22

Temporal Tables The SELECT statement FROM claus e has a new clause FOR SYSTEM_TIME with four temporal-specific sub-clauses to query data across the current and history tables. Point in time: AS OF Exclusive bounds: FROM TO Inclusive lower bound, exclusive upper bound: BETWEEN AND Inclusive bounds: CONTAINED IN (, ) 23

Temporal Tables For example, if you want to look at the values active for customer 27 on the first of the year: … FROM Customer FOR SYSTEM_TIME AS OF ' ' WHERE CustomerID = 27 If instead you want to see every version of the users records for that day you could write: … FROM Customer FOR SYSTEM_TIME BETWEEN ' ' AND ' 'WHERE CustomerID = 27 24

Demo

Try any of our tools for free!