You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "zoudan (via GitHub)" <gi...@apache.org> on 2023/06/07 02:18:57 UTC

[GitHub] [calcite] zoudan commented on a diff in pull request #3221: [CALCITE-5709] Add TO_BASE32 and FROM_BASE32 functions (enabled in BigQuery library)

zoudan commented on code in PR #3221:
URL: https://github.com/apache/calcite/pull/3221#discussion_r1220711542


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -924,6 +924,21 @@ private static RelDataType arrayReturnType(SqlOperatorBinding opBinding) {
           OperandTypes.STRING.or(OperandTypes.BINARY),
           SqlFunctionCategory.STRING);
 
+  @LibraryOperator(libraries = {BIG_QUERY})
+  public static final SqlFunction FROM_BASE32 =
+      SqlBasicFunction.create("FROM_BASE32",
+          ReturnTypes.explicit(SqlTypeName.VARBINARY)
+              .andThen(SqlTypeTransforms.TO_NULLABLE),
+          OperandTypes.STRING, SqlFunctionCategory.STRING);
+
+  @LibraryOperator(libraries = {BIG_QUERY})
+  public static final SqlFunction TO_BASE32 =
+      SqlBasicFunction.create("TO_BASE32",
+          ReturnTypes.explicit(SqlTypeName.VARCHAR)

Review Comment:
   Good idea, and I have added in [CALCITE-5728](https://github.com/apache/calcite/pull/3237/files), maybe I could rebase and modify it after [CALCITE-5728](https://github.com/apache/calcite/pull/3237/files) is merged



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org