CertLumen

Question of the day · Databricks

Databricks Certified Data Engineer Professional: today's question

Today · Developing Code for Data Processing using Python and SQL

A unit test calls assertDataFrameEqual(actual, expected, checkRowOrder=True) on the output of a groupBy().agg() transformation. It passes on a laptop but fails intermittently in CI, always with the same rows in a different order. Row order is not part of the function's contract. What should the engineer change?

  1. AAdd ignoreColumnOrder=True so that the comparison no longer depends on how the rows are ordered
  2. BRaise rtol so that rows that differ only in their position are treated as approximately equal
  3. CCall actual.coalesce(1) before the assertion so that Spark returns the rows in insertion order
  4. DDrop checkRowOrder=True; by default rows are compared regardless of their order
Show the answer

D. assertDataFrameEqual defaults to checkRowOrder=False, which compares rows as a multiset. Spark doesn't guarantee row order after a shuffle such as an aggregation, so forcing an order check on unsorted output makes a correct test flaky.

Written for practice in the style of the exam: never a question from the real exam. A new one every day.

Get one question a day by email

Each morning at 7 am your time, with the day before's answer. One click stops it.

We send a link to confirm the address first. See privacy.

Want ten more now?

The free readiness check asks ten questions weighted like the real exam and shows your score by section.

Take the free check

About the course · More practice questions · Other exams