>>> spark.sql("SELECT ceil(-0.1), typeof(ceil(-0.1)), typeof(-0.1)").show()
+----------+------------------+------------+
|CEIL(-0.1)|typeof(CEIL(-0.1))|typeof(-0.1)|
+----------+------------------+------------+
|         0|      decimal(1,0)|decimal(1,1)|
+----------+------------------+------------+

>>> spark.sql("SELECT ceil(5), typeof(ceil(5)), typeof(5)").show()
+-------+---------------+---------+
|CEIL(5)|typeof(CEIL(5))|typeof(5)|
+-------+---------------+---------+
|      5|         bigint|      int|
+-------+---------------+---------+

>>> spark.sql("SELECT ceil(5.4), typeof(ceil(5.4)), typeof(5.4)").show()
+---------+-----------------+------------+
|CEIL(5.4)|typeof(CEIL(5.4))| typeof(5.4)|
+---------+-----------------+------------+
|        6|     decimal(2,0)|decimal(2,1)|
+---------+-----------------+------------+

>>> spark.sql("SELECT ceil(3.1411, -3), typeof(ceil(3.1411, -3)), typeof(3.1411)").show()
+----------------+------------------------+--------------+
|ceil(3.1411, -3)|typeof(ceil(3.1411, -3))|typeof(3.1411)|
+----------------+------------------------+--------------+
|            1000|            decimal(4,0)|  decimal(5,4)|
+----------------+------------------------+--------------+

>>> spark.sql("SELECT ceil(3.1411, 3), typeof(ceil(3.1411, 3)), typeof(3.1411)").show()
+---------------+-----------------------+--------------+
|ceil(3.1411, 3)|typeof(ceil(3.1411, 3))|typeof(3.1411)|
+---------------+-----------------------+--------------+
|          3.142|           decimal(5,3)|  decimal(5,4)|
+---------------+-----------------------+--------------+

>>> spark.sql("SELECT ceil(3345.1, -2), typeof(ceil(3345.1, -2)), typeof(3345.1)").show()
+----------------+------------------------+--------------+
|ceil(3345.1, -2)|typeof(ceil(3345.1, -2))|typeof(3345.1)|
+----------------+------------------------+--------------+
|            3400|            decimal(5,0)|  decimal(5,1)|
+----------------+------------------------+--------------+

>>> spark.sql("SELECT ceil(-12.345, 1), typeof(ceil(-12.345, 1)), typeof(3345.1)").show()
+----------------+------------------------+--------------+
|ceil(-12.345, 1)|typeof(ceil(-12.345, 1))|typeof(3345.1)|
+----------------+------------------------+--------------+
|           -12.3|            decimal(4,1)|  decimal(5,1)|
+----------------+------------------------+--------------+

>>> spark.sql("SELECT ceil(CAST(5 as TINYINT), 1), typeof(ceil(CAST(5 as TINYINT), 1))").show()
+---------------------------+-----------------------------------+
|ceil(CAST(5 AS TINYINT), 1)|typeof(ceil(CAST(5 AS TINYINT), 1))|
+---------------------------+-----------------------------------+
|                          5|                       decimal(4,0)|
+---------------------------+-----------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as TINYINT), -4), typeof(ceil(CAST(5 as TINYINT), -4))").show()
+----------------------------+------------------------------------+
|ceil(CAST(5 AS TINYINT), -4)|typeof(ceil(CAST(5 AS TINYINT), -4))|
+----------------------------+------------------------------------+
|                       10000|                        decimal(5,0)|
+----------------------------+------------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as SMALLINT), 1), typeof(ceil(CAST(5 as SMALLINT), 1))").show()
+----------------------------+------------------------------------+
|ceil(CAST(5 AS SMALLINT), 1)|typeof(ceil(CAST(5 AS SMALLINT), 1))|
+----------------------------+------------------------------------+
|                           5|                        decimal(6,0)|
+----------------------------+------------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as SMALLINT), -6), typeof(ceil(CAST(5 as SMALLINT), -6))").show()
+-----------------------------+-------------------------------------+
|ceil(CAST(5 AS SMALLINT), -6)|typeof(ceil(CAST(5 AS SMALLINT), -6))|
+-----------------------------+-------------------------------------+
|                      1000000|                         decimal(7,0)|
+-----------------------------+-------------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as INT), 1), typeof(ceil(CAST(5 as INT), 1))").show()
+-----------------------+-------------------------------+
|ceil(CAST(5 AS INT), 1)|typeof(ceil(CAST(5 AS INT), 1))|
+-----------------------+-------------------------------+
|                      5|                  decimal(11,0)|
+-----------------------+-------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as INT), -11), typeof(ceil(CAST(5 as INT), -11))").show()
+-------------------------+---------------------------------+
|ceil(CAST(5 AS INT), -11)|typeof(ceil(CAST(5 AS INT), -11))|
+-------------------------+---------------------------------+
|             100000000000|                    decimal(12,0)|
+-------------------------+---------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as BIGINT), 1), typeof(ceil(CAST(5 as BIGINT), 1))").show()
+--------------------------+----------------------------------+
|ceil(CAST(5 AS BIGINT), 1)|typeof(ceil(CAST(5 AS BIGINT), 1))|
+--------------------------+----------------------------------+
|                         5|                     decimal(21,0)|
+--------------------------+----------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as BIGINT), -21), typeof(ceil(CAST(5 as BIGINT), -21))").show()
+----------------------------+------------------------------------+
|ceil(CAST(5 AS BIGINT), -21)|typeof(ceil(CAST(5 AS BIGINT), -21))|
+----------------------------+------------------------------------+
|        10000000000000000...|                       decimal(22,0)|
+----------------------------+------------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as FLOAT), 1), typeof(ceil(CAST(5 as FLOAT), 1))").show()
+-------------------------+---------------------------------+
|ceil(CAST(5 AS FLOAT), 1)|typeof(ceil(CAST(5 AS FLOAT), 1))|
+-------------------------+---------------------------------+
|                      5.0|                     decimal(9,1)|
+-------------------------+---------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as FLOAT), -15), typeof(ceil(CAST(5 as FLOAT), -15))").show()
+---------------------------+-----------------------------------+
|ceil(CAST(5 AS FLOAT), -15)|typeof(ceil(CAST(5 AS FLOAT), -15))|
+---------------------------+-----------------------------------+
|           1000000000000000|                      decimal(16,0)|
+---------------------------+-----------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as DOUBLE), 1), typeof(ceil(CAST(5 as DOUBLE), 1))").show()
+--------------------------+----------------------------------+
|ceil(CAST(5 AS DOUBLE), 1)|typeof(ceil(CAST(5 AS DOUBLE), 1))|
+--------------------------+----------------------------------+
|                       5.0|                     decimal(17,1)|
+--------------------------+----------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as DOUBLE), -31), typeof(ceil(CAST(5 as DOUBLE), -31))").show()
+----------------------------+------------------------------------+
|ceil(CAST(5 AS DOUBLE), -31)|typeof(ceil(CAST(5 AS DOUBLE), -31))|
+----------------------------+------------------------------------+
|        10000000000000000...|                       decimal(32,0)|
+----------------------------+------------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as DECIMAL(5, 2)), 1), typeof(ceil(CAST(5 as DECIMAL(5, 2)), 1))").show()
+--------------------------------+----------------------------------------+
|ceil(CAST(5 AS DECIMAL(5,2)), 1)|typeof(ceil(CAST(5 AS DECIMAL(5,2)), 1))|
+--------------------------------+----------------------------------------+
|                             5.0|                            decimal(5,1)|
+--------------------------------+----------------------------------------+

>>> spark.sql("SELECT ceil(CAST(5 as DECIMAL(5, 2))), typeof(ceil(CAST(5 as DECIMAL(5, 2))))").show()
+-----------------------------+-------------------------------------+
|CEIL(CAST(5 AS DECIMAL(5,2)))|typeof(CEIL(CAST(5 AS DECIMAL(5,2))))|
+-----------------------------+-------------------------------------+
|                            5|                         decimal(4,0)|
+-----------------------------+-------------------------------------+

>>> spark.sql("SELECT ceil(5.4, -1), typeof(ceil(5.4, -1)), typeof(5.4)").show()
+-------------+---------------------+------------+
|ceil(5.4, -1)|typeof(ceil(5.4, -1))| typeof(5.4)|
+-------------+---------------------+------------+
|           10|         decimal(2,0)|decimal(2,1)|
+-------------+---------------------+------------+

>>> spark.sql("SELECT ceil(5, -1), typeof(ceil(5, -1)), typeof(5)").show()
+-----------+-------------------+---------+
|ceil(5, -1)|typeof(ceil(5, -1))|typeof(5)|
+-----------+-------------------+---------+
|         10|      decimal(11,0)|      int|
+-----------+-------------------+---------+

>>> spark.sql("SELECT ceil(5, 0), typeof(ceil(5, 0)), typeof(5)").show()
+----------+------------------+---------+
|ceil(5, 0)|typeof(ceil(5, 0))|typeof(5)|
+----------+------------------+---------+
|         5|     decimal(11,0)|      int|
+----------+------------------+---------+
