Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
In-Memory Analytics with Apache Arrow
In-Memory Analytics with Apache Arrow

In-Memory Analytics with Apache Arrow: Accelerate data analytics for efficient processing of flat and hierarchical data structures , Second Edition

eBook
€20.98 €29.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

In-Memory Analytics with Apache Arrow

Getting Started with Apache Arrow

Regardless of whether you’re a data scientist/engineer, a machine learning (ML) specialist, or a software engineer trying to build something to perform data analytics, you’ve probably heard of or read about something called Apache Arrow and either looked for more information or wondered what it was. Hopefully, this book can serve as a springboard in understanding what Apache Arrow is and isn’t, as well as a reference book to be continuously utilized so that you can supercharge your analytical capabilities.

For now, we’ll start by explaining what Apache Arrow is and what you will use it for. Following that, we will walk through the Arrow specifications, set up a development environment where you can play around with the various Apache Arrow libraries, and walk through a few simple exercises so that you can get a feel for how to use them.

In this chapter, we’re going to cover the following topics:

  • Understanding...

Technical requirements

For the portion of this chapter that describes how to set up a development environment for working with various Arrow libraries, you’ll need the following:

  • Your preferred integrated development environment (IDE) – for example, VS Code, Sublime, Emacs, or Vim
  • Plugins for your desired language (optional but highly recommended)
  • An interpreter or toolchain for your desired language(s):
    • Python 3.8+: pip and venv and/or pipenv
    • Go 1.21+
    • C++ Compiler (capable of compiling C++17 or newer)

Understanding the Arrow format and specifications

The Apache Arrow documentation states the following [1]:

Apache Arrow is a development platform for in-memory analytics. It contains a set of technologies that enable big data systems to process and move data fast. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware.

