-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
base: main
Are you sure you want to change the base?
Conversation
55039ce
to
b85217b
Compare
Quality Gate passedIssues Measures |
@@ -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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is ixs a typo?
No description provided.