Details
-
Improvement
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
0.8.0, 1.2.0
Description
t1.json
{ "a1": 1 , "b1" : 1} { "a1": 2 , "b1" : 1} { "a1": 2 , "b1" : 2} { "a1": 3 , "b1" : 2} { "a1": 5000147483647 , "b1" : 3}
We should throw an error, this is technically data corruption.
0: jdbc:drill:schema=dfs> select cast(a1 as integer) from `t1.json`;
+------------+
| EXPR$0 |
+------------+
| 1 |
| 2 |
| 2 |
| 3 |
| 805551103 |
+------------+
5 rows selected (0.074 seconds)
0: jdbc:drill:schema=dfs> select cast(2147483648 as integer) from `t1.json`;
+------------+
| EXPR$0 |
+------------+
| -2147483648 |
| -2147483648 |
| -2147483648 |
| -2147483648 |
| -2147483648 |
+------------+
5 rows selected (0.076 seconds)
Attachments
Issue Links
- incorporates
-
DRILL-3278 SUM(CAST(columns[0] AS BIGINT)) OVER(...) gives wrong results
- Closed
I think this needs to be looked at in the broader sense. Due we throw exception in the case of truncation or overflow. I know some databases have an option to do both. My inclination is to simply overflow. I'm up for doing this with literals but I don't think the performance impact warrants doing this for all transformations. We could support it as an option but that would be a lot of work and I'm not sure it is an important priority.