druid icon indicating copy to clipboard operation
druid copied to clipboard

string_to_array ordering

Open fstolba opened this issue 4 years ago • 4 comments

Affected Version

0.17

Description

When using the function string_to_array on ingest the ordering of the resulting arrays seems random. I would expect the array elements to keep the order they had in the constituting string. Is this to be expected / by design?

Example:

Function Call                                         Result
string_to_array("A_B_C", "_")                         ["C", "B", "A"]
string_to_array("D_E_F", "_")                         ["E", "D", "F"]
string_to_array("A_B", "_")                           ["A", "B"]
string_to_array("A_B_B_C", "_")                       ["A", "C", "B", "B"]

Desired result:

Function Call                                         Result
string_to_array("A_B_C", "_")                         ["A", "B", "C"]
string_to_array("D_E_F", "_")                         ["D", "E", "F"]
string_to_array("A_B", "_")                           ["A", "B"]
string_to_array("A_B_B_C", "_")                       ["A", "B", "B", "C"]

fstolba avatar Feb 10 '20 23:02 fstolba

This issue has been marked as stale due to 280 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

stale[bot] avatar Dec 25 '20 20:12 stale[bot]

using 0.21.1 (unified console shows 0.20.0), when I add a transformation using the web console, I get "null" as a result...

Screenshot 2021-11-17 at 15-46-40 Apache Druid

if use a column as the first argument I get weird output.

(can't upload image anymore (damned GH))

But somethig like : string_to_array(log, "_") return a column with something like : [ , , , , , , , ...1077 omitted..., x, x, z]

setop avatar Nov 17 '21 14:11 setop

This issue is no longer marked as stale.

stale[bot] avatar Nov 17 '21 14:11 stale[bot]

@setop try the delimiter with single quotes. like string_to_array(log, '_')

kkarnam2713 avatar Sep 12 '22 16:09 kkarnam2713

This issue has been marked as stale due to 280 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Aug 04 '23 00:08 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Sep 02 '23 00:09 github-actions[bot]