Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Distributed Data Systems with Azure Databricks

You're reading from  Distributed Data Systems with Azure Databricks

Product type Book
Published in May 2021
Publisher Packt
ISBN-13 9781838647216
Pages 414 pages
Edition 1st Edition
Languages
Author (1):
Alan Bernardo Palacio Alan Bernardo Palacio
Profile icon Alan Bernardo Palacio

Table of Contents (17) Chapters

Preface Section 1: Introducing Databricks
Chapter 1: Introduction to Azure Databricks Chapter 2: Creating an Azure Databricks Workspace Section 2: Data Pipelines with Databricks
Chapter 3: Creating ETL Operations with Azure Databricks Chapter 4: Delta Lake with Azure Databricks Chapter 5: Introducing Delta Engine Chapter 6: Introducing Structured Streaming Section 3: Machine and Deep Learning with Databricks
Chapter 7: Using Python Libraries in Azure Databricks Chapter 8: Databricks Runtime for Machine Learning Chapter 9: Databricks Runtime for Deep Learning Chapter 10: Model Tracking and Tuning in Azure Databricks Chapter 11: Managing and Serving Models with MLflow and MLeap Chapter 12: Distributed Deep Learning in Azure Databricks Other Books You May Enjoy

Automating schema inference

The spark-tensorflow-connector library, which integrates Spark with TensorFlow, supports automatic schema inference when reading TensorFlow records into Spark DataFrames. Schema inference is an expensive operation because it requires an extra reading pass through the data, and therefore it's good practice to specify it as it will improve the overall performance of our pipeline.

The following Python code example demonstrates how we can do this on some test data we create as an example:

  1. Our first step is to define the schema of our data:
    from pyspark.sql.types import *
    path = "test-output.tfrecord"
    fields = [StructField("id", IntegerType()), 
    StructField("IntegerCol", IntegerType()),
    StructField("LongCol", LongType()), 
    StructField("FloatCol", FloatType()),
    StructField("DoubleCol", DoubleType()), 
    StructField("VectorCol", ArrayType(DoubleType(), 
        &...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}