File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
sql/core/src/main/scala/org/apache/spark/sql Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ class TypedColumn[-T, U](
8484 * col("`a.column.with.dots`") // Escape `.` in column names.
8585 * $"columnName" // Scala short hand for a named column.
8686 * expr("a + 1") // A column that is constructed from a parsed SQL Expression.
87- * lit("1") // A column that produces a literal (constant) value.
87+ * lit("abc") // A column that produces a literal (constant) value.
8888 * }}}
8989 *
9090 * [[Column ]] objects can be composed to form complex expressions:
Original file line number Diff line number Diff line change @@ -1421,6 +1421,19 @@ class DataFrame private[sql](
14211421 */
14221422 def first (): Row = head()
14231423
1424+ /**
1425+ * Concise syntax for chaining custom transformations.
1426+ * {{{
1427+ * def featurize(ds: DataFrame) = ...
1428+ *
1429+ * df
1430+ * .transform(featurize)
1431+ * .transform(...)
1432+ * }}}
1433+ * @since 1.6.0
1434+ */
1435+ def transform [U ](t : DataFrame => DataFrame ): DataFrame = t(this )
1436+
14241437 /**
14251438 * Returns a new RDD by applying a function to all rows of this DataFrame.
14261439 * @group rdd
You can’t perform that action at this time.
0 commit comments