-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dialect fixes for operator.date test as of AOS-203 #4
Conversation
…ses in 'operator.date' test (AOS-203) Signed-off-by: Yury Fridlyand <[email protected]>
@@ -63,16 +63,87 @@ | |||
<argument type='datetime' /> | |||
<argument type='datetime' /> | |||
</function> | |||
|
|||
<function group='operator' name='==' return-type='bool'> | |||
<formula>(TIMESTAMP(%1) = TIMESTAMP(%2))</formula> |
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.
Do you need to have the timestamp function when the type itself is already a datetime?
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.
Unfortunately, yes. Due to opensearch-project#259 and opensearch-project#294 OSSQL doesn't return valid types and can't compare across different types. Once everything is compared to TS, we can compare things.
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.
I think it would be better to use CAST vs. the TIMESTAMP function as mentioned in the past due to perf concerns.
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.
See fix in 96ac3ca
</function> | ||
<function group='operator' name='==' return-type='bool'> | ||
<formula>(TIMESTAMP(%1) = TIMESTAMP(%2))</formula> | ||
<argument type='datetime' /> |
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.
I think just calling TIMESTAMP would cause an issue where the time would not be 00:00:00 as expected. We have to do something like SUBDATE(TIMESTAMP(DATE(%2)), INTERVAL HOUR(TIMESTAMP(DATE(%2))) HOUR). This will likely result in a an error logged in this issue.
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.
Signed-off-by: Yury Fridlyand <[email protected]>
Signed-off-by: Yury Fridlyand <[email protected]>
@@ -65,62 +65,62 @@ | |||
</function> | |||
|
|||
<function group='operator' name='==' return-type='bool'> | |||
<formula>(CAST(%1 as TIMESTAMP) = CAST(%2 as TIMESTAMP))</formula> | |||
<formula>(CAST(DATE_FORMAT(%1, '%Y-%m-%d %H:%i:%s') AS TIMESTAMP) = CAST(DATE_FORMAT(%2, '%Y-%m-%d %H:%i:%s') as TIMESTAMP))</formula> |
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.
Is an alternative here to just use the TIMESTAMP function directly instead of the combo CAST/DATE_FORMAT?
Signed-off-by: Yury Fridlyand <[email protected]>
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.
Nit: Please reference things via the OpenSource GitHub versus BQ Atlassian links.
|
||
<function group='operator' name='-' return-type='real'> | ||
<!-- 86400 as it represents seconds in a day --> | ||
<formula>((TO_DAYS(CAST(%1 as TIMESTAMP)) - TO_DAYS(CAST(%2 as TIMESTAMP))) + ((TIME_TO_SEC(CAST(%1 as TIMESTAMP)) - TIME_TO_SEC(CAST(%2 as TIMESTAMP))) / 86400.0))</formula> |
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.
Casting DATE to TIMESTAMP doesn't work. We have to use TIMESTAMP() or DATE_FORMAT. Ideally we should use SUBDATE(TIMESTAMP(%2), INTERVAL HOUR(TIMESTAMP(%2)) HOUR).
# This is the 1st commit message: Fix create_index/create_index_with_IOException issue caused by OpenSearch PR change (opensearch-project#1899) * Added setDefaultMediaType for create_index and create_index_with_IOException Signed-off-by: Mitchell Gale <[email protected]> (cherry picked from commit 7b932a7) Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Converts java doc table to proper java doc table. Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs 2 Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> cherry pick 60c0018 Signed-off-by: Mitchell Gale <[email protected]> Addressed PR comment for table format in AbstractExprValue. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from ExpressionReferenceOptimizer. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> fixed java doc in QualifiedName.java Signed-off-by: Mitchell Gale <[email protected]> Removing checkstyle test for core and added spotless for relevant directories. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #2: Fixing spacing around headers in ExpressionReferenceOptimizer.java SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #3: Fix breaking changes. Disable some flaky tests in legacy. Signed-off-by: Yury-Fridlyand <[email protected]> (cherry picked from commit 809e656) Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #4: Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #5: running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #6: Fixed java doc spelling and improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #7: improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #8: Improving failure format on some functions. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #9: spotless apply and fix of build.gradle Signed-off-by: Mitchell Gale <[email protected]>
[Spotless] Applying Google Code Format for core/src/main files #4
Signed-off-by: Mitchell Gale <[email protected]>
…ensearch-project#1930) * # This is a combination of 9 commits. # This is the 1st commit message: Fix create_index/create_index_with_IOException issue caused by OpenSearch PR change (opensearch-project#1899) * Added setDefaultMediaType for create_index and create_index_with_IOException Signed-off-by: Mitchell Gale <[email protected]> (cherry picked from commit 7b932a7) Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Converts java doc table to proper java doc table. Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs 2 Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> cherry pick 60c0018 Signed-off-by: Mitchell Gale <[email protected]> Addressed PR comment for table format in AbstractExprValue. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from ExpressionReferenceOptimizer. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> fixed java doc in QualifiedName.java Signed-off-by: Mitchell Gale <[email protected]> Removing checkstyle test for core and added spotless for relevant directories. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #2: Fixing spacing around headers in ExpressionReferenceOptimizer.java SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #3: Fix breaking changes. Disable some flaky tests in legacy. Signed-off-by: Yury-Fridlyand <[email protected]> (cherry picked from commit 809e656) Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #4: Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #5: running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #6: Fixed java doc spelling and improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #7: improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #8: Improving failure format on some functions. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #9: spotless apply and fix of build.gradle Signed-off-by: Mitchell Gale <[email protected]> * parent 496fe8e author Mitchell Gale <[email protected]> 1691080710 -0700 committer Mitchell Gale <[email protected]> 1691080766 -0700 Fix create_index/create_index_with_IOException issue caused by OpenSearch PR change (opensearch-project#1899) * Added setDefaultMediaType for create_index and create_index_with_IOException Signed-off-by: Mitchell Gale <[email protected]> (cherry picked from commit 7b932a7) Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Converts java doc table to proper java doc table. Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs 2 Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> cherry pick 60c0018 Signed-off-by: Mitchell Gale <[email protected]> Addressed PR comment for table format in AbstractExprValue. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from ExpressionReferenceOptimizer. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> fixed java doc in QualifiedName.java Signed-off-by: Mitchell Gale <[email protected]> Removing checkstyle test for core and added spotless for relevant directories. Signed-off-by: Mitchell Gale <[email protected]> Fixing spacing around headers in ExpressionReferenceOptimizer.java SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> Fix breaking changes. Disable some flaky tests in legacy. Signed-off-by: Yury-Fridlyand <[email protected]> (cherry picked from commit 809e656) Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Fixed java doc spelling and improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> Improving failure format on some functions. Signed-off-by: Mitchell Gale <[email protected]> spotless apply and fix of build.gradle Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Converts java doc table to proper java doc table. Signed-off-by: Mitchell Gale <[email protected]> Removing unused import in OpenSearchRestClientTest.java Signed-off-by: Mitchell Gale <[email protected]> * running spotless apply. Signed-off-by: Mitchell Gale <[email protected]> * Addressed comments in PR 5. Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]>
…ensearch-project#1933) * GJF part 4 Signed-off-by: Mitchell Gale <[email protected]> * add build.gradle comment to mention why we are ignoring checkstyle failures for core. Signed-off-by: Mitchell Gale <[email protected]> * Fix include spotless build gradle. Signed-off-by: Mitchell Gale <[email protected]> * revert astDSL.JAVA Signed-off-by: Mitchell Gale <[email protected]> * revert ast changes as was covered in spotless #1 PR for GJF. Signed-off-by: Mitchell Gale <[email protected]> * Reverting commits in ast folder attempt #2 Signed-off-by: Mitchell Gale <[email protected]> * revert change to RaretopN.java Signed-off-by: Mitchell Gale <[email protected]> * addressed PR comments. Signed-off-by: Mitchell Gale <[email protected]> * Replacing removed include in spotless. Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]>
…ensearch-project#1930) * # This is a combination of 9 commits. # This is the 1st commit message: Fix create_index/create_index_with_IOException issue caused by OpenSearch PR change (opensearch-project#1899) * Added setDefaultMediaType for create_index and create_index_with_IOException Signed-off-by: Mitchell Gale <[email protected]> (cherry picked from commit 7b932a7) Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Converts java doc table to proper java doc table. Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs 2 Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> cherry pick 60c0018 Signed-off-by: Mitchell Gale <[email protected]> Addressed PR comment for table format in AbstractExprValue. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from ExpressionReferenceOptimizer. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> fixed java doc in QualifiedName.java Signed-off-by: Mitchell Gale <[email protected]> Removing checkstyle test for core and added spotless for relevant directories. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #2: Fixing spacing around headers in ExpressionReferenceOptimizer.java SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #3: Fix breaking changes. Disable some flaky tests in legacy. Signed-off-by: Yury-Fridlyand <[email protected]> (cherry picked from commit 809e656) Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #4: Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #5: running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #6: Fixed java doc spelling and improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #7: improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #8: Improving failure format on some functions. Signed-off-by: Mitchell Gale <[email protected]> # This is the commit message #9: spotless apply and fix of build.gradle Signed-off-by: Mitchell Gale <[email protected]> * parent 496fe8e author Mitchell Gale <[email protected]> 1691080710 -0700 committer Mitchell Gale <[email protected]> 1691080766 -0700 Fix create_index/create_index_with_IOException issue caused by OpenSearch PR change (opensearch-project#1899) * Added setDefaultMediaType for create_index and create_index_with_IOException Signed-off-by: Mitchell Gale <[email protected]> (cherry picked from commit 7b932a7) Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Converts java doc table to proper java doc table. Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs 2 Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> cherry pick 60c0018 Signed-off-by: Mitchell Gale <[email protected]> Addressed PR comment for table format in AbstractExprValue. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from ExpressionReferenceOptimizer. Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from AstDSL.java Signed-off-by: Mitchell Gale <[email protected]> Removed pre tag from SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> fixed java doc in QualifiedName.java Signed-off-by: Mitchell Gale <[email protected]> Removing checkstyle test for core and added spotless for relevant directories. Signed-off-by: Mitchell Gale <[email protected]> Fixing spacing around headers in ExpressionReferenceOptimizer.java SelectExpressionAnalyzer.java Signed-off-by: Mitchell Gale <[email protected]> Fix breaking changes. Disable some flaky tests in legacy. Signed-off-by: Yury-Fridlyand <[email protected]> (cherry picked from commit 809e656) Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Fixed java doc spelling and improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> improving string concatination. Signed-off-by: Mitchell Gale <[email protected]> Improving failure format on some functions. Signed-off-by: Mitchell Gale <[email protected]> spotless apply and fix of build.gradle Signed-off-by: Mitchell Gale <[email protected]> Resolving merge conflicts for pre tag in java docs. Signed-off-by: Mitchell Gale <[email protected]> running spotless check on newly pre tagged javadocs. Signed-off-by: Mitchell Gale <[email protected]> Converts java doc table to proper java doc table. Signed-off-by: Mitchell Gale <[email protected]> Removing unused import in OpenSearchRestClientTest.java Signed-off-by: Mitchell Gale <[email protected]> * running spotless apply. Signed-off-by: Mitchell Gale <[email protected]> * Addressed comments in PR 5. Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]>
…ensearch-project#1933) * GJF part 4 Signed-off-by: Mitchell Gale <[email protected]> * add build.gradle comment to mention why we are ignoring checkstyle failures for core. Signed-off-by: Mitchell Gale <[email protected]> * Fix include spotless build gradle. Signed-off-by: Mitchell Gale <[email protected]> * revert astDSL.JAVA Signed-off-by: Mitchell Gale <[email protected]> * revert ast changes as was covered in spotless #1 PR for GJF. Signed-off-by: Mitchell Gale <[email protected]> * Reverting commits in ast folder attempt #2 Signed-off-by: Mitchell Gale <[email protected]> * revert change to RaretopN.java Signed-off-by: Mitchell Gale <[email protected]> * addressed PR comments. Signed-off-by: Mitchell Gale <[email protected]> * Replacing removed include in spotless. Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]>
…ensearch-project#1933) * GJF part 4 Signed-off-by: Mitchell Gale <[email protected]> * add build.gradle comment to mention why we are ignoring checkstyle failures for core. Signed-off-by: Mitchell Gale <[email protected]> * Fix include spotless build gradle. Signed-off-by: Mitchell Gale <[email protected]> * revert astDSL.JAVA Signed-off-by: Mitchell Gale <[email protected]> * revert ast changes as was covered in spotless #1 PR for GJF. Signed-off-by: Mitchell Gale <[email protected]> * Reverting commits in ast folder attempt #2 Signed-off-by: Mitchell Gale <[email protected]> * revert change to RaretopN.java Signed-off-by: Mitchell Gale <[email protected]> * addressed PR comments. Signed-off-by: Mitchell Gale <[email protected]> * Replacing removed include in spotless. Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]>
…in files #4 opensearch-project#1933 (opensearch-project#1995) * [Spotless] Applying Google Code Format for core/src/main files #4 (opensearch-project#1933) * GJF part 4 Signed-off-by: Mitchell Gale <[email protected]> * add build.gradle comment to mention why we are ignoring checkstyle failures for core. Signed-off-by: Mitchell Gale <[email protected]> * Fix include spotless build gradle. Signed-off-by: Mitchell Gale <[email protected]> * revert astDSL.JAVA Signed-off-by: Mitchell Gale <[email protected]> * revert ast changes as was covered in spotless #1 PR for GJF. Signed-off-by: Mitchell Gale <[email protected]> * Reverting commits in ast folder attempt #2 Signed-off-by: Mitchell Gale <[email protected]> * revert change to RaretopN.java Signed-off-by: Mitchell Gale <[email protected]> * addressed PR comments. Signed-off-by: Mitchell Gale <[email protected]> * Replacing removed include in spotless. Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> * spotless apply Signed-off-by: Mitchell Gale <[email protected]> * addressed PR comments Signed-off-by: Mitchell Gale <[email protected]> * remove pitest Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]>
Description
This makes 8 of 10 tests cases pass in
operator.date
test. Due to TDVT bug #888. Please note, tests passes on computer which has default time format = 'mm/dd/yyyy
' and not 'dd/mm/yyyy
' only.Failing test cases are:
date0 + num4
date0 - num4
Perhaps, it is caused by different processing double numbers or different lengths of exponent and fraction parts.
Issues Resolved
operator.date
testCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.