use of io.prestosql.sql.builder.functioncall.FunctionCallArgsPackage in project hetu-core by openlookeng.
the class TestDefaultConnectorConfigFunctionRewriter method testDefaultConnectorConfigFunctionRewriter.
@Test
public void testDefaultConnectorConfigFunctionRewriter() {
List<String> functionName = new ArrayList<>();
functionName.add("CORR");
List<String> argsList = new ArrayList<>();
argsList.add("var1");
argsList.add("var2");
FunctionCallArgsPackage functionCallArgsPackage = new FunctionCallArgsPackage(new QualifiedName(functionName), false, argsList, Optional.empty(), Optional.empty(), Optional.empty());
String connectorName = "jdbc_connector";
DefaultUdfRewriteConfigSupplier defaultUdfRewriteConfigSupplier = new DefaultUdfRewriteConfigSupplier(Test_UDF_REWRITE_PATTERNS);
DefaultConnectorConfigFunctionRewriter defaultConnectorConfigFunctionRewriter = new DefaultConnectorConfigFunctionRewriter(connectorName, defaultUdfRewriteConfigSupplier);
assertEquals(defaultConnectorConfigFunctionRewriter.rewriteFunctionCall(functionCallArgsPackage), "CORR(var1, var2)");
}
use of io.prestosql.sql.builder.functioncall.FunctionCallArgsPackage in project hetu-core by openlookeng.
the class TestFromBase64CallRewriter method testFromBase64CallRewriter.
@Test
public void testFromBase64CallRewriter() {
List<String> list = new ArrayList<>();
list.add("'12A69797965458999E'");
FunctionCallArgsPackage functionCallArgsPackage = new FunctionCallArgsPackage(new QualifiedName(Collections.emptyList()), false, list, Optional.empty(), Optional.empty(), Optional.empty());
FromBase64CallRewriter fromBase64CallRewriter = new FromBase64CallRewriter();
assertEquals(fromBase64CallRewriter.rewriteFunctionCall(functionCallArgsPackage), "D7603AF7BF7BF7AE78E7CF7DF4");
}
Aggregations