Skip to content

Conversation

@Gabriel39
Copy link
Contributor

Proposed changes

Issue Number: close #9575

Problem Summary:

Describe the overview of changes.

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@Gabriel39 Gabriel39 changed the title [Feature-wip] support datev2/datetimev2/timev2 in FE [Feature-wip] support datev2 Jun 1, 2022
@github-actions github-actions bot added area/load Issues or PRs related to all kinds of load area/planner Issues or PRs related to the query planner area/sql/function Issues or PRs related to the SQL functions area/vectorization kind/test labels Jun 1, 2022
@Gabriel39 Gabriel39 force-pushed the refactor_time_be_dev branch 22 times, most recently from b2faa13 to 6cbc559 Compare June 23, 2022 07:12
Status OlapScanNode::change_fixed_value_range(ColumnValueRange<T>& temp_range, PrimitiveType type,
void* value, const ChangeFixedValueRangeFunc& func) {
void* value, const ChangeFixedValueRangeFunc& func,
PrimitiveType to_type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add param of to_type seems do not use ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This argument is added in order to meet patterns like cast(datev2 as datetimev2). Since datetimev2 has not been supported, this argument is indeed not used now.

}
static void set_to_min(void* buf) {
// min is 0 * 16 * 32 + 1 * 32 + 1;
*reinterpret_cast<CppType*>(buf) = doris::vectorized::MIN_DATE_V2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mysql seems support "0000-00-00", rethink whether we need to support the data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.

The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD hh:mm:ss' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

This is described in document[1]

[1] https://dev.mysql.com/doc/refman/8.0/en/datetime.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we do not support years before 1000. Although we could save it but could not support calculations. And maybe we could support it in the future.

@Gabriel39 Gabriel39 force-pushed the refactor_time_be_dev branch 3 times, most recently from 1ae65ef to fb14fc8 Compare June 25, 2022 07:00
@Gabriel39 Gabriel39 requested a review from HappenLee June 25, 2022 07:01
@Gabriel39 Gabriel39 force-pushed the refactor_time_be_dev branch from fb14fc8 to b2c8650 Compare June 25, 2022 11:03
@Gabriel39 Gabriel39 force-pushed the refactor_time_be_dev branch from b2c8650 to d888cd9 Compare June 25, 2022 14:40
@Gabriel39 Gabriel39 force-pushed the refactor_time_be_dev branch from d888cd9 to f7271be Compare June 26, 2022 00:53
Copy link
Contributor

@yiguolei yiguolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yiguolei
Copy link
Contributor

I will merge it and we can do decimal v3 based on this.

@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions github-actions bot added approved Indicates a PR has been approved by one committer. reviewed labels Jun 26, 2022
@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit ca94867 into apache:master Jun 26, 2022
xy720 pushed a commit that referenced this pull request Jul 21, 2022
1.This pr is used for adding the supported sub-type for array which has been modified in #9916
2.add regression test for the supported sub-type

Co-authored-by: hucheng01 <hucheng01@baidu.com>
miswujian pushed a commit to miswujian/doris that referenced this pull request Jul 28, 2022
1.This pr is used for adding the supported sub-type for array which has been modified in apache#9916
2.add regression test for the supported sub-type

Co-authored-by: hucheng01 <hucheng01@baidu.com>
whutpencil pushed a commit to whutpencil/incubator-doris that referenced this pull request Jul 29, 2022
1.This pr is used for adding the supported sub-type for array which has been modified in apache#9916
2.add regression test for the supported sub-type

Co-authored-by: hucheng01 <hucheng01@baidu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/load Issues or PRs related to all kinds of load area/planner Issues or PRs related to the query planner area/sql/function Issues or PRs related to the SQL functions area/vectorization kind/test reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Refactor date/datetime type

3 participants