Skip to content

feat : Addition of API support for receiving attribute expressions #126

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

Merged
merged 17 commits into from
Dec 23, 2021

Conversation

sarthak77
Copy link
Member

@sarthak77 sarthak77 commented Dec 17, 2021

Ref issue: #99

Files changed :

  • ExecutionContext
  • PinotBasedRequestHandler
  • ProjectionTransformation
  • QueryRequestToPinotSQLConverter

Testing

  • Integration tests ( copy existing ones and check if work for attribute expression as well )
  • Integration tests ( new )
  • Unit tests

@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #126 (d51263a) into main (94d19d8) will increase coverage by 0.17%.
The diff coverage is 83.90%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #126      +/-   ##
============================================
+ Coverage     81.12%   81.29%   +0.17%     
- Complexity      567      575       +8     
============================================
  Files            53       53              
  Lines          2193     2235      +42     
  Branches        235      236       +1     
============================================
+ Hits           1779     1817      +38     
- Misses          320      323       +3     
- Partials         94       95       +1     
Flag Coverage Δ
integration 81.29% <83.90%> (+0.17%) ⬆️
unit 79.07% <79.31%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
...e/prometheus/QueryRequestEligibilityValidator.java 12.85% <0.00%> (-0.58%) ⬇️
...y/service/projection/ProjectionTransformation.java 87.37% <75.00%> (-2.75%) ⬇️
...ypertrace/core/query/service/QueryRequestUtil.java 83.11% <88.23%> (+11.68%) ⬆️
...ypertrace/core/query/service/ExecutionContext.java 95.45% <100.00%> (+0.38%) ⬆️
.../query/service/pinot/PinotBasedRequestHandler.java 70.86% <100.00%> (-0.20%) ⬇️
...service/pinot/QueryRequestToPinotSQLConverter.java 91.40% <100.00%> (+0.24%) ⬆️
...ry/service/prometheus/FilterToPromqlConverter.java 50.98% <100.00%> (+0.98%) ⬆️
...vice/prometheus/PrometheusBasedRequestHandler.java 84.90% <100.00%> (+0.29%) ⬆️
...core/query/service/prometheus/PrometheusUtils.java 83.33% <100.00%> (+3.33%) ⬆️
...vice/prometheus/QueryRequestToPromqlConverter.java 100.00% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94d19d8...d51263a. Read the comment docs.

@github-actions

This comment has been minimized.

@sarthak77 sarthak77 marked this pull request as ready for review December 20, 2021 04:54
@sarthak77 sarthak77 requested a review from a team December 20, 2021 04:54
// workaround is to use alias for now
builder.setColumnName(function.getFunctionName());
}
builder.setColumnName(getAlias(expression));
builder.setValueType(ValueType.STRING);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is value type always string and never repeated? Looks pre-existing, but pretty sure this is a bug. Can come back to it.

@@ -245,7 +248,7 @@ private boolean rhsHasLongValue(Expression rhs) {
// return it.
if (filter.getChildFilterCount() == 0) {
return doesSingleViewFilterMatchLeafQueryFilter(viewFilterMap, filter)
? Set.of(filter.getLhs().getColumnIdentifier().getColumnName())
? Set.of(getLogicalColumnName(filter.getLhs()))
Copy link
Contributor

Choose a reason for hiding this comment

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

This would break if I created a filter of "10 = duration" - it's assuming any col will be on the LHS. Can defer and file this since it's pre-existing and widespread in this code.

@github-actions

This comment has been minimized.

@kotharironak
Copy link
Contributor

@sarthak77 Can you add the integration test as discussed in the morning?

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

System.out.println(json);

// Change for attribute Expression
json = json.replaceAll("columnIdentifier", "attributeExpression");
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't have any existing columnIdentifier queries with map field with CONTAINS_KEY_VALUE, right? If, so, it will fail the transformation.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@aaron-steinfeld aaron-steinfeld merged commit 4daed08 into main Dec 23, 2021
@aaron-steinfeld aaron-steinfeld deleted the feat_api_support_for_attribute_expr branch December 23, 2021 18:14
@github-actions
Copy link

Unit Test Results

  30 files  ±0    30 suites  ±0   8s ⏱️ -1s
182 tests +8  182 ✔️ +8  0 💤 ±0  0 ❌ ±0 

Results for commit 4daed08. ± Comparison against base commit 94d19d8.

@sarthak77 sarthak77 mentioned this pull request Dec 24, 2021
2 tasks
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