dolphindb 2.0.1021 → 2.0.1024

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.zh.json CHANGED
@@ -162,25 +162,36 @@
162
162
  "",
163
163
  " //定义一个一元函数",
164
164
  " $ def func1(x){",
165
- " $ \tif(x<5){",
166
- " $ \t\treturn x*3",
167
- " $ \t}",
168
- " $ \telse{",
169
- " $ \t\treturn 6",
170
- " $ \t}",
165
+ " $ if(x<5){",
166
+ " $ return x*3",
167
+ " $ }",
168
+ " $ else{",
169
+ " $ return x+3",
170
+ " $ }",
171
171
  " $ }",
172
172
  " //当 X 为整数时,输出结果长度为 X + 1",
173
173
  " $ accumulate(func1, 5, 1)",
174
- " [1,3,9,6,6,6]",
175
- " //当 X 为 NULL(或不指定)时,因第4次迭代结果和第3次相同,停止迭代并输出前3次迭代结果。",
176
- " $ accumulate(func1,NULL,1)",
177
- " [1,3,9,6]",
174
+ " [1,3,9,12,15,18]",
178
175
  " //当 X 为一元函数 condition 时,第3次迭代时因 condition 返回false,停止迭代并输出前2次迭代结果。",
179
176
  " $ def condition(x){",
180
- " $ \treturn x<9",
177
+ " $ return x<9",
181
178
  " $ }",
182
- " $ accumulate(func1, condition, 1) ",
179
+ " $ accumulate(func1, condition, 1)",
183
180
  " [1,3,9]",
181
+ "",
182
+ " //当 X 为 NULL(或不指定)时,自定义函数 func2 作为迭代的函数。",
183
+ " $ def func2(x){",
184
+ " $ if(x<5){",
185
+ " $ return x*3",
186
+ " $ }",
187
+ " $ else{",
188
+ " $ return 6",
189
+ " $ }",
190
+ " $ }",
191
+ "",
192
+ " //因第4次迭代结果和第3次相同,停止迭代并输出前3次迭代结果。",
193
+ " $ accumulate(func2,NULL,1)",
194
+ " [1,3,9,6]",
184
195
  ""
185
196
  ]
186
197
  },
@@ -7778,7 +7789,7 @@
7778
7789
  "",
7779
7790
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
7780
7791
  " $ ds.cacheDS!() //cache the data",
7781
- " $ ds.clearCacheDS!() //clear the cache"
7792
+ " $ ds.clearDSCache!() //clear the cache"
7782
7793
  ]
7783
7794
  }
7784
7795
  ]
@@ -7840,7 +7851,7 @@
7840
7851
  "",
7841
7852
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
7842
7853
  " $ ds.cacheDSNow() //cache the data immediately",
7843
- " $ ds.clearCacheDSNow() //clear the cache immediately"
7854
+ " $ ds.clearDSCacheNow() //clear the cache immediately"
7844
7855
  ]
7845
7856
  }
7846
7857
  ]
@@ -10752,7 +10763,7 @@
10752
10763
  " ",
10753
10764
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
10754
10765
  " $ ds.cacheDS!() //cache the data",
10755
- " $ ds.clearCacheDS!() //clear the cache"
10766
+ " $ ds.clearDSCache!() //clear the cache"
10756
10767
  ]
10757
10768
  }
10758
10769
  ]
@@ -10794,7 +10805,7 @@
10794
10805
  {
10795
10806
  "type": "text",
10796
10807
  "value": [
10797
- "函数clearCacheDSNow立即清除数据源和缓存。"
10808
+ "函数clearDSCacheNow立即清除数据源和缓存。"
10798
10809
  ]
10799
10810
  }
10800
10811
  ]
@@ -10814,7 +10825,7 @@
10814
10825
  " ",
10815
10826
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
10816
10827
  " $ ds.cacheDSNow() //cache the data immediately",
10817
- " $ ds.clearCacheDSNow() //clear the cache immediately"
10828
+ " $ ds.clearDSCacheNow() //clear the cache immediately"
10818
10829
  ]
10819
10830
  }
10820
10831
  ]
@@ -17258,7 +17269,42 @@
17258
17269
  "",
17259
17270
  "为了便于观察和对比计算结果,系统会对第一个数据窗口的起始时间进行规整,根据 :ref:`step <step_ts>` 参数、数据的时间精度,以及 :ref:`roundTime <roundTime_ts>` 参数来确定整数类型的规整尺度 alignmentSize。当时间序列引擎使用分组计算时,所有分组的窗口均进行统一的规整。相同时刻的数据窗口在各组均有相同的边界。",
17260
17271
  "",
17261
- "* 若数据的时间精度为秒,如 DATETIME(yyyy-MM-dd HH:mm:ss) 与 SECOND(HH:mm:ss) 类型,alignmentSize 的 取值如下:",
17272
+ "* 若数据的时间精度为分钟,如 MINUTE(HH:mm) 类型,alignmentSize 取值如下:",
17273
+ "",
17274
+ " *若 roundTime = false*:",
17275
+ "",
17276
+ " ============== =================",
17277
+ " step alignmentSize",
17278
+ " ============== =================",
17279
+ " 0~2 2",
17280
+ " 3 3",
17281
+ " 4~5 5",
17282
+ " 6~10 10",
17283
+ " 11~15 15",
17284
+ " 16~20 20",
17285
+ " 21~30 30",
17286
+ " >30 60 (1小时)",
17287
+ " ============== =================",
17288
+ "",
17289
+ " *若 roundTime = true*:",
17290
+ "",
17291
+ " 当 step <= 30 时,alignmentSize 取值同上表。当 step > 30 时,alignmentSize 取值见下表:",
17292
+ "",
17293
+ " ============== =================",
17294
+ " step alignmentSize",
17295
+ " ============== =================",
17296
+ " 31~60 60 (1小时)",
17297
+ " 61~120 120 (2小时)",
17298
+ " 121~180 180 (3小时)",
17299
+ " 181~300 300 (5小时)",
17300
+ " 301~600 600 (10小时)",
17301
+ " 601~900 900 (15小时)",
17302
+ " 901~1200 1200 (20小时)",
17303
+ " 1201~1800 1800 (30小时)",
17304
+ " >1800 3600 (60小时)",
17305
+ " ============== =================",
17306
+ "",
17307
+ "* 若数据的时间精度为秒,如 DATETIME(yyyy-MM-dd HH:mm:ss) 与 SECOND(HH:mm:ss) 类型,alignmentSize 取值如下:",
17262
17308
  "",
17263
17309
  " *若 roundTime = false*:",
17264
17310
  "",
@@ -17283,7 +17329,7 @@
17283
17329
  " step alignmentSize",
17284
17330
  " ============== =================",
17285
17331
  " 31~60 60 (1分钟)",
17286
- " 60~120 120 (2分钟)",
17332
+ " 61~120 120 (2分钟)",
17287
17333
  " 121~180 180 (3分钟)",
17288
17334
  " 181~300 300 (5分钟)",
17289
17335
  " 301~600 600 (10分钟)",
@@ -23107,7 +23153,9 @@
23107
23153
  {
23108
23154
  "type": "text",
23109
23155
  "value": [
23110
- "返回对应的 datetime 值。返回值的类型是 DATEITIME,一个时间值。"
23156
+ "返回对应的 datetime 值。返回值的类型是 DATEITIME,一个时间值。",
23157
+ "",
23158
+ "注意:DATETIME 类型的可用时间范围是 [1901.12.13T20:45:53, 2038.01.19T03:14:07]。"
23111
23159
  ]
23112
23160
  }
23113
23161
  ]
@@ -24042,15 +24090,15 @@
24042
24090
  "name isCommand userDefined minParamCount maxParamCount syntax ",
24043
24091
  "======= ========= =========== ============= ============= ===============",
24044
24092
  "!=_2 0 0 2 2 (X, Y) ",
24045
- "!_1 0 0 1 1 (X) ",
24093
+ "!_1 0 0 1 1 \\(X) ",
24046
24094
  "$_2 0 0 2 2 (obj, type) ",
24047
24095
  "%_2 0 0 2 2 (X, Y) ",
24048
24096
  "&&_2 0 0 2 2 (X, Y) ",
24049
24097
  "&_2 0 0 2 2 (X, Y) ",
24050
- "**_2 0 0 2 2 (X, Y) ",
24051
- "*_2 0 0 2 2 (X, Y) ",
24098
+ "\\**_2 0 0 2 2 (X, Y) ",
24099
+ "\\*_2 0 0 2 2 (X, Y) ",
24052
24100
  "+_2 0 0 2 2 (X, Y) ",
24053
- "=_1 0 0 1 1 (X) ",
24101
+ "=_1 0 0 1 1 \\(X) ",
24054
24102
  "=_2 0 0 2 2 (X, Y) ",
24055
24103
  ".._2 0 0 2 2 (start, end) ",
24056
24104
  "._2 0 0 2 2 (obj, keys) ",
@@ -24070,7 +24118,7 @@
24070
24118
  "BETWEEN 0 0 2 2 (X, Y) ",
24071
24119
  "IN 0 0 2 2 (X, Y) ",
24072
24120
  "LIKE 0 0 2 2 (X, pattern) ",
24073
- "NOT 0 0 1 1 (X) ",
24121
+ "NOT 0 0 1 1 \\(X) ",
24074
24122
  "...",
24075
24123
  "======= ========= =========== ============= ============= ===============",
24076
24124
  ""
