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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.