static PreparedStatementRequest helpGetProcessorPlan(String preparedSql, List values,
CapabilitiesFinder capFinder, QueryMetadataInterface metadata, SessionAwareCache<PreparedPlan> prepPlanCache, int conn, boolean callableStatement, boolean limitResults, VDBMetaData vdb)
throws TeiidComponentException, TeiidProcessingException {
//Create Request
RequestMessage request = new RequestMessage(preparedSql);
if (callableStatement) {
request.setStatementType(StatementType.CALLABLE);
} else {
request.setStatementType(StatementType.PREPARED);
}
request.setParameterValues(values);
if (values != null && values.size() > 0 && values.get(0) instanceof List) {
request.setBatchedUpdate(true);
}
if (limitResults) {
request.setRowLimit(1);
}
DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, vdb);
workContext.getSession().setSessionId(String.valueOf(conn));