dolphindb 2.0.602 → 2.0.603

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs.en.json CHANGED
@@ -1086,7 +1086,7 @@
1086
1086
  "value": [
1087
1087
  "In the following example, the user-defined function ``getSpread`` calculates the average bid-ask spread for a specified stock in the table `dfs://TAQ/quotes`. A user (user1) does not have the privilege to read table `dfs://TAQ/quotes`. Now define function ``getSpread`` to be a function view, and grant user1 the priviledge to execute the function view. Although user1 cannot read the raw data of table `dfs://TAQ/quotes`, now she can execute the function view to calculate the average bid-ask spread of any stock in the table.",
1088
1088
  "",
1089
- "Please note that as table `dfs://TAQ/quotes` is a distributed database, the following script needs to be executed by a system administrator on a controller node. User1 can execute function ``getSpread`` on any data node.",
1089
+ "Please note that as table `dfs://TAQ/quotes` is a distributed database, the following script needs to be executed by a system administrator. User1 can execute function ``getSpread`` on any data node/compute node.",
1090
1090
  ""
1091
1091
  ]
1092
1092
  },
@@ -2591,35 +2591,37 @@
2591
2591
  "",
2592
2592
  "`rule` is a string that can take the following values:",
2593
2593
  "",
2594
- "========================== ================================",
2595
- "Values of parameter \"rule\" Corresponding DolphinDB function",
2596
- "========================== ================================",
2597
- "\"B\" businessDay",
2598
- "\"W\" weekEnd",
2599
- "\"WOM\" weekOfMonth",
2600
- "\"LWOM\" lastWeekOfMonth",
2601
- "\"M\" monthEnd",
2602
- "\"MS\" monthBegin",
2603
- "\"BM\" businessMonthEnd",
2604
- "\"BMS\" businessMonthBegin",
2605
- "\"SM\" semiMonthEnd",
2606
- "\"SMS\" semiMonthBegin",
2607
- "\"Q\" quarterEnd",
2608
- "\"QS\" quarterBegin",
2609
- "\"BQ\" businessQuarterEnd",
2610
- "\"BQS\" businessQuarterBegin",
2611
- "\"A\" yearEnd",
2612
- "\"AS\" yearBegin",
2613
- "\"BA\" businessYearEnd",
2614
- "\"BAS\" businessYearBegin",
2615
- "\"D\" date",
2616
- "\"H\" hourOfDay",
2617
- "\"min\" minuteOfHour",
2618
- "\"S\" secondOfMinute",
2619
- "\"L\" millisecond",
2620
- "\"U\" microsecond",
2621
- "\"N\" nanosecond",
2622
- "========================== ================================",
2594
+ "=========================== =================================",
2595
+ "Values of parameter \"rule\" Corresponding DolphinDB function",
2596
+ "=========================== =================================",
2597
+ "\"B\" businessDay",
2598
+ "\"W\" weekEnd",
2599
+ "\"WOM\" weekOfMonth",
2600
+ "\"LWOM\" lastWeekOfMonth",
2601
+ "\"M\" monthEnd",
2602
+ "\"MS\" monthBegin",
2603
+ "\"BM\" businessMonthEnd",
2604
+ "\"BMS\" businessMonthBegin",
2605
+ "\"SM\" semiMonthEnd",
2606
+ "\"SMS\" semiMonthBegin",
2607
+ "\"Q\" quarterEnd",
2608
+ "\"QS\" quarterBegin",
2609
+ "\"BQ\" businessQuarterEnd",
2610
+ "\"BQS\" businessQuarterBegin",
2611
+ "\"REQ\" FY5253Quarter",
2612
+ "\"A\" yearEnd",
2613
+ "\"AS\" yearBegin",
2614
+ "\"BA\" businessYearEnd",
2615
+ "\"BAS\" businessYearBegin",
2616
+ "\"RE\" FY5253",
2617
+ "\"D\" date",
2618
+ "\"H\" hourOfDay",
2619
+ "\"min\" minuteOfHour",
2620
+ "\"S\" secondOfMinute",
2621
+ "\"L\" millisecond",
2622
+ "\"U\" microsecond",
2623
+ "\"N\" nanosecond",
2624
+ "=========================== =================================",
2623
2625
  "",
2624
2626
  "The strings above can also be used with integers for parameter \"rule\". For example, \"2M\" means month end every two months.",
2625
2627
  "",
@@ -11715,7 +11717,7 @@
11715
11717
  "",
11716
11718
  "`outputTable` is a table object indicating the output table for the results. We need to set the output table as an empty table and specify the names and data types of the columns before using function createAsofJoinEngine. By default, the first two columns are the `timeColumn` and `matchingColumn` of the leftTable which do not need to be specified in metrics.",
11717
11719
  "",
11718
- "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it's not necessary to specify the column names). For more information about metacode please refer to :doc:`/Objects/Metaprogramming`.",
11720
+ "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For more information about metacode please refer to :doc:`/Objects/Metaprogramming`.",
11719
11721
  "",
11720
11722
  "`matchingColumn` is a STRING scaler/vector/tuple indicating the column(s) on which the tables are joined. It supports integral, temporal or literal (except UUID) types.",
11721
11723
  "",
@@ -11728,7 +11730,7 @@
11728
11730
  "`useSystemTime` is an optional parameter indicating whether the first column of outputTable is system time ( `useSystemTime` = true) or `timeColumn` in the stream table ( `useSystemTime` = false).",
11729
11731
  "",
11730
11732
  " * `useSystemTime` = true, to calculate according to the timestamp when each record is ingested into the streaming engine (with millisecond precision) instead of `timeColumn`.",
11731
- " * `useSystemTime` = false (default), to calculate according to `timeColumn` instead of the timestamp when each record is ingested into the engine. Please note that the the data which triggers the calculation doesn’t participate in this calculation.",
11733
+ " * `useSystemTime` = false (default), to calculate according to `timeColumn` instead of the timestamp when each record is ingested into the engine. Please note that the the data which triggers the calculation doesn't participate in this calculation.",
11732
11734
  "",
11733
11735
  "`useSessionStartTime` is a Boolean scalar. It is optional and indicates whether the time in the output table is the start time of data window. The default value is false, which means that the time in the output table is the end time of the data window, that is, the timestamp of the last data in each window + sessionGap. It must be set to true if parameter `updateTime` is specified.",
11734
11736
  "",
@@ -12174,7 +12176,7 @@
12174
12176
  "",
12175
12177
  "`mergeSessionEnd` is a Boolean scalar indicating whether to include the data at the ending time of the session in the calculation of each session. It is optional and the default value is false.",
12176
12178
  "",
12177
- "`forceTriggerSessionEndTime` is an optional parameter. It is a positive integer in unit of seconds. It indicates the waiting time to force trigger calculation in the window containing the sessionEnd, if it ends without calculation.",
12179
+ "`forceTriggerSessionEndTime` is an optional parameter. It is a positive integer whose unit is consistent with the precision of timeColumn. It indicates the waiting time to force trigger calculation in the window containing the sessionEnd, if it ends without calculation.",
12178
12180
  "",
12179
12181
  "- If *fill* is not specified, the window returns no result.",
12180
12182
  "",
@@ -12767,7 +12769,7 @@
12767
12769
  "",
12768
12770
  "\\(2) The last few columns are the results of the *metrics*.",
12769
12771
  "",
12770
- "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it's not necessary to specify the column names). For more information about metacode, please refer to :doc:`/Objects/Metaprogramming`.",
12772
+ "`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For more information about metacode, please refer to :doc:`/Objects/Metaprogramming`.",
12771
12773
  "",
12772
12774
  "`matchingColumn` is a STRING scalar/vector, or a tuple of STRING vectors indicating the matching column(s). It can be integral, temporal or literal (excluding UUID) types.",
12773
12775
  "",
@@ -14411,7 +14413,7 @@
14411
14413
  "",
14412
14414
  "`window` is a pair of integers or duration values, indicating the range of the sliding window, including both left and right bounds.",
14413
14415
  "",
14414
- "`metrics` is a required parameter indicating calculation metrics in the form of metacode. It can use one or more expressions, and built-in or user-defined functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it’s not necessary to specify the column names). For details about metacode, see :doc:`/Objects/Metaprogramming`。",
14416
+ "`metrics` is a required parameter indicating calculation metrics in the form of metacode. It can use one or more expressions, and built-in or user-defined functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For details about metacode, see :doc:`/Objects/Metaprogramming`。",
14415
14417
  "",
14416
14418
  "When only the columns in the *rightTable* are involved in calculation, the window join engine optimizes the performance of the following functions: sum, sum2, avg, std, var, corr, covar, wavg, wsum, beta, max, min, last, first, med, percentile。",
14417
14419
  "",
@@ -19071,7 +19073,7 @@
19071
19073
  "",
19072
19074
  "`ascending` is a Boolean value indicating whether to sort in ascending order. It is an optional parameter and the default value is true.",
19073
19075
  "",
19074
- "`ignoreNA` is a Boolean value indicating whether NULL values are ignored in ranking and return NULL. When NULL values participate in ranking, NULL values return 0, which is the smallest value in the result.",
19076
+ "`ignoreNA` is a Boolean value indicating whether NULL values are ignored in ranking. The default value is true. If set to false, NULL is ranked as the minimum value.",
19075
19077
  "",
19076
19078
  "`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false."
19077
19079
  ]
@@ -19085,8 +19087,15 @@
19085
19087
  {
19086
19088
  "type": "text",
19087
19089
  "value": [
19088
- "* If *X* is a vector, return the consecutive rank of each element in *X*.",
19089
- "* If *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*."
19090
+ "If *X* is a vector:",
19091
+ "",
19092
+ "- return the consecutive rank of each element in *X* based on the specified order.",
19093
+ "",
19094
+ "- If ignoreNA = true, the NULL values are ignored in ranking and return NULL.",
19095
+ "",
19096
+ "* If *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.",
19097
+ "",
19098
+ "Note: Unlike ``denseRank``, :doc:`../r/rank` skips positions after equal rankings."
19090
19099
  ]
19091
19100
  }
19092
19101
  ]
@@ -19099,7 +19108,7 @@
19099
19108
  "type": "code",
19100
19109
  "language": "console",
19101
19110
  "value": [
19102
- " ",
19111
+ "",
19103
19112
  " $ x=1 5 5 6 8 8 9",
19104
19113
  " $ print denseRank(x)",
19105
19114
  " [0,1,1,2,3,3,4]",
@@ -19108,21 +19117,21 @@
19108
19117
  " $ print denseRank(y, ascending=false)",
19109
19118
  " [0,2,2,1]",
19110
19119
  " $ m = matrix(1 2 2 NULL, 0 0 0 1, 0 0 NULL 2)",
19111
- " $ denseRank(m, ignoreNA=false) ",
19120
+ " $ denseRank(m, ignoreNA=false)",
19112
19121
  ""
19113
19122
  ]
19114
19123
  },
19115
19124
  {
19116
19125
  "type": "text",
19117
19126
  "value": [
19118
- "== == == ",
19127
+ "== == ==",
19119
19128
  "#0 #1 #2",
19120
- "== == == ",
19129
+ "== == ==",
19121
19130
  "1 0 1",
19122
19131
  "2 0 1",
19123
19132
  "2 0 0",
19124
19133
  "0 1 2",
19125
- "== == == ",
19134
+ "== == ==",
19126
19135
  ""
19127
19136
  ]
19128
19137
  },
@@ -19130,7 +19139,7 @@
19130
19139
  "type": "code",
19131
19140
  "language": "console",
19132
19141
  "value": [
19133
- " ",
19142
+ "",
19134
19143
  " $ t=table(`A`A`B`C`B`B`A`C`C as id,[4,1,NULL,1,2,4,5,0,-1] as val)",
19135
19144
  " $ select id,val, denseRank(val) from t context by id",
19136
19145
  ""
@@ -19145,12 +19154,12 @@
19145
19154
  "A 4 1",
19146
19155
  "A 1 0",
19147
19156
  "A 5 2",
19148
- "B ",
19157
+ "B",
19149
19158
  "B 2 0",
19150
19159
  "B 4 1",
19151
19160
  "C 1 2",
19152
19161
  "C 0 1",
19153
- "C \\(1) 0",
19162
+ "C -1 0",
19154
19163
  "======== ======== =============",
19155
19164
  "",
19156
19165
  "Related function: :doc:`../r/rowDenseRank`"
@@ -21143,7 +21152,7 @@
21143
21152
  {
21144
21153
  "type": "text",
21145
21154
  "value": [
21146
- "dropFunctionView(udfs)"
21155
+ "dropFunctionView(name)"
21147
21156
  ]
21148
21157
  }
21149
21158
  ]
@@ -21155,7 +21164,7 @@
21155
21164
  {
21156
21165
  "type": "text",
21157
21166
  "value": [
21158
- "`udfs` is either a user defined function or a tuple containing multiple user defined functions."
21167
+ "`name` is a string scalar indicating the name of user defined function."
21159
21168
  ]
21160
21169
  }
21161
21170
  ]
@@ -21169,9 +21178,7 @@
21169
21178
  "value": [
21170
21179
  "Delete a function view.",
21171
21180
  "",
21172
- "Make the functions that are specified by :doc:`../a/addFunctionView` as ineligible values for the parameter objs if the parameter accessType is set to VIEW_EXEC in command :doc:`../g/grant`, :doc:`../d/deny`, or :doc:`../r/revoke`.",
21173
- "",
21174
- "It can only be executed by administrators on the controller node. ",
21181
+ "It can only be executed by an administrator. ",
21175
21182
  "",
21176
21183
  ".. meta:: ",
21177
21184
  " :keywords: drop, Function, view"
@@ -27975,7 +27982,42 @@
27975
27982
  " $ rpc(getControllerAlias(), getClusterPerf).keys()",
27976
27983
  " [\"host\",\"port\",\"site\",\"mode\",\"state\",\"agentSite\",\"maxConnections\",\"maxMemSize\",\"workerNum\",\"executorNum\",\"connectionNum\",\"name\",\"memoryUsed\",\"memoryAlloc\",\"cpuUsage\",\"avgLoad\",\"medLast10QueryTime\",\"maxLast10QueryTime\",\"medLast100QueryTime\",\"maxLast100QueryTime\",\"maxRunningQueryTime\",\"runningJobs\",\"queuedJobs\",\"runningTasks\",\"queuedTasks\",\"jobLoad\",\"diskCapacity\",\"diskFreeSpace\",\"diskFreeSpaceRatio\",\"diskWriteRate\",\"diskReadRate\",\"lastMinuteWriteVolume\",\"lastMinuteReadVolume\",\"networkSendRate\",\"networkRecvRate\",\"lastMinuteNetworkSend\",\"lastMinuteNetworkRecv\",\"publicName\",\"lastMsgLatency\",\"cumMsgLatency\"]",
27977
27984
  "",
27985
+ ""
27986
+ ]
27987
+ },
27988
+ {
27989
+ "type": "text",
27990
+ "value": [
27991
+ "Execute in a high-availability cluster:",
27992
+ "",
27993
+ ""
27994
+ ]
27995
+ },
27996
+ {
27997
+ "type": "code",
27998
+ "language": "console",
27999
+ "value": [
27978
28000
  "",
28001
+ " $ rpc(getControllerAlias(true), getClusterPerf)",
28002
+ ""
28003
+ ]
28004
+ },
28005
+ {
28006
+ "type": "text",
28007
+ "value": [
28008
+ "=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
28009
+ "host port site mode state agentSite maxConnections maxMemSize workerNum executorNum connectionNum name memoryUsed memoryAlloc cpuUsage avgLoad medLast10QueryTime maxLast10QueryTime medLast100QueryTime maxLast100QueryTime maxRunningQueryTime runningJobs queuedJobs runningTasks queuedTasks jobLoad diskCapacity diskFreeSpace diskFreeSpaceRatio diskWriteRate diskReadRate lastMinuteWriteVolume lastMinuteReadVolume networkSendRate networkRecvRate lastMinuteNetworkSend lastMinuteNetworkRecv publicName lastMsgLatency cumMsgLatency isLeader",
28010
+ "=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
28011
+ "192.168.100.10 17,000 192.168.100.10:17000:master3 2 1 512 16 64 3 1 master3 23,449,272 24,133,632 0.7788 0.0037 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,658 2,736 102,468 59,193 78,351 8,012,182 2,378,846 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0 false",
28012
+ "192.168.100.11 17,000 192.168.100.11:17000:master2 2 1 512 16 64 3 2 master2 23,527,872 24,133,632 11.5625 0.3219 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,670 2,785 116,733 62,402 56,160 1,366,293 1,398,238 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0 false",
28013
+ "192.168.100.12 17,000 192.168.100.12:17000:master1 2 1 512 16 64 3 20 master1 25,002,792 46,538,752 14.0406 0.1136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,671 13,546,528 19,964,606 53,206 56,891 22,543,771 8,226,278 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0 true",
28014
+ "192.168.100.12 17,102 192.168.100.12:17102:server19-datanode1 0 1 192.168.100.12:17101:server19-agent1 254 120 5 31 1 server19-datanode1 23,118,960 24,133,632 13.928 0.1136 0 0 0 0 0 0 0 0 0 0 17,790,585,659,392 16,826,060,464,128 0.9458 0 4,687 1,289 23,477 44,197 55,104 352,258 6,163,159 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0 ",
28015
+ "192.168.100.11 17,102 192.168.100.11:17102:server18-datanode1 0 1 192.168.100.11:17101:server18-agent1 254 120 5 31 1 server18-datanode1 23,111,912 24,133,632 14.1066 0.3219 0 0 0 0 0 0 0 0 0 0 17,790,585,659,392 16,714,392,956,928 0.9395 0 4,698 1,989 23,530 40,896 50,706 243,008 250,727 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0 ",
28016
+ "192.168.100.11 17,101 192.168.100.11:17101:server18-agent1 1 1 192.168.100.11:17101:server18-agent1 304 4 4 63 0 server18-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0",
28017
+ "192.168.100.10 17,102 192.168.100.10:17102:server17-datanode1 0 1 192.168.100.10:17101:server17-agent1 254 120 5 31 1 server17-datanode1 40,872,496 52,445,184 0.7788 0.0037 0 0 0 0 0 0 0 0 0 0 53,783,736,754,176 50,336,934,432,768 0.9359 0 4,699 13,900,218 18,835 118,935 109,862 6,170,512 408,018 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0",
28018
+ "192.168.100.12 17,101 192.168.100.12:17101:server19-agent1 1 1 192.168.100.12:17101:server19-agent1 304 4 4 63 0 server19-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0",
28019
+ "192.168.100.10 17,101 192.168.100.10:17101:server17-agent1 1 1 192.168.100.10:17101:server17-agent1 304 4 4 63 0 server17-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0",
28020
+ "=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
27979
28021
  " "
27980
28022
  ]
27981
28023
  }
@@ -62611,10 +62653,12 @@
62611
62653
  "\"QS\" quarterBegin",
62612
62654
  "\"BQ\" businessQuarterEnd",
62613
62655
  "\"BQS\" businessQuarterBegin",
62656
+ "\"REQ\" FY5253Quarter",
62614
62657
  "\"A\" yearEnd",
62615
62658
  "\"AS\" yearBegin",
62616
62659
  "\"BA\" businessYearEnd",
62617
62660
  "\"BAS\" businessYearBegin",
62661
+ "\"RE\" FY5253",
62618
62662
  "\"D\" date",
62619
62663
  "\"H\" hourOfDay",
62620
62664
  "\"min\" minuteOfHour",
@@ -79600,7 +79644,7 @@
79600
79644
  {
79601
79645
  "type": "text",
79602
79646
  "value": [
79603
- "Release variables or function definitions from the memory. Another way to release variables from the memory is to use \"= NULL\"."
79647
+ "Release variables or function definitions from the memory. You can also release a local variable (VAR) from the memory using \"= NULL\"."
79604
79648
  ]
79605
79649
  }
79606
79650
  ]
package/docs.zh.json CHANGED
@@ -1382,7 +1382,7 @@
1382
1382
  "value": [
1383
1383
  "增加数据节点或计算节点。新增加的节点为关闭状态,需要通过Web集群管理器或命令行启动。",
1384
1384
  "",
1385
- "注意,如果要在新的服务器上增加节点,要先部署代理节点。详情请参考教程 `多服务器集群部署 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/multi_machine_cluster_deploy.md>`_ 。"
1385
+ "注意,如果要在新的服务器上增加节点,要先部署代理节点。详情请参考教程 `多服务器集群部署 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/%E5%AE%89%E8%A3%85%E5%92%8C%E9%83%A8%E7%BD%B2/multi_machine_cluster_deployment.md>`_ 。"
1386
1386
  ]
1387
1387
  }
1388
1388
  ]
@@ -8530,7 +8530,7 @@
8530
8530
  {
8531
8531
  "type": "text",
8532
8532
  "value": [
8533
- "`X` 可以是向量、矩阵、集合、字典。"
8533
+ "`X` 可以是向量、矩阵、集合、字典、内存表。"
8534
8534
  ]
8535
8535
  }
8536
8536
  ]
@@ -8577,7 +8577,10 @@
8577
8577
  " 3->6",
8578
8578
  " 1->4",
8579
8579
  " 2->5",
8580
- " $ z.clear!();"
8580
+ " $ z.clear!();",
8581
+ "",
8582
+ " $ t = table(1 2 3 as id, 1.0 2.0 3.0 as value)",
8583
+ " $ t.clear!()"
8581
8584
  ]
8582
8585
  }
8583
8586
  ]
@@ -13648,7 +13651,7 @@
13648
13651
  "",
13649
13652
  "返回一个表对象,向该表写入数据意味着这些数据进入响应式状态引擎进行计算。",
13650
13653
  "",
13651
- "通常与 :doc:`../s/subscribeTable` 函数一起使用。更多详情请参考教程 `DolphinDB 流聚合引擎 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/stream_aggregator.md>`_。创建的响应式状态引擎可以跨会话调用。",
13654
+ "通常与 :doc:`../s/subscribeTable` 函数一起使用。更多详情请参考教程 `DolphinDB 流聚合引擎 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/%E6%B5%81%E8%AE%A1%E7%AE%97/stream_aggregator.md>`_。创建的响应式状态引擎可以跨会话调用。",
13652
13655
  "",
13653
13656
  "请注意:响应式状态引擎不支持多线程并发写入,必须配置 *subExecutorPooling* = false,使引擎读写任务串行执行。"
13654
13657
  ]
@@ -14039,7 +14042,7 @@
14039
14042
  "",
14040
14043
  "否则,时间乱序的数据在计算中会被直接丢弃。",
14041
14044
  "",
14042
- "该函数通常与 :doc:`../s/subscribeTable` 函数一起使用。更多详情请参考教程 `DolphinDB 流数据引擎 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/stream_aggregator.md>`_。创建时间序列引擎可以跨会话调用。"
14045
+ "该函数通常与 :doc:`../s/subscribeTable` 函数一起使用。更多详情请参考教程 `DolphinDB 流数据引擎 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/%E6%B5%81%E8%AE%A1%E7%AE%97/stream_aggregator.md>`_。创建时间序列引擎可以跨会话调用。"
14043
14046
  ]
14044
14047
  }
14045
14048
  ]
@@ -15408,7 +15411,13 @@
15408
15411
  {
15409
15412
  "type": "text",
15410
15413
  "value": [
15411
- "计算 *X* 中第一个不为 *k* 的元素;若 *k* 未指定,则返回第一个不为 NULL 的元素。"
15414
+ "若 *X* 是向量:",
15415
+ "",
15416
+ "如果没有指定 *k*,对 *X* 内的每个元素,返回其之前所有元素中第一个不为 NULL 的元素。",
15417
+ "",
15418
+ "如果指定 *k*,对 *X* 内的每个元素,返回其之前所有元素中第一个不为 *k* 的元素。",
15419
+ "",
15420
+ "若 *X* 是矩阵,在每列内进行上述计算,返回一个与 *X* 维度相同的矩阵。"
15412
15421
  ]
15413
15422
  }
15414
15423
  ]
@@ -15511,7 +15520,13 @@
15511
15520
  {
15512
15521
  "type": "text",
15513
15522
  "value": [
15514
- "计算 *X* 中最后一个不为 *k* 的元素;若 *k* 未指定,则返回最后一个不为 NULL 的元素。"
15523
+ "若 *X* 是向量:",
15524
+ "",
15525
+ "如果没有指定 *k*,对 *X* 内的每个元素,返回其之前所有元素中最后一个不为 NULL 的元素。",
15526
+ "",
15527
+ "如果指定 *k*,对 *X* 内的每个元素,返回其之前所有元素中最后一个不为 *k* 的元素。",
15528
+ "",
15529
+ "若 *X* 是矩阵,在每列内进行上述计算,返回一个与 *X* 维度相同的矩阵。"
15515
15530
  ]
15516
15531
  }
15517
15532
  ]
@@ -54311,9 +54326,7 @@
54311
54326
  "* 'nearest': :math:`X_i` 和 :math:`X_{i+1}` 之中最接近分位点的数据",
54312
54327
  "* 'midpoint': :math:`(X_i+X_{i+1})/2`",
54313
54328
  "",
54314
- "如果没有指定 *interpolation*,默认采用 'linear'。",
54315
- "",
54316
- "如果没有指定 *interpolation*,默认采用 linear。"
54329
+ "如果没有指定 *interpolation*,默认采用 'linear'。"
54317
54330
  ]
54318
54331
  }
54319
54332
  ]
@@ -59950,7 +59963,7 @@
59950
59963
  "",
59951
59964
  "panel 函数同 :doc:`/SQLStatements/pivotBy` 语句类似,将数据表中的数据按照两个维度重新排列。两者的不同之处在于,SQL 中,exec... pivot by... 只能指定一个指标列,",
59952
59965
  "生成一个矩阵,而 panel 函数可以指定一个或多个指标列,生成一个或多个矩阵。",
59953
- "更多面板数据的处理,请参考 `DolphinDB教程:面板数据的处理 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/panel_data.md>`_。"
59966
+ "更多面板数据的处理,请参考 `DolphinDB教程:面板数据的处理 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/%E5%BA%94%E7%94%A8%E5%9C%BA%E6%99%AF%E7%A4%BA%E4%BE%8B/panel_data.md>`_。"
59954
59967
  ]
59955
59968
  }
59956
59969
  ]
@@ -90755,7 +90768,7 @@
90755
90768
  {
90756
90769
  "type": "text",
90757
90770
  "value": [
90758
- "从内存中释放变量和函数定义。另一种从内存中释放变量的做法是使用 \"= NULL\"。"
90771
+ "从内存中释放变量和函数定义。VAR(本地变量)亦可通过 \"= NULL\" 释放变量。"
90759
90772
  ]
90760
90773
  }
90761
90774
  ]
package/index.d.ts CHANGED
@@ -123,6 +123,15 @@ export interface DdbChartValue {
123
123
  /** original: chartType */
124
124
  type: DdbChartType;
125
125
  stacking: boolean;
126
+ /** 直方图 (Histogram), plotHist 函数返回的 chart 可能具有该属性
127
+ 原属性 binStart
128
+ 数值类型的 DdbObj 都有可能?
129
+ */
130
+ bin_start?: DdbObj;
131
+ /** 原属性 binEnd */
132
+ bin_end?: DdbObj;
133
+ /** 原属性 binCount */
134
+ bin_count?: DdbObj;
126
135
  titles: {
127
136
  chart: string;
128
137
  x_axis: string;
@@ -382,9 +391,11 @@ export declare class DDB {
382
391
  print_object_buffer: boolean;
383
392
  print_message: boolean;
384
393
  parse_object: boolean;
394
+ pnode_run_defined: boolean;
385
395
  /** DdbMessage listeners */
386
396
  listeners: DdbMessageListener[];
387
397
  pconnect: Promise<void>;
398
+ ppnoderun: Promise<void>;
388
399
  presult: Promise<any>;
389
400
  get connected(): boolean;
390
401
  /**
package/index.js CHANGED
@@ -267,7 +267,7 @@ export class DdbObj {
267
267
  if (form === DdbForm.dict)
268
268
  return dict;
269
269
  else {
270
- const { chartType: type, stacking, title: titles, extras, data, ...others } = dict.to_dict();
270
+ const { chartType: type, stacking, binStart: bin_start, binEnd: bin_end, binCount: bin_count, title: titles, extras, data, ...others } = dict.to_dict();
271
271
  const [chart, x_axis, y_axis] = titles.value;
272
272
  dict.form = DdbForm.chart;
273
273
  dict.value = {
@@ -278,6 +278,8 @@ export class DdbObj {
278
278
  x_axis,
279
279
  y_axis,
280
280
  },
281
+ ...bin_start ? { bin_start, bin_end, } : {},
282
+ ...bin_count ? { bin_count } : {},
281
283
  ...extras ? (() => {
282
284
  const { multiYAxes: multi_y_axes = false, ...extras_others } = extras.to_dict({ strip: true });
283
285
  return {
@@ -865,10 +867,17 @@ export class DdbObj {
865
867
  value[1].pack(),
866
868
  ];
867
869
  case DdbForm.chart: {
868
- const { type, stacking, titles: { chart, x_axis, y_axis, }, extras, data } = this.value;
870
+ const { type, stacking, bin_start, bin_end, bin_count, titles: { chart, x_axis, y_axis, }, extras, data } = this.value;
869
871
  const { value: [keys, values] } = new DdbDict({
870
872
  chartType: new DdbInt(type),
871
873
  stacking,
874
+ ...bin_start ? {
875
+ binStart: bin_start,
876
+ binEnd: bin_end
877
+ } : {},
878
+ ...bin_count ? {
879
+ binCount: bin_count
880
+ } : {},
872
881
  title: new DdbVectorString([chart, x_axis, y_axis]),
873
882
  ...extras ? (() => {
874
883
  const { multi_y_axes, ...extras_other } = extras;
@@ -1100,7 +1109,7 @@ export class DdbObj {
1100
1109
  case DdbForm.table:
1101
1110
  return `table[${this.rows}r][${this.cols}c]`;
1102
1111
  case DdbForm.dict:
1103
- return `dict<${DdbType[this.value[0].type]}, ${DdbType[this.value[1].type]}>`;
1112
+ return `dict<${DdbType[this.value[0].type]}, ${DdbType[this.value[1].type]}>[${this.rows}]`;
1104
1113
  case DdbForm.chart:
1105
1114
  return `chart<${DdbChartType[this.value.type]}>`;
1106
1115
  case DdbForm.matrix:
@@ -1968,13 +1977,16 @@ export class DDB {
1968
1977
  password = '123456';
1969
1978
  /** python session flag (2048) */
1970
1979
  python = false;
1980
+ // --- 内部选项, 状态
1971
1981
  print_message_buffer = false;
1972
1982
  print_object_buffer = false;
1973
1983
  print_message = true;
1974
1984
  parse_object = true;
1985
+ pnode_run_defined = false;
1975
1986
  /** DdbMessage listeners */
1976
1987
  listeners = [];
1977
1988
  pconnect = Promise.resolve();
1989
+ ppnoderun = Promise.resolve();
1978
1990
  presult = Promise.resolve(null);
1979
1991
  get connected() {
1980
1992
  return this.websocket?.readyState === WebSocket.OPEN;
@@ -2042,41 +2054,6 @@ export class DDB {
2042
2054
  this.on_message(event);
2043
2055
  }
2044
2056
  });
2045
- await this.eval(this.python ?
2046
- 'def pnode_run (nodes, func_name, args, add_node_alias):\n' +
2047
- ' nargs = size(args)\n' +
2048
- ' func = funcByName(func_name)\n' +
2049
- ' \n' +
2050
- ' if not nargs:\n' +
2051
- ' return pnodeRun(func, nodes, add_node_alias)\n' +
2052
- ' \n' +
2053
- ' args_partial = [ ]\n' +
2054
- ' args_partial.append(func)\n' +
2055
- ' for a in args:\n' +
2056
- ' args_partial.append(a)\n' +
2057
- ' \n' +
2058
- ' return pnodeRun(\n' +
2059
- ' unifiedCall(partial, args_partial),\n' +
2060
- ' nodes,\n' +
2061
- ' add_node_alias\n' +
2062
- ' )\n'
2063
- :
2064
- 'def pnode_run (nodes, func_name, args, add_node_alias = true) {\n' +
2065
- ' nargs = size(args)\n' +
2066
- ' func = funcByName(func_name)\n' +
2067
- ' \n' +
2068
- ' if (!nargs)\n' +
2069
- ' return pnodeRun(func, nodes, add_node_alias)\n' +
2070
- ' \n' +
2071
- ' args_partial = array(any, 1 + nargs, 1 + nargs)\n' +
2072
- ' args_partial[0] = func\n' +
2073
- ' args_partial[1:] = args\n' +
2074
- ' return pnodeRun(\n' +
2075
- ' unifiedCall(partial, args_partial),\n' +
2076
- ' nodes,\n' +
2077
- ' add_node_alias\n' +
2078
- ' )\n' +
2079
- '}\n', { urgent: true });
2080
2057
  if (this.autologin)
2081
2058
  if (this.python)
2082
2059
  await this.eval(`login(${this.username.quote('double')}, ${this.password.quote('double')})`, { urgent: true });
@@ -2148,6 +2125,55 @@ export class DDB {
2148
2125
  }
2149
2126
  if (!this.connected)
2150
2127
  throw new Error(`${this.url} is already disconnected`);
2128
+ if (func === 'pnode_run' && !this.pnode_run_defined) {
2129
+ const ptail = this.ppnoderun;
2130
+ let resolve;
2131
+ this.ppnoderun = new Promise((_resolve, _reject) => {
2132
+ resolve = _resolve;
2133
+ });
2134
+ await ptail;
2135
+ try {
2136
+ if (!this.pnode_run_defined)
2137
+ await this.eval(this.python ?
2138
+ 'def pnode_run (nodes, func_name, args, add_node_alias):\n' +
2139
+ ' nargs = size(args)\n' +
2140
+ ' func = funcByName(func_name)\n' +
2141
+ ' \n' +
2142
+ ' if not nargs:\n' +
2143
+ ' return pnodeRun(func, nodes, add_node_alias)\n' +
2144
+ ' \n' +
2145
+ ' args_partial = [ ]\n' +
2146
+ ' args_partial.append(func)\n' +
2147
+ ' for a in args:\n' +
2148
+ ' args_partial.append(a)\n' +
2149
+ ' \n' +
2150
+ ' return pnodeRun(\n' +
2151
+ ' unifiedCall(partial, args_partial),\n' +
2152
+ ' nodes,\n' +
2153
+ ' add_node_alias\n' +
2154
+ ' )\n'
2155
+ :
2156
+ 'def pnode_run (nodes, func_name, args, add_node_alias = true) {\n' +
2157
+ ' nargs = size(args)\n' +
2158
+ ' func = funcByName(func_name)\n' +
2159
+ ' \n' +
2160
+ ' if (!nargs)\n' +
2161
+ ' return pnodeRun(func, nodes, add_node_alias)\n' +
2162
+ ' \n' +
2163
+ ' args_partial = array(any, 1 + nargs, 1 + nargs)\n' +
2164
+ ' args_partial[0] = func\n' +
2165
+ ' args_partial[1:] = args\n' +
2166
+ ' return pnodeRun(\n' +
2167
+ ' unifiedCall(partial, args_partial),\n' +
2168
+ ' nodes,\n' +
2169
+ ' add_node_alias\n' +
2170
+ ' )\n' +
2171
+ '}\n', { urgent: true });
2172
+ }
2173
+ finally {
2174
+ resolve();
2175
+ }
2176
+ }
2151
2177
  // this 上的当前配置需要在 message 到达后使用,先保存起来
2152
2178
  const _handlers = [...this.listeners].reverse();
2153
2179
  // 临界区:保证多个 rpc 并发时形成 promise 链