DataFrameSchemaImpl

DataFrameSchema implementation.

Represents the schema of a dataframe, i.e., an ordered map of column names to their types.

Column types are represented by ColumnSchema:

  • For value columns, it contains the type of the column.

  • For column groups, it contains the DataFrameSchema of the nested columns.

  • For frame columns, it contains the DataFrameSchema of the contained dataframes.

Use org.jetbrains.kotlinx.dataframe.DataFrame.schema to read the schema of a DataFrame from its columns, and org.jetbrains.kotlinx.dataframe.DataFrame.compileTimeSchema to get the one that follows from its type.

Use compare to compare this schema with another schema using different comparison modes. The comparison ignores column order and can report how the schemas are related.

Use equals to check whether two schemas are exactly equal, including column order.

Constructors

Link copied to clipboard
constructor(columns: Map<String, ColumnSchema>)

Properties

Link copied to clipboard
open override val columns: Map<String, ColumnSchema>

A map that defines the schema of the columns within a DataFrameSchema.

Functions

Link copied to clipboard
open override fun compare(other: DataFrameSchema, comparisonMode: ComparisonMode = ComparisonMode.LENIENT): CompareResult

Compares this schema with other schema.

Link copied to clipboard
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Returns true if, and only if, this schema has the same columns in the same order as the other schema. The types must also match exactly.

Link copied to clipboard
internal fun DataFrameSchema.generateCodeImpl(markerName: String, extensionProperties: Boolean, visibility: MarkerVisibility, useFqNames: Boolean, nameNormalizer: NameNormalizer, asDataClass: Boolean, knownMarkers: Iterable<Marker> = emptyList(), nestedMarkerNameProvider: MarkerNameProvider = MarkerNameProvider.fromColumnName): CodeString

Generates a CodeString containing generated @DataSchema declarations (markers).

Link copied to clipboard
@JvmName(name = "generateDataClassesForSchema")
fun DataFrameSchema.generateDataClasses(markerName: String, extensionProperties: Boolean = false, visibility: MarkerVisibility = MarkerVisibility.IMPLICIT_PUBLIC, useFqNames: Boolean = false, nameNormalizer: NameNormalizer = NameNormalizer.default, nestedMarkerNameProvider: MarkerNameProvider = MarkerNameProvider.fromColumnName): CodeString

Generates a CodeString containing generated @DataSchema data classes for the given DataFrameSchema (including all nested frame columns and column groups).

Link copied to clipboard
@JvmName(name = "generateInterfacesForSchema")
fun DataFrameSchema.generateInterfaces(markerName: String, extensionProperties: Boolean = false, visibility: MarkerVisibility = MarkerVisibility.IMPLICIT_PUBLIC, useFqNames: Boolean = false, nameNormalizer: NameNormalizer = NameNormalizer.default, nestedMarkerNameProvider: MarkerNameProvider = MarkerNameProvider.fromColumnName): CodeString

Generates a CodeString containing generated @DataSchema interfaces for the given DataFrameSchema (including all nested frame columns and column groups).

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String