@@ -30282,7 +30330,7 @@
30282
30330
  "value": [
30283
30331
  "该命令把共享的流计算表保存到磁盘上。",
30284
30332
  "",
30285
- "为了保证该命令能够正常执行,我们需要指定配置参数 *persistenceDir* 。流数据表在磁盘上的存储目录是<PERSISTENCE_DIR>/<TABLE_NAME>。目录包含两种类型的文件:数据文件(名称类型 *data0.log, data1.log...* )和索引文件 *index.log* 。把这些数据保存到磁盘后,如果重启系统,该命令会把磁盘中的数据加载到内存中。",
30333
+ "为了保证该命令能够正常执行,需要在配置文件中(单节点:dolohindb.cfg,集群:cluster.cfg)指定配置参数 *persistenceDir*,配置参考 :doc:`/DatabaseandDistributedComputing/Configuration/ConfigParamRef`。流数据表在磁盘上的存储目录是<PERSISTENCE_DIR>/<TABLE_NAME>。目录包含两种类型的文件:数据文件(名称类型 *data0.log, data1.log...* )和索引文件 *index.log* 。把这些数据保存到磁盘后,如果重启系统,该命令会把磁盘中的数据加载到内存中。",
30286
30334
  "",
30287
30335
  "参数 *asynWrite* 会告知系统是否以异步模式保存表。在异步模式中,追加的数据会被放进队列,之后用于保存的工作线程把数据写入磁盘。在同步模式中,表的追加数据操作直到追加数据被保存到磁盘中才完成。该参数的默认值是 true,即为异步模式。通常情况下,异步模式实现更高的吞吐量,但是如果服务器崩溃,可能会丢失最后追加的行。在异步模式中,保存表的工作是由单个工作线程完成,并且一个工作线程可能处理多个表。如果只保存一个表,增加工作线程的数量并不会提升性能。",
30288
30336
  "",
@@ -30414,7 +30462,7 @@
30414
30462
  "value": [
30415
30463
  "该命令把流数据表共享,并把它持久化到磁盘上。",
30416
30464
  "",
30417
- "为了保证该命令能够正常执行,需要指定配置参数 *persistenceDir*。流数据表在磁盘上的存储目录是<PERSISTENCE_DIR>/<TABLE_NAME>。目录包含两种类型的文件:数据文件(名称类型 *data0.log, data1.log...* )和索引文件 *index.log*。把这些数据保存到磁盘后,如果重启系统,再次执行该命令会把磁盘中的数据加载到内存中,加载的记录条数由参数 *preCache* 指定,但是实际加载的记录条数有可能会超过 *preCache*。",
30465
+ "为了保证该命令能够正常执行,需要在配置文件中(单节点:dolohindb.cfg,集群:cluster.cfg)指定配置参数 *persistenceDir*,配置参考 :doc:`/DatabaseandDistributedComputing/Configuration/ConfigParamRef`。流数据表在磁盘上的存储目录是<PERSISTENCE_DIR>/<TABLE_NAME>。目录包含两种类型的文件:数据文件(名称类型 *data0.log, data1.log...* )和索引文件 *index.log*。把这些数据保存到磁盘后,如果重启系统,再次执行该命令会把磁盘中的数据加载到内存中,加载的记录条数由参数 *preCache* 指定,但是实际加载的记录条数有可能会超过 *preCache*。",
30418
30466
  "",
30419
30467
  "参数 *asynWrite* 会告知系统是否以异步模式保存表。在异步模式中,追加的数据会被放进队列,之后用于保存的工作线程把数据写入磁盘。在同步模式中,表的追加数据操作直到追加数据被保存到磁盘中才完成。该参数的默认值是 true,即为异步模式。通常情况下,异步模式实现更高的吞吐量,但是如果服务器崩溃,可能会丢失最后追加的行。在异步模式中,保存表的工作是由单个工作线程完成,并且一个工作线程可能处理多个表。如果只保存一个表,增加工作线程的数量并不会提升性能。",
30420
30468
  "",
@@ -36187,21 +36235,21 @@
36187
36235
  {
36188
36236
  "type": "text",
36189
36237
  "value": [
36190
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
36191
- "| userName type | startTime | dbName | tableName | totalPartitions | completedPartitions | percentComplete | endTime completed |",
36192
- "+===============+=============================================+===============+===========+=================+=====================+=================+===========================+",
36193
- "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt | 1 | 1 | 100 | 2022.09.21T17:18:04.269 1 |",
36194
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
36195
- "| u1 | BACKUP 2022.09.21T17:13:04.344 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T17:13:04.413 1 |",
36196
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
36197
- "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt1 | 1 | 1 | 100 | 2022.09.21T17:18:04.265 1 |",
36198
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
36199
- "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:47:42.798 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:47:42.859 1 |",
36200
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
36201
- "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:37:33.725 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:37:33.790 1 |",
36202
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
36203
- "| admin | BACKUP 2022.09.21T15:10:05.016 | dfs://compoDB | pt2 | 10 | 10 | 100 | 2022.09.21T15:10:05.075 1 |",
36204
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+"
36238
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
36239
+ "| userName type | startTime | dbName | tableName | totalPartitions | completedPartitions | percentComplete | endTime | completed |",
36240
+ "+===============+=============================================+===============+===========+=================+=====================+=================+=========================================+",
36241
+ "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt | 1 | 1 | 100 | 2022.09.21T17:18:04.269 | 1 |",
36242
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
36243
+ "| u1 | BACKUP 2022.09.21T17:13:04.344 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T17:13:04.413 | 1 |",
36244
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
36245
+ "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt1 | 1 | 1 | 100 | 2022.09.21T17:18:04.265 | 1 |",
36246
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
36247
+ "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:47:42.798 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:47:42.859 | 1 |",
36248
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
36249
+ "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:37:33.725 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:37:33.790 | 1 |",
36250
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
36251
+ "| admin | BACKUP 2022.09.21T15:10:05.016 | dfs://compoDB | pt2 | 10 | 10 | 100 | 2022.09.21T15:10:05.075 | 1 |",
36252
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+"
36205
36253
  ]
36206
36254
  }
36207
36255
  ]
@@ -38974,8 +39022,8 @@
38974
39022
  "value": [
38975
39023
  "返回当前节点已分配的内存和未使用的内存。返回一个字典其 key 值的含义为:",
38976
39024
  "",
38977
- "* freeBytes:当前节点已分配的内存,单位为字节。 ",
38978
- "* allocatedBytes:当前节点未使用的内存,单位为字节。 "
39025
+ "* freeBytes:当前节点未使用的内存,单位为字节。",
39026
+ "* allocatedBytes:当前节点已分配的内存,单位为字节。"
38979
39027
  ]
38980
39028
  }
38981
39029
  ]
@@ -41306,7 +41354,7 @@
41306
41354
  "",
41307
41355
  "================== =====================================",
41308
41356
  "",
41309
- "* 表subConns监控本地订阅节点和订阅节点之间的连接状态。每一行表示一个发布节点。它包含以下列:",
41357
+ "* 表subConns监控本地订阅节点和发布节点之间的连接状态。每一行表示一个发布节点。它包含以下列:",
41310
41358
  "",
41311
41359
  "================== =====================================",
41312
41360
  "列名 含义",
@@ -63852,7 +63900,7 @@
63852
63900
  {
63853
63901
  "type": "text",
63854
63902
  "value": [
63855
- "`funcArgs` 是函数func的参数。可为向量、字典或表。如果有多个参数,则用元组表示,并且每个参数的长度(向量/字典的元素个数或表的行数)必须相同。",
63903
+ "`funcArgs` 是函数func的参数。可为向量、字典。如果有多个参数,则用元组表示,并且每个参数的长度(向量/字典的元素个数)必须相同。",
63856
63904
  "",
63857
63905
  "`window` 是正整型 或 DURATION 标量。",
63858
63906
  "",
@@ -70973,12 +71021,78 @@
70973
71021
  "pcross": {
70974
71022
  "title": "pcross",
70975
71023
  "type": "template",
70976
- "children": []
71024
+ "children": [
71025
+ {
71026
+ "title": "语法",
71027
+ "type": "grammer",
71028
+ "children": [
71029
+ {
71030
+ "type": "text",
71031
+ "value": [
71032
+ "pcross(func, X, [Y])",
71033
+ "",
71034
+ "*pcross* 是并行计算版本的 *cross* 高阶函数。"
71035
+ ]
71036
+ }
71037
+ ]
71038
+ }
71039
+ ]
70977
71040
  },
70978
71041
  "peach": {
70979
71042
  "title": "peach",
70980
71043
  "type": "template",
70981
- "children": []
71044
+ "children": [
71045
+ {
71046
+ "title": "语法",
71047
+ "type": "grammer",
71048
+ "children": [
71049
+ {
71050
+ "type": "text",
71051
+ "value": [
71052
+ "peach(func, args...)"
71053
+ ]
71054
+ }
71055
+ ]
71056
+ },
71057
+ {
71058
+ "title": "详情",
71059
+ "type": "detail",
71060
+ "children": [
71061
+ {
71062
+ "type": "text",
71063
+ "value": [
71064
+ "*peach* 是并行计算版本的 *each* 高阶函数。对于执行时间较长的任务,*peach* 比 *each* 能节省大量的时间。但对于小任务,*peach* 可能执行时间要比each更长,因为并行函数调用的开销很大。",
71065
+ "关于并行函数调用请参考 :doc:`/DatabaseandDistributedComputing/DistributedComputing`。"
71066
+ ]
71067
+ }
71068
+ ]
71069
+ },
71070
+ {
71071
+ "title": "例子",
71072
+ "type": "example",
71073
+ "children": [
71074
+ {
71075
+ "type": "text",
71076
+ "value": [
71077
+ "对于执行时间长的任务,使用 `peach` 进行并行计算,可以节约任务执行时间。",
71078
+ ""
71079
+ ]
71080
+ },
71081
+ {
71082
+ "type": "code",
71083
+ "language": "console",
71084
+ "value": [
71085
+ "",
71086
+ " $ m=rand(1,20000:5000)",
71087
+ " $ timer f=peach(mskew{,8},m) ",
71088
+ " Time elapsed: 3134.71 ms",
71089
+ " $ timer f=mskew(m,8) ",
71090
+ " Time elapsed: 8810.485 ms"
71091
+ ]
71092
+ }
71093
+ ]
71094
+ }
71095
+ ]
70982
71096
  },
70983
71097
  "percentChange": {
70984
71098
  "title": "percentChange",
@@ -71729,7 +71843,22 @@
71729
71843
  "ploop": {
71730
71844
  "title": "ploop",
71731
71845
  "type": "template",
71732
- "children": []
71846
+ "children": [
71847
+ {
71848
+ "title": "语法",
71849
+ "type": "grammer",
71850
+ "children": [
71851
+ {
71852
+ "type": "text",
71853
+ "value": [
71854
+ "ploop(func, args...)",
71855
+ "",
71856
+ "ploop 是 :doc:`loop` 的并行版本。关于并行函数调用请参考 :doc:`/DatabaseandDistributedComputing/DistributedComputing`。"
71857
+ ]
71858
+ }
71859
+ ]
71860
+ }
71861
+ ]
71733
71862
  },
71734
71863
  "plot": {
71735
71864
  "title": "plot",
@@ -76599,15 +76728,15 @@
76599
76728
  "",
76600
76729
  "返回一个表,包含以下列:",
76601
76730
  "",
76602
- "================== =================================================",
76603
- "列名 含义",
76604
- "================== =================================================",
76605
- "chunkId chunk 的唯一标识",
76606
- "srcNode 源节点的别名",
76607
- "destNode 目标节点的别名",
76608
- "================== =================================================",
76731
+ "================= =====================",
76732
+ "列名 含义 ",
76733
+ "================= =====================",
76734
+ "chunkId chunk 的唯一标识 ",
76735
+ "srcNode 源节点的别名 ",
76736
+ "destNode 目标节点的别名 ",
76737
+ "================= ===================== ",
76609
76738
  "",
76610
- "调用该函数后,可以在控制节点上执行 :doc:`/FunctionsandCommands/FunctionReferences/g/getRecoveryTaskStatus` 查看任务执行的状态。"
76739
+ "调用该函数后,可以在控制节点上执行 :doc:`/FunctionsandCommands/FunctionReferences/g/getRecoveryTaskStatus` 查看任务执行的状态。"
76611
76740
  ]
76612
76741
  }
76613
76742
  ]
@@ -76628,14 +76757,15 @@
76628
76757
  {
76629
76758
  "type": "text",
76630
76759
  "value": [
76631
- "==================================== ======= ========",
76632
- "ChunkId srcNode destNode",
76633
- "==================================== ======= ========",
76634
- "99279094-ca12-3b87-48b6-520cbb986f39 node1 node2",
76635
- "45f612b8-42f5-aebd-4cef-e522b6ae1fc8 node1 node2\t",
76636
- "==================================== ======= ========",
76760
+ "====================================== ================= ==================",
76761
+ "ChunkId srcNode destNode ",
76762
+ "====================================== ================= ==================",
76763
+ "99279094-ca12-3b87-48b6-520cbb986f39 node1 node2 ",
76764
+ "45f612b8-42f5-aebd-4cef-e522b6ae1fc8 node1 node2 ",
76765
+ "====================================== ================= ==================",
76637
76766
  "",
76638
- " "
76767
+ ".. meta::",
76768
+ " :keywords: rebalance"
76639
76769
  ]
76640
76770
  }
76641
76771
  ]