Well, that’s a lot of technical jargon! Let’s start from the top. Apache Arrow (just Arrow for brevity) is an open source project from the Apache Software Foundation (https://apache.org) that is released under the Apache License, version 2.0 [2]. It was co-created by Jacques Nadeau and Wes McKinney, the creator of pandas, and first released in 2016. Simply put, Arrow is a collection of libraries and specifications that make it easy to build high-performance software utilities for processing and transporting large datasets. It consists of...

Why does Arrow use a columnar in-memory format?

There is often a lot of debate surrounding whether a database should be row-oriented or column-oriented, but this primarily refers to the on-disk format of the underlying storage files. Arrow’s data format is different from most cases discussed so far since it uses a columnar organization of data structures in memory directly. If you’re not familiar with columnar as a term, let’s take a look at what it means. First, imagine the following table of data:

Figure 1.3 – Sample data table

Figure 1.3 – Sample data table

Traditionally, if you were to read this table into memory, you’d likely have some structure to represent a row and then read the data in one row at a time – maybe something like struct { string archer; string location; int year }. The result is that you have the memory grouped closely together for each row, which is great if you always want to read all the columns for every row or are...

Learning the terminology and physical memory layout

As mentioned previously, the Arrow columnar format specification includes definitions of the in-memory data structures, metadata serialization, and protocols for data transportation. The format itself has a few key promises:

  • Data adjacency for sequential access
  • O(1) (constant time) random access
  • SIMD and vectorization-friendly
  • Relocatable, allowing for zero-copy access in shared memory

To ensure we’re all on the same page, here’s a quick glossary of terms that are used throughout the format specification and the rest of this book:

  • Array: A list of values with a known length of the same type.
  • Slot: The value in an array identified by a specific index.
  • Buffer/contiguous memory region: A single contiguous block of memory with a given length.
  • Physical layout: The underlying memory layout for an array without accounting for the interpretation of the logical value. For example...

Arrow format versioning and stability

To ensure confidence that updating the version of the Arrow library in use won’t break applications and the long-term stability of the Arrow project, two versions are used to describe each release of the project: the format version and the library version. Different library implementations and releases can have different versions, but they will always implement a specific format version. From version 1.0.0 onward, semantic versioning is used with releases.

Provided the major version of the format is the same between two libraries, any new library is backward-compatible with any older library with regards to being able to read data and metadata produced by an older library. Increases in the minor version of the format, such as an increase from version 1.0.0 to version 1.1.0, indicate new features that were added. So long as these new features are not used (such as new data types or physical layouts), older libraries will be able to read...

Would you download a library? Of course!

As mentioned previously, the Arrow project contains a variety of libraries for multiple programming languages. These official libraries enable anyone to work with Arrow data without having to implement the Arrow format themselves, regardless of the platform and programming language they are utilizing. There are two primary types of libraries that exist so far: ones that are distinct implementations of the Arrow specification, and ones that are built on other implementations. At the time of writing this book, there are implementations for Arrow in C++ [3], C# [4], Go [5], Java [6], JavaScript [7], Julia [8], and Rust [9], all of which are distinct implementations.

On top of those, there are libraries for C (Glib) [10], MATLAB [11], Python [12], R [13], and Ruby [14], all of which are built on top of the C++ library, which happens to have the most active development. As you might expect, the various implementations all have different stages...

Setting up your shooting range

By now, you should have a pretty solid understanding of what Arrow is, the basics of how it’s laid out in memory, and the basic terminology. So, let’s set up a development environment where you can test out and play with Arrow. For this book, I’m going to primarily focus on the three libraries that I’m most familiar with: the C++ library, the Python library, and the Go library. While the basic concepts will apply to all of the implementations, the precise APIs may differ between them. So, armed with the knowledge you’ve gained so far, you should be able to make sense of the documentation for your preferred language, even without precise examples for that language being printed here.

For each of C++, Python, and Go, after the instructions for installing the Arrow library, I’ll go through a few exercises to get you acquainted with the basics of using the Arrow library in that language.

The full code for all...

Summary

The goal of this chapter was to explain what Apache Arrow is, get you acquainted with the format, and have you use it in some simple use cases. This knowledge forms the baseline of everything else for us to talk about in the rest of this book!

Just as a reminder, you can check out this book’s GitHub repository (https://github.com/PacktPublishing/In-Memory-Analytics-with-Apache-Arrow-Second-Edition) for the solutions to the exercises presented here and for the full code samples so that you can make sure you understand the concepts!

The examples and exercises that were provided in this chapter are all fairly trivial and are meant to help reinforce the concepts that were introduced about Arrow’s format and specification while helping you get familiar with using Arrow in code.

In Chapter 2, Working with Key Arrow Specifications, you’ll learn how to read your data into the Arrow format, whether it’s on your local disk, Hadoop Distributed File...

References

Here’s a list of the references that were provided in this chapter – there were quite a lot!

  1. Apache Arrow documentation: https://arrow.apache.org/docs/
  2. Apache License 2.0: https://apache.org/licenses/LICENSE-2.0
  3. C++ Apache Arrow documentation: https://arrow.apache.org/docs/cpp/
  4. C# documentation for Arrow: https://github.com/apache/arrow/blob/master/csharp/README.md
  5. Golang documentation for Arrow: https://pkg.go.dev/github.com/apache/arrow/go/v7/arrow
  6. Java documentation for Arrow: https://arrow.apache.org/docs/java/
  7. JavaScript documentation for Arrow: https://arrow.apache.org/docs/js/
  8. Julia documentation for Arrow: https://arrow.apache.org/julia/stable/
  9. Rust documentation for Arrow: https://docs.rs/crate/arrow/
  10. Glib documentation for Arrow: https://arrow.apache.org/docs/c_glib/
  11. MATLAB documentation for Arrow: https://github.com/apache/arrow/blob/master/matlab/README.md
  12. Python documentation for Arrow: https...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore Apache Arrow's data types and integration with pandas, Polars, and Parquet
  • Work with Arrow libraries such as Flight SQL, Acero compute engine, and Dataset APIs for tabular data
  • Enhance and accelerate machine learning data pipelines using Apache Arrow and its subprojects
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Apache Arrow is an open source, columnar in-memory data format designed for efficient data processing and analytics. This book harnesses the author’s 15 years of experience to show you a standardized way to work with tabular data across various programming languages and environments, enabling high-performance data processing and exchange. This updated second edition gives you an overview of the Arrow format, highlighting its versatility and benefits through real-world use cases. It guides you through enhancing data science workflows, optimizing performance with Apache Parquet and Spark, and ensuring seamless data translation. You’ll explore data interchange and storage formats, and Arrow's relationships with Parquet, Protocol Buffers, FlatBuffers, JSON, and CSV. You’ll also discover Apache Arrow subprojects, including Flight, SQL, Database Connectivity, and nanoarrow. You’ll learn to streamline machine learning workflows, use Arrow Dataset APIs, and integrate with popular analytical data systems such as Snowflake, Dremio, and DuckDB. The latter chapters provide real-world examples and case studies of products powered by Apache Arrow, providing practical insights into its applications. By the end of this book, you’ll have all the building blocks to create efficient and powerful analytical services and utilities with Apache Arrow.

Who is this book for?

This book is for developers, data engineers, and data scientists looking to explore the capabilities of Apache Arrow from the ground up. Whether you’re building utilities for data analytics and query engines, or building full pipelines with tabular data, this book can help you out regardless of your preferred programming language. A basic understanding of data analysis concepts is needed, but not necessary. Code examples are provided using C++, Python, and Go throughout the book.

What you will learn

  • Use Apache Arrow libraries to access data files, both locally and in the cloud
  • Understand the zero-copy elements of the Apache Arrow format
  • Improve the read performance of data pipelines by memory-mapping Arrow files
  • Produce and consume Apache Arrow data efficiently by sharing memory with the C API
  • Leverage the Arrow compute engine, Acero, to perform complex operations
  • Create Arrow Flight servers and clients for transferring data quickly
  • Build the Arrow libraries locally and contribute to the community

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 30, 2024
Length: 406 pages
Edition : 2nd
Language : English
ISBN-13 : 9781835461228
Vendor :
Dremio
Category :
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 30, 2024
Length: 406 pages
Edition : 2nd
Language : English
ISBN-13 : 9781835461228
Vendor :
Dremio
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 94.97
In-Memory Analytics with Apache Arrow
€37.99
Principles of Data Science
€29.99
Database Design and Modeling with PostgreSQL and MySQL
€26.99
Total 94.97 Stars icon

Table of Contents

17 Chapters
Part 1: Overview of What Arrow is, Its Capabilities, Benefits, and Goals Chevron down icon Chevron up icon
Chapter 1: Getting Started with Apache Arrow Chevron down icon Chevron up icon
Chapter 2: Working with Key Arrow Specifications Chevron down icon Chevron up icon
Chapter 3: Format and Memory Handling Chevron down icon Chevron up icon
Part 2: Interoperability with Arrow: The Power of Open Standards Chevron down icon Chevron up icon
Chapter 4: Crossing the Language Barrier with the Arrow C Data API Chevron down icon Chevron up icon
Chapter 5: Acero: A Streaming Arrow Execution Engine Chevron down icon Chevron up icon
Chapter 6: Using the Arrow Datasets API Chevron down icon Chevron up icon
Chapter 7: Exploring Apache Arrow Flight RPC Chevron down icon Chevron up icon
Chapter 8: Understanding Arrow Database Connectivity (ADBC) Chevron down icon Chevron up icon
Chapter 9: Using Arrow with Machine Learning Workflows Chevron down icon Chevron up icon
Part 3: Real-World Examples, Use Cases, and Future Development Chevron down icon Chevron up icon
Chapter 10: Powered by Apache Arrow Chevron down icon Chevron up icon
Chapter 11: How to Leave Your Mark on Arrow Chevron down icon Chevron up icon
Chapter 12: Future Development and Plans Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(6 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Will Ayd Oct 15, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've worked in the open source analytics space for a while, and have always had a vague understanding of what the Apache Arrow project is. However, trying to piece the bigger picture together from the official documentation is challenging and leaves a lot to be desired.This book helped me understand core Arrow technologies like Acero, Flight, Flight SQL, and ADBC at a much deeper level. The detailed description of the Arrow array format is a great resource for developers, and the fact that examples are provided in C++, Python, and Go makes it easy to put the theory of Arrow into action into a language of your choice.I highly recommend this book to data engineers. Whether they are looking to build Arrow-based systems or just want to understand the technology better, this book is must-read.
Amazon Verified review Amazon
Martin Kysel Oct 03, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I'm someone who prefers structured learning over trial and error. When exploring new technology, I always seek out resources like this book that not only cover what I might discover on my own, but also guide me through the unknowns I wouldn't have thought to search for. I had heard of the Apache Arrow ecosystem but knew very little about it. This book has been incredibly helpful in navigating its complexities, including ADBC, Parquet, Flight, and much more. I am likely to come back to this book and use it as a reference in my future dealings with Apache Arrow.
Amazon Verified review Amazon
Nic Sep 30, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Matt does a great job of defining complex terminology in a way that makes the ideas accessible to readers. His tone is technical but conversational which makes this book enjoyable to read despite the highly technical nature of the content. I like the way the book covers both PyArrow and C++ so we can really see how Arrow is a standard with multiple implementations. I am a developer on the Apache Arrow project and have used a previous edition of this book to get to grips with some complex ideas when I found the project docs a bit too dense. Thanks Matt!
Amazon Verified review Amazon
Nicolay Gerold Sep 30, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am atm in process of developing an open source tool on top of arrow. This book is what got me started and helped me understand how Arrow works under the hood and how to work with it. Now also with a section on ML!!!!
Amazon Verified review Amazon
JT Oct 12, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As Arrow moves from up-and-coming to the de facto standard in data formats for in-memory and over-the-wire tabular data, the second, revised edition of Matt's book is a necessary read for anybody in data engineering, analytics and data science.The book serves both as a technical, hands-on introduction to Arrow and its rich ecosystem - PyArrow, Flight, Acero etc. - and as a reference for intermediate-to-advanced use cases - FFI, Arrow IPC, etc. The book guides the reader through the motivations behind the design choices, and explain how to effectively solve common data management problems leveraging Arrow strengths (code snippets are also available on GitHub!).As an entrepreneur building in the Arrow ecosystem, this is the book I give to every new hire to quickly build an accurate mental model of data best practices.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.