Running shell_package gives errors
I am using Vertica 7.1, community edition 3 nodes cluster.
I've installed library from https://github.com/vertica/Vertica-Extension-Packages/tree/master/shell_package
From this library the function int_sequence works just fine, but shell_execute gives an error.
This is a function:
dbadmin=> \df shell_execute
List of functions
procedure_name | procedure_return_type | procedure_argument_types
----------------+-----------------------+--------------------------
shell_execute | Integer, Varchar | Varchar
As per documentation, this example should work but gives error:
dbadmin=> select shell_execute(local_node_name(),'date') over ();
ERROR 3457: Function shell_execute(varchar, unknown) does not exist, or permission is denied for shell_execute(varchar, unknown)
HINT: No function matches the given name and argument types. You may need to add explicit type casts
Also, from above I see it should accept 1 parameter? So if I re-run, anyway it gives error:
dbadmin=> select shell_execute('date') over ();
ERROR 3399: Failure in UDx RPC call InvokeProcessPartition(): Error calling processPartition() in User Defined Object [shell_execute] at [/opt/vertica/sdk/include/VerticaUDx.h:4048], error code: 0, message: User code caused Vertica to throw exception "Function attempted to access parameter cmd when it was not provided"
Could you please provide some insites what is wrong and how to make it run?
Thank you,
Oleg
I've installed library from https://github.com/vertica/Vertica-Extension-Packages/tree/master/shell_package
From this library the function int_sequence works just fine, but shell_execute gives an error.
This is a function:
dbadmin=> \df shell_execute
List of functions
procedure_name | procedure_return_type | procedure_argument_types
----------------+-----------------------+--------------------------
shell_execute | Integer, Varchar | Varchar
As per documentation, this example should work but gives error:
dbadmin=> select shell_execute(local_node_name(),'date') over ();
ERROR 3457: Function shell_execute(varchar, unknown) does not exist, or permission is denied for shell_execute(varchar, unknown)
HINT: No function matches the given name and argument types. You may need to add explicit type casts
Also, from above I see it should accept 1 parameter? So if I re-run, anyway it gives error:
dbadmin=> select shell_execute('date') over ();
ERROR 3399: Failure in UDx RPC call InvokeProcessPartition(): Error calling processPartition() in User Defined Object [shell_execute] at [/opt/vertica/sdk/include/VerticaUDx.h:4048], error code: 0, message: User code caused Vertica to throw exception "Function attempted to access parameter cmd when it was not provided"
Could you please provide some insites what is wrong and how to make it run?
Thank you,
Oleg
0
Comments
Function shell_execute(varchar, unknown) does not exist, or permission is denied for shell_execute(varchar, unknown
Resolution
-----------------------
* Make sure there are no extraneous spaces before the command #!/bin/bash.
* If you are using programs within the external procedure, such as vsql, make sure the program is fully pathed in the script—even if it's already in the search path; for example /opt/vertica/bin/vsql
--------