Reputation: 429
This line of code converts a dataFrame to a logical plan
val logical = df.queryExecution.logical
Can we do the opposite, meaning extracting from the logical plan, the dataframes used ?
Upvotes: 3
Views: 1471
Reputation: 241
in Dataset object there is a method:
def ofRows(sparkSession: SparkSession, logicalPlan: LogicalPlan)
so if you have a logical plan, you can transform it into a DataFrame by calling Dataset.ofRows(sparkSession, logical)
Upvotes: 3