%3CLINGO-SUB%20id%3D%22lingo-sub-1075336%22%20slang%3D%22en-US%22%3EPolybase%20for%20beginners.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1075336%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%22toc-hId-358472469%22%20id%3D%22toc-hId-358472469%22%3EPolybase%20for%20beginners.%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20regards%20to%20Polybase%2C%20I%20have%20seen%20some%20confusion%20from%20customers%20about%20what%20it%20is%2C%20the%20problems%20that%20it%20solves%20and%20when%20to%20use%20it%3B%20so%20I%20decided%20to%20come%20up%20with%20a%20brief%20blog%20post%20to%20explain%20Polybase%20in%20some%20short%20paragraphs.%3C%2FP%3E%0A%3CP%3EHopefully%20after%20reading%20this%20you%20will%20walk%20out%20with%20a%20good%20enough%20grasp%20of%20it%2C%20even%20if%20you%20are%20completely%20new%20to%20this%20topic.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1049033943%22%20id%3D%22toc-hId-1049033943%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--758420520%22%20id%3D%22toc-hId--758420520%22%3EWhat%20is%20data%20virtualization%3F%3C%2FH2%3E%0A%3CP%3EIn%20simple%20terms%20data%20virtualization%20means%20querying%20external%20data%20objects%20from%20a%20database%20as%20if%20they%20were%20local%20objects.%20The%20most%20basic%20example%20is%20to%20make%20a%20third%20party%20database%20table%20(such%20as%20Oracle)%20available%20for%20queries%20as%20if%20it%20was%20a%20SQL%20Server%20table.%3C%2FP%3E%0A%3CP%3EPolybase%20is%20SQL%20Server%E2%80%99s%202019%20data%20virtualization%20solution.%20SQL%20Server%20can%20now%20be%20the%20central%20hub%20for%20all%20your%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F162652iFB2EE0577A63EFE8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_0.png%22%20title%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1729092313%22%20id%3D%22toc-hId-1729092313%22%3EWhen%20to%20use%20it%3F%3C%2FH2%3E%0A%3CP%3EIt%20is%20common%20to%20see%20a%20wide%20variety%20of%20data%20sources%20and%20data%20platforms%20in%20modern%20organizations.%20By%20using%20data%20virtualization%20over%20disparate%20data%20sources%2C%20you%20get%20the%20following%20benefits%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EA%20common%20language%20to%20query%20the%20data.%20Your%20staff%20does%20not%20need%20to%20learn%20several%20different%20programming%2Fquery%20languages%20and%20you%20can%20combine%20data%20using%20a%20unifying%20paradigm.%3C%2FLI%3E%0A%3CLI%3EA%20common%20model%20for%20security.%20You%20can%20leverage%20the%20SQL%20Server%20and%20Active%20Directory%20permissions%20to%20simplify%20authentication%20and%20security%20administration.%3C%2FLI%3E%0A%3CLI%3ENo%20need%20to%20move%20the%20data%20and%20increase%20the%20stewardship.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--78362150%22%20id%3D%22toc-hId--78362150%22%3ESo%2C%20this%20replaces%20data%20movement%3F%20I%20no%20longer%20need%20Extract%20Transform%20Load%20jobs%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20depends%20on%20the%20scenario.%20If%20all%20you%20do%20with%20your%20data%20movement%20process%20is%20moving%20data%20for%20one%20database%20to%20another%20(for%20example%20Mongo%20to%20SQL%20SERVER)%2C%20data%20virtualization%20can%20very%20well%20fulfill%20the%20requirement.%3C%2FP%3E%0A%3CP%3EIf%20you%20need%20to%20process%20unstructured%20or%20semi%20structured%20files%20coming%20from%20an%20external%20source%2C%20where%20you%20cannot%20trust%20the%20validity%20of%20the%20data%20and%20you%20need%20to%20take%20actions%20regarding%20discarded%20rows%20and%20other%20types%20of%20data%20processing%3B%20your%20ETL%20packages%20are%20still%20necessary.%20Hopefully%2C%20this%20problem%20of%20format%20untrustworthiness%20in%20data%20exchange%20will%20become%20less%20of%20an%20issue%20in%20the%20future%20as%20data%20format%20standards%20are%20adopted%20and%20stricter%20data%20stewardship%20is%20implemented%20across%20organizations.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1885816613%22%20id%3D%22toc-hId--1885816613%22%3EIsn%E2%80%99t%20this%20the%20same%20functionality%20that%20linked%20servers%20have%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELinked%20servers%20also%20allow%20for%20querying%20external%20data%20from%20SQL%20server%20however%20there%20are%20some%20key%20differences%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EA%20linked%20server%20is%20a%20data%20source%20definition%20at%20the%20server%20level.%20Polybase%20objects%20represent%20not%20just%20the%20data%20source%20but%20the%20metadata%20for%20the%20tables%2C%20giving%20a%20more%20richer%20integration%20model%20out%20of%20the%20box%2C%20for%20the%20reasons%20I%20just%20explained%20in%20the%20previous%20section.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWith%20linked%20there%20will%20be%201%20thread%20(either%20in%20process%20or%20out%20of%20process)%20will%20be%20used%20in%20sql%20server%20during%20the%20reading%20from%20the%20data%20source.%20Polybase%20has%20dedicated%20services%20for%20processing%20and%20moving%20the%20external%20data.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ELinked%20servers%20support%20data%20modification%20while%20Polybase%20doesn%E2%80%99t.%20Polybase%20was%20conceived%20as%20a%20technology%20for%20mainly%20reading%20data.%20This%20may%20change%20in%20the%20future.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ELinked%20servers%20use%20OLEDB%20while%20Polybase%20uses%20ODBC.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPolybase%20offers%20out%20of%20the%20box%20support%20for%20SQL%20Server%2C%20Oracle%2C%20Teradata%2C%20MongoDB%2C%20Azure%20Blob%20Storage%20and%20Hadoop.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-601696220%22%20id%3D%22toc-hId-601696220%22%3EWhat%20are%20OLEDB%20and%20ODBC%3F%20How%20are%20they%20different%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBoth%20ODBC%20and%20OLEDB%20are%20application%20programing%20interfaces%20for%20connecting%20to%20databases%20and%20both%20specifications%20were%20developed%20by%20Microsoft.%20They%20define%20a%20set%20of%20methods%20as%20well%20as%20datatypes%20that%20serve%20as%20a%20common%20interface%20for%20clients%20to%20read%20data.%3C%2FP%3E%0A%3CP%3EInterestingly%20enough%2C%20OLEDB%20is%20a%20newer%20more%20feature%20rich%20technology%2C%20but%20ODBC%20is%20now%20preferred%20mostly%20due%20to%20having%20much%20wider%20adoption.%3C%2FP%3E%0A%3CP%3ETo%20use%20an%20ODBC%20connection%2C%20you%20must%20install%20the%20ODBC%20driver%20for%20the%20database%20you%20want%20to%20connect%20to.%20After%20the%20installation%20program%20registers%20the%20driver%20you%20can%20review%20your%20installed%20client%20drivers%20using%20the%20ODBC%20Data%20Source%20Administrator%20(64-Bit).%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20459px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F162651iBC6F6A39137F7073%2Fimage-dimensions%2F459x332%3Fv%3D1.0%22%20width%3D%22459%22%20height%3D%22332%22%20alt%3D%22clipboard_image_4.png%22%20title%3D%22clipboard_image_4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1205758243%22%20id%3D%22toc-hId--1205758243%22%3EWhat%20it%20means%20exactly%20to%20have%20%22out%20of%20the%20box%22%20support%20for%20SQL%20Server%2C%20Oracle%2C%20Teradata%2C%20MongoDB%2C%20Azure%20Blob%20Storage%20and%20Hadoop%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20it%20means%20that%20you%20don%E2%80%99t%20need%20to%20install%20any%20drivers%20for%20these%20data%20sources%2C%20Microsoft%20provides%20its%20own%20out%20of%20the%20box.%20You%20will%20use%20a%20specific%20%E2%80%9Cnative%20protocol%E2%80%9D%20name%20in%20the%20data%20source%20location%20definition.%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20to%20define%20an%20Oracle%20data%20source%20the%20command%20would%20be%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3ECREATE%20EXTERNAL%20DATA%20SOURCE%3C%2FFONT%3E%20external_data_source_name%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3EWITH%3C%2FFONT%3E%20(LOCATION%20%3D%20'%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3E%3CU%3Eoracle%3C%2FU%3E%3C%2FSTRONG%3E%3A%2F%2F%3CSERVER%20address%3D%22%22%3E%5B%3A%3CPORT%3E%5D%3C%2FPORT%3E%3C%2FSERVER%3E%3C%2FFONT%3E'%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20CREDENTIAL%20%3D%20credential_name)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20SQL%20Server%20an%20Oracle%2C%20it%20also%20means%20native%20support%20for%20partitioned%20tables.%20Polybase%20can%20read%20different%20partitions%20using%20multiple%20workers%20concurrently%20in%20a%20scale%20out%20group%20(scale%20out%20groups%20are%20a%20discussion%20for%20another%20day).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1281754590%22%20id%3D%22toc-hId-1281754590%22%3EUse%20Example%3A%20Oracle%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20suppose%20that%20you%20want%20to%20access%20a%20table%20named%20PERSON%20on%20an%20Oracle%20contained%20database%20named%20%26nbsp%3BCDB1%2C%20from%20a%20SQL%20SERVER%202019%20instance%20with%20the%20Polybase%20feature%20installed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnsure%20your%20database%20has%20a%20master%20key%20created.%20If%20not%20you%20will%20need%20to%20create%20one.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3ECREATE%20MASTER%20KEY%20ENCRYPTION%20BY%20PASSWORD%3C%2FFONT%3E%20%3D%20%3CFONT%20color%3D%22%23FF0000%22%3E'StrongP%40ssword1'%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECreate%20credential%20(username%2Fpassword%20pair)%20to%20connect%20to%20your%20Oracle%20database.%20The%20credentials%20are%20safely%20stored%20in%20your%20database%20using%20the%20DB%E2%80%99s%20master%20key.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3ECREATE%20DATABASE%20SCOPED%20CREDENTIAL%3C%2FFONT%3E%20%5BORA_C_HR%5D%20%3CFONT%20color%3D%22%230000FF%22%3EWITH%3C%2FFONT%3E%20IDENTITY%20%3D%20%3CFONT%20color%3D%22%23FF0000%22%3EN'C%23%23HR'%3C%2FFONT%3E%2C%20Secret%20%3D%20%3CFONT%20color%3D%22%23FF0000%22%3E'StrongP%40ssword1'%3C%2FFONT%3E%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20create%20the%20datasource%20definition.%3C%2FP%3E%0A%3CP%3EThe%20data%20source%20requires%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20location%3A%20This%20is%20a%20URL%20that%20contains%20the%20location%20prefix%20(the%20data%20source%20type%2C%20oracle%2C%20sqlserver%2C%20odbc%2C%20etc.)%2C%20the%20name%20of%20the%20server%20and%20the%20port.%3C%2FLI%3E%0A%3CLI%3EThe%20credential%20to%20connect.%3C%2FLI%3E%0A%3CLI%3EAny%20additional%20options%20for%20the%20driver%20in%20the%20form%20of%20a%20connection%20string%20can%20be%20passed%20using%20the%20CONNECTION_OPTIONS%20parameter.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMore%20info%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Ft-sql%2Fstatements%2Fcreate-external-data-source-transact-sql%3Fview%3Dsql-server-ver15%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Ft-sql%2Fstatements%2Fcreate-external-data-source-transact-sql%3Fview%3Dsql-server-ver15%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20suppose%20that%20your%20server%20is%20named%20oraserver%20and%20listens%20in%20the%20default%20port%20(1521).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CFONT%20color%3D%22%230000FF%22%3ECREATE%20EXTERNAL%20DATA%20SOURCE%3C%2FFONT%3E%20%5BORA_SERVER%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CFONT%20color%3D%22%230000FF%22%3EWITH%3C%2FFONT%3E%20(LOCATION%20%3D%20%3CFONT%20color%3D%22%23FF0000%22%3EN'oracle%3A%2F%2Foraserver%3A1521'%3C%2FFONT%3E%2C%20CREDENTIAL%20%3D%20%5BORA_C_HR%5D)%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20you%20can%20create%20the%20table.%20In%20this%20example%20the%20table%20is%20named%20%E2%80%9CPerson%E2%80%9D%20and%20is%20under%20the%20USER%20C%23%23HR%20in%20the%20database%20CDB1%2C%20this%20is%20specified%20in%20the%20LOCATION%20option%20for%20the%20CREATE%20TABLE%20statement.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CFONT%20color%3D%22%230000FF%22%3ECREATE%20EXTERNAL%20TABLE%3C%2FFONT%3E%20dbo.%5BPERSON%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20(%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%5BID%5D%20DECIMAL(38%2C0)%20NOT%20NULL%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%5BNAME%5D%20VARCHAR(100)%26nbsp%3B%26nbsp%3B%26nbsp%3B%20COLLATE%20Latin1_General_100_BIN2_UTF8%20NOT%20NULL%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CFONT%20color%3D%22%230000FF%22%3EWITH%3C%2FFONT%3E%20(LOCATION%20%3D%20%3CFONT%20color%3D%22%23FF0000%22%3EN'%5BCDB1%5D.%5BC%23%23HR%5D.%5BPERSON%5D'%3C%2FFONT%3E%2C%20DATA_SOURCE%20%3D%20%5BORA_SERVER%5D)%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20now%20query%20the%20table%20Person%20like%20if%20it%20was%20a%20SQL%20Server%20native%20table.%20Remember%20you%20cannot%20issue%20update%20or%20insert%20statements%2C%20only%20queries.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3ESELECT%3C%2FFONT%3E%20%3CFONT%20color%3D%22%230000FF%22%3ETOP%3C%2FFONT%3E%20100%20*%20%3CFONT%20color%3D%22%230000FF%22%3EFROM%3C%2FFONT%3E%20dbo.%5BPERSON%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20it%20for%20today%E2%80%99s%20post.%20Hopefully%2C%20you%20will%20have%20a%20better%20idea%20of%20what%20SQL%20SERVER%202019%20Polybase%20is.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20will%20be%20posting%20more%20in-depth%20examples%20for%20generic%20ODBC%20types%20in%20the%20next%20days.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegards.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1075336%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20regards%20to%20Polybase%2C%20I%20have%20seen%20some%20confusion%20from%20customers%20about%20what%20it%20is%2C%20the%20problems%20that%20it%20solves%20and%20when%20to%20use%20it%3B%20so%20I%20decided%20to%20come%20up%20with%20a%20brief%20blog%20post%20to%20explain%20Polybase%20in%20some%20short%20paragraphs.%3C%2FP%3E%0A%3CP%3EHopefully%20after%20reading%20this%20you%20will%20walk%20out%20with%20a%20good%20enough%20grasp%20of%20it%2C%20even%20if%20you%20are%20completely%20new%20to%20this%20topic.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1075336%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQL%202019%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Polybase for beginners.

 

In regards to Polybase, I have seen some confusion from customers about what it is, the problems that it solves and when to use it; so I decided to come up with a brief blog post to explain Polybase in some short paragraphs.

Hopefully after reading this you will walk out with a good enough grasp of it, even if you are completely new to this topic.

 

What is data virtualization?

In simple terms data virtualization means querying external data objects from a database as if they were local objects. The most basic example is to make a third party database table (such as Oracle) available for queries as if it was a SQL Server table.

Polybase is SQL Server’s 2019 data virtualization solution. SQL Server can now be the central hub for all your data.

 

 

clipboard_image_0.png

When to use it?

It is common to see a wide variety of data sources and data platforms in modern organizations. By using data virtualization over disparate data sources, you get the following benefits:

  • A common language to query the data. Your staff does not need to learn several different programming/query languages and you can combine data using a unifying paradigm.
  • A common model for security. You can leverage the SQL Server and Active Directory permissions to simplify authentication and security administration.
  • No need to move the data and increase the stewardship.

 

So, this replaces data movement? I no longer need Extract Transform Load jobs?

 

This depends on the scenario. If all you do with your data movement process is moving data for one database to another (for example Mongo to SQL SERVER), data virtualization can very well fulfill the requirement.

If you need to process unstructured or semi structured files coming from an external source, where you cannot trust the validity of the data and you need to take actions regarding discarded rows and other types of data processing; your ETL packages are still necessary. Hopefully, this problem of format untrustworthiness in data exchange will become less of an issue in the future as data format standards are adopted and stricter data stewardship is implemented across organizations.

 

 

Isn’t this the same functionality that linked servers have?

 

Linked servers also allow for querying external data from SQL server however there are some key differences:

  • A linked server is a data source definition at the server level. Polybase objects represent not just the data source but the metadata for the tables, giving a more richer integration model out of the box, for the reasons I just explained in the previous section.

 

  • With linked there will be 1 thread (either in process or out of process) will be used in sql server during the reading from the data source. Polybase has dedicated services for processing and moving the external data.

 

  • Linked servers support data modification while Polybase doesn’t. Polybase was conceived as a technology for mainly reading data. This may change in the future.

 

  • Linked servers use OLEDB while Polybase uses ODBC.

 

  • Polybase offers out of the box support for SQL Server, Oracle, Teradata, MongoDB, Azure Blob Storage and Hadoop.

 

 

 

 

What are OLEDB and ODBC? How are they different?

 

Both ODBC and OLEDB are application programing interfaces for connecting to databases and both specifications were developed by Microsoft. They define a set of methods as well as datatypes that serve as a common interface for clients to read data.

Interestingly enough, OLEDB is a newer more feature rich technology, but ODBC is now preferred mostly due to having much wider adoption.

To use an ODBC connection, you must install the ODBC driver for the database you want to connect to. After the installation program registers the driver you can review your installed client drivers using the ODBC Data Source Administrator (64-Bit).

 

clipboard_image_4.png

 

What it means exactly to have "out of the box" support for SQL Server, Oracle, Teradata, MongoDB, Azure Blob Storage and Hadoop?

 

First, it means that you don’t need to install any drivers for these data sources, Microsoft provides its own out of the box. You will use a specific “native protocol” name in the data source location definition.

For example, to define an Oracle data source the command would be like this:

 

CREATE EXTERNAL DATA SOURCE external_data_source_name

WITH (LOCATION = 'oracle://<server address>[:<port>]',

      CREDENTIAL = credential_name)

 

For SQL Server an Oracle, it also means native support for partitioned tables. Polybase can read different partitions using multiple workers concurrently in a scale out group (scale out groups are a discussion for another day).

 

Use Example: Oracle

 

Let’s suppose that you want to access a table named PERSON on an Oracle contained database named  CDB1, from a SQL SERVER 2019 instance with the Polybase feature installed.

 

Ensure your database has a master key created. If not you will need to create one.

 

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'StrongP@ssword1'

 

 

Create credential (username/password pair) to connect to your Oracle database. The credentials are safely stored in your database using the DB’s master key.

 

 

CREATE DATABASE SCOPED CREDENTIAL [ORA_C_HR] WITH IDENTITY = N'C##HR', Secret = 'StrongP@ssword1';

 

 

Now create the datasource definition.

The data source requires:

  • The location: This is a URL that contains the location prefix (the data source type, oracle, sqlserver, odbc, etc.), the name of the server and the port.
  • The credential to connect.
  • Any additional options for the driver in the form of a connection string can be passed using the CONNECTION_OPTIONS parameter.

 

More info: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-external-data-source-transact-sql?view=...

 

Let’s suppose that your server is named oraserver and listens in the default port (1521).

 

 

        CREATE EXTERNAL DATA SOURCE [ORA_SERVER]

            WITH (LOCATION = N'oracle://oraserver:1521', CREDENTIAL = [ORA_C_HR]);

 

 

Now you can create the table. In this example the table is named “Person” and is under the USER C##HR in the database CDB1, this is specified in the LOCATION option for the CREATE TABLE statement.

 

 

        CREATE EXTERNAL TABLE dbo.[PERSON]

        (

            [ID] DECIMAL(38,0) NOT NULL,

            [NAME] VARCHAR(100)    COLLATE Latin1_General_100_BIN2_UTF8 NOT NULL

        )

        WITH (LOCATION = N'[CDB1].[C##HR].[PERSON]', DATA_SOURCE = [ORA_SERVER]);

 

 

You can now query the table Person like if it was a SQL Server native table. Remember you cannot issue update or insert statements, only queries.

 

 

SELECT TOP 100 * FROM dbo.[PERSON]

 

 

This is it for today’s post. Hopefully, you will have a better idea of what SQL SERVER 2019 Polybase is.

 

I will be posting more in-depth examples for generic ODBC types in the next days.

 

Regards.