-
Notifications
You must be signed in to change notification settings - Fork 358
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
DHIS-16705 Fix handling of NV filter clause #19758
Conversation
luciano-fiandesio
commented
Jan 23, 2025
- Fix reference to table alias in PI CTE
- Fix quoting of sort order column
operator = "is not"; | ||
} else { | ||
throw new IllegalQueryException( | ||
ErrorCode.E3000, |
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.
we should use a dedicated error code
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.
Argh, you are right, fixing it
String operator = "NULL".equals(value) ? "is" : filter.getSqlOperator(); | ||
String operator = filter.getSqlOperator(); | ||
|
||
if (value.trim().equalsIgnoreCase("null")) { |
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 we could find a way to make this a bit more compact/encapsulated. We could move "null" to a constant.
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.
Agreed, I can refactor it to be more compact and readable. Do we have constants for null
somewhere? I am sure there must be but hard to find the constant
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.
Great. Right. I guess there is AnalyticsConstants
where we could add it.
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.
Ok,done
if (value.trim().equalsIgnoreCase("null")) { | ||
if (filter.getOperator() == QueryOperator.EQ || filter.getOperator() == QueryOperator.IEQ) { | ||
operator = "is"; | ||
} else if (filter.getOperator() == QueryOperator.NEQ |
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.
There is now a method in master isNotEqualTo()
for QueryOperator
which we can use here.
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.
Ah nice
- Fix reference to table alias in PI CTE - Fix quoting of sort order column
88fac45
to
e742a28
Compare
Quality Gate passedIssues Measures |