@@ -76666,7 +76796,6 @@
76666
76796
  "type": "text",
76667
76797
  "value": [
76668
76798
  "`nodeAlias` 字符串,表示数据节点的别名。",
76669
- "",
76670
76799
  "`exec` 布尔值,表示是否在节点内进行数据平衡。默认值为 false,表示不进行数据平衡。"
76671
76800
  ]
76672
76801
  }
@@ -76684,15 +76813,15 @@
76684
76813
  "",
76685
76814
  "返回结果包含以下列:",
76686
76815
  "",
76687
- "================== =================================================",
76688
- "列名 含义",
76689
- "================== =================================================",
76690
- "chunkId chunk 的唯一标识",
76691
- "srcVolume 源磁盘卷",
76692
- "destVolume 目标磁盘卷",
76693
- "================== =================================================",
76816
+ "================= =====================",
76817
+ "列名 含义 ",
76818
+ "================= =====================",
76819
+ "chunkId chunk 的唯一标识 ",
76820
+ "srcVolume 源磁盘卷 ",
76821
+ "destVolume 目标磁盘卷 ",
76822
+ "================= =====================",
76694
76823
  "",
76695
- "调用该函数进行数据平衡后,可以在控制节点上执行 :doc:`/FunctionsandCommands/FunctionReferences/g/getRecoveryTaskStatus` 查看任务执行的状态。"
76824
+ "调用该函数进行数据平衡后,可以在控制节点上执行 :doc:`/FunctionsandCommands/FunctionReferences/g/getRecoveryTaskStatus` 查看任务执行的状态。"
76696
76825
  ]
76697
76826
  }
76698
76827
  ]
@@ -76713,11 +76842,14 @@
76713
76842
  {
76714
76843
  "type": "text",
76715
76844
  "value": [
76716
- "+-------------------------------------+-------------------+------------------+",
76717
- "|ChunkId |srcVolume |destVolume |",
76718
- "+=====================================+===================+==================+",
76719
- "|82c6eb6c-36ee-b1b6-4a86-ca24d9faaa25 | /hdd/hdd1/volumes |/hdd/hdd2/volumes |\t",
76720
- "+-------------------------------------+-------------------+------------------+"
76845
+ "====================================== ================= ==================",
76846
+ "ChunkId srcVolume destVolume ",
76847
+ "====================================== ================= ==================",
76848
+ "82c6eb6c-36ee-b1b6-4a86-ca24d9faaa25 /hdd/hdd1/volumes /hdd/hdd2/volumes ",
76849
+ "====================================== ================= ==================",
76850
+ "",
76851
+ ".. meta::",
76852
+ " :keywords: rebalance"
76721
76853
  ]
76722
76854
  }
76723
76855
  ]
@@ -76894,23 +77026,38 @@
76894
77026
  "language": "console",
76895
77027
  "value": [
76896
77028
  "",
77029
+ " //定义一个一元函数",
76897
77030
  " $ def func1(x){",
76898
- " $ \tif(x<5){",
76899
- " $ \t\treturn x*3",
76900
- " $ \t}",
76901
- " $ \telse{",
76902
- " $ \t\treturn 6",
76903
- " $ \t}",
77031
+ " $ if(x<5){",
77032
+ " $ return x*3",
77033
+ " $ }",
77034
+ " $ else{",
77035
+ " $ return x+3",
77036
+ " $ }",
76904
77037
  " $ }",
77038
+ " //当 X 为整数时,迭代 X 次,输出最后一个结果",
76905
77039
  " $ reduce(func1, 5, 1)",
76906
- " 6",
76907
- " $ reduce(func1,NULL,1)",
76908
- " 6",
77040
+ " 18",
77041
+ " //当 X 为一元函数 condition 时,第3次迭代时因 condition 返回false,停止迭代2次后停止,并输出最后一个结果。",
76909
77042
  " $ def condition(x){",
76910
- " $ \treturn x<9",
76911
- " $ }",
76912
- " $ reduce(func1, condition, 1) ",
77043
+ " $ return x<9",
77044
+ " }",
77045
+ " $ reduce(func1, condition, 1)",
76913
77046
  " 9",
77047
+ "",
77048
+ " //当 X 为 NULL(或不指定)时,自定义函数 func2 作为进行迭代的函数。",
77049
+ " $ def func2(x){",
77050
+ " $ if(x<5){",
77051
+ " $ return x*3",
77052
+ " $ }",
77053
+ " $ else{",
77054
+ " $ return 6",
77055
+ " $ }",
77056
+ " $ }",
77057
+ "",
77058
+ " //因第4次迭代结果和第3次相同,停止迭代并输出最后一个结果。",
77059
+ " $ reduce(func2,NULL,1)",
77060
+ " 6",
76914
77061
  ""
76915
77062
  ]
76916
77063
  },
@@ -99172,9 +99319,9 @@
99172
99319
  {
99173
99320
  "type": "text",
99174
99321
  "value": [
99175
- "`scriptFile` 是字符串,表示测试脚本文件或目录。",
99322
+ "`scriptFile` 是字符串,表示服务器端的测试脚本文件或目录。可以是相对路径或绝对路径。",
99176
99323
  "",
99177
- "`outputFile` 是字符串,测试结果输出文件或目录。",
99324
+ "`outputFile` 是字符串,表示服务器端的测试结果输出文件。可以是相对路径或绝对路径。",
99178
99325
  "",
99179
99326
  "`testMemLeaking` 是布尔值,表示是否测试内存泄漏。"
99180
99327
  ]
@@ -99190,9 +99337,9 @@
99190
99337
  "value": [
99191
99338
  "用于单元测试的系统命令。该命令必须要用户登录后才能执行。",
99192
99339
  "",
99193
- "如果 *scriptFile* 是一个目录,测试目录中所有脚本文件。",
99340
+ "如果 *scriptFile* 是一个目录,将执行测试目录中所有脚本文件,不会执行子目录中的文件。",
99194
99341
  "",
99195
- "如果 *outputFile* 没有指定,测试结果将会显示在屏幕上。"
99342
+ "如果 *outputFile* 没有指定,测试结果将会显示在屏幕上。如果 *outputFile* 指定为相对路径,则测试结果文件输出到 <HomeDir>。"
99196
99343
  ]
99197
99344
  }
99198
99345
  ]
@@ -99206,8 +99353,8 @@
99206
99353
  "language": "console",
99207
99354
  "value": [
99208
99355
  "",
99209
- " $ test(\"C:/DolphinDB/test/test1.txt\", \"C:/DolphinDB/testResult/test1.txt\");",
99210
- " $ test(\"C:/DolphinDB/test\");",
99356
+ " $ test(\"/home/Data/test.dos\", \"/home/Data/result.dos\");",
99357
+ " $ test(\"/home/Data\");",
99211
99358
  ""
99212
99359
  ]
99213
99360
  }
package/i18n/dict.json CHANGED
@@ -76,5 +76,8 @@
76
76
  },
77
77
  "vector<{{type}}> 暂时不支持解析": {
78
78
  "en": "cannot parse vector<{{type}}>"
79
+ },
80
+ "流数据订阅后一定先返回 schema": {
81
+ "en": "After subscribing to streaming data, the schema must be returned first."
79
82
  }
80
83
  }
package/index.d.ts CHANGED
@@ -363,6 +363,7 @@ export interface DdbRpcOptions {
363
363
  listener?: DdbMessageListener;
364
364
  parse_object?: boolean;
365
365
  skip_connection_check?: boolean;
366
+ on_more_messages?: (buffer: Uint8Array) => void;
366
367
  }
367
368
  export declare class DdbConnectionError extends Error {
368
369
  name: string;
@@ -561,7 +562,7 @@ export declare class DDB {
561
562
  将这个 flag 设为 true 跳过连接状态检查
562
563
  (internal use) When await ddb.connect() establishes a connection for the first time, you cannot call await this.connect() again to ensure the connection status, which will lead to circular dependencies.
563
564
  Set this flag to true to skip connection status checks */
564
- call<TResult extends DdbObj>(func: string, args?: (DdbObj | string | boolean)[], { urgent, node, nodes, func_type, add_node_alias, listener, parse_object, skip_connection_check }?: {
565
+ call<TResult extends DdbObj>(func: string, args?: (DdbObj | string | boolean)[], { urgent, node, nodes, func_type, add_node_alias, listener, parse_object, skip_connection_check, on_more_messages }?: {
565
566
  urgent?: boolean;
566
567
  node?: string;
567
568
  nodes?: string[];
@@ -570,6 +571,7 @@ export declare class DDB {
570
571
  listener?: DdbMessageListener;
571
572
  parse_object?: boolean;
572
573
  skip_connection_check?: boolean;
574
+ on_more_messages?: DdbRpcOptions['on_more_messages'];
573
575
  }): Promise<TResult>;
574
576
  /** upload variable through websocket (variable command) */
575
577
  upload(