Azure Synapse SQL on-demand pagination (OFFSET/FETCH)

%3CLINGO-SUB%20id%3D%22lingo-sub-1830557%22%20slang%3D%22en-US%22%3EAzure%20Synapse%20SQL%20on-demand%20pagination%20(OFFSET%2FFETCH)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1830557%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22votecell%20post-layout--left%22%3E%3CDIV%20class%3D%22js-voting-container%20grid%20fd-column%20ai-stretch%20gs4%20fc-black-200%22%3E%3CDIV%20class%3D%22js-vote-count%20grid--cell%20fc-black-500%20fs-title%20grid%20fd-column%20ai-center%22%3E%3CSPAN%3EWe%20have%20Azure%20data%20lake%20-%20where%20the%20data%20is%20stored%20in%20parquet%20file%20format.%20We%20are%20trying%20to%20fetch%20the%20data%20from%20the%20parquet%20file%20using%20Azure%20synapse%20SQL-on%20Demand.%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22postcell%20post-layout--right%22%3E%3CDIV%20class%3D%22s-prose%20js-post-body%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20we%20are%20looking%20for%20is%20-%20pagination%20while%20fetching%20the%20data.%20So%20if%20there%20are%2010%2C000%20records%20matching%20to%20the%20criteria%2C%20we%20want%20to%20return%20only%20100%20rows%20on%20UI%20and%20then%20next%20100%20etc.%20In%20SQL%20query%20there%20is%20OFFSET%2FFETCH%20which%20we%20can%20use.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20to%20do%20such%20thing%20for%20SQL%20on-demand%20query%3F%20Here%20is%20our%20sample%20query%20of%20SQL%20on%20demand.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-sql%22%3E%3CCODE%3ESELECT%20*%20FROM%20%0A%20%20%20%20OPENROWSET%0A%20%20%20%20%20(%20%0A%20%20%20%20%20%20%20BULK%20'*.parquet'%2C%20%20%0A%20%20%20%20%20%20%20FORMAT%3D'PARQUET'%0A%20%20%20%20%20)%20%0A%20%20%20%20%20AS%20rows%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Visitor
We have Azure data lake - where the data is stored in parquet file format. We are trying to fetch the data from the parquet file using Azure synapse SQL-on Demand.

 

What we are looking for is - pagination while fetching the data. So if there are 10,000 records matching to the criteria, we want to return only 100 rows on UI and then next 100 etc. In SQL query there is OFFSET/FETCH which we can use.

 

How to do such thing for SQL on-demand query? Here is our sample query of SQL on demand.

 

 

 

SELECT * FROM 
    OPENROWSET
     ( 
       BULK '*.parquet',  
       FORMAT='PARQUET'
     ) 
     AS rows

 

 

 

0 Replies