Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat : Enable user-defined-java-function(UDF) #87

Merged
merged 23 commits into from
Oct 9, 2022
Merged

Feat : Enable user-defined-java-function(UDF) #87

merged 23 commits into from
Oct 9, 2022

Conversation

joeCarf
Copy link
Contributor

@joeCarf joeCarf commented Sep 14, 2022

Problems solved in this PR

Supporting CREATE FUNCTION and DROP FUNCTION syntax based on ScalaFunction, allowing users to define their own java functions and use them.

Changes proposed in this PR

UDF设计文档: https://drive.google.com/file/d/1IgL1BMlF_8leEvLbaBNOgQ9hUoQQxkxs/view?usp=sharing
UDF使用手册: https://drive.google.com/file/d/1UmTcmpIWvAb-AZFxWTQs877Nz6VA3AgA/view?usp=sharing

Tests

  • Unit test
  • DML_DDL test

Release note

None

Issue link

#62

Copy link
Collaborator

@hustfxj hustfxj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自定义UDF,尽可能减少用户使用成本。用户写UDF,import和使用的数据结构尽量是java 原生的,不需要额外import polardb-x 内部类(如果有有需要你编译优化的时候默默给他加上imprt)。输入行参和返回类型,尽量不需要显示定义。可以先把你的类编译成class,然后根据函数的输入和输出的对象,通过反射推导出java的原生类型是啥。

Copy link
Collaborator

@hustfxj hustfxj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问个问题:
CN 注册成功UDF后,可以正常使用。如果这个时候CN挂了,重启,那么这部分UDF应该会在CN重启的时候再次被注册到当前内存去,但这部分逻辑没有看到。意味着CN重启的时候,虽然metadb 有,但没有被动态加载?

Copy link
Collaborator

@hustfxj hustfxj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUPPORT_MAX_REGISTER_UDF_NUM
防止用户注册非常多的UDF。

@joeCarf
Copy link
Contributor Author

joeCarf commented Sep 29, 2022

SUPPORT_MAX_REGISTER_UDF_NUM 防止用户注册非常多的UDF。

@joeCarf joeCarf closed this Sep 29, 2022
@joeCarf joeCarf reopened this Sep 29, 2022
@Oldbread3 Oldbread3 merged commit 9ba80b7 into polardb:main Oct 9, 2022
@joeCarf joeCarf mentioned this pull request Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants