Skip to content

Commit 13cad5c

Browse files
committed
couple fixes
1 parent 7d53953 commit 13cad5c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/pyspark/sql/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def test_rand_functions(self):
422422
rnd = df.select('key', functions.rand()).collect()
423423
for row in rnd:
424424
assert row[1] >= 0.0 and row[1] <= 1.0, "got: %s" % row[1]
425-
rndn = df.select('key', functions.randn(5L)).collect()
425+
rndn = df.select('key', functions.randn(5)).collect()
426426
for row in rndn:
427427
assert row[1] >= -4.0 and row[1] <= 4.0, "got: %s" % row[1]
428428

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
12431243
case Token("TOK_FUNCTION", Token(ARRAY(), Nil) :: children) =>
12441244
CreateArray(children.map(nodeToExpr))
12451245
case Token("TOK_FUNCTION", Token(RAND(), Nil) :: Nil) => Rand()
1246-
case Token("TOK_FUNCTION", Token(RAND(seed), Nil) :: Nil) => Rand(seed.toLong)
1246+
case Token("TOK_FUNCTION", Token(RAND(), Nil) :: seed :: Nil) => Rand(seed.toString.toLong)
12471247
case Token("TOK_FUNCTION", Token(SUBSTR(), Nil) :: string :: pos :: Nil) =>
12481248
Substring(nodeToExpr(string), nodeToExpr(pos), Literal.create(Integer.MAX_VALUE, IntegerType))
12491249
case Token("TOK_FUNCTION", Token(SUBSTR(), Nil) :: string :: pos :: length :: Nil) =>

0 commit comments

Comments
 (0)