Search in sources :

Example 1 with ValueResultSet

use of com.wplatform.ddal.value.ValueResultSet in project jdbc-shards by wplatform.

the class FunctionTable method getValueResultSet.

private ValueResultSet getValueResultSet(Session session) {
    functionExpr = functionExpr.optimize(session);
    Value v = functionExpr.getValue(session);
    if (v == ValueNull.INSTANCE) {
        return null;
    }
    return (ValueResultSet) v;
}
Also used : ValueResultSet(com.wplatform.ddal.value.ValueResultSet) Value(com.wplatform.ddal.value.Value)

Example 2 with ValueResultSet

use of com.wplatform.ddal.value.ValueResultSet in project jdbc-shards by wplatform.

the class FunctionTable method getResult.

/**
     * Read the result from the function. This method buffers the result in a
     * temporary file.
     *
     * @param session the session
     * @return the result
     */
public ResultInterface getResult(Session session) {
    ValueResultSet v = getValueResultSet(session);
    if (v == null) {
        return null;
    }
    if (cachedResult != null && cachedValue == v) {
        cachedResult.reset();
        return cachedResult;
    }
    LocalResult result = LocalResult.read(session, v.getResultSet(), 0);
    if (function.isDeterministic()) {
        cachedResult = result;
        cachedValue = v;
    }
    return result;
}
Also used : LocalResult(com.wplatform.ddal.result.LocalResult) ValueResultSet(com.wplatform.ddal.value.ValueResultSet)

Aggregations

ValueResultSet (com.wplatform.ddal.value.ValueResultSet)2 LocalResult (com.wplatform.ddal.result.LocalResult)1 Value (com.wplatform.ddal.value.Value)1