Skip to main content
PYSPARK โ€ข LESSON 269

Reading Cloud Storage with Recursive File Lookup

How can we read files from deeply nested non-standard directory trees recursively using wildcards?

Expertโฑ 3 Minutesโญ 880 XP
๐Ÿค” THE QUESTION

How can we read files from deeply nested non-standard directory trees recursively using wildcards?

๐Ÿ’ก WHAT IS IT?

Using recursiveFileLookup option traverses arbitrary nested directory hierarchies without requiring Hive partition syntax.

๐ŸŽฏ WHAT IS IT USED FOR?

Ingesting legacy FTP dumps, timestamped bucket folders, and third-party vendor landing zones.

๐Ÿ’ป EXAMPLE
df_recursive = spark.read.option("recursiveFileLookup", "true").parquet("s3://lakehouse/landing_zone/legacy_data/")

๐ŸŽฏ Mission Objectives

Practice typing production-grade PySpark code for Reading Cloud Storage with Recursive File Lookup.

  • โœ“ recursiveFileLookup option
  • โœ“ Arbitrary directory traversal
  • โœ“ Vendor landing zone ingestion