We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 697fd31 commit 850480aCopy full SHA for 850480a
kotlin-spark-api/2.4/src/main/kotlin/org/jetbrains/kotlinx/spark/api/ApiV1.kt
@@ -269,6 +269,9 @@ inline fun <reified R> Dataset<*>.toArray(): Array<R> = to<R>().collect() as Arr
269
*/
270
fun <T> Dataset<T>.showDS(numRows: Int = 20, truncate: Boolean = true) = apply { show(numRows, truncate) }
271
272
+@OptIn(ExperimentalStdlibApi::class)
273
+inline fun <reified T> schema(map: Map<String, KType> = mapOf()) = schema(typeOf<T>(), map)
274
+
275
@OptIn(ExperimentalStdlibApi::class)
276
fun schema(type: KType, map: Map<String, KType> = mapOf()): DataType {
277
val primitiveSchema = knownDataTypes[type.classifier]
0 commit comments