Loading...

How to read Data Lake with Synapse Serverless – Part 1

How to read Data Lake with Synapse Serverless – Part 1

ryanjadams_0-1670518238006.png

 

Author: Ryan Adams is a Program Manager in Azure Synapse Customer Success Engineering (CSE) team. 

 

There are two ways to read data inside Data Lake using the Synapse Serverless engine.  In this article, we’ll look at the first method which uses OPENROWSET to query a path within the lake. 

 

Synapse is a collection of tools with four different analytical engines (Dedicated Pool, Spark Pool, Serverless Pool, Data Explorer Pool).  This gives you a lot of options for ingesting, transforming, storing, and querying your data.  The article will focus on how you can use the Synapse Serverless Pool to query the data in your ADLS account.   

 

Let's start by going to the Develop Hub and click the ellipsis that appears when you hover your cursor over the SQL Scripts heading.  That will open a drop-down menu where you can select “New SQL Script”.  Enter the code below into your script, make sure the “Connect To” box shows “Built-in” to use the serverless pool, and execute the script to read your data. 

 

ryanjadams_1-1670518278817.png

 

In my example, I have some IoT data representing temperatures from two different probes.  The data is stored in my lake using Parquet format.  Here are the options I have defined: 

 

  • BULK – This is the URI to my data lake and you can see I used a wildcard to grab all files ending in, .parquet (*.parquet).  If you only point to a folder or container, then it will read all files in that location. 
  • FORMAT – The OPENROWSET function supports three file formats (Parquet, Delta, and CSV) and I am telling it to expect Parquet. 

 

The last thing I do is order my results, so the newest events are at the top.  You can easily use the following code and change it to fit your environment and start querying data in your lake using the SQL language! 

 

SELECT     Temp1, Temp2, ArrivalTime FROM     OPENROWSET(         BULK 'https://YourStorageAccountName.dfs.core.windows.net/iot/bronze/temperature_raw/*.parquet',         FORMAT = 'PARQUET'     ) AS [PARQUET FORMAT] ORDER BY ArrivalTime DESC

 

 

Demo

Learn how to read Data Lake using OPENROWSET by checking out this video

 

 

Resources 

You can find more details and full documentation on the OPENROWSET command with this link.  For increased performance, it’s worth noting that we have two different parsers you can use, and you define that with the PARSER_VERSION option.  Check out an excellent video demonstration we have on CSV files and the two different parser versions. 

 

Our team publishes blog(s) regularly and you can find all these blogs here: https://aka.ms/synapsecseblog  

For deeper level understanding of Synapse implementation best practices, please refer our Success By Design (SBD) site: https://aka.ms/Synapse-Success-By-Design  

Published on:

Learn more
Need help with this product?

We can help you with How to read Data Lake with Synapse Serverless – Part 1

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Azure Synapse Analytics Blog articles
Azure Synapse Analytics Blog articles

Azure Synapse Analytics Blog articles

Share post:

Related posts

We're moving!

We’re moving to the Analytics on Azure Tech Community! All new Azure Synapse Analytics content will be published there. In the next few days a...

1 year ago

Upgrade to Azure Synapse runtimes for Apache Spark 3.4 & previous runtimes deprecation

It is important to stay ahead of the curve and keep services up to date. That's why we encourage all Azure Synapse customers with Apache ...

2 years ago

ADF\Synapse Analytics - Replace Columns names using Rule based mapping in Mapping data flows

In real time, the column names from source might not be uniform, some columns will have a space in it, some other columns will not. For exampl...

2 years ago

Interpreting Script activity output json with Azure Data Factory\Synapse analytics

Script activity in Azure Data Factory\ Synapse analytics is very helpful to run queries against data sources mentioned here in this document.&...

2 years ago

Synapse Connectivity Series Part #4 - Advanced network troubleshooting and network trace analysis

Continuing the series of this blog posts I would like to go more advanced on troubleshooting connectivity issues. I would like to thank also&n...

2 years ago

Boost your CICD automation for Synapse SQL Serverless by taking advantage of SSDT and SqlPackage CLI

Introduction   Azure Synapse Analytics Serverless SQL is a query service mostly used over the data in your data lake, for data discovery,...

2 years ago

Metadata-Based Ingestion in Synapse with Delta Lake

  Overview     The crucial first step in any ETL (extract, transform, load) process or data engineering program is ingestion, w...

3 years ago

Missing Fields Added to Dedicated SQL pool Diagnostic Settings Logs

Over the past year, customers have informed the team there were a set of key columns missing in the standalone Dedicated SQL pools (formerly S...

3 years ago

Using Azure DevOps with Synapse Workspaces to create hot fixes in production environments

Have you ever deployed a release to production only to find out a bug has escaped your testing process and now users are being severely impact...

3 years ago

Azure Synapse MVP Corner - March 2023

About this blog series Microsoft Most Valuable Professionals, or MVPs, are technology experts who passionately share their knowledge with the ...

3 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.