forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
107 lines
9.6 KiB
HTML
107 lines
9.6 KiB
HTML
<a name="EN-US_TOPIC_0000001811609465"></a><a name="EN-US_TOPIC_0000001811609465"></a>
|
|
|
|
<h1 class="topictitle1">Rules for Using Custom GaussDB(DWS) External Functions (pgSQL/Java)</h1>
|
|
<div id="body0000001229396179"><ul id="EN-US_TOPIC_0000001811609465__ul18305191117205"><li id="EN-US_TOPIC_0000001811609465__li83061611182011">[Notice] Java UDFs can perform some Java logic calculation. Do not encapsulate services in Java UDFs.</li><li id="EN-US_TOPIC_0000001811609465__li4306411192015">[Notice] Do not connect to a database in any way (for example, by using JDBC) in Java functions.</li><li id="EN-US_TOPIC_0000001811609465__li93061811192013">[Notice] Only the data types listed in the following table can be used. User-defined types and complex data types (Java Array and derived classes) are not supported.</li><li id="EN-US_TOPIC_0000001811609465__li93061911182016">[Notice] User-defined aggregation functions (UDAFs) and user-defined table-generating functions (UDTFs) are not supported.</li></ul>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001811609465__table7470152762417" frame="border" border="1" rules="all"><caption><b>Table 1 </b>PL/Java mapping for default data types</caption><thead align="left"><tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row52006273347"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.3.1.1"><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p12221055173619"><span id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_text1858749099">GaussDB(DWS)</span></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.3.1.2"><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p182285553613"><strong id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_b222555123617">Java</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row16200102783419"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1322105512361">BOOLEAN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1922175514367">boolean</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row132001827103418"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1623155517366">"char"</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p22365583612">byte</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row192001627153420"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1124175533612">bytea</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p324165512366">byte[]</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row52011027113413"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1824155533619">SMALLINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1424955103619">short</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row520182783411"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p32475516360">INTEGER</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p72485573617">int</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row2126124903615"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p112415517366">BIGINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p12410551363">long</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row113734619364"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1224175519367">FLOAT4</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1324155513366">float</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row1220119277343"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p4245552369">FLOAT8</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p132415556365">double</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row194001343143617"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p524055113617">CHAR</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p024195516368">java.lang.String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row989924003617"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1724155512367">VARCHAR</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p192418558360">java.lang.String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row120172753416"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p92475512360">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p132411553366">java.lang.String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row1154313281354"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p42455515364">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p92645513367">java.lang.String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row627313814365"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p426125515368">DATE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p626175533613">java.sql.Timestamp</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row9126123918355"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p142695523610">TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p2261855153620">java.sql.Time (stored value treated as local time)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row47181243113513"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p1826055193619">TIMETZ</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p726165553613">java.sql.Time</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row16150193563516"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p52755593616">TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p02745533610">java.sql.Timestamp</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_row1445023473613"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.1 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p9278556361">TIMESTAMPTZ</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.3.1.2 "><p id="EN-US_TOPIC_0000001811609465__en-us_topic_0000001811609533_p927135543614">java.sql.Timestamp</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0107.html">Detailed Design Rules for GaussDB(DWS) Objects</a></div>
|
|
</div>
|
|
</div>
|
|
|