DataFrame operations and associated functions

DataFrames support untyped transformations with the following operations:

  • printSchema: This prints out the mapping for a Spark DataFrame in a tree structure. The following code will give you a clear idea of how this operation works:
//Scalaimport spark.implicits._// Print the schema in a tree formatsales_df.printSchema()//Javaimport static org.apache.spark.sql.functions.col;// Print the schema in a tree formatsales_df.printSchema();#Python# Print the schema in a tree formatsales_df.printSchema()

The output you get should look like this:

  • select: This allows you to select a set of columns from ...

Get Apache Spark Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.