Skip to content

Commit

Permalink
Simplify with map
Browse files Browse the repository at this point in the history
  • Loading branch information
zeotuan committed Oct 7, 2024
1 parent eb0d8e7 commit 9c3af23
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ object StructTypeHelpers {
case _ if !firstLevel => parentCol(childFieldName)
}

schema.fields.sortBy(f).foldLeft(Seq.empty[Column]) {
case (acc, field) =>
acc :+ childFieldToCol(field.dataType, field.name, col(field.name), firstLevel = true)
}
schema.fields.sortBy(f).map(field => childFieldToCol(field.dataType, field.name, col(field.name), firstLevel = true))
}

/**
Expand Down

0 comments on commit 9c3af23

Please sign in to comment.