-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add scalar functions in postgres #165
Conversation
Codecov Report
@@ Coverage Diff @@
## main #165 +/- ##
============================================
+ Coverage 78.02% 78.11% +0.08%
Complexity 758 758
============================================
Files 79 79
Lines 3318 3317 -1
Branches 371 371
============================================
+ Hits 2589 2591 +2
+ Misses 568 565 -3
Partials 161 161
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
CREATE OR REPLACE FUNCTION dateTimeConvert (bigint, bigint) RETURNS bigint AS $$ select ((($1 + $2 - 1)/$2)*$2) $$ LANGUAGE SQL; | ||
|
||
CREATE OR REPLACE FUNCTION conditional (condition text, first text, second text) |
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.
should condition be text or boolean? similarly, is there any kind of "any" type for first and second?
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.
That is what we discussed yesterday right that condition can be null as well. That is reason I have used text, and converting to boolean only if it is not null.
All arguments must be of specific type in postgres functions.
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.
HTPinotQueriesTest > testServicesQueriesForAvgRateWithTimeAggregation() FAILED
org.opentest4j.AssertionFailedError: expected: <4> but was: <5>
at app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
at app//org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:527)
at app//org.hypertrace.core.query.service.htqueries.HTPinotQueriesTest.testServicesQueriesForAvgRateWithTimeAggregation(HTPinotQueriesTest.java:396)
None of the changes in PR impact pinot implementation in any way. Let me check this failure by running locally. |
No description provided.