Skip to content
Snippets Groups Projects
Commit dfd8bac8 authored by Reynold Xin's avatar Reynold Xin
Browse files

Minor style fix for the previous commit.

parent 1a7a7d7d
No related branches found
No related tags found
No related merge requests found
...@@ -21,10 +21,8 @@ import java.lang.{Long => JLong} ...@@ -21,10 +21,8 @@ import java.lang.{Long => JLong}
import java.util.Arrays import java.util.Arrays
import org.apache.spark.sql.catalyst.analysis.TypeCheckResult import org.apache.spark.sql.catalyst.analysis.TypeCheckResult
import org.apache.spark.sql.types._
import org.apache.spark.sql.types.{StringType}
import org.apache.spark.sql.catalyst.expressions.codegen._ import org.apache.spark.sql.catalyst.expressions.codegen._
import org.apache.spark.sql.types.{DataType, DoubleType, LongType, IntegerType} import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String import org.apache.spark.unsafe.types.UTF8String
/** /**
...@@ -192,8 +190,7 @@ object Factorial { ...@@ -192,8 +190,7 @@ object Factorial {
) )
} }
case class Factorial(child: Expression) case class Factorial(child: Expression) extends UnaryExpression with ExpectsInputTypes {
extends UnaryExpression with ExpectsInputTypes {
override def inputTypes: Seq[DataType] = Seq(IntegerType) override def inputTypes: Seq[DataType] = Seq(IntegerType)
...@@ -204,8 +201,6 @@ case class Factorial(child: Expression) ...@@ -204,8 +201,6 @@ case class Factorial(child: Expression)
// If the value not in the range of [0, 20], it still will be null, so set it to be true here. // If the value not in the range of [0, 20], it still will be null, so set it to be true here.
override def nullable: Boolean = true override def nullable: Boolean = true
override def toString: String = s"factorial($child)"
override def eval(input: InternalRow): Any = { override def eval(input: InternalRow): Any = {
val evalE = child.eval(input) val evalE = child.eval(input)
if (evalE == null) { if (evalE == null) {
...@@ -372,8 +367,8 @@ case class Hex(child: Expression) extends UnaryExpression with Serializable { ...@@ -372,8 +367,8 @@ case class Hex(child: Expression) extends UnaryExpression with Serializable {
var len = 0 var len = 0
do { do {
len += 1 len += 1
value(value.length - len) = Character.toUpperCase(Character value(value.length - len) =
.forDigit((numBuf & 0xF).toInt, 16)).toByte Character.toUpperCase(Character.forDigit((numBuf & 0xF).toInt, 16)).toByte
numBuf >>>= 4 numBuf >>>= 4
} while (numBuf != 0) } while (numBuf != 0)
UTF8String.fromBytes(Arrays.copyOfRange(value, value.length - len, value.length)) UTF8String.fromBytes(Arrays.copyOfRange(value, value.length - len, value.length))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment