DatabricksDatabricks
DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #81
DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Question #81: Real Exam Question with Answer & Explanation
The correct answer is D: 1. "Timestamp". See the full explanation below for the reasoning.
Performing Transformations on DataFrames
Question
Which of the following code blocks returns a DataFrame containing a column month, an integer representation of the day of the year from column openDate from DataFrame storesDF. Note that column openDate is of type integer and represents a date in the UNIX epoch format - the number of seconds since midnight on January 1st, 1970. A sample of storesDF is displayed below: Code block: stored.withColumn("openTimestamp", col("openDate").cast(__1__)) .withColumn(__2__, __3__(__4__))
Options
- A1. "Data"
- B1. "Timestamp"
- C1. "Timestamp"
- D1. "Timestamp"
Topics
#Spark DataFrames#Date/Time Functions#Data Type Casting#Column Operations
Community Discussion
No community discussion yet for this question.