DW(三):polybase基本理論

来源:http://www.cnblogs.com/tgzhu/archive/2016/09/18/5875038.html
-Advertisement-
Play Games

PolyBase is a technology that accesses and combines(整合) both non-relational and relational data, all from within SQL Server. It allows you to run quer ...


    PolyBase is a technology that accesses and combines(整合 both non-relational and relational data, all from within SQL Server. It allows you to run queries on external data in Hadoop or Azure blob storage. The queries are optimized(優化) to push computation to Hadoop

目錄:

  • feature
  • Performance
  • cale-out groups
  • use cases
  • 參考資料

feature


  •  By simply using Transact-SQL (T-SQL) statements, you an import and export data back and forth(反覆、來回 between relational tables in SQL Server and non-relational data stored in Hadoop or Azure Blob Storage. You can also query the external data from within a T-SQL query and join it with relational data
  • Query data stored in Hadoop: Users are storing data in cost-effective distributed and scalable systems(可伸縮系統), such as Hadoop. PolyBase makes it easy to query the data by using T-SQL
  • Query data stored in Azure blob storage: Azure blob storage is a convenient(方便) place to store data for use by Azure services. PolyBase makes it easy to access the data by using T-SQL.
  • Import data from Hadoop or Azure blob storage: Leverage the speed of Microsoft SQL's columnstore technology and analysis capabilities by importing data from Hadoop or Azure blob storage into relational tables. There is no need for a separate ETL or import tool
  • Export data to Hadoop or Azure blob storage: Archive data to Hadoop or Azure blob storage to achieve cost-effective storage and keep it online for easy access
  • Integrate with BI tools:Use PolyBase with Microsoft’s business intelligence and analysis stack, or use any third party tools that is compatible with SQL Server

Performance:


  • Push computation to Hadoop:The query optimizer (查詢優化器)makes a cost-based decision to push computation to Hadoop when doing so will improve query performance. It uses statistics on external tables to make the cost-based decision. Pushing computation creates MapReduce jobs and leverages Hadoop's distributed computational resources.
  • Scale compute resources:To improve query performance, you can use SQL Server PolyBase scale-out groups. This enables parallel data transfer between SQL Server instances and Hadoop nodes, and it adds compute resources for operating on the external data

cale-out groups:


  • polybase 使用單一的sqlserver 實例來處理基於hadoop 或 Azure blobl Storage 的大量數據集時,可能會出現性能瓶頸, group feature允許用戶創建 sqlserver instance 集群來處理擴展的大數據集
  • headnode:  The head node contains the SQL Server instance to which PolyBase queries are submitted. Each PolyBase group can have only one head node. A head node is a logical group of SQL Database Engine, PolyBase Engine and PolyBase Data Movement Service on the SQL Server instance
  • Compute node:A compute node contains the SQL Server instance that assists with(幫助) scale-out query processing on external data. A compute node is a logical group of SQL Server and the PolyBase data movement service on the SQL Server instance. A PolyBase group can have multiple compute nodes
  • Distributed query processing:
    1. PolyBase queries are submitted to the SQL Server on the head node. The part of the query that refers to external tables is handed-off (移交)to the PolyBase engine
    2. The PolyBase engine is the key component behind PolyBase queries. It parses the query on external data, generates the query plan and distributes the work to the data movement service on the compute nodes for execution. After completion of the work, it receives the results from the compute nodes and submits them to SQL Server for processing and returning to the client
    3. The PolyBase data movement service receives instructions(指令) from the PolyBase engine and transfers data between HDFS and SQL Server, and between SQL Server instances on the head and compute nodes
  • Editions availability:
    1. After setup of SQL Server, the instance can be designated(指定) as either a head node or a compute node.
    2. The choice depends on which version of SQL Server PolyBase is running on.
    3. On an Enterprise edition installation, the instance can be designated either as head node or a compute node.
    4. On a Standard edition, the instance can only be designated as a compute node

use cases


  • polybase primary use cases 如下圖:
  • (a) query submitted to PDW requires “unstructured” data from Hadoop for its execution. This might be as simple as a scan whose input is an HDFS file or a join between a file in HDFS and a table in PDW. The output in this case flows back to the user or application program that submitted the query
  • (b)  is similar except that the output of the query is materialized as an output file in HDFS, where it might be consumed by either a subsequent PDW query or by a MapReduce job. Polybase, when appropriate,will translate operations on HDFS-resident data into MapReduce jobs and push those jobs to Hadoop for execution in order to minimize the data imported from HDFS into PDW and maximize the use of Hadoop cluster resources. With Hadoop 2.0 we envision supporting a variety of techniques for processing joins that involve HDFS and PDW resident tables, including, for example, the use of semi-join techniques.

 

pushdown:


  • 和linked servers一樣,PolyBase會設法將儘量多的處理工作轉移到源資料庫。也就是說,當查詢Hadoop或Azure blob存儲時,會生成恰當的map/reduce操作。這就是所謂的“下推(pushdown)”,開發人員需要瞭解的下推限制:
    1. 用於數值、日期、時間值的二元比較操作符(<、>、=、!=、<>、>=、<=)
    2. 算術運算符( +、-、*、/、%)
    3. 邏輯運算符(AND、OR)
    4. 一元運算符(NOT、IS NULL、IS NOT NULL)
    5. BETWEEN、NOT、IN和LIKE操作符可能也可以下推。這取決於查詢優化器如何將它們改寫為一系列使用基本關係運算符的語句
    6. 下推可以通過OPTION (FORCE EXTERNALPUSHDOWN)顯式啟用,或通過OPTION (DISABLE EXTERNALPUSHDOWN)顯式禁用

參考資料


  • jdk: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  • 註意:英文版的window2012 OS 不支持安裝 sqlserver2016中文版

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 1.首先先看下什麼是MySQL。 MySQL是一個關係型資料庫管理系統,由瑞典MySQL AB 公司開發,目前屬於 Oracle 旗下產品。MySQL 最流行的關係型資料庫管理系統,其開放源碼這一特點,使得一般中小型網站的開發都選擇 MySQL 作為網站資料庫。 2、安裝。 安裝參考:http:// ...
  • 在取消執行 Restore HeaderOnly 命令時,發現取消不了,Session長時間處於PARALLEL_BACKUP_QUEUE 等待狀態。 官方文檔:Occurs when serializing output produced by RESTORE HEADERONLY, RESTOR ...
  • https://www.sitepoint.com/cursors-mysql-stored-procedures/ After my previous article on Stored Procedures was published on SitePoint, I received quite ...
  • 在Ubuntu 下配置 Mysql 的字元編碼。安裝完 Mysql 後,系統預設的字元編碼是 latin1 ,輸入的是中文,可是輸出卻是一堆亂碼。現在要做的就是把 Mysql的預設字元編碼設置為支持中文的編碼,如 GBK、GB23112、等。 說正經的,我大天朝程式員開發麵臨的兩座智障大山是編碼問題 ...
  • 好記心不如爛筆頭,很多東西當時沒記下來,過了就忘了,下次用到時又得浪費好多時間才能解決。今天又遇到修改MySQL預設字元集編碼的問題,折騰了半天解決了,趕快記錄下來,以後就不用每次折騰了。 查看MySQL字元集的命令是“show variables like '%char%';”。 以MySQL5. ...
  • 這是如何使用SQL server來 編寫 資料庫 表的 操作方式 學習要點: SQL之-建庫、建表、建約束、關係SQL基本語句大全.txt舉得起放得下叫舉重,舉得起放不下叫負重。頭要有勇氣,抬頭要有底氣。學習要加,驕傲要減,機會要乘,懶惰要除。人生三難題:思,相思,單相思。SQL之-建庫、建表、建約 ...
  • 目錄: Prerequisites 集群配置規劃 創建域控伺服器 polybase install firewall config 集群配置 刪除計算節點 install Prerequisites Microsoft .NET Framework 4.5 Oracle Java SE RunTim ...
  • 在mysql 中,索引可以分為兩種類型 hash索引和 btree索引。 什麼情況下可以用到B樹索引? 1.全值匹配索引 比如: orderID="123” 2.匹配最左首碼索引查詢 比如:在userid 和 date欄位上創建聯合索引。 那麼如果輸入 userId作為條件,那麼這個userid可以... ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...