dolphindb 2.0.916 → 2.0.917
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs.en.json +90 -26
- package/docs.zh.json +112 -126
- package/package.json +1 -1
package/docs.en.json
CHANGED
|
@@ -30983,7 +30983,7 @@
|
|
|
30983
30983
|
{
|
|
30984
30984
|
"type": "text",
|
|
30985
30985
|
"value": [
|
|
30986
|
-
"getJobMessage(
|
|
30986
|
+
"getJobMessage(jobId)",
|
|
30987
30987
|
""
|
|
30988
30988
|
]
|
|
30989
30989
|
}
|
|
@@ -30996,7 +30996,7 @@
|
|
|
30996
30996
|
{
|
|
30997
30997
|
"type": "text",
|
|
30998
30998
|
"value": [
|
|
30999
|
-
"`
|
|
30999
|
+
"`jobId` is a batch job ID.",
|
|
31000
31000
|
""
|
|
31001
31001
|
]
|
|
31002
31002
|
}
|
|
@@ -31097,7 +31097,7 @@
|
|
|
31097
31097
|
{
|
|
31098
31098
|
"type": "text",
|
|
31099
31099
|
"value": [
|
|
31100
|
-
"getJobReturn(
|
|
31100
|
+
"getJobReturn(jobId, [blocking=false])",
|
|
31101
31101
|
""
|
|
31102
31102
|
]
|
|
31103
31103
|
}
|
|
@@ -31110,7 +31110,7 @@
|
|
|
31110
31110
|
{
|
|
31111
31111
|
"type": "text",
|
|
31112
31112
|
"value": [
|
|
31113
|
-
"`
|
|
31113
|
+
"`jobId` is a batch job ID.",
|
|
31114
31114
|
"",
|
|
31115
31115
|
"`blocking` is a Boolean value indicating whether the blocking mode is enabled. If blocking is false, the function will return an exception if the job is not completed. If blocking is true, the function will not return a value until the job is completed. The default value is false.",
|
|
31116
31116
|
""
|
|
@@ -31284,7 +31284,7 @@
|
|
|
31284
31284
|
{
|
|
31285
31285
|
"type": "text",
|
|
31286
31286
|
"value": [
|
|
31287
|
-
"getJobStatus(
|
|
31287
|
+
"getJobStatus(jobId)"
|
|
31288
31288
|
]
|
|
31289
31289
|
}
|
|
31290
31290
|
]
|
|
@@ -31296,7 +31296,7 @@
|
|
|
31296
31296
|
{
|
|
31297
31297
|
"type": "text",
|
|
31298
31298
|
"value": [
|
|
31299
|
-
"`
|
|
31299
|
+
"`jobId` is the batch job ID."
|
|
31300
31300
|
]
|
|
31301
31301
|
}
|
|
31302
31302
|
]
|
|
@@ -65494,10 +65494,10 @@
|
|
|
65494
65494
|
"",
|
|
65495
65495
|
"`tiesMethod` is a string indicating how to rank the group of elements with the same value (i.e., ties):",
|
|
65496
65496
|
"",
|
|
65497
|
-
"
|
|
65498
|
-
"
|
|
65499
|
-
"
|
|
65500
|
-
"
|
|
65497
|
+
"- 'min' : Gives all ties the smallest rank value of the tie values.",
|
|
65498
|
+
"- 'max' : Gives all ties the largest rank value of the tie values. ",
|
|
65499
|
+
"- 'average' : Gives all ties the average of the rank values for all ties. ",
|
|
65500
|
+
"- 'first': Gives the first found tie value the lowest rank value, and continues with the following rank value for the next tie. ",
|
|
65501
65501
|
"",
|
|
65502
65502
|
"`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.",
|
|
65503
65503
|
"",
|
|
@@ -65557,13 +65557,15 @@
|
|
|
65557
65557
|
" $ rank(X=1 2 2 3, tiesMethod='average');",
|
|
65558
65558
|
" [0,1.5,1.5,3]",
|
|
65559
65559
|
"",
|
|
65560
|
+
" $ rank(X=1 2 2 3, tiesMethod='first');",
|
|
65561
|
+
" [0,1,2,3]",
|
|
65562
|
+
"",
|
|
65560
65563
|
" $ rank(1 NULL NULL 3);",
|
|
65561
65564
|
" [0,,,1]",
|
|
65562
65565
|
"",
|
|
65563
65566
|
" $ rank(X=1 NULL NULL 3, ignoreNA=false);",
|
|
65564
65567
|
" [2,0,0,3]",
|
|
65565
65568
|
"",
|
|
65566
|
-
" $ t=table(1 1 1 2 2 2 2 as id, 3 5 4 6 2 7 1 as x);",
|
|
65567
65569
|
" $ t=table(1 1 1 2 2 2 2 as id, 3 5 4 6 2 7 1 as x)",
|
|
65568
65570
|
" $ t",
|
|
65569
65571
|
""
|
|
@@ -67458,6 +67460,18 @@
|
|
|
67458
67460
|
}
|
|
67459
67461
|
]
|
|
67460
67462
|
},
|
|
67463
|
+
{
|
|
67464
|
+
"title": "Details",
|
|
67465
|
+
"type": "detail",
|
|
67466
|
+
"children": [
|
|
67467
|
+
{
|
|
67468
|
+
"type": "text",
|
|
67469
|
+
"value": [
|
|
67470
|
+
"Send a script or function to a remote database for execution."
|
|
67471
|
+
]
|
|
67472
|
+
}
|
|
67473
|
+
]
|
|
67474
|
+
},
|
|
67461
67475
|
{
|
|
67462
67476
|
"title": "Examples",
|
|
67463
67477
|
"type": "example",
|
|
@@ -72845,10 +72859,10 @@
|
|
|
72845
72859
|
"",
|
|
72846
72860
|
"`tiesMethod` is a string indicating how to rank the group of elements with the same value (i.e., ties):",
|
|
72847
72861
|
"",
|
|
72848
|
-
"
|
|
72849
|
-
"
|
|
72850
|
-
"
|
|
72851
|
-
"
|
|
72862
|
+
"- 'min' : Gives all ties the smallest rank value of the tie values.",
|
|
72863
|
+
"- 'max' : Gives all ties the largest rank value of the tie values. ",
|
|
72864
|
+
"- 'average' : Gives all ties the average of the rank values for all ties. ",
|
|
72865
|
+
"- 'first': Gives the first found tie value the lowest rank value, and continues with the following rank value for the next tie. ",
|
|
72852
72866
|
"",
|
|
72853
72867
|
"`percent` is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.",
|
|
72854
72868
|
"",
|
|
@@ -73005,6 +73019,28 @@
|
|
|
73005
73019
|
"2 0 1 3 6 5 8 7 4",
|
|
73006
73020
|
"8 0 2 4 5 6 4 2 7",
|
|
73007
73021
|
"== == == == == == == == == ",
|
|
73022
|
+
""
|
|
73023
|
+
]
|
|
73024
|
+
},
|
|
73025
|
+
{
|
|
73026
|
+
"type": "code",
|
|
73027
|
+
"language": "console",
|
|
73028
|
+
"value": [
|
|
73029
|
+
"",
|
|
73030
|
+
" $ m.rowRank(ignoreNA=false, tiesMethod='first');",
|
|
73031
|
+
""
|
|
73032
|
+
]
|
|
73033
|
+
},
|
|
73034
|
+
{
|
|
73035
|
+
"type": "text",
|
|
73036
|
+
"value": [
|
|
73037
|
+
"+------+------+------+------+------+------+------+------+------+",
|
|
73038
|
+
"| col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 |",
|
|
73039
|
+
"+======+======+======+======+======+======+======+======+======+",
|
|
73040
|
+
"| 2 | 0 | 1 | 3 | 6 | 5 | 8 | 7 | 4 |",
|
|
73041
|
+
"+------+------+------+------+------+------+------+------+------+",
|
|
73042
|
+
"| 8 | 0 | 1 | 3 | 5 | 6 | 4 | 2 | 7 |",
|
|
73043
|
+
"+------+------+------+------+------+------+------+------+------+",
|
|
73008
73044
|
"",
|
|
73009
73045
|
"Related functions: :doc:`rowDenseRank`, :doc:`../r/rank`",
|
|
73010
73046
|
"",
|
|
@@ -77783,7 +77819,7 @@
|
|
|
77783
77819
|
{
|
|
77784
77820
|
"type": "text",
|
|
77785
77821
|
"value": [
|
|
77786
|
-
"setRetentionPolicy(
|
|
77822
|
+
"setRetentionPolicy(dbHandle, retentionHours, [retentionDimension], [hoursToColdVolume])"
|
|
77787
77823
|
]
|
|
77788
77824
|
}
|
|
77789
77825
|
]
|
|
@@ -77799,7 +77835,11 @@
|
|
|
77799
77835
|
"",
|
|
77800
77836
|
"`retentionHours` is a positive integer indicating the number of hours that data are kept.",
|
|
77801
77837
|
"",
|
|
77802
|
-
"`retentionDimension` is an integer indicating the layer of the temporal partition. The default value is 0 indicating the first layer of a COMPO partition is a temporal partition."
|
|
77838
|
+
"`retentionDimension` is an integer indicating the layer of the temporal partition. The default value is 0 indicating the first layer of a COMPO partition is a temporal partition.",
|
|
77839
|
+
"",
|
|
77840
|
+
"`hoursToColdVolume` is a positive integer indicating the number of hours that data are kept in volumes. Data stored in volumes will be migrated to the specified coldVolumes (configuration parameter) after hoursToColdVolume.",
|
|
77841
|
+
"",
|
|
77842
|
+
"Note: Make sure that retentionHours - hoursToColdVolume > 7 * 24 (7 days)."
|
|
77803
77843
|
]
|
|
77804
77844
|
}
|
|
77805
77845
|
]
|
|
@@ -77811,9 +77851,15 @@
|
|
|
77811
77851
|
{
|
|
77812
77852
|
"type": "text",
|
|
77813
77853
|
"value": [
|
|
77814
|
-
"Set the
|
|
77854
|
+
"Set the policy of data retention and tiered storage. The parameter retentionHours should be specified as large as possible for tiered storage to avoid deleting any data.",
|
|
77815
77855
|
"",
|
|
77816
|
-
"
|
|
77856
|
+
"Both data retention and tiered storage are partition-based. Therefore, the interval configured by retentionHours and hoursToColdVolume must be divisible by the granularity of the partition.",
|
|
77857
|
+
"",
|
|
77858
|
+
"The system will keep the data with the timestamp of the last retentionHours based on the system time: Data of the last hoursToColdVolume are stored in volumes; Data in [current time - hoursToColdVolumes - checkRange, current time - hoursToColdVolumes) are migrated to coldVolumes. If multiple paths are specified for coldVolumes, the data will be transferred randomly to one of the specified directories.",
|
|
77859
|
+
"",
|
|
77860
|
+
"For other data, only data in the range of [current time - retentionHours - 10 days, current time - retentionHours) are deleted. To delete the data outside the range, you can call function ``dropPartition``.",
|
|
77861
|
+
"",
|
|
77862
|
+
"Note: The function is only applied to a DFS database."
|
|
77817
77863
|
]
|
|
77818
77864
|
}
|
|
77819
77865
|
]
|
|
@@ -77828,15 +77874,30 @@
|
|
|
77828
77874
|
"value": [
|
|
77829
77875
|
"",
|
|
77830
77876
|
" $ db=database(\"dfs://db1\",VALUE,2019.06.01..date(now()))",
|
|
77831
|
-
" $ retentionHour=
|
|
77832
|
-
" $
|
|
77877
|
+
" $ retentionHour=9*24",
|
|
77878
|
+
" $ hoursToColdVolume=1*24",
|
|
77879
|
+
" $ setRetentionPolicy(db,retentionHour,0, hoursToColdVolume);",
|
|
77833
77880
|
"",
|
|
77834
77881
|
" $ schema(db);",
|
|
77835
|
-
" partitionSchema->[
|
|
77836
|
-
" databaseDir->dfs://db1",
|
|
77882
|
+
" partitionSchema->[2022.05.05,2022.05.04,2022.05.03,2022.05.02,2022.05.01,2022.04.30,2022.04.29,2022.04.28,2022.04.27,2022.04.26,...]",
|
|
77837
77883
|
" partitionSites->",
|
|
77884
|
+
" partitionTypeName->VALUE",
|
|
77885
|
+
" hoursToColdVolume->24",
|
|
77886
|
+
" atomic->TRANS",
|
|
77887
|
+
" databaseDir->dfs://db1",
|
|
77888
|
+
" engineType->OLAP",
|
|
77889
|
+
" chunkGranularity->TABLE",
|
|
77838
77890
|
" retentionDimension->0",
|
|
77839
|
-
"
|
|
77891
|
+
" partitionType->1",
|
|
77892
|
+
" retentionHours->216",
|
|
77893
|
+
""
|
|
77894
|
+
]
|
|
77895
|
+
},
|
|
77896
|
+
{
|
|
77897
|
+
"type": "text",
|
|
77898
|
+
"value": [
|
|
77899
|
+
".. meta:: ",
|
|
77900
|
+
" :keywords: set"
|
|
77840
77901
|
]
|
|
77841
77902
|
}
|
|
77842
77903
|
]
|
|
@@ -83449,7 +83510,7 @@
|
|
|
83449
83510
|
{
|
|
83450
83511
|
"type": "text",
|
|
83451
83512
|
"value": [
|
|
83452
|
-
"
|
|
83513
|
+
"use function ``remoteRun`` or ``remoteRunWithCompression``. For example:",
|
|
83453
83514
|
""
|
|
83454
83515
|
]
|
|
83455
83516
|
},
|
|
@@ -83671,7 +83732,10 @@
|
|
|
83671
83732
|
"",
|
|
83672
83733
|
"`persistOffset` a Boolean value indicating whether to persist the offset of the last processed message in the current subscription. It is used for resubscription and can be obtained with function :doc:`../g/getTopicProcessedOffset`. The default value is false.",
|
|
83673
83734
|
"",
|
|
83674
|
-
"Note:
|
|
83735
|
+
"Note: ",
|
|
83736
|
+
"",
|
|
83737
|
+
"- To subscribe to a high-availability stream table, the parameter *persistOffset* should be set to true to prevent data loss on the subscriber.",
|
|
83738
|
+
"- To resubscribe from the persisted offset, set *persistOffset* to true and *removeOffset* of function ``unsubscribeTable`` to false.",
|
|
83675
83739
|
"",
|
|
83676
83740
|
"`timeTrigger` a Boolean value. If it is set to true, handler is triggered at the intervals specified by parameter throttle even if no new messages arrive. The default value is false.",
|
|
83677
83741
|
"",
|
package/docs.zh.json
CHANGED
|
@@ -1706,7 +1706,7 @@
|
|
|
1706
1706
|
"language": "console",
|
|
1707
1707
|
"value": [
|
|
1708
1708
|
"",
|
|
1709
|
-
" $ addVolumes(\"
|
|
1709
|
+
" $ addVolumes(\"/home/dolphindb/data\")",
|
|
1710
1710
|
""
|
|
1711
1711
|
]
|
|
1712
1712
|
},
|
|
@@ -6867,7 +6867,7 @@
|
|
|
6867
6867
|
"language": "console",
|
|
6868
6868
|
"value": [
|
|
6869
6869
|
"",
|
|
6870
|
-
" $ PTNDB_DIR = \"
|
|
6870
|
+
" $ PTNDB_DIR = \"/home/db_testing\"",
|
|
6871
6871
|
" $ dbName = database(PTNDB_DIR + \"/NYSETAQByName\")",
|
|
6872
6872
|
" $ Trades = dbName.loadTable(`Trades)",
|
|
6873
6873
|
"",
|
|
@@ -6929,7 +6929,7 @@
|
|
|
6929
6929
|
"language": "console",
|
|
6930
6930
|
"value": [
|
|
6931
6931
|
"",
|
|
6932
|
-
" $ PTNDB_DIR = \"
|
|
6932
|
+
" $ PTNDB_DIR = \"/home/db_testing\"",
|
|
6933
6933
|
" $ dbName = database(PTNDB_DIR + \"/NYSETAQByName\")",
|
|
6934
6934
|
" $ Trades = dbName.loadTable(`Trades)",
|
|
6935
6935
|
"",
|
|
@@ -9708,7 +9708,7 @@
|
|
|
9708
9708
|
"language": "console",
|
|
9709
9709
|
"value": [
|
|
9710
9710
|
" ",
|
|
9711
|
-
" $ PTNDB_DIR = \"
|
|
9711
|
+
" $ PTNDB_DIR = \"/home/db_testing\"",
|
|
9712
9712
|
" $ dbName = database(PTNDB_DIR + \"/NYSETAQByName\")",
|
|
9713
9713
|
" $ Trades = dbName.loadTable(`Trades)",
|
|
9714
9714
|
" ",
|
|
@@ -9770,7 +9770,7 @@
|
|
|
9770
9770
|
"language": "console",
|
|
9771
9771
|
"value": [
|
|
9772
9772
|
" ",
|
|
9773
|
-
" $ PTNDB_DIR = \"
|
|
9773
|
+
" $ PTNDB_DIR = \"/home/db_testing\"",
|
|
9774
9774
|
" $ dbName = database(PTNDB_DIR + \"/NYSETAQByName\")",
|
|
9775
9775
|
" $ Trades = dbName.loadTable(`Trades)",
|
|
9776
9776
|
" ",
|
|
@@ -12887,7 +12887,7 @@
|
|
|
12887
12887
|
"value": [
|
|
12888
12888
|
"创建流数据 asof join 引擎。返回一个左、右两表 as join 后的表对象。注入 asof join 引擎的左、右两表将以 :ref:`matchingColumn <mc_aj>` + :ref:`timeColumn <tc_aj>` (或系统时间) 作为连接列,在右表中选取与连接列匹配的,在给定的左表时间戳前且最接近的记录。该引擎适用于两个数据源没有完全匹配的记录,需要按时间段作连接,以获取最新信息的场景。",
|
|
12889
12889
|
"",
|
|
12890
|
-
"注意:asof join
|
|
12890
|
+
"注意:asof join 左表和右表的数据必须按照时间顺序排序。",
|
|
12891
12891
|
"",
|
|
12892
12892
|
"* 如果没有指定 :ref:`delayedTime <delayedTime_aj>`,则当右表数据的最新时间大于左表数据的最新时间,才会触发 join, 计算输出。",
|
|
12893
12893
|
"* 如果指定了 :ref:`delayedTime <delayedTime_aj>`,则当左表中数据最新时间与上一条未计算的时间差大于 *delayedTime* 设置值,或者左表中数据在经过 2 \\* *delayedTime* (小于2秒按2秒计算)后还没有 join 输出,就直接触发左右两表 join。",
|
|
@@ -14734,13 +14734,7 @@
|
|
|
14734
14734
|
"如果参数 *table* 是一个表,则根据该表的结构创建一个分区表。通过 :doc:`../a/append!` 或 :doc:`../t/tableInsert` 给新创建的分区表插入数据。它不能用于创建顺序分区的分区表。",
|
|
14735
14735
|
"",
|
|
14736
14736
|
"如果参数 *table* 是一系列表,则创建一个分区的内存表。参数 *table* 中表的数量与数据库中分区的数量相同。",
|
|
14737
|
-
""
|
|
14738
|
-
"注意:",
|
|
14739
|
-
"",
|
|
14740
|
-
"* 创建分区表时只会使用参数 *table* 的结构,并不会把 *table* 中的数据插入到新的分区表中。",
|
|
14741
|
-
"* 允许集群每个节点创建的不同的分布式分区表句柄(包含临时句柄)上限为 8192。临时句柄的说明请参考注释。",
|
|
14742
|
-
"",
|
|
14743
|
-
"注释:调用函数 createPartitionedTable 创建分布式分区表时,若用户没有创建一个句柄变量来接收函数的返回值,则每个数据库会创建一个临时句柄。若在同一数据库下多次创表,则该数据库的临时句柄会被覆盖,即最多允许同时创建 8192 个包含分布式分区表的数据库。"
|
|
14737
|
+
""
|
|
14744
14738
|
]
|
|
14745
14739
|
}
|
|
14746
14740
|
]
|
|
@@ -15681,7 +15675,7 @@
|
|
|
15681
15675
|
" ",
|
|
15682
15676
|
"\\(1) 将窗口划分为多个长度为 *updateTime* 的小窗口,各个小窗口之间没有重叠。每个小窗口的计算将由窗口结束后的第一条数据触发。该次计算包括当前窗口内所有未参与计算的数据。注意:触发计算的数据不参与本次计算。",
|
|
15683
15677
|
"",
|
|
15684
|
-
"\\(2) 系统每经过 2 \\*
|
|
15678
|
+
"\\(2) 系统每经过 2 \\* updateTime(若 2 \\* updateTime 不足 2 秒,则设置为 2 秒)会检查是否有数据未参与计算,若仍有数据未参与计算,则会触发计算。本次计算包括触发计算时当前窗口内的所有数据。",
|
|
15685
15679
|
"",
|
|
15686
15680
|
"若分组计算,则每组内进行上述操作。",
|
|
15687
15681
|
"",
|
|
@@ -15914,7 +15908,7 @@
|
|
|
15914
15908
|
" >30s 1min",
|
|
15915
15909
|
" ============== =================",
|
|
15916
15910
|
"",
|
|
15917
|
-
"假设第一条数据的时间为 x, 那么根据其类型,第一个数据窗口的左边界的计算规则为:``timeType_cast(x/alignmentSize
|
|
15911
|
+
"假设第一条数据的时间为 x, 那么根据其类型,第一个数据窗口的左边界的计算规则为:``timeType_cast(x/alignmentSize*alignmentSize+step-windowSize)``。其中,timeType_cast 表示依据时间精度,需要强制转换的时间类型;'/' 表示整除。例如,第一条数据的时间为 2018.10.08T01:01:01.365,windowSize 为 120000,step 为 60000,那么 alignmentSize 为 60000,第一个数据窗口的左边界为 ``timestamp(2018.10.08T01:01:01.365/60000*60000+60000-120000)``,即 2018.10.08T01:00:00.000。 ",
|
|
15918
15912
|
""
|
|
15919
15913
|
]
|
|
15920
15914
|
}
|
|
@@ -21628,22 +21622,12 @@
|
|
|
21628
21622
|
{
|
|
21629
21623
|
"type": "text",
|
|
21630
21624
|
"value": [
|
|
21631
|
-
"组“production”中的所有成员不能访问数据库 ``dfs://db1`` 中的所有表:",
|
|
21632
|
-
""
|
|
21633
|
-
|
|
21634
|
-
|
|
21635
|
-
|
|
21636
|
-
"type": "code",
|
|
21637
|
-
"language": "console",
|
|
21638
|
-
"value": [
|
|
21625
|
+
".. 组“production”中的所有成员不能访问数据库 ``dfs://db1`` 中的所有表:",
|
|
21626
|
+
"",
|
|
21627
|
+
".. .. code:: console",
|
|
21628
|
+
"",
|
|
21629
|
+
".. $ deny(`production, TABLE_READ, \"dfs://db1\")",
|
|
21639
21630
|
"",
|
|
21640
|
-
" $ deny(`production, TABLE_READ, \"dfs://db1\")",
|
|
21641
|
-
""
|
|
21642
|
-
]
|
|
21643
|
-
},
|
|
21644
|
-
{
|
|
21645
|
-
"type": "text",
|
|
21646
|
-
"value": [
|
|
21647
21631
|
"组“research”中的所有成员都不能向表 ``dfs://db1/t1`` 中写入数据:",
|
|
21648
21632
|
""
|
|
21649
21633
|
]
|
|
@@ -26938,7 +26922,7 @@
|
|
|
26938
26922
|
{
|
|
26939
26923
|
"type": "text",
|
|
26940
26924
|
"value": [
|
|
26941
|
-
"`path`
|
|
26925
|
+
"`path` 字符串标量或向量,表示服务器端文件或文件夹的路径。"
|
|
26942
26926
|
]
|
|
26943
26927
|
}
|
|
26944
26928
|
]
|
|
@@ -26965,16 +26949,16 @@
|
|
|
26965
26949
|
"value": [
|
|
26966
26950
|
" ",
|
|
26967
26951
|
" $ t=table(1..10 as ID, rand(1.0, 10) as x);",
|
|
26968
|
-
" $ saveText(t, \"
|
|
26952
|
+
" $ saveText(t, \"/home/DolphinDB/Data/t.txt\");",
|
|
26969
26953
|
" ",
|
|
26970
|
-
" $ exists(\"
|
|
26954
|
+
" $ exists(\"/home/DolphinDB/Data/t.txt\");",
|
|
26971
26955
|
" 1",
|
|
26972
|
-
" $ exists(\"
|
|
26956
|
+
" $ exists(\"/home/DolphinDB/Data/t1.txt\");",
|
|
26973
26957
|
" 0",
|
|
26974
|
-
" $ exists(\"
|
|
26958
|
+
" $ exists(\"/home/DolphinDB/Data\");",
|
|
26975
26959
|
" 1",
|
|
26976
26960
|
"",
|
|
26977
|
-
" $ exists([\"
|
|
26961
|
+
" $ exists([\"/home/DolphinDB/Data/t.txt\",\"/home/DolphinDB/Data/t1.txt\",\"/home/DolphinDB/Data\"]);",
|
|
26978
26962
|
" [1,0,1]",
|
|
26979
26963
|
""
|
|
26980
26964
|
]
|
|
@@ -27066,14 +27050,14 @@
|
|
|
27066
27050
|
" $ x=rand(10.0, n)",
|
|
27067
27051
|
" $ t=table(ID, date, x)",
|
|
27068
27052
|
"",
|
|
27069
|
-
" $ db = database(\"
|
|
27053
|
+
" $ db = database(\"/home/DolphinDB/Data/valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
27070
27054
|
" $ pt = db.createPartitionedTable(t, `pt, `date);",
|
|
27071
27055
|
" $ pt.append!(t);",
|
|
27072
27056
|
"",
|
|
27073
|
-
" $ existsDatabase(\"
|
|
27057
|
+
" $ existsDatabase(\"/home/DolphinDB/Data/valueDB\");",
|
|
27074
27058
|
" 1",
|
|
27075
27059
|
"",
|
|
27076
|
-
" $ existsDatabase(\"
|
|
27060
|
+
" $ existsDatabase(\"/home/DolphinDB/Data/valueDB/20170807\");",
|
|
27077
27061
|
" 0",
|
|
27078
27062
|
"",
|
|
27079
27063
|
"检查分布式数据库是否存在:",
|
|
@@ -27364,17 +27348,17 @@
|
|
|
27364
27348
|
" $ x=rand(10.0, n)",
|
|
27365
27349
|
" $ t=table(ID, date, x)",
|
|
27366
27350
|
"",
|
|
27367
|
-
" $ db = database(\"
|
|
27351
|
+
" $ db = database(\"/home/DolphinDB/Data/valueDB\", VALUE, 2017.08.07..2017.08.11)",
|
|
27368
27352
|
" $ pt = db.createPartitionedTable(t, `pt, `date);",
|
|
27369
27353
|
" $ pt.append!(t);",
|
|
27370
27354
|
"",
|
|
27371
|
-
" $ existsTable(\"
|
|
27355
|
+
" $ existsTable(\"/home/DolphinDB/Data/valueDB\", `pt);",
|
|
27372
27356
|
" 1",
|
|
27373
27357
|
"",
|
|
27374
|
-
" $ existsTable(\"
|
|
27358
|
+
" $ existsTable(\"/home/DolphinDB/Data/valueDB/20170807\", `pt);",
|
|
27375
27359
|
" 1",
|
|
27376
27360
|
"",
|
|
27377
|
-
" $ existsTable(\"
|
|
27361
|
+
" $ existsTable(\"/home/DolphinDB/Data\", `pt);",
|
|
27378
27362
|
" 0",
|
|
27379
27363
|
"",
|
|
27380
27364
|
"检查分区是否在分布式文件系统中(以下脚本需要在集群的数据节点/计算节点中执行):",
|
|
@@ -27737,7 +27721,7 @@
|
|
|
27737
27721
|
{
|
|
27738
27722
|
"type": "text",
|
|
27739
27723
|
"value": [
|
|
27740
|
-
"`filename`
|
|
27724
|
+
"`filename` 字符串,表示输入数据的绝对路径或相对路径。",
|
|
27741
27725
|
"",
|
|
27742
27726
|
"`delimiter` 是表中列的分隔符。默认为逗号。",
|
|
27743
27727
|
"",
|
|
@@ -27773,8 +27757,8 @@
|
|
|
27773
27757
|
" $ qty=100*(1+rand(100,n))",
|
|
27774
27758
|
" $ price=5.0+rand(100.0,n)",
|
|
27775
27759
|
" $ t1 = table(timestamp,ID,qty,price)",
|
|
27776
|
-
" $ saveText(t1, \"
|
|
27777
|
-
" $ schema=extractTextSchema(\"
|
|
27760
|
+
" $ saveText(t1, \"/home/DolphinDB/Data/t1.txt\")",
|
|
27761
|
+
" $ schema=extractTextSchema(\"/home/DolphinDB/Data/t1.txt\");",
|
|
27778
27762
|
" $ schema;",
|
|
27779
27763
|
""
|
|
27780
27764
|
]
|
|
@@ -28392,7 +28376,7 @@
|
|
|
28392
28376
|
"language": "console",
|
|
28393
28377
|
"value": [
|
|
28394
28378
|
" ",
|
|
28395
|
-
" $ files(\"
|
|
28379
|
+
" $ files(\"/home/06_DolphinDB/01_App/DolphinDB_Win_V0.2\");",
|
|
28396
28380
|
""
|
|
28397
28381
|
]
|
|
28398
28382
|
},
|
|
@@ -28415,7 +28399,7 @@
|
|
|
28415
28399
|
"language": "console",
|
|
28416
28400
|
"value": [
|
|
28417
28401
|
" ",
|
|
28418
|
-
" $ files(\"
|
|
28402
|
+
" $ files(\"/home/06_DolphinDB/01_App/DolphinDB_Win_V0.2\", \"readme%\");",
|
|
28419
28403
|
""
|
|
28420
28404
|
]
|
|
28421
28405
|
},
|
|
@@ -28435,7 +28419,7 @@
|
|
|
28435
28419
|
"language": "console",
|
|
28436
28420
|
"value": [
|
|
28437
28421
|
" ",
|
|
28438
|
-
" $ select * from files(\"
|
|
28422
|
+
" $ select * from files(\"/home/06_DolphinDB/01_App/DolphinDB_Win_V0.2\") where filename like \"README%\";",
|
|
28439
28423
|
""
|
|
28440
28424
|
]
|
|
28441
28425
|
},
|
|
@@ -32890,7 +32874,7 @@
|
|
|
32890
32874
|
{
|
|
32891
32875
|
"type": "text",
|
|
32892
32876
|
"value": [
|
|
32893
|
-
"getJobMessage(
|
|
32877
|
+
"getJobMessage(jobId)",
|
|
32894
32878
|
""
|
|
32895
32879
|
]
|
|
32896
32880
|
}
|
|
@@ -32903,7 +32887,7 @@
|
|
|
32903
32887
|
{
|
|
32904
32888
|
"type": "text",
|
|
32905
32889
|
"value": [
|
|
32906
|
-
"`
|
|
32890
|
+
"`jobId` 是批处理作业的ID,是一个字符串。",
|
|
32907
32891
|
""
|
|
32908
32892
|
]
|
|
32909
32893
|
}
|
|
@@ -32996,7 +32980,7 @@
|
|
|
32996
32980
|
{
|
|
32997
32981
|
"type": "text",
|
|
32998
32982
|
"value": [
|
|
32999
|
-
"getJobReturn(
|
|
32983
|
+
"getJobReturn(jobId, [blocking=false])",
|
|
33000
32984
|
""
|
|
33001
32985
|
]
|
|
33002
32986
|
}
|
|
@@ -33009,7 +32993,7 @@
|
|
|
33009
32993
|
{
|
|
33010
32994
|
"type": "text",
|
|
33011
32995
|
"value": [
|
|
33012
|
-
"`
|
|
32996
|
+
"`jobId` 是批处理作业的ID,是一个字符串。",
|
|
33013
32997
|
"",
|
|
33014
32998
|
"`blocking` 是一个布尔值,表示是否采用阻塞模式。默认值为false。如果blocking为false,在批处理作业没有完成的情况下,函数会抛出异常。如果blocking为true,直到批处理作业完成后,函数才会返回值。",
|
|
33015
32999
|
""
|
|
@@ -33167,7 +33151,7 @@
|
|
|
33167
33151
|
{
|
|
33168
33152
|
"type": "text",
|
|
33169
33153
|
"value": [
|
|
33170
|
-
"getJobStatus(
|
|
33154
|
+
"getJobStatus(jobId)"
|
|
33171
33155
|
]
|
|
33172
33156
|
}
|
|
33173
33157
|
]
|
|
@@ -33179,7 +33163,7 @@
|
|
|
33179
33163
|
{
|
|
33180
33164
|
"type": "text",
|
|
33181
33165
|
"value": [
|
|
33182
|
-
"`
|
|
33166
|
+
"`jobId` 是批处理作业的ID,是一个字符串。"
|
|
33183
33167
|
]
|
|
33184
33168
|
}
|
|
33185
33169
|
]
|
|
@@ -47335,9 +47319,9 @@
|
|
|
47335
47319
|
" $ y = b0 + b1 * x1 + b2 * x2 + err",
|
|
47336
47320
|
" $ t = table(x1, x2, y)",
|
|
47337
47321
|
" $ model = randomForestRegressor(sqlDS(<select * from t>), `y, `x1`x2)",
|
|
47338
|
-
" $ saveModel(model, \"
|
|
47322
|
+
" $ saveModel(model, \"/home/DolphinDB/Data/regressionModel.txt\");",
|
|
47339
47323
|
"",
|
|
47340
|
-
" $ model = loadModel(\"
|
|
47324
|
+
" $ model = loadModel(\"/home/DolphinDB/Data/regressionModel.txt\")",
|
|
47341
47325
|
" $ yhat = predict(model, t);"
|
|
47342
47326
|
]
|
|
47343
47327
|
}
|
|
@@ -47472,7 +47456,7 @@
|
|
|
47472
47456
|
{
|
|
47473
47457
|
"type": "text",
|
|
47474
47458
|
"value": [
|
|
47475
|
-
"`path`
|
|
47459
|
+
"`path` 是一个字符串,表示绝对路径或相对路径。",
|
|
47476
47460
|
"",
|
|
47477
47461
|
"`tableName` 是一个字符串,表示表名。"
|
|
47478
47462
|
]
|
|
@@ -47507,10 +47491,10 @@
|
|
|
47507
47491
|
" $ qty=100*(1+rand(100,n))",
|
|
47508
47492
|
" $ price=5.0+rand(100.0,n)",
|
|
47509
47493
|
" $ temp=table(timestamp,sym,qty,price)",
|
|
47510
|
-
" $ t1= mvccTable(1:0,`timestamp`sym`qty`price,[TIMESTAMP,SYMBOL,INT,DOUBLE],\"
|
|
47494
|
+
" $ t1= mvccTable(1:0,`timestamp`sym`qty`price,[TIMESTAMP,SYMBOL,INT,DOUBLE],\"/home/DolphinDB/Data\",\"t1\")",
|
|
47511
47495
|
" $ t1.append!(temp);",
|
|
47512
47496
|
"",
|
|
47513
|
-
" $ loadMvccTable(\"
|
|
47497
|
+
" $ loadMvccTable(\"/home/DolphinDB/Data\",\"t1\");",
|
|
47514
47498
|
""
|
|
47515
47499
|
]
|
|
47516
47500
|
},
|
|
@@ -47775,7 +47759,7 @@
|
|
|
47775
47759
|
{
|
|
47776
47760
|
"type": "text",
|
|
47777
47761
|
"value": [
|
|
47778
|
-
"`filepath`
|
|
47762
|
+
"`filepath` 是文本文件的绝对路径。"
|
|
47779
47763
|
]
|
|
47780
47764
|
}
|
|
47781
47765
|
]
|
|
@@ -47830,7 +47814,7 @@
|
|
|
47830
47814
|
"language": "console",
|
|
47831
47815
|
"value": [
|
|
47832
47816
|
"",
|
|
47833
|
-
" $ loadPlugin(\"
|
|
47817
|
+
" $ loadPlugin(\"/home/DolphinDB/server/plugins/odbc/odbc.cfg\")",
|
|
47834
47818
|
" $ use odbc",
|
|
47835
47819
|
" $ ConnStr=\"Driver=MySQL;Data Source=odbc_test;Server=127.0.0.1;Uid=root;Pwd=123456;Database=odbc_test\"",
|
|
47836
47820
|
" $ conn=connect(connStr) // 创建 MySQL 连接",
|
|
@@ -48137,20 +48121,20 @@
|
|
|
48137
48121
|
" $ price=5.0+rand(100.0,n)",
|
|
48138
48122
|
" $ t1= table(timestamp,sym,qty,price)",
|
|
48139
48123
|
"",
|
|
48140
|
-
" $ db=database(\"
|
|
48124
|
+
" $ db=database(\"/home/DolphinDB/Data/db01\");",
|
|
48141
48125
|
" $ saveTable(db, t1, `t1);",
|
|
48142
48126
|
"",
|
|
48143
48127
|
" $ tt=loadTable(db,`t1);",
|
|
48144
48128
|
"",
|
|
48145
48129
|
" $ // alternatively, we can specify the folder path to load a table:",
|
|
48146
|
-
" $ tt=loadTable(\"
|
|
48130
|
+
" $ tt=loadTable(\"/home/DolphinDB/Data/db01\",`t1);",
|
|
48147
48131
|
"",
|
|
48148
48132
|
".. * 加载本地磁盘分区表的某些分区:",
|
|
48149
48133
|
"",
|
|
48150
48134
|
".. .. code:: console",
|
|
48151
48135
|
"",
|
|
48152
48136
|
" $ n = 2000000",
|
|
48153
|
-
" $ workDir = \"
|
|
48137
|
+
" $ workDir = \"/home/DolphinDB/Data\"",
|
|
48154
48138
|
" $ if(!exists(workDir)) mkdir(workDir)",
|
|
48155
48139
|
" $ trades=table(rand(`IBM`MSFT`GM`C`YHOO`GOOG,n) as sym, 2000.01.01+rand(365,n) as date, 10.0+rand(2.0,n) as price, rand(1000,n) as qty)",
|
|
48156
48140
|
" $ trades.saveText(workDir + \"/trades.txt\")",
|
|
@@ -48180,7 +48164,7 @@
|
|
|
48180
48164
|
".. .. code:: console",
|
|
48181
48165
|
"",
|
|
48182
48166
|
" $ n = 2000000",
|
|
48183
|
-
" $ workDir = \"
|
|
48167
|
+
" $ workDir = \"/home/DolphinDB/Data\"",
|
|
48184
48168
|
" $ if(!exists(workDir)) mkdir(workDir)",
|
|
48185
48169
|
" $ trades=table(rand(`IBM`MSFT`GM`C`YHOO`GOOG,n) as sym, 2000.01.01+rand(365,n) as date, 10.0+rand(2.0,n) as price, rand(1000,n) as qty)",
|
|
48186
48170
|
" $ trades.saveText(workDir + \"/trades.txt\")",
|
|
@@ -48226,7 +48210,7 @@
|
|
|
48226
48210
|
{
|
|
48227
48211
|
"type": "text",
|
|
48228
48212
|
"value": [
|
|
48229
|
-
"`sql` 是表示SQL查询的元代码。它可以用WHERE子句来过滤分区或记录行,也可以用SELECT语句选择包括计算列在内的列,但不能包含TOP子句、GROUP BY
|
|
48213
|
+
"`sql` 是表示 SQL 查询的元代码。它可以用 WHERE 子句来过滤分区或记录行,也可以用 SELECT 语句选择包括计算列在内的列,但不能包含 TOP 子句、GROUP BY 子句、 ORDER BY 子句、CONTEXT BY 子句和 LIMIT 子句。"
|
|
48230
48214
|
]
|
|
48231
48215
|
}
|
|
48232
48216
|
]
|
|
@@ -48238,7 +48222,7 @@
|
|
|
48238
48222
|
{
|
|
48239
48223
|
"type": "text",
|
|
48240
48224
|
"value": [
|
|
48241
|
-
"把分区表中满足SQL查询的记录行加载到内存中。返回的是分区的内存表,其分区机制与分区表一致。"
|
|
48225
|
+
"把分区表中满足 SQL 查询的记录行加载到内存中。返回的是分区的内存表,其分区机制与分区表一致。"
|
|
48242
48226
|
]
|
|
48243
48227
|
}
|
|
48244
48228
|
]
|
|
@@ -48381,7 +48365,7 @@
|
|
|
48381
48365
|
" $ vol=rand(10000,n)",
|
|
48382
48366
|
" $ amount=rand(100000.0,n)",
|
|
48383
48367
|
" $ t=table(sym,permno,date,open,high,close,pre_close,change,vol,amount)",
|
|
48384
|
-
" $ saveText(t,\"
|
|
48368
|
+
" $ saveText(t,\"/home/DolphinDB/Data/stock.csv\");"
|
|
48385
48369
|
]
|
|
48386
48370
|
}
|
|
48387
48371
|
]
|
|
@@ -48394,7 +48378,7 @@
|
|
|
48394
48378
|
"language": "console",
|
|
48395
48379
|
"value": [
|
|
48396
48380
|
"",
|
|
48397
|
-
" $ tt=loadText(\"
|
|
48381
|
+
" $ tt=loadText(\"/home/DolphinDB/Data/stock.csv\");",
|
|
48398
48382
|
"",
|
|
48399
48383
|
" $ tt;",
|
|
48400
48384
|
""
|
|
@@ -48465,9 +48449,9 @@
|
|
|
48465
48449
|
"language": "console",
|
|
48466
48450
|
"value": [
|
|
48467
48451
|
"",
|
|
48468
|
-
" $ schema=extractTextSchema(\"
|
|
48452
|
+
" $ schema=extractTextSchema(\"/home/DolphinDB/Data/stock.csv\");",
|
|
48469
48453
|
" $ update schema set type=`SYMBOL where name=`permno;",
|
|
48470
|
-
" $ tt=loadText(\"
|
|
48454
|
+
" $ tt=loadText(\"/home/DolphinDB/Data/stock.csv\",,schema);",
|
|
48471
48455
|
" $ schema(tt).colDefs;",
|
|
48472
48456
|
""
|
|
48473
48457
|
]
|
|
@@ -48500,7 +48484,7 @@
|
|
|
48500
48484
|
"value": [
|
|
48501
48485
|
"",
|
|
48502
48486
|
" $ schematable=table(`sym`permno`date`open`high`close`pre_close`change`vol`amount as name,`SYMBOL`SYMBOL`DATE`DOUBLE`DOUBLE`DOUBLE`DOUBLE`DOUBLE`INT`DOUBLE as type)",
|
|
48503
|
-
" $ tt=loadText(\"
|
|
48487
|
+
" $ tt=loadText(\"/home/DolphinDB/Data/stock.csv\",,schematable)",
|
|
48504
48488
|
" $ schema(tt).colDefs;",
|
|
48505
48489
|
""
|
|
48506
48490
|
]
|
|
@@ -48541,11 +48525,11 @@
|
|
|
48541
48525
|
"language": "console",
|
|
48542
48526
|
"value": [
|
|
48543
48527
|
"",
|
|
48544
|
-
" $ schema=extractTextSchema(\"
|
|
48528
|
+
" $ schema=extractTextSchema(\"/home/DolphinDB/Data/stock.csv\");",
|
|
48545
48529
|
" $ schema=select * from schema where name in `sym`date`open`high`close`vol`amount",
|
|
48546
48530
|
" $ schema[`col]=[0,2,3,4,5,8,9]",
|
|
48547
48531
|
"",
|
|
48548
|
-
" $ tt=loadText(\"
|
|
48532
|
+
" $ tt=loadText(\"/home/DolphinDB/Data/stock.csv\",,schema);",
|
|
48549
48533
|
" $ tt;",
|
|
48550
48534
|
""
|
|
48551
48535
|
]
|
|
@@ -48586,7 +48570,7 @@
|
|
|
48586
48570
|
"language": "console",
|
|
48587
48571
|
"value": [
|
|
48588
48572
|
"",
|
|
48589
|
-
" $ re=loadText(filename=\"
|
|
48573
|
+
" $ re=loadText(filename=\"/home/DolphinDB/Data/stock.csv\",skipRows=2)",
|
|
48590
48574
|
" $ select count(*) from re;",
|
|
48591
48575
|
""
|
|
48592
48576
|
]
|
|
@@ -48623,7 +48607,7 @@
|
|
|
48623
48607
|
" $ qty=2200 5400 8670",
|
|
48624
48608
|
" $ price=54.78 59.64 65.23",
|
|
48625
48609
|
" $ t=table(time,sym,qty,price)",
|
|
48626
|
-
" $ saveText(t,\"
|
|
48610
|
+
" $ saveText(t,\"/home/DolphinDB/Data/t2.csv\");",
|
|
48627
48611
|
""
|
|
48628
48612
|
]
|
|
48629
48613
|
},
|
|
@@ -48639,7 +48623,7 @@
|
|
|
48639
48623
|
"language": "console",
|
|
48640
48624
|
"value": [
|
|
48641
48625
|
"",
|
|
48642
|
-
" $ extractTextSchema(\"
|
|
48626
|
+
" $ extractTextSchema(\"/home/DolphinDB/Data/t2.csv\");",
|
|
48643
48627
|
""
|
|
48644
48628
|
]
|
|
48645
48629
|
},
|
|
@@ -48664,11 +48648,11 @@
|
|
|
48664
48648
|
"language": "console",
|
|
48665
48649
|
"value": [
|
|
48666
48650
|
"",
|
|
48667
|
-
" $ schema=extractTextSchema(\"
|
|
48651
|
+
" $ schema=extractTextSchema(\"/home/DolphinDB/Data/t2.csv\")",
|
|
48668
48652
|
" $ update schema set type = \"DATETIME\" where name = \"time\"",
|
|
48669
48653
|
" $ schema[`format]=[\"yyyyMMddHHmmss\",,,];",
|
|
48670
48654
|
"",
|
|
48671
|
-
" $ loadText(\"
|
|
48655
|
+
" $ loadText(\"/home/DolphinDB/Data/t2.csv\",,schema);",
|
|
48672
48656
|
""
|
|
48673
48657
|
]
|
|
48674
48658
|
},
|
|
@@ -48770,7 +48754,7 @@
|
|
|
48770
48754
|
" $ date=rand(dates, n)",
|
|
48771
48755
|
" $ vol=rand(1..10 join int(), n)",
|
|
48772
48756
|
" $ t=table(ID, date, vol)",
|
|
48773
|
-
" $ saveText(t, \"
|
|
48757
|
+
" $ saveText(t, \"/home/DolphinDB/Data/t.txt\");"
|
|
48774
48758
|
]
|
|
48775
48759
|
}
|
|
48776
48760
|
]
|
|
@@ -48784,7 +48768,7 @@
|
|
|
48784
48768
|
"value": [
|
|
48785
48769
|
"",
|
|
48786
48770
|
" $ db = database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 51 101)",
|
|
48787
|
-
" $ pt=loadTextEx(dbHandle=db,tableName=`pt, partitionColumns=`ID, filename=\"
|
|
48771
|
+
" $ pt=loadTextEx(dbHandle=db,tableName=`pt, partitionColumns=`ID, filename=\"/home/DolphinDB/Data/t.txt\");"
|
|
48788
48772
|
]
|
|
48789
48773
|
}
|
|
48790
48774
|
]
|
|
@@ -48800,7 +48784,7 @@
|
|
|
48800
48784
|
" $ dbDate = database(directory=\"\", partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)",
|
|
48801
48785
|
" $ dbID=database(directory=\"\", partitionType=RANGE, partitionScheme=0 51 101)",
|
|
48802
48786
|
" $ db = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID])",
|
|
48803
|
-
" $ pt=loadTextEx(dbHandle=db, tableName=`pt, partitionColumns=`date`ID, filename=\"
|
|
48787
|
+
" $ pt=loadTextEx(dbHandle=db, tableName=`pt, partitionColumns=`date`ID, filename=\"/home/DolphinDB/Data/t.txt\");"
|
|
48804
48788
|
]
|
|
48805
48789
|
}
|
|
48806
48790
|
]
|
|
@@ -48814,7 +48798,7 @@
|
|
|
48814
48798
|
"value": [
|
|
48815
48799
|
"",
|
|
48816
48800
|
" $ db = database(directory=\"\", partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)",
|
|
48817
|
-
" $ pt = db.loadTextEx(tableName=\"\", partitionColumns=`date, filename=\"
|
|
48801
|
+
" $ pt = db.loadTextEx(tableName=\"\", partitionColumns=`date, filename=\"/home/DolphinDB/Data/t.txt\");",
|
|
48818
48802
|
"",
|
|
48819
48803
|
" $ pt.sortBy!(`ID`x);"
|
|
48820
48804
|
]
|
|
@@ -48834,7 +48818,7 @@
|
|
|
48834
48818
|
" $ db = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID]);",
|
|
48835
48819
|
"",
|
|
48836
48820
|
" $ pt=db.createPartitionedTable(t,`pt,`date`ID)",
|
|
48837
|
-
" $ pt=loadTextEx(dbHandle=db, tableName=`pt, partitionColumns=`date`ID, filename=\"
|
|
48821
|
+
" $ pt=loadTextEx(dbHandle=db, tableName=`pt, partitionColumns=`date`ID, filename=\"/home/DolphinDB/Data/t.txt\", transform=nullFill!{,0});"
|
|
48838
48822
|
]
|
|
48839
48823
|
}
|
|
48840
48824
|
]
|
|
@@ -55257,7 +55241,7 @@
|
|
|
55257
55241
|
"language": "console",
|
|
55258
55242
|
"value": [
|
|
55259
55243
|
"",
|
|
55260
|
-
" $ files(\"
|
|
55244
|
+
" $ files(\"/home/test\");",
|
|
55261
55245
|
""
|
|
55262
55246
|
]
|
|
55263
55247
|
},
|
|
@@ -55277,10 +55261,10 @@
|
|
|
55277
55261
|
"language": "console",
|
|
55278
55262
|
"value": [
|
|
55279
55263
|
"",
|
|
55280
|
-
" $ mkdir(\"
|
|
55281
|
-
" $ mkdir(\"
|
|
55282
|
-
" $ mkdir(\"
|
|
55283
|
-
" The directory [
|
|
55264
|
+
" $ mkdir(\"/home/test/dir1\");",
|
|
55265
|
+
" $ mkdir(\"/home/test/dir2\");",
|
|
55266
|
+
" $ mkdir(\"/home/test/dir3\");",
|
|
55267
|
+
" The directory [/home/test/dir3] already exists.",
|
|
55284
55268
|
""
|
|
55285
55269
|
]
|
|
55286
55270
|
},
|
|
@@ -55289,7 +55273,7 @@
|
|
|
55289
55273
|
"language": "console",
|
|
55290
55274
|
"value": [
|
|
55291
55275
|
"",
|
|
55292
|
-
" $ files(\"
|
|
55276
|
+
" $ files(\"/home/test\");",
|
|
55293
55277
|
""
|
|
55294
55278
|
]
|
|
55295
55279
|
},
|
|
@@ -59912,7 +59896,7 @@
|
|
|
59912
59896
|
"language": "console",
|
|
59913
59897
|
"value": [
|
|
59914
59898
|
"",
|
|
59915
|
-
" $ mvccTable(200:10, `name`id`value, [STRING,INT,DOUBLE],\"
|
|
59899
|
+
" $ mvccTable(200:10, `name`id`value, [STRING,INT,DOUBLE],\"/home/DolphinDB/Data\",\"t1\");",
|
|
59916
59900
|
""
|
|
59917
59901
|
]
|
|
59918
59902
|
},
|
|
@@ -59943,7 +59927,7 @@
|
|
|
59943
59927
|
"| | 0 | 0 |",
|
|
59944
59928
|
"+------+------+------+",
|
|
59945
59929
|
"",
|
|
59946
|
-
"\"
|
|
59930
|
+
"\"/home/DolphinDB/Data“目录下会有一个名为\"t1\"文件夹、t1.tbl文件和t1.sym文件。如果需要删除磁盘上的表,需要把这三个文件都删除。",
|
|
59947
59931
|
"",
|
|
59948
59932
|
".. meta::",
|
|
59949
59933
|
" :keywords: table"
|
|
@@ -62296,12 +62280,12 @@
|
|
|
62296
62280
|
" $ vol=rand(1..10 join int(), n)",
|
|
62297
62281
|
" $ price=rand(100,n)",
|
|
62298
62282
|
" $ t=table(ID, date, vol,price)",
|
|
62299
|
-
" $ saveText(t, \"
|
|
62283
|
+
" $ saveText(t, \"/home/DolphinDB/Data/t.txt\");",
|
|
62300
62284
|
" $ if(existsDatabase(\"dfs://rangedb\")){",
|
|
62301
62285
|
" $ \tdropDatabase(\"dfs://rangedb\")",
|
|
62302
62286
|
" $ }",
|
|
62303
62287
|
" $ db = database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 51 101)",
|
|
62304
|
-
" $ USPrices=loadTextEx(dbHandle=db,tableName=`USPrices, partitionColumns=`ID, filename=\"
|
|
62288
|
+
" $ USPrices=loadTextEx(dbHandle=db,tableName=`USPrices, partitionColumns=`ID, filename=\"/home/DolphinDB/Data/t.txt\");",
|
|
62305
62289
|
"",
|
|
62306
62290
|
" $ ds=sqlDS(<select vol as VS, price as SBA from USPrices where vol>5>)",
|
|
62307
62291
|
" $ rs=olsEx(ds, `VS, `SBA, true, 2)",
|
|
@@ -73043,7 +73027,7 @@
|
|
|
73043
73027
|
"language": "console",
|
|
73044
73028
|
"value": [
|
|
73045
73029
|
"",
|
|
73046
|
-
" $ files(\"
|
|
73030
|
+
" $ files(\"/home/test\");",
|
|
73047
73031
|
""
|
|
73048
73032
|
]
|
|
73049
73033
|
},
|
|
@@ -73066,7 +73050,7 @@
|
|
|
73066
73050
|
"language": "console",
|
|
73067
73051
|
"value": [
|
|
73068
73052
|
"",
|
|
73069
|
-
" $ rm(\"
|
|
73053
|
+
" $ rm(\"/home/test/abc.txt\");",
|
|
73070
73054
|
" $ // delete file abc.txt",
|
|
73071
73055
|
""
|
|
73072
73056
|
]
|
|
@@ -73076,7 +73060,7 @@
|
|
|
73076
73060
|
"language": "console",
|
|
73077
73061
|
"value": [
|
|
73078
73062
|
"",
|
|
73079
|
-
" $ files(\"
|
|
73063
|
+
" $ files(\"/home/test\");",
|
|
73080
73064
|
""
|
|
73081
73065
|
]
|
|
73082
73066
|
},
|
|
@@ -73149,7 +73133,7 @@
|
|
|
73149
73133
|
"language": "console",
|
|
73150
73134
|
"value": [
|
|
73151
73135
|
"",
|
|
73152
|
-
" $ files(\"
|
|
73136
|
+
" $ files(\"/home/test\");",
|
|
73153
73137
|
""
|
|
73154
73138
|
]
|
|
73155
73139
|
},
|
|
@@ -73172,14 +73156,14 @@
|
|
|
73172
73156
|
"value": [
|
|
73173
73157
|
"",
|
|
73174
73158
|
" $ // delete a directory. dir1 is empty, dir2 is not empty.",
|
|
73175
|
-
" $ rmdir(\"
|
|
73176
|
-
" $ rmdir(\"
|
|
73177
|
-
" Failed to remove directory [
|
|
73159
|
+
" $ rmdir(\"/home/test/dir1\");",
|
|
73160
|
+
" $ rmdir(\"/home/test/dir2\");",
|
|
73161
|
+
" Failed to remove directory [/home/test/dir2] with error code 145",
|
|
73178
73162
|
"",
|
|
73179
73163
|
" $ // Delete a directory recursively",
|
|
73180
|
-
" $ rmdir(\"
|
|
73164
|
+
" $ rmdir(\"/home/test/dir2\", true);",
|
|
73181
73165
|
"",
|
|
73182
|
-
" $ files(\"
|
|
73166
|
+
" $ files(\"/home/test\");",
|
|
73183
73167
|
""
|
|
73184
73168
|
]
|
|
73185
73169
|
},
|
|
@@ -76563,7 +76547,7 @@
|
|
|
76563
76547
|
{
|
|
76564
76548
|
"type": "text",
|
|
76565
76549
|
"value": [
|
|
76566
|
-
"`scriptFile`
|
|
76550
|
+
"`scriptFile` 是服务器端的脚本所在路径。",
|
|
76567
76551
|
"",
|
|
76568
76552
|
"`newSession` 是否新开一个 session 运行脚本。",
|
|
76569
76553
|
"",
|
|
@@ -76598,11 +76582,11 @@
|
|
|
76598
76582
|
"language": "console",
|
|
76599
76583
|
"value": [
|
|
76600
76584
|
"",
|
|
76601
|
-
" $ run \"
|
|
76585
|
+
" $ run \"/home/DolphinDB/test.script\";",
|
|
76602
76586
|
" $ d = dict(STRING, ANY)",
|
|
76603
76587
|
" $ d[\"TradePrice\"] = 1..1000",
|
|
76604
76588
|
" //clean参数设置为false,当前session中定义的变量d不会被清除。",
|
|
76605
|
-
" $ run(\"
|
|
76589
|
+
" $ run(\"/home/DolphinDB/test.script\", clean=false) ",
|
|
76606
76590
|
" $ parseExpr(\"avg(TradePrice)\",d).eval()",
|
|
76607
76591
|
" 500.5"
|
|
76608
76592
|
]
|
|
@@ -76696,7 +76680,7 @@
|
|
|
76696
76680
|
"value": [
|
|
76697
76681
|
"`obj` 是一个数值向量或矩阵。",
|
|
76698
76682
|
"",
|
|
76699
|
-
"`fileName`
|
|
76683
|
+
"`fileName` 是服务器端输出文件的绝对路径或相对路径。"
|
|
76700
76684
|
]
|
|
76701
76685
|
}
|
|
76702
76686
|
]
|
|
@@ -76725,10 +76709,10 @@
|
|
|
76725
76709
|
"value": [
|
|
76726
76710
|
"",
|
|
76727
76711
|
" $ v = 1..1000",
|
|
76728
|
-
" $ v.saveAsNpy(\"
|
|
76712
|
+
" $ v.saveAsNpy(\"/home/DolphinDB/intVec.npy\")",
|
|
76729
76713
|
"",
|
|
76730
76714
|
" $ m = (1..1000 + 0.5)$20:50",
|
|
76731
|
-
" $ m.saveAsNpy(\"
|
|
76715
|
+
" $ m.saveAsNpy(\"/home/DolphinDB/doubleMat.npy\")",
|
|
76732
76716
|
""
|
|
76733
76717
|
]
|
|
76734
76718
|
},
|
|
@@ -76745,8 +76729,8 @@
|
|
|
76745
76729
|
"value": [
|
|
76746
76730
|
"",
|
|
76747
76731
|
" import numpy as np",
|
|
76748
|
-
" v = np.load(\"
|
|
76749
|
-
" m = np.load(\"
|
|
76732
|
+
" v = np.load(\"/home/DolphinDB/intVec.npy\")",
|
|
76733
|
+
" m = np.load(\"/home/DolphinDB/doubleMat.npy\")",
|
|
76750
76734
|
""
|
|
76751
76735
|
]
|
|
76752
76736
|
},
|
|
@@ -76921,9 +76905,9 @@
|
|
|
76921
76905
|
{
|
|
76922
76906
|
"type": "text",
|
|
76923
76907
|
"value": [
|
|
76924
|
-
"`model`
|
|
76908
|
+
"`model` 需要保存的模型,一般是字典,由 :doc:`../../FunctionReferences/r/randomForestClassifier`, :doc:`../../FunctionReferences/r/randomForestRegressor` 等机器学习函数生成。",
|
|
76925
76909
|
"",
|
|
76926
|
-
"`location`
|
|
76910
|
+
"`location` 字符串,表示服务器端输出文件的绝对路径或相对路径。"
|
|
76927
76911
|
]
|
|
76928
76912
|
}
|
|
76929
76913
|
]
|
|
@@ -76958,7 +76942,7 @@
|
|
|
76958
76942
|
" $ y = b0 + b1 * x1 + b2 * x2 + err",
|
|
76959
76943
|
" $ t = table(x1, x2, y)",
|
|
76960
76944
|
" $ model = randomForestRegressor(sqlDS(<select * from t>), `y, `x1`x2)",
|
|
76961
|
-
" $ saveModel(model, \"
|
|
76945
|
+
" $ saveModel(model, \"/home/DolphinDB/Data/regressionModel.txt\");"
|
|
76962
76946
|
]
|
|
76963
76947
|
}
|
|
76964
76948
|
]
|
|
@@ -77314,7 +77298,7 @@
|
|
|
77314
77298
|
"",
|
|
77315
77299
|
"`obj` 可以是表、矩阵、向量或 SQL 元代码。*obj* 取 SQL 元代码时,系统将分配多个线程并发读取数据,并通过独立的写线程将数据写入文件。否则,数据查询和写入将由当前 worker 处理。",
|
|
77316
77300
|
"",
|
|
77317
|
-
"`filename`
|
|
77301
|
+
"`filename` 是在服务器端输出文件的绝对路径或相对路径。",
|
|
77318
77302
|
"",
|
|
77319
77303
|
"`delimiter` 是表中的列分隔符。系统的默认分隔符是逗号(,)。",
|
|
77320
77304
|
"",
|
|
@@ -77364,7 +77348,7 @@
|
|
|
77364
77348
|
" $ price=5.0+rand(100.0,n)",
|
|
77365
77349
|
" $ t1=table(timestamp,sym,qty,price);",
|
|
77366
77350
|
"",
|
|
77367
|
-
" $ timer saveText(t1, \"
|
|
77351
|
+
" $ timer saveText(t1, \"/home/DolphinDB/trades.txt\");",
|
|
77368
77352
|
" Time elapsed: 191488 ms",
|
|
77369
77353
|
"",
|
|
77370
77354
|
""
|
|
@@ -77384,10 +77368,10 @@
|
|
|
77384
77368
|
"",
|
|
77385
77369
|
" $ n=100",
|
|
77386
77370
|
" $ t1=table(1..n as id, rand(1000, n) as x)",
|
|
77387
|
-
" $ saveText(t1, \"
|
|
77371
|
+
" $ saveText(t1, \"/home/DolphinDB/t.csv\",,1)",
|
|
77388
77372
|
" $ t2=table((n+1)..(2*n) as id, rand(1000, n) as x)",
|
|
77389
|
-
" $ saveText(t2, \"
|
|
77390
|
-
" $ t = loadText(\"
|
|
77373
|
+
" $ saveText(t2, \"/home/DolphinDB/t.csv\",,1)",
|
|
77374
|
+
" $ t = loadText(\"/home/DolphinDB/t.csv\")",
|
|
77391
77375
|
" $ select count(*) from t;",
|
|
77392
77376
|
" 200",
|
|
77393
77377
|
""
|
|
@@ -77417,7 +77401,7 @@
|
|
|
77417
77401
|
" $ pt = db.createPartitionedTable(t, `pt, `ticker)",
|
|
77418
77402
|
" $ pt.append!(t)",
|
|
77419
77403
|
"",
|
|
77420
|
-
" $ saveText(<select * from pt>, \"
|
|
77404
|
+
" $ saveText(<select * from pt>, \"/home/DolphinDB/pt.txt\")",
|
|
77421
77405
|
""
|
|
77422
77406
|
]
|
|
77423
77407
|
}
|
|
@@ -77480,9 +77464,9 @@
|
|
|
77480
77464
|
"language": "console",
|
|
77481
77465
|
"value": [
|
|
77482
77466
|
"",
|
|
77483
|
-
" $ saveTextFile(\"1234567890\\n0987654321\\nabcdefghijk\\n\", \"
|
|
77467
|
+
" $ saveTextFile(\"1234567890\\n0987654321\\nabcdefghijk\\n\", \"/home/test/abc.txt\", false, 1495762562671l);",
|
|
77484
77468
|
"",
|
|
77485
|
-
" [content of file \"
|
|
77469
|
+
" [content of file \"/home/test/abc.txt\"]",
|
|
77486
77470
|
" 1234567890",
|
|
77487
77471
|
" 0987654321",
|
|
77488
77472
|
" abcdefghijk",
|
|
@@ -86123,7 +86107,7 @@
|
|
|
86123
86107
|
{
|
|
86124
86108
|
"type": "text",
|
|
86125
86109
|
"value": [
|
|
86126
|
-
"* 使用 *remoteRun*
|
|
86110
|
+
"* 使用 *remoteRun* 函数或 *remoteRunWithCompression* 函数,这里以 *remoteRun* 为例:",
|
|
86127
86111
|
""
|
|
86128
86112
|
]
|
|
86129
86113
|
},
|
|
@@ -94977,7 +94961,7 @@
|
|
|
94977
94961
|
"",
|
|
94978
94962
|
"* 用法三:",
|
|
94979
94963
|
"",
|
|
94980
|
-
"`tables` 是一个元组,其中每个元素都是一个内存表,并且它们具有相同的列数。`tableB` 是一个和 tables
|
|
94964
|
+
"`tables` 是一个元组,其中每个元素都是一个内存表,并且它们具有相同的列数。`tableB` 是一个和 tables 中表列数相同的内存表。",
|
|
94981
94965
|
"",
|
|
94982
94966
|
"注:tableA, tableB, tables 支持以下内存表:table, keyedTable, indexedTable, latestKeyedTable, latestIndexedTable。此外,用法三的 tableB 还可以是一个分区内存表。"
|
|
94983
94967
|
]
|
|
@@ -94997,7 +94981,9 @@
|
|
|
94997
94981
|
"",
|
|
94998
94982
|
"当 *byColName* =true时,各表可有不同数量的列。若某列在某些表中不存在,结果中会以空值填充。",
|
|
94999
94983
|
"",
|
|
95000
|
-
"当 *byColName* =false时,各表必须有相同数量的列。"
|
|
94984
|
+
"当 *byColName* =false时,各表必须有相同数量的列。",
|
|
94985
|
+
"",
|
|
94986
|
+
"第三种用法是将多个表追加到指定的表,并返回该表。常用于 mr 函数的 finalFunc。"
|
|
95001
94987
|
]
|
|
95002
94988
|
}
|
|
95003
94989
|
]
|