Advanced
Тема интерфейса

UDF Overview

In CloudTable, if built-in functions do not meet service requirements, you can customize functions to extend SQL statements to fulfill personalized needs. These functions are called User-Defined Functions (UDFs). You can upload and manage UDF JAR files on the console and invoke related UDF functions during service operations.

Application Scenarios

  • Data Processing: UDFs can process data, such as strings, dates, and numeric calculations.
  • Data Conversion: UDFs can convert data from one form to another, such as from a string to a date or from a number to a string.
  • Data Analysis: UDFs can be used to analyze data, such as calculating the average value, standard deviation, maximum value, and minimum value.

Precautions

  • Avoid excessive data replication operations to prevent stack memory overflow.
  • Avoid a large number of recursive calls to prevent stack or memory overflow.
  • Avoid continuously creating objects or arrays to prevent memory exhaustion.
  • Avoid concatenating a large number of strings to prevent high memory usage.
  • Java UDFs should have meaningful names for easy understanding by other developers. Use camel-case naming and end with "UDF," for example, AddOne_UDF.
  • Java UDFs should specify the return data type and must have a return value. Do not set the return value to NULL when it should be the default value or during exceptions. Use basic data types or Java classes for return value types.
  • The maximum stack memory for UDFs is set to 1 GB by default. If you need to adjust this allocation, please contact technical support.