dolphindb 2.0.600 → 2.0.603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs.en.json CHANGED
@@ -1086,7 +1086,7 @@
1086
1086
  "value": [
1087
1087
  "In the following example, the user-defined function ``getSpread`` calculates the average bid-ask spread for a specified stock in the table `dfs://TAQ/quotes`. A user (user1) does not have the privilege to read table `dfs://TAQ/quotes`. Now define function ``getSpread`` to be a function view, and grant user1 the priviledge to execute the function view. Although user1 cannot read the raw data of table `dfs://TAQ/quotes`, now she can execute the function view to calculate the average bid-ask spread of any stock in the table.",
1088
1088
  "",
1089
- "Please note that as table `dfs://TAQ/quotes` is a distributed database, the following script needs to be executed by a system administrator on a controller node. User1 can execute function ``getSpread`` on any data node.",
1089
+ "Please note that as table `dfs://TAQ/quotes` is a distributed database, the following script needs to be executed by a system administrator. User1 can execute function ``getSpread`` on any data node/compute node.",
1090
1090
  ""
1091
1091
  ]
1092
1092
  },
@@ -2022,17 +2022,17 @@
2022
2022
  {
2023
2023
  "type": "text",
2024
2024
  "value": [
2025
- "If `obj` is a local variable: obj must be a vector/matrix/table/set, and newData is scalar/vector/table/set. Please note that obj cannot be a scalar. ",
2025
+ "`obj` is a local variable, and it must a vector/matrix/table/set.",
2026
2026
  "",
2027
- " * If obj is a vector, newData is a scalar or a vector. The result is a new vector longer than obj. ",
2027
+ "`newData` is a scalar/vector/table/set.",
2028
2028
  "",
2029
- " * If obj is a matrix, newData is a vector whose length must be a multiple of the number of rows of obj. The result is a new matrix with the same number of rows as obj but more columns.",
2030
- "",
2031
- " * If obj is a table, newData is a table with the same number of columns as obj. The columns names of newData do not need to be identical as those of obj. The result is a new table with the same column names as obj but more rows.",
2032
- "",
2033
- " * If newData is not of the same data form as obj, append! will attempt to convert newData to the same data form as obj; if this is not possible, it returns an error message.",
2034
- "",
2035
- "If obj is a table in the distributed file system, newData must be a regular in-memory table instead of a partitioned table. "
2029
+ " - If *obj* is a vector, *newData* is a scalar or vector. The result is a vector longer than *obj*.",
2030
+ " ",
2031
+ " - If *obj* is a matrix, *newData* is a vector whose length must be a multiple of the number of rows of *obj*. The result is a matrix with the same number of rows as *obj* but with more columns.",
2032
+ " ",
2033
+ " - If *obj* is a table, *newData* is a table with the same number of columns as *obj*. The result is a table with the same number and name of columns as *obj* but with more rows.",
2034
+ " ",
2035
+ " - If *newData* and *obj* are of different data forms, ``append!`` will attempt to convert *newData* to the same data form as *obj*. If it is not possible, return an error message."
2036
2036
  ]
2037
2037
  }
2038
2038
  ]
@@ -2044,7 +2044,9 @@
2044
2044
  {
2045
2045
  "type": "text",
2046
2046
  "value": [
2047
- "Append newData to obj. ! means in-place change. "
2047
+ "Append *newData* to *obj*. The exclamation mark (!) means in-place change in DolphinDB.",
2048
+ "",
2049
+ "Note: In most cases, the column names and orders in the tables should be consistent. Please first check whether the corresponding columns in *obj* and *newData* have the same names and are arranged in the same order before executing ``append!``. The function does not check the consistency of column names or align the columns if they are not arranged in the same order. It is executed as long as the corresponding columns are of the same data types. "
2048
2050
  ]
2049
2051
  }
2050
2052
  ]
@@ -2220,7 +2222,6 @@
2220
2222
  "type": "text",
2221
2223
  "value": [
2222
2224
  "* Use append! to add data to a table in the local file system:",
2223
- "",
2224
2225
  ""
2225
2226
  ]
2226
2227
  },
@@ -2240,7 +2241,7 @@
2240
2241
  {
2241
2242
  "type": "text",
2242
2243
  "value": [
2243
- "Please note that the last line of script is only executed on the harddisk, and we need to load the table into memory to work with it. ",
2244
+ "Please note that the last line of script is only executed on the hard disk, and we need to load the table into memory to work with it. ",
2244
2245
  ""
2245
2246
  ]
2246
2247
  },
@@ -2292,7 +2293,27 @@
2292
2293
  " $ Trades=loadTable(db, `Trades)",
2293
2294
  " $ size(Trades);",
2294
2295
  "",
2295
- " 1500000"
2296
+ " 1500000",
2297
+ ""
2298
+ ]
2299
+ },
2300
+ {
2301
+ "type": "text",
2302
+ "value": [
2303
+ "* An error is raised if the corresponding columns in obj and newData are of different data types.",
2304
+ ""
2305
+ ]
2306
+ },
2307
+ {
2308
+ "type": "code",
2309
+ "language": "console",
2310
+ "value": [
2311
+ "",
2312
+ " $ t1=table(`x`y`z as name,10 12 16 as val)",
2313
+ " $ t2=table(5 7 9 as val,`b`n`m as name)",
2314
+ " //columns in t1 and t2 are of different data types",
2315
+ " $ t2.append!(t1)",
2316
+ " Failed to append data to column 'val' "
2296
2317
  ]
2297
2318
  }
2298
2319
  ]
@@ -2554,7 +2575,7 @@
2554
2575
  {
2555
2576
  "type": "text",
2556
2577
  "value": [
2557
- "asfreq(X, Y)"
2578
+ "asfreq(X, rule, [closed], [label], [origin='start_day'])"
2558
2579
  ]
2559
2580
  }
2560
2581
  ]
@@ -2568,41 +2589,63 @@
2568
2589
  "value": [
2569
2590
  "`X` is an indexed matrix or indexed series. The index must be of temporal type. ",
2570
2591
  "",
2571
- "rule is a string that can take the following values:",
2572
- "",
2573
- "========================== ================================",
2574
- "Values of parameter \"rule\" Corresponding DolphinDB function",
2575
- "========================== ================================",
2576
- "\"B\" businessDay",
2577
- "\"W\" weekEnd",
2578
- "\"WOM\" weekOfMonth",
2579
- "\"LWOM\" lastWeekOfMonth",
2580
- "\"M\" monthEnd",
2581
- "\"MS\" monthBegin",
2582
- "\"BM\" businessMonthEnd",
2583
- "\"BMS\" businessMonthBegin",
2584
- "\"SM\" semiMonthEnd",
2585
- "\"SMS\" semiMonthBegin",
2586
- "\"Q\" quarterEnd",
2587
- "\"QS\" quarterBegin",
2588
- "\"BQ\" businessQuarterEnd",
2589
- "\"BQS\" businessQuarterBegin",
2590
- "\"A\" yearEnd",
2591
- "\"AS\" yearBegin",
2592
- "\"BA\" businessYearEnd",
2593
- "\"BAS\" businessYearBegin",
2594
- "\"D\" date",
2595
- "\"H\" hourOfDay",
2596
- "\"min\" minuteOfHour",
2597
- "\"S\" secondOfMinute",
2598
- "\"L\" millisecond",
2599
- "\"U\" microsecond",
2600
- "\"N\" nanosecond",
2601
- "========================== ================================",
2592
+ "`rule` is a string that can take the following values:",
2593
+ "",
2594
+ "=========================== =================================",
2595
+ "Values of parameter \"rule\" Corresponding DolphinDB function",
2596
+ "=========================== =================================",
2597
+ "\"B\" businessDay",
2598
+ "\"W\" weekEnd",
2599
+ "\"WOM\" weekOfMonth",
2600
+ "\"LWOM\" lastWeekOfMonth",
2601
+ "\"M\" monthEnd",
2602
+ "\"MS\" monthBegin",
2603
+ "\"BM\" businessMonthEnd",
2604
+ "\"BMS\" businessMonthBegin",
2605
+ "\"SM\" semiMonthEnd",
2606
+ "\"SMS\" semiMonthBegin",
2607
+ "\"Q\" quarterEnd",
2608
+ "\"QS\" quarterBegin",
2609
+ "\"BQ\" businessQuarterEnd",
2610
+ "\"BQS\" businessQuarterBegin",
2611
+ "\"REQ\" FY5253Quarter",
2612
+ "\"A\" yearEnd",
2613
+ "\"AS\" yearBegin",
2614
+ "\"BA\" businessYearEnd",
2615
+ "\"BAS\" businessYearBegin",
2616
+ "\"RE\" FY5253",
2617
+ "\"D\" date",
2618
+ "\"H\" hourOfDay",
2619
+ "\"min\" minuteOfHour",
2620
+ "\"S\" secondOfMinute",
2621
+ "\"L\" millisecond",
2622
+ "\"U\" microsecond",
2623
+ "\"N\" nanosecond",
2624
+ "=========================== =================================",
2602
2625
  "",
2603
2626
  "The strings above can also be used with integers for parameter \"rule\". For example, \"2M\" means month end every two months.",
2604
2627
  "",
2605
- "rule can also be a vector of temporal type. "
2628
+ "rule can also be a vector of temporal type. ",
2629
+ "",
2630
+ "`closed` is a string indicating which boundary of the interval is closed.",
2631
+ "",
2632
+ "- The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.",
2633
+ "- The default is 'right' if *origin* is 'end' or 'end_day'.",
2634
+ "- For version 1.30.18/2.00.6, when the time precision of *rule* is less than day, only the default value can be used.",
2635
+ "",
2636
+ "`label` is a string indicating which boundary is used to label the interval.",
2637
+ "",
2638
+ "- The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.",
2639
+ "- The default is 'right' if *origin* is 'end' or 'end_day'.",
2640
+ "- For version 1.30.18/2.00.6, when the time precision of *rule* is less than day, only the default value can be used.",
2641
+ "",
2642
+ "`origin` is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start_day', 'end', 'end_day' or a user-defined time object. The default value is 'start_day'.",
2643
+ "",
2644
+ "- 'epoch': *origin* is 1970-01-01",
2645
+ "- 'start': *origin* is the first value of the timeseries",
2646
+ "- 'start_day': *origin* is 00:00 of the first day of the timeseries",
2647
+ "- 'end': *origin* is the last value of the timeseries",
2648
+ "- 'end_day': *origin* is 24:00 of the last day of the timeseries"
2606
2649
  ]
2607
2650
  }
2608
2651
  ]
