Java Spark Tips, Tricks and Basics 3 – How to select columns for nested Datasets / Dataframes in Spark Java

How to select columns from a nested Dataset/Dataframe in Spark java


Let’s assume we have nested data that looks like this

Let’s say we have the data stored and we load into a dataframe frist




We can now get a dataframe, only containing one of the nested colmns with the following command



And so on. So you just have to use “.” as separate to select any nested column.


Leave a Reply

Your email address will not be published. Required fields are marked *