*: remove fsp out of Datum and Duration(experimental) #7013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What have you changed? (mandatory)
The purpose of this PR is remove fsp from Time(types.Duration).
What's Fsp?
For MySQL, Time/Timestamp/Datetime has an fsp argument is given to specify a fractional seconds precision from 0 to 6, the return value includes a fractional seconds part of that many digits.
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html
what's the problem now we have?
In current version(2.1 beta), types.Duration(stand for MySQL Time) has combinate time.Duration with fsp(int) in
types.Duration
but after reading previous MySQL document, we can abstract fsp is just :
So...fsp seems not property of Data type(like Time), but property of
but NOT a property of data , it will be only be calculate & allocate one time for a query in type infer stage, no need calcuate it in every row.
How?
to solve this, we should
pass ResultType.Column.decimal as new added parameter value
What are the type of the changes (mandatory)?
At, first we remove fsp in types.Duration, and modify
ToString
to let fsp can be pass in different context.Then modify time related funcation and testcase to meet type decimal infer.
How has this PR been tested (mandatory)?
This change is