OushuDB同PostgreSQL兼容,提供四類函數(shù)。每一類函數(shù)都可以帶基礎(chǔ)數(shù)據(jù)類型以及復(fù)合數(shù)據(jù)類型為參數(shù),并且可以返回一個(gè)基礎(chǔ)數(shù)據(jù)類型或者復(fù)合數(shù)據(jù)類型的值。函數(shù)也可以定義為返回基礎(chǔ)數(shù)據(jù)類型或者復(fù)合數(shù)據(jù)類型值的集合。詳細(xì)用法可參見PostgreSQL具體章節(jié)。
查詢語言(SQL)函數(shù): https://www.postgresql.org/docs/8.2/xfunc-sql.html
過程語言函數(shù): https://www.postgresql.org/docs/8.2/static/plpgsql.html , https://www.postgresql.org/docs/8.2/static/plpython.html , https://www.postgresql.org/docs/8.2/static/plperl.html 等
內(nèi)部函數(shù):參考 https://www.postgresql.org/docs/8.2/static/xfunc-internal.html
C語言函數(shù):參考 https://www.postgresql.org/docs/8.2/static/xfunc-c.html
注意事項(xiàng): OushuDB為了解決可移植性問題,內(nèi)置了Python2.7。如果需要使用宿主系統(tǒng)上已有的Python2.7和相關(guān)的依賴包,可以運(yùn)行以下命令刪除。
hawq ssh -f hostfile -e << EOFtest -f /usr/local/hawq/bin/python && mv /usr/local/hawq/bin/python* /usr/local/hawq/sharetest -d /usr/local/hawq/lib/python2.7 && mv /usr/local/hawq/lib/python2.7 /usr/local/hawq/sharetest -f /usr/local/hawq/lib/libpython2.7.so && mv /usr/local/hawq/lib/libpython* /usr/local/hawq/shareEOF