# Schema inheritance

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

In order to reduce amount of generated code, previously generated [DataSchema](schema.html) interfaces are reused and only new properties are introduced

API reference: [DataSchema](https://kotlin.github.io/dataframe/api-docs/core/org.jetbrains.kotlinx.dataframe.annotations/-data-schema/index.html)

Let's filter out all `null` values from `age` column and add one more column of type `Boolean`:

```KOTLIN
val filtered = df.filter { age != null }.add("isAdult") { age!! > 18 }
```

New schema interface for `filtered` variable will be derived from previously generated `DataFrameType`:

```KOTLIN
@DataSchema
interface DataFrameType1 : DataFrameType
```

Extension properties for data access are generated only for new and overridden members of `DataFrameType1` interface:

```KOTLIN
val ColumnsContainer<DataFrameType1>.age: DataColumn<Int> get() = this["age"] as DataColumn<Int>
val DataRow<DataFrameType1>.age: Int get() = this["age"] as Int
val ColumnsContainer<DataFrameType1>.isAdult: DataColumn<Boolean> get() = this["isAdult"] as DataColumn<Boolean>
val DataRow<DataFrameType1>.isAdult: String get() = this["isAdult"] as Boolean
```

Then variable `filtered` is cast to new interface:

```KOTLIN
val temp = filtered
```

```KOTLIN
val filtered = temp.cast<DataFrameType1>()
```