@@ -2614,7 +2657,7 @@
2614
2657
  {
2615
2658
  "type": "text",
2616
2659
  "value": [
2617
- "Convert X to specified frequency. "
2660
+ "Convert X to specified frequency. Different from :doc:`../r/resample`, aggregate functions cannot be used in ``asfreq``."
2618
2661
  ]
2619
2662
  }
2620
2663
  ]
@@ -2769,7 +2812,90 @@
2769
2812
  "2020.01.01 1",
2770
2813
  "2020.01.03 2",
2771
2814
  "2020.01.05 ",
2772
- "=========== =="
2815
+ "=========== ==",
2816
+ ""
2817
+ ]
2818
+ },
2819
+ {
2820
+ "type": "code",
2821
+ "language": "console",
2822
+ "value": [
2823
+ "",
2824
+ " $ index = temporalAdd(2022.10.01 23:30:00,7*(0..8),`m)",
2825
+ " $ s = indexedSeries(index, 3*(0..8))",
2826
+ " $ s.asfreq(\"8min\")",
2827
+ ""
2828
+ ]
2829
+ },
2830
+ {
2831
+ "type": "text",
2832
+ "value": [
2833
+ "=================== ====",
2834
+ "label\t col1",
2835
+ "=================== ====",
2836
+ "2022.10.01T23:28:00\t",
2837
+ "2022.10.01T23:36:00\t",
2838
+ "2022.10.01T23:44:00\t6",
2839
+ "2022.10.01T23:52:00\t",
2840
+ "2022.10.02T00:00:00\t",
2841
+ "2022.10.02T00:08:00\t",
2842
+ "2022.10.02T00:16:00\t",
2843
+ "2022.10.02T00:24:00",
2844
+ "=================== ====",
2845
+ ""
2846
+ ]
2847
+ },
2848
+ {
2849
+ "type": "code",
2850
+ "language": "console",
2851
+ "value": [
2852
+ "",
2853
+ " $ s.asfreq(rule=`8min,closed=`right)",
2854
+ ""
2855
+ ]
2856
+ },
2857
+ {
2858
+ "type": "text",
2859
+ "value": [
2860
+ "=================== ====",
2861
+ "label\t col1",
2862
+ "=================== ====",
2863
+ "2022.10.01T23:36:00\t",
2864
+ "2022.10.01T23:44:00\t6",
2865
+ "2022.10.01T23:52:00\t",
2866
+ "2022.10.02T00:00:00\t",
2867
+ "2022.10.02T00:08:00\t",
2868
+ "2022.10.02T00:16:00\t",
2869
+ "2022.10.02T00:24:00\t",
2870
+ "2022.10.02T00:32:00",
2871
+ "=================== ====",
2872
+ ""
2873
+ ]
2874
+ },
2875
+ {
2876
+ "type": "code",
2877
+ "language": "console",
2878
+ "value": [
2879
+ "",
2880
+ " $ s.asfreq(rule=`8min,closed=`right,origin=`end)",
2881
+ ""
2882
+ ]
2883
+ },
2884
+ {
2885
+ "type": "text",
2886
+ "value": [
2887
+ "=================== ====",
2888
+ "label\t col1",
2889
+ "=================== ====",
2890
+ "2022.10.01T23:30:00\t0",
2891
+ "2022.10.01T23:38:00\t",
2892
+ "2022.10.01T23:46:00\t",
2893
+ "2022.10.01T23:54:00\t",
2894
+ "2022.10.02T00:02:00\t",
2895
+ "2022.10.02T00:10:00\t",
2896
+ "2022.10.02T00:18:00\t",
2897
+ "2022.10.02T00:26:00\t24",
2898
+ "=================== ===="
2773
2899
  ]
2774
2900
  }
2775
2901
  ]
@@ -6317,7 +6443,9 @@
6317
6443
  {
6318
6444
  "type": "text",
6319
6445
  "value": [
6320
- "Cancel a submitted but unfinished batch job."
6446
+ "Cancel a submitted but unfinished batch job.",
6447
+ "",
6448
+ "Starting from version 1.30.19/2.00.7, if a jobId does not exist when ``cancelJob`` is executed, the system no longer throws an exception. Instead, it outputs the error message with jobId to the log."
6321
6449
  ]
6322
6450
  }
6323
6451
  ]
@@ -6350,8 +6478,26 @@
6350
6478
  " $ myJobId=\"writeData\"+temporalFormat(datetime(now()),\"yyyyMMddHHmmss\")",
6351
6479
  " $ submitJob(myJobId,\"write data to dfs table\",writeData,120);",
6352
6480
  " $ cancelJob(myJobId);",
6481
+ ""
6482
+ ]
6483
+ },
6484
+ {
6485
+ "type": "text",
6486
+ "value": [
6487
+ "Cancel the unfinished jobs in a cluster:",
6488
+ ""
6489
+ ]
6490
+ },
6491
+ {
6492
+ "type": "code",
6493
+ "language": "console",
6494
+ "value": [
6353
6495
  "",
6354
- "",
6496
+ " $ def cancelAllBatchJob(){",
6497
+ " $ jobids=exec jobid from getRecentJobs() where endTime=NULL",
6498
+ " $ cancelJob(jobids)\t",
6499
+ " $ }",
6500
+ " $ pnodeRun(cancelAllBatchJob)",
6355
6501
  ""
6356
6502
  ]
6357
6503
  }
@@ -11571,7 +11717,7 @@
11571
11717
  "",
11572
11718
  "`outputTable` is a table object indicating the output table for the results. We need to set the output table as an empty table and specify the names and data types of the columns before using function createAsofJoinEngine. By default, the first two columns are the `timeColumn` and `matchingColumn` of the leftTable which do not need to be specified in metrics.",
11573
11719
  "",
11574
- "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it's not necessary to specify the column names). For more information about metacode please refer to :doc:`/Objects/Metaprogramming`.",
11720
+ "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For more information about metacode please refer to :doc:`/Objects/Metaprogramming`.",
11575
11721
  "",
11576
11722
  "`matchingColumn` is a STRING scaler/vector/tuple indicating the column(s) on which the tables are joined. It supports integral, temporal or literal (except UUID) types.",
11577
11723
  "",
@@ -11584,7 +11730,7 @@
11584
11730
  "`useSystemTime` is an optional parameter indicating whether the first column of outputTable is system time ( `useSystemTime` = true) or `timeColumn` in the stream table ( `useSystemTime` = false).",
11585
11731
  "",
11586
11732
  " * `useSystemTime` = true, to calculate according to the timestamp when each record is ingested into the streaming engine (with millisecond precision) instead of `timeColumn`.",
11587
- " * `useSystemTime` = false (default), to calculate according to `timeColumn` instead of the timestamp when each record is ingested into the engine. Please note that the the data which triggers the calculation doesn’t participate in this calculation.",
11733
+ " * `useSystemTime` = false (default), to calculate according to `timeColumn` instead of the timestamp when each record is ingested into the engine. Please note that the the data which triggers the calculation doesn't participate in this calculation.",
11588
11734
  "",
11589
11735
  "`useSessionStartTime` is a Boolean scalar. It is optional and indicates whether the time in the output table is the start time of data window. The default value is false, which means that the time in the output table is the end time of the data window, that is, the timestamp of the last data in each window + sessionGap. It must be set to true if parameter `updateTime` is specified.",
11590
11736
  "",
@@ -12030,7 +12176,7 @@
12030
12176
  "",
12031
12177
  "`mergeSessionEnd` is a Boolean scalar indicating whether to include the data at the ending time of the session in the calculation of each session. It is optional and the default value is false.",
12032
12178
  "",
12033
- "`forceTriggerSessionEndTime` is an optional parameter. It is a positive integer in unit of seconds. It indicates the waiting time to force trigger calculation in the window containing the sessionEnd, if it ends without calculation.",
12179
+ "`forceTriggerSessionEndTime` is an optional parameter. It is a positive integer whose unit is consistent with the precision of timeColumn. It indicates the waiting time to force trigger calculation in the window containing the sessionEnd, if it ends without calculation.",
12034
12180
  "",
12035
12181
  "- If *fill* is not specified, the window returns no result.",
12036
12182
  "",
@@ -12623,7 +12769,7 @@
12623
12769
  "",
12624
12770
  "\\(2) The last few columns are the results of the *metrics*.",
12625
12771
  "",
12626
- "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it's not necessary to specify the column names). For more information about metacode, please refer to :doc:`/Objects/Metaprogramming`.",
12772
+ "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For more information about metacode, please refer to :doc:`/Objects/Metaprogramming`.",
12627
12773
  "",
12628
12774
  "`matchingColumn` is a STRING scalar/vector, or a tuple of STRING vectors indicating the matching column(s). It can be integral, temporal or literal (excluding UUID) types.",
12629
12775
  "",
@@ -13169,11 +13315,11 @@
13169
13315
  "",
13170
13316
  "The following state functions in DolphinDB's reactive state engine has been optimized. Currently, unoptimized state functions are not supported by this engine. And aggregate functions should be avoid.",
13171
13317
  "",
13172
- "* cumulative function: cumavg, cumsum, cumprod, cumcount, cummin, cummax, cumvar, cumvarp, cumstd, cumstdp, cumcorr, cumcovar, cumbeta, cumwsum, cumwavg, cumfirstNot, cumlastNot",
13318
+ "* cumulative function: cumavg, cumsum, cumprod, cumcount, cummin, cummax, cumvar, cumvarp, cumstd, cumstdp, cumcorr, cumcovar, cumbeta, cumwsum, cumwavg, cumfirstNot, cumlastNot, cummed, cumpercentile ",
13173
13319
  "* moving function: ema, mavg, msum, mcount, mprod, mvar, mvarp, mstd, mstdp, mskew, mkurtosis, mmin, mmax, mimin, mimax, mmed, mpercentile, mrank, mcorr, mcovar, mbeta, mwsum, mwavg, mmad, mfirst, mlast, mslr, tmove, tmfirst, tmlast, tmsum, tmavg, tmcount, tmvar, tmvarp, tmstd, tmstdp, tmprod, tmskew, tmkurtosis, tmmin, tmmax, tmmed, tmpercentile, tmrank, tmcovar, tmbeta, tmcorr, tmwavg, tmwsum, tmoving, moving, sma,wma, dema, tema, trima, linearTimeTrend, talib, t3, ma",
13174
13320
  "* order-sensitive function: deltas, ratios, ffill, move, prev, iterate, ewmMean, ewmVar, ewmStd, ewmCov, ewmCorr",
13175
- "* topN functions: msumTopN, mavgTopN, mstdpTopN, mstdTopN, mvarpTopN, mvarTopN, mcorrTopN, mbetaTopN, mcovarTopN, mwsumTopN",
13176
- "* other: talibNull",
13321
+ "* topN function: msumTopN, mavgTopN, mstdpTopN, mstdTopN, mvarpTopN, mvarTopN, mcorrTopN, mbetaTopN, mcovarTopN, mwsumTopN",
13322
+ "* other: talibNull, talibNull, fixedLengthArrayVector, dynamicGroupCumsum, dynamicGroupCumcount",
13177
13323
  "",
13178
13324
  "Note: The parameter *func* in the state function ``talib`` can only be a state function supported by the reactive state engine.",
13179
13325
  "",
@@ -14267,7 +14413,7 @@
14267
14413
  "",
14268
14414
  "`window` is a pair of integers or duration values, indicating the range of the sliding window, including both left and right bounds.",
14269
14415
  "",
14270
- "`metrics` is a required parameter indicating calculation metrics in the form of metacode. It can use one or more expressions, and built-in or user-defined functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it’s not necessary to specify the column names). For details about metacode, see :doc:`/Objects/Metaprogramming`。",
14416
+ "`metrics` is a required parameter indicating calculation metrics in the form of metacode. It can use one or more expressions, and built-in or user-defined functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For details about metacode, see :doc:`/Objects/Metaprogramming`。",
14271
14417
  "",
14272
14418
  "When only the columns in the *rightTable* are involved in calculation, the window join engine optimizes the performance of the following functions: sum, sum2, avg, std, var, corr, covar, wavg, wsum, beta, max, min, last, first, med, percentile。",
14273
14419
  "",
@@ -18927,7 +19073,7 @@
18927
19073
  "",
18928
19074
  "`ascending` is a Boolean value indicating whether to sort in ascending order. It is an optional parameter and the default value is true.",
18929
19075
  "",
18930
- "`ignoreNA` is a Boolean value indicating whether NULL values are ignored in ranking and return NULL. When NULL values participate in ranking, NULL values return 0, which is the smallest value in the result.",
19076
+ "`ignoreNA` is a Boolean value indicating whether NULL values are ignored in ranking. The default value is true. If set to false, NULL is ranked as the minimum value.",
18931
19077
  "",
18932
19078
  "`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false."
18933
19079
  ]
@@ -18941,8 +19087,15 @@
18941
19087
  {
18942
19088
  "type": "text",
18943
19089
  "value": [
18944
- "* If *X* is a vector, return the consecutive rank of each element in *X*.",
18945
- "* If *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*."
19090
+ "If *X* is a vector:",
19091
+ "",
19092
+ "- return the consecutive rank of each element in *X* based on the specified order.",
19093
+ "",
19094
+ "- If ignoreNA = true, the NULL values are ignored in ranking and return NULL.",
19095
+ "",
19096
+ "* If *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.",
19097
+ "",
19098
+ "Note: Unlike ``denseRank``, :doc:`../r/rank` skips positions after equal rankings."
18946
19099
  ]
18947
19100
  }
18948
19101
  ]
@@ -18955,7 +19108,7 @@
18955
19108
  "type": "code",
18956
19109
  "language": "console",
18957
19110
  "value": [
18958
- " ",
19111
+ "",
18959
19112
  " $ x=1 5 5 6 8 8 9",
18960
19113
  " $ print denseRank(x)",
18961
19114
  " [0,1,1,2,3,3,4]",
@@ -18964,21 +19117,21 @@
18964
19117
  " $ print denseRank(y, ascending=false)",
18965
19118
  " [0,2,2,1]",
18966
19119
  " $ m = matrix(1 2 2 NULL, 0 0 0 1, 0 0 NULL 2)",
18967
- " $ denseRank(m, ignoreNA=false) ",
19120
+ " $ denseRank(m, ignoreNA=false)",
18968
19121
  ""
18969
19122
  ]
18970
19123
  },
18971
19124
  {
18972
19125
  "type": "text",
18973
19126
  "value": [
18974
- "== == == ",
19127
+ "== == ==",
18975
19128
  "#0 #1 #2",
18976
- "== == == ",
19129
+ "== == ==",
18977
19130
  "1 0 1",
18978
19131
  "2 0 1",
18979
19132
  "2 0 0",
18980
19133
  "0 1 2",
18981
- "== == == ",
19134
+ "== == ==",
18982
19135
  ""
18983
19136
  ]
18984
19137
  },
@@ -18986,7 +19139,7 @@
18986
19139
  "type": "code",
18987
19140
  "language": "console",
18988
19141
  "value": [
18989
- " ",
19142
+ "",
18990
19143
  " $ t=table(`A`A`B`C`B`B`A`C`C as id,[4,1,NULL,1,2,4,5,0,-1] as val)",
18991
19144
  " $ select id,val, denseRank(val) from t context by id",
18992
19145
  ""
@@ -19001,12 +19154,12 @@
19001
19154
  "A 4 1",
19002
19155
  "A 1 0",
19003
19156
  "A 5 2",
19004
- "B ",
19157
+ "B",
19005
19158
  "B 2 0",
19006
19159
  "B 4 1",
19007
19160
  "C 1 2",
19008
19161
  "C 0 1",
19009
- "C \\(1) 0",
19162
+ "C -1 0",
19010
19163
  "======== ======== =============",
19011
19164
  "",
19012
19165
  "Related function: :doc:`../r/rowDenseRank`"
@@ -20999,7 +21152,7 @@
20999
21152
  {
21000
21153
  "type": "text",
21001
21154
  "value": [
21002
- "dropFunctionView(udfs)"
21155
+ "dropFunctionView(name)"
21003
21156
  ]
21004
21157
  }
21005
21158
  ]
@@ -21011,7 +21164,7 @@
21011
21164
  {
21012
21165
  "type": "text",
21013
21166
  "value": [
21014
- "`udfs` is either a user defined function or a tuple containing multiple user defined functions."
21167
+ "`name` is a string scalar indicating the name of user defined function."
21015
21168
  ]
21016
21169
  }
21017
21170
  ]
@@ -21025,9 +21178,7 @@
21025
21178
  "value": [
21026
21179
  "Delete a function view.",
21027
21180
  "",
21028
- "Make the functions that are specified by :doc:`../a/addFunctionView` as ineligible values for the parameter objs if the parameter accessType is set to VIEW_EXEC in command :doc:`../g/grant`, :doc:`../d/deny`, or :doc:`../r/revoke`.",
21029
- "",
21030
- "It can only be executed by administrators on the controller node. ",
21181
+ "It can only be executed by an administrator. ",
21031
21182
  "",
21032
21183
  ".. meta:: ",
21033
21184
  " :keywords: drop, Function, view"
@@ -24020,7 +24171,7 @@
24020
24171
  {
24021
24172
  "type": "text",
24022
24173
  "value": [
24023
- "existsPartition(path)"
24174
+ "existsPartition(path, [tableName])"
24024
24175
  ]
24025
24176
  }
24026
24177
  ]
@@ -24032,7 +24183,13 @@
24032
24183
  {
24033
24184
  "type": "text",
24034
24185
  "value": [
24035
- "`path` is a string indicating the path of a partition folder."
24186
+ "`path` is a string indicating the path of a partition folder.",
24187
+ "",
24188
+ "`tableName` is a string indicating the table name. If *chunkGranularity* is set to \"DATABASE\" when creating the database, *tableName* is not required. If *chunkGranularity* is set to \"TABLE\":",
24189
+ "",
24190
+ "- If the parameter path contains the physical index of the table (which can be retrieved with the function ``listTables``), *tableName* is not required.",
24191
+ "",
24192
+ "- Otherwise, *tableName* must be specified."
24036
24193
  ]
24037
24194
  }
24038
24195
  ]
@@ -24053,11 +24210,18 @@
24053
24210
  "title": "Examples",
24054
24211
  "type": "example",
24055
24212
  "children": [
24213
+ {
24214
+ "type": "text",
24215
+ "value": [
24216
+ "Check if the specified partition exists. The following scripts must be executed on a data node or compute node.",
24217
+ ""
24218
+ ]
24219
+ },
24056
24220
  {
24057
24221
  "type": "code",
24058
24222
  "language": "console",
24059
24223
  "value": [
24060
- "",
24224
+ " ",
24061
24225
  " $ n=1000000",
24062
24226
  " $ ID=rand(10, n)",
24063
24227
  " $ dates=2017.08.07..2017.08.11",
@@ -24069,21 +24233,18 @@
24069
24233
  " $ pt = db.createPartitionedTable(t, `pt, `date);",
24070
24234
  " $ pt.append!(t);",
24071
24235
  "",
24072
- " $ existsPartition(\"C:/DolphinDB/Data/valueDB/20170807\");",
24073
- " 1",
24074
- "",
24075
- " $ existsPartition(\"C:/DolphinDB/Data/valueDB\");",
24076
- " 0",
24077
- "",
24078
- " $ existsPartition(\"C:/DolphinDB/Data\");",
24079
- " 0",
24236
+ " $ listTables(\"dfs://valueDB\")",
24080
24237
  ""
24081
24238
  ]
24082
24239
  },
24083
24240
  {
24084
24241
  "type": "text",
24085
24242
  "value": [
24086
- "To check if a DFS database partition exists:",
24243
+ "+----------+--------------+",
24244
+ "|tableName |physicalIndex |",
24245
+ "+==========+==============+",
24246
+ "|pt |s |",
24247
+ "+----------+--------------+",
24087
24248
  ""
24088
24249
  ]
24089
24250
  },
@@ -24091,26 +24252,31 @@
24091
24252
  "type": "code",
24092
24253
  "language": "console",
24093
24254
  "value": [
24094
- " ",
24095
- " $ n=1000000",
24096
- " $ ID=rand(10, n)",
24097
- " $ dates=2017.08.07..2017.08.11",
24098
- " $ date=rand(dates, n)",
24099
- " $ x=rand(10.0, n)",
24100
- " $ t=table(ID, date, x)",
24101
24255
  "",
24102
- " $ db = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)",
24103
- " $ pt = db.createPartitionedTable(t, `pt, `date);",
24104
- " $ pt.append!(t);",
24256
+ " $ existsPartition(\"dfs://valueDB/20170807/s\");",
24257
+ " true",
24258
+ "",
24259
+ " //When the chunk granularity of the database is at TABLE level and the parameter path doesn't contain table physicalIndex, the parameter tableName must be specified or the partition cannot be found.",
24260
+ "",
24261
+ " $ existsPartition(\"dfs://valueDB/20170807\", `pt) ",
24262
+ " true",
24105
24263
  "",
24106
24264
  " $ existsPartition(\"dfs://valueDB/20170807\");",
24107
- " 1",
24265
+ " false",
24108
24266
  "",
24109
24267
  " $ existsPartition(\"dfs://valueDB\");",
24110
- " 0",
24268
+ " false",
24111
24269
  "",
24112
- " $ existsPartition(\"dfs://valueDB/20170807/pt\");",
24113
- " 0"
24270
+ " $ existsPartition(\"dfs://valueDB/20170807/s/pt\");",
24271
+ " false",
24272
+ ""
24273
+ ]
24274
+ },
24275
+ {
24276
+ "type": "text",
24277
+ "value": [
24278
+ ".. meta:: ",
24279
+ " :keywords: exist"
24114
24280
  ]
24115
24281
  }
