Csaba Ringhofer has posted comments on this change. ( http://gerrit.cloudera.org:8080/11450 )
Change subject: IMPALA-7492: Add support for DATE text parser/formatter ...................................................................... Patch Set 2: (9 comments) http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-test.cc File be/src/runtime/date-test.cc: http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-test.cc@120 PS2, Line 120: ValidateDate I think that it's worth mentioning both here and in the commit message that Impala's parsing logic is checked with against CCTZ's logic. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-test.cc@418 PS2, Line 418: { I would prefer to move this block to a member function of DateTc. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-test.cc@424 PS2, Line 424: "TC: " << i; Instead of printing the index it would be more informative print test_case.str or adding a << function for DateTc. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-test.cc@472 PS2, Line 472: { Similarly to line 418, I would prefer to move this block to a member function + replace '<< "TC: " << i' with more detailed info. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-test.cc@490 PS2, Line 490: // Test min supported date. Please mention here that MIN_DATE_DAYS_SINCE_EPOCH is calculated with Proleptic Gregorian calendar and is expected to be different than 0001-01-01 Hive. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-value.h File be/src/runtime/date-value.h: http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-value.h@44 PS2, Line 44: MIN_DAYS_SINCE_EPOCH - 1 I would prefer to choose another value for invalid dates - my concern is that this may be valid if written by Hive or other systems that do not use Proleptic Gregorian Calendar. This probably wouldn't cause an issue, but it would clearer to use a more extreme value. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-value.h@46 PS2, Line 46: year >= MIN_YEAR && year <= MAX_YEAR LIKELY could be added here. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-value.h@67 PS2, Line 67: ToCivilDay I would prefer to avoid including CCTZ in the interface (but not at all costs) and hide it behind the implementation of TimestampValue/DateValue/TimezoneDb. Maybe some utility functions could be added somewhere that do these conversions. CCTZ will be useful for functions like addDay/addYear/dayOfWeek, but these could be also added to the interface of DateValue, so the CCTZ can do its work in the implementation. http://gerrit.cloudera.org:8080/#/c/11450/2/be/src/runtime/date-value.h@101 PS2, Line 101: int32_t days_since_epoch_; Please add more explanation about the representation here or at the start of the class e.g.: - the epoch is 1970.01.01 - this representation was chosen to be the same (bit-by-bit) as Parquet's date: https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#date - boost::gregorian::date could not be used as representation due to its limited range - Proleptic Gregorian calendar which can lead to different historical representation compared to Hive (https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar) -- To view, visit http://gerrit.cloudera.org:8080/11450 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1eec00f22502c4c67c6807c4b51384419ea8b831 Gerrit-Change-Number: 11450 Gerrit-PatchSet: 2 Gerrit-Owner: Attila Jeges <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]> Gerrit-Comment-Date: Mon, 17 Sep 2018 17:22:12 +0000 Gerrit-HasComments: Yes
