Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: supports decimal type in RPC #2788

Merged
merged 12 commits into from
Nov 24, 2023

Conversation

QuenKar
Copy link
Contributor

@QuenKar QuenKar commented Nov 21, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

main change:

  • Decimal128 grpc

refactor ColumnDataTypeWrapper

#[derive(Debug, PartialEq)]
pub struct ColumnDataTypeWrapper {
    datatype: ColumnDataType,
    datatype_ext: Option<ColumnDataTypeExtension>,
}
  • ColumnDataTypeWrapper can convert with ConcreteDataType.(refactor From/TryFrom trait).
  • we can use ColumnDataType::xxx_datatype() to create, as ConcreteDataType style.
  • use datatype() can get (ColumnDataType, Option<ColumnDataTypeExtension>) , which is needed by ColumnSchema ,ColumnDef and Column.
  • use try_new to construct a ColumnDataTypeWrapper.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

#2682
GreptimeTeam/greptime-proto#122

@QuenKar QuenKar marked this pull request as ready for review November 21, 2023 08:52
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Merging #2788 (9a67619) into develop (a7bbd61) will decrease coverage by 0.14%.
Report is 11 commits behind head on develop.
The diff coverage is 80.87%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2788      +/-   ##
===========================================
- Coverage    84.47%   84.34%   -0.14%     
===========================================
  Files          728      731       +3     
  Lines       113352   114517    +1165     
===========================================
+ Hits         95756    96587     +831     
- Misses       17596    17930     +334     

@QuenKar QuenKar requested a review from evenyag November 22, 2023 07:57
Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

I'll review the rest parts after the proto is updated.

src/api/src/helper.rs Show resolved Hide resolved
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

This PR adds a feature and not only refactors the ColumnDataTypeWrapper. @QuenKar Could you edit the title? And I think it actually supports decimal type in RPC.

src/api/src/helper.rs Outdated Show resolved Hide resolved
src/api/src/helper.rs Show resolved Hide resolved
src/api/src/helper.rs Outdated Show resolved Hide resolved
src/datatypes/src/types/decimal_type.rs Show resolved Hide resolved
src/mito2/src/memtable/key_values.rs Outdated Show resolved Hide resolved
src/mito2/src/memtable/key_values.rs Outdated Show resolved Hide resolved
src/mito2/src/request.rs Outdated Show resolved Hide resolved
src/operator/src/expr_factory.rs Outdated Show resolved Hide resolved
src/common/decimal/src/decimal128.rs Outdated Show resolved Hide resolved
src/operator/src/req_convert/common.rs Outdated Show resolved Hide resolved
@QuenKar QuenKar changed the title refactor: ColumnDataTypeWrapper feat: supports decimal type in RPC Nov 24, 2023
src/api/src/helper.rs Show resolved Hide resolved
src/api/src/helper.rs Show resolved Hide resolved
src/api/src/helper.rs Show resolved Hide resolved
src/api/src/helper.rs Outdated Show resolved Hide resolved
src/api/src/helper.rs Show resolved Hide resolved
src/datatypes/src/types/decimal_type.rs Show resolved Hide resolved
Co-authored-by: Yingwen <realevenyag@gmail.com>
src/mito2/src/memtable/time_series.rs Outdated Show resolved Hide resolved
Co-authored-by: Yingwen <realevenyag@gmail.com>
Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@evenyag evenyag added this pull request to the merge queue Nov 24, 2023
Merged via the queue into GreptimeTeam:develop with commit 3a4c9f2 Nov 24, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants