Data Lake Selective Reads: Optimizing S3 and Azure Storage

Updated

7 min read

Watercolour illustration of a shallow glass basin of blue cubes, with light falling on only a few of them
In this article
  1. Quick answer
  2. What to check before you design the read path
  3. Parquet: skip data before you read it
  4. Byte-range reads on S3
  5. S3 Select: why it is not the default answer
  6. Azure Data Lake Storage query acceleration
  7. Which to pick, by use case
  8. FAQ
  9. Is S3 Select still available?
  10. Can Azure query acceleration run joins?
  11. Does a Parquet reader need special tools to skip data?
  12. Are byte-range reads the same as reading part of a Parquet file?

A Data Lake query should read only the bytes it needs. Selective reads do that in three ways. The file format lets a reader skip row groups and pages using statistics. The client asks storage for a byte range instead of a whole object. Some storage services filter rows and columns before the data leaves the cloud. This article explains how each mechanism works on Amazon S3 and Azure Storage, what the vendors document as limits, and where each one fits. The article analyses vendor documentation and standards. It does not benchmark anything.

Quick answer

For most Data Lake workloads, start with columnar files such as Parquet, because the reader can skip data on its own. Use byte-range reads when your client already knows the offsets. Treat server-side filtering as a niche option with limits. On S3, the older S3 Select feature is closed to new customers, so do not design a new system around it. On Azure, Data Lake Storage query acceleration filters CSV and JSON files on the storage side, with no joins or group-by aggregates.

MechanismWhere it runsWhat the vendor documentsMain limit
Columnar file skipping (Parquet statistics and page index)The reader, on any object storeOptional per-column statistics for data pages can be used to skip pagesOnly helps when the writer stored statistics and the data layout lets them filter
Byte-range GET (S3 GetObject with Range)The storage API, on S3The Range header downloads a byte range; S3 does not return several ranges in one GETThe client must know the offsets, usually from file metadata
Server-side filter and column projection (Azure Data Lake Storage query acceleration)Azure storage, per requestOnly rows that match the predicate cross the network; CSV and JSON inputNo joins or group-by aggregates; one file per request; billed on data scanned and returned
S3 SelectAmazon S3Closed to new customers; existing customers can keep using itNot a path for new projects

What to check before you design the read path

  • File format: is the data stored in a columnar format with statistics? If it is CSV or JSON, a reader has to scan more bytes before it can filter.
  • Engine support: does the query engine push predicates and column selections down to the file reader? Check the engine’s own documentation for the version you run.
  • Access pattern: many small reads of one file favour byte ranges. Scans across many files favour a layout that lets the engine skip whole files.
  • Cost model: storage vendors charge for requests, for data scanned and for data returned. Read the current price page for each service before comparing options.

Parquet: skip data before you read it

A Parquet file is organised in row groups. A row group holds one column chunk for each column, and each column chunk is made of pages. The Apache Parquet project describes this layout in its file format documentation, which is the reference for any engine that reads the format.

The part that saves reads is the statistics. Parquet stores minimum and maximum values, so a reader can decide that a row group or page cannot match a filter and skip it. The Page Index adds two optional per-column structures to the row group metadata. The column index holds statistics for data pages, which lets a reader find matching pages without reading the others. The offset index lets a reader move to a page by row number.

The practical consequence is that the layout written upstream matters as much as the query. If values for a column are spread across every row group, the statistics cannot exclude much. If the writer sorts or clusters the data by the column that queries filter on, the statistics can exclude most row groups. That is a property of how the data is written, so the pipeline design decides it.

Byte-range reads on S3

S3 supports the HTTP Range header on GetObject. A client can request one byte range of an object, and the AWS SDK reference for the range parameter points to the HTTP range semantics in RFC 9110. The SDK documentation also states that S3 does not support retrieving several ranges in one GET request. A reader that needs three separate pieces of a file sends three requests.

The S3 performance guidance on byte-range fetches describes using several concurrent connections to fetch different ranges of the same object. It also notes that smaller ranges can make retries cheaper when a request is interrupted. Both points are about throughput and resilience. Neither changes what is billed, so count the requests as well as the bytes.

Byte-range reads also have a gotcha with S3 Object Lambda. By default, an Object Lambda access point returns HTTP 501 (Not Implemented) to a GetObject or HeadObject request that contains a Range or partNumber parameter. The owner of the access point has to add GetObject-Range to the AllowedFeatures list before range requests work through it. Check this setting if your pipeline puts a Lambda transform in front of the bucket.

S3 Select: why it is not the default answer

S3 Select let applications run a SQL expression against one object and return only the matching rows or columns. AWS now states that the feature is no longer available to new customers, and that existing customers can keep using it as usual. The S3 user guide links to an AWS Storage Blog post about optimising queries for other options.

For a new Data Lake, that means S3 Select should not be the core of the design. Use a query engine that reads Parquet with predicate pushdown, or filter on the client after a byte-range read. If you already run S3 Select, check your account’s eligibility and the migration options in the AWS documentation before you plan around it.

Azure Data Lake Storage query acceleration

Microsoft’s query acceleration feature accepts filtering predicates and column projections in a request. Filtering happens in storage, so only the data that meets the predicate is sent back to the application. The input must be CSV or JSON, and each request processes one file.

The feature does not support advanced SQL features such as joins and group-by aggregates, so it works as a filter rather than a query engine. It works with blobs in storage accounts that do not have a hierarchical namespace, as well as with Data Lake Storage accounts. Pricing has two parts: a charge for the amount of data scanned and a charge for the amount of data returned to the caller. The Microsoft Learn page does not state whether the feature is in preview or generally available, so confirm that status before you plan a production workload.

Because the feature bills for data scanned, it can cost more than a plain read when the predicate keeps most rows. It helps most when a request returns a small share of a large CSV or JSON file. For Parquet files, the reader’s own pruning is usually the better first step.

Which to pick, by use case

If your data is already Parquet, rely on the engine’s pruning first. Write statistics, sort or cluster by the columns your queries filter on, and keep file sizes reasonable so the engine does not open thousands of tiny objects.

If a service reads one known piece of a large object, use a byte-range read. Read the footer or index first, then request only the ranges you need, and run the requests concurrently.

If you hold CSV or JSON on Azure and each request filters one file, query acceleration can fit, as long as the query needs no joins or aggregates and the scanned-data cost is acceptable for your volumes.

If you start a new S3 project, do not choose S3 Select. Use Parquet with a query engine, or byte-range reads with client-side filtering. Check your legal duties for any personal data stored in the lake with counsel before you decide retention or deletion rules.

FAQ

Is S3 Select still available?

Existing customers can keep using it. AWS states that it is no longer available to new customers.

Can Azure query acceleration run joins?

No. The Microsoft Learn page says the feature does not support advanced relational features such as joins and group-by aggregates.

Does a Parquet reader need special tools to skip data?

No special service is needed. A reader that supports the statistics and the page index can skip row groups and pages on its own. The file must have been written with those statistics.

Are byte-range reads the same as reading part of a Parquet file?

They are the same mechanism at the storage level. A Parquet reader reads the file metadata first, then requests only the byte ranges of the column chunks and pages it needs.

About the author

Equipe Gui Tech

68 articles published

The Gui Tech team researches, verifies and updates every guide with verifiable sources. Enterprise tech, AI and security explained.

All articles

Keep reading