use of io.prestosql.plugin.jdbc.BaseJdbcConfig in project hetu-core by openlookeng.
the class TestDataSourceTableSplitManager method testGetTableSplits14.
// splitField is not number type
@Test
public void testGetTableSplits14() {
BaseJdbcConfig config = new BaseJdbcConfig();
config.setPushDownEnable(true).setTableSplitEnable(true).setTableSplitFields("[{\"catalogName\":\"" + catalogName + "\",\"schemaName\":\"EXAMPLE\",\"tableName\":\"NUMBERS\"," + "\"splitField\":\"text_short\",\"calcStepEnable\":\"false\",\"dataReadOnly\":\"true\",\"splitCount\":\"2\"," + "\"fieldMinValue\":\"1\",\"fieldMaxValue\":\"12\"}]");
tableHandle = getTableHandle(new SchemaTableName("example", "numbers"));
splitManager = new DataSourceTableSplitManager(config, jdbcClient, nodeManager);
ConnectorSplitSource splitSource = splitManager.getSplits(JdbcIdentity.from(SESSION), tableHandle);
}
use of io.prestosql.plugin.jdbc.BaseJdbcConfig in project hetu-core by openlookeng.
the class TestDataSourceTableSplitManager method testGetTableSplits09.
// splitField is not exist.
@Test
public void testGetTableSplits09() {
BaseJdbcConfig config = new BaseJdbcConfig();
config.setPushDownEnable(true).setTableSplitEnable(true).setTableSplitFields("[{\"catalogName\":\"" + catalogName + "\",\"schemaName\":\"EXAMPLE\",\"tableName\":\"NUMBERS\"," + "\"calcStepEnable\":\"false\",\"dataReadOnly\":\"true\",\"splitCount\":\"2\"," + "\"fieldMinValue\":\"1\",\"fieldMaxValue\":\"12\"}]");
tableHandle = getTableHandle(new SchemaTableName("example", "numbers"));
splitManager = new DataSourceTableSplitManager(config, jdbcClient, nodeManager);
ConnectorSplitSource splitSource = splitManager.getTableSplits(JdbcIdentity.from(SESSION), tableHandle);
assertEquals(splitSource.getClass(), FixedSplitSource.class);
}
use of io.prestosql.plugin.jdbc.BaseJdbcConfig in project hetu-core by openlookeng.
the class TestApplyRemoteFunctionPushDown method setup.
@BeforeTest
public void setup() {
BaseJdbcConfig baseJdbcConfig = new BaseJdbcConfig();
baseJdbcConfig.setPushDownExternalFunctionNamespace("jdbc.v1");
TesterParameter testerParameter = TesterParameter.getTesterParameter();
this.baseJdbcRowExpressionConverter = new BaseJdbcRowExpressionConverter(testerParameter.getMetadata().getFunctionAndTypeManager(), testerParameter.getFunctionResolution(), testerParameter.getRowExpressionService(), testerParameter.getDeterminismEvaluator());
this.applyRemoteFunctionPushDown = new TestingApplyRemoteFunctionPushDown(baseJdbcConfig, "foo");
columnA = planSymbolAllocator.newSymbol("a", BIGINT);
}
use of io.prestosql.plugin.jdbc.BaseJdbcConfig in project hetu-core by openlookeng.
the class TestMySqlRegisterRemoteUdf method testMultiParamsFunctions.
// test func defination with more than one params
@Test
public void testMultiParamsFunctions() {
MysqlExternalFunctionHub externalFunctionHub = new MysqlExternalFunctionHub(new BaseJdbcConfig());
Set<ExternalFunctionInfo> externalFunctionInfo = externalFunctionHub.getExternalFunctions();
assertTrue(externalFunctionInfo.size() > 0);
List<ExternalFunctionInfo> functionList = externalFunctionInfo.stream().filter(x -> x.getFunctionName().get().equals("abs")).collect(Collectors.toList());
assertEquals(functionList.size(), 2);
}
use of io.prestosql.plugin.jdbc.BaseJdbcConfig in project hetu-core by openlookeng.
the class TestMySqlRegisterRemoteUdf method testOverloadFunctions.
// test over load function register
@Test
public void testOverloadFunctions() {
MysqlExternalFunctionHub externalFunctionHub = new MysqlExternalFunctionHub(new BaseJdbcConfig());
Set<ExternalFunctionInfo> externalFunctionInfo = externalFunctionHub.getExternalFunctions();
assertTrue(externalFunctionInfo.size() > 0);
List<ExternalFunctionInfo> functionList = externalFunctionInfo.stream().filter(x -> x.getFunctionName().get().equals("timestamp")).collect(Collectors.toList());
assertEquals(functionList.size(), 1);
ExternalFunctionInfo functionInfo = functionList.get(0);
List<String> inputArgs = functionInfo.getInputArgs();
assertEquals(inputArgs.size(), 2);
assertEquals(inputArgs.get(0), StandardTypes.TIMESTAMP);
assertEquals(inputArgs.get(1), StandardTypes.TIME);
assertEquals(functionInfo.getReturnType().get(), StandardTypes.TIMESTAMP);
assertTrue(functionInfo.isDeterministic());
assertFalse(functionInfo.isCalledOnNullInput());
}
Aggregations