@@ -3,9 +3,11 @@ package org.jetbrains.kotlinx.dataframe.api
33import org.jetbrains.kotlinx.dataframe.AnyColumnReference
44import org.jetbrains.kotlinx.dataframe.ColumnsSelector
55import org.jetbrains.kotlinx.dataframe.DataFrame
6+ import org.jetbrains.kotlinx.dataframe.DataRow
67import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
78import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
89import org.jetbrains.kotlinx.dataframe.annotations.Refine
10+ import org.jetbrains.kotlinx.dataframe.api.DistinctDocs.DISTINCT_RETURN
911import org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions
1012import org.jetbrains.kotlinx.dataframe.columns.ColumnSet
1113import org.jetbrains.kotlinx.dataframe.columns.SingleColumn
@@ -23,24 +25,27 @@ import kotlin.reflect.KProperty
2325// region DataFrame
2426
2527/* *
26- * ## The Distinct Operation
28+ * ## The {@get NAME Distinct} Operation
2729 *
28- * It removes duplicated rows based on {@get PHRASE_ENDING}.
30+ * {@get DESCRIPTION It removes duplicated rows based on {@get PHRASE_ENDING} }.
2931 *
30- * __NOTE:__ The rows in the resulting [DataFrame] are in the same order as they were in the original [DataFrame].
32+ * __NOTE:__ The [rows][DataRow] in the resulting [DataFrame] are in the same order
33+ * as they were in the original [DataFrame].
3134 *
32- * {@get [DISTINCT_PARAM] @param [columns]
33- * The names of the columns to consider for evaluating distinct rows.}
35+ * {@get [DISTINCT_PARAM]}
3436 *
35- * @ return A new DataFrame containing only distinct rows.
37+ * {@get [DISTINCT_RETURN] @ return A new [ DataFrame] containing only distinct rows.}
3638 *
3739 * @see [Selecting Columns][SelectSelectingOptions].
3840 * @see {@include [DocumentationUrls.Distinct]}
41+ * @see {@include [DocumentationUrls.DistinctBy]}
3942 */
4043@ExcludeFromSources
4144@Suppress(" ClassName" )
4245private interface DistinctDocs {
4346 interface DISTINCT_PARAM
47+
48+ interface DISTINCT_RETURN
4449}
4550
4651/* *
@@ -52,15 +57,21 @@ public fun <T> DataFrame<T>.distinct(): DataFrame<T> = distinctBy { all() }
5257
5358/* *
5459 * {@include [DistinctDocs]}
55- * {@set PHRASE_ENDING the specified columns}.
60+ * {@set DESCRIPTION It selects the specified columns and keeps only distinct rows based on these selected columns}
61+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] The names of the columns to select
62+ * and to consider for evaluating distinct rows.}
63+ * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.}
5664 */
5765@Refine
5866@Interpretable(" Distinct0" )
5967public fun <T , C > DataFrame<T>.distinct (columns : ColumnsSelector <T , C >): DataFrame <T > = select(columns).distinct()
6068
6169/* *
6270 * {@include [DistinctDocs]}
63- * {@set PHRASE_ENDING the specified columns}.
71+ * {@set DESCRIPTION It selects the specified columns and keeps only distinct rows based on these selected columns}
72+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] The names of the columns to select
73+ * and to consider for evaluating distinct rows.}
74+ * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.}
6475 */
6576@Deprecated(DEPRECATED_ACCESS_API )
6677@AccessApiOverload
@@ -72,13 +83,19 @@ public fun <T> DataFrame<T>.distinct(vararg columns: KProperty<*>): DataFrame<T>
7283
7384/* *
7485 * {@include [DistinctDocs]}
75- * {@set PHRASE_ENDING the specified columns}.
86+ * {@set DESCRIPTION It selects the specified columns and keeps only distinct rows based on these selected columns}
87+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] The names of the columns to select
88+ * and to consider for evaluating distinct rows.}
89+ * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.}
7690 */
7791public fun <T > DataFrame<T>.distinct (vararg columns : String ): DataFrame <T > = distinct { columns.toColumnSet() }
7892
7993/* *
8094 * {@include [DistinctDocs]}
81- * {@set PHRASE_ENDING the specified columns}.
95+ * {@set DESCRIPTION It selects the specified columns and keeps only distinct rows based on these selected columns}
96+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns] The names of the columns to select
97+ * and to consider for evaluating distinct rows.}
98+ * {@set [DISTINCT_RETURN] @return A new [DataFrame] containing only selected columns and distinct rows.}
8299 */
83100@Deprecated(DEPRECATED_ACCESS_API )
84101@AccessApiOverload
@@ -87,7 +104,10 @@ public fun <T> DataFrame<T>.distinct(vararg columns: AnyColumnReference): DataFr
87104
88105/* *
89106 * {@include [DistinctDocs]}
107+ * {@set NAME DistinctBy}
90108 * {@set PHRASE_ENDING the specified columns}.
109+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns]
110+ * The names of the columns to consider for evaluating distinct rows.}
91111 */
92112@Deprecated(DEPRECATED_ACCESS_API )
93113@AccessApiOverload
@@ -96,13 +116,19 @@ public fun <T> DataFrame<T>.distinctBy(vararg columns: KProperty<*>): DataFrame<
96116
97117/* *
98118 * {@include [DistinctDocs]}
119+ * {@set NAME DistinctBy}
99120 * {@set PHRASE_ENDING the specified columns}.
121+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns]
122+ * The names of the columns to consider for evaluating distinct rows.}
100123 */
101124public fun <T > DataFrame<T>.distinctBy (vararg columns : String ): DataFrame <T > = distinctBy { columns.toColumnSet() }
102125
103126/* *
104127 * {@include [DistinctDocs]}
128+ * {@set NAME DistinctBy}
105129 * {@set PHRASE_ENDING the specified columns}.
130+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns]
131+ * The names of the columns to consider for evaluating distinct rows.}
106132 */
107133@Deprecated(DEPRECATED_ACCESS_API )
108134@AccessApiOverload
@@ -111,7 +137,10 @@ public fun <T> DataFrame<T>.distinctBy(vararg columns: AnyColumnReference): Data
111137
112138/* *
113139 * {@include [DistinctDocs]}
140+ * {@set NAME DistinctBy}
114141 * {@set PHRASE_ENDING the specified columns}.
142+ * {@set [DistinctDocs.DISTINCT_PARAM] @param [columns]
143+ * The names of the columns to consider for evaluating distinct rows.}
115144 */
116145public fun <T , C > DataFrame<T>.distinctBy (columns : ColumnsSelector <T , C >): DataFrame <T > {
117146 val cols = get(columns)
0 commit comments