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
€25.99 €37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
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 : 9781835469682
Vendor :
Dremio
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Sep 30, 2024
Length: 406 pages
Edition : 2nd
Language : English
ISBN-13 : 9781835469682
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 73.96 94.97 21.01 saved
In-Memory Analytics with Apache Arrow
€25.99 €37.99
Principles of Data Science
€20.98 €29.99
Database Design and Modeling with PostgreSQL and MySQL
€26.99
Total 73.96 94.97 21.01 saved 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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.