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

UDF: Support Function OIDs and Function reference with OIDs in expressions #83231

Closed
chengxiong-ruan opened this issue Jun 22, 2022 · 1 comment · Fixed by #96442
Closed

UDF: Support Function OIDs and Function reference with OIDs in expressions #83231

chengxiong-ruan opened this issue Jun 22, 2022 · 1 comment · Fixed by #96442
Assignees
Labels
A-sql-routine UDFs and Stored Procedures C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@chengxiong-ruan
Copy link
Contributor

chengxiong-ruan commented Jun 22, 2022

Describe the solution you'd like

  1. Give builtin function fixed OIDs
  2. UDF should have OIDs no conflicting with builtin functions
  3. Syntax to support function reference with OIDs within expressions

Jira issue: CRDB-16936

Epic CRDB-19497

@chengxiong-ruan chengxiong-ruan added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-schema-deprecated Use T-sql-foundations instead labels Jun 22, 2022
@chengxiong-ruan chengxiong-ruan self-assigned this Jun 22, 2022
@postamar postamar added the A-sql-routine UDFs and Stored Procedures label Jul 12, 2022
@chengxiong-ruan
Copy link
Contributor Author

(1) and (2) done. Will do (3) in 23.1

chengxiong-ruan added a commit to chengxiong-ruan/cockroach that referenced this issue Feb 2, 2023
This commit implements `@F` OID references syntax of functions.
With this change, functions can be called with oid numerical
representation. For example `SELECT @f('helloworld')`.
The intention of this syntax is only for internal serialization
of references to UDFs. But it's general enough for builtin
funtions as well.

Fixes: cockroachdb#83231

Release note: None
chengxiong-ruan added a commit to chengxiong-ruan/cockroach that referenced this issue Feb 2, 2023
This commit implements `[FUNCTION xxxx]` OID references syntax
of functions. With this change, functions can be called with
the new OID numerical representation. For example
`SELECT [FUNCTION 123]('helloworld')`. The intention of this
syntax is only for internal serialization of references to UDFs.
But it's general enough for builtin functions as well.

A new implementation of the `ResolvableFunctionReference`
interface, `OIDFunctionReference` is introduced for function
resolution purpose for the new syntax.

The `ResolveFunctionByOID` method is also refactored to return
a qualified name.

Fixes: cockroachdb#83231

Release note: None
chengxiong-ruan added a commit to chengxiong-ruan/cockroach that referenced this issue Feb 6, 2023
This commit implements `[FUNCTION xxxx]` OID references syntax
of functions. With this change, functions can be called with
the new OID numerical representation. For example
`SELECT [FUNCTION 123]('helloworld')`. The intention of this
syntax is only for internal serialization of references to UDFs.
But it's general enough for builtin functions as well.

A new implementation of the `ResolvableFunctionReference`
interface, `OIDFunctionReference` is introduced for function
resolution purpose for the new syntax.

The `ResolveFunctionByOID` method is also refactored to return
a qualified name.

Fixes: cockroachdb#83231

Release note: None
chengxiong-ruan added a commit to chengxiong-ruan/cockroach that referenced this issue Feb 6, 2023
This commit implements `[FUNCTION xxxx]` OID references syntax
of functions. With this change, functions can be called with
the new OID numerical representation. For example
`SELECT [FUNCTION 123]('helloworld')`. The intention of this
syntax is only for internal serialization of references to UDFs.
But it's general enough for builtin functions as well.

A new implementation of the `ResolvableFunctionReference`
interface, `OIDFunctionReference` is introduced for function
resolution purpose for the new syntax.

The `ResolveFunctionByOID` method is also refactored to return
a qualified name.

Fixes: cockroachdb#83231

Release note: None
chengxiong-ruan added a commit to chengxiong-ruan/cockroach that referenced this issue Feb 7, 2023
This commit implements `[FUNCTION xxxx]` OID references syntax
of functions. With this change, functions can be called with
the new OID numerical representation. For example
`SELECT [FUNCTION 123]('helloworld')`. The intention of this
syntax is only for internal serialization of references to UDFs.
But it's general enough for builtin functions as well.

A new implementation of the `ResolvableFunctionReference`
interface, `OIDFunctionReference` is introduced for function
resolution purpose for the new syntax.

The `ResolveFunctionByOID` method is also refactored to return
a qualified name.

Fixes: cockroachdb#83231

Release note: None
chengxiong-ruan added a commit to chengxiong-ruan/cockroach that referenced this issue Feb 13, 2023
This commit implements `[FUNCTION xxxx]` OID references syntax
of functions. With this change, functions can be called with
the new OID numerical representation. For example
`SELECT [FUNCTION 123]('helloworld')`. The intention of this
syntax is only for internal serialization of references to UDFs.
But it's general enough for builtin functions as well.

A new implementation of the `ResolvableFunctionReference`
interface, `OIDFunctionReference` is introduced for function
resolution purpose for the new syntax.

The `ResolveFunctionByOID` method is also refactored to return
a qualified name.

Fixes: cockroachdb#83231

Release note: None
chengxiong-ruan added a commit to chengxiong-ruan/cockroach that referenced this issue Feb 14, 2023
This commit implements `[FUNCTION xxxx]` OID references syntax
of functions. With this change, functions can be called with
the new OID numerical representation. For example
`SELECT [FUNCTION 123]('helloworld')`. The intention of this
syntax is only for internal serialization of references to UDFs.
But it's general enough for builtin functions as well.

A new implementation of the `ResolvableFunctionReference`
interface, `OIDFunctionReference` is introduced for function
resolution purpose for the new syntax.

The `ResolveFunctionByOID` method is also refactored to return
a qualified name.

Fixes: cockroachdb#83231

Release note: None
craig bot pushed a commit that referenced this issue Feb 15, 2023
96442: sql: implement function OID reference r=chengxiong-ruan a=chengxiong-ruan

This commit implements `[FUNCTION xxxx]` OID references syntax of functions. With this change, functions can be called with the new OID numerical representation. For example `SELECT [FUNCTION 123]('helloworld')`. The intention of this syntax is only for internal serialization of references to UDFs. But it's general enough for builtin functions as well.

A new implementation of the `ResolvableFunctionReference` interface, `OIDFunctionReference` is introduced for function resolution purpose for the new syntax
The `ResolveFunctionByOID` method is also refactored to return a qualified name.

Fixes: #83231

Release note: None

Co-authored-by: Chengxiong Ruan <chengxiongruan@gmail.com>
@craig craig bot closed this as completed in 1c7a82b Feb 15, 2023
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-routine UDFs and Stored Procedures C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
2 participants