dolphindb 2.0.527 → 2.0.530
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 +4 -3
- package/browser.js +50 -39
- package/browser.js.map +1 -1
- package/docs.en.json +2732 -276
- package/docs.zh.json +1939 -360
- package/index.d.ts +3 -2
- package/index.js +47 -37
- package/index.js.map +1 -1
- package/package.json +3 -3
package/docs.en.json
CHANGED
|
@@ -704,6 +704,134 @@
|
|
|
704
704
|
}
|
|
705
705
|
]
|
|
706
706
|
},
|
|
707
|
+
"addAccessControl": {
|
|
708
|
+
"title": "addAccessControl",
|
|
709
|
+
"type": "command",
|
|
710
|
+
"children": [
|
|
711
|
+
{
|
|
712
|
+
"title": "Syntax",
|
|
713
|
+
"type": "grammer",
|
|
714
|
+
"children": [
|
|
715
|
+
{
|
|
716
|
+
"type": "text",
|
|
717
|
+
"value": [
|
|
718
|
+
"addAccessControl(table)"
|
|
719
|
+
]
|
|
720
|
+
}
|
|
721
|
+
]
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
"title": "Arguments",
|
|
725
|
+
"type": "parameters",
|
|
726
|
+
"children": [
|
|
727
|
+
{
|
|
728
|
+
"type": "text",
|
|
729
|
+
"value": [
|
|
730
|
+
"`table` is a shared table or a streaming engine."
|
|
731
|
+
]
|
|
732
|
+
}
|
|
733
|
+
]
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
"title": "Details",
|
|
737
|
+
"type": "detail",
|
|
738
|
+
"children": [
|
|
739
|
+
{
|
|
740
|
+
"type": "text",
|
|
741
|
+
"value": [
|
|
742
|
+
"The current user can add access control to the table created by herself. Other users can access this table only after the administrator grants the privilege.",
|
|
743
|
+
"",
|
|
744
|
+
"Please note:",
|
|
745
|
+
"",
|
|
746
|
+
"1. It can only be executed by the user who created the table or administrators.",
|
|
747
|
+
"",
|
|
748
|
+
"2. If the administrator has set access privileges to the table for other users by grant/deny/revoke, access control will be automatically added without calling addAccessControl. Users that are not granted privileges by the administrator cannot access the table."
|
|
749
|
+
]
|
|
750
|
+
}
|
|
751
|
+
]
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"title": "Examples",
|
|
755
|
+
"type": "example",
|
|
756
|
+
"children": [
|
|
757
|
+
{
|
|
758
|
+
"type": "text",
|
|
759
|
+
"value": [
|
|
760
|
+
"Create a user group for access management.",
|
|
761
|
+
""
|
|
762
|
+
]
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"type": "code",
|
|
766
|
+
"language": "console",
|
|
767
|
+
"value": [
|
|
768
|
+
"",
|
|
769
|
+
" $ login(`admin, `123456)",
|
|
770
|
+
" $ createUser(`u1, \"111111\");",
|
|
771
|
+
" $ createUser(`u2, \"222222\");",
|
|
772
|
+
" $ createUser(`u3, \"333333\");",
|
|
773
|
+
""
|
|
774
|
+
]
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"type": "text",
|
|
778
|
+
"value": [
|
|
779
|
+
"streaming engine",
|
|
780
|
+
""
|
|
781
|
+
]
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"type": "code",
|
|
785
|
+
"language": "console",
|
|
786
|
+
"value": [
|
|
787
|
+
"",
|
|
788
|
+
" // user u1 create streaming engine agg1",
|
|
789
|
+
" $ login(`u1, \"111111\")",
|
|
790
|
+
" $ share streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades",
|
|
791
|
+
" $ output1 = table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])",
|
|
792
|
+
" $ agg1 = createTimeSeriesEngine(name=\"agg1\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=false)",
|
|
793
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"agg1\", offset=0, handler=append!{agg1}, msgAsTable=true);",
|
|
794
|
+
" // add access control for agg1",
|
|
795
|
+
" $ addAccessControl(agg1)",
|
|
796
|
+
"",
|
|
797
|
+
" // user u2 logs in",
|
|
798
|
+
" $ login(`u2, \"222222\")",
|
|
799
|
+
"",
|
|
800
|
+
" // insert data",
|
|
801
|
+
" $ insert into trades values(2018.10.08T01:01:01.785,`A,10) // OK!",
|
|
802
|
+
" $ insert into agg1 values(2018.10.08T01:01:01.785,`A,10) // ERROR: No access to table [agg1]",
|
|
803
|
+
" ",
|
|
804
|
+
" // drop stream engine",
|
|
805
|
+
" $ dropStreamEngine(\"agg1\") // No access to drop stream engine agg1",
|
|
806
|
+
""
|
|
807
|
+
]
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"type": "text",
|
|
811
|
+
"value": [
|
|
812
|
+
"shared in-memory table",
|
|
813
|
+
""
|
|
814
|
+
]
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
"type": "code",
|
|
818
|
+
"language": "console",
|
|
819
|
+
"value": [
|
|
820
|
+
"",
|
|
821
|
+
" $ login(`u1, \"111111\")",
|
|
822
|
+
" $ t = table(take(`a`b`c`, 10) as sym, 1..10 as val)",
|
|
823
|
+
" $ share t as st;",
|
|
824
|
+
" $ addAccessControl(`st)",
|
|
825
|
+
"",
|
|
826
|
+
" $ login(`u3, \"333333\")",
|
|
827
|
+
" $ select * from st // ERROR: No access to shared table [st]",
|
|
828
|
+
" $ insert into st values(`a, 4) // ERROR: No access to shared table [st]"
|
|
829
|
+
]
|
|
830
|
+
}
|
|
831
|
+
]
|
|
832
|
+
}
|
|
833
|
+
]
|
|
834
|
+
},
|
|
707
835
|
"addColumn": {
|
|
708
836
|
"title": "addColumn",
|
|
709
837
|
"type": "command",
|
|
@@ -2194,7 +2322,7 @@
|
|
|
2194
2322
|
{
|
|
2195
2323
|
"type": "text",
|
|
2196
2324
|
"value": [
|
|
2197
|
-
"`engine`
|
|
2325
|
+
"`engine` is a streaming join engine, which is the abstract table object returned by functions ``createAsofJoinEngine``, ``createEqualJoinEngine``, ``createWindowJoinEngine``, or ``createLookupJoinEngine``.",
|
|
2198
2326
|
"",
|
|
2199
2327
|
"`isLeftTable` is a Boolean value indicating whether to insert a left table or right table. ",
|
|
2200
2328
|
"",
|
|
@@ -2212,7 +2340,7 @@
|
|
|
2212
2340
|
"value": [
|
|
2213
2341
|
"Insert data into a streaming join engine.",
|
|
2214
2342
|
"",
|
|
2215
|
-
"Please note that the parameter *handler* of function :doc:`../s/subscribeTable` must be function ``appendForJoin
|
|
2343
|
+
"Please note that the parameter *handler* of function :doc:`../s/subscribeTable` must be function ``appendForJoin``, :doc:`/FunctionsandCommands/FunctionReferences/g/getLeftStream` or :doc:`/FunctionsandCommands/FunctionReferences/g/getRightStream` while subscribing to a stream table for the streaming join engine."
|
|
2216
2344
|
]
|
|
2217
2345
|
}
|
|
2218
2346
|
]
|
|
@@ -3034,7 +3162,9 @@
|
|
|
3034
3162
|
{
|
|
3035
3163
|
"type": "text",
|
|
3036
3164
|
"value": [
|
|
3037
|
-
"Find the position of the element with the largest value in parameter *location*, and return the value of the element in the same position in parameter *value*.",
|
|
3165
|
+
"Find the position of the element with the largest value in parameter *location*, and return the value of the element in the same position in parameter *value*. If there are multiple identical maximums in *location*, return the position of the first maximum.",
|
|
3166
|
+
"",
|
|
3167
|
+
"If *location* and *value* are matrices, conduct the aforementioned calculation with each column of *location* and the corresponding column of *value*.",
|
|
3038
3168
|
"",
|
|
3039
3169
|
"atImax(location, value) = value[imax(location)]. "
|
|
3040
3170
|
]
|
|
@@ -3103,7 +3233,9 @@
|
|
|
3103
3233
|
{
|
|
3104
3234
|
"type": "text",
|
|
3105
3235
|
"value": [
|
|
3106
|
-
"Find the position of the element with the smallest value in parameter *location*, and return the value of the element in the same position in parameter *value*.",
|
|
3236
|
+
"Find the position of the element with the smallest value in parameter *location*, and return the value of the element in the same position in parameter *value*. If there are multiple identical minimums in *location*, return the position of the first minimum.",
|
|
3237
|
+
"",
|
|
3238
|
+
"If *location* and *value* are matrices, conduct the aforementioned calculation with each column of *location* and the corresponding column of *value*.",
|
|
3107
3239
|
"",
|
|
3108
3240
|
"atImin(location, value) = value[imin(location)]. ",
|
|
3109
3241
|
""
|
|
@@ -3550,7 +3682,9 @@
|
|
|
3550
3682
|
{
|
|
3551
3683
|
"type": "text",
|
|
3552
3684
|
"value": [
|
|
3553
|
-
"bar(X,
|
|
3685
|
+
"bar(X, interval, [closed='left'])",
|
|
3686
|
+
"",
|
|
3687
|
+
"Related function: :doc:`../d/dailyAlignedBar`"
|
|
3554
3688
|
]
|
|
3555
3689
|
}
|
|
3556
3690
|
]
|
|
@@ -3562,11 +3696,19 @@
|
|
|
3562
3696
|
{
|
|
3563
3697
|
"type": "text",
|
|
3564
3698
|
"value": [
|
|
3565
|
-
"`X`
|
|
3699
|
+
"`X` is an integral/temporal scalar or vector.",
|
|
3700
|
+
"",
|
|
3701
|
+
"`interval` is an integral/DURATION type scalar greater than 0 or a vector of the same length as X.",
|
|
3566
3702
|
"",
|
|
3567
|
-
"
|
|
3703
|
+
"When *interval* is of type DURATION, the following time units are supported: w, d, H, m, s, ms, us, ns.",
|
|
3568
3704
|
"",
|
|
3569
|
-
"Note: As
|
|
3705
|
+
"Note: As time units *y* and *M* are not supported in interval, to group X by year or month, convert the data format of X with function :doc:`/FunctionsandCommands/FunctionReferences/m/month` or :doc:`/FunctionsandCommands/FunctionReferences/y/year`. Specify the interval as an integer for calculation. You can refer to Example 2.",
|
|
3706
|
+
"",
|
|
3707
|
+
"`closed` is a string. This optional parameter can specified as 'left' or 'right', indicating whether an element of X that is divisible by interval is the left boundary (the first element of the group) or the right boundary(the last element of the group) of a group. The default value is 'left'.",
|
|
3708
|
+
"",
|
|
3709
|
+
"* *closed* = 'left': X-(X % interval), indicating that the value with a remainder of 0 is specified as the left boundary of a group.",
|
|
3710
|
+
"",
|
|
3711
|
+
"* *closed* = 'right': iif((X % interval) == 0, X, X + (interval-(X % interval))), indicating that the value with a remainder of 0 is specified as the right boundary of a group."
|
|
3570
3712
|
]
|
|
3571
3713
|
}
|
|
3572
3714
|
]
|
|
@@ -3578,7 +3720,7 @@
|
|
|
3578
3720
|
{
|
|
3579
3721
|
"type": "text",
|
|
3580
3722
|
"value": [
|
|
3581
|
-
"
|
|
3723
|
+
"``bar`` can group *X* based on the length specified by *interval*. Return a vector with the same length as X."
|
|
3582
3724
|
]
|
|
3583
3725
|
}
|
|
3584
3726
|
]
|
|
@@ -3643,7 +3785,137 @@
|
|
|
3643
3785
|
"======== ======",
|
|
3644
3786
|
"2018.01M 0.9868",
|
|
3645
3787
|
"2018.04M 0.9243",
|
|
3646
|
-
"======== ======"
|
|
3788
|
+
"======== ======",
|
|
3789
|
+
"",
|
|
3790
|
+
"The following example groups data by week and calculates the maximum values for each week. Depending on parameter *closed*, the results are different.",
|
|
3791
|
+
""
|
|
3792
|
+
]
|
|
3793
|
+
},
|
|
3794
|
+
{
|
|
3795
|
+
"type": "code",
|
|
3796
|
+
"language": "console",
|
|
3797
|
+
"value": [
|
|
3798
|
+
"",
|
|
3799
|
+
" $ t=table(2022.01.01 + 1..20 as time, rand(100, 20) as x)",
|
|
3800
|
+
""
|
|
3801
|
+
]
|
|
3802
|
+
},
|
|
3803
|
+
{
|
|
3804
|
+
"type": "text",
|
|
3805
|
+
"value": [
|
|
3806
|
+
"+------------+----+",
|
|
3807
|
+
"| time | x |",
|
|
3808
|
+
"+============+====+",
|
|
3809
|
+
"| 2022.01.02 | 6 |",
|
|
3810
|
+
"+------------+----+",
|
|
3811
|
+
"| 2022.01.03 | 29 |",
|
|
3812
|
+
"+------------+----+",
|
|
3813
|
+
"| 2022.01.04 | 71 |",
|
|
3814
|
+
"+------------+----+",
|
|
3815
|
+
"| 2022.01.05 | 56 |",
|
|
3816
|
+
"+------------+----+",
|
|
3817
|
+
"| 2022.01.06 | 93 |",
|
|
3818
|
+
"+------------+----+",
|
|
3819
|
+
"| 2022.01.07 | 34 |",
|
|
3820
|
+
"+------------+----+",
|
|
3821
|
+
"| 2022.01.08 | 77 |",
|
|
3822
|
+
"+------------+----+",
|
|
3823
|
+
"| 2022.01.09 | 18 |",
|
|
3824
|
+
"+------------+----+",
|
|
3825
|
+
"| 2022.01.10 | 62 |",
|
|
3826
|
+
"+------------+----+",
|
|
3827
|
+
"| 2022.01.11 | 33 |",
|
|
3828
|
+
"+------------+----+",
|
|
3829
|
+
"| 2022.01.12 | 34 |",
|
|
3830
|
+
"+------------+----+",
|
|
3831
|
+
"| 2022.01.13 | 64 |",
|
|
3832
|
+
"+------------+----+",
|
|
3833
|
+
"| 2022.01.14 | 80 |",
|
|
3834
|
+
"+------------+----+",
|
|
3835
|
+
"| 2022.01.15 | 63 |",
|
|
3836
|
+
"+------------+----+",
|
|
3837
|
+
"| 2022.01.16 | 17 |",
|
|
3838
|
+
"+------------+----+",
|
|
3839
|
+
"| 2022.01.17 | 66 |",
|
|
3840
|
+
"+------------+----+",
|
|
3841
|
+
"| 2022.01.18 | 85 |",
|
|
3842
|
+
"+------------+----+",
|
|
3843
|
+
"| 2022.01.19 | 27 |",
|
|
3844
|
+
"+------------+----+",
|
|
3845
|
+
"| 2022.01.20 | 77 |",
|
|
3846
|
+
"+------------+----+",
|
|
3847
|
+
"| 2022.01.21 | 27 |",
|
|
3848
|
+
"+------------+----+",
|
|
3849
|
+
""
|
|
3850
|
+
]
|
|
3851
|
+
},
|
|
3852
|
+
{
|
|
3853
|
+
"type": "code",
|
|
3854
|
+
"language": "console",
|
|
3855
|
+
"value": [
|
|
3856
|
+
" ",
|
|
3857
|
+
" $ select max(x) from t group by bar(time, 7d);",
|
|
3858
|
+
""
|
|
3859
|
+
]
|
|
3860
|
+
},
|
|
3861
|
+
{
|
|
3862
|
+
"type": "text",
|
|
3863
|
+
"value": [
|
|
3864
|
+
"+------------+-------+",
|
|
3865
|
+
"| bar_time | max_x |",
|
|
3866
|
+
"+============+=======+",
|
|
3867
|
+
"| 2021.12.30 | 71 |",
|
|
3868
|
+
"+------------+-------+",
|
|
3869
|
+
"| 2022.01.06 | 93 |",
|
|
3870
|
+
"+------------+-------+",
|
|
3871
|
+
"| 2022.01.13 | 85 |",
|
|
3872
|
+
"+------------+-------+",
|
|
3873
|
+
"| 2022.01.20 | 77 |",
|
|
3874
|
+
"+------------+-------+",
|
|
3875
|
+
""
|
|
3876
|
+
]
|
|
3877
|
+
},
|
|
3878
|
+
{
|
|
3879
|
+
"type": "code",
|
|
3880
|
+
"language": "console",
|
|
3881
|
+
"value": [
|
|
3882
|
+
"",
|
|
3883
|
+
" $ print select max(x) from t group by bar(time, 7d, closed='right');",
|
|
3884
|
+
""
|
|
3885
|
+
]
|
|
3886
|
+
},
|
|
3887
|
+
{
|
|
3888
|
+
"type": "text",
|
|
3889
|
+
"value": [
|
|
3890
|
+
"+------------+-------+",
|
|
3891
|
+
"| bar_time | max_x |",
|
|
3892
|
+
"+============+=======+",
|
|
3893
|
+
"| 2021.01.06 | 93 |",
|
|
3894
|
+
"+------------+-------+",
|
|
3895
|
+
"| 2022.01.13 | 77 |",
|
|
3896
|
+
"+------------+-------+",
|
|
3897
|
+
"| 2022.01.20 | 85 |",
|
|
3898
|
+
"+------------+-------+",
|
|
3899
|
+
"| 2022.01.27 | 27 |",
|
|
3900
|
+
"+------------+-------+",
|
|
3901
|
+
"",
|
|
3902
|
+
"When calculating 1-minute OHLC bars, the data type needs to be converted to LONG if n needs to be converted to NANOTIMESTAMP, otherwise an integer overflow will occur.",
|
|
3903
|
+
"",
|
|
3904
|
+
".. code-block:: console",
|
|
3905
|
+
" :linenos:",
|
|
3906
|
+
" :emphasize-lines: 9, 11",
|
|
3907
|
+
" ",
|
|
3908
|
+
" $ n = 1000000",
|
|
3909
|
+
" $ nano = (09:30:00.000000000 + rand(long(6.5*60*60*1000000000), n)).sort!() ",
|
|
3910
|
+
" $ price = 100+cumsum(rand(0.02, n)-0.01)",
|
|
3911
|
+
" $ volume = rand(1000, n)",
|
|
3912
|
+
" $ symbol = rand(`600519`000001`600000`601766, n)",
|
|
3913
|
+
" $ tradeNano = table(symbol, nano, price, volume).sortBy!(`symbol`nano)",
|
|
3914
|
+
" $ undef(`nano`price`volume`symbol)",
|
|
3915
|
+
" $ barMinutes = 7",
|
|
3916
|
+
" $ itv = barMinutes*60*long(1000000000)",
|
|
3917
|
+
"",
|
|
3918
|
+
" $ OHLC_nano=select first(price) as open, max(price) as high, min(price) as low, last(price) as close, sum(volume) as volume from tradeNano group by symbol, bar(nano, itv) as barStart"
|
|
3647
3919
|
]
|
|
3648
3920
|
}
|
|
3649
3921
|
]
|
|
@@ -4338,6 +4610,67 @@
|
|
|
4338
4610
|
}
|
|
4339
4611
|
]
|
|
4340
4612
|
},
|
|
4613
|
+
"bitNot": {
|
|
4614
|
+
"title": "bitNot",
|
|
4615
|
+
"type": "function",
|
|
4616
|
+
"children": [
|
|
4617
|
+
{
|
|
4618
|
+
"title": "Syntax",
|
|
4619
|
+
"type": "grammer",
|
|
4620
|
+
"children": [
|
|
4621
|
+
{
|
|
4622
|
+
"type": "text",
|
|
4623
|
+
"value": [
|
|
4624
|
+
"bitNot(X)"
|
|
4625
|
+
]
|
|
4626
|
+
}
|
|
4627
|
+
]
|
|
4628
|
+
},
|
|
4629
|
+
{
|
|
4630
|
+
"title": "Arguments",
|
|
4631
|
+
"type": "parameters",
|
|
4632
|
+
"children": [
|
|
4633
|
+
{
|
|
4634
|
+
"type": "text",
|
|
4635
|
+
"value": [
|
|
4636
|
+
"`X` is a numeric scalar/vector/matrix/table."
|
|
4637
|
+
]
|
|
4638
|
+
}
|
|
4639
|
+
]
|
|
4640
|
+
},
|
|
4641
|
+
{
|
|
4642
|
+
"title": "Details",
|
|
4643
|
+
"type": "detail",
|
|
4644
|
+
"children": [
|
|
4645
|
+
{
|
|
4646
|
+
"type": "text",
|
|
4647
|
+
"value": [
|
|
4648
|
+
"Return the result of a bitwise logical NOT operation."
|
|
4649
|
+
]
|
|
4650
|
+
}
|
|
4651
|
+
]
|
|
4652
|
+
},
|
|
4653
|
+
{
|
|
4654
|
+
"title": "Examples",
|
|
4655
|
+
"type": "example",
|
|
4656
|
+
"children": [
|
|
4657
|
+
{
|
|
4658
|
+
"type": "code",
|
|
4659
|
+
"language": "console",
|
|
4660
|
+
"value": [
|
|
4661
|
+
"",
|
|
4662
|
+
" $ bitNot(3)",
|
|
4663
|
+
" -4",
|
|
4664
|
+
"",
|
|
4665
|
+
" $ av = array(INT[], 0, 10).append!([1 2 3, 4 5])",
|
|
4666
|
+
" $ bitNot(av)",
|
|
4667
|
+
" [[-2,-3,-4],[-5,-6]]"
|
|
4668
|
+
]
|
|
4669
|
+
}
|
|
4670
|
+
]
|
|
4671
|
+
}
|
|
4672
|
+
]
|
|
4673
|
+
},
|
|
4341
4674
|
"bitOr": {
|
|
4342
4675
|
"title": "bitOr",
|
|
4343
4676
|
"type": "function",
|
|
@@ -7423,6 +7756,95 @@
|
|
|
7423
7756
|
}
|
|
7424
7757
|
]
|
|
7425
7758
|
},
|
|
7759
|
+
"cells": {
|
|
7760
|
+
"title": "cells",
|
|
7761
|
+
"type": "function",
|
|
7762
|
+
"children": [
|
|
7763
|
+
{
|
|
7764
|
+
"title": "Syntax",
|
|
7765
|
+
"type": "grammer",
|
|
7766
|
+
"children": [
|
|
7767
|
+
{
|
|
7768
|
+
"type": "text",
|
|
7769
|
+
"value": [
|
|
7770
|
+
"cells(obj, row, col)"
|
|
7771
|
+
]
|
|
7772
|
+
}
|
|
7773
|
+
]
|
|
7774
|
+
},
|
|
7775
|
+
{
|
|
7776
|
+
"title": "Arguments",
|
|
7777
|
+
"type": "parameters",
|
|
7778
|
+
"children": [
|
|
7779
|
+
{
|
|
7780
|
+
"type": "text",
|
|
7781
|
+
"value": [
|
|
7782
|
+
"`obj` is a matrix.",
|
|
7783
|
+
"",
|
|
7784
|
+
"`row` is a vector of integral type, indicating indices of rows. ",
|
|
7785
|
+
"",
|
|
7786
|
+
"`col` is a vector of integral type of the same length as row, indicating indices of columns."
|
|
7787
|
+
]
|
|
7788
|
+
}
|
|
7789
|
+
]
|
|
7790
|
+
},
|
|
7791
|
+
{
|
|
7792
|
+
"title": "Details",
|
|
7793
|
+
"type": "detail",
|
|
7794
|
+
"children": [
|
|
7795
|
+
{
|
|
7796
|
+
"type": "text",
|
|
7797
|
+
"value": [
|
|
7798
|
+
"Return a vector of cells in a matrix by the specified row and column index."
|
|
7799
|
+
]
|
|
7800
|
+
}
|
|
7801
|
+
]
|
|
7802
|
+
},
|
|
7803
|
+
{
|
|
7804
|
+
"title": "Examples",
|
|
7805
|
+
"type": "example",
|
|
7806
|
+
"children": [
|
|
7807
|
+
{
|
|
7808
|
+
"type": "code",
|
|
7809
|
+
"language": "console",
|
|
7810
|
+
"value": [
|
|
7811
|
+
"",
|
|
7812
|
+
" $ m=(1..15).reshape(3:5)",
|
|
7813
|
+
" $ m;",
|
|
7814
|
+
""
|
|
7815
|
+
]
|
|
7816
|
+
},
|
|
7817
|
+
{
|
|
7818
|
+
"type": "text",
|
|
7819
|
+
"value": [
|
|
7820
|
+
"===== ===== ===== ===== =====",
|
|
7821
|
+
"col1 col2 col3 col4 col5",
|
|
7822
|
+
"===== ===== ===== ===== =====",
|
|
7823
|
+
"1 4 7 10 13",
|
|
7824
|
+
"2 5 8 11 14",
|
|
7825
|
+
"3 6 9 12 15",
|
|
7826
|
+
"===== ===== ===== ===== =====",
|
|
7827
|
+
""
|
|
7828
|
+
]
|
|
7829
|
+
},
|
|
7830
|
+
{
|
|
7831
|
+
"type": "code",
|
|
7832
|
+
"language": "console",
|
|
7833
|
+
"value": [
|
|
7834
|
+
"",
|
|
7835
|
+
" // obtain the two elements at [0,1] and [0,2]",
|
|
7836
|
+
" $ cells(m, 0 0, 1 2)",
|
|
7837
|
+
" [4,7]",
|
|
7838
|
+
" // obtain the elements on the diagonal of the matrix",
|
|
7839
|
+
" $ index = 0..2",
|
|
7840
|
+
" $ cells(m, v, v)",
|
|
7841
|
+
" [1, 5, 9]"
|
|
7842
|
+
]
|
|
7843
|
+
}
|
|
7844
|
+
]
|
|
7845
|
+
}
|
|
7846
|
+
]
|
|
7847
|
+
},
|
|
7426
7848
|
"changePwd": {
|
|
7427
7849
|
"title": "changePwd",
|
|
7428
7850
|
"type": "command",
|
|
@@ -9390,6 +9812,111 @@
|
|
|
9390
9812
|
}
|
|
9391
9813
|
]
|
|
9392
9814
|
},
|
|
9815
|
+
"concatMatrix": {
|
|
9816
|
+
"title": "concatMatrix",
|
|
9817
|
+
"type": "function",
|
|
9818
|
+
"children": [
|
|
9819
|
+
{
|
|
9820
|
+
"title": "Syntax",
|
|
9821
|
+
"type": "grammer",
|
|
9822
|
+
"children": [
|
|
9823
|
+
{
|
|
9824
|
+
"type": "text",
|
|
9825
|
+
"value": [
|
|
9826
|
+
"concatMatrix(X, [horizontal=true]) "
|
|
9827
|
+
]
|
|
9828
|
+
}
|
|
9829
|
+
]
|
|
9830
|
+
},
|
|
9831
|
+
{
|
|
9832
|
+
"title": "Arguments",
|
|
9833
|
+
"type": "parameters",
|
|
9834
|
+
"children": [
|
|
9835
|
+
{
|
|
9836
|
+
"type": "text",
|
|
9837
|
+
"value": [
|
|
9838
|
+
"`X` is a tuple of multiple matrices.",
|
|
9839
|
+
"",
|
|
9840
|
+
"`horizontal` is a boolean value indicating whether the matrices are contatenated horizontally. The default value is true. If it is false, the matrices are contatenated vertically."
|
|
9841
|
+
]
|
|
9842
|
+
}
|
|
9843
|
+
]
|
|
9844
|
+
},
|
|
9845
|
+
{
|
|
9846
|
+
"title": "Details",
|
|
9847
|
+
"type": "detail",
|
|
9848
|
+
"children": [
|
|
9849
|
+
{
|
|
9850
|
+
"type": "text",
|
|
9851
|
+
"value": [
|
|
9852
|
+
"Concatenate the matrices vertically or horizontally.",
|
|
9853
|
+
"",
|
|
9854
|
+
"When you concatenate matrices horizontally, they must have the same number of rows. When you concatenate them vertically, they must have the same number of columns. "
|
|
9855
|
+
]
|
|
9856
|
+
}
|
|
9857
|
+
]
|
|
9858
|
+
},
|
|
9859
|
+
{
|
|
9860
|
+
"title": "Examples",
|
|
9861
|
+
"type": "example",
|
|
9862
|
+
"children": [
|
|
9863
|
+
{
|
|
9864
|
+
"type": "code",
|
|
9865
|
+
"language": "console",
|
|
9866
|
+
"value": [
|
|
9867
|
+
" ",
|
|
9868
|
+
" $ m1 = matrix(4 0 5, 2 1 8);",
|
|
9869
|
+
" $ m2 = matrix(2 9 8, 3 7 -3, 6 4 2, 0 5 8);",
|
|
9870
|
+
" $ m3 = matrix(1 -1 6 2, 1 -3 1 9, 5 3 0 -4, 1 NULL 3 4);",
|
|
9871
|
+
" $ concatMatrix([m1, m2]);",
|
|
9872
|
+
""
|
|
9873
|
+
]
|
|
9874
|
+
},
|
|
9875
|
+
{
|
|
9876
|
+
"type": "text",
|
|
9877
|
+
"value": [
|
|
9878
|
+
"==== ==== ==== ==== ==== ====",
|
|
9879
|
+
"col1 col2 col3 col4 col5 col6",
|
|
9880
|
+
"==== ==== ==== ==== ==== ====",
|
|
9881
|
+
"4 2 2 3 6 0",
|
|
9882
|
+
"0 1 9 7 4 5",
|
|
9883
|
+
"5 8 8 -3 2 8",
|
|
9884
|
+
"==== ==== ==== ==== ==== ====",
|
|
9885
|
+
""
|
|
9886
|
+
]
|
|
9887
|
+
},
|
|
9888
|
+
{
|
|
9889
|
+
"type": "code",
|
|
9890
|
+
"language": "console",
|
|
9891
|
+
"value": [
|
|
9892
|
+
"",
|
|
9893
|
+
" $ print concatMatrix([m2, m3], false);",
|
|
9894
|
+
""
|
|
9895
|
+
]
|
|
9896
|
+
},
|
|
9897
|
+
{
|
|
9898
|
+
"type": "text",
|
|
9899
|
+
"value": [
|
|
9900
|
+
"==== ==== ==== ====",
|
|
9901
|
+
"col1 col2 col3 col4",
|
|
9902
|
+
"==== ==== ==== ====",
|
|
9903
|
+
"2 3 6 0",
|
|
9904
|
+
"9 7 4 5",
|
|
9905
|
+
"8 -3 2 8",
|
|
9906
|
+
"1 1 5 1",
|
|
9907
|
+
"-1 -3 3 ",
|
|
9908
|
+
"6 1 0 3",
|
|
9909
|
+
"2 9 4 4",
|
|
9910
|
+
"==== ==== ==== ====",
|
|
9911
|
+
"",
|
|
9912
|
+
".. meta:: ",
|
|
9913
|
+
" :keywords: concat"
|
|
9914
|
+
]
|
|
9915
|
+
}
|
|
9916
|
+
]
|
|
9917
|
+
}
|
|
9918
|
+
]
|
|
9919
|
+
},
|
|
9393
9920
|
"conditionalFilter": {
|
|
9394
9921
|
"title": "conditionalFilter",
|
|
9395
9922
|
"type": "function",
|
|
@@ -11044,9 +11571,13 @@
|
|
|
11044
11571
|
"",
|
|
11045
11572
|
"`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.",
|
|
11046
11573
|
"",
|
|
11047
|
-
"`metrics` is metacode specifying the calculation formulas.
|
|
11574
|
+
"`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> (it's not necessary to specify the column names). For more information about metacode please refer to :doc:`/Objects/Metaprogramming`.",
|
|
11048
11575
|
"",
|
|
11049
|
-
"`
|
|
11576
|
+
"`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.",
|
|
11577
|
+
"",
|
|
11578
|
+
"\\1. When there is only 1 matching column - If the names of the matching column are the same in both tables, *matchingColumn* should be specified as a STRING scalar; otherwise it's a tuple of two elements. For example, if the matching column is named “sym“ in the left table and “sym1“ in the right table, then matchingColumn = [[\\`sym],[\\`sym1]]. ",
|
|
11579
|
+
"",
|
|
11580
|
+
"\\2. When there are multiple matching columns - If the names of the matching columns are all the same in both tables, specify *matchingColumn* as a STRING vector; otherwise it's a tuple of two elements. For example, if the matching columns are named “timestamp“ and “sym“ in the left table and “timestamp“ and “sym1“ in the right table, then matchingColumn = [[\\`timestamp, \\`sym], [\\`timestamp,\\`sym1]].",
|
|
11050
11581
|
"",
|
|
11051
11582
|
"`timeColumn` is an optional parameter indicating the name of the time column in the two input tables when `useSystemTime` = false. If the time column of the left table is the same as that of the right table, `timeColumn` can be a string scalar. Otherwise, specify a string vector of length 2 (the time column names in the two tables).",
|
|
11052
11583
|
"",
|
|
@@ -11057,7 +11588,9 @@
|
|
|
11057
11588
|
"",
|
|
11058
11589
|
"`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.",
|
|
11059
11590
|
"",
|
|
11060
|
-
"`delayedTime` is a positive integer.
|
|
11591
|
+
"`delayedTime` is a positive integer. We need to set parameter `useSystemTime` to false before specifying `delayedTime`.",
|
|
11592
|
+
"",
|
|
11593
|
+
"When delayedTime is specified, if the time difference between the timestamp of the latest record t2 in the left table and the timestamp of uncalculated records is greater than the delayedTime, a calculation will be triggered by the record t2. If max(2*updateTime, 2 seconds) after a record of leftTable arrives at the aggregator, the arriving record still has not participated in a calculation, a calculation will be triggered too.",
|
|
11061
11594
|
"",
|
|
11062
11595
|
"`garbageSize` is a positive integer. It is optional and the default value is 5,000. As the subscribed data is ingested into the streaming engine, it occupies an increasing amount of memory. When the number of rows in memory exceeds *garbageSize*, the system will clear the data that is not needed for the current calculation."
|
|
11063
11596
|
]
|
|
@@ -11071,15 +11604,15 @@
|
|
|
11071
11604
|
{
|
|
11072
11605
|
"type": "text",
|
|
11073
11606
|
"value": [
|
|
11074
|
-
"Create asof join engine for streaming data. Return a table
|
|
11607
|
+
"Create asof join engine for streaming data. Return a table that is the asof join result of a left table and a right table. Generally it is used in conjunction with subscribeTable.",
|
|
11075
11608
|
"",
|
|
11076
|
-
"* If delayedTime is not specified, then a calculation is triggered when the timestamp of the latest record in the right table is later than the timestamp of the latest record in the left table.",
|
|
11077
|
-
"* If delayedTime is specified, then a calculation is trigger when either of the following 2 conditions is met:",
|
|
11609
|
+
"* If *delayedTime* is not specified, then a calculation is triggered when the timestamp of the latest record in the right table is later than the timestamp of the latest record in the left table.",
|
|
11610
|
+
"* If *delayedTime* is specified, then a calculation is trigger when either of the following 2 conditions is met:",
|
|
11078
11611
|
"",
|
|
11079
11612
|
" * the time difference between the latest time in left table and the time of uncalculated data is greater than the delayedTime.",
|
|
11080
11613
|
" * max(2*updateTime, 2 seconds) after a record is ingested into the left table, it still has not been used in a calculation.",
|
|
11081
11614
|
"",
|
|
11082
|
-
"
|
|
11615
|
+
"Starting from version 1.30.17, 2.00.5, DolphinDB supports other stream engines to ingest data into streaming join engines to realize cascade between engines through :doc:`/FunctionsandCommands/FunctionReferences/g/getLeftStream` and :doc:`/FunctionsandCommands/FunctionReferences/g/getRightStream`."
|
|
11083
11616
|
]
|
|
11084
11617
|
}
|
|
11085
11618
|
]
|
|
@@ -11148,7 +11681,7 @@
|
|
|
11148
11681
|
{
|
|
11149
11682
|
"type": "text",
|
|
11150
11683
|
"value": [
|
|
11151
|
-
"createCrossSectionalEngine(name, [metrics], dummyTable, [outputTable], keyColumn, [triggeringPattern='perBatch'], [triggeringInterval=1000], [useSystemTime=true], [timeColumn], [lastBatchOnly=false])",
|
|
11684
|
+
"createCrossSectionalEngine(name, [metrics], dummyTable, [outputTable], keyColumn, [triggeringPattern='perBatch'], [triggeringInterval=1000], [useSystemTime=true], [timeColumn], [lastBatchOnly=false], [contextByColumn], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup=-1])",
|
|
11152
11685
|
"",
|
|
11153
11686
|
"Alias: createCrossSectionalAggregator"
|
|
11154
11687
|
]
|
|
@@ -11164,38 +11697,65 @@
|
|
|
11164
11697
|
"value": [
|
|
11165
11698
|
"`name` is a string indicating the name of the engine. It is the only identifier of an engine. It can have letter, number and \"_\". It must start with a letter.",
|
|
11166
11699
|
"",
|
|
11167
|
-
"`metrics` is a piece of metacode or a tuple specifying the formula for calculation. It can use built-in or user-defined aggregate functions or expressions such as <[sum(qty), avg(price)]>, <[avg(price1)-avg(price2)]> or <[std(price1-price2)]>.
|
|
11700
|
+
"`metrics` is a piece of metacode or a tuple specifying the formula for calculation. It can use built-in or user-defined aggregate functions or expressions such as <[sum(qty), avg(price)]>, <[avg(price1)-avg(price2)]> or <[std(price1-price2)]>. You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it's not necessary to specify the column names). For more information about metacode please refer to :doc:`/Objects/Metaprogramming`. ",
|
|
11701
|
+
"",
|
|
11702
|
+
"`dummyTable` is a TABLE indicating the schema of the subscribed stream table. It doesn't matter whether *dummyTable* contains data or not. ",
|
|
11168
11703
|
"",
|
|
11169
|
-
"`
|
|
11704
|
+
"`outputTable` is a TABLE containing calculation results. It can be an in-memory table or a distributed table. ",
|
|
11170
11705
|
"",
|
|
11171
|
-
"
|
|
11706
|
+
"* If *contextByColumn* is not specified, the number of columns in the output table should be the number of metrics + 1. The first column is of TIMESTAMP type indicating the starting time of each calculation in system time (If *timeColumn* is specified, the values in *timeColumn* will be used instead). The remaining columns are calculation results - make sure to keep the data types of columns consistent with the results.",
|
|
11707
|
+
"* If *contextByColumn* is specified, the number of columns in the output table should be the number of metrics + 2. The first column is of TIMESTAMP type indicating the starting time of each calculation in system time (If *timeColumn* is specified, the values in *timeColumn* will be used instead). The second column is the column specified by *contextByColumn*. The remaining columns are calculation results - make sure to keep the data types of columns consistent with the results.",
|
|
11172
11708
|
"",
|
|
11173
11709
|
"`keyColumn` is a string scalar or vector that specifies one or more columns in the stream table as the key columns of the cross-sectional streaming engine. For each unique value in the *keyColumn*, only the lastest row is used in the calculation.",
|
|
11174
11710
|
"",
|
|
11175
|
-
"`triggeringPattern` is a
|
|
11711
|
+
"`triggeringPattern` is a STRING indicating how calculation is triggered. Each calculation adds 1 record to the output table. This parameter can take the following values:",
|
|
11176
11712
|
"",
|
|
11177
|
-
"* 'perBatch':
|
|
11178
|
-
"* 'perRow':
|
|
11179
|
-
"* 'interval':
|
|
11180
|
-
"* 'keyCount':
|
|
11713
|
+
"* 'perBatch': Default value. Calculation is triggered by each batch of data that is inserted.",
|
|
11714
|
+
"* 'perRow': Calculation is triggered by each row of data that is inserted.",
|
|
11715
|
+
"* 'interval': Calculation is triggered at predetermined intervals (using system time).",
|
|
11716
|
+
"* 'keyCount': If data with the same timestamp arrive in batches, calculation is triggered if either a) the number of keys with the latest timestamp reaches *triggeringInterval*, or b) data that is to be calculated contains 2 different timestamps (i.e., data with newer timestamp arrives before some data with old timestamp is used for calculation). To set *triggeringPattern* to 'keyCount', *timeColumn* must be specified and *useSystemTime* must be set to false.",
|
|
11181
11717
|
"",
|
|
11182
|
-
"
|
|
11718
|
+
"Note: If *triggeringPattern* is specified as keyCount, out-of-order data will not participate in the calculation. ",
|
|
11183
11719
|
"",
|
|
11184
|
-
"
|
|
11185
|
-
"
|
|
11720
|
+
"`triggeringInterval` is an INTEGER or a tuple. Below explains its available values and triggering rules: ",
|
|
11721
|
+
"",
|
|
11722
|
+
"*If *triggeringPattern*='interval': *triggeringInterval* indicates the duration in milliseconds between 2 adjacent calculations. The default value is 1000.",
|
|
11723
|
+
"*If *triggeringPattern*='keyCount': *triggeringInterval* indicates the threshold of the number of keys in the unused data to trigger a calculation. It can also be a tuple of 2 elements, with the first being an integer indicating the threshold of the number of keys in the unused data to trigger a calculation, and the second being an INTEGER or DURATION value. In this example, the value of *triggeringPattern* is a tuple.",
|
|
11724
|
+
"",
|
|
11725
|
+
" Suppose *triggeringPattern* =(c1, c2):",
|
|
11726
|
+
"",
|
|
11727
|
+
" * When c2 is an integer, if the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system will go on to save data with newer timestamp t2 (t2>t1). Data with t1 will be calculated when either of the events happens: the number of keys with timestamp t2 reaches c2, or data with newer timestamp t3 (t3>t2) starts to come in. Note that c2 must be smaller than c1.",
|
|
11728
|
+
" * When c2 is a duration, if the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system will go on to save data with newer timestamp t2 (t2>t1) . Once data with t2 starts to come in, data with t1 will not be calculated until any of the events happens: the number of keys with timestamp t1 reaches c1, or data with newer timestamp t3 (t3>t2) starts to come in, or the duration c2 comes to an end.",
|
|
11186
11729
|
"",
|
|
11187
11730
|
"`useSystemTime` is a Boolean value indicating whether the first column of outputTable is system time (`useSystemTime`\\=true) or `timeColumn` in the stream table (`useSystemTime`\\=false). ",
|
|
11188
11731
|
"",
|
|
11189
11732
|
"`timeColumn` is a string. If `useSystemTime`\\=false, timeColumn is the name of the temporal column in the stream table. The column only supports TIMESTAMP type. ",
|
|
11190
11733
|
"",
|
|
11191
|
-
"
|
|
11734
|
+
"`lastBatchOnly` is an optional BOOLEAN indicating whether to keep the latest data only in the cross-sectional engine. When *lastBatchOnly* = true, *triggeringPattern* must take the value 'keyCount' and the the cross-sectional engine only saves the unique value with the latest timestamp for calculation. When *lastBatchOnly* = false, the engine updates and retains all unique values for calculation.",
|
|
11735
|
+
"",
|
|
11736
|
+
"`contextByColumn` is an optional STRING scalar indicating the grouping column, based on which data will be calculated in groups.",
|
|
11192
11737
|
"",
|
|
11193
|
-
"
|
|
11738
|
+
"* To specify this parameter, *metrics* and *outputTable* must be specified accordingly.",
|
|
11739
|
+
"* If *metrics* only contains aggregate functions, the calculation results would be the same as using function ``groupby`` to conduct calculation in groups. Otherwise, the results would be the same as using function ``contextby``.",
|
|
11194
11740
|
"",
|
|
11195
|
-
"
|
|
11741
|
+
"To enable snapshot, *snapshotDir* and *snapshotIntervalInMsgCount* must be specified.",
|
|
11196
11742
|
"",
|
|
11197
|
-
"
|
|
11198
|
-
"
|
|
11743
|
+
"With snapshot enabled, if an exception occurs, the stream engine can be recovered to the latest snapshot.",
|
|
11744
|
+
"",
|
|
11745
|
+
"`snapshotDir` is an optional STRING indicating the directory where the snapshot of the engine is stored.",
|
|
11746
|
+
"",
|
|
11747
|
+
"* Make sure the specified directory actually exists. Otherwise the system reports an error.",
|
|
11748
|
+
"* If *snapshotDir* is specified when creating the engine, the system will check if a snapshot exists in this directory. If it exists, the system will load the snapshot and restore the state of the engine (intermediate calculation results).",
|
|
11749
|
+
"* Multiple engines may share a single directory, using the name of the engine to distinguish the snapshot files.",
|
|
11750
|
+
"* A snapshot file of an engine may take 3 file extensions over different stages:",
|
|
11751
|
+
"",
|
|
11752
|
+
" * <engineName>.*tmp* for temporary stroage of snapshot data",
|
|
11753
|
+
" * <engineName>.*snapshot* for a generated snapshot file synced to disk",
|
|
11754
|
+
" * If a new snapshot file is created, the existing snapshot with the same name will be renamed to <engineName>.*old*",
|
|
11755
|
+
"",
|
|
11756
|
+
"`snapshotIntervalInMsgCount` is an optional INTEGER indicating how many messages are processed before a new snapshot is generated.",
|
|
11757
|
+
"",
|
|
11758
|
+
"`raftGroup` is the ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. It is an integer greater than 1. Specify *raftGroup* to enable high availability on the streaming engine. When a streaming engine is created on the leader, it is also created on each follower. Once a snapshot is generated, it will also be synced to all followers. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table. Note that *SnapShotDir* must also be specified when specifying a raft group."
|
|
11199
11759
|
]
|
|
11200
11760
|
}
|
|
11201
11761
|
]
|
|
@@ -11207,10 +11767,11 @@
|
|
|
11207
11767
|
{
|
|
11208
11768
|
"type": "text",
|
|
11209
11769
|
"value": [
|
|
11210
|
-
"Create a cross
|
|
11770
|
+
"Create a cross-sectional engine. Return a keyed table with *keyColumn* values as the keys.",
|
|
11211
11771
|
"",
|
|
11212
|
-
"
|
|
11213
|
-
"
|
|
11772
|
+
"If *metrics* or *outputTable* is not specified, the engine only updates table records but will not calculate or output any data.",
|
|
11773
|
+
"",
|
|
11774
|
+
"If *metrics* and *outputTable* are specified, the engine will update table records, conduct calculation using the latest records, and output results to the *outputTable*. "
|
|
11214
11775
|
]
|
|
11215
11776
|
}
|
|
11216
11777
|
]
|
|
@@ -11222,8 +11783,6 @@
|
|
|
11222
11783
|
{
|
|
11223
11784
|
"type": "text",
|
|
11224
11785
|
"value": [
|
|
11225
|
-
"`Example 1`",
|
|
11226
|
-
"",
|
|
11227
11786
|
"Use function ``createCrossSectionalEngine`` to create a table `csEngine1` that subscribes to the stream table `trades1`.",
|
|
11228
11787
|
"",
|
|
11229
11788
|
"In this example, `triggeringPattern`\\=\"perRow\". Therefore each row that is inserted into table `csEngine1` triggers a computation. ",
|
|
@@ -11284,7 +11843,6 @@
|
|
|
11284
11843
|
"2020.08.12T09:30:00.901 15.2 60 1012 2",
|
|
11285
11844
|
"======================== ========= ======= ============= ======",
|
|
11286
11845
|
"",
|
|
11287
|
-
"`Example 2`",
|
|
11288
11846
|
"",
|
|
11289
11847
|
"In this example, `triggeringPattern`\\=\"perBatch\". Insert 2 batches of data and the result has 2 rows. ",
|
|
11290
11848
|
""
|
|
@@ -11317,8 +11875,6 @@
|
|
|
11317
11875
|
"2020.08.12T09:30:00.901 15.2 60 1012 2",
|
|
11318
11876
|
"======================== ========= ======= ============= ======",
|
|
11319
11877
|
"",
|
|
11320
|
-
"`Example 3`",
|
|
11321
|
-
"",
|
|
11322
11878
|
"In this example, `triggeringPattern` = \"keyCount\" and `lastBatchOnly` = true. Only the data with the latest timestamp will participate in calculation. Because there are both aggregator and non-aggregator functions set in metrics, the number of rows in the result table will be the same as that in the input table.",
|
|
11323
11879
|
""
|
|
11324
11880
|
]
|
|
@@ -11376,8 +11932,6 @@
|
|
|
11376
11932
|
"2018.01.01T09:30:01.000 10.1 40",
|
|
11377
11933
|
"======================= ======== ======== ",
|
|
11378
11934
|
"",
|
|
11379
|
-
"`Example 4`",
|
|
11380
|
-
"",
|
|
11381
11935
|
"In this example, `triggeringPattern`\\=\"interval\" and triggeringInterval=500 (milliseconds). ",
|
|
11382
11936
|
""
|
|
11383
11937
|
]
|
|
@@ -11456,7 +12010,7 @@
|
|
|
11456
12010
|
{
|
|
11457
12011
|
"type": "text",
|
|
11458
12012
|
"value": [
|
|
11459
|
-
"createDailyTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, [timeColumn], [useSystemTime=false], [keyColumn], [garbageSize], [updateTime], [useWindowStartTime], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [fill
|
|
12013
|
+
"createDailyTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, [timeColumn], [useSystemTime=false], [keyColumn], [garbageSize], [updateTime], [useWindowStartTime], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [fill='none'], [sessionBegin], [sessionEnd], [mergeSessionEnd=false], [forceTriggerTime], [raftGroup], [forceTriggerSessionEndTime])"
|
|
11460
12014
|
]
|
|
11461
12015
|
}
|
|
11462
12016
|
]
|
|
@@ -11476,9 +12030,15 @@
|
|
|
11476
12030
|
"",
|
|
11477
12031
|
"`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.",
|
|
11478
12032
|
"",
|
|
12033
|
+
"`forceTriggerSessionEndTime` is an optional parameter. It is a positive integer in unit of seconds. It indicates the waiting time to force trigger calculation in the window containing the sessionEnd, if it ends without calculation.",
|
|
12034
|
+
"",
|
|
12035
|
+
"- If *fill* is not specified, the window returns no result.",
|
|
12036
|
+
"",
|
|
12037
|
+
"- If *fill* is specified, the result of the window will be filled using the specified filling method.",
|
|
12038
|
+
"",
|
|
11479
12039
|
"Note: ",
|
|
11480
12040
|
"",
|
|
11481
|
-
"* The
|
|
12041
|
+
"* The engine automatically adjusts the starting point of the window for `sessionBegin` and `sessionEnd` according to the value of alignmentSize.",
|
|
11482
12042
|
"* To set these three parameters, `useSystemTime` must be set to false. `mergeSessionEnd` can be set only when `updateTime` or `forceTriggerTime` is specified."
|
|
11483
12043
|
]
|
|
11484
12044
|
}
|
|
@@ -11509,8 +12069,8 @@
|
|
|
11509
12069
|
" ",
|
|
11510
12070
|
" $ share streamTable(1000:0, `date`second`sym`volume, [DATE, SECOND, SYMBOL, INT]) as trades",
|
|
11511
12071
|
" $ output1 = keyedTable(`time`sym, 10000:0, `time`sym`sumVolume, [DATETIME, SYMBOL, INT])",
|
|
11512
|
-
" $
|
|
11513
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"
|
|
12072
|
+
" $ engine1 = createDailyTimeSeriesEngine(name=\"engine1\", windowSize=60, step=60, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`date`second, useSystemTime=false, keyColumn=`sym, garbageSize=50, updateTime=2, useWindowStartTime=false, sessionBegin=09:30:00 13:00:00, sessionEnd=11:30:00 15:00:00,mergeSessionEnd=true)",
|
|
12073
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);",
|
|
11514
12074
|
"",
|
|
11515
12075
|
" $ insert into trades values(2018.10.08,09:25:31,`A,8)",
|
|
11516
12076
|
" $ insert into trades values(2018.10.08,09:26:01,`B,10)",
|
|
@@ -11535,18 +12095,262 @@
|
|
|
11535
12095
|
{
|
|
11536
12096
|
"type": "text",
|
|
11537
12097
|
"value": [
|
|
11538
|
-
"===================
|
|
11539
|
-
"time sym
|
|
11540
|
-
"===================
|
|
11541
|
-
"2018.10.08T09:31:00 A
|
|
11542
|
-
"2018.10.08T09:31:00 B
|
|
11543
|
-
"2018.10.08T11:30:00 A
|
|
11544
|
-
"2018.10.08T11:30:00 B
|
|
11545
|
-
"2018.10.08T13:01:00 A
|
|
11546
|
-
"2018.10.08T13:01:00 B
|
|
11547
|
-
"2018.10.08T15:00:00 A
|
|
11548
|
-
"2018.10.08T15:00:00 B
|
|
11549
|
-
"===================
|
|
12098
|
+
"=================== === =========",
|
|
12099
|
+
"time sym sumVolume",
|
|
12100
|
+
"=================== === =========",
|
|
12101
|
+
"2018.10.08T09:31:00 A 34",
|
|
12102
|
+
"2018.10.08T09:31:00 B 24",
|
|
12103
|
+
"2018.10.08T11:30:00 A 44",
|
|
12104
|
+
"2018.10.08T11:30:00 B 15",
|
|
12105
|
+
"2018.10.08T13:01:00 A 16",
|
|
12106
|
+
"2018.10.08T13:01:00 B 9",
|
|
12107
|
+
"2018.10.08T15:00:00 A 30",
|
|
12108
|
+
"2018.10.08T15:00:00 B 49",
|
|
12109
|
+
"=================== === =========",
|
|
12110
|
+
""
|
|
12111
|
+
]
|
|
12112
|
+
},
|
|
12113
|
+
{
|
|
12114
|
+
"type": "code",
|
|
12115
|
+
"language": "console",
|
|
12116
|
+
"value": [
|
|
12117
|
+
"",
|
|
12118
|
+
" $ share streamTable(1000:0, `date`second`sym`volume, [DATE, SECOND, SYMBOL, INT]) as trades",
|
|
12119
|
+
" $ output1 = keyedTable(`time`sym, 10000:0, `time`sym`sumVolume, [DATETIME, SYMBOL, INT])",
|
|
12120
|
+
" $ engine1 = createDailyTimeSeriesEngine(name=\"engine1\", windowSize=60, step=60, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`date`second, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=false, sessionBegin=09:30:00 13:00:00, sessionEnd=11:30:00 15:00:00,mergeSessionEnd=true,forceTriggerSessionEndTime=10)",
|
|
12121
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);",
|
|
12122
|
+
"",
|
|
12123
|
+
" $ insert into trades values(date(now()),09:25:31,`A,8)",
|
|
12124
|
+
" $ insert into trades values(date(now()),09:26:01,`B,10)",
|
|
12125
|
+
" $ insert into trades values(date(now()),09:30:02,`A,26)",
|
|
12126
|
+
" $ insert into trades values(date(now()),09:30:10,`B,14)",
|
|
12127
|
+
" $ insert into trades values(date(now()),11:29:46,`A,30)",
|
|
12128
|
+
" $ insert into trades values(date(now()),11:29:50,`B,11)",
|
|
12129
|
+
" $ insert into trades values(date(now()),11:30:00,`B,14)",
|
|
12130
|
+
" $ insert into trades values(date(now()),11:30:01,`A,4)",
|
|
12131
|
+
"",
|
|
12132
|
+
" $ select * from output1",
|
|
12133
|
+
""
|
|
12134
|
+
]
|
|
12135
|
+
},
|
|
12136
|
+
{
|
|
12137
|
+
"type": "text",
|
|
12138
|
+
"value": [
|
|
12139
|
+
"=================== === =========",
|
|
12140
|
+
"time sym sumVolume",
|
|
12141
|
+
"=================== === =========",
|
|
12142
|
+
"2022.03.24T09:31:00 A 34",
|
|
12143
|
+
"2022.03.24T09:31:00 B 24",
|
|
12144
|
+
"2022.03.24T11:30:00 A 30",
|
|
12145
|
+
"=================== === =========",
|
|
12146
|
+
"",
|
|
12147
|
+
"",
|
|
12148
|
+
"Set *forceTriggerSessionEndTime* = 10. Calculation on the window with the right boundary at 11:30:00 will be triggered 10 seconds after the system time reaches 11:30:00.",
|
|
12149
|
+
""
|
|
12150
|
+
]
|
|
12151
|
+
},
|
|
12152
|
+
{
|
|
12153
|
+
"type": "code",
|
|
12154
|
+
"language": "console",
|
|
12155
|
+
"value": [
|
|
12156
|
+
"",
|
|
12157
|
+
" $ sleep(10000)",
|
|
12158
|
+
" $ select * from output1",
|
|
12159
|
+
""
|
|
12160
|
+
]
|
|
12161
|
+
},
|
|
12162
|
+
{
|
|
12163
|
+
"type": "text",
|
|
12164
|
+
"value": [
|
|
12165
|
+
"=================== === =========",
|
|
12166
|
+
"time sym sumVolume",
|
|
12167
|
+
"=================== === =========",
|
|
12168
|
+
"2022.03.24T09:31:00 A 34",
|
|
12169
|
+
"2022.03.24T09:31:00 B 24",
|
|
12170
|
+
"2022.03.24T11:30:00 A 30",
|
|
12171
|
+
"2022.03.03T11:30:00 B 25",
|
|
12172
|
+
"=================== === ========="
|
|
12173
|
+
]
|
|
12174
|
+
}
|
|
12175
|
+
]
|
|
12176
|
+
}
|
|
12177
|
+
]
|
|
12178
|
+
},
|
|
12179
|
+
"createDistributedInMemoryTable": {
|
|
12180
|
+
"title": "createDistributedInMemoryTable",
|
|
12181
|
+
"type": "function",
|
|
12182
|
+
"children": [
|
|
12183
|
+
{
|
|
12184
|
+
"title": "Syntax",
|
|
12185
|
+
"type": "grammer",
|
|
12186
|
+
"children": [
|
|
12187
|
+
{
|
|
12188
|
+
"type": "text",
|
|
12189
|
+
"value": [
|
|
12190
|
+
"createDistributedInMemoryTable(tableName, colNames, colTypes, globalPartitionType, globalPartitionScheme, globalPartitionColumn, [localPartitionType], [localPartitionScheme], [localPartitionColumn])",
|
|
12191
|
+
" "
|
|
12192
|
+
]
|
|
12193
|
+
}
|
|
12194
|
+
]
|
|
12195
|
+
},
|
|
12196
|
+
{
|
|
12197
|
+
"title": "Details",
|
|
12198
|
+
"type": "detail",
|
|
12199
|
+
"children": [
|
|
12200
|
+
{
|
|
12201
|
+
"type": "text",
|
|
12202
|
+
"value": [
|
|
12203
|
+
"Create a distributed in-memory table and store it on different nodes based on the specified partitioning scheme. This function can only be executed on a data node or compute node.",
|
|
12204
|
+
"",
|
|
12205
|
+
"The distributed in-memory table is stored on different nodes (data nodes/compute nodes) based on the global partitioning scheme. Each node can only hold one partition. Concurrent reads and writes are supported in a distributed in-memory table. Therefore, it is suitable for scenarios that require distributed computing on in-memory tables.",
|
|
12206
|
+
"",
|
|
12207
|
+
"A distributed in-memory table can be partitioned on 2 different levels:",
|
|
12208
|
+
"",
|
|
12209
|
+
"- global (between nodes): a distributed in-memory table is partitioned and the partitions are stored on different nodes. ",
|
|
12210
|
+
"",
|
|
12211
|
+
"- local (within node): data within each node can be partitioned again.",
|
|
12212
|
+
"",
|
|
12213
|
+
"If both global and local partitioning is adopted, the partitioning scheme of the distributed in-memory table is equivalent to a composite domain.",
|
|
12214
|
+
"",
|
|
12215
|
+
"Note:",
|
|
12216
|
+
"",
|
|
12217
|
+
"\\(1) Distributed in-memory tables can only be created in cluster mode.",
|
|
12218
|
+
"",
|
|
12219
|
+
"\\(2) The number of global partitions must be greater or equal to 2 and less than the total number of data nodes and compute nodes.",
|
|
12220
|
+
"",
|
|
12221
|
+
"\\(3) Before accessing the distributed in-memory table from other nodes, use function :doc:`../l/loadDistributedInMemoryTable` first to load the table.",
|
|
12222
|
+
"",
|
|
12223
|
+
"\\(4) Drop the distributed in-memory table with command :doc:`/FunctionsandCommands/CommandsReferences/d/dropDistributedInMemoryTable`.",
|
|
12224
|
+
"",
|
|
12225
|
+
"\\(5) Transactions are not supported currently for distributed in-memory tables. "
|
|
12226
|
+
]
|
|
12227
|
+
}
|
|
12228
|
+
]
|
|
12229
|
+
},
|
|
12230
|
+
{
|
|
12231
|
+
"title": "Arguments",
|
|
12232
|
+
"type": "parameters",
|
|
12233
|
+
"children": [
|
|
12234
|
+
{
|
|
12235
|
+
"type": "text",
|
|
12236
|
+
"value": [
|
|
12237
|
+
"`tableName` is a STRING scalar indicating the name of a distributed in-memory table.",
|
|
12238
|
+
"",
|
|
12239
|
+
"`colNames` is a STRING vector of column names. ",
|
|
12240
|
+
"",
|
|
12241
|
+
"`colTypes` is a vector indicating data types of columns specified by *colNames*.",
|
|
12242
|
+
"",
|
|
12243
|
+
"`globalPartitionType` is a required parameter indicating the partition type for a table in a cluster, which only supports RANGE, HASG, VALUE, and LIST.",
|
|
12244
|
+
"",
|
|
12245
|
+
"`globalPartitionScheme` is a required parameter indicating the partitioning scheme that describes how the partitions are created in a cluster.",
|
|
12246
|
+
"",
|
|
12247
|
+
"The partition type and partitioning scheme are shown as follows:",
|
|
12248
|
+
"",
|
|
12249
|
+
"+----------------+-----------------------+-------------------------------------------------------------------------------------+",
|
|
12250
|
+
"| Partition Type | Partition Type Symbol | Partitioning Scheme |",
|
|
12251
|
+
"+================+=======================+=====================================================================================+",
|
|
12252
|
+
"| range domain | RANGE | A vector. Any two adjacent elements of the vector define the range for a partition. |",
|
|
12253
|
+
"+----------------+-----------------------+-------------------------------------------------------------------------------------+",
|
|
12254
|
+
"| hash domain | HASH | A tuple. The first element is the data type of partitioning column. The second |",
|
|
12255
|
+
"| | | element is the number of partitions. |",
|
|
12256
|
+
"+----------------+-----------------------+-------------------------------------------------------------------------------------+",
|
|
12257
|
+
"| value domain | VALUE | A vector. Each element of the vector defines a partition. |",
|
|
12258
|
+
"+----------------+-----------------------+-------------------------------------------------------------------------------------+",
|
|
12259
|
+
"| list domain | LIST | A vector. Each element of the vector defines a partition. |",
|
|
12260
|
+
"+----------------+-----------------------+-------------------------------------------------------------------------------------+",
|
|
12261
|
+
"",
|
|
12262
|
+
"`globalPartitionColumn` is a required parameter. It is a STRING scalar indicating the partitioning column for a table in a cluster.",
|
|
12263
|
+
"",
|
|
12264
|
+
"The above parameters are specified for a cluster. The distributed in-memory table is partitioned and the partitions are stored on each node based on the above partitioning schemes. ",
|
|
12265
|
+
"",
|
|
12266
|
+
"The data within each node can be partitioned again through the following parameters.",
|
|
12267
|
+
"",
|
|
12268
|
+
"`localPartitionType` is an optional parameter indicating the partition type within a node, which only supports RANGE, HASG, VALUE, and LIST.",
|
|
12269
|
+
"",
|
|
12270
|
+
"`localPartitionScheme` is an optional parameter indicating the partitioning scheme that describes how the partitions are created within a node.",
|
|
12271
|
+
"",
|
|
12272
|
+
"`localPartitionColumn` is an optional parameter. It is a STRING scalar indicating the partitioning column within a node."
|
|
12273
|
+
]
|
|
12274
|
+
}
|
|
12275
|
+
]
|
|
12276
|
+
},
|
|
12277
|
+
{
|
|
12278
|
+
"title": "Examples",
|
|
12279
|
+
"type": "example",
|
|
12280
|
+
"children": [
|
|
12281
|
+
{
|
|
12282
|
+
"type": "text",
|
|
12283
|
+
"value": [
|
|
12284
|
+
"* Create a distributed in-memory table",
|
|
12285
|
+
"",
|
|
12286
|
+
"The cluster in this example has two data nodes: node1 and node2. Create a distributed in-memory table on node1. The number of partitions should be less than the total number of data nodes and compute nodes, thus HASH partitioning is recommended.",
|
|
12287
|
+
""
|
|
12288
|
+
]
|
|
12289
|
+
},
|
|
12290
|
+
{
|
|
12291
|
+
"type": "code",
|
|
12292
|
+
"language": "console",
|
|
12293
|
+
"value": [
|
|
12294
|
+
"",
|
|
12295
|
+
" $ pt = createDistributedInMemoryTable(`dt, `time`id`value, `DATETIME`INT`LONG, HASH, [INT, 2],`id)",
|
|
12296
|
+
""
|
|
12297
|
+
]
|
|
12298
|
+
},
|
|
12299
|
+
{
|
|
12300
|
+
"type": "text",
|
|
12301
|
+
"value": [
|
|
12302
|
+
"* Load a distributed in-memory table",
|
|
12303
|
+
"",
|
|
12304
|
+
"Load a distributed in-memory table on node2 and insert data into it.",
|
|
12305
|
+
""
|
|
12306
|
+
]
|
|
12307
|
+
},
|
|
12308
|
+
{
|
|
12309
|
+
"type": "code",
|
|
12310
|
+
"language": "console",
|
|
12311
|
+
"value": [
|
|
12312
|
+
"",
|
|
12313
|
+
" $ time = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);",
|
|
12314
|
+
" $ id = 0..39;",
|
|
12315
|
+
" $ value = rand(100, 40);",
|
|
12316
|
+
" $ tmp = table(time, id, value);",
|
|
12317
|
+
"",
|
|
12318
|
+
" $ pt = loadDistributedInMemoryTable(`dt)",
|
|
12319
|
+
" $ pt.append!(tmp);",
|
|
12320
|
+
"",
|
|
12321
|
+
" $ select * from pt;",
|
|
12322
|
+
""
|
|
12323
|
+
]
|
|
12324
|
+
},
|
|
12325
|
+
{
|
|
12326
|
+
"type": "text",
|
|
12327
|
+
"value": [
|
|
12328
|
+
"* Check whether a distributed in-memory table exists",
|
|
12329
|
+
""
|
|
12330
|
+
]
|
|
12331
|
+
},
|
|
12332
|
+
{
|
|
12333
|
+
"type": "code",
|
|
12334
|
+
"language": "console",
|
|
12335
|
+
"value": [
|
|
12336
|
+
"",
|
|
12337
|
+
" $ objs(true)",
|
|
12338
|
+
""
|
|
12339
|
+
]
|
|
12340
|
+
},
|
|
12341
|
+
{
|
|
12342
|
+
"type": "text",
|
|
12343
|
+
"value": [
|
|
12344
|
+
"* Delete a distributed in-memory table",
|
|
12345
|
+
""
|
|
12346
|
+
]
|
|
12347
|
+
},
|
|
12348
|
+
{
|
|
12349
|
+
"type": "code",
|
|
12350
|
+
"language": "console",
|
|
12351
|
+
"value": [
|
|
12352
|
+
"",
|
|
12353
|
+
" $ dropDistributedInMemoryTable(`dt)"
|
|
11550
12354
|
]
|
|
11551
12355
|
}
|
|
11552
12356
|
]
|
|
@@ -11758,6 +12562,305 @@
|
|
|
11758
12562
|
}
|
|
11759
12563
|
]
|
|
11760
12564
|
},
|
|
12565
|
+
"createLookupJoinEngine": {
|
|
12566
|
+
"title": "createLookupJoinEngine",
|
|
12567
|
+
"type": "function",
|
|
12568
|
+
"children": [
|
|
12569
|
+
{
|
|
12570
|
+
"title": "Syntax",
|
|
12571
|
+
"type": "grammer",
|
|
12572
|
+
"children": [
|
|
12573
|
+
{
|
|
12574
|
+
"type": "text",
|
|
12575
|
+
"value": [
|
|
12576
|
+
"createLookupJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, [rightTimeColumn], [checkTimes])"
|
|
12577
|
+
]
|
|
12578
|
+
}
|
|
12579
|
+
]
|
|
12580
|
+
},
|
|
12581
|
+
{
|
|
12582
|
+
"title": "Details",
|
|
12583
|
+
"type": "detail",
|
|
12584
|
+
"children": [
|
|
12585
|
+
{
|
|
12586
|
+
"type": "text",
|
|
12587
|
+
"value": [
|
|
12588
|
+
"Create a lookup join streaming engine to perform left join on stream tables. It conducts a real-time left join on two stream tables, or on a stream table and a non-stream table (where the non-stream table needs to be refreshed regularly).",
|
|
12589
|
+
"",
|
|
12590
|
+
"Note:",
|
|
12591
|
+
"",
|
|
12592
|
+
"\\1. A left join is triggered only when new data is ingested to the left table.",
|
|
12593
|
+
"",
|
|
12594
|
+
"\\2. Data in the right table is grouped based on *matchingColumn* and only the latest record in each group is kept. ",
|
|
12595
|
+
"",
|
|
12596
|
+
"- If the right table is a subscribed stream table, the records will be updated when new data is ingested to the right table. ",
|
|
12597
|
+
"",
|
|
12598
|
+
"- If the right table is an in-memory table or a DFS table (currently only dimension table is supported), the system refreshes the right table at specified *checkTimes* intervals.",
|
|
12599
|
+
"",
|
|
12600
|
+
"Starting from version 1.30.17, 2.00.5, DolphinDB supports using streaming engines to ingest data into streaming join engines to realize cascade of engines with :doc:`/FunctionsandCommands/FunctionReferences/g/getLeftStream` and :doc:`/FunctionsandCommands/FunctionReferences/g/getRightStream`."
|
|
12601
|
+
]
|
|
12602
|
+
}
|
|
12603
|
+
]
|
|
12604
|
+
},
|
|
12605
|
+
{
|
|
12606
|
+
"title": "Arguments",
|
|
12607
|
+
"type": "parameters",
|
|
12608
|
+
"children": [
|
|
12609
|
+
{
|
|
12610
|
+
"type": "text",
|
|
12611
|
+
"value": [
|
|
12612
|
+
"`name` is a STRING indicating the name of the lookup join streaming engine.",
|
|
12613
|
+
"",
|
|
12614
|
+
"`leftTable` is a table object. Its schema must be the same as the subscribed stream table.",
|
|
12615
|
+
"",
|
|
12616
|
+
"`rightTable` is a table object. It is an empty in-memory table, stream table or dimension table. Note that if the *rightTable* is not subscribed, *checkTimes* must be specified for timed data refreshing.",
|
|
12617
|
+
"",
|
|
12618
|
+
"`outputTable` is a required table object to hold the calculation results. Before using function ``createLookupJoinEngine``, set up an empty table as the *outputTable*, and specify the column names and data types.",
|
|
12619
|
+
"",
|
|
12620
|
+
"The columns of the *outputTable* are in the following order: the matching columns, the result columns. Specifically:",
|
|
12621
|
+
"",
|
|
12622
|
+
"\\(1) The first few columns must be arranged in the same order as specified in *matchingColumn*.",
|
|
12623
|
+
"",
|
|
12624
|
+
"\\(2) The last few columns are the results of the *metrics*.",
|
|
12625
|
+
"",
|
|
12626
|
+
"`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> (it's not necessary to specify the column names). For more information about metacode, please refer to :doc:`/Objects/Metaprogramming`.",
|
|
12627
|
+
"",
|
|
12628
|
+
"`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.",
|
|
12629
|
+
"",
|
|
12630
|
+
"Specify *matchingColumn* following the rules below:",
|
|
12631
|
+
"",
|
|
12632
|
+
"\\1. When there is only 1 matching column - If the names of the matching column are the same in both tables, *matchingColumn* should be specified as a STRING scalar; otherwise it's a tuple of two elements. For example, if the matching column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = [[\\`sym],[\\`sym1]].",
|
|
12633
|
+
"",
|
|
12634
|
+
"\\2. When there are multiple matching columns - If the names of the matching columns are all the same in both tables, specify *matchingColumn* as a STRING vector; otherwise it's a tuple of two elements. For example, if the matching columns are named \"timestamp\" and \"sym\" in the left table, whereas in the right table they're named \"timestamp\" and \"sym1\", then *matchingColumn* = [[\\`timestamp, \\`sym], [\\`timestamp,\\`sym1]].",
|
|
12635
|
+
"",
|
|
12636
|
+
"`rightTimeColumn` is a STRING scalar, indicating the time column in the right table. If the parameter is specified, the right table will keep the record with the latest timestamp. If there are multiple records with identical timestamp, only the latest is retained. If the parameter is not specified, the latest ingested record based on the system time will be kept.",
|
|
12637
|
+
"",
|
|
12638
|
+
"`checkTimes` is a temporal vector or DURATION scalar. If it is specified, the system will regularly update the data set in the right table (with only the latest record kept).",
|
|
12639
|
+
"",
|
|
12640
|
+
"- If *checkTimes* is a temporal vector, it is of SECOND, TIME or NANOTIME type. The lookup join engine updates the right table on a daily basis according to the time specified by each element in the vector.",
|
|
12641
|
+
"",
|
|
12642
|
+
"- If *checkTimes* is a DURATION scalar, it indicates the interval to update the right table."
|
|
12643
|
+
]
|
|
12644
|
+
}
|
|
12645
|
+
]
|
|
12646
|
+
},
|
|
12647
|
+
{
|
|
12648
|
+
"title": "First Release",
|
|
12649
|
+
"children": [
|
|
12650
|
+
{
|
|
12651
|
+
"type": "text",
|
|
12652
|
+
"value": [
|
|
12653
|
+
"1.30.16/2.00.4"
|
|
12654
|
+
]
|
|
12655
|
+
}
|
|
12656
|
+
]
|
|
12657
|
+
},
|
|
12658
|
+
{
|
|
12659
|
+
"title": "Examples",
|
|
12660
|
+
"type": "example",
|
|
12661
|
+
"children": [
|
|
12662
|
+
{
|
|
12663
|
+
"type": "text",
|
|
12664
|
+
"value": [
|
|
12665
|
+
"Ex. 1",
|
|
12666
|
+
""
|
|
12667
|
+
]
|
|
12668
|
+
},
|
|
12669
|
+
{
|
|
12670
|
+
"type": "code",
|
|
12671
|
+
"language": "console",
|
|
12672
|
+
"value": [
|
|
12673
|
+
" ",
|
|
12674
|
+
" $ login(`admin, `123456)",
|
|
12675
|
+
" $ share streamTable(1000:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades",
|
|
12676
|
+
" $ share streamTable(1000:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT]) as prices",
|
|
12677
|
+
" $ output = table(100:0, `sym`factor1`factor2`factor3, [SYMBOL, DOUBLE, DOUBLE, DOUBLE])",
|
|
12678
|
+
"",
|
|
12679
|
+
" $ LjEngine = createLookupJoinEngine(name=\"test1\", leftTable=trades, rightTable=prices, outputTable=output, metrics=<[price,val,price*val]>, matchingColumn=`sym)",
|
|
12680
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"append_leftTable\", offset=0, handler=appendForJoin{LjEngine, true}, msgAsTable=true) ",
|
|
12681
|
+
" $ subscribeTable(tableName=\"prices\", actionName=\"append_rightTable\", offset=0, handler=appendForJoin{LjEngine, false}, msgAsTable=true) ",
|
|
12682
|
+
"",
|
|
12683
|
+
" $ n = 15",
|
|
12684
|
+
" $ tem1 = table( (2018.10.08T01:01:01.001 + 1..12) join (2018.10.08T01:01:01.001 + 1..3)as timestamps,take(`A`B`C, n) as sym,take(1..15,n) as val,1..15 as id)",
|
|
12685
|
+
" $ prices.append!(tem1)",
|
|
12686
|
+
" $ sleep(2000)",
|
|
12687
|
+
" $ n = 10",
|
|
12688
|
+
" $ tem2 = table( 2019.10.08T01:01:01.001 + 1..n as timestamps,take(`A`B`C, n) as sym,take(0.1+10..20,n) as price)",
|
|
12689
|
+
" $ trades.append!(tem2)",
|
|
12690
|
+
" $ sleep(100)",
|
|
12691
|
+
" $ select * from output",
|
|
12692
|
+
""
|
|
12693
|
+
]
|
|
12694
|
+
},
|
|
12695
|
+
{
|
|
12696
|
+
"type": "text",
|
|
12697
|
+
"value": [
|
|
12698
|
+
"=== ======= ======= =======",
|
|
12699
|
+
"sym factor1 factor2 factor3",
|
|
12700
|
+
"=== ======= ======= =======",
|
|
12701
|
+
"A 10.1 13 131.3",
|
|
12702
|
+
"B 11.1 14 155.4",
|
|
12703
|
+
"C 12.1 15 181.5",
|
|
12704
|
+
"A 13.1 13 170.3",
|
|
12705
|
+
"B 14.1 14 197.4",
|
|
12706
|
+
"C 15.1 15 226.5",
|
|
12707
|
+
"A 16.1 13 209.3",
|
|
12708
|
+
"B 17.1 14 239.4",
|
|
12709
|
+
"C 8.1 15 271.5",
|
|
12710
|
+
"A 19.1 13 248.3",
|
|
12711
|
+
"=== ======= ======= =======",
|
|
12712
|
+
"",
|
|
12713
|
+
"Ex. 2",
|
|
12714
|
+
""
|
|
12715
|
+
]
|
|
12716
|
+
},
|
|
12717
|
+
{
|
|
12718
|
+
"type": "code",
|
|
12719
|
+
"language": "console",
|
|
12720
|
+
"value": [
|
|
12721
|
+
" ",
|
|
12722
|
+
" $ share streamTable(1000:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades",
|
|
12723
|
+
" $ share streamTable(1000:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT]) as prices",
|
|
12724
|
+
" $ output = table(100:0, `sym`factor1`factor2`factor3, [SYMBOL, DOUBLE, DOUBLE, DOUBLE])",
|
|
12725
|
+
" $ LjEngine = createLookupJoinEngine(name=\"test1\", leftTable=trades, rightTable=prices, outputTable=output, metrics=<[price,val,price*val]>, matchingColumn=`sym, rightTimeColumn=`timestamps)",
|
|
12726
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"append_leftTable\", offset=0, handler=appendForJoin{LjEngine, true}, msgAsTable=true) ",
|
|
12727
|
+
" $ subscribeTable(tableName=\"prices\", actionName=\"append_rightTable\", offset=0, handler=appendForJoin{LjEngine, false}, msgAsTable=true) ",
|
|
12728
|
+
"",
|
|
12729
|
+
" $ n = 15",
|
|
12730
|
+
" $ tem1 = table( (2018.10.08T01:01:01.001 + 1..12) join (2018.10.08T01:01:01.001 + 1..3)as timestamps,take(`A`B`C, n) as sym,take(1..15,n) as val,1..15 as id)",
|
|
12731
|
+
" $ prices.append!(tem1)",
|
|
12732
|
+
" $ sleep(2000)",
|
|
12733
|
+
" $ n = 10",
|
|
12734
|
+
" $ tem2 = table( 2019.10.08T01:01:01.001 + 1..n as timestamps,take(`A`B`C, n) as sym,take(0.1+10..20,n) as price)",
|
|
12735
|
+
" $ trades.append!(tem2)",
|
|
12736
|
+
" $ sleep(100)",
|
|
12737
|
+
" $ select * from output",
|
|
12738
|
+
""
|
|
12739
|
+
]
|
|
12740
|
+
},
|
|
12741
|
+
{
|
|
12742
|
+
"type": "text",
|
|
12743
|
+
"value": [
|
|
12744
|
+
"=== ======= ======= =======",
|
|
12745
|
+
"sym factor1 factor2 factor3",
|
|
12746
|
+
"=== ======= ======= =======",
|
|
12747
|
+
"A 10.1 10 101",
|
|
12748
|
+
"B 11.1 11 122.1",
|
|
12749
|
+
"C 12.1 12 145.2",
|
|
12750
|
+
"A 13.1 10 131",
|
|
12751
|
+
"B 14.1 11 155.1",
|
|
12752
|
+
"C 15.1 12 181.2",
|
|
12753
|
+
"A 16.1 10 161",
|
|
12754
|
+
"B 17.1 11 188.1",
|
|
12755
|
+
"C 18.1 12 217.2",
|
|
12756
|
+
"A 19.1 10 191",
|
|
12757
|
+
"=== ======= ======= =======",
|
|
12758
|
+
"",
|
|
12759
|
+
"Ex. 3:",
|
|
12760
|
+
"The right table is an in-memory table, so *checkTimes* must be set.",
|
|
12761
|
+
""
|
|
12762
|
+
]
|
|
12763
|
+
},
|
|
12764
|
+
{
|
|
12765
|
+
"type": "code",
|
|
12766
|
+
"language": "console",
|
|
12767
|
+
"value": [
|
|
12768
|
+
" ",
|
|
12769
|
+
" $ share streamTable(1000:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades",
|
|
12770
|
+
" $ output = table(100:0, `sym`factor1`factor2`factor3, [SYMBOL, DOUBLE, DOUBLE, DOUBLE])",
|
|
12771
|
+
" $ prices=table(1000:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT])",
|
|
12772
|
+
" $ LjEngine = createLookupJoinEngine(name=\"test1\", leftTable=trades, rightTable=prices, outputTable=output, metrics=<[price,val,price*val]>, matchingColumn=`sym, rightTimeColumn=`timestamps, checkTimes=1s)",
|
|
12773
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"append_leftTable\", offset=0, handler=appendForJoin{LjEngine, true}, msgAsTable=true) ",
|
|
12774
|
+
"",
|
|
12775
|
+
" $ n = 15",
|
|
12776
|
+
" $ tem1 = table( (2018.10.08T01:01:01.001 + 1..12) join (2018.10.08T01:01:01.001 + 1..3)as timestamps,take(`A`B`C, n) as sym,take(1..15,n) as val,1..15 as id)",
|
|
12777
|
+
" $ prices.append!(tem1)",
|
|
12778
|
+
" $ sleep(2000)",
|
|
12779
|
+
" $ n = 10",
|
|
12780
|
+
" $ tem2 = table( 2019.10.08T01:01:01.001 + 1..n as timestamps,take(`A`B`C, n) as sym,take(0.1+10..20,n) as price)",
|
|
12781
|
+
" $ trades.append!(tem2)",
|
|
12782
|
+
" $ sleep(100)",
|
|
12783
|
+
" $ select * from output",
|
|
12784
|
+
""
|
|
12785
|
+
]
|
|
12786
|
+
},
|
|
12787
|
+
{
|
|
12788
|
+
"type": "text",
|
|
12789
|
+
"value": [
|
|
12790
|
+
"=== ======= ======= =======",
|
|
12791
|
+
"sym factor1 factor2 factor3",
|
|
12792
|
+
"=== ======= ======= =======",
|
|
12793
|
+
"A 10.1 10 101",
|
|
12794
|
+
"B 11.1 11 122.1",
|
|
12795
|
+
"C 12.1 12 145.2",
|
|
12796
|
+
"A 13.1 10 131",
|
|
12797
|
+
"B 14.1 11 155.1",
|
|
12798
|
+
"C 15.1 12 181.2",
|
|
12799
|
+
"A 16.1 10 161",
|
|
12800
|
+
"B 17.1 11 188.1",
|
|
12801
|
+
"C 18.1 12 217.2",
|
|
12802
|
+
"A 19.1 10 191",
|
|
12803
|
+
"=== ======= ======= =======",
|
|
12804
|
+
"",
|
|
12805
|
+
"Ex 4:",
|
|
12806
|
+
"Join the left table \"trades\" (a real-time stream table) and the right table \"prices\" (a dimension table with relatively infrequent updates) to look up the matched records in column \"id\" from the right table.",
|
|
12807
|
+
""
|
|
12808
|
+
]
|
|
12809
|
+
},
|
|
12810
|
+
{
|
|
12811
|
+
"type": "code",
|
|
12812
|
+
"language": "console",
|
|
12813
|
+
"value": [
|
|
12814
|
+
" ",
|
|
12815
|
+
" $ share streamTable(1000:0, `time`volume`id, [TIMESTAMP, INT,INT]) as trades",
|
|
12816
|
+
" $ dbPath=\"dfs://testlj\"",
|
|
12817
|
+
" $ if(existsDatabase(dbPath)){",
|
|
12818
|
+
" $ \tdropDatabase(dbPath)",
|
|
12819
|
+
" $ }",
|
|
12820
|
+
" $ rt=table(1000:0, `time`price`id, [TIMESTAMP, DOUBLE, INT])",
|
|
12821
|
+
" $ db=database(dbPath, VALUE, `A`B`C)",
|
|
12822
|
+
" $ prices=db.createTable(rt,`rightTable)",
|
|
12823
|
+
" $ outputTable = table(10000:0, `id`volume`price`prod, [INT,INT,DOUBLE,DOUBLE])",
|
|
12824
|
+
"",
|
|
12825
|
+
" $ tradesLookupJoin = createLookupJoinEngine(name=\"streamLookup1\", leftTable=trades, rightTable=prices, outputTable=outputTable, metrics=<[volume,price,volume*price]>, matchingColumn=`id, rightTimeColumn=`time,checkTimes=1s)",
|
|
12826
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"append_trades\", offset=0, handler=appendForJoin{tradesLookupJoin, true}, msgAsTable=true) ",
|
|
12827
|
+
"",
|
|
12828
|
+
" $ def writeData(t,n){",
|
|
12829
|
+
" $ timev = 2021.10.08T01:01:01.001 + timestamp(1..n)",
|
|
12830
|
+
" $ volumev = take(1..n, n)",
|
|
12831
|
+
" $ id = take(1 2 3, n)",
|
|
12832
|
+
" $ insert into t values(timev, volumev, id)",
|
|
12833
|
+
" $ }",
|
|
12834
|
+
" $ //n=7",
|
|
12835
|
+
" $ writeData(rt, 10)",
|
|
12836
|
+
" $ prices.append!(rt)",
|
|
12837
|
+
" $ sleep(2000)",
|
|
12838
|
+
" $ writeData(trades, 6)",
|
|
12839
|
+
" $ sleep(2)",
|
|
12840
|
+
"",
|
|
12841
|
+
" $ select * from outputTable",
|
|
12842
|
+
""
|
|
12843
|
+
]
|
|
12844
|
+
},
|
|
12845
|
+
{
|
|
12846
|
+
"type": "text",
|
|
12847
|
+
"value": [
|
|
12848
|
+
"== ====== ===== ====",
|
|
12849
|
+
"id volume price prod",
|
|
12850
|
+
"== ====== ===== ====",
|
|
12851
|
+
"1 1 10 10",
|
|
12852
|
+
"2 2 8 16",
|
|
12853
|
+
"3 3 9 27",
|
|
12854
|
+
"1 4 10 40",
|
|
12855
|
+
"2 5 8 40",
|
|
12856
|
+
"3 6 9 54",
|
|
12857
|
+
"== ====== ===== ===="
|
|
12858
|
+
]
|
|
12859
|
+
}
|
|
12860
|
+
]
|
|
12861
|
+
}
|
|
12862
|
+
]
|
|
12863
|
+
},
|
|
11761
12864
|
"createPartitionedTable": {
|
|
11762
12865
|
"title": "createPartitionedTable",
|
|
11763
12866
|
"type": "function",
|
|
@@ -12048,7 +13151,7 @@
|
|
|
12048
13151
|
{
|
|
12049
13152
|
"type": "text",
|
|
12050
13153
|
"value": [
|
|
12051
|
-
"createReactiveStateEngine(name, metrics, dummyTable, outputTable, keyColumn, [filter], [snapshotDir], [snapshotIntervalInMsgCount], [keepOrder], [raftGroup])"
|
|
13154
|
+
"createReactiveStateEngine(name, metrics, dummyTable, outputTable, keyColumn, [filter], [snapshotDir], [snapshotIntervalInMsgCount], [keepOrder], [keyPurgeFilter], [keyPurgeFreqInSecond=0], [raftGroup])"
|
|
12052
13155
|
]
|
|
12053
13156
|
}
|
|
12054
13157
|
]
|
|
@@ -12062,20 +13165,17 @@
|
|
|
12062
13165
|
"value": [
|
|
12063
13166
|
"`name` is a string indicating the name of the reactive state engine. It is the only identifier of the reactive state engine. It can have letter, number and \"_\". It must start with a letter.",
|
|
12064
13167
|
"",
|
|
12065
|
-
"`metrics` is metacode specifying the formulas for calculation. The formulas should use vector functions instead of aggregate functions. For more information about metacode please refer to :doc:`/Objects/Metaprogramming`.",
|
|
12066
|
-
"",
|
|
12067
|
-
".. 下列状态函数在DolphinDB的响应式状态引擎中的实现均得到了优化。目前,状态引擎不允许使用未经优化的状态函数。应避免使用聚合函数。",
|
|
12068
|
-
"",
|
|
12069
|
-
".. * 累计窗口函数: cumavg, cumsum, cumprod, cumcount, cummin, cummax, cumvar, cumvarp, cumstd, cumstdp, cumcorr, cumcovar, cumbeta, cumwsum, cumwavg",
|
|
12070
|
-
".. * 滑动窗口函数: ema, mavg, msum, mcount, mprod, mvar, mvarp, mstd, mstdp, mskew, mkurtosis, mmin, mmax, mimin, mimax, mmed, mpercentile, mrank, mcorr, mcovar, mbeta, mwsum, mwavg, mslr",
|
|
12071
|
-
".. * 序列相关函数: deltas, ratios, ffill, move, prev, iterate, ewmMean, ewmVar, ewmStd, ewmCovar, ewmCorr",
|
|
13168
|
+
"`metrics` is metacode specifying the formulas for calculation. The formulas should use vector functions instead of aggregate functions. For more information about metacode please refer to :doc:`/Objects/Metaprogramming`. To use a user-defined function in the reactive state engine, please add \"@state\" to declare it before the definition.",
|
|
12072
13169
|
"",
|
|
12073
13170
|
"The following state functions in DolphinDB's reactive state engine has been optimized. Currently, unoptimized state functions are not supported by this engine. And aggregate functions should be avoid.",
|
|
12074
13171
|
"",
|
|
12075
13172
|
"* cumulative function: cumavg, cumsum, cumprod, cumcount, cummin, cummax, cumvar, cumvarp, cumstd, cumstdp, cumcorr, cumcovar, cumbeta, cumwsum, cumwavg, cumfirstNot, cumlastNot",
|
|
12076
|
-
"* 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, 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,
|
|
12077
|
-
"*
|
|
12078
|
-
"* topN
|
|
13173
|
+
"* 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",
|
|
13174
|
+
"* order-sensitive function: deltas, ratios, ffill, move, prev, iterate, ewmMean, ewmVar, ewmStd, ewmCov, ewmCorr",
|
|
13175
|
+
"* topN functions: msumTopN, mavgTopN, mstdpTopN, mstdTopN, mvarpTopN, mvarTopN, mcorrTopN, mbetaTopN, mcovarTopN, mwsumTopN",
|
|
13176
|
+
"* other: talibNull",
|
|
13177
|
+
"",
|
|
13178
|
+
"Note: The parameter *func* in the state function ``talib`` can only be a state function supported by the reactive state engine.",
|
|
12079
13179
|
"",
|
|
12080
13180
|
"`dummyTable` is a table object whose schema must be the same as the subscribed stream table. The system uses the schema of dummyTable to determine the data type of each column in the messages. Whether dummyTable contains data does not matter.",
|
|
12081
13181
|
"",
|
|
@@ -12490,6 +13590,33 @@
|
|
|
12490
13590
|
}
|
|
12491
13591
|
]
|
|
12492
13592
|
},
|
|
13593
|
+
{
|
|
13594
|
+
"title": "Details",
|
|
13595
|
+
"type": "detail",
|
|
13596
|
+
"children": [
|
|
13597
|
+
{
|
|
13598
|
+
"type": "text",
|
|
13599
|
+
"value": [
|
|
13600
|
+
"Create a time-series engine to conduct real-time time-series aggregate calculations with streaming data.",
|
|
13601
|
+
"",
|
|
13602
|
+
"Return a table object that subscribes to a stream table. Ingesting data to this table means that data enters the engine for windowed aggregations. The left boundary of the sliding window is inclusive and the right bounday is exclusive. ",
|
|
13603
|
+
"",
|
|
13604
|
+
"If *keyColumn* is specified to group the records that have the same key, the window calculation will be performed in each group.",
|
|
13605
|
+
"",
|
|
13606
|
+
"Rules for *timeColumn*:",
|
|
13607
|
+
"",
|
|
13608
|
+
"\\1. If keyColumn is not specified, the values in timeColumn must be incremental.",
|
|
13609
|
+
"",
|
|
13610
|
+
"\\2. If keyColumn is specified, the values from the same group in the timeColumn must be incremental.",
|
|
13611
|
+
"",
|
|
13612
|
+
"Otherwise, out-of-order data will will be discarded.",
|
|
13613
|
+
"",
|
|
13614
|
+
"Generally it is used in conjunction with :doc:`../s/subscribeTable`. Refer to `Time-Series Stream Engine of DolphinDB <https://github.com/dolphindb/Tutorials_EN/blob/master/stream_aggregator.md>`_ for more information. The engine it creates can be called across sessions.",
|
|
13615
|
+
""
|
|
13616
|
+
]
|
|
13617
|
+
}
|
|
13618
|
+
]
|
|
13619
|
+
},
|
|
12493
13620
|
{
|
|
12494
13621
|
"title": "Arguments",
|
|
12495
13622
|
"type": "parameters",
|
|
@@ -12499,16 +13626,11 @@
|
|
|
12499
13626
|
"value": [
|
|
12500
13627
|
"`name` is a string indicating the name of the engine. It is the only identifier of an engine. It can have letter, number and \"_\". It must start with a letter.",
|
|
12501
13628
|
"",
|
|
12502
|
-
"`useSystemTime` is
|
|
12503
|
-
"",
|
|
12504
|
-
".. * 当useSystemTime=true时,时间序列引擎会按照数据进入时间序列引擎的时刻(毫秒精度的本地系统时间,与数据中的时间列无关),每隔固定时间截取固定长度窗口的流数据进行计算。只要一个数据窗口中含有数据,数据窗口结束后就会自动进行计算。结果中的第一列为计算发生的时间戳,与数据中的时间无关。",
|
|
12505
|
-
"",
|
|
12506
|
-
".. * 当useSystemTime=false(缺省值)时,时间序列引擎根据流数据中的timeColumn列来截取数据窗口。一个数据窗口结束后的第一条新数据才会触发该数据窗口的计算。请注意,触发计算的数据并不会参与该次计算。",
|
|
13629
|
+
"`useSystemTime` is an optional BOOLEAN indicating whether the calculations are performed based on the system time when data is ingested into the engine.",
|
|
12507
13630
|
"",
|
|
12508
|
-
"
|
|
13631
|
+
"- *useSystemTime* = true: the engine will regularly window the streaming data at fixed time intervals for calculations according to the ingestion time (local system time with millisecond precision, independent of any temporal columns in the streaming table) of each record. As long as a window contains data, the calculation will be performed automatically when the window ends. The first column in output table indicates the timestamp when the calculation occurred.",
|
|
12509
13632
|
"",
|
|
12510
|
-
"*
|
|
12511
|
-
"* useSystemTime=false: the engine will intercept the window according to the timeColumn in the streaming table. The calculation for a window is triggered by the first record after the previous window. Please note that the record which triggers the calculation will not participate in this calculation. ",
|
|
13633
|
+
"- *useSystemTime* = false (default): the engine will window the streaming data according to the timeColumn in the stream table. The calculation for a window is triggered by the first record after the previous window. Please note that the record which triggers the calculation will not participate in this calculation.",
|
|
12512
13634
|
"",
|
|
12513
13635
|
"For example, there is a window ranges from 10:10:10 to 10:10:19. If useSystemTime=true and the window is not empty, the calculation will be triggered at 10:10:20. If useSystemTime=false and the first record after 10:10:19 is at 10:10:25, the calculation will be triggered at 10:10:25.",
|
|
12514
13636
|
"",
|
|
@@ -12652,9 +13774,7 @@
|
|
|
12652
13774
|
"",
|
|
12653
13775
|
"* It can use one or more built-in or user-defined aggregate functions such as <[sum(volume), avg(price)]>, or expressions of aggregate functions such as as <[avg(price1)-avg(price2)]>, or aggregate functions on operations involving multiple columns such as <[std(price1-price2)]>. ",
|
|
12654
13776
|
"",
|
|
12655
|
-
"
|
|
12656
|
-
"",
|
|
12657
|
-
"* A function used in metrics can return multiple results, such as <func(price) as \\`col1\\`col2>.",
|
|
13777
|
+
"* You can specify functions that return multiple values for metrics, such as <func(price) as \\`col1\\`col2> (it's not necessary to specify the column names).",
|
|
12658
13778
|
"",
|
|
12659
13779
|
"* If windowSize is a vector, each element of windowSize can correspond to multiple formulas in metrics. For example, if windowSize=[10,20], metrics can be (<[min(volume), max(volume)]>, <sum(volume)>). Metrics can also input nested tuple vectors, such as [[<[min(volume), max(volume)]>, <sum(volume)>],[<avg(volume)>]].",
|
|
12660
13780
|
"",
|
|
@@ -12732,19 +13852,24 @@
|
|
|
12732
13852
|
"",
|
|
12733
13853
|
".. fill可以输入向量,为每个metrics指定不同的fill方式。其中,向量中各项只能是'null', 'ffill'或一个数值,不能是'none'.",
|
|
12734
13854
|
"",
|
|
12735
|
-
"`fill` is a vector/scalar indicating the method to deal with an empty window.It could be:",
|
|
13855
|
+
"`fill` is a vector/scalar indicating the filling method to deal with an empty window (in a group). It could be:",
|
|
13856
|
+
"",
|
|
13857
|
+
"- 'none': no result",
|
|
13858
|
+
"- 'null': result is NULL.",
|
|
13859
|
+
"- 'ffill': output the result in the last window.",
|
|
13860
|
+
"- 'specific value': Specify a value. Its type should be the same as metrics output's type.",
|
|
13861
|
+
"",
|
|
13862
|
+
"*fill* could be a vector to specify different fill method for each metric. The element in vector can't be 'none'.",
|
|
12736
13863
|
"",
|
|
12737
|
-
"
|
|
12738
|
-
"* 'null': result is NULL.",
|
|
12739
|
-
"* 'ffill': output the result in the last window.",
|
|
12740
|
-
"* 'specific value': the type should be the same as metrics output's type.",
|
|
13864
|
+
"`forceTriggerTime` is an optional parameter. It is a non-negative integer indicating the waiting time (in seconds) to force trigger calculation in the uncalculated windows for each group. The rules are as follow:",
|
|
12741
13865
|
"",
|
|
12742
|
-
"
|
|
13866
|
+
"\\1. Suppose the end time of the uncalculated window is t, and an incoming record of another group arrives at t1: when t1-t>=forceTriggerTime, calculation of the window will be triggered.",
|
|
12743
13867
|
"",
|
|
12744
|
-
"
|
|
13868
|
+
"\\2. When a window doesn't contain any records:",
|
|
12745
13869
|
"",
|
|
12746
|
-
"
|
|
12747
|
-
"
|
|
13870
|
+
"- If *fill* is not specified, the window returns no result.",
|
|
13871
|
+
"",
|
|
13872
|
+
"- If *fill* is specified, the result of the window will be filled using the specified filling method.",
|
|
12748
13873
|
"",
|
|
12749
13874
|
"Note: useSystemTime must be false and updateTime cannot be specified if forceTriggerTime is set. If the data belonging to the current window is still be injected into the engine after the calculation is forced to be triggered, the data will be calculated in the next window. It is recommended not to set the a small value to forceTriggerTime.",
|
|
12750
13875
|
"",
|
|
@@ -12753,23 +13878,23 @@
|
|
|
12753
13878
|
"* If updateTime is set, the output table must be a keyedTable; If forceTriggerTime is set, output table can be an in-memory table or a distributed table.",
|
|
12754
13879
|
"* If the data belonging to the current window is still reached after the calculation is forced to be triggered, the data will be calculated in the next window.",
|
|
12755
13880
|
"",
|
|
12756
|
-
"`raftGroup` is an integer greater than 1 indicating Raft group ID. Setting this parameter to enable high availability in the computing engine. The calculation engines will be created on other Followers, and the snapshot will be synchronized to other Followers as well. Enable high availability on subscriber with function subscribeTable. The raftGroup ID of subscribeTable must be the same as that of the stream engine. When the leader is down, it will automatically switch to a new leader and re-subscribe. Please note that SnapShotDir must be specified if raftGroup is specified."
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
"type": "detail",
|
|
12764
|
-
"children": [
|
|
12765
|
-
{
|
|
12766
|
-
"type": "text",
|
|
12767
|
-
"value": [
|
|
12768
|
-
"Create a time-series engine to conduct real-time time-series aggregate calculations with streaming data.",
|
|
13881
|
+
"`raftGroup` is an integer greater than 1 indicating Raft group ID. Setting this parameter to enable high availability in the computing engine. The calculation engines will be created on other Followers, and the snapshot will be synchronized to other Followers as well. Enable high availability on subscriber with function subscribeTable. The raftGroup ID of subscribeTable must be the same as that of the stream engine. When the leader is down, it will automatically switch to a new leader and re-subscribe. Please note that SnapShotDir must be specified if raftGroup is specified.",
|
|
13882
|
+
"",
|
|
13883
|
+
"`keyPurgeFreqInSec` is a positive integer indicating the interval (in seconds) to remove groups with no incoming data for a long time. If a group has no incoming data for at least *keyPurgeFreqInSec* seconds after the last time of data purging, it will be removed. ",
|
|
13884
|
+
"",
|
|
13885
|
+
"Note: To specify this parameter, parameter *forceTriggerTime* must be specified and parameter *fill* cannot be specified. ",
|
|
13886
|
+
"",
|
|
13887
|
+
"You can check the number of groups in a time-series streaming engine based on the column numGroups returned by :doc:`../g/getStreamEngineStat`.",
|
|
12769
13888
|
"",
|
|
12770
|
-
"
|
|
13889
|
+
"`closed` is a STRING indicating whether the left or the right boundary is included.",
|
|
12771
13890
|
"",
|
|
12772
|
-
"
|
|
13891
|
+
"* closed = 'left': left-closed, right-open",
|
|
13892
|
+
"* closed = 'right': left-open, right-closed",
|
|
13893
|
+
"",
|
|
13894
|
+
".. `closed`` is a STRING indicating the point in the moving window that need to be excluded from calculation. This optional parameter can specified as ‘left’ or ‘right’. The default value is `left`.",
|
|
13895
|
+
"",
|
|
13896
|
+
".. * closed = 'left': the last point in the window is excluded from calculations.",
|
|
13897
|
+
".. * closed = 'right': the first point in the window is excluded from calculations."
|
|
12773
13898
|
]
|
|
12774
13899
|
}
|
|
12775
13900
|
]
|
|
@@ -12792,8 +13917,8 @@
|
|
|
12792
13917
|
" ",
|
|
12793
13918
|
" $ share streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades",
|
|
12794
13919
|
" $ output1 = table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])",
|
|
12795
|
-
" $
|
|
12796
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"
|
|
13920
|
+
" $ engine1 = createTimeSeriesEngine(name=\"engine1\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=false)",
|
|
13921
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);",
|
|
12797
13922
|
" ",
|
|
12798
13923
|
" $ insert into trades values(2018.10.08T01:01:01.785,`A,10)",
|
|
12799
13924
|
" $ insert into trades values(2018.10.08T01:01:02.125,`B,26)",
|
|
@@ -12833,7 +13958,6 @@
|
|
|
12833
13958
|
"As there are no records since 01:05:00.000, no calculations are triggers for the window of [01:04:00.000, 01:05:00.000).",
|
|
12834
13959
|
"",
|
|
12835
13960
|
"The table output1 stores the calculation results of the time-series engine. As useWindowStartTime=false, the timestamps in the output table are the starting time of the windows + windowSize. If useWindowStartTime=true, then the timestamps in the output table are the starting time of the windows, as illustrated in the following example:",
|
|
12836
|
-
"",
|
|
12837
13961
|
""
|
|
12838
13962
|
]
|
|
12839
13963
|
},
|
|
@@ -12843,8 +13967,8 @@
|
|
|
12843
13967
|
"value": [
|
|
12844
13968
|
" ",
|
|
12845
13969
|
" $ output2 = table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])",
|
|
12846
|
-
" $
|
|
12847
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"
|
|
13970
|
+
" $ engine2 = createTimeSeriesEngine(name=\"engine2\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output2, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=true)",
|
|
13971
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"engine2\", offset=0, handler=append!{engine2}, msgAsTable=true)",
|
|
12848
13972
|
" ",
|
|
12849
13973
|
" $ sleep(10)",
|
|
12850
13974
|
" $ select * from output2;",
|
|
@@ -12873,8 +13997,8 @@
|
|
|
12873
13997
|
"value": [
|
|
12874
13998
|
" ",
|
|
12875
13999
|
" $ output3 = keyedTable(`time`sym,10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])",
|
|
12876
|
-
" $
|
|
12877
|
-
" $ subscribeTable(tableName=\"trades\", actionName=\"
|
|
14000
|
+
" $ engine3 = createTimeSeriesEngine(name=\"engine3\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output3, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, updateTime=1000, useWindowStartTime=false)",
|
|
14001
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"engine3\", offset=0, handler=append!{engine3}, msgAsTable=true)",
|
|
12878
14002
|
" ",
|
|
12879
14003
|
" $ sleep(2001)",
|
|
12880
14004
|
" $ select * from output3;",
|
|
@@ -12983,24 +14107,46 @@
|
|
|
12983
14107
|
"",
|
|
12984
14108
|
" $ share streamTable(1000:0, `time`sym`qty, [DATETIME, SYMBOL, INT]) as trades",
|
|
12985
14109
|
" $ output3 = table(10000:0, `time`sym`sumQty, [DATETIME, SYMBOL, INT])",
|
|
12986
|
-
"
|
|
12987
|
-
" $
|
|
12988
|
-
" $
|
|
12989
|
-
" $ insert into agg3 values(2018.08.01T14:05:43,`A,1)",
|
|
12990
|
-
" $ sleep(1000)",
|
|
12991
|
-
" $ insert into agg3 values(2018.08.01T14:05:44,`B,1)",
|
|
12992
|
-
" $ sleep(8000)",
|
|
12993
|
-
" $ insert into agg3 values(2018.08.01T14:05:52,`B,3)",
|
|
12994
|
-
" $ sleep(2000)",
|
|
12995
|
-
" $ insert into agg3 values(2018.08.01T14:05:54,`A,3)",
|
|
14110
|
+
"",
|
|
14111
|
+
" $ engine = createTimeSeriesEngine(name=\"engine\", windowSize=6, step=6, metrics=<sum(qty)>, dummyTable=trades, outputTable=output3, timeColumn=`time,keyColumn=`sym, forceTriggerTime=7,fill=1000)",
|
|
14112
|
+
" $ subscribeTable(tableName=\"trades\", actionName=\"engine\", offset=0, handler=append!{engine}, msgAsTable=true)",
|
|
12996
14113
|
" $ sleep(1000)",
|
|
12997
|
-
" $ insert into
|
|
12998
|
-
" $
|
|
12999
|
-
" $
|
|
13000
|
-
" $
|
|
13001
|
-
" $
|
|
13002
|
-
" $
|
|
13003
|
-
" $
|
|
14114
|
+
" $ insert into engine values(2018.08.01T14:05:43,`A,1)",
|
|
14115
|
+
" $ insert into engine values(2018.08.01T14:05:43,`C,3)",
|
|
14116
|
+
" $ sleep(10)",
|
|
14117
|
+
" $ insert into engine values(2018.08.01T14:05:44,`B,1)",
|
|
14118
|
+
" $ sleep(80)",
|
|
14119
|
+
" $ insert into engine values(2018.08.01T14:05:52,`B,3)",
|
|
14120
|
+
" $ sleep(20)",
|
|
14121
|
+
" $ insert into engine values(2018.08.01T14:05:54,`A,3)",
|
|
14122
|
+
" $ sleep(10)",
|
|
14123
|
+
" $ insert into engine values(2018.08.01T14:05:55,`A,5)",
|
|
14124
|
+
" $ sleep(20)",
|
|
14125
|
+
" $ insert into engine values(2018.08.01T14:05:57,`B,5)",
|
|
14126
|
+
" $ sleep(50)",
|
|
14127
|
+
" $ insert into engine values(2018.08.01T14:06:12,`A,1)",
|
|
14128
|
+
" $ sleep(50)",
|
|
14129
|
+
" $ select * from output3 order by sym",
|
|
14130
|
+
""
|
|
14131
|
+
]
|
|
14132
|
+
},
|
|
14133
|
+
{
|
|
14134
|
+
"type": "text",
|
|
14135
|
+
"value": [
|
|
14136
|
+
"=================== === ======",
|
|
14137
|
+
"time sum Qty",
|
|
14138
|
+
"=================== === ======",
|
|
14139
|
+
"2018.08.01T14:05:46 A\t1",
|
|
14140
|
+
"2018.08.01T14:05:52 A\t1,000",
|
|
14141
|
+
"2018.08.01T14:05:58 A\t8",
|
|
14142
|
+
"2018.08.01T14:06:04 A\t1,000",
|
|
14143
|
+
"2018.08.01T14:06:10 A\t1,000",
|
|
14144
|
+
"2018.08.01T14:05:46 B\t1",
|
|
14145
|
+
"2018.08.01T14:05:52 B\t1,000",
|
|
14146
|
+
"2018.08.01T14:05:58 B\t8",
|
|
14147
|
+
"2018.08.01T14:05:46 C\t3",
|
|
14148
|
+
"2018.08.01T14:05:52 C\t1,000",
|
|
14149
|
+
"=================== === ======"
|
|
13004
14150
|
]
|
|
13005
14151
|
}
|
|
13006
14152
|
]
|
|
@@ -13121,7 +14267,7 @@
|
|
|
13121
14267
|
"",
|
|
13122
14268
|
"`window` is a pair of integers or duration values, indicating the range of the sliding window, including both left and right bounds.",
|
|
13123
14269
|
"",
|
|
13124
|
-
"`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. For details about metacode, see :doc:`/Objects/Metaprogramming`。",
|
|
14270
|
+
"`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> (it’s not necessary to specify the column names). For details about metacode, see :doc:`/Objects/Metaprogramming`。",
|
|
13125
14271
|
"",
|
|
13126
14272
|
"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。",
|
|
13127
14273
|
"",
|
|
@@ -13157,6 +14303,8 @@
|
|
|
13157
14303
|
"value": [
|
|
13158
14304
|
"Create the window join streaming engine. Return a table that is the :doc:`/SQLStatements/TableJoiners/windowjoin` result of a left table and a right table. This function is usually used in conjunction with :doc:`../s/subscribeTable`.",
|
|
13159
14305
|
"",
|
|
14306
|
+
"Note: Only function :doc:`../a/appendForJoin`、:doc:`/FunctionsandCommands/FunctionReferences/g/getLeftStream` or :doc:`/FunctionsandCommands/FunctionReferences/g/getRightStream` can be used to ingest data into the window join engine.",
|
|
14307
|
+
"",
|
|
13160
14308
|
"Calculation rules of the engine:",
|
|
13161
14309
|
"",
|
|
13162
14310
|
"\\1. With data grouped based on the *matchingColumn*, the timestamp of each record from the left table determines a time window in the right table. The calculation of each window is triggered by the arrival of the first record after the current window ends.",
|
|
@@ -15623,7 +16771,9 @@
|
|
|
15623
16771
|
{
|
|
15624
16772
|
"type": "text",
|
|
15625
16773
|
"value": [
|
|
15626
|
-
"dailyAlignedBar(X, timeOffset, n, [timeEnd], [mergeSessionEnd=false])"
|
|
16774
|
+
"dailyAlignedBar(X, timeOffset, n, [timeEnd], [mergeSessionEnd=false])",
|
|
16775
|
+
"",
|
|
16776
|
+
"Related function: :doc:`../b/bar`"
|
|
15627
16777
|
]
|
|
15628
16778
|
}
|
|
15629
16779
|
]
|
|
@@ -15635,15 +16785,15 @@
|
|
|
15635
16785
|
{
|
|
15636
16786
|
"type": "text",
|
|
15637
16787
|
"value": [
|
|
15638
|
-
"`X`
|
|
16788
|
+
"`X` is a temporal vector of type SECOND, TIME, NANOTIME, DATETIME, TIMESTAMP or NANOTIMESTAMP.",
|
|
15639
16789
|
"",
|
|
15640
|
-
"`timeOffset` is a scalar/vector of type SECOND, TIME or NANOTIME
|
|
16790
|
+
"`timeOffset` is a scalar/vector of type SECOND, TIME or NANOTIME with the same accuracy of *X* indicating the left boundary of session(s). If it is a vector, it must be increasing.",
|
|
15641
16791
|
"",
|
|
15642
|
-
"`n`
|
|
16792
|
+
"`n` is a positive integer or DURATION type data indicating the window length. If n is a positive integer, its unit is the minimum accuracy of timeOffset. If n is a DURATION type data, its unit cannot be y, M, w, d, B.",
|
|
15643
16793
|
"",
|
|
15644
|
-
"`timeEnd`
|
|
16794
|
+
"`timeEnd` is an optional parameter of the same type and length of *timeOffset* indicating the right boundary of session(s).",
|
|
15645
16795
|
"",
|
|
15646
|
-
"`mergeSessionEnd`
|
|
16796
|
+
"`mergeSessionEnd` is a Boolean value. When the right boundary of a session (as specified in timeEnd) is also the right boundary of a window, if mergeSessionEnd=true, the right boundary of the session is merged into the previous window."
|
|
15647
16797
|
]
|
|
15648
16798
|
}
|
|
15649
16799
|
]
|
|
@@ -15751,7 +16901,24 @@
|
|
|
15751
16901
|
{
|
|
15752
16902
|
"type": "text",
|
|
15753
16903
|
"value": [
|
|
15754
|
-
"
|
|
16904
|
+
"Ex 3. When calculating 1-minute OHLC bars, the data type needs to be converted to LONG if n needs to be converted to NANOTIMESTAMP, otherwise an integer overflow will occur.",
|
|
16905
|
+
"",
|
|
16906
|
+
".. code-block:: console",
|
|
16907
|
+
" :linenos:",
|
|
16908
|
+
" :emphasize-lines: 10, 12",
|
|
16909
|
+
" ",
|
|
16910
|
+
" $ n = 1000000",
|
|
16911
|
+
" $ nano=(09:30:00.000000000 + rand(long(6.5*60*60*1000000000), n)).sort!() ",
|
|
16912
|
+
" $ sessionStartNano=09:30:00.000000000 ",
|
|
16913
|
+
" $ price = 100+cumsum(rand(0.02, n)-0.01)",
|
|
16914
|
+
" $ volume = rand(1000, n)",
|
|
16915
|
+
" $ symbol = rand(`600519`000001`600000`601766, n)",
|
|
16916
|
+
" $ tradeNano=table(symbol, nano, price, volume).sortBy!(`symbol`nano)",
|
|
16917
|
+
" $ undef(`nano`price`volume`symbol)",
|
|
16918
|
+
" $ barMinutes=7",
|
|
16919
|
+
" $ itv = barMinutes*60*long(1000000000)",
|
|
16920
|
+
"",
|
|
16921
|
+
" $ OHLC_nano=select first(price) as open, max(price) as high, min(price) as low, last(price) as close, sum(volume) as volume from tradeNano group by symbol, dailyAlignedBar(nano, sessionStartNano, itv) as barStart"
|
|
15755
16922
|
]
|
|
15756
16923
|
}
|
|
15757
16924
|
]
|
|
@@ -15769,7 +16936,11 @@
|
|
|
15769
16936
|
{
|
|
15770
16937
|
"type": "text",
|
|
15771
16938
|
"value": [
|
|
15772
|
-
"database(directory, [partitionType], [partitionScheme], [locations])"
|
|
16939
|
+
"database(directory, [partitionType], [partitionScheme], [locations], [engine='OLAP'], [atomic='TRANS'])",
|
|
16940
|
+
"",
|
|
16941
|
+
"Starting from 1.30.16/2.00.4, if the configuration paramter *enableChunkGranularityConfig* = true, use the following syntax:",
|
|
16942
|
+
"",
|
|
16943
|
+
"database(directory, [partitionType], [partitionScheme], [locations], [engine='OLAP'], [atomic='TRANS'], [chunkGranularity='TABLE'])"
|
|
15773
16944
|
]
|
|
15774
16945
|
}
|
|
15775
16946
|
]
|
|
@@ -15803,7 +16974,24 @@
|
|
|
15803
16974
|
"|composite domain |COMPO |A vector. Each element of the vector is a database handle. |",
|
|
15804
16975
|
"+-----------------+---------------------+--------------------------------------------------------------------------------------------------------------------+",
|
|
15805
16976
|
"",
|
|
15806
|
-
"`locations` a tuple indicating the locations of each partition. The number of elements in the tuple should be the same as that of partitions determined by *partitionType* and *partitionScheme*. When saving partitions on multiple nodes, we can specify the location for each partition by using the DFS (Distributed File System) or the *locations* parameter. If the *locations* parameter is not specified, all partitions reside in the current node. We cannot specify partition locations for composite partitions."
|
|
16977
|
+
"`locations` a tuple indicating the locations of each partition. The number of elements in the tuple should be the same as that of partitions determined by *partitionType* and *partitionScheme*. When saving partitions on multiple nodes, we can specify the location for each partition by using the DFS (Distributed File System) or the *locations* parameter. If the *locations* parameter is not specified, all partitions reside in the current node. We cannot specify partition locations for composite partitions.",
|
|
16978
|
+
"",
|
|
16979
|
+
"`engine = 'OLAP'` is a parameter with fixed value. Only version 2.00 supports modifying the parameter.",
|
|
16980
|
+
"",
|
|
16981
|
+
"`atomic` indicates at which level the atomicity is guaranteed for a write transaction, thus determining whether concurrent writes to the same chunk are allowed. It can be 'TRANS' or 'CHUNK' and the default value is 'TRANS'.",
|
|
16982
|
+
"",
|
|
16983
|
+
"- 'TRANS' indicates that the atomicity is guaranteed at the transaction level. If a transaction attempts to write to multiple chunks and one of the chunks is locked by another transaction, a write-write conflict occurs, and all writes of the transaction fail. Therefore, setting *atomic* ='TRANS' means concurrent writes to a chunk are not allowed.",
|
|
16984
|
+
"",
|
|
16985
|
+
"- 'CHUNK' indicates that the atomicity is guaranteed at the chunk level. If a transaction tries to write to multiple chunks and a write-write conflict occurs as a chunk is locked by another transaction, instead of aborting the writes, the transaction will keep writing to the non-locked chunks and keep attempting to write to the chunk in conflict until it is still locked after a few minutes. Therefore, setting *atomic* ='CHUNK' means concurrent writes to a chunk are allowed. As the atomicity at the transaction level is not guaranteed, the write operation may succeed in some chunks but fail in other chunks. Please also note that the write speed may be impacted by the repeated attempts to write to the chunks that are locked.",
|
|
16986
|
+
"",
|
|
16987
|
+
"`chunkGranularity` is a string indicating the chunk granularity. It determines whether concurrent writes to different tables in the same chunk are allowed. It is only enabled when *enableChunkGranularityConfig* = true is configured. The value can be 'TABLE' or 'DATABASE':",
|
|
16988
|
+
"",
|
|
16989
|
+
"- 'TABLE': the chunk granularity is at the TABLE level. In this case, concurrent writes to different tables in the same partition are allowed.",
|
|
16990
|
+
"",
|
|
16991
|
+
"- 'DATABASE': the chunk granularity is at the DATABASE level. In this case, concurrent writes to different tables in the same partition are not allowed.",
|
|
16992
|
+
"",
|
|
16993
|
+
"The chunk granularity determines where a DolphinDB transaction locates the lock. Before version 1.30.16/2.00.4, the chunk granularity is at the DATABASE level, i.e., each partition of the database is a chunk. Starting from version 1.30.16/2.00.4, the default chunk granularity is at the TABLE level and each table of the partition is a chunk.",
|
|
16994
|
+
""
|
|
15807
16995
|
]
|
|
15808
16996
|
}
|
|
15809
16997
|
]
|
|
@@ -16208,7 +17396,37 @@
|
|
|
16208
17396
|
"language": "console",
|
|
16209
17397
|
"value": [
|
|
16210
17398
|
" ",
|
|
16211
|
-
" $ 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\"])"
|
|
17399
|
+
" $ 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\"])",
|
|
17400
|
+
"",
|
|
17401
|
+
""
|
|
17402
|
+
]
|
|
17403
|
+
},
|
|
17404
|
+
{
|
|
17405
|
+
"type": "text",
|
|
17406
|
+
"value": [
|
|
17407
|
+
"\\5. Examples regarding the parameter *atomic*:",
|
|
17408
|
+
""
|
|
17409
|
+
]
|
|
17410
|
+
},
|
|
17411
|
+
{
|
|
17412
|
+
"type": "code",
|
|
17413
|
+
"language": "console",
|
|
17414
|
+
"value": [
|
|
17415
|
+
"",
|
|
17416
|
+
" $ if(existsDatabase(\"dfs://test\"))",
|
|
17417
|
+
" $ dropDB(\"dfs://test\")",
|
|
17418
|
+
" $ db = database(directory=\"dfs://test\", partitionType=VALUE, partitionScheme=1..20, atomic='CHUNK')",
|
|
17419
|
+
" $ dummy = table(take(1..20, 100000) as id, rand(1.0, 100000) as value)",
|
|
17420
|
+
" $ pt = db.createPartitionedTable(dummy, \"pt\", `id)",
|
|
17421
|
+
"",
|
|
17422
|
+
" $ dummy1 = table(take(1..15, 1000000) as id, rand(1.0, 1000000) as value)",
|
|
17423
|
+
" $ dummy2 = table(take(11..20, 1000000) as id, rand(1.0, 1000000) as value)",
|
|
17424
|
+
" $ submitJob(\"write1\", \"writer1\", append!{pt, dummy1})",
|
|
17425
|
+
" $ submitJob(\"write2\", \"writer2\", append!{pt, dummy2})",
|
|
17426
|
+
" $ submitJob(\"write3\", \"writer3\", append!{pt, dummy1})",
|
|
17427
|
+
" $ submitJob(\"write4\", \"writer4\", append!{pt, dummy2})",
|
|
17428
|
+
" $ select count(*) from pt",
|
|
17429
|
+
" 4,000,000"
|
|
16212
17430
|
]
|
|
16213
17431
|
}
|
|
16214
17432
|
]
|
|
@@ -17306,7 +18524,7 @@
|
|
|
17306
18524
|
{
|
|
17307
18525
|
"type": "text",
|
|
17308
18526
|
"value": [
|
|
17309
|
-
"Delete a group
|
|
18527
|
+
"Delete a group. This can only be executed by an administrator on the controller."
|
|
17310
18528
|
]
|
|
17311
18529
|
}
|
|
17312
18530
|
]
|
|
@@ -19698,6 +20916,78 @@
|
|
|
19698
20916
|
}
|
|
19699
20917
|
]
|
|
19700
20918
|
},
|
|
20919
|
+
"dropDistributedInMemoryTable": {
|
|
20920
|
+
"title": "dropDistributedInMemoryTable",
|
|
20921
|
+
"type": "command",
|
|
20922
|
+
"children": [
|
|
20923
|
+
{
|
|
20924
|
+
"title": "Syntax",
|
|
20925
|
+
"type": "grammer",
|
|
20926
|
+
"children": [
|
|
20927
|
+
{
|
|
20928
|
+
"type": "text",
|
|
20929
|
+
"value": [
|
|
20930
|
+
"dropDistributedInMemoryTable(tableName)"
|
|
20931
|
+
]
|
|
20932
|
+
}
|
|
20933
|
+
]
|
|
20934
|
+
},
|
|
20935
|
+
{
|
|
20936
|
+
"title": "Arguments",
|
|
20937
|
+
"type": "parameters",
|
|
20938
|
+
"children": [
|
|
20939
|
+
{
|
|
20940
|
+
"type": "text",
|
|
20941
|
+
"value": [
|
|
20942
|
+
"`tableName` is a STRING scalar indicating column names of a distributed in-memory table. "
|
|
20943
|
+
]
|
|
20944
|
+
}
|
|
20945
|
+
]
|
|
20946
|
+
},
|
|
20947
|
+
{
|
|
20948
|
+
"title": "Details",
|
|
20949
|
+
"type": "detail",
|
|
20950
|
+
"children": [
|
|
20951
|
+
{
|
|
20952
|
+
"type": "text",
|
|
20953
|
+
"value": [
|
|
20954
|
+
"Delete the specified distributed in-memory table. This function can only be executed on a data node or compute node."
|
|
20955
|
+
]
|
|
20956
|
+
}
|
|
20957
|
+
]
|
|
20958
|
+
},
|
|
20959
|
+
{
|
|
20960
|
+
"title": "Examples",
|
|
20961
|
+
"type": "example",
|
|
20962
|
+
"children": [
|
|
20963
|
+
{
|
|
20964
|
+
"type": "code",
|
|
20965
|
+
"language": "console",
|
|
20966
|
+
"value": [
|
|
20967
|
+
"",
|
|
20968
|
+
" $ pt = createDistributedInMemoryTable(`dt, `time`id`value, `DATETIME`INT`LONG, HASH, [INT, 2],`id)",
|
|
20969
|
+
" $ time = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);",
|
|
20970
|
+
" $ id = 0..39;",
|
|
20971
|
+
" $ value = rand(100, 40);",
|
|
20972
|
+
" $ tmp = table(time, id, value);",
|
|
20973
|
+
"",
|
|
20974
|
+
" $ pt = loadDistributedInMemoryTable(`dt)",
|
|
20975
|
+
" $ pt.append!(tmp);",
|
|
20976
|
+
" $ dropDistributedInMemoryTable(`dt)",
|
|
20977
|
+
"",
|
|
20978
|
+
""
|
|
20979
|
+
]
|
|
20980
|
+
},
|
|
20981
|
+
{
|
|
20982
|
+
"type": "text",
|
|
20983
|
+
"value": [
|
|
20984
|
+
"Related functions: :doc:`/FunctionsandCommands/FunctionReferences/l/loadDistributedInMemoryTable`, :doc:`/FunctionsandCommands/FunctionReferences/c/createDistributedInMemoryTable`"
|
|
20985
|
+
]
|
|
20986
|
+
}
|
|
20987
|
+
]
|
|
20988
|
+
}
|
|
20989
|
+
]
|
|
20990
|
+
},
|
|
19701
20991
|
"dropFunctionView": {
|
|
19702
20992
|
"title": "dropFunctionView",
|
|
19703
20993
|
"type": "command",
|
|
@@ -21568,9 +22858,9 @@
|
|
|
21568
22858
|
{
|
|
21569
22859
|
"type": "text",
|
|
21570
22860
|
"value": [
|
|
21571
|
-
"
|
|
22861
|
+
"Check if the data types and values of two objects are identical. Return true only if both data types and values are identical. Please note that ``eqObj`` returns false if values are identical but object types are different. This is different from fuction :doc:`eq`.",
|
|
21572
22862
|
"",
|
|
21573
|
-
"
|
|
22863
|
+
"Note: When comparing floating point numbers, function eqObj determines whether the values of obj1 and obj2 are equal based on the result of abs(obj1-obj2)<=pow(10,-precision)."
|
|
21574
22864
|
]
|
|
21575
22865
|
}
|
|
21576
22866
|
]
|
|
@@ -21585,21 +22875,21 @@
|
|
|
21585
22875
|
"value": [
|
|
21586
22876
|
" ",
|
|
21587
22877
|
" $ eqObj(2, 2.0);",
|
|
21588
|
-
"
|
|
22878
|
+
" false",
|
|
21589
22879
|
"",
|
|
21590
22880
|
" $ eq(2, 2.0);",
|
|
21591
|
-
"
|
|
22881
|
+
" true",
|
|
21592
22882
|
"",
|
|
21593
22883
|
" $ eqObj(1.1, 1.2, 0);",
|
|
21594
|
-
"
|
|
22884
|
+
" true",
|
|
21595
22885
|
"",
|
|
21596
22886
|
" $ eqObj(1.1, 1.2, 1);",
|
|
21597
|
-
"
|
|
22887
|
+
" false",
|
|
21598
22888
|
"",
|
|
21599
22889
|
" $ eqObj(1 2 3, 1 2 3);",
|
|
21600
|
-
"
|
|
22890
|
+
" true",
|
|
21601
22891
|
" $ eq(1 2 3, 1 2 3);",
|
|
21602
|
-
" [
|
|
22892
|
+
" [true,true,true]",
|
|
21603
22893
|
""
|
|
21604
22894
|
]
|
|
21605
22895
|
},
|
|
@@ -21622,7 +22912,7 @@
|
|
|
21622
22912
|
" ([1,2,3],[4,5,6])",
|
|
21623
22913
|
"",
|
|
21624
22914
|
" $ each(eqObj, t1.values(), t2.values());",
|
|
21625
|
-
" [
|
|
22915
|
+
" [true,true]"
|
|
21626
22916
|
]
|
|
21627
22917
|
}
|
|
21628
22918
|
]
|
|
@@ -26794,6 +28084,63 @@
|
|
|
26794
28084
|
}
|
|
26795
28085
|
]
|
|
26796
28086
|
},
|
|
28087
|
+
"getCurrentSessionAndUser": {
|
|
28088
|
+
"title": "getCurrentSessionAndUser",
|
|
28089
|
+
"type": "function",
|
|
28090
|
+
"children": [
|
|
28091
|
+
{
|
|
28092
|
+
"title": "Syntax",
|
|
28093
|
+
"type": "grammer",
|
|
28094
|
+
"children": [
|
|
28095
|
+
{
|
|
28096
|
+
"type": "text",
|
|
28097
|
+
"value": [
|
|
28098
|
+
"getCurrentSessionAndUser()"
|
|
28099
|
+
]
|
|
28100
|
+
}
|
|
28101
|
+
]
|
|
28102
|
+
},
|
|
28103
|
+
{
|
|
28104
|
+
"title": "Arguments",
|
|
28105
|
+
"type": "parameters",
|
|
28106
|
+
"children": [
|
|
28107
|
+
{
|
|
28108
|
+
"type": "text",
|
|
28109
|
+
"value": [
|
|
28110
|
+
"None"
|
|
28111
|
+
]
|
|
28112
|
+
}
|
|
28113
|
+
]
|
|
28114
|
+
},
|
|
28115
|
+
{
|
|
28116
|
+
"title": "Details",
|
|
28117
|
+
"type": "detail",
|
|
28118
|
+
"children": [
|
|
28119
|
+
{
|
|
28120
|
+
"type": "text",
|
|
28121
|
+
"value": [
|
|
28122
|
+
"Get the sessionId and username of the current session. Return a tuple with sessionId as the first element and userId as the second element."
|
|
28123
|
+
]
|
|
28124
|
+
}
|
|
28125
|
+
]
|
|
28126
|
+
},
|
|
28127
|
+
{
|
|
28128
|
+
"title": "Examples",
|
|
28129
|
+
"type": "example",
|
|
28130
|
+
"children": [
|
|
28131
|
+
{
|
|
28132
|
+
"type": "code",
|
|
28133
|
+
"language": "console",
|
|
28134
|
+
"value": [
|
|
28135
|
+
"",
|
|
28136
|
+
" $ getCurrentSessionAndUser()",
|
|
28137
|
+
" (1166953221,\"admin\")"
|
|
28138
|
+
]
|
|
28139
|
+
}
|
|
28140
|
+
]
|
|
28141
|
+
}
|
|
28142
|
+
]
|
|
28143
|
+
},
|
|
26797
28144
|
"getDFSTablesByDatabase": {
|
|
26798
28145
|
"title": "getDFSTablesByDatabase",
|
|
26799
28146
|
"type": "function",
|
|
@@ -27659,6 +29006,106 @@
|
|
|
27659
29006
|
}
|
|
27660
29007
|
]
|
|
27661
29008
|
},
|
|
29009
|
+
"getLeftStream": {
|
|
29010
|
+
"title": "getLeftStream",
|
|
29011
|
+
"type": "function",
|
|
29012
|
+
"children": [
|
|
29013
|
+
{
|
|
29014
|
+
"title": "Arguments",
|
|
29015
|
+
"type": "parameters",
|
|
29016
|
+
"children": [
|
|
29017
|
+
{
|
|
29018
|
+
"type": "text",
|
|
29019
|
+
"value": [
|
|
29020
|
+
"`joinEngine` is a table object returned by creating a join engine. The join engines currently supported by DolphinDB are:",
|
|
29021
|
+
"",
|
|
29022
|
+
"* createAsofJoinEngine",
|
|
29023
|
+
"",
|
|
29024
|
+
"* createEqualJoinEngine",
|
|
29025
|
+
"",
|
|
29026
|
+
"* createLookupJoinEngine",
|
|
29027
|
+
"",
|
|
29028
|
+
"* createWindowJoinEngine"
|
|
29029
|
+
]
|
|
29030
|
+
}
|
|
29031
|
+
]
|
|
29032
|
+
},
|
|
29033
|
+
{
|
|
29034
|
+
"title": "Details",
|
|
29035
|
+
"type": "detail",
|
|
29036
|
+
"children": [
|
|
29037
|
+
{
|
|
29038
|
+
"type": "text",
|
|
29039
|
+
"value": [
|
|
29040
|
+
"Return the schema of the left table of the join engine. The data ingested into this schema will be ingested into *joinEngine*.",
|
|
29041
|
+
"",
|
|
29042
|
+
"The result of an engine can be ingested into the join engine to realize the cascade between engines."
|
|
29043
|
+
]
|
|
29044
|
+
}
|
|
29045
|
+
]
|
|
29046
|
+
},
|
|
29047
|
+
{
|
|
29048
|
+
"title": "Examples",
|
|
29049
|
+
"type": "example",
|
|
29050
|
+
"children": [
|
|
29051
|
+
{
|
|
29052
|
+
"type": "code",
|
|
29053
|
+
"language": "console",
|
|
29054
|
+
"value": [
|
|
29055
|
+
" ",
|
|
29056
|
+
" $ share streamTable(1000:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades",
|
|
29057
|
+
"",
|
|
29058
|
+
" $ output=table(100:0, `timestamp`sym`price1`price2, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE])",
|
|
29059
|
+
"",
|
|
29060
|
+
" $ leftTable=table(1:0, `sym`timestamp`price, [SYMBOL, TIMESTAMP, DOUBLE])",
|
|
29061
|
+
" $ rightTable=table(1:0, `sym`timestamp`price, [SYMBOL, TIMESTAMP, DOUBLE])",
|
|
29062
|
+
"",
|
|
29063
|
+
" $ ajEngine = createAsofJoinEngine(\"asofjoin_engine\", leftTable, rightTable, output, <[leftTable.price, rightTable.price]>, `sym, `timestamp)",
|
|
29064
|
+
"",
|
|
29065
|
+
" $ leftEngine = createReactiveStateEngine(name=`left_reactive_engine, metrics=<[time,msum(price,3)]>, dummyTable=trades, outputTable=getLeftStream(ajEngine), keyColumn=\"sym\")",
|
|
29066
|
+
" $ rightEngine = createReactiveStateEngine(name=`right_reactive_engine, metrics=<[time,mfirst(price,3)]>, dummyTable=trades, outputTable=getRightStream(ajEngine), keyColumn=\"sym\")",
|
|
29067
|
+
"",
|
|
29068
|
+
" $ subscribeTable(, \"trades\", \"left_reactive_engine\", 0, append!{leftEngine}, true) ",
|
|
29069
|
+
" $ subscribeTable(, \"trades\", \"right_reactive_engine\", 0, append!{rightEngine}, true) ",
|
|
29070
|
+
"",
|
|
29071
|
+
" $ t = table(2022.01.01 + 1..20 as time, take(`AMZN`IBM`APPL, 20) as sym, rand(100.0, 20) as price)",
|
|
29072
|
+
" $ trades.append!(t) ",
|
|
29073
|
+
" $ select * from output order by timestamp,sym",
|
|
29074
|
+
""
|
|
29075
|
+
]
|
|
29076
|
+
},
|
|
29077
|
+
{
|
|
29078
|
+
"type": "text",
|
|
29079
|
+
"value": [
|
|
29080
|
+
"======================= ==== ======== ======",
|
|
29081
|
+
"timestamp sym price1 price2",
|
|
29082
|
+
"======================= ==== ======== ======",
|
|
29083
|
+
"2022.01.02T00:00:00.000 AMZN ",
|
|
29084
|
+
"2022.01.03T00:00:00.000 IBM ",
|
|
29085
|
+
"2022.01.04T00:00:00.000 APPL ",
|
|
29086
|
+
"2022.01.05T00:00:00.000 AMZN ",
|
|
29087
|
+
"2022.01.06T00:00:00.000 IBM ",
|
|
29088
|
+
"2022.01.07T00:00:00.000 APPL ",
|
|
29089
|
+
"2022.01.08T00:00:00.000 AMZN 102.192 26.2273",
|
|
29090
|
+
"2022.01.09T00:00:00.000 IBM 152.2704 43.6296",
|
|
29091
|
+
"2022.01.10T00:00:00.000 APPL 126.1056 74.929",
|
|
29092
|
+
"2022.01.11T00:00:00.000 AMZN 137.4656 57.6015",
|
|
29093
|
+
"2022.01.12T00:00:00.000 IBM 116.7775 54.2854",
|
|
29094
|
+
"2022.01.13T00:00:00.000 APPL 58.8909 49.3149",
|
|
29095
|
+
"2022.01.14T00:00:00.000 AMZN 148.5405 18.3633",
|
|
29096
|
+
"2022.01.15T00:00:00.000 IBM 141.0848 54.3554",
|
|
29097
|
+
"2022.01.16T00:00:00.000 APPL 93.9003 1.8618",
|
|
29098
|
+
"2022.01.17T00:00:00.000 AMZN 210.4329 61.5008",
|
|
29099
|
+
"2022.01.18T00:00:00.000 IBM 88.7772 8.1367",
|
|
29100
|
+
"======================= ==== ======== ======",
|
|
29101
|
+
"",
|
|
29102
|
+
"Related function: :doc:`/FunctionsandCommands/FunctionReferences/g/getRightStream`."
|
|
29103
|
+
]
|
|
29104
|
+
}
|
|
29105
|
+
]
|
|
29106
|
+
}
|
|
29107
|
+
]
|
|
29108
|
+
},
|
|
27662
29109
|
"getLicenseExpiration": {
|
|
27663
29110
|
"title": "getLicenseExpiration",
|
|
27664
29111
|
"type": "function",
|
|
@@ -28668,6 +30115,113 @@
|
|
|
28668
30115
|
}
|
|
28669
30116
|
]
|
|
28670
30117
|
},
|
|
30118
|
+
"getRecoveryWorkerNum": {
|
|
30119
|
+
"title": "getRecoveryWorkerNum",
|
|
30120
|
+
"type": "command",
|
|
30121
|
+
"children": [
|
|
30122
|
+
{
|
|
30123
|
+
"title": "Arguments",
|
|
30124
|
+
"type": "parameters",
|
|
30125
|
+
"children": [
|
|
30126
|
+
{
|
|
30127
|
+
"type": "text",
|
|
30128
|
+
"value": [
|
|
30129
|
+
"None"
|
|
30130
|
+
]
|
|
30131
|
+
}
|
|
30132
|
+
]
|
|
30133
|
+
},
|
|
30134
|
+
{
|
|
30135
|
+
"title": "Details",
|
|
30136
|
+
"type": "detail",
|
|
30137
|
+
"children": [
|
|
30138
|
+
{
|
|
30139
|
+
"type": "text",
|
|
30140
|
+
"value": [
|
|
30141
|
+
"Get the number of worker threads used by the current node for chunk recovery."
|
|
30142
|
+
]
|
|
30143
|
+
}
|
|
30144
|
+
]
|
|
30145
|
+
},
|
|
30146
|
+
{
|
|
30147
|
+
"title": "Examples",
|
|
30148
|
+
"type": "example",
|
|
30149
|
+
"children": [
|
|
30150
|
+
{
|
|
30151
|
+
"type": "code",
|
|
30152
|
+
"language": "console",
|
|
30153
|
+
"value": [
|
|
30154
|
+
"",
|
|
30155
|
+
" $ resetRecoveryWorkerNum(2)",
|
|
30156
|
+
" $ getRecoveryWorkerNum()",
|
|
30157
|
+
" 2",
|
|
30158
|
+
""
|
|
30159
|
+
]
|
|
30160
|
+
},
|
|
30161
|
+
{
|
|
30162
|
+
"type": "text",
|
|
30163
|
+
"value": [
|
|
30164
|
+
"Related function: :doc:`../r/resetRecoveryWorkerNum`"
|
|
30165
|
+
]
|
|
30166
|
+
}
|
|
30167
|
+
]
|
|
30168
|
+
}
|
|
30169
|
+
]
|
|
30170
|
+
},
|
|
30171
|
+
"getRightStream": {
|
|
30172
|
+
"title": "getRightStream",
|
|
30173
|
+
"type": "function",
|
|
30174
|
+
"children": [
|
|
30175
|
+
{
|
|
30176
|
+
"title": "Syntax",
|
|
30177
|
+
"type": "grammer",
|
|
30178
|
+
"children": [
|
|
30179
|
+
{
|
|
30180
|
+
"type": "text",
|
|
30181
|
+
"value": [
|
|
30182
|
+
"getRightStream(joinEngine)"
|
|
30183
|
+
]
|
|
30184
|
+
}
|
|
30185
|
+
]
|
|
30186
|
+
},
|
|
30187
|
+
{
|
|
30188
|
+
"title": "Arguments",
|
|
30189
|
+
"type": "parameters",
|
|
30190
|
+
"children": [
|
|
30191
|
+
{
|
|
30192
|
+
"type": "text",
|
|
30193
|
+
"value": [
|
|
30194
|
+
"`joinEngine` is a table object returned by creating a join engine. The join engines currently supported by DolphinDB are:",
|
|
30195
|
+
"",
|
|
30196
|
+
"* createAsofJoinEngine",
|
|
30197
|
+
"",
|
|
30198
|
+
"* createEqualJoinEngine",
|
|
30199
|
+
"",
|
|
30200
|
+
"* createLookupJoinEngine",
|
|
30201
|
+
"",
|
|
30202
|
+
"* createWindowJoinEngine"
|
|
30203
|
+
]
|
|
30204
|
+
}
|
|
30205
|
+
]
|
|
30206
|
+
},
|
|
30207
|
+
{
|
|
30208
|
+
"title": "Details",
|
|
30209
|
+
"type": "detail",
|
|
30210
|
+
"children": [
|
|
30211
|
+
{
|
|
30212
|
+
"type": "text",
|
|
30213
|
+
"value": [
|
|
30214
|
+
"Return the schema of the right table of the join engine. The data ingested into this schema will be inserted into *joinEngine*.",
|
|
30215
|
+
"",
|
|
30216
|
+
"The result of an engine can be directly ingested into the join engine to realize the cascade between engines.",
|
|
30217
|
+
"",
|
|
30218
|
+
"Please refer to :doc:`/FunctionsandCommands/FunctionReferences/g/getLeftStream` for specific examples."
|
|
30219
|
+
]
|
|
30220
|
+
}
|
|
30221
|
+
]
|
|
30222
|
+
}
|
|
30223
|
+
]
|
|
30224
|
+
},
|
|
28671
30225
|
"getRunningQueries": {
|
|
28672
30226
|
"title": "getRunningQueries",
|
|
28673
30227
|
"type": "function",
|
|
@@ -40032,6 +41586,86 @@
|
|
|
40032
41586
|
}
|
|
40033
41587
|
]
|
|
40034
41588
|
},
|
|
41589
|
+
"listTables": {
|
|
41590
|
+
"title": "listTables",
|
|
41591
|
+
"type": "function",
|
|
41592
|
+
"children": [
|
|
41593
|
+
{
|
|
41594
|
+
"title": "Syntax",
|
|
41595
|
+
"type": "grammer",
|
|
41596
|
+
"children": [
|
|
41597
|
+
{
|
|
41598
|
+
"type": "text",
|
|
41599
|
+
"value": [
|
|
41600
|
+
"listTables(dbUrl)"
|
|
41601
|
+
]
|
|
41602
|
+
}
|
|
41603
|
+
]
|
|
41604
|
+
},
|
|
41605
|
+
{
|
|
41606
|
+
"title": "Arguments",
|
|
41607
|
+
"type": "parameters",
|
|
41608
|
+
"children": [
|
|
41609
|
+
{
|
|
41610
|
+
"type": "text",
|
|
41611
|
+
"value": [
|
|
41612
|
+
"`dbUrl` is a string indicating the local path or dfs path of a database."
|
|
41613
|
+
]
|
|
41614
|
+
}
|
|
41615
|
+
]
|
|
41616
|
+
},
|
|
41617
|
+
{
|
|
41618
|
+
"title": "Details",
|
|
41619
|
+
"type": "detail",
|
|
41620
|
+
"children": [
|
|
41621
|
+
{
|
|
41622
|
+
"type": "text",
|
|
41623
|
+
"value": [
|
|
41624
|
+
"Return a table of two columns, tableName and physicalIndex. Please note that only the database with chunks of the table level can have physical indices."
|
|
41625
|
+
]
|
|
41626
|
+
}
|
|
41627
|
+
]
|
|
41628
|
+
},
|
|
41629
|
+
{
|
|
41630
|
+
"title": "First Release",
|
|
41631
|
+
"children": [
|
|
41632
|
+
{
|
|
41633
|
+
"type": "text",
|
|
41634
|
+
"value": [
|
|
41635
|
+
"1.30.16/2.00.4"
|
|
41636
|
+
]
|
|
41637
|
+
}
|
|
41638
|
+
]
|
|
41639
|
+
},
|
|
41640
|
+
{
|
|
41641
|
+
"title": "Examples",
|
|
41642
|
+
"type": "example",
|
|
41643
|
+
"children": [
|
|
41644
|
+
{
|
|
41645
|
+
"type": "code",
|
|
41646
|
+
"language": "console",
|
|
41647
|
+
"value": [
|
|
41648
|
+
" ",
|
|
41649
|
+
" $ listTables(dbPath)",
|
|
41650
|
+
""
|
|
41651
|
+
]
|
|
41652
|
+
},
|
|
41653
|
+
{
|
|
41654
|
+
"type": "text",
|
|
41655
|
+
"value": [
|
|
41656
|
+
"+----------+-------------+",
|
|
41657
|
+
"|tableName |physicalIndex|",
|
|
41658
|
+
"+==========+=============+",
|
|
41659
|
+
"|pt1 |1By |",
|
|
41660
|
+
"+----------+-------------+",
|
|
41661
|
+
"|pt |1Bw |",
|
|
41662
|
+
"+----------+-------------+"
|
|
41663
|
+
]
|
|
41664
|
+
}
|
|
41665
|
+
]
|
|
41666
|
+
}
|
|
41667
|
+
]
|
|
41668
|
+
},
|
|
40035
41669
|
"loadBackup": {
|
|
40036
41670
|
"title": "loadBackup",
|
|
40037
41671
|
"type": "function",
|
|
@@ -40114,6 +41748,78 @@
|
|
|
40114
41748
|
}
|
|
40115
41749
|
]
|
|
40116
41750
|
},
|
|
41751
|
+
"loadDistributedInMemoryTable": {
|
|
41752
|
+
"title": "loadDistributedInMemoryTable",
|
|
41753
|
+
"type": "function",
|
|
41754
|
+
"children": [
|
|
41755
|
+
{
|
|
41756
|
+
"title": "Syntax",
|
|
41757
|
+
"type": "grammer",
|
|
41758
|
+
"children": [
|
|
41759
|
+
{
|
|
41760
|
+
"type": "text",
|
|
41761
|
+
"value": [
|
|
41762
|
+
"loadDistributedInMemoryTable(tableName)"
|
|
41763
|
+
]
|
|
41764
|
+
}
|
|
41765
|
+
]
|
|
41766
|
+
},
|
|
41767
|
+
{
|
|
41768
|
+
"title": "Arguments",
|
|
41769
|
+
"type": "parameters",
|
|
41770
|
+
"children": [
|
|
41771
|
+
{
|
|
41772
|
+
"type": "text",
|
|
41773
|
+
"value": [
|
|
41774
|
+
"`tableName` is a STRING scalar indicating column names of a distributed in-memory table."
|
|
41775
|
+
]
|
|
41776
|
+
}
|
|
41777
|
+
]
|
|
41778
|
+
},
|
|
41779
|
+
{
|
|
41780
|
+
"title": "Details",
|
|
41781
|
+
"type": "detail",
|
|
41782
|
+
"children": [
|
|
41783
|
+
{
|
|
41784
|
+
"type": "text",
|
|
41785
|
+
"value": [
|
|
41786
|
+
"Delete the specified distributed in-memory table. This function can only be executed on a data node or compute node."
|
|
41787
|
+
]
|
|
41788
|
+
}
|
|
41789
|
+
]
|
|
41790
|
+
},
|
|
41791
|
+
{
|
|
41792
|
+
"title": "Examples",
|
|
41793
|
+
"type": "example",
|
|
41794
|
+
"children": [
|
|
41795
|
+
{
|
|
41796
|
+
"type": "code",
|
|
41797
|
+
"language": "console",
|
|
41798
|
+
"value": [
|
|
41799
|
+
"",
|
|
41800
|
+
"",
|
|
41801
|
+
" $ pt = createDistributedInMemoryTable(`dt, `time`id`value, `DATETIME`INT`LONG, HASH, [INT, 2],`id)",
|
|
41802
|
+
" $ time = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);",
|
|
41803
|
+
" $ id = 0..39;",
|
|
41804
|
+
" $ value = rand(100, 40);",
|
|
41805
|
+
" $ tmp = table(time, id, value);",
|
|
41806
|
+
"",
|
|
41807
|
+
" $ pt = loadDistributedInMemoryTable(`dt)",
|
|
41808
|
+
" $ pt.append!(tmp);",
|
|
41809
|
+
" $ select * from pt;",
|
|
41810
|
+
""
|
|
41811
|
+
]
|
|
41812
|
+
},
|
|
41813
|
+
{
|
|
41814
|
+
"type": "text",
|
|
41815
|
+
"value": [
|
|
41816
|
+
"Related functions: :doc:`/FunctionsandCommands/CommandsReferences/d/dropDistributedInMemoryTable`, :doc:`/FunctionsandCommands/FunctionReferences/c/createDistributedInMemoryTable`"
|
|
41817
|
+
]
|
|
41818
|
+
}
|
|
41819
|
+
]
|
|
41820
|
+
}
|
|
41821
|
+
]
|
|
41822
|
+
},
|
|
40117
41823
|
"loadModel": {
|
|
40118
41824
|
"title": "loadModel",
|
|
40119
41825
|
"type": "function",
|
|
@@ -41190,13 +42896,10 @@
|
|
|
41190
42896
|
{
|
|
41191
42897
|
"type": "text",
|
|
41192
42898
|
"value": [
|
|
41193
|
-
"Load a text file into memory as a table.
|
|
41194
|
-
"",
|
|
41195
|
-
"*loadText* loads data in single thread. To load data in multiple threads, use :doc:`../p/ploadText` .",
|
|
42899
|
+
"Load a text file into memory as a table. *loadText* loads data in single thread. To load data in multiple threads, use :doc:`../p/ploadText` .",
|
|
41196
42900
|
"",
|
|
41197
|
-
"When loading a text file, the
|
|
41198
|
-
"",
|
|
41199
|
-
"If none of the columns in the first row of the file starts with a number, the first row is treated as the header with column names of the text file. Otherwise the system uses *col0*, *col1*, ..... as the column names.",
|
|
42901
|
+
"* When loading a text file, the first row of data is read in string format, and the column names are parsed from that data. Please note that the upper limit for the first row is 256 KB. If none of the columns in the first row of the file starts with a number, the first row is treated as the header with column names of the text file. If at least one of the columns in the first row of the file starts with a number, the system uses col0, col1, ... as the column names.",
|
|
42902
|
+
"* When loading a text file, the system determines the data type of each column based on a random sample of rows. This convenient feature may not always accurately determine the data type of all columns. We recommend users check the data type of each column with the :doc:`../e/extractTextSchema` function after loading. If a column does not have the expected data type, then we need to enter the correct data type of the column in the schema table. Users can also specify data types for all columns. For a temporal column, if it does not have the expected data type, we also need to specify a format such as \"MM/dd/yyyy\" in the schema table. For details about temporal formats please refer to :doc:`/DataManipulation/TemporalObjects/ParsingandFormatofTemporalVariables`.",
|
|
41200
42903
|
"",
|
|
41201
42904
|
"As string in DolphinDB is encoded in UTF-8, we require input text files be encoded in UTF-8.",
|
|
41202
42905
|
"",
|
|
@@ -45139,6 +46842,82 @@
|
|
|
45139
46842
|
}
|
|
45140
46843
|
]
|
|
45141
46844
|
},
|
|
46845
|
+
"memSize": {
|
|
46846
|
+
"title": "memSize",
|
|
46847
|
+
"type": "function",
|
|
46848
|
+
"children": [
|
|
46849
|
+
{
|
|
46850
|
+
"title": "Syntax",
|
|
46851
|
+
"type": "grammer",
|
|
46852
|
+
"children": [
|
|
46853
|
+
{
|
|
46854
|
+
"type": "text",
|
|
46855
|
+
"value": [
|
|
46856
|
+
"memSize(obj)"
|
|
46857
|
+
]
|
|
46858
|
+
}
|
|
46859
|
+
]
|
|
46860
|
+
},
|
|
46861
|
+
{
|
|
46862
|
+
"title": "Arguments",
|
|
46863
|
+
"type": "parameters",
|
|
46864
|
+
"children": [
|
|
46865
|
+
{
|
|
46866
|
+
"type": "text",
|
|
46867
|
+
"value": [
|
|
46868
|
+
"`obj` is an object."
|
|
46869
|
+
]
|
|
46870
|
+
}
|
|
46871
|
+
]
|
|
46872
|
+
},
|
|
46873
|
+
{
|
|
46874
|
+
"title": "Details",
|
|
46875
|
+
"type": "detail",
|
|
46876
|
+
"children": [
|
|
46877
|
+
{
|
|
46878
|
+
"type": "text",
|
|
46879
|
+
"value": [
|
|
46880
|
+
"Return the memory usage (in units of bytes) of a local or shared object."
|
|
46881
|
+
]
|
|
46882
|
+
}
|
|
46883
|
+
]
|
|
46884
|
+
},
|
|
46885
|
+
{
|
|
46886
|
+
"title": "Examples",
|
|
46887
|
+
"type": "example",
|
|
46888
|
+
"children": [
|
|
46889
|
+
{
|
|
46890
|
+
"type": "code",
|
|
46891
|
+
"language": "console",
|
|
46892
|
+
"value": [
|
|
46893
|
+
"",
|
|
46894
|
+
" $ $ n=100",
|
|
46895
|
+
" $ ID=rand(100, n)",
|
|
46896
|
+
" $ date=rand(2017.08.07..2017.08.11, n)",
|
|
46897
|
+
" $ x=rand(10.0, n)",
|
|
46898
|
+
" $ t=table(ID, date, x);",
|
|
46899
|
+
" $ share t as tt",
|
|
46900
|
+
" $ memSize(t)",
|
|
46901
|
+
" 1952",
|
|
46902
|
+
" $ memSize(tt)",
|
|
46903
|
+
" 1952",
|
|
46904
|
+
" $ memSize(t[`x])",
|
|
46905
|
+
" 800",
|
|
46906
|
+
" $ memSize(select avg(x) as avgx from t)",
|
|
46907
|
+
" 280",
|
|
46908
|
+
""
|
|
46909
|
+
]
|
|
46910
|
+
},
|
|
46911
|
+
{
|
|
46912
|
+
"type": "text",
|
|
46913
|
+
"value": [
|
|
46914
|
+
"Related functions: :doc:`../o/objs`"
|
|
46915
|
+
]
|
|
46916
|
+
}
|
|
46917
|
+
]
|
|
46918
|
+
}
|
|
46919
|
+
]
|
|
46920
|
+
},
|
|
45142
46921
|
"member": {
|
|
45143
46922
|
"title": "member",
|
|
45144
46923
|
"type": "function",
|
|
@@ -47712,7 +49491,7 @@
|
|
|
47712
49491
|
"",
|
|
47713
49492
|
"`destNode` is a string indicating the alias of destination node.",
|
|
47714
49493
|
"",
|
|
47715
|
-
"`chunkId` is a string or
|
|
49494
|
+
"`chunkId` is a string/UUID scalar or vector indicating ID of chunks. "
|
|
47716
49495
|
]
|
|
47717
49496
|
}
|
|
47718
49497
|
]
|
|
@@ -47724,7 +49503,7 @@
|
|
|
47724
49503
|
{
|
|
47725
49504
|
"type": "text",
|
|
47726
49505
|
"value": [
|
|
47727
|
-
"Move replicas of one or multiple chunks from
|
|
49506
|
+
"Move replicas of one or multiple chunks from the source node to the destination node. If the destination node already has the chunk, the command is skipped.",
|
|
47728
49507
|
"",
|
|
47729
49508
|
"This command can only be executed by an administrator on a controller node.",
|
|
47730
49509
|
"",
|
|
@@ -50483,11 +52262,11 @@
|
|
|
50483
52262
|
{
|
|
50484
52263
|
"type": "text",
|
|
50485
52264
|
"value": [
|
|
50486
|
-
"`mean` is the mean
|
|
52265
|
+
"`mean` is a numeric scalar indicating the mean of a normal distribution.",
|
|
50487
52266
|
"",
|
|
50488
|
-
"`std` is
|
|
52267
|
+
"`std` is a numeric scalar indicating standard deviation of a normal distribution. ",
|
|
50489
52268
|
"",
|
|
50490
|
-
"`count` is
|
|
52269
|
+
"`count` is an integral scalar/pair. A scalar indicates the length of the output vector. A pair indicates the dimension of the output matrix."
|
|
50491
52270
|
]
|
|
50492
52271
|
}
|
|
50493
52272
|
]
|
|
@@ -50499,7 +52278,7 @@
|
|
|
50499
52278
|
{
|
|
50500
52279
|
"type": "text",
|
|
50501
52280
|
"value": [
|
|
50502
|
-
"Return a vector
|
|
52281
|
+
"Return a vector(matrix) that follows a normal distribution. "
|
|
50503
52282
|
]
|
|
50504
52283
|
}
|
|
50505
52284
|
]
|
|
@@ -50521,7 +52300,25 @@
|
|
|
50521
52300
|
"",
|
|
50522
52301
|
"",
|
|
50523
52302
|
" $ std norm(10000);",
|
|
50524
|
-
" 0.995806"
|
|
52303
|
+
" 0.995806",
|
|
52304
|
+
"",
|
|
52305
|
+
" //生成随机矩阵",
|
|
52306
|
+
" $ norm(0, 1, 3:2)",
|
|
52307
|
+
""
|
|
52308
|
+
]
|
|
52309
|
+
},
|
|
52310
|
+
{
|
|
52311
|
+
"type": "text",
|
|
52312
|
+
"value": [
|
|
52313
|
+
"+---------+---------+ ",
|
|
52314
|
+
"|col1 |col2 |",
|
|
52315
|
+
"+=========+=========+",
|
|
52316
|
+
"|(0.5399) |(0.8475) |",
|
|
52317
|
+
"+---------+---------+ ",
|
|
52318
|
+
"|(1.0029) |1.811 |",
|
|
52319
|
+
"+---------+---------+ ",
|
|
52320
|
+
"|(0.0485) |(0.4339) |",
|
|
52321
|
+
"+---------+---------+ "
|
|
50525
52322
|
]
|
|
50526
52323
|
}
|
|
50527
52324
|
]
|
|
@@ -51220,6 +53017,78 @@
|
|
|
51220
53017
|
}
|
|
51221
53018
|
]
|
|
51222
53019
|
},
|
|
53020
|
+
"objectChecksum": {
|
|
53021
|
+
"title": "objectChecksum",
|
|
53022
|
+
"type": "function",
|
|
53023
|
+
"children": [
|
|
53024
|
+
{
|
|
53025
|
+
"title": "Syntax",
|
|
53026
|
+
"type": "grammer",
|
|
53027
|
+
"children": [
|
|
53028
|
+
{
|
|
53029
|
+
"type": "text",
|
|
53030
|
+
"value": [
|
|
53031
|
+
"objectChecksum(vector, [prev])"
|
|
53032
|
+
]
|
|
53033
|
+
}
|
|
53034
|
+
]
|
|
53035
|
+
},
|
|
53036
|
+
{
|
|
53037
|
+
"title": "Arguments",
|
|
53038
|
+
"type": "parameters",
|
|
53039
|
+
"children": [
|
|
53040
|
+
{
|
|
53041
|
+
"type": "text",
|
|
53042
|
+
"value": [
|
|
53043
|
+
"`vector` is a vector that is used for calculating checksums.",
|
|
53044
|
+
"",
|
|
53045
|
+
"`prev` is an integer. If the vector is too long, the checksum can be computed iteratively by specifying prev which represents the checksum of the previous segment of data during iteration."
|
|
53046
|
+
]
|
|
53047
|
+
}
|
|
53048
|
+
]
|
|
53049
|
+
},
|
|
53050
|
+
{
|
|
53051
|
+
"title": "Details",
|
|
53052
|
+
"type": "detail",
|
|
53053
|
+
"children": [
|
|
53054
|
+
{
|
|
53055
|
+
"type": "text",
|
|
53056
|
+
"value": [
|
|
53057
|
+
"Calculate the checksum of a vector. The result is an integer. It is often used to verify data integrity."
|
|
53058
|
+
]
|
|
53059
|
+
}
|
|
53060
|
+
]
|
|
53061
|
+
},
|
|
53062
|
+
{
|
|
53063
|
+
"title": "Examples",
|
|
53064
|
+
"type": "example",
|
|
53065
|
+
"children": [
|
|
53066
|
+
{
|
|
53067
|
+
"type": "code",
|
|
53068
|
+
"language": "console",
|
|
53069
|
+
"value": [
|
|
53070
|
+
"",
|
|
53071
|
+
" $ print objectChecksum(take(`A`B`C, 10))",
|
|
53072
|
+
" -268298654",
|
|
53073
|
+
" ",
|
|
53074
|
+
" $ print objectChecksum(2.3 6.5 7.8)",
|
|
53075
|
+
" -430996932",
|
|
53076
|
+
"",
|
|
53077
|
+
" //calculate checksum section by section",
|
|
53078
|
+
" $ print objectChecksum(1..15)",
|
|
53079
|
+
" -1877567753",
|
|
53080
|
+
"",
|
|
53081
|
+
" $ t0 = objectChecksum(1..5)",
|
|
53082
|
+
" $ t1 = objectChecksum(6..10, t0)",
|
|
53083
|
+
" $ t2 = objectChecksum(11..15, t1)",
|
|
53084
|
+
" $ print t2 ",
|
|
53085
|
+
" -1877567753"
|
|
53086
|
+
]
|
|
53087
|
+
}
|
|
53088
|
+
]
|
|
53089
|
+
}
|
|
53090
|
+
]
|
|
53091
|
+
},
|
|
51223
53092
|
"objs": {
|
|
51224
53093
|
"title": "objs",
|
|
51225
53094
|
"type": "function",
|
|
@@ -53328,11 +55197,11 @@
|
|
|
53328
55197
|
{
|
|
53329
55198
|
"type": "text",
|
|
53330
55199
|
"value": [
|
|
53331
|
-
"`function` the local function to call. It must not be quoted. It
|
|
55200
|
+
"`function` the local function to call. It must not be quoted. It can be a function with no parameters by definition, or a partial application that wraps the orginal function and its parameters to a function with no parameters. It can be a built-in function or a user-defined function.",
|
|
53332
55201
|
"",
|
|
53333
|
-
"`nodes` aliases of nodes. It is an optional parameter. If it is not specified, the system will call the function on all live data nodes in the cluster.",
|
|
55202
|
+
"`nodes` aliases of nodes. It is an optional parameter. If it is not specified, the system will call the function on all live data nodes and compute nodes in the cluster.",
|
|
53334
55203
|
"",
|
|
53335
|
-
"`addNodeAlias` whether to add aliases of nodes to results. It is an optional parameter. The default value is true.
|
|
55204
|
+
"`addNodeAlias` whether to add aliases of nodes to results. It is an optional parameter. The default value is true. You can set it to false if the result from each node already contains the node alias. "
|
|
53336
55205
|
]
|
|
53337
55206
|
}
|
|
53338
55207
|
]
|
|
@@ -53344,7 +55213,7 @@
|
|
|
53344
55213
|
{
|
|
53345
55214
|
"type": "text",
|
|
53346
55215
|
"value": [
|
|
53347
|
-
"Call a local function on all data nodes in a cluster in parallel and then merge the results. "
|
|
55216
|
+
"Call a local function on all data nodes and compute nodes in a cluster in parallel and then merge the results. "
|
|
53348
55217
|
]
|
|
53349
55218
|
}
|
|
53350
55219
|
]
|
|
@@ -53356,7 +55225,35 @@
|
|
|
53356
55225
|
{
|
|
53357
55226
|
"type": "text",
|
|
53358
55227
|
"value": [
|
|
53359
|
-
"
|
|
55228
|
+
"Ex. 1 Call function ``getChunksMeta`` without specifying parameters",
|
|
55229
|
+
""
|
|
55230
|
+
]
|
|
55231
|
+
},
|
|
55232
|
+
{
|
|
55233
|
+
"type": "code",
|
|
55234
|
+
"language": "console",
|
|
55235
|
+
"value": [
|
|
55236
|
+
"",
|
|
55237
|
+
" $ pnodeRun(getChunksMeta,,false);",
|
|
55238
|
+
""
|
|
55239
|
+
]
|
|
55240
|
+
},
|
|
55241
|
+
{
|
|
55242
|
+
"type": "text",
|
|
55243
|
+
"value": [
|
|
55244
|
+
"========= ===================================== ============================================================================= ======================= ===== ===== ===== ======== ====== ==========================",
|
|
55245
|
+
"site chunkId path dfsPath type flag size version state versionList ",
|
|
55246
|
+
"========= ===================================== ============================================================================= ======================= ===== ===== ===== ======== ====== ==========================",
|
|
55247
|
+
"local8848 bd13090e-7177-01a7-4ac4-840e1b977dcf D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190605/GOOG /compo/20190605/GOOG 1 0 0 1 0 cid : 40,pt2=>40:6729; # ",
|
|
55248
|
+
"local8848 b4935730-6372-b2a1-4f24-6c323037e576 e:\\data/CHUNKS/compo/20190605/AAPL /compo/20190605/AAPL 1 0 0 1 0 cid : 40,pt2=>40:6613; # ",
|
|
55249
|
+
"local8848 f8ee72c9-dad3-f49e-430e-5ddb3c61ae18 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190604/MSFT /compo/20190604/MSFT 1 0 0 1 0 cid : 40,pt2=>40:6664; # ",
|
|
55250
|
+
"local8848 08e26b5a-dfac-799f-4979-0dd3902eae6e D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190604/GOOG /compo/20190604/GOOG 1 0 0 1 0 cid : 40,pt2=>40:6635; # ",
|
|
55251
|
+
"local8848 f9e53a3d-af3e-018d-4bfa-a2b4980f3561 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190604/AAPL /compo/20190604/AAPL 1 0 0 1 0 cid : 40,pt2=>40:6783; # ",
|
|
55252
|
+
"local8848 417e49e9-5c61-cf9e-4b21-4b35f8e57273 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190601/MSFT /compo/20190601/MSFT 1 0 0 1 0 cid : 40,pt2=>40:6602; # ",
|
|
55253
|
+
"local8848 3ee64942-1d72-bea7-4bc1-f720132d9288 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190602/AAPL /compo/20190602/AAPL 1 0 0 1 0 cid : 40,pt2=>40:6749; # ",
|
|
55254
|
+
"========= ===================================== ============================================================================= ======================= ===== ===== ===== ======== ====== ==========================",
|
|
55255
|
+
"",
|
|
55256
|
+
"Ex. 2 In the following example, the function ``sum`` and arguments 1..10 are wrapped into a partial application ``sum{1..10}``. ",
|
|
53360
55257
|
""
|
|
53361
55258
|
]
|
|
53362
55259
|
},
|
|
@@ -53379,7 +55276,7 @@
|
|
|
53379
55276
|
"DFS_NODE3 55",
|
|
53380
55277
|
"=========== ======",
|
|
53381
55278
|
"",
|
|
53382
|
-
"``pnodeRun`` is a very convenient tool for cluster management. For example, in a cluster of 4 nodes: \"DFS_NODE1\", \"DFS_NODE2\", \"DFS_NODE3\", and \"DFS_NODE4\", run the following script on each of the node:",
|
|
55279
|
+
"Ex. 3 ``pnodeRun`` is a very convenient tool for cluster management. For example, in a cluster of 4 nodes: \"DFS_NODE1\", \"DFS_NODE2\", \"DFS_NODE3\", and \"DFS_NODE4\", run the following script on each of the node:",
|
|
53383
55280
|
""
|
|
53384
55281
|
]
|
|
53385
55282
|
},
|
|
@@ -53467,32 +55364,7 @@
|
|
|
53467
55364
|
"+---------+-------+--------+--------+-----------------------+-----------------------+-----------------------+--------+",
|
|
53468
55365
|
"|DFS_NODE4| root |jobDemo3|job demo|2017.11.16T13:05:16.325|2017.11.16T13:05:16.328|2017.11.16T13:05:34.716| |",
|
|
53469
55366
|
"+---------+-------+--------+--------+-----------------------+-----------------------+-----------------------+--------+",
|
|
53470
|
-
""
|
|
53471
|
-
]
|
|
53472
|
-
},
|
|
53473
|
-
{
|
|
53474
|
-
"type": "code",
|
|
53475
|
-
"language": "console",
|
|
53476
|
-
"value": [
|
|
53477
55367
|
"",
|
|
53478
|
-
" $ pnodeRun(getAllChunks,,false);",
|
|
53479
|
-
""
|
|
53480
|
-
]
|
|
53481
|
-
},
|
|
53482
|
-
{
|
|
53483
|
-
"type": "text",
|
|
53484
|
-
"value": [
|
|
53485
|
-
"========= ===================================== ============================================================================= ======================= ===== ===== ===== ======== ====== ==========================",
|
|
53486
|
-
"site chunkId path dfsPath type flag size version state versionList ",
|
|
53487
|
-
"========= ===================================== ============================================================================= ======================= ===== ===== ===== ======== ====== ==========================",
|
|
53488
|
-
"local8848 bd13090e-7177-01a7-4ac4-840e1b977dcf D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190605/GOOG /compo/20190605/GOOG 1 0 0 1 0 cid : 40,pt2=>40:6729; # ",
|
|
53489
|
-
"local8848 b4935730-6372-b2a1-4f24-6c323037e576 e:\\data/CHUNKS/compo/20190605/AAPL /compo/20190605/AAPL 1 0 0 1 0 cid : 40,pt2=>40:6613; # ",
|
|
53490
|
-
"local8848 f8ee72c9-dad3-f49e-430e-5ddb3c61ae18 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190604/MSFT /compo/20190604/MSFT 1 0 0 1 0 cid : 40,pt2=>40:6664; # ",
|
|
53491
|
-
"local8848 08e26b5a-dfac-799f-4979-0dd3902eae6e D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190604/GOOG /compo/20190604/GOOG 1 0 0 1 0 cid : 40,pt2=>40:6635; # ",
|
|
53492
|
-
"local8848 f9e53a3d-af3e-018d-4bfa-a2b4980f3561 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190604/AAPL /compo/20190604/AAPL 1 0 0 1 0 cid : 40,pt2=>40:6783; # ",
|
|
53493
|
-
"local8848 417e49e9-5c61-cf9e-4b21-4b35f8e57273 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190601/MSFT /compo/20190601/MSFT 1 0 0 1 0 cid : 40,pt2=>40:6602; # ",
|
|
53494
|
-
"local8848 3ee64942-1d72-bea7-4bc1-f720132d9288 D:\\130\\DolphinDB_Win64_V\\server\\local8848\\storage/CHUNKS/compo/20190602/AAPL /compo/20190602/AAPL 1 0 0 1 0 cid : 40,pt2=>40:6749; # ",
|
|
53495
|
-
"========= ===================================== ============================================================================= ======================= ===== ===== ===== ======== ====== ==========================",
|
|
53496
55368
|
"",
|
|
53497
55369
|
"How does ``pnodeRun`` merge the results from multiple nodes:",
|
|
53498
55370
|
"",
|
|
@@ -53537,8 +55409,6 @@
|
|
|
53537
55409
|
"",
|
|
53538
55410
|
"Return a table which is the union of individual tables from multiple nodes.",
|
|
53539
55411
|
"",
|
|
53540
|
-
"Please see the aforementioned example of `pnodeRun(getRecentJobs{2})`.",
|
|
53541
|
-
"",
|
|
53542
55412
|
"\\(5) If `function` is a command (a command returns nothing):",
|
|
53543
55413
|
"",
|
|
53544
55414
|
"Return nothing",
|
|
@@ -54163,43 +56033,46 @@
|
|
|
54163
56033
|
]
|
|
54164
56034
|
},
|
|
54165
56035
|
{
|
|
54166
|
-
"title": "
|
|
54167
|
-
"type": "
|
|
56036
|
+
"title": "Details",
|
|
56037
|
+
"type": "detail",
|
|
54168
56038
|
"children": [
|
|
54169
56039
|
{
|
|
54170
56040
|
"type": "text",
|
|
54171
56041
|
"value": [
|
|
54172
|
-
"
|
|
56042
|
+
"This function is executed on the server where the stream table is located. It instructs the server to publish data from a stream table to a client. The client may or may not be a DolphinDB data node or API. In comparison, when we use function :doc:`../s/subscribeTable`, the client must be a DolphinDB data node.",
|
|
54173
56043
|
"",
|
|
54174
|
-
"
|
|
54175
|
-
"",
|
|
54176
|
-
"`tableName` a string indicating the name of the shared stream table on the local server.",
|
|
54177
|
-
"",
|
|
54178
|
-
"`actionName` a string indicating the name assigned to the subscription task. It can have letters, digits and underscores.",
|
|
56044
|
+
"This function returns a string vector, including the list of column names of the stream table.",
|
|
54179
56045
|
"",
|
|
54180
|
-
"
|
|
54181
|
-
"",
|
|
54182
|
-
"`filter` a vector of selected values in the filtering column. Only the messages with specified filtering column values are published. The filtering column is set with function :doc:`/FunctionsandCommands/CommandsReferences/s/setStreamTableFilterColumn`. filter does not support Boolean types.",
|
|
56046
|
+
"The function throws an exception if the specified table doesn't exist or it is not a stream table, or if the subscription already exists on the client and allowExists=false.",
|
|
54183
56047
|
"",
|
|
54184
|
-
"
|
|
56048
|
+
"Use command :doc:`/FunctionsandCommands/CommandsReferences/s/stopPublishTable` to stop publishing data. ",
|
|
56049
|
+
""
|
|
54185
56050
|
]
|
|
54186
56051
|
}
|
|
54187
56052
|
]
|
|
54188
56053
|
},
|
|
54189
56054
|
{
|
|
54190
|
-
"title": "
|
|
54191
|
-
"type": "
|
|
56055
|
+
"title": "Arguments",
|
|
56056
|
+
"type": "parameters",
|
|
54192
56057
|
"children": [
|
|
54193
56058
|
{
|
|
54194
56059
|
"type": "text",
|
|
54195
56060
|
"value": [
|
|
54196
|
-
"
|
|
56061
|
+
"`host` the host name of the client node.",
|
|
54197
56062
|
"",
|
|
54198
|
-
"
|
|
56063
|
+
"`port` the subscription port number of the client. If the client is the DolphinDB data node, *port* is specified by the parameter *subPort*. If the client is an API, *port* is subscription port number enabled by the client.",
|
|
54199
56064
|
"",
|
|
54200
|
-
"
|
|
56065
|
+
"`tableName` a string indicating the name of the shared stream table on the local server.",
|
|
56066
|
+
"",
|
|
56067
|
+
"`actionName` a string indicating the name assigned to the subscription task. It can have letters, digits and underscores.",
|
|
56068
|
+
"",
|
|
56069
|
+
"`offset` the position of the first message to subscribe. A message is row of the stream table. If offset is unspecified, or negative, or above the number of rows of the stream table, the subscription starts from the next incoming record. The offset is relative to the first row of the stream table when it is created. If some rows were cleared from memory due to cache size limit, they are still considered in determining where the subscription starts.",
|
|
54201
56070
|
"",
|
|
54202
|
-
"
|
|
56071
|
+
"`filter` a vector of selected values in the filtering column. Only the messages with specified filtering column values are published. The filtering column is set with function :doc:`/FunctionsandCommands/CommandsReferences/s/setStreamTableFilterColumn`. filter does not support Boolean types.",
|
|
56072
|
+
"",
|
|
56073
|
+
"`allowExists` a Boolean value. When `allowExists`\\=true, if the subscription already exists before function ``publishTable`` is executed, the system will not throw an exception. ",
|
|
56074
|
+
"",
|
|
56075
|
+
"`resetOffset` a Boolean value indicating whether to reset the *offset* to -1, the default value is false. When resetOffset = true, the *offset* will be reset if the row specified by the *offset* in the stream table has no data and the subscription will start from the next incoming record."
|
|
54203
56076
|
]
|
|
54204
56077
|
}
|
|
54205
56078
|
]
|
|
@@ -54225,6 +56098,59 @@
|
|
|
54225
56098
|
}
|
|
54226
56099
|
]
|
|
54227
56100
|
},
|
|
56101
|
+
"purgeCacheEngine": {
|
|
56102
|
+
"title": "purgeCacheEngine",
|
|
56103
|
+
"type": "command",
|
|
56104
|
+
"children": [
|
|
56105
|
+
{
|
|
56106
|
+
"title": "Syntax",
|
|
56107
|
+
"type": "grammer",
|
|
56108
|
+
"children": [
|
|
56109
|
+
{
|
|
56110
|
+
"type": "text",
|
|
56111
|
+
"value": [
|
|
56112
|
+
"purgeCacheEngine()"
|
|
56113
|
+
]
|
|
56114
|
+
}
|
|
56115
|
+
]
|
|
56116
|
+
},
|
|
56117
|
+
{
|
|
56118
|
+
"title": "Arguments",
|
|
56119
|
+
"type": "parameters",
|
|
56120
|
+
"children": [
|
|
56121
|
+
{
|
|
56122
|
+
"type": "text",
|
|
56123
|
+
"value": [
|
|
56124
|
+
"None"
|
|
56125
|
+
]
|
|
56126
|
+
}
|
|
56127
|
+
]
|
|
56128
|
+
},
|
|
56129
|
+
{
|
|
56130
|
+
"title": "Details",
|
|
56131
|
+
"type": "detail",
|
|
56132
|
+
"children": [
|
|
56133
|
+
{
|
|
56134
|
+
"type": "text",
|
|
56135
|
+
"value": [
|
|
56136
|
+
"Forcibly flush the data of completed transactions cached in the OLAP cache engine to the database. Specify the configuration parameter *chunkCacheEngineMemSize* and set *dataSync* = 1 before execution."
|
|
56137
|
+
]
|
|
56138
|
+
}
|
|
56139
|
+
]
|
|
56140
|
+
},
|
|
56141
|
+
{
|
|
56142
|
+
"title": "First Release",
|
|
56143
|
+
"children": [
|
|
56144
|
+
{
|
|
56145
|
+
"type": "text",
|
|
56146
|
+
"value": [
|
|
56147
|
+
"1.30.16/2.00.4"
|
|
56148
|
+
]
|
|
56149
|
+
}
|
|
56150
|
+
]
|
|
56151
|
+
}
|
|
56152
|
+
]
|
|
56153
|
+
},
|
|
54228
56154
|
"push!": {
|
|
54229
56155
|
"title": "push!",
|
|
54230
56156
|
"type": "function",
|
|
@@ -55235,7 +57161,7 @@
|
|
|
55235
57161
|
{
|
|
55236
57162
|
"type": "text",
|
|
55237
57163
|
"value": [
|
|
55238
|
-
"rand(X,
|
|
57164
|
+
"rand(X, count)"
|
|
55239
57165
|
]
|
|
55240
57166
|
}
|
|
55241
57167
|
]
|
|
@@ -55249,7 +57175,7 @@
|
|
|
55249
57175
|
"value": [
|
|
55250
57176
|
"`X` is a scalar/vector. ",
|
|
55251
57177
|
"",
|
|
55252
|
-
"`
|
|
57178
|
+
"`count` is an INT scalar/pair. As a scalar, it indicates the length of the output vector; As a pair, it indicates the dimension of the output matrix."
|
|
55253
57179
|
]
|
|
55254
57180
|
}
|
|
55255
57181
|
]
|
|
@@ -55261,9 +57187,11 @@
|
|
|
55261
57187
|
{
|
|
55262
57188
|
"type": "text",
|
|
55263
57189
|
"value": [
|
|
55264
|
-
"
|
|
57190
|
+
"Return a vector/matrix of random values.",
|
|
57191
|
+
"",
|
|
57192
|
+
"* If `X` is a scalar, return a vector of random values that follows a uniform distribution on [0, `X`).",
|
|
55265
57193
|
"",
|
|
55266
|
-
"If `X` is a vector, return a vector of random values drawn from the elements of `X`.",
|
|
57194
|
+
"* If `X` is a vector, return a vector of random values drawn from the elements of `X`.",
|
|
55267
57195
|
"",
|
|
55268
57196
|
"The data type of the result is the same as the data type of `X`. "
|
|
55269
57197
|
]
|
|
@@ -55280,18 +57208,41 @@
|
|
|
55280
57208
|
"value": [
|
|
55281
57209
|
"",
|
|
55282
57210
|
" $ x=rand(10, 20); ",
|
|
55283
|
-
"
|
|
57211
|
+
"",
|
|
57212
|
+
" // generate 20 random nonnegative integers less than 10 ",
|
|
55284
57213
|
" $ x; ",
|
|
55285
57214
|
" [9,9,8,1,1,0,8,3,2,6,4,6,9,6,8,9,3,2,1,5] ",
|
|
55286
57215
|
"",
|
|
57216
|
+
" // generate 10 random nonnegative double values less than 9.8",
|
|
55287
57217
|
" $ rand(9.8, 10); ",
|
|
55288
57218
|
" [3.653754,1.750518,0.055747,5.219222,2.473778,6.337576,7.797493,1.392241,0.149499,5.697612]",
|
|
55289
|
-
" $ // generate 10 random nonnegative double values less than 9.8",
|
|
55290
57219
|
"",
|
|
57220
|
+
" // generate 3 random values drawn from vector x",
|
|
55291
57221
|
" $ x=3 5 4 6 9;",
|
|
55292
57222
|
" $ rand(x, 3); ",
|
|
55293
57223
|
" [9,3,6]",
|
|
55294
|
-
"
|
|
57224
|
+
"",
|
|
57225
|
+
" $ rand(10.0, 2:2) // generate a 2*2 random matrix less than 10",
|
|
57226
|
+
""
|
|
57227
|
+
]
|
|
57228
|
+
},
|
|
57229
|
+
{
|
|
57230
|
+
"type": "text",
|
|
57231
|
+
"value": [
|
|
57232
|
+
"+-------+-------+",
|
|
57233
|
+
"|col1 |col2 |",
|
|
57234
|
+
"+=======+=======+",
|
|
57235
|
+
"|0.8233 |1.0052 |",
|
|
57236
|
+
"+-------+-------+",
|
|
57237
|
+
"|7.1127 |9.7578 |",
|
|
57238
|
+
"+-------+-------+",
|
|
57239
|
+
""
|
|
57240
|
+
]
|
|
57241
|
+
},
|
|
57242
|
+
{
|
|
57243
|
+
"type": "code",
|
|
57244
|
+
"language": "console",
|
|
57245
|
+
"value": [
|
|
55295
57246
|
"",
|
|
55296
57247
|
" $ 12:35:06 + rand(100, 10); ",
|
|
55297
57248
|
" [12:35:44,12:35:16,12:35:50,12:35:44,12:35:46,12:35:09,12:35:50,12:36:35,12:35:09,12:36:44]",
|
|
@@ -55510,6 +57461,83 @@
|
|
|
55510
57461
|
}
|
|
55511
57462
|
]
|
|
55512
57463
|
},
|
|
57464
|
+
"randDiscrete": {
|
|
57465
|
+
"title": "randDiscrete",
|
|
57466
|
+
"type": "function",
|
|
57467
|
+
"children": [
|
|
57468
|
+
{
|
|
57469
|
+
"title": "Syntax",
|
|
57470
|
+
"type": "grammer",
|
|
57471
|
+
"children": [
|
|
57472
|
+
{
|
|
57473
|
+
"type": "text",
|
|
57474
|
+
"value": [
|
|
57475
|
+
"randDiscrete(v, p, count)"
|
|
57476
|
+
]
|
|
57477
|
+
}
|
|
57478
|
+
]
|
|
57479
|
+
},
|
|
57480
|
+
{
|
|
57481
|
+
"title": "Arguments",
|
|
57482
|
+
"type": "parameters",
|
|
57483
|
+
"children": [
|
|
57484
|
+
{
|
|
57485
|
+
"type": "text",
|
|
57486
|
+
"value": [
|
|
57487
|
+
"`v` is a vector/tuple indicating the sample data.",
|
|
57488
|
+
"",
|
|
57489
|
+
"`p` is a vector of floating point type of the same length as v. Each element in p must be a positive number, indicating the probability distribution of v.",
|
|
57490
|
+
"",
|
|
57491
|
+
"`count` is a positive integer indicating the length of the output vector."
|
|
57492
|
+
]
|
|
57493
|
+
}
|
|
57494
|
+
]
|
|
57495
|
+
},
|
|
57496
|
+
{
|
|
57497
|
+
"title": "Details",
|
|
57498
|
+
"type": "detail",
|
|
57499
|
+
"children": [
|
|
57500
|
+
{
|
|
57501
|
+
"type": "text",
|
|
57502
|
+
"value": [
|
|
57503
|
+
"Generate a sample of size count with random values sampling from v based on the specified probability distribution p."
|
|
57504
|
+
]
|
|
57505
|
+
}
|
|
57506
|
+
]
|
|
57507
|
+
},
|
|
57508
|
+
{
|
|
57509
|
+
"title": "Examples",
|
|
57510
|
+
"type": "example",
|
|
57511
|
+
"children": [
|
|
57512
|
+
{
|
|
57513
|
+
"type": "code",
|
|
57514
|
+
"language": "console",
|
|
57515
|
+
"value": [
|
|
57516
|
+
"",
|
|
57517
|
+
" $ randDiscrete(1..5, [0.1, 0.1, 0.2, 0.2, 0.4], 10)",
|
|
57518
|
+
" [2,3,5,2,5,5,2,1,1,2]",
|
|
57519
|
+
"",
|
|
57520
|
+
" //If the sum of p is not 1, it will be normalized automatically.",
|
|
57521
|
+
" $ randDiscrete(1..5, [0.1, 0.2, 0.3, 0.4, 0.5], 5)",
|
|
57522
|
+
" [5,1,2,3,5]",
|
|
57523
|
+
"",
|
|
57524
|
+
" $ randDiscrete(`A`B`C`E`F, [0.1, 0.2, 0.3, 0.4, 0.5], 5)",
|
|
57525
|
+
" [\"C\",\"E\",\"B\",\"C\",\"F\"]",
|
|
57526
|
+
"",
|
|
57527
|
+
" // Sample from each element in a tuple.",
|
|
57528
|
+
" $ randDiscrete([[1,2], [2,3,4], 'S', 'abc'], [0.3, 0.3, 0.2, 0.1], 10)",
|
|
57529
|
+
" ('S',[2,3,4],[1,2],[2,3,4],[1,2],'S','S',[2,3,4],[2,3,4],[2,3,4])",
|
|
57530
|
+
"",
|
|
57531
|
+
" // Sample from each vector in an array vector.",
|
|
57532
|
+
" $ a = array(INT[], 0, 10).append!([1 2 3, 4 5,6 7 8, 9 NULL])",
|
|
57533
|
+
" $ randDiscrete(a, [0.1, 0.2, 0.3, 0.4], 10)",
|
|
57534
|
+
" [[9,00i],[9,00i],[9,00i],[4,5],[9,00i],[1,2,3],[9,00i],[6,7,8],[9,00i],[9,00i]]"
|
|
57535
|
+
]
|
|
57536
|
+
}
|
|
57537
|
+
]
|
|
57538
|
+
}
|
|
57539
|
+
]
|
|
57540
|
+
},
|
|
55513
57541
|
"randExp": {
|
|
55514
57542
|
"title": "randExp",
|
|
55515
57543
|
"type": "function",
|
|
@@ -57616,6 +59644,166 @@
|
|
|
57616
59644
|
}
|
|
57617
59645
|
]
|
|
57618
59646
|
},
|
|
59647
|
+
"rebalanceChunksAmongDataNodes": {
|
|
59648
|
+
"title": "rebalanceChunksAmongDataNodes",
|
|
59649
|
+
"type": "function",
|
|
59650
|
+
"children": [
|
|
59651
|
+
{
|
|
59652
|
+
"title": "Syntax",
|
|
59653
|
+
"type": "grammer",
|
|
59654
|
+
"children": [
|
|
59655
|
+
{
|
|
59656
|
+
"type": "text",
|
|
59657
|
+
"value": [
|
|
59658
|
+
"rebalanceChunksAmongDataNodes([exec = false])"
|
|
59659
|
+
]
|
|
59660
|
+
}
|
|
59661
|
+
]
|
|
59662
|
+
},
|
|
59663
|
+
{
|
|
59664
|
+
"title": "Arguments",
|
|
59665
|
+
"type": "parameters",
|
|
59666
|
+
"children": [
|
|
59667
|
+
{
|
|
59668
|
+
"type": "text",
|
|
59669
|
+
"value": [
|
|
59670
|
+
"`exec` is a Boolean value indicating whether to initiate data rebalancing among data nodes. The default value is false indicating that data rebalancing will not be initiated."
|
|
59671
|
+
]
|
|
59672
|
+
}
|
|
59673
|
+
]
|
|
59674
|
+
},
|
|
59675
|
+
{
|
|
59676
|
+
"title": "Details",
|
|
59677
|
+
"type": "detail",
|
|
59678
|
+
"children": [
|
|
59679
|
+
{
|
|
59680
|
+
"type": "text",
|
|
59681
|
+
"value": [
|
|
59682
|
+
"This function is used to rebalance data among data nodes for optimal performance after one or more data nodes are added to a DolphinDB cluster. It can only be executed on a controller by an administrator.",
|
|
59683
|
+
"",
|
|
59684
|
+
"Return a table containing the following columns:",
|
|
59685
|
+
"",
|
|
59686
|
+
"================== =================================================",
|
|
59687
|
+
"name meaning",
|
|
59688
|
+
"================== =================================================",
|
|
59689
|
+
"chunkId the chunk ID",
|
|
59690
|
+
"srcNode alias of source node",
|
|
59691
|
+
"destNode alias of destination node",
|
|
59692
|
+
"================== =================================================",
|
|
59693
|
+
"",
|
|
59694
|
+
"You can get the status of recovery tasks by :doc:`/FunctionsandCommands/FunctionReferences/g/getRecoveryTaskStatus` on a controller."
|
|
59695
|
+
]
|
|
59696
|
+
}
|
|
59697
|
+
]
|
|
59698
|
+
},
|
|
59699
|
+
{
|
|
59700
|
+
"title": "Example",
|
|
59701
|
+
"children": [
|
|
59702
|
+
{
|
|
59703
|
+
"type": "code",
|
|
59704
|
+
"language": "console",
|
|
59705
|
+
"value": [
|
|
59706
|
+
"",
|
|
59707
|
+
" $ rebalanceChunksAmongDataNodes()",
|
|
59708
|
+
""
|
|
59709
|
+
]
|
|
59710
|
+
},
|
|
59711
|
+
{
|
|
59712
|
+
"type": "text",
|
|
59713
|
+
"value": [
|
|
59714
|
+
"==================================== ======= ========",
|
|
59715
|
+
"ChunkId srcNode destNode",
|
|
59716
|
+
"==================================== ======= ========",
|
|
59717
|
+
"99279094-ca12-3b87-48b6-520cbb986f39 node1 node2",
|
|
59718
|
+
"45f612b8-42f5-aebd-4cef-e522b6ae1fc8 node1 node2\t",
|
|
59719
|
+
"==================================== ======= ========"
|
|
59720
|
+
]
|
|
59721
|
+
}
|
|
59722
|
+
]
|
|
59723
|
+
}
|
|
59724
|
+
]
|
|
59725
|
+
},
|
|
59726
|
+
"rebalanceChunksWithinDataNode": {
|
|
59727
|
+
"title": "rebalanceChunksWithinDataNode",
|
|
59728
|
+
"type": "function",
|
|
59729
|
+
"children": [
|
|
59730
|
+
{
|
|
59731
|
+
"title": "Syntax",
|
|
59732
|
+
"type": "grammer",
|
|
59733
|
+
"children": [
|
|
59734
|
+
{
|
|
59735
|
+
"type": "text",
|
|
59736
|
+
"value": [
|
|
59737
|
+
"rebalanceChunksWithinDataNode(nodeAlias, [exec=false])"
|
|
59738
|
+
]
|
|
59739
|
+
}
|
|
59740
|
+
]
|
|
59741
|
+
},
|
|
59742
|
+
{
|
|
59743
|
+
"title": "Arguments",
|
|
59744
|
+
"type": "parameters",
|
|
59745
|
+
"children": [
|
|
59746
|
+
{
|
|
59747
|
+
"type": "text",
|
|
59748
|
+
"value": [
|
|
59749
|
+
"`nodeAlias` is a string indicating the alias of a node.",
|
|
59750
|
+
"",
|
|
59751
|
+
"`exec` is a Boolean value indicating whether to initiate data rebalancing within a data node. The default value is false indicating that data rebalancing will not be initiated."
|
|
59752
|
+
]
|
|
59753
|
+
}
|
|
59754
|
+
]
|
|
59755
|
+
},
|
|
59756
|
+
{
|
|
59757
|
+
"title": "Details",
|
|
59758
|
+
"type": "detail",
|
|
59759
|
+
"children": [
|
|
59760
|
+
{
|
|
59761
|
+
"type": "text",
|
|
59762
|
+
"value": [
|
|
59763
|
+
"After volumes are added in a data node, partitions on the other volumes need to be rebalanced for optimal performance. This function is used to rebalance data among volumes within a data node. It can only be executed on a controller by an administrator.",
|
|
59764
|
+
"",
|
|
59765
|
+
"Return a table containing the following columns:",
|
|
59766
|
+
"",
|
|
59767
|
+
"================== =================================================",
|
|
59768
|
+
"name meaning",
|
|
59769
|
+
"================== =================================================",
|
|
59770
|
+
"chunkId the chunk ID",
|
|
59771
|
+
"srcVolume source volume",
|
|
59772
|
+
"destVolume destination volume",
|
|
59773
|
+
"================== =================================================",
|
|
59774
|
+
"",
|
|
59775
|
+
"You can get the status of recovery tasks by :doc:`/FunctionsandCommands/FunctionReferences/g/getRecoveryTaskStatus` on a controller."
|
|
59776
|
+
]
|
|
59777
|
+
}
|
|
59778
|
+
]
|
|
59779
|
+
},
|
|
59780
|
+
{
|
|
59781
|
+
"title": "Examples",
|
|
59782
|
+
"type": "example",
|
|
59783
|
+
"children": [
|
|
59784
|
+
{
|
|
59785
|
+
"type": "code",
|
|
59786
|
+
"language": "console",
|
|
59787
|
+
"value": [
|
|
59788
|
+
"",
|
|
59789
|
+
" $ rebalanceChunksWithinDataNode(\"node1\")",
|
|
59790
|
+
""
|
|
59791
|
+
]
|
|
59792
|
+
},
|
|
59793
|
+
{
|
|
59794
|
+
"type": "text",
|
|
59795
|
+
"value": [
|
|
59796
|
+
"+-------------------------------------+-------------------+------------------+",
|
|
59797
|
+
"|ChunkId |srcVolume |destVolume |",
|
|
59798
|
+
"+=====================================+===================+==================+",
|
|
59799
|
+
"|82c6eb6c-36ee-b1b6-4a86-ca24d9faaa25 | /hdd/hdd1/volumes |/hdd/hdd2/volumes |\t",
|
|
59800
|
+
"+-------------------------------------+-------------------+------------------+"
|
|
59801
|
+
]
|
|
59802
|
+
}
|
|
59803
|
+
]
|
|
59804
|
+
}
|
|
59805
|
+
]
|
|
59806
|
+
},
|
|
57619
59807
|
"reciprocal": {
|
|
57620
59808
|
"title": "reciprocal",
|
|
57621
59809
|
"type": "function",
|
|
@@ -59973,7 +62161,7 @@
|
|
|
59973
62161
|
"value": [
|
|
59974
62162
|
"`userId` a string indicating a user name.",
|
|
59975
62163
|
"",
|
|
59976
|
-
"`newPwd` a string indicating the new password for the user."
|
|
62164
|
+
"`newPwd` a string with 6-20 characters indicating the new password for the user."
|
|
59977
62165
|
]
|
|
59978
62166
|
}
|
|
59979
62167
|
]
|
|
@@ -60006,6 +62194,52 @@
|
|
|
60006
62194
|
}
|
|
60007
62195
|
]
|
|
60008
62196
|
},
|
|
62197
|
+
"resetRecoveryWorkerNum": {
|
|
62198
|
+
"title": "resetRecoveryWorkerNum",
|
|
62199
|
+
"type": "command",
|
|
62200
|
+
"children": [
|
|
62201
|
+
{
|
|
62202
|
+
"title": "Arguments",
|
|
62203
|
+
"type": "parameters",
|
|
62204
|
+
"children": [
|
|
62205
|
+
{
|
|
62206
|
+
"type": "text",
|
|
62207
|
+
"value": [
|
|
62208
|
+
"`newWokerNum` is a positive integer that specifies the number of worker threads used for chunk recovery."
|
|
62209
|
+
]
|
|
62210
|
+
}
|
|
62211
|
+
]
|
|
62212
|
+
},
|
|
62213
|
+
{
|
|
62214
|
+
"title": "Details",
|
|
62215
|
+
"type": "detail",
|
|
62216
|
+
"children": [
|
|
62217
|
+
{
|
|
62218
|
+
"type": "text",
|
|
62219
|
+
"value": [
|
|
62220
|
+
"Modify the number of worker threads used by the current node for chunk recovery online. This command can only be executed by the administrator on the data node.",
|
|
62221
|
+
"",
|
|
62222
|
+
"Note that this command modifies the configuration parameter 'recoveryWorkers' during the current session only. To permanently modify 'recoveryWorkers', change it in the configuration file (the default value is 1)."
|
|
62223
|
+
]
|
|
62224
|
+
}
|
|
62225
|
+
]
|
|
62226
|
+
},
|
|
62227
|
+
{
|
|
62228
|
+
"title": "Examples",
|
|
62229
|
+
"type": "example",
|
|
62230
|
+
"children": [
|
|
62231
|
+
{
|
|
62232
|
+
"type": "code",
|
|
62233
|
+
"language": "console",
|
|
62234
|
+
"value": [
|
|
62235
|
+
"",
|
|
62236
|
+
" $ resetRecoveryWorkerNum(2)"
|
|
62237
|
+
]
|
|
62238
|
+
}
|
|
62239
|
+
]
|
|
62240
|
+
}
|
|
62241
|
+
]
|
|
62242
|
+
},
|
|
60009
62243
|
"reshape": {
|
|
60010
62244
|
"title": "reshape",
|
|
60011
62245
|
"type": "function",
|
|
@@ -60395,6 +62629,63 @@
|
|
|
60395
62629
|
}
|
|
60396
62630
|
]
|
|
60397
62631
|
},
|
|
62632
|
+
"resumeRecovery": {
|
|
62633
|
+
"title": "resumeRecovery",
|
|
62634
|
+
"type": "command",
|
|
62635
|
+
"children": [
|
|
62636
|
+
{
|
|
62637
|
+
"title": "Syntax",
|
|
62638
|
+
"type": "grammer",
|
|
62639
|
+
"children": [
|
|
62640
|
+
{
|
|
62641
|
+
"type": "text",
|
|
62642
|
+
"value": [
|
|
62643
|
+
"resumeRecovery()"
|
|
62644
|
+
]
|
|
62645
|
+
}
|
|
62646
|
+
]
|
|
62647
|
+
},
|
|
62648
|
+
{
|
|
62649
|
+
"title": "Arguments",
|
|
62650
|
+
"type": "parameters",
|
|
62651
|
+
"children": [
|
|
62652
|
+
{
|
|
62653
|
+
"type": "text",
|
|
62654
|
+
"value": [
|
|
62655
|
+
"None"
|
|
62656
|
+
]
|
|
62657
|
+
}
|
|
62658
|
+
]
|
|
62659
|
+
},
|
|
62660
|
+
{
|
|
62661
|
+
"title": "Details",
|
|
62662
|
+
"type": "detail",
|
|
62663
|
+
"children": [
|
|
62664
|
+
{
|
|
62665
|
+
"type": "text",
|
|
62666
|
+
"value": [
|
|
62667
|
+
"Resume suspended recovery processes in \"Waiting\" status. This command can only be executed by the administrator on the controller.",
|
|
62668
|
+
"",
|
|
62669
|
+
"Note: For high-availability clusters, this command must be executed on every node in the raft group. "
|
|
62670
|
+
]
|
|
62671
|
+
}
|
|
62672
|
+
]
|
|
62673
|
+
},
|
|
62674
|
+
{
|
|
62675
|
+
"title": "First Release",
|
|
62676
|
+
"children": [
|
|
62677
|
+
{
|
|
62678
|
+
"type": "text",
|
|
62679
|
+
"value": [
|
|
62680
|
+
"1.30.16、2.00.4",
|
|
62681
|
+
"",
|
|
62682
|
+
"Related command: :doc:`../s/suspendRecovery`"
|
|
62683
|
+
]
|
|
62684
|
+
}
|
|
62685
|
+
]
|
|
62686
|
+
}
|
|
62687
|
+
]
|
|
62688
|
+
},
|
|
60398
62689
|
"reverse": {
|
|
60399
62690
|
"title": "reverse",
|
|
60400
62691
|
"type": "function",
|
|
@@ -64654,8 +66945,11 @@
|
|
|
64654
66945
|
"",
|
|
64655
66946
|
" partitionSchema->[0,5,10]",
|
|
64656
66947
|
" partitionSites->",
|
|
64657
|
-
" partitionTypeName->RANGE",
|
|
64658
66948
|
" partitionColumnType->4",
|
|
66949
|
+
" partitionTypeName->RANGE",
|
|
66950
|
+
" chunkGranularity->TABLE",
|
|
66951
|
+
" keepDuplicates->ALL",
|
|
66952
|
+
" engineType->OLAP",
|
|
64659
66953
|
" chunkPath->",
|
|
64660
66954
|
" partitionColumnIndex->0",
|
|
64661
66955
|
" colDefs->",
|
|
@@ -64666,7 +66960,7 @@
|
|
|
64666
66960
|
"",
|
|
64667
66961
|
" partitionType->2",
|
|
64668
66962
|
" partitionColumnName->ID",
|
|
64669
|
-
""
|
|
66963
|
+
" "
|
|
64670
66964
|
]
|
|
64671
66965
|
},
|
|
64672
66966
|
{
|
|
@@ -64681,11 +66975,14 @@
|
|
|
64681
66975
|
"value": [
|
|
64682
66976
|
" $ schema(db);",
|
|
64683
66977
|
"",
|
|
64684
|
-
" databaseDir->dfs://rangedb101",
|
|
64685
|
-
" partitionType->2",
|
|
64686
|
-
" partitionTypeName->RANGE",
|
|
64687
66978
|
" partitionSchema->[0,5,10]",
|
|
64688
|
-
" partitionSites->"
|
|
66979
|
+
" partitionSites->",
|
|
66980
|
+
" partitionTypeName->RANGE",
|
|
66981
|
+
" atomic->TRANS",
|
|
66982
|
+
" databaseDir->dfs://rangedb101",
|
|
66983
|
+
" chunkGranularity->TABLE",
|
|
66984
|
+
" engineType->OLAP",
|
|
66985
|
+
" partitionType->2"
|
|
64689
66986
|
]
|
|
64690
66987
|
}
|
|
64691
66988
|
]
|
|
@@ -65836,6 +68133,92 @@
|
|
|
65836
68133
|
}
|
|
65837
68134
|
]
|
|
65838
68135
|
},
|
|
68136
|
+
"setAtomicLevel": {
|
|
68137
|
+
"title": "setAtomicLevel",
|
|
68138
|
+
"type": "command",
|
|
68139
|
+
"children": [
|
|
68140
|
+
{
|
|
68141
|
+
"title": "Syntax",
|
|
68142
|
+
"type": "grammer",
|
|
68143
|
+
"children": [
|
|
68144
|
+
{
|
|
68145
|
+
"type": "text",
|
|
68146
|
+
"value": [
|
|
68147
|
+
"setAtomicLevel(dbHandle, atomic)"
|
|
68148
|
+
]
|
|
68149
|
+
}
|
|
68150
|
+
]
|
|
68151
|
+
},
|
|
68152
|
+
{
|
|
68153
|
+
"title": "Arguments",
|
|
68154
|
+
"type": "parameters",
|
|
68155
|
+
"children": [
|
|
68156
|
+
{
|
|
68157
|
+
"type": "text",
|
|
68158
|
+
"value": [
|
|
68159
|
+
"`dbHandle` is a distributed database handle returned by function :doc:`/FunctionsandCommands/FunctionReferences/d/database`.",
|
|
68160
|
+
"",
|
|
68161
|
+
"`atomic` indicates at which level the atomicity is guaranteed for a write transaction, thus determining whether concurrent writes to the same chunk are allowed. It can be 'TRANS' or 'CHUNK' and the default value is 'TRANS'.",
|
|
68162
|
+
"",
|
|
68163
|
+
"- 'TRANS' indicates that the atomicity is guaranteed at the transaction level. If a transaction attempts to write to multiple chunks and one of the chunks is locked by another transaction, a write-write conflict occurs, and all writes of the transaction fail. Therefore, setting *atomic* ='TRANS' means concurrent writes to a chunk are not allowed.",
|
|
68164
|
+
"",
|
|
68165
|
+
"- 'CHUNK' indicates that the atomicity is guaranteed at the chunk level. If a transaction tries to write to multiple chunks and a write-write conflict occurs as a chunk is locked by another transaction, instead of aborting the writes, the transaction will keep writing to the non-locked chunks and keep attempting to write to the chunk in conflict until it is still locked after a few minutes. Therefore, setting *atomic* ='CHUNK' means concurrent writes to a chunk are allowed. As the atomicity at the transaction level is not guaranteed, the write operation may succeed in some chunks but fail in other chunks. Please also note that the write speed may be impacted by the repeated attempts to write to the chunks that are locked."
|
|
68166
|
+
]
|
|
68167
|
+
}
|
|
68168
|
+
]
|
|
68169
|
+
},
|
|
68170
|
+
{
|
|
68171
|
+
"title": "Details",
|
|
68172
|
+
"type": "detail",
|
|
68173
|
+
"children": [
|
|
68174
|
+
{
|
|
68175
|
+
"type": "text",
|
|
68176
|
+
"value": [
|
|
68177
|
+
"To manually specify at which level concurrent writes are allowed in a distributed database."
|
|
68178
|
+
]
|
|
68179
|
+
}
|
|
68180
|
+
]
|
|
68181
|
+
},
|
|
68182
|
+
{
|
|
68183
|
+
"title": "Examples",
|
|
68184
|
+
"type": "example",
|
|
68185
|
+
"children": [
|
|
68186
|
+
{
|
|
68187
|
+
"type": "code",
|
|
68188
|
+
"language": "console",
|
|
68189
|
+
"value": [
|
|
68190
|
+
""
|
|
68191
|
+
]
|
|
68192
|
+
},
|
|
68193
|
+
{
|
|
68194
|
+
"type": "text",
|
|
68195
|
+
"value": [
|
|
68196
|
+
"\t$ dbPath=\"dfs://test\"",
|
|
68197
|
+
"\t$ mydb=database(dbPath, VALUE, ['AMZN','NFLX', 'NVDA'])",
|
|
68198
|
+
"\t$ mydb.schema()",
|
|
68199
|
+
"",
|
|
68200
|
+
"\tdatabaseDir->dfs://test",
|
|
68201
|
+
"\tpartitionSchema->[NVDA,AMZN,NFLX]",
|
|
68202
|
+
"\tpartitionSites->",
|
|
68203
|
+
"\tpartitionTypeName->VALUE",
|
|
68204
|
+
"\tpartitionType->1",
|
|
68205
|
+
"\tatomic->TRANS",
|
|
68206
|
+
"",
|
|
68207
|
+
"\t$ setAtomicLevel(mydb, `CHUNK)",
|
|
68208
|
+
"\t$ mydb.schema()",
|
|
68209
|
+
"",
|
|
68210
|
+
"\tdatabaseDir->dfs://test",
|
|
68211
|
+
"\tpartitionSchema->[NVDA,AMZN,NFLX]",
|
|
68212
|
+
"\tpartitionSites->",
|
|
68213
|
+
"\tpartitionTypeName->VALUE",
|
|
68214
|
+
"\tpartitionType->1",
|
|
68215
|
+
"\tatomic->CHUNK"
|
|
68216
|
+
]
|
|
68217
|
+
}
|
|
68218
|
+
]
|
|
68219
|
+
}
|
|
68220
|
+
]
|
|
68221
|
+
},
|
|
65839
68222
|
"setCacheEngineMemSize": {
|
|
65840
68223
|
"title": "setCacheEngineMemSize",
|
|
65841
68224
|
"type": "command",
|
|
@@ -66016,7 +68399,7 @@
|
|
|
66016
68399
|
{
|
|
66017
68400
|
"type": "text",
|
|
66018
68401
|
"value": [
|
|
66019
|
-
"setIndexedMatrix!(X)
|
|
68402
|
+
"setIndexedMatrix!(X, [on=true])"
|
|
66020
68403
|
]
|
|
66021
68404
|
}
|
|
66022
68405
|
]
|
|
@@ -66028,7 +68411,9 @@
|
|
|
66028
68411
|
{
|
|
66029
68412
|
"type": "text",
|
|
66030
68413
|
"value": [
|
|
66031
|
-
"`X` is a matrix with row labels and column labels. Row labels and column labels must be monotonically increasing with no duplicate values."
|
|
68414
|
+
"`X` is a matrix with row labels and column labels. Row labels and column labels must be monotonically increasing with no duplicate values.",
|
|
68415
|
+
"",
|
|
68416
|
+
"`on` is a boolean value indicating the conversion between a matrix and an indexed matrix. The default value is true, indicating the conversion from a matrix to an indexed matrix. Set to false for the opposite conversion."
|
|
66032
68417
|
]
|
|
66033
68418
|
}
|
|
66034
68419
|
]
|
|
@@ -66040,9 +68425,7 @@
|
|
|
66040
68425
|
{
|
|
66041
68426
|
"type": "text",
|
|
66042
68427
|
"value": [
|
|
66043
|
-
"Set the labels of the rows and columns of a matrix as the indexes."
|
|
66044
|
-
"",
|
|
66045
|
-
"The function was released in version 1.30.0."
|
|
68428
|
+
"Set the labels of the rows and columns of a matrix as the indexes."
|
|
66046
68429
|
]
|
|
66047
68430
|
}
|
|
66048
68431
|
]
|
|
@@ -66079,7 +68462,8 @@
|
|
|
66079
68462
|
"|2020.01.05|5 |15 |",
|
|
66080
68463
|
"+----------+---+---+ ",
|
|
66081
68464
|
"",
|
|
66082
|
-
"",
|
|
68465
|
+
".. meta:: ",
|
|
68466
|
+
" :keywords: set",
|
|
66083
68467
|
"",
|
|
66084
68468
|
"",
|
|
66085
68469
|
""
|
|
@@ -66100,7 +68484,7 @@
|
|
|
66100
68484
|
{
|
|
66101
68485
|
"type": "text",
|
|
66102
68486
|
"value": [
|
|
66103
|
-
"setIndexedSeries!(X)"
|
|
68487
|
+
"setIndexedSeries!(X, [on=true])"
|
|
66104
68488
|
]
|
|
66105
68489
|
}
|
|
66106
68490
|
]
|
|
@@ -66112,7 +68496,9 @@
|
|
|
66112
68496
|
{
|
|
66113
68497
|
"type": "text",
|
|
66114
68498
|
"value": [
|
|
66115
|
-
"`X` is a matrix with row labels and only one column. The row labels must be monotonically increasing with no duplicate values."
|
|
68499
|
+
"`X` is a matrix with row labels and only one column. The row labels must be monotonically increasing with no duplicate values.",
|
|
68500
|
+
"",
|
|
68501
|
+
"`on` is a boolean value indicating the conversion between a matrix and an indexed series. The default value is true, indicating the conversion from a matrix to an indexed series. Set to false for the opposite conversion."
|
|
66116
68502
|
]
|
|
66117
68503
|
}
|
|
66118
68504
|
]
|
|
@@ -66169,7 +68555,10 @@
|
|
|
66169
68555
|
"|2012.01.09|9 |",
|
|
66170
68556
|
"+----------+------+",
|
|
66171
68557
|
"|2012.01.10|10 |",
|
|
66172
|
-
"+----------+------+"
|
|
68558
|
+
"+----------+------+",
|
|
68559
|
+
"",
|
|
68560
|
+
".. meta:: ",
|
|
68561
|
+
" :keywords: set"
|
|
66173
68562
|
]
|
|
66174
68563
|
}
|
|
66175
68564
|
]
|
|
@@ -71721,6 +74110,28 @@
|
|
|
71721
74110
|
"title": "subscribeTable",
|
|
71722
74111
|
"type": "function",
|
|
71723
74112
|
"children": [
|
|
74113
|
+
{
|
|
74114
|
+
"title": "Details",
|
|
74115
|
+
"type": "detail",
|
|
74116
|
+
"children": [
|
|
74117
|
+
{
|
|
74118
|
+
"type": "text",
|
|
74119
|
+
"value": [
|
|
74120
|
+
"Subscribe to a stream table on a local or remote server from a client node. We can also specify a function to process the subscribed data.",
|
|
74121
|
+
"",
|
|
74122
|
+
"Return the subscription topic, which is a combination of the alias of the node where the stream table is located, stream table name, and the subscription task name (if actionName is specified) separated by \"_\". If the subscription topic already exists, the function throws an exception.",
|
|
74123
|
+
"",
|
|
74124
|
+
"* If *batchSize* is specified, *handler* will be triggered if either the number of unprocessed messages reaches *batchSize* or the duration of time since the last time handler was triggered reaches *throttle* seconds.",
|
|
74125
|
+
"",
|
|
74126
|
+
"* If the subscribed table is overwritten, to keep the subscription we need to cancel the subscription with command :doc:`/FunctionsandCommands/CommandsReferences/u/unsubscribeTable` and then subscribe to the new table.",
|
|
74127
|
+
"",
|
|
74128
|
+
"* With the high availability subscription enabled, a leader switch or cluster restart in the raft group of subscribers may log off a user. Since guests have no privilege to write to a DFS table, the writing will be interrupted (the current user can be identified by function :doc:`../g/getCurrentSessionAndUser`). If parameters userId and password are specified, the system will attempt to log in after the user is logged out accidentally to make sure the subscribed data can be written to a DFS table.",
|
|
74129
|
+
"",
|
|
74130
|
+
"Please note that the parameter handler of function subscribeTable should be function appendForJoin, :doc:`/FunctionsandCommands/FunctionReferences/g/getLeftStream` or :doc:`/FunctionsandCommands/FunctionReferences/g/getRightStream` while subscribing to a stream table for the streaming join engine."
|
|
74131
|
+
]
|
|
74132
|
+
}
|
|
74133
|
+
]
|
|
74134
|
+
},
|
|
71724
74135
|
{
|
|
71725
74136
|
"title": "Syntax",
|
|
71726
74137
|
"type": "grammer",
|
|
@@ -71756,7 +74167,7 @@
|
|
|
71756
74167
|
"",
|
|
71757
74168
|
"`batchSize` an integer indicating the number of unprocessed messages to trigger the handler. If it is positive, the handler does not process messages until the number of unprocessed messages reaches batchSize. If it is unspecified or non-positive, the handler processes incoming messages as soon as they come in.",
|
|
71758
74169
|
"",
|
|
71759
|
-
"`throttle` a
|
|
74170
|
+
"`throttle` is a floating point number in seconds, indicating the maximum waiting time before the handler processes the incoming messages if the batchSize condition has not been reached. The default value is 1. This optional parameter has no effect if batchSize is not specified. To set If throttle is less than 1 second, you need to modify the configuration parameter subThrottle first.",
|
|
71760
74171
|
"",
|
|
71761
74172
|
"`hash` a hash value (a nonnegative integer) indicating which subscription executor will process the incoming messages for this subscription. If it is unspecified, the system automatically assigns an executor. When we need to keep the messages synchronized from multiple subscriptions, we can set hash of all these subscriptions to be the same, so that the same executor is used to synchronize multiple data sources.",
|
|
71762
74173
|
"",
|
|
@@ -71792,29 +74203,13 @@
|
|
|
71792
74203
|
"",
|
|
71793
74204
|
"`handlerNeedMsgId` a Boolean value. If it is true, the parameter handler must support 2 parameters: msgBody and msgId; if it is false, the parameter handler must support just 1 parameter: msgBody. The default value is false.",
|
|
71794
74205
|
"",
|
|
71795
|
-
"`raftGroup`
|
|
71796
|
-
"",
|
|
71797
|
-
"Note: The function ``subscribeTable`` can only be executed on a leader node if the parameter *raftGroup* is set. If handlerNeedMsgId is also set to true while *raftGroup* = true, then the handler must be the handler of a stream engine (you can obtain the handler when you create the engine or obtain it with the function “getStreamEngine(engineName)”."
|
|
71798
|
-
]
|
|
71799
|
-
}
|
|
71800
|
-
]
|
|
71801
|
-
},
|
|
71802
|
-
{
|
|
71803
|
-
"title": "Details",
|
|
71804
|
-
"type": "detail",
|
|
71805
|
-
"children": [
|
|
71806
|
-
{
|
|
71807
|
-
"type": "text",
|
|
71808
|
-
"value": [
|
|
71809
|
-
"Subscribe to a stream table on a local or remote server from a client node. We can also specify a function to process the subscribed data.",
|
|
71810
|
-
"",
|
|
71811
|
-
"Return the subscription topic, which is a combination of the alias of the node where the stream table is located, stream table name, and the subscription task name (if actionName is specified) separated by \"_\". If the subscription topic already exists, the function throws an exception.",
|
|
74206
|
+
"`raftGroup` the ID of raft group used to enable high availability on the subscriber. If the leader node of a raft group is changed after setting the parameter *raftGroup*, the new leader will resubscribe to the stream table.",
|
|
71812
74207
|
"",
|
|
71813
|
-
"
|
|
74208
|
+
"Note: The function ``subscribeTable`` can only be executed on a leader node if the parameter *raftGroup* is set. If handlerNeedMsgId is also set to true while *raftGroup* = true, then the handler must be the handler of a stream engine (you can obtain the handler when you create the engine or obtain it with the function “getStreamEngine(engineName)”.",
|
|
71814
74209
|
"",
|
|
71815
|
-
"
|
|
74210
|
+
"`userId` a string indicating a user name.",
|
|
71816
74211
|
"",
|
|
71817
|
-
"
|
|
74212
|
+
"`password` a string indicating the password."
|
|
71818
74213
|
]
|
|
71819
74214
|
}
|
|
71820
74215
|
]
|
|
@@ -72764,6 +75159,63 @@
|
|
|
72764
75159
|
}
|
|
72765
75160
|
]
|
|
72766
75161
|
},
|
|
75162
|
+
"suspendRecovery": {
|
|
75163
|
+
"title": "suspendRecovery",
|
|
75164
|
+
"type": "command",
|
|
75165
|
+
"children": [
|
|
75166
|
+
{
|
|
75167
|
+
"title": "Syntax",
|
|
75168
|
+
"type": "grammer",
|
|
75169
|
+
"children": [
|
|
75170
|
+
{
|
|
75171
|
+
"type": "text",
|
|
75172
|
+
"value": [
|
|
75173
|
+
"suspendRecovery()"
|
|
75174
|
+
]
|
|
75175
|
+
}
|
|
75176
|
+
]
|
|
75177
|
+
},
|
|
75178
|
+
{
|
|
75179
|
+
"title": "Arguments",
|
|
75180
|
+
"type": "parameters",
|
|
75181
|
+
"children": [
|
|
75182
|
+
{
|
|
75183
|
+
"type": "text",
|
|
75184
|
+
"value": [
|
|
75185
|
+
"None"
|
|
75186
|
+
]
|
|
75187
|
+
}
|
|
75188
|
+
]
|
|
75189
|
+
},
|
|
75190
|
+
{
|
|
75191
|
+
"title": "Details",
|
|
75192
|
+
"type": "detail",
|
|
75193
|
+
"children": [
|
|
75194
|
+
{
|
|
75195
|
+
"type": "text",
|
|
75196
|
+
"value": [
|
|
75197
|
+
"Suspend online node recovery processes. When this command is executed, tasks in \"In-Progress\" status will continue to recover and processes in \"Waiting\" status will be suspended. Once suspended, the source node can continue to receive new data. This command can only be executed by the administrator on the controller.",
|
|
75198
|
+
"",
|
|
75199
|
+
"Note: For high-availability clusters, this command must be executed on every node in the raft group."
|
|
75200
|
+
]
|
|
75201
|
+
}
|
|
75202
|
+
]
|
|
75203
|
+
},
|
|
75204
|
+
{
|
|
75205
|
+
"title": "First Release",
|
|
75206
|
+
"children": [
|
|
75207
|
+
{
|
|
75208
|
+
"type": "text",
|
|
75209
|
+
"value": [
|
|
75210
|
+
"1.30.16、2.00.4",
|
|
75211
|
+
"",
|
|
75212
|
+
"Related command: :doc:`../r/resumeRecovery`"
|
|
75213
|
+
]
|
|
75214
|
+
}
|
|
75215
|
+
]
|
|
75216
|
+
}
|
|
75217
|
+
]
|
|
75218
|
+
},
|
|
72767
75219
|
"svd": {
|
|
72768
75220
|
"title": "svd",
|
|
72769
75221
|
"type": "function",
|
|
@@ -77639,15 +80091,15 @@
|
|
|
77639
80091
|
"",
|
|
77640
80092
|
"`ignoreNull` is a Boolean value. If set to true, for the NULL values in newData, the correponding elements in obj are not updated. The default value is false.",
|
|
77641
80093
|
"",
|
|
77642
|
-
"`keyColNames` is a STRING scalar/vector
|
|
80094
|
+
"`keyColNames` is a STRING scalar/vector. When *obj* is a DFS table, *keyColNames* are considered as the key columns.",
|
|
77643
80095
|
"",
|
|
77644
80096
|
"`sortColumns` is a STRING scalar or vector. The updated partitions will be sorted on sortColumns (only within each partition, not across partitions).",
|
|
77645
80097
|
"",
|
|
77646
80098
|
"Please note:",
|
|
77647
80099
|
"",
|
|
77648
|
-
"\\1. To specify sortColumns
|
|
80100
|
+
"\\1. To specify *sortColumns*, obj must be a DFS table.",
|
|
77649
80101
|
"",
|
|
77650
|
-
"\\2. When *obj* is an empty table, setting sortColumns has no effect. That is, the system will not sort the inserted data."
|
|
80102
|
+
"\\2. When *obj* is an empty table, setting *sortColumns* has no effect. That is, the system will not sort the inserted data."
|
|
77651
80103
|
]
|
|
77652
80104
|
}
|
|
77653
80105
|
]
|
|
@@ -77659,7 +80111,12 @@
|
|
|
77659
80111
|
{
|
|
77660
80112
|
"type": "text",
|
|
77661
80113
|
"value": [
|
|
77662
|
-
"Insert rows into a keyed table or indexed table if the values of the primary key do not already exist, or update them if they do.
|
|
80114
|
+
"Insert rows into a keyed table or indexed table if the values of the primary key do not already exist, or update them if they do. ",
|
|
80115
|
+
"",
|
|
80116
|
+
"Note:",
|
|
80117
|
+
"",
|
|
80118
|
+
"- When using this function, please make sure the corresponding columns in table *newData* and *obj* are arranged in the same order, or the system may generate the wrong result or throw an error. ",
|
|
80119
|
+
"- If obj is a DFS table with duplicated \"keys\" (as specified by keyColNames), ``upsert!`` on rows with duplicated keys only updates the first row."
|
|
77663
80120
|
]
|
|
77664
80121
|
}
|
|
77665
80122
|
]
|
|
@@ -77749,7 +80206,7 @@
|
|
|
77749
80206
|
"======= ========== === ====",
|
|
77750
80207
|
"",
|
|
77751
80208
|
"",
|
|
77752
|
-
"The example above is for the case when *ignoreNull* =true. Compare it with the following example where *ignoreNull* =
|
|
80209
|
+
"The example above is for the case when *ignoreNull* = true. Compare it with the following example where *ignoreNull* = false (by default).",
|
|
77753
80210
|
""
|
|
77754
80211
|
]
|
|
77755
80212
|
},
|
|
@@ -80735,22 +83192,20 @@
|
|
|
80735
83192
|
{
|
|
80736
83193
|
"type": "text",
|
|
80737
83194
|
"value": [
|
|
80738
|
-
"`HL` is a numeric vector or a numeric matrix
|
|
83195
|
+
"`HL` is a numeric vector or a numeric matrix with two columns.",
|
|
80739
83196
|
"",
|
|
80740
|
-
"`change` is the minimum
|
|
83197
|
+
"`change` is the minimum threshold for extreme value movement.",
|
|
80741
83198
|
"",
|
|
80742
|
-
"`percent` is a
|
|
83199
|
+
"`percent` is a Boolean value indicating whether *change* is used as a percentage.",
|
|
80743
83200
|
"",
|
|
80744
|
-
"`retrace` is a
|
|
83201
|
+
"`retrace` is a Boolean value. The default value is false.",
|
|
80745
83202
|
"",
|
|
80746
|
-
" * true:
|
|
80747
|
-
" * false:
|
|
83203
|
+
" * true: *change* represents a retracement of the previous move.",
|
|
83204
|
+
" * false: *change* represents the change between the extreme points.",
|
|
80748
83205
|
"",
|
|
80749
|
-
"
|
|
83206
|
+
"Note: If *percent*=false, *retrace* can only take “false”. Setting it to true has no effect.",
|
|
80750
83207
|
"",
|
|
80751
|
-
"
|
|
80752
|
-
" * false: select the first point",
|
|
80753
|
-
""
|
|
83208
|
+
"`lastExtreme` is a boolean value indicating whether to output the last point if multiple consecutive points have the same value. The default value is true."
|
|
80754
83209
|
]
|
|
80755
83210
|
}
|
|
80756
83211
|
]
|
|
@@ -80762,8 +83217,9 @@
|
|
|
80762
83217
|
{
|
|
80763
83218
|
"type": "text",
|
|
80764
83219
|
"value": [
|
|
80765
|
-
"
|
|
80766
|
-
""
|
|
83220
|
+
"``zigzag`` is mainly used to filter values with smaller movements in *HL*. Only extreme points that satisfy the conditions will be output.",
|
|
83221
|
+
"",
|
|
83222
|
+
"If *HL* is a vector, return a vector with the same length as *HL*; if *HL* is a matrix, return a vector with the same number of rows as *HL*."
|
|
80767
83223
|
]
|
|
80768
83224
|
}
|
|
80769
83225
|
]
|