exam questions

Exam Certified Associate Developer for Apache Spark All Questions

View all questions & answers for the Certified Associate Developer for Apache Spark exam

Exam Certified Associate Developer for Apache Spark topic 1 question 110 discussion

The code block shown below contains an error. The code block intended to return a new DataFrame that is the result of an inner join between DataFrame storesDF and DataFrame employeesDF on column storeId. Identify the error.

Code block:

StoresDF.join(employeesDF, Seq("storeId")

  • A. The key column storeId needs to be a string like “storeId”.
  • B. The key column storeId needs to be specified in an expression of both Data Frame columns like storesDF.storeId ===employeesDF.storeId.
  • C. The default argument to the joinType parameter is “inner” - an additional argument of “left” must be specified.
  • D. There is no DataFrame.join() operation - DataFrame.merge() should be used instead.
  • E. The key column storeId needs to be wrapped in the col() operation.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
58470e1
2 months, 3 weeks ago
Selected Answer: A
Not sure why C was selected as it's indicating INNER which is the the default for Dataframe.join and requires a string column name)
upvoted 1 times
...
deadbeef38
7 months, 3 weeks ago
I don't see any error in the code other than a typo
upvoted 1 times
...
SaiPavan10
10 months, 1 week ago
Selected Answer: A
since the default join is inner so key column should be "StoreId"
upvoted 2 times
...
Sowwy1
10 months, 2 weeks ago
A is correct
upvoted 2 times
...
saryu
1 year ago
A is right
upvoted 1 times
...
newusername
1 year, 3 months ago
The answer (C) is just the most wrong that could have been here
upvoted 2 times
...
cookiemonster42
1 year, 6 months ago
I think the question is corrupt. The most plausible answer is A, even though the column name is already presented as a string.
upvoted 1 times
newusername
1 year, 3 months ago
yup, 100% is smth wrong, cause storesDF.join(employeesDF, Seq("storeId")) will work
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago