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

Add Settings.transformPatterns for combining ARRAY lambda functions #16507

Open
4 tasks
lukaseder opened this issue Mar 25, 2024 · 0 comments
Open
4 tasks

Add Settings.transformPatterns for combining ARRAY lambda functions #16507

lukaseder opened this issue Mar 25, 2024 · 0 comments

Comments

@lukaseder
Copy link
Member

jOOQ 3.20 introduces ARRAY lambda functions, like ARRAY_FILTER(arr, e -> predicate):

It will be interesting to study how we can transform nested ARRAY lambda functions in order to simplify them, e.g.

  • ARRAY_FILTER
  • ARRAY_MAP
  • ARRAY_SORT (to be investigated)
  • Combinations of the above (to be investigated)

Examples

ARRAY_FILTER

-- Before
ARRAY_FILTER(
  ARRAY_FILTER(a, e -> p1(e)),
  e -> p2(e)
);

-- After
ARRAY_FILTER(a, e -> p1(e) AND p2(e))

ARRAY_MAP

-- Before
ARRAY_MAP(
  ARRAY_MAP(a, e -> m1(e)),
  e -> m2(e)
);

-- After
ARRAY_MAP(a, e -> m2(m1(e)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant