-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Fix chr to make the function behavior consistent with SparkSQL. > SparkSQL chr: > (https://github.com/apache/spark/blob/87a5442f7ed96b11051d8a9333476d080054e5a0/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala#L2253) > > ```scala > protected override def nullSafeEval(lon: Any): Any = { > val longVal = lon.asInstanceOf[Long] > if (longVal < 0) { > UTF8String.EMPTY_UTF8 > } else if ((longVal & 0xFF) == 0) { > UTF8String.fromString(Character.MIN_VALUE.toString) > } else { > UTF8String.fromString((longVal & 0xFF).toChar.toString) > } > } > ``` Pull Request resolved: #4909 Reviewed By: Yuhta Differential Revision: D47724533 Pulled By: mbasmanova fbshipit-source-id: a037bfaef3e6f32133c3b9e5152d96535c9c94dd
- Loading branch information
1 parent
4b9a079
commit 7a8f6dd
Showing
3 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters