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: Support DataTypes of Date and Time #657

Merged
merged 41 commits into from
Feb 24, 2023

Conversation

MichaelLeeHZ
Copy link
Contributor

@MichaelLeeHZ MichaelLeeHZ commented Feb 20, 2023

Which issue does this PR close?

Closes #194

Rationale for this change

Support DataTypes of Date and Time

What changes are included in this PR?

Support DataTypes of Date and Time

Are there any user-facing changes?

Support DataTypes of Date and Time

How does this change test

Test with following sqls:

curl --location --request POST 'http://127.0.0.1:5440/sql' \
--data-raw '
CREATE TABLE `demo` (
    `name` string TAG,
    `value` double NOT NULL,
    `t` timestamp NOT NULL,
    `dat` DATE ,
    `time` TIME ,
    timestamp KEY (t))
ENGINE=Analytic
  with
(enable_ttl="false")
'

curl -H POST 'http://127.0.0.1:5440/sql' -H 'Content-Type: application/json' -d '{
    "query": "INSERT INTO demo(`t`, name,value, dat,`time`) VALUES(1667374200022, '\''ceresdb04'\'', 1.0, '\''2022-10-13'\'','\''10:10:15.456'\'')"
}'

curl -H POST 'http://127.0.0.1:5440/sql' -H 'Content-Type: application/json' -d '{
    "query": "SELECT * from demo "
}'

@MichaelLeeHZ MichaelLeeHZ changed the title Feature support date feat: Support DataTypes of Date and Time Feb 20, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2023

Codecov Report

Merging #657 (3d76582) into main (ce9fa87) will increase coverage by 0.34%.
The diff coverage is 92.64%.

❗ Current head 3d76582 differs from pull request most recent head 265d2c1. Consider uploading reports for the commit 265d2c1 to get more accurate results

@@            Coverage Diff             @@
##             main     #657      +/-   ##
==========================================
+ Coverage   66.94%   67.28%   +0.34%     
==========================================
  Files         283      283              
  Lines       43969    44491     +522     
==========================================
+ Hits        29435    29936     +501     
- Misses      14534    14555      +21     
Impacted Files Coverage Δ
analytic_engine/src/instance/engine.rs 64.03% <ø> (ø)
components/arrow_ext/src/display.rs 0.00% <ø> (ø)
server/src/mysql/writer.rs 55.88% <0.00%> (-0.67%) ⬇️
wal/src/lib.rs 100.00% <ø> (ø)
wal/src/manager.rs 90.43% <ø> (-0.12%) ⬇️
analytic_engine/src/table/data.rs 91.43% <50.00%> (-0.22%) ⬇️
common_types/src/column.rs 62.46% <58.06%> (+1.43%) ⬆️
common_types/src/datum.rs 58.55% <82.65%> (+7.85%) ⬆️
common_util/src/avro.rs 17.35% <92.30%> (+11.50%) ⬆️
analytic_engine/src/instance/alter.rs 95.19% <100.00%> (-0.28%) ⬇️
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@MichaelLeeHZ MichaelLeeHZ requested review from Rachelint, ShiKaiWi and jiacai2050 and removed request for Rachelint February 20, 2023 13:38
@MichaelLeeHZ MichaelLeeHZ marked this pull request as ready for review February 20, 2023 14:22
common_util/src/avro.rs Show resolved Hide resolved
interpreters/src/tests.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
analytic_engine/src/table/data.rs Outdated Show resolved Hide resolved
common_types/src/column.rs Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
@ShiKaiWi
Copy link
Member

@MachaelLee I find the test coverage ratio of common_util/src/codec/memcomparable/datum.rs drops 5.5%.

MichaelLeeHZ and others added 3 commits February 21, 2023 23:00
Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>
Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Outdated Show resolved Hide resolved
common_types/src/datum.rs Show resolved Hide resolved
MichaelLeeHZ and others added 3 commits February 23, 2023 18:16
Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>
Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>
common_types/src/datum.rs Outdated Show resolved Hide resolved
Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>
Copy link
Member

@ShiKaiWi ShiKaiWi left a comment

Choose a reason for hiding this comment

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

LGTM

@ShiKaiWi ShiKaiWi added this pull request to the merge queue Feb 24, 2023
Merged via the queue into apache:main with commit 751c0b3 Feb 24, 2023
chunshao90 pushed a commit to chunshao90/ceresdb that referenced this pull request May 15, 2023
* add date type

* support date

* suppport date

* dev finish, ready to test

* impl time

* proto dependency

* import specify proto

* add some test

* remove blank lines

* remove blank lines

* remove blank lines

* fmt

* add test case

* fmt

* addd test case

* fmt

* udpate ut

* fix

* fix

* Update analytic_engine/src/table/data.rs

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>

* fix

* add some comment

* Update common_types/src/datum.rs

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>

* Update common_types/src/datum.rs

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>

* support negative time

* Update common_types/src/datum.rs

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>

* add some test

* support time

* test

* support mysql time

* format date  time

* add some test

* Update common_types/src/datum.rs

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>

* Update common_types/src/datum.rs

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>

* add some test

* Update common_types/src/datum.rs

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>

---------

Co-authored-by: WEI Xikai <ShiKaiWi@users.noreply.github.com>
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.

Should we support Date type?
4 participants