Skip to content

Commit

Permalink
Disable spooling through session property
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Jan 9, 2025
1 parent 3fffb1b commit dcda3d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public final class SystemSessionProperties
public static final String IDLE_WRITER_MIN_DATA_SIZE_THRESHOLD = "idle_writer_min_data_size_threshold";
public static final String CLOSE_IDLE_WRITERS_TRIGGER_DURATION = "close_idle_writers_trigger_duration";
public static final String COLUMNAR_FILTER_EVALUATION_ENABLED = "columnar_filter_evaluation_enabled";
public static final String SPOOLING_PROTOCOL_ENABLED = "spooling_protocol_enabled";

private final List<PropertyMetadata<?>> sessionProperties;

Expand Down Expand Up @@ -1128,6 +1129,11 @@ public SystemSessionProperties(
ALLOW_UNSAFE_PUSHDOWN,
"Allow pushing down expressions that may fail for some inputs",
optimizerConfig.isUnsafePushdownAllowed(),
true),
booleanProperty(
SPOOLING_PROTOCOL_ENABLED,
"Enable client spooling protocol",
true,
true));
}

Expand Down Expand Up @@ -2018,6 +2024,11 @@ public static boolean isColumnarFilterEvaluationEnabled(Session session)
return session.getSystemProperty(COLUMNAR_FILTER_EVALUATION_ENABLED, Boolean.class);
}

public static boolean isSpoolingProtocolEnabled(Session session)
{
return session.getSystemProperty(SPOOLING_PROTOCOL_ENABLED, Boolean.class);
}

public static boolean isUnsafePushdownAllowed(Session session)
{
return session.getSystemProperty(ALLOW_UNSAFE_PUSHDOWN, Boolean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static io.airlift.units.DataSize.succinctBytes;
import static io.trino.SystemSessionProperties.getRetryPolicy;
import static io.trino.SystemSessionProperties.isSpoolingProtocolEnabled;
import static io.trino.execution.BasicStageStats.EMPTY_STAGE_STATS;
import static io.trino.execution.QueryState.DISPATCHING;
import static io.trino.execution.QueryState.FAILED;
Expand Down Expand Up @@ -309,7 +310,7 @@ static QueryStateMachine beginWithTicker(
session = session.withExchangeEncryption(serializeAesEncryptionKey(createRandomAesEncryptionKey()));
}

if (!queryType.map(SELECT::equals).orElse(false)) {
if (!queryType.map(SELECT::equals).orElse(false) || !isSpoolingProtocolEnabled(session)) {
session = session.withoutSpooling();
}

Expand Down

0 comments on commit dcda3d3

Please sign in to comment.