Java 类com.hp.hpl.jena.query.SortCondition 实例源码

项目:S2RDF    文件:SqlOrder.java   
public SqlStatement translate(String _resultName, SqlStatement child) {
    resultName = subOp.getResultName();
    String order = "";
    resultSchema = subOp.getSchema();

    List<SortCondition> conditions = opOrder.getConditions();
    Iterator<SortCondition> iterator = conditions.iterator();
    SortCondition current = iterator.next();
    order += getOrderArg(current);
    while (iterator.hasNext()) {
        current = iterator.next();
        order += ", " + getOrderArg(current);
    }
    child.addOrder(order);
    child.addLimit(Tags.LIMIT_LARGE_NUMBER);
    return child;
}
项目:PigSPARQL    文件:PigOrder.java   
@Override
public String translate(String _resultName) {
    resultName = _resultName;
    varsWithNulls.addAll(subOp.getVarsWithNulls());
    String order = "-- " + Tags.ORDER + "\n";

    order += resultName + " = ORDER " + subOp.getResultName() + " BY ";
    List<SortCondition> conditions = opOrder.getConditions();
    Iterator<SortCondition> iterator = conditions.iterator();
    SortCondition current = iterator.next();
    order += getOrderArg(current);
    while (iterator.hasNext()) {
        current = iterator.next();
        order += ", " + getOrderArg(current);
    }
    order += " PARALLEL $reducerNum ;\n";
    resultSchema.addAll(subOp.getSchema());

    return order;
}
项目:PigSPARQL    文件:PigOrder.java   
private String getOrderArg(SortCondition condition) {
    String orderArg = condition.getExpression().getVarName();
    int direction = condition.getDirection();

    switch(direction) {
        case Query.ORDER_ASCENDING: {
            orderArg += " ASC";
            break;
        }
        case Query.ORDER_DESCENDING: {
            orderArg += " DESC";
            break;
        }
        case Query.ORDER_DEFAULT: {
            break;
        }
    }

    return orderArg;
}
项目:Sempala    文件:ImpalaOrder.java   
@Override
public SQLStatement translate(String _resultName, SQLStatement child) {
    resultName = subOp.getResultName();
    String order = "";
    resultSchema = subOp.getSchema();

    List<SortCondition> conditions = opOrder.getConditions();
    Iterator<SortCondition> iterator = conditions.iterator();
    SortCondition current = iterator.next();
    order += getOrderArg(current);
    while (iterator.hasNext()) {
        current = iterator.next();
        order += ", " + getOrderArg(current);
    }
    child.addOrder(order);
    child.addLimit(Tags.LIMIT_LARGE_NUMBER);
    return child;
}
项目:S2RDF    文件:SqlOrder.java   
private String getOrderArg(SortCondition condition) {
    Expr expr = condition.getExpression();
    String orderArg ="";
    if(expr instanceof E_Function){

        ExprTranslator translator = new ExprTranslator(prefixes);
        orderArg = translator.translate(expr,
                expandPrefixes,resultSchema);
    }else{
        orderArg = expr.getVarName();
    }
    int direction = condition.getDirection();

    switch (direction) {
    case Query.ORDER_ASCENDING: {
        orderArg += " ASC";
        break;
    }
    case Query.ORDER_DESCENDING: {
        orderArg += " DESC";
        break;
    }
    case Query.ORDER_DEFAULT: {
        break;
    }
    }

    return orderArg;
}
项目:Sempala    文件:ImpalaOrder.java   
private String getOrderArg(SortCondition condition) {
    Expr expr = condition.getExpression();
    String orderArg ="";
    if(expr instanceof E_Function){

        ExprTranslator translator = new ExprTranslator(prefixes);
        orderArg = translator.translate(expr,
                expandPrefixes,resultSchema);
    }else{
        orderArg = expr.getVarName();
    }
    int direction = condition.getDirection();

    switch (direction) {
    case Query.ORDER_ASCENDING: {
        orderArg += " ASC";
        break;
    }
    case Query.ORDER_DESCENDING: {
        orderArg += " DESC";
        break;
    }
    case Query.ORDER_DEFAULT: {
        break;
    }
    }

    return orderArg;
}
项目:com.inova8.remediator    文件:EvaluatorSimple.java   
@Override
public Table order(Table table, List<SortCondition> conditions)
{
    QueryIterator qIter = table.iterator(getExecContext()) ;
    qIter = new QueryIterSort(qIter, conditions, getExecContext()) ;
    return new TableN(qIter) ;
}
项目:com.inova8.remediator    文件:Evaluator.java   
public Table order(Table table, List<SortCondition> conditions) ;