Skip to content

Easier withColumn method #453

Description

@MrPowers

Great work on this lib! It's a great way to write Spark code!

As discussed here and in the docs, withColumn requires a full schema when a column is added.

Here's the example in the docs:

case class CityBedsOther(city: String, bedrooms: Int, other: List[String])

cityBeds.
   withColumn[CityBedsOther](lit(List("a","b","c"))).
   show(1).run()

Couldn't we just assume that the schema stays the same for the existing columns and only supply the schema for the column that's being added?

cityBeds.
   withColumn[List[String]](lit(List("a","b","c"))).
   show(1).run()

I think this'd be a lot more use friendly. I'm often dealing with schemas that have tons of columns and add lots of columns with withColumn. Let me know your thoughts!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions