Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Native] Add debug config for native engine execution #21036

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ public final class SystemSessionProperties
public static final String NATIVE_EXECUTION_EXECUTABLE_PATH = "native_execution_executable_path";
public static final String NATIVE_EXECUTION_PROGRAM_ARGUMENTS = "native_execution_program_arguments";
public static final String NATIVE_EXECUTION_PROCESS_REUSE_ENABLED = "native_execution_process_reuse_enabled";
public static final String NATIVE_DEBUG_VALIDATE_OUTPUT_FROM_OPERATORS = "native_debug.validate_output_from_operators";

private final List<PropertyMetadata<?>> sessionProperties;

Expand Down Expand Up @@ -1561,6 +1562,15 @@ public SystemSessionProperties(
"Enable reuse the native process within the same JVM",
true,
false),
booleanProperty(
NATIVE_DEBUG_VALIDATE_OUTPUT_FROM_OPERATORS,
"If set to true, then during execution of tasks, the output vectors of " +
"every operator are validated for consistency. This is an expensive check " +
"so should only be used for debugging. It can help debug issues where " +
"malformed vector cause failures or crashes by helping identify which " +
"operator is generating them.",
false,
true),
booleanProperty(
RANDOMIZE_OUTER_JOIN_NULL_KEY,
"(Deprecated) Randomize null join key for outer join",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,31 @@ TEST_F(QueryContextManagerTest, nativeSessionProperties) {
.systemProperties = {
{"native_max_spill_level", "1"},
{"native_spill_compression_codec", "NONE"},
{"native_join_spill_enabled", "true"},
Copy link
Collaborator

@majetideepak majetideepak Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move this change to another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is just expanding the unit testing and not changing any defaults so is fairly benign to keep in this PR. Please let me know if you still feel strongly about separating this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. Thanks for clarifying!

{"native_join_spill_enabled", "false"},
{"native_spill_write_buffer_size", "1024"},
{"native_debug.validate_output_from_operators", "true"},
{"aggregation_spill_all", "true"}}};
auto queryCtx = taskManager_->getQueryContextManager()->findOrCreateQueryCtx(
taskId, session);
EXPECT_EQ(queryCtx->queryConfig().maxSpillLevel(), 1);
EXPECT_EQ(queryCtx->queryConfig().spillCompressionKind(), "NONE");
EXPECT_TRUE(queryCtx->queryConfig().joinSpillEnabled());
EXPECT_FALSE(queryCtx->queryConfig().joinSpillEnabled());
EXPECT_TRUE(queryCtx->queryConfig().validateOutputFromOperators());
EXPECT_EQ(queryCtx->queryConfig().spillWriteBufferSize(), 1024);
EXPECT_TRUE(queryCtx->queryConfig().aggregationSpillAll());
}

TEST_F(QueryContextManagerTest, defaultSessionProperties) {
protocol::TaskId taskId = "scan.0.0.1.0";
protocol::SessionRepresentation session{.systemProperties = {}};
auto queryCtx = taskManager_->getQueryContextManager()->findOrCreateQueryCtx(
taskId, session);
EXPECT_EQ(queryCtx->queryConfig().maxSpillLevel(), 4);
EXPECT_EQ(queryCtx->queryConfig().spillCompressionKind(), "none");
EXPECT_TRUE(queryCtx->queryConfig().joinSpillEnabled());
EXPECT_FALSE(queryCtx->queryConfig().validateOutputFromOperators());
EXPECT_EQ(queryCtx->queryConfig().spillWriteBufferSize(), 1L << 20);
EXPECT_FALSE(queryCtx->queryConfig().aggregationSpillAll());
}

} // namespace facebook::presto