ydb-embedded-ui 3.4.5 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/components/InfoViewer/formatters/table.ts +6 -0
  3. package/dist/components/TruncatedQuery/TruncatedQuery.js +1 -1
  4. package/dist/components/TruncatedQuery/TruncatedQuery.scss +7 -3
  5. package/dist/containers/Node/{NodePages.js → NodePages.ts} +1 -1
  6. package/dist/containers/Tablet/TabletControls/TabletControls.tsx +2 -2
  7. package/dist/containers/Tenant/Diagnostics/Overview/Overview.tsx +11 -43
  8. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.tsx +19 -17
  9. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.ts +192 -37
  10. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.scss +20 -14
  11. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +49 -12
  12. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.tsx +37 -18
  13. package/dist/containers/Tenant/QueryEditor/QueriesHistory/QueriesHistory.tsx +3 -3
  14. package/dist/containers/Tenant/QueryEditor/QueryDuration/QueryDuration.scss +8 -0
  15. package/dist/containers/Tenant/QueryEditor/QueryDuration/QueryDuration.tsx +21 -0
  16. package/dist/containers/Tenant/QueryEditor/QueryEditor.js +58 -82
  17. package/dist/containers/Tenant/QueryEditor/QueryEditor.scss +0 -33
  18. package/dist/containers/Tenant/QueryEditor/QueryEditorControls/OldQueryEditorControls.tsx +83 -0
  19. package/dist/containers/Tenant/QueryEditor/QueryEditorControls/QueryEditorControls.scss +57 -0
  20. package/dist/containers/Tenant/QueryEditor/QueryEditorControls/QueryEditorControls.tsx +84 -0
  21. package/dist/containers/Tenant/QueryEditor/QueryEditorControls/shared.ts +23 -0
  22. package/dist/containers/Tenant/QueryEditor/QueryExplain/QueryExplain.js +12 -23
  23. package/dist/containers/Tenant/QueryEditor/QueryResult/QueryResult.js +4 -6
  24. package/dist/containers/Tenant/QueryEditor/i18n/en.json +3 -0
  25. package/dist/containers/Tenant/QueryEditor/i18n/index.ts +11 -0
  26. package/dist/containers/Tenant/QueryEditor/i18n/ru.json +3 -0
  27. package/dist/containers/UserSettings/UserSettings.tsx +30 -1
  28. package/dist/routes.ts +1 -1
  29. package/dist/services/api.d.ts +4 -3
  30. package/dist/services/api.js +5 -5
  31. package/dist/store/reducers/{executeQuery.js → executeQuery.ts} +48 -43
  32. package/dist/store/reducers/executeTopQueries.ts +5 -1
  33. package/dist/store/reducers/{explainQuery.js → explainQuery.ts} +44 -59
  34. package/dist/store/reducers/{olapStats.js → olapStats.ts} +8 -18
  35. package/dist/store/reducers/settings.js +19 -4
  36. package/dist/store/reducers/storage.js +5 -7
  37. package/dist/types/api/error.ts +14 -0
  38. package/dist/types/api/query.ts +227 -115
  39. package/dist/types/api/schema.ts +523 -3
  40. package/dist/types/common.ts +1 -0
  41. package/dist/types/store/executeQuery.ts +38 -0
  42. package/dist/types/store/explainQuery.ts +38 -0
  43. package/dist/types/store/olapStats.ts +14 -0
  44. package/dist/types/store/query.ts +23 -3
  45. package/dist/utils/constants.ts +2 -1
  46. package/dist/utils/error.ts +25 -0
  47. package/dist/utils/index.js +0 -49
  48. package/dist/utils/prepareQueryExplain.ts +7 -24
  49. package/dist/utils/query.test.ts +148 -213
  50. package/dist/utils/query.ts +68 -90
  51. package/dist/utils/timeParsers/formatDuration.ts +30 -12
  52. package/dist/utils/timeParsers/i18n/en.json +9 -5
  53. package/dist/utils/timeParsers/i18n/ru.json +9 -5
  54. package/dist/utils/timeParsers/parsers.ts +9 -0
  55. package/dist/utils/utils.js +1 -2
  56. package/package.json +1 -1
