Skip to content

Commit

Permalink
[#294] We now can disable previous row injection
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Grigorev committed Jan 9, 2025
1 parent 37011fb commit ddb66e3
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class ApplyConstructWithChunkedValuesModule extends ApplyConstructAbstrac
private static final String TYPE_URI = KBSS_MODULE.uri + "apply-construct-with-chunked-values";
private static final String TYPE_PREFIX = TYPE_URI + "/";
private static final int DEFAULT_CHUNK_SIZE = 10;
private static final boolean DEFAULT_USE_PREVIOUS_BINDING_VALUE = true;
private static final String VALUES_CLAUSE_MARKER_NAME = "VALUES";
private static final Property P_CHUNK_SIZE = ResourceFactory.createProperty(TYPE_PREFIX + "chunk-size");

Expand All @@ -58,6 +59,9 @@ public class ApplyConstructWithChunkedValuesModule extends ApplyConstructAbstrac
comment = "The select query that will be used to iterate over construct query templates.")
private Select selectQuery;

@Parameter(iri = TYPE_PREFIX + "enable-previous-binding", comment = "Default is true.")
private boolean UsePreviousBinding = DEFAULT_USE_PREVIOUS_BINDING_VALUE;


private ResultSet selectResultSet;

Expand Down Expand Up @@ -91,7 +95,10 @@ public void initializeQuery() {

log.debug("Executing query of chunk provider ...");

selectResultSet = new OneStepBackExtendedResultSet(execution.execSelect());
if (UsePreviousBinding)
selectResultSet = new OneStepBackExtendedResultSet(execution.execSelect());
else
selectResultSet = execution.execSelect();

if (! selectResultSet.hasNext()) {
log.debug("\"{}\" query did not return any values.", getLabel());
Expand Down

0 comments on commit ddb66e3

Please sign in to comment.