cast
Changes the type argument of the DataFrame
instance without changing its contents.
cast<T>(verify = false)
Parameters:
verify: Boolean = false
— whentrue
, the function throws an exception if theDataFrame
instance doesn't match the given schema. Otherwise, it just changes the format type without actual data checks.
Use this operation to change the formal type of a DataFrame
instance to match the expected schema and enable generated extension properties for it.
@DataSchema
interface Person {
val age: Int
val name: String
}
df.cast<Person>()
To convert DataFrame
columns to match given schema, use convertTo
operation.
Last modified: 01 December 2023