Double UDFs

Double UDFs in Trino

This section provides a list of Double UDFs for the protect, unprotect, and reprotect operations.

ptyProtectDouble()

This UDF protects the Double value.

Signature:

ptyProtectDouble(double input, varchar dataElement)

Parameters:

NameTypeDescription
inputDoubleSpecifies the data to protect.
dataElementVarCharSpecifies the name of the data element to protect the data.

Note: It is an observed behavior with Trino that the UDF accepting double parameter also accepts decimal and integer parameter due to internal data type conversion.

Returns:
This UDF returns the protected Double value.

Example:

select ptyProtectDouble(12345, 'No_Enc');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyProtectDouble()NoNoNoYesNoYes

ptyUnprotectDouble()

This UDF unprotects the protected Double value. Ensure to use the data element with the No Encryption method only. Using any other data element might cause data corruption.

Signature:

ptyUnprotectDouble(double input, varchar dataElement)

Parameters:

NameTypeDescription
inputDoubleSpecifies the protected data to unprotect.
dataElementVarCharSpecifies the name of the data element to unprotect the data.

Returns:
This UDF returns the original Double value.

Example:

select ptyUnprotectDouble(12345, 'No_Enc');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyUnprotectDouble()NoNoNoYesNoYes

ptyReprotect() - Double

This UDF reprotects the Double format protected data, which was earlier protected using the ptyProtectDouble() UDF, with a different data element. Ensure to use the data element with the No Encryption method only. Using any other data element might cause data corruption.

Signature:

ptyReprotect(double input, varchar oldDataElement, varchar newDataElement)

Parameters:

NameTypeDescription
inputDoubleSpecifies the Double value to reprotect.
oldDataElementVarCharSpecifies the name of the data element that was initially used to protect the data.
newDataElementVarCharSpecifies the name of the new data element to reprotect the data.

Returns:
This UDF returns the protected Double value.

Example:

select ptyReprotect(09457, 'No_Enc', 'new_No_Enc');

Supported Protection Methods:

Function NameTokenizationEncryptionFPENo EncryptionMaskingMonitoring
ptyReprotect() - DoubleNoNoNoYesNoYes

Last modified : December 18, 2025