Certified Associate Developer for Apache Spark Practice Test
Certified Associate Developer for Apache Spark Practice Test practice questions, page 6 of 14, with answer review and explanations.
Question 26
Which of the following code blocks returns a new DataFrame where column productCategories only has one word per row, resulting in a DataFrame with many more rows than DataFrame storesDF? A sample of storesDF is displayed below:
Which of the following code blocks returns a new DataFrame with column storeDescription where the pattern "Description: " has been removed from the beginning of column storeDescription in DataFrame storesDF? A sample of DataFrame storesDF is below:
Which of the following code blocks returns a new DataFrame where column division from DataFrame storesDF has been replaced and renamed to column state and column managerName from DataFrame storesDF has been replaced and renamed to column managerFullName?
The code block shown contains an error. The code block is intended to return a new DataFrame where column sqft from DataFrame storesDF has had its missing values replaced with the value 30,000. Identify the error. A sample of DataFrame storesDF is displayed below: Code block: storesDF.na.fill(30000, col("sqft"))
The argument to the subset parameter of fill() should be a string column name or a list of string column names rather than a Column object.
The na.fill() operation does not work and should be replaced by the dropna() operation.
he argument to the subset parameter of fill() should be a the numerical position of the column rather than a Column object.
The na.fill() operation does not work and should be replaced by the nafill() operation.
The na.fill() operation does not work and should be replaced by the fillna() operation.
Question 30
Which of the following operations fails to return a DataFrame with no duplicate rows?