Skip to content

Commit ba442a1

Browse files
fixes in extensionPropertiesApi.md
1 parent 3b4994c commit ba442a1

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

docs/StardustDocs/topics/extensionPropertiesApi.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[//]: # (title: Extension Properties API)
22

3-
When working with a DataFrame, the most convenient and reliable way
3+
When working with a [`DataFrame`](DataFrame.md), the most convenient and reliable way
44
to access its columns — including for operations and retrieving column values
55
in row expressions — is through auto-generated extension properties.
66
They are generated based on a [dataframe schema](schemas.md),
77
with the name and type of properties inferred from the name and type of the corresponding columns.
8-
It also works for all types of hierarchical dataframes
8+
It also works for all types of hierarchical dataframes.
99

1010
> The behavior of data schema generation differs between the
1111
> [Compiler Plugin](Compiler-Plugin.md) and [Kotlin Notebook](gettingStartedKotlinNotebook.md).
1212
>
13-
> * In the **Kotlin Notebook**, a schema is generated *only after cell execution* for
13+
> * In **Kotlin Notebook**, a schema is generated *only after cell execution* for
1414
> `DataFrame` variables defined within that cell.
1515
> * With the **Compiler Plugin**, a new schema is generated *after every operation*
1616
> — but support for all operations is still in progress.
@@ -21,10 +21,12 @@ It also works for all types of hierarchical dataframes
2121

2222
## Example
2323

24-
Consider
24+
Consider a simple hierarchical dataframe from
2525
<resource src="example.csv"></resource>.
26+
2627
This table consists of two columns: `name`, which is a `String` column, and `info`,
27-
which is a **column group** containing two nested value columns —
28+
which is a [**column group**](DataColumn.md#columngroup) containing two nested
29+
[value columns](DataColumn.md#valuecolumn)
2830
`age` of type `Int`, and `height` of type `Double`.
2931

3032
<table>
@@ -55,7 +57,7 @@ which is a **column group** containing two nested value columns —
5557

5658
<tabs>
5759
<tab title="Kotlin Notebook">
58-
Read the `DataFrame` from the CSV file:
60+
Read the [`DataFrame`](DataFrame.md) from the CSV file:
5961

6062
```kotlin
6163
val df = DataFrame.readCsv("example.csv")
@@ -78,10 +80,10 @@ df.sortBy { name and info.height }
7880
df.filter { name.startsWith("A") && info.age >= 16 }
7981
```
8082

81-
If you change DataFrame schema by changing any column [name](rename.md)
82-
or [type](convert.md), or [add](add.md) a new one, you need to
83-
run a cell with a new DataFrame declaration first.
84-
For example, rename the "name" column into "firstName":
83+
If you change the dataframe's schema by changing any column [name](rename.md),
84+
or [type](convert.md) or [add](add.md) a new one, you need to
85+
run a cell with a new [`DataFrame`](DataFrame.md) declaration first.
86+
For example, rename the `name` column into "firstName":
8587

8688
```kotlin
8789
val dfRenamed = df.rename { name }.into("firstName")
@@ -95,13 +97,13 @@ dfRenamed.rename { firstName }.into("name")
9597
dfRenamed.filter { firstName == "Nikita" }
9698
```
9799

98-
See [](quickstart.md) in the Kotlin Notebook with basic Extension Properties API examples.
100+
See the [](quickstart.md) in Kotlin Notebook with basic Extension Properties API examples.
99101

100102
</tab>
101103
<tab title="Compiler Plugin">
102104

103-
For now, if you read `DatFrame` from a file or URL, you need to define its schema manually.
104-
You can do it fast with [`generate..()` methods](DataSchema-Data-Classes-Generation.md).
105+
For now, if you read [`DataFrame`](DataFrame.md) from a file or URL, you need to define its schema manually.
106+
You can do it quickly with [`generate..()` methods](DataSchema-Data-Classes-Generation.md).
105107

106108
Define schemas:
107109
```kotlin
@@ -118,13 +120,14 @@ data class Person(
118120
)
119121
```
120122

121-
Read the `DataFrame` from the CSV file and specify the schema with `convertTo`:
123+
Read the `DataFrame` from the CSV file and specify the schema with
124+
[`.convertTo()`](convertTo.md) or [`cast()`](cast.md):
122125

123126
```kotlin
124127
val df = DataFrame.readCsv("example.csv").convertTo<Person>()
125128
```
126129

127-
Extensions for this `DataFrame` will be generated automatically by plugin,
130+
Extensions for this `DataFrame` will be generated automatically by the plugin,
128131
so you can use extensions for accessing columns,
129132
using it in operations inside the [Column Selector DSL](ColumnSelectors.md)
130133
and [DataRow API](DataRow.md).
@@ -142,8 +145,8 @@ df.filter { name.startsWith("A") && info.age >= 16 }
142145
```
143146

144147
Moreover, new extensions will be generated on-the-fly after each schema change:
145-
by changing any column [name](rename.md)
146-
or [type](convert.md), or [add](add.md) a new one.
148+
by changing any column [name](rename.md),
149+
or [type](convert.md) or [add](add.md) a new one.
147150
For example, rename the "name" column into "firstName" and then we can use `firstName` extensions
148151
in the following operations:
149152

@@ -155,7 +158,7 @@ df.rename { name }.into("firstName")
155158
.filter { firstName == "Nikita" }
156159
```
157160

158-
See [Kotlin DataFrame Compiler Plugin Example](https://github.com/Kotlin/dataframe/tree/plugin_example/examples/kotlin-dataframe-plugin-example)
161+
See [Compiler Plugin Example](https://github.com/Kotlin/dataframe/tree/plugin_example/examples/kotlin-dataframe-plugin-example)
159162
IDEA project with basic Extension Properties API examples.
160163
</tab>
161164
</tabs>

0 commit comments

Comments
 (0)