Skip to content
Closed
Prev Previous commit
Next Next commit
[SPARK-23329][SQL] Fixed formatting of long lines, reverted line brea…
…k removals
  • Loading branch information
misutoth committed Feb 19, 2018
commit 2586b0f25ae0e563374c03d1db37d08aaf0c8c08
Original file line number Diff line number Diff line change
Expand Up @@ -168,41 +168,44 @@ case class Pi() extends LeafMathExpression(math.Pi, "PI")
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the inverse cosine (a.k.a. arc cosine) of `expr`, as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns the inverse cosine (a.k.a. arc cosine) of `expr`, as if computed by
`java.lang.Math._FUNC_`.
""",
examples = """
Examples:
> SELECT _FUNC_(1);
0.0
> SELECT _FUNC_(2);
NaN
""")
// scalastyle:on line.size.limit
case class Acos(child: Expression) extends UnaryMathExpression(math.acos, "ACOS")

// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the inverse sine (a.k.a. arc sine) the arc sin of `expr`, as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns the inverse sine (a.k.a. arc sine) the arc sin of `expr`,
as if computed by `java.lang.Math._FUNC_`.
""",
examples = """
Examples:
> SELECT _FUNC_(0);
0.0
> SELECT _FUNC_(2);
NaN
""")
// scalastyle:on line.size.limit
case class Asin(child: Expression) extends UnaryMathExpression(math.asin, "ASIN")

// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the inverse tangent (a.k.a. arc tangent) of `expr`, as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns the inverse tangent (a.k.a. arc tangent) of `expr`, as if computed by
`java.lang.Math._FUNC_`
""",
examples = """
Examples:
> SELECT _FUNC_(0);
0.0
""")
// scalastyle:on line.size.limit
case class Atan(child: Expression) extends UnaryMathExpression(math.atan, "ATAN")

@ExpressionDescription(
Expand Down Expand Up @@ -252,7 +255,10 @@ case class Ceil(child: Expression) extends UnaryMathExpression(math.ceil, "CEIL"
}

@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the cosine of `expr`, as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns the cosine of `expr`, as if computed by
`java.lang.Math._FUNC_`.
""",
arguments =
"""
Arguments:
Expand Down Expand Up @@ -535,9 +541,11 @@ case class Signum(child: Expression) extends UnaryMathExpression(math.signum, "S
""")
case class Sin(child: Expression) extends UnaryMathExpression(math.sin, "SIN")

// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns hyperbolic sine of `expr`, as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns hyperbolic sine of `expr`, as if computed by
Copy link
Member

@HyukjinKwon HyukjinKwon Feb 20, 2018

Choose a reason for hiding this comment

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

I think we need double spaces ahead - I think the key is consistency but less invasive / targeted change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct

`java.lang.Math._FUNC_`.
""",
arguments =
"""
Arguments:
Expand All @@ -559,9 +567,11 @@ case class Sinh(child: Expression) extends UnaryMathExpression(math.sinh, "SINH"
""")
case class Sqrt(child: Expression) extends UnaryMathExpression(math.sqrt, "SQRT")

// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the tangent of `expr`, as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns the tangent of `expr`, as if computed by
`java.lang.Math._FUNC_`.
Copy link
Member

Choose a reason for hiding this comment

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

Seems the two lines above could fix in one line.

""",
arguments =
"""
Arguments:
Expand All @@ -575,8 +585,10 @@ case class Sqrt(child: Expression) extends UnaryMathExpression(math.sqrt, "SQRT"
case class Tan(child: Expression) extends UnaryMathExpression(math.tan, "TAN")

@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the cotangent of `expr` ," +
"as if computed by `1/java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns the cotangent of `expr`, as if computed by
`1/java.lang.Math._FUNC_`.
Copy link
Member

Choose a reason for hiding this comment

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

ditto for one line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

""",
arguments =
"""
Arguments:
Expand All @@ -595,7 +607,10 @@ case class Cot(child: Expression)
}

@ExpressionDescription(
usage = "_FUNC_(expr) - Returns the hyperbolic tangent of `expr`, as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(expr) - Returns the hyperbolic tangent of `expr`, as if computed by
`java.lang.Math._FUNC_`.
""",
arguments =
"""
Arguments:
Expand Down Expand Up @@ -816,9 +831,12 @@ case class Unhex(child: Expression) extends UnaryExpression with ImplicitCastInp
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////

// scalastyle:off line.size.limit
@ExpressionDescription(
usage = "_FUNC_(exprY, exprX) - Returns the angle in radians between the positive x-axis of a plane and the point given by the coordinates (`exprX`, `exprY`), as if computed by `java.lang.Math._FUNC_`.",
usage = """
_FUNC_(exprY, exprX) - Returns the angle in radians between the positive x-axis of a plane
and the point given by the coordinates (`exprX`, `exprY`), as if computed by
`java.lang.Math._FUNC_`.
""",
arguments =
"""
Arguments:
Expand All @@ -830,7 +848,6 @@ case class Unhex(child: Expression) extends UnaryExpression with ImplicitCastInp
> SELECT _FUNC_(0, 0);
0.0
""")
// scalastyle:on line.size.limit
case class Atan2(left: Expression, right: Expression)
extends BinaryMathExpression(math.atan2, "ATAN2") {

Expand Down Expand Up @@ -858,6 +875,7 @@ case class Pow(left: Expression, right: Expression)
}
}


Copy link
Member

Choose a reason for hiding this comment

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

I'd revert the whitespace changes here, or at least only make changes that make the spacing consistent.

/**
* Bitwise left shift.
*
Expand Down Expand Up @@ -969,6 +987,7 @@ case class ShiftRightUnsigned(left: Expression, right: Expression)
case class Hypot(left: Expression, right: Expression)
extends BinaryMathExpression(math.hypot, "HYPOT")


/**
* Computes the logarithm of a number.
*
Expand Down