A data scientist wants to ingest a directory full of plain text files so that each record in the output DataFrame contains the entire contents of a single file and the full path of the file the text was read from. The first attempt at the code does read the text files but each record contains a single line. This code is shown below: raw_txt_path = '/datasets/raw_txt/*' corpus = spark.read.text(raw_txt_path)\ .select ("*', '_metadata.file path") Which code change can be implemented in a DataFrame that meets the data scientist’s requirements?
Select one answer.
Purchase Full Access to view answer options & explanation
The first 118 questions in this bank are completely free. Unlock Full Access on the exam page to view all answer choices, verified answers, explanations, and community discussions for all 392 questions.