本文整理匯總了Java中org.apache.tajo.engine.planner.LogicalPlan.newPID方法的典型用法代碼示例。如果您正苦於以下問題:Java LogicalPlan.newPID方法的具體用法?Java LogicalPlan.newPID怎麽用?Java LogicalPlan.newPID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tajo.engine.planner.LogicalPlan
的用法示例。
在下文中一共展示了LogicalPlan.newPID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: indexEval
import org.apache.tajo.engine.planner.LogicalPlan; //導入方法依賴的package包/類
public static IndexScanNode indexEval(LogicalPlan plan, ScanNode scanNode,
Iterator<Entry<String, String>> iter ) {
EvalNode qual = scanNode.getQual();
Gson gson = CoreGsonHelper.getInstance();
FieldAndValueFinder nodeFinder = new FieldAndValueFinder();
qual.preOrder(nodeFinder);
LinkedList<EvalNode> nodeList = nodeFinder.getNodeList();
int maxSize = Integer.MIN_VALUE;
SortSpec[] maxIndex = null;
String json;
while(iter.hasNext()) {
Entry<String , String> entry = iter.next();
json = entry.getValue();
SortSpec[] sortKey = gson.fromJson(json, SortSpec[].class);
if(sortKey.length > nodeList.size()) {
/* If the number of the sort key is greater than where condition,
* this index cannot be used
* */
continue;
} else {
boolean[] equal = new boolean[sortKey.length];
for(int i = 0 ; i < sortKey.length ; i ++) {
for(int j = 0 ; j < nodeList.size() ; j ++) {
Column col = ((FieldEval)(nodeList.get(j).getLeftExpr())).getColumnRef();
if(col.equals(sortKey[i].getSortKey())) {
equal[i] = true;
}
}
}
boolean chk = true;
for(int i = 0 ; i < equal.length ; i ++) {
chk = chk && equal[i];
}
if(chk) {
if(maxSize < sortKey.length) {
maxSize = sortKey.length;
maxIndex = sortKey;
}
}
}
}
if(maxIndex == null) {
return null;
} else {
Schema keySchema = new Schema();
for(int i = 0 ; i < maxIndex.length ; i ++ ) {
keySchema.addColumn(maxIndex[i].getSortKey());
}
Datum[] datum = new Datum[nodeList.size()];
for(int i = 0 ; i < nodeList.size() ; i ++ ) {
datum[i] = ((ConstEval)(nodeList.get(i).getRightExpr())).getValue();
}
return new IndexScanNode(plan.newPID(), scanNode, keySchema , datum , maxIndex);
}
}