Skip to content

staticSchema error in chapter 3 in s #62

@LeilaGhods

Description

@LeilaGhods

I get the following error in the running of the following code from Chapter 3 (Structured Streaming)

in Python

streamingDataFrame = spark.readStream
.schema(staticSchema)
.option("maxFilesPerTrigger", 1)
.format("csv")
.option("header", "true")
.load("/data/retail-data/by-day/*.csv")

NameError: name 'staticSchema' is not defined

NameError Traceback (most recent call last)
in
2 #How many files read together is identified by maxFilesPerTrigger
3 streamingDataFrame = spark.readStream
----> 4 .schema(staticSchema)
5 .option("maxFilesPerTrigger", 1)
6 .format("csv")\

NameError: name 'staticSchema' is not defined

Can anyone guide me about it? I am running the code on Databricks community cluster.

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions