Certified Associate Developer for Apache Spark Practice Test
Certified Associate Developer for Apache Spark Practice Test practice questions, page 14 of 14, with answer review and explanations.
Question 66
Which of the following code blocks returns a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000?
storesDF.where(storesDF[sqft] > 25000)
storesDF.filter(sqft > 25000)
storesDF.filter("sqft" <= 25000)
storesDF.filter(col("sqft") <= 25000)
storesDF.where(sqft > 25000)
Question 67
Which of the following code blocks returns a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000 OR the value in column customerSatisfaction is greater than or equal to 30?
storesDF.filter(col("sqft") <= 25000 and col("customerSatisfaction") >= 30)
storesDF.filter(col("sqft") <= 25000 or col("customerSatisfaction") >= 30)
Question 68
The code block shown below should return a new DataFrame from DataFrame storesDF where column storeId is of the type string. Choose the response that correctly fills in the numbered blanks within the code block to complete this task. Code block: storesDF.__1__("storeId", __2__("storeId").__3__(__4__)