@@ -229,19 +229,539 @@ interface DatabaseQuotas {
229
229
  ttl_min_run_internal_seconds: number;
230
230
  }
231
231
 
232
- // FIXME: incomplete
233
232
  export interface TTableDescription {
233
+ Name?: string;
234
+ /**
235
+ * @deprecated LocalPathId
236
+ *
237
+ * uint64
238
+ */
239
+ Id_Deprecated?: string;
240
+ Columns?: TColumnDescription[];
241
+ KeyColumnNames?: string[];
242
+ KeyColumnIds?: number[];
243
+ /**
244
+ * Describes uniform partitioning on first key column int on ranges.
245
+ * The first key column must be of integer type
246
+ */
247
+ UniformPartitionsCount?: number;
248
+
234
249
  PartitionConfig?: TPartitionConfig;
250
+ DropColumns?: TColumnDescription[];
251
+ Path?: string;
252
+
253
+ /** bytes */
254
+ PartitionRangeBegin?: unknown;
255
+ /** bytes */
256
+ PartitionRangeEnd?: unknown;
257
+ PartitionRangeBeginIsInclusive?: boolean;
258
+ PartitionRangeEndIsInclusive?: boolean;
259
+
260
+ CopyFromTable?: string;
261
+ /** Boundaries for non-uniform split */
262
+ SplitBoundary?: TSplitBoundary[];
263
+
264
+ TableIndexes?: TIndexDescription[];
265
+ /** uint64 */
266
+ TableSchemaVersion?: string;
267
+
268
+ PathId?: TPathID;
269
+
270
+ TTLSettings?: TTTLSettings;
271
+
272
+ /**
273
+ * used with CopyFromTable
274
+ *
275
+ * default false
276
+ */
277
+ OmitFollowers?: boolean;
278
+ /** default false */
279
+ IsBackup?: boolean;
280
+
281
+ CdcStreams?: TCdcStreamDescription[];
282
+ Sequences?: TSequenceDescription[];
283
+ }
284
+
285
+ interface TColumnDescription {
286
+ Name?: string;
287
+ Type?: string;
288
+ TypeId?: number;
289
+ TypeInfo?: TTypeInfo;
290
+ Id?: number;
291
+ Family?: number;
292
+ FamilyName?: string;
293
+ /** Path to sequence for default values */
294
+ DefaultFromSequence?: string;
295
+ NotNull?: boolean;
296
+ }
297
+
298
+ interface TSplitBoundary {
299
+ /** A tuple representing full key or key prefix */
300
+ KeyPrefix?: unknown;
301
+ /**
302
+ * Or same as KeyPrefix but already serialized
303
+ *
304
+ * bytes
305
+ */
306
+ SerializedKeyPrefix?: unknown;
307
+ }
308
+
309
+ export interface TTTLSettings {
310
+ Enabled?: TEnabled;
311
+ Disabled?: {};
312
+ UseTiering?: string;
313
+ }
314
+
315
+ interface TEnabled {
316
+ ColumnName?: string;
317
+ ExpireAfterSeconds?: number;
318
+ ColumnUnit?: EUnit;
319
+ SysSettings?: TSysSettings;
320
+ }
321
+
322
+ interface TSysSettings {
323
+ /**
324
+ * default 3600000000 (1 hour)
325
+ *
326
+ * uint64
327
+ */
328
+ RunInterval?: string;
329
+ /**
330
+ * default 300000000 (5 minutes)
331
+ *
332
+ * uint64
333
+ */
334
+ RetryInterval?: string;
335
+ /** default 512000 */
336
+ BatchMaxBytes?: number;
337
+ /** default 1 */
338
+ BatchMinKeys?: number;
339
+ /** default 256 */
340
+ BatchMaxKeys?: number;
341
+ /**
342
+ * zero means no limit
343
+ *
344
+ * default 0
345
+ */
346
+ MaxShardsInFlight?: number;
347
+ }
348
+
349
+ interface TSequenceDescription {
350
+ Name?: string;
351
+ /** sequence path id, assigned by schemeshard */
352
+ PathId?: TPathID;
353
+ /**
354
+ * incremented every time sequence is altered
355
+ *
356
+ * uint64
357
+ */
358
+ Version?: string;
359
+ /**
360
+ * current sequenceshard, assigned by schemeshard
361
+ *
362
+ * uint64
363
+ */
364
+ SequenceShard?: string;
365
+ /**
366
+ * minimum value, defaults to 1 or Min<i64>
367
+ *
368
+ * sint64
369
+ */
370
+ MinValue?: string;
371
+ /**
372
+ * maximum value, defaults to Max<i64> or -1
373
+ *
374
+ * sint64
375
+ */
376
+ MaxValue?: string;
377
+ /**
378
+ * start value, defaults to MinValue
379
+ *
380
+ * sint64
381
+ */
382
+ StartValue?: string;
383
+ /**
384
+ * number of items to cache, defaults to 1
385
+ *
386
+ * uint64
387
+ */
388
+ Cache?: string;
389
+ /**
390
+ * increment at each call, defaults to 1
391
+ *
392
+ * sint64
393
+ */
394
+ Increment?: string;
395
+ /** true when cycle on overflow is allowed */
396
+ Cycle?: boolean;
235
397
  }
236
398
 
237
- // FIXME: incomplete
238
399
  export interface TPartitionConfig {
400
+ /** One of the predefined policies*/
401
+ NamedCompactionPolicy?: string;
402
+ /** Customized policy */
403
+ CompactionPolicy?: TCompactionPolicy;
239
404
  /** uint64 */
240
405
  FollowerCount?: string;
406
+ /**
407
+ * Cache size for the whole tablet including all user and system tables
408
+ *
409
+ * uint64
410
+ */
411
+ ExecutorCacheSize?: string;
412
+ /**
413
+ * if true followers can upgrade to leader, if false followers only handle reads
414
+ *
415
+ * default true
416
+ */
417
+ AllowFollowerPromotion?: boolean;
418
+ /**
419
+ * Maximum size in bytes that is allowed to be read by a single Tx
420
+ *
421
+ * uint64
422
+ */
423
+ TxReadSizeLimit?: string;
241
424
  /** @deprecated use FollowerGroups */
242
425
  CrossDataCenterFollowerCount?: number;
426
+ /** for configuring erasure and disk categories */
427
+ ChannelProfileId?: number;
428
+ PartitioningPolicy?: TPartitioningPolicy;
429
+ PipelineConfig?: TPipelineConfig;
430
+ ColumnFamilies?: TFamilyDescription[];
431
+ ResourceProfile?: string;
432
+ DisableStatisticsCalculation?: boolean;
433
+ /**
434
+ * Build and use per-part bloom filter for fast key non-existence check
435
+ *
436
+ * default false
437
+ */
438
+ EnableFilterByKey?: boolean;
439
+ /**
440
+ * Commit log faster at the expense of bandwidth for cross-DC
441
+ *
442
+ * default true
443
+ */
444
+ ExecutorFastLogPolicy?: boolean;
445
+ StorageRooms?: TStorageRoom[];
446
+ /**
447
+ * Use erase cache for faster iteration over erased rows
448
+ *
449
+ * default true
450
+ */
451
+ EnableEraseCache?: boolean;
452
+ /**
453
+ * Minimum number of erased rows worth caching
454
+ *
455
+ * default 16
456
+ */
457
+ EraseCacheMinRows?: number;
458
+ /**
459
+ * Maximum number of bytes to use for cached rows
460
+ *
461
+ * default 1MB
462
+ */
463
+ EraseCacheMaxBytes?: number;
464
+ FreezeState?: EFreezeState;
465
+ ShadowData?: boolean;
243
466
  /** 0 or 1 items */
244
467
  FollowerGroups?: TFollowerGroup[];
468
+ /** uint64 milliseconds */
469
+ KeepSnapshotTimeout?: string;
470
+ }
471
+
472
+ enum EPurpose {
473
+ SysLog,
474
+ Log,
475
+ Data,
476
+ External,
477
+ }
478
+
479
+ interface TChannelPurpose {
480
+ Purpose?: EPurpose;
481
+ Channel?: number;
482
+ }
483
+
484
+ interface TStorageRoom {
485
+ RoomId?: number;
486
+ Explanation?: TChannelPurpose[];
487
+ }
488
+
489
+ interface TPipelineConfig {
490
+ /** default 8 */
491
+ NumActiveTx?: number;
492
+ DataTxCacheSize?: number;
493
+ /** default true */
494
+ EnableOutOfOrder?: boolean;
495
+ DisableImmediate?: boolean;
496
+ EnableSoftUpdates?: boolean;
497
+ }
498
+ interface TFamilyDescription {
499
+ Id?: number;
500
+ Room?: number;
501
+ /** @deprecated use ColumnCodec */
502
+ Codec?: number;
503
+ /** @deprecated use ColumnCache */
504
+ InMemory?: boolean;
505
+ Name?: string;
506
+ ColumnCodec?: EColumnCodec;
507
+ ColumnCache?: EColumnCache;
508
+ /** @deprecated use StorageConfig */
509
+ Storage?: EColumnStorage;
510
+ StorageConfig?: TStorageConfig;
511
+ }
512
+
513
+ interface TStorageConfig {
514
+ SysLog?: TStorageSettings;
515
+ Log?: TStorageSettings;
516
+ Data?: TStorageSettings;
517
+ External?: TStorageSettings;
518
+ DataThreshold?: number;
519
+ ExternalThreshold?: number;
520
+ }
521
+
522
+ enum EColumnCache {
523
+ ColumnCacheNone,
524
+ ColumnCacheOnce,
525
+ ColumnCacheEver,
526
+ }
527
+
528
+ enum EColumnStorage {
529
+ ColumnStorage1,
530
+ ColumnStorage2,
531
+ ColumnStorage1Ext1,
532
+ ColumnStorage1Ext2,
533
+ ColumnStorage2Ext1,
534
+ ColumnStorage2Ext2,
535
+ ColumnStorage1Med2Ext2,
536
+ ColumnStorage2Med2Ext2,
537
+ ColumnStorageTest_1_2_1k,
538
+ }
539
+
540
+ enum EFreezeState {
541
+ Unspecified,
542
+ Freeze,
543
+ Unfreeze,
544
+ }
545
+
546
+ interface TPartitioningPolicy {
547
+ /**
548
+ * Partition gets split when this threshold is exceeded
549
+ *
550
+ * uint64
551
+ */
552
+ SizeToSplit?: string;
553
+
554
+ MinPartitionsCount?: number;
555
+ MaxPartitionsCount?: number;
556
+
557
+ FastSplitSettings?: TFastSplitSettings;
558
+ SplitByLoadSettings?: TSplitByLoadSettings;
559
+ }
560
+
561
+ interface TFastSplitSettings {
562
+ /** uint64 */
563
+ SizeThreshold?: string;
564
+ /** uint64 */
565
+ RowCountThreshold?: string;
566
+ CpuPercentageThreshold?: number;
567
+ }
568
+
569
+ interface TSplitByLoadSettings {
570
+ Enabled?: boolean;
571
+ CpuPercentageThreshold?: number;
572
+ }
573
+
574
+ interface TCompactionPolicy {
575
+ /** uint64 */
576
+ InMemSizeToSnapshot?: string;
577
+ /** snapshot inmem state when size AND steps from last snapshot passed */
578
+ InMemStepsToSnapshot?: number;
579
+ InMemForceStepsToSnapshot?: number;
580
+ /** uint64 */
581
+ InMemForceSizeToSnapshot?: string;
582
+ /** @deprecated default 0 */
583
+ InMemCompactionBrokerQueue?: number;
584
+ /** uint64 default 67108864 */
585
+ ReadAheadHiThreshold?: string;
586
+ /** uint64 default 16777216 */
587
+ ReadAheadLoThreshold?: string;
588
+ /** default 7168 */
589
+ MinDataPageSize?: number;
590
+ /** @deprecated default 0*/
591
+ SnapBrokerQueue?: number;
592
+ /** @deprecated default 1*/
593
+ BackupBrokerQueue?: number;
594
+ /** default 5 */
595
+ DefaultTaskPriority?: number;
596
+ BackgroundSnapshotPolicy?: TBackgroundPolicy;
597
+ InMemResourceBrokerTask?: string;
598
+ SnapshotResourceBrokerTask?: string;
599
+ BackupResourceBrokerTask?: string;
600
+ /** uint64 */
601
+ LogOverheadSizeToSnapshot?: string;
602
+ LogOverheadCountToSnapshot?: number;
603
+ DroppedRowsPercentToCompact?: number;
604
+ /** default CompactionStrategyUnset */
605
+ CompactionStrategy?: ECompactionStrategy;
606
+ ShardPolicy?: TShardPolicy;
607
+ KeepEraseMarkers?: boolean;
608
+ Generation?: TGenerationPolicy[];
609
+ }
610
+
611
+ enum ECompactionStrategy {
612
+ CompactionStrategyUnset,
613
+ CompactionStrategyGenerational,
614
+ CompactionStrategySharded,
615
+ }
616
+
617
+ interface TShardPolicy {
618
+ /**
619
+ * Adjacent shards smaller than this will be merged
620
+ *
621
+ * default 33554432
622
+ *
623
+ * uint64
624
+ */
625
+ MinShardSize?: string;
626
+ /**
627
+ * Shards bigger than this will split in two or more pieces
628
+ *
629
+ * default 134217728
630
+ *
631
+ * uint64
632
+ */
633
+ MaxShardSize?: string;
634
+ /**
635
+ * Slices smaller than this will get prioritized compaction
636
+ *
637
+ * default 2097152
638
+ *
639
+ * uint64
640
+ */
641
+ MinSliceSize?: string;
642
+ /**
643
+ * Level will be compacted when there are more than this number of slices
644
+ *
645
+ * default 256
646
+ */
647
+ MaxSlicesPerLevel?: number;
648
+ /**
649
+ * Shard will be compacted when there are more than this number of levels
650
+ *
651
+ * default 16
652
+ */
653
+ MaxTotalLevels?: number;
654
+ /**
655
+ * Shard will avoid compacting less than this number of levels
656
+ *
657
+ * default 2
658
+ */
659
+ MinLevelsToCompact?: number;
660
+ /**
661
+ * Level will be compacted when it has X% of its data in upper levels
662
+ *
663
+ * default 100
664
+ */
665
+ NewDataPercentToCompact?: number;
666
+ /**
667
+ * Level will be compacted when it has X% of its rows in upper levels
668
+ *
669
+ * default 0
670
+ */
671
+ NewRowsPercentToCompact?: number;
672
+ /**
673
+ * Resource broker task type for compactions
674
+ *
675
+ * default 'compaction_gen1'
676
+ */
677
+ ResourceBrokerTask?: string;
678
+ /**
679
+ * Base priority for compaction tasks
680
+ *
681
+ * default 1000
682
+ */
683
+ TaskPriorityBase?: number;
684
+ /**
685
+ * Task priority will be increased for every N levels over the minimum
686
+ *
687
+ * default 1
688
+ */
689
+ TaskPriorityLevelsBoost?: number;
690
+ /**
691
+ * Task priority will be decreased for every N bytes of input
692
+ *
693
+ * default 4194304
694
+ *
695
+ * uint64
696
+ */
697
+ TaskPrioritySizePenalty?: string;
698
+ /**
699
+ * Part data may be reused, unless it would leave this much garbage
700
+ *
701
+ * default 20
702
+ */
703
+ MaxGarbagePercentToReuse?: number;
704
+ /**
705
+ * Minimum slice that that may be reused
706
+ *
707
+ * default 524288
708
+ *
709
+ * uint64
710
+ */
711
+ MinSliceSizeToReuse?: string;
712
+ }
713
+
714
+ interface TGenerationPolicy {
715
+ GenerationId?: number;
716
+ /** uint64 */
717
+ SizeToCompact?: string;
718
+ CountToCompact?: number;
719
+ ForceCountToCompact?: number;
720
+ /** uint64 */
721
+ ForceSizeToCompact?: string;
722
+ /** @deprecated */
723
+ CompactionBrokerQueue?: number;
724
+ KeepInCache?: boolean;
725
+ BackgroundCompactionPolicy?: TBackgroundPolicy;
726
+ ResourceBrokerTask?: string;
727
+ ExtraCompactionPercent?: number;
728
+ /** uint64 */
729
+ ExtraCompactionMinSize?: string;
730
+ ExtraCompactionExpPercent?: number;
731
+ /** uint64 */
732
+ ExtraCompactionExpMaxSize?: string;
733
+ /** uint64 */
734
+ UpliftPartSize?: string;
735
+ }
736
+
737
+ interface TBackgroundPolicy {
738
+ /**
739
+ * How much (in %) of forced compaction criteria should be met to submit background task.
740
+ *
741
+ * default 101 - no background compaction by default
742
+ */
743
+ Threshold?: number;
744
+ /**
745
+ * Base background compaction priority value (less priority means more important task).
746
+ * Value is used to compute real task priority basing on compaction criteria, time in queue etc.
747
+ *
748
+ * default 100
749
+ */
750
+ PriorityBase?: number;
751
+
752
+ /**
753
+ * Submitted background task may become more prioritized over time.
754
+ * New priority is computed as priority /= max(log(elapsed_seconds) * factor, 1);
755
+ *
756
+ * default 1.0
757
+ *
758
+ * double
759
+ */
760
+ TimeFactor?: number;
761
+
762
+ /** @deprecated default 5*/
763
+ TaskType?: number;
764
+ ResourceBrokerTask?: string;
245
765
  }
