FrankChen021 commented on code in PR #20544:
URL: https://github.com/apache/druid/pull/20544#discussion_r4290000873
##########
web-console/src/utils/table-filters/table-filter.ts:
##########
@@ -64,14 +96,18 @@ export class TableFilter {
return new TableFilter(filter.id, mode, value);
}
+ /**
+ * @param value the values to filter on, or a needle (as typed in a filter
input) of values separated by `|` (see
+ * `splitNeedle`). To filter on one literal value, that may contain a `|`,
pass it as `[value]`.
+ */
constructor(key: string, mode: FilterMode, value: string | string[]) {
this.key = key;
this.mode = mode;
- this.values = typeof value === 'string' ? value.split('|') : value;
+ this.values = typeof value === 'string' ? TableFilter.splitNeedle(value) :
value;
}
public get value(): string {
- return this.values.join('|');
+ return TableFilter.joinNeedle(this.values);
Review Comment:
[P2] Keep literal datasource names raw for timeline consumers
**Finding:** The new getter serializes literal values for the table-filter
grammar (`a|b` becomes `a\|b`). However, the existing Datasources and Segments
views still pass `filter.value` directly to SegmentTimeline as a datasource
name. With the new literal representation, a datasource containing `|` or `\`
is sent to the timeline with its escape characters, so the SQL/API timeline
query cannot find the real datasource.
**Suggestion:** Use the raw single value (`filter.values[0]`) at those
timeline call sites, or expose separate raw-value and serialized-needle
accessors so consumers do not treat the escaped grammar value as a datasource
identifier.
--
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]