Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
dfd8bac8
Commit
dfd8bac8
authored
9 years ago
by
Reynold Xin
Browse files
Options
Downloads
Patches
Plain Diff
Minor style fix for the previous commit.
parent
1a7a7d7d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/math.scala
+4
-9
4 additions, 9 deletions
...cala/org/apache/spark/sql/catalyst/expressions/math.scala
with
4 additions
and
9 deletions
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/math.scala
+
4
−
9
View file @
dfd8bac8
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment