Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.13.0
-
None
-
None
Description
The typeof() function returns the type of a column:
SELECT typeof(CAST(a AS DOUBLE)) FROM (VALUES (1)) AS T(a); +---------+ | EXPR$0 | +---------+ | FLOAT8 | +---------+
In Drill, the DECIMAL type is parameterized with scale and precision. However, typeof() does not return this information:
ALTER SESSION SET `planner.enable_decimal_data_type` = true; SELECT typeof(CAST(a AS DECIMAL)) FROM (VALUES (1)) AS T(a); +------------------+ | EXPR$0 | +------------------+ | DECIMAL38SPARSE | +------------------+ SELECT typeof(CAST(a AS DECIMAL(6, 3))) FROM (VALUES (1)) AS T(a); +-----------+ | EXPR$0 | +-----------+ | DECIMAL9 | +-----------+
Expected something of the form DECIMAL<suffix>(<scale>, <precision>).