-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Feature](literal)Support TimeV2Literal #47319
base: master
Are you sure you want to change the base?
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
TPC-H: Total hot run time: 32300 ms
|
TPC-DS: Total hot run time: 195154 ms
|
ClickBench: Total hot run time: 30.98 s
|
run p0 |
1 similar comment
run p0 |
run buildall |
run buildall |
TPC-H: Total hot run time: 32669 ms
|
TPC-DS: Total hot run time: 184397 ms
|
ClickBench: Total hot run time: 30.49 s
|
run buildall |
TeamCity be ut coverage result: |
run buildall |
TPC-H: Total hot run time: 32315 ms
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 192714 ms
|
ClickBench: Total hot run time: 30.85 s
|
run buildall |
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 32492 ms
|
run buildall |
TeamCity cloud ut coverage result: |
TPC-H: Total hot run time: 31606 ms
|
TPC-DS: Total hot run time: 189985 ms
|
ClickBench: Total hot run time: 30.9 s
|
TeamCity be ut coverage result: |
run buildall |
TeamCity cloud ut coverage result: |
TPC-H: Total hot run time: 31306 ms
|
TPC-DS: Total hot run time: 183551 ms
|
ClickBench: Total hot run time: 30.84 s
|
TeamCity be ut coverage result: |
run buildall |
TeamCity cloud ut coverage result: |
TPC-H: Total hot run time: 31361 ms
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 190451 ms
|
ClickBench: Total hot run time: 30.95 s
|
|
||
public TimeV2Literal(double value) throws AnalysisException { | ||
super(); | ||
if (value > (double) MAX_TIME.getValue() || value < -(double) MAX_TIME.getValue()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use MIN_TIME
when check lowest bound? does this mean, we accept -(838, 01,01, 0)
? it is lower than MIN_TIME
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAX_TIME and MIN_TIME just store every part min max value
fe/fe-core/src/main/java/org/apache/doris/analysis/TimeV2Literal.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
protected static boolean checkRange(double hour, long minute, long second, long microsecond) { | ||
return hour > 838 || minute > 59 || second > 59 || hour < 0 || minute < 0 || second < 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same problem as ctor. maybe the MIN_TIME's corrent value is -838, 59, 59, 999999, 6
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but, if caller input negative as argument'TimeLiteral(-1,-1,-1,-1,-1)', the checkRange will not work corrently, because if we call getValue() it return false. minute > MAXTIME.minute(59) || minute < MINTIME.minute(59) always return true(except 59) , perhaps the variable name should be changed to make it more consistent with usage
fe/fe-core/src/main/java/org/apache/doris/analysis/TimeV2Literal.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/analysis/TimeV2Literal.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/analysis/TimeV2Literal.java
Outdated
Show resolved
Hide resolved
protected boolean negative; | ||
|
||
public TimeV2Literal(String s) { | ||
this(TimeV2Type.of(0), s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ctor with string always has 0 as scale? how about 01:01:01.123456
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because if the sql isselect cast("01:01:01.123456" as time)
will call this function directly, the sql means scale is 0, unless it use as time(scale)
this situation will call another function
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/TimeV2Literal.java
Outdated
Show resolved
Hide resolved
public class TimeV2LiteralTest { | ||
|
||
@Test | ||
public void testTimeLiteralCreate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add out of bound test to ensure check is working as well
run buildall |
run buildall |
TeamCity cloud ut coverage result: |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)