YongGang commented on PR #16510:
URL: https://github.com/apache/druid/pull/16510#issuecomment-2142853587
> If we want `Selector` to be general purpose, we need to clean it up a bit.
When implementing a selector, you need to have 3 things: the list of
selections, the evaluation criteria and the selection key. For this case, we
could simplify it to just the list of selections and the selection key. The
evaluation criteria can be defaulted to a simple "AND all of the keys except
the select key". An example of how it should look
>
> ```
> "behaviorStrategy": {
> "type": "default",
> "selectKey": "category",
> "categorySelectors": [
> {
> "category": "low-throughput",
> "context.tags": {
> "billingCategory": [
> "streaming_ingestion"
> ]
> },
> "task": {
> "datasource": [
> "wikipedia"
> ]
> }
> },
> {
> "category": "medium-throughput",
> "task": {
> "type": [
> "index_kafka"
> ]
> }
> }
> ]
> }
> ```
>
> So now the evaluator would look at all of the keys EXCEPT `category` and
one a match, it will return the category.
>
> What do you think?
I think if fully implement this proposal, it needs to be on reflection
based, otherwise still need to preknown what fields to look at. Given the
concerns we have on reflection (e.g. perf overhead, not safe etc) and we don't
expect some very different fields to look at in the near future so I think the
current solution is good enough.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]