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

[CALCITE-6730] Add CONVERT function(enabled in Oracle library) #4108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ILuffZhe
Copy link
Contributor

No description provided.

@@ -740,6 +741,7 @@ void populate1() {
defineMethod(CONCAT_WS_SPARK,
BuiltInMethod.MULTI_TYPE_STRING_ARRAY_CONCAT_WITH_SEPARATOR.method,
NullPolicy.ARG0);
defineMethod(ORACLE_CONVERT, BuiltInMethod.ORACLE_CONVERT.method, NullPolicy.ARG0);
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about changing ORACLE_CONVERT to CONVERT_ORACLE? It looks like the current naming format is functionName + dbType, for example: CONCAT_WS_SPARK, BIT_COUNT_MYSQL.

@@ -1681,6 +1681,29 @@ public static String translateWithCharset(String s, String transcodingName) {
}
}

/** Oracle's {@code CONVERT(charValue, destCharsetName[, srcCharsetName])} function,
* return null if s is null or empty. */
public static String oracleConvert(String s, String... args) {
Copy link
Member

Choose a reason for hiding this comment

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

Similar to the previous suggestion, if oracleConvert could be changed to convertOracle, perhaps this would be consistent with the existing regexpReplacePg.

*
* <p>It has a slight different semantics to standard SQL's
* {@link SqlStdOperatorTable#CONVERT} function on operands' order, and default
* charset will be used if the {@code srcCharsetName} ixs not specified.
Copy link
Member

Choose a reason for hiding this comment

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

Is ixs a typo?

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.

2 participants