本文整理匯總了Java中com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager類的典型用法代碼示例。如果您正苦於以下問題:Java ExtraFunctionManager類的具體用法?Java ExtraFunctionManager怎麽用?Java ExtraFunctionManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ExtraFunctionManager類屬於com.taobao.tddl.optimizer.core.expression包,在下文中一共展示了ExtraFunctionManager類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handle
import com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager; //導入依賴的package包/類
@Override
public ISchematicCursor handle(IDataNodeExecutor executor, ExecutionContext executionContext) throws TddlException {
ShowWithoutTable show = (ShowWithoutTable) executor;
ArrayResultCursor result = new ArrayResultCursor("TABLES", executionContext);
result.addColumn("Tables_in_" + executor.getDataNode(), DataType.StringType);
result.initMeta();
Set<String> tableNames = OptimizerContext.getContext().getRule().mergeTableRule(new ArrayList<String>());
Like like = null;
String likeExpr = null;
boolean full = show.isFull();
if (StringUtils.isNotEmpty(show.getPattern())) {
like = (Like) ExtraFunctionManager.getExtraFunction("LIKE");
if (show.getPattern().charAt(0) == '\'' && show.getPattern().charAt(show.getPattern().length() - 1) == '\'') {
likeExpr = show.getPattern().substring(1, show.getPattern().length() - 1);
} else {
likeExpr = show.getPattern();
}
}
for (String table : tableNames) {
if (like != null) {
boolean bool = (Boolean) like.compute(new Object[] { table, likeExpr }, executionContext);
if (!bool) {
continue;
}
}
if (full) {
String type = "BASE TABLE";
result.addRow(new Object[] { table, type });
} else {
result.addRow(new Object[] { table });
}
}
return result;
}
示例2: getExtraFunction
import com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager; //導入依賴的package包/類
@Override
public IExtraFunction getExtraFunction() {
if (extraFunction == null) {
extraFunction = ExtraFunctionManager.getExtraFunction(getFunctionName());
extraFunction.setFunction(this);// 不可能為null
}
return extraFunction;
}
示例3: test_extension
import com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager; //導入依賴的package包/類
@Test
public void test_extension() {
IExtraFunction func = ExtraFunctionManager.getExtraFunction("DUMMY");
Assert.assertEquals(DummyTest.class, func.getClass());
func = ExtraFunctionManager.getExtraFunction("NOT_EXIST");
Assert.assertEquals(DummyTest.class, func.getClass());
}