Improve performance of Parquet external tables using new native technology in dedicated SQL pools

Published Jun 03 2021 09:30 AM 5,030 Views
Microsoft

Azure Synapse Analytics enables you to read Parquet files stored in the Azure Data Lake storage using the T-SQL language and high-performance Parquet readers. The key characteristic of these high-performance Parquet readers is that they are using the native (C++) code for reading Parquet files, unlike the existing Polybase Parquet reader technology that uses the Java code. These native readers are introduced in the serverless SQL pools in Azure Synapse Analytics workspaces.

 

In many experiments, this native technology that is used in the serverless SQL pools demonstrated better performance compared to the existing Polybase external table in the dedicated SQL pools.

 

This native technology for reading Parquet files is now also available in the dedicated SQL pools. In the dedicated Pools in Azure Synapse Analytics, you can create external tables that use native code to read Parquet files and improve performance of your queries that access external Parquet files.

 

NOTE: The native external tables are in the gated public preview.  If you want to try this feature, fill-in this form and we will contact you, or check with your MSFT contacts or product group how to try this.

 

In this post you will see how to use these new external tables and what are the benefits.

 

What are you getting with this new technology?

 

First let’s clarify what new with this improvement:

Before: You could use only Polybase TYPE=HADOOP external tables to read the Parquet files using the dedicated SQL pools. Polybase TYPE=HADOOP tables are based on Java code and don’t have expected performance in some cases because Java data structures must be converted to the native structures.

 

Now: In addition to Polybase TYPE=HADOOP external tables, you can use a new type of native external tables that are much faster. The native external tables are implemented using the native code and have better performance. The new native tables and the existing Polybase TYPE=HADOOP external tables can be used on the same dedicated pool.

 

In the following section you will see how to get 10x better performance while accessing external Parquet files just by removing TYPE option from the external data source.

 

Hadoop vs native external tables

 

In dedicated SQL pools you can use two types of tables:

  • Hadoop external tables – The exiting Polybase Hadoop external table that leverage Java technology to read external Parquet files. This is the existing technology that is Generally Available.
  • Native external tables – new external tables that use the native Parquet readers. This feature is currently in gated public preview.

The only syntax difference in these two table types are the external data source definitions:

The syntax for the external tables is the same in both cases – you just need to create an external table on top of data source that you created with or without TYPE option. The external table will use native code or Java code depending on the TYPE attribute in the underlying EXTERNAL DATA SOURCE object.

 

The query experience is not changed. Once you create external tables you can use them in any query.

 

Performance comparison

 

The main benefit of this new technology is performance. Let’s compare the performance of the 22 T-SQL queries derived from the TPC-H benchmark, executed using the existing Hadoop external tables (red) and the new native external tables (green). All queries are executed on the same 100GB set of Parquet organized in the TPC-H table structure:

polybase-vs-native-100gb.png

(Note: smaller is better)

 

On the chart you can see that all T-SQL queries are running faster with the native external tables. The queries are running on the same Parquet data set from the same dedicated pool instance with the size 2000 DWU. The only difference is the TYPE parameter in the external data source.

 

IMPORTANT: This is not an official TPC-H benchmark. The queries are executed on the Parquet data set that has the same schema as TPC-H tables, but the distribution of data is not identical to the official TPC-H benchmark. You might get different results on your 100GB data sets, due to different data distribution.

 

Another interesting experiment shows the performance comparison of the existing Polybase tables on top of 100GB data set compared to the native external tables on top of 1TB Parquet data set (10x bigger data set):

polybase-vs-native.png

 (Note: smaller is better)

 

With the new native tables (green bars), we are getting better performance on most of the queries although the test is running on 10x bigger data set.

 

Conclusion

 

The native external tables in the dedicated SQL pools in Azure Synapse analytics are the new technology that will boost performance of your queries that use the external tables on top of Parquet files.

 

Just by removing the TYPE option in the external data source, you can get 5-10x better performance without up-scaling your dedicated pools even on the 10x bigger data sets.

 

If you want to try this feature, fill-in this form and we will contact you.

This feature is in public preview, and we would appreciate your feedback. You can add your suggestions in Azure Synapse Analytics Feedback site.

