private void loadTempTable(List<ColumnReference> cols,
List<Expression> params, String tableName, NamedTable table,
List<? extends List<?>> vals) throws TranslatorException,
SQLException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "loading temporary table", tableName, "with", vals.size(), "rows");
ExpressionValueSource evs = new ExpressionValueSource(params);
for (ColumnReference col : cols) {
col.setMetadataObject(null);
}
Insert insert = new Insert(table, cols, evs);
insert.setParameterValues(vals.iterator());
JDBCUpdateExecution ex = this.executionFactory.createUpdateExecution(insert, context, context.getRuntimeMetadata(), getConnection());
int size = this.executionFactory.getMaxDependentInPredicates() * this.executionFactory.getMaxInCriteriaSize() / cols.size();
ex.setMaxPreparedInsertBatchSize(Math.max(size, this.executionFactory.getMaxPreparedInsertBatchSize()));
ex.setAtomic(false);
ex.execute();
ex.statement.close();
this.executionFactory.loadedTemporaryTable(tableName, this.context, this.connection);
}