-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new function decode_base64_utf8 and expr macro (#14943)
* Adding new function decode_base64_utf8 and expr macro * using BaseScalarUnivariateMacroFunctionExpr * Print stack trace in case of debug in ChainedExecutionQueryRunner * fix static check
- Loading branch information
1 parent
22abc10
commit 883c269
Showing
7 changed files
with
168 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...va/org/apache/druid/sql/calcite/expression/builtin/DecodeBase64UTFOperatorConversion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.druid.sql.calcite.expression.builtin; | ||
|
||
import org.apache.calcite.sql.SqlFunction; | ||
import org.apache.calcite.sql.SqlFunctionCategory; | ||
import org.apache.calcite.sql.SqlOperator; | ||
import org.apache.calcite.sql.type.SqlTypeFamily; | ||
import org.apache.calcite.sql.type.SqlTypeName; | ||
import org.apache.druid.java.util.common.StringUtils; | ||
import org.apache.druid.math.expr.BuiltInExprMacros; | ||
import org.apache.druid.sql.calcite.expression.DirectOperatorConversion; | ||
import org.apache.druid.sql.calcite.expression.OperatorConversions; | ||
|
||
public class DecodeBase64UTFOperatorConversion extends DirectOperatorConversion | ||
{ | ||
|
||
private static final SqlFunction SQL_FUNCTION = OperatorConversions | ||
.operatorBuilder(StringUtils.toUpperCase(BuiltInExprMacros.StringDecodeBase64UTFExprMacro.NAME)) | ||
.operandTypes(SqlTypeFamily.CHARACTER) | ||
.returnTypeNullable(SqlTypeName.VARCHAR) | ||
.functionCategory(SqlFunctionCategory.STRING) | ||
.build(); | ||
|
||
public DecodeBase64UTFOperatorConversion() | ||
{ | ||
super(SQL_FUNCTION, SQL_FUNCTION.getName()); | ||
} | ||
|
||
@Override | ||
public SqlOperator calciteOperator() | ||
{ | ||
return SQL_FUNCTION; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters