-
Notifications
You must be signed in to change notification settings - Fork 43
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
Update getKustoDateTime with more lenient formatter #246
Conversation
Related to #241 |
data/src/main/java/com/microsoft/azure/kusto/data/KustoResultSetTable.java
Outdated
Show resolved
Hide resolved
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.
Nice!
We need to add additional tests for fractions and partial values before completing this PR. |
Do you have examples of the different datetime formats that you would want this method to support? |
@breriksenms This PR replaces both KUSTO_DATETIME_PATTERN_NO_FRACTIONS and KUSTO_DATETIME_PATTERN Also KUSTO_DATETIME_FORMATS in CslDateTimeFormat still doesn't seem to support timezones. |
I added new tests for the getKustoDateTime function that covers the different formats it supports. I'm not certain what you want to do with the KUSTO_DATETIME_FORMATS and timezones. I think that's more for sending a datetime out to Kusto, not for receiving it. Kusto only sends back datetimes in UTC timezone. The original getKustoDateTime function only supported UTC and then only in 2 formats. This PR just expands it to support a variable number of digits in the fraction of a second. |
Ok, looks good! |
Pull Request Description
The
getKustoDateTime
function uses 2 potential formatters for the LocalDateTime that either include no digits for the fraction of a second or 7 digits for the fraction of a second. We ran into a situation where the value coming back from ADX had a different number of digits and would cause this method to fail. This code updates that function to just use the built-inISO_LOCAL_DATE_TIME
formatter, which allows for 0-9 digits in the fraction of a second, and appends the literal 'Z' to the end of the formatter to account for that value being present in the datetimes that ADX sends back.Future Release Comment
Updating the
getKustoDateTime
function to use the built-inISO_LOCAL_DATE_TIME
formatter, which allows for 0-9 digits in the fraction of a second, and append the literal 'Z' to the end of the formatter to account for that value being present in the datetimes that ADX sends back.Breaking Changes:
Features:
Fixes:
getKustoDateTime