dataframe icon indicating copy to clipboard operation
dataframe copied to clipboard

Give schema type along with read function

Open rossetti opened this issue 1 year ago • 2 comments

As far as I can tell, the DataFrame.readCSV() functionality has very limited ability to specify the schema.

For example, there is already the following functionality:

data class Person(val name: String, val age: Int)

val persons = listOf(Person("Alice", 15), Person("Bob", 20), Person("Charlie", 22))
val df = persons.toDataFrame()   

This creates a DataFrame<Person> instance.

How about something like:

DataFrame<Person>.readCSV(...)

I know that we can use a cast<Person>(), but why not permit the functionality by default and avoid casting.

rossetti avatar Oct 23 '23 19:10 rossetti