Skip to content

Conversation

sunnut
Copy link

@sunnut sunnut commented Oct 26, 2018

  • If metric A & B has group by, the Output Name not work
  • If metric A & B has no group by, the Order and Size not work

@sunnut sunnut changed the title Add the support of group by for metric Add the support of group by for metric to Arithmetic Oct 26, 2018
@Gauravshah
Copy link
Member

Gauravshah commented Oct 29, 2018

fixes #14

@sunnut
Copy link
Author

sunnut commented Nov 1, 2018

@Gauravshah @ShilpaSivanesan
A pic to show the group by support.
image

@keithkml
Copy link

I would love to use this feature. When do you expect the code review will be complete?

@ShilpaSivanesan
Copy link
Contributor

@sunnut Thanks for the contribution
I tried this with the druid data source, it doesn't seem to work as expected
Also, the PR refers always 2 group by metrics, will it work when arithmetic applied to single group by metric?

@sunnut
Copy link
Author

sunnut commented Dec 26, 2018

@ShilpaSivanesan

  1. If the metric just have the time group by, it worked as before.
    2.I add the group by ability for metric besides time to arithmetic.
    Pls try again as the pic following:
    Screenshot

@Foorth
Copy link

Foorth commented Jun 11, 2019

Hi @Gauravshah

Any news here? This pull request is very relevant to me.

@Gauravshah
Copy link
Member

@Foorth the PR had bugs and we did not invest in it. we are open to contribution but are not actively working on this issue

@sunnut
Copy link
Author

sunnut commented Jun 12, 2019

Hi, @Gauravshah I have tried it on my product(db used elasticsearch) and work as expected.
I didnot find the bug you mentioned.
I will test it using other type datasource.

}
});

if (orderSize > resultsTotalList.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is not working as intended when you pick "No limit" as your group by size.

Suggested change
if (orderSize > resultsTotalList.length) {
if (orderSize > resultsTotalList.length || orderSize == 0) {

This should fix it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Other than this it seems to be working as intended to me (I'm using it only on elasticsearch datasource)

Copy link
Author

Choose a reason for hiding this comment

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

Yeah,I have fixed the bug in my project.


this.orderTypes = ['Top', 'Bottom'];

if (!this.target.orderSize) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This code makes it impossible to save an arithmetic metric with orderSize 'no limit' (id == 0).

Copy link
Author

Choose a reason for hiding this comment

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

This bug also fixed by !this.target.orderSize && this.target.orderSize !== 0

@Gauravshah
Copy link
Member

@rasinhas can you raise another PR after fixing it ?

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.

6 participants