create function support

Asked by pramodh

Is CREATE FUNCTION supported by stado

Question information

Language:
English Edit question
Status:
Answered
For:
Stado Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alvin Peng (pengalvin) said :
#1

No. Stado does not support CREATE FUNCTION.
Please see sql referrence http://www.stormdb.com/documentation/stado/sql_reference

However, since the underlying PostgreSQL database supports CREATE FUNCTION, maybe we can use Stado's EXECUTE DIRECT command to create function in datanodes. This could help if the function does not need Stado to do data shipping among datanodes.

Revision history for this message
Mason Sharp (mason-sharp) said :
#2

Yes, you can create a function on the underlying PostgreSQL nodes, then modify the stado.config file to tell Stado its signature so that it can be handled properly. A couple of examples appear in the config file, like below:

xdb.sqlfunction.adddate.template=DATE({arg1})+INTERVAL '{arg2} days'
xdb.sqlfunction.adddate.returntype=DATE
xdb.sqlfunction.adddate.paramcount=2
xdb.sqlfunction.adddate.arg1=ANYDATE
xdb.sqlfunction.adddate.arg2=ANYNUMBER

Can you help with this problem?

Provide an answer of your own, or ask pramodh for more information if necessary.

To post a message you must log in.