You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Converts values in [DataFrame] to match given column schema [T].
166
+
*
167
+
* Original columns are mapped to destination columns by column [path][DataColumn.path].
168
+
*
169
+
* Type converters for every column are selected automatically. See [convert] operation for details.
170
+
*
171
+
* To specify custom type converters for the particular types use [ConvertSchemaDsl].
172
+
*
173
+
* Example of Dsl:
174
+
* ```kotlin
175
+
* df.convertTo(schemaFrom = sample) {
176
+
* // defines how to convert Int? -> String
177
+
* convert<Int?>().with { it?.toString() ?: "No input given" }
178
+
* // defines how to convert String -> SomeType
179
+
* parser { SomeType(it) }
180
+
* // fill missing column `sum` with expression `a + b`
181
+
* fill { sum }.with { a + b }
182
+
* }
183
+
* ```
184
+
*
185
+
* @param [T] class that defines target schema for conversion.
186
+
* @param [schemaFrom] dataframe which type [T] will be used.
187
+
* @param [excessiveColumnsBehavior] how to handle excessive columns in the original [DataFrame].
188
+
* @param [body] optional dsl to define custom type converters.
189
+
* @throws [ColumnNotFoundException] if [DataFrame] doesn't contain columns that are required by destination schema.
190
+
* @throws [ExcessiveColumnsException] if [DataFrame] contains columns that are not required by destination schema and [excessiveColumnsBehavior] is set to [ExcessiveColumns.Fail].
191
+
* @throws [TypeConverterNotFoundException] if suitable type converter for some column was not found.
192
+
* @throws [TypeConversionException] if type converter failed to convert column values.
0 commit comments