dolphindb 2.0.913 → 2.0.915
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser.d.ts +1 -0
- package/browser.js.map +1 -1
- package/docs.en.json +166 -29
- package/docs.zh.json +115 -26
- package/index.d.ts +2 -1
- package/index.js +1 -3
- package/index.js.map +1 -1
- package/package.json +3 -4
- package/{theme.d.ts → theme.dark.d.ts} +5 -5
- package/theme.dark.js +235 -0
- package/theme.dark.js.map +1 -0
- package/theme.light.d.ts +60 -0
- package/{theme.js → theme.light.js} +3 -3
- package/theme.light.js.map +1 -0
- package/theme.js.map +0 -1
package/docs.en.json
CHANGED
|
@@ -20417,14 +20417,19 @@
|
|
|
20417
20417
|
{
|
|
20418
20418
|
"type": "text",
|
|
20419
20419
|
"value": [
|
|
20420
|
-
"
|
|
20421
|
-
"
|
|
20422
|
-
"
|
|
20423
|
-
"
|
|
20424
|
-
"
|
|
20425
|
-
"
|
|
20426
|
-
"
|
|
20427
|
-
"
|
|
20420
|
+
"+--+--+",
|
|
20421
|
+
"|#0|#1|",
|
|
20422
|
+
"+==+==+",
|
|
20423
|
+
"| | |",
|
|
20424
|
+
"+--+--+",
|
|
20425
|
+
"|2 |8 |",
|
|
20426
|
+
"+--+--+",
|
|
20427
|
+
"|-1| |",
|
|
20428
|
+
"+--+--+",
|
|
20429
|
+
"|3 | |",
|
|
20430
|
+
"+--+--+",
|
|
20431
|
+
"|1 |-1|",
|
|
20432
|
+
"+--+--+"
|
|
20428
20433
|
]
|
|
20429
20434
|
}
|
|
20430
20435
|
]
|
|
@@ -23869,13 +23874,25 @@
|
|
|
23869
23874
|
{
|
|
23870
23875
|
"type": "text",
|
|
23871
23876
|
"value": [
|
|
23872
|
-
"ema(X, window)",
|
|
23877
|
+
"ema(X, window, warmup=false)",
|
|
23873
23878
|
"",
|
|
23874
23879
|
"Please see :doc:`/FunctionsandCommands/Themes/TALib` for the parameters and windowing logic."
|
|
23875
23880
|
]
|
|
23876
23881
|
}
|
|
23877
23882
|
]
|
|
23878
23883
|
},
|
|
23884
|
+
{
|
|
23885
|
+
"title": "Arguments",
|
|
23886
|
+
"type": "parameters",
|
|
23887
|
+
"children": [
|
|
23888
|
+
{
|
|
23889
|
+
"type": "text",
|
|
23890
|
+
"value": [
|
|
23891
|
+
"`warmup` is a Boolean value. The default value is false, indicating that the first (window-1) elements windows return NULL. If set to true, elements in the first (window-1) windows are calculated based on the formula given in the details."
|
|
23892
|
+
]
|
|
23893
|
+
}
|
|
23894
|
+
]
|
|
23895
|
+
},
|
|
23879
23896
|
{
|
|
23880
23897
|
"title": "Details",
|
|
23881
23898
|
"type": "detail",
|
|
@@ -23883,13 +23900,19 @@
|
|
|
23883
23900
|
{
|
|
23884
23901
|
"type": "text",
|
|
23885
23902
|
"value": [
|
|
23886
|
-
"Calculate the Exponential Moving Average (ema) for *X* in a sliding window of the given length.",
|
|
23903
|
+
"Calculate the Exponential Moving Average (ema) for *X* in a count-based sliding window of the given length.",
|
|
23887
23904
|
"",
|
|
23888
|
-
"The formula is:",
|
|
23905
|
+
"The calculation formula is as follows:",
|
|
23906
|
+
"",
|
|
23907
|
+
"* warmup=false:",
|
|
23908
|
+
"",
|
|
23909
|
+
":math:`EMA_k = \\displaystyle{\\frac{2}{n+1}}*X_k + \\Bigl(1-\\displaystyle{\\frac{2}{n+1}}\\Bigr)*EMA_{k-1}`",
|
|
23889
23910
|
"",
|
|
23890
|
-
"
|
|
23911
|
+
"* warmup=true:",
|
|
23891
23912
|
"",
|
|
23892
|
-
"
|
|
23913
|
+
":math:`EMA_k=\\begin{cases}X_0,\\quad\\text{k=0}\\\\\\frac{2}{size(X)+1}*X_k+(1-\\frac{2}{size(X)+1})*EMA_{k-1}, \\quad\\text{size(X)<n}\\\\\\frac{2}{n+1}*X_k+(1-\\frac{2}{n+1})*EMA_{k-1}, \\quad size(X)\\geq n\\end{cases}`",
|
|
23914
|
+
"",
|
|
23915
|
+
"where :math:`EMA(X)_k` is the k-th exponential moving average, :math:`n` is the length of sliding window, :math:`X_k` is the k-th element of the vector X."
|
|
23893
23916
|
]
|
|
23894
23917
|
}
|
|
23895
23918
|
]
|
|
@@ -36373,7 +36396,25 @@
|
|
|
36373
36396
|
" $ y=4 3 2 1",
|
|
36374
36397
|
" $ points = point(x, y)",
|
|
36375
36398
|
" $ x1 = highDouble(points)",
|
|
36376
|
-
" [4,3,2,1]"
|
|
36399
|
+
" [4,3,2,1]",
|
|
36400
|
+
""
|
|
36401
|
+
]
|
|
36402
|
+
},
|
|
36403
|
+
{
|
|
36404
|
+
"type": "text",
|
|
36405
|
+
"value": [
|
|
36406
|
+
"Get the imaginary part of a complex number:",
|
|
36407
|
+
""
|
|
36408
|
+
]
|
|
36409
|
+
},
|
|
36410
|
+
{
|
|
36411
|
+
"type": "code",
|
|
36412
|
+
"language": "console",
|
|
36413
|
+
"value": [
|
|
36414
|
+
"",
|
|
36415
|
+
" $ a=complex(2, 5)",
|
|
36416
|
+
" $ highDouble(a)",
|
|
36417
|
+
" 5"
|
|
36377
36418
|
]
|
|
36378
36419
|
}
|
|
36379
36420
|
]
|
|
@@ -44894,7 +44935,46 @@
|
|
|
44894
44935
|
"\t$ x = 3 3 5 7 8 9 10 11 15 13 12 11 10",
|
|
44895
44936
|
"\t$ print linearTimeTrend(x,3)",
|
|
44896
44937
|
"\t([,,2.666666666666666,3,5.166666666666667,7,8,9,9.5,12,14.833333333333333,13,12],[,,1,2,1.5,1,1,1,2.5,1,-1.5,-1,-1])",
|
|
44897
|
-
"
|
|
44938
|
+
""
|
|
44939
|
+
]
|
|
44940
|
+
},
|
|
44941
|
+
{
|
|
44942
|
+
"type": "code",
|
|
44943
|
+
"language": "console",
|
|
44944
|
+
"value": [
|
|
44945
|
+
""
|
|
44946
|
+
]
|
|
44947
|
+
},
|
|
44948
|
+
{
|
|
44949
|
+
"type": "text",
|
|
44950
|
+
"value": [
|
|
44951
|
+
"\t$ n = 10",
|
|
44952
|
+
"\t$ t = table(09:00:00 + 1..n as time, rand(`A`B, n) as sym, rand(100.0, n) as val1, rand(1000..2000, n) as val2)",
|
|
44953
|
+
"\t$ select time, sym, linearTimeTrend(val1, 3) as `alpha`beta from t",
|
|
44954
|
+
"",
|
|
44955
|
+
"+----------+-----+---------+----------+",
|
|
44956
|
+
"| time | sym | alpha | beta |",
|
|
44957
|
+
"+==========+=====+=========+==========+",
|
|
44958
|
+
"| 09:00:01 | B | | |",
|
|
44959
|
+
"+----------+-----+---------+----------+",
|
|
44960
|
+
"| 09:00:02 | A | | |",
|
|
44961
|
+
"+----------+-----+---------+----------+",
|
|
44962
|
+
"| 09:00:03 | A | 85.0844 | -30.0688 |",
|
|
44963
|
+
"+----------+-----+---------+----------+",
|
|
44964
|
+
"| 09:00:04 | B | 49.3461 | 7.3621 |",
|
|
44965
|
+
"+----------+-----+---------+----------+",
|
|
44966
|
+
"| 09:00:05 | B | 30.4248 | 28.3589 |",
|
|
44967
|
+
"+----------+-----+---------+----------+",
|
|
44968
|
+
"| 09:00:06 | A | 83.106 | -7.7515 |",
|
|
44969
|
+
"+----------+-----+---------+----------+",
|
|
44970
|
+
"| 09:00:07 | B | 78.4412 | -17.7575 |",
|
|
44971
|
+
"+----------+-----+---------+----------+",
|
|
44972
|
+
"| 09:00:08 | A | 56.8575 | 4.4732 |",
|
|
44973
|
+
"+----------+-----+---------+----------+",
|
|
44974
|
+
"| 09:00:09 | A | 53.8492 | -6.0653 |",
|
|
44975
|
+
"+----------+-----+---------+----------+",
|
|
44976
|
+
"| 09:00:10 | A | 61.7888 | -4.5586 |",
|
|
44977
|
+
"+----------+-----+---------+----------+"
|
|
44898
44978
|
]
|
|
44899
44979
|
}
|
|
44900
44980
|
]
|
|
@@ -47981,7 +48061,25 @@
|
|
|
47981
48061
|
" $ y=4 3 2 1",
|
|
47982
48062
|
" $ points = point(x, y)",
|
|
47983
48063
|
" $ x1 = lowDouble(points)",
|
|
47984
|
-
" [1,2,3,4]"
|
|
48064
|
+
" [1,2,3,4]",
|
|
48065
|
+
""
|
|
48066
|
+
]
|
|
48067
|
+
},
|
|
48068
|
+
{
|
|
48069
|
+
"type": "text",
|
|
48070
|
+
"value": [
|
|
48071
|
+
"Get the real part of the complex number:",
|
|
48072
|
+
""
|
|
48073
|
+
]
|
|
48074
|
+
},
|
|
48075
|
+
{
|
|
48076
|
+
"type": "code",
|
|
48077
|
+
"language": "console",
|
|
48078
|
+
"value": [
|
|
48079
|
+
"",
|
|
48080
|
+
" $ a=complex(2, 5)",
|
|
48081
|
+
" $ lowDouble(a)",
|
|
48082
|
+
" 2"
|
|
47985
48083
|
]
|
|
47986
48084
|
}
|
|
47987
48085
|
]
|
|
@@ -57679,7 +57777,7 @@
|
|
|
57679
57777
|
"",
|
|
57680
57778
|
"`colTypes` is a string vector of column types.",
|
|
57681
57779
|
"",
|
|
57682
|
-
"`path` is a string indicating the absolute path of the table on disk. ",
|
|
57780
|
+
"`path` is a string indicating the absolute path of the table on disk. The DFS path is not supported.",
|
|
57683
57781
|
"",
|
|
57684
57782
|
"`tableName` is a string indicating the name of the table on disk. "
|
|
57685
57783
|
]
|
|
@@ -57695,7 +57793,9 @@
|
|
|
57695
57793
|
"value": [
|
|
57696
57794
|
"Create an MVCC (Multi Version Concurrency Control) table. When appending, updating or deleting rows of a table, another version of the table is created so that concurrent read will not be blocked. The mvcc table is optimal for the use case with frequent read and append, but few update and delete operations.",
|
|
57697
57795
|
"",
|
|
57698
|
-
"If parameters
|
|
57796
|
+
"If parameters *path* and *tableName* are specified, the table will be persisted to disk. The table on disk can be loaded into memory with function :doc:`../l/loadMvccTable`.",
|
|
57797
|
+
"",
|
|
57798
|
+
"Note: The MVCC table does not support ``addColumn``, ``dropColumns!``, ``replaceColumn!``, ``reorderColumns!``, ``upsert!``, ``drop``, ``erase!``."
|
|
57699
57799
|
]
|
|
57700
57800
|
}
|
|
57701
57801
|
]
|
|
@@ -65392,13 +65492,18 @@
|
|
|
65392
65492
|
"",
|
|
65393
65493
|
"`ignoreNA` is a Boolean value indicating whether NULL values are ignored.",
|
|
65394
65494
|
"",
|
|
65395
|
-
"`tiesMethod` is a string
|
|
65495
|
+
"`tiesMethod` is a string indicating how to rank the group of elements with the same value (i.e., ties):",
|
|
65396
65496
|
"",
|
|
65397
|
-
"* 'min' :
|
|
65398
|
-
"* 'max' :
|
|
65399
|
-
"* 'average' :
|
|
65497
|
+
"* 'min' : the smallest rank value of the tie values.",
|
|
65498
|
+
"* 'max' : the largest rank value of the tie values. ",
|
|
65499
|
+
"* 'average' : the average of the rank values for all ties. ",
|
|
65500
|
+
"* 'first': Gives the first found tie value the lowest rank value, and continues with the following rank value for the next tie. ",
|
|
65400
65501
|
"",
|
|
65401
|
-
"`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false."
|
|
65502
|
+
"`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.",
|
|
65503
|
+
"",
|
|
65504
|
+
"`precision` is an integer between [1, 15]. If the absolute difference between two values is no greater than 10^(-precision), the two values are considered to be equal.",
|
|
65505
|
+
"",
|
|
65506
|
+
"Note: If parameter *precision* is specified, *X* must be numeric, and the *tiesMethod* cannot be specified as 'first'."
|
|
65402
65507
|
]
|
|
65403
65508
|
}
|
|
65404
65509
|
]
|
|
@@ -72738,13 +72843,18 @@
|
|
|
72738
72843
|
"",
|
|
72739
72844
|
"`ignoreNA` is a Boolean value indicating whether NULL values are ignored.",
|
|
72740
72845
|
"",
|
|
72741
|
-
"`tiesMethod` is a string
|
|
72846
|
+
"`tiesMethod` is a string indicating how to rank the group of elements with the same value (i.e., ties):",
|
|
72742
72847
|
"",
|
|
72743
|
-
" * 'min':
|
|
72744
|
-
" * 'max':
|
|
72745
|
-
" * 'average':
|
|
72848
|
+
" * 'min': the smallest rank value of the tie values. ",
|
|
72849
|
+
" * 'max': the largest rank value of the tie values.",
|
|
72850
|
+
" * 'average': the average of the rank values for all ties. ",
|
|
72851
|
+
" * 'first': Gives the first found tie value the lowest rank value, and continues with the following rank value for the next tie.",
|
|
72746
72852
|
"",
|
|
72747
|
-
"`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false."
|
|
72853
|
+
"`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.",
|
|
72854
|
+
"",
|
|
72855
|
+
"`precision` is an integer between [1, 15]. If the absolute difference between two values is no greater than 10^(-precision), the two values are considered to be equal. ",
|
|
72856
|
+
"",
|
|
72857
|
+
"Note: If parameter *precision* is specified, *X* must be numeric, and the *tiesMethod* cannot be specified as 'first'."
|
|
72748
72858
|
]
|
|
72749
72859
|
}
|
|
72750
72860
|
]
|
|
@@ -76829,7 +76939,7 @@
|
|
|
76829
76939
|
{
|
|
76830
76940
|
"type": "text",
|
|
76831
76941
|
"value": [
|
|
76832
|
-
"Add comments to table
|
|
76942
|
+
"Add comments to columns of an in-memory table or an MVCC table. Use function :doc:`../../FunctionReferences/s/schema` to view column comments."
|
|
76833
76943
|
]
|
|
76834
76944
|
}
|
|
76835
76945
|
]
|
|
@@ -76880,6 +76990,33 @@
|
|
|
76880
76990
|
"vol INT 4 trading volume (shares)",
|
|
76881
76991
|
"amount DOUBLE 16 trading volume (dollar)",
|
|
76882
76992
|
"========= ========== ======= ========================",
|
|
76993
|
+
""
|
|
76994
|
+
]
|
|
76995
|
+
},
|
|
76996
|
+
{
|
|
76997
|
+
"type": "code",
|
|
76998
|
+
"language": "console",
|
|
76999
|
+
"value": [
|
|
77000
|
+
"",
|
|
77001
|
+
" $ id=`XOM`GS`AAPL",
|
|
77002
|
+
" $ x=102.1 33.4 73.6",
|
|
77003
|
+
" $ mt = mvccTable(id, x);",
|
|
77004
|
+
" $ setColumnComment(mt, {id:\"identifier\"})",
|
|
77005
|
+
" $ schema(mt).colDefs",
|
|
77006
|
+
""
|
|
77007
|
+
]
|
|
77008
|
+
},
|
|
77009
|
+
{
|
|
77010
|
+
"type": "text",
|
|
77011
|
+
"value": [
|
|
77012
|
+
"+------+------------+---------+-------+----------+",
|
|
77013
|
+
"| name | typeString | typeInt | extra | comment |",
|
|
77014
|
+
"+======+============+=========+=======+==========+",
|
|
77015
|
+
"| id | STRING | 18 | |identifier|",
|
|
77016
|
+
"+------+------------+---------+-------+----------+",
|
|
77017
|
+
"| x | DOUBLE | 16 | | |",
|
|
77018
|
+
"+------+------------+---------+-------+----------+",
|
|
77019
|
+
"",
|
|
76883
77020
|
"",
|
|
76884
77021
|
".. meta:: ",
|
|
76885
77022
|
" :keywords: set"
|
package/docs.zh.json
CHANGED
|
@@ -1393,7 +1393,7 @@
|
|
|
1393
1393
|
"value": [
|
|
1394
1394
|
"增加数据节点或计算节点。新增加的节点为关闭状态,需要通过Web集群管理器或命令行启动。",
|
|
1395
1395
|
"",
|
|
1396
|
-
"注意,如果要在新的服务器上增加节点,要先部署代理节点。详情请参考教程 `多服务器集群部署 <https://gitee.com/dolphindb/Tutorials_CN/blob/master
|
|
1396
|
+
"注意,如果要在新的服务器上增加节点,要先部署代理节点。详情请参考教程 `多服务器集群部署 <https://gitee.com/dolphindb/Tutorials_CN/blob/master/multi_machine_cluster_deployment.md>`_ 。"
|
|
1397
1397
|
]
|
|
1398
1398
|
}
|
|
1399
1399
|
]
|
|
@@ -15028,7 +15028,7 @@
|
|
|
15028
15028
|
"",
|
|
15029
15029
|
"`metrics` 以元代码的形式表示计算公式。有关元代码的详情可参考 :doc:`/Objects/Metaprogramming`。若需使用用户自定义函数,请注意以下两点:",
|
|
15030
15030
|
"",
|
|
15031
|
-
"1. 需在定义前添加声明 \"@state\"。状态函数只能包含赋值语句和 return
|
|
15031
|
+
"1. 需在定义前添加声明 \"@state\"。状态函数只能包含赋值语句和 return 语句。自 1.30.21 版本起,支持使用 if-else 条件语句,且条件只能是标量。",
|
|
15032
15032
|
"",
|
|
15033
15033
|
"2. 若赋值语句的右值是一个多返回值的函数,则需要将多个返回值同时赋予多个变量。例如:两个返回值的函数 linearTimeTrend 应用于自定义状态函数中,正确写法为:",
|
|
15034
15034
|
"",
|
|
@@ -21329,14 +21329,19 @@
|
|
|
21329
21329
|
{
|
|
21330
21330
|
"type": "text",
|
|
21331
21331
|
"value": [
|
|
21332
|
-
"
|
|
21333
|
-
"
|
|
21334
|
-
"
|
|
21335
|
-
"
|
|
21336
|
-
"
|
|
21337
|
-
"
|
|
21338
|
-
"
|
|
21339
|
-
"
|
|
21332
|
+
"+--+--+",
|
|
21333
|
+
"|#0|#1|",
|
|
21334
|
+
"+==+==+",
|
|
21335
|
+
"| | |",
|
|
21336
|
+
"+--+--+",
|
|
21337
|
+
"|2 |8 |",
|
|
21338
|
+
"+--+--+",
|
|
21339
|
+
"|-1| |",
|
|
21340
|
+
"+--+--+",
|
|
21341
|
+
"|3 | |",
|
|
21342
|
+
"+--+--+",
|
|
21343
|
+
"|1 |-1|",
|
|
21344
|
+
"+--+--+"
|
|
21340
21345
|
]
|
|
21341
21346
|
}
|
|
21342
21347
|
]
|
|
@@ -23715,7 +23720,7 @@
|
|
|
23715
23720
|
"",
|
|
23716
23721
|
"`partitionPaths` 有两种指定模式:",
|
|
23717
23722
|
"",
|
|
23718
|
-
"* 指定路径:以 \"/\"
|
|
23723
|
+
"* 指定路径:以 \"/\" 开头的字符串或字符串向量,表示数据库目录下单个或多个分区的路径。请注意对组合分区,路径必须包括所有层次分区。",
|
|
23719
23724
|
"* 指定条件:以分区列的一个或多个值组成的标量或向量作为过滤条件,系统会找到并删除这些值所在的分区。对于组合分区,partitionPaths 是由每层分区的过滤条件组成的元组,如果某层分区不需要过滤,那么相应的过滤条件需置为空。",
|
|
23720
23725
|
"",
|
|
23721
23726
|
"`tableName` 一个字符串,表示表名。若分区粒度为数据库级(:doc:`/FunctionsandCommands/FunctionReferences/d/database`: *chunkGranularity* = 'DATABASE'),可以不指定 *tableName*,否则必须指定该参数。",
|
|
@@ -38038,11 +38043,29 @@
|
|
|
38038
38043
|
"language": "console",
|
|
38039
38044
|
"value": [
|
|
38040
38045
|
"",
|
|
38041
|
-
" $
|
|
38046
|
+
" $ x=1 2 3 4",
|
|
38042
38047
|
" $ y=4 3 2 1",
|
|
38043
38048
|
" $ points = point(x, y)",
|
|
38044
38049
|
" $ x1 = highDouble(points)",
|
|
38045
|
-
" [4,3,2,1]"
|
|
38050
|
+
" [4,3,2,1]",
|
|
38051
|
+
""
|
|
38052
|
+
]
|
|
38053
|
+
},
|
|
38054
|
+
{
|
|
38055
|
+
"type": "text",
|
|
38056
|
+
"value": [
|
|
38057
|
+
"获取一个复数的虚部(虚数)",
|
|
38058
|
+
""
|
|
38059
|
+
]
|
|
38060
|
+
},
|
|
38061
|
+
{
|
|
38062
|
+
"type": "code",
|
|
38063
|
+
"language": "console",
|
|
38064
|
+
"value": [
|
|
38065
|
+
"",
|
|
38066
|
+
" $ a=complex(2, 5)",
|
|
38067
|
+
" $ highDouble(a)",
|
|
38068
|
+
" 5"
|
|
38046
38069
|
]
|
|
38047
38070
|
}
|
|
38048
38071
|
]
|
|
@@ -50009,7 +50032,7 @@
|
|
|
50009
50032
|
{
|
|
50010
50033
|
"type": "text",
|
|
50011
50034
|
"value": [
|
|
50012
|
-
"返回值为 X 的低位8字节的数据,为DOUBLE类型。"
|
|
50035
|
+
"返回值为 *X* 的低位8字节的数据,为 DOUBLE 类型。"
|
|
50013
50036
|
]
|
|
50014
50037
|
}
|
|
50015
50038
|
]
|
|
@@ -50023,11 +50046,29 @@
|
|
|
50023
50046
|
"language": "console",
|
|
50024
50047
|
"value": [
|
|
50025
50048
|
"",
|
|
50026
|
-
" $
|
|
50049
|
+
" $ x=1 2 3 4",
|
|
50027
50050
|
" $ y=4 3 2 1",
|
|
50028
50051
|
" $ points = point(x, y)",
|
|
50029
50052
|
" $ x1 = lowDouble(points)",
|
|
50030
|
-
" [1,2,3,4]"
|
|
50053
|
+
" [1,2,3,4]",
|
|
50054
|
+
""
|
|
50055
|
+
]
|
|
50056
|
+
},
|
|
50057
|
+
{
|
|
50058
|
+
"type": "text",
|
|
50059
|
+
"value": [
|
|
50060
|
+
"获取一个复数的实部(实数)",
|
|
50061
|
+
""
|
|
50062
|
+
]
|
|
50063
|
+
},
|
|
50064
|
+
{
|
|
50065
|
+
"type": "code",
|
|
50066
|
+
"language": "console",
|
|
50067
|
+
"value": [
|
|
50068
|
+
"",
|
|
50069
|
+
" $ a=complex(2, 5)",
|
|
50070
|
+
" $ lowDouble(a)",
|
|
50071
|
+
" 2"
|
|
50031
50072
|
]
|
|
50032
50073
|
}
|
|
50033
50074
|
]
|
|
@@ -59824,7 +59865,7 @@
|
|
|
59824
59865
|
"",
|
|
59825
59866
|
"如果指定了 *path* 和 *tableName* 参数,会把表持久化到硬盘上。通过 :doc:`../l/loadMvccTable` 函数,可以把磁盘上的表加载到内存中。",
|
|
59826
59867
|
"",
|
|
59827
|
-
"注:mvcc table 不支持 addColumn、dropColumns!、reorderColumns!、upsert!、drop、erase!
|
|
59868
|
+
"注:mvcc table 不支持 addColumn、dropColumns!、replaceColumn!、reorderColumns!、upsert!、drop、erase! 函数。"
|
|
59828
59869
|
]
|
|
59829
59870
|
}
|
|
59830
59871
|
]
|
|
@@ -69534,9 +69575,9 @@
|
|
|
69534
69575
|
"value": [
|
|
69535
69576
|
"`conn` 是远程数据库的连接句柄。",
|
|
69536
69577
|
"",
|
|
69537
|
-
"`script`
|
|
69578
|
+
"`script` 是要执行的脚本或函数名。",
|
|
69538
69579
|
"",
|
|
69539
|
-
"
|
|
69580
|
+
"`args` 可选参数,如果 `script` 是函数名,`args` 是函数的参数。"
|
|
69540
69581
|
]
|
|
69541
69582
|
}
|
|
69542
69583
|
]
|
|
@@ -94906,7 +94947,11 @@
|
|
|
94906
94947
|
"",
|
|
94907
94948
|
"或",
|
|
94908
94949
|
"",
|
|
94909
|
-
"unionAll(tables, [partition=true], [byColName=false])"
|
|
94950
|
+
"unionAll(tables, [partition=true], [byColName=false])",
|
|
94951
|
+
"",
|
|
94952
|
+
"或",
|
|
94953
|
+
"",
|
|
94954
|
+
"unionAll(tables, tableB)"
|
|
94910
94955
|
]
|
|
94911
94956
|
}
|
|
94912
94957
|
]
|
|
@@ -94918,11 +94963,23 @@
|
|
|
94918
94963
|
{
|
|
94919
94964
|
"type": "text",
|
|
94920
94965
|
"value": [
|
|
94921
|
-
"
|
|
94966
|
+
"* 用法一:",
|
|
94967
|
+
"",
|
|
94968
|
+
"`tableA` 和 `tableB` 是列数相同的内存表。",
|
|
94969
|
+
"",
|
|
94970
|
+
"* 用法二:",
|
|
94971
|
+
"",
|
|
94972
|
+
"`tables` 是一个元组,其中每个元素都是一个表,并且它们具有相同的列数。",
|
|
94922
94973
|
"",
|
|
94923
|
-
"
|
|
94974
|
+
"`partition` 是布尔值,表示是否进行顺序分区(SEQ),默认值是true。",
|
|
94924
94975
|
"",
|
|
94925
|
-
"`byColName` 是一个布尔值。若设为true,表示表合并时,依照列名进行,各表中相同列名的列进行合并,缺失的列用空值填充。若设为false,表示表合并时仅基于列顺序,不管列名是否一致。"
|
|
94976
|
+
"`byColName` 是一个布尔值。若设为 true,表示表合并时,依照列名进行,各表中相同列名的列进行合并,缺失的列用空值填充。若设为 false,表示表合并时仅基于列顺序,不管列名是否一致。",
|
|
94977
|
+
"",
|
|
94978
|
+
"* 用法三:",
|
|
94979
|
+
"",
|
|
94980
|
+
"`tables` 是一个元组,其中每个元素都是一个内存表,并且它们具有相同的列数。`tableB` 是一个和 tables 中表列数相同的内存表。常用于 mr 语句的 finalFunc。",
|
|
94981
|
+
"",
|
|
94982
|
+
"注:tableA, tableB, tables 支持以下内存表:table, keyedTable, indexedTable, latestKeyedTable, latestIndexedTable。此外,用法三的 tableB 还可以是一个分区内存表。"
|
|
94926
94983
|
]
|
|
94927
94984
|
}
|
|
94928
94985
|
]
|
|
@@ -94952,7 +95009,7 @@
|
|
|
94952
95009
|
{
|
|
94953
95010
|
"type": "text",
|
|
94954
95011
|
"value": [
|
|
94955
|
-
"
|
|
95012
|
+
"用法一:合并两个内存表",
|
|
94956
95013
|
""
|
|
94957
95014
|
]
|
|
94958
95015
|
},
|
|
@@ -94997,7 +95054,7 @@
|
|
|
94997
95054
|
" $ typestr(re);",
|
|
94998
95055
|
" IN-MEMORY TABLE",
|
|
94999
95056
|
"",
|
|
95000
|
-
"
|
|
95057
|
+
"用法二:合并多个内存表",
|
|
95001
95058
|
""
|
|
95002
95059
|
]
|
|
95003
95060
|
},
|
|
@@ -95045,7 +95102,7 @@
|
|
|
95045
95102
|
" $ typestr(re);",
|
|
95046
95103
|
" SEGMENTED IN-MEMORY TABLE",
|
|
95047
95104
|
"",
|
|
95048
|
-
"
|
|
95105
|
+
"指定 byColName:",
|
|
95049
95106
|
""
|
|
95050
95107
|
]
|
|
95051
95108
|
},
|
|
@@ -95148,6 +95205,38 @@
|
|
|
95148
95205
|
"value": [
|
|
95149
95206
|
"上例中可见,若各表中列数不一致,必须将 *byColName* 设为true。",
|
|
95150
95207
|
"",
|
|
95208
|
+
"",
|
|
95209
|
+
"用法三:将多个内存表合并到分区内存表",
|
|
95210
|
+
""
|
|
95211
|
+
]
|
|
95212
|
+
},
|
|
95213
|
+
{
|
|
95214
|
+
"type": "code",
|
|
95215
|
+
"language": "console",
|
|
95216
|
+
"value": [
|
|
95217
|
+
"",
|
|
95218
|
+
" $ def testFunc(data, off){",
|
|
95219
|
+
" $ return select *, price * (1-off) as `discountPrice from data",
|
|
95220
|
+
" $ }",
|
|
95221
|
+
" $ n = 100",
|
|
95222
|
+
" $ dates = 2021.01.01..2021.12.31",
|
|
95223
|
+
" $ t = table(take(dates, 365 * n).sort() as `date, `sym + take(1..n, 365 * n).sort()$STRING as `sym, round(10 + norm(0, 2, 365 * n), 2) as `price)",
|
|
95224
|
+
"",
|
|
95225
|
+
" $ db = database(\"\", VALUE, 2021.01.01..2021.12.31)",
|
|
95226
|
+
" $ trade = db.createPartitionedTable(table=t, tableName=\"trade\", partitionColumns=`date).append!(t)",
|
|
95227
|
+
" $ db = database(\"\", RANGE, date(month(dates.first()) .. (month(dates.last()) + 1)))",
|
|
95228
|
+
" $ outputT=table(1:0, `date`sym`price`discountPrice, [DATE,SYMBOL,DOUBLE,DOUBLE])",
|
|
95229
|
+
" $ ports = db.createPartitionedTable(outputT, \"ports\", `date)",
|
|
95230
|
+
" //map reduce",
|
|
95231
|
+
" $ mr(sqlDS(<select * from trade>), testFunc{,0.3},,unionAll{,ports})",
|
|
95232
|
+
"",
|
|
95233
|
+
" $ select * from ports",
|
|
95234
|
+
""
|
|
95235
|
+
]
|
|
95236
|
+
},
|
|
95237
|
+
{
|
|
95238
|
+
"type": "text",
|
|
95239
|
+
"value": [
|
|
95151
95240
|
".. meta:: ",
|
|
95152
95241
|
" :keywords: union"
|
|
95153
95242
|
]
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type { InspectOptions as UtilInspectOptions } from 'util';
|
|
3
|
-
import { inspect } from 'xshell
|
|
3
|
+
import { inspect } from 'xshell';
|
|
4
4
|
export declare enum DdbForm {
|
|
5
5
|
scalar = 0,
|
|
6
6
|
vector = 1,
|
|
@@ -181,6 +181,7 @@ Uint8Array[] | // blob
|
|
|
181
181
|
DdbObj[] | // any
|
|
182
182
|
DdbSymbolExtendedValue | DdbArrayVectorValue | DdbDecimal32VectorValue | DdbDecimal64VectorValue;
|
|
183
183
|
export type DdbValue = DdbScalarValue | DdbVectorValue | DdbMatrixValue | DdbDictValue | DdbChartValue;
|
|
184
|
+
export type DdbStringObj = DdbObj<string>;
|
|
184
185
|
export type DdbVectorObj = DdbObj<DdbVectorValue>;
|
|
185
186
|
export type DdbVectorAnyObj = DdbObj<DdbObj[]>;
|
|
186
187
|
export type DdbVectorStringObj = DdbObj<string[]>;
|
package/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// import { table, getBorderCharacters, type TableUserConfig } from 'table'
|
|
2
|
-
import { WebSocket } from 'ws';
|
|
3
2
|
import dayjs from 'dayjs';
|
|
4
3
|
import DayjsCustomParseFormat from 'dayjs/plugin/customParseFormat.js';
|
|
5
4
|
dayjs.extend(DayjsCustomParseFormat);
|
|
6
5
|
import ipaddrjs from 'ipaddr.js';
|
|
7
6
|
const { fromByteArray: buf2ipaddr } = ipaddrjs;
|
|
8
|
-
import { concat, assert, inspect, typed_array_to_buffer } from 'xshell
|
|
9
|
-
import { connect_websocket } from 'xshell/net.js';
|
|
7
|
+
import { concat, assert, inspect, typed_array_to_buffer, connect_websocket, WebSocket } from 'xshell';
|
|
10
8
|
import { t } from './i18n/index.js';
|
|
11
9
|
export var DdbForm;
|
|
12
10
|
(function (DdbForm) {
|