1 Comment
%3CLINGO-SUB%20id%3D%22lingo-sub-2413152%22%20slang%3D%22en-US%22%3EImprove%20performance%20of%20Parquet%20external%20tables%20using%20new%20native%20technology%20in%20dedicated%20SQL%20pools%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2413152%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20Synapse%20Analytics%20enables%20you%20to%20read%20Parquet%20files%20stored%20in%20the%20Azure%20Data%20Lake%20storage%20using%20the%20T-SQL%20language%20and%20high-performance%20Parquet%20readers.%20The%20key%20characteristic%20of%20these%20high-performance%20Parquet%20readers%20is%20that%20they%20are%20using%20the%20native%20(C%2B%2B)%20code%20for%20reading%20Parquet%20files%2C%20unlike%20the%20existing%20Polybase%20Parquet%20reader%20technology%20that%20uses%20the%20Java%20code.%20These%20native%20readers%20are%20introduced%20in%20the%20serverless%20SQL%20pools%20in%20Azure%20Synapse%20Analytics%20workspaces.%3C%2FP%3E%0A%3CP%3EIn%20many%20experiments%2C%20this%20native%20technology%20that%20is%20used%20in%20the%20serverless%20SQL%20pools%20demonstrated%20better%20performance%20compared%20to%20the%20existing%20Polybase%20external%20table%20in%20the%20dedicated%20SQL%20pools.%3C%2FP%3E%0A%3CP%3EThis%20native%20technology%20for%20reading%20Parquet%20files%20is%20now%20also%20available%20in%20the%20dedicated%20SQL%20pools.%20In%20the%20dedicated%20Pools%20in%20Azure%20Synapse%20Analytics%2C%20you%20can%20create%20external%20tables%20that%20use%20native%20code%20to%20read%20Parquet%20files%20and%20improve%20performance%20of%20your%20queries%20that%20access%20external%20Parquet%20files.%3C%2FP%3E%0A%3CP%3ENOTE%3A%20The%20native%20external%20tables%20are%20in%20the%20gated%20public%20preview.%20Check%20with%20your%20MSFT%20contacts%20or%20product%20group%20how%20to%20try%20this.%3C%2FP%3E%0A%3CP%3EIn%20this%20post%20you%20will%20see%20how%20to%20use%20these%20new%20external%20tables%20and%20what%20are%20the%20benefits.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--442061175%22%20id%3D%22toc-hId--442061175%22%20id%3D%22toc-hId--442061175%22%20id%3D%22toc-hId--442061175%22%3EWhat%20are%20you%20getting%20with%20this%20new%20technology%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%20let%E2%80%99s%20clarify%20what%20new%20with%20this%20improvement%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EOld%20state%3A%3C%2FSTRONG%3E%20You%20could%20use%20only%20Polybase%20TYPE%3DHADOOP%20external%20tables%20to%20read%20the%20Parquet%20files%20using%20the%20dedicated%20SQL%20pools.%20Polybase%20TYPE%3DHADOOP%20tables%20are%20based%20on%20Java%20code%20and%20don%E2%80%99t%20have%20expected%20performance%20in%20some%20cases%20because%20Java%20data%20structures%20must%20be%20converted%20to%20the%20native%20structures.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ECurrent%20state%3A%3C%2FSTRONG%3E%20In%20addition%20to%20Polybase%20TYPE%3DHADOOP%20external%20tables%2C%20you%20can%20use%20a%20new%20type%20of%20native%20external%20tables%20that%20are%20much%20faster.%20The%20native%20external%20tables%20are%20implemented%20using%20the%20native%20code%20and%20have%20better%20performance.%20The%20new%20native%20tables%20and%20the%20existing%20Polybase%20TYPE%3DHADOOP%20external%20tables%20can%20be%20used%20on%20the%20same%20dedicated%20pool.%3C%2FP%3E%0A%3CP%3EIn%20the%20following%20section%20you%20will%20see%20how%20to%20get%2010x%20better%20performance%20while%20accessing%20external%20Parquet%20files%20just%20by%20removing%20TYPE%20option%20from%20the%20external%20data%20source.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-2045451658%22%20id%3D%22toc-hId-2045451658%22%20id%3D%22toc-hId-2045451658%22%20id%3D%22toc-hId-2045451658%22%3EHadoop%20vs%20native%20external%20tables%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20dedicated%20SQL%20pools%20you%20can%20use%20two%20types%20of%20tables%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EHadoop%20external%20tables%20%E2%80%93%20The%20exiting%20Polybase%20external%20table%20that%20leverage%20Java%20technology%20to%20read%20external%20Parquet%20files.%20This%20is%20the%20existing%20technology%20that%20is%20Generally%20Available.%3C%2FLI%3E%0A%3CLI%3ENative%20external%20tables%20%E2%80%93%20new%20external%20tables%20that%20use%20the%20native%20Parquet%20readers.%20This%20feature%20is%20currently%20in%20gated%20public%20preview.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20only%20syntax%20difference%20in%20these%20two%20table%20types%20are%20the%20external%20data%20source%20definitions%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EIf%20you%20want%20to%20use%20the%20existing%20Polybase%20external%20tables%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsynapse-analytics%2Fsql%2Fdevelop-tables-external-tables%3Ftabs%3Dhadoop%23syntax-for-create-external-data-source%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecreate%20an%20external%20data%20source%20with%20TYPE%3DHADOOP%20option%3C%2FA%3E.%3C%2FLI%3E%0A%3CLI%3EIf%20you%20want%20to%20use%20the%20new%20native%20external%20tables%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsynapse-analytics%2Fsql%2Fdevelop-tables-external-tables%3Ftabs%3Dnative%23syntax-for-create-external-data-source%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecreate%20an%20external%20data%20source%20without%20TYPE%20option%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20syntax%20for%20the%20external%20tables%20is%20the%20same%20in%20both%20cases%20%E2%80%93%20you%20just%20need%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsynapse-analytics%2Fsql%2Fdevelop-tables-external-tables%3Ftabs%3Dhadoop%23syntax-for-create-external-table%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ecreate%20an%20external%20table%20on%20top%20of%20data%20source%3C%2FA%3E%20that%20you%20created%20with%20or%20without%20TYPE%20option.%20The%20external%20table%20will%20use%20native%20code%20or%20Java%20code%20depending%20on%20the%20TYPE%20attribute%20in%20the%20underlying%20EXTERNAL%20DATA%20SOURCE%20object.%3C%2FP%3E%0A%3CP%3EThe%20query%20experience%20is%20not%20changed.%20Once%20you%20create%20external%20tables%20you%20can%20use%20them%20in%20any%20query.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-237997195%22%20id%3D%22toc-hId-237997195%22%20id%3D%22toc-hId-237997195%22%20id%3D%22toc-hId-237997195%22%3EPerformance%20comparison%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20main%20benefit%20of%20this%20new%20technology%20is%20performance.%20Let%E2%80%99s%20compare%20the%20existing%20Hadoop%20external%20tables%20(red)%20with%20the%20new%20native%20external%20tables%20(green)%20in%20the%20TPCH%20benchmark%20executed%20on%20the%20same%20100GB%20TPCH%20Parquet%20data%20set%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JovanPop_0-1622737375643.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F286008i14FCA53FF175C826%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22JovanPop_0-1622737375643.png%22%20alt%3D%22JovanPop_0-1622737375643.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E(Note%3A%20smaller%20is%20better)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20chart%20you%20can%20see%20that%20all%20TPCH%20queries%20are%20running%20faster%20with%20the%20native%20external%20tables.%20The%20TPCH%20queries%20are%20running%20on%20the%20same%20Parquet%20data%20set%20from%20the%20same%20dedicated%20pool%20instance%20with%20the%20size%202000%20DWU.%20The%20only%20difference%20is%20the%20TYPE%20parameter%20in%20the%20external%20data%20source.%3C%2FP%3E%0A%3CP%3EAnother%20interesting%20experiment%20shows%20the%20performance%20comparison%20of%20the%20existing%20Polybase%20tables%20on%20top%20of%20100GB%20TPCH%20data%20sets%20compared%20to%20the%20native%20external%20tables%20on%20top%20of%201TB%20Parquet%20data%20set%20(10x%20bigger%20data%20set)%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JovanPop_1-1622737375652.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F286007iA681DCA38E84CC6F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22JovanPop_1-1622737375652.png%22%20alt%3D%22JovanPop_1-1622737375652.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E(Note%3A%20smaller%20is%20better)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20the%20new%20native%20tables%20(green%20bars)%2C%20we%20are%20getting%20better%20performance%20on%20most%20of%20the%20queries%20although%20the%20test%20is%20running%20on%2010x%20bigger%20data%20set.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1569457268%22%20id%3D%22toc-hId--1569457268%22%20id%3D%22toc-hId--1569457268%22%20id%3D%22toc-hId--1569457268%22%3EConclusion%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20native%20external%20tables%20in%20the%20dedicated%20SQL%20pools%20in%20Azure%20Synapse%20analytics%20are%20the%20new%20technology%20that%20will%20boost%20performance%20of%20your%20queries%20that%20use%20the%20external%20tables%20on%20top%20of%20Parquet%20files.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EJust%20by%20removing%20the%20TYPE%20option%20in%20the%20external%20data%20source%2C%20you%20can%20get%205-10x%20better%20performance%20without%20up-scaling%20your%20dedicated%20pools%20even%20on%20the%2010x%20bigger%20data%20sets.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20feature%20is%20in%20public%20preview%2C%20and%20we%20would%20appreciate%20your%20feedback.%20You%20can%20add%20your%20suggestions%20in%20%3CA%20href%3D%22https%3A%2F%2Ffeedback.azure.com%2Fforums%2F307516-azure-synapse-analytics%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAzure%20Synapse%20Analytics%20Feedback%20site%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2413152%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20native%20external%20tables%20in%20the%20dedicated%20SQL%20pools%20in%20Azure%20Synapse%20analytics%20are%20the%20new%20technology%20that%20will%20boost%20performance%20of%20your%20queries%20that%20use%20the%20external%20tables%20on%20top%20of%20Parquet%20files.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJust%20by%20removing%20the%20TYPE%20option%20in%20the%20external%20data%20source%2C%20you%20can%20get%205-10x%20better%20performance%20without%20up-scaling%20your%20dedicated%20pools%20even%20on%20the%2010x%20bigger%20data%20sets.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2413152%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESynapse%20SQL%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2485550%22%20slang%3D%22en-US%22%3ERe%3A%20Improve%20performance%20of%20Parquet%20external%20tables%20using%20new%20native%20technology%20in%20dedicated%20SQL%20pool%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2485550%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F296874%22%20target%3D%22_blank%22%3E%40JovanPop%3C%2FA%3E%26nbsp%3Bvery%20nice%20improvement.%20Will%20the%20native%20code%20also%20be%20implemented%20on%20COPY%20INTO%20when%20readying%20from%20parquet%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Sep 15 2021 11:59 AM
Updated by: