vogievetsky commented on code in PR #18126: URL: https://github.com/apache/druid/pull/18126#discussion_r2155588988
########## web-console/src/druid-models/native-json-query/native-json-query-completions.ts: ########## @@ -0,0 +1,1098 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { JsonCompletionRule } from '../../utils'; + +export const NATIVE_JSON_QUERY_COMPLETIONS: JsonCompletionRule[] = [ + // Root level - when starting a new query + { + path: '$', + isObject: true, + completions: [ + { value: 'queryType', documentation: 'The type of query to execute' }, + { value: 'dataSource', documentation: 'The data source to query' }, + ], + }, + + // Query type values + { + path: '$.queryType', + completions: [ + { + value: 'timeseries', + documentation: 'Timeseries query for time-based aggregations', + }, + { + value: 'topN', + documentation: 'TopN query to get the top N dimension values', + }, + { value: 'groupBy', documentation: 'GroupBy query for grouped aggregations' }, + { value: 'scan', documentation: 'Scan query to return raw Druid rows' }, + { value: 'search', documentation: 'Search query to find dimension values' }, + { + value: 'timeBoundary', + documentation: 'Time boundary query to find data time range', + }, + { value: 'segmentMetadata', documentation: 'Segment metadata query' }, + { value: 'dataSourceMetadata', documentation: 'Data source metadata query' }, + ], + }, + + // Common properties for most query types + { + path: '$', + isObject: true, + condition: obj => obj.queryType !== 'dataSourceMetadata', Review Comment: Huh, it is not documented here: https://druid.apache.org/docs/latest/querying/datasourcemetadataquery/ I even double cheched this one. It kind of makes sense for `dataSourceMetadata` not to support `intervals` since it is reporting back the max ingested time. -- 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]
