You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to call this function with "-" delimeter, but it looks like comma is still used as part of the separators somehow. I didn't make any change to the udf sample code.
To complement this issue, I used the sample on Kudu with two nodes. Is it because of the merge issue? The merge calls "StringConcatUpdate(context, src, ",", dst);" that comma is hard-coded and used.
@d22shen yes it looks like the bug is in StringConcatMerge() like you mentioned. I think to fix it the UDA would need to be modified to store the separator in the intermediate value.
I tried to call this function with "-" delimeter, but it looks like comma is still used as part of the separators somehow. I didn't make any change to the udf sample code.
create aggregate function string_concat(string, string) returns string
location '/user/history/libudasample.so'
init_fn='StringConcatInit'
update_fn='StringConcatUpdate'
merge_fn='StringConcatMerge'
finalize_fn='StringConcatFinalize';
My data is as follows:
+----+----------+-----+-----------+--------+
| id | name | age | address | salary |
+----+----------+-----+-----------+--------+
| 7 | Hardik | 22 | MP | 32000 |
| 8 | Komal | 22 | Bhopal | 32000 |
| 9 | Khilan | 25 | Kota | 15000 |
| 12 | Khilan4 | 25 | Kota | 15000 |
| 14 | Khilan6 | 25 | Kota | 15000 |
| 11 | Khilan3 | 25 | Kota | 15000 |
| 15 | Khilan7 | 25 | Kota | 15000 |
| 2 | Khilan | 25 | Delhi | 15000 |
| 13 | Khilan5 | 25 | Kota | 15000 |
| 4 | Chaitali | 25 | Mumbai | 35000 |
| 1 | Ramesh | 32 | Ahmedabad | 20000 |
| 6 | Komal | 22 | MP | 32000 |
| 3 | kaushik | 23 | Kota | 30000 |
| 10 | Khilan2 | 25 | Kota | 15000 |
| 5 | Hardik | 27 | Bhopal | 40000 |
+----+----------+-----+-----------+--------+
select string_concat(name, "-") from employee_kudu group by address;
+----------------------------------------------------------------+
| db_kudu.string_concat(name, '-') |
+----------------------------------------------------------------+
| Chaitali |
| Khilan |
| Khilan5,Khilan,kaushik-Khilan2,Khilan4-Khilan6-Khilan3-Khilan7 |
| Hardik,Komal |
| Ramesh |
| Komal,Hardik |
+----------------------------------------------------------------+
The text was updated successfully, but these errors were encountered: