Skip to content

Conversation

@luigidellaquila
Copy link
Contributor

@luigidellaquila luigidellaquila commented Oct 3, 2025

Adding support for parameters and for dots in attribute names used by FUSE command, eg.

FROM ...
 | FUSE GROUP BY foo.bar
FROM ...
 | FUSE GROUP BY ??paramName

The problem was just missing trokens in the lexer definition for FUSE

@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.3.0 labels Oct 3, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @luigidellaquila, I've created a changelog YAML for you.

Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

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

I just have a tiny nitty suggestion on the changelog summary :)

@luigidellaquila luigidellaquila changed the title ES|QL: support dot for attribute names in FUSE GROUP BY ES|QL: support dot and parameters in FUSE GROUP BY Oct 3, 2025
@luigidellaquila luigidellaquila enabled auto-merge (squash) October 3, 2025 11:40
@luigidellaquila luigidellaquila merged commit 7b3aa2a into elastic:main Oct 3, 2025
34 checks passed
sddonne added a commit to elastic/kibana that referenced this pull request Oct 6, 2025
Part of #236938
## Summary
This PR adds `AST` support for the new`FUSE` parameters.

```
fuseCommand
    : DEV_FUSE (fuseType=identifier)? (fuseConfiguration)*
    ;

fuseConfiguration
    : SCORE BY score=qualifiedName
    | KEY BY key=fields
    | GROUP BY group=qualifiedName
    | WITH options=mapExpression
    ;
```

`FUSE <fuse_method> SCORE BY <score_column> GROUP BY <group_column> KEY
BY <key_columns> WITH <options>`

### Some Examples
`| FUSE LINEAR # Merge results using linear combination of scores (equal
weights by default)`

`| FUSE LINEAR WITH { "normalizer": "minmax" } # Linear combination with
min-max normalization (scales scores to 0-1 range)
 `

`| FUSE LINEAR WITH { "weights": { "fork1": 0.7, "fork2": 0.3 },
"normalizer": "minmax" } # Weighted linear combination: 70% lexical, 30%
semantic, with min-max normalization`

### Note
No tests has been added to check parameters or fields with dots, as the
parser needs this
[fix](elastic/elasticsearch#135901) to be merged
to support them.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
Part of elastic#236938
## Summary
This PR adds `AST` support for the new`FUSE` parameters.

```
fuseCommand
    : DEV_FUSE (fuseType=identifier)? (fuseConfiguration)*
    ;

fuseConfiguration
    : SCORE BY score=qualifiedName
    | KEY BY key=fields
    | GROUP BY group=qualifiedName
    | WITH options=mapExpression
    ;
```

`FUSE <fuse_method> SCORE BY <score_column> GROUP BY <group_column> KEY
BY <key_columns> WITH <options>`

### Some Examples
`| FUSE LINEAR # Merge results using linear combination of scores (equal
weights by default)`

`| FUSE LINEAR WITH { "normalizer": "minmax" } # Linear combination with
min-max normalization (scales scores to 0-1 range)
 `

`| FUSE LINEAR WITH { "weights": { "fork1": 0.7, "fork2": 0.3 },
"normalizer": "minmax" } # Weighted linear combination: 70% lexical, 30%
semantic, with min-max normalization`

### Note
No tests has been added to check parameters or fields with dots, as the
parser needs this
[fix](elastic/elasticsearch#135901) to be merged
to support them.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants