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

[flash-487] support compare and some cast functions #239

Merged
merged 4 commits into from
Sep 18, 2019

Conversation

hanfei1991
Copy link
Member

No description provided.

|| (left_is_date = checkAndGetDataType<DataTypeDate>(arguments[0].get()))
|| (left_is_date_time = checkAndGetDataType<DataTypeDateTime>(arguments[0].get()))
|| (left_is_date = checkAndGetDataType<DataTypeDate>(arguments[0].get()) || checkAndGetDataType<DataTypeMyDate>(arguments[0].get()))
|| (left_is_date_time = checkAndGetDataType<DataTypeDateTime>(arguments[0].get()) || checkAndGetDataType<DataTypeMyDateTime>(arguments[0].get()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Clickhouse can not compare date and datetime since the internal representation is different, but since MyDate and MyDateTime use the same internal representation, we should allow compare them directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

Copy link
Member Author

Choose a reason for hiding this comment

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

MyDate and MyDateTime can be comparable without any change 😃

@@ -1269,6 +1306,8 @@ using FunctionToFloat32 = FunctionConvert<DataTypeFloat32, NameToFloat32, Positi
using FunctionToFloat64 = FunctionConvert<DataTypeFloat64, NameToFloat64, PositiveMonotonicity>;
using FunctionToDate = FunctionConvert<DataTypeDate, NameToDate, ToIntMonotonicity<UInt16>>;
using FunctionToDateTime = FunctionConvert<DataTypeDateTime, NameToDateTime, ToIntMonotonicity<UInt32>>;
using FunctionToMyDate = FunctionConvert<DataTypeMyDate, NameToDate, ToIntMonotonicity<UInt16>>;
Copy link
Contributor

Choose a reason for hiding this comment

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

why UInt16 for MyDate?

Copy link
Member Author

Choose a reason for hiding this comment

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

my mistake

template <> struct FunctionTo<DataTypeDecimal32> { using Type = FunctionToDecimal<Decimal32>; };
template <> struct FunctionTo<DataTypeDecimal64> { using Type = FunctionToDecimal<Decimal64>; };
template <> struct FunctionTo<DataTypeDecimal128> { using Type = FunctionToDecimal<Decimal128>; };
template <> struct FunctionTo<DataTypeDecimal256> { using Type = FunctionToDecimal<Decimal256>; };
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated changes?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, it's redundant.

@hanfei1991
Copy link
Member Author

./run-integration-tests

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

LGTM

@hanfei1991
Copy link
Member Author

/rebuild

@hanfei1991
Copy link
Member Author

./run-integration-tests

1 similar comment
@hanfei1991
Copy link
Member Author

./run-integration-tests

@hanfei1991 hanfei1991 merged commit 286d631 into master Sep 18, 2019
@hanfei1991 hanfei1991 deleted the hanfei-datetime/udf-1 branch September 18, 2019 17:10
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Aug 2, 2024
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.

2 participants