Open
Description
Key point:
- writing the function with C signature:
void fn(StringRef*, int, StringRef*, StringRef*, bool*)
- It is able to create function as
create function list_at(string, int, string) returns string options (FILE = 'liblist_at.so')
- But cores tablet during query executing
Correct way to this fn is create function list_at(string, int, string) returns string options (FILE = 'liblist_at.so', RETURN_NULLABLE = true)
, but cores tablet is not acceptable.
127.0.0.1:9622/db> create function list_at(string, int, string) returns string options (FILE = 'liblist_at.so');
W0716 13:14:13.724938 39027 db_sdk.cc:291] fail to get zk value with path /onebox/taskmanager/leader
E0716 13:14:13.724973 39027 db_sdk.cc:66] fail to get TaskManager address
SUCCEED
127.0.0.1:9622/db> select id, list_at(val, 1, ',') as out from t1;
W0716 13:16:16.365479 39027 rpc_client.h:122] request error. [E1014]Got EOF of Socket{id=0 fd=12 addr=127.0.0.1:9520:46740} (0x0x55799394e000) [R1][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R2][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R3][E112]Not connected to 127.0.0.1:9520 yet, server_id=0
W0716 13:16:16.365582 39027 tablet_client.cc:94] send rpc request failed
W0716 13:16:16.365602 39027 sql_cluster_router.cc:1255] Status: [1500] Query rpc failed--[E1014]Got EOF of Socket{id=0 fd=12 addr=127.0.0.1:9520:46740} (0x0x55799394e000) [R1][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R2][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R3][E112]Not connected to 127.0.0.1:9520 yet, server_id=0--ReturnCode[0]--
Error: [1500] Query rpc failed--[E1014]Got EOF of Socket{id=0 fd=12 addr=127.0.0.1:9520:46740} (0x0x55799394e000) [R1][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R2][E112]Not connected to 127.0.0.1:9520 yet, server_id=0 [R3][E112]Not connected to 127.0.0.1:9520 yet, server_id=0--ReturnCode[0]--
127.0.0.1:9622/db> show components;
---------------- ------------ --------------------- --------- ---------
Endpoint Role Connect_time Status Ns_role
---------------- ------------ --------------------- --------- ---------
127.0.0.1:9520 tablet 2023-07-16 21:16:21 offline NULL
127.0.0.1:9521 tablet 2023-07-16 19:21:36 online NULL
127.0.0.1:9522 tablet 2023-07-16 19:21:36 online NULL
127.0.0.1:9622 nameserver 2023-07-16 19:21:37 online master
127.0.0.1:9623 nameserver 2023-07-16 19:21:39 online standby
127.0.0.1:9624 nameserver 2023-07-16 19:21:41 online standby
---------------- ------------ --------------------- --------- ---------
6 rows in set