Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/7954 )
Change subject: IMPALA-5664: Unix time to timestamp conversions may crash Impala ...................................................................... Patch Set 11: (5 comments) http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/exprs/cast-functions-ir.cc File be/src/exprs/cast-functions-ir.cc: http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/exprs/cast-functions-ir.cc@277 PS11, Line 277: } > all of these new if-stmts need end-to-end tests to cover. they aren't exerc They are exercised by different parts of be/exprs/expr-test.cc .I have searched for "TestIsNull.*as timestamp", and the existing tests cover every code line, but not every type instantiation for CAST_TO_SUBSECOND_TIMESTAMP / CAST_TO_TIMESTAMP, only BIGINT/DECIMAL/DOUBLE. Actually most integer types can not represent values that are outside the valid range, because it needs >32 bit. This design (BE unit tests call FE to parse expressions) seems strange to me, but there is probably a valid reason why it was not done in FE or E2E. http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/exprs/timestamp-functions-ir.cc File be/src/exprs/timestamp-functions-ir.cc: http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/exprs/timestamp-functions-ir.cc@139 PS11, Line 139: } > also needs test Done http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/runtime/timestamp-test.cc File be/src/runtime/timestamp-test.cc: http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/runtime/timestamp-test.cc@670 PS11, Line 670: * > nit: missing space here and below I can change this, but I prefer it this way actually. What is the rule, should we follow the style guide even if the contributor consciously ignored it? It doesn`t matter in this case, but it would matter with short variable names, e.g. I find a*a + 2*a*b much more readable than a * a + 2 * a * b. http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/runtime/timestamp-value.h File be/src/runtime/timestamp-value.h: http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/runtime/timestamp-value.h@43 PS11, Line 43: 9999 > is that what the documentation says? and did this code change affect the up This comment was just wrong, we state <= 9999-12-31 or <10000-01-01 everywhere else. This limitation comes from boost::gregorian, and this patch has no effect on it. http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/runtime/timestamp-value.cc File be/src/runtime/timestamp-value.cc: http://gerrit.cloudera.org:8080/#/c/7954/11/be/src/runtime/timestamp-value.cc@116 PS11, Line 116: ( > style Done -- To view, visit http://gerrit.cloudera.org:8080/7954 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I77b2f6284d3a597f57e61c17a67c959eff9e38ff Gerrit-Change-Number: 7954 Gerrit-PatchSet: 11 Gerrit-Owner: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Lars Volker <[email protected]> Gerrit-Comment-Date: Fri, 06 Oct 2017 13:00:10 +0000 Gerrit-HasComments: Yes
