Skip to content

[Feature-wip] support datev2 - #9916

Merged
yiguolei merged 3 commits into
apache:masterfrom
Gabriel39:refactor_time_be_dev
Jun 26, 2022
Merged

[Feature-wip] support datev2#9916
yiguolei merged 3 commits into
apache:masterfrom
Gabriel39:refactor_time_be_dev

Conversation

@Gabriel39

Copy link
Copy Markdown
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...

@Gabriel39Gabriel39 mentioned this pull request Jun 1, 2022
@Gabriel39Gabriel39 changed the title [Feature-wip] support datev2/datetimev2/timev2 in FE[Feature-wip] support datev2Jun 1, 2022
@github-actionsgithub-actionsBot 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
Gabriel39force-pushed the refactor_time_be_dev branch 22 times, most recently from b2faa13 to 6cbc559CompareJune 23, 2022 07:12
Comment threadbe/src/exec/olap_scan_node.cpp Outdated
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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.

Comment threadbe/src/olap/types.h
}
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Gabriel39force-pushed the refactor_time_be_dev branch 3 times, most recently from 1ae65ef to fb14fc8CompareJune 25, 2022 07:00
@Gabriel39
Gabriel39 requested a review from HappenLeeJune 25, 2022 07:01
@Gabriel39
Gabriel39force-pushed the refactor_time_be_dev branch from fb14fc8 to b2c8650CompareJune 25, 2022 11:03
@Gabriel39
Gabriel39force-pushed the refactor_time_be_dev branch from b2c8650 to d888cd9CompareJune 25, 2022 14:40
@Gabriel39
Gabriel39force-pushed the refactor_time_be_dev branch from d888cd9 to f7271beCompareJune 26, 2022 00:53

@yiguoleiyiguolei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@yiguolei

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actionsgithub-actionsBot added approved Indicates a PR has been approved by one committer. reviewed labels Jun 26, 2022
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@yiguolei
yiguolei merged commit ca94867 into apache:masterJun 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>
@Gabriel39
Gabriel39 deleted the refactor_time_be_dev branch July 30, 2026 06:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.area/loadIssues or PRs related to all kinds of loadarea/plannerIssues or PRs related to the query plannerarea/sql/functionIssues or PRs related to the SQL functionsarea/vectorizationkind/testreviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Refactor date/datetime type

3 participants

@Gabriel39@yiguolei@HappenLee