Onglet Storage de la Spark UI
Un dossier sherlock_parts existe sur le disque et contient douze fichiers texte.
ls sherlock_parts
sherlock_part0.txt sherlock_part2.txt sherlock_part7.txt
sherlock_part1.txt sherlock_part3.txt sherlock_part8.txt
sherlock_part10.txt sherlock_part4.txt sherlock_part9.txt
sherlock_part11.txt sherlock_part5.txt
sherlock_part12.txt sherlock_part6.txt
Lors du chargement, cela crée un dataframe avec sept partitions.
partitioned_df = spark.read.text('sherlock_parts')
partitioned_df.rdd.getNumPartitions()
7
Une table est créée, et la table est mise en cache :
partitioned_df.createOrReplaceTempView('text')
spark.catalog.cacheTable('text')

Question : Qu’est-ce qui apparaîtra dans l’onglet Storage de la Spark UI une fois l’opération de cache déclenchée par une action ?
Cet exercice fait partie du cours
Introduction à Spark SQL en Python
Exercice interactif pratique
Passez de la théorie à la pratique avec l’un de nos exercices interactifs
Commencer l’exercice