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

Adds lt, lte, gt, gte, eq, not operators. #1330

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

rchowell
Copy link
Contributor

@rchowell rchowell commented Jan 3, 2024

Descriptions

Adds evaluation comparison functions from SQL-99 8.2 Comparison Predicate page 287.

License Information

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

Copy link

github-actions bot commented Jan 3, 2024

Conformance comparison report

Base (dd43328) 522add2 +/-
% Passing 92.54% 92.54% 0.00%
✅ Passing 5384 5384 0
❌ Failing 434 434 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5384

Number failing in both: 434

Number passing in Base (dd43328) but now fail: 0

Number failing in Base (dd43328) but now pass: 0

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dd43328) 49.27% compared to head (603af2d) 49.27%.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             partiql-plugin-impl    #1330   +/-   ##
======================================================
  Coverage                  49.27%   49.27%           
  Complexity                  1046     1046           
======================================================
  Files                        166      166           
  Lines                      13395    13395           
  Branches                    2504     2504           
======================================================
  Hits                        6600     6600           
  Misses                      6138     6138           
  Partials                     657      657           
Flag Coverage Δ
CLI 11.86% <ø> (ø)
EXAMPLES 80.28% <ø> (ø)
LANG 54.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +82 to +89
return if (lhs.isNull || rhs.isNull) {
boolValue(null)
} else {
boolValue(lhs == rhs)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider: MISSING = a where a is a non-missing value, I am not sure if this should return false...
At the moment maybe just add a note to this? Or throw a TypeCheckException for consistency?

/**
* A [DataException] represents an unrecoverable query runtime exception.
*/
public class DataException(public override val message: String) : RuntimeException()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. File Name. Also, why is this unrecoverable, i.e., can we catch the exception and return MISSING in permissive mode?

Comment on lines +13 to +18
internal fun Int.asInt8(): Int8Value {
if (this < Byte.MIN_VALUE || Byte.MAX_VALUE < this) {
throw DataException("INT2 out of range: $this")
}
return int8Value(this.toByte())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are those cast needed?

Comment on lines +64 to +65
StaticType.TEXT.allTypes + listOf(StaticType.NULL),
StaticType.TEXT.allTypes + listOf(StaticType.NULL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this because SQL: 99 only support equal / not equal operator for comparison between large object strings?

@rchowell rchowell merged commit c7466e4 into partiql-plugin-impl Jan 5, 2024
10 checks passed
@rchowell rchowell deleted the eval-comparisons branch January 5, 2024 17:58
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.

3 participants