关注 spark技术分享,
撸spark源码 玩spark最佳实践

FunctionRegistry — Contract for Function Registries (Catalogs)

FunctionRegistry — Contract for Function Registries (Catalogs)

FunctionRegistry is the contract of function registries (catalogs) of native and user-defined functions.

Table 1. FunctionRegistry Contract
Property Description

clear

Used exclusively when SessionCatalog is requested to reset

dropFunction

Used when…​FIXME

listFunction

Used when…​FIXME

lookupFunction

Used when:

lookupFunctionBuilder

Used when…​FIXME

registerFunction

Used when:

Note
The one and only FunctionRegistry available in Spark SQL is SimpleFunctionRegistry.

FunctionRegistry is available through functionRegistry property of a SessionState (that is available as sessionState property of a SparkSession).

Note
You can register a new user-defined function using UDFRegistration.
Table 2. FunctionRegistry’s Attributes
Name Description

builtin

SimpleFunctionRegistry with the built-in functions registered.

FunctionRegistry manages function expression registry of Catalyst expressions and the corresponding built-in/native SQL functions (that can be used in SQL statements).

Table 3. (Subset of) FunctionRegistry’s Catalyst Expression to SQL Function Mapping
Catalyst Expression SQL Function

CumeDist

cume_dist

IfNull

ifnull

Left

left

MonotonicallyIncreasingID

monotonically_increasing_id

NullIf

nullif

Nvl

nvl

Nvl2

nvl2

ParseToDate

to_date

ParseToTimestamp

to_timestamp

Right

right

CreateNamedStruct

struct

expression Internal Method

expression…​FIXME

Note
expression is used when…​FIXME

SimpleFunctionRegistry

SimpleFunctionRegistry is the default FunctionRegistry that is backed by a hash map (with optional case sensitivity).

createOrReplaceTempFunction Final Method

createOrReplaceTempFunction…​FIXME

Note
createOrReplaceTempFunction is used exclusively when UDFRegistration is requested to register an user-defined function, user-defined aggregate function, user-defined function (as UserDefinedFunction) or registerPython.

functionExists Method

functionExists…​FIXME

Note
functionExists is used when…​FIXME
赞(0) 打赏
未经允许不得转载:spark技术分享 » FunctionRegistry — Contract for Function Registries (Catalogs)
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