246
766
 
247
767
  export interface TFollowerGroup {
@@ -704,7 +1224,7 @@ enum EColumnCodec {
704
1224
  ColumnCodecZSTD = 'ColumnCodecZSTD',
705
1225
  }
706
1226
 
707
- interface TColumnDataLifeCycle {
1227
+ export interface TColumnDataLifeCycle {
708
1228
  Enabled?: TTtl;
709
1229
  Disabled?: {};
710
1230
  Tiering?: TStorageTiering;
@@ -0,0 +1 @@
1
+ export type ValueOf<T extends Object> = T[keyof T];
@@ -0,0 +1,38 @@
1
+ import {
2
+ SEND_QUERY,
3
+ changeUserInput,
4
+ saveQueryToHistory,
5
+ goToPreviousQuery,
6
+ setMonacoHotKey,
7
+ goToNextQuery,
8
+ MONACO_HOT_KEY_ACTIONS,
9
+ } from '../../store/reducers/executeQuery';
10
+ import type {ApiRequestAction} from '../../store/utils';
11
+ import type {ErrorResponse} from '../api/query';
12
+ import type {ValueOf} from '../common';
13
+ import type {IQueryResult, QueryError} from './query';
14
+
15
+ export type MonacoHotKeyAction = ValueOf<typeof MONACO_HOT_KEY_ACTIONS>;
16
+
17
+ export interface ExecuteQueryState {
18
+ loading: boolean;
19
+ input: string;
20
+ history: {
21
+ queries: string[];
22
+ currentIndex: number;
23
+ };
24
+ monacoHotKey: null | MonacoHotKeyAction;
25
+ data?: IQueryResult;
26
+ stats?: IQueryResult['stats'];
27
+ error?: string | ErrorResponse;
28
+ }
29
+
30
+ type SendQueryAction = ApiRequestAction<typeof SEND_QUERY, IQueryResult, QueryError>;
31
+
32
+ export type ExecuteQueryAction =
33
+ | SendQueryAction
34
+ | ReturnType<typeof goToNextQuery>
35
+ | ReturnType<typeof goToPreviousQuery>
36
+ | ReturnType<typeof changeUserInput>
37
+ | ReturnType<typeof saveQueryToHistory>
38
+ | ReturnType<typeof setMonacoHotKey>;
@@ -0,0 +1,38 @@
1
+ import type {ExplainPlanNodeData, GraphNode, Link} from '@gravity-ui/paranoid';
2
+
3
+ import {GET_EXPLAIN_QUERY, GET_EXPLAIN_QUERY_AST} from '../../store/reducers/explainQuery';
4
+ import type {ApiRequestAction} from '../../store/utils';
5
+ import type {PlanTable, ErrorResponse, ScanPlan, ScriptPlan} from '../api/query';
6
+ import type {IQueryResult, QueryError} from './query';
7
+
8
+ export interface PreparedExplainResponse {
9
+ plan?: {
10
+ links?: Link[];
11
+ nodes?: GraphNode<ExplainPlanNodeData>[];
12
+ tables?: PlanTable[];
13
+ version?: string;
14
+ pristine?: ScanPlan | ScriptPlan;
15
+ };
16
+ ast?: string;
17
+ }
18
+
19
+ export interface ExplainQueryState {
20
+ loading: boolean;
21
+ data?: PreparedExplainResponse['plan'];
22
+ dataAst?: PreparedExplainResponse['ast'];
23
+ error?: string | ErrorResponse;
24
+ errorAst?: string | ErrorResponse;
25
+ }
26
+
27
+ type GetExplainQueryAstAction = ApiRequestAction<
28
+ typeof GET_EXPLAIN_QUERY_AST,
29
+ IQueryResult,
30
+ QueryError
31
+ >;
32
+ type GetExplainQueryAction = ApiRequestAction<
33
+ typeof GET_EXPLAIN_QUERY,
34
+ PreparedExplainResponse,
35
+ QueryError
36
+ >;
37
+
38
+ export type ExplainQueryAction = GetExplainQueryAstAction | GetExplainQueryAction;
@@ -0,0 +1,14 @@
1
+ import {FETCH_OLAP_STATS, resetLoadingState} from '../../store/reducers/olapStats';
2
+ import type {ApiRequestAction} from '../../store/utils';
3
+ import type {IQueryResult} from './query';
4
+
5
+ export interface OlapStatsState {
6
+ loading: boolean;
7
+ wasLoaded: boolean;
8
+ data?: IQueryResult;
9
+ error?: unknown;
10
+ }
11
+
12
+ export type OlapStatsAction =
13
+ | ApiRequestAction<typeof FETCH_OLAP_STATS, IQueryResult, unknown>
14
+ | ReturnType<typeof resetLoadingState>;
@@ -1,9 +1,29 @@
1
- import type {KeyValueRow, ColumnType} from '../api/query';
1
+ import type {NetworkError} from '../api/error';
2
+ import type {
3
+ KeyValueRow,
4
+ ColumnType,
5
+ ErrorResponse,
6
+ ScriptPlan,
7
+ ScanPlan,
8
+ TKqpStatsQuery,
9
+ } from '../api/query';
2
10
 
3
11
  export interface IQueryResult {
4
12
  result?: KeyValueRow[];
5
13
  columns?: ColumnType[];
6
- stats?: any;
7
- plan?: any;
14
+ stats?: TKqpStatsQuery;
15
+ plan?: ScriptPlan | ScanPlan;
8
16
  ast?: string;
9
17
  }
18
+
19
+ export interface QueryRequestParams {
20
+ database: string;
21
+ query: string;
22
+ }
23
+
24
+ export type QueryError = NetworkError | ErrorResponse;
25
+
26
+ export enum QueryModes {
27
+ scan = 'scan',
28
+ script = 'script',
29
+ }
@@ -94,6 +94,7 @@ export type IProblemFilterValues = typeof ALL | typeof PROBLEMS;
94
94
  export const THEME_KEY = 'theme';
95
95
  export const INVERTED_DISKS_KEY = 'invertedDisks';
96
96
  export const USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY = 'useNodesEndpointInDiagnostics';
97
+ export const ENABLE_QUERY_MODES_FOR_EXPLAIN = 'enableQueryModesForExplain';
97
98
  export const SAVED_QUERIES_KEY = 'saved_queries';
98
99
  export const ASIDE_HEADER_COMPACT_KEY = 'asideHeaderCompact';
99
100
  export const QUERIES_HISTORY_KEY = 'queries_history';
@@ -118,6 +119,6 @@ export const DEFAULT_TABLE_SETTINGS = {
118
119
  } as const;
119
120
 
120
121
  export const TENANT_INITIAL_TAB_KEY = 'saved_tenant_initial_tab';
121
- export const QUERY_INITIAL_RUN_ACTION_KEY = 'query_initial_run_action';
122
+ export const QUERY_INITIAL_MODE_KEY = 'query_initial_mode';
122
123
 
123
124
  export const PARTITIONS_SELECTED_COLUMNS_KEY = 'partitionsSelectedColumns';