dolphindb 2.0.970 → 2.0.972
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/browser.js +50 -44
- package/browser.js.map +1 -1
- package/docs.en.json +341 -976
- package/docs.zh.json +71 -53
- package/index.js +50 -44
- package/index.js.map +1 -1
- package/package.json +9 -9
- package/test.js.map +1 -1
package/docs.en.json
CHANGED
|
@@ -2928,7 +2928,7 @@
|
|
|
2928
2928
|
"",
|
|
2929
2929
|
"`capacity` is is the amount of memory (in terms of the number of elements) allocated to the array. When the number of elements exceeds capacity, the system will first allocate memory of 1.2~2 times of capacity, copy the data to the new memory space, and release the original memory. ",
|
|
2930
2930
|
"",
|
|
2931
|
-
"`defaultValue` is the default value of the vector.
|
|
2931
|
+
"`defaultValue` is the default value of the vector. It must be a scalar. If defaultValue is not specified, it defaults to NULL for strings and symbols and 0 for other data types. "
|
|
2932
2932
|
]
|
|
2933
2933
|
}
|
|
2934
2934
|
]
|
|
@@ -12472,182 +12472,6 @@
|
|
|
12472
12472
|
}
|
|
12473
12473
|
]
|
|
12474
12474
|
},
|
|
12475
|
-
"createAnomalyDetectionEngine": {
|
|
12476
|
-
"title": "createAnomalyDetectionEngine",
|
|
12477
|
-
"type": "function",
|
|
12478
|
-
"children": [
|
|
12479
|
-
{
|
|
12480
|
-
"title": "Syntax",
|
|
12481
|
-
"type": "grammer",
|
|
12482
|
-
"children": [
|
|
12483
|
-
{
|
|
12484
|
-
"type": "text",
|
|
12485
|
-
"value": [
|
|
12486
|
-
"createAnomalyDetectionEngine(name, metrics, dummyTable, outputTable, timeColumn, [keyColumn], [windowSize], [step], [garbageSize], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup])"
|
|
12487
|
-
]
|
|
12488
|
-
}
|
|
12489
|
-
]
|
|
12490
|
-
},
|
|
12491
|
-
{
|
|
12492
|
-
"title": "Arguments",
|
|
12493
|
-
"type": "parameters",
|
|
12494
|
-
"children": [
|
|
12495
|
-
{
|
|
12496
|
-
"type": "text",
|
|
12497
|
-
"value": [
|
|
12498
|
-
"`name` is a string indicating the name of the aggregator. It is the only identifier of an aggregator. It can have letter, number and \"_\". It must start with a letter.",
|
|
12499
|
-
"",
|
|
12500
|
-
"`metrics` is metacode or tuple specifying the formula for anomaly detection. It uses functions or expressions such as <[sum(qty)>5, avg(qty)>qty, qty<4]> that indicate anomaly conditions and return Boolean values.",
|
|
12501
|
-
"",
|
|
12502
|
-
"`dummyTable` is a table object whose schema must be the same as the subscribed stream table. The system uses the schema of dummyTable to determine the data type of each column in the messages. Whether dummyTable contains data does not affect the aggregation result.",
|
|
12503
|
-
"",
|
|
12504
|
-
"`outputTable` is the output table of detected anomalies. The first column is of temporal data type and stores the time when an anomaly is detected. If keyColumn is specified, the second column is keyColumn. The next 2 columns are of INT and STRING/SYMBOL data type indicating the category (the position of the condition in metrics) and the content of the anomaly conditions.",
|
|
12505
|
-
"",
|
|
12506
|
-
"`timeColumn` is a string scalar indicating the name of the temporal column of the input stream table.",
|
|
12507
|
-
"",
|
|
12508
|
-
"`keyColumn` is a string scalar indicating the grouping column name. The anomaly detection engine conducts the calculations within each group specified by keyColumn. It is optional.",
|
|
12509
|
-
"",
|
|
12510
|
-
"`windowSize` is a positive integer indicating the length of the data window for calculation. If aggregate function are used in metrics then windowSize is required. The unit of windowSize is the smallest unit of time of timeColumn.",
|
|
12511
|
-
"",
|
|
12512
|
-
"`step` is a positive integer indicating the duration between 2 adjacent calculations. The unit of step is the smallest unit of time of timeColumn. The value of windowSize must be a multiple of step, otherwise an exception will be thrown. The system automatically adjusts the left bound of the first window. For details please check createTimeSeriesAggregator. :doc:`createTimeSeriesEngine` ",
|
|
12513
|
-
"",
|
|
12514
|
-
"`garbageSize` is a positive integer. It is optional and the default value is 2000 (in Bytes). ",
|
|
12515
|
-
"",
|
|
12516
|
-
"* If *keyColumn* is not specified, when the number of historical records in memory exceeds *garbageSize*, the system will clear the records that is no longer needed.",
|
|
12517
|
-
"* If *keyColumn* is specified, record clearing is conducted independently in each group. When the number of historical records in a group exceeds *garbageSize*, the system will clear the records within the group that is no longer needed.",
|
|
12518
|
-
"* *garbageSize* does not work if no aggregate function is specified in parameter *metrics*.",
|
|
12519
|
-
"",
|
|
12520
|
-
"`snapshotDir` is a string indicating the directory where the streaming engine snapshot is saved. The snapshot is used to restore the streaming engine after system interruption.",
|
|
12521
|
-
"",
|
|
12522
|
-
"* The directory must already exist, otherwise an exception is thrown.",
|
|
12523
|
-
"* When creating a streaming engine, if snapshotDir is specified, the system will check whether there is a snapshot in the directory already. If it exists, the snapshot will be loaded to restore the state of the engine.",
|
|
12524
|
-
"* Multiple streaming engines can share a directory.",
|
|
12525
|
-
"* A snapshot may use 3 names. When the snapshot is being generated, the file name is <engineName>.tmp; after the snapshot is generated and flushed to the disk, it is renamed to <engineName>.snapshot; if a snapshot with the same name already exists, the previous snapshot is renamed to <engineName>.old.",
|
|
12526
|
-
"",
|
|
12527
|
-
"`snapshotIntervalInMsgCount` is a positive integer indicating the number of messages between 2 streaming engine snapshots.",
|
|
12528
|
-
"",
|
|
12529
|
-
"To enable snapshots in streaming engines, *snapshotDir* and *snapshotIntervalInMsgCount* must be specified.",
|
|
12530
|
-
"",
|
|
12531
|
-
"`raftGroup` is the ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. It is an integer greater than 1. Specify *raftGroup* to enable high availability on the streaming engine. When a streaming engine is created on the leader, it is also created on each follower. Once a snapshot is generated, it will also be synced to all followers. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table. Note that *SnapShotDir* must also be specified when specifying a raft group."
|
|
12532
|
-
]
|
|
12533
|
-
}
|
|
12534
|
-
]
|
|
12535
|
-
},
|
|
12536
|
-
{
|
|
12537
|
-
"title": "Details",
|
|
12538
|
-
"type": "detail",
|
|
12539
|
-
"children": [
|
|
12540
|
-
{
|
|
12541
|
-
"type": "text",
|
|
12542
|
-
"value": [
|
|
12543
|
-
"Create an anomaly detection engine. Return an abstract table object. Data inserted into this table is used to calculate specified metrics to detect anomalies. Generally it is used in conjunction with subscribeTable.",
|
|
12544
|
-
"",
|
|
12545
|
-
"We can use the following 3 types of expressions as the metrics:",
|
|
12546
|
-
"",
|
|
12547
|
-
"* Comparison between a column and a constant or between columns. Nonaggregate functions may be used but aggregate function are not used. For examples: qty < 4, qty > price, lt(qty, prev(qty)), isNull(qty) == false, etc. For these metrics, the engine conducts calculations for each row and determines whether to output the result.",
|
|
12548
|
-
"",
|
|
12549
|
-
"* Comparison between aggregate function result and a constant or between aggregate function results. Nonaggregate functions may be used, but their arguments may only include aggregate functions and/or constants, not columns. For examples: avg(qty - price) > 10, percentile(qty, 90) < 100, max(qty) < avg(qty) * 2, le(sum(qty), 5), etc. For these metrics, the engine conducts calculations at frequencies determined by the parameter 'step' and determines whether to output the result.",
|
|
12550
|
-
"",
|
|
12551
|
-
"* Comparison be tween aggregate function result and a column, or nonaggregate functions are used and their arguments include aggregate functions and columns. For examples: avg(qty) > qty, le(med(qty), price), etc. For these metrics, the engine conducts calculations at frequencies determined by the parameter 'step' and determines whether to output the result."
|
|
12552
|
-
]
|
|
12553
|
-
}
|
|
12554
|
-
]
|
|
12555
|
-
},
|
|
12556
|
-
{
|
|
12557
|
-
"title": "Examples",
|
|
12558
|
-
"type": "example",
|
|
12559
|
-
"children": [
|
|
12560
|
-
{
|
|
12561
|
-
"type": "text",
|
|
12562
|
-
"value": [
|
|
12563
|
-
".. 下面的例子使用createAnomalyDetectionEngine函数创建了一个表engine,然后通过订阅流数据表trades把数据写入到engine中,按照sym列进行分组聚合运算,并把结果保存在表outputTable中。",
|
|
12564
|
-
""
|
|
12565
|
-
]
|
|
12566
|
-
},
|
|
12567
|
-
{
|
|
12568
|
-
"type": "code",
|
|
12569
|
-
"language": "console",
|
|
12570
|
-
"value": [
|
|
12571
|
-
" ",
|
|
12572
|
-
" $ share streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT]) as trades",
|
|
12573
|
-
" $ outputTable = table(1000:0, `time`sym`type`metric, [TIMESTAMP, SYMBOL, INT, STRING])",
|
|
12574
|
-
" $ engine = createAnomalyDetectionEngine(name=\"anomalyDetection1\", metrics=<[sum(qty) > 5, avg(qty) > qty, qty < 4]>, dummyTable=trades, outputTable=outputTable, timeColumn=`time, keyColumn=`sym, windowSize=3, step=3)",
|
|
12575
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"anomalyDetectionSub1\", offset=0, handler=append!{engine}, msgAsTable=true)",
|
|
12576
|
-
"",
|
|
12577
|
-
" $ def writeData(n){",
|
|
12578
|
-
" $ timev = 2018.10.08T01:01:01.001 + 1..n",
|
|
12579
|
-
" $ symv =take(`A`B, n)",
|
|
12580
|
-
" $ qtyv = n..1",
|
|
12581
|
-
" $ insert into trades values(timev, symv, qtyv)",
|
|
12582
|
-
" $ }",
|
|
12583
|
-
"",
|
|
12584
|
-
" $ writeData(6);",
|
|
12585
|
-
"",
|
|
12586
|
-
" $ select * from trades;",
|
|
12587
|
-
""
|
|
12588
|
-
]
|
|
12589
|
-
},
|
|
12590
|
-
{
|
|
12591
|
-
"type": "text",
|
|
12592
|
-
"value": [
|
|
12593
|
-
"======================== ===== =====",
|
|
12594
|
-
"time sym qty",
|
|
12595
|
-
"======================== ===== =====",
|
|
12596
|
-
"2018.10.08T01:01:01.002 A 6 ",
|
|
12597
|
-
"2018.10.08T01:01:01.003 B 5 ",
|
|
12598
|
-
"2018.10.08T01:01:01.004 A 4",
|
|
12599
|
-
"2018.10.08T01:01:01.005 B 3",
|
|
12600
|
-
"2018.10.08T01:01:01.006 A 2",
|
|
12601
|
-
"2018.10.08T01:01:01.007 B 1",
|
|
12602
|
-
"======================== ===== =====",
|
|
12603
|
-
""
|
|
12604
|
-
]
|
|
12605
|
-
},
|
|
12606
|
-
{
|
|
12607
|
-
"type": "code",
|
|
12608
|
-
"language": "sql",
|
|
12609
|
-
"value": [
|
|
12610
|
-
" ",
|
|
12611
|
-
" select * from outputTable;",
|
|
12612
|
-
""
|
|
12613
|
-
]
|
|
12614
|
-
},
|
|
12615
|
-
{
|
|
12616
|
-
"type": "text",
|
|
12617
|
-
"value": [
|
|
12618
|
-
"======================== ===== ===== ===============",
|
|
12619
|
-
"time sym type metric",
|
|
12620
|
-
"======================== ===== ===== ===============",
|
|
12621
|
-
"2018.10.08T01:01:01.003 A 0 sum(qty) > 5 ",
|
|
12622
|
-
"2018.10.08T01:01:01.004 A 1 avg(qty) > qty",
|
|
12623
|
-
"2018.10.08T01:01:01.005 B 2 qty < 4",
|
|
12624
|
-
"2018.10.08T01:01:01.006 A 1 avg(qty) > qty",
|
|
12625
|
-
"2018.10.08T01:01:01.006 A 2 qty < 4",
|
|
12626
|
-
"2018.10.08T01:01:01.006 B 0 sum(qty) > 5",
|
|
12627
|
-
"2018.10.08T01:01:01.007 B 1 avg(qty) > qty",
|
|
12628
|
-
"2018.10.08T01:01:01.007 B 2 qty < 4",
|
|
12629
|
-
"======================== ===== ===== ===============",
|
|
12630
|
-
"",
|
|
12631
|
-
"The calculation process of the anomaly detection engine is explained in details below:",
|
|
12632
|
-
"",
|
|
12633
|
-
"\\(1) The indicator sum(qty)>5 represents the comparison between the aggregate result and a constant, the anomaly detection engine will check this indicator during the calculation in each window. ",
|
|
12634
|
-
"",
|
|
12635
|
-
"* The first window ranges from 2018.10.08T01:01:01.000 to 2018.10.08T01:01:01.002, and the sum(qty) of A and B is calculated respectively. At 2018.10.08T01:01:01.003 the engine starts to judge whether it meets the condition sum(qty)>5. ",
|
|
12636
|
-
"* The second window ranges from 2018.10.08T01:01:01.003 to 2018.10.08T01:01:01.005, at 2018.10.08T01:01:01.006, the engine starts to judge whether it meets the condition sum(qty)>5, and so on.",
|
|
12637
|
-
"",
|
|
12638
|
-
"\\(2) The indicator avg(qty)>qty represents the comparison between the aggregate result and a certain column. Therefore, whenever data arrives, the anomaly detection engine compares the data with the aggregation result of the previous window. Util the next aggregation calculation is triggered, the engine check whether the result meets the conditions and output it. ",
|
|
12639
|
-
"",
|
|
12640
|
-
"* The first window ranges from 2018.10.08T01:01:01.000 to 2018.10.08T01:01:01.002, the avg(qty) of A and B is calculated respectively. Each qty between 2018.10.08T01:01:01.003 and 2018.10.08T01:01:01.005 will be compared with the avg(qty) of the previous window. ",
|
|
12641
|
-
"* The window moves at 2018.10.08T01:01:01.005. ",
|
|
12642
|
-
"* The second window ranges from 2018.10.08T01:01:01.003 to 2018.10.08T01:01:01.005. In the second window, the avg(qty) of A and B is calculated, each qty between 2018.10.08T01:01:01.006 and 2018.10.08T01:01:01.008 will be compared with the avg(qty) of the previous window, and so on.",
|
|
12643
|
-
"",
|
|
12644
|
-
"\\(3) The indicator qty<4 is a comparison between the qty column and a constant, so every time the data arrives, the anomaly detection engine will check this indicator."
|
|
12645
|
-
]
|
|
12646
|
-
}
|
|
12647
|
-
]
|
|
12648
|
-
}
|
|
12649
|
-
]
|
|
12650
|
-
},
|
|
12651
12475
|
"createAsofJoinEngine": {
|
|
12652
12476
|
"title": "createAsofJoinEngine",
|
|
12653
12477
|
"type": "function",
|
|
@@ -12838,44 +12662,50 @@
|
|
|
12838
12662
|
]
|
|
12839
12663
|
},
|
|
12840
12664
|
{
|
|
12841
|
-
"title": "
|
|
12842
|
-
"type": "
|
|
12665
|
+
"title": "Details",
|
|
12666
|
+
"type": "detail",
|
|
12843
12667
|
"children": [
|
|
12844
12668
|
{
|
|
12845
12669
|
"type": "text",
|
|
12846
12670
|
"value": [
|
|
12847
|
-
"This
|
|
12671
|
+
"This function creates a daily time-series streaming engine. The windowing logic and calculation rules of the daily time-series engine are similar to those of the time-series engine, but with some added features:",
|
|
12848
12672
|
"",
|
|
12849
|
-
"
|
|
12673
|
+
"* Window calculations are performed only within a specified time period (known as a \"session\") of a calendar day. A day can have multiple sessions, such as 9:00-12:00, 13:00-15:00, and so on.",
|
|
12850
12674
|
"",
|
|
12851
|
-
"
|
|
12675
|
+
"* Data that arrives before the start of a session within a calendar day will be included in the calculation of the first window of that session. ",
|
|
12852
12676
|
"",
|
|
12853
|
-
"
|
|
12677
|
+
"* Data that arrives after the end of the last session of that day will be discarded.",
|
|
12854
12678
|
"",
|
|
12855
|
-
"
|
|
12856
|
-
"",
|
|
12857
|
-
"- If *fill* is not specified, the window returns no result.",
|
|
12858
|
-
"",
|
|
12859
|
-
"- If *fill* is specified, the result of the window will be filled using the specified filling method.",
|
|
12860
|
-
"",
|
|
12861
|
-
"Note: ",
|
|
12679
|
+
"Note: If *keyColumn* is specified to group data by the column values, the calculations described above will be performed within each group.",
|
|
12862
12680
|
"",
|
|
12863
|
-
"
|
|
12864
|
-
"* To set these three parameters, `useSystemTime` must be set to false. `mergeSessionEnd` can be set only when `updateTime` or `forceTriggerTime` is specified."
|
|
12681
|
+
"For more application scenarios, see :doc:`../../Themes/streamingEngine`."
|
|
12865
12682
|
]
|
|
12866
12683
|
}
|
|
12867
12684
|
]
|
|
12868
12685
|
},
|
|
12869
12686
|
{
|
|
12870
|
-
"title": "
|
|
12871
|
-
"type": "
|
|
12687
|
+
"title": "Arguments",
|
|
12688
|
+
"type": "parameters",
|
|
12872
12689
|
"children": [
|
|
12873
12690
|
{
|
|
12874
12691
|
"type": "text",
|
|
12875
12692
|
"value": [
|
|
12876
|
-
"
|
|
12693
|
+
"The daily time-series engine is an extension of the time-series engine (:doc:`createTimeSeriesEngine`) and inherits all of its parameters. In this section, we will only cover the parameters specific to this engine.",
|
|
12694
|
+
"",
|
|
12695
|
+
"`sessionBegin` (optional) can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the starting time of each session. If it is a vector, it must be increasing.",
|
|
12696
|
+
"",
|
|
12697
|
+
"`sessionEnd` (optional) can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the end time of each session. Specify *sessionEnd* as 00:00:00 to indicate the beginning of the next day (i.e., 24:00:00 of the current day).",
|
|
12698
|
+
"",
|
|
12699
|
+
"`mergeSessionEnd` (optional) is a Boolean value. This parameter is only applicable when *closed* = 'left'. When *closed* = 'left', *mergeSessionEnd* determines whether the record arriving at the end of a session (which has been adjusted based on the alignment rules) will be included in the calculation of the last window of that session. The default value is false, which means the record will not be included in the last window but will trigger its calculation. If the current session is not the last session of the day, the record will participate in the calculation of the first window of the next session.",
|
|
12877
12700
|
"",
|
|
12878
|
-
"
|
|
12701
|
+
"`forceTriggerSessionEndTime` (optional) is a positive integer. The unit of *forceTriggerSessionEndTime* 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.",
|
|
12702
|
+
"",
|
|
12703
|
+
"If no data is ingested into a group after the last window is calculated, and new data continues to ingest into other groups, the specified *fill* parameter can be used to fill the results of empty windows of that group. This ensures that the group's windows will still be output at the latest time point. If parameter *fill* is not specified, no new windows will be generated for that group after the calculation of the last window.",
|
|
12704
|
+
"",
|
|
12705
|
+
"Note: ",
|
|
12706
|
+
"",
|
|
12707
|
+
"* The engine automatically adjusts the starting point of the window for *sessionBegin* and *sessionEnd* according to the value of *alignmentSize*.",
|
|
12708
|
+
" "
|
|
12879
12709
|
]
|
|
12880
12710
|
}
|
|
12881
12711
|
]
|
|
@@ -14722,587 +14552,6 @@
|
|
|
14722
14552
|
"type": "function",
|
|
14723
14553
|
"children": []
|
|
14724
14554
|
},
|
|
14725
|
-
"createTimeSeriesEngine": {
|
|
14726
|
-
"title": "createTimeSeriesEngine",
|
|
14727
|
-
"type": "function",
|
|
14728
|
-
"children": [
|
|
14729
|
-
{
|
|
14730
|
-
"title": "Syntax",
|
|
14731
|
-
"type": "grammer",
|
|
14732
|
-
"children": [
|
|
14733
|
-
{
|
|
14734
|
-
"type": "text",
|
|
14735
|
-
"value": [
|
|
14736
|
-
"createTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, [timeColumn], [useSystemTime=false], [keyColumn], [garbageSize], [updateTime], [useWindowStartTime=false], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [fill='none'], [forceTriggerTime], [raftGroup], [keyPurgeFreqInSec], [closed='left'])",
|
|
14737
|
-
"",
|
|
14738
|
-
"Alias: createTimeSeriesAggregator"
|
|
14739
|
-
]
|
|
14740
|
-
}
|
|
14741
|
-
]
|
|
14742
|
-
},
|
|
14743
|
-
{
|
|
14744
|
-
"title": "Details",
|
|
14745
|
-
"type": "detail",
|
|
14746
|
-
"children": [
|
|
14747
|
-
{
|
|
14748
|
-
"type": "text",
|
|
14749
|
-
"value": [
|
|
14750
|
-
"Create a time-series engine to conduct real-time time-series aggregate calculations with streaming data.",
|
|
14751
|
-
"",
|
|
14752
|
-
"Return a table object that subscribes to a stream table. Ingesting data to this table means that data enters the engine for windowed aggregations. ",
|
|
14753
|
-
"",
|
|
14754
|
-
"If *keyColumn* is specified to group the records that have the same key, the window calculation will be performed in each group.",
|
|
14755
|
-
"",
|
|
14756
|
-
"Rules for *timeColumn*:",
|
|
14757
|
-
"",
|
|
14758
|
-
"\\1. If keyColumn is not specified, the values in timeColumn must be incremental.",
|
|
14759
|
-
"",
|
|
14760
|
-
"\\2. If keyColumn is specified, the values from the same group in the timeColumn must be incremental.",
|
|
14761
|
-
"",
|
|
14762
|
-
"Otherwise, out-of-order data will will be discarded.",
|
|
14763
|
-
"",
|
|
14764
|
-
"Generally it is used in conjunction with :doc:`../s/subscribeTable`. Refer to `Time-Series Stream Engine of DolphinDB <https://github.com/dolphindb/Tutorials_EN/blob/master/stream_aggregator.md>`_ for more information. The engine it creates can be called across sessions.",
|
|
14765
|
-
""
|
|
14766
|
-
]
|
|
14767
|
-
}
|
|
14768
|
-
]
|
|
14769
|
-
},
|
|
14770
|
-
{
|
|
14771
|
-
"title": "Arguments",
|
|
14772
|
-
"type": "parameters",
|
|
14773
|
-
"children": [
|
|
14774
|
-
{
|
|
14775
|
-
"type": "text",
|
|
14776
|
-
"value": [
|
|
14777
|
-
"`name` is a string indicating the name of the engine. It is the only identifier of an engine. It can have letter, number and \"_\". It must start with a letter.",
|
|
14778
|
-
"",
|
|
14779
|
-
"`useSystemTime` is an optional BOOLEAN indicating whether the calculations are performed based on the system time when data is ingested into the engine.",
|
|
14780
|
-
"",
|
|
14781
|
-
"- *useSystemTime* = true: the engine will regularly window the streaming data at fixed time intervals for calculations according to the ingestion time (local system time with millisecond precision, independent of any temporal columns in the streaming table) of each record. As long as a window contains data, the calculation will be performed automatically when the window ends. The first column in output table indicates the timestamp when the calculation occurred.",
|
|
14782
|
-
"",
|
|
14783
|
-
"- *useSystemTime* = false (default): the engine will window the streaming data according to the timeColumn in the stream table. The calculation for a window is triggered by the first record after the previous window. Please note that the record which triggers the calculation will not participate in this calculation.",
|
|
14784
|
-
"",
|
|
14785
|
-
"For example, there is a window ranges from 10:10:10 to 10:10:19. If useSystemTime=true and the window is not empty, the calculation will be triggered at 10:10:20. If useSystemTime=false and the first record after 10:10:19 is at 10:10:25, the calculation will be triggered at 10:10:25.",
|
|
14786
|
-
"",
|
|
14787
|
-
"`windowSize` is a scalar or vector of positive integers that specifies the length of the windows for calculation. If it is a vector, the size must be the same as the number of elements in *metrics*. Only the left boundary is included in the window.",
|
|
14788
|
-
"",
|
|
14789
|
-
"`step` is a positive integer indicating the length between the end time of two adjacent windows. Together with the starting time of the first window, it determines the end time of each window. The value of windowSize must be a multiple of step, otherwise an exception will be thrown.",
|
|
14790
|
-
"",
|
|
14791
|
-
"The unit of `windowSize` and step depends on the value of `useSystemTime`.",
|
|
14792
|
-
"",
|
|
14793
|
-
"* If `useSystemTime`\\=true, the unit of `windowSize` and step is millisecond.",
|
|
14794
|
-
"",
|
|
14795
|
-
"* If `useSystemTime`\\=false, the unit of `windowSize` and step is the same as the unit of `timeColumn`.",
|
|
14796
|
-
"",
|
|
14797
|
-
"The engine automatically adjusts the starting point of the first window according to the value of `alignmentSize`, which depends on `step` and the unit of `timeColumn`. ",
|
|
14798
|
-
"",
|
|
14799
|
-
".. 为了便于观察和对比计算结果,系统会对第一个数据窗口的起始时间进行规整,根据step参数、数据的时间精度,以及roundTime参数来确定整数类型的规整尺度alignmentSize。当时间序列引擎使用分组计算时,所有分组的窗口均进行统一的规整。相同时刻的数据窗口在各组均有相同的边界。",
|
|
14800
|
-
"",
|
|
14801
|
-
"The system will do alignment for the starting time of first window. The alignmentSize(integer) will be decided by the step, precision and roundTime. When time series engine calculates in groups, all groups' window will be uniformly aligned. The windows at the same time have the same boundary. ",
|
|
14802
|
-
"",
|
|
14803
|
-
"* If the data type of `timeColumn` is DATETIME(yyyy-MM-dd HH:mm:ss) or SECOND(HH:mm:ss), the value of `alignmentSize` is as follows:",
|
|
14804
|
-
"",
|
|
14805
|
-
" *if roundTime=false*: ",
|
|
14806
|
-
"",
|
|
14807
|
-
"============== =================",
|
|
14808
|
-
"step alignmentSize",
|
|
14809
|
-
"============== =================",
|
|
14810
|
-
"0~2 2",
|
|
14811
|
-
"3 3",
|
|
14812
|
-
"4~5 5",
|
|
14813
|
-
"6~10 10",
|
|
14814
|
-
"11~15 15",
|
|
14815
|
-
"16~20 20",
|
|
14816
|
-
"21~30 30",
|
|
14817
|
-
">30 60 (1minutes)",
|
|
14818
|
-
"============== =================",
|
|
14819
|
-
"",
|
|
14820
|
-
" *if roundTime=true:*",
|
|
14821
|
-
"",
|
|
14822
|
-
"The value of `alignmentSize` is same as above table if step<=30; The value of `alignmentSize` is as folllows if step>30: ",
|
|
14823
|
-
"",
|
|
14824
|
-
"============== =================",
|
|
14825
|
-
"step alignmentSize",
|
|
14826
|
-
"============== =================",
|
|
14827
|
-
"31~60 60 (1minutes)",
|
|
14828
|
-
"60~120 120 (2minutes)",
|
|
14829
|
-
"121~180 180 (3minutes)",
|
|
14830
|
-
"181~300 300 (5minutes)",
|
|
14831
|
-
"301~600 600 (10minutes)",
|
|
14832
|
-
"601~900 900 (15minutes)",
|
|
14833
|
-
"901~1200 1200 (20minutes)",
|
|
14834
|
-
"1201~1800 1800 (30minutes)",
|
|
14835
|
-
">1800 3600 (1hour)",
|
|
14836
|
-
"============== =================",
|
|
14837
|
-
"",
|
|
14838
|
-
"* If the data type of timeColumn is TIMESTAMP(yyyy-MM-dd HH:mm:ss.mmm) or TIME(HH:mm:ss.mmm), the value of alignmentSize is as follows:",
|
|
14839
|
-
"",
|
|
14840
|
-
" *if roundTime=false:*",
|
|
14841
|
-
"",
|
|
14842
|
-
"============== =================",
|
|
14843
|
-
"step alignmentSize",
|
|
14844
|
-
"============== =================",
|
|
14845
|
-
"0~2 2",
|
|
14846
|
-
"3~5 5",
|
|
14847
|
-
"6~10 10",
|
|
14848
|
-
"11~20 20",
|
|
14849
|
-
"21~25 25",
|
|
14850
|
-
"26~50 50",
|
|
14851
|
-
"51~100 100",
|
|
14852
|
-
"101~200 200",
|
|
14853
|
-
"201~250 250",
|
|
14854
|
-
"251~500 500",
|
|
14855
|
-
"501~1000 1000(1seconds)",
|
|
14856
|
-
"1001~2000 2000(2seconds)",
|
|
14857
|
-
"2001~5000 5000(5seconds)",
|
|
14858
|
-
"5001~10000 10000(10seconds)",
|
|
14859
|
-
"10001~15000 15000(15seconds)",
|
|
14860
|
-
"15001~20000 20000(20seconds)",
|
|
14861
|
-
"20001~30000 30000(30seconds)",
|
|
14862
|
-
">30000 60000(1minutes)",
|
|
14863
|
-
"============== =================",
|
|
14864
|
-
"",
|
|
14865
|
-
" *if roundTime=true:*",
|
|
14866
|
-
"",
|
|
14867
|
-
"The value of `alignmentSize` is same as above table if step<=30000; The value of `alignmentSize` is as folllows if step>30000: ",
|
|
14868
|
-
"",
|
|
14869
|
-
"======================= ==========================",
|
|
14870
|
-
"step alignmentSize",
|
|
14871
|
-
"======================= ==========================",
|
|
14872
|
-
"30001~60000 60000(1minutes)",
|
|
14873
|
-
"60001~120000 120000(2minutes)",
|
|
14874
|
-
"120001~300000 300000(5minutes)",
|
|
14875
|
-
"300001~600000 600000(10minutes)",
|
|
14876
|
-
"600001~900000 900000(15minutes)",
|
|
14877
|
-
"900001~1200000 1200000(20minutes)",
|
|
14878
|
-
"1200001~1800000 1800000(30minutes)",
|
|
14879
|
-
">1800000 3600000(1hour)",
|
|
14880
|
-
"======================= ==========================",
|
|
14881
|
-
"",
|
|
14882
|
-
"* If the data type of *timeColumn* is NANOTIMESTAMP(yyyy-MM-dd HH:mm:ss.nnnnnnnnn) or NANOTIME(HH:mm:ss.nnnnnnnnn), the value of *alignmentSize* is as follows:",
|
|
14883
|
-
"",
|
|
14884
|
-
" *if roundTime=false*:",
|
|
14885
|
-
"",
|
|
14886
|
-
" ============== =================",
|
|
14887
|
-
" step alignmentSize",
|
|
14888
|
-
" ============== =================",
|
|
14889
|
-
" 0~2ns 2ns",
|
|
14890
|
-
" 3ns~5ns 5ns",
|
|
14891
|
-
" 6ns~10ns 10ns",
|
|
14892
|
-
" 11ns~20ns 20ns",
|
|
14893
|
-
" 21ns~25ns 25ns",
|
|
14894
|
-
" 26ns~50ns 50ns",
|
|
14895
|
-
" 51ns~100ns 100ns",
|
|
14896
|
-
" 101ns~200ns 200ns",
|
|
14897
|
-
" 201ns~250ns 250ns",
|
|
14898
|
-
" 251ns~500ns 500ns",
|
|
14899
|
-
" >500ns 1000ns",
|
|
14900
|
-
" ============== =================",
|
|
14901
|
-
"",
|
|
14902
|
-
" *if roundTime=true*:",
|
|
14903
|
-
"",
|
|
14904
|
-
" ============== =================",
|
|
14905
|
-
" step alignmentSize",
|
|
14906
|
-
" ============== =================",
|
|
14907
|
-
" 1000ns~1ms 1ms",
|
|
14908
|
-
" 1ms~10ms 10ms",
|
|
14909
|
-
" 10ms~100ms 100ms",
|
|
14910
|
-
" 100ms~1s 1s",
|
|
14911
|
-
" 1s~2s 2s",
|
|
14912
|
-
" 2s~3s 3s",
|
|
14913
|
-
" 3s~5s 5s",
|
|
14914
|
-
" 5s~10s 10s",
|
|
14915
|
-
" 10s~15s 15s",
|
|
14916
|
-
" 15s~20s 20s",
|
|
14917
|
-
" 20s~30s 30s",
|
|
14918
|
-
" >30s 1min",
|
|
14919
|
-
" ============== =================",
|
|
14920
|
-
"",
|
|
14921
|
-
"If the time of the first record is x with data type of TIMESTAMP, then the starting time of the first window is adjusted to be timestamp(x/alignmentSize*alignmentSize), where / produces only the integer part after division. For example, if the time of the first record is 2018.10.08T01:01:01.365 and step=60000, then alignmentSize=60000, and the starting time of the first window is timestamp(2018.10.08T01:01:01.365/60000*60000)=2018.10.08T01:01:00.000.",
|
|
14922
|
-
"",
|
|
14923
|
-
"`metrics` is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to metaprogramming :doc:`/Objects/Metaprogramming`",
|
|
14924
|
-
"",
|
|
14925
|
-
"* It can use one or more built-in or user-defined aggregate functions such as <[sum(volume), avg(price)]>, or expressions of aggregate functions such as as <[avg(price1)-avg(price2)]>, or aggregate functions on operations involving multiple columns such as <[std(price1-price2)]>. ",
|
|
14926
|
-
"",
|
|
14927
|
-
"* 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).",
|
|
14928
|
-
"",
|
|
14929
|
-
"* If windowSize is a vector, each element of windowSize can correspond to multiple formulas in metrics. For example, if windowSize=[10,20], metrics can be (<[min(volume), max(volume)]>, <sum(volume)>). Metrics can also input nested tuple vectors, such as [[<[min(volume), max(volume)]>, <sum(volume)>],[<avg(volume)>]].",
|
|
14930
|
-
"",
|
|
14931
|
-
".. metrics也可以嵌套输入元组向量。例如:[[<[min(volume), max(volume)]>, <sum(volume)>],[<avg(volume)>]]",
|
|
14932
|
-
"",
|
|
14933
|
-
"DolphinDB has optimized the following aggregate functions in the time-series engine to achieve incremental computing:",
|
|
14934
|
-
"``corr``, ``covar``, ``first``, ``last``, ``max``, ``med``, ``min``, ``percentile``, ``quantile``, ``std``, ``var``, ``sum``, ``sum2``, ``sum3``, ``sum4``, ``wavg``, ``wsum``, ``count``, ``firstNot``, ``ifirstNot``, ``lastNot``, ``ilastNot``, ``imax``, ``imin``, ``nunique``, ``prod``, ``sem``, ``mode``, ``searchK``",
|
|
14935
|
-
"",
|
|
14936
|
-
"`dummyTable` is a table object whose schema must be the same as the subscribed stream table. The system uses the schema of dummyTable to determine the data type of each column in the messages. Whether dummyTable contains data does not affect the aggregation result.",
|
|
14937
|
-
"",
|
|
14938
|
-
"`outputTable` is the output table for the calculation results. It can be a in-memory table or a DFS table. Before we use function createTimeSeriesEngine, we need to create outputTable and specify the names and data types of its columns. The engine inserts the results into it. ",
|
|
14939
|
-
"",
|
|
14940
|
-
"The following rules apply to the schema of outputTable:",
|
|
14941
|
-
"",
|
|
14942
|
-
"* The data type of the first column must be temporal. It is TIMESTAMP if useSystemTime=true. It is the same as the data type of timeColumn if useSystemTime=false.",
|
|
14943
|
-
"",
|
|
14944
|
-
"* If keyColumn is specified, the second column is keyColumn.",
|
|
14945
|
-
"",
|
|
14946
|
-
"* The remaining columns are calculation results.",
|
|
14947
|
-
"",
|
|
14948
|
-
"`timeColumn` is a string scalar indicating the name of the temporal column of the subscribed stream table when useSystemTime=false.",
|
|
14949
|
-
"",
|
|
14950
|
-
".. 请注意,字符串向量,必须是date和time组成的向量,date类型为DATE,time类型为TIME,SECOND或NANOTIME。此时,输出表第一列的时间类型必须与concatDateTime(date, time)的类型一致。",
|
|
14951
|
-
"",
|
|
14952
|
-
"Please note:",
|
|
14953
|
-
"",
|
|
14954
|
-
"* It must be a string vector composed of date(type DATE) and time(type TIME, SECOND, NANOTIME). The first column in output table must be as the same type as concatDateTime(date, time).",
|
|
14955
|
-
"* If keyColumn is not specified, timeColumn must be increasing; if keyColumn is specified, timeColumn must be increasing within each group specified by keyColumn.",
|
|
14956
|
-
"",
|
|
14957
|
-
"`keyColumn` is a string scalar/vector indicating the grouping column name. The engine conducts the calculations within each group specified by keyColumn if it is specified.",
|
|
14958
|
-
"",
|
|
14959
|
-
"`garbageSize` is a positive integer. It is optional and the default value is 50,000. As the subscribed data continues to accumulate in the engine, a machenism is needed to clear data in the memory that is no longer needed. When the number of rows of historical data in the memory exceeds garbageSize, the system will clear the historical data that is not needed for the current calculation.",
|
|
14960
|
-
"",
|
|
14961
|
-
"If `keyColumn` is specified, memory cleanup is performed independently within each group. When the number of rows of historical data in memory of a group exceeds garbageSize, the historical data that is not needed in the current calculation in this group will be cleared.",
|
|
14962
|
-
"",
|
|
14963
|
-
"`updateTime` is a positive integer. It can be used to trigger multiple calculations within the current window. The unit of updateTime is the same as the unit of step, and step must be an integer multiple of updateTime. To specify updateTime, useSystemTime must be set to false.",
|
|
14964
|
-
"",
|
|
14965
|
-
"If updateTime is not specified, calculation for a window will not occur before the window ends. ",
|
|
14966
|
-
"",
|
|
14967
|
-
"If updateTime is specified, multiple calculations may happen within the current window. These calculations are triggered with the following rules:",
|
|
14968
|
-
"",
|
|
14969
|
-
"* Divide the current window into windowSize/updateTime small windows. Each small window has a length of updateTime. When a new record arrives after a small window finishes, if there is at least one record in the current window that is not used in a calculation (excluding the new record), a calculation is triggered. Please note that this calculation does not use the new record.",
|
|
14970
|
-
"",
|
|
14971
|
-
"* If max(2\\*updateTime, 2 seconds) after a record arrives at the engine, it still has not been used in a calculation, a calculation is triggered. This calculation includes all data in the current window at the time.",
|
|
14972
|
-
"",
|
|
14973
|
-
"If `keyColumn` is specified, these rules apply within each group.",
|
|
14974
|
-
"",
|
|
14975
|
-
"Please note that the timestamp of each calculation result within the current window is the current window starting time or starting time + windowSize (depending on parameter useWindowStartTime) instead of a timestamp inside the current window.",
|
|
14976
|
-
"",
|
|
14977
|
-
"It is recommended to specify a keyed table for *outputTable* if *updateTime* is set. If *outputTable* is a standard in-memory table or stream table, it will have multiple results for each timestamp (in each group). It is not recommended to use a keyed stream table either as the records of a keyed stream table cannot be updated.",
|
|
14978
|
-
"",
|
|
14979
|
-
"`useWindowStartTime` is a Boolean value indicating whether the first column in outputTable is the starting time of the windows. The default value is false, which means the timestamps in the output table are the starting time of the windows + windowSize. If windowSize is a vector, useWindowStartTime must be false.'",
|
|
14980
|
-
"",
|
|
14981
|
-
".. `roundTime` 可选参数,是一个布尔值,表示若数据时间精度为毫秒或者秒且step>一分钟,如何对窗口边界值进行规整处理。默认值为true, 表示按照既定的多分钟规则(见以上表格)进行规整。若为false, 则按一分钟规则(见以上表格)进行窗口规整。",
|
|
14982
|
-
"",
|
|
14983
|
-
"`roundTime` is an optional parameter with a Boolean value indicating the method to align the window boundary if the time precision is milliseconds or seconds and step is bigger than one minute. The default value is true indicating the alignment is based on the multi-minute rule (see the table above). False means alignment is based on the one-minute rule(see the table above).",
|
|
14984
|
-
"",
|
|
14985
|
-
"`snapshotDir` is a string indicating the directory where the streaming engine snapshot is saved. The snapshot is used to restore the streaming engine after system interruption.",
|
|
14986
|
-
"",
|
|
14987
|
-
"* The directory must already exist, otherwise an exception is thrown.",
|
|
14988
|
-
"* When creating a streaming engine, if snapshotDir is specified, the system will check whether there is a snapshot in the directory already. If it exists, the snapshot will be loaded to restore the state of the engine.",
|
|
14989
|
-
"* Multiple streaming engines can share a directory.",
|
|
14990
|
-
"* A snapshot may use 3 names. When the snapshot is being generated, the file name is <engineName>.tmp; after the snapshot is generated and flushed to the disk, it is renamed to <engineName>.snapshot; if a snapshot with the same name already exists, the previous snapshot is renamed to <engineName>.old.",
|
|
14991
|
-
"",
|
|
14992
|
-
"`snapshotIntervalInMsgCount` is a positive integer indicating the number of messages between 2 streaming engine snapshots.",
|
|
14993
|
-
"",
|
|
14994
|
-
"To enable snapshots in streaming engines, snapshotDir and snapshotIntervalInMsgCount must be specified.",
|
|
14995
|
-
"",
|
|
14996
|
-
".. `fill` 可选参数,是一个标量或向量,表示若(某个key的)某个窗口无数据时,如何处理。可取以下值: ",
|
|
14997
|
-
"",
|
|
14998
|
-
".. * 'none': no result",
|
|
14999
|
-
".. * 'null': result is NULL.",
|
|
15000
|
-
".. * 'ffill': output the result in the last window.",
|
|
15001
|
-
".. * 'specific value': the type should be the same as metrics output's type.",
|
|
15002
|
-
"",
|
|
15003
|
-
".. fill可以输入向量,为每个metrics指定不同的fill方式。其中,向量中各项只能是'null', 'ffill'或一个数值,不能是'none'.",
|
|
15004
|
-
"",
|
|
15005
|
-
"`fill` is a vector/scalar indicating the filling method to deal with an empty window (in a group). It could be:",
|
|
15006
|
-
"",
|
|
15007
|
-
"- 'none': no result",
|
|
15008
|
-
"- 'null': result is NULL.",
|
|
15009
|
-
"- 'ffill': output the result in the last window.",
|
|
15010
|
-
"- 'specific value': Specify a value. Its type should be the same as metrics output's type.",
|
|
15011
|
-
"",
|
|
15012
|
-
"*fill* could be a vector to specify different fill method for each metric. The element in vector can't be 'none'.",
|
|
15013
|
-
"",
|
|
15014
|
-
"`forceTriggerTime` is an optional parameter. It is a non-negative integer indicating the waiting time (in seconds) to force trigger calculation in the uncalculated windows for each group. The rules are as follow:",
|
|
15015
|
-
"",
|
|
15016
|
-
"\\1. Suppose the end time of the uncalculated window is t, and an incoming record of another group arrives at t1: when t1-t>=forceTriggerTime, calculation of the window will be triggered.",
|
|
15017
|
-
"",
|
|
15018
|
-
"\\2. When a window doesn't contain any records:",
|
|
15019
|
-
"",
|
|
15020
|
-
"- If *fill* is not specified, the window returns no result.",
|
|
15021
|
-
"",
|
|
15022
|
-
"- If *fill* is specified, the result of the window will be filled using the specified filling method.",
|
|
15023
|
-
"",
|
|
15024
|
-
"Note: useSystemTime must be false and updateTime cannot be specified if forceTriggerTime is set. If the data belonging to the current window is still be injected into the engine after the calculation is forced to be triggered, the data will be calculated in the next window. It is recommended not to set the a small value to forceTriggerTime.",
|
|
15025
|
-
"",
|
|
15026
|
-
"Note the following points when setting forceTriggerTime or updateTime:",
|
|
15027
|
-
"",
|
|
15028
|
-
"* If updateTime is set, the output table must be a keyedTable; If forceTriggerTime is set, output table can be an in-memory table or a distributed table.",
|
|
15029
|
-
"* If the data belonging to the current window is still reached after the calculation is forced to be triggered, the data will be calculated in the next window.",
|
|
15030
|
-
"",
|
|
15031
|
-
"`raftGroup` is an integer greater than 1 indicating Raft group ID. Setting this parameter to enable high availability in the computing engine. The calculation engines will be created on other Followers, and the snapshot will be synchronized to other Followers as well. Enable high availability on subscriber with function subscribeTable. The raftGroup ID of subscribeTable must be the same as that of the stream engine. When the leader is down, it will automatically switch to a new leader and re-subscribe. Please note that SnapShotDir must be specified if raftGroup is specified.",
|
|
15032
|
-
"",
|
|
15033
|
-
"`keyPurgeFreqInSec` is a positive integer indicating the interval (in seconds) to remove groups with no incoming data for a long time. If a group has no incoming data for at least *keyPurgeFreqInSec* seconds after the last time of data purging, it will be removed. ",
|
|
15034
|
-
"",
|
|
15035
|
-
"Note: To specify this parameter, parameter *forceTriggerTime* must be specified and parameter *fill* cannot be specified. ",
|
|
15036
|
-
"",
|
|
15037
|
-
"You can check the number of groups in a time-series streaming engine based on the column numGroups returned by :doc:`../g/getStreamEngineStat`.",
|
|
15038
|
-
"",
|
|
15039
|
-
"`closed` is a STRING indicating whether the left or the right boundary is included.",
|
|
15040
|
-
"",
|
|
15041
|
-
"* closed = 'left': left-closed, right-open",
|
|
15042
|
-
"* closed = 'right': left-open, right-closed",
|
|
15043
|
-
"",
|
|
15044
|
-
".. `closed`` is a STRING indicating the point in the moving window that need to be excluded from calculation. This optional parameter can specified as ‘left’ or ‘right’. The default value is `left`.",
|
|
15045
|
-
"",
|
|
15046
|
-
".. * closed = 'left': the last point in the window is excluded from calculations.",
|
|
15047
|
-
".. * closed = 'right': the first point in the window is excluded from calculations."
|
|
15048
|
-
]
|
|
15049
|
-
}
|
|
15050
|
-
]
|
|
15051
|
-
},
|
|
15052
|
-
{
|
|
15053
|
-
"title": "Examples",
|
|
15054
|
-
"type": "example",
|
|
15055
|
-
"children": [
|
|
15056
|
-
{
|
|
15057
|
-
"type": "text",
|
|
15058
|
-
"value": [
|
|
15059
|
-
"In the following example, the time-series engine agg1 subscribes to the stream table trades and calculates sum(volume) for each stock in the last minute in real time. The result is saved in table output1.",
|
|
15060
|
-
""
|
|
15061
|
-
]
|
|
15062
|
-
},
|
|
15063
|
-
{
|
|
15064
|
-
"type": "code",
|
|
15065
|
-
"language": "console",
|
|
15066
|
-
"value": [
|
|
15067
|
-
" ",
|
|
15068
|
-
" $ share streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades",
|
|
15069
|
-
" $ output1 = table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])",
|
|
15070
|
-
" $ engine1 = createTimeSeriesEngine(name=\"engine1\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=false)",
|
|
15071
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);",
|
|
15072
|
-
" ",
|
|
15073
|
-
" $ insert into trades values(2018.10.08T01:01:01.785,`A,10)",
|
|
15074
|
-
" $ insert into trades values(2018.10.08T01:01:02.125,`B,26)",
|
|
15075
|
-
" $ insert into trades values(2018.10.08T01:01:10.263,`B,14)",
|
|
15076
|
-
" $ insert into trades values(2018.10.08T01:01:12.457,`A,28)",
|
|
15077
|
-
" $ insert into trades values(2018.10.08T01:02:10.789,`A,15)",
|
|
15078
|
-
" $ insert into trades values(2018.10.08T01:02:12.005,`B,9)",
|
|
15079
|
-
" $ insert into trades values(2018.10.08T01:02:30.021,`A,10)",
|
|
15080
|
-
" $ insert into trades values(2018.10.08T01:04:02.236,`A,29)",
|
|
15081
|
-
" $ insert into trades values(2018.10.08T01:04:04.412,`B,32)",
|
|
15082
|
-
" $ insert into trades values(2018.10.08T01:04:05.152,`B,23)",
|
|
15083
|
-
"",
|
|
15084
|
-
" $ sleep(10)",
|
|
15085
|
-
"",
|
|
15086
|
-
" $ select * from output1;",
|
|
15087
|
-
""
|
|
15088
|
-
]
|
|
15089
|
-
},
|
|
15090
|
-
{
|
|
15091
|
-
"type": "text",
|
|
15092
|
-
"value": [
|
|
15093
|
-
"======================== ====== ===========",
|
|
15094
|
-
"time sym sumVolume",
|
|
15095
|
-
"======================== ====== ===========",
|
|
15096
|
-
"2018.10.08T01:02:00.000 A 38",
|
|
15097
|
-
"2018.10.08T01:02:00.000 B 40",
|
|
15098
|
-
"2018.10.08T01:03:00.000 A 25",
|
|
15099
|
-
"2018.10.08T01:03:00.000 B 9",
|
|
15100
|
-
"======================== ====== ===========",
|
|
15101
|
-
"",
|
|
15102
|
-
"The following paragraphs explain in details how the time-series engine conducts the calculations. For simplicity, regarding the \"time\" column we ignore the part of \"2018.10.08T\" and only use the \"hour:minute:second.millisecond\" part.",
|
|
15103
|
-
"",
|
|
15104
|
-
"First, the time-series engine adjusts the starting time of the first window to be 01:01:00.000. The first window is from 01:01:00.000 (inclusive) to 01:02:00.000 (exclusive). When the record (01:02:10.789,`A,15) arrives, it triggers the calculation of group A for the first window; the arrival of (01:02:12.005,`B,9) triggers the calculation of group B for the first window.",
|
|
15105
|
-
"",
|
|
15106
|
-
"The second window is from 01:02:00.000 (inclusive) to 01:03:00.000 (exclusive). When the record (01:04:02.236,`A,29) arrives, it triggers the calculation of group A for the second window; the arrival of (01:04:04.412,`B,32) triggers the calculation of group B for the second window.",
|
|
15107
|
-
"",
|
|
15108
|
-
"As there are no records since 01:05:00.000, no calculations are triggers for the window of [01:04:00.000, 01:05:00.000).",
|
|
15109
|
-
"",
|
|
15110
|
-
"The table output1 stores the calculation results of the time-series engine. As useWindowStartTime=false, the timestamps in the output table are the starting time of the windows + windowSize. If useWindowStartTime=true, then the timestamps in the output table are the starting time of the windows, as illustrated in the following example:",
|
|
15111
|
-
""
|
|
15112
|
-
]
|
|
15113
|
-
},
|
|
15114
|
-
{
|
|
15115
|
-
"type": "code",
|
|
15116
|
-
"language": "console",
|
|
15117
|
-
"value": [
|
|
15118
|
-
" ",
|
|
15119
|
-
" $ output2 = table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])",
|
|
15120
|
-
" $ engine2 = createTimeSeriesEngine(name=\"engine2\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output2, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=true)",
|
|
15121
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"engine2\", offset=0, handler=append!{engine2}, msgAsTable=true)",
|
|
15122
|
-
" ",
|
|
15123
|
-
" $ sleep(10)",
|
|
15124
|
-
" $ select * from output2;",
|
|
15125
|
-
""
|
|
15126
|
-
]
|
|
15127
|
-
},
|
|
15128
|
-
{
|
|
15129
|
-
"type": "text",
|
|
15130
|
-
"value": [
|
|
15131
|
-
"======================== ====== ===========",
|
|
15132
|
-
"time sym sumVolume",
|
|
15133
|
-
"======================== ====== ===========",
|
|
15134
|
-
"2018.10.08T01:01:00.000 A 38",
|
|
15135
|
-
"2018.10.08T01:01:00.000 B 40",
|
|
15136
|
-
"2018.10.08T01:02:00.000 A 25",
|
|
15137
|
-
"2018.10.08T01:02:00.000 B 9",
|
|
15138
|
-
"======================== ====== ===========",
|
|
15139
|
-
"",
|
|
15140
|
-
"In the following example, we specify updateTime to be 1000 (milliseconds):",
|
|
15141
|
-
""
|
|
15142
|
-
]
|
|
15143
|
-
},
|
|
15144
|
-
{
|
|
15145
|
-
"type": "code",
|
|
15146
|
-
"language": "console",
|
|
15147
|
-
"value": [
|
|
15148
|
-
" ",
|
|
15149
|
-
" $ output3 = keyedTable(`time`sym,10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])",
|
|
15150
|
-
" $ engine3 = createTimeSeriesEngine(name=\"engine3\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output3, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, updateTime=1000, useWindowStartTime=false)",
|
|
15151
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"engine3\", offset=0, handler=append!{engine3}, msgAsTable=true)",
|
|
15152
|
-
" ",
|
|
15153
|
-
" $ sleep(2001)",
|
|
15154
|
-
" $ select * from output3;",
|
|
15155
|
-
""
|
|
15156
|
-
]
|
|
15157
|
-
},
|
|
15158
|
-
{
|
|
15159
|
-
"type": "text",
|
|
15160
|
-
"value": [
|
|
15161
|
-
"======================== ====== ===========",
|
|
15162
|
-
"time sym sumVolume",
|
|
15163
|
-
"======================== ====== ===========",
|
|
15164
|
-
"2018.10.08T01:02:00.000 A 38",
|
|
15165
|
-
"2018.10.08T01:02:00.000 B 40",
|
|
15166
|
-
"2018.10.08T01:03:00.000 A 25",
|
|
15167
|
-
"2018.10.08T01:03:00.000 B 9",
|
|
15168
|
-
"2018.10.08T01:05:00.000 B 55",
|
|
15169
|
-
"2018.10.08T01:05:00.000 A 29",
|
|
15170
|
-
"======================== ====== ===========",
|
|
15171
|
-
"",
|
|
15172
|
-
"Next, we will explain the calculations triggered in the last window from 01:04:00.000 to 01:05:00.000.",
|
|
15173
|
-
"",
|
|
15174
|
-
"* At 01:04:04.236, 2000 milliseconds after the first record of group A arrived, a group A calculation is triggered. The result (01:05:00.000, \\`A, 29) is written to the output table.",
|
|
15175
|
-
"",
|
|
15176
|
-
"* The record of group B at 01:04:05.152 is the first record after the small window of [01:04:04.000, 01:04:05.000) that contains the group B record at 01:04:04.412. It triggers a group B calculation. The result (01:05:00.000,\"B\",32) is written to the output table.",
|
|
15177
|
-
"",
|
|
15178
|
-
"* 2000 milliseconds later, at 01:04:07.152, as the B group record at 1:04:05.152 has not been used in a calculation, a group B calculation is triggered. The result is (01:05:00.000,\"B\",55). As the output table's keys are columns 'time' and 'sym', the record of (01:05:00.000,\"B\",32) in the output table is updated and becomes (01:05:00.000,\"B\",55).",
|
|
15179
|
-
"",
|
|
15180
|
-
".. 下例中,共享流数据表“pubT”包含两个时间列,类型分别时DATE和SECOND,创建时间序列引擎时,通过设置timeColumn来将原来流数据表的两个时间列整合为输出表streamMinuteBar_1min中的一个类型为DATETIME的时间列。",
|
|
15181
|
-
"",
|
|
15182
|
-
"In the example, the shared stream table \"pubT\" contains two time columns with the type of DATE and SECOND. When creating time series engine, the two time columns could be combined into one column with the type of DATETIME in output table \"streamMinuteBar_1min\" by setting timeColumn.",
|
|
15183
|
-
""
|
|
15184
|
-
]
|
|
15185
|
-
},
|
|
15186
|
-
{
|
|
15187
|
-
"type": "code",
|
|
15188
|
-
"language": "console",
|
|
15189
|
-
"value": [
|
|
15190
|
-
"",
|
|
15191
|
-
" $ colNames=`symbol`date`minute`price`type`volume",
|
|
15192
|
-
" $ colTypes=`SYMBOL`DATE`SECOND`DOUBLE`STRING`INT",
|
|
15193
|
-
" $ pubTable = streamTable(10000:0,colNames,colTypes) ",
|
|
15194
|
-
" $ share pubTable as pubT",
|
|
15195
|
-
"",
|
|
15196
|
-
" $ colNames = `time`symbol`open`max`min`close`volume`amount`ret`vwap",
|
|
15197
|
-
" $ colTypes = `DATETIME`SYMBOL`DOUBLE`DOUBLE`DOUBLE`DOUBLE`INT`DOUBLE`DOUBLE`DOUBLE",
|
|
15198
|
-
" $ streamMinuteBar_1min = streamTable(10000:0,colNames, colTypes) ",
|
|
15199
|
-
"",
|
|
15200
|
-
" $ tsAggrOHLC = createTimeSeriesEngine(name=\"subT\", windowSize=60, step=60, metrics=<[first(price) as open ,max(price) as max,min(price) as min ,last(price) as close ,sum(volume) as volume ,wsum(volume, price) as amount ,(last(price)-first(price)/first(price)) as ret, (wsum(volume, price)/sum(volume)) as vwap]>, dummyTable=pubTable, outputTable=streamMinuteBar_1min, timeColumn=`date`minute, useSystemTime=false, keyColumn='symbol', fill=`none)",
|
|
15201
|
-
" $ subscribeTable(tableName=\"pubT\", actionName=\"subT\", offset=-1, handler=append!{tsAggrOHLC}, msgAsTable=true)",
|
|
15202
|
-
"",
|
|
15203
|
-
" $ insert into pubT values(`000001, 2021.04.05, 09:25:01, 1, 'B', 1)",
|
|
15204
|
-
" $ insert into pubT values(`000001, 2021.04.05, 09:30:05, 2, 'B', 1)",
|
|
15205
|
-
" $ insert into pubT values(`000001, 2021.04.05, 09:31:06, 3, 'B', 1)",
|
|
15206
|
-
" $ insert into pubT values(`000001, 2021.04.05, 09:35:05, 4, 'S', 4)",
|
|
15207
|
-
" $ insert into pubT values(`000001, 2021.04.05, 09:40:05, 5, 'S', 5)",
|
|
15208
|
-
" $ insert into pubT values(`000001, 2021.04.06, 09:25:05, 6, 'S', 6)",
|
|
15209
|
-
"",
|
|
15210
|
-
""
|
|
15211
|
-
]
|
|
15212
|
-
},
|
|
15213
|
-
{
|
|
15214
|
-
"type": "text",
|
|
15215
|
-
"value": [
|
|
15216
|
-
"====== ========== ======== ===== ==== ======",
|
|
15217
|
-
"symbol date minute price type volume",
|
|
15218
|
-
"====== ========== ======== ===== ==== ======",
|
|
15219
|
-
"000001 2021.04.05 09:25:01 1 B 1",
|
|
15220
|
-
"000001 2021.04.05 09:30:05 2 B 1",
|
|
15221
|
-
"000001 2021.04.05 09:31:06 3 B 1",
|
|
15222
|
-
"000001 2021.04.05 09:35:05 4 S 4",
|
|
15223
|
-
"000001 2021.04.05 09:40:05 5 S 5",
|
|
15224
|
-
"000001 2021.04.06 09:25:05 6 S 6",
|
|
15225
|
-
"====== ========== ======== ===== ==== ======",
|
|
15226
|
-
""
|
|
15227
|
-
]
|
|
15228
|
-
},
|
|
15229
|
-
{
|
|
15230
|
-
"type": "code",
|
|
15231
|
-
"language": "console",
|
|
15232
|
-
"value": [
|
|
15233
|
-
"",
|
|
15234
|
-
" $ select * from streamMinuteBar_1min",
|
|
15235
|
-
""
|
|
15236
|
-
]
|
|
15237
|
-
},
|
|
15238
|
-
{
|
|
15239
|
-
"type": "text",
|
|
15240
|
-
"value": [
|
|
15241
|
-
"=================== ====== ==== === === ===== ====== ====== === ====",
|
|
15242
|
-
"time symbol open max min close volume amount ret vwap",
|
|
15243
|
-
"=================== ====== ==== === === ===== ====== ====== === ====",
|
|
15244
|
-
"2021.04.05T09:26:00 000001 1 1 1 1 1 1 0 1",
|
|
15245
|
-
"2021.04.05T09:31:00 000001 2 2 2 2 1 2 1 2",
|
|
15246
|
-
"2021.04.05T09:32:00 000001 3 3 3 3 1 3 2 3",
|
|
15247
|
-
"2021.04.05T09:36:00 000001 4 4 4 4 4 16 3 4",
|
|
15248
|
-
"2021.04.05T09:41:00 000001 5 5 5 5 5 25 4 5",
|
|
15249
|
-
"=================== ====== ==== === === ===== ====== ====== === ====",
|
|
15250
|
-
""
|
|
15251
|
-
]
|
|
15252
|
-
},
|
|
15253
|
-
{
|
|
15254
|
-
"type": "code",
|
|
15255
|
-
"language": "console",
|
|
15256
|
-
"value": [
|
|
15257
|
-
"",
|
|
15258
|
-
" $ share streamTable(1000:0, `time`sym`qty, [DATETIME, SYMBOL, INT]) as trades",
|
|
15259
|
-
" $ output3 = table(10000:0, `time`sym`sumQty, [DATETIME, SYMBOL, INT])",
|
|
15260
|
-
"",
|
|
15261
|
-
" $ engine = createTimeSeriesEngine(name=\"engine\", windowSize=6, step=6, metrics=<sum(qty)>, dummyTable=trades, outputTable=output3, timeColumn=`time,keyColumn=`sym, forceTriggerTime=7,fill=1000)",
|
|
15262
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"engine\", offset=0, handler=append!{engine}, msgAsTable=true)",
|
|
15263
|
-
" $ sleep(1000)",
|
|
15264
|
-
" $ insert into engine values(2018.08.01T14:05:43,`A,1)",
|
|
15265
|
-
" $ insert into engine values(2018.08.01T14:05:43,`C,3)",
|
|
15266
|
-
" $ sleep(10)",
|
|
15267
|
-
" $ insert into engine values(2018.08.01T14:05:44,`B,1)",
|
|
15268
|
-
" $ sleep(80)",
|
|
15269
|
-
" $ insert into engine values(2018.08.01T14:05:52,`B,3)",
|
|
15270
|
-
" $ sleep(20)",
|
|
15271
|
-
" $ insert into engine values(2018.08.01T14:05:54,`A,3)",
|
|
15272
|
-
" $ sleep(10)",
|
|
15273
|
-
" $ insert into engine values(2018.08.01T14:05:55,`A,5)",
|
|
15274
|
-
" $ sleep(20)",
|
|
15275
|
-
" $ insert into engine values(2018.08.01T14:05:57,`B,5)",
|
|
15276
|
-
" $ sleep(50)",
|
|
15277
|
-
" $ insert into engine values(2018.08.01T14:06:12,`A,1)",
|
|
15278
|
-
" $ sleep(50)",
|
|
15279
|
-
" $ select * from output3 order by sym",
|
|
15280
|
-
""
|
|
15281
|
-
]
|
|
15282
|
-
},
|
|
15283
|
-
{
|
|
15284
|
-
"type": "text",
|
|
15285
|
-
"value": [
|
|
15286
|
-
"=================== === ======",
|
|
15287
|
-
"time sum Qty",
|
|
15288
|
-
"=================== === ======",
|
|
15289
|
-
"2018.08.01T14:05:46 A\t1",
|
|
15290
|
-
"2018.08.01T14:05:52 A\t1,000",
|
|
15291
|
-
"2018.08.01T14:05:58 A\t8",
|
|
15292
|
-
"2018.08.01T14:06:04 A\t1,000",
|
|
15293
|
-
"2018.08.01T14:06:10 A\t1,000",
|
|
15294
|
-
"2018.08.01T14:05:46 B\t1",
|
|
15295
|
-
"2018.08.01T14:05:52 B\t1,000",
|
|
15296
|
-
"2018.08.01T14:05:58 B\t8",
|
|
15297
|
-
"2018.08.01T14:05:46 C\t3",
|
|
15298
|
-
"2018.08.01T14:05:52 C\t1,000",
|
|
15299
|
-
"=================== === ======"
|
|
15300
|
-
]
|
|
15301
|
-
}
|
|
15302
|
-
]
|
|
15303
|
-
}
|
|
15304
|
-
]
|
|
15305
|
-
},
|
|
15306
14555
|
"createUser": {
|
|
15307
14556
|
"title": "createUser",
|
|
15308
14557
|
"type": "command",
|
|
@@ -24020,7 +23269,7 @@
|
|
|
24020
23269
|
{
|
|
24021
23270
|
"type": "text",
|
|
24022
23271
|
"value": [
|
|
24023
|
-
"`A` is a
|
|
23272
|
+
"`A` is a real symmetric matrix or a Hermitian matrix."
|
|
24024
23273
|
]
|
|
24025
23274
|
}
|
|
24026
23275
|
]
|
|
@@ -24032,7 +23281,9 @@
|
|
|
24032
23281
|
{
|
|
24033
23282
|
"type": "text",
|
|
24034
23283
|
"value": [
|
|
24035
|
-
"Calculate the eigenvalues and eigenvectors of A. Return a dictionary."
|
|
23284
|
+
"Calculate the eigenvalues and eigenvectors of A. Return a dictionary.",
|
|
23285
|
+
"",
|
|
23286
|
+
"The result of ``eig`` is the same as the result of ``numpy.linalg.eigh``."
|
|
24036
23287
|
]
|
|
24037
23288
|
}
|
|
24038
23289
|
]
|
|
@@ -30298,7 +29549,7 @@
|
|
|
30298
29549
|
"From version 1.30.21.3/2.00.9.3 onwards, ",
|
|
30299
29550
|
"",
|
|
30300
29551
|
"- For an administrator, the function returns all DFS tables in the cluster; ",
|
|
30301
|
-
"- For a non-admin user, the function returns DFS tables that can be accessed by the user, i.e., the user has DB_OWNER, TABLE_READ, TABLE_WRITE, TABLE_INSERT, TABLE_UPDATE, TABLE_DELETE, DB_READ, DB_WRITE, DB_INSERT, DB_UPDATE, DB_DELETE
|
|
29552
|
+
"- For a non-admin user, the function returns DFS tables that can be accessed by the user, i.e., the user has at least one of the following privileges: DB_OWNER, TABLE_READ, TABLE_WRITE, TABLE_INSERT, TABLE_UPDATE, TABLE_DELETE, DB_READ, DB_WRITE, DB_INSERT, DB_UPDATE, and DB_DELETE."
|
|
30302
29553
|
]
|
|
30303
29554
|
}
|
|
30304
29555
|
]
|
|
@@ -30340,7 +29591,7 @@
|
|
|
30340
29591
|
{
|
|
30341
29592
|
"type": "text",
|
|
30342
29593
|
"value": [
|
|
30343
|
-
"getCompletedQueries([
|
|
29594
|
+
"getCompletedQueries([top])"
|
|
30344
29595
|
]
|
|
30345
29596
|
}
|
|
30346
29597
|
]
|
|
@@ -30352,7 +29603,7 @@
|
|
|
30352
29603
|
{
|
|
30353
29604
|
"type": "text",
|
|
30354
29605
|
"value": [
|
|
30355
|
-
"`
|
|
29606
|
+
"`top` is a positive integer. It is optional with the default value of 10."
|
|
30356
29607
|
]
|
|
30357
29608
|
}
|
|
30358
29609
|
]
|
|
@@ -30364,7 +29615,31 @@
|
|
|
30364
29615
|
{
|
|
30365
29616
|
"type": "text",
|
|
30366
29617
|
"value": [
|
|
30367
|
-
"Return descriptive information about the most recently finished
|
|
29618
|
+
"Return descriptive information about the most recently finished *top* SQL queries on DFS databases at the local node. It returns a table with the following columns:",
|
|
29619
|
+
"",
|
|
29620
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29621
|
+
"| Name | Meaning |",
|
|
29622
|
+
"+===========+======================================================================================================================================================+",
|
|
29623
|
+
"| userID | the user ID |",
|
|
29624
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29625
|
+
"| sessionID | the session ID |",
|
|
29626
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29627
|
+
"| jobID | the job ID |",
|
|
29628
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29629
|
+
"| rootID | the root job ID |",
|
|
29630
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29631
|
+
"| level | the level of jobs. The root job starts from level 0, the tasks broken down from the root job are marked as level 1, and subtasks level 2, and so on. |",
|
|
29632
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29633
|
+
"| startTime | the start time of a query (of NANOTIMESTAMP type) |",
|
|
29634
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29635
|
+
"| endTime | the end time of a query (of NANOTIMESTAMP type) |",
|
|
29636
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29637
|
+
"| jobDesc | the job description |",
|
|
29638
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29639
|
+
"| errorMsg | error messages |",
|
|
29640
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29641
|
+
"| remoteIP | the IP address of the client that initiates a query |",
|
|
29642
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
30368
29643
|
"",
|
|
30369
29644
|
"Only administrators can use this function. Before using the function, please set the configuration parameter perfMonitoring=1 to enable performance monitoring."
|
|
30370
29645
|
]
|
|
@@ -30595,7 +29870,48 @@
|
|
|
30595
29870
|
{
|
|
30596
29871
|
"type": "text",
|
|
30597
29872
|
"value": [
|
|
30598
|
-
"Return the descriptive information about the running interactive jobs of the local node."
|
|
29873
|
+
"Return the descriptive information about the running interactive jobs of the local node.",
|
|
29874
|
+
"",
|
|
29875
|
+
"It returns a table with the following columns:",
|
|
29876
|
+
"",
|
|
29877
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29878
|
+
"| Name | Meaning |",
|
|
29879
|
+
"+=====================+======================================================================================================================================================+",
|
|
29880
|
+
"| node | the alias of the local node |",
|
|
29881
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29882
|
+
"| userID | the user ID |",
|
|
29883
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29884
|
+
"| rootJobId | the root job ID |",
|
|
29885
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29886
|
+
"| jobType | the job type |",
|
|
29887
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29888
|
+
"| desc | the job description |",
|
|
29889
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29890
|
+
"| priority | priority of the job which is marked as integers ranging from 0 to 9 |",
|
|
29891
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29892
|
+
"| parallelism | the parallelism, i.e., the maximum number of jobs that can run in parallel |",
|
|
29893
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29894
|
+
"| receiveTime | the time when a job is received by the node |",
|
|
29895
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29896
|
+
"| sessionId | the ID of the session where the job is submitted |",
|
|
29897
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29898
|
+
"| remoteIP | the IP address of the client where the job is submitted |",
|
|
29899
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29900
|
+
"| remotePort | the port number of the client where the job is submitted |",
|
|
29901
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29902
|
+
"| totalTasks | the total tasks broken down from the job |",
|
|
29903
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29904
|
+
"| finishedTasks | the number of finished tasks |",
|
|
29905
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29906
|
+
"| runningTask | the number of running tasks |",
|
|
29907
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29908
|
+
"| firstTaskStartTime | the start time of the first task |",
|
|
29909
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29910
|
+
"| latestTaskStartTime | the start time of the latest task |",
|
|
29911
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29912
|
+
"| queue | the task queues: The value can be normal queue (for workers); web queue (for web workers); local task queue; batch job queue |",
|
|
29913
|
+
"+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
29914
|
+
""
|
|
30599
29915
|
]
|
|
30600
29916
|
}
|
|
30601
29917
|
]
|
|
@@ -31116,7 +30432,12 @@
|
|
|
31116
30432
|
{
|
|
31117
30433
|
"type": "text",
|
|
31118
30434
|
"value": [
|
|
31119
|
-
"Return all the function views."
|
|
30435
|
+
"Return all the function views. ",
|
|
30436
|
+
"",
|
|
30437
|
+
"It returns a table with the following columns:",
|
|
30438
|
+
"",
|
|
30439
|
+
"* name: the function name.",
|
|
30440
|
+
"* body: the function body."
|
|
31120
30441
|
]
|
|
31121
30442
|
}
|
|
31122
30443
|
]
|
|
@@ -31620,7 +30941,23 @@
|
|
|
31620
30941
|
{
|
|
31621
30942
|
"type": "text",
|
|
31622
30943
|
"value": [
|
|
31623
|
-
"Monitor the number of jobs and tasks that are are running or in the job queue."
|
|
30944
|
+
"Monitor the number of jobs and tasks that are are running or in the job queue.",
|
|
30945
|
+
"",
|
|
30946
|
+
"It returns a dictionary with the following keys:",
|
|
30947
|
+
"",
|
|
30948
|
+
"+-------------------+-------------------------------------------------+",
|
|
30949
|
+
"| Keys | Meaning |",
|
|
30950
|
+
"+===================+=================================================+",
|
|
30951
|
+
"| queuedLocalTasks | the number of local tasks waiting in the queue |",
|
|
30952
|
+
"+-------------------+-------------------------------------------------+",
|
|
30953
|
+
"| runningLocalTasks | the number of running local tasks |",
|
|
30954
|
+
"+-------------------+-------------------------------------------------+",
|
|
30955
|
+
"| queuedJobs | the number of jobs in the queue |",
|
|
30956
|
+
"+-------------------+-------------------------------------------------+",
|
|
30957
|
+
"| runningJobs | the number of running jobs |",
|
|
30958
|
+
"+-------------------+-------------------------------------------------+",
|
|
30959
|
+
"| queuedRemoteTasks | the number of remote tasks waiting in the queue |",
|
|
30960
|
+
"+-------------------+-------------------------------------------------+"
|
|
31624
30961
|
]
|
|
31625
30962
|
}
|
|
31626
30963
|
]
|
|
@@ -31690,7 +31027,41 @@
|
|
|
31690
31027
|
{
|
|
31691
31028
|
"type": "text",
|
|
31692
31029
|
"value": [
|
|
31693
|
-
"Retrieve the status of a batch job.
|
|
31030
|
+
"Retrieve the status of a batch job. ",
|
|
31031
|
+
"",
|
|
31032
|
+
"It returns a table with the following columns:",
|
|
31033
|
+
"",
|
|
31034
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31035
|
+
"| Name | Meaning |",
|
|
31036
|
+
"+==============+============================================================================+",
|
|
31037
|
+
"| node | the alias of the local node |",
|
|
31038
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31039
|
+
"| userID | the user ID |",
|
|
31040
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31041
|
+
"| jobId | the job ID |",
|
|
31042
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31043
|
+
"| rootJobId | the root job ID |",
|
|
31044
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31045
|
+
"| jobDesc | the job description |",
|
|
31046
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31047
|
+
"| priority | priority of the job which is marked as integers ranging from 0 to 9 |",
|
|
31048
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31049
|
+
"| parallelism | the parallelism, i.e., the maximum number of jobs that can run in parallel |",
|
|
31050
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31051
|
+
"| clientIp | the IP address of the client where the job is submitted |",
|
|
31052
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31053
|
+
"| clientPort | the port number of the client where the job is submitted |",
|
|
31054
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31055
|
+
"| receivedTime | the time (of TIMESTAMP type) when a job is received by the node |",
|
|
31056
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31057
|
+
"| startTime | the start time of jobs (of TIMESTAMP type) |",
|
|
31058
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31059
|
+
"| endTime | the end time of jobs (of TIMESTAMP type) |",
|
|
31060
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31061
|
+
"| errorMessage | error messages |",
|
|
31062
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
31063
|
+
"",
|
|
31064
|
+
"For details about batch jobs please refer to :doc:`/SystemManagement/BatchJobManagement`."
|
|
31694
31065
|
]
|
|
31695
31066
|
}
|
|
31696
31067
|
]
|
|
@@ -32216,7 +31587,12 @@
|
|
|
32216
31587
|
{
|
|
32217
31588
|
"type": "text",
|
|
32218
31589
|
"value": [
|
|
32219
|
-
"Return the allocated memory and the unused memory."
|
|
31590
|
+
"Return the allocated memory and the unused memory.",
|
|
31591
|
+
"",
|
|
31592
|
+
"It returns a dictionary with the following keys:",
|
|
31593
|
+
"",
|
|
31594
|
+
"* freeBytes: the allocated memory (in Bytes) for the current node. ",
|
|
31595
|
+
"* allocatedBytes: the unused memory (in Bytes) for the current node."
|
|
32220
31596
|
]
|
|
32221
31597
|
}
|
|
32222
31598
|
]
|
|
@@ -33231,7 +32607,7 @@
|
|
|
33231
32607
|
{
|
|
33232
32608
|
"type": "text",
|
|
33233
32609
|
"value": [
|
|
33234
|
-
"`n` is
|
|
32610
|
+
"`n` is a positive integer. If it is unspecified, return all batch jobs since the session is started."
|
|
33235
32611
|
]
|
|
33236
32612
|
}
|
|
33237
32613
|
]
|
|
@@ -33243,7 +32619,39 @@
|
|
|
33243
32619
|
{
|
|
33244
32620
|
"type": "text",
|
|
33245
32621
|
"value": [
|
|
33246
|
-
"Retrieve the status of most recent n batch jobs on the local node.
|
|
32622
|
+
"Retrieve the status of most recent n batch jobs on the local node. ",
|
|
32623
|
+
"",
|
|
32624
|
+
"It returns a table with the following columns:",
|
|
32625
|
+
"",
|
|
32626
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32627
|
+
"| Name | Meaning |",
|
|
32628
|
+
"+==============+============================================================================+",
|
|
32629
|
+
"| node | the alias of the local node |",
|
|
32630
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32631
|
+
"| userID | the user ID |",
|
|
32632
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32633
|
+
"| jobId | the job ID |",
|
|
32634
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32635
|
+
"| rootJobId | the root job ID |",
|
|
32636
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32637
|
+
"| jobDesc | the job description |",
|
|
32638
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32639
|
+
"| priority | priority of the job which is marked as integers ranging from 0 to 9 |",
|
|
32640
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32641
|
+
"| parallelism | the parallelism, i.e., the maximum number of jobs that can run in parallel |",
|
|
32642
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32643
|
+
"| clientIp | the IP address of the client where the job is submitted |",
|
|
32644
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32645
|
+
"| clientPort | the port number of the client where the job is submitted |",
|
|
32646
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32647
|
+
"| receivedTime | the time (of TIMESTAMP type) when a job is received by the node |",
|
|
32648
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32649
|
+
"| startTime | the start time of jobs (of TIMESTAMP type) |",
|
|
32650
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32651
|
+
"| endTime | the end time of jobs (of TIMESTAMP type) |",
|
|
32652
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
32653
|
+
"| errorMessage | error messages |",
|
|
32654
|
+
"+--------------+----------------------------------------------------------------------------+",
|
|
33247
32655
|
"",
|
|
33248
32656
|
"For details please refer to :doc:`/SystemManagement/BatchJobManagement`."
|
|
33249
32657
|
]
|
|
@@ -33601,7 +33009,33 @@
|
|
|
33601
33009
|
{
|
|
33602
33010
|
"type": "text",
|
|
33603
33011
|
"value": [
|
|
33604
|
-
"Return descriptive information about the SQL queries that are being executed on the local node.
|
|
33012
|
+
"Return descriptive information about the SQL queries that are being executed on the local node. It returns a table with the following columns:",
|
|
33013
|
+
"",
|
|
33014
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33015
|
+
"| Name | Meaning |",
|
|
33016
|
+
"+===========+======================================================================================================================================================+",
|
|
33017
|
+
"| userID | the user ID |",
|
|
33018
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33019
|
+
"| sessionID | the session ID |",
|
|
33020
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33021
|
+
"| jobID | the job ID |",
|
|
33022
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33023
|
+
"| rootID | the root job ID |",
|
|
33024
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33025
|
+
"| level | the level of jobs. The root job starts from level 0, the tasks broken down from the root job are marked as level 1, and subtasks level 2, and so on. |",
|
|
33026
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33027
|
+
"| startTime | the start time of a query (of NANOTIMESTAMP type) |",
|
|
33028
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33029
|
+
"| endTime | the end time of a query (of NANOTIMESTAMP type) |",
|
|
33030
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33031
|
+
"| jobDesc | the job description |",
|
|
33032
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33033
|
+
"| errorMsg | error messages |",
|
|
33034
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33035
|
+
"| remoteIP | the IP address of the client that initiates a query |",
|
|
33036
|
+
"+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
33037
|
+
"",
|
|
33038
|
+
"To use this function, we must set perfMonitoring=1 in the configuration file to enable performance monitoring. "
|
|
33605
33039
|
]
|
|
33606
33040
|
}
|
|
33607
33041
|
]
|
|
@@ -33671,7 +33105,29 @@
|
|
|
33671
33105
|
{
|
|
33672
33106
|
"type": "text",
|
|
33673
33107
|
"value": [
|
|
33674
|
-
"Return a table of scheduled jobs. If jobIdPattern is not specified, return all scheduled jobs. "
|
|
33108
|
+
"Return a table of scheduled jobs. If *jobIdPattern* is not specified, return all scheduled jobs. ",
|
|
33109
|
+
"",
|
|
33110
|
+
"It returns a table with the following columns:",
|
|
33111
|
+
"",
|
|
33112
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33113
|
+
"| Name | Meaning |",
|
|
33114
|
+
"+===============+=======================================================================+",
|
|
33115
|
+
"| userId | the user ID |",
|
|
33116
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33117
|
+
"| jobId | the job ID |",
|
|
33118
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33119
|
+
"| jobDesc | the job description |",
|
|
33120
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33121
|
+
"| startDate | the start date of the scheduled job (of DATE type) |",
|
|
33122
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33123
|
+
"| endDate | the end date of the scheduled job (of DATE type) |",
|
|
33124
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33125
|
+
"| frequency | the frequency to execute the scheduled job |",
|
|
33126
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33127
|
+
"| scheduledTime | the specified time to execute each job (of MINUTE type) |",
|
|
33128
|
+
"+---------------+-----------------------------------------------------------------------+",
|
|
33129
|
+
"| days | the specified days to execute the scheduled job when frequency=W or M |",
|
|
33130
|
+
"+---------------+-----------------------------------------------------------------------+"
|
|
33675
33131
|
]
|
|
33676
33132
|
}
|
|
33677
33133
|
]
|
|
@@ -33743,11 +33199,48 @@
|
|
|
33743
33199
|
{
|
|
33744
33200
|
"type": "text",
|
|
33745
33201
|
"value": [
|
|
33746
|
-
"Return information about memory usage of all sessions on the current node.
|
|
33202
|
+
"Return information about memory usage of all sessions on the current node. It returns a table containing the following columns:",
|
|
33203
|
+
"",
|
|
33204
|
+
"* userId: the user ID or the cache type (in the format of \\_\\_xxx\\_\\_). ",
|
|
33205
|
+
"* sessionId: the session ID. ",
|
|
33206
|
+
"* memSize: memory usage of all sessions (in Bytes). ",
|
|
33207
|
+
"* remoteIP: the IP address of the client that initiates the session. ",
|
|
33208
|
+
"* remotePort: the port number of the client that initiates the session. ",
|
|
33209
|
+
"* createTime: the creation time (of TIMESTAMP data type) of session.",
|
|
33210
|
+
"* lastActiveTime: last timestamp of the execution.",
|
|
33211
|
+
"",
|
|
33212
|
+
"Cache Types:",
|
|
33747
33213
|
"",
|
|
33748
|
-
"
|
|
33214
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33215
|
+
"| Cache Types | Meaning |",
|
|
33216
|
+
"+==============================+=============================================================+",
|
|
33217
|
+
"| \\_\\_DimensionalTable\\_\\_ | the cache of dimension tables (in Bytes) |",
|
|
33218
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33219
|
+
"| \\_\\_SharedTable\\_\\_ | the cache of shared tables (in Bytes) |",
|
|
33220
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33221
|
+
"| \\_\\_OLAPTablet\\_\\_ | the cache of the OLAP databases (in Bytes) |",
|
|
33222
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33223
|
+
"| \\_\\_OLAPCacheEngine\\_\\_ | the memory usage of OLAP cache engine (in Bytes) |",
|
|
33224
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33225
|
+
"| \\_\\_OLAPCachedSymbolBase\\_\\_ | the cache of SYMBOL base in OLAP engine (in Bytes) |",
|
|
33226
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33227
|
+
"| \\_\\_DFSMetadata\\_\\_ | the cache of DFS metadata (in Bytes) |",
|
|
33228
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33229
|
+
"| \\_\\_TSDBCacheEngine\\_\\_ | the cache of the TSDB engine (in Bytes) |",
|
|
33230
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33231
|
+
"| \\_\\_TSDBLevelFileIndex\\_\\_ | the cache of level file index in the TSDB engine (in Bytes) |",
|
|
33232
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33233
|
+
"| \\_\\_TSDBCachedSymbolBase\\_\\_ | the cache of SYMBOL base in TSDB engine (in Bytes) |",
|
|
33234
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33235
|
+
"| \\_\\_StreamingPubQueue\\_\\_ | the unprocessed messages in a publisher queue |",
|
|
33236
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33237
|
+
"| \\_\\_StreamingSubQueue\\_\\_ | the unprocessed messages in a subscriber queue |",
|
|
33238
|
+
"+------------------------------+-------------------------------------------------------------+",
|
|
33749
33239
|
"",
|
|
33750
|
-
"Note:
|
|
33240
|
+
"Note:",
|
|
33241
|
+
"",
|
|
33242
|
+
"* This function does not return the memory occupied by tasks being executed in the session.",
|
|
33243
|
+
"* For the columns *createTime* and *lastActiveTime* in the result table, versions before 1.30.21.4/2.00.9.4 return GMT time. From version 1.30.21.4/2.00.9.4 onwards, these columns return time in your current time zone. "
|
|
33751
33244
|
]
|
|
33752
33245
|
}
|
|
33753
33246
|
]
|
|
@@ -33795,52 +33288,7 @@
|
|
|
33795
33288
|
"__StreamingSubQueue__ 0 0.0.0.0 ",
|
|
33796
33289
|
"",
|
|
33797
33290
|
"admin 2882591513 1416 60.176.105.0 20861 2023.02.15T02:15:22.384 2023.02.15T02:24:16.307",
|
|
33798
|
-
"=========================== ============ ======== ============== ========== =========================== ========================= "
|
|
33799
|
-
""
|
|
33800
|
-
]
|
|
33801
|
-
},
|
|
33802
|
-
{
|
|
33803
|
-
"type": "code",
|
|
33804
|
-
"language": "console",
|
|
33805
|
-
"value": [
|
|
33806
|
-
"",
|
|
33807
|
-
" $ update t set createTime=localtime(createTime), lastActiveTime=localtime(lastActiveTime) where not userId like \"__%__\"",
|
|
33808
|
-
""
|
|
33809
|
-
]
|
|
33810
|
-
},
|
|
33811
|
-
{
|
|
33812
|
-
"type": "text",
|
|
33813
|
-
"value": [
|
|
33814
|
-
"================================= ============ ======== ============== ========== ======================= ========================= ",
|
|
33815
|
-
"userId sessionId memSize remoteIP remotePort createTime lastActiveTime ",
|
|
33816
|
-
"================================= ============ ======== ============== ========== ======================= =========================",
|
|
33817
|
-
"__DimensionalTable__ 0 0.0.0.0 ",
|
|
33818
|
-
"",
|
|
33819
|
-
"__SharedTable__ 0 0.0.0.0 ",
|
|
33820
|
-
"",
|
|
33821
|
-
"__OLAPTablet__ 0 0.0.0.0 ",
|
|
33822
|
-
"",
|
|
33823
|
-
"__OLAPCacheEngine__ 0 0.0.0.0 ",
|
|
33824
|
-
"",
|
|
33825
|
-
"__OLAPCachedSymbolBa... 0 0.0.0.0 ",
|
|
33826
|
-
"",
|
|
33827
|
-
"__DFSMetadata__ 2769 0.0.0.0 ",
|
|
33828
|
-
"",
|
|
33829
|
-
"__TSDBCacheEngine__ 0 0.0.0.0 ",
|
|
33830
|
-
"",
|
|
33831
|
-
"__TSDBLevelFileIndex__ 0 0.0.0.0 ",
|
|
33832
|
-
"",
|
|
33833
|
-
"__TSDBCachedSymbolBa... 0 0.0.0.0 ",
|
|
33834
|
-
"",
|
|
33835
|
-
"__StreamingPubQueue__ 0 0.0.0.0 ",
|
|
33836
|
-
"",
|
|
33837
|
-
"__StreamingSubQueue__ 0 0.0.0.0 ",
|
|
33838
|
-
"",
|
|
33839
|
-
"admin 1195587396 1416 60.176.105.0 20874 2023.02.14T21:26:14.004 2023.02.14T21:27:27.463",
|
|
33840
|
-
"================================= ============ ======== ============== ========== ======================= ========================= ",
|
|
33841
|
-
"",
|
|
33842
|
-
".. meta:: ",
|
|
33843
|
-
" :keywords: get"
|
|
33291
|
+
"=========================== ============ ======== ============== ========== =========================== ========================= "
|
|
33844
33292
|
]
|
|
33845
33293
|
}
|
|
33846
33294
|
]
|
|
@@ -35504,8 +34952,9 @@
|
|
|
35504
34952
|
"* version: the version number.",
|
|
35505
34953
|
"* rowNum: the number of records in the partition.",
|
|
35506
34954
|
"* diskUsage: the disk space occupied by partition.",
|
|
35507
|
-
"* createCids
|
|
35508
|
-
"* latestPhysicalDir
|
|
34955
|
+
"* createCids: the Cids created when updating/deleting the table.",
|
|
34956
|
+
"* latestPhysicalDir: the temporary physical directory storing the data generated by the operation with the latest Cid.",
|
|
34957
|
+
"* diskUsage: the disk space occupied by partition (in Bytes)."
|
|
35509
34958
|
]
|
|
35510
34959
|
}
|
|
35511
34960
|
]
|
|
@@ -39454,7 +38903,7 @@
|
|
|
39454
38903
|
{
|
|
39455
38904
|
"type": "text",
|
|
39456
38905
|
"value": [
|
|
39457
|
-
"interpolate(
|
|
38906
|
+
"interpolate(X, [method='linear'], [limit], [inplace=false], [limitDirection='forward'], [limitArea])"
|
|
39458
38907
|
]
|
|
39459
38908
|
}
|
|
39460
38909
|
]
|
|
@@ -39466,7 +38915,7 @@
|
|
|
39466
38915
|
{
|
|
39467
38916
|
"type": "text",
|
|
39468
38917
|
"value": [
|
|
39469
|
-
"`
|
|
38918
|
+
"`X` is a numeric vector. ",
|
|
39470
38919
|
"",
|
|
39471
38920
|
"`method` is a string indicating how to fill the NULL values. It can take the following values and the default value is 'linear'. ",
|
|
39472
38921
|
"",
|
|
@@ -39479,9 +38928,9 @@
|
|
|
39479
38928
|
"",
|
|
39480
38929
|
"`inplace` is a Boolean value indicating whether to update the input vector array. The default value is false, which means a new vector will be returned. ",
|
|
39481
38930
|
"",
|
|
39482
|
-
"`
|
|
38931
|
+
"`limitDirection` is a string indicating the direction to fill NULL values. It can take the following values: 'forward', 'backward' and 'both'. The default value is 'forward'. ",
|
|
39483
38932
|
"",
|
|
39484
|
-
"`
|
|
38933
|
+
"`limitArea` is a string indicating restrictions regarding filling NULL values. It can take the following values and the default value is empty string \"\". ",
|
|
39485
38934
|
"",
|
|
39486
38935
|
"* empty string: no restrictions.",
|
|
39487
38936
|
"* inside: only fill NULLs surrounded by valid values. ",
|
|
@@ -39516,22 +38965,22 @@
|
|
|
39516
38965
|
" $ interpolate(a);",
|
|
39517
38966
|
" [,,1,2,3,4,5,6,6,6]",
|
|
39518
38967
|
"",
|
|
39519
|
-
" $ interpolate(
|
|
38968
|
+
" $ interpolate(X=a, method=\"pad\");",
|
|
39520
38969
|
" [,,1,2,2,2,5,6,6,6]",
|
|
39521
38970
|
"",
|
|
39522
|
-
" $ interpolate(
|
|
38971
|
+
" $ interpolate(X=a, limitDirection='both');",
|
|
39523
38972
|
" [1,1,1,2,3,4,5,6,6,6]",
|
|
39524
38973
|
"",
|
|
39525
|
-
" $ interpolate(
|
|
38974
|
+
" $ interpolate(X=a, limit=1, limitDirection='both');",
|
|
39526
38975
|
" [,1,1,2,3,4,5,6,6,]",
|
|
39527
38976
|
"",
|
|
39528
|
-
" $ interpolate(
|
|
38977
|
+
" $ interpolate(X=a, limitDirection='both', limitArea='outside');",
|
|
39529
38978
|
" [1,1,1,2,,,5,6,6,6]",
|
|
39530
38979
|
"",
|
|
39531
38980
|
" $ a;",
|
|
39532
38981
|
" [,,1,2,,,5,6,,]",
|
|
39533
38982
|
"",
|
|
39534
|
-
" $ interpolate(
|
|
38983
|
+
" $ interpolate(X=a, limitDirection='backward', inplace=true);",
|
|
39535
38984
|
" [1,1,1,2,3,4,5,6,,]",
|
|
39536
38985
|
"",
|
|
39537
38986
|
" $ a;",
|
|
@@ -45681,7 +45130,37 @@
|
|
|
45681
45130
|
{
|
|
45682
45131
|
"type": "text",
|
|
45683
45132
|
"value": [
|
|
45684
|
-
"Display information regarding the DolphinDB license."
|
|
45133
|
+
"Display information regarding the DolphinDB license.",
|
|
45134
|
+
"",
|
|
45135
|
+
"It returns a dictionary with the following keys:",
|
|
45136
|
+
"",
|
|
45137
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45138
|
+
"| Keys | Meaning |",
|
|
45139
|
+
"+==================+==========================================================================================================================================================+",
|
|
45140
|
+
"| authorization | authorization types: trial/test/commercial |",
|
|
45141
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45142
|
+
"| licenseType | The license type: 1: fingerprint authentication; 2: online verification; 3: license server; 0: others |",
|
|
45143
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45144
|
+
"| maxMemoryPerNode | the maximum memory for each node (in GB) |",
|
|
45145
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45146
|
+
"| bindCores | CPU ID(s) (starting from 0) that are already bound to the DolphinDB process. Note that it takes effect only when bindCPU is configured to true. |",
|
|
45147
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45148
|
+
"| maxCoresPerNode | the maximum cores for each node |",
|
|
45149
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45150
|
+
"| clientName | the client name |",
|
|
45151
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45152
|
+
"| port | the port number bound to the node. It is returned only for the license server and its connected nodes. |",
|
|
45153
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45154
|
+
"| bindCPU | whether a DolphinDB process is bound to a CPU |",
|
|
45155
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45156
|
+
"| expiration | the expiration date of the license |",
|
|
45157
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45158
|
+
"| maxNodes | the maximum number of nodes for the cluster |",
|
|
45159
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45160
|
+
"| version | the version number of the server. Only a server that is not higher than the version can be used. If it is empty, there is no restriction on the version. |",
|
|
45161
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+",
|
|
45162
|
+
"| modules | the module name. Only specified modules can be used. If modules = -1, there is no restriction on the module used. |",
|
|
45163
|
+
"+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+"
|
|
45685
45164
|
]
|
|
45686
45165
|
}
|
|
45687
45166
|
]
|
|
@@ -50148,7 +49627,7 @@
|
|
|
50148
49627
|
{
|
|
50149
49628
|
"type": "text",
|
|
50150
49629
|
"value": [
|
|
50151
|
-
"makeCall(F, args
|
|
49630
|
+
"makeCall(F, args...)"
|
|
50152
49631
|
]
|
|
50153
49632
|
}
|
|
50154
49633
|
]
|
|
@@ -50162,7 +49641,7 @@
|
|
|
50162
49641
|
"value": [
|
|
50163
49642
|
"`F` is a function.",
|
|
50164
49643
|
"",
|
|
50165
|
-
"`args
|
|
49644
|
+
"`args` are the required parameters of *F*."
|
|
50166
49645
|
]
|
|
50167
49646
|
}
|
|
50168
49647
|
]
|
|
@@ -55536,7 +55015,9 @@
|
|
|
55536
55015
|
"value": [
|
|
55537
55016
|
"If *X* is a vector, calculate the most frequently occurring value in *X*.",
|
|
55538
55017
|
"",
|
|
55539
|
-
"If *X* is a matrix, calculate the most frequently occurring value in each column of *X* and return a vector.",
|
|
55018
|
+
"If *X* is a matrix/table, calculate the most frequently occurring value in each column of *X* and return a vector/table.",
|
|
55019
|
+
"",
|
|
55020
|
+
"This function counts the occurrences of unique values (keys) in *X* using a hash table. If there are multiple keys with the highest count, the function returns the first key in the hash table. Note that the hash algorithm used by this function varies for different data types, so the output results may differ.",
|
|
55540
55021
|
"",
|
|
55541
55022
|
"As with all aggregate functions, NULL values are not included in the calculation."
|
|
55542
55023
|
]
|
|
@@ -61848,122 +61329,6 @@
|
|
|
61848
61329
|
}
|
|
61849
61330
|
]
|
|
61850
61331
|
},
|
|
61851
|
-
"or": {
|
|
61852
|
-
"title": "or",
|
|
61853
|
-
"type": "function",
|
|
61854
|
-
"children": [
|
|
61855
|
-
{
|
|
61856
|
-
"title": "Syntax",
|
|
61857
|
-
"type": "grammer",
|
|
61858
|
-
"children": [
|
|
61859
|
-
{
|
|
61860
|
-
"type": "text",
|
|
61861
|
-
"value": [
|
|
61862
|
-
"or(X, Y) or X||Y"
|
|
61863
|
-
]
|
|
61864
|
-
}
|
|
61865
|
-
]
|
|
61866
|
-
},
|
|
61867
|
-
{
|
|
61868
|
-
"title": "Arguments",
|
|
61869
|
-
"type": "parameters",
|
|
61870
|
-
"children": [
|
|
61871
|
-
{
|
|
61872
|
-
"type": "text",
|
|
61873
|
-
"value": [
|
|
61874
|
-
"`X` and `Y` is a scalar/pair/vector/matrix. If X or Y is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size."
|
|
61875
|
-
]
|
|
61876
|
-
}
|
|
61877
|
-
]
|
|
61878
|
-
},
|
|
61879
|
-
{
|
|
61880
|
-
"title": "Details",
|
|
61881
|
-
"type": "detail",
|
|
61882
|
-
"children": [
|
|
61883
|
-
{
|
|
61884
|
-
"type": "text",
|
|
61885
|
-
"value": [
|
|
61886
|
-
"Return the element-by-element logical X OR Y."
|
|
61887
|
-
]
|
|
61888
|
-
}
|
|
61889
|
-
]
|
|
61890
|
-
},
|
|
61891
|
-
{
|
|
61892
|
-
"title": "Examples",
|
|
61893
|
-
"type": "example",
|
|
61894
|
-
"children": [
|
|
61895
|
-
{
|
|
61896
|
-
"type": "code",
|
|
61897
|
-
"language": "console",
|
|
61898
|
-
"value": [
|
|
61899
|
-
"",
|
|
61900
|
-
" $ >1 || 0;",
|
|
61901
|
-
" 1",
|
|
61902
|
-
"",
|
|
61903
|
-
" $ x=1 0 1;",
|
|
61904
|
-
" $ x || 0; ",
|
|
61905
|
-
" [1,0,1]",
|
|
61906
|
-
"",
|
|
61907
|
-
" $ y=0 1 0;",
|
|
61908
|
-
" $ x or y;",
|
|
61909
|
-
" [1,1,1]",
|
|
61910
|
-
""
|
|
61911
|
-
]
|
|
61912
|
-
},
|
|
61913
|
-
{
|
|
61914
|
-
"type": "code",
|
|
61915
|
-
"language": "console",
|
|
61916
|
-
"value": [
|
|
61917
|
-
"",
|
|
61918
|
-
" $ t=table(1..3 as id, 4..6 as value);",
|
|
61919
|
-
" $ t; ",
|
|
61920
|
-
""
|
|
61921
|
-
]
|
|
61922
|
-
},
|
|
61923
|
-
{
|
|
61924
|
-
"type": "text",
|
|
61925
|
-
"value": [
|
|
61926
|
-
"+----------+--------+",
|
|
61927
|
-
"|id | value |",
|
|
61928
|
-
"+==========+========+",
|
|
61929
|
-
"| 1 | 4 |",
|
|
61930
|
-
"+----------+--------+",
|
|
61931
|
-
"| 2 | 5 |",
|
|
61932
|
-
"+----------+--------+",
|
|
61933
|
-
"| 3 | 6 |",
|
|
61934
|
-
"+----------+--------+",
|
|
61935
|
-
""
|
|
61936
|
-
]
|
|
61937
|
-
},
|
|
61938
|
-
{
|
|
61939
|
-
"type": "code",
|
|
61940
|
-
"language": "sql",
|
|
61941
|
-
"value": [
|
|
61942
|
-
"",
|
|
61943
|
-
" select id, value from t where id=2 or id=3; ",
|
|
61944
|
-
""
|
|
61945
|
-
]
|
|
61946
|
-
},
|
|
61947
|
-
{
|
|
61948
|
-
"type": "text",
|
|
61949
|
-
"value": [
|
|
61950
|
-
"============= =============",
|
|
61951
|
-
"id value",
|
|
61952
|
-
"============= =============",
|
|
61953
|
-
"2 5",
|
|
61954
|
-
"3 6",
|
|
61955
|
-
"============= =============",
|
|
61956
|
-
"",
|
|
61957
|
-
"Related functions: :doc:`../a/and`, :doc:`../n/not`",
|
|
61958
|
-
"",
|
|
61959
|
-
".. meta:: ",
|
|
61960
|
-
" :keywords: or"
|
|
61961
|
-
]
|
|
61962
|
-
}
|
|
61963
|
-
]
|
|
61964
|
-
}
|
|
61965
|
-
]
|
|
61966
|
-
},
|
|
61967
61332
|
"pack": {
|
|
61968
61333
|
"title": "pack",
|
|
61969
61334
|
"type": "function",
|
|
@@ -79286,7 +78651,7 @@
|
|
|
79286
78651
|
{
|
|
79287
78652
|
"type": "text",
|
|
79288
78653
|
"value": [
|
|
79289
|
-
"Modify the maximum memory allocated to DolphinDB online. This command can only be executed by the admin on
|
|
78654
|
+
"Modify the maximum memory allocated to DolphinDB online. This command can only be executed by the admin on a data/compute node. Call ``getClusterPerf().maxMemSize`` to check if the modification has taken effect.",
|
|
79290
78655
|
"",
|
|
79291
78656
|
"Note: The modified configuration will expire after the cluster is rebooted. To make it permanent, please change the configuration parameter *maxMemSize*."
|
|
79292
78657
|
]
|
|
@@ -97528,7 +96893,7 @@
|
|
|
97528
96893
|
"value": [
|
|
97529
96894
|
"`X` is a vector.",
|
|
97530
96895
|
"",
|
|
97531
|
-
"`limit` is a scalar or a vector with 2 elements indicating the percentages to cut on each side of `X`, with respect to the number of unmasked data, as floats between 0 and 1. If
|
|
96896
|
+
"`limit` is a scalar or a vector with 2 elements indicating the percentages to cut on each side of `X`, with respect to the number of unmasked data, as floats between 0 and 1. If *limit* is a scalar, it means the percentages to cut on both sides of X. If *limit* has n elements (including NULLs), the (n \\* limit[0])-th smallest element and the (n \\* limit[1])-th largest element are masked, and the total number of unmasked data after trimming is n \\* (1-sum(limit)). The value of one element of *limit* can be set to 0 to indicate no masking is conducted on this side.",
|
|
97532
96897
|
"",
|
|
97533
96898
|
"`inclusive` is a Boolean type scalar or a vector of 2 elements indicating whether the number of data being masked on each side should be truncated (true) or rounded (false).",
|
|
97534
96899
|
"",
|
|
@@ -97536,8 +96901,8 @@
|
|
|
97536
96901
|
"",
|
|
97537
96902
|
"* 'upper': allows NULL values and treats them as the largest values of `X`.",
|
|
97538
96903
|
"* 'lower': allows NULL values and treats them as the smallest values of `X`.",
|
|
97539
|
-
"* 'raise': throws an error",
|
|
97540
|
-
"* 'omit': performs the calculations
|
|
96904
|
+
"* 'raise': throws an error.",
|
|
96905
|
+
"* 'omit': performs the calculations without masking NULL values."
|
|
97541
96906
|
]
|
|
97542
96907
|
}
|
|
97543
96908
|
]
|