Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
DateTime64 data type #7170
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
For changelog. Remove if this is non-significant change.
Category (leave one):
Short description (up to few sentences):
Things not addressed in this PR and to be implemented later:
…ield type. Since DateTime64 is just a typedef, and there is no explicit Field-type for it, we have to solely rely on type_hint provided by origin column. If the hint is missing, there is no way of distinguishing DateTime64 from Decimal64. Alternative could be having explicit converting code, (and it looks like it has to be added at some point).
KochetovNicolai left a comment
The first iteration is finished.
Generally, everything is good. But I still need to test how it works.
Also, it would be better to split pr to smaller steps next time. E.g. single pr with decimal refactoring and new type, several prs with functions and pr with asof join.
* put functions in DecimalFunctions into DecimalUtils namespace * fixed possible buffer overflow in parseDateTimeBestEffortImpl * fixed readDateTimeTextImpl not to require fractional part separator (if fractional part is missing) * Tests for code from DecimalFunctions.h * Fixed serializing DateTime64 to string with writeDateTimeText(), fixed tests
@KochetovNicolai Thanks for a review!
well, it is already there, current function prototype is
I think that
There is no consensus on what format specifier to use and how to set precision. And it is explicitly marked in PR description that we'll do that later (as you've mentioned PR is already HUGE), so let's postpone formatting till everything else is resolved.
* More precise overflow check in readIntTextImpl * writeDateTimeText now always writes sub-second part for DateTime64 * comment for validateFunctionArgumentTypes * DateTime64-related fixes for FunctionConvertFromString * other minoe fixes: comments, removed commented out code, variable renamings, etc.
* Fixed precision calculation in DataTypeDecimalBase c-tor * Fixed max precision calculation in getLeastSupertype * Fixed reading past end of vector in FunctionsConversion with extractToDecimalScale * More verbose comments on FunctionArgumentTypeValidator and validateFunctionArgumentTypes * style and other minor fixes.