Skip to content

Commit 47cc1fe

Browse files
cloud-fanmarmbrus
authored andcommitted
[SQL][MINOR] remove newLongEncoder in functions
it may shadows the one from implicits in some case. Author: Wenchen Fan <[email protected]> Closes #9629 from cloud-fan/minor. (cherry picked from commit e71ba56) Signed-off-by: Michael Armbrust <[email protected]>
1 parent 9bf9885 commit 47cc1fe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/functions.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ object functions extends LegacyFunctions {
8383
Column(func.toAggregateExpression(isDistinct))
8484
}
8585

86-
private implicit def newLongEncoder: Encoder[Long] = ExpressionEncoder[Long](flat = true)
87-
88-
8986
/**
9087
* Returns a [[Column]] based on the given column name.
9188
*
@@ -269,7 +266,8 @@ object functions extends LegacyFunctions {
269266
* @group agg_funcs
270267
* @since 1.3.0
271268
*/
272-
def count(columnName: String): TypedColumn[Any, Long] = count(Column(columnName)).as[Long]
269+
def count(columnName: String): TypedColumn[Any, Long] =
270+
count(Column(columnName)).as(ExpressionEncoder[Long](flat = true))
273271

274272
/**
275273
* Aggregate function: returns the number of distinct items in a group.

0 commit comments

Comments
 (0)