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.en.json CHANGED
@@ -176,25 +176,35 @@
176
176
  "",
177
177
  " //define a unary function",
178
178
  " $ def func1(x){",
179
- " $ \tif(x<5){",
180
- " $ \t\treturn x*3",
181
- " $ \t}",
182
- " $ \telse{",
183
- " $ \t\treturn 6",
184
- " $ \t}",
179
+ " $ if(x<5){",
180
+ " $ return x*3",
181
+ " $ }",
182
+ " $ else{",
183
+ " $ return x+3",
184
+ " $ }",
185
185
  " $ }",
186
186
  " //when X is an integer, the size of the result is X + 1 ",
187
187
  " $ accumulate(func1, 5, 1)",
188
- " [1,3,9,6,6,6]",
189
- " //when X is NULL or unspecified, as the results of the 3rd and 4th iterations are the same, the function stops iteration and outputs the results of the first three iterations",
190
- " $ accumulate(func1,NULL,1)",
191
- " [1,3,9,6]",
188
+ " [1,3,9,12,15,18]",
192
189
  " //X is a unary function \"condition\". As condition returns false during the 3rd iteration, the system stops iteration and outputs the results of the first two iterations.",
193
190
  " $ def condition(x){",
194
- " $ \treturn x<9",
191
+ " $ return x<9",
195
192
  " $ }",
196
193
  " $ accumulate(func1, condition, 1) ",
197
194
  " [1,3,9]",
195
+ "",
196
+ " //when X is NULL or unspecified, define a UDF func2 for iteration.",
197
+ " $ def func2(x){",
198
+ " $ if(x<5){",
199
+ " $ return x*3",
200
+ " $ }",
201
+ " $ else{",
202
+ " $ return 6",
203
+ " $ }",
204
+ " $ }",
205
+ " //As the results of the 3rd and 4th iterations are the same, the function stops iteration and outputs the results of the first three iterations.",
206
+ " $ accumulate(func2,NULL,1)",
207
+ " [1,3,9,6]",
198
208
  ""
199
209
  ]
200
210
  },
@@ -7541,7 +7551,7 @@
7541
7551
  "",
7542
7552
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
7543
7553
  " $ ds.cacheDS!() //cache the data",
7544
- " $ ds.clearCacheDS!() //clear the cache"
7554
+ " $ ds.clearDSCache!() //clear the cache"
7545
7555
  ]
7546
7556
  }
7547
7557
  ]
@@ -7603,7 +7613,7 @@
7603
7613
  "",
7604
7614
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
7605
7615
  " $ ds.cacheDSNow() //cache the data immediately",
7606
- " $ ds.clearCacheDSNow() //clear the cache immediately",
7616
+ " $ ds.clearDSCacheNow() //clear the cache immediately",
7607
7617
  "",
7608
7618
  "",
7609
7619
  "",
@@ -7789,7 +7799,7 @@
7789
7799
  {
7790
7800
  "type": "text",
7791
7801
  "value": [
7792
- "Call a function with the specified parameters. It is often used with function :doc:`each/peach <each>` or :doc:`loop/ploop <loopPloop>` to call multiple functions."
7802
+ "Call a function with the specified parameters. It is often used with function :doc:`each </Functionalprogramming/TemplateFunctions/each>`/:doc:`peach </Functionalprogramming/TemplateFunctions/peach>` or :doc:`loop </Functionalprogramming/TemplateFunctions/loop>`/:doc:`ploop </Functionalprogramming/TemplateFunctions/ploop>` to call multiple functions."
7793
7803
  ]
7794
7804
  }
7795
7805
  ]
@@ -10444,7 +10454,7 @@
10444
10454
  " ",
10445
10455
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
10446
10456
  " $ ds.cacheDS!() //cache the data",
10447
- " $ ds.clearCacheDS!() //clear the cache"
10457
+ " $ ds.clearDSCache!() //clear the cache"
10448
10458
  ]
10449
10459
  }
10450
10460
  ]
@@ -10506,7 +10516,7 @@
10506
10516
  " ",
10507
10517
  " $ ds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)",
10508
10518
  " $ ds.cacheDSNow() //cache the data immediately",
10509
- " $ ds.clearCacheDSNow() //clear the cache immediately"
10519
+ " $ ds.clearDSCacheNow() //clear the cache immediately"
10510
10520
  ]
10511
10521
  }
10512
10522
  ]
@@ -16154,9 +16164,7 @@
16154
16164
  "",
16155
16165
  "If the result of func(X[i], Y[j]) is a scalar, the result of the ``cross`` template is a matrix.",
16156
16166
  "",
16157
- "If the result of func(X[i], Y[j]) is a vector, the result of the ``cross`` template is a tuple with m elements. Each of the element is a tuple with n elements.",
16158
- "",
16159
- "``pcross`` is the parallel computing version of template function ``cross``."
16167
+ "If the result of func(X[i], Y[j]) is a vector, the result of the ``cross`` template is a tuple with m elements. Each of the element is a tuple with n elements."
16160
16168
  ]
16161
16169
  }
16162
16170
  ]
@@ -21065,7 +21073,9 @@
21065
21073
  {
21066
21074
  "type": "text",
21067
21075
  "value": [
21068
- "Return the corresponding datetime(s). The return value type is DATETIME, a temporal."
21076
+ "Return the corresponding datetime(s). The return value type is DATETIME, a temporal.",
21077
+ "",
21078
+ "Note that the range for data of DATETIME type is [1901.12.13T20:45:53, 2038.01.19T03:14:07]."
21069
21079
  ]
21070
21080
  }
21071
21081
  ]
@@ -26141,9 +26151,7 @@
26141
26151
  "",
26142
26152
  "The data type and form of the return value are determined by each calculation result. It returns a vector or matrix if all calculation results have the same data type and form, otherwise it returns a tuple.",
26143
26153
  "",
26144
- "The difference between *func(X)* and *func :E X* is that the former treats *X* as the one input variable while the later takes each element in *X* as an input variable. If *func* is a vector function, avoid using “:E“ since element-wise operations are very slow with a large number of elements.",
26145
- "",
26146
- "``peach`` is the parallel computing version of template function ``each`` . For tasks that take a long time to finish, ``peach`` can save a significant amount of time over ``each``. For light tasks, however, ``peach`` may take longer than each as the overhead of parallel function call is not trivial."
26154
+ "The difference between *func(X)* and *func :E X* is that the former treats *X* as the one input variable while the later takes each element in *X* as an input variable. If *func* is a vector function, avoid using “:E“ since element-wise operations are very slow with a large number of elements."
26147
26155
  ]
26148
26156
  }
26149
26157
  ]
@@ -28011,7 +28019,9 @@
28011
28019
  "type": "text",
28012
28020
  "value": [
28013
28021
  "- It is recommended to invoke command :doc:`/FunctionsandCommands/CommandsReferences/f/fflush` to write data in the page cache to disk before you kill a DolphinDB process and restart it.",
28014
- "- If asynchronous mode is enabled for data persistence or flush, data loss may occur due to server crash.",
28022
+ "- If asynWrite is set to true, streaming data is written at the fastest speed and data loss may occur due to server crash.",
28023
+ "- If asynWrite is set to false and flushMode to 0, data loss may occur due to operating system crash.",
28024
+ "- If asynWrite is set to false and flushMode to 1, the streaming data is written at the slowest speed, and server or operating system crash will not cause data loss.",
28015
28025
  "- It is not allowed to share a stream table multiple times by modifying the shared table name."
28016
28026
  ]
28017
28027
  }
@@ -33402,21 +33412,21 @@
33402
33412
  {
33403
33413
  "type": "text",
33404
33414
  "value": [
33405
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
33406
- "| userName type | startTime | dbName | tableName | totalPartitions | completedPartitions | percentComplete | endTime completed |",
33407
- "+===============+=============================================+===============+===========+=================+=====================+=================+===========================+",
33408
- "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt | 1 | 1 | 100 | 2022.09.21T17:18:04.269 1 |",
33409
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
33410
- "| u1 | BACKUP 2022.09.21T17:13:04.344 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T17:13:04.413 1 |",
33411
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
33412
- "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt1 | 1 | 1 | 100 | 2022.09.21T17:18:04.265 1 |",
33413
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
33414
- "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:47:42.798 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:47:42.859 1 |",
33415
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
33416
- "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:37:33.725 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:37:33.790 1 |",
33417
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+",
33418
- "| admin | BACKUP 2022.09.21T15:10:05.016 | dfs://compoDB | pt2 | 10 | 10 | 100 | 2022.09.21T15:10:05.075 1 |",
33419
- "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+"
33415
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
33416
+ "| userName type | startTime | dbName | tableName | totalPartitions | completedPartitions | percentComplete | endTime | completed |",
33417
+ "+===============+=============================================+===============+===========+=================+=====================+=================+=========================================+",
33418
+ "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt | 1 | 1 | 100 | 2022.09.21T17:18:04.269 | 1 |",
33419
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
33420
+ "| u1 | BACKUP 2022.09.21T17:13:04.344 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T17:13:04.413 | 1 |",
33421
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
33422
+ "| u1 | BACKUP_BY_COPY_FILE 2022.09.21T17:18:04.264 | dfs://valuedb | pt1 | 1 | 1 | 100 | 2022.09.21T17:18:04.265 | 1 |",
33423
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
33424
+ "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:47:42.798 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:47:42.859 | 1 |",
33425
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
33426
+ "| admin | BACKUP_BY_COPY_FILE 2022.09.21T16:37:33.725 | dfs://valuedb | pt | 4 | 4 | 100 | 2022.09.21T16:37:33.790 | 1 |",
33427
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+",
33428
+ "| admin | BACKUP 2022.09.21T15:10:05.016 | dfs://compoDB | pt2 | 10 | 10 | 100 | 2022.09.21T15:10:05.075 | 1 |",
33429
+ "+---------------+---------------------------------------------+---------------+-----------+-----------------+---------------------+-----------------+---------------------------+-------------+"
33420
33430
  ]
33421
33431
  }
33422
33432
  ]
@@ -40178,7 +40188,7 @@
40178
40188
  {
40179
40189
  "type": "text",
40180
40190
  "value": [
40181
- "Grant user \"AlexSmith\" the privilege to create and manage databases with prefix \"dbxxx\" where xxx is from 000 to 099.",
40191
+ "Grant user \"AlexSmith\" the privilege to create and manage databases with prefix \"dbxxx\".",
40182
40192
  ""
40183
40193
  ]
40184
40194
  },
@@ -53367,8 +53377,8 @@
53367
53377
  }
53368
53378
  ]
53369
53379
  },
53370
- "loopPloop": {
53371
- "title": "loopPloop",
53380
+ "loop": {
53381
+ "title": "loop",
53372
53382
  "type": "template",
53373
53383
  "children": [
53374
53384
  {
@@ -67563,6 +67573,76 @@
67563
67573
  }
67564
67574
  ]
67565
67575
  },
67576
+ "pcross": {
67577
+ "title": "pcross",
67578
+ "type": "template",
67579
+ "children": [
67580
+ {
67581
+ "title": "Syntax",
67582
+ "type": "grammer",
67583
+ "children": [
67584
+ {
67585
+ "type": "text",
67586
+ "value": [
67587
+ "pcross(func, X, [Y])",
67588
+ "",
67589
+ "``pcross`` is the parallel computing version of template function ``cross`` ."
67590
+ ]
67591
+ }
67592
+ ]
67593
+ }
67594
+ ]
67595
+ },
67596
+ "peach": {
67597
+ "title": "peach",
67598
+ "type": "template",
67599
+ "children": [
67600
+ {
67601
+ "title": "Syntax",
67602
+ "type": "grammer",
67603
+ "children": [
67604
+ {
67605
+ "type": "text",
67606
+ "value": [
67607
+ "peach(func, args...)"
67608
+ ]
67609
+ }
67610
+ ]
67611
+ },
67612
+ {
67613
+ "title": "Details",
67614
+ "type": "detail",
67615
+ "children": [
67616
+ {
67617
+ "type": "text",
67618
+ "value": [
67619
+ "``peach`` is the parallel computing version of template function ``each``. For tasks that take a long time to finish, ``peach`` can save a significant amount of time over ``each``. For light tasks, however, ``peach`` may take longer than each as the overhead of parallel function call is not trivial.",
67620
+ "",
67621
+ "Refer to :doc:`/DatabaseandDistributedComputing/DistributedComputing` for the details of Parallel Function Call."
67622
+ ]
67623
+ }
67624
+ ]
67625
+ },
67626
+ {
67627
+ "title": "Examples",
67628
+ "type": "example",
67629
+ "children": [
67630
+ {
67631
+ "type": "code",
67632
+ "language": "console",
67633
+ "value": [
67634
+ "",
67635
+ " $ m=rand(1,20000:5000)",
67636
+ " $ timer f=peach(mskew{,8},m) ",
67637
+ " Time elapsed: 3134.71 ms",
67638
+ " $ timer f=mskew(m,8) ",
67639
+ " Time elapsed: 8810.485 ms"
67640
+ ]
67641
+ }
67642
+ ]
67643
+ }
67644
+ ]
67645
+ },
67566
67646
  "percentChange": {
67567
67647
  "title": "percentChange",
67568
67648
  "type": "function",
@@ -68303,6 +68383,26 @@
68303
68383
  }
68304
68384
  ]
68305
68385
  },
68386
+ "ploop": {
68387
+ "title": "ploop",
68388
+ "type": "template",
68389
+ "children": [
68390
+ {
68391
+ "title": "Syntax",
68392
+ "type": "grammer",
68393
+ "children": [
68394
+ {
68395
+ "type": "text",
68396
+ "value": [
68397
+ "ploop(func, args...)",
68398
+ "",
68399
+ "``ploop`` is the parallel computing version of template function ``loop`` . Refer to :doc:`/DatabaseandDistributedComputing/DistributedComputing` for the details of Parallel Function Call."
68400
+ ]
68401
+ }
68402
+ ]
68403
+ }
68404
+ ]
68405
+ },
68306
68406
  "plot": {
68307
68407
  "title": "plot",
68308
68408
  "type": "function",
@@ -73420,23 +73520,38 @@
73420
73520
  "language": "console",
73421
73521
  "value": [
73422
73522
  "",
73423
- " $ def func1(x){",
73424
- " $ \tif(x<5){",
73425
- " $ \t\treturn x*3",
73426
- " $ \t}",
73427
- " $ \telse{",
73428
- " $ \t\treturn 6",
73429
- " $ \t}",
73523
+ " // define a unary function",
73524
+ " $ def func1(x){",
73525
+ " $ if(x<5){",
73526
+ " $ return x*3",
73527
+ " $ }",
73528
+ " $ else{",
73529
+ " $ return x+3",
73530
+ " $ }",
73430
73531
  " $ }",
73532
+ " // When X is an integer, iterate X times and output the last result.",
73431
73533
  " $ reduce(func1, 5, 1)",
73432
- " 6",
73433
- " $ reduce(func1,NULL,1)",
73434
- " 6",
73534
+ " 18",
73535
+ " //X is a unary function \"condition\". As condition returns false during the 3rd iteration, the system stops iteration and outputs the results of the first two iterations.",
73435
73536
  " $ def condition(x){",
73436
73537
  " $ \treturn x<9",
73437
73538
  " $ }",
73438
73539
  " $ reduce(func1, condition, 1) ",
73439
73540
  " 9",
73541
+ "",
73542
+ " //when X is NULL or unspecified, define a UDF func2 for iteration.",
73543
+ " $ def func2(x){",
73544
+ " $ if(x<5){",
73545
+ " $ return x*3",
73546
+ " $ }",
73547
+ " $ else{",
73548
+ " $ return 6",
73549
+ " $ }",
73550
+ " $ }",
73551
+ " //As the results of the 3rd and 4th iterations are the same, the function stops iteration and outputs the results of the first three iterations.",
73552
+ " $ reduce(func2,NULL,1)",
73553
+ " // output",
73554
+ " 6",
73440
73555
  ""
73441
73556
  ]
73442
73557
  },
@@ -76526,7 +76641,7 @@
76526
76641
  " $ restore(\"/home/DolphinDB/backup\",\"dfs://compoDB\",\"pt\",\"%20170810%\",true)",
76527
76642
  " [\"dfs://compoDB/20170810/0_50/6F\",\"dfs://compoDB/20170810/50_100/6F\"]",
76528
76643
  "",
76529
- "Example 3. Restore the backup of table pt to table temp. Table temp has the same schema as table pt.",
76644
+ "Example 3. Restore the backup of table pt to table temp. Table temp has the same schema as table pt. Note that data loss may occur in table temp when using \"%\".",
76530
76645
  ""
76531
76646
  ]
76532
76647
  },
@@ -101686,8 +101801,7 @@
101686
101801
  "type": "text",
101687
101802
  "value": [
101688
101803
  "Call a function with the specified parameters. Similar to :doc:`/Functionalprogramming/TemplateFunctions/call`, ",
101689
- "it can be used in :doc:`each/peach </Functionalprogramming/TemplateFunctions/each>` or ",
101690
- ":doc:`loop/ploop </Functionalprogramming/TemplateFunctions/loopPloop>` function to call a set of functions. ",
101804
+ "it can be used in :doc:`each </Functionalprogramming/TemplateFunctions/each>`/:doc:`peach </Functionalprogramming/TemplateFunctions/peach>` or :doc:`loop </Functionalprogramming/TemplateFunctions/loop>`/:doc:`ploop </Functionalprogramming/TemplateFunctions/ploop>` function to call a set of functions. ",
101691
101805
  "The difference is that the size of args in call function is determined by the function passed in by the parameter func, ",
101692
101806
  "whereas the size of args in unifiedCall is always 1. All arguments of the function used in function call is assembled in a ",
101693
101807
  "tuple for function unifiedCall. "