use of com.actiontech.dble.plan.common.item.ItemString in project dble by actiontech.
the class JoinNodeHandlerBuilder method buildNestFiltersForExplain.
private void buildNestFiltersForExplain(PlanNode tnBig, Item keyToPass) {
Item keyInBig = PlanUtil.pushDownItem(node, keyToPass);
List<Item> strategyFilters = tnBig.getNestLoopFilters();
List<Item> argList = new ArrayList<>();
argList.add(keyInBig);
argList.add(new ItemString(NEED_REPLACE));
ItemFuncIn filter = new ItemFuncIn(argList, false);
strategyFilters.add(filter);
}
use of com.actiontech.dble.plan.common.item.ItemString in project dble by actiontech.
the class JoinNodeHandlerBuilder method buildNestFilters.
/**
* generate filter for big table according to tmp(small) table's result
*
* @param tnBig
* @param keyToPass
* @param valueSet
*/
protected void buildNestFilters(PlanNode tnBig, Item keyToPass, Set<String> valueSet, int maxPartSize) {
List<Item> strategyFilters = tnBig.getNestLoopFilters();
List<Item> partList = null;
Item keyInBig = PlanUtil.pushDownItem(node, keyToPass);
int partSize = 0;
for (String value : valueSet) {
if (partList == null)
partList = new ArrayList<>();
if (value == null) {
// is null will never join
continue;
} else {
partList.add(new ItemString(value));
if (++partSize >= maxPartSize) {
List<Item> argList = new ArrayList<>();
argList.add(keyInBig);
argList.addAll(partList);
ItemFuncIn inFilter = new ItemFuncIn(argList, false);
strategyFilters.add(inFilter);
partList = null;
partSize = 0;
}
}
}
if (partSize > 0) {
List<Item> argList = new ArrayList<>();
argList.add(keyInBig);
argList.addAll(partList);
ItemFuncIn inFilter = new ItemFuncIn(argList, false);
strategyFilters.add(inFilter);
}
// if no data
if (strategyFilters.isEmpty()) {
strategyFilters.add(new ItemInt(0));
}
}
Aggregations