Vertica-Extension-Packages icon indicating copy to clipboard operation
Vertica-Extension-Packages copied to clipboard

compatlib_function - ConnectBy supports only an integer input. It does not work when the parent-child relationship is established as a STRING / VARCHAR.

Open bharathwaj1993 opened this issue 2 years ago • 1 comments

compatlib_function - ConnectBy supports only an integer input. It does not work when the parent-child relationship is established as a STRING / VARCHAR.

bharathwaj1993 avatar Mar 18 '22 12:03 bharathwaj1993

Confirmed connect_by_path accepts only INTEGER values for parent ID and child ID. If it was run with the following data, the error happened.

=> CREATE TABLE company (id VARCHAR, supervisor_id VARCHAR, name VARCHAR(20));
=> INSERT INTO company VALUES ('1', null, 'Patrick');
=> INSERT INTO company VALUES ('2', '1', 'Jim');
=> INSERT INTO company VALUES ('3', '1', 'Sandy');
=> INSERT INTO company VALUES ('4', '3', 'Brian');
=> INSERT INTO company VALUES ('5', '3', 'Otto');
=> COMMIT;

=> SELECT connect_by_path(supervisor_id, id, name, ' >> ') OVER () FROM company;
vsql:connect_by_path.sql:21: ERROR 3457:  Function connect_by_path(varchar, varchar, varchar, unknown) does not exist, or permission is denied for connect_by_path(varchar, varchar, varchar, unknown)
HINT:  No function matches the given name and argument types. You may need to add explicit type casts

I will work on this issue.

h-serizawa avatar Mar 23 '22 05:03 h-serizawa