dolphindb 2.0.602 → 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/README.md +1 -0
- package/browser.d.ts +109 -17
- package/browser.js +389 -183
- package/browser.js.map +1 -1
- package/docs.en.json +2046 -552
- package/docs.zh.json +1311 -737
- package/index.d.ts +114 -18
- package/index.js +406 -196
- 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
|
@@ -1086,7 +1086,7 @@
|
|
|
1086
1086
|
"value": [
|
|
1087
1087
|
"In the following example, the user-defined function ``getSpread`` calculates the average bid-ask spread for a specified stock in the table `dfs://TAQ/quotes`. A user (user1) does not have the privilege to read table `dfs://TAQ/quotes`. Now define function ``getSpread`` to be a function view, and grant user1 the priviledge to execute the function view. Although user1 cannot read the raw data of table `dfs://TAQ/quotes`, now she can execute the function view to calculate the average bid-ask spread of any stock in the table.",
|
|
1088
1088
|
"",
|
|
1089
|
-
"Please note that as table `dfs://TAQ/quotes` is a distributed database, the following script needs to be executed by a system administrator
|
|
1089
|
+
"Please note that as table `dfs://TAQ/quotes` is a distributed database, the following script needs to be executed by a system administrator. User1 can execute function ``getSpread`` on any data node/compute node.",
|
|
1090
1090
|
""
|
|
1091
1091
|
]
|
|
1092
1092
|
},
|
|
@@ -2591,35 +2591,37 @@
|
|
|
2591
2591
|
"",
|
|
2592
2592
|
"`rule` is a string that can take the following values:",
|
|
2593
2593
|
"",
|
|
2594
|
-
"
|
|
2595
|
-
"Values of parameter \"rule\"
|
|
2596
|
-
"
|
|
2597
|
-
"\"B\"
|
|
2598
|
-
"\"W\"
|
|
2599
|
-
"\"WOM\"
|
|
2600
|
-
"\"LWOM\"
|
|
2601
|
-
"\"M\"
|
|
2602
|
-
"\"MS\"
|
|
2603
|
-
"\"BM\"
|
|
2604
|
-
"\"BMS\"
|
|
2605
|
-
"\"SM\"
|
|
2606
|
-
"\"SMS\"
|
|
2607
|
-
"\"Q\"
|
|
2608
|
-
"\"QS\"
|
|
2609
|
-
"\"BQ\"
|
|
2610
|
-
"\"BQS\"
|
|
2611
|
-
"\"
|
|
2612
|
-
"\"
|
|
2613
|
-
"\"
|
|
2614
|
-
"\"
|
|
2615
|
-
"\"
|
|
2616
|
-
"\"
|
|
2617
|
-
"\"
|
|
2618
|
-
"\"
|
|
2619
|
-
"\"
|
|
2620
|
-
"\"
|
|
2621
|
-
"\"
|
|
2622
|
-
"
|
|
2594
|
+
"=========================== =================================",
|
|
2595
|
+
"Values of parameter \"rule\" Corresponding DolphinDB function",
|
|
2596
|
+
"=========================== =================================",
|
|
2597
|
+
"\"B\" businessDay",
|
|
2598
|
+
"\"W\" weekEnd",
|
|
2599
|
+
"\"WOM\" weekOfMonth",
|
|
2600
|
+
"\"LWOM\" lastWeekOfMonth",
|
|
2601
|
+
"\"M\" monthEnd",
|
|
2602
|
+
"\"MS\" monthBegin",
|
|
2603
|
+
"\"BM\" businessMonthEnd",
|
|
2604
|
+
"\"BMS\" businessMonthBegin",
|
|
2605
|
+
"\"SM\" semiMonthEnd",
|
|
2606
|
+
"\"SMS\" semiMonthBegin",
|
|
2607
|
+
"\"Q\" quarterEnd",
|
|
2608
|
+
"\"QS\" quarterBegin",
|
|
2609
|
+
"\"BQ\" businessQuarterEnd",
|
|
2610
|
+
"\"BQS\" businessQuarterBegin",
|
|
2611
|
+
"\"REQ\" FY5253Quarter",
|
|
2612
|
+
"\"A\" yearEnd",
|
|
2613
|
+
"\"AS\" yearBegin",
|
|
2614
|
+
"\"BA\" businessYearEnd",
|
|
2615
|
+
"\"BAS\" businessYearBegin",
|
|
2616
|
+
"\"RE\" FY5253",
|
|
2617
|
+
"\"D\" date",
|
|
2618
|
+
"\"H\" hourOfDay",
|
|
2619
|
+
"\"min\" minuteOfHour",
|
|
2620
|
+
"\"S\" secondOfMinute",
|
|
2621
|
+
"\"L\" millisecond",
|
|
2622
|
+
"\"U\" microsecond",
|
|
2623
|
+
"\"N\" nanosecond",
|
|
2624
|
+
"=========================== =================================",
|
|
2623
2625
|
"",
|
|
2624
2626
|
"The strings above can also be used with integers for parameter \"rule\". For example, \"2M\" means month end every two months.",
|
|
2625
2627
|
"",
|
|
@@ -11715,7 +11717,7 @@
|
|
|
11715
11717
|
"",
|
|
11716
11718
|
"`outputTable` is a table object indicating the output table for the results. We need to set the output table as an empty table and specify the names and data types of the columns before using function createAsofJoinEngine. By default, the first two columns are the `timeColumn` and `matchingColumn` of the leftTable which do not need to be specified in metrics.",
|
|
11717
11719
|
"",
|
|
11718
|
-
"`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2
|
|
11720
|
+
"`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For more information about metacode please refer to :doc:`/Objects/Metaprogramming`.",
|
|
11719
11721
|
"",
|
|
11720
11722
|
"`matchingColumn` is a STRING scaler/vector/tuple indicating the column(s) on which the tables are joined. It supports integral, temporal or literal (except UUID) types.",
|
|
11721
11723
|
"",
|
|
@@ -11728,7 +11730,7 @@
|
|
|
11728
11730
|
"`useSystemTime` is an optional parameter indicating whether the first column of outputTable is system time ( `useSystemTime` = true) or `timeColumn` in the stream table ( `useSystemTime` = false).",
|
|
11729
11731
|
"",
|
|
11730
11732
|
" * `useSystemTime` = true, to calculate according to the timestamp when each record is ingested into the streaming engine (with millisecond precision) instead of `timeColumn`.",
|
|
11731
|
-
" * `useSystemTime` = false (default), to calculate according to `timeColumn` instead of the timestamp when each record is ingested into the engine. Please note that the the data which triggers the calculation doesn
|
|
11733
|
+
" * `useSystemTime` = false (default), to calculate according to `timeColumn` instead of the timestamp when each record is ingested into the engine. Please note that the the data which triggers the calculation doesn't participate in this calculation.",
|
|
11732
11734
|
"",
|
|
11733
11735
|
"`useSessionStartTime` is a Boolean scalar. It is optional and indicates whether the time in the output table is the start time of data window. The default value is false, which means that the time in the output table is the end time of the data window, that is, the timestamp of the last data in each window + sessionGap. It must be set to true if parameter `updateTime` is specified.",
|
|
11734
11736
|
"",
|
|
@@ -12174,7 +12176,7 @@
|
|
|
12174
12176
|
"",
|
|
12175
12177
|
"`mergeSessionEnd` is a Boolean scalar indicating whether to include the data at the ending time of the session in the calculation of each session. It is optional and the default value is false.",
|
|
12176
12178
|
"",
|
|
12177
|
-
"`forceTriggerSessionEndTime` is an optional parameter. It is a positive integer
|
|
12179
|
+
"`forceTriggerSessionEndTime` is an optional parameter. It is a positive integer whose unit is consistent with the precision of timeColumn. It indicates the waiting time to force trigger calculation in the window containing the sessionEnd, if it ends without calculation.",
|
|
12178
12180
|
"",
|
|
12179
12181
|
"- If *fill* is not specified, the window returns no result.",
|
|
12180
12182
|
"",
|
|
@@ -12767,7 +12769,7 @@
|
|
|
12767
12769
|
"",
|
|
12768
12770
|
"\\(2) The last few columns are the results of the *metrics*.",
|
|
12769
12771
|
"",
|
|
12770
|
-
"`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2
|
|
12772
|
+
"`metrics` is metacode specifying the calculation formulas. It can use one or more expressions, built-in or user-defined functions, but not aggregate functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For more information about metacode, please refer to :doc:`/Objects/Metaprogramming`.",
|
|
12771
12773
|
"",
|
|
12772
12774
|
"`matchingColumn` is a STRING scalar/vector, or a tuple of STRING vectors indicating the matching column(s). It can be integral, temporal or literal (excluding UUID) types.",
|
|
12773
12775
|
"",
|
|
@@ -13073,7 +13075,7 @@
|
|
|
13073
13075
|
"type": "code",
|
|
13074
13076
|
"language": "console",
|
|
13075
13077
|
"value": [
|
|
13076
|
-
"
|
|
13078
|
+
"",
|
|
13077
13079
|
" $ n=1000000;",
|
|
13078
13080
|
" $ t=table(rand(`IBM`MS`APPL`AMZN,n) as symbol, rand(10.0, n) as value)",
|
|
13079
13081
|
" $ db = database(\"dfs://rangedb_tradedata\", RANGE, `A`F`M`S`ZZZZ)",
|
|
@@ -13094,7 +13096,7 @@
|
|
|
13094
13096
|
"type": "code",
|
|
13095
13097
|
"language": "console",
|
|
13096
13098
|
"value": [
|
|
13097
|
-
"
|
|
13099
|
+
"",
|
|
13098
13100
|
" $ Trades.append!(t);",
|
|
13099
13101
|
""
|
|
13100
13102
|
]
|
|
@@ -13110,7 +13112,7 @@
|
|
|
13110
13112
|
"type": "code",
|
|
13111
13113
|
"language": "console",
|
|
13112
13114
|
"value": [
|
|
13113
|
-
"
|
|
13115
|
+
"",
|
|
13114
13116
|
" $ Trades=loadTable(db,`Trades);",
|
|
13115
13117
|
" $ select min(value) from Trades;",
|
|
13116
13118
|
" 0",
|
|
@@ -13124,27 +13126,17 @@
|
|
|
13124
13126
|
"",
|
|
13125
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. ",
|
|
13126
13128
|
"",
|
|
13127
|
-
"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.",
|
|
13128
13130
|
"",
|
|
13129
|
-
"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. ",
|
|
13130
|
-
""
|
|
13131
|
-
|
|
13132
|
-
},
|
|
13133
|
-
{
|
|
13134
|
-
"type": "code",
|
|
13135
|
-
"language": "console",
|
|
13136
|
-
"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",
|
|
13137
13134
|
" ",
|
|
13138
13135
|
" $ db=database(\"C:/DolphinDB/Data/rangedb_tradedata\",RANGE,`A`F`M`S`ZZZZ)",
|
|
13139
|
-
""
|
|
13140
|
-
]
|
|
13141
|
-
},
|
|
13142
|
-
{
|
|
13143
|
-
"type": "text",
|
|
13144
|
-
"value": [
|
|
13145
|
-
"Example 3. Create a partitioned table in an in-memory database.",
|
|
13146
13136
|
"",
|
|
13147
|
-
"Example
|
|
13137
|
+
"Example 2. Create in-memory partitioned tables",
|
|
13138
|
+
"",
|
|
13139
|
+
"Example 2.1. Create an ordinary partitioned in-memory table. ",
|
|
13148
13140
|
""
|
|
13149
13141
|
]
|
|
13150
13142
|
},
|
|
@@ -13152,14 +13144,14 @@
|
|
|
13152
13144
|
"type": "code",
|
|
13153
13145
|
"language": "console",
|
|
13154
13146
|
"value": [
|
|
13155
|
-
"
|
|
13147
|
+
"",
|
|
13156
13148
|
" $ n = 200000",
|
|
13157
13149
|
" $ colNames = `time`sym`qty`price",
|
|
13158
13150
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
13159
13151
|
" $ t = table(n:0, colNames, colTypes)",
|
|
13160
13152
|
" $ db = database(, RANGE, `A`D`F)",
|
|
13161
13153
|
" $ pt = db.createPartitionedTable(t, `pt, `sym)",
|
|
13162
|
-
"
|
|
13154
|
+
"",
|
|
13163
13155
|
" $ insert into pt values(09:30:00.001,`AAPL,100,56.5)",
|
|
13164
13156
|
" $ insert into pt values(09:30:01.001,`DELL,100,15.5)",
|
|
13165
13157
|
""
|
|
@@ -13168,7 +13160,7 @@
|
|
|
13168
13160
|
{
|
|
13169
13161
|
"type": "text",
|
|
13170
13162
|
"value": [
|
|
13171
|
-
"Example
|
|
13163
|
+
"Example 2.2. Create a partitioned keyed table. ",
|
|
13172
13164
|
""
|
|
13173
13165
|
]
|
|
13174
13166
|
},
|
|
@@ -13176,14 +13168,14 @@
|
|
|
13176
13168
|
"type": "code",
|
|
13177
13169
|
"language": "console",
|
|
13178
13170
|
"value": [
|
|
13179
|
-
"
|
|
13171
|
+
"",
|
|
13180
13172
|
" $ n = 200000",
|
|
13181
13173
|
" $ colNames = `time`sym`qty`price",
|
|
13182
13174
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
13183
13175
|
" $ t = keyedTable(`time`sym, n:0, colNames, colTypes)",
|
|
13184
13176
|
" $ db = database(, RANGE, `A`D`F)",
|
|
13185
13177
|
" $ pt = db.createPartitionedTable(t, `pt, `sym)",
|
|
13186
|
-
"
|
|
13178
|
+
"",
|
|
13187
13179
|
" $ insert into pt values(09:30:00.001,`AAPL,100,56.5)",
|
|
13188
13180
|
" $ insert into pt values(09:30:01.001,`DELL,100,15.5)",
|
|
13189
13181
|
""
|
|
@@ -13192,7 +13184,7 @@
|
|
|
13192
13184
|
{
|
|
13193
13185
|
"type": "text",
|
|
13194
13186
|
"value": [
|
|
13195
|
-
"Example
|
|
13187
|
+
"Example 2.3. Create a partitioned stream table.",
|
|
13196
13188
|
"",
|
|
13197
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`.",
|
|
13198
13190
|
""
|
|
@@ -13202,7 +13194,7 @@
|
|
|
13202
13194
|
"type": "code",
|
|
13203
13195
|
"language": "console",
|
|
13204
13196
|
"value": [
|
|
13205
|
-
"
|
|
13197
|
+
"",
|
|
13206
13198
|
" $ n=200000",
|
|
13207
13199
|
" $ colNames = `time`sym`qty`price",
|
|
13208
13200
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
@@ -13210,7 +13202,7 @@
|
|
|
13210
13202
|
" $ trades_stream2 = streamTable(n:0, colNames, colTypes)",
|
|
13211
13203
|
" $ db=database(, RANGE, `A`D`F)",
|
|
13212
13204
|
" $ trades = createPartitionedTable(db,[trades_stream1, trades_stream2], \"\", `sym)",
|
|
13213
|
-
"
|
|
13205
|
+
"",
|
|
13214
13206
|
" $ insert into trades_stream1 values(09:30:00.001,`AAPL,100,56.5)",
|
|
13215
13207
|
" $ insert into trades_stream2 values(09:30:01.001,`DELL,100,15.5)",
|
|
13216
13208
|
"",
|
|
@@ -13228,7 +13220,7 @@
|
|
|
13228
13220
|
"09:30:01.001 DELL 100 15.5",
|
|
13229
13221
|
"============= ===== ===== ======",
|
|
13230
13222
|
"",
|
|
13231
|
-
"Example
|
|
13223
|
+
"Example 2.4. Create a partitioned MVCC table.",
|
|
13232
13224
|
"",
|
|
13233
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`. ",
|
|
13234
13226
|
""
|
|
@@ -13238,7 +13230,7 @@
|
|
|
13238
13230
|
"type": "code",
|
|
13239
13231
|
"language": "console",
|
|
13240
13232
|
"value": [
|
|
13241
|
-
"
|
|
13233
|
+
"",
|
|
13242
13234
|
" $ n=200000",
|
|
13243
13235
|
" $ colNames = `time`sym`qty`price",
|
|
13244
13236
|
" $ colTypes = [TIME,SYMBOL,INT,DOUBLE]",
|
|
@@ -13246,7 +13238,7 @@
|
|
|
13246
13238
|
" $ trades_mvcc2 = mvccTable(n:0, colNames, colTypes)",
|
|
13247
13239
|
" $ db=database(, RANGE, `A`D`F)",
|
|
13248
13240
|
" $ trades = createPartitionedTable(db,[trades_mvcc1, trades_mvcc2], \"\", `sym)",
|
|
13249
|
-
"
|
|
13241
|
+
"",
|
|
13250
13242
|
" $ insert into trades_mvcc1 values(09:30:00.001,`AAPL,100,56.5)",
|
|
13251
13243
|
" $ insert into trades_mvcc2 values(09:30:01.001,`DELL,100,15.5)",
|
|
13252
13244
|
"",
|
|
@@ -13272,13 +13264,20 @@
|
|
|
13272
13264
|
"type": "code",
|
|
13273
13265
|
"language": "console",
|
|
13274
13266
|
"value": [
|
|
13275
|
-
"
|
|
13267
|
+
"",
|
|
13276
13268
|
" $ db = database(\"dfs://demodb\", VALUE, 1..10)",
|
|
13277
13269
|
" $ t=table(take(1, 86400) as id, 2020.01.01T00:00:00 + 0..86399 as timestamp, rand(1..100, 86400) as val)",
|
|
13278
13270
|
" $ pt =db.createPartitionedTable(t, \"pt\", \"id\", {timestamp:\"delta\", val:\"delta\"})",
|
|
13279
13271
|
" $ pt.append!(t)",
|
|
13280
13272
|
""
|
|
13281
13273
|
]
|
|
13274
|
+
},
|
|
13275
|
+
{
|
|
13276
|
+
"type": "text",
|
|
13277
|
+
"value": [
|
|
13278
|
+
".. meta::",
|
|
13279
|
+
" :keywords: in-memory table"
|
|
13280
|
+
]
|
|
13282
13281
|
}
|
|
13283
13282
|
]
|
|
13284
13283
|
}
|
|
@@ -13317,7 +13316,7 @@
|
|
|
13317
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",
|
|
13318
13317
|
"* order-sensitive function: deltas, ratios, ffill, move, prev, iterate, ewmMean, ewmVar, ewmStd, ewmCov, ewmCorr",
|
|
13319
13318
|
"* topN function: msumTopN, mavgTopN, mstdpTopN, mstdTopN, mvarpTopN, mvarTopN, mcorrTopN, mbetaTopN, mcovarTopN, mwsumTopN",
|
|
13320
|
-
"* other: talibNull, talibNull,
|
|
13319
|
+
"* other: talibNull, talibNull, dynamicGroupCumsum, dynamicGroupCumcount",
|
|
13321
13320
|
"",
|
|
13322
13321
|
"Note: The parameter *func* in the state function ``talib`` can only be a state function supported by the reactive state engine.",
|
|
13323
13322
|
"",
|
|
@@ -13727,7 +13726,7 @@
|
|
|
13727
13726
|
{
|
|
13728
13727
|
"type": "text",
|
|
13729
13728
|
"value": [
|
|
13730
|
-
"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'])",
|
|
13731
13730
|
"",
|
|
13732
13731
|
"Alias: createTimeSeriesAggregator"
|
|
13733
13732
|
]
|
|
@@ -13743,7 +13742,7 @@
|
|
|
13743
13742
|
"value": [
|
|
13744
13743
|
"Create a time-series engine to conduct real-time time-series aggregate calculations with streaming data.",
|
|
13745
13744
|
"",
|
|
13746
|
-
"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. ",
|
|
13747
13746
|
"",
|
|
13748
13747
|
"If *keyColumn* is specified to group the records that have the same key, the window calculation will be performed in each group.",
|
|
13749
13748
|
"",
|
|
@@ -14411,7 +14410,7 @@
|
|
|
14411
14410
|
"",
|
|
14412
14411
|
"`window` is a pair of integers or duration values, indicating the range of the sliding window, including both left and right bounds.",
|
|
14413
14412
|
"",
|
|
14414
|
-
"`metrics` is a required parameter indicating calculation metrics in the form of metacode. It can use one or more expressions, and built-in or user-defined functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2
|
|
14413
|
+
"`metrics` is a required parameter indicating calculation metrics in the form of metacode. It can use one or more expressions, and built-in or user-defined functions. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2>. For details about metacode, see :doc:`/Objects/Metaprogramming`。",
|
|
14415
14414
|
"",
|
|
14416
14415
|
"When only the columns in the *rightTable* are involved in calculation, the window join engine optimizes the performance of the following functions: sum, sum2, avg, std, var, corr, covar, wavg, wsum, beta, max, min, last, first, med, percentile。",
|
|
14417
14416
|
"",
|
|
@@ -17161,7 +17160,7 @@
|
|
|
17161
17160
|
{
|
|
17162
17161
|
"type": "text",
|
|
17163
17162
|
"value": [
|
|
17164
|
-
"\\1. To establish a non-partitioned database:",
|
|
17163
|
+
"\\1. To establish a non-partitioned database on disk:",
|
|
17165
17164
|
""
|
|
17166
17165
|
]
|
|
17167
17166
|
},
|
|
@@ -17170,7 +17169,7 @@
|
|
|
17170
17169
|
"language": "console",
|
|
17171
17170
|
"value": [
|
|
17172
17171
|
" ",
|
|
17173
|
-
" $ db=database(
|
|
17172
|
+
" $ db=database(directory=\"C:/DolphinDB/Data/db1/\");",
|
|
17174
17173
|
" $ t=table(take(1..10,10000000) as id, rand(10,10000000) as x, rand(10.0,10000000) as y);",
|
|
17175
17174
|
" $ saveTable(db, t, `t1);",
|
|
17176
17175
|
""
|
|
@@ -17198,7 +17197,7 @@
|
|
|
17198
17197
|
" $ t=table(ID, date, x);",
|
|
17199
17198
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
17200
17199
|
" ",
|
|
17201
|
-
" $ db = database(
|
|
17200
|
+
" $ db = database(directory=\"C:/DolphinDB/Data/seqdb\", partitionType=SEQ, partitionScheme=8)",
|
|
17202
17201
|
" $ pt = loadTextEx(db, `pt, ,\"C:/DolphinDB/Data/t.txt\");",
|
|
17203
17202
|
""
|
|
17204
17203
|
]
|
|
@@ -17223,7 +17222,7 @@
|
|
|
17223
17222
|
" $ ID=rand(10, n)",
|
|
17224
17223
|
" $ x=rand(1.0, n)",
|
|
17225
17224
|
" $ t=table(ID, x);",
|
|
17226
|
-
" $ db=database(
|
|
17225
|
+
" $ db=database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 5 10)",
|
|
17227
17226
|
" $ pt = db.createPartitionedTable(t, `pt, `ID);",
|
|
17228
17227
|
" $ pt.append!(t);",
|
|
17229
17228
|
"",
|
|
@@ -17261,17 +17260,16 @@
|
|
|
17261
17260
|
" $ t=table(ID, x);",
|
|
17262
17261
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
17263
17262
|
" ",
|
|
17264
|
-
" $ db=database(
|
|
17263
|
+
" $ db=database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 5 10)",
|
|
17265
17264
|
" $ pt = loadTextEx(db, `pt, `ID, \"C:/DolphinDB/Data/t.txt\");",
|
|
17265
|
+
"",
|
|
17266
17266
|
""
|
|
17267
17267
|
]
|
|
17268
17268
|
},
|
|
17269
17269
|
{
|
|
17270
17270
|
"type": "text",
|
|
17271
17271
|
"value": [
|
|
17272
|
-
"
|
|
17273
|
-
"",
|
|
17274
|
-
"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.",
|
|
17275
17273
|
""
|
|
17276
17274
|
]
|
|
17277
17275
|
},
|
|
@@ -17284,12 +17282,11 @@
|
|
|
17284
17282
|
" $ ID=rand(10, n)",
|
|
17285
17283
|
" $ x=rand(1.0, n)",
|
|
17286
17284
|
" $ t=table(ID, x)",
|
|
17287
|
-
" $ db=database(
|
|
17285
|
+
" $ db=database(directory=\"dfs://hashdb\", partitionType=HASH, partitionScheme=[INT, 2])",
|
|
17288
17286
|
" ",
|
|
17289
17287
|
" $ pt = db.createPartitionedTable(t, `pt, `ID)",
|
|
17290
17288
|
" $ pt.append!(t);",
|
|
17291
17289
|
" ",
|
|
17292
|
-
" $ pt=loadTable(db,`pt)",
|
|
17293
17290
|
" $ select count(x) from pt;",
|
|
17294
17291
|
""
|
|
17295
17292
|
]
|
|
@@ -17303,11 +17300,37 @@
|
|
|
17303
17300
|
"|1000000|",
|
|
17304
17301
|
"+-------+",
|
|
17305
17302
|
"",
|
|
17306
|
-
".. 上面的例子中,数据库db有两个分区。表t被保存为以ID为分区列的分区表pt。",
|
|
17307
|
-
"",
|
|
17308
17303
|
"In example above, database db has two partitions. Table t is saved as pt(a partitioned table) with the partitioning column ID.",
|
|
17309
17304
|
"",
|
|
17310
|
-
"
|
|
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.",
|
|
17311
17334
|
""
|
|
17312
17335
|
]
|
|
17313
17336
|
},
|
|
@@ -17321,7 +17344,7 @@
|
|
|
17321
17344
|
" $ x=rand(1.0, n);",
|
|
17322
17345
|
" $ t=table(month, x);",
|
|
17323
17346
|
" ",
|
|
17324
|
-
" $ db=database(
|
|
17347
|
+
" $ db=database(directory=\"dfs://valuedb\", partitionType=VALUE, partitionScheme=2000.01M..2016.12M)",
|
|
17325
17348
|
" $ pt = db.createPartitionedTable(t, `pt, `month);",
|
|
17326
17349
|
" $ pt.append!(t);",
|
|
17327
17350
|
" ",
|
|
@@ -17339,7 +17362,7 @@
|
|
|
17339
17362
|
"|1000000|",
|
|
17340
17363
|
"+-------+",
|
|
17341
17364
|
"",
|
|
17342
|
-
"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.",
|
|
17343
17366
|
"",
|
|
17344
17367
|
".. image:: ../../../images/database03.png",
|
|
17345
17368
|
"",
|
|
@@ -17357,7 +17380,7 @@
|
|
|
17357
17380
|
" $ x=rand(1.0, n);",
|
|
17358
17381
|
" $ t=table(ticker, x);",
|
|
17359
17382
|
" ",
|
|
17360
|
-
" $ db=database(
|
|
17383
|
+
" $ db=database(directory=\"dfs://listdb\", partitionType=LIST, partitionScheme=[`IBM`ORCL`MSFT, `GOOG`FB])",
|
|
17361
17384
|
" $ pt = db.createPartitionedTable(t, `pt, `ticker)",
|
|
17362
17385
|
" $ pt.append!(t);",
|
|
17363
17386
|
" ",
|
|
@@ -17395,9 +17418,9 @@
|
|
|
17395
17418
|
" $ x=rand(10.0, n)",
|
|
17396
17419
|
" $ t=table(ID, date, x)",
|
|
17397
17420
|
" ",
|
|
17398
|
-
" $ dbDate = database(, VALUE, 2017.08.07..2017.08.11)",
|
|
17399
|
-
" $ dbID = database(, RANGE, 0 50 100)",
|
|
17400
|
-
" $ 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])",
|
|
17401
17424
|
" ",
|
|
17402
17425
|
" $ pt = db.createPartitionedTable(t, `pt, `date`ID)",
|
|
17403
17426
|
" $ pt.append!(t)",
|
|
@@ -17449,9 +17472,9 @@
|
|
|
17449
17472
|
" $ x=rand(10.0, n)",
|
|
17450
17473
|
" $ t=table(ID, date, x);",
|
|
17451
17474
|
" ",
|
|
17452
|
-
" $ dbDate = database(, VALUE, 2017.08.07..2017.08.11)",
|
|
17453
|
-
" $ dbID=database(, RANGE, 0 50 100);",
|
|
17454
|
-
" $ 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]);",
|
|
17455
17478
|
" $ pt = db.createPartitionedTable(t, `pt, `date`ID)",
|
|
17456
17479
|
" $ pt.append!(t);",
|
|
17457
17480
|
""
|
|
@@ -17503,7 +17526,7 @@
|
|
|
17503
17526
|
" $ x=rand(1.0, n)",
|
|
17504
17527
|
" $ t=table(ID, x);",
|
|
17505
17528
|
" ",
|
|
17506
|
-
" $ db=database(
|
|
17529
|
+
" $ db=database(directory=\"dfs://rangedb5\", partitionType=RANGE, partitionScheme=0 5 10, locations=[`node1`node2, `node3])",
|
|
17507
17530
|
" $ pt = db.createPartitionedTable(t, `pt, `ID);",
|
|
17508
17531
|
" $ pt.append!(t);",
|
|
17509
17532
|
""
|
|
@@ -17530,7 +17553,6 @@
|
|
|
17530
17553
|
"value": [
|
|
17531
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.",
|
|
17532
17555
|
"",
|
|
17533
|
-
"",
|
|
17534
17556
|
"We can also use the actual host name and the port number to represent a site. The function call can be changed to",
|
|
17535
17557
|
""
|
|
17536
17558
|
]
|
|
@@ -17541,7 +17563,6 @@
|
|
|
17541
17563
|
"value": [
|
|
17542
17564
|
" ",
|
|
17543
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\"])",
|
|
17544
|
-
"",
|
|
17545
17566
|
""
|
|
17546
17567
|
]
|
|
17547
17568
|
},
|
|
@@ -19071,7 +19092,7 @@
|
|
|
19071
19092
|
"",
|
|
19072
19093
|
"`ascending` is a Boolean value indicating whether to sort in ascending order. It is an optional parameter and the default value is true.",
|
|
19073
19094
|
"",
|
|
19074
|
-
"`ignoreNA` is a Boolean value indicating whether NULL values are ignored in ranking
|
|
19095
|
+
"`ignoreNA` is a Boolean value indicating whether NULL values are ignored in ranking. The default value is true. If set to false, NULL is ranked as the minimum value.",
|
|
19075
19096
|
"",
|
|
19076
19097
|
"`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false."
|
|
19077
19098
|
]
|
|
@@ -19085,8 +19106,15 @@
|
|
|
19085
19106
|
{
|
|
19086
19107
|
"type": "text",
|
|
19087
19108
|
"value": [
|
|
19088
|
-
"
|
|
19089
|
-
"
|
|
19109
|
+
"If *X* is a vector:",
|
|
19110
|
+
"",
|
|
19111
|
+
"- return the consecutive rank of each element in *X* based on the specified order.",
|
|
19112
|
+
"",
|
|
19113
|
+
"- If ignoreNA = true, the NULL values are ignored in ranking and return NULL.",
|
|
19114
|
+
"",
|
|
19115
|
+
"* If *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.",
|
|
19116
|
+
"",
|
|
19117
|
+
"Note: Unlike ``denseRank``, :doc:`../r/rank` skips positions after equal rankings."
|
|
19090
19118
|
]
|
|
19091
19119
|
}
|
|
19092
19120
|
]
|
|
@@ -19099,7 +19127,7 @@
|
|
|
19099
19127
|
"type": "code",
|
|
19100
19128
|
"language": "console",
|
|
19101
19129
|
"value": [
|
|
19102
|
-
"
|
|
19130
|
+
"",
|
|
19103
19131
|
" $ x=1 5 5 6 8 8 9",
|
|
19104
19132
|
" $ print denseRank(x)",
|
|
19105
19133
|
" [0,1,1,2,3,3,4]",
|
|
@@ -19108,21 +19136,21 @@
|
|
|
19108
19136
|
" $ print denseRank(y, ascending=false)",
|
|
19109
19137
|
" [0,2,2,1]",
|
|
19110
19138
|
" $ m = matrix(1 2 2 NULL, 0 0 0 1, 0 0 NULL 2)",
|
|
19111
|
-
" $ denseRank(m, ignoreNA=false)
|
|
19139
|
+
" $ denseRank(m, ignoreNA=false)",
|
|
19112
19140
|
""
|
|
19113
19141
|
]
|
|
19114
19142
|
},
|
|
19115
19143
|
{
|
|
19116
19144
|
"type": "text",
|
|
19117
19145
|
"value": [
|
|
19118
|
-
"== == ==
|
|
19146
|
+
"== == ==",
|
|
19119
19147
|
"#0 #1 #2",
|
|
19120
|
-
"== == ==
|
|
19148
|
+
"== == ==",
|
|
19121
19149
|
"1 0 1",
|
|
19122
19150
|
"2 0 1",
|
|
19123
19151
|
"2 0 0",
|
|
19124
19152
|
"0 1 2",
|
|
19125
|
-
"== == ==
|
|
19153
|
+
"== == ==",
|
|
19126
19154
|
""
|
|
19127
19155
|
]
|
|
19128
19156
|
},
|
|
@@ -19130,7 +19158,7 @@
|
|
|
19130
19158
|
"type": "code",
|
|
19131
19159
|
"language": "console",
|
|
19132
19160
|
"value": [
|
|
19133
|
-
"
|
|
19161
|
+
"",
|
|
19134
19162
|
" $ t=table(`A`A`B`C`B`B`A`C`C as id,[4,1,NULL,1,2,4,5,0,-1] as val)",
|
|
19135
19163
|
" $ select id,val, denseRank(val) from t context by id",
|
|
19136
19164
|
""
|
|
@@ -19145,12 +19173,12 @@
|
|
|
19145
19173
|
"A 4 1",
|
|
19146
19174
|
"A 1 0",
|
|
19147
19175
|
"A 5 2",
|
|
19148
|
-
"B
|
|
19176
|
+
"B",
|
|
19149
19177
|
"B 2 0",
|
|
19150
19178
|
"B 4 1",
|
|
19151
19179
|
"C 1 2",
|
|
19152
19180
|
"C 0 1",
|
|
19153
|
-
"C
|
|
19181
|
+
"C -1 0",
|
|
19154
19182
|
"======== ======== =============",
|
|
19155
19183
|
"",
|
|
19156
19184
|
"Related function: :doc:`../r/rowDenseRank`"
|
|
@@ -19965,6 +19993,54 @@
|
|
|
19965
19993
|
}
|
|
19966
19994
|
]
|
|
19967
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
|
+
},
|
|
19968
20044
|
"disableTablePersistence": {
|
|
19969
20045
|
"title": "disableTablePersistence",
|
|
19970
20046
|
"type": "command",
|
|
@@ -21002,6 +21078,13 @@
|
|
|
21002
21078
|
"title": "Examples",
|
|
21003
21079
|
"type": "example",
|
|
21004
21080
|
"children": [
|
|
21081
|
+
{
|
|
21082
|
+
"type": "text",
|
|
21083
|
+
"value": [
|
|
21084
|
+
"Drop a DFS database:",
|
|
21085
|
+
""
|
|
21086
|
+
]
|
|
21087
|
+
},
|
|
21005
21088
|
{
|
|
21006
21089
|
"type": "code",
|
|
21007
21090
|
"language": "console",
|
|
@@ -21012,20 +21095,21 @@
|
|
|
21012
21095
|
" $ dates=2017.08.07..2017.08.11",
|
|
21013
21096
|
" $ date=rand(dates, n)",
|
|
21014
21097
|
" $ x=rand(10.0, n)",
|
|
21015
|
-
" $ t=table(ID, date, x)",
|
|
21098
|
+
" $ t=table(ID, date, x);",
|
|
21016
21099
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
21017
21100
|
"",
|
|
21018
|
-
" $ db = database(\"
|
|
21019
|
-
" $ 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\")",
|
|
21020
21105
|
"",
|
|
21021
|
-
" $ dropDatabase(\"C:/DolphinDB/Data/rangedb\");",
|
|
21022
21106
|
""
|
|
21023
21107
|
]
|
|
21024
21108
|
},
|
|
21025
21109
|
{
|
|
21026
21110
|
"type": "text",
|
|
21027
21111
|
"value": [
|
|
21028
|
-
"
|
|
21112
|
+
"Drop a database on disk:",
|
|
21029
21113
|
""
|
|
21030
21114
|
]
|
|
21031
21115
|
},
|
|
@@ -21039,13 +21123,13 @@
|
|
|
21039
21123
|
" $ dates=2017.08.07..2017.08.11",
|
|
21040
21124
|
" $ date=rand(dates, n)",
|
|
21041
21125
|
" $ x=rand(10.0, n)",
|
|
21042
|
-
" $ t=table(ID, date, x)
|
|
21126
|
+
" $ t=table(ID, date, x)",
|
|
21043
21127
|
" $ saveText(t, \"C:/DolphinDB/Data/t.txt\");",
|
|
21044
21128
|
"",
|
|
21045
|
-
" $ db = database(\"
|
|
21046
|
-
" $ 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\");",
|
|
21047
21131
|
"",
|
|
21048
|
-
" $ dropDatabase(\"
|
|
21132
|
+
" $ dropDatabase(\"C:/DolphinDB/Data/rangedb\");",
|
|
21049
21133
|
""
|
|
21050
21134
|
]
|
|
21051
21135
|
},
|
|
@@ -21143,7 +21227,7 @@
|
|
|
21143
21227
|
{
|
|
21144
21228
|
"type": "text",
|
|
21145
21229
|
"value": [
|
|
21146
|
-
"dropFunctionView(
|
|
21230
|
+
"dropFunctionView(name)"
|
|
21147
21231
|
]
|
|
21148
21232
|
}
|
|
21149
21233
|
]
|
|
@@ -21155,7 +21239,7 @@
|
|
|
21155
21239
|
{
|
|
21156
21240
|
"type": "text",
|
|
21157
21241
|
"value": [
|
|
21158
|
-
"`
|
|
21242
|
+
"`name` is a string scalar indicating the name of user defined function."
|
|
21159
21243
|
]
|
|
21160
21244
|
}
|
|
21161
21245
|
]
|
|
@@ -21169,9 +21253,7 @@
|
|
|
21169
21253
|
"value": [
|
|
21170
21254
|
"Delete a function view.",
|
|
21171
21255
|
"",
|
|
21172
|
-
"
|
|
21173
|
-
"",
|
|
21174
|
-
"It can only be executed by administrators on the controller node. ",
|
|
21256
|
+
"It can only be executed by an administrator. ",
|
|
21175
21257
|
"",
|
|
21176
21258
|
".. meta:: ",
|
|
21177
21259
|
" :keywords: drop, Function, view"
|
|
@@ -21507,7 +21589,7 @@
|
|
|
21507
21589
|
{
|
|
21508
21590
|
"type": "text",
|
|
21509
21591
|
"value": [
|
|
21510
|
-
"`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``."
|
|
21511
21593
|
]
|
|
21512
21594
|
}
|
|
21513
21595
|
]
|
|
@@ -22403,6 +22485,50 @@
|
|
|
22403
22485
|
}
|
|
22404
22486
|
]
|
|
22405
22487
|
},
|
|
22488
|
+
"enableQueryMonitor": {
|
|
22489
|
+
"title": "enableQueryMonitor",
|
|
22490
|
+
"type": "command",
|
|
22491
|
+
"children": [
|
|
22492
|
+
{
|
|
22493
|
+
"title": "Syntax",
|
|
22494
|
+
"type": "grammer",
|
|
22495
|
+
"children": [
|
|
22496
|
+
{
|
|
22497
|
+
"type": "text",
|
|
22498
|
+
"value": [
|
|
22499
|
+
"enableQueryMonitor()"
|
|
22500
|
+
]
|
|
22501
|
+
}
|
|
22502
|
+
]
|
|
22503
|
+
},
|
|
22504
|
+
{
|
|
22505
|
+
"title": "Arguments",
|
|
22506
|
+
"type": "parameters",
|
|
22507
|
+
"children": [
|
|
22508
|
+
{
|
|
22509
|
+
"type": "text",
|
|
22510
|
+
"value": [
|
|
22511
|
+
"None"
|
|
22512
|
+
]
|
|
22513
|
+
}
|
|
22514
|
+
]
|
|
22515
|
+
},
|
|
22516
|
+
{
|
|
22517
|
+
"title": "Details",
|
|
22518
|
+
"type": "detail",
|
|
22519
|
+
"children": [
|
|
22520
|
+
{
|
|
22521
|
+
"type": "text",
|
|
22522
|
+
"value": [
|
|
22523
|
+
"Enable the monitor on the query status. The monitor is enabled by default.",
|
|
22524
|
+
"",
|
|
22525
|
+
"Related function: :doc:`../d/disableQueryMonitor`"
|
|
22526
|
+
]
|
|
22527
|
+
}
|
|
22528
|
+
]
|
|
22529
|
+
}
|
|
22530
|
+
]
|
|
22531
|
+
},
|
|
22406
22532
|
"enableTablePersistence": {
|
|
22407
22533
|
"title": "enableTablePersistence",
|
|
22408
22534
|
"type": "command",
|
|
@@ -23880,82 +24006,6 @@
|
|
|
23880
24006
|
}
|
|
23881
24007
|
]
|
|
23882
24008
|
},
|
|
23883
|
-
"existSubscriptionTopic": {
|
|
23884
|
-
"title": "existSubscriptionTopic",
|
|
23885
|
-
"type": "function",
|
|
23886
|
-
"children": [
|
|
23887
|
-
{
|
|
23888
|
-
"title": "Syntax",
|
|
23889
|
-
"type": "grammer",
|
|
23890
|
-
"children": [
|
|
23891
|
-
{
|
|
23892
|
-
"type": "text",
|
|
23893
|
-
"value": [
|
|
23894
|
-
"existSubscriptionTopic([server], tableName, [actionName])"
|
|
23895
|
-
]
|
|
23896
|
-
}
|
|
23897
|
-
]
|
|
23898
|
-
},
|
|
23899
|
-
{
|
|
23900
|
-
"title": "Arguments",
|
|
23901
|
-
"type": "parameters",
|
|
23902
|
-
"children": [
|
|
23903
|
-
{
|
|
23904
|
-
"type": "text",
|
|
23905
|
-
"value": [
|
|
23906
|
-
"`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.",
|
|
23907
|
-
"",
|
|
23908
|
-
"`tableName` is a STRING indicating the name of a shared stream table.",
|
|
23909
|
-
"",
|
|
23910
|
-
"`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. "
|
|
23911
|
-
]
|
|
23912
|
-
}
|
|
23913
|
-
]
|
|
23914
|
-
},
|
|
23915
|
-
{
|
|
23916
|
-
"title": "Details",
|
|
23917
|
-
"type": "detail",
|
|
23918
|
-
"children": [
|
|
23919
|
-
{
|
|
23920
|
-
"type": "text",
|
|
23921
|
-
"value": [
|
|
23922
|
-
"Check the existence of a subscription topic of a shared stream table. Return “true” if the subscription topic exists, “false” if it doesn't."
|
|
23923
|
-
]
|
|
23924
|
-
}
|
|
23925
|
-
]
|
|
23926
|
-
},
|
|
23927
|
-
{
|
|
23928
|
-
"title": "First Release",
|
|
23929
|
-
"children": [
|
|
23930
|
-
{
|
|
23931
|
-
"type": "text",
|
|
23932
|
-
"value": [
|
|
23933
|
-
"1.30.16 / 2.00.4"
|
|
23934
|
-
]
|
|
23935
|
-
}
|
|
23936
|
-
]
|
|
23937
|
-
},
|
|
23938
|
-
{
|
|
23939
|
-
"title": "Examples",
|
|
23940
|
-
"type": "example",
|
|
23941
|
-
"children": [
|
|
23942
|
-
{
|
|
23943
|
-
"type": "code",
|
|
23944
|
-
"language": "console",
|
|
23945
|
-
"value": [
|
|
23946
|
-
"",
|
|
23947
|
-
" $ t=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])",
|
|
23948
|
-
" $ share t as trades",
|
|
23949
|
-
" $ trades_1=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])",
|
|
23950
|
-
" $ subscribeTable(tableName=`trades, actionName=`vwap, offset=-1, handler=append!{trades_1})",
|
|
23951
|
-
" $ existSubscriptionTopic(,`trades,`vwap)",
|
|
23952
|
-
" true"
|
|
23953
|
-
]
|
|
23954
|
-
}
|
|
23955
|
-
]
|
|
23956
|
-
}
|
|
23957
|
-
]
|
|
23958
|
-
},
|
|
23959
24009
|
"exists": {
|
|
23960
24010
|
"title": "exists",
|
|
23961
24011
|
"type": "function",
|
|
@@ -24095,30 +24145,6 @@
|
|
|
24095
24145
|
"title": "Examples",
|
|
24096
24146
|
"type": "example",
|
|
24097
24147
|
"children": [
|
|
24098
|
-
{
|
|
24099
|
-
"type": "code",
|
|
24100
|
-
"language": "console",
|
|
24101
|
-
"value": [
|
|
24102
|
-
"",
|
|
24103
|
-
" $ n=1000000",
|
|
24104
|
-
" $ ID=rand(10, n)",
|
|
24105
|
-
" $ dates=2017.08.07..2017.08.11",
|
|
24106
|
-
" $ date=rand(dates, n)",
|
|
24107
|
-
" $ x=rand(10.0, n)",
|
|
24108
|
-
" $ t=table(ID, date, x)",
|
|
24109
|
-
"",
|
|
24110
|
-
" $ db = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
24111
|
-
" $ pt = db.createPartitionedTable(t, `pt, `date);",
|
|
24112
|
-
" $ pt.append!(t);",
|
|
24113
|
-
"",
|
|
24114
|
-
" $ existsDatabase(\"C:/DolphinDB/Data/valueDB\");",
|
|
24115
|
-
" 1",
|
|
24116
|
-
"",
|
|
24117
|
-
" $ existsDatabase(\"C:/DolphinDB/Data/valueDB/20170807\");",
|
|
24118
|
-
" 0",
|
|
24119
|
-
""
|
|
24120
|
-
]
|
|
24121
|
-
},
|
|
24122
24148
|
{
|
|
24123
24149
|
"type": "text",
|
|
24124
24150
|
"value": [
|
|
@@ -24146,7 +24172,15 @@
|
|
|
24146
24172
|
" 1",
|
|
24147
24173
|
"",
|
|
24148
24174
|
" $ existsDatabase(\"dfs://valueDB/20170807\");",
|
|
24149
|
-
" 0"
|
|
24175
|
+
" 0",
|
|
24176
|
+
""
|
|
24177
|
+
]
|
|
24178
|
+
},
|
|
24179
|
+
{
|
|
24180
|
+
"type": "text",
|
|
24181
|
+
"value": [
|
|
24182
|
+
".. meta:: ",
|
|
24183
|
+
" :keywords: exist"
|
|
24150
24184
|
]
|
|
24151
24185
|
}
|
|
24152
24186
|
]
|
|
@@ -24276,8 +24310,8 @@
|
|
|
24276
24310
|
}
|
|
24277
24311
|
]
|
|
24278
24312
|
},
|
|
24279
|
-
"
|
|
24280
|
-
"title": "
|
|
24313
|
+
"existsSubscriptionTopic": {
|
|
24314
|
+
"title": "existsSubscriptionTopic",
|
|
24281
24315
|
"type": "function",
|
|
24282
24316
|
"children": [
|
|
24283
24317
|
{
|
|
@@ -24287,7 +24321,9 @@
|
|
|
24287
24321
|
{
|
|
24288
24322
|
"type": "text",
|
|
24289
24323
|
"value": [
|
|
24290
|
-
"
|
|
24324
|
+
"existsSubscriptionTopic([server], tableName, [actionName])",
|
|
24325
|
+
"",
|
|
24326
|
+
"Alias: existSubscriptionTopic"
|
|
24291
24327
|
]
|
|
24292
24328
|
}
|
|
24293
24329
|
]
|
|
@@ -24299,9 +24335,11 @@
|
|
|
24299
24335
|
{
|
|
24300
24336
|
"type": "text",
|
|
24301
24337
|
"value": [
|
|
24302
|
-
"`
|
|
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.",
|
|
24303
24339
|
"",
|
|
24304
|
-
"`tableName` a
|
|
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. "
|
|
24305
24343
|
]
|
|
24306
24344
|
}
|
|
24307
24345
|
]
|
|
@@ -24313,7 +24351,18 @@
|
|
|
24313
24351
|
{
|
|
24314
24352
|
"type": "text",
|
|
24315
24353
|
"value": [
|
|
24316
|
-
"Check if the
|
|
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"
|
|
24317
24366
|
]
|
|
24318
24367
|
}
|
|
24319
24368
|
]
|
|
@@ -24327,32 +24376,68 @@
|
|
|
24327
24376
|
"language": "console",
|
|
24328
24377
|
"value": [
|
|
24329
24378
|
"",
|
|
24330
|
-
"
|
|
24331
|
-
"
|
|
24332
|
-
"
|
|
24333
|
-
"
|
|
24334
|
-
"
|
|
24335
|
-
"
|
|
24336
|
-
|
|
24337
|
-
|
|
24338
|
-
|
|
24339
|
-
|
|
24340
|
-
|
|
24341
|
-
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
|
|
24345
|
-
|
|
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
|
+
},
|
|
24391
|
+
"existsTable": {
|
|
24392
|
+
"title": "existsTable",
|
|
24393
|
+
"type": "function",
|
|
24394
|
+
"children": [
|
|
24395
|
+
{
|
|
24396
|
+
"title": "Syntax",
|
|
24397
|
+
"type": "grammer",
|
|
24398
|
+
"children": [
|
|
24399
|
+
{
|
|
24400
|
+
"type": "text",
|
|
24401
|
+
"value": [
|
|
24402
|
+
"existsTable(path, tableName)"
|
|
24403
|
+
]
|
|
24404
|
+
}
|
|
24405
|
+
]
|
|
24406
|
+
},
|
|
24407
|
+
{
|
|
24408
|
+
"title": "Arguments",
|
|
24409
|
+
"type": "parameters",
|
|
24410
|
+
"children": [
|
|
24411
|
+
{
|
|
24412
|
+
"type": "text",
|
|
24413
|
+
"value": [
|
|
24414
|
+
"`path` a string indicating the path of a database.",
|
|
24346
24415
|
"",
|
|
24347
|
-
"
|
|
24348
|
-
" 0",
|
|
24349
|
-
""
|
|
24416
|
+
"`tableName` a string indicating a table name."
|
|
24350
24417
|
]
|
|
24351
|
-
}
|
|
24418
|
+
}
|
|
24419
|
+
]
|
|
24420
|
+
},
|
|
24421
|
+
{
|
|
24422
|
+
"title": "Details",
|
|
24423
|
+
"type": "detail",
|
|
24424
|
+
"children": [
|
|
24425
|
+
{
|
|
24426
|
+
"type": "text",
|
|
24427
|
+
"value": [
|
|
24428
|
+
"Check if the specified table exists in the specified database."
|
|
24429
|
+
]
|
|
24430
|
+
}
|
|
24431
|
+
]
|
|
24432
|
+
},
|
|
24433
|
+
{
|
|
24434
|
+
"title": "Examples",
|
|
24435
|
+
"type": "example",
|
|
24436
|
+
"children": [
|
|
24352
24437
|
{
|
|
24353
24438
|
"type": "text",
|
|
24354
24439
|
"value": [
|
|
24355
|
-
"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):",
|
|
24356
24441
|
""
|
|
24357
24442
|
]
|
|
24358
24443
|
},
|
|
@@ -24376,7 +24461,15 @@
|
|
|
24376
24461
|
" 1",
|
|
24377
24462
|
"",
|
|
24378
24463
|
" $ existsTable(\"dfs://valueDB/20170807\", `pt);",
|
|
24379
|
-
" 1"
|
|
24464
|
+
" 1",
|
|
24465
|
+
""
|
|
24466
|
+
]
|
|
24467
|
+
},
|
|
24468
|
+
{
|
|
24469
|
+
"type": "text",
|
|
24470
|
+
"value": [
|
|
24471
|
+
".. meta:: ",
|
|
24472
|
+
" :keywords: exist"
|
|
24380
24473
|
]
|
|
24381
24474
|
}
|
|
24382
24475
|
]
|
|
@@ -27219,6 +27312,63 @@
|
|
|
27219
27312
|
}
|
|
27220
27313
|
]
|
|
27221
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
|
+
},
|
|
27222
27372
|
"getBackupList": {
|
|
27223
27373
|
"title": "getBackupList",
|
|
27224
27374
|
"type": "function",
|
|
@@ -27768,7 +27918,7 @@
|
|
|
27768
27918
|
"",
|
|
27769
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).",
|
|
27770
27920
|
"",
|
|
27771
|
-
"\\(2) Operations such as recovery
|
|
27921
|
+
"\\(2) Operations such as recovery and rebalance cannot be performed."
|
|
27772
27922
|
]
|
|
27773
27923
|
}
|
|
27774
27924
|
]
|
|
@@ -27975,7 +28125,42 @@
|
|
|
27975
28125
|
" $ rpc(getControllerAlias(), getClusterPerf).keys()",
|
|
27976
28126
|
" [\"host\",\"port\",\"site\",\"mode\",\"state\",\"agentSite\",\"maxConnections\",\"maxMemSize\",\"workerNum\",\"executorNum\",\"connectionNum\",\"name\",\"memoryUsed\",\"memoryAlloc\",\"cpuUsage\",\"avgLoad\",\"medLast10QueryTime\",\"maxLast10QueryTime\",\"medLast100QueryTime\",\"maxLast100QueryTime\",\"maxRunningQueryTime\",\"runningJobs\",\"queuedJobs\",\"runningTasks\",\"queuedTasks\",\"jobLoad\",\"diskCapacity\",\"diskFreeSpace\",\"diskFreeSpaceRatio\",\"diskWriteRate\",\"diskReadRate\",\"lastMinuteWriteVolume\",\"lastMinuteReadVolume\",\"networkSendRate\",\"networkRecvRate\",\"lastMinuteNetworkSend\",\"lastMinuteNetworkRecv\",\"publicName\",\"lastMsgLatency\",\"cumMsgLatency\"]",
|
|
27977
28127
|
"",
|
|
28128
|
+
""
|
|
28129
|
+
]
|
|
28130
|
+
},
|
|
28131
|
+
{
|
|
28132
|
+
"type": "text",
|
|
28133
|
+
"value": [
|
|
28134
|
+
"Execute in a high-availability cluster:",
|
|
27978
28135
|
"",
|
|
28136
|
+
""
|
|
28137
|
+
]
|
|
28138
|
+
},
|
|
28139
|
+
{
|
|
28140
|
+
"type": "code",
|
|
28141
|
+
"language": "console",
|
|
28142
|
+
"value": [
|
|
28143
|
+
"",
|
|
28144
|
+
" $ rpc(getControllerAlias(true), getClusterPerf)",
|
|
28145
|
+
""
|
|
28146
|
+
]
|
|
28147
|
+
},
|
|
28148
|
+
{
|
|
28149
|
+
"type": "text",
|
|
28150
|
+
"value": [
|
|
28151
|
+
"=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
|
|
28152
|
+
"host port site mode state agentSite maxConnections maxMemSize workerNum executorNum connectionNum name memoryUsed memoryAlloc cpuUsage avgLoad medLast10QueryTime maxLast10QueryTime medLast100QueryTime maxLast100QueryTime maxRunningQueryTime runningJobs queuedJobs runningTasks queuedTasks jobLoad diskCapacity diskFreeSpace diskFreeSpaceRatio diskWriteRate diskReadRate lastMinuteWriteVolume lastMinuteReadVolume networkSendRate networkRecvRate lastMinuteNetworkSend lastMinuteNetworkRecv publicName lastMsgLatency cumMsgLatency isLeader",
|
|
28153
|
+
"=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
|
|
28154
|
+
"192.168.100.10 17,000 192.168.100.10:17000:master3 2 1 512 16 64 3 1 master3 23,449,272 24,133,632 0.7788 0.0037 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,658 2,736 102,468 59,193 78,351 8,012,182 2,378,846 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0 false",
|
|
28155
|
+
"192.168.100.11 17,000 192.168.100.11:17000:master2 2 1 512 16 64 3 2 master2 23,527,872 24,133,632 11.5625 0.3219 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,670 2,785 116,733 62,402 56,160 1,366,293 1,398,238 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0 false",
|
|
28156
|
+
"192.168.100.12 17,000 192.168.100.12:17000:master1 2 1 512 16 64 3 20 master1 25,002,792 46,538,752 14.0406 0.1136 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,671 13,546,528 19,964,606 53,206 56,891 22,543,771 8,226,278 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0 true",
|
|
28157
|
+
"192.168.100.12 17,102 192.168.100.12:17102:server19-datanode1 0 1 192.168.100.12:17101:server19-agent1 254 120 5 31 1 server19-datanode1 23,118,960 24,133,632 13.928 0.1136 0 0 0 0 0 0 0 0 0 0 17,790,585,659,392 16,826,060,464,128 0.9458 0 4,687 1,289 23,477 44,197 55,104 352,258 6,163,159 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0 ",
|
|
28158
|
+
"192.168.100.11 17,102 192.168.100.11:17102:server18-datanode1 0 1 192.168.100.11:17101:server18-agent1 254 120 5 31 1 server18-datanode1 23,111,912 24,133,632 14.1066 0.3219 0 0 0 0 0 0 0 0 0 0 17,790,585,659,392 16,714,392,956,928 0.9395 0 4,698 1,989 23,530 40,896 50,706 243,008 250,727 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0 ",
|
|
28159
|
+
"192.168.100.11 17,101 192.168.100.11:17101:server18-agent1 1 1 192.168.100.11:17101:server18-agent1 304 4 4 63 0 server18-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.11;172.17.0.1;10.244.4.0;10.244.4.1 0 0",
|
|
28160
|
+
"192.168.100.10 17,102 192.168.100.10:17102:server17-datanode1 0 1 192.168.100.10:17101:server17-agent1 254 120 5 31 1 server17-datanode1 40,872,496 52,445,184 0.7788 0.0037 0 0 0 0 0 0 0 0 0 0 53,783,736,754,176 50,336,934,432,768 0.9359 0 4,699 13,900,218 18,835 118,935 109,862 6,170,512 408,018 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0",
|
|
28161
|
+
"192.168.100.12 17,101 192.168.100.12:17101:server19-agent1 1 1 192.168.100.12:17101:server19-agent1 304 4 4 63 0 server19-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.12;172.17.0.1;10.244.3.0;10.244.3.1 0 0",
|
|
28162
|
+
"192.168.100.10 17,101 192.168.100.10:17101:server17-agent1 1 1 192.168.100.10:17101:server17-agent1 304 4 4 63 0 server17-agent1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 192.198.1.10;172.17.0.1;10.244.5.0;10.244.5.1 0 0",
|
|
28163
|
+
"=================== =========== ========================================== ====== ======= ===================================== ================ ============ =========== ============= =============== ===================== ============ ============= ========== ========= ==================== ==================== ===================== ===================== ===================== ============= ============ ============== ============= ========= ===================== ======================= ==================== =============== ============== ======================= ====================== ================= ================= ======================= ======================= =============================================== ================ =============== ================",
|
|
27979
28164
|
" "
|
|
27980
28165
|
]
|
|
27981
28166
|
}
|
|
@@ -29493,8 +29678,8 @@
|
|
|
29493
29678
|
}
|
|
29494
29679
|
]
|
|
29495
29680
|
},
|
|
29496
|
-
"
|
|
29497
|
-
"title": "
|
|
29681
|
+
"getMemLimitOfQueryResult": {
|
|
29682
|
+
"title": "getMemLimitOfQueryResult",
|
|
29498
29683
|
"type": "function",
|
|
29499
29684
|
"children": [
|
|
29500
29685
|
{
|
|
@@ -29504,7 +29689,7 @@
|
|
|
29504
29689
|
{
|
|
29505
29690
|
"type": "text",
|
|
29506
29691
|
"value": [
|
|
29507
|
-
"
|
|
29692
|
+
"getMemLimitOfQueryResult()"
|
|
29508
29693
|
]
|
|
29509
29694
|
}
|
|
29510
29695
|
]
|
|
@@ -29528,7 +29713,7 @@
|
|
|
29528
29713
|
{
|
|
29529
29714
|
"type": "text",
|
|
29530
29715
|
"value": [
|
|
29531
|
-
"
|
|
29716
|
+
"Get the memory limit (in units of bytes) for the result of each query. Return a DOUBLE value."
|
|
29532
29717
|
]
|
|
29533
29718
|
}
|
|
29534
29719
|
]
|
|
@@ -29542,26 +29727,24 @@
|
|
|
29542
29727
|
"language": "console",
|
|
29543
29728
|
"value": [
|
|
29544
29729
|
" ",
|
|
29545
|
-
" $
|
|
29546
|
-
"",
|
|
29547
|
-
"
|
|
29548
|
-
" allocatedBytes->35463168",
|
|
29730
|
+
" $ setMemLimitOfQueryResult(0.2)",
|
|
29731
|
+
" $ getMemLimitOfQueryResult() / 1024 / 1024 / 1024",
|
|
29732
|
+
" 0.2",
|
|
29549
29733
|
""
|
|
29550
29734
|
]
|
|
29551
29735
|
},
|
|
29552
29736
|
{
|
|
29553
29737
|
"type": "text",
|
|
29554
29738
|
"value": [
|
|
29555
|
-
"
|
|
29556
|
-
" :keywords: get"
|
|
29739
|
+
"Related function: :doc:`/FunctionsandCommands/CommandsReferences/s/setMemLimitOfQueryResult`"
|
|
29557
29740
|
]
|
|
29558
29741
|
}
|
|
29559
29742
|
]
|
|
29560
29743
|
}
|
|
29561
29744
|
]
|
|
29562
29745
|
},
|
|
29563
|
-
"
|
|
29564
|
-
"title": "
|
|
29746
|
+
"getMemLimitOfTaskGroupResult": {
|
|
29747
|
+
"title": "getMemLimitOfTaskGroupResult",
|
|
29565
29748
|
"type": "function",
|
|
29566
29749
|
"children": [
|
|
29567
29750
|
{
|
|
@@ -29571,7 +29754,7 @@
|
|
|
29571
29754
|
{
|
|
29572
29755
|
"type": "text",
|
|
29573
29756
|
"value": [
|
|
29574
|
-
"
|
|
29757
|
+
"getMemLimitOfTaskGroupResult()"
|
|
29575
29758
|
]
|
|
29576
29759
|
}
|
|
29577
29760
|
]
|
|
@@ -29595,7 +29778,7 @@
|
|
|
29595
29778
|
{
|
|
29596
29779
|
"type": "text",
|
|
29597
29780
|
"value": [
|
|
29598
|
-
"
|
|
29781
|
+
"Get the memory limit of a task group sent from the current node. Return a DOUBLE value."
|
|
29599
29782
|
]
|
|
29600
29783
|
}
|
|
29601
29784
|
]
|
|
@@ -29609,25 +29792,24 @@
|
|
|
29609
29792
|
"language": "console",
|
|
29610
29793
|
"value": [
|
|
29611
29794
|
" ",
|
|
29612
|
-
" $
|
|
29613
|
-
"",
|
|
29614
|
-
"
|
|
29795
|
+
" $ setMemLimitOfTaskGroupResult(10)",
|
|
29796
|
+
" $ getMemLimitOfTaskGroupResult() / 1024 / 1024 / 1024",
|
|
29797
|
+
" 10",
|
|
29615
29798
|
""
|
|
29616
29799
|
]
|
|
29617
29800
|
},
|
|
29618
29801
|
{
|
|
29619
29802
|
"type": "text",
|
|
29620
29803
|
"value": [
|
|
29621
|
-
"
|
|
29622
|
-
" :keywords: get"
|
|
29804
|
+
"Related function: :doc:`/FunctionsandCommands/CommandsReferences/s/setMemLimitOfTaskGroupResult`"
|
|
29623
29805
|
]
|
|
29624
29806
|
}
|
|
29625
29807
|
]
|
|
29626
29808
|
}
|
|
29627
29809
|
]
|
|
29628
29810
|
},
|
|
29629
|
-
"
|
|
29630
|
-
"title": "
|
|
29811
|
+
"getMemoryStat": {
|
|
29812
|
+
"title": "getMemoryStat",
|
|
29631
29813
|
"type": "function",
|
|
29632
29814
|
"children": [
|
|
29633
29815
|
{
|
|
@@ -29637,7 +29819,7 @@
|
|
|
29637
29819
|
{
|
|
29638
29820
|
"type": "text",
|
|
29639
29821
|
"value": [
|
|
29640
|
-
"
|
|
29822
|
+
"getMemoryStat()"
|
|
29641
29823
|
]
|
|
29642
29824
|
}
|
|
29643
29825
|
]
|
|
@@ -29661,7 +29843,7 @@
|
|
|
29661
29843
|
{
|
|
29662
29844
|
"type": "text",
|
|
29663
29845
|
"value": [
|
|
29664
|
-
"Return the
|
|
29846
|
+
"Return the allocated memory and the unused memory."
|
|
29665
29847
|
]
|
|
29666
29848
|
}
|
|
29667
29849
|
]
|
|
@@ -29675,9 +29857,10 @@
|
|
|
29675
29857
|
"language": "console",
|
|
29676
29858
|
"value": [
|
|
29677
29859
|
" ",
|
|
29678
|
-
" $
|
|
29860
|
+
" $ getMemoryStat();",
|
|
29679
29861
|
"",
|
|
29680
|
-
"
|
|
29862
|
+
" freeBytes->6430128",
|
|
29863
|
+
" allocatedBytes->35463168",
|
|
29681
29864
|
""
|
|
29682
29865
|
]
|
|
29683
29866
|
},
|
|
@@ -29692,8 +29875,8 @@
|
|
|
29692
29875
|
}
|
|
29693
29876
|
]
|
|
29694
29877
|
},
|
|
29695
|
-
"
|
|
29696
|
-
"title": "
|
|
29878
|
+
"getNodeAlias": {
|
|
29879
|
+
"title": "getNodeAlias",
|
|
29697
29880
|
"type": "function",
|
|
29698
29881
|
"children": [
|
|
29699
29882
|
{
|
|
@@ -29703,7 +29886,7 @@
|
|
|
29703
29886
|
{
|
|
29704
29887
|
"type": "text",
|
|
29705
29888
|
"value": [
|
|
29706
|
-
"
|
|
29889
|
+
"getNodeAlias()"
|
|
29707
29890
|
]
|
|
29708
29891
|
}
|
|
29709
29892
|
]
|
|
@@ -29727,7 +29910,7 @@
|
|
|
29727
29910
|
{
|
|
29728
29911
|
"type": "text",
|
|
29729
29912
|
"value": [
|
|
29730
|
-
"Return the
|
|
29913
|
+
"Return the alias of the local node, which is defined in the configuration file dolphindb.cfg."
|
|
29731
29914
|
]
|
|
29732
29915
|
}
|
|
29733
29916
|
]
|
|
@@ -29741,9 +29924,9 @@
|
|
|
29741
29924
|
"language": "console",
|
|
29742
29925
|
"value": [
|
|
29743
29926
|
" ",
|
|
29744
|
-
" $
|
|
29927
|
+
" $ getNodeAlias();",
|
|
29745
29928
|
"",
|
|
29746
|
-
"
|
|
29929
|
+
" controller2",
|
|
29747
29930
|
""
|
|
29748
29931
|
]
|
|
29749
29932
|
},
|
|
@@ -29758,8 +29941,8 @@
|
|
|
29758
29941
|
}
|
|
29759
29942
|
]
|
|
29760
29943
|
},
|
|
29761
|
-
"
|
|
29762
|
-
"title": "
|
|
29944
|
+
"getNodeHost": {
|
|
29945
|
+
"title": "getNodeHost",
|
|
29763
29946
|
"type": "function",
|
|
29764
29947
|
"children": [
|
|
29765
29948
|
{
|
|
@@ -29769,7 +29952,139 @@
|
|
|
29769
29952
|
{
|
|
29770
29953
|
"type": "text",
|
|
29771
29954
|
"value": [
|
|
29772
|
-
"
|
|
29955
|
+
"getNodeHost()"
|
|
29956
|
+
]
|
|
29957
|
+
}
|
|
29958
|
+
]
|
|
29959
|
+
},
|
|
29960
|
+
{
|
|
29961
|
+
"title": "Arguments",
|
|
29962
|
+
"type": "parameters",
|
|
29963
|
+
"children": [
|
|
29964
|
+
{
|
|
29965
|
+
"type": "text",
|
|
29966
|
+
"value": [
|
|
29967
|
+
"None"
|
|
29968
|
+
]
|
|
29969
|
+
}
|
|
29970
|
+
]
|
|
29971
|
+
},
|
|
29972
|
+
{
|
|
29973
|
+
"title": "Details",
|
|
29974
|
+
"type": "detail",
|
|
29975
|
+
"children": [
|
|
29976
|
+
{
|
|
29977
|
+
"type": "text",
|
|
29978
|
+
"value": [
|
|
29979
|
+
"Return the host name of the local node, which is defined in the configuration file dolphindb.cfg."
|
|
29980
|
+
]
|
|
29981
|
+
}
|
|
29982
|
+
]
|
|
29983
|
+
},
|
|
29984
|
+
{
|
|
29985
|
+
"title": "Examples",
|
|
29986
|
+
"type": "example",
|
|
29987
|
+
"children": [
|
|
29988
|
+
{
|
|
29989
|
+
"type": "code",
|
|
29990
|
+
"language": "console",
|
|
29991
|
+
"value": [
|
|
29992
|
+
" ",
|
|
29993
|
+
" $ getNodeHost();",
|
|
29994
|
+
"",
|
|
29995
|
+
" 10.6.0.6",
|
|
29996
|
+
""
|
|
29997
|
+
]
|
|
29998
|
+
},
|
|
29999
|
+
{
|
|
30000
|
+
"type": "text",
|
|
30001
|
+
"value": [
|
|
30002
|
+
".. meta:: ",
|
|
30003
|
+
" :keywords: get"
|
|
30004
|
+
]
|
|
30005
|
+
}
|
|
30006
|
+
]
|
|
30007
|
+
}
|
|
30008
|
+
]
|
|
30009
|
+
},
|
|
30010
|
+
"getNodePort": {
|
|
30011
|
+
"title": "getNodePort",
|
|
30012
|
+
"type": "function",
|
|
30013
|
+
"children": [
|
|
30014
|
+
{
|
|
30015
|
+
"title": "Syntax",
|
|
30016
|
+
"type": "grammer",
|
|
30017
|
+
"children": [
|
|
30018
|
+
{
|
|
30019
|
+
"type": "text",
|
|
30020
|
+
"value": [
|
|
30021
|
+
"getNodePort()"
|
|
30022
|
+
]
|
|
30023
|
+
}
|
|
30024
|
+
]
|
|
30025
|
+
},
|
|
30026
|
+
{
|
|
30027
|
+
"title": "Arguments",
|
|
30028
|
+
"type": "parameters",
|
|
30029
|
+
"children": [
|
|
30030
|
+
{
|
|
30031
|
+
"type": "text",
|
|
30032
|
+
"value": [
|
|
30033
|
+
"None"
|
|
30034
|
+
]
|
|
30035
|
+
}
|
|
30036
|
+
]
|
|
30037
|
+
},
|
|
30038
|
+
{
|
|
30039
|
+
"title": "Details",
|
|
30040
|
+
"type": "detail",
|
|
30041
|
+
"children": [
|
|
30042
|
+
{
|
|
30043
|
+
"type": "text",
|
|
30044
|
+
"value": [
|
|
30045
|
+
"Return the port number of the local node, which is defined in the configuration file dolphindb.cfg."
|
|
30046
|
+
]
|
|
30047
|
+
}
|
|
30048
|
+
]
|
|
30049
|
+
},
|
|
30050
|
+
{
|
|
30051
|
+
"title": "Examples",
|
|
30052
|
+
"type": "example",
|
|
30053
|
+
"children": [
|
|
30054
|
+
{
|
|
30055
|
+
"type": "code",
|
|
30056
|
+
"language": "console",
|
|
30057
|
+
"value": [
|
|
30058
|
+
" ",
|
|
30059
|
+
" $ getNodePort();",
|
|
30060
|
+
"",
|
|
30061
|
+
" 8081",
|
|
30062
|
+
""
|
|
30063
|
+
]
|
|
30064
|
+
},
|
|
30065
|
+
{
|
|
30066
|
+
"type": "text",
|
|
30067
|
+
"value": [
|
|
30068
|
+
".. meta:: ",
|
|
30069
|
+
" :keywords: get"
|
|
30070
|
+
]
|
|
30071
|
+
}
|
|
30072
|
+
]
|
|
30073
|
+
}
|
|
30074
|
+
]
|
|
30075
|
+
},
|
|
30076
|
+
"getNodeType": {
|
|
30077
|
+
"title": "getNodeType",
|
|
30078
|
+
"type": "function",
|
|
30079
|
+
"children": [
|
|
30080
|
+
{
|
|
30081
|
+
"title": "Syntax",
|
|
30082
|
+
"type": "grammer",
|
|
30083
|
+
"children": [
|
|
30084
|
+
{
|
|
30085
|
+
"type": "text",
|
|
30086
|
+
"value": [
|
|
30087
|
+
"getNodeType()"
|
|
29773
30088
|
]
|
|
29774
30089
|
}
|
|
29775
30090
|
]
|
|
@@ -30158,6 +30473,86 @@
|
|
|
30158
30473
|
}
|
|
30159
30474
|
]
|
|
30160
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
|
+
},
|
|
30161
30556
|
"getRaftElectionTick": {
|
|
30162
30557
|
"title": "getRaftElectionTick",
|
|
30163
30558
|
"type": "function",
|
|
@@ -31760,8 +32155,6 @@
|
|
|
31760
32155
|
"| OLAP CACHE ENGINE | The status of OLAP cache engine on the current node and the memory usage of | ``pnodeRun(getCacheEngineMemSize)`` |",
|
|
31761
32156
|
"| STATUS | each node | ``pnodeRun(getOLAPCacheEngineStat)`` |",
|
|
31762
32157
|
"+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
|
|
31763
|
-
"| TSDB META | the metadata of all chunks in the TSDB database | ``pnodeRun(getTSDBMetaData)`` |",
|
|
31764
|
-
"+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
|
|
31765
32158
|
"| REDO LOG GC STATUS | the redo log status | ``pnodeRun(getRedoLogGCStat)`` |",
|
|
31766
32159
|
"+----------------------+--------------------------------------------------------------------------------+-----------------------------------------+",
|
|
31767
32160
|
"| TRANSACTION STATUS | the transaction status | ``pnodeRun(getTransactionStatus)`` |",
|
|
@@ -31995,13 +32388,13 @@
|
|
|
31995
32388
|
" $ y=rand(10, n)",
|
|
31996
32389
|
" $ t1=table(ID, date, x)",
|
|
31997
32390
|
" $ t2=table(ID, date, y)",
|
|
31998
|
-
" $ db = database(\"
|
|
32391
|
+
" $ db = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
31999
32392
|
" $ pt1 = db.createPartitionedTable(t1, `pt1, `date)",
|
|
32000
32393
|
" $ pt1.append!(t1)",
|
|
32001
32394
|
" $ pt2 = db.createPartitionedTable(t2, `pt2, `date)",
|
|
32002
32395
|
" $ pt2.append!(t2);",
|
|
32003
|
-
"",
|
|
32004
32396
|
" $ getTables(db);",
|
|
32397
|
+
"",
|
|
32005
32398
|
" [\"pt1\",\"pt2\"]",
|
|
32006
32399
|
""
|
|
32007
32400
|
]
|
|
@@ -32812,6 +33205,115 @@
|
|
|
32812
33205
|
}
|
|
32813
33206
|
]
|
|
32814
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
|
+
},
|
|
32815
33317
|
"gmtime": {
|
|
32816
33318
|
"title": "gmtime",
|
|
32817
33319
|
"type": "function",
|
|
@@ -35575,16 +36077,19 @@
|
|
|
35575
36077
|
"value": [
|
|
35576
36078
|
"",
|
|
35577
36079
|
" $ timer(100) select * from t where id=500000;",
|
|
35578
|
-
" Time elapsed:
|
|
36080
|
+
" Time elapsed: 177.286 ms",
|
|
35579
36081
|
"",
|
|
35580
36082
|
" $ timer(100) select * from t1 where id=500000;",
|
|
35581
|
-
" Time elapsed: 1.
|
|
36083
|
+
" Time elapsed: 1.245 ms",
|
|
36084
|
+
"",
|
|
36085
|
+
" $ timer(100) sliceByKey(t1, 500000)",
|
|
36086
|
+
" Time elapsed: 0.742 ms",
|
|
35582
36087
|
"",
|
|
35583
36088
|
" $ timer(100) select * from t where id in [500000, 600000, 700000];",
|
|
35584
|
-
" Time elapsed:
|
|
36089
|
+
" Time elapsed: 1134.429 ms",
|
|
35585
36090
|
"",
|
|
35586
36091
|
" $ timer(100) select * from t1 where id in [500000, 600000, 700000];",
|
|
35587
|
-
" Time elapsed: 1 ms",
|
|
36092
|
+
" Time elapsed: 1.377 ms",
|
|
35588
36093
|
""
|
|
35589
36094
|
]
|
|
35590
36095
|
},
|
|
@@ -35601,10 +36106,10 @@
|
|
|
35601
36106
|
"value": [
|
|
35602
36107
|
"",
|
|
35603
36108
|
" $ timer(100) select * from t where id between 500000:500010;",
|
|
35604
|
-
" Time elapsed:
|
|
36109
|
+
" Time elapsed: 641.544 ms",
|
|
35605
36110
|
"",
|
|
35606
36111
|
" $ timer(100) select * from t1 where id between 500000:500010;",
|
|
35607
|
-
" Time elapsed:
|
|
36112
|
+
" Time elapsed: 599.752 ms",
|
|
35608
36113
|
""
|
|
35609
36114
|
]
|
|
35610
36115
|
},
|
|
@@ -35621,10 +36126,10 @@
|
|
|
35621
36126
|
"value": [
|
|
35622
36127
|
"",
|
|
35623
36128
|
" $ timer(100) select * from t where id=500000, type in [3,6];",
|
|
35624
|
-
" Time elapsed:
|
|
36129
|
+
" Time elapsed: 172.808 ms",
|
|
35625
36130
|
"",
|
|
35626
36131
|
" $ timer(100) select * from t1 where id=500000, type in [3,6];",
|
|
35627
|
-
" Time elapsed:
|
|
36132
|
+
" Time elapsed: 1.664 ms",
|
|
35628
36133
|
""
|
|
35629
36134
|
]
|
|
35630
36135
|
},
|
|
@@ -35641,16 +36146,16 @@
|
|
|
35641
36146
|
"value": [
|
|
35642
36147
|
"",
|
|
35643
36148
|
" $ timer(100) select * from t where date in [2012.06.03, 2012.06.06];",
|
|
35644
|
-
" Time elapsed:
|
|
36149
|
+
" Time elapsed: 490.182 ms",
|
|
35645
36150
|
"",
|
|
35646
36151
|
" $ timer(100) select * from t1 where date in [2012.06.03, 2012.06.06];",
|
|
35647
|
-
" Time elapsed:
|
|
36152
|
+
" Time elapsed: 544.015 ms",
|
|
35648
36153
|
"",
|
|
35649
36154
|
" $ timer(100) select * from t where date=2012.06.03, type=8;",
|
|
35650
|
-
" Time elapsed:
|
|
36155
|
+
" Time elapsed: 205.443 ms",
|
|
35651
36156
|
"",
|
|
35652
36157
|
" $ timer(100) select * from t1 where date=2012.06.03, type=8;",
|
|
35653
|
-
" Time elapsed:
|
|
36158
|
+
" Time elapsed: 204.532 ms",
|
|
35654
36159
|
""
|
|
35655
36160
|
]
|
|
35656
36161
|
},
|
|
@@ -35667,17 +36172,20 @@
|
|
|
35667
36172
|
"value": [
|
|
35668
36173
|
"",
|
|
35669
36174
|
" $ timer(100) select * from t where id in [100,200], date in [2012.06.03, 2012.06.06], type in [3,6];",
|
|
35670
|
-
" Time elapsed:
|
|
36175
|
+
" Time elapsed: 208.714 ms",
|
|
35671
36176
|
"",
|
|
35672
36177
|
" $ timer(100) select * from t1 where id in [100,200], date in [2012.06.03, 2012.06.06], type in [3,6];",
|
|
35673
|
-
" Time elapsed:
|
|
36178
|
+
" Time elapsed: 198.674 ms",
|
|
35674
36179
|
""
|
|
35675
36180
|
]
|
|
35676
36181
|
},
|
|
35677
36182
|
{
|
|
35678
36183
|
"type": "text",
|
|
35679
36184
|
"value": [
|
|
35680
|
-
"Related function: :doc:`../k/keyedTable`"
|
|
36185
|
+
"Related function: :doc:`../k/keyedTable`",
|
|
36186
|
+
"",
|
|
36187
|
+
".. meta::",
|
|
36188
|
+
" :keywords: in-memory table"
|
|
35681
36189
|
]
|
|
35682
36190
|
}
|
|
35683
36191
|
]
|
|
@@ -38342,6 +38850,128 @@
|
|
|
38342
38850
|
}
|
|
38343
38851
|
]
|
|
38344
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
|
+
},
|
|
38345
38975
|
"isQuarterEnd": {
|
|
38346
38976
|
"title": "isQuarterEnd",
|
|
38347
38977
|
"type": "function",
|
|
@@ -38818,6 +39448,128 @@
|
|
|
38818
39448
|
}
|
|
38819
39449
|
]
|
|
38820
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
|
+
},
|
|
38821
39573
|
"isVoid": {
|
|
38822
39574
|
"title": "isVoid",
|
|
38823
39575
|
"type": "function",
|
|
@@ -40266,8 +41018,7 @@
|
|
|
40266
41018
|
"",
|
|
40267
41019
|
"`colTypes` is a string vector of data types. ",
|
|
40268
41020
|
"",
|
|
40269
|
-
"For the third scenario, *table* is a table. Please note that keyColumns in table cannot have duplicate values."
|
|
40270
|
-
""
|
|
41021
|
+
"For the third scenario, *table* is a table. Please note that keyColumns in table cannot have duplicate values."
|
|
40271
41022
|
]
|
|
40272
41023
|
}
|
|
40273
41024
|
]
|
|
@@ -40515,10 +41266,13 @@
|
|
|
40515
41266
|
"value": [
|
|
40516
41267
|
"",
|
|
40517
41268
|
" $ timer(100) select * from t where id=500000, date=2012.06.01, type=0;",
|
|
40518
|
-
" Time elapsed:
|
|
41269
|
+
" Time elapsed: 161.574 ms",
|
|
40519
41270
|
"",
|
|
40520
41271
|
" $ timer(100) select * from kt where id=500000, date=2012.06.01, type=0;",
|
|
40521
|
-
" 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",
|
|
40522
41276
|
""
|
|
40523
41277
|
]
|
|
40524
41278
|
},
|
|
@@ -40535,10 +41289,10 @@
|
|
|
40535
41289
|
"value": [
|
|
40536
41290
|
"",
|
|
40537
41291
|
" $ timer(100) select * from t where id in [1, 500000], date in 2012.06.01..2012.06.05, type=5;",
|
|
40538
|
-
" Time elapsed:
|
|
41292
|
+
" Time elapsed: 894.241 ms",
|
|
40539
41293
|
"",
|
|
40540
41294
|
" $ timer(100) select * from kt where id in [1, 500000], date in 2012.06.01..2012.06.05, type=5;",
|
|
40541
|
-
" Time elapsed:
|
|
41295
|
+
" Time elapsed: 2.322 ms",
|
|
40542
41296
|
""
|
|
40543
41297
|
]
|
|
40544
41298
|
},
|
|
@@ -40557,10 +41311,10 @@
|
|
|
40557
41311
|
"value": [
|
|
40558
41312
|
"",
|
|
40559
41313
|
" $ timer(100) select * from t where id in [1, 500000], date in 2012.06.01..2012.06.05, type in 1..5;",
|
|
40560
|
-
" Time elapsed:
|
|
40561
|
-
"",
|
|
41314
|
+
" Time elapsed: 801.347 ms",
|
|
41315
|
+
" ",
|
|
40562
41316
|
" $ timer(100) select * from kt where id in [1, 500000], date in 2012.06.01..2012.06.05, type in 1..5;",
|
|
40563
|
-
" Time elapsed:
|
|
41317
|
+
" Time elapsed: 834.184 ms",
|
|
40564
41318
|
""
|
|
40565
41319
|
]
|
|
40566
41320
|
},
|
|
@@ -40579,17 +41333,20 @@
|
|
|
40579
41333
|
"value": [
|
|
40580
41334
|
"",
|
|
40581
41335
|
" $ timer(100) select * from t where id=500000, date in 2012.06.01..2012.06.05;",
|
|
40582
|
-
" Time elapsed:
|
|
41336
|
+
" Time elapsed: 177.113 ms",
|
|
40583
41337
|
"",
|
|
40584
41338
|
" $ timer(100) select * from kt where id=500000, date in 2012.06.01..2012.06.05;",
|
|
40585
|
-
" Time elapsed:
|
|
41339
|
+
" Time elapsed: 163.265 ms",
|
|
40586
41340
|
" "
|
|
40587
41341
|
]
|
|
40588
41342
|
},
|
|
40589
41343
|
{
|
|
40590
41344
|
"type": "text",
|
|
40591
41345
|
"value": [
|
|
40592
|
-
"Related function: :doc:`../i/indexedTable`"
|
|
41346
|
+
"Related function: :doc:`../i/indexedTable`",
|
|
41347
|
+
"",
|
|
41348
|
+
".. meta::",
|
|
41349
|
+
" :keywords: in-memory table"
|
|
40593
41350
|
]
|
|
40594
41351
|
}
|
|
40595
41352
|
]
|
|
@@ -43049,7 +43806,7 @@
|
|
|
43049
43806
|
"",
|
|
43050
43807
|
"`partitions` is a scalar or vector indicating which partitions of the table to load into memory.",
|
|
43051
43808
|
"",
|
|
43052
|
-
"`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."
|
|
43053
43810
|
]
|
|
43054
43811
|
}
|
|
43055
43812
|
]
|
|
@@ -43063,7 +43820,7 @@
|
|
|
43063
43820
|
"value": [
|
|
43064
43821
|
"For a DFS table: return a table object with only the metadata.",
|
|
43065
43822
|
"",
|
|
43066
|
-
"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."
|
|
43067
43824
|
]
|
|
43068
43825
|
}
|
|
43069
43826
|
]
|
|
@@ -43075,7 +43832,7 @@
|
|
|
43075
43832
|
{
|
|
43076
43833
|
"type": "text",
|
|
43077
43834
|
"value": [
|
|
43078
|
-
"
|
|
43835
|
+
"In the distributed file system:",
|
|
43079
43836
|
"",
|
|
43080
43837
|
"* To load a partitioned table:",
|
|
43081
43838
|
""
|
|
@@ -43158,16 +43915,11 @@
|
|
|
43158
43915
|
{
|
|
43159
43916
|
"type": "text",
|
|
43160
43917
|
"value": [
|
|
43161
|
-
"\\2. In the local file system:",
|
|
43918
|
+
".. \\2. In the local file system:",
|
|
43162
43919
|
"",
|
|
43163
|
-
"* To load an unpartitioned table:",
|
|
43164
|
-
""
|
|
43165
|
-
|
|
43166
|
-
},
|
|
43167
|
-
{
|
|
43168
|
-
"type": "code",
|
|
43169
|
-
"language": "console",
|
|
43170
|
-
"value": [
|
|
43920
|
+
".. * To load an unpartitioned table:",
|
|
43921
|
+
"",
|
|
43922
|
+
".. .. code:: console",
|
|
43171
43923
|
"",
|
|
43172
43924
|
" $ n=2000000",
|
|
43173
43925
|
" $ syms=`IBM`C`MS`MSFT`JPM`ORCL`FB`GE",
|
|
@@ -43181,36 +43933,16 @@
|
|
|
43181
43933
|
" $ saveTable(db, t1, `t1);",
|
|
43182
43934
|
"",
|
|
43183
43935
|
" $ tt=loadTable(db,`t1);",
|
|
43184
|
-
""
|
|
43185
|
-
|
|
43186
|
-
|
|
43187
|
-
|
|
43188
|
-
"type": "text",
|
|
43189
|
-
"value": [
|
|
43190
|
-
"Alternatively, we can specify the folder path to load a table:",
|
|
43191
|
-
""
|
|
43192
|
-
]
|
|
43193
|
-
},
|
|
43194
|
-
{
|
|
43195
|
-
"type": "code",
|
|
43196
|
-
"language": "console",
|
|
43197
|
-
"value": [
|
|
43936
|
+
"",
|
|
43937
|
+
".. Alternatively, we can specify the folder path to load a table:",
|
|
43938
|
+
"",
|
|
43939
|
+
".. .. code:: console",
|
|
43198
43940
|
"",
|
|
43199
43941
|
" $ tt=loadTable(\"C:/DolphinDB/Data/db01\",`t1);",
|
|
43200
|
-
""
|
|
43201
|
-
|
|
43202
|
-
|
|
43203
|
-
|
|
43204
|
-
"type": "text",
|
|
43205
|
-
"value": [
|
|
43206
|
-
"* To load a subset of partitions:",
|
|
43207
|
-
""
|
|
43208
|
-
]
|
|
43209
|
-
},
|
|
43210
|
-
{
|
|
43211
|
-
"type": "code",
|
|
43212
|
-
"language": "console",
|
|
43213
|
-
"value": [
|
|
43942
|
+
"",
|
|
43943
|
+
".. * To load a subset of partitions:",
|
|
43944
|
+
"",
|
|
43945
|
+
".. .. code:: console",
|
|
43214
43946
|
"",
|
|
43215
43947
|
" $ n = 2000000",
|
|
43216
43948
|
" $ workDir = \"C:/DolphinDB/Data\"",
|
|
@@ -43221,54 +43953,24 @@
|
|
|
43221
43953
|
" $ db = database(workDir + \"/trade1\",VALUE,`IBM`MSFT`GM`C`YHOO`GOOG)",
|
|
43222
43954
|
" $ db.loadTextEx(\"trades\",\"sym\", workDir + \"/trades.txt\")",
|
|
43223
43955
|
" $ trades = db.loadTable(\"trades\",`IBM`GM`YHOO,1)",
|
|
43224
|
-
""
|
|
43225
|
-
|
|
43226
|
-
|
|
43227
|
-
|
|
43228
|
-
"type": "text",
|
|
43229
|
-
"value": [
|
|
43230
|
-
"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.",
|
|
43231
|
-
""
|
|
43232
|
-
]
|
|
43233
|
-
},
|
|
43234
|
-
{
|
|
43235
|
-
"type": "code",
|
|
43236
|
-
"language": "console",
|
|
43237
|
-
"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",
|
|
43238
43960
|
"",
|
|
43239
43961
|
" $ db = database(workDir + \"/trade2\",RANGE,[2000.01.01, 2000.04.01, 2000.07.01, 2000.10.01, 2001.01.01])",
|
|
43240
43962
|
" $ db.loadTextEx(\"trades\",\"date\", workDir + \"/trades.txt\")",
|
|
43241
|
-
""
|
|
43242
|
-
|
|
43243
|
-
|
|
43244
|
-
|
|
43245
|
-
"type": "text",
|
|
43246
|
-
"value": [
|
|
43247
|
-
"The following 2 commands are equivalent:",
|
|
43248
|
-
""
|
|
43249
|
-
]
|
|
43250
|
-
},
|
|
43251
|
-
{
|
|
43252
|
-
"type": "code",
|
|
43253
|
-
"language": "console",
|
|
43254
|
-
"value": [
|
|
43963
|
+
"",
|
|
43964
|
+
".. The following 2 commands are equivalent:",
|
|
43965
|
+
"",
|
|
43966
|
+
".. .. code:: console",
|
|
43255
43967
|
"",
|
|
43256
43968
|
" $ trades = db.loadTable(\"trades\",[2000.01.01, 2000.07.01],true)",
|
|
43257
43969
|
" $ trades = db.loadTable(\"trades\",[2000.03.06, 2000.09.15],true)",
|
|
43258
|
-
""
|
|
43259
|
-
|
|
43260
|
-
|
|
43261
|
-
|
|
43262
|
-
"type": "text",
|
|
43263
|
-
"value": [
|
|
43264
|
-
"* To load a partitioned table as an in-memory partitioned table:",
|
|
43265
|
-
""
|
|
43266
|
-
]
|
|
43267
|
-
},
|
|
43268
|
-
{
|
|
43269
|
-
"type": "code",
|
|
43270
|
-
"language": "console",
|
|
43271
|
-
"value": [
|
|
43970
|
+
"",
|
|
43971
|
+
".. * To load a partitioned table as an in-memory partitioned table:",
|
|
43972
|
+
"",
|
|
43973
|
+
".. .. code:: console",
|
|
43272
43974
|
"",
|
|
43273
43975
|
" $ n = 2000000",
|
|
43274
43976
|
" $ workDir = \"C:/DolphinDB/Data\"",
|
|
@@ -43283,12 +43985,7 @@
|
|
|
43283
43985
|
" $ db = database(workDir + \"/trade3\",RANGE, 0 5 10 15 20)",
|
|
43284
43986
|
" $ db.loadTextEx(\"trades\",\"price\", workDir + \"/trades.txt\")",
|
|
43285
43987
|
" $ trades = db.loadTable(\"trades\", ,1)",
|
|
43286
|
-
""
|
|
43287
|
-
]
|
|
43288
|
-
},
|
|
43289
|
-
{
|
|
43290
|
-
"type": "text",
|
|
43291
|
-
"value": [
|
|
43988
|
+
"",
|
|
43292
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."
|
|
43293
43990
|
]
|
|
43294
43991
|
}
|
|
@@ -43733,7 +44430,7 @@
|
|
|
43733
44430
|
{
|
|
43734
44431
|
"type": "text",
|
|
43735
44432
|
"value": [
|
|
43736
|
-
"`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.",
|
|
43737
44434
|
"",
|
|
43738
44435
|
"`tableName` a string indicating the name of the table with the imported data.",
|
|
43739
44436
|
"",
|
|
@@ -43770,7 +44467,7 @@
|
|
|
43770
44467
|
"value": [
|
|
43771
44468
|
"Load a text file into DolphinDB database.",
|
|
43772
44469
|
"",
|
|
43773
|
-
"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.",
|
|
43774
44471
|
"",
|
|
43775
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.",
|
|
43776
44473
|
"",
|
|
@@ -44670,6 +45367,117 @@
|
|
|
44670
45367
|
}
|
|
44671
45368
|
]
|
|
44672
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
|
+
},
|
|
44673
45481
|
"lower": {
|
|
44674
45482
|
"title": "lower",
|
|
44675
45483
|
"type": "function",
|
|
@@ -48983,6 +49791,75 @@
|
|
|
48983
49791
|
}
|
|
48984
49792
|
]
|
|
48985
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
|
+
},
|
|
48986
49863
|
"mmed": {
|
|
48987
49864
|
"title": "mmed",
|
|
48988
49865
|
"type": "function",
|
|
@@ -52759,6 +53636,91 @@
|
|
|
52759
53636
|
}
|
|
52760
53637
|
]
|
|
52761
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
|
+
},
|
|
52762
53724
|
"norm": {
|
|
52763
53725
|
"title": "norm",
|
|
52764
53726
|
"type": "function",
|
|
@@ -53632,7 +54594,10 @@
|
|
|
53632
54594
|
{
|
|
53633
54595
|
"type": "text",
|
|
53634
54596
|
"value": [
|
|
53635
|
-
"`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"
|
|
53636
54601
|
]
|
|
53637
54602
|
}
|
|
53638
54603
|
]
|
|
@@ -53644,7 +54609,26 @@
|
|
|
53644
54609
|
{
|
|
53645
54610
|
"type": "text",
|
|
53646
54611
|
"value": [
|
|
53647
|
-
"
|
|
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. "
|
|
53648
54632
|
]
|
|
53649
54633
|
}
|
|
53650
54634
|
]
|
|
@@ -53658,19 +54642,39 @@
|
|
|
53658
54642
|
"language": "console",
|
|
53659
54643
|
"value": [
|
|
53660
54644
|
"",
|
|
53661
|
-
"
|
|
53662
|
-
""
|
|
53663
|
-
|
|
53664
|
-
|
|
53665
|
-
|
|
53666
|
-
|
|
53667
|
-
|
|
53668
|
-
"
|
|
53669
|
-
"
|
|
53670
|
-
"
|
|
53671
|
-
"t
|
|
53672
|
-
"
|
|
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",
|
|
53673
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",
|
|
53674
54678
|
""
|
|
53675
54679
|
]
|
|
53676
54680
|
},
|
|
@@ -53679,21 +54683,33 @@
|
|
|
53679
54683
|
"language": "console",
|
|
53680
54684
|
"value": [
|
|
53681
54685
|
"",
|
|
53682
|
-
" $
|
|
53683
|
-
" $ objs(true);",
|
|
54686
|
+
" $ objs(true)",
|
|
53684
54687
|
""
|
|
53685
54688
|
]
|
|
53686
54689
|
},
|
|
53687
54690
|
{
|
|
53688
54691
|
"type": "text",
|
|
53689
54692
|
"value": [
|
|
53690
|
-
"
|
|
53691
|
-
"
|
|
53692
|
-
"
|
|
53693
|
-
"
|
|
53694
|
-
"
|
|
53695
|
-
"
|
|
53696
|
-
"
|
|
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
|
+
"======= ======== ============ ========== ======= ========== ======= ================="
|
|
53697
54713
|
]
|
|
53698
54714
|
}
|
|
53699
54715
|
]
|
|
@@ -54005,33 +55021,52 @@
|
|
|
54005
55021
|
"language": "console",
|
|
54006
55022
|
"value": [
|
|
54007
55023
|
"",
|
|
54008
|
-
" $
|
|
54009
|
-
" $
|
|
54010
|
-
" $
|
|
54011
|
-
" $
|
|
54012
|
-
" $
|
|
54013
|
-
"",
|
|
54014
|
-
"
|
|
54015
|
-
"
|
|
54016
|
-
"
|
|
54017
|
-
"
|
|
54018
|
-
"
|
|
54019
|
-
"
|
|
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\");",
|
|
54020
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
|
+
" ",
|
|
54021
55042
|
" RegressionStat->",
|
|
54022
55043
|
" item statistics",
|
|
54023
|
-
" ------------
|
|
54024
|
-
" R2 0.
|
|
54025
|
-
" AdjustedR2 0.
|
|
54026
|
-
" StdError
|
|
54027
|
-
" 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 ",
|
|
54028
55056
|
"",
|
|
54029
55057
|
" Coefficient->",
|
|
54030
|
-
" factor beta
|
|
54031
|
-
" ---------
|
|
54032
|
-
" intercept
|
|
54033
|
-
"
|
|
54034
|
-
"
|
|
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"
|
|
54035
55070
|
]
|
|
54036
55071
|
}
|
|
54037
55072
|
]
|
|
@@ -55290,7 +56325,7 @@
|
|
|
55290
56325
|
{
|
|
55291
56326
|
"type": "text",
|
|
55292
56327
|
"value": [
|
|
55293
|
-
"ploadText(filename, [delimiter], [schema], [skipRows=0])"
|
|
56328
|
+
"ploadText(filename, [delimiter], [schema], [skipRows=0], [arrayDelimiter])"
|
|
55294
56329
|
]
|
|
55295
56330
|
}
|
|
55296
56331
|
]
|
|
@@ -56384,6 +57419,92 @@
|
|
|
56384
57419
|
}
|
|
56385
57420
|
]
|
|
56386
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
|
+
},
|
|
56387
57508
|
"print": {
|
|
56388
57509
|
"title": "print",
|
|
56389
57510
|
"type": "command",
|
|
@@ -62611,10 +63732,12 @@
|
|
|
62611
63732
|
"\"QS\" quarterBegin",
|
|
62612
63733
|
"\"BQ\" businessQuarterEnd",
|
|
62613
63734
|
"\"BQS\" businessQuarterBegin",
|
|
63735
|
+
"\"REQ\" FY5253Quarter",
|
|
62614
63736
|
"\"A\" yearEnd",
|
|
62615
63737
|
"\"AS\" yearBegin",
|
|
62616
63738
|
"\"BA\" businessYearEnd",
|
|
62617
63739
|
"\"BAS\" businessYearBegin",
|
|
63740
|
+
"\"RE\" FY5253",
|
|
62618
63741
|
"\"D\" date",
|
|
62619
63742
|
"\"H\" hourOfDay",
|
|
62620
63743
|
"\"min\" minuteOfHour",
|
|
@@ -66519,97 +67642,6 @@
|
|
|
66519
67642
|
}
|
|
66520
67643
|
]
|
|
66521
67644
|
},
|
|
66522
|
-
"sample": {
|
|
66523
|
-
"title": "sample",
|
|
66524
|
-
"type": "function",
|
|
66525
|
-
"children": [
|
|
66526
|
-
{
|
|
66527
|
-
"title": "Syntax",
|
|
66528
|
-
"type": "grammer",
|
|
66529
|
-
"children": [
|
|
66530
|
-
{
|
|
66531
|
-
"type": "text",
|
|
66532
|
-
"value": [
|
|
66533
|
-
"sample(partitionCol, size)"
|
|
66534
|
-
]
|
|
66535
|
-
}
|
|
66536
|
-
]
|
|
66537
|
-
},
|
|
66538
|
-
{
|
|
66539
|
-
"title": "Arguments",
|
|
66540
|
-
"type": "parameters",
|
|
66541
|
-
"children": [
|
|
66542
|
-
{
|
|
66543
|
-
"type": "text",
|
|
66544
|
-
"value": [
|
|
66545
|
-
"`partitionCol` is a partitioning column. ",
|
|
66546
|
-
"",
|
|
66547
|
-
"`size` is a positive floating number or integer. "
|
|
66548
|
-
]
|
|
66549
|
-
}
|
|
66550
|
-
]
|
|
66551
|
-
},
|
|
66552
|
-
{
|
|
66553
|
-
"title": "Details",
|
|
66554
|
-
"type": "detail",
|
|
66555
|
-
"children": [
|
|
66556
|
-
{
|
|
66557
|
-
"type": "text",
|
|
66558
|
-
"value": [
|
|
66559
|
-
"Must be used in a ``where`` clause. Take a random sample of a number of partitions in a partitioned table. ",
|
|
66560
|
-
"",
|
|
66561
|
-
"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.",
|
|
66562
|
-
""
|
|
66563
|
-
]
|
|
66564
|
-
}
|
|
66565
|
-
]
|
|
66566
|
-
},
|
|
66567
|
-
{
|
|
66568
|
-
"title": "Examples",
|
|
66569
|
-
"type": "example",
|
|
66570
|
-
"children": [
|
|
66571
|
-
{
|
|
66572
|
-
"type": "code",
|
|
66573
|
-
"language": "console",
|
|
66574
|
-
"value": [
|
|
66575
|
-
""
|
|
66576
|
-
]
|
|
66577
|
-
},
|
|
66578
|
-
{
|
|
66579
|
-
"type": "text",
|
|
66580
|
-
"value": [
|
|
66581
|
-
" $ n=1000000",
|
|
66582
|
-
" $ ID=rand(50, n)",
|
|
66583
|
-
" $ x=rand(1.0, n)",
|
|
66584
|
-
" $ t=table(ID, x)",
|
|
66585
|
-
" $ db=database(\"C:/DolphinDB/Data/rangedb1\", RANGE, $ 0 10 20 30 40 50)",
|
|
66586
|
-
" $ pt = db.createPartitionedTable(t, `pt, `ID)",
|
|
66587
|
-
" $ pt.append!(t)",
|
|
66588
|
-
" $ pt=loadTable(db,`pt);",
|
|
66589
|
-
"",
|
|
66590
|
-
"Table pt has 5 partitions. To take a random sample of 2 partitions, we can use either of the following queries:",
|
|
66591
|
-
""
|
|
66592
|
-
]
|
|
66593
|
-
},
|
|
66594
|
-
{
|
|
66595
|
-
"type": "code",
|
|
66596
|
-
"language": "console",
|
|
66597
|
-
"value": [
|
|
66598
|
-
""
|
|
66599
|
-
]
|
|
66600
|
-
},
|
|
66601
|
-
{
|
|
66602
|
-
"type": "text",
|
|
66603
|
-
"value": [
|
|
66604
|
-
" $ x = select * from pt where sample(ID, 0.4);",
|
|
66605
|
-
"",
|
|
66606
|
-
" $ x = select * from pt where sample(ID, 2);"
|
|
66607
|
-
]
|
|
66608
|
-
}
|
|
66609
|
-
]
|
|
66610
|
-
}
|
|
66611
|
-
]
|
|
66612
|
-
},
|
|
66613
67645
|
"saveAsNpy": {
|
|
66614
67646
|
"title": "saveAsNpy",
|
|
66615
67647
|
"type": "command",
|
|
@@ -67023,7 +68055,7 @@
|
|
|
67023
68055
|
{
|
|
67024
68056
|
"type": "text",
|
|
67025
68057
|
"value": [
|
|
67026
|
-
"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`."
|
|
67027
68059
|
]
|
|
67028
68060
|
}
|
|
67029
68061
|
]
|
|
@@ -67042,13 +68074,13 @@
|
|
|
67042
68074
|
" $ value=rand(1.0, n)",
|
|
67043
68075
|
" $ t=table(ID, value);",
|
|
67044
68076
|
"",
|
|
67045
|
-
" $ db=database(\"
|
|
68077
|
+
" $ db=database(\"dfs://rangedb_Trades\", RANGE, 0 5 10)",
|
|
67046
68078
|
" $ Trades = db.createPartitionedTable(t, \"Trades\", \"ID\");",
|
|
67047
68079
|
" $ savePartition(db, t, `Trades)",
|
|
67048
68080
|
"",
|
|
67049
68081
|
" $ Trades=loadTable(db, `Trades)",
|
|
67050
68082
|
" $ select count(value) from Trades;",
|
|
67051
|
-
"
|
|
68083
|
+
" 1,000,000",
|
|
67052
68084
|
""
|
|
67053
68085
|
]
|
|
67054
68086
|
},
|
|
@@ -67073,7 +68105,7 @@
|
|
|
67073
68105
|
" $ savePartition(db, t1, `Trades)",
|
|
67074
68106
|
" $ Trades=loadTable(db, `Trades)",
|
|
67075
68107
|
" $ select count(value) from Trades;",
|
|
67076
|
-
"
|
|
68108
|
+
" 1,500,000"
|
|
67077
68109
|
]
|
|
67078
68110
|
}
|
|
67079
68111
|
]
|
|
@@ -67123,7 +68155,9 @@
|
|
|
67123
68155
|
{
|
|
67124
68156
|
"type": "text",
|
|
67125
68157
|
"value": [
|
|
67126
|
-
"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."
|
|
67127
68161
|
]
|
|
67128
68162
|
}
|
|
67129
68163
|
]
|
|
@@ -67186,7 +68220,7 @@
|
|
|
67186
68220
|
"language": "console",
|
|
67187
68221
|
"value": [
|
|
67188
68222
|
"",
|
|
67189
|
-
" $ saveTable(db, t, `t2,
|
|
68223
|
+
" $ saveTable(db, t, `t2, true);",
|
|
67190
68224
|
""
|
|
67191
68225
|
]
|
|
67192
68226
|
},
|
|
@@ -67202,7 +68236,15 @@
|
|
|
67202
68236
|
"language": "console",
|
|
67203
68237
|
"value": [
|
|
67204
68238
|
"",
|
|
67205
|
-
" $ 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"
|
|
67206
68248
|
]
|
|
67207
68249
|
}
|
|
67208
68250
|
]
|
|
@@ -69256,6 +70298,50 @@
|
|
|
69256
70298
|
}
|
|
69257
70299
|
]
|
|
69258
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
|
+
},
|
|
69259
70345
|
"setMaxBlockSizeForReservedMemory": {
|
|
69260
70346
|
"title": "setMaxBlockSizeForReservedMemory",
|
|
69261
70347
|
"type": "command",
|
|
@@ -69504,6 +70590,98 @@
|
|
|
69504
70590
|
}
|
|
69505
70591
|
]
|
|
69506
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
|
+
},
|
|
69507
70685
|
"setRaftElectionTick": {
|
|
69508
70686
|
"title": "setRaftElectionTick",
|
|
69509
70687
|
"type": "command",
|
|
@@ -73872,6 +75050,79 @@
|
|
|
73872
75050
|
}
|
|
73873
75051
|
]
|
|
73874
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
|
+
},
|
|
73875
75126
|
"string": {
|
|
73876
75127
|
"title": "string",
|
|
73877
75128
|
"type": "function",
|
|
@@ -78459,6 +79710,117 @@
|
|
|
78459
79710
|
}
|
|
78460
79711
|
]
|
|
78461
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
|
+
},
|
|
78462
79824
|
"transDS!": {
|
|
78463
79825
|
"title": "transDS!",
|
|
78464
79826
|
"type": "function",
|
|
@@ -79600,7 +80962,7 @@
|
|
|
79600
80962
|
{
|
|
79601
80963
|
"type": "text",
|
|
79602
80964
|
"value": [
|
|
79603
|
-
"Release variables or function definitions from the memory.
|
|
80965
|
+
"Release variables or function definitions from the memory. You can also release a local variable (VAR) from the memory using \"= NULL\"."
|
|
79604
80966
|
]
|
|
79605
80967
|
}
|
|
79606
80968
|
]
|
|
@@ -81174,6 +82536,138 @@
|
|
|
81174
82536
|
}
|
|
81175
82537
|
]
|
|
81176
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
|
+
},
|
|
81177
82671
|
"values": {
|
|
81178
82672
|
"title": "values",
|
|
81179
82673
|
"type": "function",
|
|
@@ -81541,7 +83035,7 @@
|
|
|
81541
83035
|
" $ volume=rand(100, n)",
|
|
81542
83036
|
" $ table1 = table(date, sym, price, volume)",
|
|
81543
83037
|
" $ outputTable = table(n:0, `sym`factor1, [STRING,DOUBLE])",
|
|
81544
|
-
" $ engine = createReactiveStateEngine(\"test\", <ema(
|
|
83038
|
+
" $ engine = createReactiveStateEngine(\"test\", <ema(volume, 40)>, table1, outputTable, \"sym\")",
|
|
81545
83039
|
" $ warmupStreamEngine(engine, table1)",
|
|
81546
83040
|
" $ date=take(2021.03.09, n)",
|
|
81547
83041
|
" $ sym=take(\"A\"+string(1..3000), n)",
|