This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flattenDataFrame(df: DataFrame): DataFrame = { | |
val fields = df.schema.fields | |
val fieldNames = fields.map(x => x.name) | |
for (i <- fields.indices) { | |
val field = fields(i) | |
val fieldType = field.dataType | |
val fieldName = field.name | |
fieldType match { | |
case _: ArrayType => |