Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some typoes in functions.R and the same ones in functions.scala
  • Loading branch information
HyukjinKwon committed Nov 4, 2016
commit fd46205e363f136ecc37bea1d5d0cfa619a3a963
4 changes: 2 additions & 2 deletions R/pkg/R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,7 @@ setMethod("from_utc_timestamp", signature(y = "Column", x = "character"),
#' Locate the position of the first occurrence of substr column in the given string.
#' Returns null if either of the arguments are null.
#'
#' NOTE: The position is not zero based, but 1 based index, returns 0 if substr
#' NOTE: The position is not zero based, but 1 based index. Returns 0 if substr
#' could not be found in str.
#'
#' @param y column to check
Expand Down Expand Up @@ -2779,7 +2779,7 @@ setMethod("window", signature(x = "Column"),
#' locate
#'
#' Locate the position of the first occurrence of substr.
#' NOTE: The position is not zero based, but 1 based index, returns 0 if substr
#' NOTE: The position is not zero based, but 1 based index. Returns 0 if substr
#' could not be found in str.
#'
#' @param substr a character string to be matched.
Expand Down
31 changes: 18 additions & 13 deletions sql/core/src/main/scala/org/apache/spark/sql/functions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1117,8 +1117,8 @@ object functions {
def not(e: Column): Column = !e

/**
* Generate a random column with i.i.d. samples from U[0.0, 1.0].
*
* Generate a random column with independent and identically distributed (i.i.d.) samples
* from U[0.0, 1.0].
* Note that this is indeterministic when data partitions are not fixed.
*
* @group normal_funcs
Expand All @@ -1127,15 +1127,17 @@ object functions {
def rand(seed: Long): Column = withExpr { Rand(seed) }

/**
* Generate a random column with i.i.d. samples from U[0.0, 1.0].
* Generate a random column with independent and identically distributed (i.i.d.) samples
* from U[0.0, 1.0].
*
* @group normal_funcs
* @since 1.4.0
*/
def rand(): Column = rand(Utils.random.nextLong)

/**
* Generate a column with i.i.d. samples from the standard normal distribution.
* Generate a column with independent and identically distributed (i.i.d.) samples from
* the standard normal distribution.
*
* Note that this is indeterministic when data partitions are not fixed.
*
Expand All @@ -1145,15 +1147,16 @@ object functions {
def randn(seed: Long): Column = withExpr { Randn(seed) }

/**
* Generate a column with i.i.d. samples from the standard normal distribution.
* Generate a column with independent and identically distributed (i.i.d.) samples from
* the standard normal distribution.
*
* @group normal_funcs
* @since 1.4.0
*/
def randn(): Column = randn(Utils.random.nextLong)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was missed in 02f2031 and a08463b


/**
* Partition ID of the Spark task.
* Partition ID.
*
* Note that this is indeterministic because it depends on data partitioning and task scheduling.
*
Expand Down Expand Up @@ -1877,8 +1880,8 @@ object functions {
def shiftLeft(e: Column, numBits: Int): Column = withExpr { ShiftLeft(e.expr, lit(numBits).expr) }

/**
* Shift the given value numBits right. If the given value is a long value, it will return
* a long value else it will return an integer value.
* (Signed) shift the given value numBits right. If the given value is a long value, it will
* return a long value else it will return an integer value.
*
* @group math_funcs
* @since 1.5.0
Expand Down Expand Up @@ -2203,7 +2206,7 @@ object functions {
* Locate the position of the first occurrence of substr column in the given string.
* Returns null if either of the arguments are null.
*
* NOTE: The position is not zero based, but 1 based index, returns 0 if substr
* NOTE: The position is not zero based, but 1 based index. Returns 0 if substr
* could not be found in str.
*
* @group string_funcs
Expand Down Expand Up @@ -2238,7 +2241,7 @@ object functions {

/**
* Locate the position of the first occurrence of substr.
* NOTE: The position is not zero based, but 1 based index, returns 0 if substr
* NOTE: The position is not zero based, but 1 based index. Returns 0 if substr
* could not be found in str.
*
* @group string_funcs
Expand Down Expand Up @@ -2666,7 +2669,8 @@ object functions {
}

/**
* Assumes given timestamp is UTC and converts to given timezone.
* Given a timestamp, which corresponds to a certain time of day in UTC, returns another timestamp
* that corresponds to the same time of day in the given timezone.
* @group datetime_funcs
* @since 1.5.0
*/
Expand All @@ -2675,7 +2679,8 @@ object functions {
}

/**
* Assumes given timestamp is in given timezone and converts to UTC.
* Given a timestamp, which corresponds to a certain time of day in the given timezone, returns
* another timestamp that corresponds to the same time of day in UTC.
* @group datetime_funcs
* @since 1.5.0
*/
Expand Down Expand Up @@ -2996,7 +3001,7 @@ object functions {
def sort_array(e: Column): Column = sort_array(e, asc = true)

/**
* Sorts the input array for the given column in ascending / descending order,
* Sorts the input array for the given column in ascending or descending order,
* according to the natural ordering of the array elements.
*
* @group collection_funcs
Expand Down