24116
24282
  ]
@@ -27311,6 +27477,84 @@
27311
27477
  }
27312
27478
  ]
27313
27479
  },
27480
+ "getCacheEngineStat": {
27481
+ "title": "getCacheEngineStat",
27482
+ "type": "function",
27483
+ "children": [
27484
+ {
27485
+ "title": "Syntax",
27486
+ "type": "grammer",
27487
+ "children": [
27488
+ {
27489
+ "type": "text",
27490
+ "value": [
27491
+ "getCacheEngineStat()"
27492
+ ]
27493
+ }
27494
+ ]
27495
+ },
27496
+ {
27497
+ "title": "Arguments",
27498
+ "type": "parameters",
27499
+ "children": [
27500
+ {
27501
+ "type": "text",
27502
+ "value": [
27503
+ "None"
27504
+ ]
27505
+ }
27506
+ ]
27507
+ },
27508
+ {
27509
+ "title": "Details",
27510
+ "type": "detail",
27511
+ "children": [
27512
+ {
27513
+ "type": "text",
27514
+ "value": [
27515
+ "Get the status of the OLAP cache engine on the current node. The function can only be called on the data node.",
27516
+ "",
27517
+ "Return a table containing the following columns:",
27518
+ "",
27519
+ "- chunkId: the chunk ID",
27520
+ "- physicalName: the physical name of the table to which the chunk belongs",
27521
+ "- timeSinceLastWrite: the time elapsed (in milliseconds) since last write",
27522
+ "- cachedRowsOfCompletedTxn: the number of cached records of completed transactions",
27523
+ "- cachedRowsOfUncompletedTxn: the number of cached records of uncompleted transactions. Note: For each chunk, only the last transaction may not have been completed.",
27524
+ "- cachedMemOfCompletedTxn: the memory usage (in Bytes) of completed transactions",
27525
+ "- cachedMemOfUncompletedTxn: the memory usage (in Bytes) of uncompleted transactions",
27526
+ "- cachedTids: list of transaction IDs (tid)"
27527
+ ]
27528
+ }
27529
+ ]
27530
+ },
27531
+ {
27532
+ "title": "Examples",
27533
+ "type": "example",
27534
+ "children": [
27535
+ {
27536
+ "type": "code",
27537
+ "language": "console",
27538
+ "value": [
27539
+ "",
27540
+ " $ getCacheEngineStat()",
27541
+ ""
27542
+ ]
27543
+ },
27544
+ {
27545
+ "type": "text",
27546
+ "value": [
27547
+ "======================================== ============= =================== ========================== =========================== ======================== =========================== ==============",
27548
+ "chunkId physicalName timeSinceLastWrite cachedRowsOfCompletedTxn cachedRowsOfUncompletedTxn cachedMemOfCompletedTxn cachedMemOfUncompletedTxn cachedTids",
27549
+ "======================================== ============= =================== ========================== =========================== ======================== =========================== ==============",
27550
+ "e4558d3c-fa41-52b5-418b-94e26cb70a75 pt_2 1056 222,386 0 3,558,176 0 2052",
27551
+ "======================================== ============= =================== ========================== =========================== ======================== =========================== =============="
27552
+ ]
27553
+ }
27554
+ ]
27555
+ }
27556
+ ]
27557
+ },
27314
27558
  "getChunkPath": {
27315
27559
  "title": "getChunkPath",
27316
27560
  "type": "function",
@@ -27506,7 +27750,32 @@
27506
27750
  {
27507
27751
  "type": "text",
27508
27752
  "value": [
27509
- "It can be executed only on a controller. Return metadata about all database chunks (file chunks and tablet chunks)."
27753
+ "Return the metadata about all database chunks (file chunks and tablet chunks) on the data nodes in a cluster. It can be executed only on a controller. ",
27754
+ "",
27755
+ "Return a table containing the following columns:",
27756
+ "",
27757
+ "- chunkId: the chunk ID",
27758
+ "- file: the chunk path",
27759
+ "- size: The disk space occupied by the file chunk (in Bytes). Return 0 for a tablet chunk. Use ``getTabletsMeta`` to check the disk usage of a tablet chunk.",
27760
+ "- version: version number",
27761
+ "- vcLength: length of the version chain",
27762
+ "- versionChain: the version chain",
27763
+ "- state: the status of the chunk. It can be ",
27764
+ "",
27765
+ " - CONSTRUCTING: in transaction;",
27766
+ " - RECOVERING: recovering;",
27767
+ " - COMPLETE: transaction completed",
27768
+ "",
27769
+ "- replicas: distribution of replicas",
27770
+ "- replicaCount: the number of replicas",
27771
+ "- lastUpdated: the timestamp of the latest update",
27772
+ "- permission: the chunk permission. It can be READ_ONLY and READ_WRITE (default). Chunks that are being transferred or stored in S3 are READ_ONLY.",
27773
+ "",
27774
+ "For READ_ONLY chunks:",
27775
+ "",
27776
+ "\\(1) Data cannot be appended or updated. Only drop operations can be performed to delete records. Transaction is supported in the READ_ONLY chunks (except for those stored in S3).",
27777
+ "",
27778
+ "\\(2) Operations such as recovery, rebalance and TSDB level file compaction cannot be performed."
27510
27779
  ]
27511
27780
  }
27512
27781
  ]
@@ -27519,7 +27788,7 @@
27519
27788
  "type": "code",
27520
27789
  "language": "console",
27521
27790
  "value": [
27522
- " ",
27791
+ "",
27523
27792
  " $ rpc(getControllerAlias(), getClusterChunksStatus);",
27524
27793
  ""
27525
27794
  ]
@@ -27527,22 +27796,16 @@
27527
27796
  {
27528
27797
  "type": "text",
27529
27798
  "value": [
27530
- "=================== =============== ==== ======= ======== ============ ======== ============= ============",
27531
- "chunkId file size version VCLength VersionChain state replicas replicaCount",
27532
- "=================== =============== ==== ======= ======== ============ ======== ============= ============",
27533
- "5644dd9c-02da-60... /testDB/8_11 0 1 1 12:0:1 -> COMPLETE local8848:1:0 1",
27534
- "2bbf9030-76eb-1f... /testDB/4_8 0 1 1 12:0:1 -> COMPLETE local8848:1:0 1",
27535
- "e9a42401-11c0-49... /testDB/pt.tbl 45 1 1 11:45:1 -> COMPLETE local8848:1:0 1",
27536
- "ea6e43e5-a857-d4... /db1/pt.tbl 54 1 1 2:54:1 -> COMPLETE local8848:1:0 1",
27537
- "2be2bd58-0f6c-ac... /testDB/1_4 0 1 1 12:0:1 -> COMPLETE local8848:1:0 1",
27538
- "83e28b30-e836-c4... /db1/20120102 0 1 1 3:0:1 -> COMPLETE local8848:1:0 1",
27539
- "ce3d5e78-3ca9-ec... /db1/20120101 0 1 1 3:0:1 -> COMPLETE local8848:1:0 1",
27540
- "ee31c878-347a-44... /db1/domain 59 1 1 1:59:1 -> COMPLETE local8848:1:0 1",
27541
- "df7299c4-bbe5-72... /db1/20120103 0 1 1 3:0:1 -> COMPLETE local8848:1:0 1",
27542
- "24b55425-9dfd-71... /testDB/domain 55 1 1 10:55:1 -> COMPLETE local8848:1:0 1",
27543
- "091db33a-0bfa-1a... /db1/20120104 0 1 1 3:0:1 -> COMPLETE local8848:1:0 1",
27544
- "e6635a2b-53c9-37... /db1/20120105 0 1 1 3:0:1 -> COMPLETE local8848:1:0 1",
27545
- "=================== =============== ==== ======= ======== ============ ======== ============= ============",
27799
+ "=================== =============== ==== ======= ======== =================== ======== ==================== ============== ======================== ===========",
27800
+ "chunkId file size version vcLength versionChain state replicas replicaCount lastUpdated permission",
27801
+ "=================== =============== ==== ======= ======== =================== ======== ==================== ============== ======================== ===========",
27802
+ "092d5e12-e595-6f... /testDB/pt2.tbl 49 1 1 2052:49:1 -> COMPLETE P1-node1:1:0,P2-... 2 2022.03.31T18:09:41.138 READ_WRITE",
27803
+ "42936e31-8be0-fa... /testDB/9/i 0 2 2 2053:0:2 -> 2051... COMPLETE P3-node1:2:0,P1-... 2 2022.03.31T18:09:41.138 READ_WRITE",
27804
+ "d31e6b47-18f0-37... /testDB/7/i 0 2 2 2053:0:2 -> 2051... COMPLETE P1-node1:2:0,P2-... 2 2022.03.31T18:09:41.138 READ_WRITE",
27805
+ "647a5fd6-cd85-3b... /testDB/6/i 0 2 2 2053:0:2 -> 2051... COMPLETE P1-node1:2:0,P3-... 2 2022.03.31T18:09:41.138 READ_WRITE",
27806
+ "8bec6445-bc6d-36... /testDB/5/i 0 2 2 2053:0:2 -> 2051... COMPLETE P2-node1:2:0,P3-... 2 2022.03.31T18:09:41.138 READ_WRITE",
27807
+ "ca690ba5-be73-a6... /testDB/4/i 0 2 2 2053:0:2 -> 2051... COMPLETE P3-node1:2:0,P1-... 2 2022.03.31T18:09:41.138 READ_WRITE",
27808
+ "=================== =============== ==== ======= ======== =================== ======== ==================== ============== ======================== ===========",
27546
27809
  "",
27547
27810
  ".. meta:: ",
27548
27811
  " :keywords: get"
@@ -27719,7 +27982,42 @@
27719
27982
  " $ rpc(getControllerAlias(), getClusterPerf).keys()",
27720
27983
  " [\"host\",\"port\",\"site\",\"mode\",\"state\",\"agentSite\",\"maxConnections\",\"maxMemSize\",\"workerNum\",\"executorNum\",\"connectionNum\",\"name\",\"memoryUsed\",\"memoryAlloc\",\"cpuUsage\",\"avgLoad\",\"medLast10QueryTime\",\"maxLast10QueryTime\",\"medLast100QueryTime\",\"maxLast100QueryTime\",\"maxRunningQueryTime\",\"runningJobs\",\"queuedJobs\",\"runningTasks\",\"queuedTasks\",\"jobLoad\",\"diskCapacity\",\"diskFreeSpace\",\"diskFreeSpaceRatio\",\"diskWriteRate\",\"diskReadRate\",\"lastMinuteWriteVolume\",\"lastMinuteReadVolume\",\"networkSendRate\",\"networkRecvRate\",\"lastMinuteNetworkSend\",\"lastMinuteNetworkRecv\",\"publicName\",\"lastMsgLatency\",\"cumMsgLatency\"]",
27721
27984
  "",
27985
+ ""
27986
+ ]
27987
+ },
27988
+ {
27989
+ "type": "text",
27990
+ "value": [
27991
+ "Execute in a high-availability cluster:",
27722
27992
  "",
27993
+ ""
27994
+ ]
27995
+ },
27996
+ {
27997
+ "type": "code",
27998
+ "language": "console",
27999
+ "value": [
28000
+ "",
28001
+ " $ rpc(getControllerAlias(true), getClusterPerf)",
28002
+ ""
28003
+ ]
28004
+ },
28005
+ {
28006
+ "type": "text",
28007
+ "value": [
28008
+ "=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
28009
+ "host port site mode state agentSite maxConnections maxMemSize workerNum executorNum connectionNum name memoryUsed memoryAlloc cpuUsage avgLoad medLast10QueryTime maxLast10QueryTime medLast100QueryTime maxLast100QueryTime maxRunningQueryTime runningJobs queuedJobs runningTasks queuedTasks jobLoad diskCapacity diskFreeSpace diskFreeSpaceRatio diskWriteRate diskReadRate lastMinuteWriteVolume lastMinuteReadVolume networkSendRate networkRecvRate lastMinuteNetworkSend lastMinuteNetworkRecv publicName lastMsgLatency cumMsgLatency isLeader",
28010
+ "=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
28011
+ "192.168.100.10 17,000 192.168.100.10:17000:master3 2 1 512 16 64 3 1 master3 23,449,272 24,133,632 0.7788 0.0037 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,658 2,736 102,468 59,193 78,351 8,012,182 2,378,846 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0 false",
28012
+ "192.168.100.11 17,000 192.168.100.11:17000:master2 2 1 512 16 64 3 2 master2 23,527,872 24,133,632 11.5625 0.3219 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,670 2,785 116,733 62,402 56,160 1,366,293 1,398,238 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0 false",
28013
+ "192.168.100.12 17,000 192.168.100.12:17000:master1 2 1 512 16 64 3 20 master1 25,002,792 46,538,752 14.0406 0.1136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,671 13,546,528 19,964,606 53,206 56,891 22,543,771 8,226,278 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0 true",
28014
+ "192.168.100.12 17,102 192.168.100.12:17102:server19-datanode1 0 1 192.168.100.12:17101:server19-agent1 254 120 5 31 1 server19-datanode1 23,118,960 24,133,632 13.928 0.1136 0 0 0 0 0 0 0 0 0 0 17,790,585,659,392 16,826,060,464,128 0.9458 0 4,687 1,289 23,477 44,197 55,104 352,258 6,163,159 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0 ",
28015
+ "192.168.100.11 17,102 192.168.100.11:17102:server18-datanode1 0 1 192.168.100.11:17101:server18-agent1 254 120 5 31 1 server18-datanode1 23,111,912 24,133,632 14.1066 0.3219 0 0 0 0 0 0 0 0 0 0 17,790,585,659,392 16,714,392,956,928 0.9395 0 4,698 1,989 23,530 40,896 50,706 243,008 250,727 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0 ",
28016
+ "192.168.100.11 17,101 192.168.100.11:17101:server18-agent1 1 1 192.168.100.11:17101:server18-agent1 304 4 4 63 0 server18-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0",
28017
+ "192.168.100.10 17,102 192.168.100.10:17102:server17-datanode1 0 1 192.168.100.10:17101:server17-agent1 254 120 5 31 1 server17-datanode1 40,872,496 52,445,184 0.7788 0.0037 0 0 0 0 0 0 0 0 0 0 53,783,736,754,176 50,336,934,432,768 0.9359 0 4,699 13,900,218 18,835 118,935 109,862 6,170,512 408,018 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0",
28018
+ "192.168.100.12 17,101 192.168.100.12:17101:server19-agent1 1 1 192.168.100.12:17101:server19-agent1 304 4 4 63 0 server19-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0",
28019
+ "192.168.100.10 17,101 192.168.100.10:17101:server17-agent1 1 1 192.168.100.10:17101:server17-agent1 304 4 4 63 0 server17-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0",
28020
+ "=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
27723
28021
  " "
27724
28022
  ]
27725
28023
  }
@@ -30076,25 +30374,28 @@
30076
30374
  {
30077
30375
  "type": "text",
30078
30376
  "value": [
30079
- "Get the status of replica recovery tasks. This function can only be executed on a controller node.",
30080
- "The function returns a table containing the following columns:",
30377
+ "Get the status of recovery tasks. This function can only be executed on a controller.",
30378
+ "",
30379
+ "Return a table containing the following columns:",
30081
30380
  "",
30082
- "* TaskId: The job ID of the replica recovery task",
30083
- "* TaskType: The type of the recovery task. It can be “LoadRebalance” and “ChunkRecovery”.",
30381
+ "* TaskId: The job ID of the recovery task",
30382
+ "* TaskType: The type of the recovery task. It can be \"LoadRebalance\" and \"ChunkRecovery\".",
30084
30383
  "* ChunkId: The chunk ID",
30085
30384
  "* ChunkPath: The DFS path of the chunk",
30086
30385
  "* Source: The source node for data recovery",
30087
30386
  "* Dest: The destination node for data recovery",
30088
- "* Status: The status of the recovery task. It can be “Waiting”, “In-Progress”, or “Finish”.",
30387
+ "* Status: The status of the recovery task. It can be \"Waiting\", \"In-Progress\", and \"Finish/Abort\".",
30089
30388
  "* AttemptCount: The number of recovery attempts that have been made",
30090
- "* DeleteSource: Whether to delete the related data on the source node. When TaskType is “ChunkRecovery”, it is false. When TaskType is “LoadRebalance”, it can be true or false.",
30091
- "* StartTime: The time when the recovery task is created",
30092
- "* LastDequeueTime: The last time when the recovery task is dequeued",
30093
- "* LastStartTime: The last time when the recovery task started",
30094
- "* FinishTime: The time when the recovery task was finished",
30095
- "* IsIncrementalRecovery: Whether incremental replication is enabled",
30096
- "* IsAsyncRecovery: Whether asynchronous replication is enabled",
30097
- "* ChangeFromIncrementalToFull: Whether incremental replication has been changed to full replication"
30389
+ "* DeleteSource: Whether to delete the replica on the source node. When TaskType is \"ChunkRecovery\", it is false. When TaskType is \"LoadRebalance\", it can be true or false.",
30390
+ "* StartTime: The time when the recovery task is created.",
30391
+ "* LastDequeueTime: The last time when the recovery task is dequeued.",
30392
+ "* LastStartTime: The last time when the recovery task started.",
30393
+ "* FinishTime: The time when the recovery task was finished.",
30394
+ "* IsIncrementalRecovery: Whether incremental replication is enabled.",
30395
+ "* IsAsyncRecovery: Whether asynchronous replication is enabled.",
30396
+ "* ChangeFromIncrementalToFull: Whether incremental replication has been changed to full replication. The recovery will be automatically changed to full recovery after multiple attempts for incremental recovery fail.",
30397
+ "* ChangeToSyncTime: The time when the online recovery is changed from asynchronous to synchronous.",
30398
+ "* FailureReason: The reason for the failure of the recovery tasks."
30098
30399
  ]
30099
30400
  }
30100
30401
  ]
@@ -30168,6 +30469,84 @@
30168
30469
  }
30169
30470
  ]
30170
30471
  },
30472
+ "getRedoLogGCStat": {
30473
+ "title": "getRedoLogGCStat",
30474
+ "type": "function",
30475
+ "children": [
30476
+ {
30477
+ "title": "Syntax",
30478
+ "type": "grammer",
30479
+ "children": [
30480
+ {
30481
+ "type": "text",
30482
+ "value": [
30483
+ "getRedoLogGCStat()"
30484
+ ]
30485
+ }
30486
+ ]
30487
+ },
30488
+ {
30489
+ "title": "Arguments",
30490
+ "type": "parameters",
30491
+ "children": [
30492
+ {
30493
+ "type": "text",
30494
+ "value": [
30495
+ "None"
30496
+ ]
30497
+ }
30498
+ ]
30499
+ },
30500
+ {
30501
+ "title": "Details",
30502
+ "type": "detail",
30503
+ "children": [
30504
+ {
30505
+ "type": "text",
30506
+ "value": [
30507
+ "Get the status of garbage collection of the redo log. Return a table containing the following columns:",
30508
+ "",
30509
+ "- physicalName: physical name of the table in the format of \"/<databaseName>/<physicalName>\"",
30510
+ "- txnCount: the number of transactions that have not been garbage-collected",
30511
+ "- numOfTxnPendingGC: the number of transactions that can be garbage-collected",
30512
+ "- minTidPendingGC: the minimum tid (transaction ID) of the transactions that can be garbage-collected",
30513
+ "- numOfTxnPendingFlush: the number of transactions that can be flushed to disk from the cache engine",
30514
+ "- minTidPendingFlush: the minimum tid of the transactions that can be flushed to disk from the cache engine"
30515
+ ]
30516
+ }
30517
+ ]
30518
+ },
30519
+ {
30520
+ "title": "Examples",
30521
+ "type": "example",
30522
+ "children": [
30523
+ {
30524
+ "type": "code",
30525
+ "language": "console",
30526
+ "value": [
30527
+ "",
30528
+ " getRedoLogGCStat()",
30529
+ ""
30530
+ ]
30531
+ },
30532
+ {
30533
+ "type": "text",
30534
+ "value": [
30535
+ "============== ============ ==================== ================== ===================== ====================",
30536
+ "physicalName txnCount numOfTxnPendingGC minTidPendingGC numOfTxnPendingFlush minTidPendingFlush",
30537
+ "============== ============ ==================== ================== ===================== ====================",
30538
+ "/test/pt_2 2 0 2 1031",
30539
+ "/listdb/pt_2 1 1 1033 0",
30540
+ "============== ============ ==================== ================== ===================== ====================",
30541
+ "",
30542
+ ".. meta:: ",
30543
+ " :keywords: get"
30544
+ ]
30545
+ }
30546
+ ]
30547
+ }
30548
+ ]
30549
+ },
30171
30550
  "getRightStream": {
30172
30551
  "title": "getRightStream",
30173
30552
  "type": "function",
@@ -31274,6 +31653,7 @@
31274
31653
  "value": [
31275
31654
  " $ getStreamingStat().pubConns;",
31276
31655
  " $ getStreamingStat().subConns;",
31656
+ " $ getStreamingStat().pubTables; ",
31277
31657
  " $ getStreamingStat().persistWorkers;",
31278
31658
  " $ getStreamingStat().subWorkers;",
31279
31659
  "",
@@ -31366,6 +31746,109 @@
31366
31746
  }
31367
31747
  ]
31368
31748
  },
31749
+ "getSupportBundle": {
31750
+ "title": "getSupportBundle",
31751
+ "type": "function",
31752
+ "children": [
31753
+ {
31754
+ "title": "Syntax",
31755
+ "type": "grammer",
31756
+ "children": [
31757
+ {
31758
+ "type": "text",
31759
+ "value": [
31760
+ "getSupportBundle([dir])"
31761
+ ]
31762
+ }
31763
+ ]
31764
+ },
31765
+ {
31766
+ "title": "Arguments",
31767
+ "type": "parameters",
31768
+ "children": [
31769
+ {
31770
+ "type": "text",
31771
+ "value": [
31772
+ "`dir` the directory to store the support bundle. It is an optional parameter. The default path is <HomeDir> (which can be obtained with :doc:`getHomeDir`) for a standalone mode, and the sibling directory of <HomeDir> for a cluster mode. "
31773
+ ]
31774
+ }
31775
+ ]
31776
+ },
31777
+ {
31778
+ "title": "Details",
31779
+ "type": "detail",
31780
+ "children": [
31781
+ {
31782
+ "type": "text",
31783
+ "value": [
31784
+ "Generate a file of support bundle containing all configuration information and return the file path. The function can only be called on a data node or compute node.",
31785
+ "",
31786
+ "The file contains the following information:",
31787
+ "",
31788
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31789
+ "| Block | Description | Info Source |",
31790
+ "+======================+================================================================================+=========================================+",
31791
+ "| VERSION | the server version | ``version()`` |",
31792
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31793
+ "| CONFIGS | the configuration information. Return the configuration information for a | standalone mode: dolphindb.cfg |",
31794
+ "| | cluster | cluster mode: cluster.cfg, |",
31795
+ "| | | cluster.nodes, controller.cfg |",
31796
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31797
+ "| DB AND TABLE SCHEMA | the schema of each database and table | ``schema`` |",
31798
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31799
+ "| LICENSE AND MACHINE | license, CPU cores and memory usage | license: Dolphindb.lic |",
31800
+ "| INFO | | |",
31801
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31802
+ "| OLAP CACHE ENGINE | The status of OLAP cache engine on the current node and the memory usage of | ``pnodeRun(getCacheEngineMemSize)`` |",
31803
+ "| STATUS | each node | ``pnodeRun(getOLAPCacheEngineStat)`` |",
31804
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31805
+ "| TSDB META | the metadata of all chunks in the TSDB database | ``pnodeRun(getTSDBMetaData)`` |",
31806
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31807
+ "| REDO LOG GC STATUS | the redo log status | ``pnodeRun(getRedoLogGCStat)`` |",
31808
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31809
+ "| TRANSACTION STATUS | the transaction status | ``pnodeRun(getTransactionStatus)`` |",
31810
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31811
+ "| TABLETS META | the metadata of the 100 chunks in the cluster with the most rows | select top 100 \\* from pnodeRun(getTabl |",
31812
+ "| | | etsMeta{\"%\",\"%\",false,-1}) order by |",
31813
+ "| | | rowNum desc |",
31814
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31815
+ "| ANOMALOUS CHUNK | the status of anomalous chunks. Anomaly means chunks in recovery, with | ``getClusterChunksStatus()`` |",
31816
+ "| STATUS | different version or replica counts. | |",
31817
+ "+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
31818
+ ""
31819
+ ]
31820
+ }
31821
+ ]
31822
+ },
31823
+ {
31824
+ "title": "Examples",
31825
+ "type": "example",
31826
+ "children": [
31827
+ {
31828
+ "type": "code",
31829
+ "language": "console",
31830
+ "value": [
31831
+ "",
31832
+ " $ getSupportBundle()",
31833
+ " /home/dolphindb/server/getSupportBundle.1655869793424",
31834
+ "",
31835
+ " $ getSupportBundle(\"/home/dolphindb/sup\")",
31836
+ " /home/dolphindb/sup/getSupportBundle.1655869853178",
31837
+ "",
31838
+ ""
31839
+ ]
31840
+ },
31841
+ {
31842
+ "type": "text",
31843
+ "value": [
31844
+ ".. meta:: ",
31845
+ " :keywords: get"
31846
+ ]
31847
+ }
31848
+ ]
31849
+ }
31850
+ ]
31851
+ },
31369
31852
  "getSystemCpuUsage": {
31370
31853
  "title": "getSystemCpuUsage",
31371
31854
  "type": "function",
@@ -31919,6 +32402,85 @@
31919
32402
  }
31920
32403
  ]
31921
32404
  },
32405
+ "getTransactionStatus": {
32406
+ "title": "getTransactionStatus",
32407
+ "type": "function",
32408
+ "children": [
32409
+ {
32410
+ "title": "Syntax",
32411
+ "type": "grammer",
32412
+ "children": [
32413
+ {
32414
+ "type": "text",
32415
+ "value": [
32416
+ "getTransactionStatus()"
32417
+ ]
32418
+ }
32419
+ ]
32420
+ },
32421
+ {
32422
+ "title": "Arguments",
32423
+ "type": "parameters",
32424
+ "children": [
32425
+ {
32426
+ "type": "text",
32427
+ "value": [
32428
+ "None"
32429
+ ]
32430
+ }
32431
+ ]
32432
+ },
32433
+ {
32434
+ "title": "Details",
32435
+ "type": "detail",
32436
+ "children": [
32437
+ {
32438
+ "type": "text",
32439
+ "value": [
32440
+ "Get the status of transactions. Return a table containing the following columns:",
32441
+ "",
32442
+ "- tid: The transaction ID",
32443
+ "- startTime: The time when the transaction started",
32444
+ "- type: The type of operations involved in the transaction, including APPEND, DROP, SQLUPDATE, SQLUPSERT, SQLDELETE, FILEOPERATE, or UNKNOWN.",
32445
+ "- status: The transaction status. It can be BEGIN, COMMIT, COMPLETE, or ROLLBACK.",
32446
+ "- partitionCount: The number of partitions involved in the transaction",
32447
+ "- endTime: The time when the transaction ended",
32448
+ "- elapsedTime: The elapsed time of the transaction"
32449
+ ]
32450
+ }
32451
+ ]
32452
+ },
32453
+ {
32454
+ "title": "Examples",
32455
+ "type": "example",
32456
+ "children": [
32457
+ {
32458
+ "type": "code",
32459
+ "language": "console",
32460
+ "value": [
32461
+ "",
32462
+ " getTransactionStatus() ",
32463
+ ""
32464
+ ]
32465
+ },
32466
+ {
32467
+ "type": "text",
32468
+ "value": [
32469
+ "============= ========================== ======= ====== ============== ============================ ============",
32470
+ "tid startTime type status partitionCount endTime elapsedTime",
32471
+ "============= ========================== ======= ====== ============== ============================ ============",
32472
+ "3135 2022.06.07 16:19:48.477 APPEND BEGIN 4 584",
32473
+ "3143 2022.06.07 16:11:27.489 APPEND COMMIT 4 \t2022.06.07 16:11:33.100 484",
32474
+ "============= ========================== ======= ====== ============== ============================ ============",
32475
+ "",
32476
+ ".. meta:: ",
32477
+ " :keywords: get"
32478
+ ]
32479
+ }
32480
+ ]
32481
+ }
32482
+ ]
32483
+ },
31922
32484
  "getUserAccess": {
31923
32485
  "title": "getUserAccess",
31924
32486
  "type": "function",
@@ -61549,7 +62111,26 @@
61549
62111
  {
61550
62112
  "type": "text",
61551
62113
  "value": [
61552
- "replay(inputTables, outputTables, [dateColumn], [timeColumn], [replayRate], [absoluteRate=true], [parallelLevel=1])"
62114
+ "replay(inputTables, outputTables, [dateColumn], [timeColumn], [replayRate], [absoluteRate=true], [parallelLevel=1])",
62115
+ ""
62116
+ ]
62117
+ }
62118
+ ]
62119
+ },
62120
+ {
62121
+ "title": "Details",
62122
+ "type": "detail",
62123
+ "children": [
62124
+ {
62125
+ "type": "text",
62126
+ "value": [
62127
+ "Replay one or more tables or data sources to a table in chronological order to simulate real-time ingestion of streaming data. To replay historical data, use function :doc:`replayDS` to generate a data source as an input of replay.",
62128
+ "",
62129
+ "There are 3 mapping types between the *inputTables* and *outputTables*: one-to-one, N-to-one, and N-to-N. For N-to-one replay, before version 1.30.17 / 2.00.5, the schemata of the input tables must be the same, which is called homogeneous replay. Starting from version 1.30.17/2.00.5, replay supports inputting tables with different schemata in the format of a dictionary, which is called heterogeneous replay. In heterogeneous replay, the output table can be deserialized and data can be filtered and processed by ``streamFilter``. ",
62130
+ "",
62131
+ "Note: In N-to-one replay, if *inputTables* are data sources, the size of each data source and the time range of dateColumn must be consistent.",
62132
+ "",
62133
+ "To terminate the replay, use commands :doc:`../../CommandsReferences/c/cancelJob` or :doc:`../../CommandsReferences/c/cancelConsoleJob`. "
61553
62134
  ]
61554
62135
  }
61555
62136
  ]
@@ -61561,56 +62142,44 @@
61561
62142
  {
61562
62143
  "type": "text",
61563
62144
  "value": [
61564
- "`inputTables` is a table or a tuple. Each element of the tuple is an unpartitioned in-memory table or a data source generated by function :doc:`replayDS` .",
62145
+ "`inputTables` are non-partitioned in-memory tables or data sources generated by function :doc:`replayDS`. It is",
61565
62146
  "",
61566
- "`outputTables` is a table or a tuple of tables, or a string or a string vector. ",
61567
- "The length of `outputTables` must be the same as the length of `inputTables` . ",
61568
- "If it is a vector, it is a list of the names of the shared streaming tables where the replayed data of the corresponding tables of `inputTables` are saved. ",
61569
- "If it is a tuple, each element is a shared stream table where the replayed data of the corresponding table in `inputTables` are saved. ",
61570
- "The schema of each table in `outputTables` must be identical as the schema of the corresponding table in `inputTables` . ",
61571
- "If `outputTables` already exist, the replayed data is ingested into the tables; ",
61572
- "if `outputTables` do not exist, they are not generated automatically and must be created in advance. ",
62147
+ "- a scalar or tuple for one or more table objects or data sources with the same schema.",
62148
+ "- a dictionary for multiple table objects or data sources with different schemata. The key of the dictionary is a user-defined string indicating the unique identifier of the input table, and the value is the table object or data source.",
61573
62149
  "",
61574
- "`dateColumn` and `timeColumn` are strings indicating the date column and time column in `inputTables` . ",
61575
- "If dateColumn and(or) timeColumn are specified, data in the same date or in the same time is replayed in the same batch. ",
62150
+ "`outputTables` are in-memory tables or stream tables. If *outputTables* are shared tables, they can also be specified as sharedNames. ",
61576
62151
  "",
61577
- "`dateColumn` / `timeColumn` is a string scalar or a string vector with the same number of elements as `inputTables` (when `inputTables` is a tuple). ",
61578
- "If `dateColumn` / `timeColumn` is a string scalar, it means all the elements in `inputTables` share the same name of `dateColumn` / `timeColumn`; ",
61579
- "if `dateColumn` / `timeColumn` is a string vector, it indicates the `dateColumn` / `timeColumn` of each table in `inputTables` .",
61580
- "If there is only one temporal column in `inputTables` (most likely TIMESTAMP), we can use it for either `dateColumn` or `timeColumn`. ",
62152
+ "- In one-to-one replay or homogeneous replay: the *outputTables* is a table object or string scalar with the same schema of the input table.",
62153
+ "- In N-to-N replay: the *outputTables* is a string vector or tuple of table objects with the same length as that of *inputTables*. The *outputTables* and *inputTables* are mapped one-to-one, and each pair has the same schema.",
62154
+ "- In heterogeneous replay: the *outputTables* is a table containing at least three columns:",
61581
62155
  "",
61582
- "If `dateColumn` / `timeColumn` is a string vector, its elements can have different data types, but the data types must satisfy one of the following conditions:",
62156
+ " - The first column is of TIMESTAMP type indicating the timestamp specified by *dateColumn/timeColumn*;",
62157
+ " - The second column is of SYMBOL or STRING type indicating the key of the dictionary specified in the *inputTables*;",
62158
+ " - The third column must be of BLOB type that stores the serialized result of each replayed record.",
62159
+ " - In addition, you can output the columns with the same column names and data types in the input tables.",
61583
62160
  "",
61584
- " * None of them contains dates. The data types can be SECOND, TIME or NANOTIME.",
61585
- " * All of them contain dates. The data types can be DATETIME, TIMESTAMP or NANOTIMESTAMP.",
62161
+ "`dateColumn` / `timeColumn` is the column name of the temporal column. At least one of them must be specified. ",
61586
62162
  "",
61587
- "`replayRate` is an integer indicating the speed of replaying data.",
62163
+ "- In one-to-one replay or homogeneous replay: The time columns in the *inputTables* and *outputTables* must use the same name and the parameter is a string scalar.",
62164
+ "- In N-to-N replay: The time columns in the *inputTables* and *outputTables* use differentnames and the parameter is a string vector.",
62165
+ "- In N-to-one replay: The time columns in the *inputTables* and *outputTables* use different names and the parameter is a dictionary. The key of the dictionary is a user-defined string indicating the unique identifier of the input table, and the value is *dateColumn/timeColumn*.",
61588
62166
  "",
61589
- "`absoluteRate` is a Boolean value. The default value is true.",
62167
+ "If *dateColumn* and *timeColum* are specified as the same column or only one of them is specified, there is no restriction on the type of the specified temporal column.",
62168
+ "",
62169
+ "If *dateColumn* and *timeColum* are specified as different columns, *dateColumn* must be DATE and *timeColum* can only be SECOND, TIME or NANOTIME.",
62170
+ "",
62171
+ "`replayRate` is an integer. Together with the parameter *absoluteRate* it determines the speed of replaying data.",
61590
62172
  "",
61591
- "Regarding `replayRate` and `absoluteRate` :",
62173
+ "`absoluteRate` is a Boolean value. The default value is true.",
61592
62174
  "",
61593
- " * If `replayRate` is a positive integer and `absoluteRate` =true, replay at the speed of replayRate records per second.",
61594
- " * If `replayRate` is a positive integer and `absoluteRate` =false, replay at replayRate times the original speed of the data. For example, if the difference between the maximum and the minimum values of `dateColumn` or `timeColumn` is n seconds, then it takes n/replayRate seconds to finish the replay.",
61595
- " * If `replayRate` is unspecified or negative, replay at the maximum speed.",
62175
+ "- If *replayRate* is a positive integer and *absoluteRate* = true, replay the specified *replayRate* records per second. Assuming that the number of records of the *inputTables* is “total” (which takes the maximum number of records in a table when replaying multiple tables), then the elapsed time of replay is roughly equal to *total/replayRate* (in seconds).",
62176
+ "- If *replayRate* is a positive integer, and *absoluteRate* = false, replay at *replayRate* times the original speed of the data. For example, if the difference between the maximum and the minimum values of *dateColumn* or *timeColum* is n seconds and the number of records is s, then the system replays at the speed of *replayRate * s / n* records per second (at least 1 record per second), i.e., it takes *n/replayRate* seconds to finish the replay.",
62177
+ "- If *replayRate* is negative or unspecified, replay at the maximum speed. The elapsed time for replay is related to the performance of the DolphinDB server.",
61596
62178
  "",
62179
+ "The elapsed time of above replay modes is estimated based on homogeneous replay, whereas the elapsed time of heterogeneous replay will be slightly longer.",
61597
62180
  "",
61598
62181
  "`parallelLevel` is a positive integer indicating the number of threads loading data into memory from data sources simultaneously. ",
61599
- "The default value is 1. If `inputTables` is a tuple of tables, the effective `parallelLevel` is always 1. ",
61600
- ""
61601
- ]
61602
- }
61603
- ]
61604
- },
61605
- {
61606
- "title": "Details",
61607
- "type": "detail",
61608
- "children": [
61609
- {
61610
- "type": "text",
61611
- "value": [
61612
- "Ingest data from specified tables or data sources into streaming tables. The replayed data is sorted on `dateColumn` and `timeColumn` . ",
61613
- "To terminate the replay, use commands `cancelJob` or `cancelConsoleJob` . "
62182
+ "The default value is 1. If *inputTables* is not a data source, there is no need to specify."
61614
62183
  ]
61615
62184
  }
61616
62185
  ]
@@ -61792,7 +62361,62 @@
61792
62361
  " $ share streamTable(200:0,`sym`date`time`volume,[SYMBOL,DATE,TIME,INT]) as st3",
61793
62362
  " $ replay(inputTables=[ds1,ds2],outputTables=st3,dateColumn=`date,timeColumn=`time); //Replay both ds1 and ds2 to st3.",
61794
62363
  " $ select count(*) from st3",
61795
- " 2000000"
62364
+ " 2000000",
62365
+ "",
62366
+ "Ex 3. heterogeneous replay",
62367
+ ""
62368
+ ]
62369
+ },
62370
+ {
62371
+ "type": "code",
62372
+ "language": "console",
62373
+ "value": [
62374
+ ""
62375
+ ]
62376
+ },
62377
+ {
62378
+ "type": "text",
62379
+ "value": [
62380
+ " $ n=1000",
62381
+ " $ sym = take(take(`IBM,n).join(take(`GS,n)), n)",
62382
+ " $ myDate=take(2021.01.02..2021.01.06, n).sort!()",
62383
+ " $ myTime=take(09:30:00..15:59:59,n)",
62384
+ " $ vol = rand(100, n)",
62385
+ " $ t=table(sym,myDate,myTime,vol)",
62386
+ "",
62387
+ "",
62388
+ " $ n=1000",
62389
+ " $ sym = take(take(`IBM,n).join(take(`GS,n)), n)",
62390
+ " $ date=take(2021.01.02..2021.01.06, n).sort!()",
62391
+ " $ time=take(09:30:00..15:59:59,n)",
62392
+ " $ vol = rand(100, n)",
62393
+ " $ t1=table(sym, date,time,vol)",
62394
+ "",
62395
+ " $ if(existsDatabase(\"dfs://test_stock\")){",
62396
+ " $ dropDatabase(\"dfs://test_stock\")",
62397
+ " $ }",
62398
+ " $ db1=database(\"\",RANGE, 2021.01.01..2021.01.12)",
62399
+ " $ db2=database(\"\",VALUE,`IBM`GS)",
62400
+ " $ db=database(\"dfs://test_stock\",COMPO,[db1, db2])",
62401
+ " $ trades=db.createPartitionedTable(t,`trades,`myDate`sym)",
62402
+ " $ trades.append!(t);",
62403
+ " $ trades1=db.createPartitionedTable(t1,`trades1,`date`sym)",
62404
+ " $ trades1.append!(t1);",
62405
+ "",
62406
+ " //get the data source",
62407
+ "",
62408
+ " $ ds = replayDS(sqlObj=<select * from loadTable(db, `trades)>, dateColumn=`myDate, timeColumn=`myTime)",
62409
+ " $ ds.size();",
62410
+ "",
62411
+ " $ ds1 = replayDS(sqlObj=<select * from loadTable(db, `trades1)>, dateColumn=`date, timeColumn=`time)",
62412
+ " $ ds1.size();",
62413
+ "",
62414
+ " $ input_dict = dict([\"msg1\", \"msg2\"], [ds, ds1])",
62415
+ " $ date_dict = dict([\"msg1\", \"msg2\"], [`myDate, `date])",
62416
+ " $ time_dict = dict([\"msg1\", \"msg2\"], [`myTime, `time])",
62417
+ " $ opt = streamTable(100:0,`timestamp`sym`blob`vol, [DATETIME,SYMBOL, BLOB, INT])",
62418
+ " $ replay(inputTables=input_dict, outputTables=opt, dateColumn = date_dict, timeColumn=time_dict, replayRate=1000, absoluteRate=false);",
62419
+ " $ select top 10 * from opt;"
61796
62420
  ]
61797
62421
  }
61798
62422
  ]
@@ -61826,9 +62450,7 @@
61826
62450
  "",
61827
62451
  "`dateColumn` and `timeColumn` are strings indicating the names of date and time columns of the DFS table. A data source is generated for each day of dateColumn. If neither is specified, the first column of the table object is chosen as dateColumn. If dateColumn is specified, it must be one of the partitioning columns of the DFS table. If only timeColumn is specified, it must be one of the partitioning columns of the DFS table.",
61828
62452
  "",
