FrankChen021 commented on code in PR #20642:
URL: https://github.com/apache/druid/pull/20642#discussion_r4325239160
##########
web-console/src/druid-models/query-context/query-context.tsx:
##########
@@ -70,6 +70,30 @@ export const DEFAULT_SERVER_QUERY_CONTEXT: QueryContext = {
includeAllCounters: false,
};
+/**
+ * A query context parameter, as a row of `sys.query_context_parameters`
+ */
+export interface QueryContextParameterMetadata {
+ name: string;
+ type: string;
+ description: string;
+ default_value: string | null;
+ default_description: string | null;
+ effective_value: string | null;
+ effective_source:
+ | 'BUILT_IN'
+ | 'RUNTIME_PROPERTY'
+ | 'DEFAULT_CONTEXT_PROPERTY'
+ | 'BROKER_DYNAMIC_CONFIG'
+ | 'UNAUTHORIZED'
+ | null;
+ deprecation: string | null;
+}
+
+export const QUERY_CONTEXT_PARAMETERS_QUERY = `SELECT "name", "type",
"description", "default_value", "default_description", "effective_value",
"effective_source", "deprecation"
+FROM sys.query_context_parameters
+WHERE "visibility" = 'PUBLIC'`;
Review Comment:
[P2] Filter the catalog to SQL parameters
**Finding:** The query filters only on `visibility = 'PUBLIC'`, but public
visibility is independent of `query_languages`. It therefore returns
native-only entries such as `bySegment`, which the SQL layer explicitly
ignores, and the editor offers them after SQL `SET`; accepting one can produce
a setting that has no effect.
**Suggestion:** Restrict the catalog query or the returned metadata to rows
whose `query_languages` contains `SQL` before building completions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]