此内容没有您所选择的语言版本。

10.5. Scalar Functions


The method ExecutionFactory.getSupportedFunctions() can be used to specify which scalar and aggregate functions the Translator supports. The set of possible functions is based on the set of functions supported by JBoss Data Virtualization. This set can be found in the JBoss Data Virtualization Reference Guide. If the Translator states that it supports a function, it must support all type combinations and overloaded forms of that function.
There are also some standard operators that can be specified in the supported function list: +, -, *, and /.
The constants interface SourceSystemFunctions contains the string names of all possible built-in pushdown functions. Note that not all system functions appear in this list. This is because some system functions will always be evaluated in JBoss Data Virtualization, are simple aliases to other functions, or are rewritten to a more standard expression.
A translator may also indicate support for scalar functions that are intended for pushdown evaluation by that translator, but are not registered as user defined functions via a model/schema. These pushdown functions are reported to the engine via the ExecutionFactory.getPushDownFunctions() list as FunctionMethod metadata objects. The FuncitonMethod representation allow the translator to control all of the metadata related to the function, including type signature, determinism, varargs, etc. The simplest way to add a pushdown function is with a call to ExecutionFactory.addPushDownFunction :
FunctionMethod addPushDownFunction(String qualifier, String name, String returnType, String...paramTypes)
Copy to Clipboard Toggle word wrap
This resulting function will be known as sys.qualifier.name, but can be called with name only as long as the function name is unique. The returned FunctionMethod object may be further manipulated depending upon the needs of the source. An example of adding a custom concat vararg function in an ExecutionFactory subclass:
public void start() throws TranslatorException {
  super.start();
  FunctionMethod func = addPushDownFunciton("oracle", "concat", "string", "string", "string");
  func.setVarArgs(true);
  ...
}
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat