Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Support DateTime Casting in CAST() function #271

Closed
wants to merge 13 commits into from
Closed

Support DateTime Casting in CAST() function #271

wants to merge 13 commits into from

Conversation

davidcui1225
Copy link
Contributor

Issue #, if available:
#268
Description of changes:
Add support to cast to DateTime in CAST() in yyyy-MM-dd'T'HH:mm:ss.SSS'Z' format.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -312,6 +317,86 @@ public void castIntFieldToDoubleWithAliasJdbcFormatGroupByTest() {
}
}

@Test
public void castFieldToDatetimeWithoutAliasTest() throws IOException {
String query = "SELECT CAST(insert_time AS DATETIME) FROM " + TestsConstants.TEST_INDEX_ONLINE +
Copy link
Member

Choose a reason for hiding this comment

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

I see that index online doesn't have predefined mapping. Could you check if field insert_time is already a date in ES? If so, I think we need to test against fields of different type, ex. keyword. I assume that's the point of CAST statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right- will find other fields to test the Datetime cast

@davidcui1225
Copy link
Contributor Author

Closing this pull request for #310

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants