Date UDFs
This section provides a list of the Date UDFs for the protect, unprotect, and reprotect operations.
Caution: There are inconsistencies observed when Trino is used to fetch and store date values from HDFS, where data was stored using Hive. It is recommended to verify if the correct date and datetime values are retrieved when the data is fetched from or stored in HDFS without using the Trino UDFs. If the data consistency is maintained, only then proceed to the Trino Date or DateTime UDFs.
ptyProtectDate()
This UDF protects the Date value.
Signature:
ptyProtectDate(date input, varchar dataElement)
Parameters:
| Name | Type | Description |
|---|---|---|
input | Date | Specifies the data to protect. |
dataElement | VarChar | Specifies the name of the data element to protect the data. |
Returns:
This UDF returns the protected Date value.
Example:
select PtyProtectDate(cast('2018-10-10' as date), 'Date_DE');
Supported Protection Methods:
| Function Name | Tokenization | Encryption | FPE | No Encryption | Masking | Monitoring |
|---|---|---|---|---|---|---|
| ptyProtectDate() | Date | No | No | Yes | No | Yes |
ptyUnprotectDate()
This UDF unprotects the protected Date value.
Signature:
ptyUnprotectDate(date input, varchar dataElement)
Parameters:
| Name | Type | Description |
|---|---|---|
input | Date | Specifies the protected data to unprotect. |
dataElement | VarChar | Specifies the name of the data element to unprotect the data. |
Returns:
This UDF returns the unprotected Date value.
Example:
select ptyUnprotectDate(PtyProtectDate(cast('2018-10-10' as date), 'Date_DE'), 'Date_DE');
Supported Protection Methods:
| Function Name | Tokenization | Encryption | FPE | No Encryption | Masking | Monitoring |
|---|---|---|---|---|---|---|
| ptyUnprotectDate() | Date | No | No | Yes | No | Yes |
ptyReprotect() - Date
This UDF reprotects the Date format protected data, which was earlier protected using the ptyProtectDate UDF, with a different data element.
Signature:
ptyReprotect(date input, varchar oldDataElement, varchar newDataElement)
Parameters:
| Name | Type | Description |
|---|---|---|
input | Date | Specifies the Date value to reprotect. |
oldDataElement | VarChar | Specifies the name of the data element that was initially used to protect the data. |
newDataElement | VarChar | Specifies the name of the new data element to reprotect the data. |
Warning: Ensure to use the data element with the No Encryption method only. Using any other data element might cause data corruption.
Returns:
This UDF returns the protected Date value.
Example:
select PtyReprotect(cast('2018-10-10' as date), 'Date_DE', 'new_Date_DE');
Supported Protection Methods:
| Function Name | Tokenization | Encryption | FPE | No Encryption | Masking | Monitoring |
|---|---|---|---|---|---|---|
| ptyReprotect() | Date | No | No | Yes | No | Yes |
Feedback
Was this page helpful?