Skip to content

Instantly share code, notes, and snippets.

dharadhruve

Block or report user

Report or block dharadhruve

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dharadhruve
dharadhruve / flatten.java
Last active Jul 18, 2019 — forked from ebuildy/flatten.java
Flatten Spark data frame fields structure, via SQL in Java. This fork also supports ArrayType fields.
View flatten.java
class Toto
{
public void Main()
{
final DataFrame source = GetDataFrame();
final String querySelectSQL = flattenSchema(source.schema(), null);
source.registerTempTable("source");
final DataFrame flattenData = sqlContext.sql("SELECT " + querySelectSQL + " FROM source")
You can’t perform that action at this time.