Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 3.0
-
None
-
None
-
ghx-label-2
Description
Testing of other issues revealed a somewhat bizarre aspect of how the planner expression nodes render 0. NumericLiteral.toSql() uses the Java BigDecimal class to convert a numeric value to a string for use in explained plans.
The default Java behavior is to consider scale when rendering numbers, including 0. Thus, depending on precision and scale, you may get:
0 0.0 0.00 0.000 ... 0E-38
Mathematically, zero is zero. Unlike Java, SQL attaches no significance to the decimal point. (In Java, 0 is an integer, 0.0 is a float.) Nor does SQL attach significance to the number of zeros past the decimal point. And, of course, we're only talking about the output of EXPLAIN, which is never parsed anyway (except in tests.)
To make testing easier, change the behavior to always emit "0" when the value is zero, regardless of precision or scale.
Attachments
Issue Links
- relates to
-
IMPALA-5821 Distinguish numeric types and show implicit cast in EXTENDED explain plans
- Resolved