Chapter 3 of 7 · Databricks Associate Developer for Apache Spark

Developing Apache Spark DataFrame/DataSet API Applications

Columns, joins, dates, I/O, UDFs and shared variables.

  • 6topics
  • 26 minfast track
  • 1diagrams and exhibits
  • 30%of the exam

Topics in this chapter

Take them in order, or jump to the one you need.

  1. 1Columns, Rows and Table StructuresSpark DataFrame API: add, drop, split and rename columns, filter rows, explode arrays and handle nulls, with the PySpark calls…4 min
  2. 2Deduplication, Validation and AggregationRemove duplicates with distinct and dropDuplicates, validate data for nulls, and aggregate with count, approx_count_distinct…4 min
  3. 3Dates, Sorting and DataFrame ConversionSpark date functions (from_unixtime, to_date, year, date_format), sorting, printSchema, collect and iteration, and DataFrame to…4 min
  4. 4Joins, Unions and Broadcast JoinsCombine Spark DataFrames with inner, left, cross and multiple key joins, union and unionByName, and use broadcast joins to avoid…Diagram5 min
  5. 5Reading and Writing DataFrames with SchemasRead and write DataFrames in PySpark with an explicit schema: StructType or DDL strings, read modes, save modes, overwrite…4 min
  6. 6UDFs, Broadcast Variables and AccumulatorsCreate and call PySpark UDFs, see where stateful processing and StateStores fit, and compare broadcast variables with…5 min

About this chapter

What this chapter covers

Developing Apache Spark DataFrame/DataSet API Applications is 30% of the Databricks Associate Developer for Apache Spark exam, the largest chapter by far. It covers the PySpark calls you use every day to transform, combine, read, write and extend DataFrames.

The chapter has six parts: changing columns, rows and structure; deduplication, validation and aggregation; dates, sorting and conversion to Python lists; joins, unions and broadcast joins; reading and writing with schemas; and UDFs with broadcast variables and accumulators.

Questions are single-answer multiple choice. Many show a short PySpark snippet in the stem or the options and ask what it returns, which line fixes it, or which call meets a requirement. There are no exhibits.

How the topics fit together

Read with a schemaReshapecolumns, rows, arraysClean and aggregatededup, validate, summarizeCombinejoins and unionsExtend and writeUDFs, save modes

You read data with a schema, reshape and clean it, add date logic, combine it with other DataFrames and write it out. UDFs and shared variables cover the cases where built in functions are not enough.

  • Column and row questions ask which call adds, renames, splits or explodes, and what a filter keeps.
  • Aggregation questions ask what count, approximate count distinct, describe and summary return.
  • Date questions ask which function converts epoch seconds or extracts a date part.
  • Join questions ask which join type returns which rows and when a broadcast helps.
  • I/O and UDF questions ask about save modes, schemas, return types and accumulator behavior.
Exam tip

Read what the call returns before you read the options. Many wrong answers are real functions that return a different type, such as a string instead of a date, or a DataFrame instead of a number.

How to use these pages

Each topic page has the same shape, so you can skim for what you need.

  • What it is: the idea in plain words.
  • How it works: the mechanism, with tables and examples.
  • What to remember for the exam: the facts to memorize and how questions are phrased.
  • Common mistakes: the classic traps.
  • Check yourself: three questions to test your understanding.

Ready for more practice?

The full Databricks Associate Developer for Apache Spark question bank has 600 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Databricks. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.