Exit DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Databricks Certified Associate Developer for Apache Spark 3.0
Question 5 of 5
0% complete
Q5 Single choice

Which of the following code blocks can be used to save DataFrame transactionsDf to memory only, recalculating partitions that do not fit in memory when they are needed?

  • A

    from pyspark import StorageLevel transactionsDf.cache(StorageLevel.MEMORY_ONLY)

  • B

    transactionsDf.cache()

  • C

    transactionsDf.storage_level('MEMORY_ONLY')

  • D

    transactionsDf.persist()

  • E

    transactionsDf.clear_persist()

  • F

    from pyspark import StorageLevel transactionsDf.persist(StorageLevel.MEMORY_ONLY)