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

Allow override of requireTimeCondition in query context #17401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -39,6 +39,7 @@ public class PlannerConfig
public static final String CTX_KEY_FORCE_EXPRESSION_VIRTUAL_COLUMNS = "forceExpressionVirtualColumns";
public static final String CTX_MAX_NUMERIC_IN_FILTERS = "maxNumericInFilters";
public static final String CTX_NATIVE_QUERY_SQL_PLANNING_MODE = "plannerStrategy";
public static final String CTX_KEY_REQUIRE_TIME_CONDITION = "requireTimeCondition";
public static final int NUM_FILTER_NOT_USED = -1;

@JsonProperty
Expand Down Expand Up @@ -386,6 +387,11 @@ public Builder withOverrides(final Map<String, Object> queryContext)
CTX_NATIVE_QUERY_SQL_PLANNING_MODE,
nativeQuerySqlPlanningMode
);
requireTimeCondition = QueryContexts.parseBoolean(
queryContext,
CTX_KEY_REQUIRE_TIME_CONDITION,
requireTimeCondition
);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const DatasourcePreviewPane = React.memo(function DatasourcePreviewPane(
try {
result = await queryRunner.runQuery({
query: `SELECT * FROM ${T(datasource)}`,
extraQueryContext: { sqlOuterLimit: 100 },
extraQueryContext: { sqlOuterLimit: 100, requireTimeCondition: false },
cancelToken,
});
} catch (e) {
Expand Down
Loading