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](
84
84
* col("`a.column.with.dots`") // Escape `.` in column names.
85
85
* $"columnName" // Scala short hand for a named column.
86
86
* 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.
88
88
* }}}
89
89
*
90
90
* [[Column ]] objects can be composed to form complex expressions:
Original file line number Diff line number Diff line change @@ -1413,6 +1413,19 @@ class DataFrame private[sql](
1413
1413
*/
1414
1414
def first (): Row = head()
1415
1415
1416
+ /**
1417
+ * Concise syntax for chaining custom transformations.
1418
+ * {{{
1419
+ * def featurize(ds: DataFrame) = ...
1420
+ *
1421
+ * df
1422
+ * .transform(featurize)
1423
+ * .transform(...)
1424
+ * }}}
1425
+ * @since 1.6.0
1426
+ */
1427
+ def transform [U ](t : DataFrame => DataFrame ): DataFrame = t(this )
1428
+
1416
1429
/**
1417
1430
* Returns a new RDD by applying a function to all rows of this DataFrame.
1418
1431
* @group rdd
You can’t perform that action at this time.
0 commit comments