Skip to content

Commit

Permalink
aaa
Browse files Browse the repository at this point in the history
  • Loading branch information
koarz committed Feb 7, 2025
1 parent 3b13454 commit c65c84c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions be/src/vec/runtime/vdatetime_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ struct DateTimeV2ValueType {
class TimeV2ValueType {
public:
TimeV2ValueType() : neg_(0), microsecond_(0), second_(0), minute_(0), hour_(0) {}
TimeV2ValueType(uint16_t hour, uint8_t minute, uint8_t second, uint32_t microsecond)
TimeV2ValueType(int16_t hour, uint8_t minute, uint8_t second, uint32_t microsecond)
: neg_(hour < 0),
microsecond_(microsecond),
second_(second),
minute_(minute),
hour_(hour) {}
hour_(std::abs(hour)) {}

char* to_string(char* to) const {
if (neg_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.doris.nereids.types.DecimalV3Type;
import org.apache.doris.nereids.types.LargeIntType;
import org.apache.doris.nereids.types.StringType;
import org.apache.doris.nereids.types.TimeV2Type;
import org.apache.doris.nereids.types.VarcharType;
import org.apache.doris.nereids.types.coercion.IntegralType;

Expand Down Expand Up @@ -294,7 +295,7 @@ protected Expression uncheckedCastTo(DataType targetType) throws AnalysisExcepti
} else if (targetType.isIPv6Type()) {
return new IPv6Literal(desc);
} else if (targetType.isTimeLikeType()) {
return new TimeLiteral(desc);
return new TimeLiteral((TimeV2Type) targetType, desc);
}
throw new AnalysisException("cannot cast " + desc + " from type " + this.dataType + " to type " + targetType);
}
Expand Down

0 comments on commit c65c84c

Please sign in to comment.