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

Feature Request: support derivation as LHS for filter, post-filter, aggregation #627

Open
1 of 6 tasks
Tracked by #256
akphi opened this issue Oct 29, 2021 · 1 comment
Open
1 of 6 tasks
Tracked by #256
Labels
Component: Query Builder Issues related to query builder core Difficulty: Challenging Studio Core Team Opened by a member of the Studio core team Type: Discussion Type: Feature Request
Milestone

Comments

@akphi
Copy link
Contributor

akphi commented Oct 29, 2021

Similar requests

  • I have searched and found no existing similar requests

Context and Motivation

We want to support use cases like the following:

|model::Person.all()->filter(
  p|$p.firstName + $p.lastName == 'John Doe'
)->project(
  [
    x|$x.firstName,
    x|$x.lastName
  ],
  [
    'First Name',
    'Last Name'
  ]
)

Currently, this type of query triggers the unsupported view on the user which is very user-friendly.

What problems are you trying to solve?

This is similar to #254, but this time we want to do it for filter, post-filter, and aggregation

Describe the solution you would like to see implemented

This differs from #254 a bit since a filter is not a list like projections, but a tree structure. As such, some special handling must be in place. For example:

  • ? Add a new method to QueryBuilderFilterOperator
  • Create another visitor that extends V1_ValueSpecificationBuilder visitor that handles the building within the filter function in a special way, because unlike projection, filter is a tree structure.
  • When we introduce derivation for filter, we would need to support something similar to add functions explorer panel in query builder #888
  • We need to take care of the case in Feature request: Post Filter in Query Editor #839 where after DnD to create the column, the user change the projection derivation changing the return type, do we need to reevaluate to check if post-filter condition still valid or not

Describe alternatives you have considered

N/A

Documentation, Design, Adoption, Migration Strategy

No response

Contribution

  • I would like to work on this feature
@github-actions github-actions bot added the Studio Core Team Opened by a member of the Studio core team label Oct 29, 2021
@akphi akphi added Component: Query Builder Issues related to query builder core Type: Feature Request labels Oct 29, 2021
@akphi akphi changed the title Support derivation as LHS for filter: Feature Request: support derivation as LHS for filter Oct 29, 2021
@akphi akphi added this to the 2.0.0 milestone Oct 29, 2021
@akphi akphi modified the milestones: 2.0.0, 3.0.0 Nov 22, 2021
@YannanGao-gs YannanGao-gs self-assigned this Jan 5, 2022
@njerigrevious njerigrevious modified the milestones: 3.0.0, 4.0.0 Jan 25, 2022
@akphi akphi changed the title Feature Request: support derivation as LHS for filter Feature Request: support derivation as LHS for filter, post-filter, aggregation Feb 17, 2022
@akphi
Copy link
Contributor Author

akphi commented Feb 17, 2022

@YannanGao-gs After discussing with @MauricioUyaguari we decide to rescope this to include handling logic for post-filter and aggregation as well. This will require more in-depth discussion. So for now I'll unassign you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Builder Issues related to query builder core Difficulty: Challenging Studio Core Team Opened by a member of the Studio core team Type: Discussion Type: Feature Request
Projects
None yet
Development

No branches or pull requests

5 participants