dolphindb 2.0.603 → 2.0.800
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.d.ts +98 -17
- package/browser.js +333 -154
- package/browser.js.map +1 -1
- package/docs.en.json +2096 -646
- package/docs.zh.json +1290 -729
- package/index.d.ts +103 -18
- package/index.js +350 -166
- package/index.js.map +1 -1
- package/language.d.ts +2 -2
- package/language.js +5 -3
- package/language.js.map +1 -1
- package/package.json +7 -7
package/docs.en.json
CHANGED
|
@@ -13075,7 +13075,7 @@
|
|
|
13075
13075
|
"type": "code",
|
|
13076
13076
|
"language": "console",
|
|
13077
13077
|
"value": [
|
|
13078
|
-
"
|
|
13078
|
+
"",
|
|
13079
13079
|
" $ n=1000000;",
|
|
13080
13080
|
" $ t=table(rand(`IBM`MS`APPL`AMZN,n) as symbol, rand(10.0, n) as value)",
|
|
13081
13081
|
" $ db = database(\"dfs://rangedb_tradedata\", RANGE, `A`F`M`S`ZZZZ)",
|
|
@@ -13096,7 +13096,7 @@
|
|
|
13096
13096
|
"type": "code",
|
|
13097
13097
|
"language": "console",
|
|
13098
13098
|
"value": [
|
|
13099
|
-
"
|
|
13099
|
+
"",
|
|
13100
13100
|
" $ Trades.append!(t);",
|
|
13101
13101
|
""
|
|
13102
13102
|
]
|
|
@@ -13112,7 +13112,7 @@
|
|
|
13112
13112
|
"type": "code",
|
|
13113
13113
|
"language": "console",
|
|
13114
13114
|
"value": [
|
|
13115
|
-
"
|
|
13115
|
+
"",
|
|
13116
13116
|
" $ Trades=loadTable(db,`Trades);",
|
|
13117
13117
|
" $ select min(value) from Trades;",
|
|
13118
13118
|
" 0",
|
|
@@ -13126,27 +13126,17 @@
|
|
|
13126
13126
|
"",
|
|
13127
13127
|
"After appending data to a DFS table, we don't need to use function ``loadTable`` to load the table before querying the table, as the distributed file system automatically refreshes the table after appending operations. After system restarts, however, we need to use ``loadTable`` to load a DFS table before querying the table. ",
|
|
13128
13128
|
"",
|
|
13129
|
-
"Example 2. Create a partitioned table in a local database on disk.",
|
|
13129
|
+
".. Example 2. Create a partitioned table in a local database on disk.",
|
|
13130
13130
|
"",
|
|
13131
|
-
"Compared with example 1, we just need to change the path of the database to a local directory. Please note that after appending data to a local database table, we need to use function ``loadTable`` to load the table before querying the table. ",
|
|
13132
|
-
""
|
|
13133
|
-
|
|
13134
|
-
},
|
|
13135
|
-
{
|
|
13136
|
-
"type": "code",
|
|
13137
|
-
"language": "console",
|
|
13138
|
-
"value": [
|
|
13131
|
+
".. Compared with example 1, we just need to change the path of the database to a local directory. Please note that after appending data to a local database table, we need to use function ``loadTable`` to load the table before querying the table. ",
|
|
13132
|
+
"",
|
|
13133
|
+
".. .. code:: console",
|
|
13139
13134
|
" ",
|
|
13140
13135
|
" $ db=database(\"C:/DolphinDB/Data/rangedb_tradedata\",RANGE,`A`F`M`S`ZZZZ)",
|
|
13141
|
-
""
|
|
13142
|
-
]
|
|
13143
|
-
},
|
|
13144
|
-
{
|
|
13145
|
-
"type": "text",
|
|
13146
|
-
"value": [
|
|
13147
|
-
"Example 3. Create a partitioned table in an in-memory database.",
|
|
13148
13136
|
"",
|
|
13149
|
-
"Example
|
|
13137
|
+
"Example 2. Create in-memory partitioned tables",
|
|
13138
|
+
"",
|
|
13139
|
+
"Example 2.1. Create an ordinary partitioned in-memory table. ",
|
|
13150
13140
|
""
|
|
13151
13141
|
]
|
|
13152
13142
|
},
|
|
@@ -13154,14 +13144,14 @@
|
|
|
13154
13144
|
"type": "code",
|
|
13155
13145
|
"language": "console",
|
|
13156
13146
|
"value": [
|
|
13157
|
-
"
|
|
13147
|
+
"",
|
|
13158
13148
|
" $ n = 200000",
|
|
13159
13149
|
" $ colNames = `time`sym`qty`price",
|
|
13160
13150
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
13161
13151
|
" $ t = table(n:0, colNames, colTypes)",
|
|
13162
13152
|
" $ db = database(, RANGE, `A`D`F)",
|
|
13163
13153
|
" $ pt = db.createPartitionedTable(t, `pt, `sym)",
|
|
13164
|
-
"
|
|
13154
|
+
"",
|
|
13165
13155
|
" $ insert into pt values(09:30:00.001,`AAPL,100,56.5)",
|
|
13166
13156
|
" $ insert into pt values(09:30:01.001,`DELL,100,15.5)",
|
|
13167
13157
|
""
|
|
@@ -13170,7 +13160,7 @@
|
|
|
13170
13160
|
{
|
|
13171
13161
|
"type": "text",
|
|
13172
13162
|
"value": [
|
|
13173
|
-
"Example
|
|
13163
|
+
"Example 2.2. Create a partitioned keyed table. ",
|
|
13174
13164
|
""
|
|
13175
13165
|
]
|
|
13176
13166
|
},
|
|
@@ -13178,14 +13168,14 @@
|
|
|
13178
13168
|
"type": "code",
|
|
13179
13169
|
"language": "console",
|
|
13180
13170
|
"value": [
|
|
13181
|
-
"
|
|
13171
|
+
"",
|
|
13182
13172
|
" $ n = 200000",
|
|
13183
13173
|
" $ colNames = `time`sym`qty`price",
|
|
13184
13174
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
13185
13175
|
" $ t = keyedTable(`time`sym, n:0, colNames, colTypes)",
|
|
13186
13176
|
" $ db = database(, RANGE, `A`D`F)",
|
|
13187
13177
|
" $ pt = db.createPartitionedTable(t, `pt, `sym)",
|
|
13188
|
-
"
|
|
13178
|
+
"",
|
|
13189
13179
|
" $ insert into pt values(09:30:00.001,`AAPL,100,56.5)",
|
|
13190
13180
|
" $ insert into pt values(09:30:01.001,`DELL,100,15.5)",
|
|
13191
13181
|
""
|
|
@@ -13194,7 +13184,7 @@
|
|
|
13194
13184
|
{
|
|
13195
13185
|
"type": "text",
|
|
13196
13186
|
"value": [
|
|
13197
|
-
"Example
|
|
13187
|
+
"Example 2.3. Create a partitioned stream table.",
|
|
13198
13188
|
"",
|
|
13199
13189
|
"Please note that when creating a partitioned stream table, the second parameter of ``createPartitionedTable`` must be a tuple of tables, and its length must be equal to the number of partitions. Each table in the tuple represents a partition. In the following example, `trades_stream1` and `trades_stream2` form a partitioned stream table `trades`. We can't directly write data to `trades`. Instead, we need to write to `trades_stream1` and `trades_stream2`.",
|
|
13200
13190
|
""
|
|
@@ -13204,7 +13194,7 @@
|
|
|
13204
13194
|
"type": "code",
|
|
13205
13195
|
"language": "console",
|
|
13206
13196
|
"value": [
|
|
13207
|
-
"
|
|
13197
|
+
"",
|
|
13208
13198
|
" $ n=200000",
|
|
13209
13199
|
" $ colNames = `time`sym`qty`price",
|
|
13210
13200
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
@@ -13212,7 +13202,7 @@
|
|
|
13212
13202
|
" $ trades_stream2 = streamTable(n:0, colNames, colTypes)",
|
|
13213
13203
|
" $ db=database(, RANGE, `A`D`F)",
|
|
13214
13204
|
" $ trades = createPartitionedTable(db,[trades_stream1, trades_stream2], \"\", `sym)",
|
|
13215
|
-
"
|
|
13205
|
+
"",
|
|
13216
13206
|
" $ insert into trades_stream1 values(09:30:00.001,`AAPL,100,56.5)",
|
|
13217
13207
|
" $ insert into trades_stream2 values(09:30:01.001,`DELL,100,15.5)",
|
|
13218
13208
|
"",
|
|
@@ -13230,7 +13220,7 @@
|
|
|
13230
13220
|
"09:30:01.001 DELL 100 15.5",
|
|
13231
13221
|
"============= ===== ===== ======",
|
|
13232
13222
|
"",
|
|
13233
|
-
"Example
|
|
13223
|
+
"Example 2.4. Create a partitioned MVCC table.",
|
|
13234
13224
|
"",
|
|
13235
13225
|
"Similar to creating a partitioned stream table, to create a partitioned MVCC table, the second parameter of ``createPartitionedTable`` must be a tuple of tables, and its length must be equal to the number of partitions. Each table in the tuple represents a partition. In the following example, `trades_mvcc1` and `trades_mvcc2` form a partitioned MVCC table `trades`. We can't directly write data to trades. Instead, we need to write to `trades_mvcc1` and `trades_mvcc2`. ",
|
|
13236
13226
|
""
|
|
@@ -13240,7 +13230,7 @@
|
|
|
13240
13230
|
"type": "code",
|
|
13241
13231
|
"language": "console",
|
|
13242
13232
|
"value": [
|
|
13243
|
-
"
|
|
13233
|
+
"",
|
|
13244
13234
|
" $ n=200000",
|
|
13245
13235
|
" $ colNames = `time`sym`qty`price",
|
|
13246
13236
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
@@ -13248,7 +13238,7 @@
|
|
|
13248
13238
|
" $ trades_mvcc2 = mvccTable(n:0, colNames, colTypes)",
|
|
13249
13239
|
" $ db=database(, RANGE, `A`D`F)",
|
|
13250
13240
|
" $ trades = createPartitionedTable(db,[trades_mvcc1, trades_mvcc2], \"\", `sym)",
|
|
13251
|
-
"
|
|
13241
|
+
"",
|
|
13252
13242
|
" $ insert into trades_mvcc1 values(09:30:00.001,`AAPL,100,56.5)",
|
|
13253
13243
|
" $ insert into trades_mvcc2 values(09:30:01.001,`DELL,100,15.5)",
|
|
13254
13244
|
"",
|
|
@@ -13274,13 +13264,20 @@
|
|
|
13274
13264
|
"type": "code",
|
|
13275
13265
|
"language": "console",
|
|
13276
13266
|
"value": [
|
|
13277
|
-
"
|
|
13267
|
+
"",
|
|
13278
13268
|
" $ db = database(\"dfs://demodb\", VALUE, 1..10)",
|
|
13279
13269
|
" $ t=table(take(1, 86400) as id, 2020.01.01T00:00:00 + 0..86399 as timestamp, rand(1..100, 86400) as val)",
|
|
13280
13270
|
" $ pt =db.createPartitionedTable(t, \"pt\", \"id\", {timestamp:\"delta\", val:\"delta\"})",
|
|
13281
13271
|
" $ pt.append!(t)",
|
|
13282
13272
|
""
|
|
13283
13273
|
]
|
|
13274
|
+
},
|
|
13275
|
+
{
|
|
13276
|
+
"type": "text",
|
|
13277
|
+
"value": [
|
|
13278
|
+
".. meta::",
|
|
13279
|
+
" :keywords: in-memory table"
|
|
13280
|
+
]
|
|
13284
13281
|
}
|
|
13285
13282
|
]
|
|
13286
13283
|
}
|
|
@@ -13319,7 +13316,7 @@
|
|
|
13319
13316
|
"* moving function: ema, mavg, msum, mcount, mprod, mvar, mvarp, mstd, mstdp, mskew, mkurtosis, mmin, mmax, mimin, mimax, mmed, mpercentile, mrank, mcorr, mcovar, mbeta, mwsum, mwavg, mmad, mfirst, mlast, mslr, tmove, tmfirst, tmlast, tmsum, tmavg, tmcount, tmvar, tmvarp, tmstd, tmstdp, tmprod, tmskew, tmkurtosis, tmmin, tmmax, tmmed, tmpercentile, tmrank, tmcovar, tmbeta, tmcorr, tmwavg, tmwsum, tmoving, moving, sma,wma, dema, tema, trima, linearTimeTrend, talib, t3, ma",
|
|
13320
13317
|
"* order-sensitive function: deltas, ratios, ffill, move, prev, iterate, ewmMean, ewmVar, ewmStd, ewmCov, ewmCorr",
|
|
13321
13318
|
"* topN function: msumTopN, mavgTopN, mstdpTopN, mstdTopN, mvarpTopN, mvarTopN, mcorrTopN, mbetaTopN, mcovarTopN, mwsumTopN",
|
|
13322
|
-
"* other: talibNull, talibNull,
|
|
13319
|
+
"* other: talibNull, talibNull, dynamicGroupCumsum, dynamicGroupCumcount",
|
|
13323
13320
|
"",
|
|
13324
13321
|
"Note: The parameter *func* in the state function ``talib`` can only be a state function supported by the reactive state engine.",
|
|
13325
13322
|
"",
|
|
@@ -13729,7 +13726,7 @@
|
|
|
13729
13726
|
{
|
|
13730
13727
|
"type": "text",
|
|
13731
13728
|
"value": [
|
|
13732
|
-
"createTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, [timeColumn], [useSystemTime=false], [keyColumn], [garbageSize], [updateTime], [useWindowStartTime=false], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [fill='none'], [forceTriggerTime], [raftGroup])",
|
|
13729
|
+
"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'])",
|
|
13733
13730
|
"",
|
|
13734
13731
|
"Alias: createTimeSeriesAggregator"
|
|
13735
13732
|
]
|
|
@@ -13745,7 +13742,7 @@
|
|
|
13745
13742
|
"value": [
|
|
13746
13743
|
"Create a time-series engine to conduct real-time time-series aggregate calculations with streaming data.",
|
|
13747
13744
|
"",
|
|
13748
|
-
"Return a table object that subscribes to a stream table. Ingesting data to this table means that data enters the engine for windowed aggregations.
|
|
13745
|
+
"Return a table object that subscribes to a stream table. Ingesting data to this table means that data enters the engine for windowed aggregations. ",
|
|
13749
13746
|
"",
|
|
13750
13747
|
"If *keyColumn* is specified to group the records that have the same key, the window calculation will be performed in each group.",
|
|
13751
13748
|
"",
|
|
@@ -17163,7 +17160,7 @@
|
|
|
17163
17160
|
{
|
|
17164
17161
|
"type": "text",
|
|
17165
17162
|
"value": [
|
|
17166
|
-
"\\1. To establish a non-partitioned database:",
|
|
17163
|
+
"\\1. To establish a non-partitioned database on disk:",
|
|
17167
17164
|
""
|
|
17168
17165
|
]
|
|
17169
17166
|
},
|
|
@@ -17172,7 +17169,7 @@
|
|
|
17172
17169
|
"language": "console",
|
|
17173
17170
|
"value": [
|
|
17174
17171
|
" ",
|
|
17175
|
-
" $ db=database(
|
|
17172
|
+
" $ db=database(directory=\"C:/DolphinDB/Data/db1/\");",
|
|
17176
17173
|
" $ t=table(take(1..10,10000000) as id, rand(10,10000000) as x, rand(10.0,10000000) as y);",
|
|
17177
17174
|
" $ saveTable(db, t, `t1);",
|
|
17178
17175
|
""
|
|
@@ -17200,7 +17197,7 @@
|
|
|
17200
17197
|
" $ t=table(ID, date, x);",
|
|
17201
17198
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
17202
17199
|
" ",
|
|
17203
|
-
" $ db = database(
|
|
17200
|
+
" $ db = database(directory=\"C:/DolphinDB/Data/seqdb\", partitionType=SEQ, partitionScheme=8)",
|
|
17204
17201
|
" $ pt = loadTextEx(db, `pt, ,\"C:/DolphinDB/Data/t.txt\");",
|
|
17205
17202
|
""
|
|
17206
17203
|
]
|
|
@@ -17225,7 +17222,7 @@
|
|
|
17225
17222
|
" $ ID=rand(10, n)",
|
|
17226
17223
|
" $ x=rand(1.0, n)",
|
|
17227
17224
|
" $ t=table(ID, x);",
|
|
17228
|
-
" $ db=database(
|
|
17225
|
+
" $ db=database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 5 10)",
|
|
17229
17226
|
" $ pt = db.createPartitionedTable(t, `pt, `ID);",
|
|
17230
17227
|
" $ pt.append!(t);",
|
|
17231
17228
|
"",
|
|
@@ -17263,17 +17260,16 @@
|
|
|
17263
17260
|
" $ t=table(ID, x);",
|
|
17264
17261
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
17265
17262
|
" ",
|
|
17266
|
-
" $ db=database(
|
|
17263
|
+
" $ db=database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 5 10)",
|
|
17267
17264
|
" $ pt = loadTextEx(db, `pt, `ID, \"C:/DolphinDB/Data/t.txt\");",
|
|
17265
|
+
"",
|
|
17268
17266
|
""
|
|
17269
17267
|
]
|
|
17270
17268
|
},
|
|
17271
17269
|
{
|
|
17272
17270
|
"type": "text",
|
|
17273
17271
|
"value": [
|
|
17274
|
-
"
|
|
17275
|
-
"",
|
|
17276
|
-
"In hash domain, the data type and numbers of partitions need to be specified.",
|
|
17272
|
+
"In a hash domain (HASH), the data type and numbers of partitions need to be specified.",
|
|
17277
17273
|
""
|
|
17278
17274
|
]
|
|
17279
17275
|
},
|
|
@@ -17286,12 +17282,11 @@
|
|
|
17286
17282
|
" $ ID=rand(10, n)",
|
|
17287
17283
|
" $ x=rand(1.0, n)",
|
|
17288
17284
|
" $ t=table(ID, x)",
|
|
17289
|
-
" $ db=database(
|
|
17285
|
+
" $ db=database(directory=\"dfs://hashdb\", partitionType=HASH, partitionScheme=[INT, 2])",
|
|
17290
17286
|
" ",
|
|
17291
17287
|
" $ pt = db.createPartitionedTable(t, `pt, `ID)",
|
|
17292
17288
|
" $ pt.append!(t);",
|
|
17293
17289
|
" ",
|
|
17294
|
-
" $ pt=loadTable(db,`pt)",
|
|
17295
17290
|
" $ select count(x) from pt;",
|
|
17296
17291
|
""
|
|
17297
17292
|
]
|
|
@@ -17305,11 +17300,37 @@
|
|
|
17305
17300
|
"|1000000|",
|
|
17306
17301
|
"+-------+",
|
|
17307
17302
|
"",
|
|
17308
|
-
".. 上面的例子中,数据库db有两个分区。表t被保存为以ID为分区列的分区表pt。",
|
|
17309
|
-
"",
|
|
17310
17303
|
"In example above, database db has two partitions. Table t is saved as pt(a partitioned table) with the partitioning column ID.",
|
|
17311
17304
|
"",
|
|
17312
|
-
"
|
|
17305
|
+
"Note: For a database to be imported to a hash domain, if a partitioning column contains NULL value, the record is discarded.",
|
|
17306
|
+
""
|
|
17307
|
+
]
|
|
17308
|
+
},
|
|
17309
|
+
{
|
|
17310
|
+
"type": "code",
|
|
17311
|
+
"language": "console",
|
|
17312
|
+
"value": [
|
|
17313
|
+
"",
|
|
17314
|
+
" $ ID = NULL 3 6 NULL 9",
|
|
17315
|
+
" $ x = rand(1.0, 5)",
|
|
17316
|
+
" $ t1 = table(ID, x)",
|
|
17317
|
+
" $ pt.append!(t1)",
|
|
17318
|
+
" $ select count(x) from pt;",
|
|
17319
|
+
""
|
|
17320
|
+
]
|
|
17321
|
+
},
|
|
17322
|
+
{
|
|
17323
|
+
"type": "text",
|
|
17324
|
+
"value": [
|
|
17325
|
+
"+-------+",
|
|
17326
|
+
"|count_x|",
|
|
17327
|
+
"+=======+",
|
|
17328
|
+
"|1000003|",
|
|
17329
|
+
"+-------+",
|
|
17330
|
+
"",
|
|
17331
|
+
"",
|
|
17332
|
+
"",
|
|
17333
|
+
"In a value domain (VALUE), each element of the partition scheme vector determines a partition.",
|
|
17313
17334
|
""
|
|
17314
17335
|
]
|
|
17315
17336
|
},
|
|
@@ -17323,7 +17344,7 @@
|
|
|
17323
17344
|
" $ x=rand(1.0, n);",
|
|
17324
17345
|
" $ t=table(month, x);",
|
|
17325
17346
|
" ",
|
|
17326
|
-
" $ db=database(
|
|
17347
|
+
" $ db=database(directory=\"dfs://valuedb\", partitionType=VALUE, partitionScheme=2000.01M..2016.12M)",
|
|
17327
17348
|
" $ pt = db.createPartitionedTable(t, `pt, `month);",
|
|
17328
17349
|
" $ pt.append!(t);",
|
|
17329
17350
|
" ",
|
|
@@ -17341,7 +17362,7 @@
|
|
|
17341
17362
|
"|1000000|",
|
|
17342
17363
|
"+-------+",
|
|
17343
17364
|
"",
|
|
17344
|
-
"The example above defines a database db with 204 partitions. Each of these partitions is a month between January 2000 and December 2016. With function createPartitionedTable and append
|
|
17365
|
+
"The example above defines a database db with 204 partitions. Each of these partitions is a month between January 2000 and December 2016. With function ``createPartitionedTable`` and ``append!``, table t is saved as a partitioned table pt in the database db with the partitioning column of month.",
|
|
17345
17366
|
"",
|
|
17346
17367
|
".. image:: ../../../images/database03.png",
|
|
17347
17368
|
"",
|
|
@@ -17359,7 +17380,7 @@
|
|
|
17359
17380
|
" $ x=rand(1.0, n);",
|
|
17360
17381
|
" $ t=table(ticker, x);",
|
|
17361
17382
|
" ",
|
|
17362
|
-
" $ db=database(
|
|
17383
|
+
" $ db=database(directory=\"dfs://listdb\", partitionType=LIST, partitionScheme=[`IBM`ORCL`MSFT, `GOOG`FB])",
|
|
17363
17384
|
" $ pt = db.createPartitionedTable(t, `pt, `ticker)",
|
|
17364
17385
|
" $ pt.append!(t);",
|
|
17365
17386
|
" ",
|
|
@@ -17397,9 +17418,9 @@
|
|
|
17397
17418
|
" $ x=rand(10.0, n)",
|
|
17398
17419
|
" $ t=table(ID, date, x)",
|
|
17399
17420
|
" ",
|
|
17400
|
-
" $ dbDate = database(, VALUE, 2017.08.07..2017.08.11)",
|
|
17401
|
-
" $ dbID = database(, RANGE, 0 50 100)",
|
|
17402
|
-
" $ db = database(
|
|
17421
|
+
" $ dbDate = database(, partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)",
|
|
17422
|
+
" $ dbID = database(, partitionType=RANGE, partitionScheme=0 50 100)",
|
|
17423
|
+
" $ db = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID])",
|
|
17403
17424
|
" ",
|
|
17404
17425
|
" $ pt = db.createPartitionedTable(t, `pt, `date`ID)",
|
|
17405
17426
|
" $ pt.append!(t)",
|
|
@@ -17451,9 +17472,9 @@
|
|
|
17451
17472
|
" $ x=rand(10.0, n)",
|
|
17452
17473
|
" $ t=table(ID, date, x);",
|
|
17453
17474
|
" ",
|
|
17454
|
-
" $ dbDate = database(, VALUE, 2017.08.07..2017.08.11)",
|
|
17455
|
-
" $ dbID=database(, RANGE, 0 50 100);",
|
|
17456
|
-
" $ db = database(
|
|
17475
|
+
" $ dbDate = database(, partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)",
|
|
17476
|
+
" $ dbID=database(, partitionType=RANGE, partitionScheme=0 50 100);",
|
|
17477
|
+
" $ db = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID]);",
|
|
17457
17478
|
" $ pt = db.createPartitionedTable(t, `pt, `date`ID)",
|
|
17458
17479
|
" $ pt.append!(t);",
|
|
17459
17480
|
""
|
|
@@ -17505,7 +17526,7 @@
|
|
|
17505
17526
|
" $ x=rand(1.0, n)",
|
|
17506
17527
|
" $ t=table(ID, x);",
|
|
17507
17528
|
" ",
|
|
17508
|
-
" $ db=database(
|
|
17529
|
+
" $ db=database(directory=\"dfs://rangedb5\", partitionType=RANGE, partitionScheme=0 5 10, locations=[`node1`node2, `node3])",
|
|
17509
17530
|
" $ pt = db.createPartitionedTable(t, `pt, `ID);",
|
|
17510
17531
|
" $ pt.append!(t);",
|
|
17511
17532
|
""
|
|
@@ -17532,7 +17553,6 @@
|
|
|
17532
17553
|
"value": [
|
|
17533
17554
|
"Sites are separated by comma. Each site specification contains 3 parts: host name, port number, and alias. A partition can reside on multiple sites that back up each other. In this example, each node is located on a different machine.",
|
|
17534
17555
|
"",
|
|
17535
|
-
"",
|
|
17536
17556
|
"We can also use the actual host name and the port number to represent a site. The function call can be changed to",
|
|
17537
17557
|
""
|
|
17538
17558
|
]
|
|
@@ -17543,7 +17563,6 @@
|
|
|
17543
17563
|
"value": [
|
|
17544
17564
|
" ",
|
|
17545
17565
|
" $ db=database(\"C:/DolphinDB/Data/rangedb6\", RANGE, 0 5 10, [[\"111.222.3.4:8080\", \"111.222.3.5:8080\"], \"111.222.3.6:8080\"])",
|
|
17546
|
-
"",
|
|
17547
17566
|
""
|
|
17548
17567
|
]
|
|
17549
17568
|
},
|
|
@@ -19974,6 +19993,54 @@
|
|
|
19974
19993
|
}
|
|
19975
19994
|
]
|
|
19976
19995
|
},
|
|
19996
|
+
"disableQueryMonitor": {
|
|
19997
|
+
"title": "disableQueryMonitor",
|
|
19998
|
+
"type": "command",
|
|
19999
|
+
"children": [
|
|
20000
|
+
{
|
|
20001
|
+
"title": "Syntax",
|
|
20002
|
+
"type": "grammer",
|
|
20003
|
+
"children": [
|
|
20004
|
+
{
|
|
20005
|
+
"type": "text",
|
|
20006
|
+
"value": [
|
|
20007
|
+
"disableQueryMonitor()"
|
|
20008
|
+
]
|
|
20009
|
+
}
|
|
20010
|
+
]
|
|
20011
|
+
},
|
|
20012
|
+
{
|
|
20013
|
+
"title": "Arguments",
|
|
20014
|
+
"type": "parameters",
|
|
20015
|
+
"children": [
|
|
20016
|
+
{
|
|
20017
|
+
"type": "text",
|
|
20018
|
+
"value": [
|
|
20019
|
+
"None"
|
|
20020
|
+
]
|
|
20021
|
+
}
|
|
20022
|
+
]
|
|
20023
|
+
},
|
|
20024
|
+
{
|
|
20025
|
+
"title": "Details",
|
|
20026
|
+
"type": "detail",
|
|
20027
|
+
"children": [
|
|
20028
|
+
{
|
|
20029
|
+
"type": "text",
|
|
20030
|
+
"value": [
|
|
20031
|
+
"Disable the monitor on the query status. ",
|
|
20032
|
+
"",
|
|
20033
|
+
"As monitoring the query status has some memory overhead, you can disable the monitor when the system is low on memory. ",
|
|
20034
|
+
"",
|
|
20035
|
+
"Note: After calling the command, users cannot get the query job status with :doc:`/FunctionsandCommands/FunctionReferences/g/getQueryStatus`.",
|
|
20036
|
+
"",
|
|
20037
|
+
"Related function: :doc:`../e/enableQueryMonitor`"
|
|
20038
|
+
]
|
|
20039
|
+
}
|
|
20040
|
+
]
|
|
20041
|
+
}
|
|
20042
|
+
]
|
|
20043
|
+
},
|
|
19977
20044
|
"disableTablePersistence": {
|
|
19978
20045
|
"title": "disableTablePersistence",
|
|
19979
20046
|
"type": "command",
|
|
@@ -21011,6 +21078,13 @@
|
|
|
21011
21078
|
"title": "Examples",
|
|
21012
21079
|
"type": "example",
|
|
21013
21080
|
"children": [
|
|
21081
|
+
{
|
|
21082
|
+
"type": "text",
|
|
21083
|
+
"value": [
|
|
21084
|
+
"Drop a DFS database:",
|
|
21085
|
+
""
|
|
21086
|
+
]
|
|
21087
|
+
},
|
|
21014
21088
|
{
|
|
21015
21089
|
"type": "code",
|
|
21016
21090
|
"language": "console",
|
|
@@ -21021,20 +21095,21 @@
|
|
|
21021
21095
|
" $ dates=2017.08.07..2017.08.11",
|
|
21022
21096
|
" $ date=rand(dates, n)",
|
|
21023
21097
|
" $ x=rand(10.0, n)",
|
|
21024
|
-
" $ t=table(ID, date, x)",
|
|
21098
|
+
" $ t=table(ID, date, x);",
|
|
21025
21099
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
21026
21100
|
"",
|
|
21027
|
-
" $ db = database(\"
|
|
21028
|
-
" $ pt = loadTextEx(db, `
|
|
21101
|
+
" $ db = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
21102
|
+
" $ pt = loadTextEx(db, `pt1, `date, \"C:/DolphinDB/Data/t.txt\");",
|
|
21103
|
+
"",
|
|
21104
|
+
" $ dropDatabase(\"dfs://valueDB\")",
|
|
21029
21105
|
"",
|
|
21030
|
-
" $ dropDatabase(\"C:/DolphinDB/Data/rangedb\");",
|
|
21031
21106
|
""
|
|
21032
21107
|
]
|
|
21033
21108
|
},
|
|
21034
21109
|
{
|
|
21035
21110
|
"type": "text",
|
|
21036
21111
|
"value": [
|
|
21037
|
-
"
|
|
21112
|
+
"Drop a database on disk:",
|
|
21038
21113
|
""
|
|
21039
21114
|
]
|
|
21040
21115
|
},
|
|
@@ -21048,13 +21123,13 @@
|
|
|
21048
21123
|
" $ dates=2017.08.07..2017.08.11",
|
|
21049
21124
|
" $ date=rand(dates, n)",
|
|
21050
21125
|
" $ x=rand(10.0, n)",
|
|
21051
|
-
" $ t=table(ID, date, x)
|
|
21126
|
+
" $ t=table(ID, date, x)",
|
|
21052
21127
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
21053
21128
|
"",
|
|
21054
|
-
" $ db = database(\"
|
|
21055
|
-
" $ pt = loadTextEx(db, `
|
|
21129
|
+
" $ db = database(\"C:/DolphinDB/Data/rangedb\", RANGE, 0 5 10)",
|
|
21130
|
+
" $ pt = loadTextEx(db, `pt, `ID, \"C:/DolphinDB/Data/t.txt\");",
|
|
21056
21131
|
"",
|
|
21057
|
-
" $ dropDatabase(\"
|
|
21132
|
+
" $ dropDatabase(\"C:/DolphinDB/Data/rangedb\");",
|
|
21058
21133
|
""
|
|
21059
21134
|
]
|
|
21060
21135
|
},
|
|
@@ -21514,7 +21589,7 @@
|
|
|
21514
21589
|
{
|
|
21515
21590
|
"type": "text",
|
|
21516
21591
|
"value": [
|
|
21517
|
-
"`name` is a string indicating the name of a stream engine. "
|
|
21592
|
+
"`name` is a string indicating the name of a created stream engine. You can obtain all created engines with function ``getStreamEngineStat``."
|
|
21518
21593
|
]
|
|
21519
21594
|
}
|
|
21520
21595
|
]
|
|
@@ -22410,8 +22485,8 @@
|
|
|
22410
22485
|
}
|
|
22411
22486
|
]
|
|
22412
22487
|
},
|
|
22413
|
-
"
|
|
22414
|
-
"title": "
|
|
22488
|
+
"enableQueryMonitor": {
|
|
22489
|
+
"title": "enableQueryMonitor",
|
|
22415
22490
|
"type": "command",
|
|
22416
22491
|
"children": [
|
|
22417
22492
|
{
|
|
@@ -22421,7 +22496,7 @@
|
|
|
22421
22496
|
{
|
|
22422
22497
|
"type": "text",
|
|
22423
22498
|
"value": [
|
|
22424
|
-
"
|
|
22499
|
+
"enableQueryMonitor()"
|
|
22425
22500
|
]
|
|
22426
22501
|
}
|
|
22427
22502
|
]
|
|
@@ -22433,17 +22508,7 @@
|
|
|
22433
22508
|
{
|
|
22434
22509
|
"type": "text",
|
|
22435
22510
|
"value": [
|
|
22436
|
-
"
|
|
22437
|
-
"",
|
|
22438
|
-
"`asynWrite` is a Boolean value. It is an optional parameter indicating whether table persistence is in asynchronous mode. The default value is true. ",
|
|
22439
|
-
"",
|
|
22440
|
-
"`compress` is a Boolean value. It is an optional parameter indicating whether the table will be saved to disk in compression mode. The default value is true. ",
|
|
22441
|
-
"",
|
|
22442
|
-
"`cacheSize` is an integer. It is an optional parameter indicating the maximum number of rows of the table to keep in memory. If it is 0 or unspecified, all rows are kept in memory. The data type of `cacheSize` is LONG. The default value is -1. If it is set to a positive integer below 100,000, it will be automatically adjusted to 100,000. ",
|
|
22443
|
-
"",
|
|
22444
|
-
"`retentionMinutes` is an integer indicating for how long (in terms of minutes) the log file keeps the records. The default value is 1440, which means the log file only keeps records in the past 24 hours.",
|
|
22445
|
-
"",
|
|
22446
|
-
"`flushMode` is an integer that can be either 0 or 1. If flushMode=0, new messages are flushed to OS page buffer. A power outage might cause data loss. If flushMode=1, new messages are flushed to disk immediately."
|
|
22511
|
+
"None"
|
|
22447
22512
|
]
|
|
22448
22513
|
}
|
|
22449
22514
|
]
|
|
@@ -22455,97 +22520,17 @@
|
|
|
22455
22520
|
{
|
|
22456
22521
|
"type": "text",
|
|
22457
22522
|
"value": [
|
|
22458
|
-
"Enable
|
|
22459
|
-
"",
|
|
22460
|
-
"The parameter `asynWrite` informs the system whether table persistence is in asynchronous mode. With asynchronous mode, new data are pushed to a queue and persistence workers (threads) will write the data to disk later. With synchronous mode, the table append operation keeps running until new data are persisted to the disk. The default value is true (asynchronous mode). In general, asynchronous mode achieves higher throughput, but may lose some rows if the server crashes.",
|
|
22461
|
-
"",
|
|
22462
|
-
"With asynchronous mode, table persistence is conducted by a single persistence worker (thread), and the persistence worker may handle multiple tables. If there is only one table to be persisted, an increase in the number of persistence workers doesn't improve performance.",
|
|
22523
|
+
"Enable the monitor on the query status. The monitor is enabled by default.",
|
|
22463
22524
|
"",
|
|
22464
|
-
"
|
|
22465
|
-
]
|
|
22466
|
-
}
|
|
22467
|
-
]
|
|
22468
|
-
},
|
|
22469
|
-
{
|
|
22470
|
-
"title": "note",
|
|
22471
|
-
"children": [
|
|
22472
|
-
{
|
|
22473
|
-
"type": "text",
|
|
22474
|
-
"value": [
|
|
22475
|
-
"If manually restart the server, please write the cache data into disk before killing the process.",
|
|
22476
|
-
"",
|
|
22477
|
-
"If flushMode=0, smoe data may be lost after crash."
|
|
22478
|
-
]
|
|
22479
|
-
}
|
|
22480
|
-
]
|
|
22481
|
-
},
|
|
22482
|
-
{
|
|
22483
|
-
"title": "Examples",
|
|
22484
|
-
"type": "example",
|
|
22485
|
-
"children": [
|
|
22486
|
-
{
|
|
22487
|
-
"type": "code",
|
|
22488
|
-
"language": "console",
|
|
22489
|
-
"value": [
|
|
22490
|
-
"",
|
|
22491
|
-
" $ colName=[\"time\",\"x\"]",
|
|
22492
|
-
" $ colType=[\"timestamp\",\"int\"]",
|
|
22493
|
-
" $ t = streamTable(100:0, colName, colType);",
|
|
22494
|
-
" $ share t as st",
|
|
22495
|
-
"",
|
|
22496
|
-
" $ enableTablePersistence(table=st, cacheSize=1200000)",
|
|
22497
|
-
""
|
|
22498
|
-
]
|
|
22499
|
-
},
|
|
22500
|
-
{
|
|
22501
|
-
"type": "code",
|
|
22502
|
-
"language": "python",
|
|
22503
|
-
"value": [
|
|
22504
|
-
"",
|
|
22505
|
-
" for(s in 0:200){",
|
|
22506
|
-
" n=10000",
|
|
22507
|
-
" time=2019.01.01T00:00:00.000+s*n+1..n",
|
|
22508
|
-
" x=rand(10.0, n)",
|
|
22509
|
-
" insert into st values(time, x)",
|
|
22510
|
-
" }",
|
|
22511
|
-
""
|
|
22512
|
-
]
|
|
22513
|
-
},
|
|
22514
|
-
{
|
|
22515
|
-
"type": "code",
|
|
22516
|
-
"language": "console",
|
|
22517
|
-
"value": [
|
|
22518
|
-
"",
|
|
22519
|
-
" $ getPersistenceMeta(st);",
|
|
22520
|
-
"",
|
|
22521
|
-
" persistenceDir->/data/ssd/DolphinDBDemo/persistence3/st",
|
|
22522
|
-
" retentionMinutes->1440",
|
|
22523
|
-
" hashValue->0",
|
|
22524
|
-
" asynWrite->true",
|
|
22525
|
-
" diskOffset->0",
|
|
22526
|
-
" sizeInMemory->800000",
|
|
22527
|
-
" compress->1",
|
|
22528
|
-
" memoryOffset->1200000",
|
|
22529
|
-
" totalSize->2000000",
|
|
22530
|
-
" sizeOnDisk->2000000",
|
|
22531
|
-
""
|
|
22532
|
-
]
|
|
22533
|
-
},
|
|
22534
|
-
{
|
|
22535
|
-
"type": "text",
|
|
22536
|
-
"value": [
|
|
22537
|
-
"Please note that in this example, we shared a stream table before persisting it with the command ``enableTablePersistence``. These 2 operations can be achieved with command :doc:`enableTableShareAndPersistence`.",
|
|
22538
|
-
"",
|
|
22539
|
-
"Related commands: :doc:`../d/disableTablePersistence`, :doc:`../c/clearTablePersistence`, :doc:`enableTablePersistence`",
|
|
22540
|
-
""
|
|
22525
|
+
"Related function: :doc:`../d/disableQueryMonitor`"
|
|
22541
22526
|
]
|
|
22542
22527
|
}
|
|
22543
22528
|
]
|
|
22544
22529
|
}
|
|
22545
22530
|
]
|
|
22546
22531
|
},
|
|
22547
|
-
"
|
|
22548
|
-
"title": "
|
|
22532
|
+
"enableTablePersistence": {
|
|
22533
|
+
"title": "enableTablePersistence",
|
|
22549
22534
|
"type": "command",
|
|
22550
22535
|
"children": [
|
|
22551
22536
|
{
|
|
@@ -22555,7 +22540,7 @@
|
|
|
22555
22540
|
{
|
|
22556
22541
|
"type": "text",
|
|
22557
22542
|
"value": [
|
|
22558
|
-
"
|
|
22543
|
+
"enableTablePersistence(table, [asynWrite=true], [compress=true], [cacheSize=-1], [retentionMinutes=1440], [flushMode=0])"
|
|
22559
22544
|
]
|
|
22560
22545
|
}
|
|
22561
22546
|
]
|
|
@@ -22567,21 +22552,17 @@
|
|
|
22567
22552
|
{
|
|
22568
22553
|
"type": "text",
|
|
22569
22554
|
"value": [
|
|
22570
|
-
"`table` is an empty stream table.",
|
|
22571
|
-
"",
|
|
22572
|
-
"`tableName` is a string indicating the name of the shared table. ",
|
|
22555
|
+
"`table` is an empty shared stream table.",
|
|
22573
22556
|
"",
|
|
22574
22557
|
"`asynWrite` is a Boolean value. It is an optional parameter indicating whether table persistence is in asynchronous mode. The default value is true. ",
|
|
22575
22558
|
"",
|
|
22576
22559
|
"`compress` is a Boolean value. It is an optional parameter indicating whether the table will be saved to disk in compression mode. The default value is true. ",
|
|
22577
22560
|
"",
|
|
22578
|
-
"`cacheSize`
|
|
22561
|
+
"`cacheSize` is an integer. It is an optional parameter indicating the maximum number of rows of the table to keep in memory. If it is 0 or unspecified, all rows are kept in memory. The data type of `cacheSize` is LONG. The default value is -1. If it is set to a positive integer below 100,000, it will be automatically adjusted to 100,000. ",
|
|
22579
22562
|
"",
|
|
22580
22563
|
"`retentionMinutes` is an integer indicating for how long (in terms of minutes) the log file keeps the records. The default value is 1440, which means the log file only keeps records in the past 24 hours.",
|
|
22581
22564
|
"",
|
|
22582
|
-
"`flushMode` is an integer that can be either 0 or 1. If
|
|
22583
|
-
"",
|
|
22584
|
-
"`preCache` is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts."
|
|
22565
|
+
"`flushMode` is an integer that can be either 0 or 1. If flushMode=0, new messages are flushed to OS page buffer. A power outage might cause data loss. If flushMode=1, new messages are flushed to disk immediately."
|
|
22585
22566
|
]
|
|
22586
22567
|
}
|
|
22587
22568
|
]
|
|
@@ -22593,13 +22574,151 @@
|
|
|
22593
22574
|
{
|
|
22594
22575
|
"type": "text",
|
|
22595
22576
|
"value": [
|
|
22596
|
-
"
|
|
22577
|
+
"Enable a shared stream table to be persisted to disk. For this command to work, we need to specify the configuration parameter `persistenceDir`. The persistence location of the table is <PERSISTENCE_DIR>/<TABLE_NAME>. The directory contains 2 types of files: data files (named like `data0.log`, `data1.log`...) and an index file index.log. After these data have been saved to disk and the system is restarted, they will be loaded into memory.",
|
|
22597
22578
|
"",
|
|
22598
22579
|
"The parameter `asynWrite` informs the system whether table persistence is in asynchronous mode. With asynchronous mode, new data are pushed to a queue and persistence workers (threads) will write the data to disk later. With synchronous mode, the table append operation keeps running until new data are persisted to the disk. The default value is true (asynchronous mode). In general, asynchronous mode achieves higher throughput, but may lose some rows if the server crashes.",
|
|
22599
22580
|
"",
|
|
22600
22581
|
"With asynchronous mode, table persistence is conducted by a single persistence worker (thread), and the persistence worker may handle multiple tables. If there is only one table to be persisted, an increase in the number of persistence workers doesn't improve performance.",
|
|
22601
22582
|
"",
|
|
22602
|
-
"By default, a stream table keeps all data in memory. If the stream table is too large, the system may run out of memory. To avoid this problem, we can set a
|
|
22583
|
+
"By default, a stream table keeps all data in memory. If the stream table is too large, the system may run out of memory. To avoid this problem, we can set a limit. If the number of rows of the stream table reaches this limit, the first half of the table will be cleared from memory. "
|
|
22584
|
+
]
|
|
22585
|
+
}
|
|
22586
|
+
]
|
|
22587
|
+
},
|
|
22588
|
+
{
|
|
22589
|
+
"title": "note",
|
|
22590
|
+
"children": [
|
|
22591
|
+
{
|
|
22592
|
+
"type": "text",
|
|
22593
|
+
"value": [
|
|
22594
|
+
"If manually restart the server, please write the cache data into disk before killing the process.",
|
|
22595
|
+
"",
|
|
22596
|
+
"If flushMode=0, smoe data may be lost after crash."
|
|
22597
|
+
]
|
|
22598
|
+
}
|
|
22599
|
+
]
|
|
22600
|
+
},
|
|
22601
|
+
{
|
|
22602
|
+
"title": "Examples",
|
|
22603
|
+
"type": "example",
|
|
22604
|
+
"children": [
|
|
22605
|
+
{
|
|
22606
|
+
"type": "code",
|
|
22607
|
+
"language": "console",
|
|
22608
|
+
"value": [
|
|
22609
|
+
"",
|
|
22610
|
+
" $ colName=[\"time\",\"x\"]",
|
|
22611
|
+
" $ colType=[\"timestamp\",\"int\"]",
|
|
22612
|
+
" $ t = streamTable(100:0, colName, colType);",
|
|
22613
|
+
" $ share t as st",
|
|
22614
|
+
"",
|
|
22615
|
+
" $ enableTablePersistence(table=st, cacheSize=1200000)",
|
|
22616
|
+
""
|
|
22617
|
+
]
|
|
22618
|
+
},
|
|
22619
|
+
{
|
|
22620
|
+
"type": "code",
|
|
22621
|
+
"language": "python",
|
|
22622
|
+
"value": [
|
|
22623
|
+
"",
|
|
22624
|
+
" for(s in 0:200){",
|
|
22625
|
+
" n=10000",
|
|
22626
|
+
" time=2019.01.01T00:00:00.000+s*n+1..n",
|
|
22627
|
+
" x=rand(10.0, n)",
|
|
22628
|
+
" insert into st values(time, x)",
|
|
22629
|
+
" }",
|
|
22630
|
+
""
|
|
22631
|
+
]
|
|
22632
|
+
},
|
|
22633
|
+
{
|
|
22634
|
+
"type": "code",
|
|
22635
|
+
"language": "console",
|
|
22636
|
+
"value": [
|
|
22637
|
+
"",
|
|
22638
|
+
" $ getPersistenceMeta(st);",
|
|
22639
|
+
"",
|
|
22640
|
+
" persistenceDir->/data/ssd/DolphinDBDemo/persistence3/st",
|
|
22641
|
+
" retentionMinutes->1440",
|
|
22642
|
+
" hashValue->0",
|
|
22643
|
+
" asynWrite->true",
|
|
22644
|
+
" diskOffset->0",
|
|
22645
|
+
" sizeInMemory->800000",
|
|
22646
|
+
" compress->1",
|
|
22647
|
+
" memoryOffset->1200000",
|
|
22648
|
+
" totalSize->2000000",
|
|
22649
|
+
" sizeOnDisk->2000000",
|
|
22650
|
+
""
|
|
22651
|
+
]
|
|
22652
|
+
},
|
|
22653
|
+
{
|
|
22654
|
+
"type": "text",
|
|
22655
|
+
"value": [
|
|
22656
|
+
"Please note that in this example, we shared a stream table before persisting it with the command ``enableTablePersistence``. These 2 operations can be achieved with command :doc:`enableTableShareAndPersistence`.",
|
|
22657
|
+
"",
|
|
22658
|
+
"Related commands: :doc:`../d/disableTablePersistence`, :doc:`../c/clearTablePersistence`, :doc:`enableTablePersistence`",
|
|
22659
|
+
""
|
|
22660
|
+
]
|
|
22661
|
+
}
|
|
22662
|
+
]
|
|
22663
|
+
}
|
|
22664
|
+
]
|
|
22665
|
+
},
|
|
22666
|
+
"enableTableShareAndPersistence": {
|
|
22667
|
+
"title": "enableTableShareAndPersistence",
|
|
22668
|
+
"type": "command",
|
|
22669
|
+
"children": [
|
|
22670
|
+
{
|
|
22671
|
+
"title": "Syntax",
|
|
22672
|
+
"type": "grammer",
|
|
22673
|
+
"children": [
|
|
22674
|
+
{
|
|
22675
|
+
"type": "text",
|
|
22676
|
+
"value": [
|
|
22677
|
+
"enableTableShareAndPersistence(table, tableName, [asynWrite=true], [compress=true], [cacheSize=-1], [retentionMinutes=1440], [flushMode=0], [preCache])"
|
|
22678
|
+
]
|
|
22679
|
+
}
|
|
22680
|
+
]
|
|
22681
|
+
},
|
|
22682
|
+
{
|
|
22683
|
+
"title": "Arguments",
|
|
22684
|
+
"type": "parameters",
|
|
22685
|
+
"children": [
|
|
22686
|
+
{
|
|
22687
|
+
"type": "text",
|
|
22688
|
+
"value": [
|
|
22689
|
+
"`table` is an empty stream table.",
|
|
22690
|
+
"",
|
|
22691
|
+
"`tableName` is a string indicating the name of the shared table. ",
|
|
22692
|
+
"",
|
|
22693
|
+
"`asynWrite` is a Boolean value. It is an optional parameter indicating whether table persistence is in asynchronous mode. The default value is true. ",
|
|
22694
|
+
"",
|
|
22695
|
+
"`compress` is a Boolean value. It is an optional parameter indicating whether the table will be saved to disk in compression mode. The default value is true. ",
|
|
22696
|
+
"",
|
|
22697
|
+
"`cacheSize` is an integer. It is an optional parameter indicating the maximum number of rows of the table to keep in memory. If it is 0 or unspecified, all rows are kept in memory. The data type of cacheSize is LONG. The default value is -1. If it is set to a positive integer below 100,000, it will be automatically adjusted to 100,000. ",
|
|
22698
|
+
"",
|
|
22699
|
+
"`retentionMinutes` is an integer indicating for how long (in terms of minutes) the log file keeps the records. The default value is 1440, which means the log file only keeps records in the past 24 hours.",
|
|
22700
|
+
"",
|
|
22701
|
+
"`flushMode` is an integer that can be either 0 or 1. If `flushMode`\\=0, new messages are flushed to OS page buffer. A power outage might cause data loss. If `flushMode`\\=1, new messages are flushed to disk immediately.",
|
|
22702
|
+
"",
|
|
22703
|
+
"`preCache` is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts."
|
|
22704
|
+
]
|
|
22705
|
+
}
|
|
22706
|
+
]
|
|
22707
|
+
},
|
|
22708
|
+
{
|
|
22709
|
+
"title": "Details",
|
|
22710
|
+
"type": "detail",
|
|
22711
|
+
"children": [
|
|
22712
|
+
{
|
|
22713
|
+
"type": "text",
|
|
22714
|
+
"value": [
|
|
22715
|
+
"Share a stream table, and enable it to be persisted to disk. For this command to work, we need to specify the configuration parameter persistenceDir. The persistence location of the table is <PERSISTENCE_DIR>/<TABLE_NAME>. The directory contains 2 types of files: data files (named like `data0.log`, `data1.log`...) and an index file index.log. After these data have been saved to disk and the system is restarted, they will be loaded into memory.",
|
|
22716
|
+
"",
|
|
22717
|
+
"The parameter `asynWrite` informs the system whether table persistence is in asynchronous mode. With asynchronous mode, new data are pushed to a queue and persistence workers (threads) will write the data to disk later. With synchronous mode, the table append operation keeps running until new data are persisted to the disk. The default value is true (asynchronous mode). In general, asynchronous mode achieves higher throughput, but may lose some rows if the server crashes.",
|
|
22718
|
+
"",
|
|
22719
|
+
"With asynchronous mode, table persistence is conducted by a single persistence worker (thread), and the persistence worker may handle multiple tables. If there is only one table to be persisted, an increase in the number of persistence workers doesn't improve performance.",
|
|
22720
|
+
"",
|
|
22721
|
+
"By default, a stream table keeps all data in memory. If the stream table is too large, the system may run out of memory. To avoid this problem, we can set a cache size limit. If the number of rows of the stream table reaches this limit, the first half of the table will be cleared from memory. "
|
|
22603
22722
|
]
|
|
22604
22723
|
}
|
|
22605
22724
|
]
|
|
@@ -23887,82 +24006,6 @@
|
|
|
23887
24006
|
}
|
|
23888
24007
|
]
|
|
23889
24008
|
},
|
|
23890
|
-
"existSubscriptionTopic": {
|
|
23891
|
-
"title": "existSubscriptionTopic",
|
|
23892
|
-
"type": "function",
|
|
23893
|
-
"children": [
|
|
23894
|
-
{
|
|
23895
|
-
"title": "Syntax",
|
|
23896
|
-
"type": "grammer",
|
|
23897
|
-
"children": [
|
|
23898
|
-
{
|
|
23899
|
-
"type": "text",
|
|
23900
|
-
"value": [
|
|
23901
|
-
"existSubscriptionTopic([server], tableName, [actionName])"
|
|
23902
|
-
]
|
|
23903
|
-
}
|
|
23904
|
-
]
|
|
23905
|
-
},
|
|
23906
|
-
{
|
|
23907
|
-
"title": "Arguments",
|
|
23908
|
-
"type": "parameters",
|
|
23909
|
-
"children": [
|
|
23910
|
-
{
|
|
23911
|
-
"type": "text",
|
|
23912
|
-
"value": [
|
|
23913
|
-
"`server` is a STRING indicating the node alias of the subscribed stream table, or the handler of a remote call connection. If *server* is not specified or an empty string, it means the streaming data is from the local server.",
|
|
23914
|
-
"",
|
|
23915
|
-
"`tableName` is a STRING indicating the name of a shared stream table.",
|
|
23916
|
-
"",
|
|
23917
|
-
"`actionName` is a STRING indicating the name of the subscription task. *actionName* can only contain letters, numbers and underscores. If the *actionName* is specified when the subscription is created, it must also be specified here. "
|
|
23918
|
-
]
|
|
23919
|
-
}
|
|
23920
|
-
]
|
|
23921
|
-
},
|
|
23922
|
-
{
|
|
23923
|
-
"title": "Details",
|
|
23924
|
-
"type": "detail",
|
|
23925
|
-
"children": [
|
|
23926
|
-
{
|
|
23927
|
-
"type": "text",
|
|
23928
|
-
"value": [
|
|
23929
|
-
"Check the existence of a subscription topic of a shared stream table. Return “true” if the subscription topic exists, “false” if it doesn't."
|
|
23930
|
-
]
|
|
23931
|
-
}
|
|
23932
|
-
]
|
|
23933
|
-
},
|
|
23934
|
-
{
|
|
23935
|
-
"title": "First Release",
|
|
23936
|
-
"children": [
|
|
23937
|
-
{
|
|
23938
|
-
"type": "text",
|
|
23939
|
-
"value": [
|
|
23940
|
-
"1.30.16 / 2.00.4"
|
|
23941
|
-
]
|
|
23942
|
-
}
|
|
23943
|
-
]
|
|
23944
|
-
},
|
|
23945
|
-
{
|
|
23946
|
-
"title": "Examples",
|
|
23947
|
-
"type": "example",
|
|
23948
|
-
"children": [
|
|
23949
|
-
{
|
|
23950
|
-
"type": "code",
|
|
23951
|
-
"language": "console",
|
|
23952
|
-
"value": [
|
|
23953
|
-
"",
|
|
23954
|
-
" $ t=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])",
|
|
23955
|
-
" $ share t as trades",
|
|
23956
|
-
" $ trades_1=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])",
|
|
23957
|
-
" $ subscribeTable(tableName=`trades, actionName=`vwap, offset=-1, handler=append!{trades_1})",
|
|
23958
|
-
" $ existSubscriptionTopic(,`trades,`vwap)",
|
|
23959
|
-
" true"
|
|
23960
|
-
]
|
|
23961
|
-
}
|
|
23962
|
-
]
|
|
23963
|
-
}
|
|
23964
|
-
]
|
|
23965
|
-
},
|
|
23966
24009
|
"exists": {
|
|
23967
24010
|
"title": "exists",
|
|
23968
24011
|
"type": "function",
|
|
@@ -24102,30 +24145,6 @@
|
|
|
24102
24145
|
"title": "Examples",
|
|
24103
24146
|
"type": "example",
|
|
24104
24147
|
"children": [
|
|
24105
|
-
{
|
|
24106
|
-
"type": "code",
|
|
24107
|
-
"language": "console",
|
|
24108
|
-
"value": [
|
|
24109
|
-
"",
|
|
24110
|
-
" $ n=1000000",
|
|
24111
|
-
" $ ID=rand(10, n)",
|
|
24112
|
-
" $ dates=2017.08.07..2017.08.11",
|
|
24113
|
-
" $ date=rand(dates, n)",
|
|
24114
|
-
" $ x=rand(10.0, n)",
|
|
24115
|
-
" $ t=table(ID, date, x)",
|
|
24116
|
-
"",
|
|
24117
|
-
" $ db = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
24118
|
-
" $ pt = db.createPartitionedTable(t, `pt, `date);",
|
|
24119
|
-
" $ pt.append!(t);",
|
|
24120
|
-
"",
|
|
24121
|
-
" $ existsDatabase(\"C:/DolphinDB/Data/valueDB\");",
|
|
24122
|
-
" 1",
|
|
24123
|
-
"",
|
|
24124
|
-
" $ existsDatabase(\"C:/DolphinDB/Data/valueDB/20170807\");",
|
|
24125
|
-
" 0",
|
|
24126
|
-
""
|
|
24127
|
-
]
|
|
24128
|
-
},
|
|
24129
24148
|
{
|
|
24130
24149
|
"type": "text",
|
|
24131
24150
|
"value": [
|
|
@@ -24153,7 +24172,15 @@
|
|
|
24153
24172
|
" 1",
|
|
24154
24173
|
"",
|
|
24155
24174
|
" $ existsDatabase(\"dfs://valueDB/20170807\");",
|
|
24156
|
-
" 0"
|
|
24175
|
+
" 0",
|
|
24176
|
+
""
|
|
24177
|
+
]
|
|
24178
|
+
},
|
|
24179
|
+
{
|
|
24180
|
+
"type": "text",
|
|
24181
|
+
"value": [
|
|
24182
|
+
".. meta:: ",
|
|
24183
|
+
" :keywords: exist"
|
|
24157
24184
|
]
|
|
24158
24185
|
}
|
|
24159
24186
|
]
|
|
@@ -24283,6 +24310,84 @@
|
|
|
24283
24310
|
}
|
|
24284
24311
|
]
|
|
24285
24312
|
},
|
|
24313
|
+
"existsSubscriptionTopic": {
|
|
24314
|
+
"title": "existsSubscriptionTopic",
|
|
24315
|
+
"type": "function",
|
|
24316
|
+
"children": [
|
|
24317
|
+
{
|
|
24318
|
+
"title": "Syntax",
|
|
24319
|
+
"type": "grammer",
|
|
24320
|
+
"children": [
|
|
24321
|
+
{
|
|
24322
|
+
"type": "text",
|
|
24323
|
+
"value": [
|
|
24324
|
+
"existsSubscriptionTopic([server], tableName, [actionName])",
|
|
24325
|
+
"",
|
|
24326
|
+
"Alias: existSubscriptionTopic"
|
|
24327
|
+
]
|
|
24328
|
+
}
|
|
24329
|
+
]
|
|
24330
|
+
},
|
|
24331
|
+
{
|
|
24332
|
+
"title": "Arguments",
|
|
24333
|
+
"type": "parameters",
|
|
24334
|
+
"children": [
|
|
24335
|
+
{
|
|
24336
|
+
"type": "text",
|
|
24337
|
+
"value": [
|
|
24338
|
+
"`server` is a STRING indicating the node alias of the subscribed stream table, or the handler of a remote call connection. If *server* is not specified or an empty string, it means the streaming data is from the local server.",
|
|
24339
|
+
"",
|
|
24340
|
+
"`tableName` is a STRING indicating the name of a shared stream table.",
|
|
24341
|
+
"",
|
|
24342
|
+
"`actionName` is a STRING indicating the name of the subscription task. *actionName* can only contain letters, numbers and underscores. If the *actionName* is specified when the subscription is created, it must also be specified here. "
|
|
24343
|
+
]
|
|
24344
|
+
}
|
|
24345
|
+
]
|
|
24346
|
+
},
|
|
24347
|
+
{
|
|
24348
|
+
"title": "Details",
|
|
24349
|
+
"type": "detail",
|
|
24350
|
+
"children": [
|
|
24351
|
+
{
|
|
24352
|
+
"type": "text",
|
|
24353
|
+
"value": [
|
|
24354
|
+
"Check the existence of a subscription topic of a shared stream table. Return “true” if the subscription topic exists, “false” if it doesn't."
|
|
24355
|
+
]
|
|
24356
|
+
}
|
|
24357
|
+
]
|
|
24358
|
+
},
|
|
24359
|
+
{
|
|
24360
|
+
"title": "First Release",
|
|
24361
|
+
"children": [
|
|
24362
|
+
{
|
|
24363
|
+
"type": "text",
|
|
24364
|
+
"value": [
|
|
24365
|
+
"1.30.16 / 2.00.4"
|
|
24366
|
+
]
|
|
24367
|
+
}
|
|
24368
|
+
]
|
|
24369
|
+
},
|
|
24370
|
+
{
|
|
24371
|
+
"title": "Examples",
|
|
24372
|
+
"type": "example",
|
|
24373
|
+
"children": [
|
|
24374
|
+
{
|
|
24375
|
+
"type": "code",
|
|
24376
|
+
"language": "console",
|
|
24377
|
+
"value": [
|
|
24378
|
+
"",
|
|
24379
|
+
" $ t=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])",
|
|
24380
|
+
" $ share t as trades",
|
|
24381
|
+
" $ trades_1=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])",
|
|
24382
|
+
" $ subscribeTable(tableName=`trades, actionName=`vwap, offset=-1, handler=append!{trades_1})",
|
|
24383
|
+
" $ existsSubscriptionTopic(,`trades,`vwap)",
|
|
24384
|
+
" true"
|
|
24385
|
+
]
|
|
24386
|
+
}
|
|
24387
|
+
]
|
|
24388
|
+
}
|
|
24389
|
+
]
|
|
24390
|
+
},
|
|
24286
24391
|
"existsTable": {
|
|
24287
24392
|
"title": "existsTable",
|
|
24288
24393
|
"type": "function",
|
|
@@ -24329,37 +24434,10 @@
|
|
|
24329
24434
|
"title": "Examples",
|
|
24330
24435
|
"type": "example",
|
|
24331
24436
|
"children": [
|
|
24332
|
-
{
|
|
24333
|
-
"type": "code",
|
|
24334
|
-
"language": "console",
|
|
24335
|
-
"value": [
|
|
24336
|
-
"",
|
|
24337
|
-
" $ n=1000000",
|
|
24338
|
-
" $ ID=rand(10, n)",
|
|
24339
|
-
" $ dates=2017.08.07..2017.08.11",
|
|
24340
|
-
" $ date=rand(dates, n)",
|
|
24341
|
-
" $ x=rand(10.0, n)",
|
|
24342
|
-
" $ t=table(ID, date, x)",
|
|
24343
|
-
"",
|
|
24344
|
-
" $ db = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
24345
|
-
" $ pt = db.createPartitionedTable(t, `pt, `date);",
|
|
24346
|
-
" $ pt.append!(t);",
|
|
24347
|
-
"",
|
|
24348
|
-
" $ existsTable(\"C:/DolphinDB/Data/valueDB\", `pt);",
|
|
24349
|
-
" 1",
|
|
24350
|
-
"",
|
|
24351
|
-
" $ existsTable(\"C:/DolphinDB/Data/valueDB/20170807\", `pt);",
|
|
24352
|
-
" 1",
|
|
24353
|
-
"",
|
|
24354
|
-
" $ existsTable(\"C:/DolphinDB/Data\", `pt);",
|
|
24355
|
-
" 0",
|
|
24356
|
-
""
|
|
24357
|
-
]
|
|
24358
|
-
},
|
|
24359
24437
|
{
|
|
24360
24438
|
"type": "text",
|
|
24361
24439
|
"value": [
|
|
24362
|
-
"To check if a table exists in a DFS database:",
|
|
24440
|
+
"To check if a table exists in a DFS database (on a data node or compute node):",
|
|
24363
24441
|
""
|
|
24364
24442
|
]
|
|
24365
24443
|
},
|
|
@@ -24383,7 +24461,15 @@
|
|
|
24383
24461
|
" 1",
|
|
24384
24462
|
"",
|
|
24385
24463
|
" $ existsTable(\"dfs://valueDB/20170807\", `pt);",
|
|
24386
|
-
" 1"
|
|
24464
|
+
" 1",
|
|
24465
|
+
""
|
|
24466
|
+
]
|
|
24467
|
+
},
|
|
24468
|
+
{
|
|
24469
|
+
"type": "text",
|
|
24470
|
+
"value": [
|
|
24471
|
+
".. meta:: ",
|
|
24472
|
+
" :keywords: exist"
|
|
24387
24473
|
]
|
|
24388
24474
|
}
|
|
24389
24475
|
]
|
|
@@ -27226,6 +27312,63 @@
|
|
|
27226
27312
|
}
|
|
27227
27313
|
]
|
|
27228
27314
|
},
|
|
27315
|
+
"getAuthenticatedUsers": {
|
|
27316
|
+
"title": "getAuthenticatedUsers",
|
|
27317
|
+
"type": "function",
|
|
27318
|
+
"children": [
|
|
27319
|
+
{
|
|
27320
|
+
"title": "Syntax",
|
|
27321
|
+
"type": "grammer",
|
|
27322
|
+
"children": [
|
|
27323
|
+
{
|
|
27324
|
+
"type": "text",
|
|
27325
|
+
"value": [
|
|
27326
|
+
"getAuthenticatedUsers()"
|
|
27327
|
+
]
|
|
27328
|
+
}
|
|
27329
|
+
]
|
|
27330
|
+
},
|
|
27331
|
+
{
|
|
27332
|
+
"title": "Arguments",
|
|
27333
|
+
"type": "parameters",
|
|
27334
|
+
"children": [
|
|
27335
|
+
{
|
|
27336
|
+
"type": "text",
|
|
27337
|
+
"value": [
|
|
27338
|
+
"None"
|
|
27339
|
+
]
|
|
27340
|
+
}
|
|
27341
|
+
]
|
|
27342
|
+
},
|
|
27343
|
+
{
|
|
27344
|
+
"title": "Details",
|
|
27345
|
+
"type": "detail",
|
|
27346
|
+
"children": [
|
|
27347
|
+
{
|
|
27348
|
+
"type": "text",
|
|
27349
|
+
"value": [
|
|
27350
|
+
"Return a list of users who are currently logged in on all nodes."
|
|
27351
|
+
]
|
|
27352
|
+
}
|
|
27353
|
+
]
|
|
27354
|
+
},
|
|
27355
|
+
{
|
|
27356
|
+
"title": "Examples",
|
|
27357
|
+
"type": "example",
|
|
27358
|
+
"children": [
|
|
27359
|
+
{
|
|
27360
|
+
"type": "code",
|
|
27361
|
+
"language": "console",
|
|
27362
|
+
"value": [
|
|
27363
|
+
"",
|
|
27364
|
+
" $ getAuthenticatedUsers()",
|
|
27365
|
+
" [\"admin\",\"a1\",\"a3\",\"a2\",\"a4\"] "
|
|
27366
|
+
]
|
|
27367
|
+
}
|
|
27368
|
+
]
|
|
27369
|
+
}
|
|
27370
|
+
]
|
|
27371
|
+
},
|
|
27229
27372
|
"getBackupList": {
|
|
27230
27373
|
"title": "getBackupList",
|
|
27231
27374
|
"type": "function",
|
|
@@ -27775,7 +27918,7 @@
|
|
|
27775
27918
|
"",
|
|
27776
27919
|
"\\(1) Data cannot be appended or updated. Only drop operations can be performed to delete records. Transaction is supported in the READ_ONLY chunks (except for those stored in S3).",
|
|
27777
27920
|
"",
|
|
27778
|
-
"\\(2) Operations such as recovery
|
|
27921
|
+
"\\(2) Operations such as recovery and rebalance cannot be performed."
|
|
27779
27922
|
]
|
|
27780
27923
|
}
|
|
27781
27924
|
]
|
|
@@ -29439,7 +29582,203 @@
|
|
|
29439
29582
|
{
|
|
29440
29583
|
"type": "text",
|
|
29441
29584
|
"value": [
|
|
29442
|
-
"Return the expiration date of the license on the current node. It can be used to verify whether the license file has been updated."
|
|
29585
|
+
"Return the expiration date of the license on the current node. It can be used to verify whether the license file has been updated."
|
|
29586
|
+
]
|
|
29587
|
+
}
|
|
29588
|
+
]
|
|
29589
|
+
},
|
|
29590
|
+
{
|
|
29591
|
+
"title": "Examples",
|
|
29592
|
+
"type": "example",
|
|
29593
|
+
"children": [
|
|
29594
|
+
{
|
|
29595
|
+
"type": "code",
|
|
29596
|
+
"language": "console",
|
|
29597
|
+
"value": [
|
|
29598
|
+
" ",
|
|
29599
|
+
" $ getLicenseExpiration()",
|
|
29600
|
+
" 2021.09.30",
|
|
29601
|
+
""
|
|
29602
|
+
]
|
|
29603
|
+
},
|
|
29604
|
+
{
|
|
29605
|
+
"type": "text",
|
|
29606
|
+
"value": [
|
|
29607
|
+
".. meta:: ",
|
|
29608
|
+
" :keywords: get"
|
|
29609
|
+
]
|
|
29610
|
+
}
|
|
29611
|
+
]
|
|
29612
|
+
}
|
|
29613
|
+
]
|
|
29614
|
+
},
|
|
29615
|
+
"getMachineFingerprint": {
|
|
29616
|
+
"title": "getMachineFingerprint",
|
|
29617
|
+
"type": "command",
|
|
29618
|
+
"children": [
|
|
29619
|
+
{
|
|
29620
|
+
"title": "Syntax",
|
|
29621
|
+
"type": "grammer",
|
|
29622
|
+
"children": [
|
|
29623
|
+
{
|
|
29624
|
+
"type": "text",
|
|
29625
|
+
"value": [
|
|
29626
|
+
"getMachineFingerprint(outputPath)",
|
|
29627
|
+
"",
|
|
29628
|
+
"Alias: generateMachineFingerprint"
|
|
29629
|
+
]
|
|
29630
|
+
}
|
|
29631
|
+
]
|
|
29632
|
+
},
|
|
29633
|
+
{
|
|
29634
|
+
"title": "Arguments",
|
|
29635
|
+
"type": "parameters",
|
|
29636
|
+
"children": [
|
|
29637
|
+
{
|
|
29638
|
+
"type": "text",
|
|
29639
|
+
"value": [
|
|
29640
|
+
"`outputPath` a string indicating the path of the file with fingerprint. "
|
|
29641
|
+
]
|
|
29642
|
+
}
|
|
29643
|
+
]
|
|
29644
|
+
},
|
|
29645
|
+
{
|
|
29646
|
+
"title": "Details",
|
|
29647
|
+
"type": "detail",
|
|
29648
|
+
"children": [
|
|
29649
|
+
{
|
|
29650
|
+
"type": "text",
|
|
29651
|
+
"value": [
|
|
29652
|
+
"Generate a file with the fingerprint of the computer. "
|
|
29653
|
+
]
|
|
29654
|
+
}
|
|
29655
|
+
]
|
|
29656
|
+
},
|
|
29657
|
+
{
|
|
29658
|
+
"title": "Examples",
|
|
29659
|
+
"type": "example",
|
|
29660
|
+
"children": [
|
|
29661
|
+
{
|
|
29662
|
+
"type": "code",
|
|
29663
|
+
"language": "console",
|
|
29664
|
+
"value": [
|
|
29665
|
+
"",
|
|
29666
|
+
" $ generateMachineFingerprint(\"/home/DolphinDB\")",
|
|
29667
|
+
""
|
|
29668
|
+
]
|
|
29669
|
+
},
|
|
29670
|
+
{
|
|
29671
|
+
"type": "text",
|
|
29672
|
+
"value": [
|
|
29673
|
+
".. meta:: ",
|
|
29674
|
+
" :keywords: get"
|
|
29675
|
+
]
|
|
29676
|
+
}
|
|
29677
|
+
]
|
|
29678
|
+
}
|
|
29679
|
+
]
|
|
29680
|
+
},
|
|
29681
|
+
"getMemLimitOfQueryResult": {
|
|
29682
|
+
"title": "getMemLimitOfQueryResult",
|
|
29683
|
+
"type": "function",
|
|
29684
|
+
"children": [
|
|
29685
|
+
{
|
|
29686
|
+
"title": "Syntax",
|
|
29687
|
+
"type": "grammer",
|
|
29688
|
+
"children": [
|
|
29689
|
+
{
|
|
29690
|
+
"type": "text",
|
|
29691
|
+
"value": [
|
|
29692
|
+
"getMemLimitOfQueryResult()"
|
|
29693
|
+
]
|
|
29694
|
+
}
|
|
29695
|
+
]
|
|
29696
|
+
},
|
|
29697
|
+
{
|
|
29698
|
+
"title": "Arguments",
|
|
29699
|
+
"type": "parameters",
|
|
29700
|
+
"children": [
|
|
29701
|
+
{
|
|
29702
|
+
"type": "text",
|
|
29703
|
+
"value": [
|
|
29704
|
+
"None"
|
|
29705
|
+
]
|
|
29706
|
+
}
|
|
29707
|
+
]
|
|
29708
|
+
},
|
|
29709
|
+
{
|
|
29710
|
+
"title": "Details",
|
|
29711
|
+
"type": "detail",
|
|
29712
|
+
"children": [
|
|
29713
|
+
{
|
|
29714
|
+
"type": "text",
|
|
29715
|
+
"value": [
|
|
29716
|
+
"Get the memory limit (in units of bytes) for the result of each query. Return a DOUBLE value."
|
|
29717
|
+
]
|
|
29718
|
+
}
|
|
29719
|
+
]
|
|
29720
|
+
},
|
|
29721
|
+
{
|
|
29722
|
+
"title": "Examples",
|
|
29723
|
+
"type": "example",
|
|
29724
|
+
"children": [
|
|
29725
|
+
{
|
|
29726
|
+
"type": "code",
|
|
29727
|
+
"language": "console",
|
|
29728
|
+
"value": [
|
|
29729
|
+
" ",
|
|
29730
|
+
" $ setMemLimitOfQueryResult(0.2)",
|
|
29731
|
+
" $ getMemLimitOfQueryResult() / 1024 / 1024 / 1024",
|
|
29732
|
+
" 0.2",
|
|
29733
|
+
""
|
|
29734
|
+
]
|
|
29735
|
+
},
|
|
29736
|
+
{
|
|
29737
|
+
"type": "text",
|
|
29738
|
+
"value": [
|
|
29739
|
+
"Related function: :doc:`/FunctionsandCommands/CommandsReferences/s/setMemLimitOfQueryResult`"
|
|
29740
|
+
]
|
|
29741
|
+
}
|
|
29742
|
+
]
|
|
29743
|
+
}
|
|
29744
|
+
]
|
|
29745
|
+
},
|
|
29746
|
+
"getMemLimitOfTaskGroupResult": {
|
|
29747
|
+
"title": "getMemLimitOfTaskGroupResult",
|
|
29748
|
+
"type": "function",
|
|
29749
|
+
"children": [
|
|
29750
|
+
{
|
|
29751
|
+
"title": "Syntax",
|
|
29752
|
+
"type": "grammer",
|
|
29753
|
+
"children": [
|
|
29754
|
+
{
|
|
29755
|
+
"type": "text",
|
|
29756
|
+
"value": [
|
|
29757
|
+
"getMemLimitOfTaskGroupResult()"
|
|
29758
|
+
]
|
|
29759
|
+
}
|
|
29760
|
+
]
|
|
29761
|
+
},
|
|
29762
|
+
{
|
|
29763
|
+
"title": "Arguments",
|
|
29764
|
+
"type": "parameters",
|
|
29765
|
+
"children": [
|
|
29766
|
+
{
|
|
29767
|
+
"type": "text",
|
|
29768
|
+
"value": [
|
|
29769
|
+
"None"
|
|
29770
|
+
]
|
|
29771
|
+
}
|
|
29772
|
+
]
|
|
29773
|
+
},
|
|
29774
|
+
{
|
|
29775
|
+
"title": "Details",
|
|
29776
|
+
"type": "detail",
|
|
29777
|
+
"children": [
|
|
29778
|
+
{
|
|
29779
|
+
"type": "text",
|
|
29780
|
+
"value": [
|
|
29781
|
+
"Get the memory limit of a task group sent from the current node. Return a DOUBLE value."
|
|
29443
29782
|
]
|
|
29444
29783
|
}
|
|
29445
29784
|
]
|
|
@@ -29453,82 +29792,16 @@
|
|
|
29453
29792
|
"language": "console",
|
|
29454
29793
|
"value": [
|
|
29455
29794
|
" ",
|
|
29456
|
-
" $
|
|
29457
|
-
"
|
|
29458
|
-
""
|
|
29459
|
-
]
|
|
29460
|
-
},
|
|
29461
|
-
{
|
|
29462
|
-
"type": "text",
|
|
29463
|
-
"value": [
|
|
29464
|
-
".. meta:: ",
|
|
29465
|
-
" :keywords: get"
|
|
29466
|
-
]
|
|
29467
|
-
}
|
|
29468
|
-
]
|
|
29469
|
-
}
|
|
29470
|
-
]
|
|
29471
|
-
},
|
|
29472
|
-
"getMachineFingerprint": {
|
|
29473
|
-
"title": "getMachineFingerprint",
|
|
29474
|
-
"type": "command",
|
|
29475
|
-
"children": [
|
|
29476
|
-
{
|
|
29477
|
-
"title": "Syntax",
|
|
29478
|
-
"type": "grammer",
|
|
29479
|
-
"children": [
|
|
29480
|
-
{
|
|
29481
|
-
"type": "text",
|
|
29482
|
-
"value": [
|
|
29483
|
-
"getMachineFingerprint(outputPath)",
|
|
29484
|
-
"",
|
|
29485
|
-
"Alias: generateMachineFingerprint"
|
|
29486
|
-
]
|
|
29487
|
-
}
|
|
29488
|
-
]
|
|
29489
|
-
},
|
|
29490
|
-
{
|
|
29491
|
-
"title": "Arguments",
|
|
29492
|
-
"type": "parameters",
|
|
29493
|
-
"children": [
|
|
29494
|
-
{
|
|
29495
|
-
"type": "text",
|
|
29496
|
-
"value": [
|
|
29497
|
-
"`outputPath` a string indicating the path of the file with fingerprint. "
|
|
29498
|
-
]
|
|
29499
|
-
}
|
|
29500
|
-
]
|
|
29501
|
-
},
|
|
29502
|
-
{
|
|
29503
|
-
"title": "Details",
|
|
29504
|
-
"type": "detail",
|
|
29505
|
-
"children": [
|
|
29506
|
-
{
|
|
29507
|
-
"type": "text",
|
|
29508
|
-
"value": [
|
|
29509
|
-
"Generate a file with the fingerprint of the computer. "
|
|
29510
|
-
]
|
|
29511
|
-
}
|
|
29512
|
-
]
|
|
29513
|
-
},
|
|
29514
|
-
{
|
|
29515
|
-
"title": "Examples",
|
|
29516
|
-
"type": "example",
|
|
29517
|
-
"children": [
|
|
29518
|
-
{
|
|
29519
|
-
"type": "code",
|
|
29520
|
-
"language": "console",
|
|
29521
|
-
"value": [
|
|
29522
|
-
"",
|
|
29523
|
-
" $ generateMachineFingerprint(\"/home/DolphinDB\")",
|
|
29795
|
+
" $ setMemLimitOfTaskGroupResult(10)",
|
|
29796
|
+
" $ getMemLimitOfTaskGroupResult() / 1024 / 1024 / 1024",
|
|
29797
|
+
" 10",
|
|
29524
29798
|
""
|
|
29525
29799
|
]
|
|
29526
29800
|
},
|
|
29527
29801
|
{
|
|
29528
29802
|
"type": "text",
|
|
29529
29803
|
"value": [
|
|
29530
|
-
"
|
|
29531
|
-
" :keywords: get"
|
|
29804
|
+
"Related function: :doc:`/FunctionsandCommands/CommandsReferences/s/setMemLimitOfTaskGroupResult`"
|
|
29532
29805
|
]
|
|
29533
29806
|
}
|
|
29534
29807
|
]
|
|
@@ -30200,6 +30473,86 @@
|
|
|
30200
30473
|
}
|
|
30201
30474
|
]
|
|
30202
30475
|
},
|
|
30476
|
+
"getQueryStatus": {
|
|
30477
|
+
"title": "getQueryStatus",
|
|
30478
|
+
"type": "function",
|
|
30479
|
+
"children": [
|
|
30480
|
+
{
|
|
30481
|
+
"title": "Syntax",
|
|
30482
|
+
"type": "grammer",
|
|
30483
|
+
"children": [
|
|
30484
|
+
{
|
|
30485
|
+
"type": "text",
|
|
30486
|
+
"value": [
|
|
30487
|
+
"getQueryStatus()"
|
|
30488
|
+
]
|
|
30489
|
+
}
|
|
30490
|
+
]
|
|
30491
|
+
},
|
|
30492
|
+
{
|
|
30493
|
+
"title": "Arguments",
|
|
30494
|
+
"type": "parameters",
|
|
30495
|
+
"children": [
|
|
30496
|
+
{
|
|
30497
|
+
"type": "text",
|
|
30498
|
+
"value": [
|
|
30499
|
+
"None"
|
|
30500
|
+
]
|
|
30501
|
+
}
|
|
30502
|
+
]
|
|
30503
|
+
},
|
|
30504
|
+
{
|
|
30505
|
+
"title": "Details",
|
|
30506
|
+
"type": "detail",
|
|
30507
|
+
"children": [
|
|
30508
|
+
{
|
|
30509
|
+
"type": "text",
|
|
30510
|
+
"value": [
|
|
30511
|
+
"Get the status of a running query initialized on the current node. Return a table with the following columns:",
|
|
30512
|
+
"",
|
|
30513
|
+
"* id: The total count of the query tasks that have been executed.",
|
|
30514
|
+
"* sessionId: ID of the session where the query is initialized. Please note that sessionId of the jobs submitted with submitJob cannot be obtained. ",
|
|
30515
|
+
"* userId: The user who initialized the task.",
|
|
30516
|
+
"* query: The query statement.",
|
|
30517
|
+
"* startTime: The timestamp when the query starts.",
|
|
30518
|
+
"* elapsedTimeInMs: The elapsed time (in ms) of the query.",
|
|
30519
|
+
"* memoryUsage: The memory used by the variables and results of the query (in bytes).",
|
|
30520
|
+
"* totalTaskCount: Total count of tasks.",
|
|
30521
|
+
"* completedTaskCount: Count of completed tasks.",
|
|
30522
|
+
"* percentComplete: The completion percentage of the query.",
|
|
30523
|
+
"",
|
|
30524
|
+
"The function can only be called on the node where a query is initialized."
|
|
30525
|
+
]
|
|
30526
|
+
}
|
|
30527
|
+
]
|
|
30528
|
+
},
|
|
30529
|
+
{
|
|
30530
|
+
"title": "Examples",
|
|
30531
|
+
"type": "example",
|
|
30532
|
+
"children": [
|
|
30533
|
+
{
|
|
30534
|
+
"type": "code",
|
|
30535
|
+
"language": "console",
|
|
30536
|
+
"value": [
|
|
30537
|
+
"",
|
|
30538
|
+
" getQueryStatus();",
|
|
30539
|
+
""
|
|
30540
|
+
]
|
|
30541
|
+
},
|
|
30542
|
+
{
|
|
30543
|
+
"type": "text",
|
|
30544
|
+
"value": [
|
|
30545
|
+
"=== ========== ======== =============================== ========================= ================ ============ =============== =================== ================",
|
|
30546
|
+
"id sessionId userId query startTime elapsedTimeInMs memoryUsage totalTaskCount completedTaskCount percentComplete",
|
|
30547
|
+
"=== ========== ======== =============================== ========================= ================ ============ =============== =================== ================",
|
|
30548
|
+
"2 1166953221 admin select ticker, id, x from pt 2022.06.14 08:15:00.606 1052 184550000 4 1 0.25",
|
|
30549
|
+
"=== ========== ======== =============================== ========================= ================ ============ =============== =================== ================"
|
|
30550
|
+
]
|
|
30551
|
+
}
|
|
30552
|
+
]
|
|
30553
|
+
}
|
|
30554
|
+
]
|
|
30555
|
+
},
|
|
30203
30556
|
"getRaftElectionTick": {
|
|
30204
30557
|
"title": "getRaftElectionTick",
|
|
30205
30558
|
"type": "function",
|
|
@@ -31802,8 +32155,6 @@
|
|
|
31802
32155
|
"| OLAP CACHE ENGINE | The status of OLAP cache engine on the current node and the memory usage of | ``pnodeRun(getCacheEngineMemSize)`` |",
|
|
31803
32156
|
"| STATUS | each node | ``pnodeRun(getOLAPCacheEngineStat)`` |",
|
|
31804
32157
|
"+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
|
|
31805
|
-
"| TSDB META | the metadata of all chunks in the TSDB database | ``pnodeRun(getTSDBMetaData)`` |",
|
|
31806
|
-
"+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
|
|
31807
32158
|
"| REDO LOG GC STATUS | the redo log status | ``pnodeRun(getRedoLogGCStat)`` |",
|
|
31808
32159
|
"+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
|
|
31809
32160
|
"| TRANSACTION STATUS | the transaction status | ``pnodeRun(getTransactionStatus)`` |",
|
|
@@ -32037,13 +32388,13 @@
|
|
|
32037
32388
|
" $ y=rand(10, n)",
|
|
32038
32389
|
" $ t1=table(ID, date, x)",
|
|
32039
32390
|
" $ t2=table(ID, date, y)",
|
|
32040
|
-
" $ db = database(\"
|
|
32391
|
+
" $ db = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
32041
32392
|
" $ pt1 = db.createPartitionedTable(t1, `pt1, `date)",
|
|
32042
32393
|
" $ pt1.append!(t1)",
|
|
32043
32394
|
" $ pt2 = db.createPartitionedTable(t2, `pt2, `date)",
|
|
32044
32395
|
" $ pt2.append!(t2);",
|
|
32045
|
-
"",
|
|
32046
32396
|
" $ getTables(db);",
|
|
32397
|
+
"",
|
|
32047
32398
|
" [\"pt1\",\"pt2\"]",
|
|
32048
32399
|
""
|
|
32049
32400
|
]
|
|
@@ -32854,6 +33205,115 @@
|
|
|
32854
33205
|
}
|
|
32855
33206
|
]
|
|
32856
33207
|
},
|
|
33208
|
+
"gmm": {
|
|
33209
|
+
"title": "gmm",
|
|
33210
|
+
"type": "function",
|
|
33211
|
+
"children": [
|
|
33212
|
+
{
|
|
33213
|
+
"title": "Syntax",
|
|
33214
|
+
"type": "grammer",
|
|
33215
|
+
"children": [
|
|
33216
|
+
{
|
|
33217
|
+
"type": "text",
|
|
33218
|
+
"value": [
|
|
33219
|
+
"gmm(X, k, [maxIter=300], [tolerance=1e-4], [randomSeed], [mean], [sigma])"
|
|
33220
|
+
]
|
|
33221
|
+
}
|
|
33222
|
+
]
|
|
33223
|
+
},
|
|
33224
|
+
{
|
|
33225
|
+
"title": "Arguments",
|
|
33226
|
+
"type": "parameters",
|
|
33227
|
+
"children": [
|
|
33228
|
+
{
|
|
33229
|
+
"type": "text",
|
|
33230
|
+
"value": [
|
|
33231
|
+
"`X` is the training data set. For univariate data, X is a vector; For multivariate data, X is a matrix/table where each column is a sample.",
|
|
33232
|
+
"",
|
|
33233
|
+
"`k` is an integer indicating the number of independent Gaussians in a mixture model.",
|
|
33234
|
+
"",
|
|
33235
|
+
"`maxlter` is a positive integer indicating the maximum EM iterations to perform. The default value is 300.",
|
|
33236
|
+
"",
|
|
33237
|
+
"`tolerance` is a floating-point number indicating the convergence tolerance. EM iterations will stop when the lower bound average gain is below this threshold. The default value is 1e-4.",
|
|
33238
|
+
"",
|
|
33239
|
+
"`randomSeed` is the random seed given to the method.",
|
|
33240
|
+
"",
|
|
33241
|
+
"`mean` is an optional parameter. It is a vector or matrix indicating the initial means. ",
|
|
33242
|
+
"",
|
|
33243
|
+
"* For univariate data, it is a vector of length *k*;",
|
|
33244
|
+
"* For multivariate data, it is a matrix whose number of columns is *k* and number of rows is the same as the number of variables in *X*;",
|
|
33245
|
+
"* If *mean* is unspecified, *k* values are randomly selected from *X* as the initial means.",
|
|
33246
|
+
"",
|
|
33247
|
+
"`sigma` an optional parameter. It is ",
|
|
33248
|
+
"",
|
|
33249
|
+
"* a vector, indicating the initialized variance of each submodel if *X* is univariate data;",
|
|
33250
|
+
"* a tuple of length *k*, indicating the covariance matrix of each submodel if *X* is multivariate data;",
|
|
33251
|
+
"* a vector with element values of 1 or an identity matrix if sigma is unspecified.",
|
|
33252
|
+
""
|
|
33253
|
+
]
|
|
33254
|
+
}
|
|
33255
|
+
]
|
|
33256
|
+
},
|
|
33257
|
+
{
|
|
33258
|
+
"title": "Details",
|
|
33259
|
+
"type": "detail",
|
|
33260
|
+
"children": [
|
|
33261
|
+
{
|
|
33262
|
+
"type": "text",
|
|
33263
|
+
"value": [
|
|
33264
|
+
"Train the Gaussian Mixture Model (GMM) with the given data set. Return a dictionary with the following keys:",
|
|
33265
|
+
"",
|
|
33266
|
+
"* modelName: a string “Gaussian Mixture Model”",
|
|
33267
|
+
"* prior: the prior probability of each submodel ",
|
|
33268
|
+
"* mean: the expectation of each submodel",
|
|
33269
|
+
"* sigma: If *X* is univariate data, it represents the variance of each submodel; If *X* is multivariate data, it represents the covariance matrix of each submodel."
|
|
33270
|
+
]
|
|
33271
|
+
}
|
|
33272
|
+
]
|
|
33273
|
+
},
|
|
33274
|
+
{
|
|
33275
|
+
"title": "Examples",
|
|
33276
|
+
"type": "example",
|
|
33277
|
+
"children": [
|
|
33278
|
+
{
|
|
33279
|
+
"type": "code",
|
|
33280
|
+
"language": "console",
|
|
33281
|
+
"value": [
|
|
33282
|
+
"",
|
|
33283
|
+
" $ dataT = 6.8 7.2 5.3 9.4 6.5 11.2 25.6 0.6 8.9 4.3 2.2 1.9 8.7 0.2 1.5",
|
|
33284
|
+
" $ mean = [2, 2]",
|
|
33285
|
+
" $ re = gmm(dataT, 2, 300, 1e-4, 42, mean)",
|
|
33286
|
+
" $ re",
|
|
33287
|
+
"",
|
|
33288
|
+
" sigma->[36.759822,36.759822]",
|
|
33289
|
+
" modelName->Gaussian Mixture Model",
|
|
33290
|
+
" prior->[0.5,0.5]",
|
|
33291
|
+
" mean->[6.686667,6.686667]",
|
|
33292
|
+
"",
|
|
33293
|
+
" $ dataT = transpose(matrix(3.2 1.5 2.6 7.8 6.3 4.2 5.1 8.9 11.2 25.8, 25.6 4.6 8.9 4.3 2.2 1.9 8.7 0.2 1.5 9.3))",
|
|
33294
|
+
" $ mean = transpose(matrix([1, 0], [0, 1]))",
|
|
33295
|
+
" $ re = gmm(dataT, 2, 300, 1e-4, 42, mean)",
|
|
33296
|
+
" $ re",
|
|
33297
|
+
"",
|
|
33298
|
+
" sigma->(#0 #1 ",
|
|
33299
|
+
" 51.001369 18.273032",
|
|
33300
|
+
" 18.273032 9.34789 ",
|
|
33301
|
+
" ,#0 #1 ",
|
|
33302
|
+
" 1.718475 0.629584 ",
|
|
33303
|
+
" 0.629584 67.713701",
|
|
33304
|
+
" )",
|
|
33305
|
+
" modelName->Gaussian Mixture Model",
|
|
33306
|
+
" prior->[0.558683,0.441317]",
|
|
33307
|
+
" mean->",
|
|
33308
|
+
" #0 #1 ",
|
|
33309
|
+
" 11.152841 3.238262 ",
|
|
33310
|
+
" 3.341493 10.996997"
|
|
33311
|
+
]
|
|
33312
|
+
}
|
|
33313
|
+
]
|
|
33314
|
+
}
|
|
33315
|
+
]
|
|
33316
|
+
},
|
|
32857
33317
|
"gmtime": {
|
|
32858
33318
|
"title": "gmtime",
|
|
32859
33319
|
"type": "function",
|
|
@@ -35617,16 +36077,19 @@
|
|
|
35617
36077
|
"value": [
|
|
35618
36078
|
"",
|
|
35619
36079
|
" $ timer(100) select * from t where id=500000;",
|
|
35620
|
-
" Time elapsed:
|
|
36080
|
+
" Time elapsed: 177.286 ms",
|
|
35621
36081
|
"",
|
|
35622
36082
|
" $ timer(100) select * from t1 where id=500000;",
|
|
35623
|
-
" Time elapsed: 1.
|
|
36083
|
+
" Time elapsed: 1.245 ms",
|
|
36084
|
+
"",
|
|
36085
|
+
" $ timer(100) sliceByKey(t1, 500000)",
|
|
36086
|
+
" Time elapsed: 0.742 ms",
|
|
35624
36087
|
"",
|
|
35625
36088
|
" $ timer(100) select * from t where id in [500000, 600000, 700000];",
|
|
35626
|
-
" Time elapsed:
|
|
36089
|
+
" Time elapsed: 1134.429 ms",
|
|
35627
36090
|
"",
|
|
35628
36091
|
" $ timer(100) select * from t1 where id in [500000, 600000, 700000];",
|
|
35629
|
-
" Time elapsed: 1 ms",
|
|
36092
|
+
" Time elapsed: 1.377 ms",
|
|
35630
36093
|
""
|
|
35631
36094
|
]
|
|
35632
36095
|
},
|
|
@@ -35643,10 +36106,10 @@
|
|
|
35643
36106
|
"value": [
|
|
35644
36107
|
"",
|
|
35645
36108
|
" $ timer(100) select * from t where id between 500000:500010;",
|
|
35646
|
-
" Time elapsed:
|
|
36109
|
+
" Time elapsed: 641.544 ms",
|
|
35647
36110
|
"",
|
|
35648
36111
|
" $ timer(100) select * from t1 where id between 500000:500010;",
|
|
35649
|
-
" Time elapsed:
|
|
36112
|
+
" Time elapsed: 599.752 ms",
|
|
35650
36113
|
""
|
|
35651
36114
|
]
|
|
35652
36115
|
},
|
|
@@ -35663,10 +36126,10 @@
|
|
|
35663
36126
|
"value": [
|
|
35664
36127
|
"",
|
|
35665
36128
|
" $ timer(100) select * from t where id=500000, type in [3,6];",
|
|
35666
|
-
" Time elapsed:
|
|
36129
|
+
" Time elapsed: 172.808 ms",
|
|
35667
36130
|
"",
|
|
35668
36131
|
" $ timer(100) select * from t1 where id=500000, type in [3,6];",
|
|
35669
|
-
" Time elapsed:
|
|
36132
|
+
" Time elapsed: 1.664 ms",
|
|
35670
36133
|
""
|
|
35671
36134
|
]
|
|
35672
36135
|
},
|
|
@@ -35683,16 +36146,16 @@
|
|
|
35683
36146
|
"value": [
|
|
35684
36147
|
"",
|
|
35685
36148
|
" $ timer(100) select * from t where date in [2012.06.03, 2012.06.06];",
|
|
35686
|
-
" Time elapsed:
|
|
36149
|
+
" Time elapsed: 490.182 ms",
|
|
35687
36150
|
"",
|
|
35688
36151
|
" $ timer(100) select * from t1 where date in [2012.06.03, 2012.06.06];",
|
|
35689
|
-
" Time elapsed:
|
|
36152
|
+
" Time elapsed: 544.015 ms",
|
|
35690
36153
|
"",
|
|
35691
36154
|
" $ timer(100) select * from t where date=2012.06.03, type=8;",
|
|
35692
|
-
" Time elapsed:
|
|
36155
|
+
" Time elapsed: 205.443 ms",
|
|
35693
36156
|
"",
|
|
35694
36157
|
" $ timer(100) select * from t1 where date=2012.06.03, type=8;",
|
|
35695
|
-
" Time elapsed:
|
|
36158
|
+
" Time elapsed: 204.532 ms",
|
|
35696
36159
|
""
|
|
35697
36160
|
]
|
|
35698
36161
|
},
|
|
@@ -35709,17 +36172,20 @@
|
|
|
35709
36172
|
"value": [
|
|
35710
36173
|
"",
|
|
35711
36174
|
" $ timer(100) select * from t where id in [100,200], date in [2012.06.03, 2012.06.06], type in [3,6];",
|
|
35712
|
-
" Time elapsed:
|
|
36175
|
+
" Time elapsed: 208.714 ms",
|
|
35713
36176
|
"",
|
|
35714
36177
|
" $ timer(100) select * from t1 where id in [100,200], date in [2012.06.03, 2012.06.06], type in [3,6];",
|
|
35715
|
-
" Time elapsed:
|
|
36178
|
+
" Time elapsed: 198.674 ms",
|
|
35716
36179
|
""
|
|
35717
36180
|
]
|
|
35718
36181
|
},
|
|
35719
36182
|
{
|
|
35720
36183
|
"type": "text",
|
|
35721
36184
|
"value": [
|
|
35722
|
-
"Related function: :doc:`../k/keyedTable`"
|
|
36185
|
+
"Related function: :doc:`../k/keyedTable`",
|
|
36186
|
+
"",
|
|
36187
|
+
".. meta::",
|
|
36188
|
+
" :keywords: in-memory table"
|
|
35723
36189
|
]
|
|
35724
36190
|
}
|
|
35725
36191
|
]
|
|
@@ -38384,6 +38850,128 @@
|
|
|
38384
38850
|
}
|
|
38385
38851
|
]
|
|
38386
38852
|
},
|
|
38853
|
+
"isPeak": {
|
|
38854
|
+
"title": "isPeak",
|
|
38855
|
+
"type": "function",
|
|
38856
|
+
"children": [
|
|
38857
|
+
{
|
|
38858
|
+
"title": "Syntax",
|
|
38859
|
+
"type": "grammer",
|
|
38860
|
+
"children": [
|
|
38861
|
+
{
|
|
38862
|
+
"type": "text",
|
|
38863
|
+
"value": [
|
|
38864
|
+
"isPeak(X, [strict=true])"
|
|
38865
|
+
]
|
|
38866
|
+
}
|
|
38867
|
+
]
|
|
38868
|
+
},
|
|
38869
|
+
{
|
|
38870
|
+
"title": "Arguments",
|
|
38871
|
+
"type": "parameters",
|
|
38872
|
+
"children": [
|
|
38873
|
+
{
|
|
38874
|
+
"type": "text",
|
|
38875
|
+
"value": [
|
|
38876
|
+
"`X` is a numeric vector/matrix/table.",
|
|
38877
|
+
"",
|
|
38878
|
+
"`strict` is a Boolean value. The default value is true.",
|
|
38879
|
+
"",
|
|
38880
|
+
" * If strict = true, the adjacent elements cannot be NULL and are strictly smaller than the element;",
|
|
38881
|
+
" * If strict = false, the adjacent elements cannot be NULL and are no greater than the element."
|
|
38882
|
+
]
|
|
38883
|
+
}
|
|
38884
|
+
]
|
|
38885
|
+
},
|
|
38886
|
+
{
|
|
38887
|
+
"title": "Details",
|
|
38888
|
+
"type": "detail",
|
|
38889
|
+
"children": [
|
|
38890
|
+
{
|
|
38891
|
+
"type": "text",
|
|
38892
|
+
"value": [
|
|
38893
|
+
"If *X* is a vector, check if each element in *X* is the peak. ",
|
|
38894
|
+
"",
|
|
38895
|
+
"If *X* is a matrix, perform the aforementioned calculations on each column and return a matrix of the same size as *X*.",
|
|
38896
|
+
"",
|
|
38897
|
+
"If *X* is a table, only the numeric columns are involved in the calculations."
|
|
38898
|
+
]
|
|
38899
|
+
}
|
|
38900
|
+
]
|
|
38901
|
+
},
|
|
38902
|
+
{
|
|
38903
|
+
"title": "Examples",
|
|
38904
|
+
"type": "example",
|
|
38905
|
+
"children": [
|
|
38906
|
+
{
|
|
38907
|
+
"type": "code",
|
|
38908
|
+
"language": "console",
|
|
38909
|
+
"value": [
|
|
38910
|
+
"",
|
|
38911
|
+
" $ v = [1, 2.2, 2.2, 2.2, 2.3, 1, 1.2]",
|
|
38912
|
+
" $ isPeak(v)",
|
|
38913
|
+
" [0,0,0,0,1,0,0]",
|
|
38914
|
+
"",
|
|
38915
|
+
" $ v = [1, 2.2, 2.2, 2.2, 1.6, 1, 1.2]",
|
|
38916
|
+
" $ isPeak(v)",
|
|
38917
|
+
" [0,0,0,0,0,0,0]",
|
|
38918
|
+
" $ isPeak(v, false)",
|
|
38919
|
+
" [0,1,1,1,0,0,0]",
|
|
38920
|
+
"",
|
|
38921
|
+
" // Perform the calculations on each column in a matrix",
|
|
38922
|
+
" $ m = matrix(3.3 2.8 5.6 NULL 2.5 1.2, 4.5 3.5 4.6 2.8 3.9 NULL)",
|
|
38923
|
+
" $ isPeak(m)",
|
|
38924
|
+
""
|
|
38925
|
+
]
|
|
38926
|
+
},
|
|
38927
|
+
{
|
|
38928
|
+
"type": "text",
|
|
38929
|
+
"value": [
|
|
38930
|
+
"== ==",
|
|
38931
|
+
"#0 #1",
|
|
38932
|
+
"== ==",
|
|
38933
|
+
"0 0 ",
|
|
38934
|
+
"0 0 ",
|
|
38935
|
+
"0 1 ",
|
|
38936
|
+
"0 0 ",
|
|
38937
|
+
"0 0 ",
|
|
38938
|
+
"0 0 ",
|
|
38939
|
+
"== ==",
|
|
38940
|
+
""
|
|
38941
|
+
]
|
|
38942
|
+
},
|
|
38943
|
+
{
|
|
38944
|
+
"type": "code",
|
|
38945
|
+
"language": "console",
|
|
38946
|
+
"value": [
|
|
38947
|
+
"",
|
|
38948
|
+
" // Perform the calculations on the numeric columns in a table",
|
|
38949
|
+
" $ t = table(`01`01`00`01`02`00 as id, 2022.01.01 + 1..6 as date, 388.3 390.6 390.8 390.6 390.3 391.5 as price)",
|
|
38950
|
+
" $ isPeak(t)",
|
|
38951
|
+
""
|
|
38952
|
+
]
|
|
38953
|
+
},
|
|
38954
|
+
{
|
|
38955
|
+
"type": "text",
|
|
38956
|
+
"value": [
|
|
38957
|
+
"== ========== =====",
|
|
38958
|
+
"id date price",
|
|
38959
|
+
"== ========== =====",
|
|
38960
|
+
"01 2022.01.02 0 ",
|
|
38961
|
+
"01 2022.01.03 0 ",
|
|
38962
|
+
"00 2022.01.04 1 ",
|
|
38963
|
+
"01 2022.01.05 0 ",
|
|
38964
|
+
"02 2022.01.06 0 ",
|
|
38965
|
+
"00 2022.01.07 0",
|
|
38966
|
+
"== ========== =====",
|
|
38967
|
+
"",
|
|
38968
|
+
"Related function: :doc:`isValley`"
|
|
38969
|
+
]
|
|
38970
|
+
}
|
|
38971
|
+
]
|
|
38972
|
+
}
|
|
38973
|
+
]
|
|
38974
|
+
},
|
|
38387
38975
|
"isQuarterEnd": {
|
|
38388
38976
|
"title": "isQuarterEnd",
|
|
38389
38977
|
"type": "function",
|
|
@@ -38860,6 +39448,128 @@
|
|
|
38860
39448
|
}
|
|
38861
39449
|
]
|
|
38862
39450
|
},
|
|
39451
|
+
"isValley": {
|
|
39452
|
+
"title": "isValley",
|
|
39453
|
+
"type": "function",
|
|
39454
|
+
"children": [
|
|
39455
|
+
{
|
|
39456
|
+
"title": "Syntax",
|
|
39457
|
+
"type": "grammer",
|
|
39458
|
+
"children": [
|
|
39459
|
+
{
|
|
39460
|
+
"type": "text",
|
|
39461
|
+
"value": [
|
|
39462
|
+
"isValley(X, [strict=true])"
|
|
39463
|
+
]
|
|
39464
|
+
}
|
|
39465
|
+
]
|
|
39466
|
+
},
|
|
39467
|
+
{
|
|
39468
|
+
"title": "Arguments",
|
|
39469
|
+
"type": "parameters",
|
|
39470
|
+
"children": [
|
|
39471
|
+
{
|
|
39472
|
+
"type": "text",
|
|
39473
|
+
"value": [
|
|
39474
|
+
"`X` is a numeric vector/matrix/table.",
|
|
39475
|
+
"",
|
|
39476
|
+
"`strict` is a Boolean value. The default value is true.",
|
|
39477
|
+
"",
|
|
39478
|
+
" * If strict = true, the adjacent elements cannot be NULL and are strictly greater than the element;",
|
|
39479
|
+
" * If strict = false, the adjacent elements cannot be NULL and are no smaller than the element."
|
|
39480
|
+
]
|
|
39481
|
+
}
|
|
39482
|
+
]
|
|
39483
|
+
},
|
|
39484
|
+
{
|
|
39485
|
+
"title": "Details",
|
|
39486
|
+
"type": "detail",
|
|
39487
|
+
"children": [
|
|
39488
|
+
{
|
|
39489
|
+
"type": "text",
|
|
39490
|
+
"value": [
|
|
39491
|
+
"If *X* is a vector, check if each element in *X* is the valley.",
|
|
39492
|
+
"",
|
|
39493
|
+
"If *X* is a matrix, perform the aforementioned calculations on each column and return a matrix of the same size as *X*. ",
|
|
39494
|
+
"",
|
|
39495
|
+
"If *X* is a table, only the numeric columns are involved in the calculations."
|
|
39496
|
+
]
|
|
39497
|
+
}
|
|
39498
|
+
]
|
|
39499
|
+
},
|
|
39500
|
+
{
|
|
39501
|
+
"title": "Examples",
|
|
39502
|
+
"type": "example",
|
|
39503
|
+
"children": [
|
|
39504
|
+
{
|
|
39505
|
+
"type": "code",
|
|
39506
|
+
"language": "console",
|
|
39507
|
+
"value": [
|
|
39508
|
+
"",
|
|
39509
|
+
" $ v = [3.1, 2.2, 2.2, 2.2, 1.3, 2.1, 1.2]",
|
|
39510
|
+
" $ isValley(v)",
|
|
39511
|
+
" [0,0,0,0,1,0,0]",
|
|
39512
|
+
"",
|
|
39513
|
+
" $ v = [3.1, 2.2, 2.2, 2.2, 2.6, 1, 1.2]",
|
|
39514
|
+
" $ isValley(v)",
|
|
39515
|
+
" [0,0,0,0,0,1,0]",
|
|
39516
|
+
" $ isValley(v, false)",
|
|
39517
|
+
" [0,1,1,1,0,1,0]",
|
|
39518
|
+
"",
|
|
39519
|
+
" // Perform the calculations on each column in a matrix",
|
|
39520
|
+
" $ m = matrix(5.3 5.8 5.6 NULL 5.7 1.2, 4.5 3.5 4.6 2.8 3.9 NULL)",
|
|
39521
|
+
" $ isValley(m)",
|
|
39522
|
+
""
|
|
39523
|
+
]
|
|
39524
|
+
},
|
|
39525
|
+
{
|
|
39526
|
+
"type": "text",
|
|
39527
|
+
"value": [
|
|
39528
|
+
"== ==",
|
|
39529
|
+
"#0 #1",
|
|
39530
|
+
"== ==",
|
|
39531
|
+
"0 0 ",
|
|
39532
|
+
"0 1 ",
|
|
39533
|
+
"0 0 ",
|
|
39534
|
+
"0 1 ",
|
|
39535
|
+
"0 0 ",
|
|
39536
|
+
"0 0 ",
|
|
39537
|
+
"== ==",
|
|
39538
|
+
""
|
|
39539
|
+
]
|
|
39540
|
+
},
|
|
39541
|
+
{
|
|
39542
|
+
"type": "code",
|
|
39543
|
+
"language": "console",
|
|
39544
|
+
"value": [
|
|
39545
|
+
"",
|
|
39546
|
+
" // Perform the calculations on the numeric columns in a table",
|
|
39547
|
+
" $ t = table(`01`01`00`01`02`00 as id, 2022.01.01 + 1..6 as date, 388.3 390.6 390.8 390.6 390.3 391.5 as price)",
|
|
39548
|
+
" $ isValley(t)",
|
|
39549
|
+
""
|
|
39550
|
+
]
|
|
39551
|
+
},
|
|
39552
|
+
{
|
|
39553
|
+
"type": "text",
|
|
39554
|
+
"value": [
|
|
39555
|
+
"== ========== =====",
|
|
39556
|
+
"id date price",
|
|
39557
|
+
"== ========== =====",
|
|
39558
|
+
"01 2022.01.02 0 ",
|
|
39559
|
+
"01 2022.01.03 0 ",
|
|
39560
|
+
"00 2022.01.04 0 ",
|
|
39561
|
+
"01 2022.01.05 0 ",
|
|
39562
|
+
"02 2022.01.06 1 ",
|
|
39563
|
+
"00 2022.01.07 0",
|
|
39564
|
+
"== ========== =====",
|
|
39565
|
+
"",
|
|
39566
|
+
"Related function: :doc:`isPeak`"
|
|
39567
|
+
]
|
|
39568
|
+
}
|
|
39569
|
+
]
|
|
39570
|
+
}
|
|
39571
|
+
]
|
|
39572
|
+
},
|
|
38863
39573
|
"isVoid": {
|
|
38864
39574
|
"title": "isVoid",
|
|
38865
39575
|
"type": "function",
|
|
@@ -40308,8 +41018,7 @@
|
|
|
40308
41018
|
"",
|
|
40309
41019
|
"`colTypes` is a string vector of data types. ",
|
|
40310
41020
|
"",
|
|
40311
|
-
"For the third scenario, *table* is a table. Please note that keyColumns in table cannot have duplicate values."
|
|
40312
|
-
""
|
|
41021
|
+
"For the third scenario, *table* is a table. Please note that keyColumns in table cannot have duplicate values."
|
|
40313
41022
|
]
|
|
40314
41023
|
}
|
|
40315
41024
|
]
|
|
@@ -40557,10 +41266,13 @@
|
|
|
40557
41266
|
"value": [
|
|
40558
41267
|
"",
|
|
40559
41268
|
" $ timer(100) select * from t where id=500000, date=2012.06.01, type=0;",
|
|
40560
|
-
" Time elapsed:
|
|
41269
|
+
" Time elapsed: 161.574 ms",
|
|
40561
41270
|
"",
|
|
40562
41271
|
" $ timer(100) select * from kt where id=500000, date=2012.06.01, type=0;",
|
|
40563
|
-
" Time elapsed:
|
|
41272
|
+
" Time elapsed: 1.483 ms",
|
|
41273
|
+
"",
|
|
41274
|
+
" $ timer(100) sliceByKey(t1, (500000, 2012.06.01, 0))",
|
|
41275
|
+
" Time elapsed: 0.705 ms",
|
|
40564
41276
|
""
|
|
40565
41277
|
]
|
|
40566
41278
|
},
|
|
@@ -40577,10 +41289,10 @@
|
|
|
40577
41289
|
"value": [
|
|
40578
41290
|
"",
|
|
40579
41291
|
" $ timer(100) select * from t where id in [1, 500000], date in 2012.06.01..2012.06.05, type=5;",
|
|
40580
|
-
" Time elapsed:
|
|
41292
|
+
" Time elapsed: 894.241 ms",
|
|
40581
41293
|
"",
|
|
40582
41294
|
" $ timer(100) select * from kt where id in [1, 500000], date in 2012.06.01..2012.06.05, type=5;",
|
|
40583
|
-
" Time elapsed:
|
|
41295
|
+
" Time elapsed: 2.322 ms",
|
|
40584
41296
|
""
|
|
40585
41297
|
]
|
|
40586
41298
|
},
|
|
@@ -40599,10 +41311,10 @@
|
|
|
40599
41311
|
"value": [
|
|
40600
41312
|
"",
|
|
40601
41313
|
" $ timer(100) select * from t where id in [1, 500000], date in 2012.06.01..2012.06.05, type in 1..5;",
|
|
40602
|
-
" Time elapsed:
|
|
40603
|
-
"",
|
|
41314
|
+
" Time elapsed: 801.347 ms",
|
|
41315
|
+
" ",
|
|
40604
41316
|
" $ timer(100) select * from kt where id in [1, 500000], date in 2012.06.01..2012.06.05, type in 1..5;",
|
|
40605
|
-
" Time elapsed:
|
|
41317
|
+
" Time elapsed: 834.184 ms",
|
|
40606
41318
|
""
|
|
40607
41319
|
]
|
|
40608
41320
|
},
|
|
@@ -40621,17 +41333,20 @@
|
|
|
40621
41333
|
"value": [
|
|
40622
41334
|
"",
|
|
40623
41335
|
" $ timer(100) select * from t where id=500000, date in 2012.06.01..2012.06.05;",
|
|
40624
|
-
" Time elapsed:
|
|
41336
|
+
" Time elapsed: 177.113 ms",
|
|
40625
41337
|
"",
|
|
40626
41338
|
" $ timer(100) select * from kt where id=500000, date in 2012.06.01..2012.06.05;",
|
|
40627
|
-
" Time elapsed:
|
|
41339
|
+
" Time elapsed: 163.265 ms",
|
|
40628
41340
|
" "
|
|
40629
41341
|
]
|
|
40630
41342
|
},
|
|
40631
41343
|
{
|
|
40632
41344
|
"type": "text",
|
|
40633
41345
|
"value": [
|
|
40634
|
-
"Related function: :doc:`../i/indexedTable`"
|
|
41346
|
+
"Related function: :doc:`../i/indexedTable`",
|
|
41347
|
+
"",
|
|
41348
|
+
".. meta::",
|
|
41349
|
+
" :keywords: in-memory table"
|
|
40635
41350
|
]
|
|
40636
41351
|
}
|
|
40637
41352
|
]
|
|
@@ -43091,7 +43806,7 @@
|
|
|
43091
43806
|
"",
|
|
43092
43807
|
"`partitions` is a scalar or vector indicating which partitions of the table to load into memory.",
|
|
43093
43808
|
"",
|
|
43094
|
-
"`memoryMode` is a Boolean value indicating whether to load only metadata into memory (`memoryMode
|
|
43809
|
+
"`memoryMode` is a Boolean value indicating whether to load only metadata into memory (`memoryMode` = false). If `memoryMode` = true, load all data or selected partitions into memory. Please note that this parameter only takes effect for local databases on disk. For DFS databases, only the metadata is loaded into memory."
|
|
43095
43810
|
]
|
|
43096
43811
|
}
|
|
43097
43812
|
]
|
|
@@ -43105,7 +43820,7 @@
|
|
|
43105
43820
|
"value": [
|
|
43106
43821
|
"For a DFS table: return a table object with only the metadata.",
|
|
43107
43822
|
"",
|
|
43108
|
-
"For a partitioned table in the local file system: if *memoryMode
|
|
43823
|
+
"For a partitioned table in the local file system: if *memoryMode* = true, load all partitions (or selected partitions if parameter *partitions* is specified) into memory as a partitioned table; if *memoryMode* = false, only load metadata into memory."
|
|
43109
43824
|
]
|
|
43110
43825
|
}
|
|
43111
43826
|
]
|
|
@@ -43117,7 +43832,7 @@
|
|
|
43117
43832
|
{
|
|
43118
43833
|
"type": "text",
|
|
43119
43834
|
"value": [
|
|
43120
|
-
"
|
|
43835
|
+
"In the distributed file system:",
|
|
43121
43836
|
"",
|
|
43122
43837
|
"* To load a partitioned table:",
|
|
43123
43838
|
""
|
|
@@ -43200,16 +43915,11 @@
|
|
|
43200
43915
|
{
|
|
43201
43916
|
"type": "text",
|
|
43202
43917
|
"value": [
|
|
43203
|
-
"\\2. In the local file system:",
|
|
43918
|
+
".. \\2. In the local file system:",
|
|
43204
43919
|
"",
|
|
43205
|
-
"* To load an unpartitioned table:",
|
|
43206
|
-
""
|
|
43207
|
-
|
|
43208
|
-
},
|
|
43209
|
-
{
|
|
43210
|
-
"type": "code",
|
|
43211
|
-
"language": "console",
|
|
43212
|
-
"value": [
|
|
43920
|
+
".. * To load an unpartitioned table:",
|
|
43921
|
+
"",
|
|
43922
|
+
".. .. code:: console",
|
|
43213
43923
|
"",
|
|
43214
43924
|
" $ n=2000000",
|
|
43215
43925
|
" $ syms=`IBM`C`MS`MSFT`JPM`ORCL`FB`GE",
|
|
@@ -43223,36 +43933,16 @@
|
|
|
43223
43933
|
" $ saveTable(db, t1, `t1);",
|
|
43224
43934
|
"",
|
|
43225
43935
|
" $ tt=loadTable(db,`t1);",
|
|
43226
|
-
""
|
|
43227
|
-
|
|
43228
|
-
|
|
43229
|
-
|
|
43230
|
-
"type": "text",
|
|
43231
|
-
"value": [
|
|
43232
|
-
"Alternatively, we can specify the folder path to load a table:",
|
|
43233
|
-
""
|
|
43234
|
-
]
|
|
43235
|
-
},
|
|
43236
|
-
{
|
|
43237
|
-
"type": "code",
|
|
43238
|
-
"language": "console",
|
|
43239
|
-
"value": [
|
|
43936
|
+
"",
|
|
43937
|
+
".. Alternatively, we can specify the folder path to load a table:",
|
|
43938
|
+
"",
|
|
43939
|
+
".. .. code:: console",
|
|
43240
43940
|
"",
|
|
43241
43941
|
" $ tt=loadTable(\"C:/DolphinDB/Data/db01\",`t1);",
|
|
43242
|
-
""
|
|
43243
|
-
|
|
43244
|
-
|
|
43245
|
-
|
|
43246
|
-
"type": "text",
|
|
43247
|
-
"value": [
|
|
43248
|
-
"* To load a subset of partitions:",
|
|
43249
|
-
""
|
|
43250
|
-
]
|
|
43251
|
-
},
|
|
43252
|
-
{
|
|
43253
|
-
"type": "code",
|
|
43254
|
-
"language": "console",
|
|
43255
|
-
"value": [
|
|
43942
|
+
"",
|
|
43943
|
+
".. * To load a subset of partitions:",
|
|
43944
|
+
"",
|
|
43945
|
+
".. .. code:: console",
|
|
43256
43946
|
"",
|
|
43257
43947
|
" $ n = 2000000",
|
|
43258
43948
|
" $ workDir = \"C:/DolphinDB/Data\"",
|
|
@@ -43263,54 +43953,24 @@
|
|
|
43263
43953
|
" $ db = database(workDir + \"/trade1\",VALUE,`IBM`MSFT`GM`C`YHOO`GOOG)",
|
|
43264
43954
|
" $ db.loadTextEx(\"trades\",\"sym\", workDir + \"/trades.txt\")",
|
|
43265
43955
|
" $ trades = db.loadTable(\"trades\",`IBM`GM`YHOO,1)",
|
|
43266
|
-
""
|
|
43267
|
-
|
|
43268
|
-
|
|
43269
|
-
|
|
43270
|
-
"type": "text",
|
|
43271
|
-
"value": [
|
|
43272
|
-
"To selectively load range partitions, we can use any value in a range to represent the range. Similarly, for a list partition, we can use any value in a group to represent the group.",
|
|
43273
|
-
""
|
|
43274
|
-
]
|
|
43275
|
-
},
|
|
43276
|
-
{
|
|
43277
|
-
"type": "code",
|
|
43278
|
-
"language": "console",
|
|
43279
|
-
"value": [
|
|
43956
|
+
"",
|
|
43957
|
+
".. To selectively load range partitions, we can use any value in a range to represent the range. Similarly, for a list partition, we can use any value in a group to represent the group.",
|
|
43958
|
+
"",
|
|
43959
|
+
".. .. code:: console",
|
|
43280
43960
|
"",
|
|
43281
43961
|
" $ db = database(workDir + \"/trade2\",RANGE,[2000.01.01, 2000.04.01, 2000.07.01, 2000.10.01, 2001.01.01])",
|
|
43282
43962
|
" $ db.loadTextEx(\"trades\",\"date\", workDir + \"/trades.txt\")",
|
|
43283
|
-
""
|
|
43284
|
-
|
|
43285
|
-
|
|
43286
|
-
|
|
43287
|
-
"type": "text",
|
|
43288
|
-
"value": [
|
|
43289
|
-
"The following 2 commands are equivalent:",
|
|
43290
|
-
""
|
|
43291
|
-
]
|
|
43292
|
-
},
|
|
43293
|
-
{
|
|
43294
|
-
"type": "code",
|
|
43295
|
-
"language": "console",
|
|
43296
|
-
"value": [
|
|
43963
|
+
"",
|
|
43964
|
+
".. The following 2 commands are equivalent:",
|
|
43965
|
+
"",
|
|
43966
|
+
".. .. code:: console",
|
|
43297
43967
|
"",
|
|
43298
43968
|
" $ trades = db.loadTable(\"trades\",[2000.01.01, 2000.07.01],true)",
|
|
43299
43969
|
" $ trades = db.loadTable(\"trades\",[2000.03.06, 2000.09.15],true)",
|
|
43300
|
-
""
|
|
43301
|
-
|
|
43302
|
-
|
|
43303
|
-
|
|
43304
|
-
"type": "text",
|
|
43305
|
-
"value": [
|
|
43306
|
-
"* To load a partitioned table as an in-memory partitioned table:",
|
|
43307
|
-
""
|
|
43308
|
-
]
|
|
43309
|
-
},
|
|
43310
|
-
{
|
|
43311
|
-
"type": "code",
|
|
43312
|
-
"language": "console",
|
|
43313
|
-
"value": [
|
|
43970
|
+
"",
|
|
43971
|
+
".. * To load a partitioned table as an in-memory partitioned table:",
|
|
43972
|
+
"",
|
|
43973
|
+
".. .. code:: console",
|
|
43314
43974
|
"",
|
|
43315
43975
|
" $ n = 2000000",
|
|
43316
43976
|
" $ workDir = \"C:/DolphinDB/Data\"",
|
|
@@ -43325,12 +43985,7 @@
|
|
|
43325
43985
|
" $ db = database(workDir + \"/trade3\",RANGE, 0 5 10 15 20)",
|
|
43326
43986
|
" $ db.loadTextEx(\"trades\",\"price\", workDir + \"/trades.txt\")",
|
|
43327
43987
|
" $ trades = db.loadTable(\"trades\", ,1)",
|
|
43328
|
-
""
|
|
43329
|
-
]
|
|
43330
|
-
},
|
|
43331
|
-
{
|
|
43332
|
-
"type": "text",
|
|
43333
|
-
"value": [
|
|
43988
|
+
"",
|
|
43334
43989
|
"With the in-memory partitioned table, we can execute functions such as :doc:`../u/update!`, :doc:`drop! <../d/dropColumns!>`, :doc:`../r/rename!`, :doc:`../s/sortBy!` etc."
|
|
43335
43990
|
]
|
|
43336
43991
|
}
|
|
@@ -43775,7 +44430,7 @@
|
|
|
43775
44430
|
{
|
|
43776
44431
|
"type": "text",
|
|
43777
44432
|
"value": [
|
|
43778
|
-
"`dbHandle` the distributed database where the imported data will be saved. The database can be either in the
|
|
44433
|
+
"`dbHandle` the distributed database where the imported data will be saved. The database can be either in the distributed file system or an in-memory database.",
|
|
43779
44434
|
"",
|
|
43780
44435
|
"`tableName` a string indicating the name of the table with the imported data.",
|
|
43781
44436
|
"",
|
|
@@ -43812,7 +44467,7 @@
|
|
|
43812
44467
|
"value": [
|
|
43813
44468
|
"Load a text file into DolphinDB database.",
|
|
43814
44469
|
"",
|
|
43815
|
-
"If *dbHandle* is specified and is not empty string \"\": load a text file to a distributed database
|
|
44470
|
+
"If *dbHandle* is specified and is not empty string \"\": load a text file to a distributed database. The result is a table object with metadata of the table.",
|
|
43816
44471
|
"",
|
|
43817
44472
|
"If *dbHandle* is empty string \"\" or unspecified: load a text file as a partitioned in-memory table. For this usage, when we define *dbHandle* with function ``database``, the parameter directory must also be the empty string \"\" or unspecified.",
|
|
43818
44473
|
"",
|
|
@@ -44712,6 +45367,117 @@
|
|
|
44712
45367
|
}
|
|
44713
45368
|
]
|
|
44714
45369
|
},
|
|
45370
|
+
"lowRange": {
|
|
45371
|
+
"title": "lowRange",
|
|
45372
|
+
"type": "function",
|
|
45373
|
+
"children": [
|
|
45374
|
+
{
|
|
45375
|
+
"title": "Syntax",
|
|
45376
|
+
"type": "grammer",
|
|
45377
|
+
"children": [
|
|
45378
|
+
{
|
|
45379
|
+
"type": "text",
|
|
45380
|
+
"value": [
|
|
45381
|
+
"lowRange(X)"
|
|
45382
|
+
]
|
|
45383
|
+
}
|
|
45384
|
+
]
|
|
45385
|
+
},
|
|
45386
|
+
{
|
|
45387
|
+
"title": "Arguments",
|
|
45388
|
+
"type": "parameters",
|
|
45389
|
+
"children": [
|
|
45390
|
+
{
|
|
45391
|
+
"type": "text",
|
|
45392
|
+
"value": [
|
|
45393
|
+
"`X` is a vector/tuple/matrix/table."
|
|
45394
|
+
]
|
|
45395
|
+
}
|
|
45396
|
+
]
|
|
45397
|
+
},
|
|
45398
|
+
{
|
|
45399
|
+
"title": "Details",
|
|
45400
|
+
"type": "detail",
|
|
45401
|
+
"children": [
|
|
45402
|
+
{
|
|
45403
|
+
"type": "text",
|
|
45404
|
+
"value": [
|
|
45405
|
+
"For each element *Xi* in *X*, count the continuous nearest neighbors to its left that are smaller than *Xi*.",
|
|
45406
|
+
"",
|
|
45407
|
+
"For each element in X, the function return the maximum length of a window to the left of X where it is the max/min. For example, after how many days a stock hits a new high."
|
|
45408
|
+
]
|
|
45409
|
+
}
|
|
45410
|
+
]
|
|
45411
|
+
},
|
|
45412
|
+
{
|
|
45413
|
+
"title": "Examples",
|
|
45414
|
+
"type": "example",
|
|
45415
|
+
"children": [
|
|
45416
|
+
{
|
|
45417
|
+
"type": "code",
|
|
45418
|
+
"language": "console",
|
|
45419
|
+
"value": [
|
|
45420
|
+
"",
|
|
45421
|
+
" $ lowRange([13.5, 13.6, 13.4, 13.3, 13.5, 13.9, 13.1, 20.1, 20.2, 20.3])",
|
|
45422
|
+
" [0,0,2,3,0,0,6,0,0,0]",
|
|
45423
|
+
"",
|
|
45424
|
+
" $ m = matrix(1.5 2.6 3.2 1.4 2.5 2.2 3.7 2.0, 1.6 2.3 4.2 5.6 4.1 3.2 4.4 6.9)",
|
|
45425
|
+
" $ lowRange(m)",
|
|
45426
|
+
""
|
|
45427
|
+
]
|
|
45428
|
+
},
|
|
45429
|
+
{
|
|
45430
|
+
"type": "text",
|
|
45431
|
+
"value": [
|
|
45432
|
+
"== ==",
|
|
45433
|
+
"#0 #1",
|
|
45434
|
+
"== ==",
|
|
45435
|
+
"0 0 ",
|
|
45436
|
+
"0 0 ",
|
|
45437
|
+
"0 0 ",
|
|
45438
|
+
"3 0 ",
|
|
45439
|
+
"0 2 ",
|
|
45440
|
+
"1 3 ",
|
|
45441
|
+
"0 0 ",
|
|
45442
|
+
"3 0 ",
|
|
45443
|
+
"== ==",
|
|
45444
|
+
""
|
|
45445
|
+
]
|
|
45446
|
+
},
|
|
45447
|
+
{
|
|
45448
|
+
"type": "code",
|
|
45449
|
+
"language": "console",
|
|
45450
|
+
"value": [
|
|
45451
|
+
"",
|
|
45452
|
+
" //Simulate the stock price of stock A for 8 days. Use lowRange to calculate after how many days the stock hit a new low",
|
|
45453
|
+
" $ trades = table(take(`A, 8) as sym, 2022.01.01 + 1..8 as date, 39.70 39.72 39.80 39.78 39.83 39.92 40.00 40.03 as price)",
|
|
45454
|
+
" $ select *, lowRange(price) from trades",
|
|
45455
|
+
""
|
|
45456
|
+
]
|
|
45457
|
+
},
|
|
45458
|
+
{
|
|
45459
|
+
"type": "text",
|
|
45460
|
+
"value": [
|
|
45461
|
+
"=== ========== ======== ===============",
|
|
45462
|
+
"id date price lowRange_price",
|
|
45463
|
+
"=== ========== ======== ===============",
|
|
45464
|
+
"A 2022.01.02 39.7 0",
|
|
45465
|
+
"A 2022.01.03 39.72 0",
|
|
45466
|
+
"A 2022.01.04 39.8 0",
|
|
45467
|
+
"A 2022.01.05 39.78 1",
|
|
45468
|
+
"A 2022.01.06 39.83 0",
|
|
45469
|
+
"A 2022.01.07 39.92 0",
|
|
45470
|
+
"A 2022.01.08 40 0",
|
|
45471
|
+
"A 2022.01.09 40.03 0",
|
|
45472
|
+
"=== ========== ======== ===============",
|
|
45473
|
+
"",
|
|
45474
|
+
"Related function: :doc:`../t/topRange`"
|
|
45475
|
+
]
|
|
45476
|
+
}
|
|
45477
|
+
]
|
|
45478
|
+
}
|
|
45479
|
+
]
|
|
45480
|
+
},
|
|
44715
45481
|
"lower": {
|
|
44716
45482
|
"title": "lower",
|
|
44717
45483
|
"type": "function",
|
|
@@ -49025,6 +49791,75 @@
|
|
|
49025
49791
|
}
|
|
49026
49792
|
]
|
|
49027
49793
|
},
|
|
49794
|
+
"mmaxPositiveStreak": {
|
|
49795
|
+
"title": "mmaxPositiveStreak",
|
|
49796
|
+
"type": "function",
|
|
49797
|
+
"children": [
|
|
49798
|
+
{
|
|
49799
|
+
"title": "Syntax",
|
|
49800
|
+
"type": "grammer",
|
|
49801
|
+
"children": [
|
|
49802
|
+
{
|
|
49803
|
+
"type": "text",
|
|
49804
|
+
"value": [
|
|
49805
|
+
"mmaxPositiveStreak(X, window)"
|
|
49806
|
+
]
|
|
49807
|
+
}
|
|
49808
|
+
]
|
|
49809
|
+
},
|
|
49810
|
+
{
|
|
49811
|
+
"title": "Arguments",
|
|
49812
|
+
"type": "parameters",
|
|
49813
|
+
"children": [
|
|
49814
|
+
{
|
|
49815
|
+
"type": "text",
|
|
49816
|
+
"value": [
|
|
49817
|
+
"`X` is a vector/matrix.",
|
|
49818
|
+
"",
|
|
49819
|
+
"`window` is a positive integer, indicating the size of the sliding window."
|
|
49820
|
+
]
|
|
49821
|
+
}
|
|
49822
|
+
]
|
|
49823
|
+
},
|
|
49824
|
+
{
|
|
49825
|
+
"title": "Details",
|
|
49826
|
+
"type": "detail",
|
|
49827
|
+
"children": [
|
|
49828
|
+
{
|
|
49829
|
+
"type": "text",
|
|
49830
|
+
"value": [
|
|
49831
|
+
"Obtain the maximum value of the sum of consecutive positive numbers in X within a sliding window of given size (based on the number of elements)."
|
|
49832
|
+
]
|
|
49833
|
+
}
|
|
49834
|
+
]
|
|
49835
|
+
},
|
|
49836
|
+
{
|
|
49837
|
+
"title": "例子",
|
|
49838
|
+
"children": [
|
|
49839
|
+
{
|
|
49840
|
+
"type": "code",
|
|
49841
|
+
"language": "console",
|
|
49842
|
+
"value": [
|
|
49843
|
+
"",
|
|
49844
|
+
" $ x = 1 -1 1 -2 10 3 3 9 0 6 5",
|
|
49845
|
+
" $ w = 5",
|
|
49846
|
+
" $ mmaxPositiveStreak(x, w)",
|
|
49847
|
+
" [,,,,10,13,16,25,25,15,12]",
|
|
49848
|
+
"",
|
|
49849
|
+
" $ x = 5 NULL 3 2 1 5 10 9 NULL 9 10 -1 NULL ",
|
|
49850
|
+
" $ w = 5",
|
|
49851
|
+
" $ mmaxPositiveStreak(x, w)",
|
|
49852
|
+
" [,,,,6,11,21,27,25,24,19,19,19]",
|
|
49853
|
+
"",
|
|
49854
|
+
" // use the signum function to count the maximum number of consecutive positive numbers",
|
|
49855
|
+
" $ mmaxPositiveStreak(signum(x), w)",
|
|
49856
|
+
" [,,,,3,4,5,5,4,3,2,2,2]"
|
|
49857
|
+
]
|
|
49858
|
+
}
|
|
49859
|
+
]
|
|
49860
|
+
}
|
|
49861
|
+
]
|
|
49862
|
+
},
|
|
49028
49863
|
"mmed": {
|
|
49029
49864
|
"title": "mmed",
|
|
49030
49865
|
"type": "function",
|
|
@@ -52801,6 +53636,91 @@
|
|
|
52801
53636
|
}
|
|
52802
53637
|
]
|
|
52803
53638
|
},
|
|
53639
|
+
"nextState": {
|
|
53640
|
+
"title": "nextState",
|
|
53641
|
+
"type": "function",
|
|
53642
|
+
"children": [
|
|
53643
|
+
{
|
|
53644
|
+
"title": "Syntax",
|
|
53645
|
+
"type": "grammer",
|
|
53646
|
+
"children": [
|
|
53647
|
+
{
|
|
53648
|
+
"type": "text",
|
|
53649
|
+
"value": [
|
|
53650
|
+
"nextState(X)"
|
|
53651
|
+
]
|
|
53652
|
+
}
|
|
53653
|
+
]
|
|
53654
|
+
},
|
|
53655
|
+
{
|
|
53656
|
+
"title": "Arguments",
|
|
53657
|
+
"type": "parameters",
|
|
53658
|
+
"children": [
|
|
53659
|
+
{
|
|
53660
|
+
"type": "text",
|
|
53661
|
+
"value": [
|
|
53662
|
+
"`X` is a vector or matrix of temporal/Boolean/numeric type."
|
|
53663
|
+
]
|
|
53664
|
+
}
|
|
53665
|
+
]
|
|
53666
|
+
},
|
|
53667
|
+
{
|
|
53668
|
+
"title": "Details",
|
|
53669
|
+
"type": "detail",
|
|
53670
|
+
"children": [
|
|
53671
|
+
{
|
|
53672
|
+
"type": "text",
|
|
53673
|
+
"value": [
|
|
53674
|
+
"Consecutive elements in *X* with the same value feature the same state, and a NULL value has no state. The state of each element is equal to its value. Return the next state of the current state for each element in X. If it is NULL, return the next adjacent state.",
|
|
53675
|
+
"",
|
|
53676
|
+
"If *X* is a matrix, return the next state for each column of the matrix."
|
|
53677
|
+
]
|
|
53678
|
+
}
|
|
53679
|
+
]
|
|
53680
|
+
},
|
|
53681
|
+
{
|
|
53682
|
+
"title": "Examples",
|
|
53683
|
+
"type": "example",
|
|
53684
|
+
"children": [
|
|
53685
|
+
{
|
|
53686
|
+
"type": "code",
|
|
53687
|
+
"language": "console",
|
|
53688
|
+
"value": [
|
|
53689
|
+
"",
|
|
53690
|
+
" $ X = [1, 2.2, NULL, 2.2, 2.3, 1, 1.2]",
|
|
53691
|
+
" $ next(X)",
|
|
53692
|
+
" [2.2,,2.2,2.3,1,1.2,]",
|
|
53693
|
+
" ",
|
|
53694
|
+
" $ nextState(X)",
|
|
53695
|
+
" [2.2,2.2,2.2,2.3,1,1.2,]",
|
|
53696
|
+
"",
|
|
53697
|
+
" $ X = matrix([1.0, 1.1, 1.0, 0.9], [NULL, 1.3, 2.5, 5.5], [5.5, 4.2, 1.6, 1.8])",
|
|
53698
|
+
" $ nextState(X)",
|
|
53699
|
+
""
|
|
53700
|
+
]
|
|
53701
|
+
},
|
|
53702
|
+
{
|
|
53703
|
+
"type": "text",
|
|
53704
|
+
"value": [
|
|
53705
|
+
"+---+---+---+",
|
|
53706
|
+
"|#0 |#1 |#2 |",
|
|
53707
|
+
"+===+===+===+",
|
|
53708
|
+
"|1.1|1.3|4.2|",
|
|
53709
|
+
"+---+---+---+",
|
|
53710
|
+
"|1 |2.5|1.6| ",
|
|
53711
|
+
"+---+---+---+ ",
|
|
53712
|
+
"|0.9|5.5|1.8|",
|
|
53713
|
+
"+---+---+---+",
|
|
53714
|
+
"| | | |",
|
|
53715
|
+
"+---+---+---+",
|
|
53716
|
+
"",
|
|
53717
|
+
"Related function: :doc:`../p/prevState`"
|
|
53718
|
+
]
|
|
53719
|
+
}
|
|
53720
|
+
]
|
|
53721
|
+
}
|
|
53722
|
+
]
|
|
53723
|
+
},
|
|
52804
53724
|
"norm": {
|
|
52805
53725
|
"title": "norm",
|
|
52806
53726
|
"type": "function",
|
|
@@ -53674,7 +54594,10 @@
|
|
|
53674
54594
|
{
|
|
53675
54595
|
"type": "text",
|
|
53676
54596
|
"value": [
|
|
53677
|
-
"`shared` is Boolean variable.
|
|
54597
|
+
"`shared` is Boolean variable. ",
|
|
54598
|
+
"",
|
|
54599
|
+
"* false (default): return info on all variables in the current session",
|
|
54600
|
+
"* true: return info on all variables in the current session and variables shared by other sessions"
|
|
53678
54601
|
]
|
|
53679
54602
|
}
|
|
53680
54603
|
]
|
|
@@ -53686,7 +54609,26 @@
|
|
|
53686
54609
|
{
|
|
53687
54610
|
"type": "text",
|
|
53688
54611
|
"value": [
|
|
53689
|
-
"
|
|
54612
|
+
"Obtain the information on the variables in memory. Return a table with the following columns:",
|
|
54613
|
+
"",
|
|
54614
|
+
"* name: variable name",
|
|
54615
|
+
"* type: data type",
|
|
54616
|
+
"* form: data form",
|
|
54617
|
+
"* rows:",
|
|
54618
|
+
"",
|
|
54619
|
+
" * If the data form is vector/dictionary/set, return the number of all elements (including NULL values);",
|
|
54620
|
+
" * If the data form is matrix/table, return the number of rows.",
|
|
54621
|
+
"",
|
|
54622
|
+
"* columns:",
|
|
54623
|
+
"",
|
|
54624
|
+
" * If the data form is vector/dictionary/set, return 1;",
|
|
54625
|
+
" * If the data form is matrix/table, return the number of columns.",
|
|
54626
|
+
"",
|
|
54627
|
+
"* bytes: the memory (in bytes) used by the variable",
|
|
54628
|
+
"* shared: whether it is a shared variable",
|
|
54629
|
+
"* extra: the logical path to the DFS table, in the format of “dfs://dbName/tableName”",
|
|
54630
|
+
"",
|
|
54631
|
+
"Please note that the function does not return the function definitions. You can use defs to check function definitions, or :doc:`../m/memSize` for the memory usage. "
|
|
53690
54632
|
]
|
|
53691
54633
|
}
|
|
53692
54634
|
]
|
|
@@ -53700,19 +54642,39 @@
|
|
|
53700
54642
|
"language": "console",
|
|
53701
54643
|
"value": [
|
|
53702
54644
|
"",
|
|
53703
|
-
"
|
|
53704
|
-
""
|
|
53705
|
-
|
|
53706
|
-
|
|
53707
|
-
|
|
53708
|
-
|
|
53709
|
-
|
|
53710
|
-
"
|
|
53711
|
-
"
|
|
53712
|
-
"
|
|
53713
|
-
"t
|
|
53714
|
-
"
|
|
54645
|
+
" //create a DFS database",
|
|
54646
|
+
" $ if(existsDatabase(\"dfs://listdb\")){",
|
|
54647
|
+
" $ dropDatabase(\"dfs://listdb\")",
|
|
54648
|
+
" $ }",
|
|
54649
|
+
" $ n=1000000",
|
|
54650
|
+
" $ ticker = rand(`MSFT`GOOG`FB`ORCL`IBM,n);",
|
|
54651
|
+
" $ ticker[0..5]",
|
|
54652
|
+
" $ x=rand(1.0, n)",
|
|
54653
|
+
" $ t=table(ticker, x)",
|
|
54654
|
+
" $ db=database(directory=\"dfs://listdb\", partitionType=HASH, partitionScheme=[STRING, 5])",
|
|
54655
|
+
" $ pt=db.createPartitionedTable(t, `pt, `ticker)",
|
|
54656
|
+
" $ pt.append!(t)",
|
|
54657
|
+
"",
|
|
54658
|
+
" // shared in-memory table",
|
|
54659
|
+
" $ time = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);",
|
|
54660
|
+
" $ id = 0..39;",
|
|
54661
|
+
" $ value = rand(100, 40);",
|
|
54662
|
+
" $ tmp = table(time, id, value);",
|
|
54663
|
+
" $ share tmp as st",
|
|
53715
54664
|
"",
|
|
54665
|
+
" // create set",
|
|
54666
|
+
" $ s = set([1,2,3,4,5])",
|
|
54667
|
+
"",
|
|
54668
|
+
" // create dict",
|
|
54669
|
+
" $ x=1 2 3",
|
|
54670
|
+
" $ y=4.5 7.8 4.3",
|
|
54671
|
+
" $ z=dict(x,y);",
|
|
54672
|
+
"",
|
|
54673
|
+
" // create matrix",
|
|
54674
|
+
" $ m = matrix(1 2 3, 4 5 6)",
|
|
54675
|
+
"",
|
|
54676
|
+
" // create pair",
|
|
54677
|
+
" $ p = 1:2",
|
|
53716
54678
|
""
|
|
53717
54679
|
]
|
|
53718
54680
|
},
|
|
@@ -53721,21 +54683,33 @@
|
|
|
53721
54683
|
"language": "console",
|
|
53722
54684
|
"value": [
|
|
53723
54685
|
"",
|
|
53724
|
-
" $
|
|
53725
|
-
" $ objs(true);",
|
|
54686
|
+
" $ objs(true)",
|
|
53726
54687
|
""
|
|
53727
54688
|
]
|
|
53728
54689
|
},
|
|
53729
54690
|
{
|
|
53730
54691
|
"type": "text",
|
|
53731
54692
|
"value": [
|
|
53732
|
-
"
|
|
53733
|
-
"
|
|
53734
|
-
"
|
|
53735
|
-
"
|
|
53736
|
-
"
|
|
53737
|
-
"
|
|
53738
|
-
"
|
|
54693
|
+
"======= ======== ============ ========== ======= ========== ======= =================",
|
|
54694
|
+
"name type form rows columns bytes shared extra",
|
|
54695
|
+
"======= ======== ============ ========== ======= ========== ======= =================",
|
|
54696
|
+
"n INT SCALAR 1 1 16 false ",
|
|
54697
|
+
"ticker SYMBOL VECTOR 1,000,000 1 4,000,000 false ",
|
|
54698
|
+
"x INT VECTOR 3 1 12 false ",
|
|
54699
|
+
"t BASIC TABLE 1,000,000 2 12,000,312 false ",
|
|
54700
|
+
"db HANDLE SCALAR 1 1 24 false ",
|
|
54701
|
+
"pt ALIAS TABLE 0 2 12,000,000 false dfs://listdb/pt",
|
|
54702
|
+
"time DATETIME VECTOR 40 1 160 false ",
|
|
54703
|
+
"id INT VECTOR 40 1 160 false ",
|
|
54704
|
+
"value INT VECTOR 40 1 160 false ",
|
|
54705
|
+
"tmp BASIC TABLE 40 3 832 false ",
|
|
54706
|
+
"s INT SET 5 1 28 false ",
|
|
54707
|
+
"y DOUBLE VECTOR 3 1 24 false ",
|
|
54708
|
+
"z DOUBLE DICTIONARY 3 1 199 false ",
|
|
54709
|
+
"m INT MATRIX 3 2 24 false ",
|
|
54710
|
+
"p INT PAIR 2 1 8 false ",
|
|
54711
|
+
"st BASIC TABLE 40 3 832 true",
|
|
54712
|
+
"======= ======== ============ ========== ======= ========== ======= ================="
|
|
53739
54713
|
]
|
|
53740
54714
|
}
|
|
53741
54715
|
]
|
|
@@ -54047,33 +55021,52 @@
|
|
|
54047
55021
|
"language": "console",
|
|
54048
55022
|
"value": [
|
|
54049
55023
|
"",
|
|
54050
|
-
" $
|
|
54051
|
-
" $
|
|
54052
|
-
" $
|
|
54053
|
-
" $
|
|
54054
|
-
" $
|
|
54055
|
-
"",
|
|
54056
|
-
"
|
|
54057
|
-
"
|
|
54058
|
-
"
|
|
54059
|
-
"
|
|
54060
|
-
"
|
|
54061
|
-
"
|
|
55024
|
+
" $ n=10000",
|
|
55025
|
+
" $ ID=rand(100, n)",
|
|
55026
|
+
" $ dates=2017.08.07..2017.08.11",
|
|
55027
|
+
" $ date=rand(dates, n)",
|
|
55028
|
+
" $ vol=rand(1..10 join int(), n)",
|
|
55029
|
+
" $ price=rand(100,n)",
|
|
55030
|
+
" $ t=table(ID, date, vol,price)",
|
|
55031
|
+
" $ saveText(t, \"D:/DolphinDB/Data/t.txt\");",
|
|
55032
|
+
" $ if(existsDatabase(\"dfs://rangedb\")){",
|
|
55033
|
+
" $ \tdropDatabase(\"dfs://rangedb\")",
|
|
55034
|
+
" $ }",
|
|
55035
|
+
" $ db = database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 51 101)",
|
|
55036
|
+
" $ USPrices=loadTextEx(dbHandle=db,tableName=`USPrices, partitionColumns=`ID, filename=\"D:/DolphinDB/Data/t.txt\");",
|
|
54062
55037
|
"",
|
|
55038
|
+
" $ ds=sqlDS(<select vol as VS, price as SBA from USPrices where vol>5>)",
|
|
55039
|
+
" $ rs=olsEx(ds, `VS, `SBA, true, 2)",
|
|
55040
|
+
" $ rs;",
|
|
55041
|
+
" ",
|
|
54063
55042
|
" RegressionStat->",
|
|
54064
55043
|
" item statistics",
|
|
54065
|
-
" ------------
|
|
54066
|
-
" R2 0.
|
|
54067
|
-
" AdjustedR2 0.
|
|
54068
|
-
" StdError
|
|
54069
|
-
" Observations
|
|
55044
|
+
" ------------ ----------",
|
|
55045
|
+
" R2 0.000848 ",
|
|
55046
|
+
" AdjustedR2 0.000628 ",
|
|
55047
|
+
" StdError 1.404645 ",
|
|
55048
|
+
" Observations 4535 ",
|
|
55049
|
+
"",
|
|
55050
|
+
" ANOVA->",
|
|
55051
|
+
" Breakdown DF SS MS F Significance",
|
|
55052
|
+
" ---------- ---- ----------- -------- -------- ------------",
|
|
55053
|
+
" Regression 1 7.592565 7.592565 3.848178 0.049861 ",
|
|
55054
|
+
" Residual 4533 8943.739298 1.973029 ",
|
|
55055
|
+
" Total 4534 8951.331863 ",
|
|
54070
55056
|
"",
|
|
54071
55057
|
" Coefficient->",
|
|
54072
|
-
" factor beta
|
|
54073
|
-
" ---------
|
|
54074
|
-
" intercept
|
|
54075
|
-
"
|
|
54076
|
-
"
|
|
55058
|
+
" factor beta stdError tstat pvalue ",
|
|
55059
|
+
" --------- -------- -------- ---------- --------",
|
|
55060
|
+
" intercept 7.953084 0.04185 190.039423 0 ",
|
|
55061
|
+
" SBA 0.001422 0.000725 1.961677 0.049861",
|
|
55062
|
+
""
|
|
55063
|
+
]
|
|
55064
|
+
},
|
|
55065
|
+
{
|
|
55066
|
+
"type": "text",
|
|
55067
|
+
"value": [
|
|
55068
|
+
".. meta::",
|
|
55069
|
+
" :keywords: ols"
|
|
54077
55070
|
]
|
|
54078
55071
|
}
|
|
54079
55072
|
]
|
|
@@ -55332,7 +56325,7 @@
|
|
|
55332
56325
|
{
|
|
55333
56326
|
"type": "text",
|
|
55334
56327
|
"value": [
|
|
55335
|
-
"ploadText(filename, [delimiter], [schema], [skipRows=0])"
|
|
56328
|
+
"ploadText(filename, [delimiter], [schema], [skipRows=0], [arrayDelimiter])"
|
|
55336
56329
|
]
|
|
55337
56330
|
}
|
|
55338
56331
|
]
|
|
@@ -56426,6 +57419,92 @@
|
|
|
56426
57419
|
}
|
|
56427
57420
|
]
|
|
56428
57421
|
},
|
|
57422
|
+
"prevState": {
|
|
57423
|
+
"title": "prevState",
|
|
57424
|
+
"type": "function",
|
|
57425
|
+
"children": [
|
|
57426
|
+
{
|
|
57427
|
+
"title": "Syntax",
|
|
57428
|
+
"type": "grammer",
|
|
57429
|
+
"children": [
|
|
57430
|
+
{
|
|
57431
|
+
"type": "text",
|
|
57432
|
+
"value": [
|
|
57433
|
+
"prevState(X)"
|
|
57434
|
+
]
|
|
57435
|
+
}
|
|
57436
|
+
]
|
|
57437
|
+
},
|
|
57438
|
+
{
|
|
57439
|
+
"title": "Arguments",
|
|
57440
|
+
"type": "parameters",
|
|
57441
|
+
"children": [
|
|
57442
|
+
{
|
|
57443
|
+
"type": "text",
|
|
57444
|
+
"value": [
|
|
57445
|
+
"`X` is a vector or matrix of temporal/Boolean/numeric type."
|
|
57446
|
+
]
|
|
57447
|
+
}
|
|
57448
|
+
]
|
|
57449
|
+
},
|
|
57450
|
+
{
|
|
57451
|
+
"title": "Details",
|
|
57452
|
+
"type": "detail",
|
|
57453
|
+
"children": [
|
|
57454
|
+
{
|
|
57455
|
+
"type": "text",
|
|
57456
|
+
"value": [
|
|
57457
|
+
"Consecutive elements in *X* with the same value feature the same state, and a NULL value has no state. The state of each element refers to its value. Return the previous state of the current element. If it is NULL, return the previous adjacent state.",
|
|
57458
|
+
"",
|
|
57459
|
+
"If *X* is a matrix, return the previous state for each column of the matrix."
|
|
57460
|
+
]
|
|
57461
|
+
}
|
|
57462
|
+
]
|
|
57463
|
+
},
|
|
57464
|
+
{
|
|
57465
|
+
"title": "Examples",
|
|
57466
|
+
"type": "example",
|
|
57467
|
+
"children": [
|
|
57468
|
+
{
|
|
57469
|
+
"type": "code",
|
|
57470
|
+
"language": "console",
|
|
57471
|
+
"value": [
|
|
57472
|
+
"",
|
|
57473
|
+
" $ X = [1, 2.2, NULL, 2.2, 2.3, 1, 1.2]",
|
|
57474
|
+
" $ prev(X)",
|
|
57475
|
+
" [,1,2.2,,2.2,2.3,1]",
|
|
57476
|
+
" ",
|
|
57477
|
+
" $ prevState(X)",
|
|
57478
|
+
" [,1,2.2,2.2,2.2,2.3,1]",
|
|
57479
|
+
"",
|
|
57480
|
+
" $ X = matrix([1.0, 1.1, 1.0, 0.9], [NULL, 1.3, 2.5, 5.5], [5.5, 4.2, 1.6, 1.8])",
|
|
57481
|
+
" $ prevState(X)",
|
|
57482
|
+
""
|
|
57483
|
+
]
|
|
57484
|
+
},
|
|
57485
|
+
{
|
|
57486
|
+
"type": "text",
|
|
57487
|
+
"value": [
|
|
57488
|
+
"+---+---+---+",
|
|
57489
|
+
"|#0 |#1 |#2 |",
|
|
57490
|
+
"+===+===+===+",
|
|
57491
|
+
"| | | |",
|
|
57492
|
+
"+---+---+---+",
|
|
57493
|
+
"|1 | |5.5|",
|
|
57494
|
+
"+---+---+---+",
|
|
57495
|
+
"|1.1|1.3|4.2|",
|
|
57496
|
+
"+---+---+---+",
|
|
57497
|
+
"|1 |2.5|1.6|",
|
|
57498
|
+
"+---+---+---+ ",
|
|
57499
|
+
"",
|
|
57500
|
+
"",
|
|
57501
|
+
"Related function: :doc:`../n/nextState`"
|
|
57502
|
+
]
|
|
57503
|
+
}
|
|
57504
|
+
]
|
|
57505
|
+
}
|
|
57506
|
+
]
|
|
57507
|
+
},
|
|
56429
57508
|
"print": {
|
|
56430
57509
|
"title": "print",
|
|
56431
57510
|
"type": "command",
|
|
@@ -66563,97 +67642,6 @@
|
|
|
66563
67642
|
}
|
|
66564
67643
|
]
|
|
66565
67644
|
},
|
|
66566
|
-
"sample": {
|
|
66567
|
-
"title": "sample",
|
|
66568
|
-
"type": "function",
|
|
66569
|
-
"children": [
|
|
66570
|
-
{
|
|
66571
|
-
"title": "Syntax",
|
|
66572
|
-
"type": "grammer",
|
|
66573
|
-
"children": [
|
|
66574
|
-
{
|
|
66575
|
-
"type": "text",
|
|
66576
|
-
"value": [
|
|
66577
|
-
"sample(partitionCol, size)"
|
|
66578
|
-
]
|
|
66579
|
-
}
|
|
66580
|
-
]
|
|
66581
|
-
},
|
|
66582
|
-
{
|
|
66583
|
-
"title": "Arguments",
|
|
66584
|
-
"type": "parameters",
|
|
66585
|
-
"children": [
|
|
66586
|
-
{
|
|
66587
|
-
"type": "text",
|
|
66588
|
-
"value": [
|
|
66589
|
-
"`partitionCol` is a partitioning column. ",
|
|
66590
|
-
"",
|
|
66591
|
-
"`size` is a positive floating number or integer. "
|
|
66592
|
-
]
|
|
66593
|
-
}
|
|
66594
|
-
]
|
|
66595
|
-
},
|
|
66596
|
-
{
|
|
66597
|
-
"title": "Details",
|
|
66598
|
-
"type": "detail",
|
|
66599
|
-
"children": [
|
|
66600
|
-
{
|
|
66601
|
-
"type": "text",
|
|
66602
|
-
"value": [
|
|
66603
|
-
"Must be used in a ``where`` clause. Take a random sample of a number of partitions in a partitioned table. ",
|
|
66604
|
-
"",
|
|
66605
|
-
"Suppose the database has N partitions. If 0<size<1, then take int(N*size) partitions. If size is a positive integer, then take size partitions.",
|
|
66606
|
-
""
|
|
66607
|
-
]
|
|
66608
|
-
}
|
|
66609
|
-
]
|
|
66610
|
-
},
|
|
66611
|
-
{
|
|
66612
|
-
"title": "Examples",
|
|
66613
|
-
"type": "example",
|
|
66614
|
-
"children": [
|
|
66615
|
-
{
|
|
66616
|
-
"type": "code",
|
|
66617
|
-
"language": "console",
|
|
66618
|
-
"value": [
|
|
66619
|
-
""
|
|
66620
|
-
]
|
|
66621
|
-
},
|
|
66622
|
-
{
|
|
66623
|
-
"type": "text",
|
|
66624
|
-
"value": [
|
|
66625
|
-
" $ n=1000000",
|
|
66626
|
-
" $ ID=rand(50, n)",
|
|
66627
|
-
" $ x=rand(1.0, n)",
|
|
66628
|
-
" $ t=table(ID, x)",
|
|
66629
|
-
" $ db=database(\"C:/DolphinDB/Data/rangedb1\", RANGE, $ 0 10 20 30 40 50)",
|
|
66630
|
-
" $ pt = db.createPartitionedTable(t, `pt, `ID)",
|
|
66631
|
-
" $ pt.append!(t)",
|
|
66632
|
-
" $ pt=loadTable(db,`pt);",
|
|
66633
|
-
"",
|
|
66634
|
-
"Table pt has 5 partitions. To take a random sample of 2 partitions, we can use either of the following queries:",
|
|
66635
|
-
""
|
|
66636
|
-
]
|
|
66637
|
-
},
|
|
66638
|
-
{
|
|
66639
|
-
"type": "code",
|
|
66640
|
-
"language": "console",
|
|
66641
|
-
"value": [
|
|
66642
|
-
""
|
|
66643
|
-
]
|
|
66644
|
-
},
|
|
66645
|
-
{
|
|
66646
|
-
"type": "text",
|
|
66647
|
-
"value": [
|
|
66648
|
-
" $ x = select * from pt where sample(ID, 0.4);",
|
|
66649
|
-
"",
|
|
66650
|
-
" $ x = select * from pt where sample(ID, 2);"
|
|
66651
|
-
]
|
|
66652
|
-
}
|
|
66653
|
-
]
|
|
66654
|
-
}
|
|
66655
|
-
]
|
|
66656
|
-
},
|
|
66657
67645
|
"saveAsNpy": {
|
|
66658
67646
|
"title": "saveAsNpy",
|
|
66659
67647
|
"type": "command",
|
|
@@ -67067,7 +68055,7 @@
|
|
|
67067
68055
|
{
|
|
67068
68056
|
"type": "text",
|
|
67069
68057
|
"value": [
|
|
67070
|
-
"Save a table as a partitioned table.
|
|
68058
|
+
"Save a table as a partitioned DFS table. An empty table must be created with the function :doc:`../../FunctionReferences/c/createPartitionedTable`."
|
|
67071
68059
|
]
|
|
67072
68060
|
}
|
|
67073
68061
|
]
|
|
@@ -67086,13 +68074,13 @@
|
|
|
67086
68074
|
" $ value=rand(1.0, n)",
|
|
67087
68075
|
" $ t=table(ID, value);",
|
|
67088
68076
|
"",
|
|
67089
|
-
" $ db=database(\"
|
|
68077
|
+
" $ db=database(\"dfs://rangedb_Trades\", RANGE, 0 5 10)",
|
|
67090
68078
|
" $ Trades = db.createPartitionedTable(t, \"Trades\", \"ID\");",
|
|
67091
68079
|
" $ savePartition(db, t, `Trades)",
|
|
67092
68080
|
"",
|
|
67093
68081
|
" $ Trades=loadTable(db, `Trades)",
|
|
67094
68082
|
" $ select count(value) from Trades;",
|
|
67095
|
-
"
|
|
68083
|
+
" 1,000,000",
|
|
67096
68084
|
""
|
|
67097
68085
|
]
|
|
67098
68086
|
},
|
|
@@ -67117,7 +68105,7 @@
|
|
|
67117
68105
|
" $ savePartition(db, t1, `Trades)",
|
|
67118
68106
|
" $ Trades=loadTable(db, `Trades)",
|
|
67119
68107
|
" $ select count(value) from Trades;",
|
|
67120
|
-
"
|
|
68108
|
+
" 1,500,000"
|
|
67121
68109
|
]
|
|
67122
68110
|
}
|
|
67123
68111
|
]
|
|
@@ -67167,7 +68155,9 @@
|
|
|
67167
68155
|
{
|
|
67168
68156
|
"type": "text",
|
|
67169
68157
|
"value": [
|
|
67170
|
-
"Save a table to an unpartitioned
|
|
68158
|
+
"Save a table to an unpartitioned disk table. To save a table to a partitioned database, use :doc:`../../FunctionReferences/c/createPartitionedTable` together with :doc:`../../FunctionReferences/a/append!` or :doc:`../../FunctionReferences/t/tableInsert`.",
|
|
68159
|
+
"",
|
|
68160
|
+
"Note: Disk tables are only used for backup or local computing. Unlike the DFS tables, disk tables do not support access control."
|
|
67171
68161
|
]
|
|
67172
68162
|
}
|
|
67173
68163
|
]
|
|
@@ -67230,7 +68220,7 @@
|
|
|
67230
68220
|
"language": "console",
|
|
67231
68221
|
"value": [
|
|
67232
68222
|
"",
|
|
67233
|
-
" $ saveTable(db, t, `t2,
|
|
68223
|
+
" $ saveTable(db, t, `t2, true);",
|
|
67234
68224
|
""
|
|
67235
68225
|
]
|
|
67236
68226
|
},
|
|
@@ -67246,7 +68236,15 @@
|
|
|
67246
68236
|
"language": "console",
|
|
67247
68237
|
"value": [
|
|
67248
68238
|
"",
|
|
67249
|
-
" $ saveTable(db, t, `t3,
|
|
68239
|
+
" $ saveTable(db, t, `t3, false, true);",
|
|
68240
|
+
""
|
|
68241
|
+
]
|
|
68242
|
+
},
|
|
68243
|
+
{
|
|
68244
|
+
"type": "text",
|
|
68245
|
+
"value": [
|
|
68246
|
+
".. meta:: ",
|
|
68247
|
+
" :keywords: disk table"
|
|
67250
68248
|
]
|
|
67251
68249
|
}
|
|
67252
68250
|
]
|
|
@@ -69300,6 +70298,50 @@
|
|
|
69300
70298
|
}
|
|
69301
70299
|
]
|
|
69302
70300
|
},
|
|
70301
|
+
"setLogLevel": {
|
|
70302
|
+
"title": "setLogLevel",
|
|
70303
|
+
"type": "command",
|
|
70304
|
+
"children": [
|
|
70305
|
+
{
|
|
70306
|
+
"title": "Syntax",
|
|
70307
|
+
"type": "grammer",
|
|
70308
|
+
"children": [
|
|
70309
|
+
{
|
|
70310
|
+
"type": "text",
|
|
70311
|
+
"value": [
|
|
70312
|
+
"setLogLevel(logLevel)"
|
|
70313
|
+
]
|
|
70314
|
+
}
|
|
70315
|
+
]
|
|
70316
|
+
},
|
|
70317
|
+
{
|
|
70318
|
+
"title": "Arguments",
|
|
70319
|
+
"type": "parameters",
|
|
70320
|
+
"children": [
|
|
70321
|
+
{
|
|
70322
|
+
"type": "text",
|
|
70323
|
+
"value": [
|
|
70324
|
+
"`logLevel` the log level. The optional values from low to high are: DEBUG, INFO, WARNING, and ERROR."
|
|
70325
|
+
]
|
|
70326
|
+
}
|
|
70327
|
+
]
|
|
70328
|
+
},
|
|
70329
|
+
{
|
|
70330
|
+
"title": "Details",
|
|
70331
|
+
"type": "detail",
|
|
70332
|
+
"children": [
|
|
70333
|
+
{
|
|
70334
|
+
"type": "text",
|
|
70335
|
+
"value": [
|
|
70336
|
+
"Set the log level on the current node online. After setting the log level, only logs at and above the specified *logLevel* are printed.",
|
|
70337
|
+
"",
|
|
70338
|
+
"The command can only be executed by an administrator."
|
|
70339
|
+
]
|
|
70340
|
+
}
|
|
70341
|
+
]
|
|
70342
|
+
}
|
|
70343
|
+
]
|
|
70344
|
+
},
|
|
69303
70345
|
"setMaxBlockSizeForReservedMemory": {
|
|
69304
70346
|
"title": "setMaxBlockSizeForReservedMemory",
|
|
69305
70347
|
"type": "command",
|
|
@@ -69548,6 +70590,98 @@
|
|
|
69548
70590
|
}
|
|
69549
70591
|
]
|
|
69550
70592
|
},
|
|
70593
|
+
"setMemLimitOfQueryResult": {
|
|
70594
|
+
"title": "setMemLimitOfQueryResult",
|
|
70595
|
+
"type": "command",
|
|
70596
|
+
"children": [
|
|
70597
|
+
{
|
|
70598
|
+
"title": "Syntax",
|
|
70599
|
+
"type": "grammer",
|
|
70600
|
+
"children": [
|
|
70601
|
+
{
|
|
70602
|
+
"type": "text",
|
|
70603
|
+
"value": [
|
|
70604
|
+
"setMemLimitOfQueryResult(memLimit)"
|
|
70605
|
+
]
|
|
70606
|
+
}
|
|
70607
|
+
]
|
|
70608
|
+
},
|
|
70609
|
+
{
|
|
70610
|
+
"title": "Arguments",
|
|
70611
|
+
"type": "parameters",
|
|
70612
|
+
"children": [
|
|
70613
|
+
{
|
|
70614
|
+
"type": "text",
|
|
70615
|
+
"value": [
|
|
70616
|
+
"`memLimit` is a numeric scalar, indicating the memory limit (in GB). It must be smaller than smaller than 80% * maxMemSize."
|
|
70617
|
+
]
|
|
70618
|
+
}
|
|
70619
|
+
]
|
|
70620
|
+
},
|
|
70621
|
+
{
|
|
70622
|
+
"title": "Details",
|
|
70623
|
+
"type": "detail",
|
|
70624
|
+
"children": [
|
|
70625
|
+
{
|
|
70626
|
+
"type": "text",
|
|
70627
|
+
"value": [
|
|
70628
|
+
"Set the memory limit for the result of each query online. This command can only be executed by an administrator on a data node or compute node.",
|
|
70629
|
+
"",
|
|
70630
|
+
"Note: The modified configuration will expire after the cluster is rebooted. To make it permanent, please specify the configuration parameter *memLimitOfQueryResult*.",
|
|
70631
|
+
"",
|
|
70632
|
+
"Related function: :doc:`/FunctionsandCommands/FunctionReferences/g/getMemLimitOfQueryResult`"
|
|
70633
|
+
]
|
|
70634
|
+
}
|
|
70635
|
+
]
|
|
70636
|
+
}
|
|
70637
|
+
]
|
|
70638
|
+
},
|
|
70639
|
+
"setMemLimitOfTaskGroupResult": {
|
|
70640
|
+
"title": "setMemLimitOfTaskGroupResult",
|
|
70641
|
+
"type": "command",
|
|
70642
|
+
"children": [
|
|
70643
|
+
{
|
|
70644
|
+
"title": "Syntax",
|
|
70645
|
+
"type": "grammer",
|
|
70646
|
+
"children": [
|
|
70647
|
+
{
|
|
70648
|
+
"type": "text",
|
|
70649
|
+
"value": [
|
|
70650
|
+
"setMemLimitOfTaskGroupResult(memLimit)"
|
|
70651
|
+
]
|
|
70652
|
+
}
|
|
70653
|
+
]
|
|
70654
|
+
},
|
|
70655
|
+
{
|
|
70656
|
+
"title": "Arguments",
|
|
70657
|
+
"type": "parameters",
|
|
70658
|
+
"children": [
|
|
70659
|
+
{
|
|
70660
|
+
"type": "text",
|
|
70661
|
+
"value": [
|
|
70662
|
+
"`memLimit` is a numeric scalar, indicating the memory limit (in GB)."
|
|
70663
|
+
]
|
|
70664
|
+
}
|
|
70665
|
+
]
|
|
70666
|
+
},
|
|
70667
|
+
{
|
|
70668
|
+
"title": "Details",
|
|
70669
|
+
"type": "detail",
|
|
70670
|
+
"children": [
|
|
70671
|
+
{
|
|
70672
|
+
"type": "text",
|
|
70673
|
+
"value": [
|
|
70674
|
+
"Set the memory limit of a task group sent from the current node online. This command can only be executed by an administrator on a data node or compute node.",
|
|
70675
|
+
"",
|
|
70676
|
+
"Note: The modified configuration will expire after the cluster is rebooted. To make it permanent, please specify the configuration parameter *memLimitOfTaskGroupResult*.",
|
|
70677
|
+
"",
|
|
70678
|
+
"Related function: :doc:`/FunctionsandCommands/FunctionReferences/g/getMemLimitOfTaskGroupResult`"
|
|
70679
|
+
]
|
|
70680
|
+
}
|
|
70681
|
+
]
|
|
70682
|
+
}
|
|
70683
|
+
]
|
|
70684
|
+
},
|
|
69551
70685
|
"setRaftElectionTick": {
|
|
69552
70686
|
"title": "setRaftElectionTick",
|
|
69553
70687
|
"type": "command",
|
|
@@ -73916,6 +75050,79 @@
|
|
|
73916
75050
|
}
|
|
73917
75051
|
]
|
|
73918
75052
|
},
|
|
75053
|
+
"stretch": {
|
|
75054
|
+
"title": "stretch",
|
|
75055
|
+
"type": "function",
|
|
75056
|
+
"children": [
|
|
75057
|
+
{
|
|
75058
|
+
"title": "Syntax",
|
|
75059
|
+
"type": "grammer",
|
|
75060
|
+
"children": [
|
|
75061
|
+
{
|
|
75062
|
+
"type": "text",
|
|
75063
|
+
"value": [
|
|
75064
|
+
"stretch(X, n)"
|
|
75065
|
+
]
|
|
75066
|
+
}
|
|
75067
|
+
]
|
|
75068
|
+
},
|
|
75069
|
+
{
|
|
75070
|
+
"title": "Arguments",
|
|
75071
|
+
"type": "parameters",
|
|
75072
|
+
"children": [
|
|
75073
|
+
{
|
|
75074
|
+
"type": "text",
|
|
75075
|
+
"value": [
|
|
75076
|
+
"`X` is a vector/tuple.",
|
|
75077
|
+
"",
|
|
75078
|
+
"`n` is a non-negative integer."
|
|
75079
|
+
]
|
|
75080
|
+
}
|
|
75081
|
+
]
|
|
75082
|
+
},
|
|
75083
|
+
{
|
|
75084
|
+
"title": "Details",
|
|
75085
|
+
"type": "detail",
|
|
75086
|
+
"children": [
|
|
75087
|
+
{
|
|
75088
|
+
"type": "text",
|
|
75089
|
+
"value": [
|
|
75090
|
+
"Stretch *X* evenly to a new length n.",
|
|
75091
|
+
"",
|
|
75092
|
+
"The difference between ``stretch`` and :doc:`../t/take` lies in:",
|
|
75093
|
+
"",
|
|
75094
|
+
"* ``take`` takes n values iteratively and sequentially from a vector, whereas ``stretch`` copies each element of the vector to stretch the vector to a new length n."
|
|
75095
|
+
]
|
|
75096
|
+
}
|
|
75097
|
+
]
|
|
75098
|
+
},
|
|
75099
|
+
{
|
|
75100
|
+
"title": "Examples",
|
|
75101
|
+
"type": "example",
|
|
75102
|
+
"children": [
|
|
75103
|
+
{
|
|
75104
|
+
"type": "code",
|
|
75105
|
+
"language": "console",
|
|
75106
|
+
"value": [
|
|
75107
|
+
"",
|
|
75108
|
+
" $ X = 1 NULL 2 3",
|
|
75109
|
+
" $ print stretch(X, 11)",
|
|
75110
|
+
" [1,1,1,,,,2,2,3,3]",
|
|
75111
|
+
"",
|
|
75112
|
+
" $ print stretch(X, 11)",
|
|
75113
|
+
" [1,1,1,,,,2,2,2,3,3]",
|
|
75114
|
+
"",
|
|
75115
|
+
" $ print stretch(X, 12)",
|
|
75116
|
+
" [1,1,1,,,,2,2,2,3,3,3]",
|
|
75117
|
+
"",
|
|
75118
|
+
" $ print take(X, 10)",
|
|
75119
|
+
" [1,,2,3,1,,2,3,1,]"
|
|
75120
|
+
]
|
|
75121
|
+
}
|
|
75122
|
+
]
|
|
75123
|
+
}
|
|
75124
|
+
]
|
|
75125
|
+
},
|
|
73919
75126
|
"string": {
|
|
73920
75127
|
"title": "string",
|
|
73921
75128
|
"type": "function",
|
|
@@ -78503,6 +79710,117 @@
|
|
|
78503
79710
|
}
|
|
78504
79711
|
]
|
|
78505
79712
|
},
|
|
79713
|
+
"topRange": {
|
|
79714
|
+
"title": "topRange",
|
|
79715
|
+
"type": "function",
|
|
79716
|
+
"children": [
|
|
79717
|
+
{
|
|
79718
|
+
"title": "Syntax",
|
|
79719
|
+
"type": "grammer",
|
|
79720
|
+
"children": [
|
|
79721
|
+
{
|
|
79722
|
+
"type": "text",
|
|
79723
|
+
"value": [
|
|
79724
|
+
"topRange(X)"
|
|
79725
|
+
]
|
|
79726
|
+
}
|
|
79727
|
+
]
|
|
79728
|
+
},
|
|
79729
|
+
{
|
|
79730
|
+
"title": "Arguments",
|
|
79731
|
+
"type": "parameters",
|
|
79732
|
+
"children": [
|
|
79733
|
+
{
|
|
79734
|
+
"type": "text",
|
|
79735
|
+
"value": [
|
|
79736
|
+
"`X` is a vector/tuple/matrix/table"
|
|
79737
|
+
]
|
|
79738
|
+
}
|
|
79739
|
+
]
|
|
79740
|
+
},
|
|
79741
|
+
{
|
|
79742
|
+
"title": "Details",
|
|
79743
|
+
"type": "detail",
|
|
79744
|
+
"children": [
|
|
79745
|
+
{
|
|
79746
|
+
"type": "text",
|
|
79747
|
+
"value": [
|
|
79748
|
+
"For each element *Xi* in *X*, count the continuous nearest neighbors to its left that are larger than *Xi*.",
|
|
79749
|
+
"",
|
|
79750
|
+
"For each element in X, the function return the maximum length of a window to the left of X where it is the max/min. For example, after how many days a stock hits a new high."
|
|
79751
|
+
]
|
|
79752
|
+
}
|
|
79753
|
+
]
|
|
79754
|
+
},
|
|
79755
|
+
{
|
|
79756
|
+
"title": "Examples",
|
|
79757
|
+
"type": "example",
|
|
79758
|
+
"children": [
|
|
79759
|
+
{
|
|
79760
|
+
"type": "code",
|
|
79761
|
+
"language": "console",
|
|
79762
|
+
"value": [
|
|
79763
|
+
"",
|
|
79764
|
+
" $ topRange([13.5, 13.6, 13.4, 13.3, 13.5, 13.9, 13.1, 20.1, 20.2, 20.3])",
|
|
79765
|
+
" [0,1,0,0,2,5,0,7,8,9]",
|
|
79766
|
+
"",
|
|
79767
|
+
" $ m = matrix(1.5 2.6 3.2 1.4 2.5 2.2 3.7 2.0, 1.6 2.3 4.2 5.6 4.1 3.2 4.4 6.9)",
|
|
79768
|
+
" $ topRange(m)",
|
|
79769
|
+
""
|
|
79770
|
+
]
|
|
79771
|
+
},
|
|
79772
|
+
{
|
|
79773
|
+
"type": "text",
|
|
79774
|
+
"value": [
|
|
79775
|
+
"== ==",
|
|
79776
|
+
"#0 #1",
|
|
79777
|
+
"== ==",
|
|
79778
|
+
"0 0 ",
|
|
79779
|
+
"1 1 ",
|
|
79780
|
+
"2 2 ",
|
|
79781
|
+
"0 3 ",
|
|
79782
|
+
"1 0 ",
|
|
79783
|
+
"0 0 ",
|
|
79784
|
+
"6 2 ",
|
|
79785
|
+
"0 7 ",
|
|
79786
|
+
"== ==",
|
|
79787
|
+
""
|
|
79788
|
+
]
|
|
79789
|
+
},
|
|
79790
|
+
{
|
|
79791
|
+
"type": "code",
|
|
79792
|
+
"language": "console",
|
|
79793
|
+
"value": [
|
|
79794
|
+
"",
|
|
79795
|
+
" //Simulate the stock price of stock A for 8 days. Use topRange to calculate after how many days the stock hit a new high",
|
|
79796
|
+
" $ trades = table(take(`A, 8) as sym, 2022.01.01 + 1..8 as date, 39.70 39.72 39.80 39.78 39.83 39.92 40.00 40.03 as price)",
|
|
79797
|
+
" $ select *, topRange(price) from trades",
|
|
79798
|
+
""
|
|
79799
|
+
]
|
|
79800
|
+
},
|
|
79801
|
+
{
|
|
79802
|
+
"type": "text",
|
|
79803
|
+
"value": [
|
|
79804
|
+
"=== ========== ======== ===============",
|
|
79805
|
+
"id date price topRange_price",
|
|
79806
|
+
"=== ========== ======== ===============",
|
|
79807
|
+
"A 2022.01.02 39.7 0",
|
|
79808
|
+
"A 2022.01.03 39.72 1",
|
|
79809
|
+
"A 2022.01.04 39.8 2",
|
|
79810
|
+
"A 2022.01.05 39.78 0",
|
|
79811
|
+
"A 2022.01.06 39.83 4",
|
|
79812
|
+
"A 2022.01.07 39.92 5",
|
|
79813
|
+
"A 2022.01.08 40 6",
|
|
79814
|
+
"A 2022.01.09 40.03 7",
|
|
79815
|
+
"=== ========== ======== ===============",
|
|
79816
|
+
"",
|
|
79817
|
+
"Related function: :doc:`../l/lowRange`"
|
|
79818
|
+
]
|
|
79819
|
+
}
|
|
79820
|
+
]
|
|
79821
|
+
}
|
|
79822
|
+
]
|
|
79823
|
+
},
|
|
78506
79824
|
"transDS!": {
|
|
78507
79825
|
"title": "transDS!",
|
|
78508
79826
|
"type": "function",
|
|
@@ -81218,6 +82536,138 @@
|
|
|
81218
82536
|
}
|
|
81219
82537
|
]
|
|
81220
82538
|
},
|
|
82539
|
+
"valueChanged": {
|
|
82540
|
+
"title": "valueChanged",
|
|
82541
|
+
"type": "function",
|
|
82542
|
+
"children": [
|
|
82543
|
+
{
|
|
82544
|
+
"title": "Syntax",
|
|
82545
|
+
"type": "grammer",
|
|
82546
|
+
"children": [
|
|
82547
|
+
{
|
|
82548
|
+
"type": "text",
|
|
82549
|
+
"value": [
|
|
82550
|
+
"valueChanged(X, [mode=”prev“])"
|
|
82551
|
+
]
|
|
82552
|
+
}
|
|
82553
|
+
]
|
|
82554
|
+
},
|
|
82555
|
+
{
|
|
82556
|
+
"title": "Arguments",
|
|
82557
|
+
"type": "parameters",
|
|
82558
|
+
"children": [
|
|
82559
|
+
{
|
|
82560
|
+
"type": "text",
|
|
82561
|
+
"value": [
|
|
82562
|
+
"`X` is a vector/matrix/table/tuple of STRING, BOOL, temporal or numeric type.",
|
|
82563
|
+
"",
|
|
82564
|
+
"`mode` is a string. It can take the value of \"prev\", \"next\", \"any\" and \"all\". The default value is \"prev\".",
|
|
82565
|
+
"",
|
|
82566
|
+
"* \"prev\": the previous element",
|
|
82567
|
+
"* \"next\": the next element",
|
|
82568
|
+
"* \"any\": the previous OR the next element",
|
|
82569
|
+
"* \"all\": the previous AND the next element"
|
|
82570
|
+
]
|
|
82571
|
+
}
|
|
82572
|
+
]
|
|
82573
|
+
},
|
|
82574
|
+
{
|
|
82575
|
+
"title": "Details",
|
|
82576
|
+
"type": "detail",
|
|
82577
|
+
"children": [
|
|
82578
|
+
{
|
|
82579
|
+
"type": "text",
|
|
82580
|
+
"value": [
|
|
82581
|
+
"Compare each element in *X* with the element specified by mode. Return true if the value is changed, otherwise false. Return false if the compared object does not exist.",
|
|
82582
|
+
"",
|
|
82583
|
+
"For example, for the first element of valueChanged(X, [mode=”prev“]) and the last element of valueChanged(X, [mode=”next“]), the function returns false.",
|
|
82584
|
+
"",
|
|
82585
|
+
"If *X* is a matrix/table, perform the aforementioned operation on each column and return a matrix/table."
|
|
82586
|
+
]
|
|
82587
|
+
}
|
|
82588
|
+
]
|
|
82589
|
+
},
|
|
82590
|
+
{
|
|
82591
|
+
"title": "Examples",
|
|
82592
|
+
"type": "example",
|
|
82593
|
+
"children": [
|
|
82594
|
+
{
|
|
82595
|
+
"type": "code",
|
|
82596
|
+
"language": "console",
|
|
82597
|
+
"value": [
|
|
82598
|
+
"",
|
|
82599
|
+
" $ x= 1 2 2 2 2 3 NULL 3 4 8",
|
|
82600
|
+
" $ valueChanged(x)",
|
|
82601
|
+
" [false,true,false,false,false,true,true,true,true,true]",
|
|
82602
|
+
" ",
|
|
82603
|
+
" $ valueChanged(x,\"next\")",
|
|
82604
|
+
" [true,false,false,false,true,true,true,true,true,false]",
|
|
82605
|
+
" ",
|
|
82606
|
+
" $ valueChanged(x,\"any\")",
|
|
82607
|
+
" [true,true,false,false,true,true,true,true,true,true]",
|
|
82608
|
+
" ",
|
|
82609
|
+
" $ valueChanged(x,\"all\")",
|
|
82610
|
+
" [false,false,false,false,false,true,true,true,true,false]",
|
|
82611
|
+
"",
|
|
82612
|
+
" $ tup=(1 2 3, `A`A`B`C, 2021.10.12+1 2 2)",
|
|
82613
|
+
" $ valueChanged(tup)",
|
|
82614
|
+
" ([false,true,true],[false,false,true,true],[false,true,false])",
|
|
82615
|
+
"",
|
|
82616
|
+
" $ m=matrix(1 2 3, 1 2 3, 1 3 3)",
|
|
82617
|
+
" $ valueChanged(m)",
|
|
82618
|
+
""
|
|
82619
|
+
]
|
|
82620
|
+
},
|
|
82621
|
+
{
|
|
82622
|
+
"type": "text",
|
|
82623
|
+
"value": [
|
|
82624
|
+
"====== ======= =======",
|
|
82625
|
+
"col1\tcol2\tcol3",
|
|
82626
|
+
"====== ======= =======",
|
|
82627
|
+
"false\tfalse\tfalse",
|
|
82628
|
+
"true\ttrue\ttrue",
|
|
82629
|
+
"true\ttrue\tfalse",
|
|
82630
|
+
"====== ======= =======",
|
|
82631
|
+
""
|
|
82632
|
+
]
|
|
82633
|
+
},
|
|
82634
|
+
{
|
|
82635
|
+
"type": "code",
|
|
82636
|
+
"language": "console",
|
|
82637
|
+
"value": [
|
|
82638
|
+
"",
|
|
82639
|
+
" $ id= 1 2 2 2 2 3 3 4 8",
|
|
82640
|
+
" $ sym=`A + string(1 2 2 2 2 3 3 4 8)",
|
|
82641
|
+
" $ val=83.8 92.8 8.1 61.4 40.7 67.2 15.2 20.6 96.5",
|
|
82642
|
+
" $ t=table(id, sym, val)",
|
|
82643
|
+
" $ valueChanged(t)",
|
|
82644
|
+
""
|
|
82645
|
+
]
|
|
82646
|
+
},
|
|
82647
|
+
{
|
|
82648
|
+
"type": "text",
|
|
82649
|
+
"value": [
|
|
82650
|
+
"======= ====== =======",
|
|
82651
|
+
"id sym val",
|
|
82652
|
+
"======= ====== =======",
|
|
82653
|
+
"false\tfalse\tfalse",
|
|
82654
|
+
"true\ttrue\ttrue",
|
|
82655
|
+
"false\tfalse\ttrue",
|
|
82656
|
+
"false\tfalse\ttrue",
|
|
82657
|
+
"false\tfalse\ttrue",
|
|
82658
|
+
"true\ttrue\ttrue",
|
|
82659
|
+
"false\tfalse\ttrue",
|
|
82660
|
+
"true\ttrue\ttrue",
|
|
82661
|
+
"true\ttrue\ttrue",
|
|
82662
|
+
"======= ====== =======",
|
|
82663
|
+
"",
|
|
82664
|
+
"Related function: :doc:`../k/keys`"
|
|
82665
|
+
]
|
|
82666
|
+
}
|
|
82667
|
+
]
|
|
82668
|
+
}
|
|
82669
|
+
]
|
|
82670
|
+
},
|
|
81221
82671
|
"values": {
|
|
81222
82672
|
"title": "values",
|
|
81223
82673
|
"type": "function",
|
|
@@ -81585,7 +83035,7 @@
|
|
|
81585
83035
|
" $ volume=rand(100, n)",
|
|
81586
83036
|
" $ table1 = table(date, sym, price, volume)",
|
|
81587
83037
|
" $ outputTable = table(n:0, `sym`factor1, [STRING,DOUBLE])",
|
|
81588
|
-
" $ engine = createReactiveStateEngine(\"test\", <ema(
|
|
83038
|
+
" $ engine = createReactiveStateEngine(\"test\", <ema(volume, 40)>, table1, outputTable, \"sym\")",
|
|
81589
83039
|
" $ warmupStreamEngine(engine, table1)",
|
|
81590
83040
|
" $ date=take(2021.03.09, n)",
|
|
81591
83041
|
" $ sym=take(\"A\"+string(1..3000), n)",
|