confluentinc/ksql

Add an array_positions function.

Open

#9.158 geöffnet am 1. Juni 2022

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Java (1.048 Forks)batch import
enhancementfix-it-weekgood first issuestreaming-engineuser-defined-functions

Repository-Metriken

Stars
 (5.739 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 4T 20h) (6 gemergte PRs in 30 T)

Beschreibung

Is your feature request related to a problem? Please describe. The existing FIELD function works on a varags array of input strings. It does not work on an array of strings.

E.g.

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|KSQL_COL_0                                                                                                                                                                 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|0                                                                                                                                                                          |

Describe the solution you'd like In the above example, it'd be nice to return 1 or better an array of the positions where the element is present in the array.

See array_positions from https://www.postgresql.org/docs/current/functions-array.html.

Additional context See a short Slack discussion here: https://confluentcommunity.slack.com/archives/C6UJNMY67/p1654021013224899

Contributor Guide