Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/22419#discussion_r218408565
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/MathUtils.scala
---
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache
GitHub user wangyum opened a pull request:
https://github.com/apache/spark/pull/22419
[SPARK-23906][SQL] Add UDF TRUNCATE(number)
## What changes were proposed in this pull request?
Add UDF `TRUNCATE(number)`:
```sql
> SELECT TRUNCATE(1234567891.1234567891, 4);