61829
- "`timeRepartitionSchema` is a TIME or NANOTIME type vector. `timeRepartitionSchema` deliminates multiple data sources based on timeColumn within each date. For example, if ",
61830
- "",
61831
- "`timeRepartitionSchema` =[t1, t2], then there are 3 data sources within each day: [00:00:00.000,t1), [t1,t2), and [t2,23:59:59.999)."
62453
+ "`timeRepartitionSchema` is a TIME or NANOTIME type vector. `timeRepartitionSchema` deliminates multiple data sources based on timeColumn within each date. For example, if `timeRepartitionSchema` =[t1, t2], then there are 3 data sources within each day: [00:00:00.000,t1), [t1,t2), and [t2,23:59:59.999)."
61832
62454
  ]
61833
62455
  }
61834
62456
  ]
@@ -61998,7 +62620,7 @@
61998
62620
  {
61999
62621
  "type": "text",
62000
62622
  "value": [
62001
- "resample(X, rule, func)"
62623
+ "resample(X, rule, func, [closed], [label], [origin='start_day'])"
62002
62624
  ]
62003
62625
  }
62004
62626
  ]
@@ -62031,10 +62653,12 @@
62031
62653
  "\"QS\" quarterBegin",
62032
62654
  "\"BQ\" businessQuarterEnd",
62033
62655
  "\"BQS\" businessQuarterBegin",
62656
+ "\"REQ\" FY5253Quarter",
62034
62657
  "\"A\" yearEnd",
62035
62658
  "\"AS\" yearBegin",
62036
62659
  "\"BA\" businessYearEnd",
62037
62660
  "\"BAS\" businessYearBegin",
62661
+ "\"RE\" FY5253",
62038
62662
  "\"D\" date",
62039
62663
  "\"H\" hourOfDay",
62040
62664
  "\"min\" minuteOfHour",
@@ -62046,7 +62670,27 @@
62046
62670
  "",
62047
62671
  "The strings above can also be used with integers for parameter `rule` . For example, \"2M\" means month end every two months. ",
62048
62672
  "",
62049
- "`func` is an aggregate function. "
62673
+ "`func` is an aggregate function. ",
62674
+ "",
62675
+ "`closed` is a string indicating which boundary of the interval is closed.",
62676
+ "",
62677
+ "- The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.",
62678
+ "- The default is 'right' if *origin* is 'end' or 'end_day'.",
62679
+ "- For version 1.30.18/2.00.6, when the time precision of *rule* is less than day, only the default value can be used.",
62680
+ "",
62681
+ "`label` is a string indicating which boundary is used to label the interval.",
62682
+ "",
62683
+ "- The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.",
62684
+ "- The default is 'right' if *origin* is 'end' or 'end_day'.",
62685
+ "- For version 1.30.18/2.00.6, when the time precision of *rule* is less than day, only the default value can be used.",
62686
+ "",
62687
+ "`origin` is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start_day', 'end', 'end_day' or a user-defined time object. The default value is 'start_day'.",
62688
+ "",
62689
+ "- 'epoch': *origin* is 1970-01-01",
62690
+ "- 'start': *origin* is the first value of the timeseries",
62691
+ "- 'start_day': *origin* is 00:00 of the first day of the timeseries",
62692
+ "- 'end': *origin* is the last value of the timeseries",
62693
+ "- 'end_day': *origin* is 24:00 of the last day of the timeseries"
62050
62694
  ]
62051
62695
  }
62052
62696
  ]
@@ -62129,7 +62773,98 @@
62129
62773
  "|2000.07.31| | ",
62130
62774
  "+----------+----+",
62131
62775
  "|2000.09.30|8 |",
62132
- "+----------+----+"
62776
+ "+----------+----+",
62777
+ ""
62778
+ ]
62779
+ },
62780
+ {
62781
+ "type": "code",
62782
+ "language": "console",
62783
+ "value": [
62784
+ "",
62785
+ " $ index = temporalAdd(2022.01.01 00:00:00,1..8,`m)",
62786
+ " $ s = indexedSeries(index, 1..8)",
62787
+ " $ s.resample(rule=`3min, func=sum);",
62788
+ ""
62789
+ ]
62790
+ },
62791
+ {
62792
+ "type": "text",
62793
+ "value": [
62794
+ "=================== ====",
62795
+ "label\t col1",
62796
+ "=================== ====",
62797
+ "2022.01.01T00:00:00\t3",
62798
+ "2022.01.01T00:03:00\t12",
62799
+ "2022.01.01T00:06:00\t21 ",
62800
+ "=================== ====",
62801
+ ""
62802
+ ]
62803
+ },
62804
+ {
62805
+ "type": "code",
62806
+ "language": "console",
62807
+ "value": [
62808
+ "",
62809
+ " $ s.resample(rule=`3min, func=sum, closed=`right);",
62810
+ ""
62811
+ ]
62812
+ },
62813
+ {
62814
+ "type": "text",
62815
+ "value": [
62816
+ "=================== ====",
62817
+ "label\t col1",
62818
+ "=================== ====",
62819
+ "2022.01.01T00:00:00\t6",
62820
+ "2022.01.01T00:03:00\t15",
62821
+ "2022.01.01T00:06:00\t15",
62822
+ "=================== ====",
62823
+ ""
62824
+ ]
62825
+ },
62826
+ {
62827
+ "type": "code",
62828
+ "language": "console",
62829
+ "value": [
62830
+ "",
62831
+ " $ s.resample(rule=`3min, func=sum, closed=`right,origin=`end);",
62832
+ ""
62833
+ ]
62834
+ },
62835
+ {
62836
+ "type": "text",
62837
+ "value": [
62838
+ "=================== ====",
62839
+ "label\t col1",
62840
+ "=================== ====",
62841
+ "2022.01.01T00:02:00\t1",
62842
+ "2022.01.01T00:05:00\t9",
62843
+ "2022.01.01T00:08:00\t18",
62844
+ "2022.01.01T00:11:00\t8",
62845
+ "=================== ====",
62846
+ ""
62847
+ ]
62848
+ },
62849
+ {
62850
+ "type": "code",
62851
+ "language": "console",
62852
+ "value": [
62853
+ "",
62854
+ " $ s.resample(rule=`3min, func=sum,origin=2022.10.01 00:00:10)",
62855
+ ""
62856
+ ]
62857
+ },
62858
+ {
62859
+ "type": "text",
62860
+ "value": [
62861
+ "=================== ====",
62862
+ "label col1",
62863
+ "=================== ====",
62864
+ "2022.01.01T00:00:10\t6",
62865
+ "2022.01.01T00:03:10\t15",
62866
+ "2022.01.01T00:06:10\t15",
62867
+ "=================== ===="
62133
62868
  ]
62134
62869
  }
62135
62870
  ]
@@ -77868,7 +78603,7 @@
77868
78603
  {
77869
78604
  "type": "text",
77870
78605
  "value": [
77871
- "transFreq(X, rule)"
78606
+ "transFreq(X, rule, [closed], [label], [origin='start_day'])"
77872
78607
  ]
77873
78608
  }
77874
78609
  ]
@@ -77914,7 +78649,27 @@
77914
78649
  "\"N\" nanosecond",
77915
78650
  "=========================== =================================",
77916
78651
  "",
77917
- "The strings above can also be used with integers for parameter `rule`. For example, \"2M\" means month end every two months."
78652
+ "The strings above can also be used with integers for parameter `rule`. For example, \"2M\" means month end every two months.",
78653
+ "",
78654
+ "`closed` is a string indicating which boundary of the interval is closed.",
78655
+ "",
78656
+ "- The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.",
78657
+ "- The default is 'right' if *origin* is 'end' or 'end_day'.",
78658
+ "- For version 1.30.18/2.00.6, when the time precision of *rule* is less than day, only the default value can be used.",
78659
+ "",
78660
+ "`label` is a string indicating which boundary is used to label the interval.",
78661
+ "",
78662
+ "- The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.",
78663
+ "- The default is 'right' if *origin* is 'end' or 'end_day'.",
78664
+ "- For version 1.30.18/2.00.6, when the time precision of *rule* is less than day, only the default value can be used.",
78665
+ "",
78666
+ "`origin` is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start_day', 'end', 'end_day' or a user-defined time object. The default value is 'start_day'.",
78667
+ "",
78668
+ "- 'epoch': *origin* is 1970-01-01",
78669
+ "- 'start': *origin* is the first value of the timeseries",
78670
+ "- 'start_day': *origin* is 00:00 of the first day of the timeseries",
78671
+ "- 'end': *origin* is the last value of the timeseries",
78672
+ "- 'end_day': *origin* is 24:00 of the last day of the timeseries"
77918
78673
  ]
77919
78674
  }
77920
78675
  ]
@@ -77947,7 +78702,25 @@
77947
78702
  " [2020.09.30,2020.12.31]",
77948
78703
  "",
77949
78704
  " $ transFreq(2020.08.08 2020.11.18, \"2Q\");",
77950
- " [2020.09.30,2021.03.31]"
78705
+ " [2020.09.30,2021.03.31]",
78706
+ ""
78707
+ ]
78708
+ },
78709
+ {
78710
+ "type": "code",
78711
+ "language": "console",
78712
+ "value": [
78713
+ "",
78714
+ " $ s = temporalAdd(2022.01.01 00:00:00,1..8,`m);",
78715
+ "",
78716
+ " $ s.transFreq(rule=\"3min\");",
78717
+ " [2022.01.01T00:00:00,2022.01.01T00:00:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:06:00,2022.01.01T00:06:00,2022.01.01T00:06:00]",
78718
+ "",
78719
+ " $ s.transFreq(rule=`3min,closed=`right);",
78720
+ " [2022.01.01T00:00:00,2022.01.01T00:00:00,2022.01.01T00:00:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:06:00,2022.01.01T00:06:00]",
78721
+ " ",
78722
+ " $ s.transFreq(rule=`3min,closed=`right,origin=`end);",
78723
+ " [2021.12.31T23:59:00,2021.12.31T23:59:00,2022.01.01T00:02:00,2022.01.01T00:02:00,2022.01.01T00:02:00,2022.01.01T00:05:00,2022.01.01T00:05:00,2022.01.01T00:05:00]"
77951
78724
  ]
77952
78725
  }
77953
78726
  ]
@@ -78871,7 +79644,7 @@
78871
79644
  {
78872
79645
  "type": "text",
78873
79646
  "value": [
78874
- "Release variables or function definitions from the memory. Another way to release variables from the memory is to use \"= NULL\"."
79647
+ "Release variables or function definitions from the memory. You can also release a local variable (VAR) from the memory using \"= NULL\"."
78875
79648
  ]
78876
79649
  }
78877
79650
  ]