{
    "abs": {
        "url": "https://docs.dolphindb.com/en/Functions/a/abs.html",
        "signatures": [
            {
                "full": "abs(X)",
                "name": "abs",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [abs](https://docs.dolphindb.com/en/Functions/a/abs.html)\n\n\n\n#### Syntax\n\nabs(X)\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix/dictionary/table.\n\n#### Details\n\nReturn the element-by-element absolute value(s) of *X*.\n\nThe `abs` function in DolphinDB has the same functionality as the `abs` functions in Python, NumPy, and `scipy.stats`\n\n, with the following difference: Python/NumPy/`scipy.stats` support calculating the absolute value of complex numbers,whereas DolphinDB’s `abs` function does not support complex numbers. To calculate the absolute value of complex numbers in DolphinDB, you can use the `abs` function provided in the DolphinDB *signal* plugin (see example).\n\n#### Examples\n\n```\nabs(-2.0);\n// output: 2\n\nabs(-2 -3 4);\n// output: [2, 3, 4]\n```\n\nCalculate the absolute value of a complex number using the *signal* plugin.\n\n```\n// Check whether the signal plugin exists in the plugin marketplace\nlistRemotePlugins()\n\n// Download the signal plugin from the marketplace\ninstallPlugin(\"signal\")\n\n// Load the signal plugin\nloadPlugin(\"signal\")\n\n// Create a complex number\nz = complex(3, 4)  // 3.0+4.0i\n\n// Calculate the absolute value of the complex number\nabs = signal::abs(z)\n\nabs\n// output: 5\n```\n"
    },
    "acf": {
        "url": "https://docs.dolphindb.com/en/Functions/a/acf.html",
        "signatures": [
            {
                "full": "acf(X, maxLag)",
                "name": "acf",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "maxLag",
                        "name": "maxLag"
                    }
                ]
            }
        ],
        "markdown": "### [acf](https://docs.dolphindb.com/en/Functions/a/acf.html)\n\n\n\n#### Syntax\n\nacf(X, maxLag)\n\n#### Details\n\nComputes the autocorrelation of *X* from lag=1 to lag=*maxLag*. Note that the means of the two time series used in the calculation is the mean of *X* instead of the means of the two time series.\n\nThis function is largely consistent with `statsmodels.tsa.stattools.acf` in terms of computing autocorrelation coefficients. The specific implementation differences are as follows:\n\n| Dimension              | DolphinDB `acf`                                             | Python `statsmodels.tsa.acf`                                                                    |\n| ---------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |\n| lag parameter          | maxLag must be specified                                    | Optional; default is `min(10 * np.log10(nobs), nobs - 1)`                                       |\n| Computation method     | Demeaning + normalization                                   | Demeaning + normalization (default); normalization can be adjusted via the *adjusted* parameter |\n| FFT acceleration       | Supported (not configurable)                                | Supported (controlled by the *fft* parameter)                                                   |\n| Confidence interval    | Not supported                                               | Supports confidence intervals via *alpha* and method selection via *bartlett\\_confint*          |\n| Significance test      | Not supported                                               | Supported (via the *qstat* parameter)                                                           |\n| Missing value handling | Not supported (throws error)                                | Supported (via the *missing* parameter)                                                         |\n| Return value           | Vector of autocorrelation coefficients from lag 1 to maxLag | Array of autocorrelation coefficients + optional confidence intervals                           |\n\n#### Parameters\n\n**X** is a vector.\n\n**maxLag** is a positive integer that specifies the maximum lag for computing the autocorrelation coefficient.\n\n#### Examples\n\n```\nn=10000\nx=array(double, n, n, NULL)\nx[0]=1\nr=rand(0.05, n)-0.025\nfor(i in 0:(n-1)){\n   x[i+1]=-0.8*x[i]+r[i]\n}\n\nacf = acf(x, 20)\nplot(acf,chartType=BAR)\n```\n"
    },
    "acos": {
        "url": "https://docs.dolphindb.com/en/Functions/a/acos.html",
        "signatures": [
            {
                "full": "acos(X)",
                "name": "acos",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [acos](https://docs.dolphindb.com/en/Functions/a/acos.html)\n\n\n\n#### Syntax\n\nacos(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nThe inverse cosine function.\n\nDolphinDB `acos` and TA-Lib `ACOS` are mathematically identical in semantic meaning. The difference is that TA-Lib’s `ACOS` is a Math Transform function whose inputs and outputs are primarily one-dimensional arrays, whereas DolphinDB’s `acos` can operate on scalars, vectors, matrices, or tables, and preserves the structure of the input data.\n\n#### Examples\n\n```\nacos(1.000000 0.540302 -0.416147);\n// output: [0,1,2]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html), [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html), [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "acosh": {
        "url": "https://docs.dolphindb.com/en/Functions/a/acosh.html",
        "signatures": [
            {
                "full": "acosh(X)",
                "name": "acosh",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html)\n\n\n\n#### Syntax\n\nacosh(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nThe inverse hyperbolic cosine function.\n\n#### Examples\n\n```\nacosh(1 2 3);\n// output: [0,1.316958,1.762747]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html), [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "adaBoostClassifier": {
        "url": "https://docs.dolphindb.com/en/Functions/a/adaBoostClassifier.html",
        "signatures": [
            {
                "full": "adaBoostClassifier(ds, yColName, xColNames, numClasses, [maxFeatures=0], [numTrees=10], [numBins=32], [maxDepth=10], [minImpurityDecrease=0.0], [learningRate=0.1], [algorithm='SAMME.R'], [randomSeed])",
                "name": "adaBoostClassifier",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "numClasses",
                        "name": "numClasses"
                    },
                    {
                        "full": "[maxFeatures=0]",
                        "name": "maxFeatures",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[numTrees=10]",
                        "name": "numTrees",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[numBins=32]",
                        "name": "numBins",
                        "optional": true,
                        "default": "32"
                    },
                    {
                        "full": "[maxDepth=10]",
                        "name": "maxDepth",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[minImpurityDecrease=0.0]",
                        "name": "minImpurityDecrease",
                        "optional": true,
                        "default": "0.0"
                    },
                    {
                        "full": "[learningRate=0.1]",
                        "name": "learningRate",
                        "optional": true,
                        "default": "0.1"
                    },
                    {
                        "full": "[algorithm='SAMME.R']",
                        "name": "algorithm",
                        "optional": true,
                        "default": "'SAMME.R'"
                    },
                    {
                        "full": "[randomSeed]",
                        "name": "randomSeed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [adaBoostClassifier](https://docs.dolphindb.com/en/Functions/a/adaBoostClassifier.html)\n\n\n\n#### Syntax\n\nadaBoostClassifier(ds, yColName, xColNames, numClasses, \\[maxFeatures=0], \\[numTrees=10], \\[numBins=32], \\[maxDepth=10], \\[minImpurityDecrease=0.0], \\[learningRate=0.1], \\[algorithm='SAMME.R'], \\[randomSeed])\n\n#### Parameters\n\n**ds** is the data sources to be trained. It can be generated with function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**yColName** is a string indicating the name of the category column in the data sources.\n\n**xColNames** is a string scalar/vector indicating the names of the feature columns in the data sources.\n\n**numClasses** is a positive integer indicating the number of categories in the category column. The value of the category column must be integers in \\[0, *numClasses*).\n\n**maxFeatures** (optional) is an integer or a floating number indicating the number of features to consider when looking for the best split. The default value is 0.\n\n* If *maxFeatures* is a positive integer, then consider *maxFeatures* features at each split.\n* If *maxFeatures* is 0, then `sqrt(the number of feature columns)` features are considered at each split.\n* If *maxFeatures* is a floating number between 0 and 1, then `int(maxFeatures * the number of feature columns)` features are considered at each split.\n\n**numTrees** (optional) is a positive integer indicating the number of trees. The default value is 10.\n\n**numBins** (optional) is a positive integer indicating the number of bins used when discretizing continuous features. The default value is 32. Increasing *numBins* allows the algorithm to consider more split candidates and make fine-grained split decisions. However, it also increases computation and communication time.\n\n**maxDepth** (optional) is a positive integer indicating the maximum depth of a tree. The default value is 10.\n\n**minImpurityDecrease** (optional) a node will be split if this split induces a decrease of the Gini impurity greater than or equal to this value. The default value is 0.\n\n**learningRate** (optional) is a positive floating number indicating the contribution of a regressor to the next regressor.\n\n**algorithm** (optional) is a string indicating the algorithm used. It can take the value of either \"SAMME.R\" or \"SAMME\". The default value is \"SAMME.R\".\n\n**randomSeed** (optional) is the seed used by the random number generator.\n\n#### Details\n\nFit an AdaBoost classification model. The result is a dictionary with the following keys: numClasses, minImpurityDecrease, maxDepth, numBins, numTress, maxFeatures, model, modelName, xColNames, learningRate, algorithm, and predict. model is a tuple with the result of the trained trees; modelName is \"AdaBoost Classifier\".\n\nThe fitted model can be used as an input for function [predict](https://docs.dolphindb.com/en/Functions/p/predict.html).\n\n#### Examples\n\nFit an AdaBoost classification model with simulated data:\n\n```\nt = table(100:0, `cls`x0`x1, [INT,DOUBLE,DOUBLE])\nn=5\ncls = take(0, n)\nx0 = norm(0, 10, n)\nx1 = norm(0, 10, n)\ninsert into t values (cls, x0, x1)\ncls = take(1, n)\nx0 = norm(1, 10, n)\nx1 = norm(1, 10, n)\ninsert into t values (cls, x0, x1)\nmodel = adaBoostClassifier(sqlDS(<select * from t>), `cls, `x0`x1, 2);\n```\n\nUse the fitted model in forecasting:\n\n```\nt1 = table(-0.5 0 1 2 as x0, -2 0 1 3 as x1)\npredict(model, t1);\n```\n\nSave the fitted model to disk:\n\n```\nsaveModel(model, \"C:/DolphinDB/data/classifierModel.bin\");\nloadModel(\"C:/DolphinDB/data/classifierModel.bin\");\n```\n\nRelated functions: [adaBoostRegressor](https://docs.dolphindb.com/en/Functions/a/adaBoostRegressor.html), [randomForestClassifier](https://docs.dolphindb.com/en/Functions/r/randomForestClassifier.html), [randomForestRegressor](https://docs.dolphindb.com/en/Functions/r/randomForestRegressor.html)\n"
    },
    "adaBoostRegressor": {
        "url": "https://docs.dolphindb.com/en/Functions/a/adaBoostRegressor.html",
        "signatures": [
            {
                "full": "adaBoostRegressor(ds, yColName, xColNames, [maxFeatures=0], [numTrees=10], [numBins=32], [maxDepth=10], [minImpurityDecrease=0.0], [learningRate=0.1], [loss='linear'], [randomSeed])",
                "name": "adaBoostRegressor",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[maxFeatures=0]",
                        "name": "maxFeatures",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[numTrees=10]",
                        "name": "numTrees",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[numBins=32]",
                        "name": "numBins",
                        "optional": true,
                        "default": "32"
                    },
                    {
                        "full": "[maxDepth=10]",
                        "name": "maxDepth",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[minImpurityDecrease=0.0]",
                        "name": "minImpurityDecrease",
                        "optional": true,
                        "default": "0.0"
                    },
                    {
                        "full": "[learningRate=0.1]",
                        "name": "learningRate",
                        "optional": true,
                        "default": "0.1"
                    },
                    {
                        "full": "[loss='linear']",
                        "name": "loss",
                        "optional": true,
                        "default": "'linear'"
                    },
                    {
                        "full": "[randomSeed]",
                        "name": "randomSeed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [adaBoostRegressor](https://docs.dolphindb.com/en/Functions/a/adaBoostRegressor.html)\n\n\n\n#### Syntax\n\nadaBoostRegressor(ds, yColName, xColNames, \\[maxFeatures=0], \\[numTrees=10], \\[numBins=32], \\[maxDepth=10], \\[minImpurityDecrease=0.0], \\[learningRate=0.1], \\[loss='linear'], \\[randomSeed])\n\n#### Parameters\n\n**ds** is the data sources to be trained. It can be generated with function `sqlDS`.\n\n**yColName** is a string indicating the name of the dependent variable column in the data sources.\n\n**xColNames** is a string scalar/vector indicating the names of the feature columns in the data sources.\n\n**maxFeatures** (optional) is an integer or a floating number indicating the number of features to consider when looking for the best split. The default value is 0.\n\n* If *maxFeatures* is a positive integer, then consider maxFeatures features at each split.\n* If *maxFeatures* is 0, then sqrt(the number of feature columns) features are considered at each split.\n* If *maxFeatures* is a floating number between 0 and 1, then int(maxFeatures \\* the number of feature columns) features are considered at each split.\n\n**numTrees** (optional) is a positive integer indicating the number of trees. The default value is 10.\n\n**numBins** (optional) is a positive integer indicating the number of bins used when discretizing continuous features. The default value is 32. Increasing *numBins* allows the algorithm to consider more split candidates and make fine-grained split decisions. However, it also increases computation and communication time.\n\n**maxDepth** (optional) is a positive integer indicating the maximum depth of a tree. The default value is 10.\n\n**minImpurityDecrease** (optional) a node will be split if this split induces a decrease of impurity greater than or equal to this value. The default value is 0.\n\n**learningRate** (optional) is a positive floating-point number that indicates the influence of each classifier on the sample weights of the subsequent classifier during the iterative process.\n\n**loss** (optional) is a string indicating the loss function to use when updating the weights after each boosting iteration. It can take the value of \"linear\", \"square\" or \"exponential\". The default value is \"linear\".\n\n**randomSeed** (optional) is the seed used by the random number generator.\n\n#### Details\n\nFit an AdaBoost regression model. The result is a dictionary with the following keys: minImpurityDecrease, maxDepth, numBins, numTress, maxFeatures, model, modelName, xColNames, learningRate and loss. model is a tuple with the result of the trained trees; modelName is \"AdaBoost Regressor\".\n\nThe fitted model can be used as an input for function [predict](https://docs.dolphindb.com/en/Functions/p/predict.html).\n\n#### Examples\n\nFit an AdaBoost regression model with simulated data:\n\n```\nn=10\nx1 = rand(1.0, n)\nx2 = rand(1.0, n)\nb0 = 1\nb1 = 1\nb2 = -2\nerr = norm(0, 0.2, n)\ny = b0 + b1 * x1 + b2 * x2 + err\nt = table(y, x1, x2)\nmodel = adaBoostRegressor(sqlDS(<select * from t>), `y, `x1`x2);\n```\n\nUse the fitted model in forecasting:\n\n```\nt1 = table(0 0.4 0.7 1 as x1, 0.9 0.2 0.1 0 as x2)\npredict(model, t1);\n```\n\nSave the trained model to disk:\n\n```\nsaveModel(model, \"C:/DolphinDB/data/regressionModel.bin\")\n```\n\nLoad a saved model:\n\n```\nloadModel(\"C:/DolphinDB/data/regressionModel.bin\");\n```\n\nRelated functions: [adaBoostClassifier](https://docs.dolphindb.com/en/Functions/a/adaBoostClassifier.html), [randomForestClassifier](https://docs.dolphindb.com/en/Functions/r/randomForestClassifier.html), [randomForestRegressor](https://docs.dolphindb.com/en/Functions/r/randomForestRegressor.html)\n"
    },
    "add": {
        "url": "https://docs.dolphindb.com/en/Functions/a/add.html",
        "signatures": [
            {
                "full": "add(X, Y)",
                "name": "add",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [add](https://docs.dolphindb.com/en/Functions/a/add.html)\n\n\n\n#### Syntax\n\nadd(X, Y)\n\n#### Parameters\n\n**X** and **Y** is a scalar/pair/vector/matrix. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\nComparison of the functionality and implementation of DolphinDB `add` versus `numpy.add` and pandas `Series.add` / `DataFrame.add`:\n\n| Comparison Dimension        | DolphinDB `add`                                                                                  | `numpy.add`                                                     | pandas `add`                                                         |\n| --------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- | -------------------------------------------------------------------- |\n| Core functionality          | Supports element-wise addition for scalars, vectors, matrices, etc.                              | Supports scalars and ndarrays, follows NumPy broadcasting rules | Index-aligned addition, supports scalar broadcasting                 |\n| Index alignment             | Index sequences and index matrices can be aligned by index                                       | Not supported                                                   | Can specify alignment by index or columns                            |\n| Null/missing value handling | NULL propagation (NULL + any value = NULL); can specify fill value using `withNullFill` function | NaN propagation (NaN + any number = NaN)                        | Automatically handled; fill value can be specified via *fill\\_value* |\n\n#### Details\n\nReturn the element-by-element sum of X and Y.\n\n#### Examples\n\n```\nadd(3,2)\n// output: 5\n\n1:2+6\n// output: 7:8\n\n1:2+3:4\n// output: 4:6\n\n3+1..3\n// output: [4,5,6]\n\nadd(1..3, 4..6)\n// output: [5,7,9]\n\n(1..3).add(4..6)\n// output: [5,7,9]\n\nx=reshape(1..6, 3:2)\nx\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\nx+1.5\n```\n\n| 0   | 1   |\n| --- | --- |\n| 2.5 | 5.5 |\n| 3.5 | 6.5 |\n| 4.5 | 7.5 |\n\n```\ny=reshape(5..10, 3:2)\ny\n```\n\n| 0 | 1  |\n| - | -- |\n| 5 | 8  |\n| 6 | 9  |\n| 7 | 10 |\n\n```\nx+y\n```\n\n| 0  | 1  |\n| -- | -- |\n| 6  | 12 |\n| 8  | 14 |\n| 10 | 16 |\n\nRefer to [\"+\" operator](https://docs.dolphindb.com/en/Programming/Operators/OperatorReferences/add.html)\n\nRelated function: [sub](https://docs.dolphindb.com/en/Functions/s/sub.html)\n"
    },
    "addAccessControl": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addAccessControl.html",
        "signatures": [
            {
                "full": "addAccessControl(table)",
                "name": "addAccessControl",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [addAccessControl](https://docs.dolphindb.com/en/Functions/a/addAccessControl.html)\n\n\n\n#### Syntax\n\naddAccessControl(table)\n\n#### Details\n\nAdds access control to the shared table or streaming engine created by the current user. Other users can access the target shared table or streaming engine only after the administrator grants them permissions.\n\n**Note:**\n\n1. The function can only be executed by administrators or the shared table/streaming engine creator.\n\n2. If the administrator has added access control to the shared table or streaming engine for other users by using [grant](https://docs.dolphindb.com/en/Functions/g/grant.html)/[deny](https://docs.dolphindb.com/en/Functions/d/deny.html)/[revoke](https://docs.dolphindb.com/en/Functions/r/revoke.html), you do not need to call `addAccessControl`. Users that are not granted permissions by the administrator cannot access the shared table or streaming.\n\n#### Parameters\n\n**table** is a shared table or a streaming engine.\n\n#### Examples\n\nCreate users for access management.\n\n```\nlogin(`admin, `123456)\ncreateUser(`u1, \"111111\");\ncreateUser(`u2, \"222222\");\ncreateUser(`u3, \"333333\");\n```\n\nExample 1: Restrict other users from accessing a streaming engine.\n\n1. Create the agg1 streaming engine as user u1.\n\n   ```\n   login(`u1, \"111111\")\n   share streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\n   output1 = table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT])\n   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)\n   subscribeTable(tableName=\"trades\", actionName=\"agg1\", offset=0, handler=append!{agg1}, msgAsTable=true);\n   ```\n\n2. Add access control for agg1.\n\n   ```\n   addAccessControl(agg1)\n   ```\n\n3. An error is reported when user u2 inserts data into agg1 or drops agg1.\n\n   ```\n   // Log on to the server as user u2\n   login(`u2, \"222222\")\n\n   // Insert data\n   insert into trades values(2018.10.08T01:01:01.785,`A,10) // No error\n   insert into agg1 values(2018.10.08T01:01:01.785,`A,10) // ERROR: No access to table [agg1]\n\n   // Drop streaming engine\n   dropStreamEngine(\"agg1\") // No access to drop stream engine agg1\n   ```\n\n4. Grant user u2 write permission on agg1.\n\n   ```\n   login(`admin, `123456)\n   grant(\"u2\", TABLE_WRITE, \"agg1\")\n   ```\n\n   If the server is deployed in cluster mode, the target object must be written as \"nodeAlias:tableName\". Assume that agg1 resides in the dnode1 node.\n\n   ```\n   grant(\"u2\", TABLE_WRITE, \"dnode1:agg1\")\n   ```\n\n5. Then, user u2 can insert data into agg1.\n\n   ```\n   insert into agg1 values(2018.10.08T01:01:01.785,`A,10)\n   ```\n\nExample 2: Restrict other users from accessing a shared table.\n\n```\nlogin(`u1, \"111111\")\nt = table(take(`a`b`c`, 10) as sym, 1..10 as val)\nshare t as st;\naddAccessControl(`st)\n\nlogin(`u3, \"333333\")\nselect * from st // ERROR: No access to shared table [st]\ninsert into st values(`a, 4) // ERROR: No access to shared table [st]\n```\n\n**Related functions**: [grant](https://docs.dolphindb.com/en/Functions/g/grant.html), [deny](https://docs.dolphindb.com/en/Functions/d/deny.html), [revoke](https://docs.dolphindb.com/en/Functions/r/revoke.html)\n"
    },
    "addCacheRulesForComputeGroup": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addcacherulesforcomputegroup.html",
        "signatures": [
            {
                "full": "addCacheRulesForComputeGroup(name, tableNames)",
                "name": "addCacheRulesForComputeGroup",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "tableNames",
                        "name": "tableNames"
                    }
                ]
            }
        ],
        "markdown": "### [addCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/a/addcacherulesforcomputegroup.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\naddCacheRulesForComputeGroup(name, tableNames)\n\n#### Details\n\nAdds cache rules to a compute group, specifying the tables to be cached in the compute group’s cache path.\n\n#### Parameters\n\n**name**: A STRING scalar specifying the name of the compute group to which cache rules are added.\n\n**tableNames**: A STRING scalar or vector specifying the tables to be cached in the compute group’s cache path. The tables are specified in the format of databaseName/tableName, for example \"dfs\\://compute\\_test/tb1\". Wildcards are not supported.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\naddCacheRulesForComputeGroup(\"cgroup1\", \"dfs://compute_test/tb1\")\n\naddCacheRulesForComputeGroup(\"cgroup1\", [\"dfs://compute_test/tb1\", \"dfs://compute_test/tb2\"])\n```\n\n**Related Functions:** [removeCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/r/removecacherulesforcomputegroup.html), [getCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/g/getcacherulesforcomputegroup.html)\n"
    },
    "addColumn": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addColumn.html",
        "signatures": [
            {
                "full": "addColumn(table, colNames, colTypes)",
                "name": "addColumn",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            }
        ],
        "markdown": "### [addColumn](https://docs.dolphindb.com/en/Functions/a/addColumn.html)\n\n\n\n#### Syntax\n\naddColumn(table, colNames, colTypes)\n\n#### Parameters\n\n**table** can be an in-memory table, a stream table, a DFS table (excluding tables using the PKEY engine), or a dimension table.\n\n**colNames** is a STRING scalar/vector indicating the name(s) of the column(s) to be added.\n\n**colTypes** is a scalar/vector indicating the data type(s) of the column(s) to be added.\n\n#### Details\n\nAdd a column or columns to a table. It is the only way to add a column to a stream table, a DFS table (excluding tables using the PKEY engine), or a dimension table. SQL `update` statement is not supported for these cases.\n\nNote that the table should be updated by function `loadTable` after adding a new column into a DFS table not using the PKEY engine or a dimension table with `addColumn`.\n\nTables using the PKEY engine do not support adding columns.\n\nHigh-availability stream tables do not support adding columns.\n\n#### Examples\n\nExample 1. Add columns to a DFS table.\n\n```\nID=1..6\nx=1..6\\5\nt1=table(ID, x)\ndb=database(\"dfs://rangedb\",RANGE,  1 4 7)\npt = db.createPartitionedTable(t1, `pt, `ID)\npt.append!(t1);\naddColumn(pt,[\"price\", \"qty\"],[DOUBLE, INT]);\n```\n\nAfter using `addColumn` and before data with the new schema is inserted, we can still insert data with the old schema.\n\n```\nt2=table(1 as ID, 1.2 as x)\npt.append!(t2)\nselect * from pt;\n```\n\n| ID | x   | price | qty |\n| -- | --- | ----- | --- |\n| 1  | 0.2 |       |     |\n| 2  | 0.4 |       |     |\n| 3  | 0.6 |       |     |\n| 1  | 1.2 |       |     |\n| 4  | 0.8 |       |     |\n| 5  | 1   |       |     |\n| 6  | 1.2 |       |     |\n\nAfter data with the new schema is inserted, however, data with the old schema can no longer be inserted.\n\n```\nt3=table(1 as ID, 1.6 as x, 10.0 as price, 6 as qty)\npt.append!(t3)\nselect * from pt;\n```\n\n| ID | x   | price | qty |\n| -- | --- | ----- | --- |\n| 1  | 0.2 |       |     |\n| 2  | 0.4 |       |     |\n| 3  | 0.6 |       |     |\n| 1  | 1.2 |       |     |\n| 1  | 1.6 | 10    | 6   |\n| 4  | 0.8 |       |     |\n| 5  | 1   |       |     |\n| 6  | 1.2 |       |     |\n\n```\nt4=table(2 as ID, 2.2 as x)\npt.append!(t4); // The data to append contains fewer columns than the schema.\n```\n\nExample 2. Add columns to a stream table.\n\n```\nn=10\nticker = rand(`MSFT`GOOG`FB`ORCL`IBM,n)\nx=rand(1.0, n)\nt=streamTable(ticker, x)\nshare t as st\naddColumn(st,[\"price\", \"qty\"],[DOUBLE, INT])\ninsert into st values(\"MSFT\",12.0,25.46,256)\nselect * from st;\n```\n\n| ticker | x                 | price | qty |\n| ------ | ----------------- | ----- | --- |\n| MSFT   | 0.743241031421349 |       |     |\n| FB     | 0.254624255700037 |       |     |\n| FB     | 0.947473830310628 |       |     |\n| FB     | 0.904140035156161 |       |     |\n| MSFT   | 0.193251194199547 |       |     |\n| MSFT   | 0.416090324753895 |       |     |\n| MSFT   | 0.479371337918565 |       |     |\n| ORCL   | 0.69910929678008  |       |     |\n| GOOG   | 0.131539688445628 |       |     |\n| MSFT   | 0.472390263108537 |       |     |\n| MSFT   | 12                | 25.46 | 256 |\n"
    },
    "addFunctionView": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addFunctionView.html",
        "signatures": [
            {
                "full": "addFunctionView(udf|moduleName)",
                "name": "addFunctionView",
                "parameters": [
                    {
                        "full": "udf|moduleName",
                        "name": "udf|moduleName"
                    }
                ]
            }
        ],
        "markdown": "### [addFunctionView](https://docs.dolphindb.com/en/Functions/a/addFunctionView.html)\n\n\n\n#### Syntax\n\naddFunctionView(udf|moduleName)\n\n#### Parameters\n\n**udf** is either a user-defined function or a tuple containing multiple user-defined functions.\n\n**moduleName** is a STRING scalar indicating a module name.\n\nNote:\n\n* Anonymous functions are not supported.\n* A user-defined function can only take scalars, pairs or regular vectors as default parameters.\n* The module specified by*moduleName*must be placed in the modules directory of the current node.\n* When module files have both *.dos* and *.dom* versions, *.dos* is loaded first.\n* When a module is loaded with `use <moduleName>` on the current node, and functions under a namespace with the same name are added as function views, the loaded module takes precedence if the function definitions are different.\n\n#### Details\n\nFunction view provides a flexible way to control user access to databases and tables. A function view is a user-defined function that encapsulates statements that access databases. Even if a user does not have the privilege to read the data of a database, the user can execute the function view to obtain the desired calculation result.\n\nSpecify user defined functions that can be executed by certain users although these users may not have TABLE\\_READ access to the datasets that these functions operate on. For example, a user who cannot see individual patient names or ages may nevertheless calculate the number of patients and the average age of patients.\n\nThe specified user defined functions can be used as the value of the parameter *objs* if the parameter *accessType* is set to VIEW\\_EXEC in command [grant](https://docs.dolphindb.com/en/Functions/g/grant.html), [deny](https://docs.dolphindb.com/en/Functions/d/deny.html) or [revoke](https://docs.dolphindb.com/en/Functions/r/revoke.html).\n\nUnlike other user-defined functions that are session isolated, the function view can be shared between sessions. The definition of the function view is persisted to the controller node, so if the DolphinDB cluster is restarted, the previously defined function view can still be used.\n\n`addFunctionView` can only be executed by administrators or users with VIEW\\_OWNER permission.\n\n#### Examples\n\nIn the following example, the user-defined function `getSpread` calculates the average bid-ask spread for a specified stock in the table *dfs\\://TAQ/quotes*. A user (user1) does not have the privilege to read table *dfs\\://TAQ/quotes*. Now define function `getSpread` to be a function view, and grant user1 the privilege to execute the function view. Although user1 cannot read the raw data of table *dfs\\://TAQ/quotes*, now she can execute the function view to calculate the average bid-ask spread of any stock in the table.\n\nPlease note that as table *dfs\\://TAQ/quotes* is a distributed database, the following script needs to be executed by a system administrator. User1 can execute function `getSpread` on any data node/compute node.\n\n```\ndef getSpread(s, d){\n    return select avg((ofr-bid)/(ofr+bid)*2) as spread from loadTable(\"dfs://TAQ\",\"quotes\") where symbol=s, date=d\n}\n```\n\n```\naddFunctionView(getSpread)\n\n// grant privileges on a controller\ngrant(\"user1\", VIEW_EXEC, \"getSpread\")\n```\n\nA module test.dos which defines functions `f1` and `f2` is placed under the modules directory:\n\n```\naddFunctionView(\"test\")\n\n// Grant user1 the execution privilege of f1\ngrant(\"user1\", VIEW_EXEC, \"test::f1\")\n// Grant user1 the execution privilege of all functions under test\ngrant(`user1, VIEW_EXEC, \"test::*\")\n\n// A granted user can use the fully qualified name to call a function\ntest::f1()\n```\n\n**Related functions**: [dropFunctionView](https://docs.dolphindb.com/en/Functions/d/dropFunctionView.html), [getFunctionViews](https://docs.dolphindb.com/en/Functions/g/getFunctionViews.html)\n"
    },
    "addGpFunction": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addGpFunction.html",
        "signatures": [
            {
                "full": "addGpFunction(engine, func)",
                "name": "addGpFunction",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    }
                ]
            }
        ],
        "markdown": "### [addGpFunction](https://docs.dolphindb.com/en/Functions/a/addGpFunction.html)\n\n**Note:** This function is not supported by Community Edition. You can [get a trial](https://dolphindb.com/product#downloads-down) of Shark from DolphinDB official website.\n\n#### Syntax\n\naddGpFunction(engine, func)\n\n#### Parameters\n\n**engine** is the engine object returned by `createGPLearnEngine`.\n\n**func**is a user-defined function. Currently it does not support complex assignment, `if` or `for` statement. Only `return` statement can be used to return a combination of the training functions (see Appendix for supported functions). For example:\n\n```\ndef f(x, y){\n  return cos(x+y)\n}\n```\n\n#### Details\n\nAdd a user-defined training function to the GPLearn engine.\n\n#### Examples\n\n```\ndef f(x, y){\n  return cos(x+y)\n}\naddGpFunction(engine,f)\n```\n\n\n\n#### Appendix\n\nThe following table lists available functions for building and evolving formulas.\n\n| Function        | Description                                                                              |\n| --------------- | ---------------------------------------------------------------------------------------- |\n| add(x,y)        | Addition                                                                                 |\n| sub(x,y)        | Subtraction                                                                              |\n| mul(x,y)        | Multiplication                                                                           |\n| div(x,y)        | Division. If the absolute value of the divisor is less than 0.001, returns 1.            |\n| max(x,y)        | Maximum value                                                                            |\n| min(x,y)        | Minimum value                                                                            |\n| sqrt(x)         | Square root of the absolute value                                                        |\n| log(x)          | Logarithm. If x is less than 0.001, returns 0.                                           |\n| neg(x)          | Negation                                                                                 |\n| reciprocal(x)   | Reciprocal. If the absolute value of x is less than 0.001, returns 0.                    |\n| abs(x)          | Absolute value                                                                           |\n| sin(x)          | Sine function                                                                            |\n| cos(x)          | Cosine function                                                                          |\n| tan(x)          | Tangent function                                                                         |\n| sig(x)          | Sigmoid function                                                                         |\n| signum(x)       | Returns the sign of x                                                                    |\n| mcovar(x, y, n) | Covariance of x and y within a sliding window of size n                                  |\n| mcorr(x, y, n)  | Correlation of x and y within a sliding window of size n                                 |\n| mstd(x, n)      | Sample standard deviation of x within a sliding window of size n                         |\n| mmax(x, n)      | Maximum value of x within a sliding window of size n                                     |\n| mmin(x, n)      | Minimum value of x within a sliding window of size n                                     |\n| msum(x, n)      | Sum of x within a sliding window of size n                                               |\n| mavg(x, n)      | Average of x within a sliding window of size n                                           |\n| mprod(x, n)     | Product of x within a sliding window of size n                                           |\n| mvar(x, n)      | Sample variance of x within a sliding window of size n                                   |\n| mvarp(x, n)     | Population variance of x within a sliding window of size n                               |\n| mstdp(x, n)     | Population standard deviation of x within a sliding window of size n                     |\n| mimin(x, n)     | Index of the minimum value of x within a sliding window of size n                        |\n| mimax(x, n)     | Index of the maximum value of x within a sliding window of size n                        |\n| mbeta(x, y, n)  | Least-squares estimate of the regression coefficient of x on y within a window of size n |\n| mwsum(x, y, n)  | Iner product of x and y within a sliding window of size n                                |\n| mwavg(x, y, n)  | Weighted average of x with y as weights within a sliding window of size n                |\n| mfirst(x,n)     | First element of the window of size n                                                    |\n| mlast(x,n)      | Last element of the window of size n                                                     |\n| mrank(x,asc, n) | Rank of x within the sliding window of size n                                            |\n| ratios(x)       | Returns the value of x(n)/x(n−1)x(n) / x(n-1)                                            |\n| deltas(x)       | Returns the value of x(n)−x(n−1)x(n) - x(n-1)                                            |\n\nNote: For moving window operators (such as `mmax(x, n)`), the parameter *n*, which represents the window size, is randomly selected from the *windowRange*vector specified in the `createGPLearnEngine` function. In the following example, the training process randomly selects a value from \\[7,14,21] as the window size.\n\n```\nengine = createGPLearnEngine(source, predVec, windowRange=[7,14,21])\n```\n"
    },
    "addGroupMember": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addGroupMember.html",
        "signatures": [
            {
                "full": "addGroupMember(userIds, groupIds)",
                "name": "addGroupMember",
                "parameters": [
                    {
                        "full": "userIds",
                        "name": "userIds"
                    },
                    {
                        "full": "groupIds",
                        "name": "groupIds"
                    }
                ]
            }
        ],
        "markdown": "### [addGroupMember](https://docs.dolphindb.com/en/Functions/a/addGroupMember.html)\n\n\n\n#### Syntax\n\naddGroupMember(userIds, groupIds)\n\n#### Parameters\n\n**userIds** is a STRING scalar/vector indicating a user name or multiple user names.\n\n**groupIds** is a STRING scalar/vector indicating a group name or multiple group names.\n\n*userIds* and *groupIds* cannot both be vectors.\n\n#### Details\n\nAdd a user to a group or multiple groups, or add multiple users to a group.\n\nIt can only be executed by an administrator.\n\n#### Examples\n\n```\naddGroupMember(`AlexSmith`JoshAllen, `production);\n```\n"
    },
    "addIPBlackList": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addipblacklist.html",
        "signatures": [
            {
                "full": "addIPBlackList(ips)",
                "name": "addIPBlackList",
                "parameters": [
                    {
                        "full": "ips",
                        "name": "ips"
                    }
                ]
            }
        ],
        "markdown": "### [addIPBlackList](https://docs.dolphindb.com/en/Functions/a/addipblacklist.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\naddIPBlackList(ips)\n\n#### Parameters\n\n**ips** is a STRING or IPADDR scalar/vector indicating one or more (up to 65535) IP addresses.\n\n#### Details\n\nAdd IP addresses to the blacklist. The blacklist feature is enabled when the first IP address is added. The whitelist and blacklist cannot be enabled simultaneously. After the blacklist feature is enabled, all the access requests from IP addresses in the blacklist are blocked.\n\nThis function can only be executed by an administrator and takes effect on the cluster.\n\n#### Examples\n\n```\naddIPBlackList([\"1.1.1.1\", \"2.2.2.2\", \"3.3.3.3\"])\n```\n\nRelated functions: [removeIPBlackList](https://docs.dolphindb.com/en/Functions/r/removeipblacklist.html), [getIPBlackList](https://docs.dolphindb.com/en/Functions/g/getipblacklist.html)\n"
    },
    "addIPWhiteList": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addipwhitelist.html",
        "signatures": [
            {
                "full": "addIPWhiteList(ips)",
                "name": "addIPWhiteList",
                "parameters": [
                    {
                        "full": "ips",
                        "name": "ips"
                    }
                ]
            }
        ],
        "markdown": "### [addIPWhiteList](https://docs.dolphindb.com/en/Functions/a/addipwhitelist.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\naddIPWhiteList(ips)\n\n#### Parameters\n\n**ips** is a STRING or IPADDR scalar/vector indicating one or more (up to 65535) IP addresses.\n\n#### Details\n\nAdd IP addresses to the whitelist. The whitelist feature is enabled when the first IP address is added. The whitelist and blacklist cannot be enabled simultaneously. After the whitelist feature is enabled, only the access requests from IP addresses in the whitelist are allowed. The local host 127.0.0.1 is included by default.\n\nThis function can only be executed by an administrator and takes effect on the cluster.\n\n#### Examples\n\n```\naddIPWhiteList([\"1.1.1.1\", \"2.2.2.2\", \"3.3.3.3\"])\n```\n\nRelated functions: [removeIPWhiteList](https://docs.dolphindb.com/en/Functions/r/removeipwhitelist.html), [getIPWhiteList](https://docs.dolphindb.com/en/Functions/g/getipwhitelist.html)\n"
    },
    "addMarketHoliday": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addMarketHoliday.html",
        "signatures": [
            {
                "full": "addMarketHoliday(marketName, holiday)",
                "name": "addMarketHoliday",
                "parameters": [
                    {
                        "full": "marketName",
                        "name": "marketName"
                    },
                    {
                        "full": "holiday",
                        "name": "holiday"
                    }
                ]
            },
            {
                "full": "addMarketHoliday(marketName, holiday, [dateType = 'holidayDate'])",
                "name": "addMarketHoliday",
                "parameters": [
                    {
                        "full": "marketName",
                        "name": "marketName"
                    },
                    {
                        "full": "holiday",
                        "name": "holiday"
                    },
                    {
                        "full": "[dateType = 'holidayDate']",
                        "name": "[dateType = 'holidayDate']"
                    }
                ]
            }
        ],
        "markdown": "### [addMarketHoliday](https://docs.dolphindb.com/en/Functions/a/addMarketHoliday.html)\n\n\n\n#### Syntax\n\naddMarketHoliday(marketName, holiday)\n\naddMarketHoliday(marketName, holiday, \\[dateType = 'holidayDate'])\n\n#### Parameters\n\n**marketName** is a STRING scalar, indicating the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name.\n\n**holiday** is a vector of DATE type, indicating weekday holidays.\n\n**holiday** is a vector of DATE type, indicating holiday dates or trading dates.\n\n* When *dateType*='holidayDate', *holiday* should be specified as the dates of weekday holidays.\n\n* When *dateType*='tradingDate', *holiday* should be specified as trading dates.\n\n**dateType** (optional) is a string, indicating the type of the added file from which the trading calendar is generated. It can take one of the following values: 'holidayDate' (default) and 'tradingDate'.\n\n#### Details\n\nAdds a holiday calendar online to generate a trading calendar.Adds a file of holiday dates or trading dates to generate a trading calendar. A CSV file named *marketName* will be generated in the directory specified by *marketHolidayDir*.\n\nNote:\n\n* It can only be executed by an administrator.\n\n* It only takes effect on the current node. In a cluster, `pnodeRun` can be used to call this function on all data/compute nodes.\n\n* *marketName*must consist of four uppercase letters and cannot be the same as the file name in *marketHolidayDir*.\n\n#### Examples\n\nExample 1: Adding a custom trading calendar with *holiday* containing dates of weekday holidays\n\nThe following example demonstrates how to manually add a trading calendar named \"DCBA\".\n\n```\naddMarketHoliday(\"DCBA\",2022.01.03 2022.01.05)\n```\n\nA file named *DCBA.csv* will be generated in */server/marketHoliday/*, containing all specified holidays.\n\n**Note**: When attempting to create a trading calendar, if you use an identifier (like \"DCBA\") that already exists in the */server/marketHoliday/* directory, the system will block the operation with an error message: `The added market '<marketName>' already exists`, preventing duplication of trading calendars.\n\n```\ntemporalAdd(2022.01.01,1,\"DCBA\")\n//Output: 2022.01.04\n```\n\n```\nindex = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.04]\ns = indexedSeries(index, 1..4)\ns.resample(\"DCBA\", sum);\n/* output\nlabel\tcol1\n2021.12.31   6\n2022.01.04   4\n*/\n```\n\nExample 2: Adding a custom trading calendar with *holiday* containing trading dates on weekends\n\nThe following example demonstrates how to manually add a trading calendar named \"AAAA\".\n\n```\ntradingDates=[2024.02.08, 2024.02.09, 2024.02.18, 2024.02.19, 2024.02.20, 2024.02.21]\naddMarketHoliday(marketName=\"AAAA\", holiday=tradingDates, dateType='tradingDate')\n```\n\nA file named *AAAA.csv* will be generated in */server/marketHoliday/*. In the file is a column named \"tradingDate\", which contains data from the vector *tradingDates*.\n\n```\ntemporalAdd(2024.02.09, 1, \"AAAA\") \n// Output: 2024.02.18\n```\n\n```\ntemporalAdd(2024.02.21, 1, \"AAAA\")\n// Dates not included in AAAA.csv will throw an error: The returned date does not exist in trading calendar [AAAA].\n```\n\nRelated functions: [updateMarketHoliday](https://docs.dolphindb.com/en/Functions/u/updateMarketHoliday.html), [getMarketCalendar](https://docs.dolphindb.com/en/Functions/g/getMarketCalendar.html), [getTradingCalendarType](https://docs.dolphindb.com/en/Functions/g/getTradingCalendarType.html).\n"
    },
    "addMCPPrompt": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addMCPPrompt.html",
        "signatures": [
            {
                "full": "addMCPPrompt(name, message, [description], [extraInfo])",
                "name": "addMCPPrompt",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "message",
                        "name": "message"
                    },
                    {
                        "full": "[description]",
                        "name": "description",
                        "optional": true
                    },
                    {
                        "full": "[extraInfo]",
                        "name": "extraInfo",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [addMCPPrompt](https://docs.dolphindb.com/en/Functions/a/addMCPPrompt.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\naddMCPPrompt(name, message, \\[description], \\[extraInfo])\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the prompt template.\n\n**message** is a STRING scalar indicating the content of the prompt template. It can contain the placeholder `{}`.\n\n**description** (optional) is a STRING scalar indicating the description of the prompt template.\n\n**extraInfo** (optional) is a dictionary with STRING keys and ANY or STRING values used to specify additional information. Currently support \"title\" only.\n\n#### Details\n\nDefines an MCP prompt template.\n\n**Return value**: A string indicating the name of the newly added MCP prompt template.\n\n#### Examples\n\n```\naddMCPPrompt(\n  name = \"stock_summary\",\n  message = \"Summary the trend of ${stock} from ${startDate} to ${endDate}.\",\n  description = \"Generate a natural-language overview of a stock over a time period\",\n  extraInfo = {title : \"Stock Trend Summary\"}\n)\n\n//output:'stock_summary'\n```\n"
    },
    "addMCPTool": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addMCPTool.html",
        "signatures": [
            {
                "full": "addMCPTool(name, func, [argNames], [argTypes], [description], [extraInfo])",
                "name": "addMCPTool",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "[argNames]",
                        "name": "argNames",
                        "optional": true
                    },
                    {
                        "full": "[argTypes]",
                        "name": "argTypes",
                        "optional": true
                    },
                    {
                        "full": "[description]",
                        "name": "description",
                        "optional": true
                    },
                    {
                        "full": "[extraInfo]",
                        "name": "extraInfo",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [addMCPTool](https://docs.dolphindb.com/en/Functions/a/addMCPTool.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\naddMCPTool(name, func, \\[argNames], \\[argTypes], \\[description], \\[extraInfo])\n\n#### Parameters\n\n**name** is a STRING scalar, indicating the tool name.\n\n**func** is a user-defined function.\n\n**argNames** is a STRING vector specifying the argument names. Pass `[]` if no parameters are required.\n\n**argTypes** is a STRING vector specifying the data types of arguments, which can be DolphinDB data types or JSON data types. Supported types include:\n\n| DolphinDB Type | JSON Type         |\n| -------------- | ----------------- |\n| STRING         | \"string\"          |\n| TEMPORAL       | \"string\"          |\n| DOUBLE         | \"number\"          |\n| BOOL           | \"boolean\"         |\n| STRING\\[]      | \"array\\<string>\"  |\n| TEMPORAL\\[]    | \"array\\<string>\"  |\n| DOUBLE\\[]      | \"array\\<number>\"  |\n| BOOL\\[]        | \"array\\<boolean>\" |\n\n**description** (optional) A STRING scalar describing the tool.\n\n**extraInfo** (optional) A dictionary where keys are strings and values are of type ANY or STRING, used to specify additional metadata. Currently,the only supported key is \"title\"\n\n#### Details\n\nDefines a new MCP tool.\n\n**Return value**: A string representing the tool name.\n\n#### Examples\n\n```\ndef myTool(x) {\n   return x * 2 + 1\n}\n\ninfo = {\n    \"title\": \"DolphinDB Tools\"\n}\n\naddMCPTool(name=\"myTool\", func=myTool, argNames=[\"a\"], argTypes=[\"number\"], description=\"This is a tool\", extraInfo=info)\n```\n"
    },
    "addMetrics": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addMetrics.html",
        "signatures": [
            {
                "full": "addMetrics(engine, newMetrics, newMetricsSchema, [windowSize], [fill])",
                "name": "addMetrics",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "newMetrics",
                        "name": "newMetrics"
                    },
                    {
                        "full": "newMetricsSchema",
                        "name": "newMetricsSchema"
                    },
                    {
                        "full": "[windowSize]",
                        "name": "windowSize",
                        "optional": true
                    },
                    {
                        "full": "[fill]",
                        "name": "fill",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [addMetrics](https://docs.dolphindb.com/en/Functions/a/addMetrics.html)\n\n\n\n#### Syntax\n\naddMetrics(engine, newMetrics, newMetricsSchema, \\[windowSize], \\[fill])\n\nAlias: extendMetrics\n\n#### Parameters\n\n**engine** is the abstract table object returned by a streaming engine function such as [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html). Note that `addMetrics` cannot be used in [createAnomalyDetectionEngine](https://docs.dolphindb.com/en/Functions/c/createAnomalyDetectionEngine.html) and [createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html).\n\n**newMetrics** is metacode indicating the new metrics to be calculated by the streaming engine. The metacode can include one or more expressions, built-in or user-defined functions, or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n**newMetricsSchema** is a table object specifying the column names and data types of the new metrics in the output table.\n\n**windowSize** (optional) is a positive integer indicating the length of the windows for calculation for the new metrics. It is only used for the time-series engine. It must be one of the values of *windowSize* in the existing time-series engine. The default value is the first value of *windowSize* in the existing time-series engine.\n\n**fill** (optional) is a vector/scalar indicating the filling method to deal with an empty window (in a group). It can be:\n\n* 'none': no result\n\n* 'null': output a null value.\n\n* 'ffill': output the result in the last window.\n\n* specific value: output the specified value. Its type should be the same as metrics output's type.\n\n*fill* could be a vector to specify different filling method for each metric. The size of the vector must be consistent with the number of elements specified in *metrics*. The element in vector cannot be 'none'.\n\n#### Details\n\nDynamically add new measures to a streaming engine.\n\n#### Examples\n\nCalculate the sum of column x with a streaming engine:\n\n```\nshare streamTable(10000:0,`time`id`x, [TIMESTAMP,SYMBOL,INT]) as t\noutput1 = table(10000:0, `time`sum_x, [TIMESTAMP,INT])\nagg1 = createTimeSeriesEngine(name=`agg1, windowSize=100, step=50, metrics=<sum(x)>, dummyTable=t, outputTable=output1, timeColumn=`time)\nsubscribeTable(tableName=\"t\", actionName=\"agg1\", offset=0, handler=append!{agg1}, msgAsTable=true)\nn=500\ntime=2019.01.01T00:00:00.000+(1..n)\nid=take(`ABC`DEF, n)\nx=1..n\ninsert into t values(time, id, x);\nselect * from output1;\n```\n\n| time                    | sum\\_x |\n| ----------------------- | ------ |\n| 2019.01.01T00:00:00.050 | 1,225  |\n| 2019.01.01T00:00:00.100 | 4,950  |\n| 2019.01.01T00:00:00.150 | 9,950  |\n| 2019.01.01T00:00:00.200 | 14,950 |\n| 2019.01.01T00:00:00.300 | 24,950 |\n| 2019.01.01T00:00:00.350 | 29,950 |\n| 2019.01.01T00:00:00.400 | 34,950 |\n| 2019.01.01T00:00:00.450 | 39,950 |\n| 2019.01.01T00:00:00.500 | 44,950 |\n\nNow add a new measure `avg(x)` to the streaming engine. The new measure's column name is avg\\_x and the data type is DOUBLE in the output table.\n\n```\nnewMetricsSchema= table(1:0, [`avg_x], [DOUBLE])\naddMetrics(agg1, <avg(x)>, newMetricsSchema);\nn=300\ntime=2019.01.01T00:00:00.500+(1..n)\nid=take(`ABC`DEF, n)\nx=500+1..n\ninsert into t values(time, id, x);\nselect * from output1;\n```\n\n| time                    | sum\\_x | avg\\_x |\n| ----------------------- | ------ | ------ |\n| 2019.01.01T00:00:00.050 | 1,225  |        |\n| 2019.01.01T00:00:00.100 | 4,950  |        |\n| 2019.01.01T00:00:00.150 | 9,950  |        |\n| 2019.01.01T00:00:00.200 | 14,950 |        |\n| 2019.01.01T00:00:00.250 | 19,950 |        |\n| 2019.01.01T00:00:00.300 | 24,950 |        |\n| 2019.01.01T00:00:00.350 | 29,950 |        |\n| 2019.01.01T00:00:00.400 | 34,950 |        |\n| 2019.01.01T00:00:00.450 | 39,950 |        |\n| 2019.01.01T00:00:00.500 | 44,950 |        |\n| 2019.01.01T00:00:00.550 | 49,950 | 525    |\n| 2019.01.01T00:00:00.600 | 54,950 | 550    |\n| 2019.01.01T00:00:00.650 | 59,950 | 599.5  |\n| 2019.01.01T00:00:00.700 | 64,950 | 649.5  |\n| 2019.01.01T00:00:00.750 | 69,950 | 699.5  |\n| 2019.01.01T00:00:00.800 | 74,950 | 749.5  |\n"
    },
    "addNode": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addNode.html",
        "signatures": [
            {
                "full": "addNode(host, port, alias, [saveConfig=true], [nodeType='datanode'], [computeGroup]), [zone])",
                "name": "addNode",
                "parameters": [
                    {
                        "full": "host",
                        "name": "host"
                    },
                    {
                        "full": "port",
                        "name": "port"
                    },
                    {
                        "full": "alias",
                        "name": "alias"
                    },
                    {
                        "full": "[saveConfig=true]",
                        "name": "saveConfig",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[nodeType='datanode']",
                        "name": "nodeType",
                        "optional": true,
                        "default": "'datanode'"
                    },
                    {
                        "full": "[computeGroup])",
                        "name": "computeGroup",
                        "optional": true
                    },
                    {
                        "full": "[zone]",
                        "name": "zone",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [addNode](https://docs.dolphindb.com/en/Functions/a/addNode.html)\n\n\n\n#### Syntax\n\naddNode(host, port, alias, \\[saveConfig=true], \\[nodeType='datanode'], \\[computeGroup]), \\[zone])\n\n#### Parameters\n\n**host** is a STRING scalar or vector indicating the IP address of the node(s).\n\n**port** is a positive integral scalar or vector indicating the port number of the node(s).\n\n**alias** is a STRING scalar or vector indicating the node alias(es).\n\n**saveConfig** (optional) is a Boolean value indicating whether to save the information of the node in the configuration file `cluster.nodes` when adding the node. The default value is true.\n\n**nodeType** (optional) is a STRING scalar or vector indicating the node type(s), which can be 'datanode' or 'computenode'.\n\n**computeGroup** (optional) is a string indicating the compute group to which the compute node belongs to. If not specified, a compute node will be added without joining any compute group, and partition data will not be cached on the node.\n\n**zone** (optional) is a string indicating the zone to which the node belongs to. If the cluster.nodes file has already defined zones, this parameter becomes mandatory and must match one of the zones. It cannot be set to an undefined zone or the default zone.\n\nNote that the length of *host*, *port*, *alias*, *nodeType* must be consistent.\n\n#### Details\n\nAdd node(s) to a cluster. It can only be executed by administrator. The added nodes are not started. You can start the nodes in the cluster management web interface or in the command line.\n\nNote that you need to deploy an agent before adding a node on a new machine.\n\n#### Examples\n\nAdd a compute node “orca4”, and specify its compute group “orca”.\n\n```\naddNode(\"192.168.1.243\", 23796, \"orca4\", true, 'computenode', \"orca\");\n```\n"
    },
    "addRangePartitions": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addRangePartitions.html",
        "signatures": [
            {
                "full": "addRangePartitions(dbHandle, newRanges, [level=0], [locations])",
                "name": "addRangePartitions",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "newRanges",
                        "name": "newRanges"
                    },
                    {
                        "full": "[level=0]",
                        "name": "level",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[locations]",
                        "name": "locations",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [addRangePartitions](https://docs.dolphindb.com/en/Functions/a/addRangePartitions.html)\n\n* **[addGpFunction](https://docs.dolphindb.com/en/Functions/a/addGpFunction.html)**\n\n\n\n#### Syntax\n\naddRangePartitions(dbHandle, newRanges, \\[level=0], \\[locations])\n\n#### Parameters\n\n**dbHandle** is a database handle.\n\n**newRanges** is a vector indicating new partitions. The elements in the vector must be in ascending order. The first element must be the same as the last element or the original partition scheme.\n\n**level** (optional) is a non-negative integer. For a partitioned database with COMPO domain, we need to specify the level of the partitions that `addRangePartitions` applies if it is not for the first level of partitions. This level must be of a RANGE domain. The default value is 0.\n\n**locations** (optional) is a STRING scalar/vector. If the paramater *locations* was specified when the database was created, we can use *locations* to specify where the new partitions located.\n\n#### Details\n\nAppend new values to the partition scheme of a database. This database must be of RANGE domain or of COMPO domain with at least one level of RANGE domain. Note that the new partition can only be added after the last existing partition.\n\n#### Examples\n\nIn the following example, we add 3 new ID partitions \\[100,150), \\[150,200) and \\[200,250) to the partition scheme of a database of COMPO domain.\n\n```\nn=1000000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(date, ID, x);\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndbID=database(, RANGE, 0 50 101);\ndb = database(\"dfs://compoDB\", COMPO, [dbDate,dbID]);\npt = db.createPartitionedTable(t, `pt, `date`ID)\npt.append!(t);\n\naddRangePartitions(db,101 150 200 250,1)\n// output: 3\n```\n\nBefore appending data to the new partitions, we need to reload the table.\n\n```\ndb=database(\"dfs://compoDB\")\npt=loadTable(db,\"pt\")\n\nt1=table(rand(101..249,n) as ID,rand(2017.08.07..2017.08.11,n) as date,rand(10.0,n) as x)\npt.append!(t1);\n\nselect count(*) from loadTable(\"dfs://compoDB\",\"pt\");\n// output: 2000000\n```\n\nTo add new partitions consecutively without appending new data, we need to reload the database before each `addRangePartitions` operation.\n\n```\ndb=database(\"dfs://compoDB\")\npt=loadTable(db,\"pt\")\n\nt1=table(rand(2017.08.07..2017.08.11,n) as date, rand(101..249,n) as ID, rand(10.0,n) as x)\npt.append!(t1);\n\nselect count(*) from loadTable(\"dfs://compoDB\",\"pt\");\n//output: 2000000\n```\n"
    },
    "addReactiveMetrics": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addReactiveMetrics.html",
        "signatures": [
            {
                "full": "addReactiveMetrics(name, metricNames, metrics)",
                "name": "addReactiveMetrics",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metricNames",
                        "name": "metricNames"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    }
                ]
            }
        ],
        "markdown": "### [addReactiveMetrics](https://docs.dolphindb.com/en/Functions/a/addReactiveMetrics.html)\n\n\n\n#### Syntax\n\naddReactiveMetrics(name, metricNames, metrics)\n\n#### Details\n\nDynamically add new factors to a reactive state engine generated by `createNarrowReactiveStateEngine`. The added factors take effect on subsequent incoming data.\n\n#### Parameters\n\n**name**is a string indicating the engine name.\n\n**metricNames** is a STRING scalar or vector, indicating the name of the new factor. The number and order of names must align to that of factors specified in *metrics*.\n\n**metrics** is metacode or a tuple of metacode containing new factors.\n\n#### Examples\n\n```\ndummy = streamTable(1:0, [\"securityID1\",\"securityID2\",\"securityID3\",\"createTime\",\"updateTime\",\"upToDatePrice\",\"qty\",\"value\"], [STRING,STRING,STRING,TIMESTAMP,TIMESTAMP,DOUBLE,DOUBLE,INT]) \noutputTable = streamTable(1:0,[\"securityID1\",\"securityID2\",\"securityID3\",\"createTime\",\"updateTime\",\"metricNames\",\"factorValue\"], [STRING,STRING,STRING, TIMESTAMP,TIMESTAMP,STRING,DOUBLE])\nfactor = [<createTime>, <updateTime>,<cumsum(qty)>]\nNarrowtest = createNarrowReactiveStateEngine(name=\"narrowtest1\",metrics=factor,metricNames=\"factor1\",dummyTable=dummy,outputTable=outputTable,keyColumn=[\"securityID1\",\"securityID2\",\"securityID3\"])\nnum = 5\ntmp = table(take(\"A\" + lpad(string(1..4),4,\"0\"),num) as securityID1,take(\"CC.HH\" + lpad(string(21..34),4,\"0\"),num) as securityID2,take(\"FFICE\" + lpad(string(13..34),4,\"0\"),num) as securityID3, 2023.09.01 00:00:00+(1..num) as createTime, 2023.09.01 00:00:00+(1..num) as updateTime,100.0+(1..num) as upToDatePrice, 130.0+(1..num) as qty,take(1..3,num) as value)\nNarrowtest.append!(tmp)\n\nselect * from outputTable\n\n/*\nsecurityID1\tsecurityID2\tsecurityID3\tcreateTime\tupdateTime\tmetricNames\tfactorValue\nA0001\tCC.HH0021\tFFICE0013\t2023.09.01T00:00:01.000\t2023.09.01T00:00:01.000\tfactor1\t131\nA0002\tCC.HH0022\tFFICE0014\t2023.09.01T00:00:02.000\t2023.09.01T00:00:02.000\tfactor1\t132\nA0003\tCC.HH0023\tFFICE0015\t2023.09.01T00:00:03.000\t2023.09.01T00:00:03.000\tfactor1\t133\nA0004\tCC.HH0024\tFFICE0016\t2023.09.01T00:00:04.000\t2023.09.01T00:00:04.000\tfactor1\t134\nA0001\tCC.HH0025\tFFICE0017\t2023.09.01T00:00:05.000\t2023.09.01T00:00:05.000\tfactor1\t135\n*/\n\nmetrics = [<cumavg(upToDatePrice)>]\naddReactiveMetrics(\"narrowtest1\", \"factor2\", metrics)\n\n// After adding a new factor, the arrival of the new data to the engine will output the results of updated metrics\ntmp1 = table(\"A5\" as securityID1,\"CC.HH0033\" as securityID2,\"FFICE0034\" as securityID3, 2023.09.01 00:00:11 as createTime, 2023.09.01 00:00:09 as updateTime,59 as upToDatePrice,100 as qty,13 as value)\nNarrowtest.append!(tmp1)\nselect * from outputTable where securityID1=\"A5\"\n\n/*\nsecurityID1\tsecurityID2\tsecurityID3\tcreateTime\tupdateTime\tmetricNames\tfactorValue\nA5\tCC.HH0033\tFFICE0034\t2023.09.01T00:00:11.000\t2023.09.01T00:00:09.000\tfactor1\t100\nA5\tCC.HH0033\tFFICE0034\t2023.09.01T00:00:11.000\t2023.09.01T00:00:09.000\tfactor2\t59\n*/\n```\n\nRelated functions: [createNarrowReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createNarrowReactiveStateEngine.html),[getReactiveMetrics](https://docs.dolphindb.com/en/Functions/g/getReactiveMetrics.html)\n"
    },
    "addSparseReactiveMetrics": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addSparseReactiveMetrics.html",
        "signatures": [
            {
                "full": "addSparseReactiveMetrics(name, metrics)",
                "name": "addSparseReactiveMetrics",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    }
                ]
            }
        ],
        "markdown": "### [addSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/a/addSparseReactiveMetrics.html)\n\n\n\n#### Syntax\n\naddSparseReactiveMetrics(name, metrics)\n\n#### Details\n\nAdds sparse state computation rules to the specified SparseReactiveStateEngine. The format of the new *metrics* is the same as the *metrics* parameter of `createSparseReactiveStateEngine`.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the SparseReactiveStateEngine to which rules are added.\n\n**metrics** is a table representing the set of rules to be added. Its schema is the same as the *metrics* parameter of `createSparseReactiveStateEngine`: `keyColumn(s), formula, outputMetricKey`.\n\n#### Returns\n\nReturns no value or returns an execution status (subject to the actual product implementation).\n\n#### Examples\n\n```\nnewMetrics = table(\n    [\"A003\"] as deviceID,\n    [\"mavg(value,3)\"] as formula,\n    [\"A003_1\"] as outputMetricKey\n)\naddSparseReactiveMetrics(\"demoengine\", newMetrics)\n```\n\n**Related functions**: [createSparseReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createSparseReactiveStateEngine.html), [getSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/g/getSparseReactiveMetrics.html), [deleteSparseReactiveMetric](https://docs.dolphindb.com/en/Functions/d/deleteSparseReactiveMetric.html)\n"
    },
    "addValuePartitions": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addValuePartitions.html",
        "signatures": [
            {
                "full": "addValuePartitions(dbHandle, newValues, [level=0], [locations])",
                "name": "addValuePartitions",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "newValues",
                        "name": "newValues"
                    },
                    {
                        "full": "[level=0]",
                        "name": "level",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[locations]",
                        "name": "locations",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [addValuePartitions](https://docs.dolphindb.com/en/Functions/a/addValuePartitions.html)\n\n\n\n#### Syntax\n\naddValuePartitions(dbHandle, newValues, \\[level=0], \\[locations])\n\n#### Parameters\n\n**dbHandle** is a database handle.\n\n**newValues** is a scalar or vector indicating new partitions.\n\n**level** (optional) is a non-negative integer. For a partitioned database with COMPO domain, we need to specify the level of the partitions that `addValuePartitions` applies if it is not for the first level of partitions. This level must be of a VALUE domain. The default value is 0.\n\n**locations** (optional) is a STRING scalar/vector. If the paramater *locations* was specified when the database was created, we can use *locations* to specify where the new partitions located.\n\n#### Details\n\nAppend new values to the partition scheme of a database.\n\nThis database must be of VALUE domain or of COMPO domain with at least one level of VALUE domain.\n\n#### Examples\n\nIn the following example, we append (2017.08.12..2017.08.20) to the partition scheme of a database of COMPO domain.\n\n```\nn=1000000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\n\ndbID=database(, RANGE, 0 50 100);\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndb = database(\"dfs://compoDB\", COMPO, [dbID, dbDate]);\npt = db.createPartitionedTable(t, `pt, `ID`date)\npt.append!(t)\n\naddValuePartitions(db,2017.08.12..2017.08.20,1)\n// output: 9\n```\n\nTo add new partitions consecutively without appending new data, we need to reload the database before each `addValuePartitions` operation.\n\n```\ndb=database(\"dfs://compoDB\")\npt=loadTable(db,\"pt\")\n\nt1=table(0..99 as ID,take(2017.08.12,100) as date,rand(10.0,100) as x)\npt.append!(t1)\n\nselect count(*) from loadTable(\"dfs://compoDB\",\"pt\")\n// output: 1000100\n```\n"
    },
    "addVolumes": {
        "url": "https://docs.dolphindb.com/en/Functions/a/addVolumes.html",
        "signatures": [
            {
                "full": "addVolumes(volumes)",
                "name": "addVolumes",
                "parameters": [
                    {
                        "full": "volumes",
                        "name": "volumes"
                    }
                ]
            }
        ],
        "markdown": "### [addVolumes](https://docs.dolphindb.com/en/Functions/a/addVolumes.html)\n\n\n\n#### Syntax\n\naddVolumes(volumes)\n\n#### Parameters\n\n**volumes** is a STRING scalar or vector indicating the volume path(s).\n\n#### Details\n\nDynamically add volume(s) without rebooting the cluster.\n\nNote: This command does not modify the cluster configuration file. Please manually update the configuration file before the next cluster reboot, or data cannot be written to the new volume(s) after reboot.\n\n#### Examples\n\n```\naddVolumes(\"/home/dolphindb/data\")\n```\n"
    },
    "addEventListener": {
        "url": "https://docs.dolphindb.com/en/Functions/a/add_event_listener.html",
        "signatures": [
            {
                "full": "addEventListener(handler, [eventType], [condition], [times=\"all\"], [at], [wait], [within], [exceedTime], [name])",
                "name": "addEventListener",
                "parameters": [
                    {
                        "full": "handler",
                        "name": "handler"
                    },
                    {
                        "full": "[eventType]",
                        "name": "eventType",
                        "optional": true
                    },
                    {
                        "full": "[condition]",
                        "name": "condition",
                        "optional": true
                    },
                    {
                        "full": "[times=\"all\"]",
                        "name": "times",
                        "optional": true,
                        "default": "\"all\""
                    },
                    {
                        "full": "[at]",
                        "name": "at",
                        "optional": true
                    },
                    {
                        "full": "[wait]",
                        "name": "wait",
                        "optional": true
                    },
                    {
                        "full": "[within]",
                        "name": "within",
                        "optional": true
                    },
                    {
                        "full": "[exceedTime]",
                        "name": "exceedTime",
                        "optional": true
                    },
                    {
                        "full": "[name]",
                        "name": "name",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [addEventListener](https://docs.dolphindb.com/en/Functions/a/add_event_listener.html)\n\n\n\n#### Syntax\n\naddEventListener(handler, \\[eventType], \\[condition], \\[times=\"all\"], \\[at], \\[wait], \\[within], \\[exceedTime], \\[name])\n\n#### Details\n\nDefines or dynamically adds event listeners within a monitor.\n\n#### Parameters\n\n**handler** is a callback function to be invoked when the event listener triggers.\n\n* If *handler* is triggered by each matched event (with *eventType* specified), it is a unary function that takes the matched event as its parameter.\n\n* If *handler* is triggered by a scheduled time interval (without *eventType*), it is a function without any parameters.\n\n```\ndef action1(stockVal){\n    // insert attributes of event stockVal to a shared table\n    insert into objByName(\"sharedUSPrices\") values([stockVal.price, stockVal.qty])\n}\n```\n\nYou can add listeners dynamically in a *handler*. For example:\n\n```\ndef action1(stockVal){\n    insert into objByName(\"sharedUSPrices\") values([stockVal.price, stockVal.qty])\n    // add a listener\n    addEventListener(handler=action2, eventType=\"Stock\", condition=<self.price > Stock.price>)\n}\n```\n\n**eventType** (optional) is a string scalar indicating the event to be monitored. If set to \"any\", the *handler* will be triggered for any event that matches the specified *condition.*\n\n**condition** (optional) is metacode of Boolean expression to identify the event or pattern of events that you want to match. For example, when *eventType* is \"Stock\", *condition* can be `<Stock.price > 10 and Stock.qty < 10>`.\n\n**times** (optional) is \"all\" or an integer that specifies the lifetime of an event listener by setting a limit on the number of times the *handler*can be triggered. The default value is \"all\", which means the listener remains active within the CEP engine, continuously monitoring for events and invoking the *handler* until the engine is explicitly dropped.\n\n**at** (optional) is a tuple of length 6 that specifies the scheduled time for triggering the *handler*. The tuple takes the following form: `(seconds, minutes, hours, days_of_the_week, days_of_the_month, months)`. For example, `at = (0, 5, , , , )` means the *handler* will be triggered at the 5th minute of every hour.\n\n**wait**(optional) is of DURATION type, indicating the interval to trigger the *handler*. For example, `wait = 60s` means *handler* is triggered every 60 seconds.\n\n**within** (optional) is a DURATION scalar that specifies the time interval during which the *handler* is triggered by matched events. When *within* is specified, *times*must be set to 1. For example, when `within=60s`,\n\n* If one or more matching events occur within a 60-second interval, the *handler*is invoked for the first matching event and the event listener will be removed once the *handler* is triggered.\n\n* If no matching events occur within this interval, the event listener is automatically removed after 60s.\n\n**exceedTime** (optional) is a DURATION scalar that specifies the time interval during which the *handler* is triggered by the absence of matched events. If *exceedTime* is specified, *times* must be set to 1. For example, `exceedTime=60s`,\n\n* If no matching events occur within a 60-second interval, the *handler*is invoked after 60s. The event listener will be removed once the *handler* is triggered.\n\n* If one or more matching events occur within this interval, the listener is automatically removed.\n\n**name**(optional) is a STRING scalar indicating the unique identifier of the listener. The default naming rules are as follows:\n\n* If *condition* is specified, the default name is the string representation of the condition expression.\n* If *condition*is not specified but *eventType* is specified, the default name is*eventType*.\n* If both *condition*and *eventType* are not specified, the default name is \"timer\".\n* If the generated name duplicates with an existing listener, a numeric suffix will be appended automatically to ensure uniqueness.\n\n**Note:**\n\nEvent listeners can be triggered by:\n\n* **specific events**: *eventType* (required), *condition*;\n\n* **time conditions**: *at* or *wait*;\n\n* **a combination of events and time**: *eventType* (required), *condition*, combined with *within* or *exceedTime.*\n\nWhen defining a listener, do not mix parameters for different trigger conditions. For example, you should not specify an *eventType* and a *wait* time together.\n\n#### Returns\n\nReturns an `EventListener` instance.\n\n#### Examples\n\n```\nclass trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    eventTime :: TIMESTAMP\n    def trades(t, m, c, p, q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n        eventTime = now()\n    }\n}\n\nclass mainMonitor:CEPMonitor{\n    tradesTable :: ANY\n    isBusy :: BOOL\n    def mainMonitor(){\n        tradesTable = array(ANY, 0)\n        isBusy = false\n    }\n\n    def updateTrades(event)\n\n    def updateTrades2(event)\n\n    def unOnload(){\n        undef('traderDV', SHARED)\n    }\n\n    def onload(){\n        addEventListener(updateTrades, `trades, , \"all\",,,,,\"trades1\")\n        addEventListener(updateTrades2, `trades, , \"all\",,,,,\"trades2\")\n        traderDV = streamTable(array(STRING, 0) as trader, array(STRING, 0) as market, array(SYMBOL, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(INT, 0) as tradeCount, array(BOOL, 0) as busy, array(DATE, 0) as orderDate, array(TIMESTAMP, 0) as updateTime)\n        share(traderDV, 'traderDV')\n        createDataViewEngine('traderDV', objByName('traderDV'), `trader, `updateTime, true)\n    }\n\n    def updateTrades(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n\n    def updateTrades2(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\nengineCep = createCEPEngine('cep1', <mainMonitor()>, dummy, [trades], 1, 'eventTime', 10000)\ntrade1 = trades('t1', 'sz', 's001', 11.0, 10)\ngo\nappendEvent(engineCep, trade1)\n\nmonitors = getCEPEngineMonitor('cep1',\"cep1\",\"mainMonitor\")\n\nlisteners = monitors.getEventListener()\nprint(listeners)\n// Terminate listener\nlisteners['trades1'].terminate()\nprint(listeners)\n```\n\n**Related functions**: [getEventListener](https://docs.dolphindb.com/en/Functions/g/get_event_listener.html), [terminate](https://docs.dolphindb.com/en/Functions/t/terminate.html)\n"
    },
    "adfuller": {
        "url": "https://docs.dolphindb.com/en/Functions/a/adfuller.html",
        "signatures": [
            {
                "full": "adfuller(X, [maxLag], [regression=\"c\"], [autoLag=\"aic\"], [store=false], [regResults=false])",
                "name": "adfuller",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[maxLag]",
                        "name": "maxLag",
                        "optional": true
                    },
                    {
                        "full": "[regression=\"c\"]",
                        "name": "regression",
                        "optional": true,
                        "default": "\"c\""
                    },
                    {
                        "full": "[autoLag=\"aic\"]",
                        "name": "autoLag",
                        "optional": true,
                        "default": "\"aic\""
                    },
                    {
                        "full": "[store=false]",
                        "name": "store",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[regResults=false]",
                        "name": "regResults",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [adfuller](https://docs.dolphindb.com/en/Functions/a/adfuller.html)\n\n\n\n#### Syntax\n\nadfuller(X, \\[maxLag], \\[regression=\"c\"], \\[autoLag=\"aic\"], \\[store=false], \\[regResults=false])\n\n#### Details\n\nPerform Augmented Dickey-Fuller unit root test. It can be used to test for a unit root in a univariate process in the presence of serial correlation.\n\nThe DolphinDB `adfuller` function is consistent with `statsmodels.tsa.stattools.adfuller` in terms of core algorithm and parameter design. The main difference lies in the return value structure:\n\n* DolphinDB returns a structured dictionary with clear field semantics, which is convenient for engineering and programmatic processing.\n* `statsmodels` returns a tuple; a `ResultStore` object can provide more detailed statistical information, making it more suitable for analytical scenarios.\n\n#### Parameters\n\n**X** is a numeric vector indicating the time series data to test. The elements in X cannot be all identical, and null values are not supported.\n\n**maxlag** (optional) is a non-negative integer indicating the maximum lag which is included in test. The default value is `12*(nobs/100)^{1/4}` where nobs is the number of observations.\n\n**regression** (optional) is a string indicating the constant and trend order to include in regression. It can be:\n\n* \"c\" : constant only (default).\n\n* \"ct\" : constant and trend.\n\n* \"ctt\" : constant, and linear and quadratic trend.\n\n* \"n\" : no constant, no trend.\n\n**autoLag** (optional) is a string indicating the method to use when automatically determining the lag length among the values 0, 1, …, *maxlag*. It can be:\n\n* \"aic\": The number of lags is chosen to minimize the Akaike information criterion.\n\n* \"bic\": The number of lags is chosen to minimize the Bayesian information criterion.\n\n* \"tstat\": Start with *maxLag* and drops a lag until the t-statistic on the last lag length is significant using a 5%-sized test.\n\n* \"max\": The number of included lags is set to *maxLag*.\n\n**store** (optional) is a Boolean value. If set to true, the regression result is returned additionally to the adf statistic. The default value is false.\n\n**regResults** (optional) is a Boolean value. If set to true, the full regression results are returned. The default value is false.\n\n#### Returns\n\nA dictionary containing the following keys\n\n* adfStat: A floating-point scalar indicating the test statistic.\n\n* pValue: A floating-point scalar indicating the MacKinnon's approximate p-value based on MacKinnon (1994, 2010).\n\n* usedLag: An integer indicating the number of lags used.\n\n* nobs: An integer indicating the number of observations used for the ADF regression and calculation of the critical values.\n\n* criticalValues: A dictionary containing the critical values for the test statistic at the 1 %, 5 %, and 10 % levels.\n\n* icBest: A floating-point scalar indicating the maximized information criterion if *autoLag*is not max.\n\n* resultStore: A dictionary with results when *regResults*or *store*is set to true.\n\n#### Examples\n\n```\ndata = 234 267 289 301 312 323 334 345 356 367\nadfuller(data);\n```\n\nA dictionary is returned:\n\n```\nadfStat->-4.34190584894534\npValue->0.00037562619202430314\ncriticalValues->[-4.473135048010974,-3.2898806035665293,-2.772382345679012]\nusedLag->0\nnobs->9\nicBest->-195.23465793624445\n```\n"
    },
    "align": {
        "url": "https://docs.dolphindb.com/en/Functions/a/align.html",
        "signatures": [
            {
                "full": "align(left, right, [how='outer'], [byRow], [view=true])",
                "name": "align",
                "parameters": [
                    {
                        "full": "left",
                        "name": "left"
                    },
                    {
                        "full": "right",
                        "name": "right"
                    },
                    {
                        "full": "[how='outer']",
                        "name": "how",
                        "optional": true,
                        "default": "'outer'"
                    },
                    {
                        "full": "[byRow]",
                        "name": "byRow",
                        "optional": true
                    },
                    {
                        "full": "[view=true]",
                        "name": "view",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [align](https://docs.dolphindb.com/en/Functions/a/align.html)\n\n\n\n#### Syntax\n\nalign(left, right, \\[how='outer'], \\[byRow], \\[view=true])\n\n#### Details\n\nAlign the *left* and *right* matrices based on row labels and/or column labels (specified by *byRow*) using the join method specified by *how*. Return a tuple with 2 aligned matrices.\n\nNote:\n\n* The aligned matrices do not keep the attributes of the original matrices. For instance, an indexed matrix will no longer have index after the alignment.\n\n* To add column/row labels to a matrix, call `rename!`. Use the SQL keywords `exec` and `pivot by` to create a matrix with the columns specified in the `pivot by` clause as the matrix labels (see [pivotBy](https://docs.dolphindb.com/en/Programming/SQLStatements/pivotBy.html)).\n\n#### Parameters\n\n**left** and **right** are both matrices with column and/or row labels.\n\n**how** (optional) indicates the join method with which the two matrices are aligned. The matrices are aligned on the column labels and/or row labels. It can be 'outer' (or 'fj'), 'inner' (or 'ej'), 'left' (or 'lj') or 'asof ('aj')'. The default value is 'outer', indicating outer join.\n\n**byRow** (optional) is a Boolean or null value.\n\n* true: align the matrices on row labels.\n\n* false: align the matrices on the column labels.\n\n* Null value (default): align on the row labels and the column labels. Specify how in the format of \"\\<row\\_alignment>,\\<column alignment>\", e.g., `how=\"outer,inner\"`. Do not add a space or special character before or after the comma. If the same alignment method is used on rows and columns, it only needs to be specified once, e.g., `how=\"inner\"`.\n\nNote: The *left* and *right* matrices must both have the required labels (based on the value of *byRow*). The columns with the same label in both tables must have compatible data type. The supported data types and compatibility rules are as follows:\n\n* Integral (INT, SHORT, LONG and CHAR are compatible data types)\n\n* Floating (FLOAT and DOUBLE are compatible )\n\n* Temporal\n\n* STRING and SYMBOL (compatible data types)\n\n**view** (optional) is a Boolean value. The default value is true, indicating the result will be a view of the original matrix (shallow copy) and changes made to the original matrix will be reflected in the view. If set to false, the result will be a new matrix (deep copy).\n\n#### Context\n\nPrior to version 1.30.20/2.00.8, matrices must be converted to indexed matrices/series for binary operations. As the matrix/series will be aligned on index (with \"outer\" join), they must be monotonically increasing.\n\nWith the `align` function, alignment between matrices are more flexible in the following aspects:\n\n* Alignment between non-indexed matrices are supported. The matrices can be aligned on column/row labels which do not have to be monotonically increasing.\n\n* More options for the alignment methods.\n\n#### Examples\n\n```\n// align matrices with overlapping labels\nx1 = [09:00:00, 09:00:01, 09:00:03]\nx2 = [09:00:00, 09:00:03, 09:00:03, 09:00:04]\nm1 = matrix(1 2 3, 2 3 4, 3 4 5).rename!(x1)\nm2 = matrix(11 12 13, 12 13 14, 13 14 15, 14 15 16).rename!(x2)\na, b = align(left=m1, right=m2, how='fj', byRow=false);\na;\n```\n\n| 09:00:00 | 09:00:01 | 09:00:03 | 09:00:03 | 09:00:04 |\n| -------- | -------- | -------- | -------- | -------- |\n| 1        | 2        | 3        | 3        |          |\n| 2        | 3        | 4        | 4        |          |\n| 3        | 4        | 5        | 5        |          |\n\n```\nb;\n```\n\n| 09:00:00 | 09:00:01 | 09:00:03 | 09:00:03 | 09:00:04 |\n| -------- | -------- | -------- | -------- | -------- |\n| 11       |          | 12       | 13       | 14       |\n| 12       |          | 13       | 14       | 15       |\n| 13       |          | 14       | 15       | 16       |\n\n```\na+b;\n```\n\n| 09:00:00 | 09:00:01 | 09:00:03 | 09:00:03 | 09:00:04 |\n| -------- | -------- | -------- | -------- | -------- |\n| 12       |          | 15       | 16       |          |\n| 14       |          | 17       | 18       |          |\n| 16       |          | 19       | 20       |          |\n\n```\nm = align(left=m1, right=m2, how='aj', byRow=false);\nm[0];\n```\n\n| 09:00:00 | 09:00:01 | 09:00:03 |\n| -------- | -------- | -------- |\n| 1        | 2        | 3        |\n| 2        | 3        | 4        |\n| 3        | 4        | 5        |\n\n```\nm[1];\n```\n\n| 09:00:00 | 09:00:01 | 09:00:03 |\n| -------- | -------- | -------- |\n| 11       | 11       | 13       |\n| 12       | 12       | 14       |\n| 13       | 13       | 15       |\n\n```\n//create table pt for prices and vt for trading volumes\ntimestamp = [09:00:00, 09:00:02, 09:00:03, 09:00:06, 09:00:08]\nid= ['st1', 'st2', 'st1', 'st1', 'st2']\nprice = [197.8, 197.5, 198.4, 198.6, 198.6]\npt = table(timestamp, id, price)\n\ntimestamp = [09:00:00, 09:00:01, 09:00:02, 09:00:05, 09:00:08]\nid = ['st1', 'st2', 'st2', 'st3', 'st2']\nvol = [200, 300, 150, 200, 180]\nvt = table(timestamp, id, vol)\n\n// convert vt and pt to matrices. Use the columns specified by \"pivot by\" as labels for the matrices\nm1 = exec vol from vt pivot by timestamp, id\nm2 = exec price from pt pivot by timestamp, id\n\n// align the matrices using the full join method\nm = align(left=m1, right=m2, how='aj,fj')\n\n// get the matrix of the total trading value\nre = m[0] * m[1]\nre;\n```\n\n| label    | st1   | st2   | st3 |\n| -------- | ----- | ----- | --- |\n| 09:00:00 | 39560 |       |     |\n| 09:00:01 |       |       |     |\n| 09:00:02 |       | 29625 |     |\n| 09:00:03 |       |       |     |\n| 09:00:05 |       |       |     |\n| 09:00:08 |       | 35748 |     |\n"
    },
    "all": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/all.html",
        "signatures": [
            {
                "full": "all(func, args...)",
                "name": "all",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [all](https://docs.dolphindb.com/en/Functions/Templates/all.html)\n\n\n\n#### Syntax\n\nall(func, args...)\n\n#### Parameters\n\n**func** is a function.\n\n**args** are the required parameters of *func*. They can be vectors/matrices/tables. They do not need to have the same data form, but they must have the same size. Data size is the number of elements for a vector, the number of columns for a matrix, and the number of rows for a table.\n\n#### Details\n\nApply a function on each element of all arguments. The template runs through each element of a vector, each column of a matrix, and each row of a table. It stops execution and returns a false value as soon as one function call returns a false value. It returns a true value if all function calls return true values.\n\n#### Examples\n\nTemplate `all` on a vector:\n\n```\nx = 1 2 NULL 11 NULL 13 NULL 102 103;\ny = x cut 3;\ny;\n// output: ([1,2,],[11,,13],[,102,103])\n\nall(hasNull, y);\n// output: 1\n// check if all of [1,2,],[11,,13],[,102,103] has null values\n\nx = 1 25 7 15 11 197 16 18 23;\ny = x cut 3;\ny;\n// output: ([1,25,7],[15,11,197],[16,18,23])\n\nall(in, 7 11 23, y);\n// output: 1\n// check if 7 in [1,25,7], 11 in [15,11,197], and 23 in [16,18,23]\n\nall(in, 7 8 23, y);\n// output: 0\n// return false as 8 is not in [15,11,197]\n\nall(lt, 1 2 3, 4 5 6);\n// output: 1\n// check if 1<4, 2<5 and 3<6\n\nall(lt, 1 2 7, 4 5 6);\n// output: 0\n// return false as 7<6 is false\n```\n\nTemplate `all` on a matrix. For a matrix, the template runs through each column.\n\n```\nx=1..6$2:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nall(in, 1 4 5, x);\n// output: 1\n\nall(in, 1 2 5, x);\n// output: 0\n// return false as 2 is not in the second column of matrix x\n```\n\nTemplate `all` on a table. For a table, the template runs through each row. In the following example, we define a function `varscompare` to compare the values of 2 variables in a table.\n\n```\nx=table(1 2 3 as a, 4 5 6 as b);\nx;\n```\n\n| a | b |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\ndef varscompare(t):t.a<t.b;\nall(varscompare, x);\n// output: 1\n\ny=table(1 7 3 as a, 4 5 6 as b);\ny;\n```\n\n| a | b |\n| - | - |\n| 1 | 4 |\n| 7 | 5 |\n| 3 | 6 |\n\n```\nall(varscompare, y);\n// output: 0\n// return false as 7<5 is false\n```\n"
    },
    "amortizingFixedRateBondDirtyPrice": {
        "url": "https://docs.dolphindb.com/en/Functions/a/amortizingfixedratebonddirtyprice.html",
        "signatures": [
            {
                "full": "amortizingFixedRateBondDirtyPrice(settlement, maturity, notionals, coupon, yield, calendar, frequency, [basis=1], [convention=\"Following\"])",
                "name": "amortizingFixedRateBondDirtyPrice",
                "parameters": [
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "notionals",
                        "name": "notionals"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "yield",
                        "name": "yield"
                    },
                    {
                        "full": "calendar",
                        "name": "calendar"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "[basis=1]",
                        "name": "basis",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[convention=\"Following\"]",
                        "name": "convention",
                        "optional": true,
                        "default": "\"Following\""
                    }
                ]
            }
        ],
        "markdown": "### [amortizingFixedRateBondDirtyPrice](https://docs.dolphindb.com/en/Functions/a/amortizingfixedratebonddirtyprice.html)\n\n#### Syntax\n\namortizingFixedRateBondDirtyPrice(settlement, maturity, notionals, coupon, yield, calendar, frequency, \\[basis=1], \\[convention=\"Following\"])\n\n#### Details\n\nThe `amortizingFixedRateBondDirtyPrice` function calculates the dirty price (per 100 face value) of an amortizing fixed-rate bond.\n\nAn amortizing fixed-rate bond is a type of bond with a fixed interest rate. This type of bond repays its principal gradually over its term, rather than in a lump sum at maturity. The interest payment for each period decreases over time, as it is calculated based on the remaining unpaid principal balance.\n\n**Return value**: Numeric scalar.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**notionals** is a numeric scalar or vector indicating the notional amount for each coupon.\n\n**coupon** is a numeric scalar or vector indicating the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.\n\n**yield** is a numeric scalar or vector indicating the annual yield.\n\n**calendar** is a STRING scalar or vector indicating the trading calendar(s). See [Trading Calendar](https://docs.dolphindb.com/en/Tutorials/trading_calendar.html) for more information.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**basis** (optional) is an INT/STRING scalar or vector indicating the day count basis to use. It can be:\n\n* 0/\"Thirty360US\": US (NASD) 30/360\n* 1/\"ActualActual\": actual/actual\n* 2/\"Actual360\": actual/360\n* 3/\"Actual365\": actual/365\n* 4/\"Thirty360EU\": European 30/360\n\n**convention** (optional) is a STRING scalar or vector indicating how cash flows that fall on a non-trading day are treated. The following options are available. Defaults to 'Following'.\n\n* 'Following': The following trading day.\n* 'ModifiedFollowing': The following trading day. If that day is in a different month, the preceding trading day is adopted instead.\n* 'Preceding': The preceding trading day.\n* 'ModifiedPreceding': The preceding trading day. If that day is in a different month, the following trading day is adopted instead.\n* 'Unadjusted': Unadjusted.\n* 'HalfMonthModifiedFollowing': The following trading day. If that day crosses the mid-month (15th) or the end of month, the preceding trading day is adopted instead.\n* 'Nearest': The nearest trading day. If both the preceding and following trading days are equally far away, default to following trading day.\n\n#### Examples\n\nSuppose the purchase date is January 25, 2018, and the maturity date is January 25, 2022. The bond has a principal of 100, an annual coupon rate of 3%, an annual yield of 2.55%, and pays interest annually. Additionally, 50 of the principal is repaid at the 3rd interest payment period. The bond follows the US (NASD) 30/360 day-count convention for interest calculations and adheres to the NewYork Stock Exchange (XNYS) trading calendar for business day adjustments.\n\n```\nsettlement = 2018.01.25\nmaturity = 2022.01.25\nnotionals = [100,100,100,50]\ncoupon = 0.03\nyield = 0.0255\ncalendar = `XNYS\nfrequency = 1\nbasis = 0\nres = amortizingFixedRateBondDirtyPrice(settlement, maturity, notionals, coupon, yield, calendar, frequency, basis)\nres;\n// 101.4874025388439\n```\n"
    },
    "and": {
        "url": "https://docs.dolphindb.com/en/Functions/a/and.html",
        "signatures": [
            {
                "full": "and(X, Y)",
                "name": "and",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [and](https://docs.dolphindb.com/en/Functions/a/and.html)\n\n\n\n#### Syntax\n\nand(X, Y)\n\nor\n\nX && Y\n\n#### Parameters\n\n**X** / **Y** is a scalar/pair/vector/matrix. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Details\n\nReturn the element-by-element logical X AND Y.\n\n#### Examples\n\n```\n1 && 3;\n// output: 1\n\nx=1 2 3\nx && 0\n// output: [0,0,0]\n\nx=1 2 3\ny=0 1 0\nx && y\n// output: [0,1,0]\n\nt=table(1 2 2 3 as id, 4 5 6 5 as value)\nt\n```\n\n| id | value |\n| -- | ----- |\n| 1  | 4     |\n| 2  | 5     |\n| 2  | 6     |\n| 3  | 5     |\n\n```\nselect id, value from t where id=2 and value=5;\n```\n\n| id | value |\n| -- | ----- |\n| 2  | 5     |\n\nRelated functions: [or](https://docs.dolphindb.com/en/Programming/Operators/OperatorReferences/or.html), [not](https://docs.dolphindb.com/en/Functions/n/not.html)\n"
    },
    "anova": {
        "url": "https://docs.dolphindb.com/en/Functions/a/anova.html",
        "signatures": [
            {
                "full": "anova(X)",
                "name": "anova",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [anova](https://docs.dolphindb.com/en/Functions/a/anova.html)\n\n\n\n#### Syntax\n\nanova(X)\n\n#### Parameters\n\n**X** is a matrix or a table with numeric columns.\n\n#### Details\n\nConduct one-way analysis of variance (ANOVA). Each column in *X* is a group.\n\nReturn a dictionary with the following keys:\n\n* pValue: p-value of the F-statistic\n* fValue: F-statistic\n* ssBetween: sum of squares between groups\n* dfBetween: degrees of freedom between groups\n* ssWithin: sum of squares within groups\n* dfWithin: degrees of freedom for each group\n\n#### Examples\n\n```\na=300 287 301 400 211 399 412 312 390 412\nb=240 259 302 311 210 402 390 298 347 380\nc=210 230 213 210 220 208 290 300 201 201\nm=matrix(a,b,c)\nanova(m);\n\n/* output\npValue->0.000515\nfValue->10.15459\nssBetween->70528.066667\ndfBetween->2\nssWithin->93763.4\ndfWithin->27\n*/\n```\n"
    },
    "any": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/any.html",
        "signatures": [
            {
                "full": "any(func, args...)",
                "name": "any",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [any](https://docs.dolphindb.com/en/Functions/Templates/any.html)\n\n\n\n#### Syntax\n\nany(func, args...)\n\n#### Parameters\n\n**func** is a function.\n\n**args** are the required parameters of *func*. They can be vectors/matrices/tables. They do not need to have the same data form, but they must have the same size. Data size is the number of elements for a vector, the number of columns for a matrix, and the number of rows for a table.\n\n#### Details\n\nApply a function on each element of all arguments. The template runs through each element of a vector, each column of a matrix, and each row of a table. It stops execution and returns a true value as soon as one function call returns a true value. It returns a false value if all function calls return false values.\n\n#### Examples\n\nTemplate `any` on a vector:\n\n```\nx = 1 2 3 11 12 13 NULL 102 103;\ny = x cut 3;\ny;\n// output: ([1,2,3],[11,12,13],[,102,103])\n\nany(hasNull, y);\n// output: 1\n// check if any of [1,2,3],[11,12,13],[,102,103] has null values;\n\nx=1 25 7 15 11 197 16 18 23;\ny=x cut 3;\ny;\n// output: ([1,25,7],[15,11,197],[16,18,23])\n\nany(in, 7 8 23, y);\n// output: 1\n// return true since 7 is in [1, 25, 7], although 8 is not in [15,11,197]\n\nany(in, 8 20 19, y);\n// output: 0\n// 8 is not in [1,25,7], 20 is not in [15,11,197], and 19 is not in [16,18,23]\n\nany(lt, 4 5 6, 1 2 3);\n// output: 0\n// check if 4<1, 5<2 and 6<3\n\nany(<, 4 5 6, 1 7 3);\n// output: 1\n// return true as 5<7 is true\n```\n\nTemplate `any` on a matrix. For a matrix, the template runs through each column.\n\n```\nx=1..6$2:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nany(in, 6 1 4, x);\n// output: 0\n\nany(in, 3 4 2, x);\n// output: 1\n// return true as 4 is in the second column of matrix x\n```\n\nTemplate `any` on a table. For a table, the template runs through each row. In the following example, we define a function `varscompare` to compare the values of 2 variables in a table.\n\n```\nx=table(1 2 3 as a, 4 5 6 as b);\nx;\n```\n\n| a | b |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\ndef varscompare(t): t.a>t.b;\nany(varscompare, x);\n// output: 0\n\ny=table(1 7 3 as a, 4 5 6 as b);\ny;\n```\n\n| a | b |\n| - | - |\n| 1 | 4 |\n| 7 | 5 |\n| 3 | 6 |\n\n```\nany(varscompare, y);\n// output: 1\n//return true as 7>5 is true\n```\n"
    },
    "append!": {
        "url": "https://docs.dolphindb.com/en/Functions/a/append!.html",
        "signatures": [
            {
                "full": "append!(obj, newData)",
                "name": "append!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "newData",
                        "name": "newData"
                    }
                ]
            }
        ],
        "markdown": "### [append!](https://docs.dolphindb.com/en/Functions/a/append!.html)\n\n\n\n#### Syntax\n\nappend!(obj, newData)\n\nAlias: push!\n\n#### Parameters\n\n**obj** is a local variable, and it must be a vector/tuple/matrix/table/set.\n\n**newData** is a scalar/vector/tuple/table/set.\n\n* If *obj* is a vector, *newData* is a scalar, vector, or tuple whose elements are of the same type as *obj*. The result is a vector longer than *obj*.\n\n* If *obj* is a tuple, *newData* is a scalar, vector or tuple:\n  * If *newData* is a vector, it is appended to *obj* as one tuple element;\n\n  * If *newData* is a tuple, the *appendTupleAsAWhole* configuration parameter controls whether it is appended to *obj* as one tuple element (true) or each of its elements is appended independently (false).\n\n* If *obj* is a matrix, *newData* is a vector whose length must be a multiple of the number of rows of *obj*. The result is a matrix with the same number of rows as *obj* but with more columns.\n\n* If *obj* is a table, *newData* is a table with the same number of columns as *obj*. The result is a table with the same number and name of columns as *obj* but with more rows.\n\n* If *newData* and *obj* are of different data forms, `append!` will attempt to convert *newData* to the same data form as *obj*. If it is not possible, return an error message.\n\n#### Details\n\nAppend *newData* to *obj*. The exclamation mark (!) means in-place change in DolphinDB.\n\nNote: In most cases, the column names and orders in the tables should be consistent. Please first check whether the corresponding columns in *obj* and *newData* have the same names and are arranged in the same order before executing `append!`. The function does not check the consistency of column names or align the columns if they are not arranged in the same order. It is executed as long as the corresponding columns are of the same data types.\n\n#### Examples\n\n```\nx = 1 2 3\nx.append!(4)\nx\n// output: [1,2,3,4]\n\nappend!(x, 5 6)\nx\n//output: [1,2,3,4,5,6]\n\nx.append!(7.2)\nx\n//output: [1,2,3,4,5,6,7]\n// converted DOUBLE 7.2 to INT 7\n\nx.append!(`XOM)\n// Error: Incompatible type. Expected: INT, Actual: STRING\n\nx=array(int, 0, 10) // x is an empty vector\nx\n//output: []\n\nx.append!(1)\nx\n//output: [1]\n\nx=array(symbol, 0, 100)\nappend!(x, `TEST)\nx\n//output\n[\"TEST\"]\n\nx=1..6$3:2\nx\n\nx = (1,\"X\")\ny = (2,\"Y\")\nx.append!(y)\nprint(x)\n// when appendTupleAsAWhole = true\n(1,\"X\",(2,\"Y\"))\n// when appendTupleAsAWhole = false\n(1,\"X\",2,\"Y\")\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\nx.append!(7..12)\nx\n```\n\n| 0 | 1 | 2 | 3  |\n| - | - | - | -- |\n| 1 | 4 | 7 | 10 |\n| 2 | 5 | 8 | 11 |\n| 3 | 6 | 9 | 12 |\n\n```\nx=set(1 2 3 4)\nx.append!(6)\nx\n// output: set(6,1,2,3,4)\n\nt1=table(1 2 3 as x, 4 5 6 as y)\nt2=table(1.1 2.2 3.3 as a, 4.4 5.5 6.6 as b)\nt1.append!(t2)\nt1\n```\n\n| x | y |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n| 1 | 4 |\n| 2 | 6 |\n| 3 | 7 |\n\nUse `append!` to add data to a DFS table. The following example should be executed in a DFS cluster.\n\n```\nn=1000000\nt=table(rand(`IBM`MS`APPL`AMZN,n) as symbol, rand(10.0, n) as value)\ndb = database(\"dfs://rangedb_tradedata\", RANGE, `A`F`M`S`ZZZZ)\nTrades = db.createPartitionedTable(t, \"Trades\", \"symbol\")\n```\n\nWe have created an empty table Trades with the schema of t. Next, we append the empty table Trades with data from table t.\n\n```\nTrades.append!(t)\nselect count(*) from Trades;\n// output: 1000000\n```\n\nTo append table Trades with another table:\n\n```\nn=500000\nt1=table(rand(`FB`GE`MSFT,n) as symbol, rand(100.0, n) as value)\nTrades.append!(t1)\nselect count(*) from Trades\n// output: 1500000\n```\n"
    },
    "appendEventWithResponse": {
        "url": "https://docs.dolphindb.com/en/Functions/a/appendeventwithresponse.html",
        "signatures": [
            {
                "full": "appendEventWithResponse(engine, event, responseType, [timeout=5000], [condition], [returnType=\"instance\"])",
                "name": "appendEventWithResponse",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "event",
                        "name": "event"
                    },
                    {
                        "full": "responseType",
                        "name": "responseType"
                    },
                    {
                        "full": "[timeout=5000]",
                        "name": "timeout",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[condition]",
                        "name": "condition",
                        "optional": true
                    },
                    {
                        "full": "[returnType=\"instance\"]",
                        "name": "returnType",
                        "optional": true,
                        "default": "\"instance\""
                    }
                ]
            }
        ],
        "markdown": "### [appendEventWithResponse](https://docs.dolphindb.com/en/Functions/a/appendeventwithresponse.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nappendEventWithResponse(engine, event, responseType, \\[timeout=5000], \\[condition], \\[returnType=\"instance\"])\n\n#### Details\n\nA synchronous event-processing function for CEP engines. It sends an event to the engine and blocks the current thread until a matching response event is received or the wait times out.\n\nUnlike [appendEvent](https://docs.dolphindb.com/en/Streaming/RoutingEvents.md#) that operates asynchronously, this function adopts a synchronous request-response pattern.\n\n#### Parameters\n\n**engine** is a CEP engine handle or name.\n\n**event** is a class object of the event instance or a dictionary. If it is a dictionary, the event instances will be automatically constructed with the key-value pairs provided. The keys of the dictionary must include the \"eventType\" and all fields declared by the event type.\n\n**responseType** is a STRTING scalar specifying the expected type of the response event.\n\n**timeout** (optional) is an INT scalar specifying the maximum wait time for the response in milliseconds. The default is 5000 ms.\n\n**condition** (optional) is metacode of Boolean expression to ifilter response events, e.g. `<event.id = 1>`. If *condition* is specified, both the event type and the filter condition must be satisfied for an event to be accepted.\n\n**returnType**is a STRING scalar specifying the format of the returned response event. The options include:\n\n* \"dict\": Returns the response event as a dictionary.\n\n* \"instance\" (default): Returns the response event as an event instance.\n\n#### Returns\n\nThe return value depends on the *returnType* parameter:\n\n* If *returnType*=\"dict\", the function returns a dictionary.\n* If *returnType*=\"instance\", the function returns an event instance.\n\n#### Examples\n\nThis example demonstrates how to implement strategy start requests with synchronous responses.\n\nAn external caller sends a StartRequest event to the CEP engine to initiate a strategy start request. The CEP monitor receives and processes the event, executes the corresponding startup logic, and returns the result via a StartResponse event.\n\nThe caller uses the `appendEventWithResponse` function to synchronously wait for the startup response of a specific strategy instance, matched by instanceId, thereby implementing an event-based request–response interaction pattern.\n\n```\ntry { \n    dropStreamEngine(`cep) \n} catch(ex) { print(ex) }\n\ntry {\n    dropStreamEngine(`streamEventSerializer)\n} catch(ex) { print(ex) }\n\n\nclass StartRequest{\n    instanceId :: STRING\n    strategyParams :: INT\n    def StartRequest(instanceId_, strategyParams_){\n        instanceId = instanceId_\n        strategyParams = strategyParams_\n    }\n}\n\nclass StartResponse{\n    instanceId :: STRING\n    status :: STRING\n    def StartResponse(instanceId_, status_){\n        instanceId = instanceId_\n        status = status_\n    }\n}\n\nclass Stratege:CEPMonitor {\n\t// Custructor\n\tdef Stratege(){\n\t}\n    def startStratege(StartRequestEvent){\n        // Start a strategy instance\n    }\n\tdef processStartRequest(StartRequestEvent){\n        startStratege(StartRequestEvent)\n        // Send a strategy start success response\n        emitEvent(StartResponse(StartRequestEvent.instanceId, \"success\"))        \n    }\n\tdef onload() {\n        // Register an event listener for strategy start requests\n\t\taddEventListener(handler=processStartRequest, eventType=\"StartRequest\", times=\"all\")\n\t}\n}\n\ndummy = table(array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as outputTable\nserializer = streamEventSerializer(name=`streamEventSerializer, eventSchema=[StartResponse], outputTable=outputTable)\n// Create a CEP engine\nengine = createCEPEngine(name='cep1', monitors=<Stratege()>, dummyTable=dummy, eventSchema=[StartRequest], outputTable=serializer)\n\n// Send a strategy start request and synchronously wait for the successful startup response of strategy instance instance_001\nrequest = StartRequest(`instance_001, 100)\nresponse = appendEventWithResponse(engine=getStreamEngine(`cep1), event=request, responseType=\"StartResponse\", timeout=3000, condition=<StartResponse.instanceId==request.instanceId>)\n```\n\n**Related function:** [appendEvent](https://docs.dolphindb.com/en/Streaming/RoutingEvents.md#)\n"
    },
    "appendForJoin": {
        "url": "https://docs.dolphindb.com/en/Functions/a/appendForJoin.html",
        "signatures": [
            {
                "full": "appendForJoin(engine, isLeftTable, data)",
                "name": "appendForJoin",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "isLeftTable",
                        "name": "isLeftTable"
                    },
                    {
                        "full": "data",
                        "name": "data"
                    }
                ]
            }
        ],
        "markdown": "### [appendForJoin](https://docs.dolphindb.com/en/Functions/a/appendForJoin.html)\n\n\n\n#### Syntax\n\nappendForJoin(engine, isLeftTable, data)\n\n#### Parameters\n\n**engine** is a streaming join engine, which is the abstract table object returned by function `createAsofJoinEngine`, `createEquiJoinEngine`, `createWindowJoinEngine`, `createLeftSemiJoinEngine`, or `createLookupJoinEngine`.\n\n**isLeftTable** is a Boolean value indicating whether to insert into the left table or right table.\n\n**data** is the data to be ingested into the streaming engine.\n\n#### Details\n\nInsert data into a streaming join engine.\n\nPlease note that the parameter *handler* of function [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html) must be `appendForJoin`, [getLeftStream](https://docs.dolphindb.com/en/Functions/g/getLeftStream.html), or [getRightStream](https://docs.dolphindb.com/en/Functions/g/getRightStream.html) while subscribing to a stream table of a streaming join engine.\n\n#### Examples\n\n```\nleftTable=table(1:0, `timestamp`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\nrightTable=table(1:0, `timestamp`sym`val, [TIMESTAMP, SYMBOL, DOUBLE])\noutput=table(100:0, `timestamp`sym`price`val`total, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE])\najEngine=createAsofJoinEngine(\"test1\", leftTable, rightTable, output, <[price, val, price*val]>, `sym, `timestamp, false, 7)\n\ntmp1=table(take(2012.01.01T00:00:00.000+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 20) as timestamp, take(`AAPL, 10) join take(`IBM, 10) as sym, double(1..20) as price)\ntmp2=table(take(2012.01.01T00:00:00.000+[1, 2, 3, 4, 4, 4, 4, 4, 4, 4], 20) as timestamp, take(`AAPL, 10) join take(`IBM, 10) as sym, double(1..20) as val)\n\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.001))\nappendForJoin(ajEngine, false, (select * from tmp2 where timestamp=2012.01.01T00:00:00.001))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.002))\nappendForJoin(ajEngine, false, (select * from tmp2 where timestamp=2012.01.01T00:00:00.002))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.003))\nappendForJoin(ajEngine, false, (select * from tmp2 where timestamp=2012.01.01T00:00:00.003))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.004))\nappendForJoin(ajEngine, false, (select * from tmp2 where timestamp=2012.01.01T00:00:00.004))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.005))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.006))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.007))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.008))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.009))\nappendForJoin(ajEngine, true, (select * from tmp1 where timestamp=2012.01.01T00:00:00.010))\n\nsleep(5000)\n```\n"
    },
    "appendForPrediction": {
        "url": "https://docs.dolphindb.com/en/Functions/a/appendforprediction.html",
        "signatures": [
            {
                "full": "appendForPrediction(engine, data)",
                "name": "appendForPrediction",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "data",
                        "name": "data"
                    }
                ]
            }
        ],
        "markdown": "### [appendForPrediction](https://docs.dolphindb.com/en/Functions/a/appendforprediction.html)\n\n#### Syntax\n\nappendForPrediction(engine, data)\n\n#### Arguments\n\n**engine** is a string indicating the name of the yield curve engine or the engine object returned by `createYieldCurveEngine`.\n\n**data** is a table object containing data to be predicted. Its schema must match the *predictDummyTable*parameter specified in `createYieldCurveEngine`.\n\n#### Details\n\nAppend data to the predictDummyTable of a yield curve engine (`createYieldCurveEngine`) for prediction.\n\n#### Examples\n\nCreate a yield curve engine.\n\n```\ndummyTable = table(1:0, `symbol`sendingtime`askDirtyPrice1`bidDirtyPrice1`midDirtyPirce1`askyield1`bidyield1`midyield1`timetoMaturity`assetType`datasource`clearRate, \n                        [SYMBOL, TIMESTAMP,DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DOUBLE,INT,INT,STRING])\nassetType=[0,1,2]\nfitMethod=[<piecewiseLinFit(timetoMaturity, midyield1, 10)>,\n            <nss(timetoMaturity,bidyield1,\"ns\")>,\n            <piecewiseLinFit(timetoMaturity, askyield1, 5)>]\n\nmodelOutput=table(1:0, `time`assetType`dataSource`clearRate`model,\n                       [TIMESTAMP,INT,INT,SYMBOL,BLOB])\npredictOutput=table(1:0, `time`assetType`dataSource`clearRate`x`y,[TIMESTAMP,INT,INT,SYMBOL,DOUBLE,DOUBLE])\n\nengine = createYieldCurveEngine(name=\"test\", dummyTable=dummyTable,assetType=assetType,fitMethod=fitMethod,\n                                keyColumn=`assetType`dataSource`clearRate, modelOutput=modelOutput,\n                                frequency=10,predictInputColumn=`timetoMaturity,predictTimeColumn=`sendingtime, \n                                predictOutput=predictOutput,fitAfterPredict=false)\n                                \ndata = table(take(`a`b`c, 30) as  symbol, take(now(), 30) as time, decimal32(rand(10.0, 30),3) as p1,  decimal32(rand(10.0, 30),3) as p2,  decimal32(rand(10.0, 30),3) as p3, decimal32(rand(10.0, 30),3) as p4,  decimal32(rand(10.0, 30),3) as p5,  decimal32(rand(10.0, 30),3) as p6, (rand(10.0, 30)+10).sort() as timetoMaturity, take(0 1 2, 30) as assetType, take([1], 30) as datasource, take(\"1\", 30) as clearRate)\nengine.append!(data)                                \n```\n\nUse the `appendForPrediction` function to add data to the predictOutput table and retrieve the prediction results.\n\n```\nappendForPrediction(engine, data) \n//Output: 30   \n```\n\n**Related Function**: [createYieldCurveEngine](https://docs.dolphindb.com/en/Functions/c/createyieldcurveengine.html)\n"
    },
    "appendMktData": {
        "url": "https://docs.dolphindb.com/en/Functions/a/appendMktData.html",
        "signatures": [
            {
                "full": "appendMktData(engine, data, [eventTime])",
                "name": "appendMktData",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "data",
                        "name": "data"
                    },
                    {
                        "full": "[eventTime]",
                        "name": "eventTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [appendMktData](https://docs.dolphindb.com/en/Functions/a/appendMktData.html)\n\n\n\n#### Syntax\n\nappendMktData(engine, data, \\[eventTime])\n\n#### Details\n\nWrites market data to either a market data engine or a pricing engine.\n\n* For a market data engine, the written data is used to update the cached historical data.\n* For a pricing engine, the written data is applied to update pricing calculations.\n\n#### Parameters\n\n**engine** is the handle of a market data engine/pricing engine.\n\n**data** is an MKTDATA scalar/vector or a dictionary, indicating the market data to be written.\n\n**eventTime** (optional) is a NANOTIMESTAMP scalar indicating the time at which the event occurs. This parameter is used only when `engineConfig.outputTime` is set to true.\n\n#### Returns\n\nA LONG scalar.\n\n#### Examples\n\nExample 1. Writing market data to a market data engine.\n\nCreate a market data engine.\n\n```\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.07.01\nconfig1 = {\"name\": \"USDCNY\", \"type\": \"FxSpotRate\"}\nconfig2 = {\"name\": \"EURUSD\", \"type\": \"FxSpotRate\"}\nconfig3 = {\"name\": \"EURCNY\", \"type\": \"FxSpotRate\"}\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config1, config2, config3])\n```\n\nWrite a single MKTDATA record (scalar).\n\n```\nfxSpot1 = {\n    \"mktDataType\": \"Price\",\n    \"referenceDate\": referenceDate,\n    \"spotDate\": 2025.07.03,\n    \"priceType\": \"FxSpotRate\",\n    \"value\": 7.12,\n    \"unit\": \"USDCNY\"\n}\nmktData1 = parseMktData(fxSpot1)\n\nappendMktData(engine, mktData1)\n```\n\nWrite multiple MKTDATA records (vector).\n\n```\nfxSpot2 = {\n    \"mktDataType\": \"Price\",\n    \"referenceDate\": referenceDate,\n    \"priceType\": \"FxSpotRate\",\n    \"value\": 7.88,\n    \"unit\": \"EURCNY\"\n}\nfxSpot3 = {\n    \"mktDataType\": \"Price\",\n    \"referenceDate\": referenceDate,\n    \"priceType\": \"FxSpotRate\",\n    \"value\": 1.10,\n    \"unit\": \"EURUSD\"\n}\nmktData2 = parseMktData(fxSpot2)\nmktData3 = parseMktData(fxSpot3)\nappendMktData(engine, [mktData1, mktData2, mktData3])    \n```\n\nInspect the generated market data.\n\n```\nre = getMktData(engine, \"Price\", referenceDate, \"EURUSD\")\nprint(re)\n\n// output: {\"mktDataType\": \"Price\",\"priceType\": \"FxSpotRate\",\"spotDate\": \"2025.07.03\",\"referenceDate\": \"2025.07.01\",\"value\": 1.1,\"unit\": \"EURUSD\",\"version\": 2,\"underlying\": \"EURUSD\"}\n```\n\nExample 2. Specifying *eventTime* when outputTime is enabled\n\nWhen the engine is configured with `outputTime=true`, the *eventTime* parameter must be provided when inserting data using `appendMktData`.\n\n```\n// Clean up the environment (if the engine already exists)\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\n\n// Set the reference date and market data configurations\nreferenceDate = 2025.07.01\nconfig1 = {\"name\": \"USDCNY\", \"type\": \"FxSpotRate\"}\nconfig2 = {\"name\": \"EURUSD\", \"type\": \"FxSpotRate\"}\nconfig3 = {\"name\": \"EURCNY\", \"type\": \"FxSpotRate\"}\n\n// Create engine configuration with outputTime enabled\nengineConfig = {\n    \"outputTime\": true\n}\n\n// Create a market data engine\nengine = createMktDataEngine(\n    name=\"MKTDATA_ENGINE\",\n    referenceDate=referenceDate,\n    mktDataConfig=[config1, config2, config3],\n    engineConfig=engineConfig  \n)\n\n// Create MKTDATA object\nfxSpot1 = {\n    \"mktDataType\": \"Price\",\n    \"referenceDate\": referenceDate,\n    \"spotDate\": 2025.07.03,\n    \"priceType\": \"FxSpotRate\",\n    \"value\": 7.12,\n    \"unit\": \"USDCNY\"\n}\nmktData1 = parseMktData(fxSpot1)\n\n// Use appendMktData and explicitly specify the eventTime parameter\neventTime = now() \nappendMktData(engine, mktData1, eventTime)\n\nre = getMktData(engine, \"Price\", referenceDate, \"USDCNY\")\nprint(re)\n\n// output: {\"mktDataType\": \"Price\",\"priceType\": \"FxSpotRate\",\"spotDate\": \"2025.01.03\",\"referenceDate\": \"2025.01.01\",\"value\": 7.12,\"unit\": \"USDCNY\",\"version\": 2,\"underlying\": \"USDCNY\"}\n```\n\n**Related functions**: [createMktDataEngine](https://docs.dolphindb.com/en/Functions/c/createMktDataEngine.html), [createPricingEngine](https://docs.dolphindb.com/en/Functions/c/createPricingEngine.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html), [getMktData](https://docs.dolphindb.com/en/Functions/g/getMktData.html)\n"
    },
    "appendMsg": {
        "url": "https://docs.dolphindb.com/en/Functions/a/appendMsg.html",
        "signatures": [
            {
                "full": "appendMsg(engine, msgBody, msgId)",
                "name": "appendMsg",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "msgBody",
                        "name": "msgBody"
                    },
                    {
                        "full": "msgId",
                        "name": "msgId"
                    }
                ]
            }
        ],
        "markdown": "### [appendMsg](https://docs.dolphindb.com/en/Functions/a/appendMsg.html)\n\n\n\n#### Syntax\n\nappendMsg(engine, msgBody, msgId)\n\n#### Parameters\n\n**engine** is a built-in streaming engine, i.e., the abstract table object return by functions such as [createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html)\n\n**msgBody** is the messages to be ingested into the streaming engine.\n\n**msgId** is the ID of the last message that has been ingested into the streaming engine. The ID starts from the beginning of the subscription.\n\n#### Details\n\nIf *snapshot* is enabled and *RaftGroup* is disabled for a streaming engine, the *handler* parameter of function [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html) must be `appendMsg` to inject the data into the engine.\n\n#### Examples\n\n```\nshare streamTable(10000:0,`time`sym`price, [TIMESTAMP,SYMBOL,DOUBLE]) as trades\noutput1 =table(10000:0, `time`sym`avgPrice, [TIMESTAMP,SYMBOL,DOUBLE]);\n\nengine1 = createTimeSeriesEngine(name=`engine1, windowSize=100, step=50, metrics=<avg(price)>, dummyTable=trades, outputTable=output1, timeColumn=`time, keyColumn=`sym, snapshotDir=\"C:/DolphinDB/Data/snapshotDir\", snapshotIntervalInMsgCount=100)\nsubscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=appendMsg{engine1}, msgAsTable=true, handlerNeedMsgId=true)\n\nn=500\ntimev=2021.03.12T15:00:00.000 + (1..n join 1..n)\nsymv = take(`A, n) join take(`B, n)\npricev = (100+cumsum(rand(1.0,n)-0.5)) join (200+cumsum(rand(1.0,n)-0.5))\nt=table(timev as time, symv as sym, pricev as price).sortBy!(`time)\ntrades.append!(t)\n\nselect * from output1\n```\n"
    },
    "appendOrcaStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/a/appendOrcaStreamTable.html",
        "signatures": [
            {
                "full": "appendOrcaStreamTable(name, data)",
                "name": "appendOrcaStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "data",
                        "name": "data"
                    }
                ]
            }
        ],
        "markdown": "### [appendOrcaStreamTable](https://docs.dolphindb.com/en/Functions/a/appendOrcaStreamTable.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nappendOrcaStreamTable(name, data)\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**data** is a table object containing the data to be inserted.\n\n#### Details\n\nAppends data to an orca stream table.\n\n**Note:** This function does not support regular (non-Orca) stream tables.\n\n#### Examples\n\nInsert the snapshot table into an orca stream table.\n\n```\nif (!existsCatalog(\"test\")) {\n\tcreateCatalog(\"test\")\n}\ngo;\nuse catalog test\n\nt = table(1..100 as id, 1..100 as value, take(09:29:00.000..13:00:00.000, 100) as timestamp)\ng = createStreamGraph(\"factor\")\nbaseStream = g.source(\"snapshot\",  1024:0, schema(t).colDefs.name, schema(t).colDefs.typeString)\n  .reactiveStateEngine([<cumsum(value)>, <timestamp>])\n  .setEngineName(\"rse\")\n  .buffer(\"end\")\n  \ng.submit()\n\nappendOrcaStreamTable(\"snapshot\", t)\n// Be equivalent to appendOrcaStreamTable(\"test.orca_table.snapshot\", t)\n```\n\nWe can verify the inserted data with a SQL query like `SELECT * FROM <catalog>.orca_table.<name>`. The `<catalog>` part is optional—if omitted, the system will use the current catalog automatically.\n\n```\nselect * from orca_table.end\n```\n\n| cumsum\\_value | timestamp    |\n| ------------- | ------------ |\n| 1             | 09:29:00.000 |\n| 3             | 09:29:00.001 |\n| 6             | 09:29:00.002 |\n| 10            | 09:29:00.003 |\n| 15            | 09:29:00.004 |\n| 21            | 09:29:00.005 |\n| 28            | 09:29:00.006 |\n| 36            | 09:29:00.007 |\n| 45            | 09:29:00.008 |\n| 55            | 09:29:00.009 |\n| …             | …            |\n"
    },
    "appendTuple!": {
        "url": "https://docs.dolphindb.com/en/Functions/a/appendtuple.html",
        "signatures": [
            {
                "full": "appendTuple!(X, Y, [wholistic=false])",
                "name": "appendTuple!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[wholistic=false]",
                        "name": "wholistic",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [appendTuple!](https://docs.dolphindb.com/en/Functions/a/appendtuple.html)\n\n\n\n#### Syntax\n\nappendTuple!(X, Y, \\[wholistic=false])\n\n#### Parameters\n\n**X** is a tuple.\n\n**Y** is a tuple.\n\n**wholistic** is a Boolean. The default value is false.\n\n#### Details\n\nAppend *Y* to *X*:\n\n* If *wholistic* = true, *Y* is appended as one tuple element;\n\n* If *wholistic*= false, each element of *Y* is appended independently.\n\nIf *X* is a columnar tuple, *wholistic* must be set to false, and the elements of *Y* must have the same data type as those of *X*.\n\n#### Examples\n\n```language-python\n$ x = (1,\"X\")\n$ y = ([2,3],\"Y\")\n$ x.appendTuple!(y,true)\n$ print(x)\n// output: (1,\"X\",([2,3],\"Y\"))\n\n$ x.appendTuple!(y,false)\n$ print(x)\n// output: (1,\"X\",([2,3],\"Y\"),[2,3],\"Y\")\n\n$ x = [[1,2,3],4]\n$ x.setColumnarTuple!()\n$ x.appendTuple!((5,6),false)\n$ print(x)\n// output: ([1,2,3],4,5,6)\n```\n"
    },
    "appendEvent": {
        "url": "https://docs.dolphindb.com/en/Functions/a/append_event.html",
        "signatures": [
            {
                "full": "appendEvent(engine, events)",
                "name": "appendEvent",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "events",
                        "name": "events"
                    }
                ]
            }
        ],
        "markdown": "### [appendEvent](https://docs.dolphindb.com/en/Functions/a/append_event.html)\n\n\n\n#### Syntax\n\nappendEvent(engine, events)\n\n#### Details\n\nThe `appendEvent` function allows direct event appending to event input queue, avoiding serialization and deserialization compared to writing data through heterogeneous tables.\n\n#### Parameters\n\n**engine**is the engine object returned by `createCEPEngine` or `streamEventSerializer`.\n\n**events**is a class object of the event instance or a dictionary. If it is a dictionary, the event instances will be automatically constructed with the key-value pairs provided. The keys of the dictionary must include the event type (specified with *eventSchema*) and all of its event fields.\n\n#### Examples\n\nDefine an event Orders contianing the following fields: sym, val0, val1, and val2.\n\n```\nclass Orders{\n    eventTime :: TIMESTAMP \n    sym :: STRING\n    val0 :: INT\n    val1 :: FLOAT\n    val2 :: DOUBLE\n    def Orders(s,v0,v1,v2){\n        sym = s\n        val0 = v0\n        val1 = v1\n        val2 = v2\n        eventTime = now()\n    }\n}\n```\n\nDefined a monitor:\n\n```\nclass mainMonitor:CEPMonitor {\n    ordersTable :: ANY  \n    def mainMonitor(){\n        ordersTable = array(ANY, 0)  \n    }    \n\n    def updateOrders(event) {\n        ordersTable.append!([event.sym, event.val0, event.val1, event.val2])\n    }\n    def onload(){\n        addEventListener(updateOrders, 'Orders',,'all') \n    }\n}\n```\n\nCreate a CEP engine:\n\n```\ndummy = table(array(TIMESTAMP, 0) as eventTime,array(STRING, 0) as eventType,  array(BLOB, 0) as blobs)\nengine=createCEPEngine(name=\"test_CEP\",monitors=<mainMonitor()>,dummyTable=dummy,eventSchema=Orders,timeColumn='eventTime')\n```\n\nAppend events to the engine:\n\n* *events* is specified as an instance of an event:\n\n  ```\n  appendEvent(`test_CEP,Orders(\"a000\", 3, 3.0, 30.0))\n  ```\n\n* *events* is specified as a dictionary:\n\n  ```\n  d=dict(['eventType',\"sym\", \"val0\",\"val1\", \"val2\", \"eventTime\"],[\"Orders\",'a000',5,float(3.6),double(29.3),2025.09.24T11:35:22.789])\n  appendEvent(`test_CEP,d)\n  ```\n\n**Related function:** [addEventListener](https://docs.dolphindb.com/en/Functions/a/add_event_listener.html), [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [emitEvent](https://docs.dolphindb.com/en/Functions/e/emit_event.html), [routeEvent](https://docs.dolphindb.com/en/Functions/r/route_event.html), [sendEvent](https://docs.dolphindb.com/en/Functions/s/send_event.html)\n"
    },
    "arima": {
        "url": "https://docs.dolphindb.com/en/Functions/a/arima.html",
        "signatures": [
            {
                "full": "arima(ds, endogColName, order, [seasonalOrder], [exog], [trend], [enforceStationarity=true], [enforceInvertibility=true], [concentrateScale=false], [trendOffset=1])",
                "name": "arima",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "endogColName",
                        "name": "endogColName"
                    },
                    {
                        "full": "order",
                        "name": "order"
                    },
                    {
                        "full": "[seasonalOrder]",
                        "name": "seasonalOrder",
                        "optional": true
                    },
                    {
                        "full": "[exog]",
                        "name": "exog",
                        "optional": true
                    },
                    {
                        "full": "[trend]",
                        "name": "trend",
                        "optional": true
                    },
                    {
                        "full": "[enforceStationarity=true]",
                        "name": "enforceStationarity",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[enforceInvertibility=true]",
                        "name": "enforceInvertibility",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[concentrateScale=false]",
                        "name": "concentrateScale",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[trendOffset=1]",
                        "name": "trendOffset",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [arima](https://docs.dolphindb.com/en/Functions/a/arima.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\narima(ds, endogColName, order, \\[seasonalOrder], \\[exog], \\[trend], \\[enforceStationarity=true], \\[enforceInvertibility=true], \\[concentrateScale=false], \\[trendOffset=1])\n\n#### Parameters\n\n**ds** is an in-memory table or a list of data sources containing the univariate time series data for analysis.\n\n**endogColName** is a string specifying the column name in *ds* that contains the univariate time series to be analyzed.\n\n**order** is a vector of three non-negative integers representing the (p,d,q) order of the ARIMA model for the autoregressive (AR), differences, and moving average (MA) components.\n\n**seasonalOrder** (optional) is a vector of four non-negative integers representing the (P, D, Q, s) order of the seasonal ARIMA model for the AR parameters, differences, MA parameters, and periodicity. The default value is \\[0, 0, 0, 0], indicating no seasonality.\n\n**exog** (optional) is a numerical matrix representing exogenous variables. Each column of the matrix represents the time series data of an exogenous variable, and the number of rows must equal the number of rows in *ds*.\n\n**trend** (optional) is a string used to control the deterministic trend. It can be\n\n* 'n' - no constant or trend (default if *d* > 0 or D > 0)\n* 'c' - only constant (default if *d* = 0 and D = 0)\n* 't' - only linear trend\n* 'ct' - constant and linear trend\n\n**enforceStationarity**(optional) is a boolean scalar indicating whether to enforce stationarity on the AR component. The default value is true.\n\n**enforceInvertibility**(optional) is a boolean scalar indicating whether to enforce invertibility on the MA component. The default value is true.\n\n**concentrateScale**(optional) is a boolean scalar indicating whether to concentrate the scale (variance of the error term) out of the likelihood, which reduces the number of estimated parameters by one. Applicable only when considering estimation by numerical maximum likelihood. The default value is false.\n\n**trendOffset** (optional) is an integer specifying the offset at which to start time trend values. The default value is 1, so if *trend*='t', the trend values will be 1, 2, ..., nobs.\n\n**maxIter**(optional) is a positive integer indicating the maximum number of iterations. The default value is 500.\n\n#### Details\n\nThe Autoregressive Integrated Moving Average (ARIMA) model is used to analyze univariate time series, which consists of three main components: autoregressive (AR), integrated (I), and moving average (MA).\n\nThe `arima` function is used for ARIMA-like modeling and can be used to construct the following time series analysis models:\n\n* Autoregressive model, *AR*: Captures the relationship between data and its historical values.\n* Moving Average model, *MA*: Focuses on handling random fluctuations.\n* Autoregressive Moving Average model, *ARMA*: Combines AR and MA components.\n* Autoregressive Integrated Moving Average model,*ARIMA*\n* Seasonal model, *SARIMA*: Handles data with periodic patterns.\n* Regression with errors, *ARIMAX*: Incorporates external regressors with error terms modeled by ARIMA-like structures.\n\n**Return value**: A dictionary representing the analysis results of the ARIMA model with the following keys:\n\n* params: A vector of floating-point numbers representing the parameters estimated by the ARIMA model.\n* llf: A floating-point scalar representing the log-likelihood value of the ARIMA model.\n* aic: A floating-point scalar representing the Akaike Information Criterion.\n* bic: A floating-point scalar representing the Bayesian Information Criterion.\n* hqic: A floating-point scalar representing the Hannan-Quinn Information Criterion.\n\n#### Examples\n\nThe following script uses quarterly economic indicator data from 1959 to 2009 to fit an ARIMA model to real GDP (`realgdp`). Based on analysis, it is assumed that the appropriate model is ARIMA(1,0,0), meaning an autoregressive model with order 1, no differencing, and no moving average component.\n\n```\ndata = loadText(\"./macrodata.csv\")\nres = arima(data, \"realgdp\", [1,0,0]);\nres;\n/* \nparams->[0.007795600187477,0.306055792984419,0.000069811276429]\nllf->679.783769203580163\naic->-1353.567538407160327\nbic->-1343.64273531495678\nhqic->-1349.551945119058927\n*/\n```\n\n[macrodata.csv](https://docs.dolphindb.com/en/Functions/resources/arima/macrodata.csv)\n"
    },
    "array": {
        "url": "https://docs.dolphindb.com/en/Functions/a/array.html",
        "signatures": [
            {
                "full": "array(dataType|template, [initialSize], [capacity], [defaultValue])",
                "name": "array",
                "parameters": [
                    {
                        "full": "dataType|template",
                        "name": "dataType|template"
                    },
                    {
                        "full": "[initialSize]",
                        "name": "initialSize",
                        "optional": true
                    },
                    {
                        "full": "[capacity]",
                        "name": "capacity",
                        "optional": true
                    },
                    {
                        "full": "[defaultValue]",
                        "name": "defaultValue",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [array](https://docs.dolphindb.com/en/Functions/a/array.html)\n\n\n\n#### Syntax\n\narray(dataType|template, \\[initialSize], \\[capacity], \\[defaultValue])\n\n#### Parameters\n\n**dataType** is the data type for the vector.\n\n**template** is an existing vector. The existing vector serves as a template and its data type determines the new vector's data type.\n\n**initialSize** (optional) is the initial size (in terms of the number of elements) of the vector.\n\n**capacity** (optional) is the amount of memory (in terms of the number of elements) allocated to the array. When the number of elements exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory.\n\n**defaultValue** (optional) is the default value of the vector. It must be a scalar. If *defaultValue* is not specified, it defaults to NULL for STRING and SYMBOL values, and 0 for other data types.\n\n#### Details\n\nReturn a vector.\n\nDifferences from Python’s `numpy.array` and `pandas.array`: `numpy.array` converts *object* to an ndarray and can infer or specify *dtype*, dimensions, memory order, and copy behavior. `pandas.array` creates a pandas ExtensionArray from a sequence, focusing on nullable/extension *dtype* inference. DolphinDB’s `array` creates a DolphinDB vector by a specified data type or template and can specify *initialSize*, *capacity*, and *defaultValue*.\n\n#### Examples\n\n```\nx=array(int, 10, 100, 1) // initial size is 10; capacity is 100; default value is 1\nx\n// output: [1,1,1,1,1,1,1,1,1,1]\n\nx=array(int, 0) // initialize an empty vector\nx\n// output: []\n\nx.append!(1..10)\n// output: [1,2,3,4,5,6,7,8,9,10]\n\ny=array(x)\ny\n// output: [0,0,0,0,0,0,0,0,0,0]\n\nsyms=array(symbol, 0, 100) // an empty symbol vector with capacity of 100\ntypestr syms\n// output: FAST SYMBOL VECTOR\n```\n"
    },
    "arrayVector": {
        "url": "https://docs.dolphindb.com/en/Functions/a/arrayVector.html",
        "signatures": [
            {
                "full": "arrayVector(index, value)",
                "name": "arrayVector",
                "parameters": [
                    {
                        "full": "index",
                        "name": "index"
                    },
                    {
                        "full": "value",
                        "name": "value"
                    }
                ]
            }
        ],
        "markdown": "### [arrayVector](https://docs.dolphindb.com/en/Functions/a/arrayVector.html)\n\n\n\n#### Syntax\n\narrayVector(index, value)\n\n#### Parameters\n\n**index** is a vector of positive integers, which must be strictly monotonically increasing.\n\n**value** is a vector. Its data type must be supported by [arrayVector](https://docs.dolphindb.com/en/Programming/DataTypesandStructures/DataForms/Vector/arrayVector.html)\n\n#### Details\n\nConvert *value* into an array vector by spliting it based on the elements in *index*. The number of elements in *index* indicates the number of rows of array vector. Each element in *index* corresponds to the position in *value* (starting from 1), which is the last element of each new vector. See how an array vector is converted in the following figure:\n\n![](https://docs.dolphindb.com/en/images/arrayVector01.png)\n\nNote: The maximum value in *index* can be no greater than the length of *value*.\n\n#### Examples\n\n```\narrayVector(2 3 4, [1,2,3,4])\n// output: [[1,2],[3],[4]]\n\narrayVector(1 4 7, [1.0,2.1,4.1,6.8,0.5,2.2,2])\n// output: [[1],[2.1,4.1,6.8],[0.5,2.2,2]]\n\nvalue = 2022.01.01 + 0..20\nindex = 7 14 21\narrayVector(index, value)\n// output: [[2022.01.01,2022.01.02,2022.01.03,2022.01.04,2022.01.05,2022.01.06,2022.01.07],[2022.01.08,2022.01.09,2022.01.10,2022.01.11,2022.01.12,2022.01.13,2022.01.14],[2022.01.15,2022.01.16,2022.01.17,2022.01.18,2022.01.19,2022.01.20,2022.01.21]]\n```\n\nRelated function: [fixedLengthArrayVector](https://docs.dolphindb.com/en/Functions/f/fixedLengthArrayVector.html)\n"
    },
    "asFreq": {
        "url": "https://docs.dolphindb.com/en/Functions/a/asFreq.html",
        "signatures": [
            {
                "full": "asFreq(X, rule, [closed], [label], [origin='start_day'])",
                "name": "asFreq",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "rule",
                        "name": "rule"
                    },
                    {
                        "full": "[closed]",
                        "name": "closed",
                        "optional": true
                    },
                    {
                        "full": "[label]",
                        "name": "label",
                        "optional": true
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    }
                ]
            }
        ],
        "markdown": "### [asFreq](https://docs.dolphindb.com/en/Functions/a/asFreq.html)\n\n\n\n#### Syntax\n\nasFreq(X, rule, \\[closed], \\[label], \\[origin='start\\_day'])\n\nAlias: asfreq\n\n#### Parameters\n\n**X** is an indexed matrix or indexed series. The index must be of temporal type.\n\n**rule** is a string that can take the following values:\n\n| Value of *rule* | Corresponding DolphinDB function |\n| --------------- | -------------------------------- |\n| \"B\"             | businessDay                      |\n| \"W\"             | weekEnd                          |\n| \"WOM\"           | weekOfMonth                      |\n| \"LWOM\"          | lastWeekOfMonth                  |\n| \"M\"             | monthEnd                         |\n| \"MS\"            | monthBegin                       |\n| \"BM\"            | businessMonthEnd                 |\n| \"BMS\"           | businessMonthBegin               |\n| \"SM\"            | semiMonthEnd                     |\n| \"SMS\"           | semiMonthBegin                   |\n| \"Q\"             | quarterEnd                       |\n| \"QS\"            | quarterBegin                     |\n| \"BQ\"            | businessQuarterEnd               |\n| \"BQS\"           | businessQuarterBegin             |\n| \"REQ\"           | FY5253Quarter                    |\n| \"A\"             | yearEnd                          |\n| \"AS\"            | yearBegin                        |\n| \"BA\"            | businessYearEnd                  |\n| \"BAS\"           | businessYearBegin                |\n| \"RE\"            | FY5253                           |\n| \"D\"             | date                             |\n| \"H\"             | hourOfDay                        |\n| \"min\"           | minuteOfHour                     |\n| \"S\"             | secondOfMinute                   |\n| \"L\"             | millisecond                      |\n| \"U\"             | microsecond                      |\n| \"N\"             | nanosecond                       |\n| \"SA\"            | semiannualEnd                    |\n| \"SAS\"           | semiannualBegin                  |\n\nThe strings above can also be used with positive integers for parameter *rule*. For example, \"2M\" means the end of every two months. In addition, *rule* can also be set as the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name. Positive integers can also be used with identifiers. For example, \"2XNYS\" means every two trading days of New York Stock Exchange.\n\n*rule* can also be a vector of temporal type.\n\n**closed** is a string indicating which boundary of the interval is closed.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**label** is a string indicating which boundary is used to label the interval.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**origin** is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start\\_day', 'end', 'end\\_day' or a user-defined time object. The default value is 'start\\_day'.\n\n* 'epoch': *origin* is 1970-01-01\n\n* 'start': *origin* is the first value of the timeseries\n\n* 'start\\_day': *origin* is 00:00 of the first day of the timeseries\n\n* 'end': *origin* is the last value of the timeseries\n\n* 'end\\_day': *origin* is 24:00 of the last day of the timeseries\n\n#### Details\n\nConvert *X* to specified frequency. Different from [resample](https://docs.dolphindb.com/en/Functions/r/resample.html), aggregate functions cannot be used in `asfreq`.\n\n#### Examples\n\n```\nindex = [2000.01.01, 2000.01.31, 2000.02.15, 2000.02.20, 2000.03.31, 2000.04.16, 2000.05.06, 2000.08.31]\ns = indexedSeries(index, 1..8)\ns\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2000.01.01 | 1 |\n| 2000.01.31 | 2 |\n| 2000.02.15 | 3 |\n| 2000.02.20 | 4 |\n| 2000.03.31 | 5 |\n| 2000.04.16 | 6 |\n| 2000.05.06 | 7 |\n| 2000.08.31 | 8 |\n\n```\ns.asfreq(\"M\")  // M = monthEnd\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2000.01.31 | 2 |\n| 2000.02.29 |   |\n| 2000.03.31 | 5 |\n| 2000.04.30 |   |\n| 2000.05.31 |   |\n| 2000.06.30 |   |\n| 2000.07.31 |   |\n| 2000.08.31 | 8 |\n\n```\ns.asfreq(\"2M\")  // 2M = every 2 months month-end\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2000.01.31 | 2 |\n| 2000.03.31 | 5 |\n| 2000.05.31 |   |\n| 2000.07.31 |   |\n\n```\nindex = [2020.01.01, 2020.01.03, 2020.01.06]\ns = indexedSeries(index, 1..3)\ns\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2020.01.01 | 1 |\n| 2020.01.03 | 2 |\n| 2020.01.06 | 3 |\n\n```\ns.asfreq(\"D\")  // D = date\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2020.01.01 | 1 |\n| 2020.01.02 |   |\n| 2020.01.03 | 2 |\n| 2020.01.04 |   |\n| 2020.01.05 |   |\n| 2020.01.06 | 3 |\n\n```\ns.asfreq(\"2D\")  // 2D = every 2 days\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2020.01.01 | 1 |\n| 2020.01.03 | 2 |\n| 2020.01.05 |   |\n\n```\nindex = temporalAdd(2022.10.01 23:30:00,7*(0..8),`m)\ns = indexedSeries(index, 3*(0..8))\ns.asfreq(\"8min\")  // Convert to 8-minute frequency, with closed=`left by default (left-closed right-open)\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.10.01T23:28:00 |      |\n| 2022.10.01T23:36:00 |      |\n| 2022.10.01T23:44:00 | 6    |\n| 2022.10.01T23:52:00 |      |\n| 2022.10.02T00:00:00 |      |\n| 2022.10.02T00:08:00 |      |\n| 2022.10.02T00:16:00 |      |\n| 2022.10.02T00:24:00 |      |\n\n```\n// Set closed=`right for left-open right-closed interval\ns.asfreq(rule=`8min,closed=`right)\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.10.01T23:36:00 |      |\n| 2022.10.01T23:44:00 | 6    |\n| 2022.10.01T23:52:00 |      |\n| 2022.10.02T00:00:00 |      |\n| 2022.10.02T00:08:00 |      |\n| 2022.10.02T00:16:00 |      |\n| 2022.10.02T00:24:00 |      |\n| 2022.10.02T00:32:00 |      |\n\n```\n// Set origin=`end to align backward from the last time point\ns.asfreq(rule=`8min,closed=`right,origin=`end)\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.10.01T23:30:00 | 0    |\n| 2022.10.01T23:38:00 |      |\n| 2022.10.01T23:46:00 |      |\n| 2022.10.01T23:54:00 |      |\n| 2022.10.02T00:02:00 |      |\n| 2022.10.02T00:10:00 |      |\n| 2022.10.02T00:18:00 |      |\n| 2022.10.02T00:26:00 | 24   |\n\n```\n// Set label=`right to label the right boundary of the interval, with closed=`left by default\ns.asFreq(rule=`8min,label=`right)\n```\n\n| label               | 0 |\n| ------------------- | - |\n| 2022.10.01 23:36:00 |   |\n| 2022.10.01 23:44:00 | 6 |\n| 2022.10.01 23:52:00 |   |\n| 2022.10.02 00:00:00 |   |\n| 2022.10.02 00:08:00 |   |\n| 2022.10.02 00:16:00 |   |\n| 2022.10.02 00:24:00 |   |\n| 2022.10.02 00:32:00 |   |\n"
    },
    "asfreq": {
        "url": "https://docs.dolphindb.com/en/Functions/a/asfreq1.html",
        "signatures": [
            {
                "full": "asFreq(X, rule, [closed], [label], [origin='start_day'])",
                "name": "asFreq",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "rule",
                        "name": "rule"
                    },
                    {
                        "full": "[closed]",
                        "name": "closed",
                        "optional": true
                    },
                    {
                        "full": "[label]",
                        "name": "label",
                        "optional": true
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    }
                ]
            }
        ],
        "markdown": "### [asfreq](https://docs.dolphindb.com/en/Functions/a/asfreq1.html)\n\nAlias for [asFreq](https://docs.dolphindb.com/en/Functions/a/asFreq.html)\n\n\nDocumentation for the `asFreq` function:\n### [asFreq](https://docs.dolphindb.com/en/Functions/a/asFreq.html)\n\n\n\n#### Syntax\n\nasFreq(X, rule, \\[closed], \\[label], \\[origin='start\\_day'])\n\nAlias: asfreq\n\n#### Parameters\n\n**X** is an indexed matrix or indexed series. The index must be of temporal type.\n\n**rule** is a string that can take the following values:\n\n| Value of *rule* | Corresponding DolphinDB function |\n| --------------- | -------------------------------- |\n| \"B\"             | businessDay                      |\n| \"W\"             | weekEnd                          |\n| \"WOM\"           | weekOfMonth                      |\n| \"LWOM\"          | lastWeekOfMonth                  |\n| \"M\"             | monthEnd                         |\n| \"MS\"            | monthBegin                       |\n| \"BM\"            | businessMonthEnd                 |\n| \"BMS\"           | businessMonthBegin               |\n| \"SM\"            | semiMonthEnd                     |\n| \"SMS\"           | semiMonthBegin                   |\n| \"Q\"             | quarterEnd                       |\n| \"QS\"            | quarterBegin                     |\n| \"BQ\"            | businessQuarterEnd               |\n| \"BQS\"           | businessQuarterBegin             |\n| \"REQ\"           | FY5253Quarter                    |\n| \"A\"             | yearEnd                          |\n| \"AS\"            | yearBegin                        |\n| \"BA\"            | businessYearEnd                  |\n| \"BAS\"           | businessYearBegin                |\n| \"RE\"            | FY5253                           |\n| \"D\"             | date                             |\n| \"H\"             | hourOfDay                        |\n| \"min\"           | minuteOfHour                     |\n| \"S\"             | secondOfMinute                   |\n| \"L\"             | millisecond                      |\n| \"U\"             | microsecond                      |\n| \"N\"             | nanosecond                       |\n| \"SA\"            | semiannualEnd                    |\n| \"SAS\"           | semiannualBegin                  |\n\nThe strings above can also be used with positive integers for parameter *rule*. For example, \"2M\" means the end of every two months. In addition, *rule* can also be set as the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name. Positive integers can also be used with identifiers. For example, \"2XNYS\" means every two trading days of New York Stock Exchange.\n\n*rule* can also be a vector of temporal type.\n\n**closed** is a string indicating which boundary of the interval is closed.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**label** is a string indicating which boundary is used to label the interval.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**origin** is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start\\_day', 'end', 'end\\_day' or a user-defined time object. The default value is 'start\\_day'.\n\n* 'epoch': *origin* is 1970-01-01\n\n* 'start': *origin* is the first value of the timeseries\n\n* 'start\\_day': *origin* is 00:00 of the first day of the timeseries\n\n* 'end': *origin* is the last value of the timeseries\n\n* 'end\\_day': *origin* is 24:00 of the last day of the timeseries\n\n#### Details\n\nConvert *X* to specified frequency. Different from [resample](https://docs.dolphindb.com/en/Functions/r/resample.html), aggregate functions cannot be used in `asfreq`.\n\n#### Examples\n\n```\nindex = [2000.01.01, 2000.01.31, 2000.02.15, 2000.02.20, 2000.03.31, 2000.04.16, 2000.05.06, 2000.08.31]\ns = indexedSeries(index, 1..8)\ns\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2000.01.01 | 1 |\n| 2000.01.31 | 2 |\n| 2000.02.15 | 3 |\n| 2000.02.20 | 4 |\n| 2000.03.31 | 5 |\n| 2000.04.16 | 6 |\n| 2000.05.06 | 7 |\n| 2000.08.31 | 8 |\n\n```\ns.asfreq(\"M\")  // M = monthEnd\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2000.01.31 | 2 |\n| 2000.02.29 |   |\n| 2000.03.31 | 5 |\n| 2000.04.30 |   |\n| 2000.05.31 |   |\n| 2000.06.30 |   |\n| 2000.07.31 |   |\n| 2000.08.31 | 8 |\n\n```\ns.asfreq(\"2M\")  // 2M = every 2 months month-end\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2000.01.31 | 2 |\n| 2000.03.31 | 5 |\n| 2000.05.31 |   |\n| 2000.07.31 |   |\n\n```\nindex = [2020.01.01, 2020.01.03, 2020.01.06]\ns = indexedSeries(index, 1..3)\ns\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2020.01.01 | 1 |\n| 2020.01.03 | 2 |\n| 2020.01.06 | 3 |\n\n```\ns.asfreq(\"D\")  // D = date\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2020.01.01 | 1 |\n| 2020.01.02 |   |\n| 2020.01.03 | 2 |\n| 2020.01.04 |   |\n| 2020.01.05 |   |\n| 2020.01.06 | 3 |\n\n```\ns.asfreq(\"2D\")  // 2D = every 2 days\n```\n\n| lable      | 0 |\n| ---------- | - |\n| 2020.01.01 | 1 |\n| 2020.01.03 | 2 |\n| 2020.01.05 |   |\n\n```\nindex = temporalAdd(2022.10.01 23:30:00,7*(0..8),`m)\ns = indexedSeries(index, 3*(0..8))\ns.asfreq(\"8min\")  // Convert to 8-minute frequency, with closed=`left by default (left-closed right-open)\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.10.01T23:28:00 |      |\n| 2022.10.01T23:36:00 |      |\n| 2022.10.01T23:44:00 | 6    |\n| 2022.10.01T23:52:00 |      |\n| 2022.10.02T00:00:00 |      |\n| 2022.10.02T00:08:00 |      |\n| 2022.10.02T00:16:00 |      |\n| 2022.10.02T00:24:00 |      |\n\n```\n// Set closed=`right for left-open right-closed interval\ns.asfreq(rule=`8min,closed=`right)\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.10.01T23:36:00 |      |\n| 2022.10.01T23:44:00 | 6    |\n| 2022.10.01T23:52:00 |      |\n| 2022.10.02T00:00:00 |      |\n| 2022.10.02T00:08:00 |      |\n| 2022.10.02T00:16:00 |      |\n| 2022.10.02T00:24:00 |      |\n| 2022.10.02T00:32:00 |      |\n\n```\n// Set origin=`end to align backward from the last time point\ns.asfreq(rule=`8min,closed=`right,origin=`end)\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.10.01T23:30:00 | 0    |\n| 2022.10.01T23:38:00 |      |\n| 2022.10.01T23:46:00 |      |\n| 2022.10.01T23:54:00 |      |\n| 2022.10.02T00:02:00 |      |\n| 2022.10.02T00:10:00 |      |\n| 2022.10.02T00:18:00 |      |\n| 2022.10.02T00:26:00 | 24   |\n\n```\n// Set label=`right to label the right boundary of the interval, with closed=`left by default\ns.asFreq(rule=`8min,label=`right)\n```\n\n| label               | 0 |\n| ------------------- | - |\n| 2022.10.01 23:36:00 |   |\n| 2022.10.01 23:44:00 | 6 |\n| 2022.10.01 23:52:00 |   |\n| 2022.10.02 00:00:00 |   |\n| 2022.10.02 00:08:00 |   |\n| 2022.10.02 00:16:00 |   |\n| 2022.10.02 00:24:00 |   |\n| 2022.10.02 00:32:00 |   |\n"
    },
    "asin": {
        "url": "https://docs.dolphindb.com/en/Functions/a/asin.html",
        "signatures": [
            {
                "full": "asin(X)",
                "name": "asin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [asin](https://docs.dolphindb.com/en/Functions/a/asin.html)\n\n\n\n#### Syntax\n\nasin(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nThe inverse sine (arcsine) function.\n\nDolphinDB `sine` and TA-Lib `ASIN` are mathematically identical in semantic meaning. The difference is that TA-Lib’s `ASIN` is a Math Transform function whose inputs and outputs are primarily one-dimensional arrays, whereas DolphinDB’s `sine` can operate on scalars, vectors, matrices, or tables, and preserves the structure of the input data.\n\n#### Examples\n\n```\nasin(0 0.5 1);\n// output: [0,0.523599,1.570796]\n```\n\nRelated functions: [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html), [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html), [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "asinh": {
        "url": "https://docs.dolphindb.com/en/Functions/a/asinh.html",
        "signatures": [
            {
                "full": "asinh(X)",
                "name": "asinh",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html)\n\n\n\n#### Syntax\n\nasinh(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nThe inverse hyperbolic sine function.\n\n#### Examples\n\n```\nasinh(0.841471 0.909297 0.141120);\n// output: [0.764725,0.815761,0.140656]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html), [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "asis": {
        "url": "https://docs.dolphindb.com/en/Functions/a/asis.html",
        "signatures": [
            {
                "full": "asis(obj)",
                "name": "asis",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [asis](https://docs.dolphindb.com/en/Functions/a/asis.html)\n\n\n\n#### Syntax\n\nasis(obj)\n\n#### Parameters\n\n**obj** can be of any data type.\n\n#### Details\n\nReturn a reference of *obj*.\n\n#### Examples\n\n```\na = 1 2 3\nb = asis(a)\na[0] = 0\nb\n// output: [0, 2, 3]\n\nb[1] = 4\na;\n// output: [0, 4, 3]\n```\n\nRelated Functions: [copy](https://docs.dolphindb.com/en/Functions/c/copy.html), [deepCopy](https://docs.dolphindb.com/en/Functions/d/deepCopy.html)\n"
    },
    "asof": {
        "url": "https://docs.dolphindb.com/en/Functions/a/asof.html",
        "signatures": [
            {
                "full": "asof(X, Y)",
                "name": "asof",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [asof](https://docs.dolphindb.com/en/Functions/a/asof.html)\n\n\n\n#### Syntax\n\nasof(X, Y)\n\n#### Parameters\n\n**X** must be a vector sorted in ascending order, or an indexed series/matrix whose row index is sorted in ascending order.\n\n**Y** is a scalar/vector/tuple/matrix/dictionary/table/array vector. If *X* is an indexed series/matrix, *Y* must be a vector.\n\n#### Details\n\nIf *X* is a vector, for each element y in *Y*, return the index of the last element in *X* that is no greater than y. If nothing is found, return -1.\n\nIf *X* is an indexed series/matrix, for each element y in *Y*, search the row index of *X* for the last index no greater than y, and return the data in the corresponding row. If no row index is found, return NULL.\n\n**Return value**: If *X* is a vector, the result is INT and has the same form as *Y*. If *X* is an indexed series, the result is an indexed series whose row index is *Y*. If *X* is an indexed matrix, the result is an indexed matrix whose row index is *Y* and column labels are the same as *X*.\n\n#### Examples\n\nExample 1. *X* is a vector.\n\n```\nasof(1..100, 60 200 -10)\n// output: [59,99,-1]\n\n0 0 0 1 1 1 1 2 2 3 asof 1\n// output: 6\n```\n\nExample 2. *X* is an indexed series.\n\n```\nindex = [2023.05.04, 2023.05.06, 2023.05.10]\ns = indexedSeries(index, 1..3)\ny = [2023.05.03, 2023.05.04, 2023.05.05, 2023.05.09, 2023.05.12]\nasof(s, y)\n```\n\n| label      | #0 |\n| ---------- | -- |\n| 2023.05.03 |    |\n| 2023.05.04 | 1  |\n| 2023.05.05 | 1  |\n| 2023.05.09 | 2  |\n| 2023.05.12 | 3  |\n\nExample 3. *X* is an indexed matrix.\n\n```\nindex = [2023.05.04, 2023.05.06, 2023.05.10]\nm = matrix(1..3, 11..13).rename!(index, `A`B).setIndexedMatrix!()\ny = [2023.05.03, 2023.05.04, 2023.05.05, 2023.05.09, 2023.05.12]\nasof(m, y)\n```\n\n| label      | A | B  |\n| ---------- | - | -- |\n| 2023.05.03 |   |    |\n| 2023.05.04 | 1 | 11 |\n| 2023.05.05 | 1 | 11 |\n| 2023.05.09 | 2 | 12 |\n| 2023.05.12 | 3 | 13 |\n"
    },
    "at": {
        "url": "https://docs.dolphindb.com/en/Functions/a/at.html",
        "signatures": [
            {
                "full": "at(X, [index])",
                "name": "at",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[index]",
                        "name": "index",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [at](https://docs.dolphindb.com/en/Functions/a/at.html)\n\n\n\n#### Syntax\n\nat(X, \\[index])\n\n#### Parameters\n\nIf only one parameter is specified:\n\n* **X** is a Boolean expression/vector or an integer vector.\n\nIf both parameters are specified:\n\n* **X** is a scalar/vector (including tuplesand array vectors)/matrix/table/dictionary/pair/function;\n* **index** is a Boolean expression/Boolean value/scalar/vector (including tuplesand array vectors)/pair.\n\n#### Details\n\nIn the first case:\n\n* If *X* is a Boolean expression/vector, `at` returns the indexes of the elements of *X* that are true.\n\n* If *X* is an integer vector, `at` returns a vector where each index in *X* is repeated according to its corresponding value. Its functionality is equivalent to `take(til(count(X)), X)`. For example, `at(3 0 2)` returns `[0,0,0,2,2]`. If a value at some position is non-positive, that position is skipped.\n\nIn the second case:\n\n* If *index* is a Boolean expression, `at` returns the elements in *X* that correspond to the elements in *Y* that are true. Function `at` is equivalent to brackets operator `[]`. For example, `X.at(X>3)` is equivalent to `X[X>3]`.\n\n* If *index* is a vector, `at` retrieves the elements from *X* at the positions as specified by each element of *index*.\n\n* If *index* is a tuple, each element in the tuple specifies an index into the corresponding dimension of *X*. `at` retrieves the element(s) at the specified position as specified by the indices. For example, when *X* is a matrix, *index* must be a tuple of two elements - the first element indicates the row index, and the second element indicates the column index.\n\n* If *index* is a pair like a:b, `at` returns the elements from *X* in the range \\[a,b).\n\n* If *index* is an array vector, each row of index specifies indices to retrieve from *X*. The result is an array vector with the same dimension as *index*.\n\nNote: When *index* refers to column/row index, or an index range, for elements outside the bounds of the *X* (i.e. outside of \\[0, size(X)-1]), the corresponding positions in *X* will return null values.\n\nIf *X* is a function, *index* specifies the arguments of *X*. When*index* is a tuple, each element of the tuple is passed as an argument to *X*.\n\n#### Examples\n\n```\nx = 2 3 -1 0 1\nat(x)\n// output:[0,0,1,1,1,4]\n\nx=5 7 0 4 2 3\nat(x>3)\n// output: [0,1,3] \n// at position 0, 1, and 3, x>3 is true.\n\n// compare with x>3:\nx>3;\n// output: [1,1,0,1,0,0]\n\nx[x>3]\n// output: [5,7,4]\n\nx at x>3\n// output: [5,7,4]\n\nx=5 7 0 0 0 3\nat(x==0)\n// output: [2,3,4]\n\nx[x==0]\n// output: [0,0,0]\n\nshares=500 1000 1000 600 2000\nprices=25.5 97.5  19.2 38.4 101.5\nprices[shares>800]\n// output: [97.5,19.2,101.5]\n\nprices at shares>800\n// output: [97.5,19.2,101.5]\n\nm=(1..6).reshape(2:3)\nm;\n```\n\n| 0 | 1 | 2 |\n| - | - | - |\n| 1 | 3 | 5 |\n| 2 | 4 | 6 |\n\n```\nat(m>3)\n// output: [3,4,5]\n\nm[m>3] // equal to m at m>3\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n|      |      | 5    |\n|      | 4    | 6    |\n\nNote the difference between using a vector versus a tuple for *index*:\n\n```\nm at [0,2]  // locate column 0 and 2\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 5 |\n| 2 | 6 |\n\n```\nm at (0,2) // locate element at a specific column and a specific row\n// output: 5\n```\n\n```\nm at 0:2  // locate column 0 and 1\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 3 |\n| 2 | 4 |\n\nWhen *index* is an array vector:\n\n```\na = array\\(INT\\[\\], 0, 10\\).append!\\(\\[0 2 3, 0 5, 0 8 8, 9 10\\]\\)\nb =\\[1, 2, 3\\]\n\nat\\(b, a\\)\n// output: \\[\\[1,3, \\], \\[1, \\], \\[1, , \\], \\[ , \\]\\]\n\nat\\(a,a&gt;3\\)\n// output: \\[,\\[5\\],\\[8,8\\],\\[9,10\\]\\]\n```\n\nWhen *X*is a function, and *index* is a tuple to be passed as an argument:\n\n```\nscore = (60, 70);\nat(add,score)\n//output: 130\n```\n"
    },
    "atan": {
        "url": "https://docs.dolphindb.com/en/Functions/a/atan.html",
        "signatures": [
            {
                "full": "atan(X)",
                "name": "atan",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [atan](https://docs.dolphindb.com/en/Functions/a/atan.html)\n\n\n\n#### Syntax\n\natan(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nThe inverse tangent (arctan) function.\n\nDifference from Python TA-Lib’s `ATAN`: Both functions calculate the inverse tangent and return radians. TA-Lib’s `ATAN(close)` is a Math Transform function for vector input and returns an array, whereas DolphinDB’s `atan(X)` accepts a scalar, vector, matrix, or table and preserves the input form.\n\n#### Examples\n\n```\natan 0.000000 1.557408 -2.185040;\n// output: [0,1,-1.141593]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html), [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html), [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "atanh": {
        "url": "https://docs.dolphindb.com/en/Functions/a/atanh.html",
        "signatures": [
            {
                "full": "atanh(X)",
                "name": "atanh",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html)\n\n\n\n#### Syntax\n\natanh(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nThe inverse hyperbolic tangent function.\n\n#### Examples\n\n```\natanh 0.000000 0.557408 -0.185040;\n// output: [0,0.629065,-0.187196]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html), [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "atImax": {
        "url": "https://docs.dolphindb.com/en/Functions/a/atImax.html",
        "signatures": [
            {
                "full": "atImax(location, value)",
                "name": "atImax",
                "parameters": [
                    {
                        "full": "location",
                        "name": "location"
                    },
                    {
                        "full": "value",
                        "name": "value"
                    }
                ]
            }
        ],
        "markdown": "### [atImax](https://docs.dolphindb.com/en/Functions/a/atImax.html)\n\n\n\n#### Syntax\n\natImax(location, value)\n\n#### Parameters\n\n**location** and **value** are vectors/matrices/tables of the same dimensions.\n\n#### Details\n\nFind the position of the element with the largest value in *location*, and return the value of the element in the same position in *value*. If there are multiple identical maximums in *location*, return the position of the first maximum.\n\nIf *location* and *value* are matrices, conduct the aforementioned calculation with each column of *location* and the corresponding column of *value*.\n\n`atImax(location, value)` is equivalent to `value[imax(location)]`.\n\n#### Examples\n\n```\natImax(3 5 1 2, 9 7 5 3)\n// output: 7\n\nm1=matrix(9 2 1 5 6 9, 3 1 3 NULL 5 2, 2 8 1 2 3 4)\nm2=matrix(1..6, 1..6, 1..6)\natImax(m1,m2)\n// output: [1,5,2]\n```\n\nRelated functions: [imax](https://docs.dolphindb.com/en/Functions/i/imax.html), [atImin](https://docs.dolphindb.com/en/Functions/a/atImin.html)\n"
    },
    "atImin": {
        "url": "https://docs.dolphindb.com/en/Functions/a/atImin.html",
        "signatures": [
            {
                "full": "atImin(location, value)",
                "name": "atImin",
                "parameters": [
                    {
                        "full": "location",
                        "name": "location"
                    },
                    {
                        "full": "value",
                        "name": "value"
                    }
                ]
            }
        ],
        "markdown": "### [atImin](https://docs.dolphindb.com/en/Functions/a/atImin.html)\n\n\n\n#### Syntax\n\natImin(location, value)\n\n#### Parameters\n\n**location** and **value** are vectors/matrices/tables of the same dimensions.\n\n#### Details\n\nFind the position of the element with the smallest value in *location*, and return the value of the element in the same position in *value*. If there are multiple identical minimums in *location*, return the position of the first minimum.\n\nIf *location* and *value* are matrices, conduct the aforementioned calculation with each column of *location* and the corresponding column of *value*.\n\n`atImin(location, value)` is equivalent to `value[imin(location)]`.\n\n#### Examples\n\n```\natImin(3 5 1 2, 9 7 5 3)\n// output: 5\n\nm1=matrix(9 2 1 5 6 9, 3 1 3 NULL 5 2, 2 8 1 2 3 4)\nm2=matrix(1..6, 1..6, 1..6)\natImin(m1,m2)\n// output: [3,2,3]\n```\n\nRelated functions: [imin](https://docs.dolphindb.com/en/Functions/i/imin.html), [atImax](https://docs.dolphindb.com/en/Functions/a/atImax.html)\n"
    },
    "attributeNames": {
        "url": "https://docs.dolphindb.com/en/Functions/a/attributeNames.html",
        "signatures": [
            {
                "full": "attributeNames(obj)",
                "name": "attributeNames",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [attributeNames](https://docs.dolphindb.com/en/Functions/a/attributeNames.html)\n\n\n\n#### Syntax\n\nattributeNames(obj)\n\n#### Parameters\n\n**obj** is a class instance.\n\n#### Details\n\nGet all attributes of the class instance.\n\n**Return value**: A STRING vector.\n\n#### Examples\n\n```\nclass Person {\n\t\n\tname :: STRING\n\tage :: INT\n\n\tdef Person(name_, age_) { \n\t\tname = name_\n\t\tage = age_\n\t}\n}\n\np = Person(\"Sam\", 12)\nattributeNames(p)\n\n// output: [\"name\",\"age\"]\n```\n"
    },
    "attributeTypes": {
        "url": "https://docs.dolphindb.com/en/Functions/a/attributeTypes.html",
        "signatures": [
            {
                "full": "attributeTypes(obj)",
                "name": "attributeTypes",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [attributeTypes](https://docs.dolphindb.com/en/Functions/a/attributeTypes.html)\n\nFirst introduced in versions: 3.00.4.2, 3.00.3.2\n\n\n\n#### Syntax\n\nattributeTypes(obj)\n\n#### Details\n\nGets all attributes and corresponding types of a class or class instance.\n\n#### Parameters\n\n**obj** is a class or class instance.\n\n#### Returns\n\nA table with the following columns:\n\n* attr: The attribute name.\n* type: The data type of the attribute.\n\n#### Examples\n\n```\nclass Person {\n\tname :: STRING\n\tage :: INT\n\tdef Person(name_, age_) { \n\t\tname = name_\n\t\tage = age_\n\t}\n}\np1 = Person(\"Sam\", 12)\nattributeTypes(p1)   //  or attributeTypes(Person)\n```\n\n| attr | type   |\n| ---- | ------ |\n| name | STRING |\n| age  | INT    |\n\n**Related functions**: [attributeNames](https://docs.dolphindb.com/en/Functions/a/attributeNames.html), [attributeValues](https://docs.dolphindb.com/en/Functions/a/attributeValues.html)\n"
    },
    "attributeValues": {
        "url": "https://docs.dolphindb.com/en/Functions/a/attributeValues.html",
        "signatures": [
            {
                "full": "attributeValues(obj)",
                "name": "attributeValues",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [attributeValues](https://docs.dolphindb.com/en/Functions/a/attributeValues.html)\n\n\n\n#### Syntax\n\nattributeValues(obj)\n\n#### Parameters\n\n**obj** is a class instance.\n\n#### Details\n\nGet all attributes and corresponding values of the class instance.\n\n**Return value**: A dictionary with attribute-value pairs.\n\n#### Examples\n\n```\nclass Person {\n\tname :: STRING\n\tage :: INT\n\tdef Person(name_, age_) { \n\t\tname = name_\n\t\tage = age_\n\t}\n}\np1 = Person(\"Sam\", 12)\nattributeValues(p1)\n\n/* output: \nname->Sam\nage->12\n*/\n\np2 = Person(\"Andy\", 16)\nattributeValues(p2)\n\n/* output: \nname->Andy\nage->16\n*/\n```\n"
    },
    "autocorr": {
        "url": "https://docs.dolphindb.com/en/Functions/a/autocorr.html",
        "signatures": [
            {
                "full": "autocorr(X, lag)",
                "name": "autocorr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "lag",
                        "name": "lag"
                    }
                ]
            }
        ],
        "markdown": "### [autocorr](https://docs.dolphindb.com/en/Functions/a/autocorr.html)\n\n\n\n#### Syntax\n\nautocorr(X, lag)\n\n#### Parameters\n\n**location** is a vector.\n\n**lag** is a positive integer.\n\n#### Details\n\nCalculate the autocorrelation of *X*. Note that the means of the two time series used in the calculation is the mean of *X* instead of the means of the two time series.\n\n#### Examples\n\n```\nn=10000\nx=array(double, n, n, NULL)\nx[0]=1\nr=rand(0.05, n)-0.025\nfor(i in 0:(n-1)){\n    x[i+1]=-0.8*x[i]+r[i]\n}\n\nautocorr(x, 1)\n// output: -0.808343\n\nautocorr(x, 2)\n// output: 0.661018\n```\n"
    },
    "avg": {
        "url": "https://docs.dolphindb.com/en/Functions/a/avg.html",
        "signatures": [
            {
                "full": "avg(X)",
                "name": "avg",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [avg](https://docs.dolphindb.com/en/Functions/a/avg.html)\n\n\n\n#### Syntax\n\navg(X)\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix/table.\n\n#### Details\n\nCalculate the average of *X*.\n\n* If *X* is a vector, calculate the average of *X*.\n* If *X* is a matrix, calculate the average of each column and return a vector.\n* If *X* is a table, calculate the average of each column and return a table.\n\nThe calculation skips null values.\n\n#### Examples\n\n```\navg(1 2 3 NULL)\n// output: 2\n\nm=matrix(1 2 3, 4 5 6)\nm\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\navg(m)\n// output: [2,5]\n```\n"
    },
    "backup": {
        "url": "https://docs.dolphindb.com/en/Functions/b/backup.html",
        "signatures": [
            {
                "full": "backup(backupDir, dbPath|sqlObj, [force=false], [parallel=false], [snapshot=true], [tableName], [partition], [keyPath])",
                "name": "backup",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath|sqlObj",
                        "name": "dbPath|sqlObj"
                    },
                    {
                        "full": "[force=false]",
                        "name": "force",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[parallel=false]",
                        "name": "parallel",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[snapshot=true]",
                        "name": "snapshot",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    },
                    {
                        "full": "[partition]",
                        "name": "partition",
                        "optional": true
                    },
                    {
                        "full": "[keyPath]",
                        "name": "keyPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [backup](https://docs.dolphindb.com/en/Functions/b/backup.html)\n\n\n\n#### Syntax\n\nbackup(backupDir, dbPath|sqlObj, \\[force=false], \\[parallel=false], \\[snapshot=true], \\[tableName], \\[partition], \\[keyPath])\n\n#### Details\n\nBack up all or specified partitions of a distributed table. Return an integer indicating the number of partitions that have been backed up successfully. It must be executed by a logged-in user.\n\nNote:\n\n* For a database created with *chunkGranularity*='DATABASE', it can only be backed up with SQL statements.\n\n* If backup files already exist under the *backupDir*, the next backup must adopt the same method (by specifying *dbPath* or *sqlObj*). Otherwise the backup would fail.\n\n* If *backupDir*is an AWS S3 directory, the configuration file of the data node must specify *preloadModules*=plugins::awss3, and configure *s3AccessKeyId*, *s3SecretAccessKey*and *s3Region*.\n\nThe following table compares the 2 types of backup:\n\n| Feature                                             | copying files (specifying parameter *dbPath*) | SQL statements (specifying parameter *sqlObj*) |\n| --------------------------------------------------- | --------------------------------------------- | ---------------------------------------------- |\n| back up an entire database                          | √                                             | ×                                              |\n| data consistency                                    | fully guaranteed                              | partially guaranteed                           |\n| incremental backup of modified and added partitions | √                                             | √                                              |\n| incremental backup of deleted partitions            | √                                             | ×                                              |\n| resume data transmission from a breakpoint          | √                                             | ×                                              |\n| back up data with filter conditions                 | ×                                             | √                                              |\n| performance                                         | lower memory usage                            | higher memory usage                            |\n\n#### Parameters\n\n**backupDir** is a string indicating the directory to save the backup. For an AWS S3 directory, it must begin with `s3://`.\n\n**dbPath** is a string indicating the database path. If specified, back up the database by copying partitions. If *backupDir*is an AWS S3 directory, only *dbPath*can be specified.\n\n**sqlObj** is metacode of SQL statements indicating the data to be backed up. If specified, only the queried data is backed up.\n\n**force** (optional) is a Boolean value. True means to perform a full backup, otherwise to perform an incremental backup.\n\n**parallel** (optional) is a Boolean value indicating whether to back up partitions in parallel. The default value is false.\n\nThe following parameters only take effect when *dbPath* is specified:\n\n**snapshot** (optional) is a Boolean value indicating whether to synchronize the deletion of tables/partitions to the backup database. It only takes effect when the parameter partition is empty. The default value is true, indicating the system will remove the deleted table/partitions from the backup files.\n\n**tableName** (optional) is a STRING scalar or vector indicating the name of table to be backed up. If unspecified, all tables of the database are backed up.\n\n**partition** (optional) indicates the partitions to be backed up. It can be:\n\n* a STRING scalar or vector indicating the path(s) to one or multiple partitions of a database, and each path starts with \"/\". Note that for a compo-partitioned database, the path must include all partition levels.\n\n* filter condition(s). A filter condition can be a scalar or vector where each element represents a partition.\n\n  * For a single-level partitioning database, it is a scalar.\n\n  * For a compo-partitioned database, it is a tuple composed of filter conditions with each element for a partition level. If a partition level has no filter condition, the corresponding element in the tuple is empty.\n\n* unspecified to indicate all partitions.\n\n**keyPath** (optional, Linux only) is a STRING scalar that specifies the path to the TDE key file used for backup encryption. If left empty, no encryption will be applied.\n\n#### Returns\n\nAn integer scalar.\n\n#### Examples\n\nCreate a DFS database *dfs\\://compoDB*\n\n```\nn=1000000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\n\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndbID=database(, RANGE, 0 50 100);\ndb = database(\"dfs://compoDB\", COMPO, [dbDate, dbID])\npt = db.createPartitionedTable(t, `pt, `date`ID)\npt.append!(t)\n```\n\nExample 1. Back up the table pt.\n\n```\nbackup(backupDir=\"/home/DolphinDB/backup\", sqlObj=<select * from loadTable(\"dfs://compoDB\",\"pt\")>, force=true);\n// output: 10\n```\n\nExample 2. Back up the partitions of table pt with date>2017.08.10.\n\n```\nbackup(backupDir=\"/home/DolphinDB/backup\", sqlObj=<select * from loadTable(\"dfs://compoDB\",\"pt\") where date>2017.08.10>, force=true);\n// output: 2\n```\n\nExample 3. Back up data in the date partition 2017.08.09 of table pt.\n\nThe database created above is a composite partitioned database: the first level is a VALUE partition on `date`, and the second level is a RANGE partition on `ID`. Here *partition* specifies the date value `2017.08.09`, so `backup` directly matches the first-level partition `20170809` and backs up all its second-level partitions, i.e., `/20170809/0_50` and `/20170809/50_100`. It does not filter rows by date during backup.\n\n```\nbackup(backupDir=\"/home/DolphinDB/backup\", dbPath=\"dfs://compoDB\", force=true, tableName=`pt, partition=2017.08.09)\n```\n\nExample 4. Back up tables in a database.\n\n(1) Back up tables\n\n```\n// create table pt1 under database dfs://compoDB\npt1 = db.createPartitionedTable(t, `pt1, `date`ID)\npt1.append!(t)\n\n// back up 2 tables\nbackup(backupDir=\"/home/DolphinDB/backup\",dbPath=\"dfs://compoDB\",force=true);\n// output: 20\n```\n\n(2) Back up specified partitions\n\n```\n// back up 5 partitions of table pt\npartitions=[\"/20170807/0_50\",\"/20170808/0_50\",\"/20170809/0_50\",\"/20170810/0_50\",\"/20170811/0_50\"]\nbackup(backupDir=\"/home/DolphinDB/backup\",dbPath=\"dfs://compoDB\",force=true,tableName=`pt,partition=partitions);\n// output: 5\n```\n\n(3) Back up partitions with filter conditions. Note that for a range domain, any value within the range can be specified to indicate the entire partition.\n\n```\n// back up the second-level partition 50_100 under the first-level partition 20170807\npartitions=[2017.08.07,50]\nbackup(backupDir=\"/home/DolphinDB/backup\",dbPath=\"dfs://compoDB\",force=true,tableName=`pt,partition=partitions);\n// output: 1\n\n// back up the second-level partition 50_100 under all first-level partitions\npartitions=[,[0]]\nbackup(backupDir=\"/home/DolphinDB/backup\",dbPath=\"dfs://compoDB\",force=true,tableName=`pt,partition=partitions);\n// output: 5  \n```\n\nExample 5. The following examples explains how to use the parameter *snapshot*\n\n```\n// delete partition \"/20170811/0_50\" form table pt\ndb.dropPartition(\"/20170811/0_50\",`pt)\n\n// back up again and set snapshot=false\nbackup(backupDir=\"/home/DolphinDB/backup1\",dbPath=\"dfs://compoDB\",force=true,snapshot=false,tableName=`pt);\n// output: 9\n\n// restore from the backup and you can see that partition \"/20170811/0_50\" was not deleted\nrestore(backupDir=\"/home/DolphinDB/backup1\",dbPath=\"dfs://compoDB\",tableName=`pt,partition=\"%\",force=true)\n[\"dfs://compoDB/20170807/0_50/9m9\",\"dfs://compoDB/20170807/50_100/9m9\",\"dfs://compoDB/20170808/0_50/9m9\",\"dfs://compoDB/20170808/50_100/9m9\",\"dfs://compoDB/20170809/0_50/9m9\",\"dfs://compoDB/20170809/50_100/9m9\",\"dfs://compoDB/20170810/0_50/9m9\",\"dfs://compoDB/20170810/50_100/9m9\",\"dfs://compoDB/20170811/0_50/9m9\",\"dfs://compoDB/20170811/50_100/9m9\"]\n\n//delete partition \"/20170811/0_50\" form table pt\ndb.dropPartition(\"/20170811/0_50\",`pt)\n\n// back up again and set snapshot=true\nbackup(backupDir=\"/home/DolphinDB/backup\",dbPath=\"dfs://compoDB\",force=true,snapshot=true,tableName=`pt);\n// output: 9\n    \n// restore from the backup and you can see that partition \"/20170811/0_50\" was deleted\nrestore(backupDir=\"/home/DolphinDB/backup\",dbPath=\"dfs://compoDB\",tableName=`pt,partition=\"%\",force=true)\n// output: [\"dfs://compoDB/20170807/0_50/9m9\",\"dfs://compoDB/20170807/50_100/9m9\",\"dfs://compoDB/20170808/0_50/9m9\",\"dfs://compoDB/20170808/50_100/9m9\",\"dfs://compoDB/20170809/0_50/9m9\",\"dfs://compoDB/20170809/50_100/9m9\",\"dfs://compoDB/20170810/0_50/9m9\",\"dfs://compoDB/20170810/50_100/9m9\",\"dfs://compoDB/20170811/50_100/9m9\"]\n```\n\nRelated functions: [backupDB](https://docs.dolphindb.com/en/Functions/b/backupDB.html), [backupTable](https://docs.dolphindb.com/en/Functions/b/backupTable.html), [restore](https://docs.dolphindb.com/en/Functions/r/restore.html), [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html)\n"
    },
    "backupDB": {
        "url": "https://docs.dolphindb.com/en/Functions/b/backupDB.html",
        "signatures": [
            {
                "full": "backupDB(backupDir, dbPath, [keyPath])",
                "name": "backupDB",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "[keyPath]",
                        "name": "keyPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [backupDB](https://docs.dolphindb.com/en/Functions/b/backupDB.html)\n\n\n\n#### Syntax\n\nbackupDB(backupDir, dbPath, \\[keyPath])\n\n#### Details\n\nBack up the specific database to the specified directory.\n\nThe function is equivalent to `backup(backupDir, dbPath, force=false, sparallel=true, snapshot=true)`.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory to save the backup.\n\n**dbPath** is a string indicating the database path.\n\n**keyPath** (optional, Linux only) is a STRING scalar that specifies the path to the TDE key file used for backup encryption. If left empty, no encryption will be applied.\n\n#### Return\n\nAn INT scalar, indicating the number of databases that were backed up.\n\n#### Examples\n\n```\ndbName = \"dfs://compoDB2\"\nn=1000\nID=rand(\"a\"+string(1..10), n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10, n)\nt=table(ID, date, x)\ndb1 = database(, VALUE, 2017.08.07..2017.08.11)\ndb2 = database(, HASH,[INT, 20])\nif(existsDatabase(dbName)){\n  dropDatabase(dbName)\n}\ndb = database(dbName, COMPO,[ db1,db2])\n\n//create 2 tables\npt1 = db.createPartitionedTable(t, `pt1, `date`x).append!(t)\npt2 = db.createPartitionedTable(t, `pt2, `date`x).append!(t)\n\n// Specify the directory to store the backup data.\n// The following is an example; please modify the path as needed.\nbackupDir = \"/home/test/dolphindb/server/backup/\"\n\nbackupDB(backupDir, dbName)\n```\n\nRelated functions: [backup](https://docs.dolphindb.com/en/Functions/b/backup.html), [backupTable](https://docs.dolphindb.com/en/Functions/b/backupTable.html), [restore](https://docs.dolphindb.com/en/Functions/r/restore.html), [restoreDB](https://docs.dolphindb.com/en/Functions/r/restoreDB.html), [restoreTable](https://docs.dolphindb.com/en/Functions/r/restoreTable.html), [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html)\n"
    },
    "backupSettings": {
        "url": "https://docs.dolphindb.com/en/Functions/b/backupSettings.html",
        "signatures": [
            {
                "full": "backupSettings(fileName, [userPermission=true], [functionView=true])",
                "name": "backupSettings",
                "parameters": [
                    {
                        "full": "fileName",
                        "name": "fileName"
                    },
                    {
                        "full": "[userPermission=true]",
                        "name": "userPermission",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[functionView=true]",
                        "name": "functionView",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [backupSettings](https://docs.dolphindb.com/en/Functions/b/backupSettings.html)\n\n#### Syntax\n\nbackupSettings(fileName, \\[userPermission=true], \\[functionView=true])\n\n#### Details\n\nBack up all settings on users, permissions, and function views to specified directory.\n\nThis function can only be executed by an administrator on the controller. It can be used with `restoreSettings` to back up and restore user settings when migrating databases.\n\n#### Parameters\n\n**fileName**is a STRING scalar specifying the backup file path. It can be an absolute path or relative path to *\\<HomeDir>*.\n\n**userPermission** (optional) is a Boolean scalar, indicating whether to back up user permissions. The default value is true.\n\n**functionView** (optional) is a Boolean scalar, indicating whether to back up function views. The default value is true.\n\n#### Returns\n\nA vector containing all backup user names and function views.\n\n#### Examples\n\n```\nbackupSettings(fileName=\"/home/ddb/backup/permission.back\", userPermission=true, functionView=true)\nbackupSettings(fileName=\"/home/ddb/backup/permission.back\", userPermission=true, functionView=false)\nbackupSettings(fileName=\"/home/ddb/backup/permission.back\", userPermission=false, functionView=true)\nbackupSettings(fileName=\"/home/ddb/backup/permission.back\", userPermission=false, functionView=false)\n```\n\n**Related function**: [restoreSettings](https://docs.dolphindb.com/en/Functions/r/restoreSettings.html)\n\n"
    },
    "backupTable": {
        "url": "https://docs.dolphindb.com/en/Functions/b/backupTable.html",
        "signatures": [
            {
                "full": "backupTable(backupDir, dbPath, tableName, [keyPath])",
                "name": "backupTable",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[keyPath]",
                        "name": "keyPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [backupTable](https://docs.dolphindb.com/en/Functions/b/backupTable.html)\n\n\n\n#### Syntax\n\nbackupTable(backupDir, dbPath, tableName, \\[keyPath])\n\n#### Details\n\nBack up a table to the specified directory.\n\nThe function is equivalent to `backup(backupDir, dbPath, force=false, parallel=true, snapshot=true, tableName)`.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory to save the backup.\n\n**dbPath** is a string indicating the database path.\n\n**tableName** is a string indicating the table name.\n\n**keyPath** (optional, Linux only) is a STRING scalar that specifies the path to the TDE key file used for backup encryption. If left empty, no encryption will be applied.\n\n#### Return\n\nAn INT scalar, indicating the number of tables that were backed up.\n\n#### Examples\n\n```\ndbName = \"dfs://compoDB2\"\nn=1000\nID=rand(\"a\"+string(1..10), n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10, n)\nt=table(ID, date, x)\ndb1 = database(, VALUE, 2017.08.07..2017.08.11)\ndb2 = database(, HASH,[INT, 20])\nif(existsDatabase(dbName)){\n  dropDatabase(dbName)\n}\ndb = database(dbName, COMPO,[ db1,db2])\n\n//create 2 tables\npt1 = db.createPartitionedTable(t, `pt1, `date`x).append!(t)\npt2 = db.createPartitionedTable(t, `pt2, `date`x).append!(t)\n\nbackupTable(backupDir,dbName,`pt1)\n// output: 50\n```\n\nRelated functions: [backup](https://docs.dolphindb.com/en/Functions/b/backup.html), [backupDB](https://docs.dolphindb.com/en/Functions/b/backupDB.html), [restore](https://docs.dolphindb.com/en/Functions/r/restore.html), [restoreDB](https://docs.dolphindb.com/en/Functions/r/restoreDB.html), [restoreTable](https://docs.dolphindb.com/en/Functions/r/restoreTable.html), [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html)\n"
    },
    "bar": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bar.html",
        "signatures": [
            {
                "full": "bar(X, interval, [closed='left'])",
                "name": "bar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "interval",
                        "name": "interval"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    }
                ]
            }
        ],
        "markdown": "### [bar](https://docs.dolphindb.com/en/Functions/b/bar.html)\n\n\n\n#### Syntax\n\nbar(X, interval, \\[closed='left'])\n\n#### Details\n\n`bar` can group *X* based on the length specified by *interval*. If *X* is a vector,return a vector with the same length as *X*.\n\n#### Parameters\n\n**X** is an integral/temporal scalar or vector.\n\n**interval** is an integral/DURATION type scalar greater than 0 or a vector of the same length as *X*.\n\nWhen *interval* is of type DURATION, the following time units are supported (case-sensitive): w, d, H, m, s, ms, us, ns.\n\nNote: 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 [month](https://docs.dolphindb.com/en/Functions/m/month.html) or [year](https://docs.dolphindb.com/en/Functions/y/year.html). Specify the interval as an integer for calculation. You can refer to Example 2.\n\n**closed** (optional) is a string which can take 'left' (default) 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.\n\n* *closed* = 'left': X-(X % interval), indicating that the value with a remainder of 0 is specified as the left boundary of a group.\n\n* *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.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nbar(100,3);               // 100-(100%3)=100-1=99\n// output: 99\n\nbar(0..15, 3)\n// output: [0,0,0,3,3,3,6,6,6,9,9,9,12,12,12,15]\n\nx=[7,4,5,8,9,3,3,5,2,6,12,1,0,-5,32]\nbar(x, 5)\n// output: [5,0,5,5,5,0,0,5,0,5,10,0,0,-5,30]\n\nt=table(2021.01.01T01:00:00..2021.01.01T01:00:29 as time, rand(1.0, 30) as x)\nselect max(x) from t group by bar(time,5s)\n```\n\n| bar\\_time           | max\\_x   |\n| ------------------- | -------- |\n| 2021.01.01T01:00:00 | 0.539024 |\n| 2021.01.01T01:00:05 | 0.793327 |\n| 2021.01.01T01:00:10 | 0.958522 |\n| 2021.01.01T01:00:15 | 0.96987  |\n| 2021.01.01T01:00:20 | 0.827086 |\n| 2021.01.01T01:00:25 | 0.617353 |\n\nIn the following example, to group data by every 3 months, convert *X* with the `month` function, and specify *duration* as an integer in `bar`.\n\n```\nt=table(take(2018.01.01T01:00:00+1..10,10) join take(2018.02.01T02:00:00+1..10,10) join take(2018.03.01T08:00:00+1..10,10) join take(2018.04.01T08:00:00+1..10,10) join take(2018.05.01T08:00:00+1..10, 10) as time, rand(1.0, 50) as x)\nselect max(x) from t group by bar(month(time), 3);\n```\n\n| bar      | max\\_x |\n| -------- | ------ |\n| 2018.01M | 0.9868 |\n| 2018.04M | 0.9243 |\n\nThe following example groups data by week and calculates the maximum values for each week. Depending on parameter *closed*, the results are different.\n\n```\nt=table(2022.01.01 + 1..20  as time, rand(100, 20) as x)\n```\n\n| time       | x  |\n| ---------- | -- |\n| 2022.01.02 | 6  |\n| 2022.01.03 | 29 |\n| 2022.01.04 | 71 |\n| 2022.01.05 | 56 |\n| 2022.01.06 | 93 |\n| 2022.01.07 | 34 |\n| 2022.01.08 | 77 |\n| 2022.01.09 | 18 |\n| 2022.01.10 | 62 |\n| 2022.01.11 | 33 |\n| 2022.01.12 | 34 |\n| 2022.01.13 | 64 |\n| 2022.01.14 | 80 |\n| 2022.01.15 | 63 |\n| 2022.01.16 | 17 |\n| 2022.01.17 | 66 |\n| 2022.01.18 | 85 |\n| 2022.01.19 | 27 |\n| 2022.01.20 | 77 |\n| 2022.01.21 | 27 |\n\n```\nselect max(x) from t group by bar(time, 7d);\n```\n\n| bar\\_time  | max\\_x |\n| ---------- | ------ |\n| 2021.12.30 | 71     |\n| 2022.01.06 | 93     |\n| 2022.01.13 | 85     |\n| 2022.01.20 | 77     |\n\n```\nprint  select max(x) from t group by bar(time, 7d, closed='right');\n```\n\n| bar\\_time  | max\\_x |\n| ---------- | ------ |\n| 2021.01.06 | 93     |\n| 2022.01.13 | 77     |\n| 2022.01.20 | 85     |\n| 2022.01.27 | 27     |\n\nWhen 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.\n\n```\nn = 1000000\nnano = (09:30:00.000000000 + rand(long(6.5*60*60*1000000000), n)).sort!()\nprice = 100+cumsum(rand(0.02, n)-0.01)\nvolume = rand(1000, n)\nsymbol = rand(`600519`000001`600000`601766, n)\ntradeNano = table(symbol, nano, price, volume).sortBy!(`symbol`nano)\nundef(`nano`price`volume`symbol)\nbarMinutes = 7\nitv = barMinutes*60*long(1000000000)\n\nOHLC_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\n```\n\nRelated function: [dailyAlignedBar](https://docs.dolphindb.com/en/Functions/d/dailyAlignedBar.html)\n"
    },
    "base64Decode": {
        "url": "https://docs.dolphindb.com/en/Functions/b/base64Decode.html",
        "signatures": [
            {
                "full": "base64Decode(X)",
                "name": "base64Decode",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [base64Decode](https://docs.dolphindb.com/en/Functions/b/base64Decode.html)\n\n\n\n#### Syntax\n\nbase64Decode(X)\n\n#### Details\n\nDecode *X* from Base64 format to binary data.\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\nA BLOB scalar or vector.\n\n#### Examples\n\n```\nbase64Decode(base64Encode(`hello))\nhello\n\nbase64Decode(base64Encode(`hello`world))\n[\"hello\",\"world\"]\n```\n\nRelated function: [base64Ebcode](https://docs.dolphindb.com/en/Functions/b/base64Encode.html)\n"
    },
    "base64Encode": {
        "url": "https://docs.dolphindb.com/en/Functions/b/base64Encode.html",
        "signatures": [
            {
                "full": "base64Encode(X)",
                "name": "base64Encode",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [base64Encode](https://docs.dolphindb.com/en/Functions/b/base64Encode.html)\n\n\n\n#### Syntax\n\nbase64Encode(X)\n\n#### Details\n\nEncode *X* to Base64 format.\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nbase64Encode(`hello) \n// output: aGVsbG8=\n\nbase64Encode(`hello`world) \n// output: [\"aGVsbG8=\",\"d29ybGQ=\"]\n\nbase64Encode(\"\")\n// output: \"\"\n```\n\nRelated function: [base64Decode](https://docs.dolphindb.com/en/Functions/b/base64Decode.html)\n"
    },
    "beta": {
        "url": "https://docs.dolphindb.com/en/Functions/b/beta.html",
        "signatures": [
            {
                "full": "beta(Y, X)",
                "name": "beta",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [beta](https://docs.dolphindb.com/en/Functions/b/beta.html)\n\n\n\n#### Syntax\n\nbeta(Y, X)\n\n#### Details\n\nReturn the coefficient estimate of an ordinary-least-squares regression of *Y* on *X* (with intercept).\n\nDifference from Python’s `scipy.stats.beta`: `scipy.stats.beta` is a beta continuous random variable object for calculating probability density, distribution functions, random variates, and related statistics. DolphinDB’s `beta` is a statistical regression function that returns the OLS regression coefficient of *Y* on *X*.\n\nDifference from Python TA-Lib’s `BETA`: TA-Lib’s `BETA(high, low, timeperiod=5)` is a rolling technical-analysis statistic. It calculates beta on the rate-of-change series of *high* and *low* over each window. DolphinDB’s `beta(Y, X)` calculates one OLS regression coefficient over the full input when vectors are specified. To reproduce TA-Lib’s indicator behavior, use DolphinDB’s TA module `ta::beta`.\n\n#### Parameters\n\n**Y** and **X** are vectors of the same length.\n\n#### Returns\n\nA DOUBLE scalar/vector/table.\n\n#### Examples\n\n```\nx=1 3 5 7 11 16 23\ny=0.1 4.2 5.6 8.8 22.1 35.6 77.2;\n\nbeta(y,x);\n// output: 3.378632\n```\n"
    },
    "between": {
        "url": "https://docs.dolphindb.com/en/Functions/b/between.html",
        "signatures": [
            {
                "full": "between(X, Y)",
                "name": "between",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [between](https://docs.dolphindb.com/en/Functions/b/between.html)\n\n\n\n#### Syntax\n\nbetween(X, Y)\n\n#### Details\n\nCheck if each element of *X* is between the pair indicated by *Y* (both boundaries are inclusive). The result is of the same dimension as *X*.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\n**Y** is a pair indicating a range.\n\n#### Returns\n\nBOOL type with the same data form as *X*.\n\n#### Examples\n\n```\nbetween([1, 5.5, 6, 8], 1:6);\n// output: [1,1,1,0] // 1, 5.5 and 6 are between 1 and 6, but 8 is not.\n\nbetween(1 2.4 3.6 2 3.9, 2.4:3.6);\n// output: [0,1,1,0,0]\n```\n\n`between` can be used with `select` to filter columns:\n\n```\nt = table(`abb`aac`aaa as sym, 1.8 2.3 3.7 as price);\nselect * from t where price between 1:3;\n```\n\n<table id=\"table_dh4_2pf_dzb\"><tbody><tr><td>\n\nsym\n\n</td><td>\n\nprice\n\n</td></tr><tr><td>\n\nabb\n\n</td><td>\n\n1.8\n\n</td></tr><tr><td>\n\naac\n\n</td><td>\n\n2.3\n\n</td></tr></tbody>\n</table>The following example explains how null values of *Y* are handled.\n\nIf the configuration parameter *nullAsMinValueForComparison* is set to true, null values are treated as the minimum value of the current data type. Otherwise null values are processed as NULL and the comparison returns NULL.\n\n`between` can also be used with template [nullCompare](https://docs.dolphindb.com/en/Functions/Templates/nullCompare.html), and the result of comparison involving null values is always NULL, regardless of the *nullAsMinValueForComparison* setting.\n\n```\nbetween(10,:10)\n// output: true      // when nullAsMinValueForComparison=true\n\nbetween(10,:10)\n// output: NULL     // when nullAsMinValueForComparison=false\n\nnullCompare(between, 10, :10)\n// output: NULL\n```\n"
    },
    "bfill!": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bfill!.html",
        "signatures": [
            {
                "full": "bfill!(obj, [limit])",
                "name": "bfill!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[limit]",
                        "name": "limit",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [bfill!](https://docs.dolphindb.com/en/Functions/b/bfill!.html)\n\n\n\n#### Syntax\n\nbfill!(obj, \\[limit])\n\n#### Details\n\n* If *obj* is a vector: back fill the null values in *obj* with the next non-null value.\n\n* If *obj* is a matrix or a table: back fill the null values in each column of *obj* with the next non-null value.\n\n#### Parameters\n\n**obj** is a vector, matrix, or table.\n\n**limit** (optional) is a positive integer indicating the number of null values to be filled.\n\n#### Returns\n\nReturns the object with null values filled, with the same type and form as *obj*.\n\n#### Examples\n\n```\nx=1 2 3 NULL NULL NULL 4 5 6\nx.bfill!()\nx;\n// output: [1,2,3,4,4,4,4,5,6]\n\nx=1 2 3 NULL NULL NULL 4 5 6\nx.bfill!(1)\nx;\n// output: [1,2,3,,,4,4,5,6]\n\ndate=[2012.06.12,,2012.06.13,2012.06.14,2012.06.15]\nsym=[\"IBM\",\"MSFT\",\"IBM\",\"MSFT\",\"MSFT\"]\nprice=[40.56,26.56,,,50.76]\nqty=[2200,4500,1200,5600,]\ntimestamp=[09:34:07,,09:36:42,09:36:51,09:36:59]\nt=table(date,timestamp,sym,price,qty)\n\nbfill!(t)\nt\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  | 40.56 | 2200 |\n| 2012.06.13 | 09:36:42  | MSFT | 26.56 | 4500 |\n| 2012.06.13 | 09:36:42  | IBM  | 50.76 | 1200 |\n| 2012.06.14 | 09:36:51  | MSFT | 50.76 | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 |      |\n\nIf only certain columns need to be filled instead of all columns, please use [update](https://docs.dolphindb.com/en/Programming/SQLStatements/update.html) statement and [bfill](https://docs.dolphindb.com/en/Functions/b/bfill.html) function. For details, please refer to [bfill](https://docs.dolphindb.com/en/Functions/b/bfill.html).\n"
    },
    "bfill": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bfill.html",
        "signatures": [
            {
                "full": "bfill(obj, [limit])",
                "name": "bfill",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[limit]",
                        "name": "limit",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [bfill](https://docs.dolphindb.com/en/Functions/b/bfill.html)\n\n\n\n#### Syntax\n\nbfill(obj, \\[limit])\n\n#### Details\n\n* If *obj* is a vector: back fill the null values in *obj* with the next non-null value.\n* If *obj* is an array vector:\n  * For an empty row, fill it with the first non-empty row that follows it.\n  * For null values in a column, fill them with the first non-null value that follows within the same column.\n* If *obj* is a matrix or a table: back fill the null values in each column of *obj*with the next non-null value. according to the above rules.\n\nThis operation creates a new object and does not change the input *obj*. Function [bfill!](https://docs.dolphindb.com/en/Functions/b/bfill!.html) changes the input *obj*.\n\n#### Parameters\n\n**obj** is a vector/matrix/table/array vector.\n\n**limit** (optional) is a positive integer indicating the maximum number of consecutive null values to be filled. It cannot be specified when *obj* is an array vector.\n\n#### Returns\n\nReturns the object with null values filled, with the same type and form as *obj*.\n\n#### Examples\n\n```\nx=1 2 3 NULL NULL NULL 4 5 6\nx.bfill();\n// output: [1,2,3,4,4,4,4,5,6]\n\nx=1 2 3 NULL NULL NULL 4 5 6\nx.bfill(1);\n// output: [1,2,3,,,4,4,5,6]\n\nx.bfill!(2);\nx;\n// output: [1,2,3,,4,4,4,5,6]\n\ndate=[2012.06.12,2012.06.12,2012.06.13,2012.06.14,2012.06.15]\nsym=[\"IBM\",\"MSFT\",\"IBM\",\"MSFT\",\"MSFT\"]\nprice=[,,26.56,,50.76]\nqty=[,,4500,5600,6800]\ntimestamp=[09:34:07,09:35:26,09:36:42,09:36:51,09:36:59]\nt=table(date,timestamp,sym,price,qty)\nt;\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  |       |      |\n| 2012.06.12 | 09:35:26  | MSFT |       |      |\n| 2012.06.13 | 09:36:42  | IBM  | 26.56 | 4500 |\n| 2012.06.14 | 09:36:51  | MSFT |       | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 | 6800 |\n\n```\nt.bfill()\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  | 26.56 | 4500 |\n| 2012.06.12 | 09:35:26  | MSFT | 26.56 | 4500 |\n| 2012.06.13 | 09:36:42  | IBM  | 26.56 | 4500 |\n| 2012.06.14 | 09:36:51  | MSFT | 50.76 | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 | 6800 |\n\n```\nselect date, timestamp, sym, price.bfill() as price, qty.bfill() as qty from t context by sym;\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  | 26.56 | 4500 |\n| 2012.06.13 | 09:36:42  | IBM  | 26.56 | 4500 |\n| 2012.06.12 | 09:35:26  | MSFT | 50.76 | 5600 |\n| 2012.06.14 | 09:36:51  | MSFT | 50.76 | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 | 6800 |\n\nIn the following example, the third row of the array vector x is empty, so it is filled with the fourth row \\[8, 9, 10]; the first element of the third column is null, so it is filled with the next non-null value 10 in that column.\n\n```\nx = array(INT[], 0).append!([1 2 NULL, 4 5, NULL, 8 9 10])\nx\n// output:[[1,2,NULL],[4,5],[NULL],[8,9,10]]\nbfill(x)\n// output:[[1,2,10],[4,5],[8,9,10],[8,9,10]]\n```\n"
    },
    "bigarray": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bigarray.html",
        "signatures": [
            {
                "full": "bigarray(dataType|template, [initialSize], [capacity], [defaultValue])",
                "name": "bigarray",
                "parameters": [
                    {
                        "full": "dataType|template",
                        "name": "dataType|template"
                    },
                    {
                        "full": "[initialSize]",
                        "name": "initialSize",
                        "optional": true
                    },
                    {
                        "full": "[capacity]",
                        "name": "capacity",
                        "optional": true
                    },
                    {
                        "full": "[defaultValue]",
                        "name": "defaultValue",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [bigarray](https://docs.dolphindb.com/en/Functions/b/bigarray.html)\n\n\n\n#### Syntax\n\nbigarray(dataType|template, \\[initialSize], \\[capacity], \\[defaultValue])\n\n#### Details\n\nBig arrays are specially designed for advanced users in big data analysis. Regular arrays use continuous memory. If there is not enough continuous memory, an out of memory exception will occur. A big array consists of many small memory blocks instead of one large block of memory. Therefore big arrays help relieve the memory fragmentation issue. This, however, may come with light performance penalty for certain operations. For most users who don't need to worry about the memory fragmentation issue, they should use regular arrays instead of big arrays.\n\nA big array's minimum size or capacity is 16 MB. Users can declare a big array with the function `bigarray`. Functions and operations on regular arrays also apply to big arrays.\n\nWhen we call the [array](https://docs.dolphindb.com/en/Functions/a/array.html) function, if there are not enough continuous memory blocks available, or if the memory occupied by the array exceeds a certain threshold (the default threshold is 256 MB), the system creates a big array instead.\n\n#### Parameters\n\n**dataType** is the data type for the big array.\n\n**template** is an existing vector. The existing vector serves as a template and its data type determines the new big array's data type.\n\n**initialSize** (optional) is the initial size (in terms of the number of elements) of the big array. If the first parameter is a data type, then initialSize is required; if the first parameter is an existing big array, then initialSize is optional;\n\n**capacity** (optional) is the amount of memory (in terms of the number of elements) allocated to the big array. When the number of elements exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory.\n\n**defaultValue** (optional) is the default value of the big array. For many data types, the default values are 0. For string and symbol, the default values are null values.\n\n#### Returns\n\nA big array with the data type specified by *dataType*/*template*.\n\n#### Examples\n\n```language-python\nx=bigarray(int,10,10000000);\nx;\n// output: [0,0,0,0,0,0,0,0,0,0]\n\n// default value is set to 1\nx=bigarray(int,10,10000000,1);\nx;\n// output: [1,1,1,1,1,1,1,1,1,1]\n\nx=bigarray(int,0,10000000).append!(1..100);\nx[0];\n// output: 1\n\nsum x;\n// output: 5050\n\nx[x>50&&x<60];\n// output: [51,52,53,54,55,56,57,58,59]\n\nx=array(double, 40000000);\ntypestr x;\n// output: HUGE DOUBLE VECTOR\n```\n\nPerformance comparison of arrays and big arrays:\n\n```language-python\n// for sequential operations, the performance of arrays and that of big arrays are nearly identical.     \nn=20000000\nx=rand(10000, n)\ny=rand(1.0, n)\nbx= bigarray(int, 0, n).append!(x)\nby= bigarray(double,0,n).append!(y);\n\ntimer(100) wavg(x,y);\n// Time elapsed: 4869.74 ms\ntimer(100) wavg(bx,by);\n// Time elapsed: 4762.89 ms\n\ntimer(100) x*y;\n// Time elapsed: 7525.22 ms\ntimer(100) bx*by;\n// Time elapsed: 7791.83 ms\n\n// for random access, big arrays have light performance penalty.\nindices = shuffle 0..(n-1);\ntimer(10) x[indices];\n// Time elapsed: 2942.29 ms\ntimer(10) bx[indices];\n// Time elapsed: 3547.22 ms\n```\n"
    },
    "binaryExpr": {
        "url": "https://docs.dolphindb.com/en/Functions/b/binaryExpr.html",
        "signatures": [
            {
                "full": "binaryExpr(X, Y, optr)",
                "name": "binaryExpr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "optr",
                        "name": "optr"
                    }
                ]
            }
        ],
        "markdown": "### [binaryExpr](https://docs.dolphindb.com/en/Functions/b/binaryExpr.html)\n\n\n\n#### Syntax\n\nbinaryExpr(X, Y, optr)\n\n#### Details\n\nConnect *X* and *Y* with the binary operator specified in *optr* to generate metacode of a binary expression. You can execute the metacode with function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html).\n\n#### Parameters\n\n**X** can be a scalar/vector/matrix.\n\n**Y** is a scalar or a vector of the same type as *X*.\n\n**optr** is a binary operator.\n\n#### Returns\n\nA CODE metacode.\n\n#### Examples\n\n```\nbinaryExpr(1, 1, +).eval()\n// output: 2\n\nbinaryExpr(1 2.2 3, 1 2 3, *).eval()\n// output: [1 4.4 9]\n\nbinaryExpr(`id`st`nm, `fff, +).eval()\n// output: [\"idfff\",\"stfff\",\"nmfff\"]\n\n\na = matrix(1 2, 3 4)\nb = matrix(4 2, 5 1)\nbinaryExpr(a, b, dot).eval()\n```\n\n| #0 | #1 |\n| -- | -- |\n| 10 | 8  |\n| 16 | 14 |\n\nRelated function: [unifiedExpr](https://docs.dolphindb.com/en/Functions/u/unifiedExpr.html)\n"
    },
    "binsrch": {
        "url": "https://docs.dolphindb.com/en/Functions/b/binsrch.html",
        "signatures": [
            {
                "full": "binsrch(X, Y)",
                "name": "binsrch",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [binsrch](https://docs.dolphindb.com/en/Functions/b/binsrch.html)\n\n\n\n#### Syntax\n\nbinsrch(X, Y)\n\n#### Details\n\n`binsrch` means binary search. For each element in *Y*, `binsrch` locates its position in *X*. If nothing is found, it returns -1(s).\n\nFor optimal performance, we should use `binsrch` to search a short *Y* within a long sorted vector *X*. To search a large vector against another large unsorted vector, we should use function [find](https://docs.dolphindb.com/en/Functions/f/find.html), which is implemented using a hash table. However, building a hash table takes time and memory. Please also check the related function [in](https://docs.dolphindb.com/en/Functions/i/in.html).\n\n#### Parameters\n\n**X** must be a vector sorted in ascending order.\n\n**Y** is a scalar/vector/tuple/matrix/array vector/dictionary/table.\n\n#### Returns\n\nINT type with the same data form as *Y*.\n\n#### Examples\n\n```\n1..100 binsrch 12 6 88 102;\n// output: [11,5,87,-1]\n```\n"
    },
    "bitAnd": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bitAnd.html",
        "signatures": [
            {
                "full": "bitAnd(X, Y)",
                "name": "bitAnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [bitAnd](https://docs.dolphindb.com/en/Functions/b/bitAnd.html)\n\n\n\n#### Syntax\n\nbitAnd(X, Y)\n\nor\n\nX & Y\n\n#### Details\n\nReturn the result of the *bitAnd* operation.\n\n#### Parameters\n\n**X** and **Y** are numeric scalar, vectors, matrices or tables.\n\n#### Returns\n\nAn object with the same data type and form as *X*/*Y*.\n\n#### Examples\n\n```\nx=1 0 1;\ny=0 1 1;\nx&y;\n// output: [0,0,1]\n```\n"
    },
    "bitNot": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bitNot.html",
        "signatures": [
            {
                "full": "bitNot(X)",
                "name": "bitNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [bitNot](https://docs.dolphindb.com/en/Functions/b/bitNot.html)\n\n\n\n#### Syntax\n\nbitNot(X)\n\n#### Details\n\nReturn the result of a bitwise logical NOT operation.\n\n#### Parameters\n\n**X** is a numeric scalar/vector/matrix/table.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nbitNot(3)\n// output: -4\n\nav = array(INT[], 0, 10).append!([1 2 3, 4 5])\nbitNot(av)\n// output: [[-2,-3,-4],[-5,-6]]\n```\n"
    },
    "bitOr": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bitOr.html",
        "signatures": [
            {
                "full": "bitOr(X, Y)",
                "name": "bitOr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [bitOr](https://docs.dolphindb.com/en/Functions/b/bitOr.html)\n\n\n\n#### Syntax\n\nbitOr(X, Y)\n\nor\n\nX | Y\n\n#### Details\n\nReturn the result of the *bitOr* operation.\n\n#### Parameters\n\n**X** and **Y** are numeric scalar, vectors, matrices or tables.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx=1 0 1;\ny=0 1 1;\nx | y;\n// output: [1,1,1]\n```\n"
    },
    "bitXor": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bitXor.html",
        "signatures": [
            {
                "full": "bitXor(X, Y)",
                "name": "bitXor",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [bitXor](https://docs.dolphindb.com/en/Functions/b/bitXor.html)\n\n\n\n#### Syntax\n\nbitXor(X, Y)\n\nor\n\nX ^ Y\n\n#### Details\n\nReturn the result of the *bitXOr* operation.\n\n#### Parameters\n\n**X** and **Y** are numeric scalars, vectors, matrices or tables.\n\n#### Returns\n\nAn object with the same data type and form as *X*/*Y*.\n\n#### Examples\n\n```\nx=1 0 1;\ny= 0 1 1;\nx^y;\n// output: [1,1,0]\n```\n"
    },
    "blob": {
        "url": "https://docs.dolphindb.com/en/Functions/b/blob.html",
        "signatures": [
            {
                "full": "blob(X)",
                "name": "blob",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [blob](https://docs.dolphindb.com/en/Functions/b/blob.html)\n\n\n\n#### Syntax\n\nblob(X)\n\n#### Details\n\nConvert the data type of *X* to BLOB.\n\n**Note**: Values of BLOB type do not participate in calculations.\n\n#### Parameters\n\n**X** is a STRING scalar/vector.\n\n#### Returns\n\nA scalar/vector of type BLOB.\n\n#### Examples\n\n```\nstr=\"hello\"\nblob(str)\n// output: hello\n\nt=table(1..10 as id, \"A\"+string(1..10) as sym, 2012.01.01..2012.01.10 as date, rand(100.0, 10) as val, rand(uuid(), 10) as uid)\nstr=toJson(t)\nblob(str)\n```\n\nAfter a long string is converted to BLOB, it can be used as a column of an in-memory table:\n\n```\nd = dict(1..10000,  rand(1.0, 10000))\nstr=toStdJson(d);\nt=table(blob(str) as jsonStr)\n```\n\nThe BLOB type is also supported by DFS tables.\n\n```\ndbPath=\"dfs://testBlobDB\"\nif(existsDatabase(dbPath)){\ndropDatabase(dbPath)\n}\nn=2000000\nt=table(n:0,`date`id`type`num`blob,[DATETIME,INT,SYMBOL,DOUBLE,BLOB])\ndb1=database(\"\",VALUE,2020.01.01..2020.01.10)\ndb2=database(\"\",HASH,[INT,10])\n\ndb=database(dbPath,COMPO,[db1,db2])\npt1=createPartitionedTable(db,t,`pt1,`date`id)\n\ndate=concatDateTime(take(2020.01.01..2020.01.10,n),take(00:00:00..23:23:59,n))\nid=rand(1..1000,n)\ntype=rand(`A`B`C`D`E,n)\nnum=rand(100.0,n)\n\nblob=take(blob(string(1..10)),n)\n\nt1=table(date,id,type,num,blob)\npt1.append!(t1)\nselect *  from pt1\n```\n"
    },
    "bondAccrInt": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondAccrInt.html",
        "signatures": [
            {
                "full": "bondAccrInt(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, [benchmark='Excel'])",
                "name": "bondAccrInt",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "issuePrice",
                        "name": "issuePrice"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "bondType",
                        "name": "bondType"
                    },
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "[benchmark='Excel']",
                        "name": "benchmark",
                        "optional": true,
                        "default": "'Excel'"
                    }
                ]
            }
        ],
        "markdown": "### [bondAccrInt](https://docs.dolphindb.com/en/Functions/b/bondAccrInt.html)\n\n#### Syntax\n\nbondAccrInt(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, \\[benchmark='Excel'])\n\n#### Details\n\n`bondAccrInt` returns the accrued interest of a security. Accrued interest is the interest on a bond or loan that has accumulated since the principal investment, or since the previous coupon payment if there has been one already.\n\nThe clean price is the price of a bond excluding any interest accrued since bond's issuance and the most recent coupon payment. Comparatively, the dirty price is the price of a bond including the accrued interest. Therefore,\n\nClean Price = Dirty Price − Accrued Interest\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**start**is a scalar or vector of DATE type, indicating the bond’s value date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**issuePrice**is a numeric scalar or vector of the same length as *start* indicating the bond’s issue price. For discount bonds, the actual issue price must be specified (typically less than 100); for other bonds, it is usually 100.\n\n**coupon** is a numeric scalar or vector indicating the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**dayCountConvention** is a STRING scalar or vector indicating the day count convention to use. It can be:\n\n* \"Thirty360US\": US (NASD) 30/360\n* \"ActualActualISMA\" (default): actual/actual (ISMA rule)\n* \"Actual360\": actual/360\n* \"Actual365\": actual/365\n* \"Thirty360EU\": European 30/360\n* \"ActualActualISDA\" (default): actual/actual (ISDA rule)\n\n**bondType** is a STRING scalar or vector indicating the bond type. It can be:\n\n* \"FixedRate\": Fixed-rate bond, where interest is paid periodically based on the coupon rate.\n* \"Discount\": Discount bond, where no interest is paid, and the bond is issued at a discount. FV at maturity = face value.\n* \"ZeroCoupon\": Zero-coupon bond, where interest and face value are paid at maturity. FV at maturity = face value + interest.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**benchmark**(optional) is a STRING scalar indicating the reference algorithm. Currently, only \"Excel\" (the algorithm used in Excel) is supported.\n\n#### Returns\n\nA scalar or vector of DOUBLE type.\n\n#### Examples\n\n```\nbondAccrInt(start=2024.01.01, maturity=2030.12.31, issuePrice=100, coupon=0.1, frequency=2, dayCountConvention=\"Thirty360US\", bondType=\"FixedRate\", settlement=2024.05.15)\n\n// output: 3.75\n```\n\nRelated function: [bondDirtyPrice](https://docs.dolphindb.com/en/Functions/b/bondDirtyPrice.html)\n\n"
    },
    "bondCalculator": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondCalculator.html",
        "signatures": [
            {
                "full": "bondCalculator(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, calendar, businessDayConvention, settlement, price, priceType, [calcRisk=false], [benchmark='Qeubee'])",
                "name": "bondCalculator",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "issuePrice",
                        "name": "issuePrice"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "bondType",
                        "name": "bondType"
                    },
                    {
                        "full": "calendar",
                        "name": "calendar"
                    },
                    {
                        "full": "businessDayConvention",
                        "name": "businessDayConvention"
                    },
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "price",
                        "name": "price"
                    },
                    {
                        "full": "priceType",
                        "name": "priceType"
                    },
                    {
                        "full": "[calcRisk=false]",
                        "name": "calcRisk",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[benchmark='Qeubee']",
                        "name": "benchmark",
                        "optional": true,
                        "default": "'Qeubee'"
                    }
                ]
            }
        ],
        "markdown": "### [bondCalculator](https://docs.dolphindb.com/en/Functions/b/bondCalculator.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nbondCalculator(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, calendar, businessDayConvention, settlement, price, priceType, \\[calcRisk=false], \\[benchmark='Qeubee'])\n\n#### Details\n\nThis function performs mutual conversion among a bond's yield to maturity, clean price, and dirty price, and supports the calculation of duration and convexity, and other risk indicators.\n\n#### Arguments\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**start**is a scalar or vector of DATE type, indicating the bond’s value date.\n\n**maturity**is a scalar or vector of DATE type of the same length as *start*, indicating the bond's maturity date.\n\n**issuePrice**is a numeric scalar or vector of the same length as *start* indicating the bond’s issue price. For discount bonds, the actual issue price must be specified (typically less than 100); for other bonds, it is usually 100.\n\n**coupon**is a numeric scalar or vector indicating the coupon rate of the bond. For example, 0.03 indicates a 3% annual coupon.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**dayCountConvention**is a STRING scalar or vector indicating the day count convention to use. It can be:\n\n* \"Thirty360US\": US (NASD) 30/360.\n* \"ActualActual\": actual/actual.\n* \"Actual360\": actual/360.\n* \"Actual365\": actual/365.\n* \"Thirty360EU\": European 30/360.\n\n**bondType** is a STRING scalar or vector indicating the bond type. It can be:\n\n* \"FixedRate\": Fixed-rate bond, where interest is paid periodically based on the coupon rate.\n* \"Discount\": Discount bond, where no interest is paid, and the bond is issued at a discount. FV at maturity = face value.\n* \"ZeroCoupon\": Zero-coupon bond, where interest and face value are paid at maturity. FV at maturity = face value + interest.\n\n**calendar** is a STRING scalar indicating the trading calendar. Currently, only \"CFET\" is supported, representing the bond trading calendar of the China Interbank Bond Market (for bonds ending with .IB).\n\n**businessDayConvention** is a STRING scalar indicating how cash flows that fall on a non-trading day are treated. Currently, only \"Unadjusted\" is supported.\n\n**settlement**is a scalar or vector of DATE type, indicating the bond's settlement date. The settlement date is the date after the issue date when the security is traded to the buyer.\n\n**price**is a numeric scalar or vector whose meaning depends on the value of *priceType*:\n\n* When *priceType* is \"YTM\", *price* indicates the bond's yield to maturity.\n* When *priceType* is \"CleanPrice\", *price* indicates the bond's clean price.\n* When *priceType* is \"DirtyPrice\", *price* indicates the bond's dirty price.\n\n**priceType**is a STRING scalar or vector used to specify the type of the bond price (*price*). It can be:\n\n* \"YTM\": Yield to Maturity.\n\n* \"CleanPrice\": Clean price.\n\n* \"DirtyPrice\": Dirty price.\n\n**calcRisk**(optional) is a BOOLEAN value.\n\n* When set to false (default): Returning only dirty price, clean price, accrued interest, and yield to maturity (YTM).\n* When set to true: Macaulay duration, modified duration, convexity, and price value of a basis point (PVBP) are also returned.\n\n**benchmark**(optional) is a STRING scalar indicating the he algorithm benchmark. Currently, only \"Qeubee\" (for domestic bond calculation) is supported.\n\n#### Returns\n\nA dictionary or tuple.\n\n#### Examples\n\nExample 1: Calculate the price, yield to maturity, accrued interest, and risk metrics for a fixed-rate bond.\n\n```\nbondCalculator(start=2022.07.15, maturity=2072.07.15, issuePrice=100, coupon=0.034, frequency=\"Semiannual\", dayCountConvention=\"ActualActual\", bondType=\"FixedRate\", calendar=\"CFET\", businessDayConvention=\"Unadjusted\", settlement=2025.04.10, price=0.02, priceType=\"YTM\", calcRisk=true);\n\n/* Output:\npvbp->0.3902\nytm->0.0200\nmacaulayDuration->27.4761\ndirtyPrice->143.4689\naccruedInterest->0.7983\ncleanPrice->142.6705\nmodifiedDuration->27.2041\nconvexity->1025.4003\n*/\n\n\nbondCalculator(start=2022.07.15, maturity=2072.07.15, issuePrice=100, coupon=0.034, frequency=\"Semiannual\", dayCountConvention=\"ActualActual\", bondType=\"FixedRate\", calendar=\"CFET\", businessDayConvention=\"Unadjusted\", settlement=2072.04.18, price=100.2143, priceType=\"CleanPrice\", calcRisk=false);\n\n/* Output:\naccruedInterest->0.8780\ncleanPrice->100.2143\nytm->0.0250\ndirtyPrice->101.0923\n*/\n```\n\nExample 2: Calculate the price, yield to maturity, accrued interest for a zero-coupon bond.\n\n```\nbondCalculator(start=2025.01.09, maturity=2026.02.05, issuePrice=100, coupon=0.0119, frequency=\"Annual\", dayCountConvention=\"ActualActual\", bondType=\"ZeroCoupon\", calendar=\"CFET\",  businessDayConvention=\"Unadjusted\", settlement=2025.04.10, price=0.025, priceType=\"YTM\", calcRisk=false);\n\n/* Output:\naccruedInterest->0.2966\ncleanPrice->98.9355\nytm->0.0250\ndirtyPrice->99.2322\n*/\n```\n\nExample 3. Calculate the price, yield to maturity, accrued interest, and risk metrics of a discount bond.\n\n```\nbondCalculator(start=2025.02.13, maturity=2025.05.15, issuePrice=99.663, coupon=0.0, frequency=\"Once\", dayCountConvention=\"ActualActual\", bondType=\"Discount\", calendar=\"CFET\", businessDayConvention=\"Unadjusted\", settlement=2025.04.10, price=0.02, priceType=\"YTM\", calcRisk=true);\n\n/* Output:\npvbp->0.0009\nytm->0.0200\nmacaulayDuration->0.0958\ndirtyPrice->99.8085\naccruedInterest->0.2073\ncleanPrice->99.6012\nmodifiedDuration->0.0957\nconvexity->0.0183\n*/  \n```\n\nExample 4. Calculate the price, yield to maturity, accrued interest, and risk metrics for multiple bonds at once.\n\n```\nresult = bondCalculator(start=[2025.02.13, 2025.01.09, 2022.07.15], maturity=[2025.05.15, 2026.02.05, 2072.07.15], issuePrice=[99.663, 100, 100], coupon=[0.0, 0.0119, 0.034], frequency=[\"Once\", \"Annual\", \"Semiannual\"], dayCountConvention=[\"ActualActual\", \"ActualActual\", \"ActualActual\"], bondType=[\"Discount\", \"ZeroCoupon\", \"FixedRate\"], calendar=[\"CFET\", \"CFET\", \"CFET\"], businessDayConvention=[\"Unadjusted\", \"Unadjusted\", \"Unadjusted\"], settlement=[2025.04.10, 2025.04.10, 2072.04.18], price=[0.02, 0.025, 100.2143], priceType=[\"YTM\", \"YTM\", \"CleanPrice\"], calcRisk=true);\n\nprint result\n\n/* Output:\n(dirtyPrice->99.808586272901294\ncleanPrice->99.601201657516682\nytm->0.02\naccruedInterest->0.207384615384617\nmacaulayDuration->0.095890410958904\nmodifiedDuration->0.095706863549357\nconvexity->0.018319607460911\npvbp->0.000955236674747\n,dirtyPrice->99.232212603180983\ncleanPrice->98.935527671674137\nytm->0.025\naccruedInterest->0.296684931506849\nmacaulayDuration->0.824657534246575\nmodifiedDuration->0.80799946312328\nconvexity->1.305726264815019\npvbp->0.008017957450791\n,dirtyPrice->101.092321978021971\ncleanPrice->100.214299999999994\nytm->0.025000792220527\naccruedInterest->0.878021978021978\nmacaulayDuration->0.240437158469945\nmodifiedDuration->0.239000497930427\nconvexity->0.114242476021984\npvbp->0.002416111528969\n)\n*/ \n```\n\nRelated Functions: [bondAccrInt](https://docs.dolphindb.com/en/Functions/b/bondAccrInt.html), [bondConvexity](https://docs.dolphindb.com/en/Functions/b/bondConvexity.html), [bondDirtyPrice](https://docs.dolphindb.com/en/Functions/b/bondDirtyPrice.html), [bondYield](https://docs.dolphindb.com/en/Functions/b/bondYield.html)\n"
    },
    "bondCashflow": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondCashflow.html",
        "signatures": [
            {
                "full": "bondCashflow(start, maturity, coupon, frequency, dayCountConvention, bondType, [mode='Vector'])",
                "name": "bondCashflow",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "bondType",
                        "name": "bondType"
                    },
                    {
                        "full": "[mode='Vector']",
                        "name": "mode",
                        "optional": true,
                        "default": "'Vector'"
                    }
                ]
            }
        ],
        "markdown": "### [bondCashflow](https://docs.dolphindb.com/en/Functions/b/bondCashflow.html)\n\n\n\n#### Syntax\n\nbondCashflow(start, maturity, coupon, frequency, dayCountConvention, bondType, \\[mode='Vector'])\n\n#### Details\n\n`bondCashflow` calculates the cash flow for a bond with a face value of 100. Supports fixed-rate bonds, zero-coupon bonds, and discount bonds.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**start**is a scalar or vector of DATE type, indicating the bond’s value date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**coupon** is a numeric scalar or vector indicating the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**dayCountConvention** is a STRING scalar or vector indicating the day count convention to use. It can be:\n\n* \"Thirty360US\": US (NASD) 30/360\n* \"ActualActualISMA\" (default): actual/actual (ISMA rule)\n* \"Actual360\": actual/360\n* \"Actual365\": actual/365\n* \"Thirty360EU\": European 30/360\n* \"ActualActualISDA\" (default): actual/actual (ISDA rule)\n\n**bondType** is a STRING scalar or vector indicating the bond type. It can be:\n\n* \"FixedRate\": Fixed-rate bond, where interest is paid periodically based on the coupon rate.\n* \"Discount\": Discount bond, where no interest is paid, and the bond is issued at a discount. FV at maturity = face value.\n* \"ZeroCoupon\": Zero-coupon bond, where interest and face value are paid at maturity. FV at maturity = face value + interest.\n\n**mode** is a STRING scalar specifying the output format. The values are:\n\n* \"Vector\" (default): returns only the cash flow amounts.\n* \"Table\": returns a detailed cash flow table.\n\n#### Returns\n\n* If mode = \"Vector\", it returns a DOUBLE vector or an array vector that lists the cash flow amounts for a single bond or multiple bonds.\n\n* If mode = \"Table\", it returns a table or a tuple of tables, each representing the detailed cash flows of a single bond or multiple bonds. Each table contains the following fields:\n\n  * paymentDate: DATE, payment date.\n\n  * coupon: DOUBLE, interest amount.\n\n  * notional: DOUBLE, principal.\n\n  * total: DOUBLE, total amount.\n\n#### Examples\n\n```\nfrequency=\"Annual\"\nstart=2022.09.28\nmaturity=2025.09.28\ncoupon=0.078\nbondCashflow(start=start, maturity=maturity, coupon=coupon, frequency=frequency, dayCountConvention=\"Thirty360US\", bondType=\"FixedRate\")\n\n// output: [7.8,7.8,107.799999]\n\nbondCashflow(start=start, maturity=maturity, coupon=coupon, frequency=frequency, dayCountConvention=\"Thirty360US\", bondType=\"FixedRate\", mode=\"Table\")\n\n/* output:\npaymentDate coupon notional total              \n----------- ------ -------- ----------\n2023.09.28  7.8    0        7.8                \n2024.09.28  7.8    0        7.8                \n2025.09.28  7.8    100      107.799999\n*/\n```\n"
    },
    "bondConvexity": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondConvexity.html",
        "signatures": [
            {
                "full": "bondConvexity(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType, [benchmark='Excel'])",
                "name": "bondConvexity",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "issuePrice",
                        "name": "issuePrice"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "bondType",
                        "name": "bondType"
                    },
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "price",
                        "name": "price"
                    },
                    {
                        "full": "priceType",
                        "name": "priceType"
                    },
                    {
                        "full": "[benchmark='Excel']",
                        "name": "benchmark",
                        "optional": true,
                        "default": "'Excel'"
                    }
                ]
            }
        ],
        "markdown": "### [bondConvexity](https://docs.dolphindb.com/en/Functions/b/bondConvexity.html)\n\n\n\n#### Syntax\n\nbondConvexity(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType, \\[benchmark='Excel'])\n\n#### Details\n\n`bondConvexity` returns the bond convexity of a bond with a face value of 100. Bond convexity is a measure of the non-linear relationship of bond prices to changes in interest rates, and is defined as the second derivative of the price of the bond with respect to interest rates.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**start**is a scalar or vector of DATE type, indicating the bond’s value date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**issuePrice**is a numeric scalar or vector of the same length as *start* indicating the bond’s issue price. For discount bonds, the actual issue price must be specified (typically less than 100); for other bonds, it is usually 100.\n\n**coupon** is a numeric scalar or vector indicating the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**dayCountConvention** is a STRING scalar or vector indicating the day count convention to use. It can be:\n\n* \"Thirty360US\": US (NASD) 30/360\n* \"ActualActualISMA\" (default): actual/actual (ISMA rule)\n* \"Actual360\": actual/360\n* \"Actual365\": actual/365\n* \"Thirty360EU\": European 30/360\n* \"ActualActualISDA\" (default): actual/actual (ISDA rule)\n\n**bondType** is a STRING scalar or vector indicating the bond type. It can be:\n\n* \"FixedRate\": Fixed-rate bond, where interest is paid periodically based on the coupon rate.\n* \"Discount\": Discount bond, where no interest is paid, and the bond is issued at a discount. FV at maturity = face value.\n* \"ZeroCoupon\": Zero-coupon bond, where interest and face value are paid at maturity. FV at maturity = face value + interest.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**price** is a numeric scalar or vector indicating the bond's yield to maturity.\n\n**priceType** is a STRING scalar or vector used to specify the type of the bond price (*price*). Currently, only \"`YTM`\" (Yield to Maturity) is supported.\n\n**benchmark**(optional) is a STRING scalar indicating the reference algorithm. Currently, only \"Excel\" (the algorithm used in Excel) is supported.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\nbondConvexity(start=2023.01.01, maturity=2030.12.31, issuePrice=100, coupon=0.05, frequency=1, dayCountConvention=\"ActualActualISMA\", bondType=\"FixedRate\", settlement=2023.04.01, price=0.03, priceType=\"YTM\")\n// output: 51.864347713454684\n```\n"
    },
    "bondDirtyPrice": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondDirtyPrice.html",
        "signatures": [
            {
                "full": "bondDirtyPrice(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType, [benchmark='Excel'])",
                "name": "bondDirtyPrice",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "issuePrice",
                        "name": "issuePrice"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "bondType",
                        "name": "bondType"
                    },
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "price",
                        "name": "price"
                    },
                    {
                        "full": "priceType",
                        "name": "priceType"
                    },
                    {
                        "full": "[benchmark='Excel']",
                        "name": "benchmark",
                        "optional": true,
                        "default": "'Excel'"
                    }
                ]
            }
        ],
        "markdown": "### [bondDirtyPrice](https://docs.dolphindb.com/en/Functions/b/bondDirtyPrice.html)\n\n\n\n#### Syntax\n\nbondDirtyPrice(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType, \\[benchmark='Excel'])\n\n#### Details\n\n`bondDirtyPrice` returns the dirty price of a bond with a face value of 100.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**start**is a scalar or vector of DATE type, indicating the bond’s value date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**issuePrice**is a numeric scalar or vector of the same length as *start* indicating the bond’s issue price. For discount bonds, the actual issue price must be specified (typically less than 100); for other bonds, it is usually 100.\n\n**coupon** is a numeric scalar or vector indicating the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**dayCountConvention** is a STRING scalar or vector indicating the day count convention to use. It can be:\n\n* \"Thirty360US\": US (NASD) 30/360\n* \"ActualActualISMA\" (default): actual/actual (ISMA rule)\n* \"Actual360\": actual/360\n* \"Actual365\": actual/365\n* \"Thirty360EU\": European 30/360\n* \"ActualActualISDA\" (default): actual/actual (ISDA rule)\n\n**bondType** is a STRING scalar or vector indicating the bond type. It can be:\n\n* \"FixedRate\": Fixed-rate bond, where interest is paid periodically based on the coupon rate.\n* \"Discount\": Discount bond, where no interest is paid, and the bond is issued at a discount. FV at maturity = face value.\n* \"ZeroCoupon\": Zero-coupon bond, where interest and face value are paid at maturity. FV at maturity = face value + interest.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**price**is a numeric scalar or vector whose meaning depends on the value of *priceType*:\n\n* When *priceType* is \"YTM\", *price* indicates the bond's yield to maturity.\n* When *priceType* is \"CleanPrice\", *price* indicates the bond's clean price.\n\n**priceType** is a STRING scalar or vector used to specify the type of the bond price (*price*). It can be:\n\n* \"YTM\": Yield to Maturity.\n* \"CleanPrice\": Clean price.\n\n**benchmark**(optional) is a STRING scalar indicating the reference algorithm. Currently, only \"Excel\" (the algorithm used in Excel) is supported.\n\n#### Returns\n\nA scalar/vector of type DOUBLE.\n\n#### Examples\n\n```\nbondDirtyPrice(start=2023.01.01, maturity=2030.12.31, issuePrice=100, coupon=0.05, frequency=1, dayCountConvention=\"ActualActualISMA\", bondType=\"FixedRate\", settlement=2023.04.01, price=100.2143, priceType=\"CleanPrice\")\n// output: 101.447176\n```\n"
    },
    "bondFuturesPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondFuturesPricer.html",
        "signatures": [
            {
                "full": "bondFuturesPricer(instrument, pricingDate, discountCurve)",
                "name": "bondFuturesPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    }
                ]
            }
        ],
        "markdown": "### [bondFuturesPricer](https://docs.dolphindb.com/en/Functions/b/bondFuturesPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nbondFuturesPricer(instrument, pricingDate, discountCurve)\n\n#### Details\n\nCalculates the Net Present Value (NPV) of the bond futures.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**instrument** is an INSTRUMENT scalar/vector of BondFutures type indicating the bond futures to be priced.\n\n**pricingDate** is a DATE scalar/vector specifying the pricing date(s).\n\n**discountCurve** is a MKTDATA scalar/vector of type IrYieldCurve representing the discount curve(s).\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"220010.IB\",\n    \"start\": \"2022.05.15\",\n    \"maturity\": \"2032.05.15\",\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.0276,\n    \"frequency\": \"Semiannual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\n\nbondFutures = { \n    \"productType\": \"Futures\",\n    \"futuresType\": \"BondFutures\",\n    \"instrumentId\": \"T2509\",\n    \"nominal\": 100.0,\n    \"maturity\": \"2025.09.12\",\n    \"settlement\": \"2025.09.16\",\n    \"underlying\": bond,\n    \"nominalCouponRate\": 0.03\n}\n\ninstrument = parseInstrument(bondFutures)\npricingDate = 2025.06.10\ncurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Compounded\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Semiannual\",\n    \"dates\":[2025.09.05, 2025.12.05, 2026.03.05, 2027.03.05, 2028.03.05, 2030.03.05, 2035.03.05, 2040.03.05, 2045.03.05, 2055.03.05, 2075.03.05],\n    \"values\":[1.5347, 1.4958, 1.4447, 1.3955, 1.5029, 1.5561, 1.7156, 1.8652, 2.0329, 1.8955, 2.1059] / 100.0\n}\ndiscountCurve = parseMktData(curve)\n\nbondFuturesPricer(instrument, pricingDate, discountCurve)\nbondFuturesPricer([instrument, instrument], pricingDate, discountCurve)\nbondFuturesPricer(instrument, [pricingDate, pricingDate, pricingDate], discountCurve)\nbondFuturesPricer(instrument, [pricingDate, pricingDate, pricingDate], [discountCurve, discountCurve, discountCurve])\nbondFuturesPricer(instrument, pricingDate, [discountCurve, discountCurve, discountCurve])\n```\n"
    },
    "bondPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondPricer.html",
        "signatures": [
            {
                "full": "bondPricer(instrument, pricingDate, discountCurve, [spreadCurve], [setting])",
                "name": "bondPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "[spreadCurve]",
                        "name": "spreadCurve",
                        "optional": true
                    },
                    {
                        "full": "[setting]",
                        "name": "setting",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [bondPricer](https://docs.dolphindb.com/en/Functions/b/bondPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nbondPricer(instrument, pricingDate, discountCurve, \\[spreadCurve], \\[setting])\n\n#### Details\n\nPrices the bond instrument(s), supporting output of multiple risk measures, including (NPV (Net Present Value), Delta (first-order sensitivity), Gamma (second-order sensitivity), and Key Rate Duration (sensitivity to interest rate shifts at specified key maturities).\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**instrument** is an INSTRUMENT scalar/vector object representing the bond(s) to be priced. The required key fields vary depending on the type of bond product; see [Bond Product Field Specifications](https://docs.dolphindb.com/en/Functions/b/bondPricer.html#topic_n1c_qwq_ngc) for details.\n\n**pricingDate** is a DATE scalar/vector specifying the pricing date(s).\n\n**discountCurve** is a MKTDATA scalar/vector of type IrYieldCurve representing the discount curve(s). See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/b/bondPricer.html#topic_ozj_qwq_ngc) for details.\n\n**spreadCurve** (optional) is a MKTDATA scalar/vector of type IrYieldCurve representing the credit spread curve(s). If not specified, defaults to a flat curve with 0% spread. See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/b/bondPricer.html#topic_ozj_qwq_ngc) for details.\n\n**setting** (optional)is a Dictionary\\<STRING, ANY> with the following key-value pairs：\n\n| Key                                | Value Type           | Description                                                                                                                                        |\n| ---------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| \"calcDiscountCurveDelta\"           | BOOL                 | Whether to compute the bond’s first-order sensitivity (delta) to the discount curve.                                                               |\n| \"calcDiscountCurveGamma\"           | BOOL                 | Whether to compute the bond’s second-order sensitivity (gamma) to the discount curve.                                                              |\n| \"calcDiscountCurveKeyRateDuration\" | BOOL                 | Whether to compute the bond’s key rate durations.                                                                                                  |\n| \"discountCurveShift\"               | DOUBLE scalar        | The parallel shift applied to the discount curve. For example, a bp(0.0001).                                                                       |\n| \"discountCurveKeyTerms\"            | DOUBLE scalar/vector | The specific maturity point(s) to calculate the key rate duration. For example, \\[1.0, 3.0, 5.0].                                                  |\n| \"discountCurveKeyShifts\"           | DOUBLE scalar/vector | The shift amounts corresponding to each maturity point. It has the same length with discountCurveKeyTerms. For example, \\[0.0001, 0.0002, 0.0015]. |\n\n#### Returns\n\nFor scalar input:\n\n* If *setting*is not specified, returns the NPV (a DOUBLE scalar).\n* If *setting*is specified, returns a Dictionary\\<STRING, ANY> with the following key-value pairs:\n  * \"npv\": A DOUBLE scalar\n  * \"discountCurveDelta\": A DOUBLE scalar\n  * \"discountCurveGamma\": A DOUBLE scalar\n  * \"discountCurveKeyRateDuration\": A DOUBLE vector\n\nFor vector input, it returns a DOUBLE vector (if *setting* is not specified) or a tuple of dictionaries (if *setting* is specified).\n\n#### Examples\n\n```\nbond = {\n  \"productType\": \"Cash\",\n  \"assetType\": \"Bond\",\n  \"bondType\": \"FixedRateBond\",\n  \"version\": 0, \n  \"instrumentId\": \"240025.IB\",\n  \"start\": 2024.12.25,\n  \"maturity\": 2031.12.25,\n  \"issuePrice\": 100.0,\n  \"coupon\": 0.0149,\n  \"frequency\": \"Annual\",\n  \"dayCountConvention\": \"ActualActualISDA\"\n}\n\npricingDate = 2025.08.18\n\ncurve = {\n  \"mktDataType\": \"Curve\",\n  \"curveType\": \"IrYieldCurve\",\n  \"referenceDate\": pricingDate,\n  \"currency\": \"CNY\",\n  \"curveName\": \"CNY_TREASURY_BOND\",\n  \"dayCountConvention\": \"ActualActualISDA\",\n  \"compounding\": \"Compounded\",\n  \"interpMethod\": \"Linear\",\n  \"extrapMethod\": \"Flat\",\n  \"frequency\": \"Annual\",\n  \"dates\":[2025.09.18, 2025.11.18, 2026.02.18, 2026.08.18, 2027.08.18, 2028.08.18, 2030.08.18,\n      2032.08.18, 2035.08.18, 2040.08.18, 2045.08.18, 2055.08.18,2065.08.18, 2075.08.18],\n  \"values\":[1.3000, 1.3700, 1.3898, 1.3865, 1.4299, 1.4471, 1.6401,\n       1.7654, 1.7966, 1.9930, 2.1834, 2.1397, 2.1987, 2.2225] / 100.0\n}\n\ninstrument = parseInstrument(bond)\ndiscountCurve = parseMktData(curve)\n\nsetting = dict(STRING, ANY)\nsetting[\"calcDiscountCurveDelta\"] = true\nsetting[\"calcDiscountCurveGamma\"] = true\nsetting[\"calcDiscountCurveKeyRateDuration\"] = true\nsetting[\"discountCurveShift\"] = 0.0001\nsetting[\"discountCurveKeyTerms\"] = [1.0, 3.0, 5.0]\nsetting[\"discountCurveKeyShifts\"] = [0.0002, 0.0003, 0.0001]\n\nbondPricer(instrument, pricingDate, discountCurve, setting=setting)\n\nbondPricer([instrument, instrument], pricingDate, discountCurve, setting=setting)\nbondPricer(instrument, pricingDate, [discountCurve, discountCurve], setting=setting)\nbondPricer(instrument, [pricingDate], discountCurve, setting=setting)\nbondPricer(instrument, [pricingDate, pricingDate], discountCurve, setting=setting)\n```\n\n**Related functions:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n\n#### Bond Product Field Specifications\n\n**Discount Bond**\n\n<table id=\"table_uzj_zwq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"DiscountBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nissuePrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nIssue price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>**Zero Coupon Bond**\n\n<table id=\"table_ixb_bxq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"ZeroCouponBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncoupon\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nCoupon rate, e.g., 0.03 means 3%\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFrequency of interest payment\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>**Fixed Rate Bond**\n\n<table id=\"table_b5p_cxq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FixedRateBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncoupon\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nCoupon rate, e.g., 0.03 means 3%\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFrequency of interest payment\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>## Curve Field Specifications\n\n<table id=\"table_zcd_2xq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; It can be \"Bootstrap\" (default), \"NS\", \"NSS\".\n\nWhen the value is \"NSS\" or \"NS\", the fields interpMethod, extrapMethod, dates, and values are not required.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters. It is required when *curveModel*is \"NSS\" or \"NS\":\n\n* If curveModel = \"NS\": must include keys 'beta0', 'beta1', 'beta2', 'lambda'.\n\n* If curveModel = \"NSS\": must include keys 'beta0', ‘beta1', 'beta2', 'beta3', 'lambda0', 'lambda1'.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>\n"
    },
    "bondYield": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondYield.html",
        "signatures": [
            {
                "full": "bondYield(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType, [method='newton'], [maxIter=100], [benchmark='Excel'])",
                "name": "bondYield",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "issuePrice",
                        "name": "issuePrice"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "bondType",
                        "name": "bondType"
                    },
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "price",
                        "name": "price"
                    },
                    {
                        "full": "priceType",
                        "name": "priceType"
                    },
                    {
                        "full": "[method='newton']",
                        "name": "method",
                        "optional": true,
                        "default": "'newton'"
                    },
                    {
                        "full": "[maxIter=100]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "100"
                    },
                    {
                        "full": "[benchmark='Excel']",
                        "name": "benchmark",
                        "optional": true,
                        "default": "'Excel'"
                    }
                ]
            }
        ],
        "markdown": "### [bondYield](https://docs.dolphindb.com/en/Functions/b/bondYield.html)\n\n\n\n#### Syntax\n\nbondYield(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType, \\[method='newton'], \\[maxIter=100], \\[benchmark='Excel'])\n\n#### Details\n\nCalculate the bond yield for each 100 face value of a bond based on its clean price or dirty price.\n\nNote:\n\n* If there is one coupon period or less until redemption, YIELD is calculated as follows:\n\n  ![](https://docs.dolphindb.com/en/images/bondYield.png)\n\n  where:\n\n  * * A = number of days from the beginning of the coupon period to the settlement date (accrued days).\n\n* DSR = number of days from the settlement date to the redemption date.\n\n* E = number of days in the coupon period.\n\n* If there is more than one coupon period until redemption, bond yield is calculated through a hundred iterations. The resolution uses the Newton method. The yield is changed until the estimated price given the yield is close to price.\n\n* An annual coupon rate is used by default.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**start**is a scalar or vector of DATE type, indicating the bond’s value date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**issuePrice**is a numeric scalar or vector of the same length as *start* indicating the bond’s issue price. For discount bonds, the actual issue price must be specified (typically less than 100); for other bonds, it is usually 100.\n\n**coupon** is a numeric scalar or vector indicating the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**dayCountConvention** is a STRING scalar or vector indicating the day count convention to use. It can be:\n\n* \"Thirty360US\": US (NASD) 30/360\n* \"ActualActualISMA\" (default): actual/actual (ISMA rule)\n* \"Actual360\": actual/360\n* \"Actual365\": actual/365\n* \"Thirty360EU\": European 30/360\n* \"ActualActualISDA\" (default): actual/actual (ISDA rule)\n\n**bondType** is a STRING scalar or vector indicating the bond type. It can be:\n\n* \"FixedRate\": Fixed-rate bond, where interest is paid periodically based on the coupon rate.\n* \"Discount\": Discount bond, where no interest is paid, and the bond is issued at a discount. FV at maturity = face value.\n* \"ZeroCoupon\": Zero-coupon bond, where interest and face value are paid at maturity. FV at maturity = face value + interest.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**price**is a numeric scalar or vector whose meaning depends on the value of *priceType*:\n\n* When *priceType* is \"CleanPrice\", *price* indicates the bond's clean price.\n* When *priceType* is \"DirtyPrice\", *price* indicates the bond's dirty price.\n\n**priceType** is a STRING scalar or vector used to specify the type of the bond price (*price*). It can be:\n\n* \"CleanPrice\": Clean price.\n* \"DirtyPrice\": Dirty price.\n\n**method** (optional) is a STRING scalar or vector indicating the optimization algorithm used to solve the bond yield. It can be:\n\n* \"newton\" (default): Newton algorithm.\n* \"brent\": Brent algorithm.\n* \"nm\": Nelder-Mead simplex algorithm.\n* \"bfgs\": BFGS algorithm.\n* \"lbfgs\": LBFGS algorithm.\n\n**maxIter** (optional) is a positive integer or a vector of positive integers indicating the maximum number of iterations. The default value is 100.\n\n**benchmark**(optional) is a STRING scalar indicating the reference algorithm. Currently, only \"Excel\" (the algorithm used in Excel) is supported.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\nbondYield(start=2023.01.01, maturity=2030.12.31, issuePrice=100, coupon=0.05, frequency=1, dayCountConvention=\"ActualActualISMA\", bondType=\"FixedRate\", settlement=2023.04.01, price=100.2143, priceType=\"CleanPrice\", method = ['newton', 'nm', 'brentq', 'bfgs','lbfgs'])\n\n// output: [0.049630,0.049628,0.049630,0.049630,0.049635]\n```\n"
    },
    "bondYieldCurveBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bondYieldCurveBuilder.html",
        "signatures": [
            {
                "full": "bondYieldCurveBuilder(referenceDate, currency, bonds, terms, quotes, dayCountConvention, [compounding='Compounded'], [frequency='Annual'], [curveName], [method='Bootstrap'], [interpMethod='Linear'], [extrapMethod='Flat'])",
                "name": "bondYieldCurveBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "currency",
                        "name": "currency"
                    },
                    {
                        "full": "bonds",
                        "name": "bonds"
                    },
                    {
                        "full": "terms",
                        "name": "terms"
                    },
                    {
                        "full": "quotes",
                        "name": "quotes"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "[compounding='Compounded']",
                        "name": "compounding",
                        "optional": true,
                        "default": "'Compounded'"
                    },
                    {
                        "full": "[frequency='Annual']",
                        "name": "frequency",
                        "optional": true,
                        "default": "'Annual'"
                    },
                    {
                        "full": "[curveName]",
                        "name": "curveName",
                        "optional": true
                    },
                    {
                        "full": "[method='Bootstrap']",
                        "name": "method",
                        "optional": true,
                        "default": "'Bootstrap'"
                    },
                    {
                        "full": "[interpMethod='Linear']",
                        "name": "interpMethod",
                        "optional": true,
                        "default": "'Linear'"
                    },
                    {
                        "full": "[extrapMethod='Flat']",
                        "name": "extrapMethod",
                        "optional": true,
                        "default": "'Flat'"
                    }
                ]
            }
        ],
        "markdown": "### [bondYieldCurveBuilder](https://docs.dolphindb.com/en/Functions/b/bondYieldCurveBuilder.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nbondYieldCurveBuilder(referenceDate, currency, bonds, terms, quotes, dayCountConvention, \\[compounding='Compounded'], \\[frequency='Annual'], \\[curveName], \\[method='Bootstrap'], \\[interpMethod='Linear'], \\[extrapMethod='Flat'])\n\n#### Details\n\nBuilds a bond yield curve to be used as a discount curve (i.e., a spot yield curve) in pricing applications.\n\n#### Parameters\n\n**referenceDate** A DATE scalar, representing the reference date of the yield curve.\n\n**currency** A STRING scalar specifying the currency code of the curve. Supported values: \"CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\".\n\n**bonds** An INSTRUMENT vector, specifying the sample bonds used for curve construction with bond metadata. See [Bond Product Field Specifications](https://docs.dolphindb.com/en/Functions/b/bondYieldCurveBuilder.html#topic_vw4_kyq_ngc) for details.\n\n**terms** A DURATION vector of the same length as *bonds*, indicating the remaining term to maturity of each bond.\n\n**quotes** A numeric vector of the same length as *bonds*, indicating the yield to maturity (YTM) of each bond on the *referenceDate*.\n\n**dayCountConvention**A STRING scalar indicating the day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISDA\" —actual/actual according to ISDA (International Swaps and Derivatives Association) convention\n\n* \"ActualActualISMA\" — actual/actual according to ISMA (International Securities Market Association) convention\n\n**compounding** (optional) A STRING scalar defining the compounding method. Options:\n\n* \"Compounded\" (default): Discrete compounding\n\n* \"Simple\": Simple interest\n\n* \"Continuous\": Continuous compounding\n\n**frequency** (optional) A STRING scalar specifying the interest payment frequency. It does not affect curve construction and is only recorded in the returned curve. Supported values:\n\n* \"Annual\" (default): Annually\n\n* \"NoFrequency\": No payment frequency\n\n* \"Once\": Single payment at maturity (for discount bonds and zero coupon bonds only)\n\n* \"Semiannual\": Semiannually\n\n* \"EveryFourthMonth\": Every four months\n\n* \"Quarterly\": Quarterly\n\n* \"BiMonthly\": Every two months\n\n* \"Monthly\": Monthly\n\n* \"EveryFourthWeek\": Every four weeks\n\n* \"BiWeekly\": Every two weeks\n\n* \"Weekly\": Weekly\n\n* \"Daily\": Daily\n\n* \"Other\": Other frequencies\n\n**curveName** (optional) A STRING scalar indicating the yield curve name. The default value is NULL.\n\n**method** (optional) A STRING scalar specifying the curve construction method. Options:\n\n* \"Bootstrap\" (default): Bootstrap method\n\n* \"NS\": Nelson-Siegel model\n\n* \"NSS\": Nelson-Siegel-Svensson model\n\n**interpMethod** (optional) A STRING scalar specifying the interpolation method. Options:\n\n* \"Linear\" (default): Linear interpolation\n\n* \"CubicSpline\": Cubic spline\n\n* \"CubicHermiteSpline\": Cubic Hermite spline\n\n**extrapMethod** (optional) A STRING scalar for the extrapolation method. Options:\n\n* \"Flat\" (default): Flat extrapolation\n\n* \"Linear\": Linear extrapolation\n\n#### Returns\n\nA MKTDATA object.\n\n#### Examples\n\nBuild a yield curve based on the Chinese government bond market data as of August 18, 2025.\n\n```\nbond1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"DiscountBond\",\n    \"instrumentId\": \"259916.IB\",\n    \"start\": 2025.03.13,\n    \"maturity\": 2025.09.11,\n    \"issuePrice\":  99.2070,\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond2 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"240021.IB\",\n    \"start\": 2024.10.25,\n    \"maturity\": 2025.10.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0133,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond3 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"250001.IB\",\n    \"start\": 2025.01.15,\n    \"maturity\": 2026.01.15,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0116,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond4 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"250013.IB\",\n    \"start\": 2025.07.25,\n    \"maturity\": 2026.07.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0133,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond5 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"250012.IB\",\n    \"start\": 2025.06.15,\n    \"maturity\": 2027.06.15,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0138,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond6 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"250010.IB\",\n    \"start\": 2025.05.25,\n    \"maturity\": 2028.05.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0146,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond7 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"250014.IB\",\n    \"start\": 2025.07.25,\n    \"maturity\": 2030.07.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0155,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond8 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"2500802.IB\",\n    \"start\": 2025.05.25,\n    \"maturity\": 2032.05.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0157,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond9 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"250011.IB\",\n    \"start\": 2025.05.25,\n    \"maturity\": 2035.05.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0167,\n    \"frequency\": \"Semiannual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond10 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"2400102.IB\",\n    \"start\": 2024.08.29,\n    \"maturity\": 2039.08.29,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0225,\n    \"frequency\": \"Semiannual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond11 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"2500004.IB\",\n    \"start\": 2025.07.15,\n    \"maturity\": 2045.07.15,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0192,\n    \"frequency\": \"Semiannual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond12 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"2500005.IB\",\n    \"start\": 2025.07.15,\n    \"maturity\": 2055.07.15,\n    \"issuePrice\": 100,\n    \"coupon\": 0.019,\n    \"frequency\": \"Semiannual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond13 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"200007.IB\",\n    \"start\": 2020.05.25,\n    \"maturity\": 2070.05.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0373,\n    \"frequency\": \"Semiannual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\nbond14 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"2400003.IB\",\n    \"start\": 2024.06.15,\n    \"maturity\": 2074.06.15,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0253,\n    \"frequency\": \"Semiannual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\n\nreferenceDate = 2025.08.18\nbondsTmp = [bond1, bond2, bond3, bond4, bond5, bond6, bond7, bond8, bond9,\n         bond10, bond11, bond12, bond13, bond14]\nbonds = parseInstrument(bondsTmp)\n\n```\n\nThis example uses the standard tenors from the China Foreign Exchange Trade System (CFETS, [CFETS Closing Yield Curves- Historical Data - CFETS](https://www.chinamoney.com.cn/english/bmkycvcyccyccychdt/index.html?bondType=CYCC000\\&reference=1)), with sample bonds’ remaining terms and quotes being simulated.\n\n```\nterms = [1M, 3M, 6M, 1y, 2y, 3y, 5y, 7y, 10y, 15y, 20y, 30y, 40y, 50y]\nquotes=[1.3000, 1.3700, 1.3898, 1.3865, 1.4296, 1.4466, 1.6348, \n        1.7557, 1.7875, 1.9660, 2.1300, 2.1100, 2.1556, 2.1750]/100\n       \n// method = \"BoostStarp\"\nbootstrapCurve = bondYieldCurveBuilder(referenceDate, `CNY, bonds, terms, quotes, \"ActualActualISDA\", method='Bootstrap')\nbootstrapCurveDict = extractMktData(bootstrapCurve)\nprint(bootstrapCurveDict)\n\n// method = \"NS\"\nnsCurve = bondYieldCurveBuilder(referenceDate, `CNY, bonds, terms, quotes, \"ActualActualISDA\", method='NS')\nnsCurveDict = extractMktData(nsCurve)\nprint(nsCurveDict)\n\n// method = \"NSS\"\nnssCurve = bondYieldCurveBuilder(referenceDate, `CNY, bonds, terms, quotes, \"ActualActualISDA\", method='NSS')\nnssCurveDict=extractMktData(nssCurve)\nprint(nssCurveDict)\n\n```\n\nIn practice, the remaining term should be calculated as the difference between the bond’s maturity date and the curve reference date, and the actual YTM quotes should be used to construct the curve, in accordance with CFETS bond closing valuation([Bond Valuation Dynamic and Closing - CFETS](https://www.chinamoney.com.cn/english/bmkbvl/) ).\n\n```\nterms2 = array(DURATION)\nfor(bond in bondsTmp){\n   term = duration(string(bond[\"maturity\"] - referenceDate)+\"d\")\n   terms2.append!(term)\n}\n\nquotes2 = [1.2799, 1.3440, 1.3450, 1.3849, 1.4200, 1.4450, 1.6295, \n          1.7350, 1.7860, 2.0493, 2.1304, 2.1140, 2.1558, 2.1728] / 100\n          \n// method = \"BoostStarp\"\nbootstrapCurve2 = bondYieldCurveBuilder(referenceDate, `CNY, bonds, terms2, quotes2, \"ActualActualISDA\", method='Bootstrap')\nbootstrapCurveDict2 = extractMktData(bootstrapCurve2)\nprint(bootstrapCurveDict2)\n\n// method = \"NS\"\nnsCurve2 = bondYieldCurveBuilder(referenceDate, `CNY, bonds, terms2, quotes2, \"ActualActualISDA\", method='NS')\nnsCurveDict2 = extractMktData(nsCurve2)\nprint(nsCurveDict2)\n\n// method = \"NSS\"\nnssCurve2 = bondYieldCurveBuilder(referenceDate, `CNY, bonds, terms2, quotes2, \"ActualActualISDA\",method='NSS')\nnssCurveDict2 =extractMktData(nssCurve2)\nprint(nssCurveDict2)\n```\n\n**Related functions:** [extractMktData](https://docs.dolphindb.com/en/Functions/e/extractMktData.html), [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html)\n\n#### Bond Product Field Specifications\n\n**Discount Bond**\n\n<table id=\"table_kyz_myq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"DiscountBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nissuePrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nIssue price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>**Zero Coupon Bond**\n\n<table id=\"table_nb3_4yq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"ZeroCouponBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncoupon\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nCoupon rate, e.g., 0.03 means 3%\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFrequency of interest payment\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>**Fixed Rate Bond**\n\n<table id=\"table_cdt_pyq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FixedRateBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncoupon\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nCoupon rate, e.g., 0.03 means 3%\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFrequency of interest payment\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>\n"
    },
    "bool": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bool.html",
        "signatures": [
            {
                "full": "bool(X)",
                "name": "bool",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [bool](https://docs.dolphindb.com/en/Functions/b/bool.html)\n\n\n\n#### Syntax\n\nbool(X)\n\n#### Details\n\nConvert the input to a Boolean value.\n\n#### Parameters\n\n**X** can be of any data type.\n\n#### Returns\n\nBOOL type with the same data form as *X*.\n\n#### Examples\n\n```\nx=bool()\nx;\n// output: 00b\n\ntypestr x\n// output: BOOL\n\nbool(`true`false)\n// output: [1,0]\n\nbool(100.2)\n// output: 1\n\nbool(0)\n// output: 0\n```\n"
    },
    "boxcox": {
        "url": "https://docs.dolphindb.com/en/Functions/b/boxcox.html",
        "signatures": [
            {
                "full": "boxcox(X, [lmbda])",
                "name": "boxcox",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[lmbda]",
                        "name": "lmbda",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [boxcox](https://docs.dolphindb.com/en/Functions/b/boxcox.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nboxcox(X, \\[lmbda])\n\n#### Details\n\nThis function transforms *X* by using the Box-Cox transformation method.\n\nThe Box-Cox transform is given by:\n\n![](https://docs.dolphindb.com/en/Functions/images/boxcox.png)\n\nDifference from Python’s `scipy.stats.boxcox`: Both functions can perform a Box-Cox transformation and estimate the optimal lambda when *lmbda* is not specified. In DolphinDB, *lmbda* can be a scalar or vector, and a vector *lmbda* applies the transformation element by element. SciPy also supports the *alpha* confidence interval and *optimizer* arguments.\n\n#### Parameters\n\n**X** is a numeric vector representing the input to be transformed. If the *lmbda* parameter is not specified, *X*cannot contain null or non-positivevalues, and all elements cannot be identical.\n\n**lmbda**(optional) is a numeric scalar or vector representing the lambda parameter. If it is a vector, *X* and *lmbda* must be of equal length.\n\n#### Returns\n\n* If the *lmbda* parameter is specified, the function returns a vector of DOUBLE type.\n  * if *lmbda* is a scalar, the result is the Box-Cox transformation of *X* using *lmbda*.\n  * if *lmbda* is a vector, the result is a vector where each element corresponds to `boxcox(Xi, lmbdai)`.\n* If the *lmbda* parameter is not specified, the function returns a 2-element tuple:\n  * The first element is a vector of DOUBLE type, representing the Box-Cox transformation of *X*.\n  * The second element is a scalar of DOUBLE type, representing the optimal lambda parameter.\n\n#### Examples\n\n```\ndata = [1.5, 2.3, 3.1, 4.8, 5.5, 6.7, 8.2, 9.0, 10.1, 12.4]\nlmb = 2\nboxcox(data)\n\n// output: ([0.4541,1.0562,1.5689,2.4892,2.82394,3.3559,3.9636,4.267,4.6653,5.4393],0.5495)\n\nboxcox(data, lmb)\n// output: [0.625,2.145,4.305,11.02,14.625,21.945,33.12,40,50.505,76.38]\n```\n"
    },
    "brentq": {
        "url": "https://docs.dolphindb.com/en/Functions/b/brentq.html",
        "signatures": [
            {
                "full": "brentq(f, a, b, [xtol], [rtol], [maxIter], [funcDataParam])",
                "name": "brentq",
                "parameters": [
                    {
                        "full": "f",
                        "name": "f"
                    },
                    {
                        "full": "a",
                        "name": "a"
                    },
                    {
                        "full": "b",
                        "name": "b"
                    },
                    {
                        "full": "[xtol]",
                        "name": "xtol",
                        "optional": true
                    },
                    {
                        "full": "[rtol]",
                        "name": "rtol",
                        "optional": true
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[funcDataParam]",
                        "name": "funcDataParam",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [brentq](https://docs.dolphindb.com/en/Functions/b/brentq.html)\n\n\n\n#### Syntax\n\nbrentq(f, a, b, \\[xtol], \\[rtol], \\[maxIter], \\[funcDataParam])\n\n#### Details\n\nFind a root x0 of a function*f*in a bracketing interval \\[a, b] using Brent's method.\n\nDifference from Python’s `scipy.optimize.brentq`: Both functions use Brent’s method to find a root in an interval where the function changes sign. DolphinDB returns a result of length 2 containing a status string and the root, and passes additional arguments through the *funcDataParam* vector. SciPy returns the root by default, returns the root and a `RootResults` object when *full\\_output*=True, and passes additional arguments through the *args* tuple.\n\n#### Parameters\n\n**f** is a function which returns a number. The function *f*must be continuous in \\[a,b], and *f(a)* and *f(b)* must have opposite signs.\n\n**a** is a numeric scalar that specifies the left boundary of the bracketing interval \\[a,b].\n\n**b** is a numeric scalar that specifies the right boundary of the bracketing interval \\[a,b].\n\n**xtol** / **rtol** (optional) are numeric scalars that specify the precision of the computed root. The computed root x0 satisfies `|x-x0| <= (xtol + rtol* |x0|)`, where x is the exact root. The default value of *xtol*is 2e-12, and the default value of *rtol*is 4 times the machine epsilon in double precision.\n\n**maxIter** (optional) is an integer indicating the maximum iterations. The default value is 100.\n\n**funcDataParam** (optional) is a vector containing extra arguments for the function *f*.\n\n#### Returns\n\nReturns a vector res of length 2.\n\n* res\\[0] is a STRING scalar indicating the convergence information, which can be:\n\n  * CONVERGED: converged.\n\n  * SIGNERR: sign error.\n\n  * CONVERR: convergence error.\n\n* res\\[1] is a number representing the root of *f* between *a* and *b*.\n\n#### Examples\n\nFind the root of f(x) = x^2 - 1 in \\[-2,0] and \\[0,2].\n\n```\ndef f(x) {\n    return (pow(x, 2) - 1)\n}\n\nroot1 = brentq(f, -2, 0)\nroot2 = brentq(f, 0, 2)\nprint(\"root1 : \", root1)\nprint(\"root2 : \", root2)\n\n/* output\nroot1 :\n(\"CONVERGED\",-1)\nroot2 :\n(\"CONVERGED\",1)\n*/\n```\n\nFind the root of f(x,b) with extra arguments in the \\[0,2].\n\n```\ndef f(x, b) {\n    return (pow(x, 2) - b)\n}\nroot = brentq(f, 0, 2, 2e-12, 1e-9, 100, [2])\nprint(\"root : \", root)\n\n/* output\nroot : \n(\"CONVERGED\",1.414213562373136)\n*/\n```\n"
    },
    "brute": {
        "url": "https://docs.dolphindb.com/en/Functions/b/brute.html",
        "signatures": [
            {
                "full": "brute(func, ranges, [ns=20], [finish=fmin])",
                "name": "brute",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "ranges",
                        "name": "ranges"
                    },
                    {
                        "full": "[ns=20]",
                        "name": "ns",
                        "optional": true,
                        "default": "20"
                    },
                    {
                        "full": "[finish=fmin]",
                        "name": "finish",
                        "optional": true,
                        "default": "fmin"
                    }
                ]
            }
        ],
        "markdown": "### [brute](https://docs.dolphindb.com/en/Functions/b/brute.html)\n\n\n\n#### Syntax\n\nbrute(func, ranges, \\[ns=20], \\[finish=fmin])\n\n#### Details\n\nMinimize a function over a given range by brute force. Use the \"brute force\" method, i.e., compute the function's value at each point of a multidimensional grid of points, to find the global minimum of the function.\n\n**Note:** The brute force approach is inefficient because the number of grid points increases exponentially. Consequently, even in cases where the grid spacing is coarse, or the problem is only of medium size, it can take a long time to run, and/or run into memory limitations.\n\nDifference from Python’s `scipy.optimize.brute`: Both functions perform grid-search minimization and can run a subsequent optimizer. DolphinDB’s *ranges* uses `(low, high)` or `(low, high, num)` tuples and returns a dictionary containing `xopt` and `fopt`. SciPy supports slice-based grids, *args*, *full\\_output*, *workers*, and can return the grid and function value arrays.\n\n#### Parameters\n\n**func** is the name of the function to be minimized. Note that its return value must be a numeric scalar.\n\n**ranges** is a tuple of tuples. Each tuple element can take the following forms:\n\n* (low, high): Specifies the minimum and maximum values for a parameter.\n\n* (low, high, num): Also includes the number of grid points between *low* and *high*.\n\n**ns**(optional) is a positive number indicating the number of grid points along the axes. If *ranges* is specified as *(low, high, num)*, *num* determines the number of points. Otherwise, *ns* is used, defaulting to 20 if not provided.\n\n**finish** (optional) is an optimization function that is called with the result of brute force minimization as initial guess. *finish* should be a function that returns a dictionary that contains keys 'xopt' and 'fopt' and their values should be numeric. The default value is the `fmin` function. If set to NULL, no \"polishing\" function is applied and the result of `brute` is returned directly.\n\n#### Returns\n\nIt returns a dictionary with the following members:\n\n* xopt: Parameter that minimizes function.\n\n* fopt: Value of function at minimum: `fopt = f(xopt)`.\n\n#### Examples\n\nCalculate the minimum of function `f` within *ranges*.\n\n```\ndef f(z) {\n\ta = 2\n\tb = 3\n\tc = 7\n\td = 8\n\tee = 9\n\tf = 10\n\tg = 44\n\th = -1\n\ti = 2\n\tj = 26\n\tk = 1\n\tl = -2\n\tscale = 0.5\n\tx = z[0]\n\ty = z[1]\n\tf1 = a * square(x) + b * x * y + c * square(y) + d * x + ee* y + f\n\tf2 = -g * exp(-(square(x-h)+square(y-i)) / scale)\n\tf3 =  -j * exp(-(square(x-k)+square(y-l)) / scale)\n\treturn f1+f2+f3\n}\nranges=((-4, 3.75),(-4, 3.75))\nbrute(f, ranges, 32)\n\n/* Ouput:\n\nfopt->-3.408581876799\nxopt->[-1.056651921797,1.808348429512]\n\n*/\n```\n"
    },
    "bucket": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bucket.html",
        "signatures": [
            {
                "full": "bucket(vector, dataRange, bucketNum, [includeOutbound=false])",
                "name": "bucket",
                "parameters": [
                    {
                        "full": "vector",
                        "name": "vector"
                    },
                    {
                        "full": "dataRange",
                        "name": "dataRange"
                    },
                    {
                        "full": "bucketNum",
                        "name": "bucketNum"
                    },
                    {
                        "full": "[includeOutbound=false]",
                        "name": "includeOutbound",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [bucket](https://docs.dolphindb.com/en/Functions/b/bucket.html)\n\n\n\n#### Syntax\n\nbucket(vector, dataRange, bucketNum, \\[includeOutbound=false])\n\n#### Details\n\nReturn a vector with the same length as the input *vector*. Each element of the result indicates which bucket each of the elements of the input vector belongs to, based on the bucket classification rules given by *dataRange* and *bucketNum*.\n\nFor example, if *dataRange* is 0:10, *bucketNum* is 2, and *includeOutbound* is unspecified, we have two buckets: \\[0, 5) and \\[5,10). Any value <0 or >=10 will be coded as a null integer. If *includeOutbound* is set to be true, the example above will generate 4 buckets: <0, \\[0, 5), \\[5,10), >=10.\n\n#### Parameters\n\n**vector** is a numeric or temporal vector.\n\n**dataRange** is a pair indicating the data range, which includes the lower bound and excludes the upper bound.\n\n**bucketNum** is the number of buckets. When *dataRange* is specified as an INT PAIR, its range must be a multiple of *bucketNum*.\n\n**includeOutbound** (optional) is a Boolean value indicating whether to include the bucket below the lower bound of the data range and the bucket beyond the upper bound of the data range. The default value is false.\n\n#### Returns\n\nAn INT vector with the same length as *vector*.\n\n#### Examples\n\n```\nbucket(9 23 54 36 46 12, 12:54, 2);\n// output: [,0,,1,1,0]\n\nbucket(9 23 54 36 46 12, 12:54, 2, 1);\n// output: [0,1,3,2,2,1]\n```\n"
    },
    "bucketCount": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bucketCount.html",
        "signatures": [
            {
                "full": "bucketCount(vector, dataRange, bucketNum, [includeOutbound=false])",
                "name": "bucketCount",
                "parameters": [
                    {
                        "full": "vector",
                        "name": "vector"
                    },
                    {
                        "full": "dataRange",
                        "name": "dataRange"
                    },
                    {
                        "full": "bucketNum",
                        "name": "bucketNum"
                    },
                    {
                        "full": "[includeOutbound=false]",
                        "name": "includeOutbound",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [bucketCount](https://docs.dolphindb.com/en/Functions/b/bucketCount.html)\n\n\n\n#### Syntax\n\nbucketCount(vector, dataRange, bucketNum, \\[includeOutbound=false])\n\n#### Details\n\nAccept the same set of parameters as the function [bucket](https://docs.dolphindb.com/en/Functions/b/bucket.html) and return the count for each bucket.\n\n#### Parameters\n\n**vector** is a numeric or temporal vector.\n\n**dataRange** is a pair indicating the data range, which includes the lower bound and excludes the upper bound.\n\n**bucketNum** is the number of buckets. When *dataRange* is specified as an INT PAIR, its range must be a multiple of *bucketNum*.\n\n**includeOutbound** (optional) is a Boolean value indicating whether to include the bucket below the lower bound of the data range and the bucket beyond the upper bound of the data range. The default value is false.\n\n#### Returns\n\nAn INT vector.\n\n#### Examples\n\n```\nbucketCount(9 23 54 36 46 12, 12:54, 2);\n// output: [2,2]\n\nbucketCount(9 23 54 36 46 12, 12:54, 2, 1);\n// output: [1,2,2,1]\n```\n"
    },
    "businessDay": {
        "url": "https://docs.dolphindb.com/en/Functions/b/businessDay.html",
        "signatures": [
            {
                "full": "businessDay(X, [offset], [n=1])",
                "name": "businessDay",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [businessDay](https://docs.dolphindb.com/en/Functions/b/businessDay.html)\n\n\n\n#### Syntax\n\nbusinessDay(X, \\[offset], \\[n=1])\n\n#### Details\n\nIf *X* is a business day (Monday to Friday), return date(X). Otherwise, return the most recent business day.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates dates based on periods consisting of *n* business days. In this case, *offset* determines how the business-day periods are aligned. Specifically, the system first calculates the business day corresponding to *offset* and uses that day as the reference point. A new period boundary is then generated every *n* business days, and the function returns the business day corresponding to the period to which *X* belongs.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar/vector of type DATE.\n\n#### Examples\n\n```\nbusinessDay(2019.01.06);\n// output: 2019.01.04\n\nbusinessDay(2019.01.04);\n// output: 2019.01.04\n\ndate=2019.01.06 + 1..10\nbusinessDay = businessDay(date)\nbusinessDay2 = businessDay(date,min(date),2)\ntable(date, businessDay, businessDay2);\n```\n\n| date       | businessDay | businessDay2 |\n| ---------- | ----------- | ------------ |\n| 2019.01.07 | 2019.01.07  | 2019.01.07   |\n| 2019.01.08 | 2019.01.08  | 2019.01.07   |\n| 2019.01.09 | 2019.01.09  | 2019.01.09   |\n| 2019.01.10 | 2019.01.10  | 2019.01.09   |\n| 2019.01.11 | 2019.01.11  | 2019.01.11   |\n| 2019.01.12 | 2019.01.11  | 2019.01.11   |\n| 2019.01.13 | 2019.01.11  | 2019.01.11   |\n| 2019.01.14 | 2019.01.14  | 2019.01.11   |\n| 2019.01.15 | 2019.01.15  | 2019.01.15   |\n| 2019.01.16 | 2019.01.16  | 2019.01.15   |\n"
    },
    "businessMonthBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/b/businessMonthBegin.html",
        "signatures": [
            {
                "full": "businessMonthBegin(X, [offset], [n=1])",
                "name": "businessMonthBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [businessMonthBegin](https://docs.dolphindb.com/en/Functions/b/businessMonthBegin.html)\n\n\n\n#### Syntax\n\nbusinessMonthBegin(X, \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first business day (Monday to Friday) of the month that *X* belongs to.\n\nBy default, each period corresponds to a calendar month, and the function returns the first business day of the month containing*X*. Here, business days are determined solely by the day of the week: Monday through Friday are considered business days, while Saturday and Sunday are considered non-business days. Public holidays and exchange trading calendars are not taken into account.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period start dates based on n-month periods. In this case, *offset* determines how the multi-month periods are aligned. Specifically, the system first calculates the first business day of the month containing *offset* and uses that date as the reference point. A new period boundary is then generated every *n* months, and the function returns the first business day corresponding to the period to which *X* belongs.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar/vector of type DATE.\n\n#### Examples\n\n```\nbusinessMonthBegin(2018.09.12);\n// output: 2018.09.03\n\nbusinessMonthBegin(2018.09.12, 2018.07.12, 3);\n// output: 2018.07.02\n\ndate=2016.04.12+(1..10)*30\ntime = take(09:30:00, 10)\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2016.05.12 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2016.06.11 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2016.07.11 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2016.08.10 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.09.09 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2016.10.09 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2016.11.08 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2016.12.08 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2017.01.07 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2017.02.06 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by businessMonthBegin(date,2016.01.01,2);\n```\n\n| businessMonthBegin\\_date | avg\\_price | sum\\_qty |\n| ------------------------ | ---------- | -------- |\n| 2016.05.02               | 39.53      | 4100     |\n| 2016.07.01               | 29.77      | 5300     |\n| 2016.09.01               | 175.1      | 12200    |\n| 2016.11.01               | 50.54      | 3800     |\n| 2017.01.02               | 51.835     | 13300    |\n\nRelated functions: [businessMonthEnd](https://docs.dolphindb.com/en/Functions/b/businessMonthEnd.html), [monthBegin](https://docs.dolphindb.com/en/Functions/m/monthBegin.html), [monthEnd](https://docs.dolphindb.com/en/Functions/m/monthEnd.html), [semiMonthBegin](https://docs.dolphindb.com/en/Functions/s/semiMonthBegin.html), [semiMonthEnd](https://docs.dolphindb.com/en/Functions/s/semiMonthEnd.html)\n"
    },
    "businessMonthEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/b/businessMonthEnd.html",
        "signatures": [
            {
                "full": "businessMonthEnd(X, [offset], [n=1])",
                "name": "businessMonthEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [businessMonthEnd](https://docs.dolphindb.com/en/Functions/b/businessMonthEnd.html)\n\n\n\n#### Syntax\n\nbusinessMonthEnd(X, \\[offset], \\[n=1])\n\n#### Details\n\nReturn the last business day (Monday to Friday) of the month that *X* belongs to.\n\nBy default, each period corresponds to a calendar month, and the function returns the last business day of the month containing*X*. Here, business days are determined solely by the day of the week: Monday through Friday are considered business days, while Saturday and Sunday are considered non-business days. Public holidays and exchange trading calendars are not taken into account.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period end dates based on n-month periods. In this case, *offset* determines how the multi-month periods are aligned. Specifically, the system first calculates the last business day of the month containing *offset* and uses that date as the reference point. A new period boundary is then generated every *n* months, and the function returns the last business day corresponding to the period to which *X* belongs.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar/vector of type DATE.\n\n#### Examples\n\n```\nbusinessMonthEnd(2010.10.12);\n// output: 2010.10.29\n\nbusinessMonthEnd(2010.10.12, 2000.03.31, 3);\n// output: 2010.12.31\n\ndate=2016.04.12+(1..10)*30\ntime = take(09:30:00, 10)\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2016.05.12 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2016.06.11 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2016.07.11 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2016.08.10 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.09.09 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2016.10.09 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2016.11.08 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2016.12.08 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2017.01.07 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2017.02.06 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by businessMonthEnd(date,2016.01.31,2);\n```\n\n| businessMonthEnd\\_date | avg\\_price | sum\\_qty |\n| ---------------------- | ---------- | -------- |\n| 2016.06.30             | 39.53      | 4100     |\n| 2016.08.31             | 29.77      | 5300     |\n| 2016.10.31             | 175.1      | 12200    |\n| 2016.12.30             | 50.54      | 3800     |\n| 2017.02.28             | 51.835     | 13300    |\n\nRelated functions: [businessMonthBegin](https://docs.dolphindb.com/en/Functions/b/businessMonthBegin.html), [monthBegin](https://docs.dolphindb.com/en/Functions/m/monthBegin.html), [monthEnd](https://docs.dolphindb.com/en/Functions/m/monthEnd.html), [semiMonthBegin](https://docs.dolphindb.com/en/Functions/s/semiMonthBegin.html), [semiMonthEnd](https://docs.dolphindb.com/en/Functions/s/semiMonthEnd.html)\n"
    },
    "businessQuarterBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/b/businessQuarterBegin.html",
        "signatures": [
            {
                "full": "businessQuarterBegin(X, [startingMonth=1], [offset], [n=1])",
                "name": "businessQuarterBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[startingMonth=1]",
                        "name": "startingMonth",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [businessQuarterBegin](https://docs.dolphindb.com/en/Functions/b/businessQuarterBegin.html)\n\n\n\n#### Syntax\n\nbusinessQuarterBegin(X, \\[startingMonth=1], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first business day (Monday to Friday) of the quarter that *X* belongs to. The first months of the quarters are determined by *startingMonth*. Here, business days are determined solely by the day of the week: Monday through Friday are considered business days, while Saturday and Sunday are considered non-business days.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates dates based on periods consisting of *n* quarters. In this case, *offset* determines how the multi-quarter periods are aligned. Specifically, the system first calculates the first business day of the quarter containing *offset* according to *startingMonth*, and uses that date as the reference point. A new period start boundary is then generated every *n* quarters, and the function returns the first business day corresponding to the period to which *X* belongs.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**startingMonth** (optional) is an integer between 1 and 12 that specifies the starting month of the first quarter in a year. The default value is 1, which represents calendar quarters, i.e., January–March, April–June, July–September, and October–December.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar/vector of type DATE.\n\n#### Examples\n\n```\nbusinessQuarterBegin(2012.06.12);\n// output: 2012.04.02\n\nbusinessQuarterBegin(2012.06.12, 3);\n// output: 2012.06.01\n\nbusinessQuarterBegin(2012.06.12, 8, 2011.08.01, 3);\n// output: 2012.05.01\n\ndate=2011.04.25+(1..10)*90\ntime = take(09:30:00, 10)\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2011.07.24 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2011.10.22 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2012.01.20 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2012.04.19 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2012.07.18 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2012.10.16 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2013.01.14 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2013.04.14 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2013.07.13 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2013.10.11 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by businessQuarterBegin(date, 10, 2010.10.01, 2);\n```\n\n| businessQuarterBegin\\_date | avg\\_price | sum\\_qty |\n| -------------------------- | ---------- | -------- |\n| 2011.04.01                 | 49.6       | 2200     |\n| 2011.10.03                 | 29.49      | 4000     |\n| 2012.04.02                 | 102.495    | 10000    |\n| 2012.10.01                 | 112.995    | 6700     |\n| 2013.04.01                 | 50.805     | 11300    |\n| 2013.10.01                 | 52.38      | 4500     |\n\nRelated functions: [businessQuarterEnd](https://docs.dolphindb.com/en/Functions/b/businessQuarterEnd.html), [quarterBegin](https://docs.dolphindb.com/en/Functions/q/quarterBegin.html), [quarterEnd](https://docs.dolphindb.com/en/Functions/q/quarterEnd.html)\n"
    },
    "businessQuarterEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/b/businessQuarterEnd.html",
        "signatures": [
            {
                "full": "businessQuarterEnd(X, [endingMonth=12], [offset], [n=1])",
                "name": "businessQuarterEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[endingMonth=12]",
                        "name": "endingMonth",
                        "optional": true,
                        "default": "12"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [businessQuarterEnd](https://docs.dolphindb.com/en/Functions/b/businessQuarterEnd.html)\n\n\n\n#### Syntax\n\nbusinessQuarterEnd(X, \\[endingMonth=12], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the last day of the quarter that *X* belongs to. The last months of the quarters are determined by *endingMonth*. Here, business days are determined solely by the day of the week: Monday through Friday are considered business days, while Saturday and Sunday are considered non-business days.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates dates based on periods consisting of *n* quarters. In this case, *offset* determines how the multi-quarter periods are aligned. Specifically, the system first calculates the last business day of the quarter containing *offset* according to *endingMonth*, and uses that date as the reference point. A new period-ending boundary is then generated every *n* quarters, and the function returns the last business day corresponding to the period to which *X* belongs.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**endingMonth** (optional) is an integer between 1 and 12 specifies the ending month of the last quarter in a year. The default value is 12, which represents calendar quarters, i.e., January–March, April–June, July–September, and October–December.\n\n**offset** (optional) is a scalar of the same data type as *X*, It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar/vector of type DATE.\n\n#### Examples\n\n```language-python\nbusinessQuarterEnd(2012.04.12);\n// output: 2012.06.30\n\nbusinessQuarterEnd(2012.04.12, 2);\n// output: 2012.05.31\n\nbusinessQuarterEnd(2012.04.12, 8, 2011.08.01, 3);\n// output: 2012.05.31\n\ndate=2011.04.25+(1..10)*90\ntime = take(09:30:00, 10)\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2011.07.24 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2011.10.22 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2012.01.20 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2012.04.19 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2012.07.18 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2012.10.16 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2013.01.14 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2013.04.14 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2013.07.13 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2013.10.11 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```language-python\nselect avg(price),sum(qty) from t1 group by businessQuarterEnd(date, , 2010.06.01, 2)\n```\n\n| businessQuarterEnd\\_date | avg\\_price | sum\\_qty |\n| ------------------------ | ---------- | -------- |\n| 2011.12.30               | 39.53      | 4100     |\n| 2012.06.29               | 29.77      | 5300     |\n| 2012.12.31               | 175.1      | 12200    |\n| 2013.06.28               | 50.54      | 3800     |\n| 2013.12.31               | 51.835     | 13300    |\n\nRelated functions: [businessQuarterBegin](https://docs.dolphindb.com/en/Functions/b/businessQuarterBegin.html), [quarterBegin](https://docs.dolphindb.com/en/Functions/q/quarterBegin.html), [quarterEnd](https://docs.dolphindb.com/en/Functions/q/quarterEnd.html)\n"
    },
    "businessYearBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/b/businessYearBegin.html",
        "signatures": [
            {
                "full": "businessYearBegin(X, [startingMonth=1], [offset], [n=1])",
                "name": "businessYearBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[startingMonth=1]",
                        "name": "startingMonth",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [businessYearBegin](https://docs.dolphindb.com/en/Functions/b/businessYearBegin.html)\n\n\n\n#### Syntax\n\nbusinessYearBegin(X, \\[startingMonth=1], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first business day (Monday to Friday) of the year that *X* belongs to and that starts in the month of *startingMonth*.\n\nBy default, each period corresponds to one year, and the function returns the first business day of the year containing *X*. The starting month of the year is determined by the *startingMonth* parameter. Here, business days are determined solely by the day of the week: Monday through Friday are considered business days, while Saturday and Sunday are considered non-business days.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period start dates based on n-year periods. In this case, *offset* determines how multi-year periods are aligned. Specifically, the system first calculates the first business day of the year containing *offset* according to *startingMonth*, and uses that date as the reference point. A new period start boundary is then generated every *n* years, and the function returns the first business day corresponding to the period to which *X* belongs.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**startingMonth** (optional) is an integer between 1 and 12 indicating a month. The default value is 1.\n\n**offset** (optional) is a scalar of the same data type as *X*, It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar/vector of type DATE.\n\n#### Examples\n\n```\nbusinessYearBegin(2012.06.12);\n// output: 2012.01.02\n\nbusinessYearBegin(2012.06.13 10:10:10.008,5);\n// output: 2012.05.01\n\ndate=2011.10.25 2012.10.25 2013.10.25 2014.10.25 2015.10.25 2016.10.25 2017.10.25 2018.10.25 2019.10.25 2020.10.25\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by businessYearBegin(date,1,2011.10.01,2)\n```\n\n| businessYearBegin\\_date | avg\\_price | sum\\_qty |\n| ----------------------- | ---------- | -------- |\n| 2011.01.03              | 39.53      | 4100     |\n| 2013.01.01              | 29.77      | 5300     |\n| 2015.01.01              | 175.1      | 12200    |\n| 2017.01.02              | 50.54      | 3800     |\n| 2019.01.01              | 51.835     | 13300    |\n\nRelated functions: [businessYearEnd](https://docs.dolphindb.com/en/Functions/b/businessYearEnd.html), [yearBegin](https://docs.dolphindb.com/en/Functions/y/yearBegin.html), [yearEnd](https://docs.dolphindb.com/en/Functions/y/yearEnd.html)\n"
    },
    "businessYearEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/b/businessYearEnd.html",
        "signatures": [
            {
                "full": "businessYearEnd(X, [endingMonth=12], [offset], [n=1])",
                "name": "businessYearEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[endingMonth=12]",
                        "name": "endingMonth",
                        "optional": true,
                        "default": "12"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [businessYearEnd](https://docs.dolphindb.com/en/Functions/b/businessYearEnd.html)\n\n\n\n#### Syntax\n\nbusinessYearEnd(X, \\[endingMonth=12], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the last business day (Monday to Friday) of the year that *X* belongs to and that ends in the month of *endingMonth*.\n\nBy default, each period corresponds to one year, and the function returns the last business day of the year containing *X*. The ending month of the year is determined by the *endingMonth* parameter. Here, business days are determined solely by the day of the week: Monday through Friday are considered business days, while Saturday and Sunday are considered non-business days.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period end dates based on n-year periods. In this case, *offset* determines how multi-year periods are aligned. Specifically, the system first calculates the last business day of the year containing *offset* according to *endingMonth*, and uses that date as the reference point. A new period end boundary is then generated every *n* years, and the function returns the last business day corresponding to the period to which *X* belongs.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**endingMonth** is an integer between 1 and 12 indicating a month. The default value is 12.\n\n**offset** (optional) is a scalar of the same data type as *X*, It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar/vector of type DATE.\n\n#### Examples\n\n```\nbusinessYearEnd(2012.06.12, 3);\n// output: 2013.03.29\n\nbusinessYearEnd(2012.06.12, 9);\n// output: 2012.09.28\n\nbusinessYearEnd(2012.06.12);\n// output: 2012.12.31\n\nbusinessYearEnd(2012.06.12, 12, 2009.04.03, 2);\n// output: 2013.12.31\n\ndate=2011.04.25+(1..10)*365\ntime = take(09:30:00, 10)\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2012.04.24 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2013.04.24 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2014.04.24 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2015.04.24 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.04.23 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2017.04.23 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2018.04.23 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2019.04.23 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2020.04.22 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2021.04.22 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by businessYearEnd(date, 4, 2010.04.01, 2);\n```\n\n| businessYearEnd\\_date | avg\\_price | sum\\_qty |\n| --------------------- | ---------- | -------- |\n| 2012.04.30            | 49.6       | 2200     |\n| 2014.04.30            | 29.49      | 4000     |\n| 2016.04.29            | 102.495    | 10000    |\n| 2018.04.30            | 112.995    | 6700     |\n| 2020.04.30            | 50.805     | 11300    |\n| 2022.04.29            | 52.38      | 4500     |\n\nRelated functions: [businessYearBegin](https://docs.dolphindb.com/en/Functions/b/businessYearBegin.html), [yearBegin](https://docs.dolphindb.com/en/Functions/y/yearBegin.html), [yearEnd](https://docs.dolphindb.com/en/Functions/y/yearEnd.html)\n"
    },
    "bvls": {
        "url": "https://docs.dolphindb.com/en/Functions/b/bvls.html",
        "signatures": [
            {
                "full": "bvls(Y, X, bounds, [maxIter], [tolerance=1e-10], [intercept=true], [mode=0])",
                "name": "bvls",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "bounds",
                        "name": "bounds"
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[tolerance=1e-10]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "1e-10"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[mode=0]",
                        "name": "mode",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [bvls](https://docs.dolphindb.com/en/Functions/b/bvls.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nbvls(Y, X, bounds, \\[maxIter], \\[tolerance=1e-10], \\[intercept=true], \\[mode=0])\n\n#### Details\n\nPerform Bounded-Variable Least Squares (BVLS) regression.\n\n#### Parameters\n\n**Y** is a numeric vector indicating the dependent variable.\n\n**X** is a numeric vector/matrix/table/tuple indicating the independent variable(s). When *X* is a matrix,\n\n* If the number of rows equals the length of *Y*, each column of *X* is a factor.\n* If the number of rows is not the same as the length of *Y*, and the number of columns equals the length of *Y*, each row of *X* is a factor.\n\nNote: The values in *X* and *Y* will be converted to DOUBLE, and the null values after the conversion will be treated as 0.\n\n**bounds** is a tuple of elements (\\[lb, ub]) specifying the lower and upper bounds. Each element of the tuple can be:\n\n* A scalar: specifies the same boundary for all factors.\n* A vector: specifies boundaries for each factor individually, with the vector length equal to the number of factors.\n\n**maxIter** (optional) is a positive integer indicating the maximum number of iterations before termination, defaults to the number of variables.\n\n**tolerance** (optional) is a DOUBLE value indicating the convergence threshold, defaults to 1e-10. Iteration stops when either:\n\n* The difference in loss function values between consecutive iterations < *tolerance*;\n* The KKT (Karush-Kuhn-Tucker) conditions are satisfied within *tolerance*.\n\n**intercept** (optional) is a Boolean variable indicating whether the regression includes the intercept. If it is true, the system automatically adds a column of 1 to *X* to generate the intercept. The default value is true.\n\n**mode** (optional) is an integer indicating the contents in the output. Currently only 0 (default) is supported, returning a coefficient vector.\n\n#### Returns\n\nA DOUBLE vector indicating the estimated coefficients.\n\n#### Examples\n\n```\nx1 = [1, 3, 5, 7, 11, 16, 23]\nx2 = [2, 8, 11, 34, 56, 54, 100]\ny = [0.1, 4.2, 5.6, 8.8, 22.1, 35.6, 77.2]\nbounds = (0.0, 10.0)\n\nbvls(y, x1, bounds)\n// output: [0,2.717777777777778]\n\nbvls(y, (x1, x2), bounds)\n// output: [0,1.409643685501234,0.315943584131198]\n```\n\nRelated functions: [ols](https://docs.dolphindb.com/en/Functions/o/ols.html)\n"
    },
    "dailyAlignedBar": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dailyAlignedBar.html",
        "signatures": [
            {
                "full": "dailyAlignedBar(X, timeOffset, n, [timeEnd], [mergeSessionEnd=false])",
                "name": "dailyAlignedBar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "timeOffset",
                        "name": "timeOffset"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    },
                    {
                        "full": "[timeEnd]",
                        "name": "timeEnd",
                        "optional": true
                    },
                    {
                        "full": "[mergeSessionEnd=false]",
                        "name": "mergeSessionEnd",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [dailyAlignedBar](https://docs.dolphindb.com/en/Functions/d/dailyAlignedBar.html)\n\n\n\n#### Syntax\n\ndailyAlignedBar(X, timeOffset, n, \\[timeEnd], \\[mergeSessionEnd=false])\n\n#### Details\n\nDetermine windows based on the starting time (specified by *timeOffset*), window length (specified by *n*), and possibly ending time (specified by *timeEnd*). For each element of *X*, return the starting time of the window it belongs to. Specifically, return `X-((X-timeOffset)%n)` for each element of *X* and return a vector with the same length as *X*.\n\nGenerally, a window includes the left boundary but not the right boundary. If *mergeSessionEnd*=true and the right boundary of a session is also the right boundary of a window, the right boundary of the session is merged into the previous window.\n\nThe function supports overnight sessions.\n\n#### Parameters\n\n**X** is a temporal vector of type SECOND, TIME, NANOTIME, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**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.\n\n**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.\n\n**timeEnd** (optional) is of the same type and length of *timeOffset* indicating the right boundary of session(s).\n\n**mergeSessionEnd** (optional) 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.\n\n#### Returns\n\nA vector with the same length as *X*\n\n#### Examples\n\nPlease note that the examples below use randomly generated data for the column of price. The result is different each time you execute it.\n\nExample 1. The Chinese stock market has 2 sessions each day: from 9:30AM to 11:30AM and from 1PM to 3PM. The script below calculates rolling 1-hour average prices for these sessions.\n\n```\nsessionsBegin = 09:30:00 13:00:00\nts = 2019.11.01T09:30:00..2019.11.01T11:30:00 join 2019.11.01T13:00:00..2019.11.01T15:00:00\nt = table(ts, rand(10.0, size(ts)) as price);\n\nselect avg(price) as price, count(*) as count from t group by dailyAlignedBar(X=ts, timeOffset=sessionsBegin, n=60*60) as k60;\n```\n\n| k60                 | price             | count |\n| ------------------- | ----------------- | ----- |\n| 2019.11.01T09:30:00 | 5.031685383252463 | 3600  |\n| 2019.11.01T10:30:00 | 5.022667285786399 | 3600  |\n| 2019.11.01T11:30:00 | 4.930270051117987 | 1     |\n| 2019.11.01T13:00:00 | 4.931854071494632 | 3600  |\n| 2019.11.01T14:00:00 | 4.979529541734115 | 3600  |\n| 2019.11.01T15:00:00 | 0.961996954865754 | 1     |\n\nAs a window includes the left boundary but not the right boundary, if the right boundary of a session is also the right boundary of a window as in the example above, the right boundary of the session belongs to a window that has no other records if *timeEnd* and *mergeSessionEnd* are not specified. In most cases we would like to merge the right boundary of a session to the previous window. Please refer to the example below.\n\n```\nsessionsEnd = 11:30:00 15:00:00;\nselect avg(price) as price, count(*) as count from t group by dailyAlignedBar(X=ts, timeOffset=sessionsBegin, n=60*60, timeEnd=sessionsEnd, mergeSessionEnd=true) as k60;\n```\n\n| k60                 | price             | count |\n| ------------------- | ----------------- | ----- |\n| 2019.11.01T09:30:00 | 5.031685383252463 | 3600  |\n| 2019.11.01T10:30:00 | 5.022641627015316 | 3601  |\n| 2019.11.01T13:00:00 | 4.931854071494632 | 3600  |\n| 2019.11.01T14:00:00 | 4.978413870368697 | 3601  |\n\nExample 2. The futures market has 2 sessions each day: from 1:30PM to 4:30PM and from 10:30PM to 2:30AM the next day. `dailyAlignedBar` is used to calculate 7-minute average prices for these sessions. Please note that we simulate 2 days' data in the example.\n\n```\nsessions = 13:30:00 22:30:00\nts = 2019.11.01T13:30:00..2019.11.01T16:30:00 join 2019.11.01T22:30:00..2019.11.02T02:30:00\nts = ts join (ts+60*60*24)\nt = table(ts, rand(10.0, size(ts)) as price)\nselect avg(price) as price, count(*) as count from t group by dailyAlignedBar(X=ts, timeOffset=sessions, n=7m) as k7;\n```\n\nExample 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.\n\n```\nn = 1000000\nnano=(09:30:00.000000000 + rand(long(6.5*60*60*1000000000), n)).sort!()\nsessionStartNano=09:30:00.000000000\nprice = 100+cumsum(rand(0.02, n)-0.01)\nvolume = rand(1000, n)\nsymbol = rand(`600519`000001`600000`601766, n)\ntradeNano=table(symbol, nano, price, volume).sortBy!(`symbol`nano)\nundef(`nano`price`volume`symbol)\nbarMinutes=7\nitv = barMinutes*60*long(1000000000)\n\nOHLC_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(X=nano, timeOffset=sessionStartNano, n=itv) as barStart\n```\n\nRelated function: [bar](https://docs.dolphindb.com/en/Functions/b/bar.html)\n"
    },
    "database": {
        "url": "https://docs.dolphindb.com/en/Functions/d/database.html",
        "signatures": [
            {
                "full": "database(directory, [partitionType], [partitionScheme], [locations], [engine='OLAP'], [atomic='TRANS'])",
                "name": "database",
                "parameters": [
                    {
                        "full": "directory",
                        "name": "directory"
                    },
                    {
                        "full": "[partitionType]",
                        "name": "partitionType",
                        "optional": true
                    },
                    {
                        "full": "[partitionScheme]",
                        "name": "partitionScheme",
                        "optional": true
                    },
                    {
                        "full": "[locations]",
                        "name": "locations",
                        "optional": true
                    },
                    {
                        "full": "[engine='OLAP']",
                        "name": "engine",
                        "optional": true,
                        "default": "'OLAP'"
                    },
                    {
                        "full": "[atomic='TRANS']",
                        "name": "atomic",
                        "optional": true,
                        "default": "'TRANS'"
                    }
                ]
            },
            {
                "full": "database(directory, [partitionType], [partitionScheme], [locations], [engine='OLAP'], [atomic='TRANS'], [chunkGranularity='TABLE'])",
                "name": "database",
                "parameters": [
                    {
                        "full": "directory",
                        "name": "directory"
                    },
                    {
                        "full": "[partitionType]",
                        "name": "partitionType",
                        "optional": true
                    },
                    {
                        "full": "[partitionScheme]",
                        "name": "partitionScheme",
                        "optional": true
                    },
                    {
                        "full": "[locations]",
                        "name": "locations",
                        "optional": true
                    },
                    {
                        "full": "[engine='OLAP']",
                        "name": "engine",
                        "optional": true,
                        "default": "'OLAP'"
                    },
                    {
                        "full": "[atomic='TRANS']",
                        "name": "atomic",
                        "optional": true,
                        "default": "'TRANS'"
                    },
                    {
                        "full": "[chunkGranularity='TABLE']",
                        "name": "chunkGranularity",
                        "optional": true,
                        "default": "'TABLE'"
                    }
                ]
            }
        ],
        "markdown": "### [database](https://docs.dolphindb.com/en/Functions/d/database.html)\n\n\n\n#### Syntax\n\ndatabase(directory, \\[partitionType], \\[partitionScheme], \\[locations], \\[engine='OLAP'], \\[atomic='TRANS'])\n\nStarting from 1.30.16/2.00.4, if the configuration paramter *enableChunkGranularityConfig* = true, use the following syntax:\n\ndatabase(directory, \\[partitionType], \\[partitionScheme], \\[locations], \\[engine='OLAP'], \\[atomic='TRANS'], \\[chunkGranularity='TABLE'])\n\n#### Details\n\nCreate a database handle.\n\nTo create a DFS database, *partitionType* and *partitionScheme* must be specified. To reopen an existing distributed database, only *directory* is required. It is not allowed to overwrite an existing distributed database with a different *partitionType* or *partitionScheme*.\n\n#### Parameters\n\n**directory** is the directory where a database is located. To establish a database in the distributed file system, *directory* should start with \"dfs\\://\". To establish an in-memory database, directory should be unspecfied or an empty string \"\". To establish an IMOLTP database, directory should start with \"oltp\\://\". Make sure the configuration parameter *enableIMOLTP* is set to true before creating an IMOLTP database.\n\n**partitionType** (optional) specifies the partition type, which can be: sequential (SEQ), range (RANGE), hash (HASH), value (VALUE), list (LIST), and composite (COMPO).\n\n**partitionScheme** (optional) describes how the partitions are created. It is usually a vector, with the exception that it is an integer scalar for the sequential domain. The interpretation of the partition scheme depends on the partition type. *partitionScheme* supports the following data types: CHAR, SHORT, INT, DATE, MONTH, TIME, MINUTE, SECOND, DATETIME, and SYMBOL.\n\n| Partition Type    | Partition Type Symbol | Partition Scheme                                                                                                                                                     |\n| ----------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| sequential domain | SEQ                   | An integer scalar. It means the number of partitions.                                                                                                                |\n| range domain      | RANGE                 | A vector. Any two adjacent elements of the vector define the range for a partition.                                                                                  |\n| hash domain       | HASH                  | A tuple. The first element is the data type of partitioning column. The second element is the number of partitions.                                                  |\n| value domain      | VALUE                 | A vector. Each element of the vector defines a partition.                                                                                                            |\n| list domain       | LIST                  | A vector. Each element of the vector defines a partition.                                                                                                            |\n| composite domain  | COMPO                 | A vector. Each element of the vector is a database handle. The vector can contain two or three elements and the length of the vector indicates the partition levels. |\n\n**locations** (optional) is 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.\n\n**engine** (optional) specifies the storage engine. It can be 'OLAP' (default), 'TSDB', 'IMOLTP', 'IOTDB' or 'PKEY'. Note that the TSDB and PKEY engines only support creating distributed databases.\n\n**engine** (optional) specifies the storage engine. It can be 'OLAP' (default), 'TSDB', or 'IOTDB'.\n\n**atomic** (optional) 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'.\n\n* '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.\n\n* '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.\n\n**chunkGranularity** (optional) 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':\n\n* 'TABLE': the chunk granularity is at the TABLE level. In this case, concurrent writes to different tables in the same partition are allowed.\n\n* 'DATABASE': the chunk granularity is at the DATABASE level. In this case, concurrent writes to different tables in the same partition are not allowed.\n\nThe chunk granularity determines where a DolphinDB transaction locates the lock. For databases created with version 1.30.16/2.00.4 or earlier, 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.\n\n#### Examples\n\nExample 1. To establish a non-partitioned database on disk:\n\n```\ndb=database(directory=\"C:/DolphinDB/Data/db1/\");\nt=table(take(1..10,1000) as id, rand(10,1000) as x, rand(10.0,1000) as y);\nsaveTable(db, t, `t1);\n```\n\nExample 2. For distributed database, here's an example for each type of partition:\n\n* **Partition Type: SEQ**\n\n  In a sequential domain (SEQ), the partitions are based on the order of rows in the input data file. It can only be used in the local file system, not in the distributed file system.\n\n  ```\n  n=1000000\n  ID=rand(100, n)\n  dates=2017.08.07..2017.08.11\n  date=rand(dates, n)\n  x=rand(10.0, n)\n  t=table(ID, date, x);\n  saveText(t, \"C:/DolphinDB/Data/t.txt\");\n\n  db = database(directory=\"C:/DolphinDB/Data/seqdb\", partitionType=SEQ, partitionScheme=8)\n  pt = loadTextEx(db, `pt, ,\"C:/DolphinDB/Data/t.txt\");\n  ```\n\n  Under the folder *C:/DolphinDB/data/seqdb*, 8 sub folders have been created. Each of them corresponds to a partition of the input data file. If the size of the input data file is larger than the available memory of the computer, we can load the data in partitions.\n\n  ![](https://docs.dolphindb.com/en/images/database01.png)\n\n* **Partition Type: RANGE**\n\n  In a range domain (RANGE), partitions are determined by any two adjacent elements of the partition scheme vector. The starting value is inclusive and the ending value is exclusive.\n\n  ```\n  n=1000000\n  ID=rand(10, n)\n  x=rand(1.0, n)\n  t=table(ID, x);\n  db=database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 5 10)\n  pt = db.createPartitionedTable(t, `pt, `ID);\n  pt.append!(t);\n\n  pt=loadTable(db,`pt)\n  x=select * from pt\n  select count(x) from pt;\n  ```\n\n  | count\\_x |\n  | -------- |\n  | 1000000  |\n\n  In the example above, the database db has two partitions: \\[0,5) and \\[5,10). Table t is saved as a partitioned table pt with the partitioning column of ID in database db.\n\n  ![](https://docs.dolphindb.com/en/images/database02.png)\n\n  To import a data file into a distributed database of range domain in the local file system:\n\n  ```\n  n=1000000\n  ID=rand(10, n)\n  x=rand(1.0, n)\n  t=table(ID, x);\n  saveText(t, \"C:/DolphinDB/Data/t.txt\");\n\n  db=database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 5 10)\n  pt = loadTextEx(db, `pt, `ID, \"C:/DolphinDB/Data/t.txt\");\n  ```\n\n* **Partition Type: HASH**\n\n  In a hash domain (HASH), the data type and numbers of partitions need to be specified.\n\n  ```\n  n=1000000\n  ID=rand(10, n)\n  x=rand(1.0, n)\n  t=table(ID, x)\n  db=database(directory=\"dfs://hashdb\", partitionType=HASH, partitionScheme=[INT, 2])\n\n  pt = db.createPartitionedTable(t, `pt, `ID)\n  pt.append!(t);\n\n  select count(x) from pt;\n  ```\n\n  | count\\_x |\n  | -------- |\n  | 1000000  |\n\n  In example above, database db has two partitions. Table t is saved as pt(a partitioned table) with the partitioning column ID.\n\n  Note: For a database to be imported to a hash domain, if a partitioning column contains null value, the record is discarded.\n\n  ```\n  ID = NULL 3 6 NULL 9\n  x = rand(1.0, 5)\n  t1 = table(ID, x)\n  pt.append!(t1)\n  select count(x) from pt;\n  ```\n\n  | count\\_x |\n  | -------- |\n  | 1000003  |\n\n* **Partition Type: VALUE**\n\n  In a value domain (VALUE), each element of the partition scheme vector determines a partition.\n\n  ```\n  n=1000000\n  month=take(2000.01M..2016.12M, n);\n  x=rand(1.0, n);\n  t=table(month, x);\n\n  db=database(directory=\"dfs://valuedb\", partitionType=VALUE, partitionScheme=2000.01M..2016.12M)\n  pt = db.createPartitionedTable(t, `pt, `month);\n  pt.append!(t);\n\n  pt=loadTable(db,`pt)\n  select count(x) from pt;\n  ```\n\n  | count\\_x |\n  | -------- |\n  | 1000000  |\n\n  The example above defines a database db with 204 partitions. Each of these partitions is a month between January 2000 and December 2016. With function `createPartitionedTable` and `append!`, table t is saved as a partitioned table pt in the database db with the partitioning column of month.\n\n  ![](https://docs.dolphindb.com/en/images/database03.png)\n\n* **Partition Type: LIST**\n\n  In a list domain (LIST), each element of the partition scheme vector determines a partition.\n\n  ```\n  n=1000000\n  ticker = rand(`MSFT`GOOG`FB`ORCL`IBM,n);\n  x=rand(1.0, n);\n  t=table(ticker, x);\n\n  db=database(directory=\"dfs://listdb\", partitionType=LIST, partitionScheme=[`IBM`ORCL`MSFT, `GOOG`FB])\n  pt = db.createPartitionedTable(t, `pt, `ticker)\n  pt.append!(t);\n\n  pt=loadTable(db,`pt)\n  select count(x) from pt;\n  ```\n\n  | count\\_x |\n  | -------- |\n  | 1000000  |\n\n  The database above has 2 partitions. The first partition has 3 tickers and the second has 2 tickers.\n\n  ![](https://docs.dolphindb.com/en/images/database04.png)\n\n* **Partition Type: COMPO**\n\n  In a composite domain (COMPO), we can have 2 or 3 partitioning columns. Each column can be of range, value, or list domain.\n\n  ```\n  n=1000000\n  ID=rand(100, n)\n  dates=2017.08.07..2017.08.11\n  date=rand(dates, n)\n  x=rand(10.0, n)\n  t=table(ID, date, x)\n\n  dbDate = database(, partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)\n  dbID = database(, partitionType=RANGE, partitionScheme=0 50 100)\n  db = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID])\n\n  pt = db.createPartitionedTable(t, `pt, `date`ID)\n  pt.append!(t)\n\n  pt=loadTable(db,`pt)\n  select count(x) from pt;\n  ```\n\n  | count\\_x |\n  | -------- |\n  | 1000000  |\n\n  The value domain has 5 partitions for 5 days:\n\n  ![](https://docs.dolphindb.com/en/images/database05.png)\n\n  The range domain has 2 partitions:\n\n  ![](https://docs.dolphindb.com/en/images/database06.png)\n\n  Please note that the although we have 2 levels of folders here for database files, composite domain only has one level of partition. In comparision, there are 2 levels of partition in dual partition.\n\nExample 3. To establish distributed databases in the distributed file system, we can follow the syntax of the examples above. The only difference is that the *directory* parameter in function `database` should start with \"dfs\\://\".\n\nTo execute the following examples, we need to start a DFS cluster on the web interface, and submit the script on a data node.\n\nSave a partitioned table of composite domain in the distributed file system:\n\n```\nn=1000000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x);\n\ndbDate = database(, partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)\ndbID=database(, partitionType=RANGE, partitionScheme=0 50 100);\ndb = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID]);\npt = db.createPartitionedTable(t, `pt, `date`ID)\npt.append!(t);\n```\n\nThe data are stored at a location specified by the configuration parameter volumes.\n\n![](https://docs.dolphindb.com/en/images/database07.png)\n\nPlease note that DFS\\_NODE1 only has 4 date folders; under DFS\\_NODE1, the folder of 20170807 only has 1 ID folder. This is because here we have 4 data nodes and 2*5=10 partitions based on date and ID. By default each partition has 3 copies in the distributed file system. Therefore, we have 5*2\\*3=30 partitions in total saved on 4 data nodes. Not all data nodes have all the 10 partitions.\n\nImport a data file into a distributed database of range domain in the distributed file system:\n\n```\nn=1000000\nID=rand(10, n)\nx=rand(1.0, n)\nt=table(ID, x);\nsaveText(t, \"C:/DolphinDB/Data/t.txt\");\n\ndb=database(\"dfs://rangedb\", RANGE,  0 5 10)\npt = loadTextEx(db, `pt, `ID, \"C:/DolphinDB/Data/t.txt\");\n```\n\nExample 4. Use the parameter *locations*\n\n```\nn=1000000\nID=rand(10, n)\nx=rand(1.0, n)\nt=table(ID, x);\n\ndb=database(directory=\"dfs://rangedb5\", partitionType=RANGE, partitionScheme=0 5 10, locations=[`node1`node2, `node3])\npt = db.createPartitionedTable(t, `pt, `ID);\npt.append!(t);\n```\n\nThe example above defines a list domain that has 2 partitions. The first partition resides on 2 sites: node1 and node2, and the second partition resides on site node3. All referred sites must be defined in the sites attribute of *dolphindb.cfg* on all machines where these nodes are located:\n\n```\nsites=111.222.3.4:8080:node1, 111.222.3.5:8080:node2, 111.222.3.6:8080:node3\n```\n\nSites are separated by comma. Each site specification contains 3 parts: host name, port number, and alias. A partition can reside on multiple sites that back up each other. In this example, each node is located on a different machine.\n\nWe can also use the actual host name and the port number to represent a site. The function call can be changed to\n\n```\ndb=database(\"C:/DolphinDB/Data/rangedb6\", RANGE, 0 5 10, [[\"111.222.3.4:8080\", \"111.222.3.5:8080\"], \"111.222.3.6:8080\"])\n```\n\nExample 5. Use the parameter *atomic*:\n\n```\nif(existsDatabase(\"dfs://test\"))\ndropDB(\"dfs://test\")\ndb = database(directory=\"dfs://test\", partitionType=VALUE, partitionScheme=1..20, atomic='CHUNK')\ndummy = table(take(1..20, 100000) as id, rand(1.0, 100000) as value)\npt = db.createPartitionedTable(dummy, \"pt\", `id)\n\ndummy1 = table(take(1..15, 1000000) as id, rand(1.0, 1000000) as value)\ndummy2 = table(take(11..20, 1000000) as id, rand(1.0, 1000000) as value)\nsubmitJob(\"write1\", \"writer1\", append!{pt, dummy1})\nsubmitJob(\"write2\", \"writer2\", append!{pt, dummy2})\nsubmitJob(\"write3\", \"writer3\", append!{pt, dummy1})\nsubmitJob(\"write4\", \"writer4\", append!{pt, dummy2})\nselect count(*) from pt\n// output: 4,000,000\n```\n"
    },
    "date": {
        "url": "https://docs.dolphindb.com/en/Functions/d/date.html",
        "signatures": [
            {
                "full": "date(X)",
                "name": "date",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [date](https://docs.dolphindb.com/en/Functions/d/date.html)\n\n\n\n#### Syntax\n\ndate(X)\n\n#### Details\n\nConvert *X* into DATE type.\n\n#### Parameters\n\n**X** is an integer or temporal scalar/vector.\n\n#### Returns\n\nDATE type with the same data form as *X*.\n\n#### Examples\n\n```\ndate 2012.12.03 01:22:01;\n// output: 2012.12.03\n\ndate(2016.03M);\n// output: 2016.03.01\n\ndate(1);\n// output: 1970.01.02\n```\n\nRelated functions: [second](https://docs.dolphindb.com/en/Functions/s/second.html), [minute](https://docs.dolphindb.com/en/Functions/m/minute.html), [month](https://docs.dolphindb.com/en/Functions/m/month.html), [hour](https://docs.dolphindb.com/en/Functions/h/hour.html), [year](https://docs.dolphindb.com/en/Functions/y/year.html)\n"
    },
    "datehour": {
        "url": "https://docs.dolphindb.com/en/Functions/d/datehour.html",
        "signatures": [
            {
                "full": "datehour(X)",
                "name": "datehour",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [datehour](https://docs.dolphindb.com/en/Functions/d/datehour.html)\n\n\n\n#### Syntax\n\ndatehour(X)\n\n#### Details\n\nConvert *X* into DATEHOUR data type.\n\nSince version 2.00.12, converting MONTH into DATEHOUR is allowed.\n\n#### Parameters\n\n**X** is a temporal scalar/vector that contains information about dates.\n\n#### Returns\n\nDATEHOUR type with the same data form as *X*.\n\n#### Examples\n\n```\ndatehour(2012.06.13 13:30:10);\n// output: 2012.06.13T13\n\ndatehour([2012.06.15 15:32:10.158,2012.06.15 17:30:10.008]);\n// output: [2012.06.15T15,2012.06.15T17]\n\ndatehour(2012.01M)\n// output: 2012.01.01T00\n```\n"
    },
    "datetime": {
        "url": "https://docs.dolphindb.com/en/Functions/d/datetime.html",
        "signatures": [
            {
                "full": "datetime(X)",
                "name": "datetime",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [datetime](https://docs.dolphindb.com/en/Functions/d/datetime.html)\n\n\n\n#### Syntax\n\ndatetime(X)\n\n#### Details\n\nConvert *X* into DATETIME type. Since version 2.00.12, converting MONTH into DATETIME is allowed.\n\n**Note:** The range for data of DATETIME type is \\[1901.12.13T20:45:53, 2038.01.19T03:14:07].\n\n#### Parameters\n\n**X** is a temporal scalar/vector, or an integer.\n\n#### Returns\n\nDATETIME type with the same data form as *X*.\n\n#### Examples\n\n```\ndatetime(2009.11.10);\n// output: 2009.11.10T00:00:00\n\ntypestr datetime(2009.11.10);\n// output: DATETIME\n\ndatetime(now());\n// output: 2016.03.02T20:51:10\n\ndatetime(2012.01M)\n// output: 2012.01.01T00:00:00\n```\n\nRelated functions: [date](https://docs.dolphindb.com/en/Functions/d/date.html), [second](https://docs.dolphindb.com/en/Functions/s/second.html), [minute](https://docs.dolphindb.com/en/Functions/m/minute.html), [month](https://docs.dolphindb.com/en/Functions/m/month.html), [hour](https://docs.dolphindb.com/en/Functions/h/hour.html), [year](https://docs.dolphindb.com/en/Functions/y/year.html)\n"
    },
    "datetimeParse": {
        "url": "https://docs.dolphindb.com/en/Functions/d/datetimeParse.html",
        "signatures": [
            {
                "full": "temporalParse(X, format)",
                "name": "temporalParse",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "format",
                        "name": "format"
                    }
                ]
            }
        ],
        "markdown": "### [datetimeParse](https://docs.dolphindb.com/en/Functions/d/datetimeParse.html)\n\nAlias for [temporalParse](https://docs.dolphindb.com/en/Functions/t/temporalParse.html)\n\n\nDocumentation for the `temporalParse` function:\n### [temporalParse](https://docs.dolphindb.com/en/Functions/t/temporalParse.html)\n\n\n\n#### Syntax\n\ntemporalParse(X, format)\n\nAlias: datetimeParse\n\n#### Details\n\nConvert a string with specified format to a DolphinDB temporal data type. Return NULL if it cannot decide on the data type.\n\nDolphinDB has the following temporal formats:\n\n| Format    | Meaning          | Range of value                              |\n| --------- | ---------------- | ------------------------------------------- |\n| yyyy      | year (4 digits)  | 1000-9999                                   |\n| yy        | year (2 digits)  | 00-99. (00-39: 2000-2039; 40-99: 1940-1999) |\n| MM        | month in year    | 1-12                                        |\n| MMM       | month in year    | JAN, FEB, ... DEC (case insensitive)        |\n| dd        | day in month     | 1-31                                        |\n| HH        | hour in day      | 0-23                                        |\n| hh        | hour in AM/PM    | 0-11                                        |\n| mm        | minute in hour   | 0-59                                        |\n| ss        | second in minute | 0-59                                        |\n| aa        | AM/PM marker     | AM, PM. (case-insensitive)                  |\n| SSS       | millisecond      | 0-999                                       |\n| nnnnnn    | microsecond      | 0-999999                                    |\n| nnnnnnnnn | nanosecond       | 0-999999999                                 |\n\nThe parameter format of the *temporalParse* function has 2 types of representation:\n\n* **With deliminator(s)**\n\nAny symbol or character is treated as a deliminator except the characters that are used to express a temporal format: y, M, d, H, h, m, s, a, S, and n. A deliminator in the parameter *format* should be identical as the deliminator in the input string.\n\n```\ntemporalParse(\"14-02-2018\",\"dd-MM-yyyy\");\n// output: 2018.02.14\n\ntemporalParse(\"14-02-2018\",\"dd/MM/yyyy\");\n// output: 00d\n\ntemporalParse(\"14//02//2018\",\"dd//MM//yyyy\");\n// output: 2018.02.14\n\ntemporalParse(\"14//02//2018\",\"dd/MM/yyyy\");\n// output: 00d\n\ntemporalParse(\"14//02//2018\",\"dd..MM..yyyy\");\n// output: 00d\n```\n\nWe can simplify the formats by using a single letter between deliminators for the parameter *format*. For example, we can use the format \"y/M/d\" instead of \"yyyy/MM/dd\" for \"2018/01/16\". As \"y\" may mean both \"yyyy\" and \"yy\", for this case the system decides on the format based on the number of digits between deliminators.\n\n```\ntemporalParse(\"14-02-18\",\"d-M-y\");\n// output: 2018.02.14\n\ntemporalParse(\"2018/2/6 02:33:01 PM\",\"y/M/d h:m:s a\");\n// output: 2018.02.06T14:33:01\n```\n\n\"MMM\",\"SSS\", \"nnnnnn\" and \"nnnnnnnnn\", however, cannot be simplified to a single letter.\n\n```\ntemporalParse(\"02-FEB-2018\",\"d-MMM-y\");\n// output: 2018.02.02\n\ntemporalParse(\"02-FEB-2018\",\"d-M-y\");\n// output: 00d\n\ntemporalParse(\"13:30:10.001\",\"H:m:s.SSS\");\n// output: 13:30:10.001\n\ntemporalParse(\"13:30:10.001\",\"H:m:s.S\");\n// output: Invalid temporal format: 'H:m:s.S'. Millisecond (S) must have three digits.\n\ntemporalParse(\"13:30:10.008001\",\"H:m:s.nnnnnn\");\n// output: 13:30:10.008001000\n\ntemporalParse(\"13:30:10.008001\",\"H:m:s.n\");\n// output: Invalid temporal format: 'H:m:s.n'. Nanosecond (n) must have six or nine digits.\n```\n\nThe `temporalParse` function is very flexible in interpreting the numbers between deliminators in the input string.\n\n```\ntemporalParse(\"2-4-18\",\"d-M-yy\");\n// output: 2018.04.02\n\ntemporalParse(\"2-19-6\",\"H-m-s\");\n// output: 02:19:06\n\ntemporalParse(\"002-019-006\",\"H-m-s\");\n// output: 02:19:06\n```\n\nFor millisecond, microsecond and nanosecond, however, the corresponding number of digits in the input string must be 3, 6 and 9 respectively.\n\n```\ntemporalParse(\"2018/2/6 13:30:10.001\",\"y/M/d H:m:s.SSS\");\n// output: 2018.02.06T13:30:10.001\n\ntemporalParse(\"2018/2/6 13:30:10.01\",\"y/M/d H:m:s.SSS\");\n// output: 00T\n\ntemporalParse(\"2018/2/6 13:30:10.000001\",\"y/M/d H:m:s.nnnnnn\");\n// output: 2018.02.06T13:30:10.000001000\n\ntemporalParse(\"2018/2/6 13:30:10.0000010\",\"y/M/d H:m:s.nnnnnn\");\n// output: 00N\n```\n\nIf a character that is used to express a temporal format (y, M, d, H, h, m, s, a, S, n) appears in the input string as a deliminator, we need to use \"\" before the character in parameter *format*.\n\n```\ntemporalParse(\"2013a02\", \"y\\\\aM\");\n// output: 2013.02M\n\ntemporalParse(\"2013an02\", \"y\\\\a\\\\nM\");\n// output: 2013.02M\n```\n\n* **Without deliminators**\n\nFor this reprensentation, the parameter *format* must be composed of the formats in the temporal formats table. We cannot use a single letter to represent a format in the temporal format table.\n\n```\ntemporalParse(\"20180214\",\"yyyyMMdd\");\n// output: 2018.02.14\n\ntemporalParse(\"122506\",\"MMddyy\");\n// output: 2006.12.25\n\ntemporalParse(\"155950\",\"HHmmss\");\n// output: 15:59:50\n\ntemporalParse(\"035901PM\",\"hhmmssaa\");\n// output: 15:59:01\n\ntemporalParse(\"02062018155956001000001\",\"MMddyyyyHHmmssnnnnnnnnn\");\n// output: 2018.02.06T15:59:56.001000001\n```\n\n#### Parameters\n\n**X** is a string scalar/vector to be converted to temporal data types.\n\n**format** is a string indicating a temporal format.\n\n#### Returns\n\nA temporal scalar or vector.\n"
    },
    "dayOfMonth": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html",
        "signatures": [
            {
                "full": "dayOfMonth(X)",
                "name": "dayOfMonth",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html)\n\n\n\n#### Syntax\n\ndayOfMonth(X)\n\n#### Details\n\nReturn the day of the month for each element in X.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nAn integer.\n\n#### Examples\n\n```\ndayOfMonth(2011.01.01);\n// output: 1\n\ndayOfMonth([2012.06.12T12:30:00,2012.07.28T12:35:00]);\n// outpu: [12,28]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "dayOfWeek": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dayOfWeek.html",
        "signatures": [
            {
                "full": "dayOfWeek(X)",
                "name": "dayOfWeek",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [dayOfWeek](https://docs.dolphindb.com/en/Functions/d/dayOfWeek.html)\n\n\n\n#### Syntax\n\ndayOfWeek(X)\n\n#### Details\n\nReturn which day of the week is *X*.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, DATEHOUR, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nAn integer from 0 to 6, where 0 means Monday, .., 6 means Sunday.\n\n#### Examples\n\n```\ndayOfWeek(2012.12.05);\n// output: 2\n\ndayOfWeek 2013.05.23T12:00:00;\n// output: 3\n\ndayOfWeek(2014.01.11T23:04:28.113);\n// output: 5\n\ndayOfWeek(2012.12.05 2012.12.06 2013.01.05);\n// output: [2,3,4]\n```\n"
    },
    "dayOfYear": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dayOfYear.html",
        "signatures": [
            {
                "full": "dayOfYear(X)",
                "name": "dayOfYear",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html)\n\n\n\n#### Syntax\n\ndayOfYear(X)\n\n#### Details\n\nReturn the day of the year for each element in *X*.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nAn integer.\n\n#### Examples\n\n```\ndayOfYear(2011.01.01);\n// output: 1\n\ndayOfYear([2011.12.31,2012.12.31]);\n// output: [365,366]\n\ndayOfYear([2012.06.12T12:30:00,2012.07.12T12:35:00]);\n// output: [164,194]\n```\n\nRelated functions: [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "daysInMonth": {
        "url": "https://docs.dolphindb.com/en/Functions/d/daysInMonth.html",
        "signatures": [
            {
                "full": "daysInMonth(X)",
                "name": "daysInMonth",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [daysInMonth](https://docs.dolphindb.com/en/Functions/d/daysInMonth.html)\n\n\n\n#### Syntax\n\ndaysInMonth(X)\n\n#### Details\n\nReturn the number of days in the month for each element in *X*.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nAn integer.\n\n#### Examples\n\n```\ndaysInMonth(2012.06.12T12:30:00);\n// output: 30\n\ndaysInMonth([2012.02.01,2013.12.05]);\n// output: [29,31]\n```\n"
    },
    "decimal128": {
        "url": "https://docs.dolphindb.com/en/Functions/d/decimal128.html",
        "signatures": [
            {
                "full": "decimal128(X, scale)",
                "name": "decimal128",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "scale",
                        "name": "scale"
                    }
                ]
            }
        ],
        "markdown": "### [decimal128](https://docs.dolphindb.com/en/Functions/d/decimal128.html)\n\n\n\n#### Syntax\n\ndecimal128(X, scale)\n\n#### Details\n\nConvert the input values into DECIMAL128.\n\n#### Parameters\n\n**X** is a scalar/vector of Integral, Floating, or STRING type.\n\n**scale** is an integer in \\[0,38] that determines the number of digits to the right of the decimal point.\n\n#### Returns\n\nA scalar or vector of type DECIMAL128.\n\n#### Examples\n\n```\na=decimal128(142, 2)\na\n// output: 142.00\n\nb=decimal128(1\\7, 6)\nb\n// output: 0.142857\n\na+b\n// output: 142.142857\n\na*b\n// output: 20.28569400\n\ndecimal128(\"3.1415926535\", 4)\n// output: 3.1416\n\n// All elements of a DECIMAL vector must be of the same type and scale\nd1=[1.23$DECIMAL128(4), 3$DECIMAL128(4), 3.14$DECIMAL128(4)];\n// output: [1.2300,3.0000,3.1400]\ntypestr(d1)\n// output: FAST DECIMAL128 VECTOR\n\n// If the elements are of different scales, a tuple is created\nd2=[1.23$DECIMAL128(4), 3$DECIMAL128(4), 3.14$DECIMAL128(3)];\n// output: (1.2300,3.0000,3.140)\ntypestr(d2)\n// output: ANY VECTOR\n```\n"
    },
    "decimal32": {
        "url": "https://docs.dolphindb.com/en/Functions/d/decimal32.html",
        "signatures": [
            {
                "full": "decimal32(X, scale)",
                "name": "decimal32",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "scale",
                        "name": "scale"
                    }
                ]
            }
        ],
        "markdown": "### [decimal32](https://docs.dolphindb.com/en/Functions/d/decimal32.html)\n\n\n\n#### Syntax\n\ndecimal32(X, scale)\n\n#### Details\n\nConvert the input values into DECIMAL32 type.\n\n#### Parameters\n\n**X** is a scalar/vector of Integral, Floating, or STRING type.\n\n**scale** is an integer in \\[0,9] that determines the number of digits to the right of the decimal point.\n\n#### Returns\n\nA scalar or vector of type DECIMAL32.\n\n#### Examples\n\n```\na=decimal32(142, 2)\na\n// output: 142.00\n\nb=decimal32(1\\7, 6)\nb\n// output: 0.142857\n\na+b\n// output: 142.142857\n\na*b\n// output: 20.28569400\n\ndecimal32(\"3.1415926535\", 4)\n// output: 3.1415\n\n// the elements of a DECIMAL vector must be of the same decimal type and scale\nd1=[1.23$DECIMAL32(4), 3$DECIMAL32(4), 3.14$DECIMAL32(4)];\n// output: [1.2300,3.0000,3.1400]\ntypestr(d1)\n// output: FAST DECIMAL32 VECTOR\n\nd2=[1.23$DECIMAL32(4), 3$DECIMAL32(4), 3.14$DECIMAL32(3)];\n// output: (1.2300,3.0000,3.140)\ntypestr(d2)\n// output: ANY VECTOR\n```\n\n**Note:** When converting data of STRING/SYMBOL type into DECIMAL, there has been a modification in the way the decimal part exceeding the scale is handled since version 2.00.10.\n\n* Before version 2.00.10, the decimal part is truncated;\n\n* Starting from version 2.00.10, the decimal part is rounded.\n\n```\nsymbol([\"1.341\", \"4.5677\"])$DECIMAL32(2)\n//before version 2.00.10, the output is: [1.34,4.56]\n//starting from version 2.00.10, the output turns to: [1.34,4.57]\n```\n"
    },
    "decimal64": {
        "url": "https://docs.dolphindb.com/en/Functions/d/decimal64.html",
        "signatures": [
            {
                "full": "decimal64(X, scale)",
                "name": "decimal64",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "scale",
                        "name": "scale"
                    }
                ]
            }
        ],
        "markdown": "### [decimal64](https://docs.dolphindb.com/en/Functions/d/decimal64.html)\n\n\n\n#### Syntax\n\ndecimal64(X, scale)\n\n#### Details\n\nConvert the input values into DECIMAL64.\n\n#### Parameters\n\n**X** is a scalar/vector of Integral, Floating, or STRING type.\n\n**scale** is an integer in \\[0,18] that determines the number of digits to the right of the decimal point.\n\n#### Returns\n\nA scalar or vector of type DECIMAL64.\n\n#### Examples\n\n```\na=decimal64(142, 2)\na\n// output: 142.00\n\nb=decimal64(1\\7, 6)\nb\n// output: 0.142857\n\na+b\n// output: 142.142857\n\na*b\n// output: 20.28569400\n\ndecimal64(\"3.1415926535\", 4)\n// output: 3.1415\n\n// the elements of a DECIMAL vector must be of the same decimal type and scale\nd1=[1.23$DECIMAL64(4), 3$DECIMAL64(4), 3.14$DECIMAL64(4)];\n// output: [1.2300,3.0000,3.1400]\ntypestr(d1)\n// output: FAST DECIMAL64 VECTOR\n\nd2=[1.23$DECIMAL64(4), 3$DECIMAL64(4), 3.14$DECIMAL64(3)];\n// output: (1.2300,3.0000,3.140)\ntypestr(d2)\n// output: ANY VECTOR\n```\n\n**Note:** When converting data of STRING/SYMBOL type into DECIMAL, there has been a modification in the way the decimal part exceeding the scale is handled since version 2.00.10.\n\n* Before version 2.00.10, the decimal part is truncated;\n\n* Starting from version 2.00.10, the decimal part is rounded.\n\n```\nsymbol([\"1.341\", \"4.5677\"])$DECIMAL64(2)\n//before version 2.00.10, the output is: [1.34,4.56]\n//starting from version 2.00.10, the output turns to: [1.34,4.57]\n```\n"
    },
    "decimalFormat": {
        "url": "https://docs.dolphindb.com/en/Functions/d/decimalFormat.html",
        "signatures": [
            {
                "full": "decimalFormat(X, format)",
                "name": "decimalFormat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "format",
                        "name": "format"
                    }
                ]
            }
        ],
        "markdown": "### [decimalFormat](https://docs.dolphindb.com/en/Functions/d/decimalFormat.html)\n\n\n\n#### Syntax\n\ndecimalFormat(X, format)\n\n#### Details\n\nApply a specified *format* to the given object.\n\n| Symbol | Meaning                                                                       | Notes  |\n| ------ | ----------------------------------------------------------------------------- | ------ |\n| 0      | mandatory digit                                                               | note 1 |\n| #      | optional digit                                                                | note 2 |\n| .      | decimal point                                                                 |        |\n| %      | percent sign                                                                  | note 3 |\n| E      | separates mantissa and exponent in scientific notation.                       | note 4 |\n| ,      | grouping separator                                                            | note 5 |\n| ;      | separates the format for positive numbers and the format for negative numbers | note 6 |\n\n* Note 1: The number of 0s before the decimal point means the minimum number of digits before the decimal point. In comparison, the number of 0s after the decimal point means the number of digits after the decimal point.\n\n  ```\n  decimalFormat(123,\"0\");\n  // output: 123\n\n  decimalFormat(123,\"00000\");\n  // output: 00123\n\n  decimalFormat(123.45,\"0\");\n  // output: 123\n\n  decimalFormat(123.45,\"0.0\");\n  // output: 123.5\n\n  decimalFormat(123.45,\"0.000\");\n  // output: 123.450\n\n  decimalFormat(123.45, \".0\");\n  // output: 123.5\n\n  decimalFormat(0.45, \".0\");\n  // output: .5\n  ```\n\n* Note 2: If 0s and #s are used together after the decimal point, 0s must appear before #s.\n\n  ```\n  decimalFormat(123.45,\"0.#\");\n  // output: 123.5\n\n  decimalFormat(123.45,\"0.###\");\n  // output: 123.45\n\n  decimalFormat(123.456,\"0.000###\");\n  // output: 123.456\n\n  decimalFormat(123.456789110,\"0.000###\");\n  // output: 123.456789\n\n  decimalFormat(0.345, \".##\");\n  // output: .35\n  ```\n\n* Note 3: % is always at the end of a format. % and E cannot both appear in a format.\n\n  ```\n  decimalFormat(0.125,\"0.00%\");\n  // output: 12.50%\n\n  decimalFormat(0.125, \"#.##%\");\n  // output: 12.5%\n\n  decimalFormat(0.12567,\"#.##%\");\n  // output: 12.57%\n  ```\n\n* Note 4: \"E\" is followed by at least one 0 and 0s only.\n\n  ```\n  decimalFormat(1234567.89,\"0.##E00\");\n  // output: 1.23E06\n\n  decimalFormat(0.0000000000123456789,\"0.000E0\");\n  // output: 1.235E-11\n  ```\n\n* Note 5: The grouping separator may only appear at most once in the parameter *format*. The number of digits between the grouping separator and the decimal point (if the decimal point is used) or the end of the format (if the decimal point is not used) determines the number of digits between grouping separators in the result.\n\n  ```\n  decimalFormat(123456789,\"#,###\");\n  // output: 123,456,789\n\n  decimalFormat(123456789.166,\"#,###.##\");\n  // output: 123,456,789.17\n\n  decimalFormat(123456789.166,\"0,000.00\");\n  // output: 123,456,789.17\n  ```\n\n* Note 6: If we prefer to apply different formats to an object depending on whether it is positive or negative, we can use \";\" to seperate the 2 formats.\n\n  ```\n  decimalFormat(123.456,\"0.00#E00;(0.00#E00)\");\n  // output: 1.235E02\n\n  decimalFormat(-123.456,\"0.00#E00;(0.00#E00)\");\n  // output: (1.235E02)\n  ```\n\n#### Parameters\n\n**X** is a scalar/vector of Integral or Floating type.\n\n**format** is a string indicating the format to apply to *X*.\n\n#### Returns\n\nA scalar or vector of type STRING.\n"
    },
    "decimalMultiply": {
        "url": "https://docs.dolphindb.com/en/Functions/d/decimalMultiply.html",
        "signatures": [
            {
                "full": "decimalMultiply(X, Y, scale)",
                "name": "decimalMultiply",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "scale",
                        "name": "scale"
                    }
                ]
            }
        ],
        "markdown": "### [decimalMultiply](https://docs.dolphindb.com/en/Functions/d/decimalMultiply.html)\n\n\n\n#### Syntax\n\ndecimalMultiply(X, Y, scale)\n\n#### Details\n\nThe function multiplies Decimals. Compared with the [mul](https://docs.dolphindb.com/en/Functions/m/mul.html) function or operator [\\*](https://docs.dolphindb.com/en/Programming/Operators/OperatorReferences/mul.html), the function can set the decimal places of the result with *scale*.\n\nNote: In the following situations, the specified scale does not take effect and the function is equivalent to operator `*`.\n\n* Only one argument is of DECIMAL type (with scale S), and the specified *scale* is not equal to S.\n* *X* and *Y* are both of DECIMAL type (with scale S1 and S2, respectively), and the specified *scale* is smaller than `min(S1, S2)` or greater than `(S1+S2)`.\n* One argument is a floating-point number.\n\nFor the first two situations, the function return a DECIMAL type result, and for the third situation it returns a result of DOUBLE type.\n\n#### Parameters\n\n**X** and **Y** can be scalar or vector, and at least one argument is of DECIMAL type.\n\n**scale** is a non-negative integer indicating the decimal places to be retained in the result.\n\n#### Returns\n\nDECIMAL or DOUBLE type.\n\n#### Examples\n\n```\na = decimal32(`1.235, 3);\nb = decimal32(`7.5689, 4);\nc=decimalMultiply(a, b, 5)\n// output: 9.34759\n\ntypestr(c)\n// output: DECIMAL32\n\ndecimalMultiply(a, b, 2)   // As scale is smaller than min(3,4), the operation is equivalent to a*b.\n// output: 9.3475915\n\nb=float(`7.5689)\nc=decimalMultiply(a, b, 5)   // As b is a floating-point number, the operation is equivalent to a*b and returns a result of DOUBLE type.\n// output: 9.3475916337\ntypestr(c)\n// output: DOUBLE\n```\n\nIf the calculation result of a multiplication operation (`*`) or decimalMultiply overflows, it is automatically converted to type with higher precision. If the conversion fails, an exception will be thrown.\n\n```\nx = decimal32(1\\7, 8)\ny = decimal32(1\\6, 8)\nz = x * y\nz\n// output: 0.0238095223809524\ntypestr z\n// output\nDECIMAL64\n\nz = decimalMultiply(x, y, 8)\nz\n// output: 0.02380952\ntypestr z\n// output: DECIMAL64\n\nx = decimal128(1\\7, 35)\ny = decimal128(1\\6, 35)\nx*y\nx * y => Scale out of bound (valid range: [0, 38], but get: 70)\n\ndecimalMultiply(x, y, 35)\ndecimalMultiply(x, y, 35) => Decimal math overflow\n```\n\nWhen X or Y is a vector:\n\n```\nx = [decimal32(3.213312, 3), decimal32(3.1435332, 3), decimal32(3.54321, 3)]\ny = 2.1\ndecimalMultiply(x, y, 5)\n// output: [6.7473,6.6003,7.440300000000001]\n\nx = [decimal32(3.213312, 3), decimal32(3.1435332, 3), decimal32(3.54321, 3)]\ny = [decimal64(4.312412, 3), decimal64(4.53231, 3), decimal64(4.31258, 3)]\ndecimalMultiply(x, y, 5)\n// output: [13.85445,14.24407,15.27741]\n```\n"
    },
    "declareStreamingSQLTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html",
        "signatures": [
            {
                "full": "declareStreamingSQLTable(table)",
                "name": "declareStreamingSQLTable",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ndeclareStreamingSQLTable(table)\n\n#### Details\n\nDeclare a specified table as the input table of streaming SQL. Only the declared table can be registered for streaming SQL query via `registerStreamingSQL`. This function does not affect the use of the table in regular SQL queries or other features.\n\n#### Parameters\n\n**table** A table object. Currently supports a shared table, including the in-memory table, keyed table and indexed table.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\nregisterStreamingSQL(\"select avg(val) from st\")\n```\n\n**Related functions:** [listStreamingSQLTables](https://docs.dolphindb.com/en/Functions/l/listStreamingSQLTables.html), [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html), [revokeStreamingSQLTable](https://docs.dolphindb.com/en/Functions/r/revokeStreamingSQLTable.html)\n"
    },
    "decodeShortGenomeSeq": {
        "url": "https://docs.dolphindb.com/en/Functions/d/decodeShortGenomeSeq.html",
        "signatures": [
            {
                "full": "decodeShortGenomeSeq(X)",
                "name": "decodeShortGenomeSeq",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [decodeShortGenomeSeq](https://docs.dolphindb.com/en/Functions/d/decodeShortGenomeSeq.html)\n\n#### Syntax\n\ndecodeShortGenomeSeq(X)\n\nAlias: decodeSGS\n\n#### Details\n\nDecode the DNA sequences which have been encoded with `encodeShortGenomeSeg`.\n\n#### Parameters\n\n**X** is an integral scalar/vector.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\na=encodeShortGenomeSeq(\"TCGATCG\")\ndecodeShortGenomeSeq(a)\n// output: \"TCGATCG\"\n\nb=encodeShortGenomeSeq(\"TCGATCG\" \"TCGATCGCCC\")\ndecodeShortGenomeSeq(b)\n// output: [\"TCGATCG\",\"TCGATCGCCC\"]\n    \n// When the input is empty, an empty string is returned.\ndecodeShortGenomeSeq(int(NULL))\n// output: \"\"\n    \n// encodeShortGenomeSeq returns NULL as the input exceeds 28 characters after \"TCGATCG\" is repeated 5 times. As a result, when decoding it, an empty string is returned.\nc=encodeShortGenomeSeq(repeat(\"TCGATCG\" \"TCGAT\", 5))\ndecodeShortGenomeSeq(c)\n// output: [,\"TCGATTCGATTCGATTCGATTCGAT\"]     \n```\n\nRelated functions: [encodeShortGenomeSeq](https://docs.dolphindb.com/en/Functions/e/encodeShortGenomeSeq.html), [genShortGenomeSeq](https://docs.dolphindb.com/en/Functions/g/genShortGenomeSeq.html)\n\n"
    },
    "decompress": {
        "url": "https://docs.dolphindb.com/en/Functions/d/decompress.html",
        "signatures": [
            {
                "full": "decompress(X)",
                "name": "decompress",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [decompress](https://docs.dolphindb.com/en/Functions/d/decompress.html)\n\n\n\n#### Syntax\n\ndecompress(X)\n\n#### Details\n\nDecompress a compressed vector or a table.\n\n#### Parameters\n\n**X** is a compressed vector or a table.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nx=1..100000000\ny=compress(x, \"delta\");\n\ny.typestr();\n// output: HUGE COMPRESSED VECTOR\n\nz=decompress(y);\nz.size();\n// output: 100000000\n```\n\nRelated function: [compress](https://docs.dolphindb.com/en/Functions/c/compress.html)\n"
    },
    "deepCopy": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deepCopy.html",
        "signatures": [
            {
                "full": "deepCopy(obj)",
                "name": "deepCopy",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [deepCopy](https://docs.dolphindb.com/en/Functions/d/deepCopy.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\ndeepCopy(obj)\n\n#### Details\n\nReturns a deep copy of *obj*. A deep copy copies all mutable elements, resulting in a fully independent replica of the original object.\n\nThe difference between `copy` (shallow copy) and `deepCopy` (deep copy) is most evident when dealing with nested structures such as tuples or dictionaries of type ANY:\n\n* `copy` only duplicates the top-level structure, while sub-objects retain shared references (i.e., the sub-object addresses remain unchanged).\n* `deepCopy` recursively copies all sub-objects, ensuring fully independent references.\n\n#### Parameters\n\n**obj**can be of any data type.\n\n#### Returns\n\nAn object with the same data type and form as *obj*.\n\n#### Examples\n\nExample 1. Copy a vector\n\n```\nx = 1 2 3\na = x.copy()\nb = x.deepCopy();\n\nprint constantDesc(x[0]).address  // 000000000dd3d640\nprint constantDesc(a[0]).address  // 000000000cb5a4c0\nprint constantDesc(b[0]).address  // 000000000de92c20\n```\n\nExample 2. Copy a tuple\n\n```\nx = ([[1, 2], [3, 4]], \"a\")\na = x.copy()\nb = x.deepCopy();\n\nprint constantDesc(x[0]).address  // 000000000c7ce880\nprint constantDesc(a[0]).address  // 000000000c7ce880\nprint constantDesc(b[0]).address  // 000000000c89be00\n```\n\nExample 3. Copy an ANY dictionary\n\n```\ny = dict(`A`B`C, (1 2, 3 4, 5 6))\nc = y.copy()\nd = y.deepCopy();\n\nprint constantDesc(y[`A]).address  // 000000000c88c450\nprint constantDesc(c[`A]).address  // 000000000c88c450\nprint constantDesc(d[`A]).address  // 000000000c7cde00\n```\n\nRelated functions: [copy](https://docs.dolphindb.com/en/Functions/c/copy.html), [asis](https://docs.dolphindb.com/en/Functions/a/asis.html)\n"
    },
    "defined": {
        "url": "https://docs.dolphindb.com/en/Functions/d/defined.html",
        "signatures": [
            {
                "full": "defined(names, [type=VAR])",
                "name": "defined",
                "parameters": [
                    {
                        "full": "names",
                        "name": "names"
                    },
                    {
                        "full": "[type=VAR]",
                        "name": "type",
                        "optional": true,
                        "default": "VAR"
                    }
                ]
            }
        ],
        "markdown": "### [defined](https://docs.dolphindb.com/en/Functions/d/defined.html)\n\n\n\n#### Syntax\n\ndefined(names, \\[type=VAR])\n\n#### Details\n\nReturn a scalar/vector indicating whether each element of names is defined.\n\n#### Parameters\n\n**names** is a STRING scalar/vector indicating object name(s).\n\n**type** (optional) can be VAR (variable, default), SHARED (shared variable) or DEF (function definitions).\n\n#### Returns\n\nA BOOL scalar/vector.\n\n#### Examples\n\n```\nx=10\ny=20\ndef f(a){return a+1}\nshare table(1..3 as x, 4..6 as y) as t1;\n\ndefined([\"x\",\"y\",\"f\",`t1]);\n// output: [1,1,0,0]\n\ndefined([\"x\",\"y\",\"f\",`t1], DEF);\n// output: [0,0,1,0]\n\ndefined([\"x\",\"y\",\"f\",`t1], SHARED);\n// output: [0,0,0,1]\n```\n"
    },
    "defs": {
        "url": "https://docs.dolphindb.com/en/Functions/d/defs.html",
        "signatures": [
            {
                "full": "defs([X])",
                "name": "defs",
                "parameters": [
                    {
                        "full": "[X]",
                        "name": "X",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [defs](https://docs.dolphindb.com/en/Functions/d/defs.html)\n\n\n\n#### Syntax\n\ndefs(\\[X])\n\n#### Details\n\n* If *X* is not specified, return all functions in the system as a table.\n* If *X* is specified, return all functions with names consistent with the pattern of *X*.\n\n#### Parameters\n\n**X** is a string. It supports wildcard symbols \"%\" and \"?\". \"%\" means 0, 1 or multiple characters and \"?\" means 1 character.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\ndefs();\n```\n\n| name    | isCommand | userDefined | minParamCount | maxParamCount | syntax      |\n| ------- | --------- | ----------- | ------------- | ------------- | ----------- |\n| !=\\_2   | 0         | 0           | 2             | 2             | (X, Y)      |\n| !\\_1    | 0         | 0           | 1             | 1             | (X)         |\n| $\\_2    | 0         | 0           | 2             | 2             | (obj, type) |\n| %\\_2    | 0         | 0           | 2             | 2             | (X, Y)      |\n| &&\\_2   | 0         | 0           | 2             | 2             | (X, Y)      |\n| &\\_2    | 0         | 0           | 2             | 2             | (X, Y)      |\n| \\*\\*\\_2 | 0         | 0           | 2             | 2             | (X, Y)      |\n| \\*\\_2   | 0         | 0           | 2             | 2             | (X, Y)      |\n| +\\_2    | 0         | 0           | 2             | 2             | (X, Y)      |\n| -\\_1    | 0         | 0           | 1             | 1             | (X)         |\n| ...     |           |             |               |               |             |\n\n```\ntypestr defs();\n// output: IN-MEMORY TABLE;\n\nselect * from defs() where name like \"bit%\";\n```\n\n| name   | isCommand | userDefined | minParamCount | maxParamCount | syntax |\n| ------ | --------- | ----------- | ------------- | ------------- | ------ |\n| bitAnd | 0         | 0           | 2             | 2             | (X, Y) |\n| bitNot | 0         | 0           | 1             | 1             | (X)    |\n| bitOr  | 0         | 0           | 2             | 2             | (X, Y) |\n| bitXor | 0         | 0           | 2             | 2             | (X, Y) |\n\n```\ndefs(\"bit%\");\n```\n\n| name   | isCommand | userDefined | minParamCount | maxParamCount | syntax |\n| ------ | --------- | ----------- | ------------- | ------------- | ------ |\n| bitAnd | 0         | 0           | 2             | 2             | (X, Y) |\n| bitNot | 0         | 0           | 1             | 1             | (X)    |\n| bitOr  | 0         | 0           | 2             | 2             | (X, Y) |\n| bitXor | 0         | 0           | 2             | 2             | (X, Y) |\n\n```\ndefs(\"%sin\");\n```\n\n| name | isCommand | userDefined | minParamCount | maxParamCount | syntax |\n| ---- | --------- | ----------- | ------------- | ------------- | ------ |\n| asin | 0         | 0           | 1             | 1             | (X)    |\n| sin  | 0         | 0           | 1             | 1             | (X)    |\n\n```\ndefs(\"?sin\");\n```\n\n| name | isCommand | userDefined | minParamCount | maxParamCount | syntax |\n| ---- | --------- | ----------- | ------------- | ------------- | ------ |\n| asin | 0         | 0           | 1             | 1             | (X)    |\n"
    },
    "deg2rad": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deg2rad.html",
        "signatures": [
            {
                "full": "deg2rad(X)",
                "name": "deg2rad",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [deg2rad](https://docs.dolphindb.com/en/Functions/d/deg2rad.html)\n\n\n\n#### Syntax\n\ndeg2rad(X)\n\n#### Details\n\nConvert angle units from degrees to radians for each element of *X*.\n\n**Note:** DolphinDB's `deg2rad` function works the same as NumPy's [numpy.deg2rad](https://numpy.org/doc/stable/reference/generated/numpy.deg2rad.html), except that it only accepts a single parameter, *X*, and does not support parameters like *out* or *where* in `numpy.deg2rad`.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\ndeg2rad 45 90 180 360;\n// output: [0.785398,1.570796,3.141593,6.283185]\n```\n"
    },
    "deleteChunkMetaOnMasterById": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteChunkMetaOnMasterById.html",
        "signatures": [
            {
                "full": "deleteChunkMetaOnMasterById(chunkPath, chunkId)",
                "name": "deleteChunkMetaOnMasterById",
                "parameters": [
                    {
                        "full": "chunkPath",
                        "name": "chunkPath"
                    },
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    }
                ]
            }
        ],
        "markdown": "### [deleteChunkMetaOnMasterById](https://docs.dolphindb.com/en/Functions/d/deleteChunkMetaOnMasterById.html)\n\n\n\n#### Syntax\n\ndeleteChunkMetaOnMasterById(chunkPath, chunkId)\n\n#### Details\n\nDelete the metadata of the specified chunk on the control node based on the path and ID. This function can be called to delete the metadata of a chunk when data is unexpectedly lost on a data node. Normally, deleting chunk metadata prevents querying the data, but the data remains on the node, occupying disk space. It can only be executed by an administrator on the control node.\n\n#### Parameters\n\n**chunkPath** is a string indicating the path to the chunk.\n\n**chunkId** is a string indicating the chunk ID.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\n`deleteChunkMetaOnMasterById(chunkPath=\"/olap_value/8/40o\", chunkId=\"11d45d2d-a995-7c97-c041-32362f3400d7\")`\n```\n"
    },
    "deleteGroup": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteGroup.html",
        "signatures": [
            {
                "full": "deleteGroup(groupName)",
                "name": "deleteGroup",
                "parameters": [
                    {
                        "full": "groupName",
                        "name": "groupName"
                    }
                ]
            }
        ],
        "markdown": "### [deleteGroup](https://docs.dolphindb.com/en/Functions/d/deleteGroup.html)\n\n\n\n#### Syntax\n\ndeleteGroup(groupName)\n\n#### Details\n\nDelete a group. It can only be executed by an administrator.\n\n#### Parameters\n\n**groupName** is a string indicating a group name.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ndeleteGroup(`Production);\n```\n"
    },
    "deleteGroupMember": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteGroupMember.html",
        "signatures": [
            {
                "full": "deleteGroupMember(userIds, groupIds)",
                "name": "deleteGroupMember",
                "parameters": [
                    {
                        "full": "userIds",
                        "name": "userIds"
                    },
                    {
                        "full": "groupIds",
                        "name": "groupIds"
                    }
                ]
            }
        ],
        "markdown": "### [deleteGroupMember](https://docs.dolphindb.com/en/Functions/d/deleteGroupMember.html)\n\n\n\n#### Syntax\n\ndeleteGroupMember(userIds, groupIds)\n\n#### Details\n\nRemove a user from a group or multiple groups, or remove multiple users from a group.\n\nIt can only be executed by an administrator.\n\n#### Parameters\n\n**userIds** is a STRING scalar/vector indicating user name(s).\n\n**groupIds** is a STRING scalar/vector indicating group name(s).\n\n*userIds* and *groupIds* cannot both be vectors.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ndeleteGroupMember(`AlexEdwards`ElizabethRoberts, `production);\n```\n"
    },
    "deleteMarketHoliday": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteMarketHoliday.html",
        "signatures": [
            {
                "full": "deleteMarketHoliday(marketName)",
                "name": "deleteMarketHoliday",
                "parameters": [
                    {
                        "full": "marketName",
                        "name": "marketName"
                    }
                ]
            }
        ],
        "markdown": "### [deleteMarketHoliday](https://docs.dolphindb.com/en/Functions/d/deleteMarketHoliday.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\ndeleteMarketHoliday(marketName)\n\n#### Details\n\nDelete an existing trading calendar on the current node.\n\n**Note:**\n\n* This function can only be executed by an administrator.\n\n* It only takes effect on the current node. In a cluster, `pnodeRun` can be used to call this function on all data/compute nodes.\n\n#### Parameters\n\n**marketName** is a STRING scalar, indicating the identifier of the trading calendar to delete, e.g., “XNYS“.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nlistAllMarkets()\n// Output: [\"XTSE\",\"XCSE\",\"XLIM\",\"ADDA\",\"XSTO\",\"XIST\",\"AIXK\",\"SSE\",\"XMIL\",\"XFRA\",\"INE\",\"XMEX\",\"XBUD\",\"XICE\",\"XDUB\",\"SHFE\",\"CMES\",\"XOSL\",\"DCE\",\"CCFX\",\"CFFEX\",\"XIDX\",\"BVMF\",\"XBOG\",\"XKAR\",\"XSAU\",\"XBUE\",\"XTKS\",\"XBSE\",\"XMOS\"...]\n\ndeleteMarketHoliday(\"XTSE\")\n\"XTSE\" in listAllMarkets()\n// Output: false\n```\n\n**Related function: [addMarketHoliday](https://docs.dolphindb.com/en/Functions/a/addMarketHoliday.html)**\n"
    },
    "deleteReplicas": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteReplicas.html",
        "signatures": [
            {
                "full": "deleteReplicas(chunkId, nodeAlias)",
                "name": "deleteReplicas",
                "parameters": [
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    },
                    {
                        "full": "nodeAlias",
                        "name": "nodeAlias"
                    }
                ]
            }
        ],
        "markdown": "### [deleteReplicas](https://docs.dolphindb.com/en/Functions/d/deleteReplicas.html)\n\n\n\n#### Syntax\n\ndeleteReplicas(chunkId, nodeAlias)\n\n#### Details\n\nDelete replicas of one or multiple chunks from a node.\n\nThis command can only be executed by an administrator on a controller node.\n\n#### Parameters\n\n**chunkId** is a STRING scalar/vector indicating ID of chunks.\n\n**nodeAlias** is a string indicating the node alias.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nDelete the replicas of all chunks on \"node1\".\n\n```\nchunkIds=exec chunkId from pnodeRun(getAllChunks) where node=\"node1\"\ndeleteReplicas(chunkIds,\"node1\");\n```\n"
    },
    "deleteRule": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteRule.html",
        "signatures": [
            {
                "full": "deleteRule(engineName, key)",
                "name": "deleteRule",
                "parameters": [
                    {
                        "full": "engineName",
                        "name": "engineName"
                    },
                    {
                        "full": "key",
                        "name": "key"
                    }
                ]
            }
        ],
        "markdown": "### [deleteRule](https://docs.dolphindb.com/en/Functions/d/deleteRule.html)\n\n\n\n#### Syntax\n\ndeleteRule(engineName, key)\n\n#### Details\n\nIf the specified *key*already exists in the rule engine, delete the corresponding rule set. The default rule set cannot be deleted.\n\n#### Parameters\n\n**engineName**is a string indicating the engine name.\n\n**key**is a STRING or INT scalar indicating the key for the rule set to be deleted.\n\n#### Returns\n\nReturns true if successful, otherwise false.\n\n#### Examples\n\n```\nx = [1, 2, NULL]\ny = [ [ < value>1 > ], [ < price<2 >, < price>6 > ], [ < value*price>10 > ] ]\nruleSets = dict(x, y)\nnames = `sym`value`price`quatity\ntypes = [INT, DOUBLE, DOUBLE, DOUBLE]\ndummy = table(10:0, names, types)\noutputNames = `sym`value`price`rule\noutputTypes = [INT, DOUBLE, DOUBLE, BOOL[]]\noutputTable = table(10:0, outputNames, outputTypes)\ntest = createRuleEngine(\"ruleEngineTest\",ruleSets,dummy ,`sym`value`price, outputTable,  \"all\",`sym)\n\ntest.append!(table(1 as sym, 6 as value, 1 as price, 8 as quatity))\n// outputTable: 1\t6\t1\t[true]\n\n// delete the rule set for sym=1 and the default rule set will be applied to sym=1.\ndeleteRule(\"ruleEngineTest\",1)\ntest.append!(table(1 as sym, 6 as value, 1 as price, 8 as quatity))\n// outputTable: 1\t6\t1\t[false]\n```\n"
    },
    "deleteScheduledJob": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteScheduledJob.html",
        "signatures": [
            {
                "full": "deleteScheduledJob(jobId)",
                "name": "deleteScheduledJob",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    }
                ]
            }
        ],
        "markdown": "### [deleteScheduledJob](https://docs.dolphindb.com/en/Functions/d/deleteScheduledJob.html)\n\n\n\n#### Syntax\n\ndeleteScheduledJob(jobId)\n\n#### Details\n\nDelete a scheduled job. If the specified job ID doesn't exist, throw an exception.\n\n#### Parameters\n\n**jobId** is a string indicating a scheduled job ID.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ndeleteScheduledJob(`dailyJob1);\n```\n"
    },
    "deleteSparseReactiveMetric": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteSparseReactiveMetric.html",
        "signatures": [
            {
                "full": "deleteSparseReactiveMetric(name, outputMetricKey)",
                "name": "deleteSparseReactiveMetric",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "outputMetricKey",
                        "name": "outputMetricKey"
                    }
                ]
            }
        ],
        "markdown": "### [deleteSparseReactiveMetric](https://docs.dolphindb.com/en/Functions/d/deleteSparseReactiveMetric.html)\n\n\n\n#### Syntax\n\ndeleteSparseReactiveMetric(name, outputMetricKey)\n\n#### Details\n\nDeletes the rule corresponding to `outputMetricKey` in the specified SparseReactiveStateEngine. If it exists, it is deleted and true is returned; otherwise false is returned.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the SparseReactiveStateEngine.\n\n**outputMetricKey** is a STRING/SYMBOL scalar or vector indicating the output metric name(s) of the rule(s) to be deleted.\n\n#### Returns\n\nReturns a BOOL scalar. It returns true if the rule exists and is deleted; otherwise it returns false.\n\n#### Examples\n\n```\ndeleteSparseReactiveMetric(\"demoengine\", \"A002_2\")\n```\n\n**Related functions**: [createSparseReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createSparseReactiveStateEngine.html), [addSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/a/addSparseReactiveMetrics.html), [getSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/g/getSparseReactiveMetrics.html)\n"
    },
    "deleteUser": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deleteUser.html",
        "signatures": [
            {
                "full": "deleteUser(userId)",
                "name": "deleteUser",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    }
                ]
            }
        ],
        "markdown": "### [deleteUser](https://docs.dolphindb.com/en/Functions/d/deleteUser.html)\n\n\n\n#### Syntax\n\ndeleteUser(userId)\n\n#### Details\n\nDelete a user. It removes the user from all the groups the user belongs to.\n\nIt can only be executed by an administrator.\n\n#### Parameters\n\n**userId** a string indicating a user name.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ndeleteUser(`JohnSmith);\n```\n"
    },
    "deleteDataViewItems": {
        "url": "https://docs.dolphindb.com/en/Functions/d/delete_data_view_items.html",
        "signatures": [
            {
                "full": "deleteDataViewItems(engine, keys)",
                "name": "deleteDataViewItems",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "keys",
                        "name": "keys"
                    }
                ]
            }
        ],
        "markdown": "### [deleteDataViewItems](https://docs.dolphindb.com/en/Functions/d/delete_data_view_items.html)\n\n\n\n#### Syntax\n\ndeleteDataViewItems(engine, keys)\n\n#### Details\n\nDeletes the data with the specified keys from a data view engine. If the key column specified in *keys* does not exist, an error will be raised during deletion.\n\nThe `deleteDataViewItems` functions can be called within a CEP engine context or outside of it.\n\n* Within a CEP engine: The system will first attempt to locate a data view engine handle with specified *engine* within the current CEP engine context. If a matching engine is found, the corresponding delete operation will be performed. If no such engine, the system will then search for a data view engine with the same handle outside of the CEP engine context.\n\n* Outside a CEP engine: The system will search for and perform corresponding operation on a data view engine handle with specified *engine* only from the context outside of any CEP engine.\n\n#### Parameters\n\n**engine** is the handle of a data view engine.\n\n**keys** is a scalar, vector, or tuple, indicating the key(s) to be removed. If the key is composite, a tuple should be provided, where each element represents a column that forms the key, and the order must be consistent with the order specified in *keyedColumns* in the engine.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nclass Monitor1:CEPMonitor{\n    def addNewData(order)\n    def deleteData(s)\n    def Monitor1(){\n    }\n    def onload(){\n        addEventListener(addNewData,\"Orders\",,\"all\")\n        addEventListener(deleteData,\"Drop\",,\"all\")\n        try{\n            share(streamTable(1:0,`eventTime`sym`val0`val1`val2,[TIMESTAMP,SYMBOL,INT,FLOAT,DOUBLE]),'test_DV')\n            createDataViewEngine(\"test_DV\",objByName('test_DV'),`sym,`eventTime,false)\n        }catch(ex){}\n    }\n    def unload(){\n        undef(`test_DV,SHARED)\n    }\n    def addNewData(order){\n        getDataViewEngine('test_DV').append!(table([order.eventTime] as eventTime,[order.sym] as sym,[order.val1] as v1,[order.val2] as v2,[00i] as v3,[00i] as v4,[00i] as v5))\n    }\n    def deleteData(s){\n        deleteDataViewItems('test_DV',s.sym)\n    }\n}\nclass Orders{\n    eventTime :: TIMESTAMP \n    sym :: STRING\n    val0 :: INT\n    val1 :: FLOAT\n    val2 :: DOUBLE\n    def Orders(s,v0,v1,v2){\n        sym = s\n        val0 = v0\n        val1 = v1\n        val2 = v2\n        eventTime = now()\n    }\n}\nclass Drop{\n    sym :: STRING\n    eventTime :: TIMESTAMP\n    def Drop(s){\n        sym = s \n        eventTime = now()\n    }\n}\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\ntry{dropStreamEngine(\"test_CEP\")}catch(ex){}\nengine=createCEPEngine(\"test_CEP\",<Monitor1()>,dummy,[Orders,Drop],,'eventTime',,,\"sym\")\nshare streamTable(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as input\ntry{dropStreamEngine(`serInput)}catch(ex){}\nserializer = streamEventSerializer(name=`serInput, eventSchema=Orders, outputTable=input, eventTimeField = \"eventTime\")\nsubscribeTable(,`input, `subopt1, 0,getStreamEngine('test_CEP'),true)\nappendEvent(`serInput,Orders(`a1,1,1.0,2.0))\n```\n\n**Related functions**: [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [createDataViewEngine](https://docs.dolphindb.com/en/Functions/c/create_data_view_engine.html), [dropDataViewEngine](https://docs.dolphindb.com/en/Functions/d/drop_data_view_engine.html), [getDataViewEngine](https://docs.dolphindb.com/en/Functions/g/get_data_view_engine.html)\n"
    },
    "deltas": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deltas.html",
        "signatures": [
            {
                "full": "deltas(X, [n])",
                "name": "deltas",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[n]",
                        "name": "n",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [deltas](https://docs.dolphindb.com/en/Functions/d/deltas.html)\n\n\n\n#### Syntax\n\ndeltas(X, \\[n])\n\n#### Details\n\nFor each element *Xi* in *X*, return *Xi*-*Xi-n*, representing the differences between elements.\n\n#### Parameters\n\n**X** is a vector, matrix or table.\n\n**n** (optional) is an integer specifying the step to shift when comparing elements in *X*. The default value is 1, meaning to compare the current element with the adjacent element at left.\n\n#### Returns\n\nA vector/matrix/table with the same shape as *X*.\n\n#### Examples\n\n```\nx=7 4 5 8 9;\ndeltas(x);\n// output: [,-3,1,3,1] \n\nx=NULL 1 2 NULL 3;\ndeltas(x);\n// output: [,,1,,]\n\nm=matrix(1 3 2 5 6, 0 8 NULL 7 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 0  |\n| 3  | 8  |\n| 2  |    |\n| 5  | 7  |\n| 6  | 6  |\n\n```\ndeltas(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n| 2  | 8  |\n| -1 |    |\n| 3  |    |\n| 1  | -1 |\n\nWhen *n* is a positive integer:\n\n```\nm=matrix(1 3 2 5 6, 0 8 NULL 7 6);\na=deltas(m,2)\na;\n```\n\n| 0 | 1  |\n| - | -- |\n|   |    |\n|   |    |\n| 1 |    |\n| 2 | -1 |\n| 4 |    |\n\nWhen n is a negative integer:\n\n```\nm = 3 4 6 9\nr2= deltas(m,-2)\nr2; \n// output: [-3,-5,,]\n```\n"
    },
    "dema": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dema.html",
        "signatures": [
            {
                "full": "dema(X, window)",
                "name": "dema",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [dema](https://docs.dolphindb.com/en/Functions/d/dema.html)\n\n\n\n#### Syntax\n\ndema(X, window)\n\nPlease see [TA-Lib Functions](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameter description and windowing logic.\n\n#### Details\n\nCalculates the Double Exponential Moving Average (dema) for *X* in a sliding window of the given length.\n\nThe formula is:\n\n![](https://docs.dolphindb.com/en/images/ema1.png)\n\n![](https://docs.dolphindb.com/en/images/dema.png)\n\n**Note:**\n\nEquivalent to TA-Lib's `DEMA` function. The difference is that DolphinDB `dema` accepts vectors, matrices, and tables as input, whereas TA-Lib `DEMA` is primarily designed for one-dimensional NumPy arrays and does not support matrix or table inputs.\n\n#### Returns\n\nA vector with the same length as *X* or a matrix/table with the same dimensions as *X*.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\ndema(x,3);\n// output: [,,,,12.091666666666668,11.689583333333335,11.266666666666665]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\ndema(x,3);\n```\n\n| col1    | col2    |\n| ------- | ------- |\n|         |         |\n|         |         |\n|         |         |\n|         |         |\n| 12.0917 | 20.9444 |\n| 11.6896 | 14.6806 |\n| 11.2667 | 10.9444 |\n\nRelated functions: [ema](https://docs.dolphindb.com/en/Functions/e/ema.html), [tema](https://docs.dolphindb.com/en/Functions/t/tema.html)\n"
    },
    "demean": {
        "url": "https://docs.dolphindb.com/en/Functions/d/demean.html",
        "signatures": [
            {
                "full": "demean(X)",
                "name": "demean",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [demean](https://docs.dolphindb.com/en/Functions/d/demean.html)\n\n#### Syntax\n\ndemean(X)\n\n#### Details\n\nCenter a dataset (zero-centering), and return an object of DOUBLE type with the same dimension as *X*. Null values are ignored in the calculation.\n\n* If *X* is a vector, calculate X - avg(X);\n\n* If *X* is a matrix, perform calculations by columns;\n\n* If *X* is a table, perform calculations only for numeric columns.\n\n#### Parameters\n\n`X` is a numeric scalar/vector/matrix/table.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nx = 1 NULL 2 3\ndemean(x)\n// output: [-1,,0,1]\n\nv = 1 0 1 1 8 2 -4 0\ndemean(v)\n// output: [-0.125,-1.125,-0.125,-0.125,6.875,0.875,-5.125,-1.125]\n```\n\n"
    },
    "denseRank": {
        "url": "https://docs.dolphindb.com/en/Functions/d/denseRank.html",
        "signatures": [
            {
                "full": "denseRank(X, [ascending=true],[ignoreNA=true], [percent=false])",
                "name": "denseRank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [denseRank](https://docs.dolphindb.com/en/Functions/d/denseRank.html)\n\n\n\n#### Syntax\n\ndenseRank(X, \\[ascending=true],\\[ignoreNA=true], \\[percent=false])\n\n#### Details\n\nIf *X* is a vector:\n\n* return the consecutive rank of each element in *X* based on the specified *ascending* order.\n\n* If *ignoreNA* = true, the null values are ignored in ranking and return NULL.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.\n\nIf *X* is a dictionary, the ranking is based on its values, and the ranks of all elements are returned.\n\nUnlike `denseRank`, [rank](https://docs.dolphindb.com/en/Functions/r/rank.html) skips positions after equal rankings.\n\n#### Parameters\n\n**X** is a vector/matrix/dictionary.\n\n**ascending** (optional) is a Boolean value indicating whether to sort in ascending order. The default value is true.\n\n**ignoreNA** (optional) is a Boolean value indicating whether null values are ignored in ranking. The default value is true. If set to false, null values are ranked as the minimum value.\n\n**percent** (optional) is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n#### Examples\n\n```\nx=1 5 5 6 8 8 9\nprint denseRank(x)\n// output: [0,1,1,2,3,3,4]\n\ny=time(4 1 1 2)\nprint denseRank(y, ascending=false)\n// output: [0,2,2,1]\nm = matrix(1 2 2 NULL, 0 0 0 1, 0 0 NULL 2)\ndenseRank(m, ignoreNA=false)\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 0  | 1  |\n| 2  | 0  | 1  |\n| 2  | 0  | 0  |\n| 0  | 1  | 2  |\n\n```\nt=table(`A`A`B`C`B`B`A`C`C as id,[4,1,NULL,1,2,4,5,0,-1] as val)\nselect id,val, denseRank(val) from t context by id\n```\n\n| id | val | denseRank\\_val |\n| -- | --- | -------------- |\n| A  | 4   | 1              |\n| A  | 1   | 0              |\n| A  | 5   | 2              |\n| B  |     |                |\n| B  | 2   | 0              |\n| B  | 4   | 1              |\n| C  | 1   | 2              |\n| C  | 0   | 1              |\n| C  | -1  | 0              |\n\n```\ndenseRank(dict(`a`b`c`d, [4, 1, 1,2],true))\n// output: [2,0,0,1]\n```\n\nRelated function: [rowDenseRank](https://docs.dolphindb.com/en/Functions/r/rowDenseRank.html)\n"
    },
    "deny": {
        "url": "https://docs.dolphindb.com/en/Functions/d/deny.html",
        "signatures": [
            {
                "full": "deny(userId|groupId,accessType,[objs])",
                "name": "deny",
                "parameters": [
                    {
                        "full": "userId|groupId",
                        "name": "userId|groupId"
                    },
                    {
                        "full": "accessType",
                        "name": "accessType"
                    },
                    {
                        "full": "[objs]",
                        "name": "objs",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [deny](https://docs.dolphindb.com/en/Functions/d/deny.html)\n\n\n\n#### Syntax\n\ndeny(userId|groupId,accessType,\\[objs])\n\n#### Details\n\nDeny specified access privileges to a user or a group.\n\nAdministrators can grant users all privileges (*accessType*) through this command, but regular users, after having the relevant OWNER privileges, can only grant the following privileges through this command: TABLE\\_READ, TABLE\\_WRITE, TABLE\\_INSERT, TABLE\\_UPDATE, TABLE\\_DELETE, DB\\_READ, DB\\_WRITE, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE, DBOBJ\\_DELETE, DBOBJ\\_CREATE and VIEW\\_EXEC.\n\nFor the types of permissions that can be denied, see [grant](https://docs.dolphindb.com/en/Functions/g/grant.html). Orca graph and stream table privileges: See Section 6.3 at [Orca Real-time Computing Platform](https://docs.dolphindb.com/en/Streaming/orca.md#).\n\nNote that when *accessType* is DB\\_OWNER, `deny` only takes effect globally.\n\n#### Parameters\n\n**userId** | **groupId** is a string indicating a user name or a group name.\n\n**accessType** is the privilege type or memory limit.\n\n**objs** (optional) is a STRING scalar/vector indicating the objects that the priviledges specified by *accessType* applies to. \"\\*\" means all objects. When *accessType* is COMPUTE\\_GROUP\\_EXEC, *objs* must be compute group(s).\n\nSee the privilege table in [User Access Control](https://docs.dolphindb.com/en/Maintenance/UserAccessControl.html) for the values that *accessType* and *objs* can take.\n\n**Note:**\n\n* When managing privileges for shared tables, stream tables or streaming engines, *objs* must be in the format \"tableName\\@nodeAlias\" or \"nodeAlias:tableName\".\n* When managing privileges for IMOLTP databases and tables, *objs* must be in the format \"oltp\\://database/table\\@nodeAlias\" or \"oltp\\://database\\@nodeAlias\".\n\n#### Returns\n\nNone.\n\n#### Examples\n\nNone of the members of the group \"production\" can read any table in the database *dfs\\://db1*:\n\n```\ndeny(`production, TABLE_READ, \"dfs://db1\")\n```\n\nNone of the members of the group \"research\" can write to the table *dfs\\://db1/t1*:\n\n```\ndeny(`research, TABLE_WRITE, \"dfs://db1/t1\")\n```\n\nNone of the members of the group \"research\" can create tables in the databases *dfs\\://db1* or *dfs\\://db2*:\n\n```\ndeny(\"research\", DBOBJ_CREATE, [\"dfs://db1\",\"dfs://db2\"])\n```\n\nThe user \"AlexSmith\" cannot create or delete databases:\n\n```\ndeny(\"AlexSmith\", DB_MANAGE)\n```\n\nThe user \"AlexSmith\" cannot execute script:\n\n```\ndeny(\"AlexSmith\", SCRIPT_EXEC)\n```\n\nThe user \"AlexSmith\" cannot test script:\n\n```\ndeny(\"AlexSmith\", TEST_EXEC)\n```\n"
    },
    "derivative": {
        "url": "https://docs.dolphindb.com/en/Functions/d/derivative.html",
        "signatures": [
            {
                "full": "derivative(func, X, [dx =1.0], [n=1], [order=3])",
                "name": "derivative",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[dx =1.0]",
                        "name": "[dx =1.0]"
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[order=3]",
                        "name": "order",
                        "optional": true,
                        "default": "3"
                    }
                ]
            }
        ],
        "markdown": "### [derivative](https://docs.dolphindb.com/en/Functions/d/derivative.html)\n\n\n\n#### Syntax\n\nderivative(func, X, \\[dx =1.0], \\[n=1], \\[order=3])\n\n#### Details\n\nReturn the derivative of *func* of order *n* at *X*.\n\n#### Parameters\n\n**func** is a unary function.\n\n**X** is a numeric scalar/vector indicating where the derivative is evaluated.\n\n**dx** (optional) is a scalar of FLOAT type indicating spacing. The default value is 1.0.\n\n**n** (optional) is an integer scalar indicating the order of the derivative. As of now only *n*=1 is supported.\n\n**order** (optional) is an integer scalar indicating the number of points to use. It must be an odd number. The default value is 3 and can be values between 3 and 1023.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\nderivative(acos, 0.458, 1e-3);\n// output: -1.12492\n\na=[0.25, -4.53, 1.85, 12.45, 2.0];\nderivative(cbrt, a, 1e-3, 1, 5);\n// output: [0.83995,0.121753,0.221189,0.062053,0.209987]\n\nderivative(pow{3,}, 5);\n// output: 324\n```\n"
    },
    "destroyMonitor": {
        "url": "https://docs.dolphindb.com/en/Functions/d/destroy_monitor.html",
        "signatures": [
            {
                "full": "destroyMonitor()",
                "name": "destroyMonitor",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [destroyMonitor](https://docs.dolphindb.com/en/Functions/d/destroy_monitor.html)\n\n\n\n#### Syntax\n\ndestroyMonitor()\n\n#### Details\n\nTerminates monitor instances.\n\nWhen a spawned monitor instance terminates, the engine invokes the monitor's `onDestroy` function, if it is defined.\n\nAfter terminating the monitor instance, the event listeners defined within that instance will cease to be triggered. It will not be removed until the next event match processing cycle starts. Note that monitors injected into the CEP Engine cannot be destroyed until the engine is deleted.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nclass Monitor1:CEPMonitor{\n    def addNewData(order)\n    //def updateData(change)\n    def Monitor1(){\n    }\n    def myDestroyMonitor(Orders){\n        destroyMonitor()\n    }\n    def onload(){\n        addEventListener(addNewData,\"Orders\",,\"all\")\n        // When the Orders event has a v1 value of 5.0, this listener is triggered once,\n        // and the myDestroyMonitor method is called to destroy the current monitor instance.\n        addEventListener(handler=myDestroyMonitor, eventType=\"Orders\", condition=<Orders.v1=5.0>, times=1)\n        try{\n            share(streamTable(1:0,`eventTime`sym`val0`val1`val2,[TIMESTAMP,SYMBOL,INT,FLOAT,DOUBLE]),'test_DV')\n            createDataViewEngine(\"test_DV\",objByName('test_DV'),`sym,`eventTime,false)\n        }catch(ex){}\n    }\n    def unload(){\n        undef(`test_DV,SHARED)\n    }\n    def addNewData(order){\n        getDataViewEngine('test_DV').append!(table([order.eventTime] as eventTime,[order.sym] as sym,[order.val1] as v1,[order.val2] as v2,[00i] as v3,[00i] as v4,[00i] as v5))\n    }\n\n}\nclass Orders{\n    eventTime :: TIMESTAMP \n    sym :: STRING\n    val0 :: INT\n    val1 :: FLOAT\n    val2 :: DOUBLE\n    def Orders(s,v0,v1,v2){\n        sym = s\n        val0 = v0\n        val1 = v1\n        val2 = v2\n        eventTime = now()\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\ntry{dropStreamEngine(\"test_CEP\")}catch(ex){}\nengine=createCEPEngine(\"test_CEP\",<Monitor1()>,dummy,Orders,,'eventTime',,,\"sym\")\nshare streamTable(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as input\ntry{dropStreamEngine(`serInput)}catch(ex){}\nserializer = streamEventSerializer(name=`serInput, eventSchema=Orders, outputTable=input, eventTimeField = \"eventTime\")\nsubscribeTable(,`input, `subopt1, 0,getStreamEngine('test_CEP'),true)\n```\n"
    },
    "det": {
        "url": "https://docs.dolphindb.com/en/Functions/d/det.html",
        "signatures": [
            {
                "full": "det(X)",
                "name": "det",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [det](https://docs.dolphindb.com/en/Functions/d/det.html)\n\n\n\n#### Syntax\n\ndet(X)\n\n#### Details\n\nReturn the determinant of matrix *X*. Null values are replaced with 0 in the calculation.\n\nDolphinDB’s `det` function and NumPy’s `numpy.linalg.det` have the same core functionality, but differ in parameter design and handling of missing values.\n\n* DolphinDB’s `det` requires the input to be a matrix object, whereas `numpy.linalg.det` accepts array-like inputs and automatically converts them to `ndarray`.\n* In terms of missing value handling, DolphinDB’s `det` treats NULL values as 0, while `numpy.linalg.det` returns NaN or Inf when the input contains NaN or Inf values. See the examples below for details.\n\n#### Parameters\n\n**X** is a matrix.\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\n```\nx=1..4$2:2;\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 2  | 4  |\n\n```\nx.det();\n// output: -2\n\nx=1 2 3 6 5 4 8 7 0$3:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 6  | 8  |\n| 2  | 5  | 7  |\n| 3  | 4  | 0  |\n\n```\ndet(x);\n// output: 42\n\nx=1 2 3 6 5 4 8 7 NULL $3:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 6  | 8  |\n| 2  | 5  | 7  |\n| 3  | 4  |    |\n\n```\ndet(x);\n// output: 42\n```\n\nThe following code is executed in Python and demonstrates how NumPy’s `numpy.linalg.det` handles NaN and Inf values.\n\n```\nimport numpy as np\n\nA = np.array([\n    [1, 6, 8],\n    [2, 5, 7],\n    [3, 4, np.nan]\n])\n\nprint(np.isnan(np.linalg.det(A)))\n# Return: True\n\nB = np.array([\n    [1, 6, 8],\n    [2, 5, 7],\n    [3, 4, np.inf]\n])\nprint(np.isnan(np.linalg.det(B)))\n\n# Retur True\n```\n"
    },
    "diag": {
        "url": "https://docs.dolphindb.com/en/Functions/d/diag.html",
        "signatures": [
            {
                "full": "diag(X)",
                "name": "diag",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [diag](https://docs.dolphindb.com/en/Functions/d/diag.html)\n\n\n\n#### Syntax\n\ndiag(X)\n\n#### Details\n\n* If *X* is a vector, return a diagonal matrix.\n* If *X* is a square matrix, return a vector with the diagonal elements of the matrix.\n\nDolphinDB’s `diag` function and NumPy’s `numpy.diag` function are similar in their core functionality, but differ in parameter design, functional scope, and handling of missing values.\n\n* DolphinDB’s `diag` function accepts only a single argument, does not support diagonal offsets, operates only on the main diagonal, and requires the input to be either a vector or a square matrix.\n* `numpy.diag` supports an optional offset parameter, allowing extraction or construction of arbitrary diagonals, and accepts one-dimensional or two-dimensional arrays as input.\n* In terms of missing value handling, DolphinDB’s `diag` treats NULL values as 0, whereas `numpy.diag` preserves NaN/Inf values as-is.\n\n#### Parameters\n\n**X** is a numeric vector or a square matrix.\n\n#### Examples\n\n```\ndiag(1..5);\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 0  | 0  | 0  | 0  |\n| 0  | 2  | 0  | 0  | 0  |\n| 0  | 0  | 3  | 0  | 0  |\n| 0  | 0  | 0  | 4  | 0  |\n| 0  | 0  | 0  | 0  | 5  |\n\n```\nm=1..4$2:2;\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 2  | 4  |\n\n```\ndiag(m);\n// output: [1,4]\n```\n"
    },
    "dict": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dict.html",
        "signatures": [
            {
                "full": "dict(keyObj, valueObj, [ordered=false])",
                "name": "dict",
                "parameters": [
                    {
                        "full": "keyObj",
                        "name": "keyObj"
                    },
                    {
                        "full": "valueObj",
                        "name": "valueObj"
                    },
                    {
                        "full": "[ordered=false]",
                        "name": "ordered",
                        "optional": true,
                        "default": "false"
                    }
                ]
            },
            {
                "full": "dict(keyType, valueType, [ordered=false])",
                "name": "dict",
                "parameters": [
                    {
                        "full": "keyType",
                        "name": "keyType"
                    },
                    {
                        "full": "valueType",
                        "name": "valueType"
                    },
                    {
                        "full": "[ordered=false]",
                        "name": "ordered",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [dict](https://docs.dolphindb.com/en/Functions/d/dict.html)\n\n\n\n#### Syntax\n\ndict(keyObj, valueObj, \\[ordered=false])\n\nor\n\ndict(keyType, valueType, \\[ordered=false])\n\n#### Details\n\nReturn a dictionary object.\n\n#### Parameters\n\nFor the first usage:\n\n**keyObj** is a vector indicating dictionary keys.\n\n**valueObj** is a vector indicating dictionary values.\n\nFor the second usage:\n\n**keyType** is the data type of dictionary keys. The following data categories are supported: Integral (excluding COMPRESSED), Temporal, Floating and Literal.\n\n**valueType** is the data type of dictionary values. Note that COMPLEX/POINT/DECIMAL is not supported.\n\n**ordered** (optional) is a Boolean value. The default value is false, which indicates to create a regular dictionary. True means to create an ordered dictionary. The regular dictionaries do not track the insertion order of the key-value pairs whereas the ordered dictionaries preserve the insertion order of key-value pairs.\n\n#### Examples\n\n```\nx=1 2 3\ny=4.5 7.8 4.3\nz=dict(x,y);\nz;\n/* output\n3->4.3\n1->4.5\n2->7.8\n*/\n\nz=dict(INT,DOUBLE);\nz[5]=7.9;\nz;\n// output: 5->7.9\n\nz[3]=6;\nz;\n/* output\n3->6\n5->7.9\n*/\n\ndt=dict([`test], [1]);\ndt;\n// output: test->1\n\n//create an ordered dictionary\nz=dict(x,y,true)\nz;\n/* ouput\n1->4.5\n2->7.8\n3->4.3\n*/\n\n// y is a vector of DECIMAL32 type. Create an ordered dictionary z with y as values.\nx=1 3 2\ny = decimal32\\(1.23 3 3.14, 3\\)\nz=dict\\(x,y,true\\);\nz;\n/\\* output\n1-&gt;1.230\n3-&gt;3.000\n2-&gt;3.140\n*/\n```\n\nTo get keys and values of a dictionary:\n\n```\nx=1 2 3\ny=4.5 7.8 4.3\nz=dict(x,y);\n\nz.keys();\n// output: [3,1,2]\n\nz.values();\n// output: [4.3,4.5,7.8]\n```\n\nrelated system functions: [array](https://docs.dolphindb.com/en/Functions/a/array.html), [matrix](https://docs.dolphindb.com/en/Functions/m/matrix.html), [dictUpdate!](https://docs.dolphindb.com/en/Functions/d/dictUpdate!.html), [syncDict](https://docs.dolphindb.com/en/Functions/s/syncDict.html)\n"
    },
    "dictUpdate!": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dictUpdate!.html",
        "signatures": [
            {
                "full": "dictUpdate!(dictionary, function, keys, parameters, [initFunc=copy])",
                "name": "dictUpdate!",
                "parameters": [
                    {
                        "full": "dictionary",
                        "name": "dictionary"
                    },
                    {
                        "full": "function",
                        "name": "function"
                    },
                    {
                        "full": "keys",
                        "name": "keys"
                    },
                    {
                        "full": "parameters",
                        "name": "parameters"
                    },
                    {
                        "full": "[initFunc=copy]",
                        "name": "initFunc",
                        "optional": true,
                        "default": "copy"
                    }
                ]
            }
        ],
        "markdown": "### [dictUpdate!](https://docs.dolphindb.com/en/Functions/d/dictUpdate!.html)\n\n\n\n#### Syntax\n\ndictUpdate!(dictionary, function, keys, parameters, \\[initFunc=copy])\n\n#### Details\n\nUpdate a dictionary for specified keys with the specified function.\n\n#### Parameters\n\n**dictionary** is a dictionary object.\n\n**function** is a function object.\n\n**keys** is a scalar/vector indicating for which keys to apply the *function*.\n\n**parameters** are of the same size as *keys*. The arguments passed to the applied function are *parameters* and the initial values of the dictionary.\n\n**initFunc** (optional) is a unary function. If the update operation involves new keys that did not exist in the dictionary to be updated, execute *initFunc* for these keys. If *initFunc* is specified, the values of *dictionary* must be a tuple.\n\n#### Returns\n\nAn updated table.\n\n#### Examples\n\n```\nx=dict(1 2 3, 1 1 1);\nx;\n/* output\n3->1\n1->1\n2->1\n*/\n\ndictUpdate!(x, add, 2 3, 1 2);\n/* output\n3->3\n1->1\n2->2\n*/\n\nx.dictUpdate!(mul, 3 4, 2 4);\n/* output\n4->4\n3->6\n1->1\n2->2\n*/\n\nd = dict(`IBM`MSFT, [1 2, 3 4])\nmsg = table(`IBM`MSFT`GOOG as symbol, 2 3 2 as ap)\nd.dictUpdate!(append!, msg.symbol, msg.ap, x->array(x.type(), 0, 512).append!(x))\nd;\n/* output\nMSFT->[3,4,3]\nGOOG->[2]\nIBM->[1,2,2]\n*/\n```\n"
    },
    "difference": {
        "url": "https://docs.dolphindb.com/en/Functions/d/difference.html",
        "signatures": [
            {
                "full": "difference(X)",
                "name": "difference",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [difference](https://docs.dolphindb.com/en/Functions/d/difference.html)\n\n\n\n#### Syntax\n\ndifference(X)\n\n#### Details\n\nReturn the last element minus the first element of a vector. If *X* is a scalar, it returns 0.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\n```\ndifference(2 4 2);\n// output: 0\n\ndifference(12.3 15.6 17.8);\n// output: 5.5\n\ndifference(278);\n// output: 0\n```\n"
    },
    "differentialEvolution": {
        "url": "https://docs.dolphindb.com/en/Functions/d/differentialEvolution.html",
        "signatures": [
            {
                "full": "differentialEvolution(func, bounds, [X0], [maxIter=1000], [popSize=15], [mutation], [recombination=0.7], [tol=0.01], [atol=0], [polish=true], [seed])",
                "name": "differentialEvolution",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "bounds",
                        "name": "bounds"
                    },
                    {
                        "full": "[X0]",
                        "name": "X0",
                        "optional": true
                    },
                    {
                        "full": "[maxIter=1000]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[popSize=15]",
                        "name": "popSize",
                        "optional": true,
                        "default": "15"
                    },
                    {
                        "full": "[mutation]",
                        "name": "mutation",
                        "optional": true
                    },
                    {
                        "full": "[recombination=0.7]",
                        "name": "recombination",
                        "optional": true,
                        "default": "0.7"
                    },
                    {
                        "full": "[tol=0.01]",
                        "name": "tol",
                        "optional": true,
                        "default": "0.01"
                    },
                    {
                        "full": "[atol=0]",
                        "name": "atol",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[polish=true]",
                        "name": "polish",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[seed]",
                        "name": "seed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [differentialEvolution](https://docs.dolphindb.com/en/Functions/d/differentialEvolution.html)\n\n\n\n#### Syntax\n\ndifferentialEvolution(func, bounds, \\[X0], \\[maxIter=1000], \\[popSize=15], \\[mutation], \\[recombination=0.7], \\[tol=0.01], \\[atol=0], \\[polish=true], \\[seed])\n\n#### Details\n\nUse the Differential Evolution algorithm to calculate the global minimum of a function with multiple variables.\n\n#### Parameters\n\n**func** is the objective function to be minimized. Note that the function must return a scalar.\n\n**bounds** is a numeric matrix of shape (N, 2) indicating the bounds for parameters, where N is the number of parameters to be optimized.\n\n**X0** (optional) is a numeric vector indicating the initial guess to the minimization.\n\n**Note**:\n\n* Each row in the *bound* parameter contains two values (min, max), which define the lower and upper limits for the parameter values specified by *X0*.\n* *X0* and *bounds* must have the same length, i.e., N = size(*X0*).\n\n**maxIter** (optional) is a non-negative integer indicating the maximum number of iterations. The default value is 1000.\n\n**popSize** (optional) is a positive integer specifying the multiplier for setting the total population size. The population contains `popSize*(N - N_equal)` individuals, where `N_equal` represents the number of parameters whose bounds are equal. The default value is 15.\n\n**mutation** (optional) is a numeric pair in the format of (min, max), indicating the range of the mutation constant. It should satisfy 0 <= min <= max < 2. The default value is (0.5, 1).\n\n**recombination** (optional) is a numeric scalar in \\[0, 1], indicating the recombination constant, also known as the crossover probability.\n\n**tol** (optional) is a non-negative floating-point scalar indicating the relative tolerance for convergence. The default value is 0.01.\n\n**atol** (optional) is a non-negative floating-point scalar indicating the absolute tolerance for convergence. The default value is 0. The algorithm terminates when `stdev(population_energies) <= atol + tol * abs(mean(population_energies))`, where `population_energies` is the vector consisting of objective function values for all individuals in the population.\n\n**polish** (optional) is a Boolean scalar indicating whether to polish the differential evolution result using the L-BFGS-B method. The default value is true.\n\n**seed** (optional) is an integer indicating the random seed used in the differential evolution algorithm, allowing users to reproduce the results. If unspecified (default), a non-deterministic random number generator is used.\n\n#### Returns\n\nA dictionary containing the following keys:\n\n* xopt: A floating-point vector indicating the parameter values that minimize the objective function.\n* fopt: A floating-point scalar indicating the minimum value of the objective function, where fopt = f(xopt).\n* iterations: An integer indicating the number of iterations during the optimization process.\n* fcalls: An integer indicating the number of times the objective function is called during the optimization process.\n* converged: A Boolean scalar indicating whether the optimization result is converged.\n  * true: The optimization result has been converged to below a preset tolerance and the algorithm terminates.\n  * false: The algorithm terminates without converging after reaching the maximum number of iterations.\n\n#### Examples\n\nThe following example creates a user-defined function `rosen` and uses `differentialEvolution` (with *bounds* specified) to calculate the global minimum of `rosen`.\n\n```\ndef rosen(x) { \n\tN = size(x);\n\treturn sum(100.0*power(x[1:]-power(x[:N-1], 2.0), 2.0)+power(1-x[:N-1], 2.0));\n}\nbounds = matrix([0 0 0 0 0, 2 2 2 2 2])\ndifferentialEvolution(rosen, bounds)\n\n/* Ouput:\nfcalls->43656\nxopt->[1.000000000000,1.000000000000,1.000000000000,1.000000000000,1.000000000000]\nfopt->0.0\niterations->581\nconverged->true\n*/\n```\n"
    },
    "digitize": {
        "url": "https://docs.dolphindb.com/en/Functions/d/digitize.html",
        "signatures": [
            {
                "full": "digitize(x, bins, [right=false])",
                "name": "digitize",
                "parameters": [
                    {
                        "full": "x",
                        "name": "x"
                    },
                    {
                        "full": "bins",
                        "name": "bins"
                    },
                    {
                        "full": "[right=false]",
                        "name": "right",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [digitize](https://docs.dolphindb.com/en/Functions/d/digitize.html)\n\n#### Syntax\n\ndigitize(x, bins, \\[right=false])\n\n#### Details\n\nReturn the indices of the bins to which each value in *x* belongs. The return value has the same data form as *x*.\n\n| *right* | order of *bins* | returned index *i* satisfies |\n| ------- | --------------- | ---------------------------- |\n| false   | increasing      | bins\\[i-1] <= x < bins\\[i]   |\n| true    | increasing      | bins\\[i-1] < x <= bins\\[i]   |\n| false   | decreasing      | bins\\[i-1] > x >= bins\\[i]   |\n| true    | decreasing      | bins\\[i-1] >= x > bins\\[i]   |\n\nIf values in *x* are beyond the bounds of *bins*, 0 (for values beyond left bound) or length of *bins*(for values beyond right bound) is returned.\n\nThis function serves the same functionality as numpy.digitize.\n\nDifference from Python’s `numpy.digitize`: DolphinDB’s `digitize` has the same core functionality as `numpy.digitize`, and *bins* can be increasing or decreasing. In DolphinDB, *x* supports scalar or vector inputs. In NumPy, *x* can be an array of any shape, and the return value is an ndarray of the same shape.\n\n#### Parameters\n\n**x**is a scalar or vector of floating-point, integral, or DECIMAL type, indicating the value to be binned.\n\n**bins** is a monotonically increasing or decreasing vector of floating-point, integral, or DECIMAL type, indicating the bins.\n\n**right** (optional) is a Boolean value indicating whether the intervals include the right or the left bin edge. Default behavior is*right*=false indicating that the interval includes the left edge.\n\n#### Examples\n\nWhen *x* is a scalar:\n\n```\nbins = [1,3,3,5,5]\n\n// returns index i that satisfies bins[i-1] <= 3 < bins[i]\ndigitize(3, bins=bins, right=false)\n// output: 3\n\n//returns index i that satisfies bins[i-1] <= 5 < bins[i]. Since bins[i] > 5 does not exist, size(bins) is returned.\ndigitize(5, bins=bins, right=false)\n//output: 5\n\n// returns index i that satisfies bins[i-1] < 5 <= bins[i].\ndigitize(5, bins=bins, right=true)\n//output: 3\n\nbins = reverse(bins)\ndigitize(5, bins=bins, right=false)\n//output: 0\n\ndigitize(5, bins=bins, right=true)\n//output: 2\n```\n\nWhen *x* is a vector:\n\n```\nx = [-1,0,1,2,3,4,5,6]\nbins = [1,3,5]\ndigitize(x=x, bins=bins, right=false)\n//output: [0,0,1,1,2,2,3,3]\n\ndigitize(x=x, bins=bins, right=true)\n//output: [0,0,0,1,1,2,2,3]\n\nbins = reverse(bins)\ndigitize(x=x, bins=bins, right=false)\n//output: [3,3,2,2,1,1,0,0]\n\ndigitize(x=x, bins=bins, right=true)\n//output: [3,3,3,2,2,1,1,0]\n```\n\nThe following example demonstrates the difference between `digitize` and `bucket`.\n\nFor function `bucket`, if the number of elements of the input vector that belong to *dataRange*(\"\\[12, 53)\" in this case) is not a multiple of *bucketNum*(\\*\"\\*2\" in this case), an error will be thrown. The `digitize` function, however, is more flexible in customizing *bins*.\n\n```\nbucket(9 23 54 36 46 12, 12:53, 2)\n//throw an error: dataRange must be the mutltiplier of bucketNum.\n\ndigitize(9 23 54 36 46 12 , 12 40 53)\n// output: [0,1,3,1,2,1]\n```\n\n"
    },
    "disableActivePartition": {
        "url": "https://docs.dolphindb.com/en/Functions/d/disableActivePartition.html",
        "signatures": [
            {
                "full": "disableActivePartition(dbHandle)",
                "name": "disableActivePartition",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    }
                ]
            }
        ],
        "markdown": "### [disableActivePartition](https://docs.dolphindb.com/en/Functions/d/disableActivePartition.html)\n\n\n\n#### Syntax\n\ndisableActivePartition(dbHandle)\n\n#### Details\n\nCancel the connection between the active database and the historical database.\n\n#### Parameters\n\n**dbHandle** is the handle of the historical database.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nhistdb = database(\"C:\\DolphinDBDemo\\example\\data\\dbspace\\historical-A\\Trades2ndDomain\")\nactiveNodeAlias = getNodeAlias()\nactiveDate = today()\nenableActivePartition(histdb, activeDate, activeNodeAlias);\n\ndisableActivePartition(histdb);\n```\n"
    },
    "disableDynamicScriptOptimization": {
        "url": "https://docs.dolphindb.com/en/Functions/d/disabledynamicscriptoptimization.html",
        "signatures": [
            {
                "full": "enableDynamicScriptOptimization()",
                "name": "enableDynamicScriptOptimization",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [disableDynamicScriptOptimization](https://docs.dolphindb.com/en/Functions/d/disabledynamicscriptoptimization.html)\n\n\n\n#### Syntax\n\nenableDynamicScriptOptimization()\n\n#### Details\n\nDisable script engine optimization.\n\nThis command must be executed by an administrator on the controller node.\n\nThe effect of this command will be lost after the system restarts. To make it permanent, please modify the configuration parameter *enableDynamicScriptOptimization* in the configuration file (controller.cfg for cluster mode, dolphindb.cfg for single-node mode)\n\n#### Examples\n\n```\nenableDynamicScriptOptimize()\n```\n\n**Related Functions:** [enableDynamicScriptOptimization](https://docs.dolphindb.com/en/Functions/e/enabledynamicscriptoptimization.html)\n"
    },
    "disableQueryMonitor": {
        "url": "https://docs.dolphindb.com/en/Functions/d/disableQueryMonitor.html",
        "signatures": [
            {
                "full": "disableQueryMonitor()",
                "name": "disableQueryMonitor",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [disableQueryMonitor](https://docs.dolphindb.com/en/Functions/d/disableQueryMonitor.html)\n\n\n\n#### Syntax\n\ndisableQueryMonitor()\n\n#### Details\n\nDisable the monitor on query status.\n\nAs monitoring the query status has some memory overhead, you can disable the monitor when the system is low on memory.\n\nNote: After calling the command, users cannot get the query job status with [getQueryStatus](https://docs.dolphindb.com/en/Functions/g/getQueryStatus.html).\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n\nRelated function: [enableQueryMonitor](https://docs.dolphindb.com/en/Functions/e/enableQueryMonitor.html)\n"
    },
    "disableResourceTracking": {
        "url": "https://docs.dolphindb.com/en/Functions/d/disableresourcetracking.html",
        "signatures": [
            {
                "full": "disableResourceTracking()",
                "name": "disableResourceTracking",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [disableResourceTracking](https://docs.dolphindb.com/en/Functions/d/disableresourcetracking.html)\n\n\n\n#### Syntax\n\ndisableResourceTracking()\n\n#### Details\n\nUse this function to disable resource tracking at runtime. This function can only be called by the administrator on a data node, and it only takes effect when *resourceSamplingInterval*is set to a positive integer. Note that enabling or disabling resource tracking will not affect log retention.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n\nRelated function: [enableResourceTracking](https://docs.dolphindb.com/en/Functions/e/enableresourcetracking.html)\n"
    },
    "disableTablePersistence": {
        "url": "https://docs.dolphindb.com/en/Functions/d/disableTablePersistence.html",
        "signatures": [
            {
                "full": "disableTablePersistence(table)",
                "name": "disableTablePersistence",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [disableTablePersistence](https://docs.dolphindb.com/en/Functions/d/disableTablePersistence.html)\n\n\n\n#### Syntax\n\ndisableTablePersistence(table)\n\n#### Details\n\nDisable a table persistence to disk. Any future update of the table will not be persisted to disk.\n\n#### Parameters\n\n**table** is a table object.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ncolName=[\"time\",\"x\"]\ncolType=[\"timestamp\",\"int\"]\nt = streamTable(100:0, colName, colType);\nshare t as st\nenableTablePersistence(table=st, cacheSize=1200000)\n```\n\n```\nfor(s in 0:200){\n     n=10000\n     time=2019.01.01T00:00:00.000+s*n+1..n\n     x=rand(10.0, n)\n     insert into st values(time, x)\n}\ndisableTablePersistence(st);\n```\n\n**Related functions:** [enableTablePersistence](https://docs.dolphindb.com/en/Functions/e/enableTablePersistence.html), [clearTablePersistence](https://docs.dolphindb.com/en/Functions/c/clearTablePersistence.html)\n"
    },
    "disableTSDBAsyncSorting": {
        "url": "https://docs.dolphindb.com/en/Functions/d/disableTSDBAsyncSorting.html",
        "signatures": [
            {
                "full": "disableTSDBAsyncSorting()",
                "name": "disableTSDBAsyncSorting",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [disableTSDBAsyncSorting](https://docs.dolphindb.com/en/Functions/d/disableTSDBAsyncSorting.html)\n\n\n\n#### Syntax\n\ndisableTSDBAsyncSorting()\n\n#### Details\n\nData written to the TSDB cache engine are sorted by *sortColumns*. The tasks of writing and sorting data can be processed synchronously or asynchronously. Execute the command to disable asynchronous sorting mode. This command can only be executed by an administrator on a data node.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n\nRelated function: [enableTSDBAsyncSorting](https://docs.dolphindb.com/en/Functions/e/enableTSDBAsyncSorting.html)\n"
    },
    "distance": {
        "url": "https://docs.dolphindb.com/en/Functions/d/distance.html",
        "signatures": [
            {
                "full": "distance(X, Y)",
                "name": "distance",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [distance](https://docs.dolphindb.com/en/Functions/d/distance.html)\n\n\n\n#### Syntax\n\ndistance(X, Y)\n\n#### Details\n\nCalculate the distance in meters between 2 points on the earth's surface.\n\n#### Parameters\n\n**X** and **Y** can be a POINT scalar/pair/vector representing points in the coordinate system of earth.\n\n#### Examples\n\n```\np1 = point(180, 24.118418)\np2 = point(180, 24.11931)\ndistance(p1,p2)\n// output: 99.185916\n\np1 = point(117.60972, 24.118418)\np2 = point(117.50972, 24.118418)\np3 = point(117.70972, 24.118418)\np4 = point(117.75972, 24.118418)\ndistance([p1,p2], [p3,p4])\n```\n\n| 0          | 1           |\n| ---------- | ----------- |\n| 10,148.799 | 25,371.9947 |\n\nCalculate the distance between the two points p1 (Lon1,Lat1) and p2 (Lon2,Lat2) on the map. Based on the 0-degree longitude, the east longitude is taken as a positive value (Longitude), the west longitude is taken as a negative value (-Longitude), the north latitude is taken as 90-latitude, and the south latitude is taken as 90+latitude. So the calculation is:\n\n```\np1 = point(-117.60972,24.118418)  //Longitude: 117.60972 W Latitude: 65.881582 N\np2 = point(117.61113,114.11931)  //Longitude: 117.60972 E Latitude: 24.118418 S\ndistance(p1,p2)\n// output: 6.02098E6\n```\n"
    },
    "distinct": {
        "url": "https://docs.dolphindb.com/en/Functions/d/distinct.html",
        "signatures": [
            {
                "full": "distinct(X)",
                "name": "distinct",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [distinct](https://docs.dolphindb.com/en/Functions/d/distinct.html)\n\n\n\n#### Syntax\n\ndistinct(X)\n\n#### Details\n\nReturn the distinct elements from *X*. Since version 2.00.173.00.4, the order of the returned elements matches the order of their first appearance in the input.\n\n#### Parameters\n\n**X** is a vector or array vector.\n\n#### Examples\n\n```\ndistinct(4 5 5 2 3)\n// output: [4,5,2,3]\n\na = array(INT[], 0, 10).append!([1 2 3,  4 5, 6 7 8, 9 10])\ndistinct(a)\n// output: [1,2,3,4,5,6,7,8,9,10]\n\nt=table(3 1 2 2 3 as x);\nselect distinct x from t;\n```\n\n| distinct\\_x |\n| ----------- |\n| 3           |\n| 1           |\n| 2           |\n\n```\nselect sort(distinct(x)) as x from t;\n```\n\n| x |\n| - |\n| 1 |\n| 2 |\n| 3 |\n\nThe function `distinct` returns a vector, while the function [set](https://docs.dolphindb.com/en/Functions/s/set.html) returns a set.\n\n```\nx=set(4 5 5 2 3)\nx\n// output: set(3,2,5,4)\n\nx.intersection(set(2 5))\n// output: set(2,5)\n```\n\nFor in-memory or distributed tables, `distinct` can be used with `group by` to return an array vector of unique values for each group.\n\n```\ndbName = \"dfs://testdb\"\nif(existsDatabase(dbName)){\n   dropDatabase(dbName)\n}\n\ndb=database(\"dfs://testdb\", VALUE, 2012.01.11..2012.01.29)\n\nn=100\nt=table(take(2012.01.11..2012.01.29, n) as date, symbol(take(\"A\"+string(21..60), n)) as sym, take(100, n) as val)\n\npt=db.createPartitionedTable(t, `pt, `date).append!(t)\nresult=select distinct(date) from pt group by sym\nselect sym, distinct_date from result where sym=`A21\n```\n\n| sym | distinct\\_date                      |\n| --- | ----------------------------------- |\n| A21 | \\[2012.01.15,2012.01.13,2012.01.11] |\n"
    },
    "div": {
        "url": "https://docs.dolphindb.com/en/Functions/d/div.html",
        "signatures": [
            {
                "full": "div(X, Y)",
                "name": "div",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [div](https://docs.dolphindb.com/en/Functions/d/div.html)\n\n\n\n#### Syntax\n\ndiv(X, Y)\n\nor\n\nX/Y\n\n#### Details\n\nReturn element-by-element division of *X* by *Y*.\n\nWhen *X* or *Y* is floating, it returns a floating value.\n\nWhen both *X* and *Y* are integers, `div` means integer division, which is the same as applying the [floor](https://docs.dolphindb.com/en/Functions/f/floor.html) function after division. For example, 5/2 is 2. If you want \"true\" division for integers, you can apply the operator [ratio(\\\\)](https://docs.dolphindb.com/en/Functions/r/ratio.html) instead. Integer division is often used together with the operator [mod](https://docs.dolphindb.com/en/Functions/m/mod.html) for grouping data. The results of `div` and `mod` should satisfy the relationship: `X=div(X,Y)*Y+mod(X,Y)`.\n\n#### Parameters\n\n**X** and **Y** can be a scalar/pair/vector/matrix. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Examples\n\n```\n9/2:5;\n// output: 4 : 1\n\n11:25/3:4;\n// output: 3 : 6\n\nx=1 2 3;\nx/2;\n// output: [0,1,1]\n\n2/x;\n// output: [2,1,0]\n\ny=4 5 6;\nx/y;\n// output: [0,0,0]\ny/x;\n// output: [4,2,2]\n\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1/2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 0  | 1  | 2  |\n| 1  | 2  | 3  |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1/m2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 0  | 0  | 2  |\n| 0  | 1  | 6  |\n\n```\n-7/5;\n// output: -2\n\n\nx=-1 2 6;\nx/-5;\n// output: [0,-1,-2]\n```\n"
    },
    "dividedDifference": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dividedDifference.html",
        "signatures": [
            {
                "full": "dividedDifference(X, Y, resampleRule, [closed='left'], [origin='start_day'], [outputX=false])",
                "name": "dividedDifference",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "resampleRule",
                        "name": "resampleRule"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    },
                    {
                        "full": "[outputX=false]",
                        "name": "outputX",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [dividedDifference](https://docs.dolphindb.com/en/Functions/d/dividedDifference.html)\n\n\n\n#### Syntax\n\ndividedDifference(X, Y, resampleRule, \\[closed='left'], \\[origin='start\\_day'], \\[outputX=false])\n\n#### Details\n\nResample *X* based on the specified *resampleRule*, *closed* and *origin*. Perform divided difference interpolation on *Y* based on the resampled *X*.\n\nIf *outputX* is unspecified, return a vector of *Y* after the interpolation.\n\nIf *outputX*=true, return a tuple where the first element is the vector of resampled *X* and the second element is a vector of *Y* after the interpolation.\n\n#### Parameters\n\n**X** is a strictly increasing vector of temporal type.\n\n**Y** is a numeric vector of the same length as *X*.\n\n**resampleRule** is a string. See the parameter *rule* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html) for the optional values.\n\n**closed** and **origin** are the same as the parameters *closed* and *origin* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html).\n\n**outputX** is a Boolean value indicating whether to output the resampled *X*. The default value is false.\n\n#### Examples\n\n**Example 1**\n\n```\ndividedDifference([2016.02.14 00:00:00, 2016.02.15 00:00:00, 2016.02.16 00:00:00], [1.0, 2.0, 4.0], resampleRule=`60min);\n\n/* output\n[1,1.0217,1.0451,1.0703,1.0972,1.1259,1.1562,1.1884,1.2222,1.2578,\n1.2951,1.3342,1.375,1.4175,1.4618,1.5078,1.5556,1.605,1.6562,1.7092,\n1.7639,1.8203,1.8785,1.9384,2,2.0634,2.1285,2.1953,2.2639,2.3342,\n2.4062,2.48,2.5556,2.6328,2.7118,2.7925,2.875,2.9592,3.0451,3.1328,\n3.2222,3.3134,3.4062,3.5009,3.5972,3.6953,3.7951,3.8967,4]\n*/\n```\n\n**Example 2** Different values of *closed* affect the result.\n\n```\n// Data points fall exactly on 3-minute boundaries\nX = 2022.01.01T00:00:00 + [0, 3, 6, 9] * 60  // 00:00, 00:03, 00:06, 00:09\nY = [1.0, 3.0, 7.0, 13.0]\n\n// closed='left' (default): interval [t, t+3min), left-closed right-open\n// 00:03 belongs to [00:03, 00:06), the start of the second bucket\ndividedDifference(X, Y, `3min, closed=`left)\n\n// closed='right': interval (t, t+3min], left-open right-closed\n// 00:03 belongs to (00:00, 00:03], the end of the first bucket\n// Different bucket boundaries lead to different interpolation results\ndividedDifference(X, Y, `3min, closed=`right)\n```\n\n**Example 3** Different values of *origin* affect the result.\n\n```\n// Data starts at 00:00:30 and is not aligned to whole minutes\nX = 2022.01.01T00:00:30 + (0..4) * 60  // 00:00:30, 00:01:30, ..., 00:04:30\nY = [2.0, 4.0, 7.0, 11.0, 16.0]\n\n// origin='start_day' (default): align to 00:00:00 of the same day\n// Time buckets: [00:00:00, 00:01:00), [00:01:00, 00:02:00), ...\n// Resampled X: 00:00:00, 00:01:00, 00:02:00, 00:03:00, 00:04:00\ndividedDifference(X, Y, `1min, origin=`start_day, outputX=true)\n\n// origin='start': align to the first data point 00:00:30\n// Time buckets: [00:00:30, 00:01:30), [00:01:30, 00:02:30), ...\n// Resampled X: 00:00:30, 00:01:30, 00:02:30, 00:03:30, 00:04:30\ndividedDifference(X, Y, `1min, origin=`start, outputX=true)\n\n// origin=custom timestamp: align to 00:00:10\n// Time buckets: [00:00:10, 00:01:10), [00:01:10, 00:02:10), ...\n// Resampled X: 00:00:10, 00:01:10, 00:02:10, 00:03:10, 00:04:10\ndividedDifference(X, Y, `1min, origin=2022.01.01T00:00:10, outputX=true)\n```\n\n**Example 4** Different values of *outputX* affect the result.\n\n```\nX = [2016.02.14T00:00:00, 2016.02.15T00:00:00, 2016.02.16T00:00:00]\nY = [1.0, 2.0, 4.0]\n\n// outputX=false (default): return only the interpolated Y vector\ndividedDifference(X, Y, `60min)\n// Output: [1, 1.0217, ..., 4] (49 points)\n\n// outputX=true: return a tuple; [0] is the resampled X, [1] is the interpolated Y\nresult = dividedDifference(X, Y, `60min, outputX=true)\nresult[0]  // Hourly timestamps, 49 in total\nresult[1]  // Corresponding interpolated Y values, 49 in total\n```\n"
    },
    "dot": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dot.html",
        "signatures": [
            {
                "full": "dot(X, Y)",
                "name": "dot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [dot](https://docs.dolphindb.com/en/Functions/d/dot.html)\n\n\n\n#### Syntax\n\ndot(X, Y)\n\nor\n\nX\\*\\*Y\n\n#### Details\n\nReturn the matrix multiplication of *X* and *Y*. If *X* and *Y* are vectors of the same length, return their inner product.\n\nDifference from Python’s `numpy.dot`: `numpy.dot` uses different multiplication rules for 1-D, 2-D, and N-D arrays and supports the *out* argument. DolphinDB’s `dot` supports scalars, vectors, and matrices. Two vectors return an inner product, matrix-vector multiplication automatically adjusts the vector dimension, and `X**Y` can be used as a matrix multiplication operator.\n\n#### Parameters\n\n**X** / **Y** can be a scalar/vector/matrix. If both of *X* and *Y* are vectors, they must have the same length. If one of *X* and *Y* is a matrix, the other is a vector/matrix and their dimensions must satisfy the rules of matrix multiplication.\n\n#### Returns\n\nReturns a scalar/vector/matrix.\n\n#### Examples\n\n```\nx=1..6$2:3;\ny=1 2 3;\nx dot y;\n```\n\n| #0 |\n| -- |\n| 22 |\n| 28 |\n\n```\nx=1..6$2:3;\ny=6..1$3:2;\nx**y;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 41 | 14 |\n| 56 | 20 |\n\n```\ny**x;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 12 | 30 | 48 |\n| 9  | 23 | 37 |\n| 6  | 16 | 26 |\n\n```\na=1 2 3;\nshape a;\n// output: 3:1\n\nx**a;\n```\n\n| #0 |\n| -- |\n| 22 |\n| 28 |\n\n```\nb=1 2;\nshape b;\n// output: 2:1\n\nb**x;  // for a matrix multiplication between a matrix and a vector, the system may rotate the dimension of the vector for the multiplication to go through.\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 5  | 11 | 17 |\n\n```\nx=1 2 3;\ny=4 5 6;\nx ** y;\n// output: 32  // inner product of two vectors. Equivalent to 1*4 + 2*5 + 3*6\n\nx ** 2;\n// output: [2,4,6]\n\nx=1..6$2:3\nx ** 2;\nError: Use * rather than ** for scalar and matrix multiplication.\n```\n"
    },
    "double": {
        "url": "https://docs.dolphindb.com/en/Functions/d/double.html",
        "signatures": [
            {
                "full": "double(X)",
                "name": "double",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [double](https://docs.dolphindb.com/en/Functions/d/double.html)\n\n\n\n#### Syntax\n\ndouble(X)\n\n#### Details\n\nConvert the input to the data type of DOUBLE.\n\n#### Parameters\n\n**X** can be of any data type.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\n// create a DOUBLE variable with default value 0\nx=double();\nx;\n// output: 00F\ntypestr x;\n// output: DOUBLE\n\ntypestr double(`10);\n// output: DOUBLE\n\ndouble(`10.9);\n// output: 10.9\n\ndouble(now());\n// output: 5.297834e+011\n```\n"
    },
    "drop": {
        "url": "https://docs.dolphindb.com/en/Functions/d/drop.html",
        "signatures": [
            {
                "full": "drop(obj, count)",
                "name": "drop",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [drop](https://docs.dolphindb.com/en/Functions/d/drop.html)\n\n\n\n#### Syntax\n\ndrop(obj, count)\n\n#### Details\n\nDrops a specified number of elements, columns or rows from the front or end of a vector, matrix or table.\n\n#### Parameters\n\n**obj** is a vector/matrix/table.\n\n**count** is an integer specifying the number of elements/columns/rows to drop. If negative, drop from the end of *obj*.\n\n#### Returns\n\nAn object with the same data type and form as *obj*.\n\n#### Examples\n\n```\nx=1..10;\nx.drop(2);\n// output: [3,4,5,6,7,8,9,10]\nx.drop(-2);\n// output: [1,2,3,4,5,6,7,8]\n\nx=1..10$2:5;\nx;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  |\n| 2  | 4  | 6  | 8  | 10 |\n\n```\ndrop(x,2);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 5  | 7  | 9  |\n| 6  | 8  | 10 |\n\n```\nx drop -2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nt=table(1 2 3 4 as x, 11..14 as y);\nt;\n```\n\n| x | y  |\n| - | -- |\n| 1 | 11 |\n| 2 | 12 |\n| 3 | 13 |\n| 4 | 14 |\n\n```\nt.drop(2);\n```\n\n| x | y  |\n| - | -- |\n| 3 | 13 |\n| 4 | 14 |\n\n**Related functions:** [pop!](https://docs.dolphindb.com/en/Functions/p/pop!.html), [removeHead!](https://docs.dolphindb.com/en/Functions/r/removeHead!.html), [removeTail!](https://docs.dolphindb.com/en/Functions/r/removeTail!.html), [remove!](https://docs.dolphindb.com/en/Functions/r/remove.html)\n"
    },
    "dropAggregator": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropAggregator.html",
        "signatures": [
            {
                "full": "dropStreamEngine(name)",
                "name": "dropStreamEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [dropAggregator](https://docs.dolphindb.com/en/Functions/d/dropAggregator.html)\n\nAlias for [dropStreamEngine](https://docs.dolphindb.com/en/Functions/d/dropStreamEngine.html)\n\n\nDocumentation for the `dropStreamEngine` function:\n### [dropStreamEngine](https://docs.dolphindb.com/en/Functions/d/dropStreamEngine.html)\n\n\n\n#### Syntax\n\ndropStreamEngine(name)\n\nAlias: dropAggregator\n\n#### Details\n\nReleases the definition of a streaming engine from the memory.\n\n**Note:**\n\nThis function cannot be used to delete streaming engines created by Orca. To delete an Orca streaming engine, use [dropStreamGraph](https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html) to delete the stream graph to which the engine belongs.\n\n#### Parameters\n\n**name** is a string indicating the name of a created streaming engine. You can obtain all created engines with function [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html).\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nshare streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT]) as trades\noutputTable = table(10000:0, `time`sym`sumQty, [TIMESTAMP, SYMBOL, INT])\ntradesEngine = createTimeSeriesEngine(name=\"StreamEngineDemo\", windowSize=3, step=3, metrics=<[sum(qty)]>, dummyTable=trades, outputTable=outputTable, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50)\nsubscribeTable(tableName=\"trades\", actionName=\"tradesEngine\", offset=0, handler=append!{tradesEngine}, msgAsTable=true)\n```\n\n```\ndef writeData(n){\n    timev = 2018.10.08T01:01:01.001 + timestamp(1..n)\n    symv =take(`A`B, n)\n    qtyv = take(1, n)\n    insert into trades values(timev, symv, qtyv)\n}\n\nwriteData(6);\n```\n\n```\n// output: select * from outputTable;\n```\n\n| time                    | sym | sumQty |\n| ----------------------- | --- | ------ |\n| 2018.10.08T01:01:01.003 | A   | 1      |\n| 2018.10.08T01:01:01.006 | A   | 1      |\n| 2018.10.08T01:01:01.006 | B   | 2      |\n\n```\ndropStreamEngine(\"StreamEngineDemo\");\n```\n"
    },
    "dropCatalog": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropCatalog.html",
        "signatures": [
            {
                "full": "dropCatalog(catalog)",
                "name": "dropCatalog",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    }
                ]
            }
        ],
        "markdown": "### [dropCatalog](https://docs.dolphindb.com/en/Functions/d/dropCatalog.html)\n\n#### Syntax\n\ndropCatalog(catalog)\n\n#### Details\n\nDrop a catalog.\n\n#### Parameters\n\n**catalog**is a string specifying the catalog name.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ndropCatalog(\"cat1\")\n```\n\n"
    },
    "dropColumns!": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropColumns!.html",
        "signatures": [
            {
                "full": "dropColumns!(table, colNames)",
                "name": "dropColumns!",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    }
                ]
            }
        ],
        "markdown": "### [dropColumns!](https://docs.dolphindb.com/en/Functions/d/dropColumns!.html)\n\n\n\n#### Syntax\n\ndropColumns!(table, colNames)\n\nAlias: drop!\n\n#### Details\n\nDelete one or multiple columns from a table. Note that deleting a partitioning column from a DFS table is not supported.\n\n#### Parameters\n\n**table** is a table object. It is an in-memory table or a DFS table (for OLAP engine only).\n\n**colNames** is a STRING scalar/vector indicating a column name. If *table* is a DFS table, it must be a scalar.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nt=table(1 2 3 as x, 4 5 6 as y, 7..9 as z, 10..12 as a, 13..15 as b, 16..18 as c);\nt;\n```\n\n| x | y | z | a  | b  | c  |\n| - | - | - | -- | -- | -- |\n| 1 | 4 | 7 | 10 | 13 | 16 |\n| 2 | 5 | 8 | 11 | 14 | 17 |\n| 3 | 6 | 9 | 12 | 15 | 18 |\n\n```\nt.dropColumns!(`x);\n```\n\n| y | z | a  | b  | c  |\n| - | - | -- | -- | -- |\n| 4 | 7 | 10 | 13 | 16 |\n| 5 | 8 | 11 | 14 | 17 |\n| 6 | 9 | 12 | 15 | 18 |\n\n```\ndropColumns!(t, `a`b);\n```\n\n| y | z | c  |\n| - | - | -- |\n| 4 | 7 | 16 |\n| 5 | 8 | 17 |\n| 6 | 9 | 18 |\n"
    },
    "dropDatabase": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropDatabase.html",
        "signatures": [
            {
                "full": "dropDatabase(dbDir)",
                "name": "dropDatabase",
                "parameters": [
                    {
                        "full": "dbDir",
                        "name": "dbDir"
                    }
                ]
            }
        ],
        "markdown": "### [dropDatabase](https://docs.dolphindb.com/en/Functions/d/dropDatabase.html)\n\n\n\n#### Syntax\n\ndropDatabase(dbDir)\n\n#### Details\n\nDelete all physical files from the specified database.\n\n#### Parameters\n\n**dbDir** specifies the directory where the database is located. For a database in the distributed file system, the directory should start with \"dfs\\://\".\n\n#### Returns\n\nNone.\n\n#### Examples\n\nDrop a DFS database:\n\n```\nn=1000000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x);\nsaveText(t, \"C:/DolphinDB/Data/t.txt\");\n\ndb = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)\npt = loadTextEx(db, `pt1, `date, \"C:/DolphinDB/Data/t.txt\");\n\ndropDatabase(\"dfs://valueDB\")\n```\n\nDrop a database on disk:\n\n```\nn=1000000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\nsaveText(t, \"C:/DolphinDB/Data/t.txt\");\n\ndb = database(\"C:/DolphinDB/Data/rangedb\", RANGE, 0 5 10)\npt = loadTextEx(db, `pt, `ID, \"C:/DolphinDB/Data/t.txt\");\n\ndropDatabase(\"C:/DolphinDB/Data/rangedb\");\n```\n"
    },
    "dropDistributedInMemoryTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropDistributedInMemoryTable.html",
        "signatures": [
            {
                "full": "dropDistributedInMemoryTable(tableName)",
                "name": "dropDistributedInMemoryTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [dropDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/d/dropDistributedInMemoryTable.html)\n\n\n\n#### Syntax\n\ndropDistributedInMemoryTable(tableName)\n\n#### Details\n\nDelete the specified distributed in-memory table. This function can only be executed on a data node or compute node.\n\n#### Parameters\n\n**tableName** is a STRING scalar indicating column names of a distributed in-memory table.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\npt = createDistributedInMemoryTable(`dt, `time`id`value, `DATETIME`INT`LONG, HASH, [INT, 2],`id)\ntime = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);\nid = 0..39;\nvalue = rand(100, 40);\ntmp = table(time, id, value);\n\npt = loadDistributedInMemoryTable(`dt)\npt.append!(tmp);\ndropDistributedInMemoryTable(`dt)\n```\n\nRelated functions: [loadDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/l/loadDistributedInMemoryTable.html), [createDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/c/createDistributedInMemoryTable.html)\n"
    },
    "dropFunctionView": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropFunctionView.html",
        "signatures": [
            {
                "full": "dropFunctionView(name, [isNamespace=false])",
                "name": "dropFunctionView",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[isNamespace=false]",
                        "name": "isNamespace",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [dropFunctionView](https://docs.dolphindb.com/en/Functions/d/dropFunctionView.html)\n\n\n\n#### Syntax\n\ndropFunctionView(name, \\[isNamespace=false])\n\n#### Details\n\nDelete a function view or all function views under a namespace.\n\nIt can only be executed by administrators or users with VIEW\\_OWNER permission.\n\n#### Parameters\n\n**name** is a STRING scalar indicating a user-defined function or a namespace.\n\n**isNamespace** is a Boolean value specifying whether *name* is a namespace.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ngetFunctionViews()\nname      body                           \n--------- ------------------\nf1        def f1(){return 1}\ntest::f1 def f1(){return 2}\ntest::f2 def f2(){return 3}\n\n// Drop f1\ndropFunctionView(`f1)\n// Drop test::f1\ndropFunctionView(\"test::f1\")\n// Drop all function views under test\ndropFunctionView(\"test\",true)\n```\n"
    },
    "dropHaMvccTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropHaMvccTable.html",
        "signatures": [
            {
                "full": "dropHaMvccTable(tableName)",
                "name": "dropHaMvccTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [dropHaMvccTable](https://docs.dolphindb.com/en/Functions/d/dropHaMvccTable.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ndropHaMvccTable(tableName)\n\n#### Details\n\nDrops the HA MVCC table with the specified name.\n\n**Notes:** This function must be executed on the Leader node of the Raft group that the table belongs to.\n\n#### Parameters\n\n**tableName** is a STRING scalar indicating the name of the HA MVCC table to drop.\n\n#### Examples\n\n```\ndropHaMvccTable(\"demoHaMvcc\")\n```\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "dropIPCInMemoryTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropIPCInMemoryTable.html",
        "signatures": [
            {
                "full": "dropIPCInMemoryTable(tableName)",
                "name": "dropIPCInMemoryTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [dropIPCInMemoryTable](https://docs.dolphindb.com/en/Functions/d/dropIPCInMemoryTable.html)\n\n\n\n#### Syntax\n\ndropIPCInMemoryTable(tableName)\n\n#### Details\n\nDrop an IPC in-memory table.\n\n**Note:**\n\n* This function can only be executed on Linux.\n* An IPC in-memory table cannot be deleted if a server is shut down. It still needs to be deleted through function `dropIPCInMemoryTable`.\n\n#### Parameters\n\n**tableName** is a string indicating the name of IPC in-memory table to be dropped.\n\n#### Returns\n\nA string specifying the name of the deleted IPC in-memory table.\n\n#### Examples\n\nDrop the table ipc\\_table created by function [createIPCInMemoryTable](https://docs.dolphindb.com/en/Functions/c/createIPCInMemoryTable.html).\n\n```\ndropIPCInMemoryTable(`ipc_table)\n// output: ipc_table\n```\n"
    },
    "dropMCPPrompt": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropMCPPrompt.html",
        "signatures": [
            {
                "full": "dropMCPPrompt(name)",
                "name": "dropMCPPrompt",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [dropMCPPrompt](https://docs.dolphindb.com/en/Functions/d/dropMCPPrompt.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ndropMCPPrompt(name)\n\n#### Details\n\nDeletes an MCP prompt template. If the template has been published, call `withdrawMCPPrompts` to withdraw it before deleting it.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the prompt template.\n\n#### Returns\n\nA string indicating the name of the deleted MCP prompt template.\n\n#### Examples\n\n```\ndropMCPPrompt(\"stock_summary\")\n// output:'stock_summary'\n```\n"
    },
    "dropMCPTool": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropMCPTool.html",
        "signatures": [
            {
                "full": "dropMCPTool(name)",
                "name": "dropMCPTool",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [dropMCPTool](https://docs.dolphindb.com/en/Functions/d/dropMCPTool.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ndropMCPTool(name)\n\n#### Details\n\nDeletes an MCP tool. If the tool has been published, it should be withdrawn using `withdrawMCPTools` before deletion.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the tool name.\n\n#### Returns\n\nA string representing the name of the deleted tool.\n\n#### Examples\n\n```\ndropMCPTool(\"myTool\")\n```\n"
    },
    "dropna": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropna.html",
        "signatures": [
            {
                "full": "dropna(X, [byRow=true], [thresh])",
                "name": "dropna",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[byRow=true]",
                        "name": "byRow",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[thresh]",
                        "name": "thresh",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [dropna](https://docs.dolphindb.com/en/Functions/d/dropna.html)\n\n\n\n#### Syntax\n\ndropna(X, \\[byRow=true], \\[thresh])\n\n#### Details\n\nIf *X* is a vector, delete all null values from *X*.\n\nIf *X* is a matrix and *byRow*=true, delete all rows with null values.\n\nIf *X* is a matrix and *byRow*=false, delete all columns with null values.\n\nIf *thresh* is specified, each row or column (as specified by *byRow*) in the result must have at least *thresh* non-null values.\n\n#### Parameters\n\n**X** is a vector or matrix.\n\n**byRow** (optional) is a Boolean value. The default value is true.\n\n**thresh** (optional) is a positive integer.\n\n#### Returns\n\nA vector or matrix with the same data type as *X*.\n\n#### Examples\n\n```\nx=1 NULL 2 3 NULL NULL 4;\nx.dropna();\n// output: [1,2,3,4]\n\nm=matrix(1 1 1 1, 1 1 1 NULL, 1 NULL 1 NULL);\nm;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 1  |\n| 1  | 1  |    |\n| 1  | 1  | 1  |\n| 1  |    |    |\n\n```\ndropna(m);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 1  |\n| 1  | 1  | 1  |\n\n```\ndropna(m,,2);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 1  |\n| 1  | 1  |    |\n| 1  | 1  | 1  |\n\n```\ndropna(m,false);\n```\n\n| #0 |\n| -- |\n| 1  |\n| 1  |\n| 1  |\n| 1  |\n\n```\ndropna(m,false,3);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 1  | 1  |\n| 1  | 1  |\n| 1  |    |\n"
    },
    "dropOrcaStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropOrcaStreamTable.html",
        "signatures": [
            {
                "full": "dropOrcaStreamTable(name)",
                "name": "dropOrcaStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [dropOrcaStreamTable](https://docs.dolphindb.com/en/Functions/d/dropOrcaStreamTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ndropOrcaStreamTable(name)\n\n#### Details\n\nDeletes an Orca stream table.\n\nThe table can only be deleted if it is no longer referenced by any stream graph. You can use `getOrcaStreamTableMeta` to check its references.\n\n**Note:** Before calling this function, you must first enable the Orca feature by setting `enableORCA=true` in the configuration file `cluster.cfg` or `controller.cfg`.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\n// Create an Orca stream table\nif(!existsCatalog(\"demo\")){\n    createCatalog(\"demo\")\n}\ngo\nuse catalog demo\n\ncreateOrcaStreamTable(\"trade\", `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n\n// Delete the Orca stream table\ndropOrcaStreamTable(\"demo.orca_table.trade\")\n// or dropOrcaStreamTable(\"trade\")\n```\n"
    },
    "dropPartition": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropPartition.html",
        "signatures": [
            {
                "full": "dropPartition(dbHandle, partitionPaths, tableName, [forceDelete=false], [deleteSchema=false])",
                "name": "dropPartition",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "partitionPaths",
                        "name": "partitionPaths"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[forceDelete=false]",
                        "name": "forceDelete",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[deleteSchema=false]",
                        "name": "deleteSchema",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [dropPartition](https://docs.dolphindb.com/en/Functions/d/dropPartition.html)\n\n\n\n#### Syntax\n\ndropPartition(dbHandle, partitionPaths, tableName, \\[forceDelete=false], \\[deleteSchema=false])\n\n#### Details\n\nDelete data from one or multiple partitions from a DFS database.\n\nPlease note that *dropPartition* only deletes data from selected partitions. It does not change the partitioning scheme. We do not need to reestablish these partitions if we need to append new data to them.\n\nIf *tableName* is specified: delete one or multiple partitions of the given table.\n\nIf *tableName* is not specified: delete one or multiple partitions of all tables with this partition.\n\n#### Parameters\n\n**dbHandle** is a DolphinDB database handle.\n\n**partitionPaths** can be specified in two ways:\n\n* By path: *partitionPaths* is a STRING scalar/vector indicating the path of one or multiple partitions. Each string must start with \"/\". For composite partitions, the path must include all partition levels.\n\n  The partition path can be obtained from the `dfsPath` field in the return value of function [getChunksMeta](https://docs.dolphindb.com/en/Functions/g/getChunksMeta.html). This field is structured as:`/<databaseName>/<partitionPaths>/<physicalIndex>`.\n\n* By condition: *partitionPaths* is a scalar or vector indicating the value(s) in the partitioning column. The system will drop all partitions containing these values. For composite partitions, *partitionPaths* is a tuple where each element is a filtering condition for each partition level (starting from the first level). If you do not want to apply filtering at a certain partition level, leave the corresponding element empty.\n\n**tableName** is a string indicating a table name. It can be left empty if the database chunk granularity is at DATABASE level (i.e., [database](https://docs.dolphindb.com/en/Functions/d/database.html): *chunkGranularity* = 'DATABASE'). Otherwise, it is a required parameter.\n\n**forceDelete** (optional) is a Boolean value. If set to true, the specified partition(s) will be deleted even if the partition(s) is recovering. The default value is false.\n\n**Note:** When using the `dropPartition` function with *forceDelete*=false, the number of available replicas for the chunks involved in the transaction must be greater than or equal to the configured *dfsReplicationFactor*.\n\n**deleteSchema** (optional) is a Boolean value. The default value is false, indicating that only the data in the selected partitions will be deleted, but the partition schema (which you can check with `schema().partitionSchema`) is kept. When the following conditions are satisfied, you can delete the schema of the selected partitions along with the partition data by setting *deleteSchema* to true:\n\n* There's only one table in the database.\n* The partitioning type of the database is VALUE.\n* For composite partitions, the first level of partitioning type must be VALUE, and only the first level of partitions are selected for deletion.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nThe script should be executed on a data node or compute node of a cluster.\n\n```\nn=1000000\nID=rand(150, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndbID = database(, RANGE, 0 50 100 150)\ndb = database(\"dfs://compoDB\", COMPO, [dbDate, dbID])\npt = db.createPartitionedTable(t, `pt, `date`ID)\npt.append!(t);\n```\n\nThe script above created a database with composite partition. The first level is a value partition with partitioning column of date, and the second level is a range partition with partitioning column of ID.\n\nExample 1. Delete one partition\n\nUse either of the following ways to delete the partition \"/20170807/0\\_50\".\n\n(1) Specify the partition path.\n\n```\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=\"/20170807/0_50\");\n```\n\n**Note:** The *dbHandle* of `dropPartition` can also be specified as `db`, the variable used during database creation.\n\n(2) Specify the filtering condition.\n\n```\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=[2017.08.07, 0]);\n```\n\nHere 0 means the partition of \\[0, 50). We can choose any number from 0 to 49 to represent this partition.\n\nExample 2. Delete a first level partition\n\nUse either of the following ways to delete the first level partition of 2017.08.08.\n\n(1) Specify the path of all partitions under 2017.08.08.\n\n```\npartitions=[\"/20170808/0_50\",\"/20170808/50_100\",\"/20170808/100_150\"]\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=partitions);\n```\n\n(2) Specify the filtering condition.\n\n```\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=2017.08.08, tableName=`pt);\n```\n\nAfter the deletion, check the table partitioning scheme with [schema](https://docs.dolphindb.com/en/Functions/s/schema.html)\n\n```\nschema(db);\n/*output\npartitionSchema->([2017.08.11,2017.08.10,2017.08.09,2017.08.08,2017.08.07],[0,50,100,150])\npartitionSites->\npartitionTypeName->[VALUE,RANGE]\natomic->TRANS\ndatabaseDir->dfs://compoDB\nchunkGranularity->TABLE\nengineType->OLAP\npartitionType->[1,2]\n*/\n```\n\nWe can see that \"2017.08.08\" is still in *partitionSchema* as `dropPartition` only deleted the data from this partition but kept its schema. Since \"2017.08.08\" is a first level VALUE partition, we can also delete its schema from the table partitioning scheme along with its data by specifying *deleteSchema* = true:\n\n```\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=2017.08.08, tableName=`pt, deleteSchema = true);\n```\n\nCheck the table partitioning scheme with [schema](https://docs.dolphindb.com/en/Functions/s/schema.html) - \"2017.08.08\" is no longer in *partitionSchema*:\n\n```\nschema(db);\n/* output\npartitionSchema->([2017.08.11,2017.08.10,2017.08.09,2017.08.07],[0,50,100,150])\n...\n*/\n```\n\nExample 3. Delete a second level partition\n\nUse either of the following ways to delete the second level partition of \\[0,50).\n\n(1) Specify the path of all partitions of \\[0,50).\n\n```\npartitions=[\"/20170807/0_50\",\"/20170808/0_50\",\"/20170809/0_50\",\"/20170810/0_50\",\"/20170811/0_50\"]\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=partitions);\n```\n\n(2) Specify the filtering condition.\n\n```\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=[,[0]]);\n```\n\nExample 4. Delete multiple same level partitions\n\nTo delete the second level partitions of \\[0,50) and \\[100,150):\n\n```\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=[,[0,100]]);\n```\n\nExample 5: Modify data in a distributed table on disk\n\nTo revise data in a distributed table, we need to update the entire partitions that the rows to be updated belong to. The following example adds 10 to column x of the rows with date=2017.08.10 and ID=88 in the distributed table pt.\n\n(1) First load the data of the partition with date=2017.08.10 and ID=88 into memory.\n\n```\ntmp=select * from loadTable(\"dfs://compoDB\",\"pt\") where date=2017.08.10 and 50<=ID<100 ;\n```\n\n(2) Then add 10 to column x of table tmp:\n\n```\nupdate tmp set x=x+10 where date=2017.08.10 and ID=88;\n```\n\n(3) Delete data in the relevant partition:\n\n```\ndropPartition(dbHandle=database(\"dfs://compoDB\"), partitionPaths=\"/20170810/50_100\", tableName=`pt);\n```\n\n(4) Append table tmp to table pt:\n\n```\npt.append!(tmp);\n```\n"
    },
    "dropSchema": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropSchema.html",
        "signatures": [
            {
                "full": "dropSchema(catalog, schema)",
                "name": "dropSchema",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    },
                    {
                        "full": "schema",
                        "name": "schema"
                    }
                ]
            }
        ],
        "markdown": "### [dropSchema](https://docs.dolphindb.com/en/Functions/d/dropSchema.html)\n\n#### Syntax\n\ndropSchema(catalog, schema)\n\n#### Details\n\nDrop a schema from a catalog.\n\n#### Parameters\n\n**catalog**is a string specifying the catalog name.\n\n**schema**is a string indicating the schema to be deleted.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ndropSchema(\"catalog1\", \"schema\")\n```\n\n"
    },
    "dropStreamEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropStreamEngine.html",
        "signatures": [
            {
                "full": "dropStreamEngine(name)",
                "name": "dropStreamEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [dropStreamEngine](https://docs.dolphindb.com/en/Functions/d/dropStreamEngine.html)\n\n\n\n#### Syntax\n\ndropStreamEngine(name)\n\nAlias: dropAggregator\n\n#### Details\n\nReleases the definition of a streaming engine from the memory.\n\n**Note:**\n\nThis function cannot be used to delete streaming engines created by Orca. To delete an Orca streaming engine, use [dropStreamGraph](https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html) to delete the stream graph to which the engine belongs.\n\n#### Parameters\n\n**name** is a string indicating the name of a created streaming engine. You can obtain all created engines with function [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html).\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nshare streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT]) as trades\noutputTable = table(10000:0, `time`sym`sumQty, [TIMESTAMP, SYMBOL, INT])\ntradesEngine = createTimeSeriesEngine(name=\"StreamEngineDemo\", windowSize=3, step=3, metrics=<[sum(qty)]>, dummyTable=trades, outputTable=outputTable, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50)\nsubscribeTable(tableName=\"trades\", actionName=\"tradesEngine\", offset=0, handler=append!{tradesEngine}, msgAsTable=true)\n```\n\n```\ndef writeData(n){\n    timev = 2018.10.08T01:01:01.001 + timestamp(1..n)\n    symv =take(`A`B, n)\n    qtyv = take(1, n)\n    insert into trades values(timev, symv, qtyv)\n}\n\nwriteData(6);\n```\n\n```\n// output: select * from outputTable;\n```\n\n| time                    | sym | sumQty |\n| ----------------------- | --- | ------ |\n| 2018.10.08T01:01:01.003 | A   | 1      |\n| 2018.10.08T01:01:01.006 | A   | 1      |\n| 2018.10.08T01:01:01.006 | B   | 2      |\n\n```\ndropStreamEngine(\"StreamEngineDemo\");\n```\n"
    },
    "dropStreamGraph": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html",
        "signatures": [
            {
                "full": "dropStreamGraph(name, [includeTables])",
                "name": "dropStreamGraph",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[includeTables]",
                        "name": "includeTables",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [dropStreamGraph](https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ndropStreamGraph(name, \\[includeTables])\n\n#### Details\n\nDestroys the specified stream graph. After successful execution, the stream graph’s status is set to \"destroyed\", but the metadata record is not deleted.\n\n* If *includesTables*=true, the specified stream graph and its user-created stream tables will be deleted. Ensure that these stream tables are not referenced by other stream graphs; use `getStreamTableMeta` to check table references.\n* If false, only the stream graph itself will be deleted, leaving the associated stream tables intact.\n\nIn a cluster deployment, this function can only be executed by an administrator or a user who has the COMPUTE\\_GROUP\\_EXEC permission for the compute group that was used to create the stream graph. In a single-node deployment, permission checks are not required.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_graph.factors\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**includesTables** (optional) is a Boolean value, indicating whether to delete user-created stream tables (e.g., source, sink) associated with the stream graph when deleting the graph. The default value is false.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nCreate a stream graph named “indicators”.\n\n```\ndropStreamGraph(\"demo.orca_graph.indicators\")\n\ngetStreamGraphMeta(\"demo.orca_graph.indicators\")[\"status\"]\n// Output: [\"destroyed\"]\n```\n\n**Related functions:** [createStreamGraph](https://docs.dolphindb.com/en/Functions/c/createStreamGraph.html), [StreamGraph::dropGraph](https://docs.dolphindb.com/en/Functions/s/StreamGraph_dropGraph.html)\n"
    },
    "dropStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropStreamTable.html",
        "signatures": [
            {
                "full": "dropStreamTable(tableName, [force=false])",
                "name": "dropStreamTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[force=false]",
                        "name": "force",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [dropStreamTable](https://docs.dolphindb.com/en/Functions/d/dropStreamTable.html)\n\n\n\n#### Syntax\n\ndropStreamTable(tableName, \\[force=false])\n\n#### Details\n\nDelete a stream table. If the table has been persisted to disk, the persisted data on disk will be deleted as well.\n\nTo delete a high-availability stream table, we can execute the command on any data/compute node in the Raft group. The high-availability stream table with the same name on other data nodes will be deleted as well.\n\nIf the table has been persisted to disk but not yet loaded into memory, setting the parameter *force* to true can delete the table directly from disk. Note that it can only be executed by an administrator.\n\n**Note:**\n\nThis function cannot be used to delete stream tables created by Orca. To delete an Orca stream table, use [dropOrcaStreamTable](https://docs.dolphindb.com/en/Functions/d/dropOrcaStreamTable.html).\n\n#### Parameters\n\n**tableName** is a string indicating a stream table name.\n\n**force** (optional) is a Boolean scalar indicating whether to force the deletion of the stream table named *tableName* from the disk if it is not available in memory. The default value is false.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nDelete stream table:\n\n```\ncolNames = `timestamp`sym`qty`price\ncolTypes = [TIMESTAMP,SYMBOL,INT,DOUBLE]\nt=streamTable(1:0,colNames,colTypes)\nenableTableShareAndPersistence(t,`trades);\n\ndropStreamTable(`trades);\n```\n\nDelete a stream table that has been persisted to disk but not yet loaded into memory.\n\n```\ncolNames = `timestamp`sym`qty`price\ncolTypes = [TIMESTAMP,SYMBOL,INT,DOUBLE]\nt=streamTable(1:0,colNames,colTypes)\nenableTableShareAndPersistence(t,`trades);\n\n//delete an in-memory stream table\nundef(`trades,SHARED)\n\n//failed to delete a persisted stream table\ndropStreamTable(`trades)\n//dropStreamTable(\"trades\") => Can't find stream table trades\n\n//set force to true\ndropStreamTable(tableName=`trades,force=true)\n```\n\nDelete high-availability stream table:\n\n```\ncolNames = `timestamp`sym`qty`price\ncolTypes = [TIMESTAMP,SYMBOL,INT,DOUBLE]\nt=table(1:0,colNames,colTypes)\nhaStreamTable(11,t,`trades,100000);\n\ndropStreamTable(`trades);\n```\n"
    },
    "dropTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dropTable.html",
        "signatures": [
            {
                "full": "dropTable(dbHandle, tableName)",
                "name": "dropTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [dropTable](https://docs.dolphindb.com/en/Functions/d/dropTable.html)\n\n\n\n#### Syntax\n\ndropTable(dbHandle, tableName)\n\n#### Details\n\nDelete the specified table on disk. It can only be executed on a data node or compute node.\n\n#### Parameters\n\n**dnHandle** is a DolphinDB database handle.\n\n**tableName** is a string indicating a table name.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nn=1000000\nID=rand(10, n)\nx=rand(1.0, n)\nt=table(ID, x)\ndb=database(\"dfs://rangedb\", RANGE,  0 5 10)\npt = db.createPartitionedTable(t, `pt, `ID)\npt.append!(t)\n\ndropTable(db,`pt);\n```\n"
    },
    "dropDataViewEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/drop_data_view_engine.html",
        "signatures": [
            {
                "full": "dropDataViewEngine(name)",
                "name": "dropDataViewEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [dropDataViewEngine](https://docs.dolphindb.com/en/Functions/d/drop_data_view_engine.html)\n\n\n\n#### Syntax\n\ndropDataViewEngine(name)\n\n#### Details\n\nDeletes the specified data view engine in the current CEP engine.\n\n#### Parameters\n\n**name** is a string indicating the name of the data view engine.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nclass MainMonitor: CEPMonitor {\n    def MainMonitor(){\n    }\n    // Automatically called when the engine is deleted; remove the shared stream table\n    def onunload(){ \n      undef('orderDV', SHARED)\n      dropDataViewEngine('orderDV')\n    }\n\tdef checkOrders(newOrder)\n    // Create a DataViewEngine, specifying the primary key as the 'code' column, \n    // to keep track of the latest order information for each stock\n    def onload(){\n        addEventListener(checkOrders,'Orders',,'all')  \n        orderDV = streamTable(array(STRING, 0) as market, array(STRING, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(TIMESTAMP, 0) as updateTime) \n        share(orderDV,'orderDV') \n        createDataViewEngine('orderDV', objByName('orderDV'), `code, `updateTime)\n    }\n    // Update the latest order information for each stock\n    def checkOrders(newOrder){\n\t\tgetDataViewEngine('orderDV').append!(table(newOrder.market as market, newOrder.code as code, newOrder.price as price, newOrder.qty as qty))\n    }\n}\n\n```\n\n**Related functions**: [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [createDataViewEngine](https://docs.dolphindb.com/en/Functions/c/create_data_view_engine.html), [deleteDataViewItems](https://docs.dolphindb.com/en/Functions/d/delete_data_view_items.html), [getDataViewEngine](https://docs.dolphindb.com/en/Functions/g/get_data_view_engine.html)\n"
    },
    "DStream::anomalyDetectionEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_anomalyDetectionEngine.html",
        "signatures": [
            {
                "full": "DStream::anomalyDetectionEngine(metrics, timeColumn, [keyColumn], [windowSize], [step], [garbageSize], [roundTime=true], [anomalyDescription])",
                "name": "DStream::anomalyDetectionEngine",
                "parameters": [
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[windowSize]",
                        "name": "windowSize",
                        "optional": true
                    },
                    {
                        "full": "[step]",
                        "name": "step",
                        "optional": true
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[anomalyDescription]",
                        "name": "anomalyDescription",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::anomalyDetectionEngine](https://docs.dolphindb.com/en/Functions/d/DStream_anomalyDetectionEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::anomalyDetectionEngine(metrics, timeColumn, \\[keyColumn], \\[windowSize], \\[step], \\[garbageSize], \\[roundTime=true], \\[anomalyDescription])\n\n#### Details\n\nCreates an anomaly detection engine. For details, see [createAnomalyDetectionEngine](https://docs.dolphindb.com/en/Functions/c/createAnomalyDetectionEngine.html).\n\n#### Parameters\n\n**metrics** is metacode or tuple specifying the formulas for anomaly detection. It uses functions or expressions such as `<[sum(qty)>5, avg(qty)>qty, qty<4]>` that indicate anomaly conditions and return Boolean values.\n\nNote: The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**timeColumn** is a string indicating the name of the temporal column of the input stream table.\n\n**keyColumn** (optional) is a STRING scalar or vector indicating the grouping columns. The anomaly detection engine conducts calculations within each group specified by *keyColumn*.\n\n**windowSize** (optional) is a positive integer indicating the size of window for calculation. Only the left boundary is included in the window.\n\n**step** (optional) is a positive integer indicating the duration between 2 adjacent windows. The value of *windowSize* must be a multiple of *step*.\n\nNote: If aggregate functions are used in *metrics*, parameters *windowSize* and *step* must be specified.\n\n**garbageSize** (optional) is a positive integer. The default value is 2,000 (in Bytes).\n\n* If *keyColumn* is not specified, when the number of historical records in memory exceeds *garbageSize*, the system will clear the records that are no longer needed.\n\n* If *keyColumn* is specified, garbage collection is conducted separately in each group. When the number of historical records in a group exceeds *garbageSize*, the system will clear the records that are no longer needed within the group.\n\nNote that *garbageSize* only takes effect when aggregate function(s) are specified in parameter metrics.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary if the time column is in millisecond or second precision and step is greater than one minute. The default value is true indicating the alignment is based on the multi-minute rule. False means alignment is based on the one-minute rule (See [Alignment Rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)).\n\n**anomalyDescription** (optional) is a STRING vector, where each element indicates a custom description for the corresponding anomaly condition specified in *metrics*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\nadGraph = createStreamGraph(\"anomalyDetection\")\nadGraph.source(\"trade\", 1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT])\n  .anomalyDetectionEngine(metrics=<[sum(qty) > 5, avg(qty) > qty, qty < 4]>, timeColumn=`time, keyColumn=`sym, windowSize=3, step=3)\n  .sink(\"anomal_output\")\nadGraph.submit()\ngo\n\ntimes=2024.10.08T01:01:01.001 + 1..6\nsyms=[\"A\", \"B\", \"A\", \"B\", \"A\", \"B\"]\nqtys=[6, 5, 4, 3, 2, 1]\ntmp=table(times as timestamp, syms as sym, qtys as qty)\n\nappendOrcaStreamTable(\"trade\", tmp)\n\nselect * from orca_table.anomal_output \n```\n\n| time                    | sym | type | metric         |\n| ----------------------- | --- | ---- | -------------- |\n| 2024.10.08T01:01:01.003 | A   | 0    | sum(qty) > 5   |\n| 2024.10.08T01:01:01.004 | A   | 1    | avg(qty) > qty |\n| 2024.10.08T01:01:01.005 | B   | 2    | qty < 4        |\n| 2024.10.08T01:01:01.006 | A   | 1    | avg(qty) > qty |\n| 2024.10.08T01:01:01.006 | A   | 2    | qty < 4        |\n| 2024.10.08T01:01:01.006 | B   | 0    | sum(qty) > 5   |\n| 2024.10.08T01:01:01.007 | B   | 1    | avg(qty) > qty |\n| 2024.10.08T01:01:01.007 | B   | 2    | qty < 4        |\n"
    },
    "DStream::asofJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_asofJoinEngine.html",
        "signatures": [
            {
                "full": "DStream::asofJoinEngine(rightStream, metrics, matchingColumn, [timeColumn], [useSystemTime=false], [delayedTime], [garbageSize], [sortByTime])",
                "name": "DStream::asofJoinEngine",
                "parameters": [
                    {
                        "full": "rightStream",
                        "name": "rightStream"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[delayedTime]",
                        "name": "delayedTime",
                        "optional": true
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[sortByTime]",
                        "name": "sortByTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::asofJoinEngine](https://docs.dolphindb.com/en/Functions/d/DStream_asofJoinEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::asofJoinEngine(rightStream, metrics, matchingColumn, \\[timeColumn], \\[useSystemTime=false], \\[delayedTime], \\[garbageSize], \\[sortByTime])\n\n#### Details\n\nCreates an asof join streaming engine. For details, see [createAsofJoinEngine](https://docs.dolphindb.com/en/Functions/c/createAsofJoinEngine.html).\n\n#### Parameters\n\n**rightStream** is a DStream object indicating the input data source of the right table.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://test.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions), or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n* *metrics* can be functions with multiple returns and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\n* To specify a column that exists in both the left and the right tables, use the format *tableName.colName*.\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**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.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the columns are named \"orderNo\" and \"sym\" in the left table, whereas in the right table they're named \"orderNo\" and \"sym1\", then *matchingColumn* = \\[\\[\\`orderNo, \\`sym], \\[\\`orderNo,\\`sym1]].\n\n**timeColumn** (optional) specifies the name of the time column in the left table and the right table. The time columns must have the same data type. When *useSystemTime* = false, it must be specified. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**useSystemTime** (optional) indicates whether the left table and the right table are joined on the system time, instead of on *timeColumn*.\n\n* *useSystemTime* = true: join records based on the system time (timestamp with millisecond precision) when they are ingested into the engine.\n* *useSystemTime* = false (default): join records based on the specified \\*timeColumn\\* from the left table and the right table.\n\n**delayedTime** (optional) is a positive integer with the same precision as *timeColumn*, indicating the maximum time to wait before the engine joins an uncalculated record in the left table with a right table record. To specify *delayedTime*, *timeColumn* must be specified. For more information, see Details.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (rows). As the subscribed data is ingested into the engine, it continues to take up the memory. Within the left/right table, the records are grouped by *matchingColumn* values; When the number of records in a group exceeds *garbageSize*, the system will remove those already been calculated from memory.\n\n**sortByTime** (optional) is a Boolean value that indicates whether the output data is globally sorted by time. The default value is false, meaning the output data is sorted only within groups. Note that if *sortByTime* is set to true, the parameter *delayedTime* cannot be specified, and the data input to the left and right tables must be globally sorted.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('asofJoin')\n\ng = createStreamGraph('asofJoin')\nr = g.source(\"right\", 1024:0, `time`sym`bid`ask, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE])\ng.source(\"left\", 1024:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\n    .asofJoinEngine(r, <[price, bid, ask, abs(price-(bid+ask)/2)]>, `sym, `time)\n    .sink(\"output\")\ng.submit()\ngo\n\ntmp1=table(2024.08.27T09:30:00.000+2 8 20 22 23 24 as time, take(`A`B, 6) as sym, 20.01 20.04 20.07 20.08 20.4 20.5 as price)\ntmp1.sortBy!(`time)\nappendOrcaStreamTable(\"left\", tmp1)\n\ntmp2=table(2024.08.27T09:30:00.000+1 5 6 11 19 20 21 as time, take(`A`B, 7) as sym, 20 20.02 20.03 20.05 20.06 20.6 20.4 as bid,  20.01 20.03 20.04 20.06 20.07 20.5 20.6 as ask)\nappendOrcaStreamTable(\"right\", tmp2)\n\nselect * from orca_table.output\n```\n\n| time                    | sym | price | bid   | ask   | abs                  |\n| ----------------------- | --- | ----- | ----- | ----- | -------------------- |\n| 2024.08.27 09:30:00.002 | A   | 20.01 | 20.00 | 20.01 | 0.004999999999999005 |\n| 2024.08.27 09:30:00.020 | A   | 20.07 | 20.06 | 20.07 | 0.005000000000002558 |\n| 2024.08.27 09:30:00.008 | B   | 20.04 | 20.02 | 20.03 | 0.015000000000000568 |\n"
    },
    "DStream::buffer": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_buffer.html",
        "signatures": [
            {
                "full": "DStream::buffer(name, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "DStream::buffer",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::buffer](https://docs.dolphindb.com/en/Functions/d/DStream_buffer.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::buffer(name, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted shared stream table to store intermediate results in stream processing.\n\nFor more information on table persistence, refer to the [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html) documentation.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\n\ng.source(\"trade\", 1:0, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n    .timeSeriesEngine(windowSize=60, step=60, metrics=[<first(price) as open>, <max(price) as high>, <min(price) as low>, <last(price) as close>, <sum(volume) as volume>], timeColumn=`time, keyColumn=`symbol)\n    .buffer(\"bufferTable\")\n```\n"
    },
    "DStream::changelogSink": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_changelogSink.html",
        "signatures": [
            {
                "full": "DStream::changelogSink(name, keyColumn, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "DStream::changelogSink",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::changelogSink](https://docs.dolphindb.com/en/Functions/d/DStream_changelogSink.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nDStream::changelogSink(name, keyColumn, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nOutputs the stream data to a persisted keyed stream table with a status column.\n\nFor more information on keyed stream tables, refer to the [changelogStreamTable](https://docs.dolphindb.com/en/Functions/c/changelogStreamTable.html) documentation.\n\n#### Parameters\n\n**name** A string specifying the name of the target tream table.\n\n**keyColumn** A string scalar or vector specifying the primary key column(s).\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA table.\n\n**Related functions**: [changelogStreamTable](https://docs.dolphindb.com/en/Functions/c/changelogStreamTable.html), [StreamGraph::changelogSource](https://docs.dolphindb.com/en/Functions/s/StreamGraph_changelogSource.html)\n"
    },
    "DStream::crossSectionalEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_crossSectionalEngine.html",
        "signatures": [
            {
                "full": "DStream::crossSectionalEngine(metrics, keyColumn, [triggeringPattern='perBatch'], [triggeringInterval=1000], [useSystemTime=true], [timeColumn], [lastBatchOnly=false], [contextByColumn], [roundTime=true], [keyFilter])",
                "name": "DStream::crossSectionalEngine",
                "parameters": [
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[triggeringPattern='perBatch']",
                        "name": "triggeringPattern",
                        "optional": true,
                        "default": "'perBatch'"
                    },
                    {
                        "full": "[triggeringInterval=1000]",
                        "name": "triggeringInterval",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[useSystemTime=true]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[lastBatchOnly=false]",
                        "name": "lastBatchOnly",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[contextByColumn]",
                        "name": "contextByColumn",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[keyFilter]",
                        "name": "keyFilter",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::crossSectionalEngine](https://docs.dolphindb.com/en/Functions/d/DStream_crossSectionalEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::crossSectionalEngine(metrics, keyColumn, \\[triggeringPattern='perBatch'], \\[triggeringInterval=1000], \\[useSystemTime=true], \\[timeColumn], \\[lastBatchOnly=false], \\[contextByColumn], \\[roundTime=true], \\[keyFilter])\n\n#### Details\n\nCreates a cross-sectional streaming engine. For details, see [createCrossSectionalEngine](https://docs.dolphindb.com/en/Functions/c/createCrossSectionalEngine.html).\n\n#### Parameters\n\n**metrics** (optional) is metacode or a tuple specifying the formulas for calculation. It can be:\n\n* Built-in or user-defined aggregate functions, e.g., `<[sum(qty), avg(price)]>`; Or expressions on previous results, e.g., `<[avg(price1)-avg(price2)]>`; Or calculation on multiple columns, e.g., `<[std(price1-price2)]>`\n\n* Functions with multiple returns, such as `<func(price) as `col1`col2>`. The column names can be specified or not. For more information about metacode, see [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**keyColumn** is a STRING scalar or vector that specifies one or more columns in the stream table as the key columns. For each unique value in the *keyColumn*, only the latest record is used in the calculation.\n\n**triggeringPattern** (optional) is a STRING scalar specifying how to trigger the calculations. The engine returns a result every time a calculation is triggered. It can take one of the following values:\n\n* 'perBatch' (default): calculates when a batch of data arrives.\n\n* 'perRow': calculates when a new record arrives.\n\n* 'interval': calculates at intervals specified by *triggeringInterval*, using system time.\n\n* 'keyCount': When data with the same timestamp arrives in batches, the calculation is triggered when:\n\n  * if the number of keys with the latest timestamp reaches *triggeringInterval*;\n\n  * or data with newer timestamp arrives.\n\n* 'dataInterval': calculates at intervals based on timestamps in the data. To use this, *timeColumn* must be specified and *useSystemTime* must be false.\n\nNote: To set *triggeringPattern* as 'keyCount', *timeColumn* must be specified and *useSystemTime* must be set to false. In this case, the out-of-order data will be discarded.\n\n**triggeringInterval** (optional) can be an integer or a tuple. Below explains its optional values and triggering rules:\n\n* If *triggeringPattern* = 'interval', *triggeringInterval* is a positive integer indicating the interval in milliseconds between 2 adjacent calculations. The default value is 1,000. Every *triggeringInterval* milliseconds, the system checks if the data in the engine has been calculated; if not, a calculation is triggered.\n\n* If *triggeringPattern* = 'keyCount', *triggeringInterval* can be:\n\n  * an integer specifying a threshold. Before data with a greater timestamp arrives, a calculation is triggered when the number of uncalculated records reaches the threshold.\n\n  * a tuple of 2 elements. The first element is an integer indicating the threshold of the number records with the latest timestamp to trigger calculation. The second element is an integer or duration value.\n\n  For example, when *triggeringInterval* is set to (c1, c2):\n\n  * If c2 is an integer and the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system goes on to save data with greater 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 greater timestamp t3 (t3>t2) arrives. Note that c2 must be smaller than c1.\n\n  * If c2 is a duration and the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system goes on to save data with greater 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 greater timestamp t3 (t3>t2) arrives, or the duration c2 comes to an end.\n\n* If *triggeringPattern*= 'dataInterval', *triggeringInterval* is a positive integer measured in the same units as the timestamps in *timeColumn*. The default is 1,000. Starting with the first record, a window is started at intervals defined by *triggeringInterval*, based on the timestamp units. When the first record of the next window arrives, a calculation is triggered on all data in the current window.\n\n  * In versions 2.00.11.21.30.23.2 and earlier, a calculation is triggered for each window.\n\n  * Since version 2.00.11.31.30.23.3, a calculation is triggered only for windows containing data.\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* If *useSystemTime* = true, the time column of outputTable is the system time;\n\n* If *useSystemTime* = false, the parameter timeColumn must be specified. The time column of *outputTable* uses the timestamp of each record.\n\n**timeColumn** (optional) is a STRING scalar which specifies the time column in the stream table to which the engine subscribes if *useSystemTime* = false. It can only be of TIMESTAMP type.\n\n**lastBatchOnly** (optional) is a Boolean value indicating whether to keep only the records with the latest timestamp in the engine. When *lastBatchOnly* = true, *triggeringPattern* must take the value 'keyCount', and the cross-sectional engine only maintains key values with the latest timestamp for calculation. Otherwise, the engine updates and retains all values for calculation.\n\n**contextByColumn** (optional) is a STRING scalar or vector indicating the grouping column(s) based on which calculations are performed by group. This parameter only takes effect if *metrics* and *outputTable* are specified. If *metrics* only contains aggregate functions, the calculation results would be the same as a SQL query using `group by`. Otherwise, the results would be consistent with that using `context by`.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary when *triggeringPattern*='dataInterval'. The default value is true indicating the alignment is based on the multi-minute rule (see the [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.md#) of time-series engine). False means alignment is based on the one-minute rule.\n\n**keyFilter** (optional) is metacode of an expression or function call that returns a Boolean vector. It specifies the conditions for filtering keys in the keyed table returned by the engine. Only data with keys satisfying the filtering conditions will be taken for calculation.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('cs')\n\ncsGraph = createStreamGraph(\"cs\")\ncsGraph.source(\"trade1\", 1000:0, `time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT])\n  .crossSectionalEngine(metrics=<[avg(price), sum(volume), sum(price*volume), count(price)]>, keyColumn=`sym)\n  .sink(\"cs_output\")\ncsGraph.submit()\ngo\n\ntimes=2020.08.12T09:30:00.000 + 123 234 456 678 890 901\nsyms=`A`B`A`B`B`A\nprices=10 20 10.1 20.1 20.2 10.2\nvolumes=20 10 20 30 40 20\ntmp=table(times as time, syms as sym, prices as price, volumes as volume)\n\nappendOrcaStreamTable(\"trade1\", tmp)\n\nselect * from orca_table.cs_output;\n```\n"
    },
    "DStream::cryptoOrderBookEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_cryptoOrderBookEngine.html",
        "signatures": [
            {
                "full": "DStream::cryptoOrderBookEngine(inputColMap, depth, [updateRule='direct'], [errorHandler=NULL], [cachingInterval=5000], [timeout=-1], [cachedDepth])",
                "name": "DStream::cryptoOrderBookEngine",
                "parameters": [
                    {
                        "full": "inputColMap",
                        "name": "inputColMap"
                    },
                    {
                        "full": "depth",
                        "name": "depth"
                    },
                    {
                        "full": "[updateRule='direct']",
                        "name": "updateRule",
                        "optional": true,
                        "default": "'direct'"
                    },
                    {
                        "full": "[errorHandler=NULL]",
                        "name": "errorHandler",
                        "optional": true,
                        "default": "NULL"
                    },
                    {
                        "full": "[cachingInterval=5000]",
                        "name": "cachingInterval",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[timeout=-1]",
                        "name": "timeout",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[cachedDepth]",
                        "name": "cachedDepth",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::cryptoOrderBookEngine](https://docs.dolphindb.com/en/Functions/d/DStream_cryptoOrderBookEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::cryptoOrderBookEngine(inputColMap, depth, \\[updateRule='direct'], \\[errorHandler=NULL], \\[cachingInterval=5000], \\[timeout=-1], \\[cachedDepth])\n\n#### Details\n\nCreates a real-time order book engine for cryptocurrency stream processing, which updates the order book in real time based on full-depth snapshots and incremental depth information. For details, see [createCryptoOrderBookEngine](https://docs.dolphindb.com/en/Functions/c/createCryptoOrderBookEngine.html).\n\n#### Parameters\n\n**inputColMap** is a dictionary mapping column names in *dummyTable* to the required columns.\n\n**depth** is an integer or dictionary specifying the depth of the order book.\n\n* Integer: Applies the same depth for all cryptocurrencies.\n* Dictionary: Keys are cryptocurrency codes, and values are the depth for each. If a cryptocurrency is not specified, it will not output an order book result.\n\n**updateRule** (optional) is a string specifying the order book update rule.\n\n* \"direct\" (default): Updates directly based on isIncremental field (true for update, false for overwrite).\n* \"general\": General update rule, requiring streaming data with monotonically increasing update IDs.\n* \"Binance-spot\": Update rule for Binance spot data.\n* \"Binance-futures\": Update rule for Binance futures data.\n\n**errorHandler** (optional) is a UDF to handle errors when incremental data is missing. It takes two arguments:\n\n* The first argument is a string representing the cryptocurrency code.\n* The second argument is an integer representing the error code, with possible values:\n  * **1**: Received old data.\n  * **2**: Received out-of-order data expected at a future time.\n  * **3**: Timeout, indicating no new order book update within the specified time.\n  * **4**: Crossed prices error, where the highest bid is greater than or equal to the lowest ask.\n\n**cachingInterval**(optional) is an integer indicating the interval (in milliseconds) within which incremental data is cached. The default is 5000. For each crypto, data is retained in the cache if the time difference between the first data in cache and the latest is no greater than *cachingInterval*.\n\n**timeout** (optional) is an integer specifying the timeout period in milliseconds. The default is -1 (no timeout). If order book is not updated within this period, the *errorHandler* will be invoked.\n\n**cachedDepth** (optional) is an integer or dictionary specifying the depth for cached order books.\n\n* Integer: Applies the same depth for cached order books for all cryptocurrencies.\n* Dictionary: Keys are cryptocurrency codes, and values are the depth for each. If a cryptocurrency is not specified, full-depth order books are cached.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// Define input table schema\ncolNames = `isIncremental`exchange`eventTime`transactionTime`symbol`firstUpdateId`lastUpdateId`prevLastUpdateId`bidPrice`bidQty`askPrice`askQty\ncolTypes = [BOOL, SYMBOL, TIMESTAMP, TIMESTAMP, SYMBOL, LONG, LONG, LONG, DECIMAL128(18)[], DECIMAL128(8)[], DECIMAL128(18)[], DECIMAL128(8)[]]\n\ninputTarget = [\"symbol\", \"eventTime\", \"isIncremental\", \"bidPrice\", \"bidQty\", \"askPrice\", \"askQty\", \"lastUpdateId\", \"firstUpdateId\", \"prevLastUpdateId\"]\ninputSource = [\"symbol\", \"eventTime\", 'isIncremental', 'bidPrice', 'bidQty', 'askPrice', 'askQty', 'lastUpdateId', 'firstUpdateId', 'prevLastUpdateId']\n\n// Map input columns\ninputColMap = dict(inputTarget, inputSource)\n\n// Set depth\ndepth = dict([\"BTCUSDT\"], [1000])\n\ncptGraph = createStreamGraph(\"cptEngine\")\ncptGraph.source(\"cptInput\", 1000:0, colNames,colTypes)\n.cryptoOrderBookEngine(inputColMap, depth)\n.sink(\"output\")\ncptGraph.submit()\n```\n"
    },
    "DStream::dailyTimeSeriesEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_dailyTimeSeriesEngine.html",
        "signatures": [
            {
                "full": "DStream::dailyTimeSeriesEngine(windowSize, step, metrics, sessionBegin, [sessionEnd], [timeColumn], [useSystemTime=false], [keyColumn], [updateTime], [useWindowStartTime], [roundTime=true], [fill='none'], [mergeSessionEnd=false], [forceTriggerTime], [forceTriggerSessionEndTime], [keyPurgeFreqInSecond], [closed='left'], [subWindow], [parallelism=1],[acceptedDelay=0], [keyPurgeDaily=true])",
                "name": "DStream::dailyTimeSeriesEngine",
                "parameters": [
                    {
                        "full": "windowSize",
                        "name": "windowSize"
                    },
                    {
                        "full": "step",
                        "name": "step"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "sessionBegin",
                        "name": "sessionBegin"
                    },
                    {
                        "full": "[sessionEnd]",
                        "name": "sessionEnd",
                        "optional": true
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime]",
                        "name": "useWindowStartTime",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[mergeSessionEnd=false]",
                        "name": "mergeSessionEnd",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[forceTriggerSessionEndTime]",
                        "name": "forceTriggerSessionEndTime",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[subWindow]",
                        "name": "subWindow",
                        "optional": true
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[acceptedDelay=0]",
                        "name": "acceptedDelay",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[keyPurgeDaily=true]",
                        "name": "keyPurgeDaily",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::dailyTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/d/DStream_dailyTimeSeriesEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::dailyTimeSeriesEngine(windowSize, step, metrics, sessionBegin, \\[sessionEnd], \\[timeColumn], \\[useSystemTime=false], \\[keyColumn], \\[updateTime], \\[useWindowStartTime], \\[roundTime=true], \\[fill='none'], \\[mergeSessionEnd=false], \\[forceTriggerTime], \\[forceTriggerSessionEndTime], \\[keyPurgeFreqInSecond], \\[closed='left'], \\[subWindow], \\[parallelism=1],\\[acceptedDelay=0], \\[keyPurgeDaily=true])\n\n#### Details\n\nCreates a daily time-series streaming engine. For details, see [createDailyTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createDailyTimeSeriesEngine.html).\n\n#### Parameters\n\n**windowSize** is a scalar or vector with positive integers that specifies the size of the windows for calculation.\n\n**step** is a positive integer indicating how much each window moves forward relative to the previous one. Note that step must be divisible by *windowSize*, otherwise an exception will be thrown.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n* The metacode can be a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n* If *metrics* is a tuple with multiple formulas, *windowSize* is specified as a vector of the same length as *metrics*. Each element of *windowSize* corresponds to the elements 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)>]]`.\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**sessionBegin** can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the starting time of each session. If it is a vector, it must be increasing.\n\n**sessionEnd** (optional) can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the end time of each session. Specify *sessionEnd* as 00:00:00 to indicate the beginning of the next day (i.e., 24:00:00 of the current day).\n\n**timeColumn** (optional) is a STRING scalar or vector specifying the time column(s) of the subscribed stream table. When *useSystemTime* = false, it must be specified.\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* *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.\n* *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. Note that the record which triggers the calculation will not participate in this calculation.\n\nFor 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.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\n**updateTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*. It is used to trigger window calculations at an interval shorter than *step*. *step* must be a multiple of *updateTime*. To specify *updateTime*, *useSystemTime* must be set to false.\n\n**useWindowStartTime** (optional) is a Boolean value indicating whether the time column in *outputTable* is the starting time of the windows. The default value is false, which means the timestamps in the output table are the end time of the windows. If the *windowSize* is a vector, *useWindowStartTime* must be false.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary if the time precision is milliseconds or seconds and step is bigger than one minute. The default value is true indicating the alignment is based on the multi-minute rule (see the [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.md#)). False means alignment is based on the one-minute rule.\n\n**fill** (optional) is a vector/scalar indicating the filling method to deal with an empty window (in a group). It can be:\n\n* 'none': no result\n* 'null': output a null value.\n* 'ffill': output the result in the last window.\n* specific value: output the specified value. Its type should be the same as metrics output's type.\n\n*fill* could be a vector to specify different filling method for each metric. The size of the vector must be consistent with the number of elements specified in *metrics*. The element in vector cannot be 'none'.\n\n**mergeSessionEnd** (optional) is a Boolean value. This parameter is only applicable when *closed* = 'left'. It determines whether the record arriving at the end of a session will be included in the calculation of the last window of that session. The default value is false, which means the record will not be included in the last window but will trigger its calculation. If the current session is not the last session of the day, the record will participate in the calculation of the first window of the next session.\n\n**forceTriggerTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*, indicating the waiting time to force trigger calculation in the uncalculated windows for each group. If *forceTriggerTime* is set, *useSystemTime* must be false and *updateTime* cannot be specified.\n\n**forceTriggerSessionEndTime** (optional) is a positive integer. The unit of *forceTriggerSessionEndTime* is consistent with the precision of *timeColumn*. It indicates the waiting time to force trigger calculation in the window containing the *sessionEnd*, if it ends without calculation.\n\n**keyPurgeFreqInSec** (optional) is a positive integer, measured in seconds. It controls the periodic cleanup of keys corresponding to groups where \"window data is empty,\" in order to prevent excessive memory usage caused by the continuous growth of keys. When this parameter is specified, if the time interval between the current data insertion time and the last cleanup time is greater than or equal to *keyPurgeFreqInSec*, the group with empty window data and its corresponding key will be deleted.\n\n**closed** (optional) is a STRING indicating whether the left or the right boundary is included.\n\n* closed = 'left': left-closed, right-open\n* closed = 'right': left-open, right-closed\n\n**subWindow**(optional)is a pair of integers or DURATION values, indicating the range of the subwindow within the window specified by *windowSize*. If specified, only results calculated within subwindows will be returned and the time column of the output table displays the end time of each subwindow. The calculation of the subwindow will be triggered by the arrival of the next record after the subwindow ends. The boundary of the subwindow is determined by parameter *closed*. When *subWindow* is a pair of integers, it takes the same time precision as *timeColumn*.\n\n**parallelism** (optional) is a positive integer no greater than 63, representing the number of worker threads for parallel computation. The default value is 1. For compute-intensive workloads, adjusting this parameter appropriately can effectively utilize computing resources and reduce computation time. It is recommended to set a value less than the number of CPU cores, normally from 4 to 8.\n\n**acceptedDelay** (optional) is a positive integer specifying the maximum delay for each window to accept data. The default value is 0.\n\n* When *useSystemTime*=true, data received within the *acceptedDelay*time after the window ends will still be considered part of the current window and participate in the computation, and will not be included in the computation of the next window.\n* When *useSystemTime*=false, a window with t as right boundary will wait until a record with a timestamp equal to or later than t + *acceptedDelay* arrives. When such a record arrives, the current window closes and performs a calculation on all records within the window frame. This handles scenarios with out-of-order data.\n\n**keyPurgeDaily** (optional) is a Boolean value determining if existing data groups are automatically removed when newer data of a subsequent calendar day is ingested. The default value is true. If set to false, groups of the previous calendar day are retained.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('DailyTimeSeries')\n\ng = createStreamGraph('DailyTimeSeries')\n\ng.source(\"trades\", 1000:0, `date`second`sym`volume, [DATE, SECOND, SYMBOL, INT])\n.dailyTimeSeriesEngine(windowSize=60, step=60, metrics=<[sum(volume)]>, sessionBegin=09:30:00 13:00:00, sessionEnd=11:30:00 15:00:00, timeColumn=`date`second, mergeSessionEnd=true)\n.sink(\"output\")\ng.submit()\ngo\n\ndates=take(date(2025.05.07),8)\nseconds=[09:25:31, 09:26:01, 09:30:02, 09:30:10, 11:29:46, 11:29:50, 11:30:00, 11:30:01]\nsyms=[\"A\", \"B\", \"A\", \"B\", \"A\", \"B\", \"B\", \"A\"]\nvolumes=[8, 10, 26, 14, 30, 11, 14, 4]\ntmp=table(dates as date, seconds as second, syms as sym, volumes as volume)\nappendOrcaStreamTable(\"trades\", tmp)\nselect * from orca_table.output\n```\n\n| concatDateTime      | sum\\_volume |\n| ------------------- | ----------- |\n| 2025.05.07 09:31:00 | 58          |\n| 2025.05.07 11:30:00 | 55          |\n"
    },
    "DStream::dualOwnershipReactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_dualOwnershipReactiveStateEngine.html",
        "signatures": [
            {
                "full": "DStream::dualOwnershipReactiveStateEngine(metrics1, metrics2, keyColumn1, keyColumn2, [keyPurgeFilter1], [keyPurgeFilter2], [keyPurgeFreqInSecond=0])",
                "name": "DStream::dualOwnershipReactiveStateEngine",
                "parameters": [
                    {
                        "full": "metrics1",
                        "name": "metrics1"
                    },
                    {
                        "full": "metrics2",
                        "name": "metrics2"
                    },
                    {
                        "full": "keyColumn1",
                        "name": "keyColumn1"
                    },
                    {
                        "full": "keyColumn2",
                        "name": "keyColumn2"
                    },
                    {
                        "full": "[keyPurgeFilter1]",
                        "name": "keyPurgeFilter1",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter2]",
                        "name": "keyPurgeFilter2",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=0]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::dualOwnershipReactiveStateEngine](https://docs.dolphindb.com/en/Functions/d/DStream_dualOwnershipReactiveStateEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::dualOwnershipReactiveStateEngine(metrics1, metrics2, keyColumn1, keyColumn2, \\[keyPurgeFilter1], \\[keyPurgeFilter2], \\[keyPurgeFreqInSecond=0])\n\n#### Details\n\nCreates a dual-ownership reactive state streaming engine. For details, see [createDualOwnershipReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createDualOwnershipReactiveStateEngine.html).\n\n#### Parameters\n\nOnly the parameters of `dualOwnershipReactiveStateEngine` and `reactiveStateEngine` with different usages are explained here.\n\nFor data grouped by *keyColumn1*, they are calculated based on *metrics1* and purged based on *keyPurgeFilter1*; For data grouped by *keyColumn2*, they are calculated based on *metrics2* and purged based on *keyPurgeFilter2*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('dualOwnershipReactive')\n\ng = createStreamGraph('dualOwnershipReactive')\n\ng.source(\"trades\", 1000:0, `date`time`sym`market`price`qty, [DATE, TIME, SYMBOL, CHAR, DOUBLE, INT])\n.dualOwnershipReactiveStateEngine(metrics1=<mfirst(price, 3)>, metrics2=<mmax(price, 3)>, keyColumn1=`date`sym, keyColumn2=`date`market)\n.sink(\"output\")\ng.submit()\ngo\n\ndates=take(2012.01.01, 10) join take(2012.01.02, 4)\ntimes=[09:00:00.030, 09:00:00.030, 09:00:00.031, 09:00:00.031, 09:00:00.031, 09:00:00.033, 09:00:00.033, 09:00:00.034, 09:00:00.034, 09:00:00.035, 09:00:00.031, 09:00:00.032, 09:00:00.032, 09:00:00.040]\nsyms=[`a, `a, `b, `a, `a, `b, `a, `b, `b, `a, `b, `a, `b, `c]\nmarkets=['B', 'B', 'A', 'B', 'A', 'B', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B']\nprices=[10.65, 10.59, 10.59, 10.65, 10.59, 10.59, 10.59, 10.59, 10.22, 11.0, 10.22, 11.0, 15.6, 13.2]\nqtys=[1500, 2500, 2500, 1500, 2500, 2500, 2500, 2500, 1200, 2500, 1200, 2500, 1300, 2000]\ntmp=table(dates as date, times as time, syms as sym, markets as market, prices as price, qtys as qty)\n\nappendOrcaStreamTable(\"trades\", tmp)\nselect * from orca_table.output\n```\n\n| date       | sym | market | mfirst\\_price | mmax\\_price |\n| ---------- | --- | ------ | ------------- | ----------- |\n| 2012.01.01 | a   | B      |               |             |\n| 2012.01.01 | a   | B      |               |             |\n| 2012.01.01 | b   | A      |               |             |\n| 2012.01.01 | a   | B      | 10.65         | 10.65       |\n| 2012.01.01 | a   | A      | 10.59         |             |\n| 2012.01.01 | b   | B      |               | 10.65       |\n| 2012.01.01 | a   | A      | 10.65         | 10.59       |\n| 2012.01.01 | b   | A      | 10.59         | 10.59       |\n| 2012.01.01 | b   | A      | 10.59         | 10.59       |\n| 2012.01.01 | a   | A      | 10.59         | 11          |\n"
    },
    "DStream::equalJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_equalJoinEngine.html",
        "signatures": [
            {
                "full": "DStream::equalJoinEngine(rightStream, metrics, matchingColumn, timeColumn, [garbageSize=5000], [maxDelayedTime])",
                "name": "DStream::equalJoinEngine",
                "parameters": [
                    {
                        "full": "rightStream",
                        "name": "rightStream"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[garbageSize=5000]",
                        "name": "garbageSize",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[maxDelayedTime]",
                        "name": "maxDelayedTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::equalJoinEngine](https://docs.dolphindb.com/en/Functions/d/DStream_equalJoinEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::equalJoinEngine(rightStream, metrics, matchingColumn, timeColumn, \\[garbageSize=5000], \\[maxDelayedTime])\n\n#### Details\n\nCreates an equi join streaming engine. For details, see [createEquiJoinEngine](https://docs.dolphindb.com/en/Functions/c/createEquiJoinEngine.html).\n\n#### Parameters\n\n**rightStream** is a DStream object indicating the input data source of the right table.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://test.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions), or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n* *metrics* can be functions with multiple returns and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\n* To specify a column that exists in both the left and the right tables, use the format *tableName.colName*.\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**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.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the columns are named \"orderNo\" and \"sym\" in the left table, whereas in the right table they're named \"orderNo\" and \"sym1\", then *matchingColumn* = \\[\\[\\`orderNo, \\`sym], \\[\\`orderNo,\\`sym1]].\n\n**timeColumn** is a STRING scalar or vector indicating the time columns in the left table and the right table. The time columns in the left and right tables must have the same data type. When the two time columns have the same column name, *timeColumn* is a string scalar; otherwise, *timeColumn* is vector of two strings.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (in unit of rows). When the number of rows of historical data in memory exceeds the *garbageSize*, the system will remove the historical data that is not needed for the current calculation on the following conditions:\n\n* The historical data has already been joined and returned.\n\n* For historical data that has not been joined, if the timestamp difference between the historical data and the new arriving data in left/right table has exceeded the *maxDelayedTime*, it will also be discarded.\n\n**maxDelayedTime** (optional) is a positive integer with the default value of 3 (seconds), indicating the maximum time to keep cached data in the engine. This parameter only takes effect when the conditions described in *garbageSize* are met. It is not recommended to set the *maxDelayedTime* too small in case data got removed before it is joined.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('joinEngine')\ng = createStreamGraph('joinEngine')\nr = g.source(\"right\", 1024:0, `time`sym`val, [SECOND, SYMBOL, DOUBLE])\ng.source(\"left\", 1024:0, `time`sym`price, [SECOND, SYMBOL, DOUBLE])\n    .equalJoinEngine(r, [<price>, <val>, <price*val>], `sym, `time)\n    .sink(\"output\")\ng.submit()\n\ngo\n\ntmp1=table(13:30:10+1..20 as time, take(`AAPL, 10) join take(`IBM, 10) as sym, double(1..20) as price)\nappendOrcaStreamTable(\"left\", tmp1)\n\ntmp2=table(13:30:10+1..20 as time, take(`AAPL, 10) join take(`IBM, 10) as sym, double(50..31) as val)\nappendOrcaStreamTable(\"right\", tmp2)\n\nselect * from orca_table.output\n```\n"
    },
    "DStream::fork": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_fork.html",
        "signatures": [
            {
                "full": "DStream::fork(count)",
                "name": "DStream::fork",
                "parameters": [
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::fork](https://docs.dolphindb.com/en/Functions/d/DStream_fork.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::fork(count)\n\n#### Details\n\nForks the stream data into multiple downstream branches by broadcasting the data to each. Each resulting DStream can be processed independently, supporting parallel or divergent processing logic.\n\n#### Parameters\n\n**count** An integer specifying the number of branches.\n\n#### Returns\n\nA list of DStream instances.\n\n#### Examples\n\nForks the stream data for downstream 1-minute and 5-minute factor calculations:\n\n```\nuse catalog test\n\ng = createStreamGraph(\"indicators\")\nsourceStreams = g.source(\"trade\", 1024:0, `symbol`datetime`price`volume, [SYMBOL, TIMESTAMP,DOUBLE, INT])\n    .fork(2)\nstream_1min = sourceStreams[0]\n    .timeSeriesEngine(60*1000, 60*1000, <[first(price),max(price),min(price),last(price),sum(volume)]>, \"datetime\", false, \"symbol\")\n    .reactiveStateEngine(<[datetime, first_price, max_price, min_price, last_price, sum_volume, mmax(max_price, 5), mavg(sum_volume, 5)]>, `symbol)\n    .sink(\"output_1min\")\nstream_5min = sourceStreams[1]\n    .timeSeriesEngine(5*60*1000, 5*60*1000, <[first(price),max(price),min(price),last(price),sum(volume)]>, \"datetime\", false, \"symbol\")\n    .reactiveStateEngine(<[datetime, first_price, max_price, min_price, last_price, sum_volume, mmax(max_price, 5), mavg(sum_volume, 5)]>, `symbol)\n    .sink(\"output_5min\")\ng.submit()\n```\n"
    },
    "DStream::getOutputSchema": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_getOutputSchema.html",
        "signatures": [
            {
                "full": "DStream::getOutputSchema()",
                "name": "DStream::getOutputSchema",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [DStream::getOutputSchema](https://docs.dolphindb.com/en/Functions/d/DStream_getOutputSchema.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::getOutputSchema()\n\n#### Details\n\nReturns the schema of the current DStream object.\n\n#### Parameters\n\nNone.\n\n#### Examples\n\n```\naggGraph = createStreamGraph(\"aggregation\")\nengine = aggGraph.source(\"trade\", 1000:0, `time`sym`price, [TIMESTAMP, SYMBOL, FLOAT])\n\t.timeSeriesEngine(windowSize=60, step=60, metrics=[<sum(price)>], \ntimeColumn=\"time\", keyColumn=\"sym\")\nengine.getOutputSchema()\n\n/* output:\ntime sym sum_price\n---- --- ---------\n*/\n```\n"
    },
    "DStream::haBuffer": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_haBuffer.html",
        "signatures": [
            {
                "full": "DStream::haBuffer(name, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "DStream::haBuffer",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::haBuffer](https://docs.dolphindb.com/en/Functions/d/DStream_haBuffer.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::haBuffer(name, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nCreates a high-availability stream table to store intermediate results in stream processing.\n\nFor more information on table persistence, refer to the [haStreamTable](https://docs.dolphindb.com/en/Functions/h/haStreamTable.html) documentation.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nlogin(`admin,`123456)\n\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\n\ng.source(\"trade\", `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n    .timeSeriesEngine(windowSize=60, step=60, metrics=[<first(price) as open>, <max(price) as high>, <min(price) as low>, <last(price) as close>, <sum(volume) as volume>], timeColumn=`time, keyColumn=`symbol)\n    .haBuffer(name=\"ha_Table\", raftGroup=3, cacheLimit=5)\n```\n"
    },
    "DStream::haKeyedBuffer": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_haKeyedBuffer.html",
        "signatures": [
            {
                "full": "DStream::haKeyedBuffer(name, keyColumn, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "DStream::haKeyedBuffer",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::haKeyedBuffer](https://docs.dolphindb.com/en/Functions/d/DStream_haKeyedBuffer.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::haKeyedBuffer(name, keyColumn, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nCreates a high-availability keyed stream table to store intermediate results in stream processing.\n\nFor more information on table persistence, refer to the [haStreamTable](https://docs.dolphindb.com/en/Functions/h/haStreamTable.html) documentation.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** A string scalar or vector specifying the primary key column(s).\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\n\ng.source(\"trade\", `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n    .timeSeriesEngine(windowSize=60, step=60, metrics=[<first(price) as open>, <max(price) as high>, <min(price) as low>, <last(price) as close>, <sum(volume) as volume>], timeColumn=`time, keyColumn=`symbol)\n    .haKeyedBuffer(name=\"ha_keyedTable\", keyColumn=`symbol, raftGroup=3, cacheLimit=5000)\n```\n"
    },
    "DStream::haKeyedSink": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_haKeyedSink.html",
        "signatures": [
            {
                "full": "DStream::haKeyedSink(name, keyColumn, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "DStream::haKeyedSink",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::haKeyedSink](https://docs.dolphindb.com/en/Functions/d/DStream_haKeyedSink.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::haKeyedSink(name, keyColumn, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nOutputs stream data to a high-availability keyed stream table.\n\nFor more information on HA stream tables, refer to the [haStreamTable](https://docs.dolphindb.com/en/Functions/h/haStreamTable.html) documentation.\n\n#### Parameters\n\n**name** A string specifying the name of the target stream table.\n\n**keyColumn** A string scalar or vector specifying the primary key column(s).\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA DStream object.\n"
    },
    "DStream::haSink": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_haSink.html",
        "signatures": [
            {
                "full": "DStream::haSink(name, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "DStream::haSink",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::haSink](https://docs.dolphindb.com/en/Functions/d/DStream_haSink.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::haSink(name, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nOutputs the stream data to a high-availability stream table.\n\nFor more information on HA stream tables, refer to the [haStreamTable](https://docs.dolphindb.com/en/Functions/h/haStreamTable.html) documentation.\n\n#### Parameters\n\n**name** A string specifying the name of the target stream table.\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA DStream object.\n"
    },
    "DStream::keyedBuffer": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_keyedBuffer.html",
        "signatures": [
            {
                "full": "DStream::keyedBuffer(name, keyColumn, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "DStream::keyedBuffer",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::keyedBuffer](https://docs.dolphindb.com/en/Functions/d/DStream_keyedBuffer.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::keyedBuffer(name, keyColumn, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted keyed stream table to store intermediate results in stream processing.\n\nFor more information on table persistence, refer to the [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) documentation.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\n\ng.source(\"trade\", 1:0, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n    .timeSeriesEngine(windowSize=60, step=60, metrics=[<first(price) as open>, <max(price) as high>, <min(price) as low>, <last(price) as close>, <sum(volume) as volume>], timeColumn=`time, keyColumn=`symbol)\n    .keyedBuffer(name=\"bufferTable\", keyColumn=\"symbol\")\n```\n"
    },
    "DStream::keyedSink": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_keyedSink.html",
        "signatures": [
            {
                "full": "DStream::keyedSink(name, keyColumn, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "DStream::keyedSink",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::keyedSink](https://docs.dolphindb.com/en/Functions/d/DStream_keyedSink.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::keyedSink(name, keyColumn, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nOutputs the stream data to a persisted keyed stream table.\n\nFor more information on keyed stream tables, refer to the [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) documentation.\n\n#### Parameters\n\n**name** A string specifying the name of the target tream table.\n\n**keyColumn** A string scalar or vector specifying the primary key column(s).\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n"
    },
    "DStream::latestKeyedBuffer": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_latestKeyedBuffer.html",
        "signatures": [
            {
                "full": "DStream::latestKeyedBuffer(name, keyColumn, timeColumn, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "DStream::latestKeyedBuffer",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::latestKeyedBuffer](https://docs.dolphindb.com/en/Functions/d/DStream_latestKeyedBuffer.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::latestKeyedBuffer(name, keyColumn, timeColumn, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted keyed stream table that retains only the latest record for each unique primary key based on a time column, used to store intermediate results in stream processing.\n\nFor more information on table persistence, refer to the [latestKeyedStreamTable](https://docs.dolphindb.com/en/Functions/l/latestKeyedStreamTable.html) documentation.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\n**timeColumn** specifies the time column(s) and can be either:\n\n* A string indicates a single column of integral or temporal type, or\n* A two-element vector indicates two columns that combine to form a unique timestamp: a DATE column and a TIME, SECOND, or NANOTIME column.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\n\ng.source(\"trade\", `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n    .timeSeriesEngine(windowSize=60, step=60, metrics=[<first(price) as open>, <max(price) as high>, <min(price) as low>, <last(price) as close>, <sum(volume) as volume>], timeColumn=`time, keyColumn=`symbol)\n    .latestKeyedBuffer(name=\"bufferTable\", keyColumn=\"symbol\", timeColumn=`time)\n```\n"
    },
    "DStream::latestKeyedSink": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_latestKeyedSink.html",
        "signatures": [
            {
                "full": "DStream::latestKeyedSink(name, keyColumn, timeColumn, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "DStream::latestKeyedSink",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::latestKeyedSink](https://docs.dolphindb.com/en/Functions/d/DStream_latestKeyedSink.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::latestKeyedSink(name, keyColumn, timeColumn, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nOutputs stream data to a persisted keyed stream table that retains only the latest record for each unique primary key based on a time column.\n\nFor more information on latest keyed stream tables, refer to the [latestKeyedStreamTable](https://docs.dolphindb.com/en/Functions/l/latestKeyedStreamTable.html) documentation.\n\n#### Parameters\n\n**name** A string specifying the name of the target stream table.\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\n**timeColumn** specifies the time column(s) and can be either:\n\n* A string indicates a single column of integral or temporal type, or\n* A two-element vector indicates two columns that combine to form a unique timestamp: a DATE column and a TIME, SECOND, or NANOTIME column.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n"
    },
    "DStream::leftSemiJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_leftSemiJoinEngine.html",
        "signatures": [
            {
                "full": "DStream::leftSemiJoinEngine(rightStream, metrics, matchingColumn, [garbageSize=5000], [updateRightTable=false])",
                "name": "DStream::leftSemiJoinEngine",
                "parameters": [
                    {
                        "full": "rightStream",
                        "name": "rightStream"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[garbageSize=5000]",
                        "name": "garbageSize",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[updateRightTable=false]",
                        "name": "updateRightTable",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::leftSemiJoinEngine](https://docs.dolphindb.com/en/Functions/d/DStream_leftSemiJoinEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::leftSemiJoinEngine(rightStream, metrics, matchingColumn, \\[garbageSize=5000], \\[updateRightTable=false])\n\n#### Details\n\nCreates a left semi join streaming engine. For details, see [createLeftSemiJoinEngine](https://docs.dolphindb.com/en/Functions/c/createLeftSemiJoinEngine.html) .\n\n#### Parameters\n\n**rightStream** is a DStream object indicating the input data source of the right table.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://test.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions), or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\nTo specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\n**Note:** The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**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.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**garbageSize** (optional) is a positive integer. The default value is 5,000. Unlike other join engines, the *garbageSize* parameter for left semi join engine is only used to remove the historical data from the left table. The system will clear the data from the left table when the number of joined records exceeds *garbageSize*.\n\n**updateRightTable** (optional) is a Boolean value indicating whether to output the first record (*updateRightTable* = true) or the latest record (*updateRightTable* = false) when there are more than one matching records in the right table. The default value is false.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('joinEngine')\ng = createStreamGraph('joinEngine')\n\nr = g.source(\"right\", 1024:0, `time`sym1`vol, [TIMESTAMP, SYMBOL, INT])\ng.source(\"left\", 1024:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\n    .leftSemiJoinEngine(r, metrics=<[price, vol,price*vol]>, matchingColumn=[[`time,`sym], [`time,`sym1]], updateRightTable=true)\n    .sink(\"output\")\ng.submit()\n\ngo\n\nv = [1, 5, 10, 15]\ntmp1=table(2012.01.01T00:00:00.000+v as time, take(`AAPL, 4) as sym, rand(100,4) as price)\nappendOrcaStreamTable(\"left\", tmp1)\n\nv = [1, 1, 3, 4, 5, 5, 5, 15]\ntmp2=table(2012.01.01T00:00:00.000+v as time, take(`AAPL, 8) as sym, rand(100,8) as vol)\nappendOrcaStreamTable(\"right\", tmp2)\n\nselect * from orca_table.output\n```\n\n| time                    | sym  | price | vol | price\\_mul |\n| ----------------------- | ---- | ----- | --- | ---------- |\n| 2012.01.01 00:00:00.001 | AAPL | 36    | 62  | 2,232      |\n| 2012.01.01 00:00:00.005 | AAPL | 82    | 35  | 2,870      |\n| 2012.01.01 00:00:00.015 | AAPL | 60    | 23  | 1,380      |\n"
    },
    "DStream::lookupJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_lookupJoinEngine.html",
        "signatures": [
            {
                "full": "DStream::lookupJoinEngine(rightStream, metrics, matchingColumn, [rightTimeColumn], [checkTimes], [keepDuplicates=false])",
                "name": "DStream::lookupJoinEngine",
                "parameters": [
                    {
                        "full": "rightStream",
                        "name": "rightStream"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[rightTimeColumn]",
                        "name": "rightTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[checkTimes]",
                        "name": "checkTimes",
                        "optional": true
                    },
                    {
                        "full": "[keepDuplicates=false]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::lookupJoinEngine](https://docs.dolphindb.com/en/Functions/d/DStream_lookupJoinEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::lookupJoinEngine(rightStream, metrics, matchingColumn, \\[rightTimeColumn], \\[checkTimes], \\[keepDuplicates=false])\n\n#### Details\n\nCreates a lookup join streaming engine. For details, see [createLookupJoinEngine](https://docs.dolphindb.com/en/Functions/c/createLookupJoinEngine.html).\n\n#### Parameters\n\n**rightStream** is a DStream object indicating the input data source of the right table.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://test.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions), or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as `col1`col2>.\n\nTo specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\n**Note:** The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**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.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**rightTimeColumn** (optional) 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 timestamps, only the latest record is retained. If the parameter is not specified, the latest ingested record (based) on the system time will be kept.\n\n**checkTimes** (optional) is a vector of temporal values or a DURATION scalar. If it is specified, the system will regularly update the right table (keeping only the latest data) and ingests the latest data to the lookup join engine. If the right table does not need to be updated regularly, you can leave *checkTimes* empty, but make sure to manually ingest the table data to the engine after it has been created.\n\n* If *checkTimes* is a vector of temporal values, it must be of SECOND, TIME or NANOTIME type. The lookup join engine updates the right table according to the time specified by each element in the vector on a daily basis.\n\n* If *checkTimes* is a DURATION scalar, it indicates the interval to update the right table.\n\n**keepDuplicates** (optional) is a Boolean value indicating whether to keep all records in each group of the right table. When set to false (default), the engine keeps the latest record in each group. When set to true, the engine keeps all records in each group - in this case, the engine performs inner join, i.e., output is only generated if a match is found.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('joinEngine')\ng = createStreamGraph('joinEngine')\n\nr = g.source(\"right\", 1024:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT])\ng.source(\"left\", 1024:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\n    .lookupJoinEngine(r, metrics=<[price,val,price*val]>, matchingColumn=`sym)\n    .sink(\"output\")\ng.submit()\n\ngo\nn  = 15\ntmp1 = 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)\nappendOrcaStreamTable(\"right\", tmp1)\n\nn = 10\ntmp2 = 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)\nappendOrcaStreamTable(\"left\", tmp2)\n\nselect * from orca_table.output\n```\n\n| sym | price | val | price\\_mul |\n| --- | ----- | --- | ---------- |\n| A   | 10.1  | 13  | 131.30     |\n| B   | 11.1  | 14  | 155.40     |\n| C   | 12.1  | 15  | 181.50     |\n| A   | 13.1  | 13  | 170.30     |\n| B   | 14.1  | 14  | 197.40     |\n| C   | 15.1  | 15  | 226.50     |\n| A   | 16.1  | 13  | 209.30     |\n| B   | 17.1  | 14  | 239.40     |\n| C   | 18.1  | 15  | 271.50     |\n| A   | 19.1  | 13  | 248.30     |\n"
    },
    "DStream::map": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_map.html",
        "signatures": [
            {
                "full": "DStream::map(func)",
                "name": "DStream::map",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::map](https://docs.dolphindb.com/en/Functions/d/DStream_map.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::map(func)\n\n#### Details\n\nApplies the specified function to the input streams. It is suitable for stateless data processing scenarios (e.g., data filtering).\n\n#### Parameters\n\n**func** A unary function that takes a table composed of streaming data messages as input and returns a table. Downstream engines infer processing logic based on the schema of the returned table.\n\nNote: This function must be a pure function, meaning it must satisfy the following properties:\n\n* Deterministic: Given the same input, it always produces the same output.\n* No side effects: The function must not cause any observable interaction with the outside world. Specifically, it must not:\n  * Modify global or external variables.\n  * Write to databases or files.\n  * Call external APIs or services.\n  * Mutate the input table (e.g., by modifying its values in-place).\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\nDefine `map` to generate OHLC data for AAPL:\n\n```\nuse catalog test\n\ng = createStreamGraph(\"graph\")\ng.source(\"trade\", 1024:0, `symbol`datetime`price`volume, [SYMBOL,TIMESTAMP,DOUBLE,INT])\n    .map(msg -> select * from msg where symbol == \"AAPL\")\n    .timeSeriesEngine(60, 60, <[first(price) as open, max(price) as high, min(price) as low, last(price) as close, sum(volume) as volume]>, \"datetime\", false, \"symbol\")\n    .sink(\"output\")\n```\n\n**Related function**: [DStream::udfEngine](https://docs.dolphindb.com/en/Functions/d/DStream_udfEngine.html)\n"
    },
    "DStream::narrowReactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_narrowReactiveStateEngin.html",
        "signatures": [
            {
                "full": "DStream::narrowReactiveStateEngine(metrics, metricNames, keyColumn, [filter], [keepOrder], [keyPurgeFilter], [keyPurgeFreqInSecond=0], [keyCapacity=1024], [parallelism=1])",
                "name": "DStream::narrowReactiveStateEngine",
                "parameters": [
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "metricNames",
                        "name": "metricNames"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[filter]",
                        "name": "filter",
                        "optional": true
                    },
                    {
                        "full": "[keepOrder]",
                        "name": "keepOrder",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter]",
                        "name": "keyPurgeFilter",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=0]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[keyCapacity=1024]",
                        "name": "keyCapacity",
                        "optional": true,
                        "default": "1024"
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::narrowReactiveStateEngine](https://docs.dolphindb.com/en/Functions/d/DStream_narrowReactiveStateEngin.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::narrowReactiveStateEngine(metrics, metricNames, keyColumn, \\[filter], \\[keepOrder], \\[keyPurgeFilter], \\[keyPurgeFreqInSecond=0], \\[keyCapacity=1024], \\[parallelism=1])\n\n#### Details\n\nCreates a reactive state engine that returns a table in narrow format. For details, see [createNarrowReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createNarrowReactiveStateEngine.html).\n\n#### Parameters\n\n**metrics** is metacode or a tuple of metacode containing columns from the input table (excluding *keyColumn*, optional) or factors (formulas for calculation, required).\n\n**metricNames** is a STRING scalar or vector, indicating the name for each factor specified in *metrics*. The number and order of names must align to that of factors specified in *metrics*.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the grouping column(s). The calculation is conducted within each group.\n\n**filter** (optional) is the metacode that indicates the filtering conditions. A filtering condition must be an expression and only columns of *dummyTable*can be included. You can specify multiple conditions with logical operators (and, or). Only the results that satisfy the filter conditions are ingested to the output table.\n\n**keepOrder** (optional) specifies whether to preserve the insertion order of the records in the output table. If *keyColumn* contains a time column, the default value is true, and otherwise false.\n\nTo clean up the data that is no longer needed after calculation, specify parameters *keyPurgeFilter* and *keyPurgeFreqInSecond*.\n\n**keyPurgeFilter** (optional) indicates the filtering conditions that identify the data to be purged from the cache. It is metacode composed of conditional expressions, and these expressions must refer to the columns in the *outputTable*. *keyPurgeFilter* is effective only when *keyColumn* is specified.\n\n**keyPurgeFreqInSecond** (optional) is a positive integer indicating the time interval (in seconds) to trigger a purge. *keyPurgeFreqInSecond* is effective only when *keyColumn* is specified.\n\nFor each data ingestion, the engine starts a purge if all of the following conditions are satisfied:\n\n(1) The time elapsed since the last data ingestion is equal to or greater than *keyPurgeFreqInSecond* (For the first check, the time elapsed between the ingestion of data and the creation of the engine is used);\n\n(2) If the first condition is satisfied, the engine applies *keyPurgeFilter* to the cached data to get the data to be purged.\n\n(3) The number of groups which contain data to be purged is equal to or greater than 10% of the total number of groups in the engine.\n\nTo check the engine status before and after the purge, call `getStreamEngineStat().ReactiveStreamEngine` (see [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html)) where the *numGroups* field indicates the number of groups in the reactive state streaming engine.\n\n**keyCapacity** (optional) is a positive integer indicating the amount of memory allocated for buffering state of each group (defined by *keyColumn*) on a row basis. The default value is 1024. For data with large amount of groups, setting of this parameter can reduce the latency that may occur.\n\n**parallelism** (optional) is a positive integer no greater than 63, indicating the maximum number of workers that can run in parallel. The default value is 1. For large computation workloads, reasonable adjustment of this parameter can effectively utilize computing resources and reduce computation time.\n\n**Note**: *parallelism* cannot exceed the lesser of the numbers of licensed cores and logical cores minus one.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\ng = createStreamGraph('engine')\n\nfactor = [<createTime>, <updateTime>,<cumsum(qty)>,<cumavg(upToDatePrice)>]\n\ng.source(\"trades\", 1000:0,  [\"securityID1\",\"securityID2\",\"securityID3\",\"createTime\",\"updateTime\",\"upToDatePrice\",\"qty\",\"value\"], [STRING,STRING,STRING,TIMESTAMP,TIMESTAMP,DOUBLE,DOUBLE,INT])\n.narrowReactiveStateEngine(metrics=factor,metricNames=[\"factor1\",\"factor2\"], keyColumn=[\"securityID1\",\"securityID2\",\"securityID3\"])\n.sink(\"output\")\ng.submit()\ngo\n\ndates=take(2012.01.01, 10) join take(2012.01.02, 4)\ntimes=[09:00:00.030, 09:00:00.030, 09:00:00.031, 09:00:00.031, 09:00:00.031, 09:00:00.033, 09:00:00.033, 09:00:00.034, 09:00:00.034, 09:00:00.035, 09:00:00.031, 09:00:00.032, 09:00:00.032, 09:00:00.040]\nsyms=[`a, `a, `b, `a, `a, `b, `a, `b, `b, `a, `b, `a, `b, `c]\nmarkets=['B', 'B', 'A', 'B', 'A', 'B', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B']\nprices=[10.65, 10.59, 10.59, 10.65, 10.59, 10.59, 10.59, 10.59, 10.22, 11.0, 10.22, 11.0, 15.6, 13.2]\nqtys=[1500, 2500, 2500, 1500, 2500, 2500, 2500, 2500, 1200, 2500, 1200, 2500, 1300, 2000]\ntmp=table(dates as date, times as time, syms as sym, markets as market, prices as price, qtys as qty)\n\nnum = 5\ntmp = table(take(\"A\" + lpad(string(1..4),4,\"0\"),num) as securityID1,take(\"CC.HH\" + lpad(string(21..34),4,\"0\"),num) as securityID2,take(\"FFICE\" + lpad(string(13..34),4,\"0\"),num) as securityID3, 2023.09.01 00:00:00+(1..num) as createTime, 2023.09.01 00:00:00+take(1..num, num).sort() as updateTime,take(rand(100.0,num) join take(int(),30),num) as upToDatePrice,take(take(100.0,num) join take(int(),30),num)+30 as qty,take(1..20 join take(int(),5),num) as value)\n\nappendOrcaStreamTable(\"trades\", tmp)\n\nselect * from orca_table.output\n```\n\n| securityID1 | securityID2 | securityID3 | createTime              | updateTime              | metricName | metricValue        |\n| ----------- | ----------- | ----------- | ----------------------- | ----------------------- | ---------- | ------------------ |\n| A0001       | CC.HH0021   | FFICE0013   | 2023.09.01 00:00:01.000 | 2023.09.01 00:00:01.000 | factor1    | 130                |\n| A0001       | CC.HH0021   | FFICE0013   | 2023.09.01 00:00:01.000 | 2023.09.01 00:00:01.000 | factor2    | 5.729826227745667  |\n| A0002       | CC.HH0022   | FFICE0014   | 2023.09.01 00:00:02.000 | 2023.09.01 00:00:02.000 | factor1    | 130                |\n| A0002       | CC.HH0022   | FFICE0014   | 2023.09.01 00:00:02.000 | 2023.09.01 00:00:02.000 | factor2    | 40.09022097935429  |\n| A0003       | CC.HH0023   | FFICE0015   | 2023.09.01 00:00:03.000 | 2023.09.01 00:00:03.000 | factor1    | 130                |\n| A0003       | CC.HH0023   | FFICE0015   | 2023.09.01 00:00:03.000 | 2023.09.01 00:00:03.000 | factor2    | 40.181519178922024 |\n| A0004       | CC.HH0024   | FFICE0016   | 2023.09.01 00:00:04.000 | 2023.09.01 00:00:04.000 | factor1    | 130                |\n| A0004       | CC.HH0024   | FFICE0016   | 2023.09.01 00:00:04.000 | 2023.09.01 00:00:04.000 | factor2    | 21.328769097950172 |\n| A0001       | CC.HH0025   | FFICE0017   | 2023.09.01 00:00:05.000 | 2023.09.01 00:00:05.000 | factor1    | 130                |\n| A0001       | CC.HH0025   | FFICE0017   | 2023.09.01 00:00:05.000 | 2023.09.01 00:00:05.000 | factor2    | 50.23656470375805  |\n"
    },
    "DStream::nearestJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_nearestJoinEngine.html",
        "signatures": [
            {
                "full": "DStream::nearestJoinEngine(rightStream, kNearest, metrics, matchingColumn, [timeColumn], [useSystemTime=false], [garbageSize = 5000], [maxDelayedTime], [nullFill], [cachedTableCapacity=1024])",
                "name": "DStream::nearestJoinEngine",
                "parameters": [
                    {
                        "full": "rightStream",
                        "name": "rightStream"
                    },
                    {
                        "full": "kNearest",
                        "name": "kNearest"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[garbageSize = 5000]",
                        "name": "[garbageSize = 5000]"
                    },
                    {
                        "full": "[maxDelayedTime]",
                        "name": "maxDelayedTime",
                        "optional": true
                    },
                    {
                        "full": "[nullFill]",
                        "name": "nullFill",
                        "optional": true
                    },
                    {
                        "full": "[cachedTableCapacity=1024]",
                        "name": "cachedTableCapacity",
                        "optional": true,
                        "default": "1024"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::nearestJoinEngine](https://docs.dolphindb.com/en/Functions/d/DStream_nearestJoinEngine.html)\n\nFirst introduced in versions: 3.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\nDStream::nearestJoinEngine(rightStream, kNearest, metrics, matchingColumn, \\[timeColumn], \\[useSystemTime=false], \\[garbageSize = 5000], \\[maxDelayedTime], \\[nullFill], \\[cachedTableCapacity=1024])\n\n#### Details\n\nCreates a nearest-neighbor join streaming engine. For details, see [createNearestJoinEngine](https://docs.dolphindb.com/en/Functions/c/createNearestJoinEngine.html).\n\n#### Parameters\n\n**rightStream** is a DStream object indicating the input data source of the right table.\n\n**kNearest** is a positive integer. For each row in the left table, the engine retrieves the *k* nearest rows from the right table whose timestamps are less than or equal to the current row's timestamp.\n\n**metrics** is metacode (which can be a tuple) specifying the calculation formulas. For more information about metacode, please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions.\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n* The columns in right table can be converted into array vectors using `toArray`, e.g., `<toArray(price)>`.\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\nIf you want to specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\nThe following functions are optimized in the engine when they are applied only to the columns from the right table: `sum`, `sum2`, `avg`, `std`, `var`, `corr`, `covar`, `wavg`, `wsum`, `beta`, `max`, `min`, `last`, `first`, `med`, `percentile`.\n\n**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.\n\n* When there is only 1 column to match - 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If the names of all the columns to match are the same in both tables, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**timeColumn** (optional) When *useSystemTime* = false, it must be specified to indicate the name(s) of the time column in the left table and the right table. The time columns must have the same data type. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**useSystemTime** (optional) indicates whether the left table and the right table are joined on the system time, instead of on the *timeColumn*.\n\n* *useSystemTime* = true: join records based on the system time (timestamp with millisecond precision) when they are ingested into the engine.\n\n* *useSystemTime* = false (default): join records based on the specified timeColumn from the left table and the right table.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (rows). As the subscribed data is ingested into the engine, it continues to take up the memory. Within the left/right table, the records are grouped by *matchingColumn* values; When the number of records in a group exceeds *garbageSize*, the system will remove those already been calculated from memory.\n\n**maxDelayedTime** (optional) is a positive integer. *maxDelayedTime* only takes effect when *timeColumn* is specified and the two arguments must have the same time precision. Use *maxDelayedTime* to trigger windows which remain uncalculated long past its end. The default *maxDelayedTime* is 3 seconds. For more information about this parameter, see \"Window triggering rules\" in the Details section.\n\n**Note:** Please configure the *maxDelayedTime* parameter appropriately. When the left table contains sparse data and the right table has a high data frequency, setting *maxDelayedTime* too small may cause the system to prematurely clean up older data from the right table before certain group computations are triggered.\n\n**nullFill** (optional) is a tuple of the same size as the number of output columns. It is used to fill in the null values in the output table. The data type of each element corresponds to each output column.\n\n**cachedTableCapacity** (optional) is a positive integer indicating the initial capacity (in terms of the number of rows) of the left and right cache tables for each group. The default value is 1024.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('nearestEngine')\ng = createStreamGraph('nearestEngine')\n\nleftStream = g.source(\"leftTable\", 1024:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\nrightStream  = g.source(\"rightTable\", 1024:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE])\nleftStream.nearestJoinEngine(rightStream=rightStream,kNearest=8, metrics=<[price,toArray(val),sum(val)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=NULL)\n\t\t.sink(\"output\")\ng.submit()\ngo\n\nn=10\ntp2=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(double(1..10),2*n) as val)\ntp2.sortBy!(`time)\nappendOrcaStreamTable(`rightTable, tp2)\ntp1=table(take(2012.01.01T00:00:00.003+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(NULL join rand(10.0, n-1),2*n) as price)\ntp1.sortBy!(`time)\n\nappendOrcaStreamTable(`leftTable, tp1)\n\nselect * from orca_table.output\n```\n\n| time                    | sym | price              | toArray\\_val              | sum\\_val |\n| ----------------------- | --- | ------------------ | ------------------------- | -------- |\n| 2012.01.01 00:00:00.003 | A   |                    | \\[1, 2, 3, 4]             | 10       |\n| 2012.01.01 00:00:00.004 | A   | 3.4822947595856824 | \\[1, 2, 3, 4, 5]          | 15       |\n| 2012.01.01 00:00:00.005 | A   | 7.86139521284484   | \\[1, 2, 3, 4, 5, 6]       | 21       |\n| 2012.01.01 00:00:00.006 | A   | 3.1722617468716185 | \\[1, 2, 3, 4, 5, 6, 7]    | 28       |\n| 2012.01.01 00:00:00.007 | A   | 5.3532539582956415 | \\[1, 2, 3, 4, 5, 6, 7, 8] | 36       |\n| 2012.01.01 00:00:00.008 | A   | 6.732663744145904  | \\[2, 3, 4, 5, 6, 7, 8, 9] | 44       |\n| 2012.01.01 00:00:00.003 | B   | 3.4822947595856824 | \\[2, 3, 4, 5]             | 14       |\n| 2012.01.01 00:00:00.004 | B   | 7.86139521284484   | \\[2, 3, 4, 5, 6]          | 20       |\n| 2012.01.01 00:00:00.005 | B   | 3.1722617468716185 | \\[2, 3, 4, 5, 6, 7]       | 27       |\n| 2012.01.01 00:00:00.006 | B   | 5.3532539582956415 | \\[2, 3, 4, 5, 6, 7, 8]    | 35       |\n"
    },
    "DStream::parallelize": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_parallelize.html",
        "signatures": [
            {
                "full": "DStream::parallelize(columnName, count)",
                "name": "DStream::parallelize",
                "parameters": [
                    {
                        "full": "columnName",
                        "name": "columnName"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::parallelize](https://docs.dolphindb.com/en/Functions/d/DStream_parallelize.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::parallelize(columnName, count)\n\n#### Details\n\nPartitions the stream data using a hash function based on the specified column. It generates multiple parallel DStream objects for concurrent processing. Null values in the *columnName* will be filtered out.\n\nNote: The `DStream::parallelize` and `DStream::sync` methods must be called together.\n\n#### Parameters\n\n**columnName** A string specifying the name of the column used for partitioning.\n\n**count** An integer representing the degree of parallelism.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\nPartition the stream data into four streams based on the symbol column for downstream calculations:\n\n```\nuse catalog test\n\ng = createStreamGraph(name)\ng.source(\"trade\", 1024:0, `symbol`datetime`price`volume, [SYMBOL, TIMESTAMP,DOUBLE, INT])\n  .parallelize(\"symbol\", 4)\n  .timeSeriesEngine(60*1000, 60*1000, <[first(price),max(price),min(price),last(price),sum(volume)]>, \"datetime\", false, \"symbol\")\n  .reactiveStateEngine(<[datetime, first_price, max_price, min_price, last_price, sum_volume, mmax(max_price, 5), mavg(sum_volume, 5)]>, `symbol)\n  .sync()\n  .sink(\"output\")\n.g.submit()\n```\n"
    },
    "DStream::pricingEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_pricingEngine.html",
        "signatures": [
            {
                "full": "DStream::pricingEngine(timeColumn, typeColumn, securityType, method, [securityReference], [keyColumn], [extraMetrics])",
                "name": "DStream::pricingEngine",
                "parameters": [
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "typeColumn",
                        "name": "typeColumn"
                    },
                    {
                        "full": "securityType",
                        "name": "securityType"
                    },
                    {
                        "full": "method",
                        "name": "method"
                    },
                    {
                        "full": "[securityReference]",
                        "name": "securityReference",
                        "optional": true
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[extraMetrics]",
                        "name": "extraMetrics",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::pricingEngine](https://docs.dolphindb.com/en/Functions/d/DStream_pricingEngine.html)\n\n#### Syntax\n\nDStream::pricingEngine(timeColumn, typeColumn, securityType, method, \\[securityReference], \\[keyColumn], \\[extraMetrics])\n\n#### Details\n\nCreates a pricing engine. For details, see [createPricingEngine](https://docs.dolphindb.com/en/Functions/c/createPricingEngine.html).\n\n**Return value**: A DStream object.\n\n#### Arguments\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\ng = createStreamGraph('engine')\n\ntypeList=[0,1,2]\nstart=2022.07.15\nmaturity=2072.07.15\nissuePrice=100\ncoupon=0.034\nfrequency=\"Semiannual\"\ndayCountConvention=\"ActualActual\"\nbondType=\"FixedRate\"\nsettlement=2025.04.10\nprice=0.02\npriceType=\"YTM\"\n\nmethodList=[<bondDirtyPrice(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType)>,\n             <bondAccrInt(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement)>,\n             <bondDuration(start, maturity, issuePrice, coupon, frequency, dayCountConvention, bondType, settlement, price, priceType)>]\nsecurityReference= table(take(0 1 2, 100) as type, take(1 2 3 4, 100) as assetType,\"s\"+string(1..100) as symbol, 2025.07.25+1..100 as maturity, rand(10.0, 100) as coupon, rand(10,100) as frequency,take([1],100) as basis )\n\n\ng.source(\"trades\", 1000:0, `tradeTime`Symbol`realTimeX`predictY`price,[TIMESTAMP,SYMBOL, DOUBLE, DOUBLE, DOUBLE])\n.pricingEngine(timeColumn=`tradeTime, typeColumn=`type, securityType=typeList, method=methodList, securityReference=securityReference, keyColumn=`Symbol, extraMetrics=[<price * predictY>, <coupon+price>])\n.sink(\"output\")\ng.submit()\ngo\n\ndata = table(take(now(), 100)as tradeTime,\"s\"+string(1..100) as symbol, rand(10.0, 100) as realTimeX,  rand(10.0, 100) as predictY, rand(10.0, 100) as price)\n\nappendOrcaStreamTable(\"trades\", data)\n```\n"
    },
    "DStream::reactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_reactiveStateEngine.html",
        "signatures": [
            {
                "full": "DStream::reactiveStateEngine(metrics, [keyColumn], [filter], [keepOrder], [keyPurgeFilter], [keyPurgeFreqInSecond=0], [keyCapacity=1024], [parallelism=1])",
                "name": "DStream::reactiveStateEngine",
                "parameters": [
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[filter]",
                        "name": "filter",
                        "optional": true
                    },
                    {
                        "full": "[keepOrder]",
                        "name": "keepOrder",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter]",
                        "name": "keyPurgeFilter",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=0]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[keyCapacity=1024]",
                        "name": "keyCapacity",
                        "optional": true,
                        "default": "1024"
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::reactiveStateEngine](https://docs.dolphindb.com/en/Functions/d/DStream_reactiveStateEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::reactiveStateEngine(metrics, \\[keyColumn], \\[filter], \\[keepOrder], \\[keyPurgeFilter], \\[keyPurgeFreqInSecond=0], \\[keyCapacity=1024], \\[parallelism=1])\n\n#### Details\n\nCreates a reactive state engine. For details, see [createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html).\n\n#### Parameters\n\n**metrics** is metacode specifying the formulas for calculation. The metacode can include one or more expressions, built-in or user-defined functions, or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form. For more information about metacode refer to [Metaprogramming](https://docs.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html). To use a user-defined function in the reactive state engine,\n\n(1) Add `@state` to declare the function before the definition. For state functions, the following statements are supported:\n\n* Assignment and return statements\n\n* `if...else` statements with scalar expressions (since 1.30.21/2.00.9)\n\n* `for` loops, including `break` and `continue` (since 1.30.23/2.00.11). Loop iterations must be under 100 times. Nested `for` loops are currently unsupported.\n\n(2) Stateless or state functions can be used in a reactive state engine, but the *metrics* parameter cannot be specified as the stateless function nesting with the state function.\n\n(3) If the rvalue of an assignment statement is a built-in or user-defined function that returns multiple values, the values must be assigned to variables at the same time. In the following example, the user-defined state function references linearTimeTrend, which returns two values.\n\n```\n@state\ndef forcast2(S, N){\n\tlinearregIntercept, linearregSlope = linearTimeTrend(S, N)\n\treturn (N - 1) * linearregSlope + linearregIntercept\n}\n```\n\n(4) In the reactive state engine, custom state functions cannot contain self-assignment statements such as `a=a+b`. In the following example, when the condition is false, the `iif` expression returns out, which results in self-assignment (`out = out`) and triggers an error.\n\n```\nout = iif((p1 > 0) and (p2 == 0), p1, out)\n// An assignment statement in state function 'xxx' can't use self reference\n```\n\nNote: The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the grouping column(s). The calculation is conducted within each group.\n\n**filter** (optional) is the metacode that indicates the filtering conditions. A filtering condition must be an expression and only columns of *dummyTable*can be included. You can specify multiple conditions with logical operators (and, or). Only the results that satisfy the filter conditions are ingested to the output table.\n\n**keepOrder** (optional) specifies whether to preserve the insertion order of the records in the output table. If *keyColumn* contains a time column, the default value is true, and otherwise false.\n\nTo clean up the data that is no longer needed after calculation, specify parameters *keyPurgeFilter* and *keyPurgeFreqInSecond*.\n\n**keyPurgeFilter** (optional) indicates the filtering conditions that identify the data to be purged from the cache. It is metacode composed of conditional expressions, and these expressions must refer to the columns in the *outputTable*. *keyPurgeFilter* is effective only when *keyColumn* is specified.\n\n**keyPurgeFreqInSecond** (optional) is a positive integer indicating the time interval (in seconds) to trigger a purge. *keyPurgeFreqInSecond* is effective only when *keyColumn* is specified.\n\nFor each data ingestion, the engine starts a purge if all of the following conditions are satisfied:\n\n(1) The time elapsed since the last data ingestion is equal to or greater than *keyPurgeFreqInSecond* (For the first check, the time elapsed between the ingestion of data and the creation of the engine is used);\n\n(2) If the first condition is satisfied, the engine applies *keyPurgeFilter* to the cached data to get the data to be purged.\n\n(3) The number of groups which contain data to be purged is equal to or greater than 10% of the total number of groups in the engine.\n\nTo check the engine status before and after the purge, call `getStreamEngineStat().ReactiveStreamEngine` (see [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html)) where the *numGroups* field indicates the number of groups in the reactive state streaming engine.\n\n**keyCapacity** (optional) is a positive integer indicating the amount of memory allocated for buffering state of each group (defined by *keyColumn*) on a row basis. The default value is 1024. For data with large amount of groups, setting of this parameter can reduce the latency that may occur.\n\n**parallelism** (optional) is a positive integer no greater than 63, indicating the maximum number of workers that can run in parallel. The default value is 1. For large computation workloads, reasonable adjustment of this parameter can effectively utilize computing resources and reduce computation time.\n\n**Note**: *parallelism* cannot exceed the lesser of the numbers of licensed cores and logical cores minus one.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\ng = createStreamGraph('engine')\n\ng.source(\"trades\", 1000:0, `date`time`sym`market`price`qty, [DATE, TIME, SYMBOL, CHAR, DOUBLE, INT])\n.reactiveStateEngine(metrics=<mavg(price, 3)>, keyColumn=[\"date\",\"sym\"], filter=<date between 2012.01.01 : 2012.01.03>, keepOrder=true)\n.sink(\"output\")\ng.submit()\ngo\n\nn=100\ntmp = table(rand(2012.01.01..2012.01.10, n) as date, rand(09:00:00.000..15:59:59.999, n) as time, rand(\"A\"+string(1..10), n) as sym, rand(['B', 'S'], n) as market, rand(100.0, n) as price, rand(1000..2000, n) as qty)\n\nappendOrcaStreamTable(\"trades\", tmp)\n```\n"
    },
    "DStream::reactiveStatelessEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_reactiveStatelessEngine.html",
        "signatures": [
            {
                "full": "DStream::reactiveStatelessEngine(metrics)",
                "name": "DStream::reactiveStatelessEngine",
                "parameters": [
                    {
                        "full": "metrics",
                        "name": "metrics"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::reactiveStatelessEngine](https://docs.dolphindb.com/en/Functions/d/DStream_reactiveStatelessEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::reactiveStatelessEngine(metrics)\n\n#### Details\n\nCreates a reactive stateless engine. For details, see [createReactiveStatelessEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStatelessEngine.html).\n\n#### Parameters\n\n**metrics** is a vector of dictionaries, specifying the calculation formulas and their dependencies. Each dictionary has the following key-value pairs:\n\n* \"outputName\"->productName:metricName\n\n* \"formula\"->\\<expression>\n\n  The value of *formula*is a metacode expression defining the formula for calculation, which can reference other variables. For example, the expression can be `<A*B>`, and A and B are precedent variables for this formula.\n\n* Key-value pairs specifying the precedent variable locations used in the *formula*above. For exmaple, for `<A*B>`, specify:\n\n  * \"A\"->productName:metricName\n  * \"B\"->productName:metricName\n    The *productName*and *metricName*uniquely specify the location of the variable, which can be the input or output table.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\n\ng = createStreamGraph('engine')\n\nmetrics = array(ANY, 0, 0)\nmetric1 = dict(STRING,ANY)\n// product_B:value=product_A:factor1+product_A:factor2+product_B:factor1\nmetric1[\"outputName\"] = `product_B:`value\nmetric1[\"formula\"] = <A+B+C>\nmetric1[\"A\"] = `product_A:`factor1\nmetric1[\"B\"] = `product_A:`factor2\nmetric1[\"C\"] = `product_B:`factor1\nmetrics.append!(metric1)\n// product_C:value=product_B:value*product_C:factor1\nmetric2 = dict(STRING, ANY)\nmetric2[\"outputName\"] =`product_C:`value\nmetric2[\"formula\"] = <A*B>\nmetric2[\"A\"] = `product_B:`value \nmetric2[\"B\"] = `product_C:`factor1\nmetrics.append!(metric2)\n\ng.source(\"input\", 1000:0, `product`factor`value, [STRING, STRING, DOUBLE])\n.reactiveStatelessEngine(metrics)\n.sink(\"output\")\ng.submit()\ngo\n\nproducts = take(\"product_A\", 2)\nfactors = [\"factor1\", \"factor2\"]\nvalues = [1.0, 2.0]\ntmp = table(products as product, factors as factor, values as value)\nappendOrcaStreamTable(\"input\", tmp)\n\nproducts = take(\"product_B\", 1)\nfactors = take(\"factor1\", 1)\nvalues = take(1.0, 1)\ntmp = table(products as product, factors as factor, values as value)\nappendOrcaStreamTable(\"input\", tmp)\n\n\nselect * from orca_table.output\n```\n\n| productName | metricName | metricsResults |\n| ----------- | ---------- | -------------- |\n| product\\_B  | value      |                |\n| product\\_C  | value      |                |\n| product\\_B  | value      | 4              |\n| product\\_C  | value      |                |\n"
    },
    "DStream::ruleEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_ruleEngine.html",
        "signatures": [
            {
                "full": "DStream::ruleEngine(ruleSets, outputColumns, [policy], [ruleSetColumn], [callback])",
                "name": "DStream::ruleEngine",
                "parameters": [
                    {
                        "full": "ruleSets",
                        "name": "ruleSets"
                    },
                    {
                        "full": "outputColumns",
                        "name": "outputColumns"
                    },
                    {
                        "full": "[policy]",
                        "name": "policy",
                        "optional": true
                    },
                    {
                        "full": "[ruleSetColumn]",
                        "name": "ruleSetColumn",
                        "optional": true
                    },
                    {
                        "full": "[callback]",
                        "name": "callback",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::ruleEngine](https://docs.dolphindb.com/en/Functions/d/DStream_ruleEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::ruleEngine(ruleSets, outputColumns, \\[policy], \\[ruleSetColumn], \\[callback])\n\n#### Details\n\nCreates a rule engine that supports multiple rule sets. For details, see [createRuleEngine](https://docs.dolphindb.com/en/Functions/c/createRuleEngine.html).\n\n#### Parameters\n\n**ruleSets** is a dictionary specifying the rule set. Its key is of STRING or INT type, and the value is a tuple with metacode. If the key is NULL, the rule is treated as the default rule. If *ruleSetColumn* is not specified or the data does not match any rule, the default rule will be used for checking data. A rule set must include a default rule.\n\n**outputColumns** is a STRING vector indicating the input columns to be preserved in the output table.\n\n**policy**(optional) is a STRING scalar indicating the rule-checking policy. It can take the following values:\n\n**ruleSetColumn**(optional) is a STRING scalar indicating an input column name. If it is not set or the specified column does not match any rule set, then the default rule set is applied.\n\n**callback** (optional) is a function that takes a tuple as input. The table contains a record output by the engine. If specified, the callback function is invoked with each output passed in as an argument. If not specified, the engine will only insert the checking results into the output table.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\ng = createStreamGraph('engine')\n\n// define rule sets\nx = [1, 2, NULL]\ny = [ [ < value > 1 > ], [ < price < 2 >, < price > 6 > ], [ < value*price > 10 > ] ]\nruleSets = dict(x, y)\n\n// create a DFS table to write results to the callback function\nif(existsDatabase(\"dfs://temp\")){\n    dropDatabase(\"dfs://temp\")\n}\ndb = database(\"dfs://temp\", VALUE, 1..3)\nt1 = table(1:0, `sym`value`price, [INT,DOUBLE,DOUBLE])\npt = db.createPartitionedTable(t1,`pt,`sym)\n\n// create callback function\ndef writeBack(result){\n    if(result.rule[0]==false){\n        temp = select sym,value,price from result\n        loadTable(\"dfs://temp\",`pt).append!(temp)\n    }\n}\n\ng.source(\"trades\", 1000:0, `sym`value`price`quantity, [INT, DOUBLE, DOUBLE, DOUBLE])\n.ruleEngine(ruleSets=ruleSets, outputColumns=[\"sym\",\"value\",\"price\"], policy=\"all\", ruleSetColumn=\"sym\", callback=writeBack)\n.sink(\"output\")\ng.submit()\ngo\n\ntmp=table(1 1 as sym, 0 2 as value, 2 2 as price, 3 3 as quantity)\nappendOrcaStreamTable(\"trades\", tmp)\n\nselect * from orca_table.output\n```\n\n| sym | value | price | rule     |\n| --- | ----- | ----- | -------- |\n| 1   | 0     | 2     | \\[false] |\n| 1   | 2     | 2     | \\[true]  |\n"
    },
    "DStream::sessionWindowEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_sessionWindowEngine.html",
        "signatures": [
            {
                "full": "DStream::sessionWindowEngine(sessionGap, metrics, [timeColumn], [useSystemTime=false], [keyColumn], [updateTime], [useSessionStartTime=true], [forceTriggerTime])",
                "name": "DStream::sessionWindowEngine",
                "parameters": [
                    {
                        "full": "sessionGap",
                        "name": "sessionGap"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useSessionStartTime=true]",
                        "name": "useSessionStartTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::sessionWindowEngine](https://docs.dolphindb.com/en/Functions/d/DStream_sessionWindowEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::sessionWindowEngine(sessionGap, metrics, \\[timeColumn], \\[useSystemTime=false], \\[keyColumn], \\[updateTime], \\[useSessionStartTime=true], \\[forceTriggerTime])\n\n#### Details\n\nCreates a session window streaming engine. For details, see [createSessionWindowEngine](https://docs.dolphindb.com/en/Functions/c/createSessionWindowEngine.html).\n\n#### Parameters\n\n**sessionGap** a positive integer indicating the gap between 2 session windows. Its unit is determined by the parameter *useSystemTime*.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n* The metacode can be a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n* If *metrics* is a tuple with multiple formulas, *windowSize* is specified as a vector of the same length as *metrics*. Each element of *windowSize* corresponds to the elements 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)>]]`.\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**timeColumn** (optional) is a STRING scalar or vector specifying the time column(s) of the subscribed stream table. When *useSystemTime* = false, it must be specified.\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* *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.\n* *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. Note that the record which triggers the calculation will not participate in this calculation.\n\nFor 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.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\n**updateTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*. It is used to trigger window calculations at an interval shorter than *step*. *step* must be a multiple of *updateTime*. To specify *updateTime*, *useSystemTime* must be set to false.\n\n**useSessionStartTime** (optional) is a Boolean value. Defaults to true indicating whether the first column in *outputTable* is the starting time of the windows, i.e., the timestamp of the first record in each window. Setting it to false means the timestamps in the output table are the ending time of the windows, i.e., timestamp of the last record in window + *sessionGap*. If *updateTime* is specified, *useSessionStartTime* must be true.\n\n**forceTriggerTime** (optional) is a non-negative integer. Its unit is the same as the time precision of *timeColumn*. *forceTriggerTime* indicates the waiting time to force trigger calculation in uncalculated windows for each group.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\ng = createStreamGraph('engine')\n\ng.source(\"trades\", 1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT])\n.sessionWindowEngine(sessionGap = 5, metrics = <sum(volume)>, timeColumn = `time, keyColumn=`sym)\n.sink(\"output\")\ng.submit()\ngo\n\nn = 5\ntime = 2018.10.12T10:01:00.000 + (1..n)\nsym = take(`A`B`C, n)\nvolume = (1..n) % 1000\ntmp = table(time as time, sym as sym, volume as volume)\nappendOrcaStreamTable(\"trades\", tmp)\n\nn = 5\ntime = 2018.10.12T10:01:00.010 + (1..n)\nsym = take(`A`B`C, n)\nvolume = (1..n) % 1000\ntmp = table(time as time, sym as sym, volume as volume)\nappendOrcaStreamTable(\"trades\", tmp)\n\nn = 6\ntime = 2018.10.12T10:01:00.020 + 1 2 3 8 14 20\nsym = take(`A`B`C, n)\nvolume = (1..n) % 1000\ntmp = table(time as time, sym as sym, volume as volume)\nappendOrcaStreamTable(\"trades\", tmp)\n\nselect * from orca_table.output\n```\n\n| time                    | sym | volume |\n| ----------------------- | --- | ------ |\n| 2018.10.12 10:01:00.001 | A   | 5      |\n| 2018.10.12 10:01:00.002 | B   | 7      |\n| 2018.10.12 10:01:00.003 | C   | 3      |\n| 2018.10.12 10:01:00.011 | A   | 5      |\n| 2018.10.12 10:01:00.012 | B   | 7      |\n| 2018.10.12 10:01:00.013 | C   | 3      |\n| 2018.10.12 10:01:00.021 | A   | 1      |\n| 2018.10.12 10:01:00.022 | B   | 2      |\n| 2018.10.12 10:01:00.023 | C   | 3      |\n"
    },
    "DStream::setEngineName": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_setEngineName.html",
        "signatures": [
            {
                "full": "DStream::setEngineName(name)",
                "name": "DStream::setEngineName",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::setEngineName](https://docs.dolphindb.com/en/Functions/d/DStream_setEngineName.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::setEngineName(name)\n\n#### Details\n\nSets a name for the current streaming engine. If an engine with the same name already exists, an exception will be thrown.\n\n#### Parameters\n\n**name** is a string representing the name of the streaming egine. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_engine.engine\\_name\", or just the engine name, like \"engine\\_name\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA streaming engine object.\n"
    },
    "DStream::sharedDict": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dstream_shareddict.html",
        "signatures": [
            {
                "full": "DStream::sharedDict(name, keyObj, valueObj, [ordered=false])",
                "name": "DStream::sharedDict",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyObj",
                        "name": "keyObj"
                    },
                    {
                        "full": "valueObj",
                        "name": "valueObj"
                    },
                    {
                        "full": "[ordered=false]",
                        "name": "ordered",
                        "optional": true,
                        "default": "false"
                    }
                ]
            },
            {
                "full": "DStream::sharedDict(name, keyType, valueType, [ordered=false])",
                "name": "DStream::sharedDict",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyType",
                        "name": "keyType"
                    },
                    {
                        "full": "valueType",
                        "name": "valueType"
                    },
                    {
                        "full": "[ordered=false]",
                        "name": "ordered",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::sharedDict](https://docs.dolphindb.com/en/Functions/d/dstream_shareddict.html)\n\n\n\n#### Syntax\n\nDStream::sharedDict(name, keyObj, valueObj, \\[ordered=false])\n\nor\n\nDStream::sharedDict(name, keyType, valueType, \\[ordered=false])\n\n#### Details\n\nCreates a shared dictionary in Orca, which is only usable within `DStream::udfEngine`. For details about dictionaries, refer to [dict](https://docs.dolphindb.com/en/Functions/d/dict.html).\n\n#### Parameters\n\n**name** is a STRING scalar indicating the shared dictionary name.\n\nFor the first usage:\n\n**keyObj** is a vector indicating dictionary keys.\n\n**valueObj** is a vector indicating dictionary values.\n\nFor the second usage:\n\n**keyType** is the data type of dictionary keys. The following data categories are supported: Integral (excluding COMPRESSED), Temporal, Floating and Literal.\n\n**valueType** is the data type of dictionary values. Note that COMPLEX/POINT/DECIMAL is not supported.\n\n**ordered** (optional) is a Boolean value. The default value is false, which indicates to create a regular dictionary. True means to create an ordered dictionary. The regular dictionaries do not track the insertion order of the key-value pairs whereas the ordered dictionaries preserve the insertion order of key-value pairs.\n\n#### Returns\n\nA dictionary.\n\n#### Examples\n\nIn this example, we use `DStream::sharedDict` and `DStream::udfEngine` to implement a count-based conditional alerting mechanism. The `DStream::sharedDict` is used to track the occurrence count of each key, and when the count for a key exceeds a predefined threshold, an alert message is sent downstream.\n\n```\nif(existsCatalog(\"orcaCatalog\")) dropCatalog(\"orcaCatalog\")\ncreateCatalog(\"orcaCatalog\")\ngo\nuse catalog orcaCatalog\n// Create stream graph\ng = createStreamGraph(\"counter\")\ng.sharedDict(\"counts\", STRING, LONG)\ng.source(\"items\", [\"key\"], [STRING])\n  .udfEngine(def(msg) {\n    counts = orcaObj(\"counts\")\n    triggered = table(100:0, `key`count, [STRING, LONG])\n    for(i in 0:msg.size()) {\n        keyVal = msg.key[i]\n        // Read current count\n        current = 0\n        if (keyVal in counts) {\n            current = counts[keyVal]\n        }\n        newCount = current + 1\n        // Update count\n        counts[keyVal] = newCount\n        // Check if threshold is triggered\n        if(newCount >= 3) {\n            triggered.append!(table(keyVal as key, newCount as count))\n        }\n    }\n    return triggered\n  })\n  .sink(\"alerts\")\ng.submit()\ngo\n// Generate mock data\nkeys = [\"A\", \"B\", \"A\", \"C\", \"B\", \"A\", \"B\", \"B\", \"C\", \"C\"]\nmockData1 = table(take(keys[0:3], 3) as key)\nmockData2 = table(take(keys[3:6], 3) as key)\nmockData3 = table(take(keys[6:10], 4) as key)\n// Insert data\nappendOrcaStreamTable(\"orcaCatalog.orca_table.items\", mockData1)\nappendOrcaStreamTable(\"orcaCatalog.orca_table.items\", mockData2) \nappendOrcaStreamTable(\"orcaCatalog.orca_table.items\", mockData3)\n// Wait for processing and inspect results\nsleep(1000)\nselect * from orcaCatalog.orca_table.alerts;\n```\n\n| key | count |\n| --- | ----- |\n| A   | 3     |\n| B   | 3     |\n| B   | 4     |\n| C   | 3     |\n"
    },
    "DStream::sharedKeyedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dstream_sharedkeyedtable.html",
        "signatures": [
            {
                "full": "DStream::sharedKeyedTable(name, keyColumns, X, [X1], [X2], .....)",
                "name": "DStream::sharedKeyedTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "DStream::sharedKeyedTable(name, keyColumns, capacity:size, colNames, colTypes)",
                "name": "DStream::sharedKeyedTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            },
            {
                "full": "DStream::sharedKeyedTable(name, keyColumns, table)",
                "name": "DStream::sharedKeyedTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::sharedKeyedTable](https://docs.dolphindb.com/en/Functions/d/dstream_sharedkeyedtable.html)\n\n\n\n#### Syntax\n\nDStream::sharedKeyedTable(name, keyColumns, X, \\[X1], \\[X2], .....)\n\nor\n\nDStream::sharedKeyedTable(name, keyColumns, capacity:size, colNames, colTypes)\n\nor\n\nDStream::sharedKeyedTable(name, keyColumns, table)\n\n#### Details\n\nCreates a shared keyed table in Orca, which is only usable within `DStream::udfEngine`. For details about keyed tables, refer to [keyedTable](https://docs.dolphindb.com/en/Functions/k/keyedTable.html).\n\n#### Parameters\n\n**name** is a STRING scalar indicating the shared keyed table name.\n\n**keyColumn** is a string scalar or vector indicating the name(s) of the primary key column(s). The column type must be INTEGRAL, TEMPORAL or LITERAL.\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n  * false for Boolean type;\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n  * Null value for Literal, INT128 types.\n\n* **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a string vector of data types. The non-key columns can be specified as an array vector type or ANY type.\n\nFor the third scenario, **table** is a table. Please note that *keyColumns* in *table* cannot have duplicate values.\n\n#### Returns\n\nA keyed table.\n\n#### Examples\n\nIn this example, we use `DStream::sharedKeyedTable` and `DStream::udfEngine` to implement a historical delta computation.\n\nThe `DStream::sharedKeyedTable` is used to maintain the most recent record for each ID. When a new record arrives, if an entry with the same id already exists in the table, the UDF outputs the difference between the new value and the previously stored (historical) value. If the ID does not exist, the new record is inserted into the table without producing any output.\n\n```\nif(existsCatalog(\"orcaCatalog\")) dropCatalog(\"orcaCatalog\")\ncreateCatalog(\"orcaCatalog\")\ngo\nuse catalog orcaCatalog\n// Create stream graph\ng = createStreamGraph(\"compare\")\ng.sharedKeyedTable(\"history\", \"id\", 1:0, `id`value, [INT, DOUBLE])\ng.source(\"data\", `id`value`time, [INT, DOUBLE, TIMESTAMP])\n  .udfEngine(def(msg) {\n    history = orcaObj(\"history\")\n    diffTable = table(100:0, `id`diff, [INT, DOUBLE])\n    for(i in 0:msg.size()) {\n        idVal = msg.id[i]\n        valueVal = msg.value[i]\n        // Read historical value\n        old = select value from history where id = idVal\n        // Write new value\n        newRow = table(idVal as id, valueVal as value)\n        history.append!(newRow)\n        // Compute delta\n        if(old.size() > 0) {\n            diffTable.append!(table(idVal as id, (valueVal - old.value[0]) as diff))\n        }\n    }\n    return diffTable\n  })\n  .sink(\"comparison\")\ng.submit()\n// Generate mock data\nmockData = table(1..5 as id, rand(100.0, 5) as value, now() + 1..5 as time)\n// Insert data\nappendOrcaStreamTable(\"orcaCatalog.orca_table.data\", mockData)\n//  Generate data with duplicate IDs\nmockData = table(1..5 as id, rand(100.0, 5) as value, now() + 1..5 as time)\n// Insert data\nappendOrcaStreamTable(\"orcaCatalog.orca_table.data\", mockData)\n// Wait for processing and inspect results\nsleep(1000)\nselect * from orcaCatalog.orca_table.comparison\n```\n\n| id | diff                |\n| -- | ------------------- |\n| 1  | 35.55946895749296   |\n| 2  | -3.4362593906550387 |\n| 3  | 36.283468999034596  |\n| 4  | 68.97968558337999   |\n| 5  | -91.64246928217878  |\n"
    },
    "DStream::sharedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dstream_sharedtable.html",
        "signatures": [
            {
                "full": "DStream::sharedTable(name, X, [X1], [X2], .....)",
                "name": "DStream::sharedTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "DStream::sharedTable(name, capacity:size, colNames, colTypes)",
                "name": "DStream::sharedTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::sharedTable](https://docs.dolphindb.com/en/Functions/d/dstream_sharedtable.html)\n\n\n\n#### Syntax\n\nDStream::sharedTable(name, X, \\[X1], \\[X2], .....)\n\nor\n\nDStream::sharedTable(name, capacity:size, colNames, colTypes)\n\n#### Details\n\nCreates a shared table in Orca, which is only usable within `DStream::udfEngine`. For details about table s, refer to [table](https://docs.dolphindb.com/en/Functions/t/table.html).\n\n#### Parameters\n\n**name** is a STRING scalar indicating the shared table name.\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n\n  * false for Boolean type;\n\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n\n  * Null value for Literal, INT128 types.\n\n  **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nIn this example, we use`DStream::sharedTable` and `DStream::udfEngine` to implement real-time computation and output of the current average. The `DStream::sharedTable` stores all previously computed average values. Each time new data is processed, the UDF recalculates the average based on the latest data, appends the result to the `DStream::sharedTable`, and outputs only the most recent row—i.e., the latest computed average—to the downstream.\n\n```\nif(existsCatalog(\"orcaCatalog\")) dropCatalog(\"orcaCatalog\")\ncreateCatalog(\"orcaCatalog\")\ngo\nuse catalog orcaCatalog\n\n// Create stream graph\ng = createStreamGraph(\"avgCalc\")\ng.sharedTable(\"stats\", 1:0, `sum`count, [DOUBLE, LONG])\n\ng.source(\"numbers\", [\"value\"], [DOUBLE])\n  .udfEngine(def(msg) {\n    stats = orcaObj(\"stats\")\n    \n    // Read historical value\n    if(stats.size() > 0) {\n        lastSum = exec last(sum) from stats\n        lastCount = exec last(count) from stats\n    } else {\n        lastSum = 0.0\n        lastCount = 0\n    }\n    \n    // Compute new value\n    newSum = lastSum + sum(msg.value)\n    newCount = lastCount + msg.size()\n    if (newCount > 0) {\n        avgValue = newSum / newCount\n    } else {\n        avgValue = 0.0\n    }\n    \n    // Write new value\n    newRow = table(newSum as sum, newCount as count)\n    stats.append!(newRow)\n    \n    // Return the result\n    return table(newSum as total, newCount as count, avgValue as avg)\n  })\n  .sink(\"output\")\n\ng.submit()\n\n// Generate mock data\nmockData1 = table(rand(10.0, 3) as value)\nmockData2 = table(rand(10.0, 5) as value)\nmockData3 = table(rand(10.0, 2) as value)\n\n// Insert data, wait for processing and inspect results\nappendOrcaStreamTable(\"orcaCatalog.orca_table.numbers\", mockData1)\nselect * from orcaCatalog.orca_table.numbers;\nselect * from orcaCatalog.orca_table.output;\nappendOrcaStreamTable(\"orcaCatalog.orca_table.numbers\", mockData2)\nselect * from orcaCatalog.orca_table.numbers;\nselect * from orcaCatalog.orca_table.output;\nappendOrcaStreamTable(\"orcaCatalog.orca_table.numbers\", mockData3)\nselect * from orcaCatalog.orca_table.numbers;\nselect * from orcaCatalog.orca_table.output;\n```\n"
    },
    "DStream::sink": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_sink.html",
        "signatures": [
            {
                "full": "DStream::sink(dest|name, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "DStream::sink",
                "parameters": [
                    {
                        "full": "dest|name",
                        "name": "dest|name"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::sink](https://docs.dolphindb.com/en/Functions/d/DStream_sink.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::sink(dest|name, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nOutputs the stream data to a persisted and shared stream table, a DFS table, or a function.\n\nIn Orca, the `sink` interface is the terminal node in the declarative API (DStream API). It is used to define the output destination of a streaming graph, writing stream data into a persistent shared stream table, a DFS table, or a function.\n\nWhen the sink target is a stream table, if the table does not already exist, it will be automatically created on the first write based on the structure of the input data, and schema inference will be performed.\n\nFor subsequent sink operations targeting the same stream table, the schema must remain consistent; otherwise, the system will throw a schema conflict error.\n\nFor more information on table persistence, refer to the [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html) documentation.\n\n#### Parameters\n\n**dest | name** The destination for the output stream, which can be:\n\n* A string specifying the fully qualified name of the target stream table or DFS table (e.g., \"trading.orca\\_table.factors\", \"trading.dbName.tableName\") or the DFS table path (e.g., \"dfs\\://dbName/tableName\").\n* A unary function that takes the stream table as input, whose return value will be ignored.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n"
    },
    "DStream::snapshotJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_snapshotJoinEngine.html",
        "signatures": [
            {
                "full": "DStream::snapshotJoinEngine(rightStream, metrics, matchingColumn, [timeColumn], [keepLeftDuplicates=false], [keepRightDuplicates=false], [isInnerJoin=true])",
                "name": "DStream::snapshotJoinEngine",
                "parameters": [
                    {
                        "full": "rightStream",
                        "name": "rightStream"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[keepLeftDuplicates=false]",
                        "name": "keepLeftDuplicates",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keepRightDuplicates=false]",
                        "name": "keepRightDuplicates",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[isInnerJoin=true]",
                        "name": "isInnerJoin",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::snapshotJoinEngine](https://docs.dolphindb.com/en/Functions/d/DStream_snapshotJoinEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::snapshotJoinEngine(rightStream, metrics, matchingColumn, \\[timeColumn], \\[keepLeftDuplicates=false], \\[keepRightDuplicates=false], \\[isInnerJoin=true])\n\n#### Details\n\nCreates a snapshot join streaming engine. For details, see [createSnapshotJoinEngine](https://docs.dolphindb.com/en/Functions/c/createSnapshotJoinEngine.html).\n\n#### Parameters\n\n**rightStream** is a DStream object indicating the input data source of the right table.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/metaprogramming.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions).\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, `<func(price) as `col1`col2>`.\n\nTo specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\n**Note:** The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**matchingColumn** is a STRING scalar/vector/tuple indicating the column(s) on which the tables are joined. It supports integral, temporal or literal (except UUID) types.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**timeColumn** (optional) is a STRING scalar/vector indicating the name of the time column in the left table and the right table. The time columns must have the same data type. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**keepLeftDuplicates** (optional) is a Boolean value indicating whether to match all records in each group of the left table. When set to false (default), the engine matches only the latest record in each group. When set to true, the engine matches all records in each group.\n\n**keepRightDuplicates** (optional) is a Boolean value indicating whether to match all records in each group of the right table. When set to false (default), the engine matches the latest record in each group. When set to true, the engine matches all records in each group.\n\n**isInnerJoin** (optional) is a Boolean value to determine whether an inner join or full outer join is performed.\n\n* If *isInnerJoin*=true (default), an inner join is performed. Results are only generated when matches are found between both tables.\n* If *isInnerJoin*=false, an outer join is performed. Results are generated whether or not a match is found. If there are unmatched records, entries from the other table are null padded.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('joinEngine')\n\ng = createStreamGraph('joinEngine')\nr = g.source(\"right\", 1024:0, `timestamp`sym2`id`price`qty, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE])\ng.source(\"left\", 1024:0, `timestamp`sym1`id`price`val, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE])\n    .snapshotJoinEngine(r, metrics=[<val*10>, <qty>], matchingColumn = [[\"id\",\"sym1\"],[\"id\",\"sym2\"]], \ntimeColumn = `timestamp, isInnerJoin=true, keepLeftDuplicates=true,keepRightDuplicates=true)\n    .sink(\"output\")\ng.submit()\ngo\n\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,1,2,1,5,2,4,4,1,4]\nprice = [2.53,7.61,8.07,7.87,7.29,9.39,5.98,9.49,9.20,9.17]\nval = [101,108,101,109,104,100,108,100,107,104]\ntmp1 = table(timestamp as timestamp,sym as sym1,id as id,price as price,val as val)\nappendOrcaStreamTable(\"left\", tmp1)\n\nid = [1,2,4,3,5,5,4,2,5,5]\nprice =  [1.08,9.08,9.97,7.60,1.91,6.77,7.81,8.81,0.61,5.92]\nqty =  [208,200,203,202,204,201,206,207,205,205]\ntmp2 = table(timestamp as timestamp,sym as sym2,id as id,price as price,qty as qty)\nappendOrcaStreamTable(\"right\", tmp2)\n\nselect * from orca_table.output\n```\n\n| id | sym1 | timestamp               | right\\_timestamp        | val\\_mul | qty |\n| -- | ---- | ----------------------- | ----------------------- | -------- | --- |\n| 0  | a    | 2024.10.10 15:12:01.508 | 2024.10.10 15:12:01.508 | 1,010    | 208 |\n| 1  | a    | 2024.10.10 15:12:01.512 | 2024.10.10 15:12:01.512 | 1,040    | 204 |\n| 2  | a    | 2024.10.10 15:12:01.512 | 2024.10.10 15:12:01.516 | 1,040    | 205 |\n| 3  | b    | 2024.10.10 15:12:01.513 | 2024.10.10 15:12:01.509 | 1,000    | 200 |\n| 4  | c    | 2024.10.10 15:12:01.514 | 2024.10.10 15:12:01.510 | 1,080    | 203 |\n| 5  | c    | 2024.10.10 15:12:01.514 | 2024.10.10 15:12:01.514 | 1,080    | 206 |\n| 6  | a    | 2024.10.10 15:12:01.516 | 2024.10.10 15:12:01.508 | 1,070    | 208 |\n"
    },
    "DStream::sparseReactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_SparseReactiveStateEngine.html",
        "signatures": [
            {
                "full": "DStream::sparseReactiveStateEngine(metrics, keyColumn, [extraColumn])",
                "name": "DStream::sparseReactiveStateEngine",
                "parameters": [
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[extraColumn]",
                        "name": "extraColumn",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::sparseReactiveStateEngine](https://docs.dolphindb.com/en/Functions/d/DStream_SparseReactiveStateEngine.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nDStream::sparseReactiveStateEngine(metrics, keyColumn, \\[extraColumn])\n\n#### Details\n\nCreates a sparse reactive state engine for sparse state computation. For details, see [createSparseReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createSparseReactiveStateEngine.html).\n\n#### Parameters\n\n**metrics** is a table representing the set of sparse state computation rules. It must contain at least 3 columns: `keyColumn(s), formula, outputMetricKey`.\n\n* The first N columns are input metric identifier columns. Their count and order must match those specified by *keyColumn*. Each row provides some values of *keyColumn* in the input table (e.g., if the input table identifies metrics by `deviceID`, values can be `\"A001\"`, `\"R131\"`, etc.).\n* **formula** is a STRING scalar/vector or metacode representing the computation expression for the metric. Variable names in the expression correspond to value columns in the input table (e.g., `metricValue`; also multi-value columns such as `Value1`, `Value2`).\n* **outputMetricKey** is a STRING scalar/vector indicating the new output metric name (must be unique), e.g., `\"A001_event_B\"`.\n\n**Notes**: In Orca, the formula column with user-defined functions supports only metacode in `<>` format.\n\n**keyColumn** is a STRING scalar/vector indicating the primary key column names of the input table (used to identify “which metric/device the current row belongs to”). If *keyColumn* has N columns, *metrics* must have N corresponding leading identifier columns.\n\n**extraColumn** (optional) is a STRING scalar/vector indicating the column names in the input table that should be carried to the output table unchanged (e.g., time columns).\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\n// Create a catalog if it does not exist\nif (!existsCatalog(\"orca\")) {  \n    createCatalog(\"orca\")  \n}  \ngo  \nuse catalog orca  \n  \n// If a stream graph with the same name already exists, destroy it first\n// dropStreamGraph(\"sparseGraph\")\ng = createStreamGraph(\"sparseGraph\")\n\n// Define the schema of inputTable and outputTable, as well as the SparseReactiveStateEngine\n\nbaseStream = g.source(\"trade\", `timestamp`date`deviceId1`deviceId2`deviceId3`value1`value2`value3, [TIMESTAMP, DATE, STRING, STRING, STRING, DOUBLE, DOUBLE, DOUBLE])\nformulas = [<cumsumTopN(value1, value2, 5)>, <cumavgTopN(value1, value2, 10)>, <cumstdTopN(value1, value2, 15)>, <cumstdpTopN(value1, value2, 20)>, <cumvarTopN(value1, value2, 5)>, <cumvarpTopN(value1, value2, 10)>, <cumskewTopN(value1, value2, 10)>, <cumkurtosisTopN(value1, value2, 10)>, <cumbetaTopN(value1, value2, value3, 10)>, <cumcorrTopN(value1, value2, value3, 10)>, <cumcovarTopN(value1, value2, value3, 10)>, <cumwsumTopN(value1, value2, value3, 10)>]\nkeys = \"A\"+string(1..size(formulas))\nkeys1 = keys.shuffle()\nkeys2 = keys.shuffle()\noutKeys = \"event\"+string(1..size(formulas))\nmetrics = table(\n    keys1 as deviceId1,\n    keys2 as deviceId2,\n    formulas as formula,\n    outKeys as outputMetricKey\n)\nbaseStream.sparseReactiveStateEngine(metrics, `deviceId1`deviceId2, `timestamp`date)\n.setEngineName(\"srsEngine\")\n.sink(\"output\")\ng.submit()\ngo\n\n\n// Append data and view the ouput\nn = 10000\nfor(i in 1..5){\n    data = table(rand(timestamp(1..1000), n) as timestamp, rand(date(1..1000), n) as date, rand(keys, n) as deviceId1, rand(keys, n) as deviceId2, take(keys, n) as deviceId3, rand(rand(-1000.0:1000.0, n) join take(double(), n/5), n) as value1, rand(rand(-1000.0:1000.0, n) join take(double(), n/5), n) as value2, rand(rand(-1000.0:1000.0, n) join take(double(), n/5), n) as value3)\n    appendOrcaStreamTable(\"trade\", data)\n}\nsleep(3000)\nres = select * from orca_table.output\n```\n\n**Related function**: [createSparseReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createSparseReactiveStateEngine.html)\n"
    },
    "DStream::sync": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_sync.html",
        "signatures": [
            {
                "full": "DStream::sync()",
                "name": "DStream::sync",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [DStream::sync](https://docs.dolphindb.com/en/Functions/d/DStream_sync.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::sync()\n\n#### Details\n\nWaits for all parallel tasks to complete before proceeding with downstream operations. Typically used to synchronize and merge parallel processing branches.\n\nNote: The `DStream::parallelize` and `DStream::sync` methods must be called together.\n\n#### Parameters\n\nNone\n\n#### Examples\n\nPartition the stream data into four streams based on the symbol column for downstream calculations:\n\n```\nuse catalog test\n\ng = createStreamGraph(name)\ng.source(\"trade\", 1024:0, `symbol`datetime`price`volume, [SYMBOL, TIMESTAMP,DOUBLE, INT])\n  .parallelize(\"symbol\", 4)\n  .timeSeriesEngine(60*1000, 60*1000, <[first(price),max(price),min(price),last(price),sum(volume)]>, \"datetime\", false, \"symbol\")\n  .reactiveStateEngine(<[datetime, first_price, max_price, min_price, last_price, sum_volume, mmax(max_price, 5), mavg(sum_volume, 5)]>, `symbol)\n  .sync()\n  .sink(\"output\")\n.g.submit()\n```\n"
    },
    "DStream::timeBucketEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_timeBucketEngine.html",
        "signatures": [
            {
                "full": "DStream::timeBucketEngine(timeCutPoints, metrics, timeColumn, [keyColumn], [useWindowStartTime], [closed='left'], [fill='none'], [keyPurgeFreqInSecond=-1], [parallelism=1])",
                "name": "DStream::timeBucketEngine",
                "parameters": [
                    {
                        "full": "timeCutPoints",
                        "name": "timeCutPoints"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime]",
                        "name": "useWindowStartTime",
                        "optional": true
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=-1]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::timeBucketEngine](https://docs.dolphindb.com/en/Functions/d/DStream_timeBucketEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::timeBucketEngine(timeCutPoints, metrics, timeColumn, \\[keyColumn], \\[useWindowStartTime], \\[closed='left'], \\[fill='none'], \\[keyPurgeFreqInSecond=-1], \\[parallelism=1])\n\n#### Details\n\nCreates a time-series aggregation engine that processes data in custom time windows. For details, see [createTimeBucketEngine](https://docs.dolphindb.com/en/Functions/c/createTimeBucketEngine.html).\n\n#### Parameters\n\n**timeCutPoints** is a vector of MINUTE or SECOND type defining window boundaries. Each adjacent pair of elements forms a window. Note:\n\n* Must contain no null values.\n* The timestamp precision of *timeCutPoints* must be equal to or coarser than the precision of *timeColumn*.\n* Its precision determines the exact window boundary behavior. For example, minute-precision window \\[09:00, 09:05) excludes data ≥ 09:04:00; second-precision window \\[09:00:00, 09:05:00) excludes data ≥ 09:04:59.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n* The metacode can be a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n* If *metrics* is a tuple with multiple formulas, *windowSize* is specified as a vector of the same length as *metrics*. Each element of *windowSize* corresponds to the elements 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)>]]`.\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**timeColumn** is a STRING scalar or vector specifying the time column(s) of the subscribed stream table.\n\nNote: If *timeColumn* is a vector, it must have a date element (of DATE type) and a time element (of TIME, SECOND or NANOTIME type). In this case, the first column in *outputTable* must take the data type of concatDateTime(date, time).\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\n**useWindowStartTime** (optional) is a Boolean value indicating whether the time column in *outputTable* is the starting time of the windows. The default value is false, which means the timestamps in the output table are the end time of the windows.\n\n**closed** (optional) is a STRING indicating whether the left or the right boundary is included.\n\n* closed = 'left': left-closed, right-open\n* closed = 'right': left-open, right-closed\n\n**fill** (optional) is a vector/scalar indicating the filling method to deal with an empty window (in a group). It can be:\n\n* 'none': no result\n* 'null': output a null value.\n* 'ffill': output the result in the last window.\n* specific value: output the specified value. Its type should be the same as metrics output's type.\n\n*fill* could be a vector to specify different filling method for each metric. The size of the vector must be consistent with the number of elements specified in *metrics*. The element in vector cannot be 'none'.\n\n**keyPurgeFreqInSec** (optional) 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.\n\nNote: To specify this parameter, parameter *keyColumn* must be specified and parameter *fill* cannot be specified.\n\n**parallelism** (optional) is a positive integer no greater than 63, representing the number of worker threads for parallel computation. The default value is 1. For compute-intensive workloads, adjusting this parameter appropriately can effectively utilize computing resources and reduce computation time. It is recommended to set a value less than the number of CPU cores, normally from 4 to 8.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\ng = createStreamGraph('engine')\n\ng.source(\"trades\", 1000:0, `time`sym`price`volume, [TIMESTAMP, SYMBOL, DOUBLE, INT])\n.timeSeriesEngine(windowSize=60000, step=60000, metrics=<[first(price), max(price), min(price), last(price), sum(volume)]>, timeColumn=`time, useSystemTime=false, keyColumn=`sym, useWindowStartTime=false)\n.timeBucketEngine(timeCutPoints=[10:00m, 10:05m, 10:10m, 10:15m], metrics=<[first(first_price), max(max_price), min(min_price), last(last_price), sum(sum_volume)]>, timeColumn=`time,  keyColumn=`sym)\n.sink(\"output\")\ng.submit()\ngo\n\ntimes = [2024.10.08T10:01:01.785, 2024.10.08T10:01:02.125, 2024.10.08T10:01:12.457, 2024.10.08T10:03:10.789, 2024.10.08T10:03:12.005, 2024.10.08T10:08:02.236, 2024.10.08T10:08:04.412, 2024.10.08T10:08:05.152, 2024.10.08T10:08:30.021, 2024.10.08T10:10:20.123, 2024.10.08T10:11:02.236, 2024.10.08T10:13:04.412, 2024.10.08T10:15:12.005]\nsyms = [`A, `B, `A, `A, `B, `A, `B, `B, `A, `A, `A, `B, `B]\nprices = [10.83, 21.73, 10.79, 11.81, 22.96, 11.25, 23.03, 23.18, 11.04, 11.85, 11.06, 23.15, 22.06]\nvolumes = [2110, 1600, 2850, 2250, 1980, 2400, 2130, 1900, 2300, 2200, 2200, 1880, 2100]\ntmp = table(times as time, syms as sym, prices as price, volumes as volume)\nappendOrcaStreamTable(\"trades\", tmp)\n\nselect * from orca_table.output\n```\n\n| time                    | sym | first\\_first\\_price | max\\_max\\_price | min\\_min\\_price | last\\_last\\_price | sum\\_sum\\_volume |\n| ----------------------- | --- | ------------------- | --------------- | --------------- | ----------------- | ---------------- |\n| 2024.10.08 10:05:00.000 | A   | 10.83               | 11.81           | 10.79           | 11.81             | 7,210            |\n| 2024.10.08 10:05:00.000 | B   | 21.73               | 22.96           | 21.73           | 22.96             | 3,580            |\n| 2024.10.08 10:10:00.000 | A   | 11.25               | 11.25           | 11.04           | 11.04             | 4,700            |\n| 2024.10.08 10:10:00.000 | B   | 23.03               | 23.18           | 23.03           | 23.18             | 4,030            |\n| 2024.10.08 10:15:00.000 | B   | 23.15               | 23.15           | 23.15           | 23.15             | 1,880            |\n"
    },
    "DStream::timerEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_timerEngine.html",
        "signatures": [
            {
                "full": "DStream::timerEngine(interval, func, args...)",
                "name": "DStream::timerEngine",
                "parameters": [
                    {
                        "full": "interval",
                        "name": "interval"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [DStream::timerEngine](https://docs.dolphindb.com/en/Functions/d/DStream_timerEngine.html)\n\n\n\n#### Syntax\n\nDStream::timerEngine(interval, func, args...)\n\n#### Details\n\nDefine a time-triggered engine to periodically execute *func* at intervals. This job does not block or modify the data flow of the stream graph.\n\n#### Parameters\n\n**interval** An INTEGRAL scalar representing the time interval (in second) between job executions.\n\n**func** A FUNCTIONDEF scalar representing the scheduled job.\n\n**args…** The parameter passed to *func*, used similarly to the *args…* parameter of the remote procedure call function [rpc](https://docs.dolphindb.com/en/Functions/r/rpc.html). Can be omitted when *func* is a parameterless function.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\nSubmit the job:\n\n```\nif (!existsCatalog(\"test\")) {\n\tcreateCatalog(\"test\")\t\n}\ngo\nuse catalog test\n\n// Define the job\ndef myFunc(x,y,z){\n    writeLog(x,y,z)\n}\n\n// Define the parameter\na = \"aaa\"\nb = \"bbb\"\nc = \"ccc\"\n\n// Submit the steam graph\ng = createStreamGraph(\"timerEngineDemo\")\ng.source(\"trade\", `id`price, [INT, DOUBLE])\n .timerEngine(3, myFunc, a, b, c)\n .setEngineName(\"myJob\")\n .sink(\"result\")\ng.submit()\n```\n\nStop job execution:\n\n```\nuseOrcaStreamEngine(\"myJob\", stopTimerEngine)\n```\n\nResume job execution:\n\n```\nuseOrcaStreamEngine(\"myJob\", resumeTimerEngine)\n```\n\n**Related functions:**[resumeTimerEngine](https://docs.dolphindb.com/en/Functions/r/resumeTimerEngine.html), [stopTimerEngine](https://docs.dolphindb.com/en/Functions/s/stopTimerEngine.html)\n"
    },
    "DStream::timeSeriesEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_timeSeriesEngine.html",
        "signatures": [
            {
                "full": "DStream::timeSeriesEngine(windowSize, step, metrics, [timeColumn], [useSystemTime=false], [keyColumn], [updateTime], [useWindowStartTime], [roundTime=true], [fill='none'], [forceTriggerTime], [keyPurgeFreqInSecond=-1], [closed='left'], [subWindow], [parallelism=1], [acceptedDelay=0])",
                "name": "DStream::timeSeriesEngine",
                "parameters": [
                    {
                        "full": "windowSize",
                        "name": "windowSize"
                    },
                    {
                        "full": "step",
                        "name": "step"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime]",
                        "name": "useWindowStartTime",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=-1]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[subWindow]",
                        "name": "subWindow",
                        "optional": true
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[acceptedDelay=0]",
                        "name": "acceptedDelay",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::timeSeriesEngine](https://docs.dolphindb.com/en/Functions/d/DStream_timeSeriesEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::timeSeriesEngine(windowSize, step, metrics, \\[timeColumn], \\[useSystemTime=false], \\[keyColumn], \\[updateTime], \\[useWindowStartTime], \\[roundTime=true], \\[fill='none'], \\[forceTriggerTime], \\[keyPurgeFreqInSecond=-1], \\[closed='left'], \\[subWindow], \\[parallelism=1], \\[acceptedDelay=0])\n\n#### Details\n\nCreates a time-series streaming engine. For details, see [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html).\n\n#### Parameters\n\n**windowSize** is a scalar or vector with positive integers that specifies the size of the windows for calculation.\n\n**step** is a positive integer indicating how much each window moves forward relative to the previous one. Note that step must be divisible by *windowSize*, otherwise an exception will be thrown.\n\n* If *useSystemTime* =true, the unit of *windowSize* and *step* is millisecond.\n* If *useSystemTime* =false, the unit of *windowSize* and *step* is the same as the unit of *timeColumn*.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n* The metacode can be a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n* If *metrics* is a tuple with multiple formulas, *windowSize* is specified as a vector of the same length as *metrics*. Each element of *windowSize* corresponds to the elements 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)>]]`.\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**timeColumn** (optional) is a STRING scalar or vector specifying the time column(s) of the subscribed stream table. When *useSystemTime* = false, it must be specified.\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* *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.\n* *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. Note that the record which triggers the calculation will not participate in this calculation.\n\nFor 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.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\n**updateTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*. It is used to trigger window calculations at an interval shorter than *step*. *step* must be a multiple of *updateTime*. To specify *updateTime*, *useSystemTime* must be set to false.\n\nIf *updateTime* is not specified, calculation for a window will not occur before the window ends. By specifying *updateTime*, you can calculate the values for several times in an window of which calculation hasn't been triggered for a long time.\n\n**useWindowStartTime** (optional) is a Boolean value indicating whether the time column in *outputTable* is the starting time of the windows. The default value is false, which means the timestamps in the output table are the end time of the windows. If the *windowSize* is a vector, *useWindowStartTime* must be false.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary if the time precision is milliseconds or seconds and step is bigger than one minute. The default value is true indicating the alignment is based on the multi-minute rule (see the [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.md#)). False means alignment is based on the one-minute rule.\n\n**fill** (optional) is a vector/scalar indicating the filling method to deal with an empty window (in a group). It can be:\n\n* 'none': no result\n* 'null': output a null value.\n* 'ffill': output the result in the last window.\n* specific value: output the specified value. Its type should be the same as metrics output's type.\n\n*fill* could be a vector to specify different filling method for each metric. The size of the vector must be consistent with the number of elements specified in *metrics*. The element in vector cannot be 'none'.\n\n**forceTriggerTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*, indicating the waiting time to force trigger calculation in the uncalculated windows for each group. If *forceTriggerTime* is set, *useSystemTime* must be false and *updateTime* cannot be specified.\n\nThe rules are as follow:\n\n(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.\n\n(2) If no data is ingested into a group after the last window is calculated, and new data continues to ingest into other groups, the specified *fill* parameter can be used to fill results for empty windows of that group. The group's windows will still be output at the latest time point. If parameter *fill* is not specified, no new windows will be generated for that group after the last window has been triggered for computation.\n\nNote the following points when setting *forceTriggerTime* or *updateTime*:\n\n* If *updateTime* is specified, the result of the current window calculation will be updated again when data belonging to the current window still arrives after the calculation is triggered.\n* If *forceTriggerTime* is specified, the incoming data with a timestamp within the current window will be discarded after the calculation is forced to be triggered.\n* If the time specified by `timeColumn` is of type `TIME`, it cannot determine the chronological order of data across different days based on time alone. As a result, forced triggering may fail when data spans multiple days. The time in `timeColumn` needs to include the date.\n\n**keyPurgeFreqInSec** (optional) is a positive integer, measured in seconds. It controls the periodic cleanup of keys corresponding to groups where \"window data is empty,\" in order to prevent excessive memory usage caused by the continuous growth of keys. When this parameter is specified, if the time interval between the current data insertion time and the last cleanup time is greater than or equal to *keyPurgeFreqInSec*, the group with empty window data and its corresponding key will be deleted.\n\nNote: To specify this parameter, parameter *forceTriggerTime* must be specified and parameter *fill* cannot be specified.\n\nYou can check the number of groups in a time-series streaming engine based on the column \"numGroups\" returned by [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html).\n\n**closed** (optional) is a STRING indicating whether the left or the right boundary is included.\n\n* closed = 'left': left-closed, right-open\n* closed = 'right': left-open, right-closed\n\n**subWindow**(optional)is a pair of integers or DURATION values, indicating the range of the subwindow within the window specified by *windowSize*. If specified, only results calculated within subwindows will be returned and the time column of the output table displays the end time of each subwindow. The calculation of the subwindow will be triggered by the arrival of the next record after the subwindow ends. The boundary of the subwindow is determined by parameter *closed*. When *subWindow* is a pair of integers, it takes the same time precision as *timeColumn*.\n\n**parallelism** (optional) is a positive integer no greater than 63, representing the number of worker threads for parallel computation. The default value is 1. For compute-intensive workloads, adjusting this parameter appropriately can effectively utilize computing resources and reduce computation time. It is recommended to set a value less than the number of CPU cores, normally from 4 to 8.\n\n**acceptedDelay** (optional) is a positive integer specifying the maximum delay for each window to accept data. The default value is 0.\n\n* When *useSystemTime*=true, data received within the *acceptedDelay*time after the window ends will still be considered part of the current window and participate in the computation, and will not be included in the computation of the next window.\n* When *useSystemTime*=false, a window with t as right boundary will wait until a record with a timestamp equal to or later than t + *acceptedDelay* arrives. When such a record arrives, the current window closes and performs a calculation on all records within the window frame. This handles scenarios with out-of-order data.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('engine')\ng = createStreamGraph('engine')\n\ng.source(\"trades\", 1000:0, [\"time\",\"sym\",\"volume\"], [TIMESTAMP, SYMBOL, INT])\n.timeSeriesEngine(windowSize=60000, step=60000, metrics=<[sum(volume)]>, timeColumn=\"time\", useSystemTime=false, keyColumn=\"sym\", useWindowStartTime=false)\n.sink(\"output\")\ng.submit()\ngo\n\ntimes = [2018.10.08T01:01:01.785, 2018.10.08T01:01:02.125, 2018.10.08T01:01:10.263, 2018.10.08T01:01:12.457, 2018.10.08T01:02:10.789, 2018.10.08T01:02:12.005, 2018.10.08T01:02:30.021, 2018.10.08T01:04:02.236, 2018.10.08T01:04:04.412, 2018.10.08T01:04:05.152]\nsyms = [`A, `B, `B, `A, `A, `B, `A, `A, `B, `B]\nvolumes = [10, 26, 14, 28, 15, 9, 10, 29, 32, 23]\n\ntmp = table(times as time, syms as sym, volumes as volume)\nappendOrcaStreamTable(\"trades\", tmp)\n\n\nselect * from orca_table.output\n```\n\n<table id=\"table_slb_dp3_3fc\"><thead><tr><th align=\"left\">\n\ntime\n\n</th><th align=\"left\">\n\nsym\n\n</th><th align=\"left\">\n\nsum\\_volume\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\n2018.10.08 01:02:00.000\n\n</td><td align=\"left\">\n\nA\n\n</td><td align=\"left\">\n\n38\n\n</td></tr><tr><td align=\"left\">\n\n2018.10.08 01:02:00.000\n\n</td><td align=\"left\">\n\nB\n\n</td><td align=\"left\">\n\n40\n\n</td></tr><tr><td align=\"left\">\n\n2018.10.08 01:03:00.000\n\n</td><td align=\"left\">\n\nA\n\n</td><td align=\"left\">\n\n25\n\n</td></tr><tr><td align=\"left\">\n\n2018.10.08 01:03:00.000\n\n</td><td align=\"left\">\n\nB\n\n</td><td align=\"left\">\n\n9\n\n</td></tr></tbody>\n</table>\n"
    },
    "DStream::udfEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_udfEngine.html",
        "signatures": [
            {
                "full": "DStream::udfEngine(func)",
                "name": "DStream::udfEngine",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    }
                ]
            }
        ],
        "markdown": "### [DStream::udfEngine](https://docs.dolphindb.com/en/Functions/d/DStream_udfEngine.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nDStream::udfEngine(func)\n\n#### Details\n\n`DStream::udfEngine` is an extension engine in Orca stream graphs used to execute user-defined processing logic. When the built-in streaming engine cannot meet specific business requirements, users can define functions via `DStream::udfEngine` to process each stream record.\n\nTo enable stateful computation, UDF functions can access shared variables declared via `DStream::sharedTable`, `DStream::sharedDict`, or `DStream::sharedKeyedTable`. These shared variables can be used across multiple `udfEngine` instances and tasks within the same stream graph. Orca automatically persists their state using the Checkpoint mechanism and restores them during failure recovery.\n\nNote: UDF functions are not allowed to access any external variables. Only local variables or shared variables referenced via `orcaObj(\"name\")` are permitted.\n\n**Constraints on Shared Variable**\n\n* Shared variables must be declared in advance using `DStream::sharedTable`, `DStream::sharedDict`, or `DStream::sharedKeyedTable`. Within a UDF function, they can be referenced via `orcaObj(\"name\")`. Note that `orcaObj` is only valid in the execution context of the UDF.\n\n* Each shared variable follows a single-writer, multiple-reader pattern: only one `udfEngine` instance can write to it, while multiple instances may read it concurrently.\n\n* All tasks that access the same shared variable are scheduled by Orca on the same physical node to ensure local access and state consistency.\n\n#### Parameters\n\n**func** A user-defined function. It accepts only one parameter, which is a stream table. This parameter must not be modified in place or treated as a mutable object. Within the function, shared variables defined by `DStream::sharedTable`, `DStream::sharedDict`, or `DStream::sharedKeyedTable` can be read and written for state updates. If the function returns a value, it must be either a dictionary or a table.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\nIn this example, we use `DStream::sharedKeyedTable` and `DStream::udfEngine` to implement a historical delta computation.\n\nThe `DStream::sharedKeyedTable` is used to maintain the most recent record for each ID. When a new record arrives, if an entry with the same id already exists in the table, the UDF outputs the difference between the new value and the previously stored (historical) value. If the ID does not exist, the new record is inserted into the table without producing any output.\n\n```\nif(existsCatalog(\"orcaCatalog\")) dropCatalog(\"orcaCatalog\")\ncreateCatalog(\"orcaCatalog\")\ngo\nuse catalog orcaCatalog\n// Create stream graph\ng = createStreamGraph(\"compare\")\ng.sharedKeyedTable(\"history\", \"id\", 1:0, `id`value, [INT, DOUBLE])\ng.source(\"data\", `id`value`time, [INT, DOUBLE, TIMESTAMP])\n  .udfEngine(def(msg) {\n    history = orcaObj(\"history\")\n    diffTable = table(100:0, `id`diff, [INT, DOUBLE])\n    for(i in 0:msg.size()) {\n        idVal = msg.id[i]\n        valueVal = msg.value[i]\n        // Read historical value\n        old = select value from history where id = idVal\n        // Write new value\n        newRow = table(idVal as id, valueVal as value)\n        history.append!(newRow)\n        // Compute delta\n        if(old.size() > 0) {\n            diffTable.append!(table(idVal as id, (valueVal - old.value[0]) as diff))\n        }\n    }\n    return diffTable\n  })\n  .sink(\"comparison\")\ng.submit()\n// Generate mock data\nmockData = table(1..5 as id, rand(100.0, 5) as value, now() + 1..5 as time)\n// Insert data\nappendOrcaStreamTable(\"orcaCatalog.orca_table.data\", mockData)\n//  Generate data with duplicate IDs\nmockData = table(1..5 as id, rand(100.0, 5) as value, now() + 1..5 as time)\n// Insert data\nappendOrcaStreamTable(\"orcaCatalog.orca_table.data\", mockData)\n// Wait for processing and inspect results\nsleep(1000)\nselect * from orcaCatalog.orca_table.comparison\n```\n\n| id | diff                |\n| -- | ------------------- |\n| 1  | 35.55946895749296   |\n| 2  | -3.4362593906550387 |\n| 3  | 36.283468999034596  |\n| 4  | 68.97968558337999   |\n| 5  | -91.64246928217878  |\n\n**Related functions**: [DStream::map](https://docs.dolphindb.com/en/Functions/d/DStream_map.html), [getUdfEngineVariable](https://docs.dolphindb.com/en/Functions/g/getUdfEngineVariable.html)\n"
    },
    "DStream::windowJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/d/DStream_windowJoinEngine.html",
        "signatures": [
            {
                "full": "DStream::windowJoinEngine(rightStream, window, metrics, matchingColumn, [timeColumn], [useSystemTime=false], [garbageSize], [maxDelayedTime], [nullFill], [sortByTime], [closed])",
                "name": "DStream::windowJoinEngine",
                "parameters": [
                    {
                        "full": "rightStream",
                        "name": "rightStream"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[maxDelayedTime]",
                        "name": "maxDelayedTime",
                        "optional": true
                    },
                    {
                        "full": "[nullFill]",
                        "name": "nullFill",
                        "optional": true
                    },
                    {
                        "full": "[sortByTime]",
                        "name": "sortByTime",
                        "optional": true
                    },
                    {
                        "full": "[closed]",
                        "name": "closed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [DStream::windowJoinEngine](https://docs.dolphindb.com/en/Functions/d/DStream_windowJoinEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nDStream::windowJoinEngine(rightStream, window, metrics, matchingColumn, \\[timeColumn], \\[useSystemTime=false], \\[garbageSize], \\[maxDelayedTime], \\[nullFill], \\[sortByTime], \\[closed])\n\n#### Details\n\nCreates a window join streaming engine. For details, see [createWindowJoinEngine](https://docs.dolphindb.com/en/Functions/c/createWindowJoinEngine.html).\n\n**Note:** In Orca, the column types in the output table are inferred automatically:\n\n* window = 0:0 (special window): For non-aggregated results, the output is inferred as an array vector by default. If the result type does not support array vectors, it is automatically converted to a columnar tuple.\n\n* window ≠ 0:0 (regular window): The output is inferred as an array vector only when `toArray` is explicitly specified.\n\n#### Parameters\n\n**rightStream** is a DStream object indicating the input data source of the right table.\n\n**window** is a pair of integers or duration values, indicating the range of a sliding window, including both left and right bounds.\n\n**metrics** is metacode (which can be a tuple) specifying the calculation formulas. For more information about metacode, please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (both aggregate functions and non-aggregate functions are accepted).\n\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\nIf you want to specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\nWhen an array vector result is required, explicitly apply the `toArray` function to convert the result type.\n\nThe `toColumnarTuple` function is supported to convert non-aggregated computation results into columnar tuples.\n\nThe following functions are optimized in the engine when they are applied only to the columns from the right table: `sum`, `sum2`, `avg`, `std`, `var`, `corr`, `covar`, `wavg`, `wsum`, `beta`, `max`, `min`, `last`, `first`, `med`, `percentile`.\n\n**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.\n\n* When there is only 1 column to match - 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If the names of all the columns to match are the same in both tables, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**timeColumn** (optional) When *useSystemTime* = false, it must be specified to indicate the name(s) of the time column in the left table and the right table. The time columns must have the same data type. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**useSystemTime** (optional) indicates whether the left table and the right table are joined on the system time, instead of on the *timeColumn*.\n\n* *useSystemTime* = true: join records based on the system time (timestamp with millisecond precision) when they are ingested into the engine.\n\n* *useSystemTime* = false (default): join records based on the specified timeColumn from the left table and the right table.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (rows). As the subscribed data is ingested into the engine, it continues to take up the memory. Within the left/right table, the records are grouped by *matchingColumn* values; When the number of records in a group exceeds *garbageSize*, the system will remove those already been calculated from memory.\n\n**maxDelayedTime** (optional) is a positive integer. *maxDelayedTime* only takes effect when *timeColumn* is specified and the two arguments must have the same time precision. Use *maxDelayedTime* to trigger windows which remain uncalculated long past its end. The default *maxDelayedTime* is 3 seconds. For more information about this parameter, see \"Window triggering rules\" in the Details section.\n\n**nullFill** (optional) is a tuple of the same size as the number of output columns. It is used to fill in the null values in the output table. The data type of each element corresponds to each output column.\n\n**sortByTime** (optional) is a Boolean value that indicates whether the output data is globally sorted by time. The default value is false, meaning the output data is sorted only within groups. Note that if *sortByTime* is set to true, the data input to the left and right tables must be globally sorted, and the parameter *maxDelayedTime* cannot be specified (i.e., no delayed triggering allowed).\n\n**closed**(optional) is a string that indicates whether the left or the right boundary is included. It only takes effect when *window*=0:0.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\n// If a stream graph with the same name already exists, destroy it first.\n// dropStreamGraph('joinEngine')\ng = createStreamGraph('joinEngine')\n\nr = g.source(\"right\", 1024:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE])\ng.source(\"left\", 1024:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\n    .windowJoinEngine(r, window=-2:2, metrics=<[price,val,sum(val)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false,nullFill=[2012.01.01T00:00:00.000, `NONE, 0.0, 0.0, 0.0])\n    .sink(\"output\")\ng.submit()\n\ngo\n\nn=10\ntp1=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(NULL join rand(10.0, n-1),2*n) as price)\ntp1.sortBy!(`time)\nappendOrcaStreamTable(\"left\", tp1)\n\ntp2=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(double(1..n),2*n) as val)\ntp2.sortBy!(`time)\nappendOrcaStreamTable(\"right\", tp2)\n\n\nselect * from orca_table.output\n```\n"
    },
    "dumpHeapSample": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dumpHeapSample.html",
        "signatures": [
            {
                "full": "dumpHeapSample(filename)",
                "name": "dumpHeapSample",
                "parameters": [
                    {
                        "full": "filename",
                        "name": "filename"
                    }
                ]
            }
        ],
        "markdown": "### [dumpHeapSample](https://docs.dolphindb.com/en/Functions/d/dumpHeapSample.html)\n\n\n\n#### Syntax\n\ndumpHeapSample(filename)\n\n#### Details\n\nThis function generates a snapshot of the current heap memory. It records the current memory usage, including allocated memory blocks, their sizes, and states. Only administrators can execute this function.\n\n#### Parameters\n\n**filename** is a string representing the path for the heap memory snapshot file.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nRecommended workflow for memory usage analysis:\n\n1. Enable heap memory sampling: This can be done by setting the environment variable TCMALLOC\\_SAMPLE\\_PARAMETER to a value between 1 and 524288 (recommended: 524288) before starting DolphinDB; or by dynamically enabling it using `startHeapSample`.\n2. Execute `dumpHeapSample` before and after operations that may cause memory leaks, saving to two different files. Compare these files to confirm memory allocation and usage related to the operation.\n3. Disable heap memory sampling.\n\n```\nstartHeapSample(524288)\n​\ndumpHeapSample(\"/DolphinDB/Data/heap1\")\ndumpHeapSample(\"/DolphinDB/Data/heap2\")\n​\nstopHeapSample()\n```\n\nRelated functions: [startHeapSample](https://docs.dolphindb.com/en/Functions/s/startHeapSample.html), [stopHeapSample](https://docs.dolphindb.com/en/Functions/s/stopHeapSample.html)\n"
    },
    "duration": {
        "url": "https://docs.dolphindb.com/en/Functions/d/duration.html",
        "signatures": [
            {
                "full": "duration(X)",
                "name": "duration",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [duration](https://docs.dolphindb.com/en/Functions/d/duration.html)\n\n\n\n#### Syntax\n\nduration(X)\n\n#### Details\n\nConvert *X* to DURATION type which indicates the length of a time interval.\n\nNote:\n\n* The unit of the time interval used for grouping cannot be more granular than the unit of the temporal column.\n\n* Time units are case-sensitive, for example, \"M\" means month and \"m\" means minute. If the unit of the time interval is M, use function [month](https://docs.dolphindb.com/en/Functions/m/month.html) to convert the time column values to months.\n\n* Data of DURATION type cannot participate in calculations. For example, comparisons between DURATION values (such as `duration(`20ms) >= duration(`10ms)`) are not supported.\n\n#### Parameters\n\n**X** is a STRING scalar. It is composed of an integer and a unit of time (y, M, w, d, B, H, m, s, ms, us, ns). For examples: \"2y\", \"3M\", \"30m\", \"100ms\".\n\n**X** is a STRING scalar composed of an integer and a unit of time. It supports the following units of time: y, M, w, d, B, H, m, s, ms, us, ns, and trading calendar identifier consisting of four capital letters. For example, *X* can be \"2y\", \"3M\", \"30m\", \"100ms\", and \"3XNYS\". *X* supports all trading calendars defined by the calendar files stored in *marketHolidayDir*.\n\n#### Returns\n\nA DURATION scalar.\n\n#### Examples\n\n```\ny=duration(\"20H\")\ny\n// output: 20H\n\ntypestr(y)\n// output: DURATION\n\nduration\\(\"3XNYS\"\\)\n// output: 3XNYS\n```\n\nIn function bar, we can use a number followed by a time unit to indicate a duration.\n\n```\nt=table(take(2018.01.01T01:00:00+1..10,10) join take(2018.01.01T02:00:00+1..10,10) join take(2018.01.01T08:00:00+1..10,10) as time, rand(1.0, 30) as x)\nselect max(x) from t group by bar(time, 5);\n```\n\n| bar\\_time           | max\\_x |\n| ------------------- | ------ |\n| 2018.01.01T01:00:00 | 0.8824 |\n| 2018.01.01T01:00:05 | 0.8027 |\n| 2018.01.01T01:00:10 | 0.572  |\n| 2018.01.01T02:00:00 | 0.8875 |\n| 2018.01.01T02:00:05 | 0.8542 |\n| 2018.01.01T02:00:10 | 0.4287 |\n| 2018.01.01T08:00:00 | 0.9294 |\n| 2018.01.01T08:00:05 | 0.9804 |\n| 2018.01.01T08:00:10 | 0.2147 |\n\n```\nselect max(x) from t group by bar(time, 1m);\n```\n\n| bar\\_time           | max\\_x |\n| ------------------- | ------ |\n| 2018.01.01T01:00:00 | 0.8824 |\n| 2018.01.01T02:00:00 | 0.8875 |\n| 2018.01.01T08:00:00 | 0.9804 |\n\nRelated information: [Trading Calendar](https://docs.dolphindb.com/en/Tutorials/trading_calendar.html)\n"
    },
    "dynamicGroupCumcount": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dynamicGroupCumcount.html",
        "signatures": [
            {
                "full": "dynamicGroupCumcount(membership, prevMembership, groupCount)",
                "name": "dynamicGroupCumcount",
                "parameters": [
                    {
                        "full": "membership",
                        "name": "membership"
                    },
                    {
                        "full": "prevMembership",
                        "name": "prevMembership"
                    },
                    {
                        "full": "groupCount",
                        "name": "groupCount"
                    }
                ]
            }
        ],
        "markdown": "### [dynamicGroupCumcount](https://docs.dolphindb.com/en/Functions/d/dynamicGroupCumcount.html)\n\n\n\n#### Syntax\n\ndynamicGroupCumcount(membership, prevMembership, groupCount)\n\n#### Details\n\nThe attribute and category of an event are fixed in most cases. In some scenarios, the category of an event, however, will change dynamically. For example, when processing real-time tick data, users may judge whether an order (attribute) is a large or a small one (category) based on the cumulative volume to analyze capital flow. As real-time data continues to flow in, trading volume keeps increasing, and thus a small order may change to a large one.\n\nFunction `dynamicGroupCumcount` is used in such scenarios to count the number of dynamically cumulative events of different categories.\n\nDetails are as follows:\n\n* If *membership = prevMembership*, count remains unchanged.\n\n* If *membership ≠ prevMembership*, the count of corresponding group of *membership* increases by 1, and the count of corresponding group of *prevMembership* decreases by 1.\n\n* If *prevMembership* is a null value (the first record of each group), the count of corresponding group of *membership* increases by 1.\n\nIt returns a tuple of length *groupCount*. Each element is a vector of the same length as *membership*, which sequentially records the cumulative count of each tag.\n\n**Note**: The index of the tuple matches the tags, which means that the count of tag 0 is output to the vector at index 0 of the tuple.\n\n#### Parameters\n\n**membership** is a vector, of which elements must be integers in the interval \\[0, groupCount), indicating tags for the record at the current timestamp.\n\n**prevMembership** is a vector of INT type, of which elements can be null values (the first record of each group), indicating tags for the record at the previous timestamp of *membership*.\n\n**groupCount** is an integer in the interval \\[2, 8], indicating the number of tags.\n\n#### Returns\n\nA tuple of length *groupCount*.\n\n#### Examples\n\nData preprocessing:\n\n```\n// Define a function to generate tags\ndef tag_func(v){\n\n  return iif(v <= 5, 0, iif(v <= 10 and v > 5, 1, 2))\n# output\n}\n// original table\ntime = take(2022.01.01T09:00:00.000 + 1..3, 6)\nsym=`st0`st0`st0`st1`st1`st1\norderNo = `10001`10002`10001`10002`10003`10002\nvolume = 2 4 6 3 2 9\nt = table(sym, time, orderNo, volume)\n\n// calculate cumulative sums and tag the results\nt1 = select *, cumsum(volume) as sumVolume from t context by sym, orderNo\nt2 = lj(t, t1,`sym`time`orderNo)\nt3 = select sym, time, orderNo, volume, sumVolume, tag_func(sumVolume) as groupId from t2\n```\n\nFor historical data, you can use SQL statements to calculate the cumulative count for each group:\n\n```\nt4 = select sym, time, orderNo, prev(groupId) as prevGroupId from t3 context by sym,orderNo\nt5 = lj(t3, t4,`sym`time`orderNo)\nre = select sym, time, orderNo, dynamicGroupCumcount(groupId, prevGroupId, 3) as `groupId0`groupId1`groupId2 from t5 context by sym\nre\n```\n\n| sym | time                    | orderNo | groupId0 | groupId1 | groupId2 |\n| --- | ----------------------- | ------- | -------- | -------- | -------- |\n| st0 | 2022.01.01T09:00:00.001 | 10001   | 1        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.002 | 10002   | 2        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.003 | 10001   | 1        | 1        | 0        |\n| st1 | 2022.01.01T09:00:00.001 | 10002   | 1        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.002 | 10003   | 2        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.003 | 10002   | 1        | 0        | 1        |\n\nFor real-time data, you can use reactive state engine to calculate the cumulative count for each group:\n\n```\nresult = table(1000:0, `sym`time`orderNo`groupId0`groupId1`groupId2, [SYMBOL, TIME, SYMBOL,INT,INT,INT])\nfactor0 = [<time>,  <prev(groupId) as prevGroupId>, <groupId>, <volume>]\nfactor1 = [<time>, <orderNo>, <dynamicGroupCumcount(groupId, prevGroupId, 3)>]\ndm1 = table(1000:0, `sym`time`orderNo`volume`sumVolume`groupId, [SYMBOL, TIME, SYMBOL,INT, INT,INT])\ndm2 = table(1000:0, `sym`orderNo`time`prevGroupId`groupId`volume, [SYMBOL, SYMBOL, TIME, INT,INT,INT])\nres1 = createReactiveStateEngine(name=\"reactive_ccnt\", metrics =factor1, dummyTable=dm2, outputTable=result, keyColumn=`sym, keepOrder=true)\nres0 = createReactiveStateEngine(name=\"reactive_prev\", metrics =factor0, dummyTable=dm1, outputTable=res1, keyColumn=`sym`orderNo, keepOrder=true)\nres0.append!(t3)\n\nselect * from result\n```\n\n| sym | time                    | orderNo | groupId0 | groupId1 | groupId2 |\n| --- | ----------------------- | ------- | -------- | -------- | -------- |\n| st0 | 2022.01.01T09:00:00.001 | 10001   | 1        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.002 | 10002   | 2        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.003 | 10001   | 1        | 1        | 0        |\n| st1 | 2022.01.01T09:00:00.001 | 10002   | 1        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.002 | 10003   | 2        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.003 | 10002   | 1        | 0        | 1        |\n\n```\ndropStreamEngine(\"reactive_ccnt\")\ndropStreamEngine(\"reactive_prev\")\n```\n\nRelated function: [dynamicGroupCumsum](https://docs.dolphindb.com/en/Functions/d/dynamicGroupCumsum.html)\n"
    },
    "dynamicGroupCumsum": {
        "url": "https://docs.dolphindb.com/en/Functions/d/dynamicGroupCumsum.html",
        "signatures": [
            {
                "full": "dynamicGroupCumsum(cumValue, prevCumValue, membership, prevMembership, groupCount)",
                "name": "dynamicGroupCumsum",
                "parameters": [
                    {
                        "full": "cumValue",
                        "name": "cumValue"
                    },
                    {
                        "full": "prevCumValue",
                        "name": "prevCumValue"
                    },
                    {
                        "full": "membership",
                        "name": "membership"
                    },
                    {
                        "full": "prevMembership",
                        "name": "prevMembership"
                    },
                    {
                        "full": "groupCount",
                        "name": "groupCount"
                    }
                ]
            }
        ],
        "markdown": "### [dynamicGroupCumsum](https://docs.dolphindb.com/en/Functions/d/dynamicGroupCumsum.html)\n\n\n\n#### Syntax\n\ndynamicGroupCumsum(cumValue, prevCumValue, membership, prevMembership, groupCount)\n\n#### Details\n\nThe attribute and category of an event are fixed in most cases. In some scenarios, the category of an event, however, will change dynamically. For example, when processing real-time tick data, users may judge whether an order (attribute) is a large or a small one (category) based on the cumulative volume to analyze capital flow. As real-time data continues to flow in, trading volume keeps increasing, and thus a small order may change to a large one.\n\nFunction `dynamicGroupCumsum` is used in such scenarios to obtain the cumulative sum of an indicator for events of different categories.\n\nDetails are as follows:\n\n* If *membership = prevMembership*, count remains unchanged.\n\n* If *membership ≠ prevMembership*, the count of corresponding group of *membership* increases by *cumValue*, and the count of corresponding group of *prevMembership* decreases by *preCumValue*.\n\n* If *prevMembership* is a null value (the first record of each group), the count of corresponding group of *membership* increases by *cumValue*.\n\nIt returns a tuple of length *groupCount*. Each element is a vector of the same length as *membership*, which sequentially records the cumulative sum of an indicator (*cumValue*) for each tag.\n\n**Note**: The index of the tuple matches the tags, which means that the count of tag 0 is output at index 0 of the tuple.\n\n#### Parameters\n\n**cumValue** is a numeric vector that records the cumulative value of the event at the current timestamp.\n\n**prevCumValue** is a numeric vector, of which elements can be null values (the first record of each group), indicating the cumulative value of the event at the previous timestamp of *cumValue*.\n\n**membership** is a vector of INT type, of which elements must be integers in the interval \\[0, groupCount), indicating tags for records at the current timestamp.\n\n**prevMembership** is a vector of INT type, of which elements can be null value (the first record of each group), indicating tags for records at the previous timestamp of *membership*.\n\n**groupCount** is an integer in the interval \\[2, 8], indicating the number of tags.\n\n#### Returns\n\nA tuple of length *groupCount*.\n\n#### Examples\n\nData preparation:\n\n```\n// Define a function to generate tags\ndef tag_func(v){\n\n  return iif(v <= 5, 0, iif(v <= 10 and v > 5, 1, 2))\n# output\n}\n// original table\ntime = take(2022.01.01T09:00:00.000 + 1..3, 6)\nsym=`st0`st0`st0`st1`st1`st1\norderNo = `10001`10002`10001`10002`10003`10002\nvolume = 2 4 6 3 2 9\nt = table(sym, time, orderNo, volume)\n\n// calculate cumulative sums and tag the results\nt1 = select *, cumsum(volume) as sumVolume from t context by sym, orderNo\nt2 = lj(t, t1,`sym`time`orderNo)\nt3 = select sym, time, orderNo, volume, sumVolume, tag_func(sumVolume) as groupId from t2\n```\n\nFor historical data, you can use SQL statement to calculate the cumulative volume for each group:\n\n```\nt4 = select sym, time, orderNo, prev(groupId) as prevGroupId, groupId, prev(sumVolume) as prevSumVolume, sumVolume from t3 context by sym,orderNo\nt5 = lj(t3, t4,`sym`time`orderNo)\nre = select sym, time, orderNo, dynamicGroupCumsum(sumVolume, prevSumVolume, groupId, prevGroupId, 3) as `groupId0`groupId1`groupId2 from t5 context by sym\nre\n```\n\n| sym | time                    | orderNo | groupId0 | groupId1 | groupId2 |\n| --- | ----------------------- | ------- | -------- | -------- | -------- |\n| st0 | 2022.01.01T09:00:00.001 | 10001   | 2        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.002 | 10002   | 6        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.003 | 10001   | 4        | 8        | 0        |\n| st1 | 2022.01.01T09:00:00.001 | 10002   | 3        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.002 | 10003   | 5        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.003 | 10002   | 2        | 0        | 12       |\n\nFor real-time data, you can use reactive state engine to calculate the cumulative volume for each group:\n\n```\nresult = table(1000:0, `sym`time`orderNo`groupId0`groupId1`groupId2, [SYMBOL, TIME, SYMBOL,INT,INT,INT])\nfactor0 = [ <time>, <prev(groupId) as prevGroupId>, <groupId>, <prev(sumVolume) as prevSumVolume>, <sumVolume>]\nfactor1 = [<time>, <orderNo>, <dynamicGroupCumsum(sumVolume, prevSumVolume, groupId, prevGroupId, 3)>]\ndm1 = table(1000:0, `sym`time`orderNo`volume`sumVolume`groupId, [SYMBOL, TIME, SYMBOL,INT, INT,INT])\ndm2 = table(1000:0, `sym`orderNo`time`prevGroupId`groupId`prevSumVolume`sumVolume, [SYMBOL, SYMBOL, TIME, INT, INT, INT, INT])\nres1 = createReactiveStateEngine(name=\"reactive_csum\", metrics =factor1, dummyTable=dm2, outputTable=result, keyColumn=`sym, keepOrder=true)\nres0 = createReactiveStateEngine(name=\"reactive_prev\", metrics =factor0, dummyTable=dm1, outputTable=res1, keyColumn=`sym`orderNo, keepOrder=true)\nres0.append!(t3)\n\nselect * from result\n```\n\n| sym | time                    | orderNo | groupId0 | groupId1 | groupId2 |\n| --- | ----------------------- | ------- | -------- | -------- | -------- |\n| st0 | 2022.01.01T09:00:00.001 | 10001   | 2        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.002 | 10002   | 6        | 0        | 0        |\n| st0 | 2022.01.01T09:00:00.003 | 10001   | 4        | 8        | 0        |\n| st1 | 2022.01.01T09:00:00.001 | 10002   | 3        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.002 | 10003   | 5        | 0        | 0        |\n| st1 | 2022.01.01T09:00:00.003 | 10002   | 2        | 0        | 12       |\n\n```\ndropStreamEngine(\"reactive_csum\")\ndropStreamEngine(\"reactive_prev\")\n```\n\nRelated function: [dynamicGroupCumcount](https://docs.dolphindb.com/en/Functions/d/dynamicGroupCumcount.html)\n"
    },
    "eig": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eig.html",
        "signatures": [
            {
                "full": "eig(A)",
                "name": "eig",
                "parameters": [
                    {
                        "full": "A",
                        "name": "A"
                    }
                ]
            }
        ],
        "markdown": "### [eig](https://docs.dolphindb.com/en/Functions/e/eig.html)\n\n\n\n#### Syntax\n\neig(A)\n\n#### Details\n\nCalculates the eigenvalues and eigenvectors of *A*.\n\n**Note:**\n\n* DolphinDB `eig` provides the same functionality as [numpy.linalg.eigh](https://numpy.org/doc/stable/reference/generated/numpy.linalg.eigh.html).\n* [numpy.linalg.eig](https://numpy.org/doc/stable/reference/generated/numpy.linalg.eig.html) and [scipy.linalg.eig](https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eig.html) are general-purpose eigendecomposition functions. They have a broader scope and are not designed specifically for real symmetric or Hermitian matrices.\n\n#### Parameters\n\n**A** is a real symmetric matrix or a Hermitian matrix.\n\n#### Returns\n\nA dictionary contaning the eigenvalues and eigenvectors of *A*.\n\n#### Examples\n\n```\nA = 1 1 2 7 9 3 5 7 0 $ 3:3;\neig(A);\n/* output\nvectors->\n#0        #1       #2\n--------- -------- ---------\n0.839752  0.169451 -0.515852\n-0.301349 0.935753 -0.18318\n0.45167   0.309277 0.836864\n\nvalues->[1.716868,10.17262,-1.889488]\n*/\n```\n\nFor the eigenvalue of 1.716868, the corresponding eigenvector is:\n\n```\neig(A).vectors[0];\n// output: [0.839752,-0.301349,0.45167]\n```\n\nUse `numpy.linalg.eigh` to calculate the eigenvalues and eigenvectors of the same matrix. The returned eigenvalues may appear in a different order, and the signs of the eigenvectors may be reversed, but the results are mathematically equivalent.\n\n```\nimport numpy as np\n\nA = np.array([[1., 7., 5.],\n              [1., 9., 7.],\n              [2., 3., 0.]])\n\nw, v = np.linalg.eigh(A)\n\nprint(\"values:\")\nprint(w)\n\nprint(\"vectors:\")\nprint(v)\n\n\n\"\"\" Output:\nvalues:\n[-1.88948817  1.71686814 10.17262003]\nvectors:\n[[-0.51585193  0.83975187 -0.16945081]\n [-0.18318039 -0.30134864 -0.93575314]\n [ 0.83686422  0.45167    -0.30927736]]\n\"\"\"\n```\n"
    },
    "elasticNet": {
        "url": "https://docs.dolphindb.com/en/Functions/e/elasticNet.html",
        "signatures": [
            {
                "full": "elasticNet(ds, yColName, xColNames, [alpha=1.0], [l1Ratio=0.5], [intercept=true], [normalize=false], [maxIter=1000], [tolerance=0.0001], [positive=false], [swColName], [checkInput=true])",
                "name": "elasticNet",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[alpha=1.0]",
                        "name": "alpha",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[l1Ratio=0.5]",
                        "name": "l1Ratio",
                        "optional": true,
                        "default": "0.5"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[normalize=false]",
                        "name": "normalize",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[maxIter=1000]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[tolerance=0.0001]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "0.0001"
                    },
                    {
                        "full": "[positive=false]",
                        "name": "positive",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    },
                    {
                        "full": "[checkInput=true]",
                        "name": "checkInput",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [elasticNet](https://docs.dolphindb.com/en/Functions/e/elasticNet.html)\n\n\n\n#### Syntax\n\nelasticNet(ds, yColName, xColNames, \\[alpha=1.0], \\[l1Ratio=0.5], \\[intercept=true], \\[normalize=false], \\[maxIter=1000], \\[tolerance=0.0001], \\[positive=false], \\[swColName], \\[checkInput=true])\n\n#### Details\n\nImplement linear regression with elastic net penalty (combined L1 and L2 priors as regularizer).\n\nMinimize the following objective function:\n\n![](https://docs.dolphindb.com/en/images/elasticnet.png)\n\n#### Parameters\n\n**ds** is an in-memory table or a data source usually generated by the [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html) function.\n\n**yColName** is a string indicating the column name of the dependent variable in *ds*.\n\n**xColNames** is a STRING scalar/vector indicating the column names of the independent variables in *ds*.\n\n**alpha** (optional) is a floating-point number representing the constant that multiplies the L1-norm. The default value is 1.0.\n\n**l1Ratio** (optional) is a floating-point number between 0 and 1 indicating the mixing parameter. For *l1Ratio* = 0 the penalty is an L2 penalty; for *l1Ratio* = 1 it is an L1 penalty; for 0 < *l1Ratio* < 1, the penalty is a combination of L1 and L2. The default value is 0.5.\n\n**intercept** (optional) is a Boolean value indicating whether to include the intercept in the regression. The default value is true.\n\n**normalize** (optional) is a Boolean value. If true, the regressors will be normalized before regression by subtracting the mean and dividing by the L2-norm. If *intercept*=false, this parameter will be ignored. The default value is false.\n\n**maxIter** (optional) is a positive integer indicating the maximum number of iterations. The default value is 1000.\n\n**tolerance** (optional) is a floating-point number. The iterations stop when the improvement in the objective function value is smaller than tolerance. The default value is 0.0001.\n\n**positive** (optional) is a Boolean value indicating whether to force the coefficient estimates to be positive. The default value is false.\n\n**swColName** (optional) is a string indicating a column name of *ds*. The specified column is used as the sample weight. If it is not specified, the sample weight is treated as 1.\n\n**checkInput** (optional) is a Boolean value. It determines whether to enable validation check for parameters *yColName*, *xColNames*, and *swColName*.\n\n* If *checkInput* = true (default), it will check the invalid value for parameters and throw an error if the null value exists.\n\n* If *checkInput* = false, the invalid value is not checked.\n\nIt is recommended to specify *checkInput* = true. If it is false, it must be ensured that there are no invalid values in the input parameters and no invalid values will be generated during intermediate calculations, otherwise the returned model may be inaccurate.\n\n#### Returns\n\nReturn a dictionary containing the following keys:\n\n* modelName: The model name. The corresponding model name for the ElasticNet method is \"elasticNet\".\n* coefficients: The regression coefficients of the model.\n* intercept: The intercept.\n* dual\\_gap: The dual gap at the end of optimization.\n* tolerance: The boundary difference value at which the iteration stops.\n* iterations: The number of iterations.\n* xColNames: The column names of the independent variables in the data source.\n* predict: The function used for making predictions.\n\n#### Examples\n\n```\ny = [225.720746,-76.195841,63.089878,139.44561,-65.548346,2.037451,22.403987,-0.678415,37.884102,37.308288]\nx0 = [2.240893,-0.854096,0.400157,1.454274,-0.977278,-0.205158,0.121675,-0.151357,0.333674,0.410599]\nx1 = [0.978738,0.313068,1.764052,0.144044,1.867558,1.494079,0.761038,0.950088,0.443863,-0.103219]\nt = table(y, x0, x1)\nelasticNet(t, `y, `x0`x1);\n```\n\nIf t is a DFS table, then the input should be a data source:\n\n```\nelasticNet(sqlDS(<select * from t>), `y, `x0`x1);\n```\n"
    },
    "elasticNetBasic": {
        "url": "https://docs.dolphindb.com/en/Functions/e/elasticnetbasic.html",
        "signatures": [
            {
                "full": "elasticNetBasic(Y, X, [mode], [alpha], [l1Ratio], [intercept], [normalize], [maxIter], [tolerance], [positive], [swColName], [checkInput])",
                "name": "elasticNetBasic",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[mode]",
                        "name": "mode",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    },
                    {
                        "full": "[l1Ratio]",
                        "name": "l1Ratio",
                        "optional": true
                    },
                    {
                        "full": "[intercept]",
                        "name": "intercept",
                        "optional": true
                    },
                    {
                        "full": "[normalize]",
                        "name": "normalize",
                        "optional": true
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[tolerance]",
                        "name": "tolerance",
                        "optional": true
                    },
                    {
                        "full": "[positive]",
                        "name": "positive",
                        "optional": true
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    },
                    {
                        "full": "[checkInput]",
                        "name": "checkInput",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [elasticNetBasic](https://docs.dolphindb.com/en/Functions/e/elasticnetbasic.html)\n\n\n\n#### Syntax\n\nelasticNetBasic(Y, X, \\[mode], \\[alpha], \\[l1Ratio], \\[intercept], \\[normalize], \\[maxIter], \\[tolerance], \\[positive], \\[swColName], \\[checkInput])\n\n#### Details\n\nPerform elastic net regression.\n\nMinimize the following objective function:\n\n![](https://docs.dolphindb.com/en/images/elasticNetBasic.png)\n\n#### Parameters\n\n**Y** is a numeric vector indicating the dependent variable.\n\n**X** is a numeric vector/tuple/matrix/table indicating the independent variable.\n\n* When *X* is a vector/tuple, it must be of the same length as *Y*.\n\n* When *X* is a matrix/table, the number of rows must be the same as the length of *Y*.\n\n**mode**is an integer indicating the contents in the output. It can be:\n\n* 0 (default): a vector of the coefficient estimates.\n\n* 1: a table with coefficient estimates, standard error, t-statistics, and p-values.\n\n* 2: a dictionary with the following keys: ANOVA, RegressionStat, Coefficient, and Residual.\n\n<table id=\"table_n2f_fcz_21c\"><thead><tr><th align=\"left\">\n\nSource of Variance\n\n</th><th align=\"left\">\n\nDF (degree of freedom)\n\n</th><th align=\"left\">\n\nSS (sum of square)\n\n</th><th align=\"left\">\n\nMS (mean of square)\n\n</th><th align=\"left\">\n\nF (F-score)\n\n</th><th align=\"left\">\n\nSignificance\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nRegression\n\n</td><td align=\"left\">\n\np\n\n</td><td align=\"left\">\n\nsum of squares regression, SSR\n\n</td><td align=\"left\">\n\nregression mean square, MSR=SSR/R\n\n</td><td align=\"left\">\n\nMSR/MSE\n\n</td><td align=\"left\">\n\np-value\n\n</td></tr><tr><td align=\"left\">\n\nResidual\n\n</td><td align=\"left\">\n\nn-p-1\n\n</td><td align=\"left\">\n\nsum of squares error, SSE\n\n</td><td align=\"left\">\n\nmean square error, MSE=MSE/E\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr><tr><td align=\"left\">\n\nTotal\n\n</td><td align=\"left\">\n\nn-1\n\n</td><td align=\"left\">\n\nsum of squares total, SST\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr></tbody>\n</table><table id=\"table_u2f_fcz_21c\"><thead><tr><th align=\"left\">\n\nItem\n\n</th><th align=\"left\">\n\nDescription\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nR2\n\n</td><td align=\"left\">\n\nR-squared\n\n</td></tr><tr><td align=\"left\">\n\nAdjustedR2\n\n</td><td align=\"left\">\n\nThe adjusted R-squared corrected based on the degrees of freedom by comparing the sample size to the number of terms in the regression model.\n\n</td></tr><tr><td align=\"left\">\n\nStdError\n\n</td><td align=\"left\">\n\nThe residual standard error/deviation corrected based on the degrees of freedom.\n\n</td></tr><tr><td align=\"left\">\n\nObservations\n\n</td><td align=\"left\">\n\nThe sample size.\n\n</td></tr></tbody>\n</table><table id=\"table_x2f_fcz_21c\"><thead><tr><th align=\"left\">\n\nItem\n\n</th><th align=\"left\">\n\nDescription\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nfactor\n\n</td><td align=\"left\">\n\nIndependent variables\n\n</td></tr><tr><td align=\"left\">\n\nbeta\n\n</td><td align=\"left\">\n\nEstimated regression coefficients\n\n</td></tr><tr><td align=\"left\">\n\nStdError\n\n</td><td align=\"left\">\n\nStandard error of the regression coefficients\n\n</td></tr><tr><td align=\"left\">\n\ntstat\n\n</td><td align=\"left\">\n\nt statistic, indicating the significance of the regression coefficients\n\n</td></tr></tbody>\n</table>Residual: the difference between each predicted value and the actual value.\n\n**alpha**(optional) is a floating number representing the constant that multiplies the L1-norm. The default value is 1.0.\n\n**intercept** (optional) is a Boolean value indicating whether to include the intercept in the regression. The default value is true.\n\n**normalize** (optional) is a Boolean value. If true, the regressors will be normalized before regression by subtracting the mean and dividing by the L2-norm. If *intercept*=false, this parameter will be ignored. The default value is false.\n\n**maxIter** (optional) is a positive integer indicating the maximum number of iterations. The default value is 1000.\n\n**tolerance** (optional) is a floating number. The iterations stop when the improvement in the objective function value is smaller than tolerance. The default value is 0.0001.\n\n**solver** (optional) is a string indicating the solver to use in the computation. It can be either 'svd' or 'cholesky'. It ds is a list of data sources, solver must be 'cholesky'.\n\n**swColName** (optional) is a STRING indicating a column name of *ds*. The specified column is used as the sample weight. If it is not specified, the sample weight is treated as 1.\n\n#### Returns\n\nDepends on the *[mode](https://docs.dolphindb.com/en/Functions/e/elasticnetbasic.html#ul_m2f_fcz_21c)* parameter.\n"
    },
    "elasticNetCV": {
        "url": "https://docs.dolphindb.com/en/Functions/e/elasticnetcv.html",
        "signatures": [
            {
                "full": "elasticNetCV(ds, yColName, xColNames, [alphas], [l1Ratio], [intercept], [normalize], [maxIter], [tolerance], [positive], [swColName], [checkInput])",
                "name": "elasticNetCV",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[alphas]",
                        "name": "alphas",
                        "optional": true
                    },
                    {
                        "full": "[l1Ratio]",
                        "name": "l1Ratio",
                        "optional": true
                    },
                    {
                        "full": "[intercept]",
                        "name": "intercept",
                        "optional": true
                    },
                    {
                        "full": "[normalize]",
                        "name": "normalize",
                        "optional": true
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[tolerance]",
                        "name": "tolerance",
                        "optional": true
                    },
                    {
                        "full": "[positive]",
                        "name": "positive",
                        "optional": true
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    },
                    {
                        "full": "[checkInput]",
                        "name": "checkInput",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [elasticNetCV](https://docs.dolphindb.com/en/Functions/e/elasticnetcv.html)\n\n\n\n#### Syntax\n\nelasticNetCV(ds, yColName, xColNames, \\[alphas], \\[l1Ratio], \\[intercept], \\[normalize], \\[maxIter], \\[tolerance], \\[positive], \\[swColName], \\[checkInput])\n\n#### Details\n\nImplement linear regression with elastic net penalty using 5-fold cross-validation and return a model corresponding to the optimal parameters.\n\n#### Parameters\n\nThe `elsticNetCV` function inherits all parameters of function [elasticNet](https://docs.dolphindb.com/en/Functions/e/elasticNet.html), with one added parameter, *alphas*.\n\n**alphas**(optional) is a floating-point scalar or vector that represents the coefficient multiplied by the L1 norm penalty term. The default value is \\[0.01, 0.1, 1.0].\n\n#### Returns\n\nA dictionary containing the following keys：\n\n* modelName: the model name, which is \"elasticNetCV\" for this method\n\n* coefficients: the regression coefficients\n\n* intercept: the intercept\n\n* dual\\_gap: the dual gap\n\n* tolerance: the tolerance for the optimization\n\n* iterations: the number of iterations\n\n* xColNames: the column names of the independent variables in the data source\n\n* predict: the function used for prediction\n\n* alpha: the penalty term for cross-validation\n\n#### Examples\n\n```\ny = [225.720746,-76.195841,63.089878,139.44561,-65.548346,2.037451,22.403987,-0.678415,37.884102,37.308288]\nx0 = [2.240893,-0.854096,0.400157,1.454274,-0.977278,-0.205158,0.121675,-0.151357,0.333674,0.410599]\nx1 = [0.978738,0.313068,1.764052,0.144044,1.867558,1.494079,0.761038,0.950088,0.443863,-0.103219]\nt = table(y, x0, x1);\n\nelasticNetCV(t, `y, `x0`x1);\n\n/* output\nmodelName->elasticNetCV\ncoefficients->[93.8331,13.9105]\nintercept->0.5416\ndual_gap->0.0037\ntolerance->0.0001\niterations->5\nxColNames->[\"x0\",\"x1\"]\npredict->coordinateDescentPredict\nalpha->0.01\n*/\n```\n"
    },
    "ema": {
        "url": "https://docs.dolphindb.com/en/Functions/e/ema.html",
        "signatures": [
            {
                "full": "ema(X, window, warmup=false)",
                "name": "ema",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "warmup=false",
                        "name": "warmup=false"
                    }
                ]
            }
        ],
        "markdown": "### [ema](https://docs.dolphindb.com/en/Functions/e/ema.html)\n\n\n\n#### Syntax\n\nema(X, window, warmup=false)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Exponential Moving Average (ema) for *X* in a count-based sliding window of the given length.\n\nThe calculation formula is as follows. Here *EMAk* is the k-th exponential moving average, *n* is the length of sliding window, *Xk* is the k-th element of the vector *X*.\n\n* warmup=false:\n\n  * For the first n-1 elements: no calculation is performed, and null values are returned.\n  * For the n-th element (the first EMA value):\n  * For k≥n+1:\n    ![](https://docs.dolphindb.com/en/images/ema_k.png)\n\n* warmup=true:\n\n  ![](https://docs.dolphindb.com/en/images/ema_ktrue.png)\n\n  where the vector X is defined as: X=\\[Xk-n, …, Xk-1]\n\n#### Parameters\n\n**warmup** is a Boolean value. The default value is false, indicating that the first (window-1) elements windows return NULL. If set to true, elements in the first (window-1) windows are calculated based on the formula given in the details.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\nema(x,3);\n// output: [,,12.3,12.55,12.225,11.9125,11.55625]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\nema(x,3);\n```\n\n| #0       | #1        |\n| -------- | --------- |\n|          |           |\n|          |           |\n| 12.30    | 15.666667 |\n| 12.55    | 17.333333 |\n| 12.225   | 19.166667 |\n| 11.9125  | 15.583333 |\n| 11.55625 | 12.791667 |\n\nRelated functions: [gema](https://docs.dolphindb.com/en/Functions/g/gema.html), [wilder](https://docs.dolphindb.com/en/Functions/w/wilder.html), [dema](https://docs.dolphindb.com/en/Functions/d/dema.html), [tema](https://docs.dolphindb.com/en/Functions/t/tema.html)\n"
    },
    "emitEvent": {
        "url": "https://docs.dolphindb.com/en/Functions/e/emit_event.html",
        "signatures": [
            {
                "full": "emitEvent(event, [eventTimeField], [outputName])",
                "name": "emitEvent",
                "parameters": [
                    {
                        "full": "event",
                        "name": "event"
                    },
                    {
                        "full": "[eventTimeField]",
                        "name": "eventTimeField",
                        "optional": true
                    },
                    {
                        "full": "[outputName]",
                        "name": "outputName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [emitEvent](https://docs.dolphindb.com/en/Functions/e/emit_event.html)\n\n\n\n#### Syntax\n\nemitEvent(event, \\[eventTimeField], \\[outputName])\n\n#### Details\n\nAn event sent by `emitEvent` asychronously goes to the end of the output queue. When multiple event stream serializers are specified in the CEP engine, `emitEvent` must specify the target serializer via the *outputName* parameter, which indicates the name of the StreamEventSerializer. The CEP engine matches the serializer accordingly and outputs the event to the corresponding one or more stream tables.\n\n#### Parameters\n\n**event** is an event instance.\n\n**eventTimeField** is a STRING scalar indicating the time field of the event. To specify this parameter, *event* must contain a time field. If *useSystem* is set to true when creating the engine, the output events will be timestamped with the system time. If false, it will be output with the latest event time.\n\n**outputName**(optional) is a STRING scalar specifying the name of the `StreamEventSerializer`.\n\n* If only one output table is specified in the CEP engine, this parameter is not required.\n* If multiple output tables are specified, *outputName* must be specified so that the engine can route the event to the corresponding serializer.\n\n#### Returns\n\nNone\n\n#### Examples\n\nThis example demonstrates how to specify different event stream serializers via the *outputName* parameter. The CEP engine matches the specified serializer and outputs events to the corresponding streamtables.\n\n```\nclass MarketData{\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def MarketData(m,c,p,q){\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n\nclass Orders{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def Orders(t, m,c,p,q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n\nclass Trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def Trades(t, m,c,p,q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as MarketDataChannel\nserializer1 = streamEventSerializer(name=`MarketDataChannel, eventSchema=[MarketData], outputTable=MarketDataChannel)\n\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as OrdersChannel\nserializer2 = streamEventSerializer(name=`OrdersChannel, eventSchema=[Orders], outputTable=OrdersChannel)\n\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as TradesChannel\nserializer3 = streamEventSerializer(name=`TradesChannel, eventSchema=[Trades], outputTable=TradesChannel)\n\nclass SimpleShareSearch:CEPMonitor {\n\t// Constructor\n\tdef SimpleShareSearch(){\n\t}\n    // Specify the name of the event stream serializer to which the event should be sent via emitEvent\n\tdef processMarketData(event){\n        emitEvent(event,,\"MarketDataChannel\")\n    }\n    def processOrders(event){\n        emitEvent(event,,\"OrdersChannel\")\n    }\n    def processTrades(event){\n        emitEvent(event,,\"TradesChannel\")\n    }\n\t// After the CEP sub-engine is created, the system automatically constructs a SimpleShareSearch object as a Monitor instance and invokes the onload function\n\tdef onload() {\n\n\t\taddEventListener(handler=processMarketData, eventType=\"MarketData\", times=\"all\")\n\t\taddEventListener(handler=processOrders, eventType=\"Orders\", times=\"all\")\n\t\taddEventListener(handler=processTrades, eventType=\"Trades\", times=\"all\")\n\t}\n}\n\ndummy = table(array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\n\n// Create a CEP engine and specify three event stream serializers\nengine = createCEPEngine(name='cep1', monitors=<SimpleShareSearch()>, dummyTable=dummy, eventSchema=[MarketData,Orders,Trades], outputTable=[serializer1,serializer2,serializer3])\n\nm= MarketData(\"m\", \"c\", 10.0, 100)\n\nappendEvent(engine, m)\n\no = Orders(\"a\",\"m\", \"c\", 10.0, 100)\nt = Trades(\"a\",\"m\", \"c\", 10.0, 100)\n\nappendEvent(engine, o)\nappendEvent(engine, t)\n```\n"
    },
    "enableActivePartition": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableActivePartition.html",
        "signatures": [
            {
                "full": "enableActivePartition(db, activeDate, siteAlias)",
                "name": "enableActivePartition",
                "parameters": [
                    {
                        "full": "db",
                        "name": "db"
                    },
                    {
                        "full": "activeDate",
                        "name": "activeDate"
                    },
                    {
                        "full": "siteAlias",
                        "name": "siteAlias"
                    }
                ]
            }
        ],
        "markdown": "### [enableActivePartition](https://docs.dolphindb.com/en/Functions/e/enableActivePartition.html)\n\n\n\n#### Syntax\n\nenableActivePartition(db, activeDate, siteAlias)\n\n#### Details\n\nEstablish a connection between the active database and the historical database.\n\n#### Parameters\n\n**db** is the handle of the historical database.\n\n**activeDate** is the date of the active database.\n\n**setAlias** is the node alias for the active database.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nhistdb = database(\"C:\\DolphinDBDemo\\example\\data\\dbspace\\historical-A\\Trades2ndDomain\")\nactiveNodeAlias = getNodeAlias()\nactiveDate = today()\nenableActivePartition(histdb, activeDate, activeNodeAlias);\n```\n"
    },
    "enableDynamicScriptOptimization": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enabledynamicscriptoptimization.html",
        "signatures": [
            {
                "full": "enableDynamicScriptOptimization()",
                "name": "enableDynamicScriptOptimization",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [enableDynamicScriptOptimization](https://docs.dolphindb.com/en/Functions/e/enabledynamicscriptoptimization.html)\n\n\n\n#### Syntax\n\nenableDynamicScriptOptimization()\n\n#### Details\n\nEnable script engine optimization.\n\nThis command must be executed by an administrator on the controller node.\n\nThe effect of this command will be lost after the system restarts. To make it permanent, please modify the configuration parameter *enableDynamicScriptOptimization* in the configuration file (controller.cfg for cluster mode, dolphindb.cfg for single-node mode).\n\n#### Examples\n\n```\nenableDynamicScriptOptimization()\n```\n\n**Related Functions:** [disableDynamicScriptOptimization](https://docs.dolphindb.com/en/Functions/d/disabledynamicscriptoptimization.html)\n"
    },
    "enableQueryMonitor": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableQueryMonitor.html",
        "signatures": [
            {
                "full": "enableQueryMonitor()",
                "name": "enableQueryMonitor",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [enableQueryMonitor](https://docs.dolphindb.com/en/Functions/e/enableQueryMonitor.html)\n\n\n\n#### Syntax\n\nenableQueryMonitor()\n\n#### Details\n\nEnable the monitor on query status. The monitor is enabled by default.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n\nRelated function: [disableQueryMonitor](https://docs.dolphindb.com/en/Functions/d/disableQueryMonitor.html)\n"
    },
    "enableResourceTracking": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableresourcetracking.html",
        "signatures": [
            {
                "full": "enableResourceTracking()",
                "name": "enableResourceTracking",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [enableResourceTracking](https://docs.dolphindb.com/en/Functions/e/enableresourcetracking.html)\n\n\n\n#### Syntax\n\nenableResourceTracking()\n\n#### Details\n\nUse this function to enable resource tracking at runtime. This function can only be called by the administrator on a data node, and it only takes effect when *resourceSamplingInterval*is set to a positive integer.\n\nOnce resource tracking is enabled, the data nodes will track queries at intervals defined by *resourceSamplingInterval*.\n\n*\\<HomeDir>/resource/hardware.log*records the hardware resource usage in CSV format, including the following information:\n\n* timestamp: the sampling timestamp of NANOTIMESTAMP type.\n\n* userId: the login user ID.\n\n* cpu: the number of CPU threads used by the user.\n\n* memory: the memory used (in bytes) by the user.\n\n* send: the amount of data (in bytes) sent during a sampling interval.\n\n* recv: the amount of data (in bytes) received during a sampling interval. Note that there may be some discrepancy in the measured data volume, with a potential deviation of up to 2KB.\n\n*\\<HomeDir>/resource/access.log* records DFS SQL queries in CSV format, including the following information:\n\n* timestamp: the sampling timestamp of NANOTIMESTAMP type. If type is \"sql\", it indicates the start time of the query execution; If type is \"rowCount\" or \"memUsage\", it indicates the time when data is read.\n\n* rootQueryId: the root ID of a DFS query and all its sub-queries split by partition.\n\n* userId: the login user ID.\n\n* database: the queried database.\n\n* table: the queried table.\n\n* type: the message type, which can be sql, rowCount or memUsage.\n\n* value: the message value corresponding to each type.\n\n  * sql: the execution count (always 1).\n\n  * rowCount: the number of rows read.\n\n  * memUsage: the data volume read (in bytes).\n\nNote that the values for *rowCount*and *memUsage*are recorded based on each access. For example, after a dimension table is loaded into memory, the number of rows read and data volume read are logged each time the table is accessed, rather than the amount of data initially loaded into memory.\n\n* script: the SQL query script when type is sql, otherwise an empty string is logged.\n\nNote that for DFS SQL queries, currently only the SELECT statement is supported, and tables in nested table joins that are not compatible with ANSI SQL-92 are not tracked. For example, tables t1 and t2 in the query `ej(ej(t1, t2, `id), t3, `id)` are not sampled.\n\nTo prevent excessive growth of the query logs, log rotation is applied once the log files reach the size threshold. The generated file names contain timestamp prefixes. Logs are automatically removed after the retention period configured with *resourceSamplingLogRetentionTime*regardless of whether tracking is enabled.\n\nRelated function: [disableResourceTracking](https://docs.dolphindb.com/en/Functions/d/disableresourcetracking.html)\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n"
    },
    "enableTableCachePurge": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableTableCachePurge.html",
        "signatures": [
            {
                "full": "enableTableCachePurge(table, [cacheSize],[cachePurgeTimeColumn],[cachePurgeInterval],[cacheRetentionTime])",
                "name": "enableTableCachePurge",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [enableTableCachePurge](https://docs.dolphindb.com/en/Functions/e/enableTableCachePurge.html)\n\n#### Syntax\n\nenableTableCachePurge(table, \\[cacheSize],\\[cachePurgeTimeColumn],\\[cachePurgeInterval],\\[cacheRetentionTime])\n\n#### Details\n\nEnable cache purge for a non-persisted stream table.\n\nCache purge can be configured using either of the following methods:\n\n* **Cache purge by size**: Set *cacheSize*to specify a threshold for the number of records retained. Older records exceeding the threshold will be removed. The threshold is determined as follows:\n  * If the number of records appended in one batchdoes not exceed *cacheSize*, the threshold is 2.5 \\* *cacheSize*.\n  * If the number of records appended in one batch exceeds *cacheSize*, the threshold is 1.2 \\* (appended records + *cacheSize*).\n* **Cache purge by time**: Set *cachePurgeTimeColumn*, *cachePurgeInterval* and *cacheRetentionTime.* The system will clean up data based on the *cachePurgeTimeColumn*. Each time when a new record arrives, the system obtains the time difference between the new record and the oldest record kept in memory. If the time difference exceeds *cachePurgeInterval*, the system will retain only the data with timestamps within *cacheRetentionTime*of the new data.\n\n**Note**: If a record has not been enqueued for publishing, it will not be removed.\n\n#### Parameters\n\n**table** is an empty stream table.\n\n**tableName** is a string indicating the name of the shared table.\n\n**cacheSize** (optional) is a positive integer used to determine the maximum number of records to retain in memory.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the non-persisted stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nExample 1. Set *cacheSize*.\n\n```\nt = streamTable(1000:0, `time`sym`volume, [DATETIME, SYMBOL, INT])\nenableTableCachePurge(table=t, cacheSize=1000)\ntime = datetime(2024.01.01T09:00:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\n\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 0\n\ntime = datetime(2024.01.01T09:35:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 500\n```\n\nExample 2. Set *cachePurgeTimeColumn*, *cachePurgeInterval* and *cacheRetentionTime.*\n\n```\nt = streamTable(1000:0, `time`sym`volume, [DATETIME, SYMBOL, INT])\n\nenableTableCachePurge(table=t, cachePurgeTimeColumn=`time, cachePurgeInterval=30m, cacheRetentionTime=20m)\n\ntime = datetime(2024.01.01T09:00:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\n\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 0\n\ntime = datetime(2024.01.01T09:35:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 999\n```\n\n"
    },
    "enableTablePersistence": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableTablePersistence.html",
        "signatures": [
            {
                "full": "enableTablePersistence(table, [asynWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0],[cachePurgeTimeColumn],[cachePurgeInterval],[cacheRetentionTime],[preCache])",
                "name": "enableTablePersistence",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "[asynWrite=true]",
                        "name": "asynWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [enableTablePersistence](https://docs.dolphindb.com/en/Functions/e/enableTablePersistence.html)\n\n\n\n#### Syntax\n\nenableTablePersistence(table, \\[asynWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0],\\[cachePurgeTimeColumn],\\[cachePurgeInterval],\\[cacheRetentionTime],\\[preCache])\n\n#### Details\n\nThis command enables a shared stream table to be persisted to disk.\n\nFor this command to work, we need to specify the configuration parameter *persistenceDir* in the configuration file (*dolohindb.cfg* in standalone mode and *cluster.cfg* in cluster mode). For details of this configuration parameter, see [Reference](https://docs.dolphindb.com/en/Database/Configuration/reference.html). The persistence location of the table is *\\<PERSISTENCE\\_DIR>/\\<TABLE\\_NAME>*. The directory contains 2 types of files: data files (named like *data0.log*, *data1.log*...) and an index file *index.log*. The data that has been persisted to disk will be loaded into memory after the system is restarted.\n\nThe parameter *asynWrite* informs the system whether table persistence is in asynchronous mode. With asynchronous mode, new data are pushed to a queue and persistence workers (threads) will write the data to disk later. With synchronous mode, the table append operation keeps running until new data are persisted to the disk. The default value is true (asynchronous mode). In general, asynchronous mode achieves higher throughput.\n\nWith asynchronous mode, table persistence is conducted by a single persistence worker (thread), and the persistence worker may handle multiple tables. If there is only one table to be persisted, an increase in the number of persistence workers doesn't improve performance.\n\nStream tables keep all data in memory by default. To prevent excessive memory usage, you can clear cached data using either of the following methods:\n\n* **Cache purge by size**: Set *cacheSize*to specify a threshold for the number of records retained. Older records exceeding the threshold will be removed. The threshold is determined as follows:\n  * If the number of records appended in one batchdoes not exceed *cacheSize*, the threshold is 2.5 \\* *cacheSize*.\n  * If the number of records appended in one batch exceeds *cacheSize*, the threshold is 1.2 \\* (appended records + *cacheSize*).\n* **Cache purge by time**: Set *cachePurgeTimeColumn*, *cachePurgeInterval* and *cacheRetentionTime.* The system will clean up data based on the *cachePurgeTimeColumn*. Each time when a new record arrives, the system obtains the time difference between the new record and the oldest record kept in memory. If the time difference exceeds *cachePurgeInterval*, the system will retain only the data with timestamps within *cacheRetentionTime*of the new data.\n\n**Note:**\n\n* If asynchronous mode is enabled for data persistence or flush, data loss may occur due to server crash.\n\n#### Parameters\n\n**table** is an empty shared stream table.\n\n**asynWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data.\n\n**preCache** (optional) is an integer indicating the number of records to load into memory from the persisted stream table at server startup. If it is not specified, all records are loaded into memory.\n\nNote: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nExample 1:\n\n```\ncolName=[\"time\",\"x\"]\ncolType=[\"timestamp\",\"int\"]\nt = streamTable(100:0, colName, colType);\nshare t as st\n\nenableTablePersistence(table=st, cacheSize=1200000)\n```\n\n```\nfor(s in 0:200){\n    n=10000\n    time=2019.01.01T00:00:00.000+s*n+1..n\n    x=rand(10.0, n)\n    insert into st values(time, x)\n}\n```\n\n```\ngetPersistenceMeta(st);\n\n/* output\npersistenceDir->/data/ssd/DolphinDBDemo/persistence3/st\nretentionMinutes->1440\nhashValue->0\nasynWrite->true\ndiskOffset->0\nsizeInMemory->800000\ncompress->1\nmemoryOffset->1200000\ntotalSize->2000000\nsizeOnDisk->2000000\n*/\n```\n\nPlease note that in this example, we shared a stream table before persisting it with the command `enableTablePersistence`. These 2 operations can be achieved with command [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\nExample 2: Illustrate how to use *cachePurgeTimeColumn*, *cachePurgeInterval*, and *cacheRetentionTime*.\n\n```\ncolName=[\"time\",\"x\"]\ncolType=[\"timestamp\",\"int\"]\nt1 = streamTable(100:0, colName, colType);\nshare t1 as st1\n\nenableTablePersistence(table=st1,cachePurgeTimeColumn = `time, cachePurgeInterval = duration(\"7H\"),cacheRetentionTime = duration(\"2H\"))\ngo;\n\ntime=2019.01.01T00:00:00.000\nfor(s in 0:6000){\n  time = temporalAdd(time,1,\"m\");\n  x=rand(10.0, 1)\n  insert into st1 values(time, x)\n}\n\ngetPersistenceMeta(st1);\n\n//Check the stream table metadata. The tables contains 6000 records in total, and only 300 records are retained in memory after purging the cache.\n\n/* output:\nlastLogSeqNum->-1\nsizeInMemory->300\ntotalSize->6000\nasynWrite->true\ncompress->true\nraftGroup->-1\nmemoryOffset->5700\nretentionMinutes->1440\nsizeOnDisk->5973\npersistenceDir->/home/ffliu/jjxu/DolphinDB_Linux64_V3.0/server/persistence/st1\nhashValue->0\ndiskOffset->0\n*/\n```\n\nRelated commands: [disableTablePersistence](https://docs.dolphindb.com/en/Functions/d/disableTablePersistence.html), [clearTablePersistence](https://docs.dolphindb.com/en/Functions/c/clearTablePersistence.html), [enableTablePersistence](https://docs.dolphindb.com/en/Functions/e/enableTablePersistence.html)\n"
    },
    "enableTableShareAndCachePurge": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableTableShareAndCachePurge.html",
        "signatures": [
            {
                "full": "enableTableShareAndCachePurge(table, tableName, [cacheSize],[cachePurgeTimeColumn],[cachePurgeInterval],[cacheRetentionTime])",
                "name": "enableTableShareAndCachePurge",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [enableTableShareAndCachePurge](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndCachePurge.html)\n\n#### Syntax\n\nenableTableShareAndCachePurge(table, tableName, \\[cacheSize],\\[cachePurgeTimeColumn],\\[cachePurgeInterval],\\[cacheRetentionTime])\n\n#### Details\n\nShare a non-persisted stream table with cache purge.\n\nCache purge can be configured using either of the following methods:\n\n* **Cache purge by size**: Set *cacheSize*to specify a threshold for the number of records retained. Older records exceeding the threshold will be removed. The threshold is determined as follows:\n  * If the number of records appended in one batchdoes not exceed *cacheSize*, the threshold is 2.5 \\* *cacheSize*.\n  * If the number of records appended in one batch exceeds *cacheSize*, the threshold is 1.2 \\* (appended records + *cacheSize*).\n* **Cache purge by time**: Set *cachePurgeTimeColumn*, *cachePurgeInterval* and *cacheRetentionTime.* The system will clean up data based on the *cachePurgeTimeColumn*. Each time when a new record arrives, the system obtains the time difference between the new record and the oldest record kept in memory. If the time difference exceeds *cachePurgeInterval*, the system will retain only the data with timestamps within *cacheRetentionTime*of the new data.\n\n**Note**: If a record has not been enqueued for publishing, it will not be removed.\n\n#### Parameters\n\n**table** is an empty stream table.\n\n**tableName** is a string indicating the name of the shared table.\n\n**cacheSize** (optional) is a positive integer used to determine the maximum number of records to retain in memory.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nExample 1. Set *cacheSize*.\n\n```\nt = streamTable(1000:0, `time`sym`volume, [DATETIME, SYMBOL, INT])\nenableTableShareAndCachePurge(table=t, tableName=`st, cacheSize=1000)\ntime = datetime(2024.01.01T09:00:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\n\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 0\n\ntime = datetime(2024.01.01T09:35:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 500\n```\n\nExample 2. Set *cachePurgeTimeColumn*, *cachePurgeInterval* and *cacheRetentionTime.*\n\n```\nt = streamTable(1000:0, `time`sym`volume, [DATETIME, SYMBOL, INT])\nenableTableShareAndCachePurge(table=t, tableName=`st, cachePurgeTimeColumn=`time,\n cachePurgeInterval=30m, cacheRetentionTime=20m)\n\ntime = datetime(2024.01.01T09:00:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\n\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 0\n\ntime = datetime(2024.01.01T09:35:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 999\n```\n\n"
    },
    "enableTableShareAndPersistence": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html",
        "signatures": [
            {
                "full": "enableTableShareAndPersistence(table, tableName, [asynWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "enableTableShareAndPersistence",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[asynWrite=true]",
                        "name": "asynWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html)\n\n\n\n#### Syntax\n\nenableTableShareAndPersistence(table, tableName, \\[asynWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nShare a stream table, and enable it to be persisted to disk.\n\nFor this command to work, we need to specify the configuration parameter *persistenceDir* in the configuration file (*dolohindb.cfg* in standalone mode and *cluster.cfg* in cluster mode). For details of this configuration parameter, see [Reference](https://docs.dolphindb.com/en/Database/Configuration/reference.html). The persistence location of the table is *\\<PERSISTENCE\\_DIR>/\\<TABLE\\_NAME>*. The directory contains 2 types of files: data files (named like *data0.log*, *data1.log*...) and an index file *index.log*. The data that has been persisted to disk will be loaded into memory after the system is restarted.\n\nThe parameter *asynWrite* informs the system whether table persistence is in asynchronous mode. With asynchronous mode, new data are pushed to a queue and persistence workers (threads) will write the data to disk later. With synchronous mode, the table append operation keeps running until new data are persisted to the disk. The default value is true (asynchronous mode). In general, asynchronous mode achieves higher throughput.\n\nWith asynchronous mode, table persistence is conducted by a single persistence worker (thread), and the persistence worker may handle multiple tables. If there is only one table to be persisted, an increase in the number of persistence workers doesn't improve performance.\n\nStream tables keep all data in memory by default. To prevent excessive memory usage, you can clear cached data using either of the following methods:\n\n* **Cache purge by size**: Set *cacheSize*to specify a threshold for the number of records retained. Older records exceeding the threshold will be removed. The threshold is determined as follows:\n  * If the number of records appended in one batchdoes not exceed *cacheSize*, the threshold is 2.5 \\* *cacheSize*.\n  * If the number of records appended in one batch exceeds *cacheSize*, the threshold is 1.2 \\* (appended records + *cacheSize*).\n* **Cache purge by time**: Set *cachePurgeTimeColumn*, *cachePurgeInterval* and *cacheRetentionTime.* The system will clean up data based on the *cachePurgeTimeColumn*. Each time when a new record arrives, the system obtains the time difference between the new record and the oldest record kept in memory. If the time difference exceeds *cachePurgeInterval*, the system will retain only the data with timestamps within *cacheRetentionTime*of the new data.\n\n**Note:**\n\n* If *asynWrite* is set to true, streaming data is written at the fastest speed and data loss may occur due to server crash.\n\n* If *asynWrite* is set to false and *flushMode* to 0, data loss may occur due to operating system crash.\n\n* If *asynWrite* is set to false and *flushMode* to 1, the streaming data is written at the slowest speed, and server or operating system crash will not cause data loss.\n\n* It is not allowed to share a stream table multiple times by modifying the shared table name.\n\n#### Parameters\n\n**table** is an empty stream table.\n\n**tableName** is a string indicating the name of the shared table.\n\n**asynWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nExample 1:\n\n```\ncolName=[\"time\",\"x\"]\ncolType=[\"timestamp\",\"int\"]\nt = streamTable(100:0, colName, colType);\nenableTableShareAndPersistence(table=t, tableName=`st, cacheSize=1200000)\ngo;\n```\n\n```\nfor(s in 0:200){\n    n=10000\n    time=2019.01.01T00:00:00.000+s*n+1..n\n    x=rand(10.0, n)\n    insert into st values(time, x)\n}\n```\n\n```\ngetPersistenceMeta(st);\n\n/* output\nsizeInMemory->800000\nasynWrite->true\ntotalSize->2000000\ncompress->true\nmemoryOffset->1200000\nretentionMinutes->1440\nsizeOnDisk->2000000\npersistenceDir->/home/llin/hzy/server1/pst/st\nhashValue->0\ndiskOffset->0\n*/\n```\n\nExample 2: Illustrate how to use *cachePurgeTimeColumn*, *cachePurgeInterval*, and *cacheRetentionTime*.\n\n```\ncolName=[\"time\",\"x\"]\ncolType=[\"timestamp\",\"int\"]\nt1 = streamTable(100:0, colName, colType);\n\nenableTableShareAndPersistence(table=t1,tableName=`st1, cachePurgeTimeColumn=`time, cachePurgeInterval=duration(\"7H\"),cacheRetentionTime=duration(\"2H\"))\n\ngo;\n\ntime=2019.01.01T00:00:00.000\nfor(s in 0:6000){\n  time = temporalAdd(time,1,\"m\");\n  x=rand(10.0, 1)\n  insert into st1 values(time, x)\n}\n\ngetPersistenceMeta(st1);\n/* output:\nlastLogSeqNum->-1\nsizeInMemory->300\ntotalSize->12000\nasynWrite->true\ncompress->true\nraftGroup->-1\nmemoryOffset->11700\nretentionMinutes->1440\nsizeOnDisk->11879\npersistenceDir->/home/ffliu/jjxu/DolphinDB_Linux64_V3.0/server/persistence/st1\nhashValue->0\ndiskOffset->0\n*/\n```\n\nRelated commands: [disableTablePersistence](https://docs.dolphindb.com/en/Functions/d/disableTablePersistence.html), [clearTablePersistence](https://docs.dolphindb.com/en/Functions/c/clearTablePersistence.html), [enableTablePersistence](https://docs.dolphindb.com/en/Functions/e/enableTablePersistence.html)\n"
    },
    "enableTDEKey": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enabletdekey.html",
        "signatures": [
            {
                "full": "enableTDEKey(masterKeyPath)",
                "name": "enableTDEKey",
                "parameters": [
                    {
                        "full": "masterKeyPath",
                        "name": "masterKeyPath"
                    }
                ]
            }
        ],
        "markdown": "### [enableTDEKey](https://docs.dolphindb.com/en/Functions/e/enabletdekey.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nenableTDEKey(masterKeyPath)\n\n#### Details\n\n\\[Linux Only] This function enables transparent data encryption and initializes the specified TDE key. It must be executed by an administrator on the controller.\n\nIt returns true if successful. If an error occurs, check whether the key path is correct and if the file adheres to the required key format.\n\nAfter the key is successfully configured, users can call the [getCurrentTDEKeyVersion](https://docs.dolphindb.com/en/Functions/g/getcurrenttdekeyversion.html) function to check the current TDE key version and verify if the encryption configuration is effective.\n\n#### Parameters\n\n**masterKeyPath** is a string specifying the path to the TDE key file.\n\n#### Examples\n\n```\nenableTDEKey(path/to/key)\n```\n"
    },
    "enableTransferCompressionToComputeNode": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enabletransfercompressiontocomputenode.html",
        "signatures": [
            {
                "full": "enableTransferCompressionToComputeNode(enable)",
                "name": "enableTransferCompressionToComputeNode",
                "parameters": [
                    {
                        "full": "enable",
                        "name": "enable"
                    }
                ]
            }
        ],
        "markdown": "### [enableTransferCompressionToComputeNode](https://docs.dolphindb.com/en/Functions/e/enabletransfercompressiontocomputenode.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nenableTransferCompressionToComputeNode(enable)\n\n#### Details\n\nControls whether the data node compresses data before transferring it to the compute node.\n\n#### Parameters\n\n**enable**: A boolean value specifying whether to compress the data to be transferred.\n\n* true: enables compression\n* false: disables compression\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nenableTransferCompressionToComputeNode(true)\n```\n\n**Related Function:** [isTransferCompressionToComputeNodeEnabled](https://docs.dolphindb.com/en/Functions/i/istransfercompressiontocomputenodeenabled.html)\n"
    },
    "enableTSDBAsyncSorting": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enableTSDBAsyncSorting.html",
        "signatures": [
            {
                "full": "enableTSDBAsyncSorting()",
                "name": "enableTSDBAsyncSorting",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [enableTSDBAsyncSorting](https://docs.dolphindb.com/en/Functions/e/enableTSDBAsyncSorting.html)\n\n\n\n#### Syntax\n\nenableTSDBAsyncSorting()\n\n#### Details\n\nData written to the TSDB cache engine are sorted by *sortColumns*. The tasks of writing and sorting data can be processed synchronously or asynchronously. Execute the command to enable asynchronous sorting mode. The number of asynchronous threads is specified with configuration parameter *TSDBAsyncSortingWorkerNum*. This command can only be executed by an administrator on a data node. Please make sure the parameter *TSDBAsyncSortingWorkerNum* is configured greater than 0 before executing the command.\n\nIt's recommended to enable asynchronous mode for a TSDB engine on a multi-core processor.\n\nRelated function: [disableTSDBAsyncSorting](https://docs.dolphindb.com/en/Functions/d/disableTSDBAsyncSorting.html)\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n"
    },
    "encodeShortGenomeSeq": {
        "url": "https://docs.dolphindb.com/en/Functions/e/encodeShortGenomeSeq.html",
        "signatures": [
            {
                "full": "encodeShortGenomeSeq(X)",
                "name": "encodeShortGenomeSeq",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [encodeShortGenomeSeq](https://docs.dolphindb.com/en/Functions/e/encodeShortGenomeSeq.html)\n\n#### Syntax\n\nencodeShortGenomeSeq(X)\n\nAlias: encodeSGS\n\n#### Details\n\n`encodeShortGenomeSeq` encodes DNA sequences made up of A, T, C, G letters. The encoding can reduce the storage space needed for DNA sequences and improve performance.\n\n**Note:**\n\n* When *X* is an empty string (\"\"), the function returns 0.\n\n* When *X* contains any character other than A, T, C, G (case-sensitive), the function returns NULL.\n\n* When the length of *X* exceeds 28 characters, the function returns NULL.\n\n#### Parameters\n\n`X` is a scalar/vector of STRING/CHAR type.\n\n#### Returns\n\nLONG or FAST LONG vector.\n\n#### Examples\n\n```\na=encodeShortGenomeSeq(\"TCGATCG\")\na;\n// output: 465691\ntypestr(a)\n// output: LONG\n\nb=encodeShortGenomeSeq(\"TCGATCG\" \"TCGATCGCCC\")\n// output: [465691,168216298]\ntypestr(b)\n// output: FAST LONG VECTOR\n\n//NULL is returned as the input exceeds 28 characters after \"TCGATCG\" is repeated 5 times.\nencodeShortGenomeSeq(repeat(\"TCGATCG\" \"TCGAT\", 5))\n// output: [,1801916404867712433]\n\ny=toCharArray(\"TCGATCGCCC\")\nencodeShortGenomeSeq(y)\n// output: 168216298\n\n//NULL is returned in the following cases\nencodeShortGenomeSeq(\"TC G\")\nencodeShortGenomeSeq(\"TCtG\")\nencodeShortGenomeSeq(\"NNNNNNNNTCGGGGCAT\")\nencodeShortGenomeSeq(\"TCGGGGCATNGCCCG\")\nencodeShortGenomeSeq(\"GCCCGATNNNNN\")\n```\n\nRelated functions: [decodeShortGenomeSeq](https://docs.dolphindb.com/en/Functions/d/decodeShortGenomeSeq.html), [genShortGenomeSeq](https://docs.dolphindb.com/en/Functions/g/genShortGenomeSeq.html)\n\n"
    },
    "encryptModule": {
        "url": "https://docs.dolphindb.com/en/Functions/e/encryptmodule.html",
        "signatures": [
            {
                "full": "encryptModule(name, [moduleDir], [overwrite=false])",
                "name": "encryptModule",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[moduleDir]",
                        "name": "moduleDir",
                        "optional": true
                    },
                    {
                        "full": "[overwrite=false]",
                        "name": "overwrite",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [encryptModule](https://docs.dolphindb.com/en/Functions/e/encryptmodule.html)\n\nFirst introduced in version: 2.00.18, 2.00.16.53.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\nencryptModule(name, \\[moduleDir], \\[overwrite=false])\n\n#### Details\n\nEncrypts a module (DOS file) to generate a distributable encrypted module (DOM file). This function can only be executed after login.\n\n**Note:**\n\n* The `saveModule` function can also generate a DOM file, but it does not support encryption.\n* `encryptModule` includes a function serialization protocol, so compatibility must be taken into account.\n  * Encrypted modules generated on a 3.00.0-series server cannot run on any 2.00.0-series server.\n  * Encrypted modules generated on a 2.00.0-series server can run on a same-level 3.00.0-series server. For example, versions 2.00.17 and 3.00.4 are considered the same level, so an encrypted module generated on 2.00.17 can run on 3.00.4. However, compatibility is not guaranteed on 3.00.0-series servers with versions earlier than 3.00.4.\n\n#### Parameters\n\n**name**: A string specifying the name of the module file.\n\n**moduleDir**: A string specifying the directory where the module file is located, which defaults to the \\[home]/modules directory of the node. The home directory can be queried using [getHomeDir](https://docs.dolphindb.com/en/Functions/g/getHomeDir.html).\n\n**overwrite**: A boolean value specifying whether to overwrite an existing DOM file with the same name. The default value is false, meaning the file will not be overwritten.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nAssume the modules directory under the node’s home directory contains the ta.dos module file. The following function serializes it into an encrypted binary file:\n\n```\nencryptModule(\"ta\")\n```\n\nAfter successful execution, a file named ta.dom will appear in the modules directory.\n\n![](https://docs.dolphindb.com/en/images/encrypt_module.png)\n\n**Related functions**\n\n[saveModule](https://docs.dolphindb.com/en/Functions/s/saveModule.html)\n\n[loadModule](https://docs.dolphindb.com/en/Functions/l/loadModule.html)\n"
    },
    "endsWith": {
        "url": "https://docs.dolphindb.com/en/Functions/e/endsWith.html",
        "signatures": [
            {
                "full": "endsWith(X, str)",
                "name": "endsWith",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "str",
                        "name": "str"
                    }
                ]
            }
        ],
        "markdown": "### [endsWith](https://docs.dolphindb.com/en/Functions/e/endsWith.html)\n\n\n\n#### Syntax\n\nendsWith(X, str)\n\n#### Details\n\nCheck if *X* ends with *str*. If yes, return true; otherwise, return false.\n\n#### Parameters\n\n**X** is a STRING scalar/vector.\n\n**str** is a STRING scalar/vector.\n\n#### Returns\n\nA scalar or vector of type BOOL.\n\n#### Examples\n\n```\nendsWith('ABCDEF!', \"F!\");\n// output: true\n\nendsWith('ABCDEF!', \"E!\");\n// output: false\n```\n"
    },
    "enlist": {
        "url": "https://docs.dolphindb.com/en/Functions/e/enlist.html",
        "signatures": [
            {
                "full": "enlist()",
                "name": "enlist",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [enlist](https://docs.dolphindb.com/en/Functions/e/enlist.html)\n\n\n\n#### Syntax\n\nenlist()\n\n#### Details\n\nIf *X* is a scalar, returns a vector.\n\nIf *X* is a dictionary:\n\n* When the keys are strings, it returns a single-row table.\n\n* When the keys are non-strings, it returns a tuple.\n\nIf *X* is a vector, tuple or of other data forms, returns a tuple.\n\n#### Parameters\n\n**X** can be of any data form.\n\n#### Examples\n\n```\nenlist(1)\n// output: [1]\n\nenlist(`aaa)\n// output: [\"aaa\"]\n\nenlist([2022.01.01,2022.01.02,2022.01.03])\n// output: ([2022.01.01,2022.01.02,2022.01.03])\n\nenlist([\"a\",2,3])\n// output: ((\"a\",2,3))\n\na = array(INT[], 0, 10).append!([1 2 3, 4 5,6 7 8, 9 NULL])\nenlist(a)\n// output: ([[1,2,3],[4,5],[6,7,8],[9,00i]])\n\nd1=dict(`a`b`c, (1, 2 3, 4))\nenlist(d1)\n```\n\n| c | b       | a |\n| - | ------- | - |\n| 4 | \\[2, 3] | 1 |\n\n```\nvalue =(-2 2 3, 0 1, 2.2 -3 1)\nd2 = dict(1 2 3, value, true)\nprint enlist(d2)\n\n/* output;\n(1->[-2,2,3]\n2->[0,1]\n3->[2.2,-3,1]\n)\n*/\n```\n"
    },
    "eq": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eq.html",
        "signatures": [
            {
                "full": "eq(X, Y)",
                "name": "eq",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [eq](https://docs.dolphindb.com/en/Functions/e/eq.html)\n\n\n\n#### Syntax\n\neq(X, Y)\n\nor\n\nX==Y\n\n#### Details\n\nIf neither *X* nor *Y* is a set, return the element-by-element comparison of *X* and *Y*.\n\nIf *X* and *Y* are sets, check if *X* and *Y* are identical.\n\n#### Parameters\n\n**X** / **Y** is a scalar/pair/vector/matrix/set. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\nBOOL type with the same data form as *X*/*Y*.\n\n#### Examples\n\n```\n1 2 3 == 2;\n// output: [0,1,0]\n\n1 2 3==0 2 4;\n// output: [0,1,0]\n\n1:2==1:6;\n// output: 1 : 0\n\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1 == 4;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 0  | 0  | 0  |\n| 0  | 1  | 0  |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1==m2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 0  | 0  | 0  |\n| 0  | 0  | 0  |\n\nSet operation: If *X*==*Y* then *X* and *Y* are identical.\n\n```\nx=set(4 6)\ny=set(4 6 8);\n\nx==y;\n// output: false\nx==x;\n// output: true\n```\n"
    },
    "eqAmericanOptionPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqamericanoptionpricer.html",
        "signatures": [
            {
                "full": "eqAmericanOptionPricer(instrument, pricingDate, spot, discountCurve, dividendCurve, volSurf, [setting], [model='BlackScholes'], [method='Analytic'])",
                "name": "eqAmericanOptionPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "dividendCurve",
                        "name": "dividendCurve"
                    },
                    {
                        "full": "volSurf",
                        "name": "volSurf"
                    },
                    {
                        "full": "[setting]",
                        "name": "setting",
                        "optional": true
                    },
                    {
                        "full": "[model='BlackScholes']",
                        "name": "model",
                        "optional": true,
                        "default": "'BlackScholes'"
                    },
                    {
                        "full": "[method='Analytic']",
                        "name": "method",
                        "optional": true,
                        "default": "'Analytic'"
                    }
                ]
            }
        ],
        "markdown": "### [eqAmericanOptionPricer](https://docs.dolphindb.com/en/Functions/e/eqamericanoptionpricer.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\neqAmericanOptionPricer(instrument, pricingDate, spot, discountCurve, dividendCurve, volSurf, \\[setting], \\[model='BlackScholes'], \\[method='Analytic'])\n\n#### Details\n\nPrices equity American options.\n\n#### Parameters\n\n**instrument** is an Instrument scalar/vector representing the equity American-style option contract(s) to be priced.\n\n**pricingDate** is a DATE scalar/vector specifying the pricing date(s).\n\n**spot** is a numeric scalar/vector specifying the spot price(s).\n\n**discountCurve** is a MktData scalar/vector of type IrYieldCurve representing the discount curve(s).\n\n**dividendCurve** is a MktData scalar/vector of type DividendCurve.\n\n**volSurf** is a MKTDATA scalar/vector of type VolatilitySurface representing the volatility surface.\n\n**setting** (optional): a dictionary used to configure pricing outputs. It contains the following keys:\n\n* calcDelta: Boolean value indicating whether to calculate delta.\n\n* calcGamma: Boolean value indicating whether to calculate gamma.\n\n* calcVega: Boolean value indicating whether to calculate vega.\n\n* calcTheta: Boolean value indicating whether to calculate theta.\n\n* calcRhoIr: Boolean value indicating whether to calculate rhoIr.\n\n* calcRhoDividend: Boolean value indicating whether to calculate rhoDividend.\n\n**model** (optional): a STRING scalar specifying the pricing model to use. Optional values:\n\n* \"BlackScholes\" (default): Black–Scholes model\n\n* \"BAW\": Barone-Adesi-Whaley formula\n\n* \"AmericanBinomialTree\": American binomial tree pricing model\n\n**method** (optional): a STRING scalar specifying the calculation method. Optional values:\n\n* \"Analytic\" (default): Analytic method. Supported when *model* is BlackScholes or BAW.\n\n* \"tree\": Tree-based method. Supported when *model* is AmericanBinomialTree.\n\n#### Returns\n\n* If *setting* is not specified: returns a DOUBLE scalar representing the net present value (NPV) of the option.\n\n* If *setting* is specified: returns a dictionary containing the NPV and the Greeks as specified in *setting* .\n\n#### Examples\n\n```\n//Tencent Stock Option Pricing\nreferenceDate = 2026.02.13\n// 1. Discount Curve (HKD Proxy - Simplified)\n// Note: In actual production, HIBOR or OIS curve should be used\ndiscountCurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"HKD_RF\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"HKD\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": [\n        referenceDate + 1, referenceDate + 30, referenceDate + 90,\n        referenceDate + 180, referenceDate + 365\n    ],\n    \"values\":[0.04, 0.04, 0.04, 0.04, 0.04]\n}\ndiscountCurve = parseMktData(discountCurveDict)\n// 2. Data Preparation\nspot = 532.0\ntermDates = [2026.02.20, 2026.02.26, 2026.03.30, 2026.04.29, 2026.05.28, 2026.06.29, 2026.09.29, 2026.12.30]\n// Matrices are ensured to be dense (no zeros) by Python preprocessing\ncallPrices = matrix(\n    [102.240, 92.250, 82.270, 72.300, 62.360, 52.480, 42.710, 33.180, 24.170, 15.940, 9.000, 4.600, 2.130, 0.960, 0.370, 0.130, 0.050, 0.020, 0.010, 0.010],\n    [102.480, 92.530, 82.620, 72.750, 62.980, 53.350, 43.970, 35.430, 26.800, 19.250, 12.390, 8.200, 5.010, 3.030, 1.710, 0.940, 0.490, 0.250, 0.130, 0.070],\n    [105.350, 94.410, 84.930, 75.670, 66.690, 59.800, 50.880, 41.900, 34.080, 29.030, 23.600, 18.700, 14.700, 11.470, 8.880, 7.000, 5.320, 4.000, 2.990, 2.220],\n    [107.770, 96.450, 87.340, 78.510, 70.000, 61.880, 55.250, 46.990, 41.510, 34.530, 29.120, 24.370, 20.000, 16.900, 13.980, 11.410, 9.320, 7.760, 6.500, 5.320],\n    [109.270, 97.890, 89.050, 80.500, 72.290, 64.460, 57.080, 50.140, 45.000, 38.800, 33.130, 28.330, 24.220, 20.630, 17.580, 14.840, 12.540, 10.560, 8.850, 7.440],\n    [110.210, 98.620, 90.010, 81.730, 73.930, 66.430, 59.420, 52.930, 47.380, 42.070, 36.780, 32.290, 28.310, 24.260, 21.250, 18.380, 15.900, 13.610, 11.710, 10.000],\n    [115.610, 107.450, 96.760, 89.450, 82.610, 75.990, 69.870, 63.990, 58.540, 54.680, 49.600, 45.520, 40.960, 36.480, 33.520, 30.130, 27.110, 24.080, 21.680, 19.310],\n    [124.400, 116.880, 109.390, 99.560, 92.910, 89.300, 82.750, 77.110, 69.700, 66.470, 61.260, 56.670, 52.370, 48.220, 44.480, 40.740, 37.360, 34.350, 31.340, 28.570]\n)\nputPrices = matrix(\n    [0.010, 0.010, 0.030, 0.050, 0.110, 0.210, 0.460, 0.880, 1.750, 3.450, 6.570, 12.100, 19.820, 28.260, 38.190, 48.020, 58.000, 68.000, 78.000, 88.000],\n    [0.050, 0.090, 0.160, 0.290, 0.510, 0.900, 1.480, 2.390, 3.930, 6.260, 10.000, 15.350, 21.820, 30.000, 39.150, 48.500, 58.190, 68.000, 80.340, 88.000],\n    [0.560, 0.900, 1.410, 2.140, 3.160, 4.540, 6.360, 8.640, 11.390, 14.720, 18.710, 24.150, 30.180, 37.360, 44.600, 53.900, 61.660, 70.100, 80.340, 88.940],\n    [1.310, 1.960, 2.840, 4.000, 5.470, 7.000, 9.210, 11.950, 15.110, 18.850, 23.340, 28.440, 34.710, 41.520, 48.300, 57.590, 64.690, 73.180, 81.860, 90.830],\n    [2.860, 3.870, 5.230, 6.730, 8.460, 10.740, 13.480, 16.630, 20.240, 24.470, 29.080, 34.410, 40.600, 47.430, 54.580, 62.650, 70.440, 78.580, 86.920, 95.580],\n    [3.790, 5.140, 6.750, 8.680, 10.870, 13.690, 16.300, 19.650, 23.400, 27.920, 32.950, 38.280, 44.180, 50.760, 57.030, 65.510, 73.230, 78.580, 86.920, 97.520],\n    [8.130, 10.140, 12.540, 15.140, 17.750, 20.910, 24.310, 28.300, 32.340, 37.020, 42.040, 47.690, 53.480, 60.030, 66.160, 73.900, 80.970, 88.120, 95.810, 101.990],\n    [14.020, 15.890, 18.190, 21.170, 24.270, 27.800, 31.600, 35.490, 40.040, 44.910, 49.510, 54.850, 60.560, 67.000, 72.830, 78.360, 84.930, 94.000, 102.120, 109.690]\n)\nstrikes = matrix(\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00],\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00],\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00],\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00],\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00],\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00],\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00],\n    [430.00, 440.00, 450.00, 460.00, 470.00, 480.00, 490.00, 500.00, 510.00, 520.00, 530.00, 540.00, 550.00, 560.00, 570.00, 580.00, 590.00, 600.00, 610.00, 620.00]\n)\noptionPrices = matrix(\n    [0.010, 0.010, 0.030, 0.050, 0.110, 0.210, 0.460, 0.880, 1.750, 3.450, 6.570, 4.600, 2.130, 0.960, 0.370, 0.130, 0.050, 0.020, 0.010, 0.010],\n    [0.050, 0.090, 0.160, 0.290, 0.510, 0.900, 1.480, 2.390, 3.930, 6.260, 10.000, 8.200, 5.010, 3.030, 1.710, 0.940, 0.490, 0.250, 0.130, 0.070],\n    [0.560, 0.900, 1.410, 2.140, 3.160, 4.540, 6.360, 8.640, 11.390, 14.720, 18.710, 18.700, 14.700, 11.470, 8.880, 7.000, 5.320, 4.000, 2.990, 2.220],\n    [1.310, 1.960, 2.840, 4.000, 5.470, 7.000, 9.210, 11.950, 15.110, 18.850, 23.340, 24.370, 20.000, 16.900, 13.980, 11.410, 9.320, 7.760, 6.500, 5.320],\n    [2.860, 3.870, 5.230, 6.730, 8.460, 10.740, 13.480, 16.630, 20.240, 24.470, 29.080, 28.330, 24.220, 20.630, 17.580, 14.840, 12.540, 10.560, 8.850, 7.440],\n    [3.790, 5.140, 6.750, 8.680, 10.870, 13.690, 16.300, 19.650, 23.400, 27.920, 32.950, 32.290, 28.310, 24.260, 21.250, 18.380, 15.900, 13.610, 11.710, 10.000],\n    [8.130, 10.140, 12.540, 15.140, 17.750, 20.910, 24.310, 28.300, 32.340, 37.020, 42.040, 45.520, 40.960, 36.480, 33.520, 30.130, 27.110, 24.080, 21.680, 19.310],\n    [14.020, 15.890, 18.190, 21.170, 24.270, 27.800, 31.600, 35.490, 40.040, 44.910, 49.510, 56.670, 52.370, 48.220, 44.480, 40.740, 37.360, 34.350, 31.340, 28.570]\n)\npayoffTypes = matrix(\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"]\n)\n// 3. Build Dividend Curve (CallPutParity)\n// Imply the dividend curve from option prices using Call-Put Parity\ndividendCurve = eqDividendCurveBuilder(\n    referenceDate, termDates, \"CallPutParity\", ,\n    callPrices, putPrices, strikes, spot, discountCurve, \"Actual365\"\n)\n// 4. Build Volatility Surface (SVI Model)\n// Build the volatility surface\nsurface = eqVolatilitySurfaceBuilder(\n        referenceDate,\n        termDates,\n        strikes,\n        optionPrices,\n        payoffTypes,\n        spot,\n        discountCurve,\n        dividendCurve,\n        \"SVI\"\n)\n// 5. Pricing Test: eqAmericanOptionPricer\noptionDict = {\n    \"productType\": \"Option\",\n    \"optionType\": \"AmericanOption\",\n    \"assetType\": \"EqAmericanOption\",\n    \"notionalCurrency\": \"HKD\",    // price currency\n    \"notionalAmount\": 1,          // 份数      \n    \"strike\": 530.0,\n    \"maturity\": 2026.02.24,\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"00700.HK\"\n}\ninstrument = parseInstrument(optionDict)\nres = eqAmericanOptionPricer(\n        instrument,\n        referenceDate,\n        spot,\n        discountCurve,\n        dividendCurve,\n        surface,\n        setting={\"calcDelta\": true, \"calcGamma\": true, \"calcVega\": true, \"calcTheta\": true, \"calcRho\": true, \"calcRhoIr\": true, \"calcRhoDividend\": true}\n)\nprint(res)\n```\n\n#### Instrument Field Description\n\n| **Field Name**     | **Data Type** | **Description**                                                                                                                                                                                                              | **Required** |\n| ------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |\n| productType        | STRING        | Fixed value: `\"Option\"`.                                                                                                                                                                                                     | √            |\n| optionType         | STRING        | Fixed value: `\"AmericanOption\"`.                                                                                                                                                                                             | √            |\n| assetType          | STRING        | Fixed value: `\"EqAmericanOption\"` (Equity American Option).                                                                                                                                                                  | √            |\n| notionalAmount     | DOUBLE        | Notional amount.                                                                                                                                                                                                             | √            |\n| notionalCurrency   | STRING        | Notional currency. Defaults to CNY.                                                                                                                                                                                          | √            |\n| instrumentId       | STRING        | Instrument identifier. For example, `TCH250328C0040000` is interpreted as follows: `TCH` = underlying (Tencent Holdings); `250328` = maturity date (March 28, 2025); `C` = Call option; `0040000` = strike price 400.00 HKD. | ×            |\n| direction          | STRING        | Trade direction: `Buy` or `Sell`. Defaults to `Buy`.                                                                                                                                                                         | ×            |\n| maturity           | DATE          | Maturity date (expiration date).                                                                                                                                                                                             | √            |\n| strike             | DOUBLE        | Strike price.                                                                                                                                                                                                                | √            |\n| payoffType         | STRING        | Payoff type (enumeration): `Call` or `Put`.                                                                                                                                                                                  | √            |\n| underlying         | STRING        | Underlying futures contract code, e.g., `TCH`.                                                                                                                                                                               | √            |\n| dayCountConvention | STRING        | Day count convention. Available options: `\"ActualActualISDA\"`, `\"ActualActualISMA\"`, `\"Actual365\"`, `\"Actual360\"`.                                                                                                           | √            |\n| discountCurve      | STRING        | Discount curve name used for pricing. For CNY deposits, the default is `\"CNY_FR_007\"`.                                                                                                                                       | ×            |\n| dividendCurve      | STRING        | Dividend curve name used for pricing.                                                                                                                                                                                        | ×            |\n\n**Related Functions:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html), [eqDividendCurveBuilder](https://docs.dolphindb.com/en/Functions/e/eqDividendCurveBuilder.html), [eqVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/e/eqvolatilitysurfacebuilder.html)\n"
    },
    "eqDividendCurveBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqDividendCurveBuilder.html",
        "signatures": [
            {
                "full": "eqDividendCurveBuilder(referenceDate, termDates, method, [futPrices], [callPrices], [putPrices], [strikes], spot, discountCurve, dayCountConvention='Actual365', [curveName])",
                "name": "eqDividendCurveBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "termDates",
                        "name": "termDates"
                    },
                    {
                        "full": "method",
                        "name": "method"
                    },
                    {
                        "full": "[futPrices]",
                        "name": "futPrices",
                        "optional": true
                    },
                    {
                        "full": "[callPrices]",
                        "name": "callPrices",
                        "optional": true
                    },
                    {
                        "full": "[putPrices]",
                        "name": "putPrices",
                        "optional": true
                    },
                    {
                        "full": "[strikes]",
                        "name": "strikes",
                        "optional": true
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "dayCountConvention='Actual365'",
                        "name": "dayCountConvention='Actual365'"
                    },
                    {
                        "full": "[curveName]",
                        "name": "curveName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [eqDividendCurveBuilder](https://docs.dolphindb.com/en/Functions/e/eqDividendCurveBuilder.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\neqDividendCurveBuilder(referenceDate, termDates, method, \\[futPrices], \\[callPrices], \\[putPrices], \\[strikes], spot, discountCurve, dayCountConvention='Actual365', \\[curveName])\n\n#### Details\n\nBuilds an equity dividend curve.\n\n#### Parameters\n\n**referenceDate**: A DATE scalar specifying the curve’s reference date.\n\n**termDates**: A DATE vector specifying the curve’s term dates, which must be monotonically increasing and larger than *referenceDate*.\n\n**method**: A STRING scalar specifying the calculating method, which can be “CallPutParity” or “FuturesPrice”.\n\n* When method = “CallPutParity”, implied dividend yields are derived via put-call parity. In this case, *callPrices*, *putPrices,* and *strikes* are required.\n\n* When method = “FuturesPrice”, implied dividend yields are deriving via the futures price formula. In this case, *futPrices* is required.\n\n**futPrices** (optional): A positive DOUBLE vector specifying the future prices. It should have the same length as *termDates*.\n\n**callPrices** (optional): A positive DOUBLE matrix specifying the call prices, which must have the same length as *termDates*.\n\n**putPrices** (optional): A positive DOUBLE matrix specifying the put prices.\n\n**strikes** (optional): A DOUBLE matrix specifying the strike prices, which must be monotonically increasing.\n\n**Notes**:\n\n* *callPrices*, *putPrices*, and *strikes* must have the same shape and the number of columns should match the length of *termDates*.\n\n* *futPrices* must also have the same length as *termDates*.\n\n**spot**: A positive DOUBLE scalar specifying the spot price of the underlying asset.\n\n**discountCurve**: A MKTDATA object of type IrYieldCurve specifying the discount curve.\n\n**dayCountConvention**: A STRING scalar specifying the day count convention to use, which can be:\n\n* \"Actual365\" (default): actual/365\n* \"Actual360\": actual/360\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention\n\n**curveName** (optional): A STRING scalar specifying the curve name.\n\n#### Returns\n\nA MKTDATA object.\n\n#### Examples\n\n##### CallPutParity\n\nBuild a dividend curve for the SSE 50 ETF (510050.SH) using the put-call parity method.\n\n```\nreferenceDate = 2026.02.13\nspot = 3.114  // Close Price Of 510050.SH\n\n// 1. Term Structure (Option Expiry Dates)\ntermDates = [2026.02.25, 2026.03.25, 2026.06.24, 2026.09.23]\n\n// 2. Raw Data Matrices (Settlement Price)\ncallPrices = matrix(\n    [0.2640, 0.2140, 0.1640, 0.1140, 0.0327, 0.0042, 0.0016, 0.0008, 0.0003, 0.0002],\n    [0.2723, 0.2289, 0.1810, 0.1424, 0.0721, 0.0323, 0.0138, 0.0075, 0.0050, 0.0039],\n    [0.3150, 0.2770, 0.2391, 0.2073, 0.1519, 0.1061, 0.0731, 0.0519, 0.0379, 0.0280],\n    [0.3521, 0.3170, 0.2850, 0.2555, 0.2030, 0.1577, 0.1243, 0.0986, 0.0790, 0.0642]\n)\nputPrices = matrix(\n    [0.0004, 0.0008, 0.0021, 0.0044, 0.0215, 0.0928, 0.1889, 0.2884, 0.3895, 0.4903],\n    [0.0090, 0.0124, 0.0170, 0.0260, 0.0590, 0.1225, 0.1993, 0.2928, 0.3918, 0.4903],\n    [0.0352, 0.0463, 0.0571, 0.0746, 0.1188, 0.1733, 0.2401, 0.3204, 0.4049, 0.4938],\n    [0.0601, 0.0739, 0.0903, 0.1091, 0.1548, 0.2113, 0.2795, 0.3471, 0.4307, 0.5120]\n)\nstrikes = matrix(\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000],\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000],\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000],\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000]\n)\n\n// 3. Discount Curve \n// Data From https://www.chinamoney.com.cn/english/bmkycvirc/\nterms = [1d, 1w, 2w, 3w, 1M, 2M, 3M, 6M, 9M, 1y, 18M, 2y, 3y]\ndates = array(DATE, size(terms))\nfor(i in 0..(size(terms)-1)){\n    dates[i] = transFreq(temporalAdd(referenceDate, terms[i]), \"CFET\", \"right\", \"right\")\n}\ndiscountCurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_FR_007\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": dates,\n    \"values\":[1.5577, 1.5247, 1.5181, 1.5181, 1.5195, 1.5216, 1.5167, 1.4964, 1.4758, 1.4732, 1.4859, 1.4985,1.5306] \\ 100\n}\ndiscountCurve = parseMktData(discountCurveDict)\n\n// 4. Implied Dividend Curve\n// Using Call-Put Parity on the full matrices\ndividendCurve = eqDividendCurveBuilder(\n    referenceDate, termDates, \"CallPutParity\", ,\n    callPrices, putPrices, strikes, spot, discountCurve, \"Actual365\"\n)\n\nprint(dividendCurve)\n```\n\n##### FuturesPrice\n\nBuild a dividend curve for the CSI 300 Index (000300.SH) using the futures price method.\n\n```\nreferenceDate = 2026.02.13\nspot = 4660.41  // Close Price Of 000300.SH\n\n// 1. Futures Price\ntermDates = [2026.02.24, 2026.03.20, 2026.06.22, 2026.09.18] // IF2602/03/06/09 Expiry Date\nfutPrices = [4650.6, 4639.6, 4601.2, 4540.4]  // Settlement Price\n\n// 2. Discount Curve\n// Data From https://www.chinamoney.com.cn/english/bmkycvirc/\nterms = [1d, 1w, 2w, 3w, 1M, 2M, 3M, 6M, 9M, 1y, 18M, 2y, 3y]\ndates = array(DATE, size(terms))\nfor(i in 0..(size(terms)-1)){\n    dates[i] = transFreq(temporalAdd(referenceDate, terms[i]), \"CFET\", \"right\", \"right\")\n}\ndiscountCurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_FR_007\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": dates,\n    \"values\":[1.5577, 1.5247, 1.5181, 1.5181, 1.5195, 1.5216, 1.5167, 1.4964, 1.4758, 1.4732, 1.4859, 1.4985, 1.5306] \\ 100\n}\ndiscountCurve = parseMktData(discountCurveDict)\n\n//3. Build Dividend Curve\ndividendCurve = eqDividendCurveBuilder(referenceDate, termDates, \"FuturesPrice\", futPrices,\n    , , , spot, discountCurve, \"Actual365\", \"HS300\")\nprint(dividendCurve)\n```\n\n**Related Function**: [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "eqEuropeanOptionPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqeuropeanoptionpricer.html",
        "signatures": [
            {
                "full": "eqEuropeanOptionPricer(instrument, pricingDate, spot, discountCurve, dividendCurve, volSurf, [setting])",
                "name": "eqEuropeanOptionPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "dividendCurve",
                        "name": "dividendCurve"
                    },
                    {
                        "full": "volSurf",
                        "name": "volSurf"
                    },
                    {
                        "full": "[setting]",
                        "name": "setting",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [eqEuropeanOptionPricer](https://docs.dolphindb.com/en/Functions/e/eqeuropeanoptionpricer.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\neqEuropeanOptionPricer(instrument, pricingDate, spot, discountCurve, dividendCurve, volSurf, \\[setting])\n\n#### Details\n\nPrices an European equity option.\n\n#### Parameters\n\n**instrument**: An INSTRUMENT scalar or vector specifying the European equity options to be priced. For field requirements, see the Instrument field description.\n\n**pricingDate**: A DATE scalar or vector specifying the pricing date.\n\n**spot**: A numeric scalar or vector specifying the spot price.\n\n**discountCurve**: A MKTDATA scalar or vector specifying the [discount curve (IrYieldCurve)](https://docs.dolphindb.com/en/Functions/p/parseMktData.md#).\n\n**dividendCurve**: A MKTDATA scalar or vector specifying the dividend curve (DividendCurve). This curve is built using `eqDividendCurveBuilder`.\n\n**volSurf**: A VolatilitySurface object specifying the equity option volatility surface. This surface is built using `eqVolatilitySurfaceBuilder`.\n\n**setting** (optional): A dictionary (\\<STRING, BOOL>) specifying whether to calculate option price sensitivities (Greeks). Supported keys:\n\n| Key             | Value                      | Description                                                                                             |\n| --------------- | -------------------------- | ------------------------------------------------------------------------------------------------------- |\n| calcDelta       | Boolean; defaults to false | Whether to calculate Delta, the sensitivity of the option price to the underlying asset price.          |\n| calcGamma       | Boolean; defaults to false | Whether to calculate Gamma, the sensitivity of Delta to the underlying asset price.                     |\n| calcVega        | Boolean; defaults to false | Whether to calculate Vega, the sensitivity of the option price to volatility.                           |\n| calcTheta       | Boolean; defaults to false | Whether to calculate Theta, the sensitivity of the option price to the passage of time.                 |\n| calcRhoIr       | Boolean; defaults to false | Whether to calculate RhoIr, the sensitivity of the option price to the risk-free interest rate.         |\n| calcRhoDividend | Boolean; defaults to false | Whether to calculate RhoDividend, the sensitivity of the option price to changes in the dividend yield. |\n\n#### Returns\n\n* If the *setting* parameter is not specified, returns a DOUBLE scalar indicating the option’s net present value (NPV), i.e., the theoretical option price.\n* If the *setting* parameter is specified, returns a dictionary (\\<STRING, DOUBLE>) containing the option’s NPV and the option price sensitivities represented by the Greeks. For details on Greeks, see the description of the *setting* parameter.\n\n#### Examples\n\n```\n// ================================================================\n// Data Sources:\n//   Spot Price  : akshare fund_etf_hist_sina('sh510050')     → 3.1140\n//   Option Chain: akshare option_risk_indicator_sse('20260213')\n//                 → Option settlement prices reconstructed via Black-Scholes\n//   Rate Curve  : China Money Network  FX-Implied Interest Rate Curve (CNY)\n//                 https://www.chinamoney.com.cn/chinese/bkcurvuiruuh/\n//                 API: POST /ags/ms/cm-u-bk-fx/IuirCurvHis  2026-02-13\n//\n// Target      : Call  strike=3.2000  expiry=2026-03-25\n// ================================================================\n\npricingDate   = 2026.02.13\nreferenceDate = pricingDate\n\n// ------------------------------------------------------------------\n// 1. Spot Price\n// ------------------------------------------------------------------\nspot = 3.1140\n\n// ------------------------------------------------------------------\n// 2. Define the Option Instrument  (near-month ATM / slightly OTM call)\n// ------------------------------------------------------------------\noptionDict = {\n    \"productType\"       : \"Option\",\n    \"optionType\"        : \"EuropeanOption\",\n    \"assetType\"         : \"EqEuropeanOption\",\n    \"notionalCurrency\"  : \"CNY\",\n    \"notionalAmount\"    : 10000,\n    \"strike\"            : 3.2000,\n    \"maturity\"          : 2026.03.25,\n    \"payoffType\"        : \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\"        : \"510050\"\n}\noption = parseInstrument(optionDict)\n\n// ------------------------------------------------------------------\n// 3. Raw Option Chain Data  (used to build dividend curve and vol surface)\n//    Expiry sequence: 2026.02.25 | 2026.03.25 | 2026.06.24 | 2026.09.23\n//    Strike range   : [2.85, 3.60]\n// ------------------------------------------------------------------\ntermDates = [2026.02.25, 2026.03.25, 2026.06.24, 2026.09.23]\n\ncallPrices = matrix(\n    [0.2655, 0.2155, 0.1656, 0.1156, 0.0318, 0.0039, 0.0015, 0.0008, 0.0003, 0.0001],\n    [0.2690, 0.2248, 0.1770, 0.1385, 0.0697, 0.0303, 0.0128, 0.0069, 0.0046, 0.0036],\n    [0.3030, 0.2655, 0.2278, 0.1970, 0.1431, 0.0991, 0.0677, 0.0479, 0.0346, 0.0254],\n    [0.3330, 0.2987, 0.2681, 0.2388, 0.1883, 0.1448, 0.1139, 0.0899, 0.0715, 0.0574]\n)\n\nputPrices = matrix(\n    [0.0004, 0.0009, 0.0021, 0.0045, 0.0218, 0.0939, 0.1901, 0.2896, 0.3908, 0.4916],\n    [0.0125, 0.0165, 0.0229, 0.0316, 0.0616, 0.1250, 0.2029, 0.2967, 0.3962, 0.4948],\n    [0.0396, 0.0507, 0.0634, 0.0798, 0.1253, 0.1814, 0.2499, 0.3321, 0.4175, 0.5077],\n    [0.0651, 0.0798, 0.0973, 0.1180, 0.1662, 0.2250, 0.2952, 0.3651, 0.4508, 0.5342]\n)\n\nstrikes = matrix(\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000],\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000],\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000],\n    [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000]\n)\n\n// ------------------------------------------------------------------\n// 4. Discount Curve  ── China Money Network FX-Implied CNY Rate Curve (2026-02-13)\n//    Source: https://www.chinamoney.com.cn/chinese/bkcurvuiruuh/\n//    Filter: USD.CNY / Shibor / Mean Quote Rate of OTC FX Spot Market / Swap Pips\n//    Field : rmbRateStr (CNY interest rate, %)\n// ------------------------------------------------------------------\ndiscountCurveDict = {\n    \"mktDataType\"       : \"Curve\",\n    \"curveType\"         : \"IrYieldCurve\",\n    \"curveName\"         : \"CNY_FR_007\",\n    \"referenceDate\"     : referenceDate,\n    \"currency\"          : \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\"       : \"Continuous\",\n    \"interpMethod\"      : \"Linear\",\n    \"extrapMethod\"      : \"Flat\",\n    \"dates\"             : [referenceDate + 1, referenceDate + 7, referenceDate + 14, referenceDate + 21, referenceDate + 30, referenceDate + 61, referenceDate + 91, referenceDate + 182, referenceDate + 273, referenceDate + 365, referenceDate + 547, referenceDate + 730, referenceDate + 1095],\n    \"values\"            : [0.016134, 0.016107, 0.016102, 0.016102, 0.016102, 0.016103, 0.016029, 0.015832, 0.015889, 0.015898, 0.015561, 0.015583, 0.015892]\n}\ndiscountCurve = parseMktData(discountCurveDict)\n\n// ------------------------------------------------------------------\n// 5. Dividend Curve  ── Implied via Call-Put Parity\n// ------------------------------------------------------------------\ndividendCurve = eqDividendCurveBuilder(\n    referenceDate, termDates, \"CallPutParity\", ,\n    callPrices, putPrices, strikes, spot, discountCurve,\n    \"Actual365\", \"510050\"\n)\n\n// ------------------------------------------------------------------\n// 6. Volatility Surface  ── SABR model, built from OTM options\n//    Strike < Spot → OTM Put;  Strike >= Spot → OTM Call\n// ------------------------------------------------------------------\noptionExpiries = termDates\n\noptionPrices = matrix(\n    [0.0004, 0.0009, 0.0021, 0.0045, 0.0218, 0.0039, 0.0015, 0.0008, 0.0003, 0.0001],\n    [0.0125, 0.0165, 0.0229, 0.0316, 0.0616, 0.0303, 0.0128, 0.0069, 0.0046, 0.0036],\n    [0.0396, 0.0507, 0.0634, 0.0798, 0.1253, 0.0991, 0.0677, 0.0479, 0.0346, 0.0254],\n    [0.0651, 0.0798, 0.0973, 0.1180, 0.1662, 0.1448, 0.1139, 0.0899, 0.0715, 0.0574]\n)\n\npayoffTypes = matrix(\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"]\n)\n\nvolSurface = eqVolatilitySurfaceBuilder(\n    referenceDate,\n    optionExpiries,\n    strikes,\n    optionPrices,\n    payoffTypes,\n    spot,\n    discountCurve,\n    dividendCurve,\n    \"SABR\",\n    \"50ETF_SABR_20260213\"\n)\n\n// ------------------------------------------------------------------\n// 7. Pricing  ── Single contract NPV\n// ------------------------------------------------------------------\nnpv = eqEuropeanOptionPricer(option, pricingDate, spot, discountCurve, dividendCurve, volSurface)\nprint(\"NPV = \" + string(npv))\n\n// ------------------------------------------------------------------\n// 8. Pricing  ── With Greeks\n// ------------------------------------------------------------------\nsetting = {\n    \"calcDelta\"      : true,\n    \"calcGamma\"      : true,\n    \"calcVega\"       : true,\n    \"calcTheta\"      : true,\n    \"calcRhoIr\"      : true,\n    \"calcRhoDividend\": true\n}\nresult = eqEuropeanOptionPricer(option, pricingDate, spot, discountCurve, dividendCurve, volSurface, setting)\nprint(result)\n\n// ------------------------------------------------------------------\n// 9. Batch Pricing  ── All common strikes expiring 2026-03-25 (Call)\n// ------------------------------------------------------------------\nallStrikes = [2.8500, 2.9000, 2.9500, 3.0000, 3.1000, 3.2000, 3.3000, 3.4000, 3.5000, 3.6000]\nresults = array(DOUBLE, 0)\nfor (k in allStrikes) {\n    iDict = {\n        \"productType\"       : \"Option\",\n        \"optionType\"        : \"EuropeanOption\",\n        \"assetType\"         : \"EqEuropeanOption\",\n        \"notionalCurrency\"  : \"CNY\",\n        \"notionalAmount\"    : 10000,\n        \"strike\"            : k,\n        \"maturity\"          : 2026.03.25,\n        \"payoffType\"        : \"Call\",\n        \"dayCountConvention\": \"Actual365\",\n        \"underlying\"        : \"510050\"\n    }\n    iOpt = parseInstrument(iDict)\n    results.append!(eqEuropeanOptionPricer(iOpt, pricingDate, spot, discountCurve, dividendCurve, volSurface))\n}\nt = table(allStrikes as strike, results as npv)\nprint(t)\n```\n\n#### Instrument Field Description\n\n<table id=\"table_fhn_zwx_f3c\"><thead><tr><th>\n\nField\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFixed value: \"Option\"\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\noptionType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFixed value: \"EuropeanOption\"\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFixed value: “EqEuropeanOption\"\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\nnotionalAmount\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNotional amount\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\nnotionalCurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nNotional currency. Defaults to CNY.\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nContract identifier, e.g. CSI 500 ETF option\n\n510500C2512M04800\n\n</td><td>\n\nNo\n\n</td></tr><tr><td>\n\ndirection\n\n</td><td>\n\nSRTRING\n\n</td><td>\n\nTrade direction: Buy or Sell. Defaults to Buy.\n\n</td><td>\n\nNo\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\nstrike\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nStrike price\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\npayoffType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nEnum. Supported values: Call, Put.\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\nunderlying\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nUnderlying contract code, e.g. 510050.\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nDay count convention. Supported values: \"ActualActualISDA\", \"ActualActualISMA\", \"Actual365\", \"Actual360\".\n\n</td><td>\n\nYes\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nName of the discount curve used for pricing. Defaults to \"CNY\\_FR\\_007\" for CNY deposits.\n\n</td><td>\n\nNo\n\n</td></tr><tr><td>\n\ndividendCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nName of the dividend curve used for pricing.\n\n</td><td>\n\nNo\n\n</td></tr></tbody>\n</table>**Related Functions:** [parseInstrument](../p/parseInstrument.md), [parseMktData](../p/parseMktData.md), [eqDividendCurveBuilder](eqDividendCurveBuilder.md), [eqVolatilitySurfaceBuilder](eqvolatilitysurfacebuilder.md)\n"
    },
    "eqFloat": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqFloat.html",
        "signatures": [
            {
                "full": "eqFloat(X, Y, [precision=9])",
                "name": "eqFloat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[precision=9]",
                        "name": "precision",
                        "optional": true,
                        "default": "9"
                    }
                ]
            }
        ],
        "markdown": "### [eqFloat](https://docs.dolphindb.com/en/Functions/e/eqFloat.html)\n\n\n\n#### Syntax\n\neqFloat(X, Y, \\[precision=9])\n\n#### Details\n\nReturn the element-by-element comparison of *X* and *Y* with the given precision.\n\n#### Parameters\n\n**X** / **Y** is a numeric scalar/vector/matrix. If *X* or *Y* is a vector/matrix, the other is a scalar or a vector/matrix of the same size.\n\n**precision** is a non-negative integer. FLOAT and DOUBLE types are compared up to precision digits after the decimal point.\n\n#### Returns\n\nBOOL type with the same data form as *X*/*Y*.\n\n#### Examples\n\n```\neqFloat(0.1234567891, 0.123456789);\n// output: true\n\neqFloat(0.123456788, 0.123456789);\n// output: false\n\neqFloat(0.123456788 0.123456789 0.1234567891, 0.123456789);\n// output: [false,true,true]\n```\n"
    },
    "eqObj": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqObj.html",
        "signatures": [
            {
                "full": "eqObj(obj1, obj2, [precision])",
                "name": "eqObj",
                "parameters": [
                    {
                        "full": "obj1",
                        "name": "obj1"
                    },
                    {
                        "full": "obj2",
                        "name": "obj2"
                    },
                    {
                        "full": "[precision]",
                        "name": "precision",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [eqObj](https://docs.dolphindb.com/en/Functions/e/eqObj.html)\n\n\n\n#### Syntax\n\neqObj(obj1, obj2, \\[precision])\n\n#### Details\n\nCheck 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 [eq](https://docs.dolphindb.com/en/Functions/e/eq.html).\n\nWhen 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)`.\n\n#### Parameters\n\n**obj1** / **obj2** is a scalar/pair/vector/matrix.\n\n**precision** (optional) is a non-negative integer. FLOAT and DOUBLE types are compared up to precision digits after the decimal point.\n\n#### Returns\n\nA scalar of type BOOL.\n\n#### Examples\n\n```\neqObj(2, 2.0);\n// output: false\n\neq(2, 2.0);\n// output: true\n\neqObj(1.1, 1.2, 0);\n// output: true\n\neqObj(1.1, 1.2, 1);\n// output: true\n\neqObj(1 2 3, 1 2 3);\n// output: true\n\neq(1 2 3, 1 2 3);\n// output: [true,true,true]\n```\n\n`eqObj` cannot be used to compare 2 tables directly. However, we can use the template function [each](https://docs.dolphindb.com/en/Functions/Templates/each.html) to compare the values of each column for 2 tables:\n\n```\nt1=table(1 2 3 as x, 4 5 6 as y);\nt2=table(1 2 3 as x, 4 5 6 as y);\n\nt1.values();\n// output: ([1,2,3],[4,5,6])\n\neach(eqObj, t1.values(), t2.values());\n// output: [true,true]\n```\n"
    },
    "eqPercent": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqPercent.html",
        "signatures": [
            {
                "full": "eqPercent(X, Y, [toleranceLevel=0.0001])",
                "name": "eqPercent",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[toleranceLevel=0.0001]",
                        "name": "toleranceLevel",
                        "optional": true,
                        "default": "0.0001"
                    }
                ]
            }
        ],
        "markdown": "### [eqPercent](https://docs.dolphindb.com/en/Functions/e/eqPercent.html)\n\n\n\n#### Syntax\n\neqPercent(X, Y, \\[toleranceLevel=0.0001])\n\n#### Details\n\nCheck element-wise equality of two inputs *X* and *Y* are equal within the specified *toleranceLevel*.\n\nNote:\n\n* If the type of the input *X* or *Y* is not supported, the function returns the result of `eqObj(X, Y).`\n\n* Null values are not equal to other values.\n\n* Null values of different types are considered equal.\n\n#### Parameters\n\n* **X** / **Y** are two numbers to compare. They must be scalars, vectors, pairs, or matrices of the same shape. Supported data types include BOOL, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE, DECIMAL. Note: *X* and *Y* must be of the same form, and elements in *X* and *Y* can be of different data types.\n* **toleranceLevel** (optional) is a number in (0, 100), representing the tolerable percentage error. The default value is 0.0001. This means the absolute difference between the two elements must not exceed the *toleranceLevel*percentage of the absolute value of *Y*. For example, if *Y* is 1000 and *toleranceLevel*is 0.0001, the allowable error is 1000 \\* 0.0001% = 0.001. Thus, an *X* value between \\[999.999, 1000.001] will be considered equal to *Y*.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\neqPercent((1.9999 2.9999), (2 3))\n// Output: true\n\neqPercent((1.9 2.9), (2 3), 2)\n// Output: false\n```\n\nElements in *X* and *Y* can be of different data types:\n\n```\neqPercent((1.99f 2.99), (2 3h), 2)\n// Output: true\n```\n\nWhen comparing null values:\n\n```\n// Null values are not equal to other values\neqPercent((1.9999 NULL), (2 3))\n// Output: false\n\n// Null values of DOUBLE and VOID types are considered equal\na=double(NULL)\neqPercent(a,NULL)\n// Output: true\n```\n\nWhen an unsupported type is passed, the function returns the result of `eqObj(X, Y)`:\n\n```\neqPercent(2012.06M, 2)\n// Output: false\n```\n"
    },
    "eqProxyVolatilitySurfaceBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqproxyvolatilitysurfacebuilder.html",
        "signatures": [
            {
                "full": "eqProxyVolatilitySurfaceBuilder(referenceDate, proxyExpiries, proxyStrikes, proxyCallPrices, proxyPutPrices, proxySpot, spot, discountCurve, dividendCurve, [model=”SVI”], [surfaceName])",
                "name": "eqProxyVolatilitySurfaceBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "proxyExpiries",
                        "name": "proxyExpiries"
                    },
                    {
                        "full": "proxyStrikes",
                        "name": "proxyStrikes"
                    },
                    {
                        "full": "proxyCallPrices",
                        "name": "proxyCallPrices"
                    },
                    {
                        "full": "proxyPutPrices",
                        "name": "proxyPutPrices"
                    },
                    {
                        "full": "proxySpot",
                        "name": "proxySpot"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "dividendCurve",
                        "name": "dividendCurve"
                    },
                    {
                        "full": "[model=”SVI”]",
                        "name": "model",
                        "optional": true,
                        "default": "”SVI”"
                    },
                    {
                        "full": "[surfaceName]",
                        "name": "surfaceName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [eqProxyVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/e/eqproxyvolatilitysurfacebuilder.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\neqProxyVolatilitySurfaceBuilder(referenceDate, proxyExpiries, proxyStrikes, proxyCallPrices, proxyPutPrices, proxySpot, spot, discountCurve, dividendCurve, \\[model=”SVI”], \\[surfaceName])\n\n#### Details\n\nBuilds an equity proxy volatility surface.\n\n#### Parameters\n\n**referenceDate**: A DATE scalar specifying the reference date.\n\n**proxyExpiries**: A DATE vector specifying the expiries of the proxy option contracts.\n\n**proxyStrikes**: A DOUBLE matrix specifying the strikes of the proxy option contracts. The number of columns must match *proxyExpiries*.\n\n**proxyCallPrices**: A DOUBLE matrix specifying the call prices of the proxy option contracts. The number of columns must match *proxyExpiries*, and the number of rows must match *proxyStrikes*.\n\n**proxyPutPrices**: A DOUBLE matrix specifying the put prices of the proxy option contracts. The number of columns must match *proxyExpiries*, and the number of rows must match *proxyStrikes*.\n\n**proxySpot**: ADOUBLE scalar specifying the spot price of the proxy option.\n\n**spot**: A DOUBLE scalar specifying the spot price of the option being priced.\n\n**discountCurve**: A MKTDATA scalar or vector specifying the [discount curve (IrYieldCurve)](https://docs.dolphindb.com/en/Functions/p/parseMktData.md#).\n\n**dividendCurve**: A MKTDATA scalar or vector specifying the dividend curve (DividendCurve). This curve is built using `eqDividendCurveBuilder`.\n\n**model** (optional): A STRING scalar specifying the model used to construct the volatility smile. Default is \"SVI\". Supported values: \"SABR\", \"Linear\", \"CubicSpline\", \"SVI\".\n\n**surfaceName** (optional): A STRING scalar specifying the name of the surface.\n\n#### Returns\n\nA VolatilitySurface object.\n\n#### Examples\n\n```\nreferenceDate = 2025.11.12\n\n// parse For discount curve: CNY_FR_007\n\ndiscountCurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_FR_007\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": [\n        2025.11.13, 2025.11.19, 2025.11.26, 2025.12.03, 2025.12.12,\n        2026.01.12, 2026.02.12, 2026.05.12, 2026.08.12, 2026.11.12,\n        2027.05.12, 2027.11.12, 2028.11.12\n    ],\n    \"values\":[\n        0.015219, 0.015311, 0.015668, 0.015948, 0.016003,\n        0.015557, 0.015474, 0.015278, 0.01517, 0.01515,\n        0.015306, 0.015462, 0.015716\n    ]\n}\ndiscountCurve = parseMktData(discountCurveDict)\n\n// build eq dividend curve\n\nspot = 7.285\n\nterm_dates = [2026.01.28, 2026.03.25, 2026.06.23, 2026.12.23]\n\ncall_prices = matrix(\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.3078, 0.1618, 0.0730, 0.0318, 0.0141, 0.0073],\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.3421, 0.2235, 0.1388, 0.0898, 0.0544, 0.0362],\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.3901, 0.2851, 0.2087, 0.1495, 0.1083, 0.0788],\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.2850, 0.0945, 0.0168, 0.0031, 0.0016, 0.0012]\n)\n\nput_prices = matrix(\n    [0.0040, 0.0086, 0.0189, 0.0408, 0.0938, 0.1934, 0.3500, 0.5638, 0.7947, 1.0380],\n    [0.0279, 0.0493, 0.0847, 0.1428, 0.2354, 0.3668, 0.5289, 0.7182, 0.9429, 1.1685],\n    [0.1000, 0.1525, 0.2224, 0.3175, 0.4276, 0.5790, 0.7471, 0.9336, 1.1392, 1.3555],\n    [0.0012, 0.0013, 0.0021, 0.0048, 0.0139, 0.0710, 0.2414, 0.4752, 0.7342, 0.9793]\n)\n\nstrikes = matrix(\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25],\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25],\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25],\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25]\n)\n\ndividendCurve = eqDividendCurveBuilder(referenceDate, term_dates, \"CallPutParity\", ,\n    call_prices, put_prices, strikes, spot, discountCurve, \"Actual365\");\n\n// build eq proxy volatility surface\n\nexpiries = [2026.01.28, 2026.03.25, 2026.06.23, 2026.12.23]\n\ncall_prices = matrix(\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.3078, 0.1618, 0.0730, 0.0318, 0.0141, 0.0073],\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.3421, 0.2235, 0.1388, 0.0898, 0.0544, 0.0362],\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.3901, 0.2851, 0.2087, 0.1495, 0.1083, 0.0788],\n    [1.2850, 1.0350, 0.7850, 0.5350, 0.2850, 0.0945, 0.0168, 0.0031, 0.0016, 0.0012]\n)\n\nput_prices = matrix(\n    [0.0040, 0.0086, 0.0189, 0.0408, 0.0938, 0.1934, 0.3500, 0.5638, 0.7947, 1.0380],\n    [0.0279, 0.0493, 0.0847, 0.1428, 0.2354, 0.3668, 0.5289, 0.7182, 0.9429, 1.1685],\n    [0.1000, 0.1525, 0.2224, 0.3175, 0.4276, 0.5790, 0.7471, 0.9336, 1.1392, 1.3555],\n    [0.0012, 0.0013, 0.0021, 0.0048, 0.0139, 0.0710, 0.2414, 0.4752, 0.7342, 0.9793]\n)\n\nstrikes = matrix(\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25],\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25],\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25],\n    [6.00, 6.25, 6.50, 6.75, 7.00, 7.25, 7.50, 7.75, 8.00, 8.25]\n)\n\nproxy_spot = 7.285\nspot = 7169.79\n\nsurface = eqProxyVolatilitySurfaceBuilder(referenceDate, expiries, strikes,\n    call_prices, put_prices, proxy_spot, spot, discountCurve, dividendCurve , \"SVI\")\nprint(surface)\n```\n\n**Related Functions:** [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html), [eqDividendCurveBuilder](https://docs.dolphindb.com/en/Functions/e/eqDividendCurveBuilder.html)\n"
    },
    "eqVolatilitySurfaceBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eqvolatilitysurfacebuilder.html",
        "signatures": [
            {
                "full": "eqVolatilitySurfaceBuilder(referenceDate, optionExpiries, strikes, optionPrices, payoffTypes, spot, discountCurve, dividendCurve, [model='SVI'], [surfaceName])",
                "name": "eqVolatilitySurfaceBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "optionExpiries",
                        "name": "optionExpiries"
                    },
                    {
                        "full": "strikes",
                        "name": "strikes"
                    },
                    {
                        "full": "optionPrices",
                        "name": "optionPrices"
                    },
                    {
                        "full": "payoffTypes",
                        "name": "payoffTypes"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "dividendCurve",
                        "name": "dividendCurve"
                    },
                    {
                        "full": "[model='SVI']",
                        "name": "model",
                        "optional": true,
                        "default": "'SVI'"
                    },
                    {
                        "full": "[surfaceName]",
                        "name": "surfaceName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [eqVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/e/eqvolatilitysurfacebuilder.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\neqVolatilitySurfaceBuilder(referenceDate, optionExpiries, strikes, optionPrices, payoffTypes, spot, discountCurve, dividendCurve, \\[model='SVI'], \\[surfaceName])\n\n#### Details\n\nConstructs an equity option volatility surface.\n\n#### Parameters\n\n**referenceDate**: A DATE scalar specifying the reference date.\n\n**optionExpiries**: A DATE vector specifying the option expiries.\n\n**strikes**: A DOUBLE matrix specifying the option strikes. The number of columns must be the same as the length of *optionExpiries* .\n\n**optionPrices**: A DOUBLE matrix specifying the option prices. The number of columns must be the same as the length of *optionExpiries* .\n\n**payoffTypes**: A STRING matrix specifying the option payoff types. The number of columns must be the same as the length of *optionExpiries* . Supported values include \"Call\" and \"Put\". **Note:** *strikes* , *optionPrices* , and *payoffTypes* must have the same shape.\n\n**spot**: ADOUBLE scalar specifying the spot price.\n\n**discountCurve**: An IrYieldCurve object specifying the discount curve.\n\n**dividendCurve**: A DividendCurve object specifying the underlying dividend curve.\n\n**model** (optional): A STRING scalar specifying the model used to build the volatility smile. Valid values: \"SVI\" (default), \"SABR\", \"Linear\", \"CubicSpline\".\n\n**surfaceName** (optional): A STRING scalar specifying the surface name.\n\n#### Returns\n\nA VolatilitySurface object.\n\n#### Examples\n\nThe following code demonstrates the process of constructing the volatility surface for options based on the STAR Market 50 ETF (588080.SH).\n\n```\nreferenceDate = 2026.02.11\nspot = 1.5007\n\n// 1. Term Structure\ntermDates = [2026.02.25, 2026.03.25, 2026.06.24, 2026.09.23]\n\n// 2. Raw Data Matrices (Aligned)\ncallPrices = matrix(\n    [0.2402, 0.1908, 0.1415, 0.0927, 0.0496, 0.0199, 0.0075, 0.0032, 0.0014, 0.0010, 0.0007, 0.0002],\n    [0.2398, 0.1956, 0.1516, 0.1095, 0.0780, 0.0530, 0.0347, 0.0232, 0.0152, 0.0101, 0.0069, 0.0043],\n    [0.2537, 0.2137, 0.1803, 0.1494, 0.1252, 0.1051, 0.0871, 0.0717, 0.0597, 0.0500, 0.0421, 0.0361],\n    [0.2730, 0.2442, 0.2086, 0.1816, 0.1676, 0.1439, 0.1301, 0.1099, 0.0961, 0.0848, 0.0748, 0.0663]\n)\nputPrices = matrix(\n    [0.0003, 0.0003, 0.0004, 0.0018, 0.0085, 0.0297, 0.0671, 0.1130, 0.1601, 0.2084, 0.2609, 0.3124],\n    [0.0033, 0.0062, 0.0114, 0.0215, 0.0383, 0.0621, 0.0947, 0.1331, 0.1767, 0.2114, 0.2565, 0.3032],\n    [0.0234, 0.0349, 0.0505, 0.0713, 0.0936, 0.1237, 0.1562, 0.1919, 0.2218, 0.2610, 0.3010, 0.3437],\n    [0.0445, 0.0640, 0.0808, 0.1062, 0.1312, 0.1615, 0.1882, 0.2187, 0.2567, 0.2937, 0.3323, 0.3777]\n)\nstrikes = matrix(\n    [1.2500, 1.3000, 1.3500, 1.4000, 1.4500, 1.5000, 1.5500, 1.6000, 1.6500, 1.7000, 1.7500, 1.8000],\n    [1.2500, 1.3000, 1.3500, 1.4000, 1.4500, 1.5000, 1.5500, 1.6000, 1.6500, 1.7000, 1.7500, 1.8000],\n    [1.2500, 1.3000, 1.3500, 1.4000, 1.4500, 1.5000, 1.5500, 1.6000, 1.6500, 1.7000, 1.7500, 1.8000],\n    [1.2500, 1.3000, 1.3500, 1.4000, 1.4500, 1.5000, 1.5500, 1.6000, 1.6500, 1.7000, 1.7500, 1.8000]\n)\n\n// 3. Discount Curve \ndiscountCurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_RF\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": [referenceDate + 1, referenceDate + 3650],\n    \"values\":[0.02, 0.02]\n}\ndiscountCurve = parseMktData(discountCurveDict)\n\n// 4. Implied Dividend Curve\n// Using Call-Put Parity on the full matrices\ndividendCurve = eqDividendCurveBuilder(\n    referenceDate, termDates, \"CallPutParity\", ,\n    callPrices, putPrices, strikes, spot, discountCurve, \"Actual365\"\n)\n\n// 5. Volatility Surface Construction Data\n// Selecting OTM options: Puts for Low Strikes, Calls for High Strikes\noptionExpiries = termDates\noptionPrices = matrix(\n    [0.0003, 0.0003, 0.0004, 0.0018, 0.0085, 0.0297, 0.0075, 0.0032, 0.0014, 0.0010, 0.0007, 0.0002],\n    [0.0033, 0.0062, 0.0114, 0.0215, 0.0383, 0.0621, 0.0347, 0.0232, 0.0152, 0.0101, 0.0069, 0.0043],\n    [0.0234, 0.0349, 0.0505, 0.0713, 0.0936, 0.1237, 0.0871, 0.0717, 0.0597, 0.0500, 0.0421, 0.0361],\n    [0.0445, 0.0640, 0.0808, 0.1062, 0.1312, 0.1615, 0.1301, 0.1099, 0.0961, 0.0848, 0.0748, 0.0663]\n)\npayoffTypes = matrix(\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"],\n    [\"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Put\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\", \"Call\"]\n)\n\n// 6. Build Surface.\nsurf = eqVolatilitySurfaceBuilder(\n        referenceDate,\n        optionExpiries,\n        strikes,        // Matrix\n        optionPrices,   // Matrix (OTM)\n        payoffTypes,    // Matrix (\"Call\"/\"Put\")\n        spot,\n        discountCurve,\n        dividendCurve,\n        \"SABR\",         // Model\n        \"588080.SH\"     // Name\n)\nprint(surf)\n\n// 波动率曲面可视化\n\n\ndts = (0..20)*0.05\nks = (0..40)*((max(strikes[0])-min(strikes[0]))\\40)+min(strikes[0])\nm = optionVolPredict(surf, dts, ks).rename!(dts, ks)\n\n\nplot(\n    m,\n    title=[\"Vol Surface\", \"K\", \"T\", \"vol\"],\n    chartType=SURFACE)\n    \n```\n\n**Related Functions:** [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html), [eqDividendCurveBuilder](https://docs.dolphindb.com/en/Functions/e/eqDividendCurveBuilder.html)\n"
    },
    "erase!": {
        "url": "https://docs.dolphindb.com/en/Functions/e/erase!.html",
        "signatures": [
            {
                "full": "erase!(obj, key|filter)",
                "name": "erase!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "key|filter",
                        "name": "key|filter"
                    }
                ]
            }
        ],
        "markdown": "### [erase!](https://docs.dolphindb.com/en/Functions/e/erase!.html)\n\n\n\n#### Syntax\n\nerase!(obj, key|filter)\n\n#### Details\n\nEliminate elements from a set, or members from a dictionary, or rows from a table.\n\n#### Parameters\n\n**obj** is a set/dictionary/table.\n\n**key** | **filter** is the elements to be deleted for a set; the keys of the members to be deleted for a dictionary; a piece of meta code with filtering conditions for a table. For details about meta code, please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n#### Returns\n\nThe modified set/dictionary/table.\n\n#### Examples\n\nOn a set:\n\n```\ny=set(8 9 4 6);\ny;\n// output: set(6,4,9,8)\ny.erase!(6);\n// output: set(4,9,8)\nerase!(y, 9 8);\n// output: set(4)\n```\n\nOn a dictionary:\n\n```\nx=1..6;\ny=11..16;\nz=dict(x,y);\nz;\n/* output\n6->16\n5->15\n4->14\n3->13\n2->12\n1->11\n*/\n\nerase!(z, 1..4);\n/* output\n6->16\n5->15\n*/\n```\n\nOn a table:\n\n```\nx=1..10;\ny=11..20;\nt=table(x,y);\n\nerase!(t, <x<=3>);\n```\n\n| x  | y  |\n| -- | -- |\n| 4  | 14 |\n| 5  | 15 |\n| 6  | 16 |\n| 7  | 17 |\n| 8  | 18 |\n| 9  | 19 |\n| 10 | 20 |\n\n```\nerase!(t, <x<=9 and y>=15>);\n```\n\n| x  | y  |\n| -- | -- |\n| 4  | 14 |\n| 10 | 20 |\n"
    },
    "esd": {
        "url": "https://docs.dolphindb.com/en/Functions/e/esd.html",
        "signatures": [
            {
                "full": "esd(data, [hybrid], [maxAnomalies], [alpha])",
                "name": "esd",
                "parameters": [
                    {
                        "full": "data",
                        "name": "data"
                    },
                    {
                        "full": "[hybrid]",
                        "name": "hybrid",
                        "optional": true
                    },
                    {
                        "full": "[maxAnomalies]",
                        "name": "maxAnomalies",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [esd](https://docs.dolphindb.com/en/Functions/e/esd.html)\n\n\n\n#### Syntax\n\nesd(data, \\[hybrid], \\[maxAnomalies], \\[alpha])\n\n#### Details\n\nConduct anomaly detection with the Extreme Studentized Deviate test (ESD).\n\n#### Parameters\n\n**data** is a numeric vector.\n\n**hybrid** (optional) is a Boolean value indicating whether to use median and median absolute deviation to replace mean and standard deviation. The results are more robust if *hybrid*=true. The default value is false.\n\n**maxAnomalies** (optional) is a positive integer or a floating-point number between 0 and 0.5. The default value is 0.1.\n\n* If *maxAnomalies* is a positive integer, it must be smaller than the size of data. It indicates the upper bound of the number of anomalies.\n\n* If *maxAnomalies* is a floating-point number between 0 and 0.5, the upper bound of the number of anomalies is `int(size(data) * maxAnomalies)`.\n\n**alpha** (optional) is a positive number indicating the significance level of the statistical test. A larger *alpha* means a higher likelihood of detecting anomalies.\n\n#### Returns\n\nA table with 2 columns where column index records the subscript of anomalies in data and column anoms are the anomaly values.\n\n#### Examples\n\n```\nn = 1000\nts = rand(10.0, n)\nts[500 600 700 999] += 20\nesd(ts);\n```\n\n| index | anoms     |\n| ----- | --------- |\n| 600   | 29.815742 |\n| 700   | 25.517493 |\n| 500   | 25.17515  |\n| 999   | 24.748516 |\n"
    },
    "euclidean": {
        "url": "https://docs.dolphindb.com/en/Functions/e/euclidean.html",
        "signatures": [
            {
                "full": "euclidean(X, Y)",
                "name": "euclidean",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [euclidean](https://docs.dolphindb.com/en/Functions/e/euclidean.html)\n\n\n\n#### Syntax\n\neuclidean(X, Y)\n\n#### Details\n\nIf *X* and *Y* are scalars or vectors, return the result of their Euclidean distance.\n\nIf *X* or *Y* is a matrix, return a vector that is the result of the Euclidean distance between elements in each column. Note that if both *X* and *Y* are indexed matrices or indexed series, return the results of rows with the same label. Rows with different labels will be ignored.\n\nAs with all other aggregate functions, null values are ignored in the calculation.\n\n#### Parameters\n\n**X** and **Y** are numeric scalars, or vectors/matrices of the same size.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\na=[100, 0, 0]\nb=[0, 51, NULL]\neuclidean(a,b)\n// output: 112.254176\n\ns1=indexedSeries(1 2 4, 10.4 11.2 9)\ns2=indexedSeries(1 2 5, 23.5 31.2 26)\neuclidean(s1,s2)\n// output: 23.9084\n\nm=matrix(23 56 47, 112 94 59)\neuclidean(a,m)\n// output: [106.1791,111.6288]\n\nm1=matrix(11 15 89, 52 41 63)\neuclidean(m,m1)\n// output: [59.9083,80.1561]\n\nm.rename!(2020.01.01..2020.01.03, `A`B)\nm.setIndexedMatrix!()\nm1.rename!(2020.01.01 2020.01.03 2020.01.04, `A`B)\nm1.setIndexedMatrix!()\neuclidean(m,m1)\n// output: [34.176,62.6418]\n```\n\nRelated functions: [rowEuclidean](https://docs.dolphindb.com/en/Functions/r/rowEuclidean.html), [seuclidean](https://docs.dolphindb.com/en/Functions/s/seuclidean.html)\n"
    },
    "eval": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eval.html",
        "signatures": [
            {
                "full": "eval(X)",
                "name": "eval",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [eval](https://docs.dolphindb.com/en/Functions/e/eval.html)\n\n\n\n#### Syntax\n\neval(X)\n\n#### Details\n\nEvaluates the given metacode.\n\n**Note:**\n\n* DolphinDB `eval` executes DolphinDB metacode.\n* Python's built-in [eval](https://docs.python.org/3/library/functions.html#eval) executes a Python expression string.\n* [pandas.eval](https://pandas.pydata.org/docs/reference/api/pandas.eval.html) executes expression strings on pandas objects.\n\n#### Parameters\n\n**X** is metacode.\n\n#### Examples\n\n```\neval(<1+2>);\n// output: 3\n\neval(<1+2+3=10>);\n// output: 0\n\neval(expr(6,<,8));\n// output: 1\n\neval(expr(sum, 1 2 3));\n// output: 6\n\na=6; b=9;\neval(expr(<a>,+,<b>));\n// output: 15\n```\n"
    },
    "evalTimer": {
        "url": "https://docs.dolphindb.com/en/Functions/e/evalTimer.html",
        "signatures": [
            {
                "full": "evalTimer(funcs, [count=1])",
                "name": "evalTimer",
                "parameters": [
                    {
                        "full": "funcs",
                        "name": "funcs"
                    },
                    {
                        "full": "[count=1]",
                        "name": "count",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [evalTimer](https://docs.dolphindb.com/en/Functions/e/evalTimer.html)\n\n\n\n#### Syntax\n\nevalTimer(funcs, \\[count=1])\n\n#### Details\n\nReturn the execution time of the specified functions in units of milliseconds. If *funcs* is a tuple of functions, return the amount of time to execute these functions consecutively.\n\nThe difference between statement [timer](https://docs.dolphindb.com/en/Programming/ProgrammingStatements/timer.html) and function `evalTimer`:\n\n* the input of `timer` is a statement block while the input of `evalTimer` can only be functions. To use `evalTimer` to get execution time of a statement block, we need to rewrite the statement block as a user-defined function.\n\n* `timer` returns a message which cannot be assigned to a variable; `evalTimer` returns a scalar that can be assigned to a variable.\n\n#### Parameters\n\n**funcs** is a function or a tuple of functions with no parameters.\n\n**count** (optional) is a positive number indicating the number of times funcs will be executed. The default value is 1.\n\n#### Returns\n\nA scalar of type DOUBLE.\n\n#### Examples\n\n```\nx=rand(10.0, 1000000)\nevalTimer(dot{x,2},10);\n// output: 39.609375\n\nevalTimer(sort{x},10);\n// output: 837.542702\n\nevalTimer([dot{x,2},sort{x}],10)\n// output: 870.065348\n```\n"
    },
    "ewmCorr": {
        "url": "https://docs.dolphindb.com/en/Functions/e/ewmCorr.html",
        "signatures": [
            {
                "full": "ewmCorr(X, [com], [span], [halfLife], [alpha], [minPeriods=0], [adjust=true], [ignoreNA=false], [other], [bias=false])",
                "name": "ewmCorr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[com]",
                        "name": "com",
                        "optional": true
                    },
                    {
                        "full": "[span]",
                        "name": "span",
                        "optional": true
                    },
                    {
                        "full": "[halfLife]",
                        "name": "halfLife",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    },
                    {
                        "full": "[minPeriods=0]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[adjust=true]",
                        "name": "adjust",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=false]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[other]",
                        "name": "other",
                        "optional": true
                    },
                    {
                        "full": "[bias=false]",
                        "name": "bias",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [ewmCorr](https://docs.dolphindb.com/en/Functions/e/ewmCorr.html)\n\n\n\n#### Syntax\n\newmCorr(X, \\[com], \\[span], \\[halfLife], \\[alpha], \\[minPeriods=0], \\[adjust=true], \\[ignoreNA=false], \\[other], \\[bias=false])\n\n#### Details\n\nCalculate exponentially weighted moving correlation of *X* and *other*.\n\nExactly one of the parameters *com*, *span*, *halfLife* and *alpha* must be specified.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**com** (optional) is a non-negative floating number and specifies decay in terms of center of mass. alpha=1/(1+com) where alpha is the decay factor.\n\n**span** (optional) is a positive floating number larger than 1 and specifies decay in terms of span. alpha=2/(span+1).\n\n**halfLife** (optional) is a positive floating number and specifies decay in terms of half-life. alpha=1-exp(log(0.5)/halfLife).\n\n**alpha** (optional) is a floating number between 0 and 1 and directly specifies decay.\n\n**minPeriods** (optional) is an integer indicating the minimum number of observations in window required to have a value (otherwise result is NULL). The default value is 0.\n\n**adjust** (optional) is a Boolean value. The default value is true.\n\n* If *adjust*=true, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2), …, 1-alpha, 1 divided by their sum.\n\n* If *adjust*=false, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2)\\*alpha, (1-alpha)^(n-3)\\*alpha^2,…, (1-alpha)\\*alpha, alpha.\n\n**ignoreNA** (optional) is a Boolean value indicating whether to ignore missing values. The defaut value is false.\n\n**other** (optional) is a numeric vector of the same length as *X*.\n\n**bias** (optional) is a Boolean value indicating whether the result is biased. The default value is false, meaning the bias is corrected.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\na=[0,1,2,int(),4]\nb=[2,4,3,6,5]\newmCorr(X=a,other=b,com=0.5);\n// output: [,1.0000,-0.0533,-0.0533,0.9146]\n\newmCorr(X=a,other=b,com=0.5,ignoreNA=true);\n// output: [,1.0000,-0.0533,-0.0533,0.8934]\n\nn = 20\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nt1 = table(n:0, colNames, colTypes)\ninsert into t1 values(09:30:00.001,`AAPL,100,56.5)\ninsert into t1 values(09:30:00.001,`AAPL,200,30.5)\ninsert into t1 values(09:30:00.001,`DELL,150,35.5)\ninsert into t1 values(09:30:00.001,`DELL,170,60.5)\ninsert into t1 values(09:30:00.001,`DELL,130,40.5)\nb=[2,4,3,6,5]\newmCorr(X=t1,other=b,com=0.5);\n```\n\n<table id=\"table_bnp_rxm_hzb\"><tbody><tr><td id=\"example_table_cgw_thn_ryb_entry_1\" align=\"left\">\n\ntime\n\n</td><td id=\"example_table_cgw_thn_ryb_entry_2\" align=\"left\">\n\nsym\n\n</td><td id=\"example_table_cgw_thn_ryb_entry_3\" align=\"left\">\n\nqty\n\n</td><td id=\"example_table_cgw_thn_ryb_entry_4\" align=\"left\">\n\nprice\n\n</td></tr><tr><td align=\"left\">\n\n09:30:00.001\n\n</td><td align=\"left\">\n\nAAPL\n\n</td><td align=\"left\">\n\n \n\n</td><td align=\"left\">\n\n \n\n</td></tr><tr><td align=\"left\">\n\n09:30:00.001\n\n</td><td align=\"left\">\n\nAAPL\n\n</td><td align=\"left\">\n\n1.0000\n\n</td><td align=\"left\">\n\n-1.0000\n\n</td></tr><tr><td align=\"left\">\n\n09:30:00.001\n\n</td><td align=\"left\">\n\nDELL\n\n</td><td align=\"left\">\n\n1.0000\n\n</td><td align=\"left\">\n\n-0.8481\n\n</td></tr><tr><td align=\"left\">\n\n09:30:00.001\n\n</td><td align=\"left\">\n\nDELL\n\n</td><td align=\"left\">\n\n0.5536\n\n</td><td align=\"left\">\n\n0.8747\n\n</td></tr><tr><td align=\"left\">\n\n09:30:00.001\n\n</td><td align=\"left\">\n\nDELL\n\n</td><td align=\"left\">\n\n0.3064\n\n</td><td align=\"left\">\n\n0.7050\n\n</td></tr></tbody>\n</table>\n"
    },
    "ewmCov": {
        "url": "https://docs.dolphindb.com/en/Functions/e/ewmCov.html",
        "signatures": [
            {
                "full": "ewmCov(X, [com], [span], [halfLife], [alpha], [minPeriods=0], [adjust=true], [ignoreNA=false], [other], [bias=false])",
                "name": "ewmCov",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[com]",
                        "name": "com",
                        "optional": true
                    },
                    {
                        "full": "[span]",
                        "name": "span",
                        "optional": true
                    },
                    {
                        "full": "[halfLife]",
                        "name": "halfLife",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    },
                    {
                        "full": "[minPeriods=0]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[adjust=true]",
                        "name": "adjust",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=false]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[other]",
                        "name": "other",
                        "optional": true
                    },
                    {
                        "full": "[bias=false]",
                        "name": "bias",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [ewmCov](https://docs.dolphindb.com/en/Functions/e/ewmCov.html)\n\n\n\n#### Syntax\n\newmCov(X, \\[com], \\[span], \\[halfLife], \\[alpha], \\[minPeriods=0], \\[adjust=true], \\[ignoreNA=false], \\[other], \\[bias=false])\n\n#### Details\n\nCalculate exponentially weighted moving covariance of *X* and *other*.\n\nExactly one of the parameters *com*, *span*, *halfLife* and *alpha* must be specified.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**com** (optional) is a non-negative floating number and specifies decay in terms of center of mass. alpha=1/(1+com) where alpha is the decay factor.\n\n**span** (optional) is a positive floating number larger than 1 and specifies decay in terms of span. alpha=2/(span+1).\n\n**halfLife** (optional) is a positive floating number and specifies decay in terms of half-life. alpha=1-exp(log(0.5)/halfLife).\n\n**alpha** (optional) is a floating number between 0 and 1 and directly specifies decay.\n\n**minPeriods** (optional) is an integer indicating the minimum number of observations in window required to have a value (otherwise result is NULL). The default value is 0.\n\n**adjust** (optional) is a Boolean value. The default value is true.\n\n* If *adjust*=true, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2), …, 1-alpha, 1 divided by their sum.\n\n* If *adjust*=false, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2)\\*alpha, (1-alpha)^(n-3)\\*alpha^2,…, (1-alpha)\\*alpha, alpha.\n\n**ignoreNA** (optional) is a Boolean value indicating whether to ignore missing values. The defaut value is false.\n\n**other** (optional) is a numeric vector of the same length as *X*.\n\n**bias** (optional) is a Boolean value indicating whether the result is biased. The default value is false, meaning the bias is corrected.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\na=[0,1,2,int(),4]\nb=[2,4,3,6,5]\newmCov(X=a,other=b,com=0.5);\n// output: [,1,-0.038462,-0.038462,2.112637]\n\newmCov(X=a,other=b,com=0.5,ignoreNA=true);\n// output: [,1,-0.038462,-0.038462,1.969231]\n\nn = 20\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nt1 = table(n:0, colNames, colTypes)\ninsert into t1 values(09:30:00.001,`AAPL,100,56.5)\ninsert into t1 values(09:30:00.001,`AAPL,200,30.5)\ninsert into t1 values(09:30:00.001,`DELL,150,35.5)\ninsert into t1 values(09:30:00.001,`DELL,170,60.5)\ninsert into t1 values(09:30:00.001,`DELL,130,40.5)\nb=[2,4,3,6,5]\newmCov(X=t1,other=b,com=0.5);\n```\n\n| time         | sym  | qty     | price   |\n| ------------ | ---- | ------- | ------- |\n| 09:30:00.001 | AAPL |         |         |\n| 09:30:00.001 | AAPL | 100     | -26     |\n| 09:30:00.001 | DELL | 30.7692 | -6.1538 |\n| 09:30:00.001 | DELL | 25.2308 | 29.5346 |\n| 09:30:00.001 | DELL | 9.405   | 10.0012 |\n"
    },
    "ewmMean": {
        "url": "https://docs.dolphindb.com/en/Functions/e/ewmMean.html",
        "signatures": [
            {
                "full": "ewmMean(X, [com], [span], [halfLife], [alpha], [minPeriods=0], [adjust=true], [ignoreNA=false], [times])",
                "name": "ewmMean",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[com]",
                        "name": "com",
                        "optional": true
                    },
                    {
                        "full": "[span]",
                        "name": "span",
                        "optional": true
                    },
                    {
                        "full": "[halfLife]",
                        "name": "halfLife",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    },
                    {
                        "full": "[minPeriods=0]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[adjust=true]",
                        "name": "adjust",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=false]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[times]",
                        "name": "times",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ewmMean](https://docs.dolphindb.com/en/Functions/e/ewmMean.html)\n\n\n\n#### Syntax\n\newmMean(X, \\[com], \\[span], \\[halfLife], \\[alpha], \\[minPeriods=0], \\[adjust=true], \\[ignoreNA=false], \\[times])\n\n#### Details\n\nCalculate exponentially weighted moving average.\n\nExactly one of the parameters *com*, *span*, *halfLife* and *alpha* must be specified.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**com** (optional) is a non-negative floating number and specifies decay in terms of center of mass. alpha=1/(1+com) where alpha is the decay factor.\n\n**span** (optional) is a positive floating number larger than 1 and specifies decay in terms of span. alpha=2/(span+1).\n\n**halfLife** (optional) is a positive floating number or a scalar of DURATION type specifying the half-life. alpha=1-exp(ln(2)/halfLife). If *halfLife* is a DURATION, the *times* must be specified with the same time unit.\n\n**alpha** (optional) is a floating number between 0 and 1 and directly specifies decay.\n\n**minPeriods** (optional) is an integer indicating the minimum number of observations in window required to have a value (otherwise result is NULL). The default value is 0.\n\n**adjust** (optional) is a Boolean value. The default value is true.\n\n* If *adjust*=true, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2), …, 1-alpha, 1 divided by their sum.\n\n* If *adjust*=false, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2)\\*alpha, (1-alpha)^(n-3)\\*alpha^2,…, (1-alpha)\\*alpha, alpha.\n\n**ignoreNA** (optional) is a Boolean value indicating whether to ignore null values when calculating weights. The default value is false.\n\nTake \\[x0, NULL, x2] for example,\n\n* If *ignoreNA* = true,\n\n  * *adjust* = false, the weights of x0 and x2 are 1-α and α.\n\n  * *adjust* = true, the weights of x0 and x2 are 1-α and 1.\n\n* If *ignoreNA* = false,\n\n  * *adjust* = false, the weights of x0 and x2 are (1-α)2 and α.\n\n  * *adjust* = true, the weights of x0 and x2 are (1-α)2 and 1.\n\n**times** (optional) is a strictly increasing vector of temporal type, with the same length as *X*. Required only when *halfLife* is a DURATION, and must have the same unit as *halfLife*.\n\nNote: If *halfLife* uses B (business day) or a trading calendar unit, *times* must be a vector of DATE type.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\na=[0,1,2,int(),4]\newmMean(X=a,com=0.5);\n// output: [0,0.75,1.615385,1.615385,3.670213]\n        \newmMean(X=a,com=0.5,ignoreNA=true);\n// output: [0,0.75,1.615385,1.615385,3.225] \n       \newmMean(a, halfLife = 4d, times=[2019.12.31, 2020.01.03, 2020.01.10, 2020.01.15, 2020.01.17])\n// output: [0,0.627115,1.558466,1.558466,3.256043]  \n\n// Specify halfLife using a trading calendar.\newmMean(a, halfLife = 4XNYS, times=[2019.12.31, 2020.01.03, 2020.01.10, 2020.01.15, 2020.01.17])\n// output: [0,0.585786,1.409080,1.409080,2.913483]\n  \n// Specify halfLife using a business day.\newmMean(a, halfLife = 4B, times=[2019.12.31, 2020.01.03, 2020.01.10, 2020.01.15, 2020.01.17])\n// output: [0,0.627115,1.448981,1.448981,2.947520] \n\nn = 20\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nt1 = table(n:0, colNames, colTypes)\ninsert into t1 values(09:30:00.001,`AAPL,100,56.5)\ninsert into t1 values(09:30:00.001,`AAPL,200,30.5)\ninsert into t1 values(09:30:00.001,`DELL,150,35.5)\ninsert into t1 values(09:30:00.001,`DELL,170,60.5)\ninsert into t1 values(09:30:00.001,`DELL,130,40.5)\nb=[2,4,3,6,5]\newmMean(X=t1,com=0.5);\n```\n\n| time         | sym  | qty      | price   |\n| ------------ | ---- | -------- | ------- |\n| 09:30:00.001 | AAPL | 100      | 56.5    |\n| 09:30:00.001 | AAPL | 175      | 37      |\n| 09:30:00.001 | DELL | 157.6923 | 35.9615 |\n| 09:30:00.001 | DELL | 166      | 52.525  |\n| 09:30:00.001 | DELL | 141.9008 | 44.4752 |\n"
    },
    "ewmStd": {
        "url": "https://docs.dolphindb.com/en/Functions/e/ewmStd.html",
        "signatures": [
            {
                "full": "ewmStd(X, [com], [span], [halfLife], [alpha], [minPeriods=0], [adjust=true], [ignoreNA=false], [bias=false])",
                "name": "ewmStd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[com]",
                        "name": "com",
                        "optional": true
                    },
                    {
                        "full": "[span]",
                        "name": "span",
                        "optional": true
                    },
                    {
                        "full": "[halfLife]",
                        "name": "halfLife",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    },
                    {
                        "full": "[minPeriods=0]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[adjust=true]",
                        "name": "adjust",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=false]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[bias=false]",
                        "name": "bias",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [ewmStd](https://docs.dolphindb.com/en/Functions/e/ewmStd.html)\n\n\n\n#### Syntax\n\newmStd(X, \\[com], \\[span], \\[halfLife], \\[alpha], \\[minPeriods=0], \\[adjust=true], \\[ignoreNA=false], \\[bias=false])\n\n#### Details\n\nCalculate exponentially weighted moving standard deviation.\n\nExactly one of the parameters *com*, *span*, *halfLife* and *alpha* must be specified.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**com** (optional) is a non-negative floating number and specifies decay in terms of center of mass. alpha=1/(1+com) where alpha is the decay factor.\n\n**span** (optional) is a positive floating number larger than 1 and specifies decay in terms of span. alpha=2/(span+1).\n\n**halfLife** (optional) is a positive floating number and specifies decay in terms of half-life. alpha=1-exp(log(0.5)/halfLife).\n\n**alpha** (optional) is a floating number between 0 and 1 and directly specifies decay.\n\n**minPeriods** (optional) is an integer indicating the minimum number of observations in window required to have a value (otherwise result is NULL). The default value is 0.\n\n**adjust** (optional) is a Boolean value. The default value is true.\n\n* If *adjust*=true, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2), …, 1-alpha, 1 divided by their sum.\n\n* If *adjust*=false, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2)\\*alpha, (1-alpha)^(n-3)\\*alpha^2,…, (1-alpha)\\*alpha, alpha.\n\n**ignoreNA** (optional) is a Boolean value indicating whether to ignore missing values. The defaut value is false.\n\n**other** (optional) is a numeric vector of the same length as *X*.\n\n**bias** (optional) is a Boolean value indicating whether the result is biased. The default value is false, meaning the bias is corrected.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```language-python\na=[0,1,2,int(),4]\newmStd(X=a,com=0.5);\n// output: [,0.707107,0.919866,0.919866,1.720513]\n\newmStd(X=a,com=0.5,ignoreNA=true);\n// output: [,0.707107,0.919866,0.919866,1.679057]\n\nn = 20\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nt1 = table(n:0, colNames, colTypes)\ninsert into t1 values(09:30:00.001,`AAPL,100,56.5)\ninsert into t1 values(09:30:00.001,`AAPL,200,30.5)\ninsert into t1 values(09:30:00.001,`DELL,150,35.5)\ninsert into t1 values(09:30:00.001,`DELL,170,60.5)\ninsert into t1 values(09:30:00.001,`DELL,130,40.5)\nb=[2,4,3,6,5]\newmStd(X=t1,com=0.5);\n```\n\n| time         | sym  | qty     | price   |\n| ------------ | ---- | ------- | ------- |\n| 09:30:00.001 | AAPL |         |         |\n| 09:30:00.001 | AAPL | 70.7107 | 18.3848 |\n| 09:30:00.001 | DELL | 39.2232 | 9.2487  |\n| 09:30:00.001 | DELL | 23.271  | 17.2418 |\n| 09:30:00.001 | DELL | 27.466  | 12.6944 |\n"
    },
    "ewmVar": {
        "url": "https://docs.dolphindb.com/en/Functions/e/ewmVar.html",
        "signatures": [
            {
                "full": "ewmVar(X, [com], [span], [halfLife], [alpha], [minPeriods=0], [adjust=true], [ignoreNA=false], [bias=false])",
                "name": "ewmVar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[com]",
                        "name": "com",
                        "optional": true
                    },
                    {
                        "full": "[span]",
                        "name": "span",
                        "optional": true
                    },
                    {
                        "full": "[halfLife]",
                        "name": "halfLife",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    },
                    {
                        "full": "[minPeriods=0]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[adjust=true]",
                        "name": "adjust",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=false]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[bias=false]",
                        "name": "bias",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [ewmVar](https://docs.dolphindb.com/en/Functions/e/ewmVar.html)\n\n\n\n#### Syntax\n\newmVar(X, \\[com], \\[span], \\[halfLife], \\[alpha], \\[minPeriods=0], \\[adjust=true], \\[ignoreNA=false], \\[bias=false])\n\n#### Details\n\nCalculate exponentially weighted moving variance.\n\nExactly one of the parameters *com*, *span*, *halfLife* and *alpha* must be specified.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**com** (optional) is a non-negative floating number and specifies decay in terms of center of mass. alpha=1/(1+com) where alpha is the decay factor.\n\n**span** (optional) is a positive floating number larger than 1 and specifies decay in terms of span. alpha=2/(span+1).\n\n**halfLife** (optional) is a positive floating number and specifies decay in terms of half-life. alpha=1-exp(log(0.5)/halfLife).\n\n**alpha** (optional) is a floating number between 0 and 1 and directly specifies decay.\n\n**minPeriods** (optional) is an integer indicating the minimum number of observations in window required to have a value (otherwise result is NULL). The default value is 0.\n\n**adjust** (optional) is a Boolean value. The default value is true.\n\n* If *adjust*=true, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2), …, 1-alpha, 1 divided by their sum.\n\n* If *adjust*=false, the weights are (1-alpha)^(n-1), (1-alpha)^(n-2)\\*alpha, (1-alpha)^(n-3)\\*alpha^2,…, (1-alpha)\\*alpha, alpha.\n\n**ignoreNA** (optional) is a Boolean value indicating whether to ignore missing values. The defaut value is false.\n\n**other** (optional) is a numeric vector of the same length as *X*.\n\n**bias** (optional) is a Boolean value indicating whether the result is biased. The default value is false, meaning the bias is corrected.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\na=[0,1,2,int(),4]\newmVar(X=a,com=0.5);\n// output: [,0.5,0.846154,0.846154,2.960165]\n\newmVar(X=a,com=0.5,ignoreNA=true);\n// output: [,0.5,0.846154,0.846154,2.819231]\n\nn = 20\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nt1 = table(n:0, colNames, colTypes)\ninsert into t1 values(09:30:00.001,`AAPL,100,56.5)\ninsert into t1 values(09:30:00.001,`AAPL,200,30.5)\ninsert into t1 values(09:30:00.001,`DELL,150,35.5)\ninsert into t1 values(09:30:00.001,`DELL,170,60.5)\ninsert into t1 values(09:30:00.001,`DELL,130,40.5)\nb=[2,4,3,6,5]\newmVar(X=t1,com=0.5);\n```\n\n<table id=\"table_jjk_lym_hzb\"><tbody><tr><td>\n\ntime\n\n</td><td>\n\nsym\n\n</td><td>\n\nqty\n\n</td><td>\n\nprice\n\n</td></tr><tr><td>\n\n30:00.0\n\n</td><td>\n\nAAPL\n\n</td><td>\n\n \n\n</td><td>\n\n \n\n</td></tr><tr><td>\n\n30:00.0\n\n</td><td>\n\nAAPL\n\n</td><td>\n\n5,000\n\n</td><td>\n\n338\n\n</td></tr><tr><td>\n\n30:00.0\n\n</td><td>\n\nDELL\n\n</td><td>\n\n1,538.46\n\n</td><td>\n\n85.5385\n\n</td></tr><tr><td>\n\n30:00.0\n\n</td><td>\n\nDELL\n\n</td><td>\n\n541.5385\n\n</td><td>\n\n297.2808\n\n</td></tr><tr><td>\n\n30:00.0\n\n</td><td>\n\nDELL\n\n</td><td>\n\n754.3802\n\n</td><td>\n\n161.1488\n\n</td></tr></tbody>\n</table>\n"
    },
    "exists": {
        "url": "https://docs.dolphindb.com/en/Functions/e/exists.html",
        "signatures": [
            {
                "full": "exists(path)",
                "name": "exists",
                "parameters": [
                    {
                        "full": "path",
                        "name": "path"
                    }
                ]
            }
        ],
        "markdown": "### [exists](https://docs.dolphindb.com/en/Functions/e/exists.html)\n\n\n\n#### Syntax\n\nexists(path)\n\n#### Details\n\nCheck if the specified file(s) or folder(s) exist. It can be used in the distributed files system to check if the specified folder(s) exist.\n\n#### Parameters\n\n**path** is a STRING scalar/vector, indicating the path of file(s) or folder(s).\n\n#### Returns\n\nA scalar or vector of type BOOL.\n\n#### Examples\n\n```\nt=table(1..10 as ID, rand(1.0, 10) as x);\nsaveText(t, \"C:/DolphinDB/Data/t.txt\");\n\nexists(\"C:/DolphinDB/Data/t.txt\");\n// output: true\nexists(\"C:/DolphinDB/Data/t1.txt\");\n// output: false\nexists(\"C:/DolphinDB/Data\");\n// output: true\n\nexists([\"C:/DolphinDB/Data/t.txt\",\"C:/DolphinDB/Data/t1.txt\",\"C:/DolphinDB/Data\"]);\n// output: [true,false,true]\n```\n\nTo check if a folder (or folders) exists in the distributed files system (the following script must be executed at a data node in a cluster):\n\n```\nn=1000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\n\ndb = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)\npt = db.createPartitionedTable(t, `pt, `date);\npt.append!(t);\n\nexists(\"dfs://valueDB/20170807\");\n// output: true\n```\n"
    },
    "existsCatalog": {
        "url": "https://docs.dolphindb.com/en/Functions/e/existsCatalog.html",
        "signatures": [
            {
                "full": "existsCatalog(catalog)",
                "name": "existsCatalog",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    }
                ]
            }
        ],
        "markdown": "### [existsCatalog](https://docs.dolphindb.com/en/Functions/e/existsCatalog.html)\n\n#### Syntax\n\nexistsCatalog(catalog)\n\n#### Details\n\nCheck whether the specified catalog exists.\n\n#### Parameters\n\n**catalog**is a string specifying the catalog name.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\nuse CATALOG cat1;\nexistsCatalog(\"cat1\") // Output: true\nexistsCatalog(\"cat2\") // Output: false\n```\n\n"
    },
    "existsDatabase": {
        "url": "https://docs.dolphindb.com/en/Functions/e/existsDatabase.html",
        "signatures": [
            {
                "full": "existsDatabase(dbUrl)",
                "name": "existsDatabase",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    }
                ]
            }
        ],
        "markdown": "### [existsDatabase](https://docs.dolphindb.com/en/Functions/e/existsDatabase.html)\n\n\n\n#### Syntax\n\nexistsDatabase(dbUrl)\n\n#### Details\n\nCheck if a database exists under the specified folder.\n\n#### Parameters\n\n**dbUrl** is a string indicating the path of a database folder.\n\n#### Returns\n\nA Boolean scalar. `true` and `false` represent the specified database exists/does not exist, respectively.\n\n#### Examples\n\nTo check if a DFS database exists:\n\n```\nn=1000000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\n\ndb = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)\npt = db.createPartitionedTable(t, `pt, `date);\npt.append!(t);\n\nexistsDatabase(\"dfs://valueDB\");\n// output: true\n\nexistsDatabase(\"dfs://valueDB/20170807\");\n// output: false\n```\n"
    },
    "existsPartition": {
        "url": "https://docs.dolphindb.com/en/Functions/e/existsPartition.html",
        "signatures": [
            {
                "full": "existsPartition(path, [tableName])",
                "name": "existsPartition",
                "parameters": [
                    {
                        "full": "path",
                        "name": "path"
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [existsPartition](https://docs.dolphindb.com/en/Functions/e/existsPartition.html)\n\n\n\n#### Syntax\n\nexistsPartition(path, \\[tableName])\n\n#### Details\n\nCheck if the specified partition exists.\n\n#### Parameters\n\n**path** is a string indicating the path of a partition folder.\n\n**tableName** (optional) is a string indicating the table name. If *chunkGranularity* is set to \"DATABASE\" when creating the database, *tableName* is not required. If *chunkGranularity* is set to \"TABLE\":\n\n* If the parameter path contains the physical index of the table (which can be retrieved with the function `listTables`), *tableName* is not required.\n\n* Otherwise, *tableName* must be specified.\n\n#### Returns\n\nA Boolean scalar. `true` and `false` represent the specified partition exists/does not exist, respectively.\n\n#### Examples\n\nCheck if the specified partition exists. The following scripts must be executed on a data node or compute node.\n\n```\nn=1000000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\n\ndb = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)\npt = db.createPartitionedTable(t, `pt, `date);\npt.append!(t);\n\nlistTables(\"dfs://valueDB\")\n```\n\n| tableName | physicalIndex |\n| --------- | ------------- |\n| pt        | s             |\n\n```\nexistsPartition(\"dfs://valueDB/20170807/s\");\n// output: true\n\n//When the chunk granularity of the database is at TABLE level and the parameter path doesn't contain table physicalIndex, the parameter tableName must be specified or the partition cannot be found.\nexistsPartition(\"dfs://valueDB/20170807\", `pt)\n// output: true\n\nexistsPartition(\"dfs://valueDB/20170807\");\n// output: false\n\nexistsPartition(\"dfs://valueDB\");\n// output: false\n\nexistsPartition(\"dfs://valueDB/20170807/s/pt\");\n// output: false\n```\n"
    },
    "existsStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/e/existsstreamtable.html",
        "signatures": [
            {
                "full": "existsStreamTable(tableName)",
                "name": "existsStreamTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [existsStreamTable](https://docs.dolphindb.com/en/Functions/e/existsstreamtable.html)\n\n\n\n#### Syntax\n\nexistsStreamTable(tableName)\n\n#### Details\n\nCheck if the specified stream table exists.\n\nIf it exists, return true; otherwise, return false.\n\n#### Parameters\n\n**tableName**is a string indicating the name of a stream table. It can be a regular, shared, persisted, or high-availability stream table.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\nid=`XOM`GS`AAPL\nx=102.1 33.4 73.6\nrt=streamTable(id, x);\nexistsStreamTable(`rt) \n// output: true\n\nexistsStreamTable(`srt)  \n// output: false\n\nshare rt as srt\nexistsStreamTable(`srt)  \n// output: true\n```\n"
    },
    "existsSubscriptionTopic": {
        "url": "https://docs.dolphindb.com/en/Functions/e/existsSubscriptionTopic.html",
        "signatures": [
            {
                "full": "existsSubscriptionTopic([server], tableName, [actionName])",
                "name": "existsSubscriptionTopic",
                "parameters": [
                    {
                        "full": "[server]",
                        "name": "server",
                        "optional": true
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[actionName]",
                        "name": "actionName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [existsSubscriptionTopic](https://docs.dolphindb.com/en/Functions/e/existsSubscriptionTopic.html)\n\n\n\n#### Syntax\n\nexistsSubscriptionTopic(\\[server], tableName, \\[actionName])\n\nAlias: existSubscriptionTopic\n\n#### Details\n\nCheck the existence of a subscription topic of a shared stream table. Return \"true\" if the subscription topic exists, \"false\" if it doesn't.\n\n#### Parameters\n\n**server** (optional) is a string indicating the node alias of the subscribed stream table, or the handler of a remote call connection. If *server* is not specified or an empty string, it means the streaming data is from the local server.\n\n**tableName** is a string indicating the name of a shared stream table.\n\n**actionName** (optional) is a string indicating the name of the subscription task. *actionName* can only contain letters, numbers and underscores. If the *actionName* is specified when the subscription is created, it must also be specified here.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\nt=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])\nshare t as trades\ntrades_1=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])\nsubscribeTable(tableName=`trades, actionName=`vwap, offset=-1, handler=append!{trades_1})\nexistsSubscriptionTopic(,`trades,`vwap)\n// output: true\n```\n"
    },
    "existsTable": {
        "url": "https://docs.dolphindb.com/en/Functions/e/existsTable.html",
        "signatures": [
            {
                "full": "existsTable(dbUrl, tableName)",
                "name": "existsTable",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [existsTable](https://docs.dolphindb.com/en/Functions/e/existsTable.html)\n\n\n\n#### Syntax\n\nexistsTable(dbUrl, tableName)\n\n#### Details\n\nCheck if the specified table exists in the specified database.\n\n#### Parameters\n\n**dbUrl** is a string indicating the path of a database.\n\n**tableName** is a string indicating a table name.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\nTo check if a table exists in a DFS database (on a data node or compute node). The following scripts must be executed on a data node or compute node.\n\n```\nn=1000000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\n\ndb = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)\npt = db.createPartitionedTable(t, `pt, `date);\npt.append!(t);\n\nexistsTable(\"dfs://valueDB\", `pt);\n// output: true\n\nexistsTable(\"dfs://valueDB/20170807\", `pt);\n// output: true\n```\n"
    },
    "exp": {
        "url": "https://docs.dolphindb.com/en/Functions/e/exp.html",
        "signatures": [
            {
                "full": "exp(X)",
                "name": "exp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [exp](https://docs.dolphindb.com/en/Functions/e/exp.html)\n\n\n\n#### Syntax\n\nexp(X)\n\n#### Details\n\nApply the exponential function to all elements of *X*.\n\n**Note:**\n\n* Similar to the functions of `numpy.exp` and `scipy.stats.exp`, DolphinDB's `exp` works in the same way, with the difference being that it only accepts a single parameter, *X*, and does not support parameters like *out* and *where* found in `numpy.exp`.\n* DolphinDB `exp` has the same core functionality as TA-Lib `EXP`. The difference is that DolphinDB `exp` supports scalar, vector, matrix, and table inputs, whereas TA-Lib `EXP` only accepts one-dimensional array (NumPy array) inputs. If the input data is the same, both return identical results.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix/table.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nexp(1 2 3);\n// output: [2.718282,7.389056,20.085537]\n\nlog(exp(1));\n// output: 1\n```\n"
    },
    "exp2": {
        "url": "https://docs.dolphindb.com/en/Functions/e/exp2.html",
        "signatures": [
            {
                "full": "exp2(X)",
                "name": "exp2",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [exp2](https://docs.dolphindb.com/en/Functions/e/exp2.html)\n\n\n\n#### Syntax\n\nexp2(X)\n\n#### Details\n\nReturn 2 raised to the power of *X*.\n\nThe `exp2` function in DolphinDB and the `exp2` function in NumPy are consistent in their core functionality. However, their design focuses differ:\n\n* DolphinDB `exp2` emphasizes vectorization and distributed computing capabilities, allowing it to operate efficiently on vectors, matrices, and table columns, especially in large-scale data scenarios.\n* NumPy `exp2`, as part of a general-purpose numerical computing library, is built on the ufunc (universal function) mechanism, providing richer low-level control parameters, such as:\n  * *out*: supports writing results into a specified array for in-place computation\n  * *where*: supports conditional element-wise computation\n  * *dtype*: controls the data type of computation and output\n  * *casting*: controls type casting rules\n  * *order*: specifies the memory layout of the output array\n  * *subok*: controls whether to preserve subclass types\n\nIt is important to note that these parameters are not specific to `exp2`, but are common features of NumPy ufuncs.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nexp2(3);\n// output: 8\n\nexp2(2 4 NULL 6);\n// output: [4,16,,64]\n\nexp2(1..4$2:2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 2  | 8  |\n| 4  | 16 |\n"
    },
    "expm1": {
        "url": "https://docs.dolphindb.com/en/Functions/e/expm1.html",
        "signatures": [
            {
                "full": "expm1(X)",
                "name": "expm1",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [expm1](https://docs.dolphindb.com/en/Functions/e/expm1.html)\n\n\n\n#### Syntax\n\nexpm1(X)\n\n#### Details\n\nReturn exp(X)-1.\n\nThe `expm1` function in DolphinDB and the `expm1` function in NumPy are consistent in their core functionality. However, their design focuses differ:\n\n* DolphinDB `expm1` emphasizes vectorization and distributed computing capabilities, making it suitable for large-scale data processing.\n* NumPy `expm1`, as part of a general-purpose numerical computing library, is also based on the ufunc mechanism, and provides the same set of low-level control parameters, including:\n  * `out`: supports writing results into a specified array for in-place computation\n  * `where`: supports conditional element-wise computation\n  * `dtype`: controls the data type of computation and output\n  * `casting`: controls type casting rules\n  * `order`: specifies the memory layout of the output array\n  * `subok`: controls whether to preserve subclass types\n\nSimilarly, these parameters are not unique to `expm1`, but are general features of NumPy ufuncs.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix/table.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nexpm1(5);\n// output: 147.413159\n\nexpm1(1 2 3 NULL);\n// output: [1.718282,6.389056,19.085537,]\n\nexpm1(1..4$2:2);\n```\n\n| #0       | #1        |\n| -------- | --------- |\n| 1.718282 | 19.085537 |\n| 6.389056 | 53.59815  |\n"
    },
    "expr": {
        "url": "https://docs.dolphindb.com/en/Functions/e/expr.html",
        "signatures": [
            {
                "full": "expr(args...)",
                "name": "expr",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [expr](https://docs.dolphindb.com/en/Functions/e/expr.html)\n\n\n\n#### Syntax\n\nexpr(args...)\n\n#### Details\n\nGenerate metacode from *args*.\n\n#### Parameters\n\n**args...** are objects, operators, or metacode. A metacode block contains objects or expressions enclosed by angle brackets < >. The minimum number of arguments is 2.\n\n#### Returns\n\nA metacode.\n\n#### Examples\n\n```\nexpr(6,<,8);\n// output: < 6 < 8 >\n\nexpr(sum, 1 2 3);\n// output: < sum [1,2,3] >\n\na=6;\nexpr(a,+,1);\n// output: < 6 + 1 >\n\nexpr(<a>,+,1);\n// output: < a + 1 >\n\nexpr(<a>,+,<b>);\n// output: < a + b >\n\nexpr(a+7,*,8);\n// output: < 13 * 8 >\n\nexpr(<a+7>,*,8);\n// output: < (a + 7) * 8 >\n\nexpr(not, < a >);\n// output: < ! a >\n```\n"
    },
    "extractInstrument": {
        "url": "https://docs.dolphindb.com/en/Functions/e/extractInstrument.html",
        "signatures": [
            {
                "full": "extractInstrument(instrument)",
                "name": "extractInstrument",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [extractInstrument](https://docs.dolphindb.com/en/Functions/e/extractInstrument.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nextractInstrument(instrument)\n\n#### Details\n\nExtract the data within the INSTRUMENT object(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar or a tuple of INSTRUMENT scalars.\n\n#### Returns\n\n* Returns a dictionary if the *instrument* is a scalar.\n\n* Returns a tuple of dictionaries if the *instrument* is a tuple.\n\n#### Examples\n\n```\nfxFwd1 = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.10.08,\n    \"delivery\": 2025.10.10,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 7.2\n}\nfxFwdUsdCny = parseInstrument(fxFwd1)\nfxFwd2 = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.10.08,\n    \"delivery\": 2025.10.10,\n    \"currencyPair\": \"EURCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 8.2\n}\nfxFwdEurCny = parseInstrument(fxFwd2)\n\nprint extractInstrument([fxFwdUsdCny, fxFwdEurCny])\n\n/* output\n(productType->Forward\nforwardType->FxForward\nversion->1\ninstrumentId->\nexpiry->2025.10.08\ndelivery->2025.10.10\ncurrencyPair->USDCNY\ndirection->Buy\nnotionalCurrency->USD\nnotionalAmount->1000000\nstrike->7.200000000000001\ndomesticCurve->\nforeignCurve->\n,productType->Forward\nforwardType->FxForward\nversion->1\ninstrumentId->\nexpiry->2025.10.08\ndelivery->2025.10.10\ncurrencyPair->EURCNY\ndirection->Buy\nnotionalCurrency->EUR\nnotionalAmount->1000000\nstrike->8.199999999999999\ndomesticCurve->\nforeignCurve->\n)\n*/\n```\n\n**Related function:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html)\n"
    },
    "extractMktData": {
        "url": "https://docs.dolphindb.com/en/Functions/e/extractMktData.html",
        "signatures": [
            {
                "full": "extractMktData(mktData)",
                "name": "extractMktData",
                "parameters": [
                    {
                        "full": "mktData",
                        "name": "mktData"
                    }
                ]
            }
        ],
        "markdown": "### [extractMktData](https://docs.dolphindb.com/en/Functions/e/extractMktData.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nextractMktData(mktData)\n\n#### Details\n\nExtract the data within the MKTDATA object(s).\n\n#### Parameters\n\n**mktData**is a MKTDATA scalar or a tuple of MKTDATA scalars.\n\n#### Returns\n\n* Returns a dictionary if the *mktData* is a scalar.\n\n* Returns a tuple of dictionaries if the *mktData* is a tuple.\n\n#### Examples\n\n```\ncurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": 2025.07.01,\n    \"currency\": \"CNY\",\n    \"curveName\": \"CNY_FR_007\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.07.07,2025.07.10,2025.07.17,2025.07.24,2025.08.04,2025.09.03,2025.10.09,2026.01.05,\n        2026.04.03,2026.07.03,2027.01.04,2027.07.05,2028.07.03],\n    \"values\":[0.015785,0.015931,0.016183,0.016381,0.016493,0.016503,0.016478,0.016234,0.016321,\n        0.016378,0.015508,0.015185,0.014901],\n    \"settlement\": 2025.07.01\n}\n\nmktData = parseMktData(curve)\nd = extractMktData(mktData)\n```\n\n**Related function:** [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "extractTextSchema": {
        "url": "https://docs.dolphindb.com/en/Functions/e/extractTextSchema.html",
        "signatures": [
            {
                "full": "extractTextSchema(filename, [delimiter], [skipRows=0])",
                "name": "extractTextSchema",
                "parameters": [
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "[delimiter]",
                        "name": "delimiter",
                        "optional": true
                    },
                    {
                        "full": "[skipRows=0]",
                        "name": "skipRows",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [extractTextSchema](https://docs.dolphindb.com/en/Functions/e/extractTextSchema.html)\n\n\n\n#### Syntax\n\nextractTextSchema(filename, \\[delimiter], \\[skipRows=0])\n\n#### Details\n\nGenerate the schema table for the input data file. The schema table has 2 columns: column names and their data types.\n\nWhen the input file contains dates and times:\n\n* For data with delimiters (date delimiters \"-\", \"/\" and \".\", and time delimiter \":\"), it will be converted to the corresponding type. For example, \"12:34:56\" is converted to the SECOND type; \"23.04.10\" is converted to the DATE type.\n* For data without delimiters, data in the format of \"yyMMdd\" that meets 0<=yy<=99, 0<=MM<=12, 1<=dd<=31, will be preferentially parsed as DATE; data in the format of \"yyyyMMdd\" that meets 1900<=yyyy<=2100, 0<=MM<=12, 1<=dd<=31 will be preferentially parsed as DATE.\n\n**Note:**\n\nFrom version 1.30.22/2.00.10 onwards, function `extractTextSchema` supports a data file that contains a record with multiple newlines.\n\n#### Parameters\n\n**filename** is the input data file name with its absolute path. Currently only\\*.csv\\* files are supported.\n\n**delimiter** (optional) is a string indicating the table column separator. It can consist of one or more characters, with the default being a comma (',').\n\n**skipRows** (optional) is an integer between 0 and 1024 indicating the rows in the beginning of the text file to be ignored. The default value is 0.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nn=1000000\ntimestamp=09:30:00+rand(18000,n)\nID=rand(100,n)\nqty=100*(1+rand(100,n))\nprice=5.0+rand(100.0,n)\nt1 = table(timestamp,ID,qty,price)\nsaveText(t1, \"C:/DolphinDB/Data/t1.txt\")\nschema=extractTextSchema(\"C:/DolphinDB/Data/t1.txt\");\nschema;\n```\n\n| name      | type   |\n| --------- | ------ |\n| timestamp | SECOND |\n| ID        | INT    |\n| qty       | INT    |\n| price     | DOUBLE |\n"
    },
    "eye": {
        "url": "https://docs.dolphindb.com/en/Functions/e/eye.html",
        "signatures": [
            {
                "full": "eye(X)",
                "name": "eye",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [eye](https://docs.dolphindb.com/en/Functions/e/eye.html)\n\n\n\n#### Syntax\n\neye(X)\n\n#### Details\n\nReturn an *X* by *X* indentity matrix.\n\nDifference from Python’s `numpy.eye`: `numpy.eye` can specify the number of rows and columns, diagonal offset, and *dtype*, and can generate rectangular matrices or matrices with an offset diagonal. DolphinDB’s `eye` only generates an *n*-by-*n* DOUBLE identity matrix.\n\n#### Parameters\n\n**X** is a positive integer.\n\n#### Returns\n\nA matrix of type DOUBLE.\n\n#### Examples\n\n```\neye(3);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 0  | 0  |\n| 0  | 1  | 0  |\n| 0  | 0  | 1  |\n"
    },
    "ffill!": {
        "url": "https://docs.dolphindb.com/en/Functions/f/ffill!.html",
        "signatures": [
            {
                "full": "ffill!(obj, [limit])",
                "name": "ffill!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[limit]",
                        "name": "limit",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ffill!](https://docs.dolphindb.com/en/Functions/f/ffill!.html)\n\n\n\n#### Syntax\n\nffill!(obj, \\[limit])\n\n#### Details\n\nIf *obj* is a vector, forward fill the null values in *obj* with the previous non-null value.\n\nIf *obj* is a matrix or a table, forward fill the null values in each column of *obj* with the previous non-null value.\n\n**Note:** The only difference between `ffill` and `ffill!` is that the latter assigns the result to *obj* and thus changing the value of *obj* after the execution.\n\n#### Parameters\n\n**obj** is a vector/matrix/table.\n\n**limit** is a positive integer that specifies the number of null values to forward fill for each block of null values.\n\n#### Returns\n\nIt returns an object after filling null values, with the same type and form as *obj*.\n\n#### Examples\n\nExample 1\n\n```\nx=1 2 3 NULL NULL NULL 4 5 6\nx.ffill!(); \nx; \n// The value of x is changed. \n// output: [1,2,3,3,3,3,4,5,6]\n```\n\nExample 2: Specify parameter *limit* = 1. The first null value is filled.\n\n```\nx=1 2 3 NULL NULL NULL 4 5 6\nx.ffill!(1);\n// output: [1,2,3,3,,,4,5,6]\n```\n\nExample 3: Specify *obj* as a table.\n\n```\ndate=[2012.06.12,2012.06.12,2012.06.13,2012.06.14,2012.06.15]\nsym=[\"IBM\",\"MSFT\",\"IBM\",\"MSFT\",\"MSFT\"]\nprice=[40.56,26.56,,,50.76]\nqty=[2200,4500,,5600,]\ntimestamp=[09:34:07,09:35:26,09:36:42,09:36:51,09:36:59]\nt=table(date,timestamp,sym,price,qty);\nffill!(t); \nt;\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  | 40.56 | 2200 |\n| 2012.06.12 | 09:35:26  | MSFT | 26.56 | 4500 |\n| 2012.06.13 | 09:36:42  | IBM  | 26.56 | 4500 |\n| 2012.06.14 | 09:36:51  | MSFT | 26.56 | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 | 5600 |\n"
    },
    "ffill": {
        "url": "https://docs.dolphindb.com/en/Functions/f/ffill.html",
        "signatures": [
            {
                "full": "ffill(obj, [limit])",
                "name": "ffill",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[limit]",
                        "name": "limit",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ffill](https://docs.dolphindb.com/en/Functions/f/ffill.html)\n\n\n\n#### Syntax\n\nffill(obj, \\[limit])\n\n#### Details\n\nIf *obj* is a vector, forward fill the null values in *obj* with the previous non-null value.\n\nIf *obj* is an array vector:\n\n* For an empty row, fill it with the nearest non-empty row that precedes it.\n* For null values in a column, fill them with the nearest non-null value that precedes it within the same column.\n\nIf *obj* is a matrix or a table, forward fill the null values in each column of *obj* according to the above rules.\n\nThis operation creates a new vector and does not change the input vector. Function [ffill!](https://docs.dolphindb.com/en/Functions/f/ffill!.html) changes the input vector.\n\n**Note:** The only difference between `ffill` and `ffill!` is that the latter assigns the result to *obj* and thus changing the value of *obj* after the execution.\n\n#### Parameters\n\n**obj** is a vector/matrix/table or an array vector.\n\n**limit** (optional) is a positive integer that specifies the maximum number of consecutive null values to forward fill for each block of null values. *limit* is not supported when *obj* is an array vector.\n\n#### Returns\n\nIt returns an object after filling null values, with the same type and form as *obj*.\n\n#### Examples\n\nExample 1\n\n```\nx=1 2 3 NULL NULL NULL 4 5 6\nx.ffill();\n// output: [1,2,3,3,3,3,4,5,6]\n\nx;\n// The value of x is not changed.\n// output: [1,2,3,,,,4,5,6]\n```\n\nExample 2: Specify parameter *limit*.\n\n```\nx=1 2 3 NULL NULL NULL 4 5 6\nx.ffill(1);\n// output: [1,2,3,3,,,4,5,6]\n                \nx.ffill(2);\nx;\n// output: [1,2,3,3,3,,4,5,6]\n```\n\nExample 3: Specify *obj* as a table.\n\n```\ndate=[2012.06.12,2012.06.12,2012.06.13,2012.06.14,2012.06.15]\nsym=[\"IBM\",\"MSFT\",\"IBM\",\"MSFT\",\"MSFT\"]\nprice=[40.56,26.56,,,50.76]\nqty=[2200,4500,,5600,]\ntimestamp=[09:34:07,09:35:26,09:36:42,09:36:51,09:36:59]\nt=table(date,timestamp,sym,price,qty);\nt;\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  | 40.56 | 2200 |\n| 2012.06.12 | 09:35:26  | MSFT | 26.56 | 4500 |\n| 2012.06.13 | 09:36:42  | IBM  |       |      |\n| 2012.06.14 | 09:36:51  | MSFT |       | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 |      |\n\n```\nt.ffill();\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  | 40.56 | 2200 |\n| 2012.06.12 | 09:35:26  | MSFT | 26.56 | 4500 |\n| 2012.06.13 | 09:36:42  | IBM  | 26.56 | 4500 |\n| 2012.06.14 | 09:36:51  | MSFT | 26.56 | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 | 5600 |\n\n```\nselect date, timestamp, sym, price.ffill() as price, qty.ffill() as qty from t context by sym;\n```\n\n| date       | timestamp | sym  | price | qty  |\n| ---------- | --------- | ---- | ----- | ---- |\n| 2012.06.12 | 09:34:07  | IBM  | 40.56 | 2200 |\n| 2012.06.13 | 09:36:42  | IBM  | 40.56 | 2200 |\n| 2012.06.12 | 09:35:26  | MSFT | 26.56 | 4500 |\n| 2012.06.14 | 09:36:51  | MSFT | 26.56 | 5600 |\n| 2012.06.15 | 09:36:59  | MSFT | 50.76 | 5600 |\n\nExample 4: Specify *obj* as an array vector.\n\nIn the following example, the fourth row of the array vector x is empty, so it is filled with the third row \\[6, 7, 8]; the second element of the first column is null, so it is filled with the previous non-null value 1 in that column.\n\n```\nx = array(INT[], 0).append!([1 2 3, NULL 5, 6 7 8, NULL])\nx\n// output:[[1,2,3],[NULL,5],[6,7,8],[NULL]]\nffill(x)\n// output:[[1,2,3],[1,5],[6,7,8],[6,7,8]]\n```\n"
    },
    "fflush": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fflush.html",
        "signatures": [
            {
                "full": "fflush(obj)",
                "name": "fflush",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [fflush](https://docs.dolphindb.com/en/Functions/f/fflush.html)\n\n\n\n#### Syntax\n\nfflush(obj)\n\n#### Details\n\nWrite the buffered data to the file system in the operating system. It must be executed by a logged-in user.\n\nNote:\n\n1. It is recommended to `close` the file or `fflush` the buffered data to the file after writing to it, otherwise the data may be lost.\n\n2. This command does not synchronize data to the disk. Data loss may occur in case of unexpected crash.\n\n#### Parameters\n\n**obj** is a file handle. Open a file with function [file](https://docs.dolphindb.com/en/Functions/f/file.html) to obtain the file handle.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nrows = 10\nt=table(1..rows as id, 1..rows+100 as value)\nf1=file(\"test.bin\", \"w\")\nf1.writeRecord(t)\n//The file was not closed and the buffered data was not flushed to the file system, so the file read here does not contain the newly written data.\nt1 = table(rows:0,`id`value,`INT`INT)\nf=file('test.bin')\nf.readRecord!(t1)\n::readRecord!(f, t1) => Reach the end of a file or a buffer.\n\n//call fflush\nf1.fflush()\n\nt1 = table(rows:0,`id`value,`INT`INT)\nf=file('test.bin')\nf.readRecord!(t1)\n10\n```\n"
    },
    "file": {
        "url": "https://docs.dolphindb.com/en/Functions/f/file.html",
        "signatures": [
            {
                "full": "file(name, [mode=\"r\"], [isLittleEndian])",
                "name": "file",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[mode=\"r\"]",
                        "name": "mode",
                        "optional": true,
                        "default": "\"r\""
                    },
                    {
                        "full": "[isLittleEndian]",
                        "name": "isLittleEndian",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [file](https://docs.dolphindb.com/en/Functions/f/file.html)\n\n\n\n#### Syntax\n\nfile(name, \\[mode=\"r\"], \\[isLittleEndian])\n\n#### Details\n\nOpen a file with a given mode. It must be executed by a logged-in user.\n\nThe opening mode could be one of the 6 modes: \"r\", \"r+\", \"w\", \"w+\", \"a\", and \"a+\".\n\n* \"r\" (default): Open text file for reading. The cursor is positioned at the beginning of the file.\n* \"r+\": Open for reading and writing. The cursor is positioned at the beginning of the file.\n* \"w\": Truncate file to zero length or create a text file for writing. The cursor is positioned at the beginning of the file.\n* \"w+\": Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The cursor is positioned at the beginning of the file.\n* \"a\": Open for writing. The file is created if it does not exist. The cursor is positioned at the end of the file. Subsequent writes to the file will always end up at the end of file.\n* \"a+\": Open for reading and writing. The file is created if it does not exist. The cursor is positioned at the end of the file. Subsequent writes to the file will always end up at the end of file.\n\nUse the [close](https://docs.dolphindb.com/en/Functions/c/close.html) function to close an opened file handle.\n\n#### Parameters\n\n**name** is a string indicating a file name.\n\n**mode** is a string indicating the opening mode.\n\n**isLittleEndian** (optional) is a Boolean value indicating if the file adopts the little endian format.\n\n#### Returns\n\nA handle.\n\n#### Examples\n\n```\nfout=file(\"test.txt\",\"w\");\nfout.writeLine(\"hello world!\");\n// output: 1\nfout.close();\n\nfin = file(\"test.txt\");\nprint fin.readLine();\n// output: hello world!\nfin.close();\n```\n"
    },
    "files": {
        "url": "https://docs.dolphindb.com/en/Functions/f/files.html",
        "signatures": [
            {
                "full": "files(directory, [pattern])",
                "name": "files",
                "parameters": [
                    {
                        "full": "directory",
                        "name": "directory"
                    },
                    {
                        "full": "[pattern]",
                        "name": "pattern",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [files](https://docs.dolphindb.com/en/Functions/f/files.html)\n\n\n\n#### Syntax\n\nfiles(directory, \\[pattern])\n\n#### Details\n\nIt must be executed by a logged-in user.\n\nIf *pattern* is not specified, return a table with descriptive information of the files and the sub-directories under directory.\n\nIf *pattern* is specified, return a table with descriptive information of the files and sub-directories that contain pattern in their names.\n\n#### Parameters\n\n**directory** is a string indicating a directory path.\n\n**pattern** (optional) is a string indicating the file name pattern to be searched under the directory.\n\n#### Returns\n\nA table with the following columns:\n\n* fileName: the file/directory name.\n* isDir: indicates whether the entry is a directory.\n* fileSize: the size of the file.\n* lastAccessed: last access time.\n* lastModified: last modification time.\n\n#### Examples\n\n```\nfiles(\"D:/06_DolphinDB/01_App/DolphinDB_Win_V0.2\");\n```\n\n| filename                          | isDir | fileSize | lastAccessed            | lastModified            |\n| --------------------------------- | ----- | -------- | ----------------------- | ----------------------- |\n| LICENSE\\_AND\\_AGREEMENT.txt       | false | 22558    | 2026.03.24 03:55:19.119 | 2026.03.24 03:55:19.907 |\n| README\\_WIN.txt                   | false | 5104     | 2026.03.24 03:51:56.331 | 2026.03.24 03:51:59.091 |\n| server                            | true  | 0        | 2026.03.24 06:11:27.922 | 2026.03.24 03:55:19.183 |\n| THIRD\\_PARTY\\_SOFTWARE\\_LICENS... | false | 8435     | 2026.03.24 03:48:44.566 | 2025.06.13 02:36:47.453 |\n\n```\nfiles(\"D:/06_DolphinDB/01_App/DolphinDB_Win_V0.2\", \"readme%\");\n```\n\n| filename        | isDir | fileSize | lastAccessed            | lastModified            |\n| --------------- | ----- | -------- | ----------------------- | ----------------------- |\n| README\\_WIN.txt | false | 5104     | 2026.03.24 03:48:41.830 | 2025.12.26 08:29:33.239 |\n\n```\nselect * from files(\"D:/06_DolphinDB/01_App/DolphinDB_Win_V0.2\") where filename like \"README%\";\n```\n\n| filename        | isDir | fileSize | lastAccessed            | lastModified            |\n| --------------- | ----- | -------- | ----------------------- | ----------------------- |\n| README\\_WIN.txt | false | 5104     | 2026.03.24 03:48:41.830 | 2025.12.26 08:29:33.239 |\n"
    },
    "fill!": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fill!.html",
        "signatures": [
            {
                "full": "fill!(obj, index, value)",
                "name": "fill!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "index",
                        "name": "index"
                    },
                    {
                        "full": "value",
                        "name": "value"
                    }
                ]
            }
        ],
        "markdown": "### [fill!](https://docs.dolphindb.com/en/Functions/f/fill!.html)\n\n\n\n#### Syntax\n\nfill!(obj, index, value)\n\n#### Details\n\nAssign *value* to the elements of *obj* at *index*. It is equivalent to `obj[index]=value`.\n\n#### Parameters\n\n**obj** can be a vector, tuple, matrix, dictionary or table.\n\n**index**\n\n* If *obj* is a vector, tuple or matrix, *index* is an integer scalar/vector;\n* If *obj* is a dictionary, *index* is a string scalar/vector indicating dictionary keys;\n* If *obj* is a table, *index* is a string scalar/vector indicating column names.\n\n**value** is a scalar/vector.\n\n#### Returns\n\nIt returns an object after filling null values, with the same type and form as *obj*.\n\n#### Examples\n\nExample 1. vector\n\n```\na=[1,2,3,4];\nfill!(a,3,12);\na;\n// output: [1,2,3,12]\n\nfill!(a,[0,1],[10,11]);\n// output: [10,11,3,12]\n```\n\nExample 2. tuple\n\n```\na=([1,2,3],[\"a\",\"b\",\"c\"]);\nfill!(a,0,[4,2]);\na[0];\n[4,2]\n\n// Create a tuple with 20 elements. Each element is a null value of floating type.\narray(ANY, 20).fill!(0:20, float());\n// which is equivalent to\nt = array(ANY, 20);\nt[0:20] = float()\n```\n\nExample 3. matrix\n\n```\nm=1..12$3:4;\nfill!(m,2,5);\nm;\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n| 1  | 4  | 5  | 10 |\n| 2  | 5  | 5  | 11 |\n| 3  | 6  | 5  | 12 |\n\n```\nfill!(m,[1,2],5);\nm;\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n| 1  | 5  | 5  | 10 |\n| 2  | 5  | 5  | 11 |\n| 3  | 5  | 5  | 12 |\n\n```\nfill!(m,(1,),9);\nm;\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n| 1  | 5  | 5  | 10 |\n| 9  | 9  | 9  | 9  |\n| 3  | 5  | 5  | 12 |\n\n```\nm.fill!((1,2),10).fill!((2,2),12);\nm;\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n| 1  | 5  | 5  | 10 |\n| 9  | 9  | 10 | 9  |\n| 3  | 5  | 12 | 12 |\n\nExample 4. table\n\n```\nt=table(1 2 3 as id,10.2 45.2 12.3 as val);\nfill!(t,`id,4 5 6);\nt;\n```\n\n| id | val  |\n| -- | ---- |\n| 4  | 10.2 |\n| 5  | 45.2 |\n| 6  | 12.3 |\n\n```\nfill!(t,`qty,452 142 48);\nt;\n```\n\n| id | val  | qty |\n| :- | :--- | :-- |\n| 4  | 10.2 | 452 |\n| 5  | 45.2 | 142 |\n| 6  | 12.3 | 48  |\n\nExample 5. dictionary\n\n```\nd=dict(`a`b`c,1 2 3);\nfill!(d,`a,4);\nd;\n/* output\nc->3\na->4\nb->2\n*/\n```\n"
    },
    "find": {
        "url": "https://docs.dolphindb.com/en/Functions/f/find.html",
        "signatures": [
            {
                "full": "find(X, Y)",
                "name": "find",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [find](https://docs.dolphindb.com/en/Functions/f/find.html)\n\n\n\n#### Syntax\n\nfind(X, Y)\n\n#### Details\n\n* If *X* is a vector: for each element of *Y*, return the position of its first occurrence in vector X. If the element doesn't appear in X, return -1. (To find the positions of all occurences, please use function [at](https://docs.dolphindb.com/en/Functions/a/at.html).)\n* If *X* is a dictionary: for each element of *Y*, if it is a key in *X*, return the corresponding value in *X*; if it is not a key in *X*, return NULL.\n* If *X* is an in-memory table with one column: for each element of *Y*, return the position of its first occurrence in the column of *X*. If the element doesn't appear in *X*, return -1.Note the column cannot be of array vector form.\n* If *X* is a keyed table or indexed table: for each element of *Y*, return the position of its first occurrence in the key columns of *X*. If the element doesn't appear in the key columns of *X*, return -1.\n\nTo search for a small amount of data in a sorted vector, we recommend to use function [binsrch](https://docs.dolphindb.com/en/Functions/b/binsrch.html).\n\n#### Parameters\n\n**X** can be a vector, dictionary, in-memory table with one column, keyed table, or indexed table.\n\n**Y** can be a scalar, vector, matrix, tuple, dictionary, or table.\n\n#### Returns\n\n* When *X* is a vector, an in-memory table with one column, a keyed table, or an indexed table, the return value is an integer scalar or vector.\n\n* When *X* is a dictionary, the return type is the same as the type of the corresponding value in *X*.\n\n#### Examples\n\nWhen *X* is a vector:\n\n```\nfind(7 3 3 5, 3);\n// output\n1\n\nat(7 3 3 5 == 3);\n// output\n[1,2]\n\n(7 3 3 5 6).find(2 4 5);\n// output\n[-1,-1,3]\n```\n\nWhen *X* is a dictionary:\n\n```\nz=dict(1 2 3,4.5 6.6 3.2);\nz;\n// output\n3->3.2\n1->4.5\n2->6.6\n\nfind(z,3);\n// output\n3.2\nfind(z,5);\n// output\n00F\n```\n\nWhen *X* is an in-memory table with one column:\n\n```\nt = table(1 3 5 7 9 as id)\nfind(t, 2 3)\n// output\n[-1,1]\n```\n\nWhen *X* is a keyed table or an indexed table:\n\n```\nkt = keyedTable(`name`id,1000:0,`name`id`age`department,[STRING,INT,INT,STRING])\ninsert into kt values(`Tom`Sam`Cindy`Emma`Nick, 1 2 3 4 5, 30 35 32 25 30, `IT`Finance`HR`HR`IT)\nfind(kt,(`Emma`Sam, 4 1));\n// output\n[3,-1]\n\nt1 = indexedTable(`sym`side, 10000:0, `sym`side`price`qty, [SYMBOL,CHAR,DOUBLE,INT])\ninsert into t1 values(`IBM`MSFT`GOOG, ['B','S','B'], 10.01 10.02 10.03, 10 10 20)\nfind(t1, (`GOOG`MSFT, ['B','S']))\n// output\n[2,1]\n```\n"
    },
    "first": {
        "url": "https://docs.dolphindb.com/en/Functions/f/first.html",
        "signatures": [
            {
                "full": "first(X)",
                "name": "first",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [first](https://docs.dolphindb.com/en/Functions/f/first.html)\n\n\n\n#### Syntax\n\nfirst(X)\n\nor\n\nfirst X\n\n#### Details\n\nReturn the first element of a vector, or the first row of a matrix or table.\n\nIf the first element is a null value, the function returns NULL. To get the first non-null element, use [firstNot](https://docs.dolphindb.com/en/Functions/f/firstNot.html).\n\n#### Parameters\n\n**X** can be a scalar, pair, vector, matrix or table.\n\n#### Returns\n\nA scalar or vector with the same type as *X*.\n\n#### Examples\n\n```\nfirst(`hello `world);\n// output: hello\n\nfirst(1..10);\n// output: 1\n\nm = matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nfirst(m);\n// output: [1,4]\n```\n\nRelated function: [last](https://docs.dolphindb.com/en/Functions/l/last.html)\n"
    },
    "firstHit": {
        "url": "https://docs.dolphindb.com/en/Functions/f/firstHit.html",
        "signatures": [
            {
                "full": "firstHit(func, X, target)",
                "name": "firstHit",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "target",
                        "name": "target"
                    }
                ]
            }
        ],
        "markdown": "### [firstHit](https://docs.dolphindb.com/en/Functions/f/firstHit.html)\n\n\n\n#### Syntax\n\nfirstHit(func, X, target)\n\n#### Details\n\nReturn the first element in *X* that satisfies the condition `X func target` (e.g. X>5). If no element in *X* satisfies the condition, return a NULL vlaue.\n\nNull values are ignored in `firstHit`. Use [firstNot](https://docs.dolphindb.com/en/Functions/f/firstNot.html) to find the first non-null value.\n\n#### Parameters\n\n**func** can only be the following operators: >, >=, <, <=, !=, <>, ==.\n\n**X** is a vector/matrix.\n\n**target** is a scalar of the same type as *X* indicating the value to be compared with *X*.\n\n#### Returns\n\nA scalar or vector with the same type as *X*.\n\n#### Examples\n\n```\nX = NULL 3.2 4.5 1.2 NULL 7.8 0.6 9.1\nfirstHit(<, X, 2.5)\n// output: 1.2\n\n// return null value if no element satisfies the condition\nfirstHit(>, X, 10.0)\n// output: NULL\n```\n\nRelated Function: [ifirstHit](https://docs.dolphindb.com/en/Functions/i/ifirstHit.html)\n"
    },
    "firstNot": {
        "url": "https://docs.dolphindb.com/en/Functions/f/firstNot.html",
        "signatures": [
            {
                "full": "firstNot(X, [k])",
                "name": "firstNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[k]",
                        "name": "k",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [firstNot](https://docs.dolphindb.com/en/Functions/f/firstNot.html)\n\n\n\n#### Syntax\n\nfirstNot(X, \\[k])\n\n#### Details\n\nIf *X* is a vector:\n\n* If *k* is not specified: return the first element of *X* that is not null.\n\n* If *k* is specified: return the first element of *X* that is neither *k* nor null.\n\nIf *X* is a matrix or table, conduct the aforementioned calculation within each column of *X*. The result is a vector.\n\n#### Parameters\n\n**X** can be a scalar, pair, vector, matrix or table.\n\n**k** (optional) is a scalar.\n\n#### Returns\n\n* If *X* is a vector, it returns a scalar with the same type as *X*.\n\n* If *X* is a matrix or table, it teturns a vector\n\n#### Examples\n\n```\nfirstNot(0 0 0 6 1, 0);\n// output: 6\n\nfirstNot(NULL 0 3 2 1, 0);\n// output: 3\n\nfirstNot(NULL 0 1 6);\n// output: 0\n\nt=table(1 1 1 1 1 2 2 2 2 2 as id, 0 0 0 2 1 NULL NULL 0 0 3 as x);\nt;\n```\n\n| id | x |\n| -- | - |\n| 1  | 0 |\n| 1  | 0 |\n| 1  | 0 |\n| 1  | 2 |\n| 1  | 1 |\n| 2  |   |\n| 2  |   |\n| 2  | 0 |\n| 2  | 0 |\n| 2  | 3 |\n\n```\nselect firstNot(x, 0) from t group by id;\n```\n\n| id | firstNot\\_x |\n| -- | ----------- |\n| 1  | 2           |\n| 2  | 3           |\n\n```\nm=matrix(0 NULL 1 2 3, NULL 2 NULL 0 3);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 0  | 2  |\n| 1  |    |\n| 2  | 0  |\n| 3  | 3  |\n\n```\nfirstNot(m, 0);\n// output: [1,2]\n```\n"
    },
    "fixedLengthArrayVector": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fixedLengthArrayVector.html",
        "signatures": [
            {
                "full": "fixedLengthArrayVector(args…)",
                "name": "fixedLengthArrayVector",
                "parameters": [
                    {
                        "full": "args…",
                        "name": "args…"
                    }
                ]
            }
        ],
        "markdown": "### [fixedLengthArrayVector](https://docs.dolphindb.com/en/Functions/f/fixedLengthArrayVector.html)\n\n\n\n#### Syntax\n\nfixedLengthArrayVector(args…)\n\n#### Details\n\nConcatenate vectors, matrices, and tables and return an array vector.\n\nNote: The length of a vector or each vector in a tuple, and the number of rows of a matrix or table must be the same.\n\nThe following figure describes how different data forms are concatenated into an array vector based on Example 1.\n\n![](https://docs.dolphindb.com/en/images/fixedLengthArrayVector.png)\n\n#### Parameters\n\n**args** can be vectors, tuples, fixed length array vectors, matrices, or tables. All *args* must be of the same data type supported by [array vectors](https://docs.dolphindb.com/en/Programming/DataTypesandStructures/DataForms/Vector/arrayVector.html).\n\n#### Returns\n\nAn array vector.\n\n#### Examples\n\nExample 1.\n\n```\nvec = 1 5 3\ntp = [3 4 5, 4 5 6]\nm =  matrix(5 0 7, 7 6 9, 1 9 0)\ntb = table(6 9 4 as v1, 1 4 3 as v2)\nf = fixedLengthArrayVector(vec, tp, m, tb)\nf;\n// output: [[1,3,4,5,7,1,6,1],[5,4,5,0,6,9,9,4],[3,5,6,7,9,0,4,3]]\n\ntypestr(f);\n// output: FAST INT[] VECTOR\n```\n\nExample 2. store multiple columns as one column\n\n```\nlogin(\"admin\",\"123456\")\nsyms=\"A\"+string(1..30)\ndatetimes=2019.01.01T00:00:00..2019.01.31T23:59:59\nn=200\nif(existsDatabase(\"dfs://stock\")) {\n      dropDatabase(\"dfs://stock\")\n}\ndb=database(\"dfs://stock\", RANGE, cutPoints(syms,3), engine=\"TSDB\");\nt=table(take(datetimes,n) as trade_time, take(syms,n) as sym,take(500+rand(10.0,n), n) as bid1, take(500+rand(20.0,n),n) as bid2)\nt1=select trade_time, sym, fixedLengthArrayVector(bid1,bid2) as bid from t\n\nquotes=db.createPartitionedTable(t1,`quotes,`sym, sortColumns=`sym`trade_time).append!(t1)\nselect * from quotes\n```\n\n| trade\\_time         | sym | bid                      |\n| ------------------- | --- | ------------------------ |\n| 2019.01.01T00:00:00 | A1  | \\[503.111142,507.55833]  |\n| 2019.01.01T00:00:30 | A1  | \\[502.991382,501.734092] |\n| 2019.01.01T00:01:00 | A1  | \\[500.790709,509.200963] |\n| 2019.01.01T00:01:30 | A1  | \\[501.127932,507.972508] |\n| 2019.01.01T00:02:00 | A1  | \\[500.678614,514.947117] |\n\nYou can obtain a bid price by specifying the index. Applying a function to the bid column is equivalent to calculating on all bid prices.\n\n```\nselect avg(bid[0]) as avg_bid1, avg(bid[1]) as avg_bid2, avg(bid) as avg_bid from quotes\n```\n\n| avg\\_bid1 | avg\\_bid2 | avg\\_bid |\n| --------- | --------- | -------- |\n| 505.0263  | 509.2912  | 507.16   |\n\nNormally the field names of quotes are composed of the quote type and a number. To store multiple quote prices into an array vector, you can write the script as shown below:\n\n```\n// generate 50 bid/ask prices\nn = 200\nt=table(take(datetimes,n) as trade_time, take(syms,n) as sym)\nfor(i  in 1:51){\n\n      t[\"bid\"+string(i)] = take(500+rand(10.0,n), n)\n}\n\n// store the data into an array vector\nt[\"bid\"]=fixedLengthArrayVector(t[\"bid\"+string(1..50)])\nt1=select trade_time, sym, bid from t\n```\n\nTo improve the performance, you can use it with function [unifiedCall](https://docs.dolphindb.com/en/Functions/Templates/unifiedCall.html).\n\n```\nt[\"bid\"]=unifiedCall(fixedLengthArrayVector, t[\"bid\"+string(1..50)])\nt1=select trade_time, sym, bid from t\n```\n\nExample 3. Save 5 levels of quotes for exchanges A and B as array vectors, then concatenate them into an array vector.\n\n```\n// Generate 5 levels of quotes for exchanges A and B\nsyms = \"A\" + string(1..5)\ndatetimes = 2019.01.01T00:00:00..2019.01.31T23:59:59\nn = 10\nt1 = table(take(datetimes, n) as trade_time, take(syms, n) as sym)\nfor(i  in 1:6){\n      t1[\"bid\" + string(i)] = take(50 + rand(10.0, n), n)\n}\nt2 = table(take(datetimes, n) as trade_time, take(syms, n) as sym)\nfor(i  in 1:6){\n      t2[\"bid\" + string(i)] = take(50 + rand(10.0, n), n)\n}\n\n// save quotes as array vectors\nt1[\"bid\"] = fixedLengthArrayVector(t1[\"bid\" + string(1..5)])\nt2[\"bid\"] = fixedLengthArrayVector(t2[\"bid\" + string(1..5)])\n\n// concatenate fixed length array vectors\nt1[\"bid\"] = fixedLengthArrayVector(t1[\"bid\"], t2[\"bid\"])\nt3 = select trade_time, sym, bid from t1\n```\n\n| trade\\_time         | sym | bid                                                            |\n| ------------------- | --- | -------------------------------------------------------------- |\n| 2019.01.01T00:00:00 | A1  | \\[56.68,54.55,53.11,53.38,59.60,57.35,59.92,50.62,56.06,54.69] |\n| 2019.01.01T00:00:01 | A2  | \\[58.97,50.65,54.38,50.11,56.26,52.35,52.79,55.43,52.16,53.35] |\n| 2019.01.01T00:00:02 | A3  | \\[50.25,53.45,52.68,58.19,56.51,57.54,55.22,51.74,58.63,57.43] |\n| 2019.01.01T00:00:03 | A4  | \\[56.42,50.28,57.04,52.45,51.83,57.75,55.04,57.34,57.82,53.28] |\n| 2019.01.01T00:00:04 | A5  | \\[59.90,51.73,55.54,57.74,53.48,59.62,57.26,53.99,52.67,57.82] |\n| 2019.01.01T00:00:05 | A1  | \\[53.16,59.27,52.97,50.41,58.30,57.83,54.93,56.91,52.51,57.95] |\n| 2019.01.01T00:00:06 | A2  | \\[53.14,50.87,52.62,54.47,59.97,56.99,55.32,54.66,56.77,58.39] |\n| 2019.01.01T00:00:07 | A3  | \\[58.33,59.80,52.34,57.52,57.39,54.67,51.19,52.11,55.27,53.07] |\n| 2019.01.01T00:00:08 | A4  | \\[55.21,54.88,54.38,52.36,56.56,53.81,57.84,53.24,54.87,54.63] |\n| 2019.01.01T00:00:09 | A5  | \\[52.98,55.72,55.83,50.60,51.01,57.02,54.07,54.63,55.44,59.28] |\n"
    },
    "flatten": {
        "url": "https://docs.dolphindb.com/en/Functions/f/flatten.html",
        "signatures": [
            {
                "full": "flatten(X)",
                "name": "flatten",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [flatten](https://docs.dolphindb.com/en/Functions/f/flatten.html)\n\n\n\n#### Syntax\n\nflatten(X)\n\n#### Details\n\nConvert *X* into a 1D vector.\n\nNote that for a tuple:\n\n* If it contains tuple elements, `flatten` converts these elements to 1D vectors and retains other elements, returns a tuple.\n\n* If it does not contain tuple elements, `flatten` returns a 1D vector.\n\n#### Parameters\n\n**X** is a vector, tuple or matrix.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\nConvert a matrix into a vector.\n\n```\nm=1..10$5:2;\nflatten(m);\n// output: [1,2,3,4,5,6,7,8,9,10]\n```\n\nConvert a list of vectors into a vector.\n\n```\na=1..10;\nb = a cut 2;\nb;\n// output: ([1,2],[3,4],[5,6],[7,8],[9,10])\n\nflatten(b);\n// output: [1,2,3,4,5,6,7,8,9,10]\n\nx=flatten([1, [2,3]]);\nx;\n// output: [1,2,3]\n```\n\nConvert a tuple with tuple elements into a 1d vector, which involves several times of `flatten` operations:\n\n```\nlist = (1, (2, (3, 4, 5)), (6, 7), 8, [9])\nx1 = flatten(list)\nx1\n//(3, 4, 5) and (6, 7) are converted to 1D vectors\n// output:(1,(2,[3,4,5]),[6,7],8,[9])\n\nx2= flatten(x1)\nx2\n//(2,[3,4,5]) is converted to 1D vectors\n// output:(1,[2,3,4,5],[6,7],8,[9])\n\nx3= flatten(x2)\nx3\n// flatten to 1D vector\n// output:[1,2,3,4,5,6,7,8,9]\n```\n\nOr use `flatten` with `reduce` to get the result after iteration:\n\n```\nreduce(flatten, init=list)\n// output:[1,2,3,4,5,6,7,8,9]\n```\n"
    },
    "flip": {
        "url": "https://docs.dolphindb.com/en/Functions/f/flip.html",
        "signatures": [
            {
                "full": "transpose(X)",
                "name": "transpose",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [flip](https://docs.dolphindb.com/en/Functions/f/flip.html)\n\nAlias for [transpose](https://docs.dolphindb.com/en/Functions/t/transpose.html)\n\nDifference from Python’s numpy.flip: numpy.flip reverses elements along a specified axis. DolphinDB’s flip is an alias for transpose and transposes a matrix.\n\n\nDocumentation for the `transpose` function:\n### [transpose](https://docs.dolphindb.com/en/Functions/t/transpose.html)\n\n\n\n#### Syntax\n\ntranspose(X)\n\nAlias: flip\n\n#### Details\n\nThis function is used to transpose *X:*\n\n* If *X* is a tuple: return a tuple of the same length as each element of *X*. The n-th element of the result is a vector composed of the n-th element of each element of *X*.\n\n* If *X* is a matrix: return the transpose of *X*.\n\n* If *X* is a table: convert *X* into an ordered dictionary. The dictionary keys are column names. Each dictionary value is a vector of the corresponding column.\n\n* If *X* is a dictionary: convert *X* into a table. The dictionary keys must be of STRING type:\n\n  * When values are scalars or vectors of equal length, the keys of *X*serve as the column names and the cooresponding values populate the column values in the table.\n  * When the values are dictionaries, the resulting table will have the keys of X as the first column (named \"key\"). Subsequent columns will be derived from the keys of the first sub-dictionary with each row populated by corresponding values from all nested dictionaries. Missing keys in any sub-dictionary will result in null values in the table.\n    **Note:** Dictionaries with more than 32,767 keys cannot be converted into a table.\n\n* If *X* is an array vector or columnar tuple: switch data from columns to rows, or vice versa.\n\n#### Parameters\n\n**X** is a tuple/matrix/table/dictionary/array vector/columnar tuple.\n\n* If X is a tuple, all elements must be vectors of the same length.\n* If *X* is an array vector or columnar tuple, the number of elements in each row must be the same.\n\n#### Examples\n\nExample 1: transpose of a tuple:\n\n```\nx=(`A`B`C,1 2 3);\nx.transpose();\n// output: ((\"A\",1),(\"B\",2),(\"C\",3))\n```\n\nExample 2: transpose of a matrix:\n\n```\nx=1..6 $ 3:2;\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\ntranspose x;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 2  | 3  |\n| 4  | 5  | 6  |\n\nExample 3: convert a table into a dictionary:\n\n```\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nt = table(timestamp, sym, qty, price);\nt;\n```\n\n| timestamp | sym | qty  | price  |\n| --------- | --- | ---- | ------ |\n| 09:34:07  | C   | 2200 | 49.6   |\n| 09:36:42  | MS  | 1900 | 29.46  |\n| 09:36:51  | MS  | 2100 | 29.52  |\n| 09:36:59  | MS  | 3200 | 30.02  |\n| 09:32:47  | IBM | 6800 | 174.97 |\n| 09:35:26  | IBM | 5400 | 175.23 |\n| 09:34:16  | C   | 1300 | 50.76  |\n| 09:34:26  | C   | 2500 | 50.32  |\n| 09:38:12  | C   | 8800 | 51.29  |\n\n```\ntranspose(t);\n/*\ntimestamp->[09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nsym->[C,MS,MS,MS,IBM,IBM,C,C,C]\nqty->[2200,1900,2100,3200,6800,5400,1300,2500,8800]\nprice->[49.6,29.46,29.52,30.02,174.97,175.23,50.76,50.32,51.29]\n*/\n```\n\nExample 4: convert a dictionary into a table:\n\n```\nz=dict(`id`val,[`a`b`c,1 2 3]);\nz;\n/*\nval->[1,2,3]\nid->[a,b,c]\n*/\ntranspose(z);\n```\n\n| val | id |\n| --- | -- |\n| 1   | a  |\n| 2   | b  |\n| 3   | c  |\n\n```\n// When the value of a dictionary contains both a scalar and a vector, the scalar will be automatically filled to match the length of the vector.\nz1=dict(`id`val,[`a,1 2 3]);\nz1;\ntranspose(z1)\n```\n\n| val | id |\n| --- | -- |\n| 1   | a  |\n| 2   | a  |\n| 3   | a  |\n\nExample 5: convert a nested dictionary into a table.\n\n```\nd = {'tag1':{'val1':2,'val2':6},'tag2':{'val2':1, 'val3':3}}\nd\n/*\ntag1->\n    val1->2\n    val2->6\n\ntag2->\n    val2->1\n    val3->3\n*/\ntranspose(d)\n```\n\n<table id=\"table_yr2_jxb_d2c\"><thead><tr><th align=\"left\">\n\nkey\n\n</th><th align=\"left\">\n\nval1\n\n</th><th align=\"left\">\n\nval2\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\ntag1\n\n</td><td align=\"left\">\n\n2\n\n</td><td align=\"left\">\n\n6\n\n</td></tr><tr><td align=\"left\">\n\ntag2\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n1\n\n</td></tr></tbody>\n</table>The result shows that after converting the dictionary d into a table, it includes a \"key\" column and columns named after the keys of the first sub-dictionary \\(val1 and val2\\). The \"key\" column contains the keys \\(tag1 and tag2\\) from d, while the val1 and val2 columns hold the corresponding values from the sub-dictionaries. Since sub-dictionary tag2 lacks val1 key, the corresponding value is null. Additionally, its val3 key is excluded from the resulting table, and the corresponding value is discarded.\n"
    },
    "float": {
        "url": "https://docs.dolphindb.com/en/Functions/f/float.html",
        "signatures": [
            {
                "full": "float([X])",
                "name": "float",
                "parameters": [
                    {
                        "full": "[X]",
                        "name": "X",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [float](https://docs.dolphindb.com/en/Functions/f/float.html)\n\n\n\n#### Syntax\n\nfloat(\\[X])\n\n#### Details\n\nConverts the type of input data to FLOAT.\n\n#### Parameters\n\n**X** (optional): Any data type, and can be in any data form.\n\n#### Returns\n\nData of the FLOAT type, and the data form is the same as *X*。\n\n#### Examples\n\nCreate a FLOAT variable with a default value of null.\n\n```\nx=float()\nx // Output: null\ntypestr x // Output: 'FLOAT'\n```\n\nConvert a string that indicates a number.\n\n```\nx=float(\"123\")\nx // Outout: 123\ntypestr x // Output: 'FLOAT'\n```\n\nConvert a boolean value.\n\n```\nx=float([true, false])\nx // Output: [1, 0]\ntypestr x // Output: 'FAST FLOAT VECTOR'\n```\n\nConvert data of the DOUBLE type.\n\n```\nx=123456789.1234567 // 16 digits\ntypestr x // Output: 'DOUBLE'\n\ny=float(x)\ny // Output: 123,456,792 (FLOAT accepts 9 digits at most)\ntypestr y // Output: 'FLOAT'\n```\n\nCreate variables with positive and negative infinity values.\n\n```\n// Create a variable with a positive infinity value\nposInf = float(\"inf\")\nposInf  // Output: ∞\ntypestr posInf // Output: 'FLOAT'\nposInf > 1000000000 // Output: true\n\n// Create a variable with a negative infinity value\nnegInf = float(\"-inf\")\nnegInf  // Output: -∞\ntypestr negInf // Output: 'FLOAT'\nnegInf < NULL // Output: true\n```\n"
    },
    "floatingRateBondDirtyPrice": {
        "url": "https://docs.dolphindb.com/en/Functions/f/floatingratebonddirtyprice.html",
        "signatures": [
            {
                "full": "floatingRateBondDirtyPrice(settlement, issue, maturity, redemption, spread, riskFree, calendar, frequency, [basis=1], [convention=\"Following\"])",
                "name": "floatingRateBondDirtyPrice",
                "parameters": [
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "issue",
                        "name": "issue"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "redemption",
                        "name": "redemption"
                    },
                    {
                        "full": "spread",
                        "name": "spread"
                    },
                    {
                        "full": "riskFree",
                        "name": "riskFree"
                    },
                    {
                        "full": "calendar",
                        "name": "calendar"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "[basis=1]",
                        "name": "basis",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[convention=\"Following\"]",
                        "name": "convention",
                        "optional": true,
                        "default": "\"Following\""
                    }
                ]
            }
        ],
        "markdown": "### [floatingRateBondDirtyPrice](https://docs.dolphindb.com/en/Functions/f/floatingratebonddirtyprice.html)\n\n#### Syntax\n\nfloatingRateBondDirtyPrice(settlement, issue, maturity, redemption, spread, riskFree, calendar, frequency, \\[basis=1], \\[convention=\"Following\"])\n\n#### Details\n\nCalculate the dirty price for each 100 face value of a floating rate bond.\n\nThe coupon rate of a floating rate bond is not fixed; it is periodically adjusted based on a reference rate (such as LIBOR). The actual interest rate of a floating rate bond is typically composed of the reference rate plus a fixed spread, which is determined at bond’s issuance and remains fixed until maturity.\n\n**Return value:** A DOUBLE scalar or vector.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**issue** is a DATE scalar or vector indicating the bond's issuance date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**redemption** is a numeric scalar or vector indicating the redemption value.\n\n**spread** is a numeric scalar or vector indicating the interest rate spread.\n\n**riskFree** is a numeric scalar or vector indicating the risk-free interest rate.\n\n**calendar** is a STRING scalar or vector indicating the trading calendar(s). See [Trading Calendar](https://docs.dolphindb.com/en/Tutorials/trading_calendar.html) for more information.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**basis** (optional) is an INT/STRING scalar or vector indicating the day count basis to use. It can be:\n\n* 0/\"Thirty360US\": US (NASD) 30/360\n* 1/\"ActualActual\": actual/actual\n* 2/\"Actual360\": actual/360\n* 3/\"Actual365\": actual/365\n* 4/\"Thirty360EU\": European 30/360\n\n**convention** (optional) is a STRING scalar or vector indicating how cash flows that fall on a non-trading day are treated. The following options are available. Defaults to 'Following'.\n\n* 'Following': The following trading day.\n* 'ModifiedFollowing': The following trading day. If that day is in a different month, the preceding trading day is adopted instead.\n* 'Preceding': The preceding trading day.\n* 'ModifiedPreceding': The preceding trading day. If that day is in a different month, the following trading day is adopted instead.\n* 'Unadjusted': Unadjusted.\n* 'HalfMonthModifiedFollowing': The following trading day. If that day crosses the mid-month (15th) or the end of month, the preceding trading day is adopted instead.\n* 'Nearest': The nearest trading day. If both the preceding and following trading days are equally far away, default to following trading day.\n\n#### Examples\n\nCalculate the price for a bond issued on June 9, 2020, with a maturity date of June 9, 2025, a trading date of September 15, 2020, an market risk-free rate of 0.0385, a bond spread of -0.0075, quarterly interest payments, and an actual/actual day count basis. The trading calendar is NewYork Stock Exchange (XNYS), with no adjustment for non-business days.\n\n```\nfloatingRateBondDirtyPrice(settlement=2020.09.15, issue=2020.06.09, maturity=2025.06.09, redemption=100.0, spread=-0.0075, riskFree=0.0385, calendar=`XNYS, frequency=3M,convention=`Unadjusted)\n// output: 96.8209\n```\n"
    },
    "floor": {
        "url": "https://docs.dolphindb.com/en/Functions/f/floor.html",
        "signatures": [
            {
                "full": "floor(X)",
                "name": "floor",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [floor](https://docs.dolphindb.com/en/Functions/f/floor.html)\n\n\n\n#### Syntax\n\nfloor(X)\n\n#### Details\n\nThe `floor` and [ceil](https://docs.dolphindb.com/en/Functions/c/ceil.html) functions map a real number to the largest previous and the smallest following integer, respectively. Function [round](https://docs.dolphindb.com/en/Functions/r/round.html) maps a real number to the largest previous or the smallest following integer with the round half up rule.\n\n**Note:**\n\n* Difference from Python’s `numpy.floor`: Both functions return the largest integer less than or equal to the input. `numpy.floor` is a ufunc and supports broadcasting, *out*, *where*, and other ufunc arguments. DolphinDB’s `floor` accepts a scalar, vector, or matrix and returns an integral result.\n* DolphinDB `floor` has the same core functionality as TA-Lib `FLOOR`. The difference is that DolphinDB `floor` supports scalar, pair, vector, matrix, and table inputs, whereas TA-Lib `FLOOR` only accepts one-dimensional array (NumPy array) inputs. If the input data is the same, both return identical results.\n\n#### Parameters\n\n**X** is a scalar, vector, or matrix.\n\n#### Returns\n\nAn integer scalar, vector or matrix.\n\n#### Examples\n\n```\nfloor(2.1);\n// output: 2\nfloor(2.9);\n// output: 2\nfloor(-2.1);\n// output: -3\n\nceil(2.1);\n// output: 3\nceil(2.9);\n// output: 3\nceil(-2.1);\n// output: -2\n\nround(2.1);\n// output: 2\nround(2.9);\n// output: 3\nround(-2.1);\n// output: -2\n```\n\n```\nm = 1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10$2:5;\nm;\n```\n\n| #0  | #1  | #2  | #3  | #4  |\n| --- | --- | --- | --- | --- |\n| 1.1 | 3.3 | 5.5 | 7.7 | 9.9 |\n| 2.2 | 4.4 | 6.6 | 8.8 | 10  |\n\n```\nfloor(m);\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  |\n| 2  | 4  | 6  | 8  | 10 |\n"
    },
    "flushComputeNodeMemCache": {
        "url": "https://docs.dolphindb.com/en/Functions/f/flushComputeNodeMemCache.html",
        "signatures": [
            {
                "full": "flushComputeNodeMemCache()",
                "name": "flushComputeNodeMemCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [flushComputeNodeMemCache](https://docs.dolphindb.com/en/Functions/f/flushComputeNodeMemCache.html)\n\n\n\n#### Syntax\n\nflushComputeNodeMemCache()\n\n#### Details\n\nOn a compute node in the compute group, invoke the function to flush the memory cache to disk.\n\nIn cases of upgrade and graceful restart of compute node, users can call this function first to write the cached data from memory to disk. Then after node restart, data can be fetched from disk instead of remote data nodes.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n"
    },
    "flushOLAPCache": {
        "url": "https://docs.dolphindb.com/en/Functions/f/flushOLAPCache.html",
        "signatures": [
            {
                "full": "flushOLAPCache()",
                "name": "flushOLAPCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [flushOLAPCache](https://docs.dolphindb.com/en/Functions/f/flushOLAPCache.html)\n\n\n\n#### Syntax\n\nflushOLAPCache()\n\nAlias: purgeCacheEngine\n\n#### Details\n\nFlush 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.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n"
    },
    "flushPKEYCache": {
        "url": "https://docs.dolphindb.com/en/Functions/f/flushPKEYCache.html",
        "signatures": [
            {
                "full": "flushPKEYCache()",
                "name": "flushPKEYCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [flushPKEYCache](https://docs.dolphindb.com/en/Functions/f/flushPKEYCache.html)\n\n\n\n#### Syntax\n\nflushPKEYCache()\n\n#### Details\n\nForcibly flush the completed transactions in the PKEY cache engine to the database and evict cached SYMBOL base.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n"
    },
    "flushTSDBCache": {
        "url": "https://docs.dolphindb.com/en/Functions/f/flushTSDBCache.html",
        "signatures": [
            {
                "full": "flushTSDBCache()",
                "name": "flushTSDBCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [flushTSDBCache](https://docs.dolphindb.com/en/Functions/f/flushTSDBCache.html)\n\n\n\n#### Syntax\n\nflushTSDBCache()\n\n#### Details\n\nForcibly flush the completed transactions cached in the TSDB cache engine to the database. Specify the configuration parameter *TSDBCacheEngineSize* before execution.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n"
    },
    "fmin": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fmin.html",
        "signatures": [
            {
                "full": "fmin(f, X0, [fargs], [xtol=0.0001], [ftol=0.0001], [maxIter], [maxFun])",
                "name": "fmin",
                "parameters": [
                    {
                        "full": "f",
                        "name": "f"
                    },
                    {
                        "full": "X0",
                        "name": "X0"
                    },
                    {
                        "full": "[fargs]",
                        "name": "fargs",
                        "optional": true
                    },
                    {
                        "full": "[xtol=0.0001]",
                        "name": "xtol",
                        "optional": true,
                        "default": "0.0001"
                    },
                    {
                        "full": "[ftol=0.0001]",
                        "name": "ftol",
                        "optional": true,
                        "default": "0.0001"
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[maxFun]",
                        "name": "maxFun",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [fmin](https://docs.dolphindb.com/en/Functions/f/fmin.html)\n\n#### Syntax\n\nfmin(f, X0, \\[fargs], \\[xtol=0.0001], \\[ftol=0.0001], \\[maxIter], \\[maxFun])\n\n#### Details\n\nUse a Nelder-Mead simplex algorithm to find the minimum of function of one or more variables. This algorithm only uses function values, not derivatives or second derivatives.\n\n**Note:**\n\n* DolphinDB `fmin` provides the same functionality as [scipy.optimize.fmin](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin.html). The main difference is the return format: DolphinDB `fmin` returns a dictionary containing xopt, fopt, iterations, fcalls and warnFlag , while `scipy.optimize.fmin` returns only xopt by default and returns full optimization information when *full\\_output*=True.\n* [numpy.fmin](https://numpy.org/doc/stable/reference/generated/numpy.fmin.html) is completely different from the other two. It is not an optimization function; instead, it returns the smaller value from two arrays element by element.\n\n#### Parameters\n\n**func** is the objective function to be minimized. The function must return a numeric scalar.\n\n**X0** is a numeric scalar or vector indicating the initial guess.\n\n**xtol** (optional) is a positive number specifying the absolute error in xopt between iterations that is acceptable for convergence. The default value is\n\n**ftol** (optional) is a positive number specifying the absolute error in `func(xopt)` between iterations that is acceptable for convergence. The default value is 0.0001.\n\n**maxIter** (optional) is a non-negative integer indicating the maximum number of iterations to perform.\n\n**maxFun** (optional) is a non-negative integer indicating the maximum number of function evaluations to make.\n\n#### Returns\n\nIt returns a dictionary with the following keys:\n\n* xopt: a vector of floating-point numbers, indicating parameter that minimizes function.\n\n* fopt: a floating-point number, indicating value of function at minimum: `fopt = f(xopt)`.\n\n* iterations: an integer, indicating number of iterations performed.\n\n* fcalls: an integer, indicating number of function calls made.\n\n* warnFlag: an integer that takes the following values\n\n  * 0: Optimization algorithm completed.\n\n  * 1: Maximum number of function evaluations made.\n\n  * 2: Maximum number of iterations reached.\n\n#### Examples\n\nIn the following example, we define a function `f(x)` and use the Nelder-Mead simplex algorithm to find its minimum value.\n\n```\ndef f(x) {return x*x}\nfmin(f, 1)\n/* Ouput:\nxopt->[-8.881784197001252E-16]\nfopt->7.888609052210119E-31\niterations->17\nfcalls->34\nwarnFlag->0\n*/\n```\n\n"
    },
    "fminBFGS": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fminBFGS.html",
        "signatures": [
            {
                "full": "fminBFGS(func, X0, [fprime], [gtol=1e-5], [norm], [epsilon], [maxIter], [xrtol=0], [c1=1e-4], [c2=0.9])",
                "name": "fminBFGS",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X0",
                        "name": "X0"
                    },
                    {
                        "full": "[fprime]",
                        "name": "fprime",
                        "optional": true
                    },
                    {
                        "full": "[gtol=1e-5]",
                        "name": "gtol",
                        "optional": true,
                        "default": "1e-5"
                    },
                    {
                        "full": "[norm]",
                        "name": "norm",
                        "optional": true
                    },
                    {
                        "full": "[epsilon]",
                        "name": "epsilon",
                        "optional": true
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[xrtol=0]",
                        "name": "xrtol",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[c1=1e-4]",
                        "name": "c1",
                        "optional": true,
                        "default": "1e-4"
                    },
                    {
                        "full": "[c2=0.9]",
                        "name": "c2",
                        "optional": true,
                        "default": "0.9"
                    }
                ]
            }
        ],
        "markdown": "### [fminBFGS](https://docs.dolphindb.com/en/Functions/f/fminBFGS.html)\n\n\n\n#### Syntax\n\nfminBFGS(func, X0, \\[fprime], \\[gtol=1e-5], \\[norm], \\[epsilon], \\[maxIter], \\[xrtol=0], \\[c1=1e-4], \\[c2=0.9])\n\n#### Details\n\nMinimize a function using the BFGS algorithm.\n\nDolphinDB `fminBFGS` uses the same BFGS optimization algorithm as `scipy.optimize.fmin_bfgs`, and the core parameters and computational results are consistent. The main differences are: DolphinDB does not support *args* (partial application must be used instead), does not support *full\\_output*/*disp*/*retall*/*callback*/*hess\\_inv0* and other parameters, and returns a dictionary rather than a tuple.\n\n#### Parameters\n\n**func** is the function to minimize. The return value of the function must be numeric type.\n\n**X0** is a numeric scalar or vector indicating the initial guess.\n\n**fprime** (optional) is the gradient of *func*. If not provided, then *func* returns the function value and the gradient.\n\n**gtol** (optional) is a postive number. Iteration will terminates if gradient norm is less than *gtol*. The default value is 1e-5.\n\n**norm** (optional) is a positive number indicating the order of norm. Maximum norm is used by default.\n\n**epsilon** (optional) is a positive number indicating the step size used for numerically calculating the gradient. The default value is 1.4901161193847656e-08.\n\n**maxIter** (optional) is a non-negative integer indicating the maximum number of iterations. The default value is *the size of X0 \\* 200*.\n\n**xrtol** (optional) is a non-negative number indicating the relative tolerance. Iteration will terminate if step size is less than `xk * xrtol` where *xk* is the current parameter vector. The default value is 0.\n\n**c1** (optional) is a number in (0,1) indicating the parameter for Armijo condition rule. The default value is 1e-4.\n\n**c2** (optional) is a number in (0,1) indicating the parameter for curvature condition rule. The default value is 0.9. Note that *c2* must be greater than *c1*.\n\n#### Returns\n\nA dictionary with the following members:\n\n* xopt: A floating-point vector indicating the parameters of the minimum.\n\n* fopt: A floating-point scalar indicating the value of *func* at the minimum, i.e., `fopt=func(xopt)`.\n\n* gopt: A floating-point vector indicating the gradient at the minimum. `gopt=func'(xopt)`, which should be near 0.\n\n* Hinv: A floating-point matrix representing the inverse Hessian matrix.\n\n* iterations: Number of iterations.\n\n* fcalls: Number of function calls made.\n\n* gcalls: Number of gradient calls made.\n\n* warnFlag: An integer, which can be\n\n  * 0: Minimization performed.\n\n  * 1: Maximum number of iterations exceeded.\n\n  * 2: Line search failed or extreme values encountered.\n\n  * 3: Null result encountered.\n\n#### Examples\n\nMinimize function `quadratic_cost` using the BFGS algorithm:\n\n```\ndef quadratic_cost(x, Q) {\n\treturn dot(dot(x, Q), x)\n}\n\ndef quadratic_cost_grad(x, Q) {\n\treturn 2 * dot(Q, x)\n}\n\nx0 = [-3, -4]\ncost_weight = diag([1., 10.])\n\nfminBFGS(quadratic_cost{,cost_weight}, x0, quadratic_cost_grad{,cost_weight})\n```\n\nOutput:\n\n```\nfcalls->8\nwarnFlag->0\nxopt->[0.000002859166,-4.54371E-7]\nHinv->\n#0              #1             \n0.508225788096  -0.001307222772\n-0.001307222772 0.050207740748 \n\ngopt->[0.000005718332,-0.000009087439]\nfopt->1.0E-11\ngcalls->8\niterations->7\n```\n"
    },
    "fminLBFGSB": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fminLBFGSB.html",
        "signatures": [
            {
                "full": "fminLBFGSB(func, X0, [fprime], [bounds], [m=10], [factr=1e7], [pgtol=1e-5], [epsilon=1e-8], [maxIter=15000], [maxFun=15000], [maxLS=20])",
                "name": "fminLBFGSB",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X0",
                        "name": "X0"
                    },
                    {
                        "full": "[fprime]",
                        "name": "fprime",
                        "optional": true
                    },
                    {
                        "full": "[bounds]",
                        "name": "bounds",
                        "optional": true
                    },
                    {
                        "full": "[m=10]",
                        "name": "m",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[factr=1e7]",
                        "name": "factr",
                        "optional": true,
                        "default": "1e7"
                    },
                    {
                        "full": "[pgtol=1e-5]",
                        "name": "pgtol",
                        "optional": true,
                        "default": "1e-5"
                    },
                    {
                        "full": "[epsilon=1e-8]",
                        "name": "epsilon",
                        "optional": true,
                        "default": "1e-8"
                    },
                    {
                        "full": "[maxIter=15000]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "15000"
                    },
                    {
                        "full": "[maxFun=15000]",
                        "name": "maxFun",
                        "optional": true,
                        "default": "15000"
                    },
                    {
                        "full": "[maxLS=20]",
                        "name": "maxLS",
                        "optional": true,
                        "default": "20"
                    }
                ]
            }
        ],
        "markdown": "### [fminLBFGSB](https://docs.dolphindb.com/en/Functions/f/fminLBFGSB.html)\n\n\n\n#### Syntax\n\nfminLBFGSB(func, X0, \\[fprime], \\[bounds], \\[m=10], \\[factr=1e7], \\[pgtol=1e-5], \\[epsilon=1e-8], \\[maxIter=15000], \\[maxFun=15000], \\[maxLS=20])\n\n#### Details\n\nMinimize a function *func* using the L-BFGS-B algorithm.\n\nDifference from Python's `scipy.optimize.fmin_l_bfgs_b`: Both functions use the L-BFGS-B algorithm for optimization. The Python function passes extra arguments to the objective and gradient functions through *args* and provides Python-specific interface parameters such as *approx\\_grad*, *callback*, and *disp*. DolphinDB's `fminLBFGSB` does not provide these parameters; extra arguments can be passed with partial application. The Python function returns a tuple `(x, f, d)`, whereas DolphinDB returns a dictionary containing `xopt`, `fopt`, `gopt`, `iterations`, `fcalls`, and `warnFlag`.\n\n#### Parameters\n\n**func** is the function to minimize. The return value of the function must be numeric type.\n\n**X0** is a numeric scalar or vector indicating the initial guess.\n\n**fprime** (optional) is the gradient of *func*. If not provided, then *func* returns the function value and the gradient (`f, g = func(x, *args)`).\n\n**bounds** (optional) is a numeric matrix indicating the bounds on parameters of *X0*. The matrix must be in the shape of (N,2), where *N*=size(*X0*). The two elements of each row defines the bounds (min, max) on that parameter. `float(\"inf\")` can be specified for no bound in that direction.\n\n**m** (optional) is a positive integer indicating the maximum number of variable metric corrections used to define the limited memory matrix. The default value is 10.\n\n**factr** (optional) is a positive number to stop the iteration when ![](https://docs.dolphindb.com/en/images/factr.png), where *eps* is the machine precision. Typical values for *factr* are: 1e12 for low accuracy; 1e7 (default) for moderate accuracy; 10.0 for extremely high accuracy.\n\n**pgtol** (optional) is a positive number to stop the iteration when ![](https://docs.dolphindb.com/en/images/pgtol1.png), where *proj g\\_i* is the i-th component of the projected gradient. The default value is 1e-5.\n\n**epsilon** (optional) is a positive number indicating the step size used for numerically calculating the gradient. The default value is 1e-8.\n\n**maxIter** (optional) is a non-negative integer indicating the maximum number of iterations. The default value is 15000.\n\n**maxFun** (optional) is a non-negative integer indicating the maximum number of function evaluations. The default value is 15000.\n\n**maxLS** (optional) is a non-negative integer indicating the maximum number of line search steps (per iteration). The default value is 20.\n\n#### Returns\n\nA dictionary with the following members:\n\n* xopt: A floating-point vector indicating the parameters of the minimum.\n\n* fopt: A floating-point scalar indicating the value of *func* at the minimum, i.e., `fopt=func(xopt)`.\n\n* gopt: A floating-point vector indicating the gradient at the minimum, i.e., `gopt=func'(xopt)`.\n\n* iterations: The number of iterations.\n\n* fcalls: The number of function calls made.\n\n* warnFlag: An integer, which can be\n\n  * 0: Minimization performed.\n\n  * 1: Maximum number of evaluations/iterations exceeded.\n\n  * 2: Stopped for other reasons.\n\n#### Examples\n\n```\nX = double(0..9)\nM = 2\nB = 3\nY = double(M * X + B)\ndef fun(params, x, y) {\n\tm = params[0]\n\tb = params[1]\n\ty_model = m*x + b\n\terror = sum(square(y - y_model))\n\treturn error\n}\ninitial_values = [0.0, 1.0]\nfminLBFGSB(fun{,X,Y}, initial_values)\n```\n\nOutput:\n\n```\nfcalls->27\nwarnFlag->0\nxopt->[1.999999985435,3.000000060585]\ngopt->[8.05E-10,8.84E-10]\nfopt->0E-12\niterations->6\n```\n"
    },
    "fminNCG": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fminNCG.html",
        "signatures": [
            {
                "full": "fminNCG(func, X0, fprime, fhess, [xtol=1e-5], [maxIter], [c1=1e-4], [c2=0.9])",
                "name": "fminNCG",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X0",
                        "name": "X0"
                    },
                    {
                        "full": "fprime",
                        "name": "fprime"
                    },
                    {
                        "full": "fhess",
                        "name": "fhess"
                    },
                    {
                        "full": "[xtol=1e-5]",
                        "name": "xtol",
                        "optional": true,
                        "default": "1e-5"
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[c1=1e-4]",
                        "name": "c1",
                        "optional": true,
                        "default": "1e-4"
                    },
                    {
                        "full": "[c2=0.9]",
                        "name": "c2",
                        "optional": true,
                        "default": "0.9"
                    }
                ]
            }
        ],
        "markdown": "### [fminNCG](https://docs.dolphindb.com/en/Functions/f/fminNCG.html)\n\n\n\n#### Syntax\n\nfminNCG(func, X0, fprime, fhess, \\[xtol=1e-5], \\[maxIter], \\[c1=1e-4], \\[c2=0.9])\n\n#### Details\n\nPerform unconstrained minimization of a function using the Newton-CG method.\n\nDifference from Python's `scipy.optimize.fmin_ncg`: Both functions use the Newton-CG method for unconstrained minimization. The Python function supports *fhess\\_p* for specifying the Hessian multiplied by an arbitrary vector, and also provides parameters such as *args*, *epsilon*, *full\\_output*, *disp*, *retall*, and *callback*. DolphinDB's `fminNCG` requires *fhess* to specify the Hessian matrix function; extra arguments can be passed with partial application, and the Python-specific interface parameters are not provided. The Python function returns only `xopt` by default and returns additional information when *full\\_output* is set. DolphinDB always returns a dictionary containing `xopt`, `fopt`, `iterations`, `fcalls`, `gcalls`, `hcalls`, and `warnFlag`.\n\n#### Parameters\n\n**func** is the function to minimize. The return value of the function must be numeric type.\n\n**X0** is a numeric scalar or vector indicating the initial guess.\n\n**fprime** is the gradient of *func*.\n\n**fhess** is the function to compute the Hessian matrix of *func*.\n\n**xtol** (optional) is a positive number. Convergence is assumed when the average relative error in the minimizer falls below this amount. The default value is 1e-5.\n\n**maxIter** (optional) is a non-negative integer indicating the maximum number of iterations. The default value is 15000.\n\n**c1** (optional) is a number in (0,1) indicating the parameter for Armijo condition rule. The default value is 1e-4.\n\n**c2** (optional) is a number in (0,1) indicating the parameter for curvature condition rule. The default value is 0.9. Note that *c2* must be greater than *c1*.\n\n#### Returns\n\nA dictionary with the following members:\n\n* xopt: A floating-point vector indicating the parameters of the minimum.\n\n* fopt: A floating-point scalar indicating the value of *func* at the minimum, i.e., `fopt=func(xopt)`.\n\n* iterations: The number of iterations.\n\n* fcalls: The number of function calls made.\n\n* hcalls: The number of Hessian calls made.\n\n* warnFlag: An integer, which can be\n\n  * 0: Minimization performed.\n\n  * 1: Maximum number of iterations exceeded.\n\n  * 2: Line search failure (precision loss).\n\n  * 3: Null result encountered.\n\n#### Examples\n\nTo minimize function `rosen`:\n\n```\ndef rosen(x) { \n\tN = size(x);\n\treturn sum(100.0*power(x[1:N]-power(x[0:(N-1)], 2.0), 2.0)+power(1-x[0:(N-1)], 2.0));\n}\n\ndef rosen_der(x) {\n\tN = size(x);\n\txm = x[1:(N-1)]\n\txm_m1 = x[0:(N-2)]\n\txm_p1 = x[2:N]\n\tder = array(double, N)\n\tder[1:(N-1)] = (200 * (xm - xm_m1*xm_m1) - 400 * (xm_p1 - xm*xm) * xm - 2 * (1 - xm))\n\tder[0] = -400 * x[0] * (x[1] - x[0]*x[0]) - 2 * (1 - x[0])\n\tder[N-1] = 200 * (x[N-1] - x[N-2]*x[N-2])\n\treturn der\n}\n\ndef diag1(x, k) {\n\tN = size(x)\n\tm = matrix(type(x), N+1,N+1)\n\tif (k == 1) {\n\t\tfor(i in 0:N){\n\t\t\tm[i, i+1] = x[i]\n\t\t}\n\t} else {\n\t\tfor(i in 0:N){\n\t\t\tm[i+1, i] = x[i]\n\t\t}\n\t}\n\n\treturn m\n}\n\ndef rosen_hess(x) {\n\tN = size(x);\n\tx1= x[0:(N-1)] * 400\n\tH = diag1(-x1, 1) - diag1(x1, -1)\n\tdiagonal = array(type(x), N)\n\tdiagonal[0] = 1200 * x[0]*x[0] - 400 * x[1] + 2\n\tdiagonal[N-1] = 200\n\tdiagonal[1:(N-1)] = 202 + 1200 * x[1:(N-1)]*x[1:(N-1)] - 400 * x[2:N]\n\tH = H + diag(diagonal)\n\treturn H\n}\n\nX0 = [4, -2.5]\nfminNCG(rosen, X0, rosen_der, rosen_hess)\n```\n\nOutput:\n\n```\nxopt->[0.999999966120496,0.999999932105584]\nfopt->1.149654357653714E-15\niterations->34\nfcalls->45\ngcalls->45\nhcalls->34\nwarnFlag->0\n```\n"
    },
    "fminSLSQP": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fminSLSQP.html",
        "signatures": [
            {
                "full": "fminSLSQP(func, X0, [fprime], [constraints], [bounds], [ftol=1e-6], [epsilon], [maxIter=100])",
                "name": "fminSLSQP",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X0",
                        "name": "X0"
                    },
                    {
                        "full": "[fprime]",
                        "name": "fprime",
                        "optional": true
                    },
                    {
                        "full": "[constraints]",
                        "name": "constraints",
                        "optional": true
                    },
                    {
                        "full": "[bounds]",
                        "name": "bounds",
                        "optional": true
                    },
                    {
                        "full": "[ftol=1e-6]",
                        "name": "ftol",
                        "optional": true,
                        "default": "1e-6"
                    },
                    {
                        "full": "[epsilon]",
                        "name": "epsilon",
                        "optional": true
                    },
                    {
                        "full": "[maxIter=100]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "100"
                    }
                ]
            }
        ],
        "markdown": "### [fminSLSQP](https://docs.dolphindb.com/en/Functions/f/fminSLSQP.html)\n\n\n\n#### Syntax\n\nfminSLSQP(func, X0, \\[fprime], \\[constraints], \\[bounds], \\[ftol=1e-6], \\[epsilon], \\[maxIter=100])\n\n#### Details\n\nMinimize a function using Sequential Least Squares Programming.\n\nDifference from Python's `scipy.optimize.fmin_slsqp`: Both functions use SLSQP for optimization. The Python function specifies equality and inequality constraints and their gradients through *eqcons*, *f\\_eqcons*, *ieqcons*, *f\\_ieqcons*, *fprime\\_eqcons*, and *fprime\\_ieqcons*, and provides Python-specific interface parameters such as *args*, *iprint*, *disp*, *full\\_output*, and *callback*. DolphinDB's `fminSLSQP` uses *constraints*, a vector of dictionaries where each dictionary describes a constraint with *type*, *fun*, and *jac*; extra arguments can be passed with partial application. The Python function returns only the final minimizer by default and returns the objective value, iteration count, and exit status when *full\\_output* is set. DolphinDB returns a dictionary containing `xopt`, `fopt`, `iterations`, and `mode`.\n\n#### Parameters\n\n**func** is the function to minimize. The return value of the function must be numeric type.\n\n**X0** is a numeric scalar or vector indicating the initial guess.\n\n**fprime** (optional) is the gradient of *func*. If not provided, then *func* returns the function value and the gradient.\n\n**constraints** (optional) is a vector of dictionaries. Each dictionary should include the following keys:\n\n* type: A string indicating the constraint type, which can be 'eq' for equality constraints and 'ineq' for inequality constraints.\n* fun: The constraint function. The return value must be a numeric scalar or vector.\n* jac: The gradient function of constraint *fun*. The return value must be a numeric vector or a matrix. If the size of the return value of fun is m, and the size of the parameters to be optimized is n, then the shape of the return value of jac must be (n,m).\n\nNote: The number of equality constraints in *constraints*cannot exceed the size of the parameters to be optimized. Let n be the number of parameters, k be the number of equality constraint functions, and leni be the size of the return value of the i-th equality constraint function. The following condition must be satisfied: ![](https://docs.dolphindb.com/en/images/leni.png).\n\n**bounds** (optional) is a numeric matrix indicating the bounds on parameters of *X0*. The matrix must be in the shape of (N,2), where *N*=size(*X0*). The two elements of each row defines the bounds (min, max) on that parameter. `float(\"inf\")` can be specified for no bound in that direction.\n\n**ftol** (optional) is a positive number indicating the precision requirement for the function value when the optimization stops. The default value is 1e-6.\n\n**epsilon** (optional) is a positive number indicating the step size used for numerically calculating the gradient. The default value is 1.4901161193847656e-08.\n\n**maxIter** (optional) is a non-negative integer indicating the maximum number of iterations. The default value is 15000.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* xopt: A floating-point vector indicating the parameters of the minimum.\n* fopt: A floating-point scalar indicating the value of *func* at the minimum, i.e., `fopt=func(xopt)`.\n* iterations: Number of iterations.\n* mode: An integer indicating the optimization state. *mode*=0 means optimization succeeded, while other values indicate abnormal algorithm termination. For more information, refer to [jacobwilliams - slsqp](https://jacobwilliams.github.io/slsqp/proc/slsqp.html).\n\n#### Examples\n\nMinimize function `rosen` using Sequential Least Squares Programming:\n\n```\ndef rosen(x) { \n\tN = size(x);\n\treturn sum(100.0*power(x[1:N]-power(x[0:(N-1)], 2.0), 2.0)+power(1-x[0:(N-1)], 2.0));\n}\n\ndef rosen_der(x) {\n\tN = size(x);\n\txm = x[1:(N-1)]\n\txm_m1 = x[0:(N-2)]\n\txm_p1 = x[2:N]\n\tder = array(double, N)\n\tder[1:(N-1)] = (200 * (xm - xm_m1*xm_m1) - 400 * (xm_p1 - xm*xm) * xm - 2 * (1 - xm))\n\tder[0] = -400 * x[0] * (x[1] - x[0]*x[0]) - 2 * (1 - x[0])\n\tder[N-1] = 200 * (x[N-1] - x[N-2]*x[N-2])\n\treturn der\n}\n\ndef eq_fun(x) {\n\treturn 2*x[0] + x[1] - 1\n}\n\ndef eq_jac(x) {\n\treturn [2.0, 1.0]\n}\n\ndef ieq_fun(x) {\n\treturn [1 - x[0] - 2*x[1], 1 - x[0]*x[0] - x[1], 1 - x[0]*x[0] + x[1]]\n}\n\ndef ieq_jac(x) {\n\tret = matrix(DOUBLE, 2, 3)\n\tret[0,:] = [-1.0, -2*x[0], -2*x[0]]\n\tret[1,:] = [-2.0, -1.0, 1.0]\n\treturn ret\n}\n\neqCons=dict(STRING, ANY)\neqCons[`type]=`eq\neqCons[`fun]=eq_fun\neqCons[`jac]=eq_jac\n\nineqCons=dict(STRING, ANY)\nineqCons[`type]=`ineq\nineqCons[`fun]=ieq_fun\nineqCons[`jac]=ieq_jac\n\ncons = [eqCons, ineqCons]\n\nX0 = [0.5, 0]\nbounds = matrix([0 -0.5, 1.0 2.0])\nres = fminSLSQP(rosen, X0, rosen_der, cons, bounds, 1e-9)\nres;\n```\n\nOutput:\n\n```\nmode->0\nxopt->[0.414944749170,0.170110501659]\nfopt->0.342717574994\niterations->4\n```\n"
    },
    "forceMvccCheckpoint": {
        "url": "https://docs.dolphindb.com/en/Functions/f/forceMvccCheckpoint.html",
        "signatures": [
            {
                "full": "forceMvccCheckpoint(mvccTable)",
                "name": "forceMvccCheckpoint",
                "parameters": [
                    {
                        "full": "mvccTable",
                        "name": "mvccTable"
                    }
                ]
            }
        ],
        "markdown": "### [forceMvccCheckpoint](https://docs.dolphindb.com/en/Functions/f/forceMvccCheckpoint.html)\n\n\n\n#### Syntax\n\nforceMvccCheckpoint(mvccTable)\n\n#### Details\n\nManually trigger a checkpoint for the specified MVCC table and clear the data in the log.\n\n#### Parameters\n\n**mvccTable** is the handle of the MVCC table. To obtain a handle of a persisted MVCC table, you can call function `loadMvccTable`.\n\n#### Returns\n\nNone.\n"
    },
    "form": {
        "url": "https://docs.dolphindb.com/en/Functions/f/form.html",
        "signatures": [
            {
                "full": "form(X)",
                "name": "form",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [form](https://docs.dolphindb.com/en/Functions/f/form.html)\n\n\n\n#### Syntax\n\nform(X)\n\n#### Details\n\nGenerate the data form ID of a variable or a constant. Data form IDs and their corresponding data forms are: 0: scalar; 1: vector; 2: pair; 3: matrix; 4: set; 5: dictionary; 6: table.\n\n#### Parameters\n\n**X** is a variable or constant.\n\n#### Returns\n\nAn integer scalar indicating the data form ID.\n\n#### Examples\n\n```\nform(false);\n// output: 0\n\nform(`TEST);\n// output: 0\n\nform(`t1`t2`t3);\n// output: 1\n\nform(1 2 3);\n// output: 1\n\nx= 1 2 3\nif(form(x) == VECTOR){y=1}\ny;\n// output: 1\n\nform(1..6$2:3);\n// output: 3\n```\n"
    },
    "format": {
        "url": "https://docs.dolphindb.com/en/Functions/f/format.html",
        "signatures": [
            {
                "full": "format(X, format)",
                "name": "format",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "format",
                        "name": "format"
                    }
                ]
            }
        ],
        "markdown": "### [format](https://docs.dolphindb.com/en/Functions/f/format.html)\n\n\n\n#### Syntax\n\nformat(X, format)\n\n#### Details\n\nApplies a specified format to the given object.\n\n**Note:**\n\nBoth DolphinDB `format` and Python's built-in [format](https://docs.python.org/3/library/functions.html#format) are used for formatted output, but their format string syntaxes differ and are not directly interchangeable.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n**format** is a string indicating the format to be applied to *X*. Depending on the data type of input *X*, *format* calls either function [decimalFormat](https://docs.dolphindb.com/en/Functions/d/decimalFormat.html) or [temporalFormat](https://docs.dolphindb.com/en/Functions/t/temporalFormat.html).\n\n#### Returns\n\nA STRING scalar/vector.\n\n#### Examples\n\n```\nt = table(1..100 as id, (1..100 + 2018.01.01) as date, rand(100.0, 100) as price, rand(10000, 100) as qty);\nt;\n```\n\n| id  | date       | price     | qty  |\n| --- | ---------- | --------- | ---- |\n| 1   | 2018.01.02 | 70.832104 | 1719 |\n| 2   | 2018.01.03 | 12.22557  | 6229 |\n| 3   | 2018.01.04 | 8.695886  | 1656 |\n| 4   | 2018.01.05 | 24.324535 | 2860 |\n| 5   | 2018.01.06 | 0.443173  | 6874 |\n| 6   | 2018.01.07 | 90.302176 | 3277 |\n| 7   | 2018.01.08 | 78.556843 | 3424 |\n| 8   | 2018.01.09 | 45.836447 | 8636 |\n| 9   | 2018.01.10 | 57.416425 | 707  |\n| 10  | 2018.01.11 | 98.879764 | 2267 |\n| ... |            |           |      |\n\n```\nselect id, date.format(\"MM/dd/yyyy\") as date, price.format(\"00.00\") as price, qty.format(\"#,###\") as qty from t;\n```\n\n| id  | date       | price | qty   |\n| --- | ---------- | ----- | ----- |\n| 1   | 01/02/2018 | 70.83 | 1,719 |\n| 2   | 01/03/2018 | 12.23 | 6,229 |\n| 3   | 01/04/2018 | 08.70 | 1,656 |\n| 4   | 01/05/2018 | 24.32 | 2,860 |\n| 5   | 01/06/2018 | 00.44 | 6,874 |\n| 6   | 01/07/2018 | 90.30 | 3,277 |\n| 7   | 01/08/2018 | 78.56 | 3,424 |\n| 8   | 01/09/2018 | 45.84 | 8,636 |\n| 9   | 01/10/2018 | 57.42 | 707   |\n| 10  | 01/11/2018 | 98.88 | 2,267 |\n| ... |            |       |       |\n"
    },
    "fromJson": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fromJson.html",
        "signatures": [
            {
                "full": "fromJson(X)",
                "name": "fromJson",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [fromJson](https://docs.dolphindb.com/en/Functions/f/fromJson.html)\n\n\n\n#### Syntax\n\nfromJson(X)\n\n#### Details\n\nConverta a JSON string that complies with DolphinDB specification to a DolphinDB variable.\n\nA JSON string that complies with DolphinDB specification has at least the following 3 key-value pairs: form, type and value.\n\nFor a table, the key-value pair 'name' can indicate column names.\n\n#### Parameters\n\n**X** is a JSON string that complies with DolphinDB specification.\n\n#### Returns\n\nIt returns a DolphinDB object whose format and type are determined by the \"form\" and \"type\" fields in the JSON string.\n\n#### Examples\n\n```\nx=1 2 3\ny=toJson(x)\ny;\n// output: {\"name\":\"x\",\"form\":\"vector\",\"type\":\"int\",\"size\":\"3\",\"value\":[1,2,3]}\n\nfromJson(y);\n// output: [1,2,3]\n```\n\nRelated functions: [toJson](https://docs.dolphindb.com/en/Functions/t/toJson.html)\n"
    },
    "fromStdJson": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fromStdJson.html",
        "signatures": [
            {
                "full": "fromStdJson(X)",
                "name": "fromStdJson",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [fromStdJson](https://docs.dolphindb.com/en/Functions/f/fromStdJson.html)\n\n#### Syntax\n\nfromStdJson(X)\n\n#### Details\n\nConvert *X* to a DolphinDB variable. The following table shows the data form/type mappings.\n\n| JSON    | DolphinDB                                                                                                    |\n| ------- | ------------------------------------------------------------------------------------------------------------ |\n| object  | Dictionary whose keys must be of STRING type, and values can be of ANY type if multiple types are converted. |\n| array   | vector                                                                                                       |\n| string  | Convert to a Temporal value first. If fails, it convert to a UTF-8 string.                                   |\n| number  | DOUBLE                                                                                                       |\n| boolean | BOOL                                                                                                         |\n| null    | NULL                                                                                                         |\n\nNote: Escape sequences will be automatically interpreted during conversion.\n\n#### Parameters\n\n**X** is a scalar or vector of standard JSON string(s).\n\n#### Returns\n\nThe format and type of the return value are determined by the data types in the input JSON. For the specific conversion rules, refer to the mapping table in the Details.\n\n#### Examples\n\n```\nX = \"[1, 2, 3]\";\nfromStdJson(X);\n//output:[1,2,3]\n\nX = \"{\\\"1\\\": \\\"2017.07.10 14:10:12\\\",\\\"0\\\": \\\"2012.06.13 13:30:10\\\"}\";\nfromStdJson(X);\n/* output:1->2017.07.10T14:10:12\n      0->2012.06.13T13:30:10\n*/\n```\n\n"
    },
    "fromUTF8": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fromUTF8.html",
        "signatures": [
            {
                "full": "fromUTF8(str, encode)",
                "name": "fromUTF8",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "encode",
                        "name": "encode"
                    }
                ]
            }
        ],
        "markdown": "### [fromUTF8](https://docs.dolphindb.com/en/Functions/f/fromUTF8.html)\n\n\n\n#### Syntax\n\nfromUTF8(str, encode)\n\n#### Details\n\nConvert the encoding of strings from UTF-8.\n\nFor the Windows version, *encode* can only be \"gbk\".\n\n#### Parameters\n\n**str** is a STRING scalar/vector.\n\n**encode** is a string indicating the new encoding name. It must use lowercase.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nfromUTF8(\"DolphinDB\",\"gbk\");\n// output: DolphinDB\n\nfromUTF8([\"hello\",\"world\"],\"euc-cn\");\n// output: [\"hello\",\"world\"]\n```\n"
    },
    "fTest": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fTest.html",
        "signatures": [
            {
                "full": "fTest(X, Y, [ratio=1.0], [confLevel=0.95])",
                "name": "fTest",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[ratio=1.0]",
                        "name": "ratio",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[confLevel=0.95]",
                        "name": "confLevel",
                        "optional": true,
                        "default": "0.95"
                    }
                ]
            }
        ],
        "markdown": "### [fTest](https://docs.dolphindb.com/en/Functions/f/fTest.html)\n\n\n\n#### Syntax\n\nfTest(X, Y, \\[ratio=1.0], \\[confLevel=0.95])\n\n#### Details\n\nConduct an F-test to compare the variances of two samples.\n\nReturn a dictionary with the following keys:\n\n* stat: a table with p-value and confidence interval under 3 alternative hypotheses\n\n* numeratorDf: degree of freedom of the numerator\n\n* denominatorDf: degree of freedom of the denominator\n\n* confLevel: confidence level\n\n* method: \"F test to compare two variances\"\n\n* fValue: F-stat\n\n#### Parameters\n\n**X** is a numeric vector indicating the first sample for the F-test.\n\n**Y** is a numeric vector indicating the second sample for the F-test.\n\n**ratio** (optional) is a positive floating number indicating the ratio of the variances of *X* and *Y* in the null hypothesis. The default value is 1.\n\n**confLevel** (optional) is a floating number between 0 and 1 indicating the confidence level of the test. It is optional and the default value is 0.95.\n\n#### Returns\n\nIt returns a dictionary with the following keys:\n\n* stat: a table with p-value and confidence interval under 3 alternative hypotheses\n\n* numeratorDf: degree of freedom of the numerator\n\n* denominatorDf: degree of freedom of the denominator\n\n* confLevel: confidence level\n\n* method: \"F test to compare two variances\"\n\n* fValue: F-stat\n\n#### Examples\n\n```\nx = norm(10.0, 1.0, 20);\ny = norm(1.0, 2.0, 10);\nfTest(x, y, 0.5);\n\n/* output\nnumeratorDf->19\nstat->\nalternativeHypothesis                  pValue    lowerBound upperBound\n-------------------------------------- --------- ---------- ----------\nratio of variances is not equal to 0.5 0.002326  0.025844   0.274161\nratio of variances is less than 0.5    0.001163  0          0.230624\nratio of variances is greater than 0.5 0.998837  0.032295   Infinity\n\ndenominatorDf->9\nconfLevel->0.95\nfValue->0.190386\nmethod->F test to compare two variances\n*/\n```\n"
    },
    "funcByName": {
        "url": "https://docs.dolphindb.com/en/Functions/f/funcByName.html",
        "signatures": [
            {
                "full": "funcByName(name)",
                "name": "funcByName",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [funcByName](https://docs.dolphindb.com/en/Functions/f/funcByName.html)\n\n\n\n#### Syntax\n\nfuncByName(name)\n\n#### Details\n\nDynamically execute an operator or a function. It is mainly used in metaprogramming.\n\n#### Parameters\n\n**name** is a string indicating an operator or a function. The function can be either a built-in function or a user-defined function.\n\n#### Returns\n\nA FUNCTIONDEF object.\n\n#### Examples\n\n```\ndef f(x, a, b){\n   return funcByName(x)(a, b)\n}\n\nf(\"+\", 1 2 3, 4 5 6);\n// output: [5,7,9]\n\nf(\"sub\", 1 8 3, 4 8 6);\n// output: [-3,0,-3]\n\nf(\"corr\", 1 8 3, 4 8 6);\n// output: 0.970725\n\ndef cal(a,b){\n   return pow(a\\b,2)\n}\n\nf(\"cal\", 4 8 10, 2 2 2);\n// output: [4,16,25]\n\nfuncByName(\"call\")(sum,1..10);\n// output: 55\n```\n"
    },
    "fxEuropeanOptionPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fxEuropeanOptionPricer.html",
        "signatures": [
            {
                "full": "fxEuropeanOptionPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve, volSurf, [setting])",
                "name": "fxEuropeanOptionPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "domesticCurve",
                        "name": "domesticCurve"
                    },
                    {
                        "full": "foreignCurve",
                        "name": "foreignCurve"
                    },
                    {
                        "full": "volSurf",
                        "name": "volSurf"
                    },
                    {
                        "full": "[setting]",
                        "name": "setting",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [fxEuropeanOptionPricer](https://docs.dolphindb.com/en/Functions/f/fxEuropeanOptionPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nfxEuropeanOptionPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve, volSurf, \\[setting])\n\n#### Details\n\nPrices a foreign exchange European option using BlackScholes Model and Analytic Method, and returns its net present value (NPV).\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**instrument** An INSTRUMENT scalar/vector representing the FX European option(s) to be priced. See [Product Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxEuropeanOptionPricer.html#topic_yzx_3tq_ngc) for details.\n\n**pricingDate** A DATE scalar/vector specifying the valuation date(s).\n\n**spot**A numeric scalar/vector representing the spot FX rate(s).\n\n**domesticCurve** A MKTDATA scalar/vector representing the domestic discount curve(s). See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxEuropeanOptionPricer.html#topic_pgr_jtq_ngc) for details.\n\n**foreignCurve** A MKTDATA scalar/vector representing the foreign discount curve(s). See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxEuropeanOptionPricer.html#topic_pgr_jtq_ngc) for details.\n\n**volSurf** A MKTDATA scalar/vector representing the FX volatility surface(s). See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxEuropeanOptionPricer.html#topic_pgr_jtq_ngc) for details.\n\n**setting** (optional): A dictionary used to configure pricing outputs. It supports the following keys:\n\n* calcDelta: Set a boolean value to specify whether to calculate delta.\n\n* calcGamma: Set a boolean value to specify whether to calculate gamma.\n\n* calcVega: Set a boolean value to specify whether to calculate vega.\n\n* calcTheta: Set a boolean value to specify whether to calculate theta.\n\n* calcRhoDomestic: Set a boolean value to specify whether to calculate domestic rho.\n\n* calcRhoForeign: Set a boolean value to specify whether to calculate foreign rho.\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\npricingDate = 2025.08.18\nccyPair = \"USDCNY\"\n\noption = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 7.2,\n    \"maturity\": 2025.10.28,\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": ccyPair\n}\n\nquoteTerms = ['1d', '1w', '2w', '3w', '1M', '2M', '3M', '6M', '9M', '1y', '18M', '2y', '3y']\nquoteNames = [\"ATM\", \"D25_RR\", \"D25_BF\", \"D10_RR\", \"D10_BF\"]\nquotes = [0.030000, -0.007500, 0.003500, -0.010000, 0.005500, \n          0.020833, -0.004500, 0.002000, -0.006000, 0.003800, \n          0.022000, -0.003500, 0.002000, -0.004500, 0.004100, \n          0.022350, -0.003500, 0.002000, -0.004500, 0.004150, \n          0.024178, -0.003000, 0.002200, -0.004750, 0.005500, \n          0.027484, -0.002650, 0.002220, -0.004000, 0.005650, \n          0.030479, -0.002500, 0.002400, -0.003500, 0.005750, \n          0.035752, -0.000500, 0.002750,  0.000000, 0.006950, \n          0.038108,  0.001000, 0.002800,  0.003000, 0.007550, \n          0.039492,  0.002250, 0.002950,  0.005000, 0.007550, \n          0.040500,  0.004000, 0.003100,  0.007000, 0.007850, \n          0.041750,  0.005250, 0.003350,  0.008000, 0.008400, \n          0.044750,  0.006250, 0.003400,  0.009000, 0.008550]\nquotes = reshape(quotes, size(quoteNames):size(quoteTerms)).transpose()\n\ncurveDates = [2025.08.21,\n              2025.08.27,\n              2025.09.03,\n              2025.09.10,\n              2025.09.22,\n              2025.10.20,\n              2025.11.20,\n              2026.02.24,\n              2026.05.20,\n              2026.08.20,\n              2027.02.22,\n              2027.08.20,\n              2028.08.21]\n              \ndomesticCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[1.5113, \n              1.5402, \n              1.5660, \n              1.5574, \n              1.5556, \n              1.5655, \n              1.5703, \n              1.5934, \n              1.6040, \n              1.6020, \n              1.5928, \n              1.5842, \n              1.6068]/100\n}\nforeignCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[4.3345, \n              4.3801, \n              4.3119, \n              4.3065, \n              4.2922, \n              4.2196, \n              4.1599, \n              4.0443, \n              4.0244, \n              3.9698, \n              3.7740, \n              3.6289, \n              3.5003]/100\n}\n\nspot = 7.1627\ninstrument = parseInstrument(option)\ndomesticCurve = parseMktData(domesticCurveInfo)\nforeignCurve = parseMktData(foreignCurveInfo)\nsurf = fxVolatilitySurfaceBuilder(pricingDate, ccyPair, quoteNames, quoteTerms, quotes, spot, domesticCurve, foreignCurve)\n\nfxEuropeanOptionPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve, surf)   // output: 1693.9919\nfxEuropeanOptionPricer([instrument, instrument], pricingDate, spot, domesticCurve, foreignCurve, surf)\nfxEuropeanOptionPricer(instrument, [pricingDate, pricingDate], spot, domesticCurve, foreignCurve, surf)\nfxEuropeanOptionPricer(instrument, pricingDate, [spot, spot], domesticCurve, foreignCurve, surf)\nfxEuropeanOptionPricer(instrument, pricingDate, spot, [domesticCurve, domesticCurve], foreignCurve, surf)\nfxEuropeanOptionPricer(instrument, pricingDate, spot, domesticCurve, [foreignCurve, foreignCurve], surf)\nfxEuropeanOptionPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve, [surf, surf])\n```\n\n**Related functions:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n\n#### Product Field Specifications\n\n<table id=\"table_pvt_wtq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Option\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\noptionType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"EuropeanOption\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FxEuropeanOption\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalAmount\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNotional principal amount\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalCurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nNotional principal\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInstrumentId ID\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nunderlying\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe currency pair, in the format \"EURUSD\", \"EUR.USD\", or \"EUR/USD\". Supported currency pairs include:\n\n* \"EURUSD\": Euro to US Dollar\n\n* \"USDCNY\": US Dollar to Chinese Yuan\n\n* \"EURCNY\": Euro to Chinese Yuan\n\n* \"GBPCNY\": British Pound to Chinese Yuan\n\n* \"JPYCNY\": Japanese Yen to Chinese Yuan\n\n* \"HKDCNY\": Hong Kong Dollar to Chinese Yuan\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndirection\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nTrading direction, can be \"Buy\" or \"Sell\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nstrike\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nStrike price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\npayoffType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nPayoff type. It can be \"Call\" or \"Put\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndomesticCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe domestic discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nforeignCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe foreign discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndelivery\n\n</td><td>\n\nDATE\n\n</td><td>\n\nThe delivery date\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>## Curve Field Specifications\n\n**IrYieldCurve**\n\n<table id=\"table_n5j_nl1_4gc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; Currently, only \"Bootstrap\" is supported.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>**FxVolatilitySurface**\n\n<table id=\"table_rx1_b5q_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Surface\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsurfaceType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FxVolatilitySurface\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsmileMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nVolatility smile method. It can be:\n\n* \"Linear\": linear smile\n\n* \"CubicSpline\": cubic-spline smile\n\n* \"SVI\": SVI-model smile\n\n* \"SABR\": SABR-model smile\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvolSmiles\n\n</td><td>\n\nDICT(STRING, ANY)vector\n\n</td><td>\n\nVolatility smiles vector. Each element is one smile . It has the following members:\n\n* **strikes**: A DOUBLE vector indicating the strike prices.\n\n* **vols**: A DOUBLE vector indicating the volatilities corresponding to *strikes*(of the same length).\n\n* **curveParams**: A DICT(STRING, DOUBLE) indicating the model parameters for the smile method; only effective when *smileMethod*is \"SVI\" or \"SABR\":\n\n  * smileMethod = 'SVI': Must have the keys: 'a', 'b', 'rho', 'm', 'sigma'\n\n  * smileMethod = 'SABR':\n\nMust have the keys: 'alpha', 'beta', 'rho', 'nu'\n\n* **fwd** (optional ): A DOUBLE scalar indicating the forward value. It is required when *smileMethod*is \"SVI\" or \"SABR\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ntermDates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nTerm date corresponding to each smile in *volSmiles*.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsurfaceName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSurface name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrencyPair\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nForeign exchange currency pair. Available options: \"EURUSD\", \"USDCNY\", \"EURCNY\", \"GBPCNY\", \"JPYCNY\", \"HKDCNY\".\n\nCurrency pairs may also use `.` or `/` as separators. For example, \"EURUSD\" can also be written as \"EUR.USD\" or \"EUR/USD\".\n\n</td><td>\n\n√\n\n</td></tr></tbody>\n</table>\n"
    },
    "fxForwardPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fxForwardPricer.html",
        "signatures": [
            {
                "full": "fxForwardPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)",
                "name": "fxForwardPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "domesticCurve",
                        "name": "domesticCurve"
                    },
                    {
                        "full": "foreignCurve",
                        "name": "foreignCurve"
                    }
                ]
            }
        ],
        "markdown": "### [fxForwardPricer](https://docs.dolphindb.com/en/Functions/f/fxForwardPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nfxForwardPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)\n\n#### Details\n\nComputes the Net Present Value (NPV) of the FX forward contract based on the given spot rate, domestic and foreign discount curves, and the pricing date.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**instrument** An INSTRUMENT scalar/vector of type FxForward, representing the FX forward to be priced. See[Product Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxForwardPricer.html#topic_fft_x5q_ngc) for details.\n\n**pricingDate** A DATE scalar/vector specifying the pricing date(s).\n\n**spot** A DOUBLE scalar/vector representing the spot exchange rate(s).\n\n**domesticCurve** A MKTDATA scalar/vector of type IrYieldCurve representing the domestic discount curve(s). See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxForwardPricer.html#topic_apg_y5q_ngc) for details.\n\n**foreignCurve** A MKTDATA scalar/vector of type IrYieldCurve representing the foreign discount curve(s). See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxForwardPricer.html#topic_apg_y5q_ngc) for details.\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\npricingDate = 2025.08.18\n\nfxForward = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.12.16,\n    \"delivery\": 2025.12.18,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 7.1\n}\n\ncurveDates = [2025.08.21,\n              2025.08.27,\n              2025.09.03,\n              2025.09.10,\n              2025.09.22,\n              2025.10.20,\n              2025.11.20,\n              2026.02.24,\n              2026.05.20,\n              2026.08.20,\n              2027.02.22,\n              2027.08.20,\n              2028.08.21]\ndomesticCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[1.5113, \n              1.5402, \n              1.5660, \n              1.5574, \n              1.5556, \n              1.5655, \n              1.5703, \n              1.5934, \n              1.6040, \n              1.6020, \n              1.5928, \n              1.5842, \n              1.6068]/100\n}\nforeignCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[4.3345, \n              4.3801, \n              4.3119, \n              4.3065, \n              4.2922, \n              4.2196, \n              4.1599, \n              4.0443, \n              4.0244, \n              3.9698, \n              3.7740, \n              3.6289, \n              3.5003]/100\n}\n\ninstrument = parseInstrument(fxForward)\n\ndomesticCurve = parseMktData(domesticCurveInfo)\nforeignCurve = parseMktData(foreignCurveInfo)\nspot = 7.1627\n\nfxForwardPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)   // output: 1919.8118\nfxForwardPricer([instrument, instrument], pricingDate, spot, domesticCurve, foreignCurve)\nfxForwardPricer(instrument, [pricingDate, pricingDate], spot, domesticCurve, foreignCurve)\nfxForwardPricer(instrument, pricingDate, [spot, spot], domesticCurve, foreignCurve)\nfxForwardPricer(instrument, pricingDate, spot, [domesticCurve, domesticCurve], foreignCurve)\nfxForwardPricer(instrument, pricingDate, spot, domesticCurve, [foreignCurve, foreignCurve])\n```\n\n**Related functions**: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n\n#### Product Field Specifications\n\n<table id=\"table_dm3_3vq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nProduct name. It must be \"Forward\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nforwardType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nForeign exchange forward type. It must be \"FxForward\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalAmount\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNotional principal amount\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalCurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nNotional principal\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInstrumentId ID\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nexpiry\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndelivery\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrencyPair\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe currency pair, in the format \"EURUSD\", \"EUR.USD\", or \"EUR/USD\". Supported currency pairs include:\n\n* \"EURUSD\": Euro to US Dollar\n\n* \"USDCNY\": US Dollar to Chinese Yuan\n\n* \"EURCNY\": Euro to Chinese Yuan\n\n* \"GBPCNY\": British Pound to Chinese Yuan\n\n* \"JPYCNY\": Japanese Yen to Chinese Yuan\n\n* \"HKDCNY\": Hong Kong Dollar to Chinese Yuan\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndirection\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nTrading direction, can be \"Buy\" or \"Sell\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nstrike\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nStrike price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndomesticCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe domestic discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nforeignCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe foreign discount curve name\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>## Curve Field Specifications\n\n<table id=\"table_p1w_qk1_4gc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; Currently, only \"Bootstrap\" is supported.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>\n"
    },
    "fxSwapPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fxSwapPricer.html",
        "signatures": [
            {
                "full": "fxSwapPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)",
                "name": "fxSwapPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "domesticCurve",
                        "name": "domesticCurve"
                    },
                    {
                        "full": "foreignCurve",
                        "name": "foreignCurve"
                    }
                ]
            }
        ],
        "markdown": "### [fxSwapPricer](https://docs.dolphindb.com/en/Functions/f/fxSwapPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nfxSwapPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)\n\n#### Details\n\nCalculates the Net Present Value (NPV) of the foreign exchange swap(s).\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**instrument** is an INSTRUMENT scalar/vector of FxSwap type indicating the foreign exchange swap(s) to be priced.\n\n**pricingDate** is a DATE scalar/vector specifying the pricing date(s).\n\n**spot** is a numeric scalar/vector indicating the spot exchange rate(s).\n\n**domesticCurve** A MKTDATA scalar/vector representing the domestic discount curve(s).\n\n**foreignCurve** A MKTDATA scalar/vector representing the foreign discount curve(s).\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\npricingDate = 2025.08.18\n\nfxSwap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 7.15,\n    \"nearExpiry\": pricingDate + 60,\n    \"nearDelivery\": pricingDate + 62,\n    \"farStrike\": 7.18,\n    \"farExpiry\": pricingDate + 180,\n    \"farDelivery\": pricingDate + 182\n}\n\ncurveDates = [2025.08.21,\n              2025.08.27,\n              2025.09.03,\n              2025.09.10,\n              2025.09.22,\n              2025.10.20,\n              2025.11.20,\n              2026.02.24,\n              2026.05.20,\n              2026.08.20,\n              2027.02.22,\n              2027.08.20,\n              2028.08.21]\ndomesticCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[1.5113, \n              1.5402, \n              1.5660, \n              1.5574, \n              1.5556, \n              1.5655, \n              1.5703, \n              1.5934, \n              1.6040, \n              1.6020, \n              1.5928, \n              1.5842, \n              1.6068]/100\n}\nforeignCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[4.3345, \n              4.3801, \n              4.3119, \n              4.3065, \n              4.2922, \n              4.2196, \n              4.1599, \n              4.0443, \n              4.0244, \n              3.9698, \n              3.7740, \n              3.6289, \n              3.5003]/100\n}\n\ninstrument = parseInstrument(fxSwap)\ndomesticCurve = parseMktData(domesticCurveInfo)\nforeignCurve = parseMktData(foreignCurveInfo)\nspot = 7.1627\n\nfxSwapPricer(instrument, pricingDate, spot, domesticCurve, foreignCurve)   // output:84379.328782705269986\nfxSwapPricer(instrument, pricingDate, [spot, spot], domesticCurve, foreignCurve)\nfxSwapPricer(instrument, [pricingDate, pricingDate], spot, domesticCurve, foreignCurve)\nfxSwapPricer([instrument, instrument], pricingDate, spot, domesticCurve, foreignCurve)\nfxSwapPricer(instrument, pricingDate, spot, [domesticCurve, domesticCurve], foreignCurve)\nfxSwapPricer(instrument, pricingDate, spot, domesticCurve, [foreignCurve, foreignCurve])\n```\n\n**Related functions:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "fxVolatilitySurfaceBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fxVolatilitySurfaceBuilder.html",
        "signatures": [
            {
                "full": "fxVolatilitySurfaceBuilder(referenceDate, currencyPair, quoteNames, quoteTerms, quotes, spot, domesticCurve, foreignCurve, [model='SVI'], [surfaceName])",
                "name": "fxVolatilitySurfaceBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "currencyPair",
                        "name": "currencyPair"
                    },
                    {
                        "full": "quoteNames",
                        "name": "quoteNames"
                    },
                    {
                        "full": "quoteTerms",
                        "name": "quoteTerms"
                    },
                    {
                        "full": "quotes",
                        "name": "quotes"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "domesticCurve",
                        "name": "domesticCurve"
                    },
                    {
                        "full": "foreignCurve",
                        "name": "foreignCurve"
                    },
                    {
                        "full": "[model='SVI']",
                        "name": "model",
                        "optional": true,
                        "default": "'SVI'"
                    },
                    {
                        "full": "[surfaceName]",
                        "name": "surfaceName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [fxVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/f/fxVolatilitySurfaceBuilder.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nfxVolatilitySurfaceBuilder(referenceDate, currencyPair, quoteNames, quoteTerms, quotes, spot, domesticCurve, foreignCurve, \\[model='SVI'], \\[surfaceName])\n\n#### Details\n\nBuilds a foreign exchange volatility surface.\n\n#### Parameters\n\n**referenceDate**A DATE scalar specifying the reference date of the surface.\n\n**currencyPair**A STRING scalar specifying the currency pair, in the format \"EURUSD\", \"EUR.USD\", or \"EUR/USD\". Supported currency pairs include:\n\n* \"EURUSD\": Euro to US Dollar\n\n* \"USDCNY\": US Dollar to Chinese Yuan\n\n* \"EURCNY\": Euro to Chinese Yuan\n\n* \"GBPCNY\": British Pound to Chinese Yuan\n\n* \"JPYCNY\": Japanese Yen to Chinese Yuan\n\n* \"HKDCNY\": Hong Kong Dollar to Chinese Yuan\n\n**quoteNames** A STRING vector specifying the names of market volatility quotes，which must be a permutation of \\[\"ATM\", \"D25\\_RR\", \"D25\\_BF\", \"D10\\_RR\", \"D10\\_BF\"], where:\n\n* \"ATM\": At-the-money volatility\n\n* \"D25\\_RR\": Risk reversal with Delta = 0.25\n\n* \"D25\\_BF\": Butterfly with Delta = 0.25\n\n* \"D10\\_RR\": Risk reversal with Delta = 0.1\n\n* \"D10\\_BF\": Butterfly with Delta = 0.1\n\n**quoteTerms** A vector of DURATION or STRING type, representing the tenors associated with market quotes. When it is a STRING scalar, in addition to strings that can be converted into DURATION, the following optional values are also supported:\n\n* \"ON\": Overnight, near leg value date is T, far leg value date is T+1\n\n* \"TN\": Tomorrow-next, near leg value date is T+1, far leg value date is T+2\n\n* \"SN\": Spot-next, near leg value date is T+2, far leg value date is T+3\n\n**quotes** A DOUBLE matrix with shape `(size(quoteTerms), size(quoteNames))`. The entry at row i and column j represents the quote of quoteNames\\[j] for tenor quoteTerms\\[i].\n\n**spot** A DOUBLE scalar representing the spot exchange rate.\n\n**domesticCurve** A MKTDATA object of type IrYieldCurve representing the domestic discount curve. See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxVolatilitySurfaceBuilder.html#topic_hhh_fzq_ngc) for details.\n\n**foreignCurve** A MKTDATA object of type IrYieldCurve representing the foreign discount curve. See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/f/fxVolatilitySurfaceBuilder.html#topic_hhh_fzq_ngc) for details.\n\n**model** (optional) A STRING scalar specifying the model used to construct the surface. Options:\n\n* “SVI” (default): Stochastic Volatility Inspired model\n\n* “SABR”: Stochastic Alpha Beta Rho model\n\n* “Linear”: Linear interpolation model\n\n* “CubicSpline”: Cubic spline interpolation model\n\n**surfaceName** (optional) A STRING scalar specifying the name of the volatility surface. The default value is \"FXVOLSURF/{currencyPair}\".\n\n#### Returns\n\nA FxVolatilitySurface object of MKTDATA type.\n\n#### Examples\n\n```\nrefDate = 2025.08.18\nccyPair = \"USDCNY\"\nquoteTerms = ['1d', '1w', '2w', '3w', '1M', '2M', '3M', '6M', '9M', '1y', '18M', '2y', '3y']\nquoteNames = [\"ATM\", \"D25_RR\", \"D25_BF\", \"D10_RR\", \"D10_BF\"]\nquotes = [0.030000, -0.007500, 0.003500, -0.010000, 0.005500, \n          0.020833, -0.004500, 0.002000, -0.006000, 0.003800, \n          0.022000, -0.003500, 0.002000, -0.004500, 0.004100, \n          0.022350, -0.003500, 0.002000, -0.004500, 0.004150, \n          0.024178, -0.003000, 0.002200, -0.004750, 0.005500, \n          0.027484, -0.002650, 0.002220, -0.004000, 0.005650, \n          0.030479, -0.002500, 0.002400, -0.003500, 0.005750, \n          0.035752, -0.000500, 0.002750,  0.000000, 0.006950, \n          0.038108,  0.001000, 0.002800,  0.003000, 0.007550, \n          0.039492,  0.002250, 0.002950,  0.005000, 0.007550, \n          0.040500,  0.004000, 0.003100,  0.007000, 0.007850, \n          0.041750,  0.005250, 0.003350,  0.008000, 0.008400, \n          0.044750,  0.006250, 0.003400,  0.009000, 0.008550]\nquotes = reshape(quotes, size(quoteNames):size(quoteTerms)).transpose()\nspot = 7.1627\ncurveDates = [2025.08.21,\n              2025.08.27,\n              2025.09.03,\n              2025.09.10,\n              2025.09.22,\n              2025.10.20,\n              2025.11.20,\n              2026.02.24,\n              2026.05.20,\n              2026.08.20,\n              2027.02.22,\n              2027.08.20,\n              2028.08.21]\ndomesticCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": refDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[1.5113, \n              1.5402, \n              1.5660, \n              1.5574, \n              1.5556, \n              1.5655, \n              1.5703, \n              1.5934, \n              1.6040, \n              1.6020, \n              1.5928, \n              1.5842, \n              1.6068]/100\n}\nforeignCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": refDate,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[4.3345, \n              4.3801, \n              4.3119, \n              4.3065, \n              4.2922, \n              4.2196, \n              4.1599, \n              4.0443, \n              4.0244, \n              3.9698, \n              3.7740, \n              3.6289, \n              3.5003]/100\n}\ndomesticCurve = parseMktData(domesticCurveInfo)\nforeignCurve = parseMktData(foreignCurveInfo)\nsurf = fxVolatilitySurfaceBuilder(refDate, ccyPair, quoteNames, quoteTerms, quotes, spot, domesticCurve, foreignCurve)\nsurfDict = extractMktData(surf)\nprint(surfDict)\n\n```\n\n**Related functions:** [extractMktData](https://docs.dolphindb.com/en/Functions/e/extractMktData.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n\n#### Curve Field Specifications\n\n<table id=\"table_bwd_jn1_4gc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; Currently, only \"Bootstrap\" is supported.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>\n"
    },
    "fy5253": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fy5253.html",
        "signatures": [
            {
                "full": "fy5253(X, [weekday=0], [startingMonth=1], [nearest=true], [offset], [n=1])",
                "name": "fy5253",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[weekday=0]",
                        "name": "weekday",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[startingMonth=1]",
                        "name": "startingMonth",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[nearest=true]",
                        "name": "nearest",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [fy5253](https://docs.dolphindb.com/en/Functions/f/fy5253.html)\n\n\n\n#### Syntax\n\nfy5253(X, \\[weekday=0], \\[startingMonth=1], \\[nearest=true], \\[offset], \\[n=1])\n\n#### Details\n\nUsing the 52-53 weeks in a fiscal year (4-4-5 calendar), it returns the start date of fiscal year which includes *X*.\n\n* If *nearest*=true, the last weekday which is closest to the last day of *startingMonth* will be used as the starting date of the fiscal year.\n\n* If *nearest*=false, the last weekday in *startingMonth* will be used as the starting date of the fiscal year.\n\nIf *offset* is specified, it means that starting from the *offset*, the result will be updated every *n* years. Note that *offset* can take effect only when *n* is greater than 1.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector. Its data type can be DATE, DATETIME, TIMESTAMP, or NANOTIMESTAMP.\n\n**weekday** (optional) is an integer between 0 and 6. 0 means Monday, 1 means Tuesday, …, and 6 means Sunday. The default value is 0.\n\n**startingMonth** (optional) is an integer between 1 and 12 indicating the beginning month of a year. The default value is 1.\n\n**nearest** (optional) is a Boolean value. The default value is true.\n\n**offset** (optional) is a scalar with the same data type as *X*. It must be no greater than the minimum value in *X*. The default value is the minimum value in *X*.\n\n**n** (optional) is a positive integer.The default value is 1.\n\n#### Returns\n\nA DATA scalar/vector.\n\n#### Examples\n\n```\nfy5253(2016.11.01,0,1,true);\n// output: 2016.02.01 // The Monday closest to 2016.01.31 is 2016.02.01\n\nfy5253(2016.11.01,0,1,false);\n// output: 2016.01.25 // The last Monday in January 2016 is 2016.01.25\n\ndate=2011.10.25 2012.10.25 2013.10.25 2014.10.25 2015.10.25 2016.10.25 2017.10.25 2018.10.25 2019.10.25 2020.10.25\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by fy5253(date,0,1,true,2011.10.01,2);\n```\n\n| fy5253\\_date | avg\\_price | sum\\_qty |\n| ------------ | ---------- | -------- |\n| 2011.01.31   | 39.53      | 4100     |\n| 2013.01.28   | 29.77      | 5300     |\n| 2015.02.02   | 175.1      | 12200    |\n| 2017.01.30   | 50.54      | 3800     |\n| 2019.01.28   | 51.835     | 13300    |\n\nRelated function: [fy5253Quarter](https://docs.dolphindb.com/en/Functions/f/fy5253Quarter.html)\n"
    },
    "fy5253Quarter": {
        "url": "https://docs.dolphindb.com/en/Functions/f/fy5253Quarter.html",
        "signatures": [
            {
                "full": "fy5253Quarter(X, [weekday=0], [startingMonth=1], [qtrWithExtraWeek=1], [nearest=true], [offset], [n=1])",
                "name": "fy5253Quarter",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[weekday=0]",
                        "name": "weekday",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[startingMonth=1]",
                        "name": "startingMonth",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[qtrWithExtraWeek=1]",
                        "name": "qtrWithExtraWeek",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[nearest=true]",
                        "name": "nearest",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [fy5253Quarter](https://docs.dolphindb.com/en/Functions/f/fy5253Quarter.html)\n\n\n\n#### Syntax\n\nfy5253Quarter(X, \\[weekday=0], \\[startingMonth=1], \\[qtrWithExtraWeek=1], \\[nearest=true], \\[offset], \\[n=1])\n\n#### Details\n\nUsing the 52-53 week in fiscal year (4-4-5 calendar), this function returns the start date of fiscal year which includes *X*.\n\n* If *nearest*=true, the last weekday which is closest to the last day of *startingMonth* will be used as the starting date of the fiscal year.\n\n* If *nearest*=false, the last weekday in *startingMonth* will be used as the starting date of the fiscal year.\n\nIf the *offset* is specified, indicating that starting from the *offset*, the result will be updated every *n* years. Note that only when *n* is greater than 1, the *offset* can take effect.\n\nDolphinDB and pandas both provide similar date offset functionality at the conceptual level. For a comparison of calculation rules, see [Functions Related to Date Offset](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/TemporalObjectsManipulation.md#).\n\n#### Parameters\n\n**X** is a scalar/vector, its type can be DATE, DATETIME, TIMESTAMP, NANOTIMESTAMP.\n\n**weekday** (optional) is an integer between 0 and 6. 0 means Monday, 1 means Tuesday, …, and 6 means Sunday. The default value is 0.\n\n**startingMonth** (optional) is an integer between 1 and 12 indicating the beginning month of the year. The default value is 1.\n\n**qtrWithExtraWeek** (optional) is an integer between 1 to 4. If there is a leap quarter (usually the quarter contains 13 weeks, but the leap quarter contains 14 weeks ), it indicates the leap quarter.\n\n**nearest** (optional) is a Boolean value with the default value of true.\n\n**offset** (optional) is a scalar with the same data type as *X*. It must be smaller than the minimum value in *X*. The default value is the minimum value in *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA DATA scalar/vector.\n\n#### Examples\n\n```\nfy5253Quarter(2019.12.01,0,1,1,true);\n// output: 2019.11.04\n\nfy5253Quarter(2019.12.01,0,1,4,true);\n// output: 2019.10.28   // The start date of the fiscal year 2019 is 2019.01.28. For the fiscal year 2020 it is 2020.02.03. The difference between them is 53 weeks, suggesting the existence of a leap quarter. qtrWithExtraWeek=1 means the first quarter is a leap quarter, which contains 14 weeks, so the start date of the quarter including 2019.12.01 is 2019.11.01; qtrWithExtraWeek=4 means that the fourth quarter is a leap season, which contains 14 weeks, so the start date of the quarter including 2019.12.01 is 2019.10.28.\n\ndate=2016.01.12 2016.02.25 2016.05.12 2016.06.28 2016.07.10 2016.08.18 2016.09.02 2016.10.16 2016.11.26 2016.12.30\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by fy5253Quarter(date,0,1,1,true,2016.01.01,2);\n```\n\n| fy5253Quarter\\_date | avg\\_price | sum\\_qty |\n| ------------------- | ---------- | -------- |\n| 2015.11.02          | 39.53      | 4100     |\n| 2016.05.02          | 85.136667  | 21300    |\n| 2016.10.31          | 51.835     | 13300    |\n\nRelated function: [fy5253](https://docs.dolphindb.com/en/Functions/f/fy5253.html)\n"
    },
    "haMvccTable": {
        "url": "https://docs.dolphindb.com/en/Functions/h/haMvccTable.html",
        "signatures": [
            {
                "full": "haMvccTable(capacity:size, table, tableName, raftGroup, [defaultValues], [allowNull])",
                "name": "haMvccTable",
                "parameters": [
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "[defaultValues]",
                        "name": "defaultValues",
                        "optional": true
                    },
                    {
                        "full": "[allowNull]",
                        "name": "allowNull",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nhaMvccTable(capacity:size, table, tableName, raftGroup, \\[defaultValues], \\[allowNull])\n\n#### Details\n\nCreates a high-availability version of MVCC table (HA MVCC table).\n\n**Note:**\n\nThe creation, deletion, and write operations of HA MVCC table must be executed on the Leader node of the corresponding Raft group. The Leader node of a Raft group can be obtained via the `getHaMvccLeader` function.\n\n#### Parameters\n\n**capacity** is a positive integer indicating the table capacity (in number of records). When the number of records exceeds *capacity*, the system automatically expands the capacity. The system first allocates memory that is about 1.2 to 2 times the current capacity, then copies the data to the new memory space, and finally releases the original memory. For large-scale tables, memory usage will be very high during capacity expansion. Therefore, it is recommended to pre-allocate a reasonable capacity when creating an in-memory table.\n\n**size** is a positive integer indicating the initial number of rows at table creation. If *size*=0, an empty table is created; if *size*>0, initial values are determined by *defaultValues*.\n\n**table** is a table indicating the schema of HA MVCC table. It must be an empty table created with the `table` function.\n\n**tableName** is a STRING scalar indicating the name of the HA MVCC table.\n\n**raftGroup** is an integer greater than 1 indicating the Raft group ID used by HA MVCC. This ID must be preconfigured in the `mvccTableRaftGroups` configuration parameter.\n\n**defaultValues** is a tuple of the same length as the number of table columns indicating the default values for each column at table creation. The default value is NULL.\n\n**allowNull** is a BOOLEAN vector of the same length as the number of table columns indicating whether each column is allowed to contain null values. The default value is true (all columns allow null values).\n\n#### Returns\n\nReturns a table handle of HA MVCC table.\n\n#### Examples\n\n```\nschemaTb = table(1:0, `name`id`value, [STRING, INT, DOUBLE])\nt = haMvccTable(1:0, schemaTb, \"demoHaMvcc\", 2)\n```\n\n**Related functions**: [loadHaMvccTable](https://docs.dolphindb.com/en/Functions/l/loadHaMvccTable.html), [dropHaMvccTable](https://docs.dolphindb.com/en/Functions/d/dropHaMvccTable.html), [setHaMvccColumnNullability](https://docs.dolphindb.com/en/Functions/s/setHaMvccColumnNullability.html), [setHaMvccColumnDefaultValue](https://docs.dolphindb.com/en/Functions/s/setHaMvccColumnDefaultValue.html), [getHaMvccRaftGroups](https://docs.dolphindb.com/en/Functions/g/getHaMvccRaftGroups.html), [getHaMvccLeader](https://docs.dolphindb.com/en/Functions/g/getHaMvccLeader.html), [getHaMvccTableInfo](https://docs.dolphindb.com/en/Functions/g/getHaMvccTableInfo.html), [checkpointHaMvcc](https://docs.dolphindb.com/en/Functions/c/checkpointHaMvcc.html), [isCheckpointingHaMvcc](https://docs.dolphindb.com/en/Functions/i/isCheckpointingHaMvcc.html)\n"
    },
    "hashBucket": {
        "url": "https://docs.dolphindb.com/en/Functions/h/hashBucket.html",
        "signatures": [
            {
                "full": "hashBucket(X, buckets)",
                "name": "hashBucket",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "buckets",
                        "name": "buckets"
                    }
                ]
            }
        ],
        "markdown": "### [hashBucket](https://docs.dolphindb.com/en/Functions/h/hashBucket.html)\n\n\n\n#### Syntax\n\nhashBucket(X, buckets)\n\n#### Details\n\nHashes each element in *X* into one of the specified number of buckets and returns the corresponding bucket index.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n**buckets** is a positive integer.\n\n#### Returns\n\nA scalar or vector, indicating the bucket index.\n\n#### Examples\n\n```\nhashBucket(34 45 67, 10);\n// output: [4,5,7]\n\nhashBucket(`AAPL`TSLA`GS`MS`GE`BA`UAL`WMT, 10);\n// output: [9,4,1,8,3,7,5,2]\n```\n"
    },
    "hasNull": {
        "url": "https://docs.dolphindb.com/en/Functions/h/hasNull.html",
        "signatures": [
            {
                "full": "hasNull(X)",
                "name": "hasNull",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [hasNull](https://docs.dolphindb.com/en/Functions/h/hasNull.html)\n\n\n\n#### Syntax\n\nhasNull(X)\n\n#### Details\n\n* For a scalar, return true if it is null.\n* For a vector, return true if at least one element is null.\n* For a matrix or a table, return true if at least one element of at least one column is null.\n\nPlease refer to related functions: [isNull](https://docs.dolphindb.com/en/Functions/i/isNull.html), [nullFill](https://docs.dolphindb.com/en/Functions/n/nullFill.html).\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA boolean value.\n\n#### Examples\n\n```\nhasNull NULL;\n// output: true\n\nx=00f;\nhasNull x;\n// output: true\n\nhasNull 5;\n// output: false\n\nhasNull(1 2 NULL 4 NULL 6);\n// output: true\n\nx=((NULL,1),2);\nhasNull x;\n// output: false\n\nm=(1 NULL 3 4 5 6)$2:3;\nhasNull m;\n// output: true\n\nt=table(`AAPL`IBM`MSFT as sym, 2200 NULL 4500 as qty);\nhasNull(t);\n// output: true\n```\n"
    },
    "haStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/h/haStreamTable.html",
        "signatures": [
            {
                "full": "haStreamTable(raftGroup, table, tableName, cacheSize, [keyColumn], [retentionMinutes=1440], [preCache])",
                "name": "haStreamTable",
                "parameters": [
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "cacheSize",
                        "name": "cacheSize"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [haStreamTable](https://docs.dolphindb.com/en/Functions/h/haStreamTable.html)\n\n\n\n#### Syntax\n\nhaStreamTable(raftGroup, table, tableName, cacheSize, \\[keyColumn], \\[retentionMinutes=1440], \\[preCache])\n\n#### Details\n\nCreates a high-availability stream table. To use the function, we must enable high availability for streaming by specifying parameters *streamingHAMode* and *streamingRaftGroups* in cluster configuration file *cluster.cfg*.\n\nAs the cluster starts up, the data nodes specified by the configuration parameter *streamingRaftGroups* form Raft groups. In a Raft group, one data node is the Leader and the rest are Followers. There is a copy of the high-availability stream table on each data node in a Raft group.\n\nAfter creating the high-availability stream table, subscribe to the high-availability stream table on any of the data nodes in a Raft group and set parameter *reconnect* of function `subscribeTable` to \"true\". The high-availability stream table on the Leader will publish data. If the Leader node goes down, the system will elect a new Leader to continue publishing data. Subscribers will automatically be connected to the high-availability stream table on the new Leader.\n\nA Raft group can have multiple high-availability stream tables.\n\n#### Parameters\n\n**raftGroup** is an integer greater than 1, specifying the Raft group ID.\n\n**table** is an empty table object created by function [table](https://docs.dolphindb.com/en/Functions/t/table.html).\n\n**tableName** is a STRING scalar specifying the name of the high-availability stream table.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**keyColumn** (optional) is a STRING scalar or vector specifying the primary key. When this parameter is set, a high-availability [keyed stream table](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) will be created, and its primary key cannot contain duplicate values.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n**preCache** (optional) is a positive integer specifying the number of records to be loaded into memory from the high-availability stream table on disk when DolphinDB restarts. By default, its value is the same as the configured value of *cacheSize*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nSuppose *streamingRaftGroups*=11:NODE1:NODE2:NODE3. Execute the following script on any data node of the Raft group to create a high-availability stream table trades:\n\n```\ncolNames = `timestamp`sym`qty`price\ncolTypes = [TIMESTAMP,SYMBOL,INT,DOUBLE]\nt=table(1:0,colNames,colTypes)\nhaStreamTable(11,t,`trades,100000);\n```\n\nExecute the followng script on another node that do not belong to the Raft group (NODE4) to subscribe to table trades, and then save the subscribed data to a distributed database.\n\n```\nif(existsDatabase(\"dfs://stock\")){\n   dropDatabase(\"dfs://stock\")\n}\ndb=database(\"dfs://stock\",VALUE,2018.08.01..2019.12.30)\nt=table(1:0,`timestamp`sym`qty`price,[TIMESTAMP,SYMBOL,INT,DOUBLE])\ntrades_slave=db.createPartitionedTable(t,`trades_slave,`timestamp);\nsubscribeTable(NODE2,`trades,`sub_trades,-1,append!{trades_slave},true,1000,1,-1,true);\n```\n\nPlease note that in the script above, the first parameter of function `subscribeTable` can be any of NODE1, NODE2 and NODE3. Paramater *reconnect* must be set to \"true\".\n\nExecute the following script on NODE4 to cancel the subscription.\n\n```\nunsubscribeTable(NODE2,`trades,`sub_trades);\n```\n\nRelated functions: [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html), [dropStreamTable](https://docs.dolphindb.com/en/Functions/d/dropStreamTable.html), [getStreamingLeader](https://docs.dolphindb.com/en/Functions/g/getStreamingLeader.html), [getStreamingRaftGroups](https://docs.dolphindb.com/en/Functions/g/getStreamingRaftGroups.html)\n"
    },
    "head": {
        "url": "https://docs.dolphindb.com/en/Functions/h/head.html",
        "signatures": [
            {
                "full": "head(X, [n=1])",
                "name": "head",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [head](https://docs.dolphindb.com/en/Functions/h/head.html)\n\n\n\n#### Syntax\n\nhead(X, \\[n=1])\n\n#### Details\n\nReturn the first *n* element(s) of a vector, or the first *n* columns of a matrix, or the first *n* rows of a table.\n\n#### Parameters\n\n**X** is a vector/matrix/table.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar, vector, matrix, dictionary, or table.\n\n#### Examples\n\n```\nx=1..10;\nhead(x);\n\n// output: 1\n\nx=1..10$2:5;\nx;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  |\n| 2  | 4  | 6  | 8  | 10 |\n\n```\nx.head();\n\n// output: [1,2]\n\nhead(x,2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 2  | 4  |\n\n```\nx=table(1..5 as a, 6..10 as b);\nx;\n```\n\n| a | b  |\n| - | -- |\n| 1 | 6  |\n| 2 | 7  |\n| 3 | 8  |\n| 4 | 9  |\n| 5 | 10 |\n\n```\nhead(x);\n\n/* output:\nb->6\na->1\n*/\n\nx.head(2);\n```\n\n| a | b |\n| - | - |\n| 1 | 6 |\n| 2 | 7 |\n\nRelated function: [tail](https://docs.dolphindb.com/en/Functions/t/tail.html)\n"
    },
    "hex": {
        "url": "https://docs.dolphindb.com/en/Functions/h/hex.html",
        "signatures": [
            {
                "full": "hex(X, [reverse=false])",
                "name": "hex",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[reverse=false]",
                        "name": "reverse",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [hex](https://docs.dolphindb.com/en/Functions/h/hex.html)\n\n\n\n#### Syntax\n\nhex(X, \\[reverse=false])\n\n#### Details\n\nConvert data of INTEGRAL, FLOAT,COMPLEX, and BINARY types to hexadecimal and return a string. For details, see [Data Types](https://docs.dolphindb.com/en/Programming/DataTypesandStructures/DataTypes/DataTypes.dita).\n\n**Note:** Similar to Python's built-in `hex` function:\n\n| Feature            | DolphinDB `hex`                                 | Python `hex`                  |\n| ------------------ | ----------------------------------------------- | ----------------------------- |\n| Supported Types    | INTEGRAL, FLOAT, COMPLEX, and BINARY            | Integer only                  |\n| Input              | Scalar/vector                                   | Scalar only                   |\n| Return             | Complete byte representation (e.g., \"00000010\") | With 0x prefix (e.g., \"0x10\") |\n| Byte Order Control | Supports *reverse* parameter                    | Not supported                 |\n\n#### Parameters\n\n**X** is an integer scalar/vector.\n\n**reverse** (optional) is a Boolean value indicating whether to reverse the order of the result. The default value is false.\n\n#### Returns\n\nA scalar or vector of the STRING type.\n\n#### Examples\n\n```\nhex(16 25)\n// output: [\"00000010\",\"00000019\"]\n\nhex(16 25,true)\n// output: [\"10000000\",\"19000000\"]\n```\n\n```\nhex(compress(1 2 3))\n// output: [\"00\",\"05\",\"ff\",\"01\",\"04\",\"04\",\"00\",\"00\",\"ff\",\"ff\",\"ff\",\"ff\",\"03\",\"00\",\"00\",\"00\",\"ff\",\"ff\",\"ff\",\"ff\",\"0d\",\"00\",\"00\",\"80\",\"c0\",\"01\",\"00\",\"00\",\"00\",\"02\",\"00\",\"00\",\"00\",\"03\",\"00\",\"00\",\"00\"]\n```\n\n```\nhex(123.456 3.1415926)\n// output: [\"405edd2f1a9fbe77\",\"400921fb4d12d84a\"]\n```\n"
    },
    "highDouble": {
        "url": "https://docs.dolphindb.com/en/Functions/h/highDouble.html",
        "signatures": [
            {
                "full": "highDouble(X)",
                "name": "highDouble",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [highDouble](https://docs.dolphindb.com/en/Functions/h/highDouble.html)\n\n\n\n#### Syntax\n\nhighDouble(X)\n\n#### Details\n\nIt returns the high-order 8-byte double data of *X*.\n\n#### Parameters\n\n**X** is a vector/scalar which must be 16-byte data type.\n\n#### Examples\n\n```\n$ x=1 2 3 4\ny=4 3 2 1\npoints = point(x, y)\nx1 = highDouble(points)\n// output: [4,3,2,1]\n```\n\nGet the imaginary part of a complex number:\n\n```\na=complex(2, 5)\nhighDouble(a)\n// output: 5\n```\n"
    },
    "highLong": {
        "url": "https://docs.dolphindb.com/en/Functions/h/highlong.html",
        "signatures": [
            {
                "full": "highLong(X)",
                "name": "highLong",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [highLong](https://docs.dolphindb.com/en/Functions/h/highlong.html)\n\n\n\n#### Syntax\n\nhighLong(X)\n\n#### Details\n\nIt returns the high-order 8-byte long integer data of *X*.\n\n#### Parameters\n\n**X** is a scalar/vector/table/pair/dictionary which must be 16-byte data type (UUID, IPADDR, INT128, COMPLEX, and POINT are supported).\n\n#### Examples\n\n```\nx =ipaddr(\"192.168.1.13\")\nx1 = highLong(x)\nprint(x1)\n// output: 0\n```\n\n```\nx=1 2 3 4\ny=4 3 2 1\npoints = point(x, y)\nx1 = highLong(points)\n// output: [4616189618054758400,4613937818241073152,4611686018427387904,4607182418800017408]\n```\n\nRelated function: [lowLong](https://docs.dolphindb.com/en/Functions/l/lowlong.html)\n"
    },
    "histogram": {
        "url": "https://docs.dolphindb.com/en/Functions/h/histogram.html",
        "signatures": [
            {
                "full": "histogram(X, [bins=10], [range], [density=false], [weights])",
                "name": "histogram",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[bins=10]",
                        "name": "bins",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[range]",
                        "name": "range",
                        "optional": true
                    },
                    {
                        "full": "[density=false]",
                        "name": "density",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[weights]",
                        "name": "weights",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [histogram](https://docs.dolphindb.com/en/Functions/h/histogram.html)\n\nFirst introduced in versions: 2.00.18, 2.00.16.33.00.5, 3.00.4.1, 3.00.3.2\n\n\n\n#### Syntax\n\nhistogram(X, \\[bins=10], \\[range], \\[density=false], \\[weights])\n\n#### Details\n\nCompute the histogram of a dataset.\n\nSimilar to the function of `numpy.histogram`.\n\n#### Parameters\n\n**X** is a numeric vector indicating the input data.\n\n**bins**(optional) is a positive integer or a strictly increasing numeric vector：\n\n* A positive integer specifies the number of bins of equal width. The default value is 10.\n\n* A numeric vector specifies the bin edges, including the rightmost edge.\n\n**range**(optional) is a pair or a numeric vector of length 2, indicating the lower and upper range of the bins. Values outside the range are ignored. The default value is `[X.min(), X.max()]`.\n\n**density**(optional) is a boolean value:\n\n* false (default): the result will contain the number of samples in each bin.\n\n* true: the result is the value of the probability *density* function at the bin, normalized such that the *integral* over the range is 1.\n\n**weights**(optional) is a numeric vector of the same length as *X,* representing the weight of each sample. Note that when *density* is false, the return value is the weighted counts.\n\n#### Returns\n\nA dictionary containing the following key-value pairs:\n\n* H: The values of the histogram. See *density* and *weights* for a description of the possible semantics.\n\n* edges: the bin edges.\n\n#### Examples\n\n*bins* can be an integral scalar.\n\n```\nX = [3,4,5,6,7,8,9]\nbins = 3\nhistogram(X, bins)\n/*\nH->[2,2,3]\nedges->[3,5,7,9]\n*/\n```\n\n*bins* can be a numeric vector.\n\n```\nX = [3,4,5,6,7,8,9]\nbins = [3,6,9]\nhistogram(X, bins)\n/*\nH->[3,4]\nedges->[3,6,9]\n*/\n```\n\n*range* limits the lower and upper bounds of the bins.\n\n```\nX = [3,4,5,6,7,8,9]\nbins = [3,6,9]\nrange = [4,8]\nhistogram(X, bins, range)\n/*\nH->[2,3]\nedges->[3,6,9]\n*/\n```\n\nIf *density* is true, the result is the value of the probability density function at the bin.\n\n```\nX = [3,4,5,6,7,8,9]\nbins = [3,6,9]\nrange = [4,8]\nhistogram(X, bins, range, true)\n/*\nH->[0.133333333333333,0.2]\nedges->[3,6,9]\n*/\n```\n\n*weights* specifies the weight for each sample.\n\n```\nX = [3,4,5,6,7,8,9]\nbins = [3,6,9]\nweights = [2,2,5,5,1,2,3]\nhistogram(X, bins, , false, weights)\n/*\nH->[9,11]\nedges->[3,6,9]\n*/\n```\n"
    },
    "histogram2d": {
        "url": "https://docs.dolphindb.com/en/Functions/h/histogram2d.html",
        "signatures": [
            {
                "full": "histogram2d(X, Y, [bins=10], [range], [density=false], [weights])",
                "name": "histogram2d",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[bins=10]",
                        "name": "bins",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[range]",
                        "name": "range",
                        "optional": true
                    },
                    {
                        "full": "[density=false]",
                        "name": "density",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[weights]",
                        "name": "weights",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [histogram2d](https://docs.dolphindb.com/en/Functions/h/histogram2d.html)\n\n#### Syntax\n\nhistogram2d(X, Y, \\[bins=10], \\[range], \\[density=false], \\[weights])\n\n#### Details\n\nCompute the bi-dimensional histogram of two data samples.\n\nSimilar to the function of `numpy.histogram2d`.\n\n#### Parameters\n\n**X** and **Y** are numeric vectors of the same length, indicating the x and y coordinates of the points to be histogrammed. null values are not allowed.\n\n**bins** (optional) is a numeric scalar, vector or a tuple. The default value is 10. Null values are not allowed. It can be:\n\n* Scalar: The number of bins for two dimensions.\n* Vector: The bin edges for the two diemensions. The vector must be strictly increasing.\n* Tuple with two scalars: The number of bins for each dimension.\n* Tuple with two vectors: The bin edges for each dimension.\n* Tuple with a scalar and a vector: The scalar represents the number of bins and the vector represents the bin edges, for the corresponding dimension.\n\n**range** (optional) is a tuple with two 2-length vectors, indicating the bin edges along each dimension (if not specified explicitly in the *bins* parameters). All values outside of this range will be considered outliers and not tallied in the histogram. The default value is null.\n\n**density** (optional) is a Boolean scalar. If false (default), returns the number of samples in each bin. If true, returns the probability *density* function at the bin, i.e., `bin_count / sample_count / bin_area`.\n\n**weights** (optional) is a numeric vector of the same length as *X/Y* for weighing each sample (x\\_i, y\\_i). The default value is null. Note that null values are not allowed in the vector. *weights* are normalized to 1 if *density* is true. Otherwise, the values of the returned histogram are equal to the sum of the *weights* belonging to the samples falling into each bin.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* H: The bi-dimensional histogram of samples x and y. Values in x are histogrammed along the first dimension and values in y are histogrammed along the second dimension. It is a matrix in the shape of (nx, ny), where nx and ny are the number of bins at each dimension.\n* xedges: A vector of length (nx+1) indicating the bin edges along the first dimension.\n* yedges: A vector of length (ny+1) indicating the bin edges along the second dimension.\n\n#### Examples\n\nExample 1. Set bin edges and *density*=false.\n\n```\nx = [0.1, 0.2, 0.5, 0.7, 0.9]\ny = [0.2, 0.4, 0.6, 0.8, 1.0]\nbins = [[0, 0.3, 0.6, 1.0], [0, 0.5, 1.0]]\ndensity = false\nresult = histogram2d(x, y, bins, ,density)\n\n/* Output:\nH->#0 #1\n-- --\n2  0 \n0  1 \n0  2 \nxedges->[0,0.3,0.6,1]\nyedges->[0,0.5,1]\n*/\n```\n\nExample 2. Set bin number, edges, weights and *density*=false.\n\n```\nx = [0.2, 0.4, 0.6, 0.8, 1.0]\ny = [0.3, 0.5, 0.7, 0.9, 1.1]\nbins = [2, [0.3, 0.5, 1.1]]\nweights = [1, 2, 3, 4, 5]\ndensity = true\nresult = histogram2d(x, y, bins, ,density, weights)\n\n/* Output:\nH->#0 #1\n-- --\n1  5 \n0  9 \nxedges->[0.2,0.6,1]\nyedges->[0.3,0.5,1.1]\n*/\n```\n\n"
    },
    "hmac": {
        "url": "https://docs.dolphindb.com/en/Functions/h/hmac.html",
        "signatures": [
            {
                "full": "hmac(key, message, [digest='sha256'])",
                "name": "hmac",
                "parameters": [
                    {
                        "full": "key",
                        "name": "key"
                    },
                    {
                        "full": "message",
                        "name": "message"
                    },
                    {
                        "full": "[digest='sha256']",
                        "name": "digest",
                        "optional": true,
                        "default": "'sha256'"
                    }
                ]
            }
        ],
        "markdown": "### [hmac](https://docs.dolphindb.com/en/Functions/h/hmac.html)\n\n\n\n#### Syntax\n\nhmac(key, message, \\[digest='sha256'])\n\n#### Details\n\nGenerate and return a hash value using the HMAC (Hash-based Message Authentication Code) mechanism. The value is a STRING scalar generated based on the given secret key and message using the specified hash algorithm.\n\n#### Parameters\n\n**key** is a LITERAL scalar indicating the secret key.\n\n**message**is a LITERAL scalar indicating the message to be encrypted.\n\n**digest**(optional)is a STRING scalar indicating the hash algorithm for encryption, which can be \"sha256\" (default), \"sha1\", \"sha224\", \"sha 384\", \"sha512\", and \"md5\".\n\n#### Returns\n\nA hash value of the STRING type.\n\n#### Examples\n\n```\nhmac(key=\"myKey\", message=\"myMessage\", digest=\"sha256\")\n// output:'71e5f5ca5f64550ee4524909f7cead7b81d8674a657383aec1b003a8a3f05b04'\n\nhmac(key=\"myKey\", message=\"myMessage\", digest=\"sha1\")\n// output:'5033197fa89dedf5088eed6100dfa5a0f67ef1ce'\n\nhmac(key=\"myKey2\", message=\"myMessage\", digest=\"sha256\")\n// output:'40e2a700754cec30ace1e82abfe7fd233f8f6c299050cc21b0e0a4ea42428126'\n```\n"
    },
    "hour": {
        "url": "https://docs.dolphindb.com/en/Functions/h/hour.html",
        "signatures": [
            {
                "full": "hour(X)",
                "name": "hour",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [hour](https://docs.dolphindb.com/en/Functions/h/hour.html)\n\n\n\n#### Syntax\n\nhour(X)\n\n#### Details\n\nReturn the corresponding hour(s).\n\n**Return value**: an integer.\n\n#### Parameters\n\n**X** is a temporal scalar/vector.\n\n#### Examples\n\n```\nhour(2012.12.03 01:22:01);\n// output: 1\n```\n\nRelated functions: [date](https://docs.dolphindb.com/en/Functions/d/date.html), [second](https://docs.dolphindb.com/en/Functions/s/second.html), [minute](https://docs.dolphindb.com/en/Functions/m/minute.html), [month](https://docs.dolphindb.com/en/Functions/m/month.html), [year](https://docs.dolphindb.com/en/Functions/y/year.html)\n"
    },
    "hourOfDay": {
        "url": "https://docs.dolphindb.com/en/Functions/h/hourOfDay.html",
        "signatures": [
            {
                "full": "hourOfDay(X)",
                "name": "hourOfDay",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html)\n\n\n\n#### Syntax\n\nhourOfDay(X)\n\n#### Details\n\nFor each element in *X*, return a number from 0 to 23 indicating which hour of the day it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type TIME, MINUTE, SECOND, DATETIME, TIMESTAMP, NANOTIME or NANOTIMESTAMP.\n\n#### Returns\n\nA scalar or vector of the INT type.\n\n#### Examples\n\n```\nhourOfDay(00:46:12);\n// output: 0\n\nhourOfDay([2012.06.12T12:30:00,2012.10.28T17:35:00,2013.01.06T02:36:47,2013.04.06T08:02:14]);\n// output: [12,17,2,8]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "join!": {
        "url": "https://docs.dolphindb.com/en/Functions/j/join!.html",
        "signatures": [
            {
                "full": "join!(X, Y)",
                "name": "join!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [join!](https://docs.dolphindb.com/en/Functions/j/join!.html)\n\n\n\n#### Syntax\n\njoin!(X, Y)\n\n#### Details\n\nMerge *X* and *Y*, and assign the result to *X*. The resulting object has the same data type as *X*.\n\n#### Parameters\n\n**X** is a vector/tuple/matrix/table.\n\n**Y** is a scalar/vector/tuple/matrix/table.\n\nIf *X* is a vector, *Y* is a scalar/vector/tuple; if *X* is a matrix, *Y* is a vector/matrix; if *X* is a table, *Y* is a vector/table.\n\n#### Returns\n\nThe return depends on *X* and *Y*. For details, see the examples below.\n\n#### Examples\n\nIf *X* is a vector, *Y* must be a scalar, vector, or tuple whose elements all have the same data type as *X*. The result is a vector longer than *X*.\n\n```\nx=[1,2,3]\nx.join!(4)\nx;\n// output: [1,2,3,4]\n\nx.join!(5 6 7)\nx;\n// output: [1,2,3,4,5,6,7]\n\nx.join!((8,9))\nx;\n// output: [1,2,3,4,5,6,7,8,9]\n```\n\nIf *X* is a tuple, *Y* can be a scalar, vector or tuple. The result is a tuple longer than *X*.\n\n```\nx = (1,\"A\")\nx.join!(2)\nx;\n// output: (1,\"A\",2)\n\nx.join!([3,4,5])\nx;\n// output: (1,\"A\",2,[3,4,5])\n\nx.join!((\"B\",\"C\"))\nx;\n// when appendTupleAsAWhole = true\n// output: (1,\"A\",2,[3,4,5],(\"B\",\"C\"))\n// when appendTupleAsAWhole = false\n// output: (1,\"A\",2,[3,4,5],\"B\",\"C\")\n```\n\nIf *X* is a matrix, *Y* must be a vector/matrix with the same number of rows as *X*. The result is a matrix with the same number of rows as *X*.\n\n```\nx=1..6$2:3\njoin!(x, [7,8])\nx;\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  |\n| 2  | 4  | 6  | 8  |\n\n```\nx.join!(9..12$2:2)\nx;\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 |\n| -- | -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  | 11 |\n| 2  | 4  | 6  | 8  | 10 | 12 |\n\nIf *X* is a table, *Y* must be a table or a vector with the same number of rows as *X*. The result is a table with the same number of rows as *X*.\n\n```\na=table(1..3 as x, 4.5 6.7 8.5 as y);\na;\n```\n\n| x | y   |\n| - | --- |\n| 1 | 4.5 |\n| 2 | 6.7 |\n| 3 | 8.5 |\n\n```\nb=table(700 500 800 as z);\nb;\n```\n\n| z   |\n| --- |\n| 700 |\n| 500 |\n| 800 |\n\n```\njoin!(a,b);\na;\n```\n\n| x | y   | z   |\n| - | --- | --- |\n| 1 | 4.5 | 700 |\n| 2 | 6.7 | 500 |\n| 3 | 8.5 | 800 |\n\n```\na=table(1..3 as x, `IBM`C`AAPL as y);\nb=table(172.3 25 106.5 as z);\na.join!(b);\na;\n```\n\n| x | y    | z     |\n| - | ---- | ----- |\n| 1 | IBM  | 172.3 |\n| 2 | C    | 25    |\n| 3 | AAPL | 106.5 |\n"
    },
    "join": {
        "url": "https://docs.dolphindb.com/en/Functions/j/join.html",
        "signatures": [
            {
                "full": "join(X,Y)",
                "name": "join",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [join](https://docs.dolphindb.com/en/Functions/j/join.html)\n\n\n\n#### Syntax\n\njoin(X,Y) or X<-Y\n\n#### Details\n\nMerge X and Y.\n\n#### Parameters\n\n**X** and **Y** can be scalar/vector/matrix/table.\n\n#### Returns\n\nThe return depends on *X* and *Y*. For details, see the examples below.\n\n#### Examples\n\nIf X is a scalar, Y can be a scalar/vector. The result is a vector.\n\n```\n1<-3;\n// output: [1,3]\n\n4<-1 2 3;\n// output: [4,1,2,3]\n```\n\nIf X is a vector, Y must be a scalar/vector. The result is a vector.\n\n```\n[1,2,3]<-4;\n// output: [1,2,3,4]\n\n[1,2,3]<-[4,5,6];\n// output: [1,2,3,4,5,6]\n```\n\nIf X is a matrix, Y must be a vector/matrix with the same number of rows as X. The result is a matrix with the same number of rows as X.\n\n```\n1..6$2:3 <- [7,8];\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  |\n| 2  | 4  | 6  | 8  |\n\n```\n(1..6$2:3) <- (7..12$2:3);\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 |\n| -- | -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  | 11 |\n| 2  | 4  | 6  | 8  | 10 | 12 |\n\nIf X is a table, Y must be a table or a vector with the same number of rows as X. The result is a table with the same number of rows as X.\n\n```\na=table(1..3 as x, 4.5 6.7 8.5 as y);\na;\n```\n\n| x | y   |\n| - | --- |\n| 1 | 4.5 |\n| 2 | 6.7 |\n| 3 | 8.5 |\n\n```\nb=table(700 500 800 as z);\nb\n```\n\n| z   |\n| --- |\n| 700 |\n| 500 |\n| 800 |\n\n```\nc=join(a,b);\nc;\n```\n\n| x | y   | z   |\n| - | --- | --- |\n| 1 | 4.5 | 700 |\n| 2 | 6.7 | 500 |\n| 3 | 8.5 | 800 |\n\n```\na=table(1..3 as x, `IBM`C`AAPL as y);\nb=table(172.3 25 106.5 as z);\nc=a<-b;\nc\n```\n\n| x | y    | z     |\n| - | ---- | ----- |\n| 1 | IBM  | 172.3 |\n| 2 | C    | 25    |\n| 3 | AAPL | 106.5 |\n\nRelated function: [cj (cross\\_join)](https://docs.dolphindb.com/en/Functions/c/cj.html)\n"
    },
    "JsonExtract": {
        "url": "https://docs.dolphindb.com/en/Functions/j/JsonExtract.html",
        "signatures": [
            {
                "full": "jsonExtract(json, location, type)",
                "name": "jsonExtract",
                "parameters": [
                    {
                        "full": "json",
                        "name": "json"
                    },
                    {
                        "full": "location",
                        "name": "location"
                    },
                    {
                        "full": "type",
                        "name": "type"
                    }
                ]
            }
        ],
        "markdown": "### [JsonExtract](https://docs.dolphindb.com/en/Functions/j/JsonExtract.html)\n\n#### Syntax\n\njsonExtract(json, location, type)\n\n#### Details\n\nThis function parses extracted JSON elements into specified data type.\n\n#### Parameters\n\n**json** is a LITERAL scalar or vector indicating the standard JSON string(s) to parse.\n\n**location** is a scalar/vector/tuple. Each element can be a string or a non-zero integer indicating the location at the corresponding dimension.\n\n* String: access element by key.\n* Positive integer: access the n-th element from the beginning.\n* Negative integer: access the n-th element from the end.\n\n**type** is a string specifying the data type of the return value. It can be \"long\", \"int\", \"double\", or \"string\".\n\n#### Returns\n\n* If *json* is a scalar, it returns a scalar; If *json* is a vector, it returns a vector.\n* The data type is specified by the *type* parameter.\n* If an element corresponding to *location* does not exist or cannot be parsed into expected data type, NULL is returned.\n\n#### Examples\n\nExample 1. Basic usage\n\n```\nA = '{\"a\": \"hello\", \"b\": [-100, 200.5, 300], \"c\": { \"b\" : 2} }'\njsonExtract(A, [2, 1], \"int\") \n// output: -100\n\njsonExtract(A, 1, \"int\") \n// output: NULL\n\njsonExtract(A, 999, \"int\") \n// output: NULL\n\njsonExtract(A, [\"b\", 2], \"int\") \n// output: 200\n\njsonExtract(A, [\"c\", \"b\"], \"double\") \n// output: 2\n\nB = '{\"a\": \"hello\", \"b\": [200, 300]}'\njsonExtract([A, B], [\"c\", \"b\"], \"int\") \n// output: [2, NULL]\n\njsonExtract([A, B], [2, -1], \"int\") \n// output: [300, 300]\n```\n\nExample 2. Use with SQL queries\n\n```\nA1 = '{\"a\": \"a1\",\"c\": { \"b\" : 2} }'\nA2 = '{\"a\": \"a2\", \"c\": { \"b\" : 3} }'\nB1 = '{\"a\": \"b1\",  \"c\": { \"b\" : 3} }'\nB2 = '{\"a\": \"b2\", \"c\": { \"b\" : 4} }'\nt1 = table([A1, A2] as json, [2,3] as val)\nt2 = table([B1, B2] as json, [3,4] as val)\n\nselect\n    jsonExtract(t1.json, \"a\", \"string\") as json1, \n    jsonExtract(t2.json, \"a\", \"string\") as json2 \nfrom t1 \njoin t2 on t1.val = t2.val\n```\n\n| json1 | json2 |\n| ----- | ----- |\n| a2    | b1    |\n\n"
    },
    "cacheDS!": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cacheDS!.html",
        "signatures": [
            {
                "full": "cacheDS!(ds)",
                "name": "cacheDS!",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    }
                ]
            }
        ],
        "markdown": "### [cacheDS!](https://docs.dolphindb.com/en/Functions/c/cacheDS!.html)\n\n\n\n#### Syntax\n\ncacheDS!(ds)\n\n#### Details\n\nInstruct the system to cache the data source when it is executed next time.\n\n#### Parameters\n\n**ds** is a data source or a list of data sources.\n\n#### Returns\n\nIt returns true or false to indicate if this operation is successful.\n\n#### Examples\n\n```\nPTNDB_DIR = \"/home/db_testing\"\ndbName = database(PTNDB_DIR + \"/NYSETAQByName\")\nTrades = dbName.loadTable(`Trades)\n\nds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)\nds.cacheDS!()        //cache the data\nds.clearDSCache!()   //clear the cache\n```\n"
    },
    "cacheDSNow": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cacheDSNow.html",
        "signatures": [
            {
                "full": "cacheDSNow(ds)",
                "name": "cacheDSNow",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    }
                ]
            }
        ],
        "markdown": "### [cacheDSNow](https://docs.dolphindb.com/en/Functions/c/cacheDSNow.html)\n\n\n\n#### Syntax\n\ncacheDSNow(ds)\n\n#### Details\n\nImmediately execute and cache the data source. It returns the total number of cached rows.\n\n#### Parameters\n\n**ds** is a data source or a list of data sources.\n\n#### Returns\n\nIt returns the total number of cached rows.\n\n#### Examples\n\n```\nPTNDB_DIR = \"/home/db_testing\"\ndbName = database(PTNDB_DIR + \"/NYSETAQByName\")\nTrades = dbName.loadTable(`Trades)\n\nds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)\nds.cacheDSNow()        //cache the data immediately\nds.clearDSCacheNow()   //clear the cache immediately\n```\n"
    },
    "cachedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cachedTable.html",
        "signatures": [
            {
                "full": "cachedTable(updateFunc, retentionSeconds)",
                "name": "cachedTable",
                "parameters": [
                    {
                        "full": "updateFunc",
                        "name": "updateFunc"
                    },
                    {
                        "full": "retentionSeconds",
                        "name": "retentionSeconds"
                    }
                ]
            }
        ],
        "markdown": "### [cachedTable](https://docs.dolphindb.com/en/Functions/c/cachedTable.html)\n\n\n\n#### Syntax\n\ncachedTable(updateFunc, retentionSeconds)\n\n#### Details\n\nCreate a special type of in-memory table: cached table. When querying the cached table, if the time elapsed since the last update exceeds a specified value, *updateFunc* is executed automatically to update the cached table.\n\nTo access a cached table with multiple threads, the table must be shared.\n\n#### Parameters\n\n**updateFunc** is a function without parameters. It must return a table.\n\n**retentionSeconds** is a positive integer indicating the frequency (in seconds) to update the cached table.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nThis example defines a unary function, `f1`, and fixes its argument to produce a partial application with no arguments, `f1{t}`. `f1{t}` is passed as the *updateFunc* to `cachedTable`.\n\n```\ndef f1(mutable t){\n    update t set id=id+1\n    return t\n}\nt=table(1..5 as id, 15 25 35 45 55 as val)\nct=cachedTable(f1{t}, 2);\n\nselect * from ct;\n```\n\n| id | val |\n| -- | --- |\n| 2  | 15  |\n| 3  | 25  |\n| 4  | 35  |\n| 5  | 45  |\n| 6  | 55  |\n\n```\nsleep(2100)\nselect * from ct\n```\n\n| id | val |\n| -- | --- |\n| 3  | 15  |\n| 4  | 25  |\n| 5  | 35  |\n| 6  | 45  |\n| 7  | 55  |\n\n```\nct=NULL;\n```\n"
    },
    "callMCPTool": {
        "url": "https://docs.dolphindb.com/en/Functions/c/callMCPTool.html",
        "signatures": [
            {
                "full": "callMCPTool(name, [args], [published])",
                "name": "callMCPTool",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[args]",
                        "name": "args",
                        "optional": true
                    },
                    {
                        "full": "[published]",
                        "name": "published",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [callMCPTool](https://docs.dolphindb.com/en/Functions/c/callMCPTool.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ncallMCPTool(name, \\[args], \\[published])\n\n#### Parameters\n\n**name** is a STRING scalar indicating the tool name.\n\n**args** (optional) is a dictionary where keys are strings and values are ANY or STRING, representing arguments to pass to the tool.\n\n**published** (optional) is a Boolean value indicating whether to call the published version of the tool. Defaults to false, meaning to call the unpublished version.\n\n#### Details\n\nCalls the specified MCP tool.\n\n#### Examples\n\n```\n// Define a tool and publish it\ndef myTool(x) {\n   return x * 2 + 1\n}\n\ninfo = {\n    \"title\": \"DolphinDB Tool\"\n}\n\naddMCPTool(name=\"myTool\", func=myTool, argNames=[\"a\"], argTypes=[\"number\"], description=\"This is a tool\", extraInfo=info)\n\npublishMCPTools(names=\"myTool\")\n\n// Update the tool without publishing\ndef myNewTool(x) {\n   return 100 * x\n}\n\nupdateMCPTool(name=\"myTool\", func=myNewTool)\n\n// Call the published version\ncallMCPTool(name=\"myTool\", args={\"a\":3}, published=true)\n// output:'7'\n\n// Call the updated but unpublished version\ncallMCPTool(name=\"myTool\", args={\"a\":3}, published=false)\n// output: '300'\n```\n"
    },
    "cancelConsoleJob": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cancelConsoleJob.html",
        "signatures": [
            {
                "full": "cancelConsoleJob(rootJobId)",
                "name": "cancelConsoleJob",
                "parameters": [
                    {
                        "full": "rootJobId",
                        "name": "rootJobId"
                    }
                ]
            }
        ],
        "markdown": "### [cancelConsoleJob](https://docs.dolphindb.com/en/Functions/c/cancelConsoleJob.html)\n\n\n\n#### Syntax\n\ncancelConsoleJob(rootJobId)\n\n#### Details\n\nCancel submitted but unfinished interactive job(s). To cancel batch jobs, use [cancelJob](https://docs.dolphindb.com/en/Functions/c/cancelJob.html).\n\n**Note:** This command cancels a job only after the currently running sub tasks of the job are finished. Therefore the command may not immediately take effect. If a job has no sub task, this command will not take effect.\n\n#### Parameters\n\n**rootJobId** is the job ID(s). It is a STRING scalar or vector. If it is a vector, multiple jobs are canceled at the same time.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nIn a session of a data node, execute the following script:\n\n```\npt = loadTable(\"dfs://TAQ\", `quotes)\nselect count(*) from pt;\n```\n\nIn another session of the same data node, call [getConsoleJobs](https://docs.dolphindb.com/en/Functions/g/getConsoleJobs.html) to get the *rootJobId* of the job to be canceled, then execute `cancelConsoleJob` with the rootJobId:\n\n```\ncancelConsoleJob(\"bf768327-776d-40a7-8a8d-00a6cfd054e3\");\n```\n"
    },
    "cancelJob": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cancelJob.html",
        "signatures": [
            {
                "full": "cancelJob(jobId)",
                "name": "cancelJob",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    }
                ]
            }
        ],
        "markdown": "### [cancelJob](https://docs.dolphindb.com/en/Functions/c/cancelJob.html)\n\n\n\n#### Syntax\n\ncancelJob(jobId)\n\n#### Details\n\nCancel submitted but unfinished batch job(s).\n\nStarting from version 1.30.192.00.7, if a *jobId* does not exist when `cancelJob` is executed, the system no longer throws an exception. Instead, it outputs the error message with *jobId* to the log.\n\nVersion 1.30.232.00.11 has enhanced access control on job cancellation:\n\n* Administrators (including admin and super admin) can cancel batch jobs submitted by any user.\n\n* Regular users are only allowed to cancel batch jobs submitted by themselves.\n\n#### Parameters\n\n**jobId** is the batch job ID(s). It is a STRING scalar or vector. If it is a vector, multiple batch jobs are canceled at the same time.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ndef writeData(num){\n   n=10\n   month=take(2000.01M..2016.12M, n)\n   x=rand(1.0, n)\n   tt=table(month, x)\n   if(existsDatabase(\"dfs://test_db\")){\n       dropDatabase(\"dfs://test_db\")\n   }\n   db=database(\"dfs://test_db\", VALUE, 2000.01M..2016.12M)\n   pt = db.createPartitionedTable(tt, `pt, `month)\n   for(x in 1..num){\n       pt.append!(tt)\n       sleep(1000)\n   }\n}\n\nmyJobId=\"writeData\"+temporalFormat(datetime(now()),\"yyyyMMddHHmmss\")\nsubmitJob(myJobId,\"write data to dfs table\",writeData,120);\ncancelJob(myJobId);\n```\n\nCancel the unfinished jobs in a cluster:\n\n```\ndef cancelAllBatchJob(){\n   jobids=exec jobid from getRecentJobs() where endTime=NULL\n   cancelJob(jobids)\n}\npnodeRun(cancelAllBatchJob)\n```\n"
    },
    "cancelPKEYCompactionTask": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cancelPKEYCompactionTask.html",
        "signatures": [
            {
                "full": "cancelPKEYCompactionTask(chunkId)",
                "name": "cancelPKEYCompactionTask",
                "parameters": [
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    }
                ]
            }
        ],
        "markdown": "### [cancelPKEYCompactionTask](https://docs.dolphindb.com/en/Functions/c/cancelPKEYCompactionTask.html)\n\n\n\n#### Syntax\n\ncancelPKEYCompactionTask(chunkId)\n\n#### Details\n\nCancel the running compaction tasks on the specified chunk.\n\n#### Parameters\n\n**chunkId**is a STRING scalar indicating the target chunk ID.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ncancelPKEYCompactionTask(chunkId=\"1486f935-6f87-479c-b341-34c6a303d4f9\")\n```\n"
    },
    "cancelRebalanceTask": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cancelRebalanceTask.html",
        "signatures": [
            {
                "full": "cancelRebalanceTask(taskId)",
                "name": "cancelRebalanceTask",
                "parameters": [
                    {
                        "full": "taskId",
                        "name": "taskId"
                    }
                ]
            }
        ],
        "markdown": "### [cancelRebalanceTask](https://docs.dolphindb.com/en/Functions/c/cancelRebalanceTask.html)\n\n\n\n#### Syntax\n\ncancelRebalanceTask(taskId)\n\n#### Details\n\nCancel the rebalance jobs that have been submitted but have not begun execution. This command can only be executed by an administrator on a controller.\n\n#### Parameters\n\n**taskId** is a STRING scalar or vector indicating the job ID of the rebalance task. It can be obtained with function [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html).\n\n#### Returns\n\nNone.\n"
    },
    "cancelRecoveryTask": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cancelRecoveryTask.html",
        "signatures": [
            {
                "full": "cancelRecoveryTask(taskId)",
                "name": "cancelRecoveryTask",
                "parameters": [
                    {
                        "full": "taskId",
                        "name": "taskId"
                    }
                ]
            }
        ],
        "markdown": "### [cancelRecoveryTask](https://docs.dolphindb.com/en/Functions/c/cancelRecoveryTask.html)\n\n\n\n#### Syntax\n\ncancelRecoveryTask(taskId)\n\n#### Details\n\nCancel the replica recovery jobs that have been submitted but have not begun execution. This command can only be executed by an administrator on a controller.\n\n#### Parameters\n\n**taskId** is a STRING scalar or vector indicating the job ID of the replica recovery task. It can be obtained with function [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html).\n\n#### Returns\n\nNone.\n"
    },
    "cast": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cast.html",
        "signatures": [
            {
                "full": "cast(X, Y)",
                "name": "cast",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cast](https://docs.dolphindb.com/en/Functions/c/cast.html)\n\n\n\n#### Syntax\n\ncast(X, Y)\n\nor\n\nX $ Y\n\n#### Details\n\n* convert a data type to another;\n\n* reshape a matrix, or convert between matrices and vectors.\n\n#### Parameters\n\n**X** can be of any data form.\n\n**Y** is a data type or a data pair.\n\n#### Returns\n\nDepend on *Y*.\n\n#### Examples\n\n```\nx=8.9$INT;\nx;\n// output: 9\n\nx=1..10;\nx;\n// output: [1,2,3,4,5,6,7,8,9,10]\n\ntypestr x;\n// output: FAST INT VECTOR\n\nx/2;\n// output: [0,1,1,2,2,3,3,4,4,5]\n\nx=x$DOUBLE;\ntypestr x;\n// output: FAST DOUBLE VECTOR\n\nx/2;\n// output: [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5]\n\nx=`IBM`MS;\ntypestr x;\n// output: STRING VECTOR\n\nx=x$SYMBOL;\ntypestr x;\n// output: FAST SYMBOL VECTOR\n\nx=`128.9;\ntypestr x;\n// output: STRING\n\nx=x$INT;\nx;\n// output: 128\ntypestr x;\n// output: INT\n\n// convert a vector to a matrix\nm=1..8$2:4;\nm;\n```\n\n| 0  | 1  | 2  | 3  |\n| :- | :- | :- | :- |\n| 1  | 3  | 5  | 7  |\n| 2  | 4  | 6  | 8  |\n\n```\n// reshape a matrix\nm$4:2;\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 5 |\n| 2 | 6 |\n| 3 | 7 |\n| 4 | 8 |\n\n```\nm$1:size(m);\n```\n\n| 0  | 1  | 2  | 3  | 4  | 5  | 6  | 7  |\n| :- | :- | :- | :- | :- | :- | :- | :- |\n| 1  | 2  | 3  | 4  | 5  | 6  | 7  | 8  |\n"
    },
    "cbrt": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cbrt.html",
        "signatures": [
            {
                "full": "cbrt(X)",
                "name": "cbrt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cbrt](https://docs.dolphindb.com/en/Functions/c/cbrt.html)\n\n\n\n#### Syntax\n\ncbrt(X)\n\n#### Details\n\nReturn the square root of *X*. The data type of the result is always DOUBLE.\n\n#### Parameters\n\n**X** can be a scalar/pair/vector/matrix/table.\n\n#### Returns\n\nDOUBLE type, data form same as *X*.\n\n#### Examples\n\n```\ncbrt(8);\n// output: 2\n\ncbrt(8 12 16);\n// output: [2,2.289428,2.519842]\n\ncbrt(1..6$2:3);\n```\n\n| 0        | 1        | 2        |\n| -------- | -------- | -------- |\n| 1        | 1.44225  | 1.709976 |\n| 1.259921 | 1.587401 | 1.817121 |\n"
    },
    "cdfBeta": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfBeta.html",
        "signatures": [
            {
                "full": "cdfBeta(alpha, beta, X)",
                "name": "cdfBeta",
                "parameters": [
                    {
                        "full": "alpha",
                        "name": "alpha"
                    },
                    {
                        "full": "beta",
                        "name": "beta"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfBeta](https://docs.dolphindb.com/en/Functions/c/cdfBeta.html)\n\n\n\n#### Syntax\n\ncdfBeta(alpha, beta, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a beta distribution.\n\n#### Parameters\n\nThe shape parameters **alpha** and **beta** are positive floating numbers.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfBeta(2.31, 0.627, [0.001, 0.5, 0.999]);\n// output: [0, 0.116056, 0.976416]\n\ncdfBeta(2.31, 0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.002451, 0.032995, 0.116056, 0.280532, 0.597694]\n```\n"
    },
    "cdfBinomial": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfBinomial.html",
        "signatures": [
            {
                "full": "cdfBinomial(trials, p, X)",
                "name": "cdfBinomial",
                "parameters": [
                    {
                        "full": "trials",
                        "name": "trials"
                    },
                    {
                        "full": "p",
                        "name": "p"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfBinomial](https://docs.dolphindb.com/en/Functions/c/cdfBinomial.html)\n\n\n\n#### Syntax\n\ncdfBinomial(trials, p, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a binomial distribution.\n\n#### Parameters\n\n**trials** is a positive integer.\n\n**p** is a floating number between 0 and 1.\n\n*trials* and *p* are shape parameters.\n\n**X** is a numeric scalar and vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfBinomial(10, 0.1, [1, 5, 9]);\n// output: [0.736099, 0.999853, 1]\n\ncdfBinomial(12,0.627, [1, 3, 5, 7, 9]);\n// output: [0.000154, 0.009085, 0.114844, 0.483879, 0.88373]\n```\n"
    },
    "cdfChiSquare": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfChiSquare.html",
        "signatures": [
            {
                "full": "cdfChiSquare(df, X)",
                "name": "cdfChiSquare",
                "parameters": [
                    {
                        "full": "df",
                        "name": "df"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfChiSquare](https://docs.dolphindb.com/en/Functions/c/cdfChiSquare.html)\n\n\n\n#### Syntax\n\ncdfChiSquare(df, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a chi-squared distribution.\n\n#### Parameters\n\n**df** is a positive integer indicating the degree of freedom of a chi-squared distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfChiSquare(1, [-1, 0, 0.5, 1, 2]);\n// output: [0, 0, 0.5205, 0.682689, 0.842701]\n\ncdfChiSquare(1, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.24817, 0.416118, 0.5205, 0.597216, 0.657218]\n```\n"
    },
    "cdfExp": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfExp.html",
        "signatures": [
            {
                "full": "cdfExp(mean, X)",
                "name": "cdfExp",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfExp](https://docs.dolphindb.com/en/Functions/c/cdfExp.html)\n\n\n\n#### Syntax\n\ncdfExp(mean, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of an exponential distribution.\n\n#### Parameters\n\n**mean** is the mean of an exponential distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfExp(1, [-1, 0, 0.5, 1, 2]);\n// output: [0, 0, 0.393469, 0.632121, 0.864665]\n\ncdfExp(1, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.095163, 0.259182, 0.393469, 0.503415, 0.59343]\n```\n"
    },
    "cdfF": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfF.html",
        "signatures": [
            {
                "full": "cdfF(numeratorDF, denominatorDF, X)",
                "name": "cdfF",
                "parameters": [
                    {
                        "full": "numeratorDF",
                        "name": "numeratorDF"
                    },
                    {
                        "full": "denominatorDF",
                        "name": "denominatorDF"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfF](https://docs.dolphindb.com/en/Functions/c/cdfF.html)\n\n\n\n#### Syntax\n\ncdfF(numeratorDF, denominatorDF, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of an F distribution.\n\n#### Parameters\n\n**numeratorDF** and **denominatorDF** are positive integers indicating degrees of freedom of an F distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfF(2.31, 0.627, [0.001, 0.5, 0.999]);\n// output: [0.000444, 0.245679, 0.35098]\n\ncdfF(2.31,0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.07078, 0.176153, 0.245679, 0.295996, 0.334766]\n```\n"
    },
    "cdfGamma": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfGamma.html",
        "signatures": [
            {
                "full": "cdfGamma(shape, scale, X)",
                "name": "cdfGamma",
                "parameters": [
                    {
                        "full": "shape",
                        "name": "shape"
                    },
                    {
                        "full": "scale",
                        "name": "scale"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfGamma](https://docs.dolphindb.com/en/Functions/c/cdfGamma.html)\n\n\n\n#### Syntax\n\ncdfGamma(shape, scale, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a gamma distribution.\n\n#### Parameters\n\nThe shape parameters **shape** and **scale** are both positive floating-point numbers.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfGamma(2.31, 0.627, [0.001, 0.5, 0.999]);\n// output: [0, 0.127367, 0.38032]\n\ncdfGamma(2.31,0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.004754, 0.048388, 0.127367, 0.225351, 0.329391]\n```\n"
    },
    "cdfKolmogorov": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfKolmogorov.html",
        "signatures": [
            {
                "full": "cdfKolmogorov(X)",
                "name": "cdfKolmogorov",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfKolmogorov](https://docs.dolphindb.com/en/Functions/c/cdfKolmogorov.html)\n\n\n\n#### Syntax\n\ncdfKolmogorov(X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a Kolmogorov distribution.\n\n#### Parameters\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfKolmogorov([0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [1, 0.999991, 0.963945, 0.711235, 0.392731]\n\ncdfKolmogorov([1,2,3]);\n// output: [0.27, 0.000671, 3.045996E-8]\n```\n"
    },
    "cdfLogistic": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfLogistic.html",
        "signatures": [
            {
                "full": "cdfLogistic(mean, s, X)",
                "name": "cdfLogistic",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "s",
                        "name": "s"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfLogistic](https://docs.dolphindb.com/en/Functions/c/cdfLogistic.html)\n\n\n\n#### Syntax\n\ncdfLogistic(mean, s, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a logistic distribution.\n\n#### Parameters\n\n**mean** is the mean of a logistic distribution.\n\n**s** is the scale parameter of a logistic distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfLogistic( 2.31, 0.627, [0.5, 0.3, 0.5, 0.7, 0.1]);\n// output: [0.052812, 0.03895, 0.052812, 0.071241, 0.028617]\n```\n"
    },
    "cdfNormal": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfNormal.html",
        "signatures": [
            {
                "full": "cdfNormal(mean, stdev, X)",
                "name": "cdfNormal",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "stdev",
                        "name": "stdev"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfNormal](https://docs.dolphindb.com/en/Functions/c/cdfNormal.html)\n\n\n\n#### Syntax\n\ncdfNormal(mean, stdev, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a normal distribution.\n\n#### Parameters\n\n**mean** is the mean of a normal distribution.\n\n**stdev** is the standard deviation of a normal distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfNormal(0,1,-2.33);\n// output: 0.009903\n\ncdfNormal(10, 20, -30);\n// output: 0.02275\n```\n"
    },
    "cdfPoisson": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfPoisson.html",
        "signatures": [
            {
                "full": "cdfPoisson(mean, X)",
                "name": "cdfPoisson",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfPoisson](https://docs.dolphindb.com/en/Functions/c/cdfPoisson.html)\n\n\n\n#### Syntax\n\ncdfPoisson(mean, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a Poisson distribution.\n\n#### Parameters\n\n**mean** is the mean of a Poisson distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfPoisson(1, [-1, 0, 1, 2, 3]);\n// output: [0, 0.367879, 0.735759, 0.919699, 0.981012]\n\ncdfPoisson(1, [1, 3, 5, 7, 9]);\n// output: [0.735759, 0.981012, 0.999406, 0.99999, 1]\n```\n"
    },
    "cdfStudent": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfStudent.html",
        "signatures": [
            {
                "full": "cdfStudent(df, X)",
                "name": "cdfStudent",
                "parameters": [
                    {
                        "full": "df",
                        "name": "df"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfStudent](https://docs.dolphindb.com/en/Functions/c/cdfStudent.html)\n\n\n\n#### Syntax\n\ncdfStudent(df, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a Student's t-distribution.\n\n#### Parameters\n\n**df** is a positive floating number indicating the degree of freedom of a Student's t-distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```language-python\ncdfStudent(1, [-1, 0, 0.5, 1, 2]);\n// output: [0.25, 0.5, 0.647584, 0.75, 0.852416]\n\ncdfStudent(1, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.531726, 0.592774, 0.647584, 0.6944, 0.733262]\n```\n"
    },
    "cdfUniform": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfUniform.html",
        "signatures": [
            {
                "full": "cdfUniform(lower, upper, X)",
                "name": "cdfUniform",
                "parameters": [
                    {
                        "full": "lower",
                        "name": "lower"
                    },
                    {
                        "full": "upper",
                        "name": "upper"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfUniform](https://docs.dolphindb.com/en/Functions/c/cdfUniform.html)\n\n\n\n#### Syntax\n\ncdfUniform(lower, upper, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a continuous uniform distribution.\n\n#### Parameters\n\n**lower** and **upper** are numeric scalars indicating the lower bound and upper bound of a continuous uniform distribution.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfUniform(0.627, 2.31, [0.001, 0.5, 0.999]);\n// output: [0, 0, 0.221034]\n\ncdfUniform(0.627, 2.31, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0, 0, 0, 0.043375, 0.16221]\n```\n"
    },
    "cdfWeibull": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfWeibull.html",
        "signatures": [
            {
                "full": "cdfWeibull(alpha, beta, X)",
                "name": "cdfWeibull",
                "parameters": [
                    {
                        "full": "alpha",
                        "name": "alpha"
                    },
                    {
                        "full": "beta",
                        "name": "beta"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfWeibull](https://docs.dolphindb.com/en/Functions/c/cdfWeibull.html)\n\n\n\n#### Syntax\n\ncdfWeibull(alpha, beta, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a Weibull distribution.\n\n#### Parameters\n\nThe scale parameters **alpha** and **beta** are both positive floating numbers.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfWeibull(2.31, 0.627, [0.001, 0.5, 0.999]);\n// output: [0, 0.447241, 0.946762]\n\ncdfWeibull(2.31,0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.014295, 0.166535, 0.447241, 0.724646, 0.90021]\n```\n"
    },
    "cdfZipf": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cdfZipf.html",
        "signatures": [
            {
                "full": "cdfZipf(num, exponent, X)",
                "name": "cdfZipf",
                "parameters": [
                    {
                        "full": "num",
                        "name": "num"
                    },
                    {
                        "full": "exponent",
                        "name": "exponent"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cdfZipf](https://docs.dolphindb.com/en/Functions/c/cdfZipf.html)\n\n\n\n#### Syntax\n\ncdfZipf(num, exponent, X)\n\n#### Details\n\nReturn the value of the cumulative distribution function of a Zipfian distribution.\n\n#### Parameters\n\n**num** is a positive integer.\n\n**exponent** is a non-negative floating number.\n\n**X** is a numeric scalar or vector.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\ncdfZipf(10, 0.5, [1, 3, 5, 7, 9]);\n// output: [0.199164, 0.454981, 0.643631, 0.800216, 0.937019]\n```\n"
    },
    "cds": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cds.html",
        "signatures": [
            {
                "full": "cds(settlement, maturity, evalDate, notional, spread, riskFree, recovery, isSeller, frequency, calendar, [convention='Following'], [termDateConvention='Following'], [rule='CDS'], [basis=1])",
                "name": "cds",
                "parameters": [
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "evalDate",
                        "name": "evalDate"
                    },
                    {
                        "full": "notional",
                        "name": "notional"
                    },
                    {
                        "full": "spread",
                        "name": "spread"
                    },
                    {
                        "full": "riskFree",
                        "name": "riskFree"
                    },
                    {
                        "full": "recovery",
                        "name": "recovery"
                    },
                    {
                        "full": "isSeller",
                        "name": "isSeller"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "calendar",
                        "name": "calendar"
                    },
                    {
                        "full": "[convention='Following']",
                        "name": "convention",
                        "optional": true,
                        "default": "'Following'"
                    },
                    {
                        "full": "[termDateConvention='Following']",
                        "name": "termDateConvention",
                        "optional": true,
                        "default": "'Following'"
                    },
                    {
                        "full": "[rule='CDS']",
                        "name": "rule",
                        "optional": true,
                        "default": "'CDS'"
                    },
                    {
                        "full": "[basis=1]",
                        "name": "basis",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [cds](https://docs.dolphindb.com/en/Functions/c/cds.html)\n\n#### Syntax\n\ncds(settlement, maturity, evalDate, notional, spread, riskFree, recovery, isSeller, frequency, calendar, \\[convention='Following'], \\[termDateConvention='Following'], \\[rule='CDS'], \\[basis=1])\n\n#### Details\n\nValue a Credit Default Swap (CDS) contract.\n\n**Return value**: A DOUBLE scalar or vector.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**evalDate** is a DATE scalar or vector indicating the evaluation date of the CDS contract. Note that *evalDate* should be no later than *settlement*.\n\n**notional** is a non-negative numeric scalar or vector indicating the notional principal of the CDS contract.\n\n**spread** is a numeric scalar or vector indicating the CDS spread. The CDS spread is the amount the buyer pays to the seller each period, which is quoted as a percentage of the contract’s notional principal in basis points (bps).\n\n**riskFree** is a numeric scalar or vector indicating the risk-free interest rate.\n\n**recovery** is a numeric scalar or vector in \\[0,1), indicating the recovery rate. It is the estimated percentage of par value that the bondholder will receive after a credit event (e.g., default).\n\n**isSeller** is a BOOLEAN scalar or vector indicating whether the party is the buyer or the seller. true for the seller and false for the buyer.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**calendar** is a STRING scalar or vector indicating the trading calendar(s). See [Trading Calendar](https://docs.dolphindb.com/en/Tutorials/trading_calendar.html) for more information.\n\n**convention** (optional) is a STRING scalar or vector indicating how cash flows that fall on a non-trading day are treated. The following options are available. Defaults to 'Following'.\n\n* 'Following': The following trading day.\n* 'ModifiedFollowing': The following trading day. If that day is in a different month, the preceding trading day is adopted instead.\n* 'Preceding': The preceding trading day.\n* 'ModifiedPreceding': The preceding trading day. If that day is in a different month, the following trading day is adopted instead.\n* 'Unadjusted': Unadjusted.\n* 'HalfMonthModifiedFollowing': The following trading day. If that day crosses the mid-month (15th) or the end of month, the preceding trading day is adopted instead.\n* 'Nearest': The nearest trading day. If both the preceding and following trading days are equally far away, default to following trading day.\n\n**termDateConvention** (optional) is a STRING scalar or vector indicating how maturity date that falls on a non-trading day is treated. Parameter options and the default value are the same as *convention*.\n\n**rule** (optional) is a STRING scalar or vector indicating how the list of dates is generated. It can be:\n\n* 'Backward': Backward from maturity date to settlement date.\n\n* 'Forward': Forward from settlement date to maturity date.\n\n* 'Zero': No intermediate dates between settlement date and maturity date.\n\n* 'ThirdWednesday': All dates but settlement date and maturity date are taken to be on the third Wednesday of their month (with forward calculation).\n\n* 'ThirdWednesdayInclusive': All dates are taken to be on the third Wednesday of their month (with forward calculation).\n\n* 'Twentieth': All dates but the settlement date are taken to be the twentieth of their month (used for CDS schedules in emerging markets). The maturity date is also modified.\n\n* 'TwentiethIMM': All dates but the settlement date are taken to be the twentieth of an IMM (International Money Market) month(used for CDS schedules). The maturity date is also modified.\n\n* 'OldCDS': Same as TwentiethIMM with unrestricted date ends and long/short stub coupon period (old CDS convention).\n\n* 'CDS' (default): [Credit derivatives standard rule](https://www.isda.org/2009/03/12/big-bang-protocol/) defined in the \"Big Bang\" Protocol in 2009.\n\n* 'CDS2015': [Ammended credit derivatives standard rule](https://www.isda.org/2015/07/07/amending-when-single-name-cds-roll-to-new-on-the-run-contracts/) that took effect on December 20, 2015.\n\n**basis**is an INT/STRING scalar or vector indicating the day-count basis. It can be:\n\n* 0/\"Thirty360US\": US (NASD) 30/360\n* 1/\"ActualActual\": actual/actual\n* 2/\"Actual360\": actual/360\n* 3/\"Actual365\": actual/365\n* 4/\"Thirty360EU\": European 30/360\n\n#### Examples\n\nThe following example values the specified CDS contract based on the input.\n\n```\nvalDate = 2007.05.15     \nsettlement = 2007.05.16\nmaturity = 2007.08.16\nnotional = 1000000.0\nspread = 0.0150\nriskFreeRate = 0.01\nrecoveryRate = 0.5\nisSeller = true\nfrequency = 4\nconvention = 'Following'\ntermDateConvention = 'Unadjusted'\nrule = 'TwentiethIMM'\nbasis = 3\ncds(settlement, maturity, valDate, notional, spread, riskFreeRate, recoveryRate, isSeller, frequency, 'CCFX', convention, termDateConvention, rule, basis)\n// Output: -5.448913728297157\n```\n"
    },
    "ceil": {
        "url": "https://docs.dolphindb.com/en/Functions/c/ceil.html",
        "signatures": [
            {
                "full": "ceil(X)",
                "name": "ceil",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [ceil](https://docs.dolphindb.com/en/Functions/c/ceil.html)\n\n\n\n#### Syntax\n\nceil(X)\n\n#### Details\n\nFunctions [floor](https://docs.dolphindb.com/en/Functions/f/floor.html) and `ceil` map a real number to the largest previous and the smallest following integer, respectively. Function [round](https://docs.dolphindb.com/en/Functions/r/round.html) maps a real number to the largest previous or the smallest following integer with the round half up rule.\n\n**Note:**\n\n* Difference from [numpy.ceil](https://numpy.org/doc/stable/reference/generated/numpy.ceil.html): DolphinDB `ceil` function only accepts one parameter, `X`, and does not support parameters such as *out*, *where*, *dtype*, *casting*, and *order* found in `numpy.ceil`.\n* Difference from Python TA-Lib’s `CEIL`: Both functions round values upward. TA-Lib’s `CEIL(close)` is a Math Transform function for vector input and returns a floating-point array. DolphinDB’s `ceil(X)` accepts a scalar, vector, or matrix and returns an integer scalar, vector, or matrix.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nAn integer scalar/vector/matrix.\n\n#### Examples\n\n```\nceil(2.1);\n// output: 3\nceil(2.9);\n// output: 3\nceil(-2.1);\n// output: -2\n\nfloor(2.1);\n// output: 2\nfloor(2.9);\n// output: 2\nfloor(-2.1);\n// output: -3\n\nround(2.1);\n// output: 2\nround(2.9);\n// output: 3\nround(-2.1);\n// output: -2\n\nm = 1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10$2:5;\nm;\n```\n\n| 0   | 1   | 2   | 3   | 4   |\n| --- | --- | --- | --- | --- |\n| 1.1 | 3.3 | 5.5 | 7.7 | 9.9 |\n| 2.2 | 4.4 | 6.6 | 8.8 | 10  |\n\n```\nceil(m);\n```\n\n| 0 | 1 | 2 | 3 | 4  |\n| - | - | - | - | -- |\n| 2 | 4 | 6 | 8 | 10 |\n| 3 | 5 | 7 | 9 | 10 |\n"
    },
    "cell": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cell.html",
        "signatures": [
            {
                "full": "cell(obj, row, col)",
                "name": "cell",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "row",
                        "name": "row"
                    },
                    {
                        "full": "col",
                        "name": "col"
                    }
                ]
            }
        ],
        "markdown": "### [cell](https://docs.dolphindb.com/en/Functions/c/cell.html)\n\n\n\n#### Syntax\n\ncell(obj, row, col)\n\n#### Details\n\nReturn a scalar that is the value of the specified cell: `obj[row, col]`. The `cell` function runs generally faster than `obj[row, col]`.\n\n#### Parameters\n\n**obj** is a matrix or table.\n\n**row** is a non-negative integer indicating a column number.\n\n**col** is a non-negative integer indicating a row number.\n\n#### Returns\n\nA scalar with the same data type as the corresponding element in *obj*.\n\n#### Examples\n\n```\nx=(1..6).reshape(3:2);\nx;\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\nx.cell(0,0);\n// output: 1\nx.cell(0,1);\n// output: 4\ncell(x,1,1);\n// output: 5\ncell(x,2,0);\n// output: 3\n```\n"
    },
    "cells": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cells.html",
        "signatures": [
            {
                "full": "cells(obj, row, col)",
                "name": "cells",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "row",
                        "name": "row"
                    },
                    {
                        "full": "col",
                        "name": "col"
                    }
                ]
            }
        ],
        "markdown": "### [cells](https://docs.dolphindb.com/en/Functions/c/cells.html)\n\n\n\n#### Syntax\n\ncells(obj, row, col)\n\n#### Details\n\nReturn a vector of cells in a matrix by the specified row and column index.\n\n#### Parameters\n\n**obj** is a matrix.\n\n**row** is a vector of integral type, indicating indices of rows.\n\n**col** is a vector of integral type of the same length as row, indicating indices of columns.\n\n#### Returns\n\nA vector with the same data type as the corresponding element in *obj*.\n\n#### Examples\n\n```\nm=(1..15).reshape(3:5)\nm;\n```\n\n| col1 | col2 | col3 | col4 | col5 |\n| ---- | ---- | ---- | ---- | ---- |\n| 1    | 4    | 7    | 10   | 13   |\n| 2    | 5    | 8    | 11   | 14   |\n| 3    | 6    | 9    | 12   | 15   |\n\n```\n// obtain the two elements at [0,1] and [0,2]\ncells(m, 0 0, 1 2)\n// output: [4,7]\n\n// obtain the elements on the diagonal of the matrix\nindex = 0..2\ncells(m, index, index)\n// output: [1, 5, 9]\n```\n"
    },
    "changelogStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/changelogStreamTable.html",
        "signatures": [
            {
                "full": "changelogStreamTable(keyColumn, X, [X1], [X2], .....)",
                "name": "changelogStreamTable",
                "parameters": [
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "changelogStreamTable(keyColumn, capacity:size, colNames, colTypes)",
                "name": "changelogStreamTable",
                "parameters": [
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            }
        ],
        "markdown": "### [changelogStreamTable](https://docs.dolphindb.com/en/Functions/c/changelogStreamTable.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nchangelogStreamTable(keyColumn, X, \\[X1], \\[X2], .....)\n\nor\n\nchangelogStreamTable(keyColumn, capacity:size, colNames, colTypes)\n\n#### Details\n\nCreates a keyed stream table with an internal status column.\n\n* The table contains an internal status column of type CHAR for tracking data change log. Currently supports two states:\n  1. 'N': NEW, indicating a new record when the key does not exist;\n  2. 'U': UPDATE, indicating an updated record when the key already exists.\n* The status column also supports user-defined status values.\n* Queries return only the latest record for each key.\n\n**Note:**\n\nCurrently, when the time series engine and reactive state engine process the *dummyTable* that is a stream table with a status column, only some operators are supported:\n\n* For time series engine, when *keyColumn* is set and *updateTime*=0, the following operators are supported:\n  * sum, avg, sum2, sum3, sum4, count, std, stdp, var, varp\n* For reactive state engine, the following operators are supported:\n  * cumavg, cumsum, cumstd, cumstdp, cumvar, cumvarp, cumprod, cumcount, mcount, msum, mavg, mstd, mstdp, mvar, mvarp, as well as stateless operators (expressions, stateless functions, etc.)\n\n#### Parameters\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n  * false for Boolean type;\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n  * Null value for Literal, INT128 types.\n\n* **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a string vector of data types. The non-key columns can be specified as an array vector type or ANY type.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nshare changelogStreamTable(`sym`time, 100:0, `sym`time`price, [STRING,DATETIME,DOUBLE]) as tickStream\nn=4\ndata1 = table(take(\"000001.SH\", n) as sym, take(2021.02.08T09:30:00 + 1..2, n) as time, 10+rand(100.0, n) as price)\ntickStream.append!(data1)\nselect * from tickStream\n```\n\n|   | sym       | time                | price             |\n| - | --------- | ------------------- | ----------------- |\n| 0 | 000001.SH | 2021.02.08 09:30:01 | 89.723076797026   |\n| 1 | 000001.SH | 2021.02.08 09:30:02 | 69.34098429496888 |\n\n**Related functions**: [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html), [getStreamTableChangelog](https://docs.dolphindb.com/en/Functions/g/getStreamTableChangelog.html)\n"
    },
    "changePwd": {
        "url": "https://docs.dolphindb.com/en/Functions/c/changePwd.html",
        "signatures": [
            {
                "full": "changePwd(oldPwd, newPwd)",
                "name": "changePwd",
                "parameters": [
                    {
                        "full": "oldPwd",
                        "name": "oldPwd"
                    },
                    {
                        "full": "newPwd",
                        "name": "newPwd"
                    }
                ]
            }
        ],
        "markdown": "### [changePwd](https://docs.dolphindb.com/en/Functions/c/changePwd.html)\n\n\n\n#### Syntax\n\nchangePwd(oldPwd, newPwd)\n\n#### Details\n\nChange password.\n\n#### Parameters\n\n**oldPwd** is a string indicating the current password for the user.\n\n**newPwd** is a string indicating the new password for the user. It cannot contain space or control characters.\n\nSince DolphinDB 2.00.10.10, users can determine whether to verify the complexity of *newPwd* by setting the configuration *enhancedSecurityVerification*. If it is not specified, no verification will be applied; if it is set to true, the password must meet the following conditions:\n\n* 8-20 characters\n\n* at least 1 capital letter\n\n* at least 1 special character, including !\"#$%&'()\\*+,-./:;<=>?@\\[]^\\_\\`{|}\\~\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nchangePwd(`LTmp4389, `T5139pm);\n```\n"
    },
    "char": {
        "url": "https://docs.dolphindb.com/en/Functions/c/char.html",
        "signatures": [
            {
                "full": "char(X)",
                "name": "char",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [char](https://docs.dolphindb.com/en/Functions/c/char.html)\n\n\n\n#### Syntax\n\nchar(X)\n\n#### Details\n\nConvert the input to the data type of CHAR.\n\n#### Parameters\n\n**X** can be of any data type.\n\n#### Returns\n\nA scalar of type CHAR.\n\n#### Examples\n\n```\nx=char();\nx;\n// output: 00c\n\ntypestr x;\n// output: CHAR\n\na=char(99);\na;\n// output: 'c'\n\nchar(\"990\");\nFailed to convert the string to CHAR'\n\ntypestr a;\n// output: CHAR\n\nchar(a+5);\n// output: 'h'\n```\n"
    },
    "charAt": {
        "url": "https://docs.dolphindb.com/en/Functions/c/charAt.html",
        "signatures": [
            {
                "full": "charAt(X, Y)",
                "name": "charAt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [charAt](https://docs.dolphindb.com/en/Functions/c/charAt.html)\n\n\n\n#### Syntax\n\ncharAt(X, Y)\n\n#### Details\n\nReturn the character in *X* at the position specified by *Y*. The result is a scalar/vector of data type CHAR.\n\n#### Parameters\n\n**X** is a STRING scalar/vector.\n\n**Y** is an integer scalar/vector. If *Y* is a vector, it must be of the same length as *X*.\n\n#### Returns\n\nA scalar or vector of type CHAR.\n\n#### Examples\n\n```\ns=charAt(\"abc\",2);\ns;\n// output: 'c'\n\ntypestr(s);\n// output: CHAR\n\ncharAt([\"hello\",\"world\"],[3,4]);\n// output: ['l','d']\n```\n"
    },
    "checkBackup": {
        "url": "https://docs.dolphindb.com/en/Functions/c/checkBackup.html",
        "signatures": [
            {
                "full": "checkBackup(backupDir, dbPath, [tableName], [partition])",
                "name": "checkBackup",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    },
                    {
                        "full": "[partition]",
                        "name": "partition",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [checkBackup](https://docs.dolphindb.com/en/Functions/c/checkBackup.html)\n\n\n\n#### Syntax\n\ncheckBackup(backupDir, dbPath, \\[tableName], \\[partition])\n\n#### Details\n\nCheck the data integrity of the backup files. Return an empty table if all backup files are complete and accurate; Otherwise return the information of abnormal backup files. You can set *force*=true for function backup to enable force backup to restore the corrupt backup partitions.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory to save the backup.\n\n**dbPath** is a string indicating the database path.\n\n**tableName** (optional) is a string indicating the table name. If tableName is unspecified, all tables in the database are checked.\n\n**partition** (optional) is a string indicating the relative path of the backup partitions. Use \"?\" as a single wildcard and \"%\" as a wildcard that can match zero or more characters.\n\n* For a certain partition, specify the relative path or \"%/\" + \"partition name\". For example, for the \"20170810/50\\_100\" partition under \"dfs\\://compoDB\", specify \"/compoDB/20170807/0\\_50\" or \"%/20170807/0\\_50\" as partition path.\n\n* For all the partitions: specify \"%\".\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\ndbName = \"dfs://compoDB2\"\nn=1000\nID=rand(\"a\"+string(1..10), n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10, n)\nt=table(ID, date, x)\ndb1 = database(, VALUE, 2017.08.07..2017.08.11)\ndb2 = database(, HASH,[INT, 20])\nif(existsDatabase(dbName)){\ndropDatabase(dbName)\n}\ndb = database(dbName, COMPO,[ db1,db2])\n\n//create 2 tables\npt1 = db.createPartitionedTable(t, `pt1, `date`x).append!(t)\npt2 = db.createPartitionedTable(t, `pt2, `date`x).append!(t)\n\n//back up pt1 with SQL statement\nbackup(backupDir=backupDir1, sqlObj=<select * from pt1>, parallel=true)\n//back up pt2 by copying files\nbackup(backupDir=backupDir2, dbPath=dbName, parallel=true, tableName=`pt2)\n\n//check data integrity\ncheckBackup(backupDir=backupDir2, dbPath=dbName, tableName=\"pt2\")  //return an empty table\ncheckBackup(backupDir=backupDir1, dbPath=dbName, tableName=\"pt1\")  //return the corrupted chunk information\n```\n\n| dbName          | tableName | chunkPath                 | chunkID                              | partitionPath  |\n| --------------- | --------- | ------------------------- | ------------------------------------ | -------------- |\n| dfs\\://compoDB2 | pt1       | /compoDB2/20170807/Key2/9 | 4ae71414-8bfe-4283-b04c-b2e48e90be08 | /20170807/Key2 |\n\nIn the above example, there is a corrupt chunk file of pt1. We can restore the file by setting *force*=true to back up the table again.\n\n```\nbackup(backupDir1, <select * from pt1>,force=true, parallel=true)\ncheckBackup(backupDir=backupDir1, dbPath=dbName, tableName=\"pt1\")  // return an empty table\n```\n"
    },
    "checkpointHaMvcc": {
        "url": "https://docs.dolphindb.com/en/Functions/c/checkpointHaMvcc.html",
        "signatures": [
            {
                "full": "checkpointHaMvcc(groupId)",
                "name": "checkpointHaMvcc",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [checkpointHaMvcc](https://docs.dolphindb.com/en/Functions/c/checkpointHaMvcc.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ncheckpointHaMvcc(groupId)\n\n#### Details\n\nManually triggers a checkpoint for the specified HA MVCC Raft group.\n\n#### Parameters\n\n**groupId** is an integer indicating the HA MVCC Raft group ID.\n\n#### Examples\n\n```\ncheckpointHaMvcc(5)\n```\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "chiSquareTest": {
        "url": "https://docs.dolphindb.com/en/Functions/c/chiSquareTest.html",
        "signatures": [
            {
                "full": "chiSquareTest(X, [Y])",
                "name": "chiSquareTest",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [chiSquareTest](https://docs.dolphindb.com/en/Functions/c/chiSquareTest.html)\n\n\n\n#### Syntax\n\nchiSquareTest(X, \\[Y])\n\n#### Details\n\nIf *X* is a vector, conduct a Chi-squared test for given expected values whether *X* and *Y* follow the same distribution.\n\nIf *X* is a matrix/table, conduct Pearson's Chi-squared test on *X*.\n\n#### Parameters\n\n**X** is a numeric vector/matrix/table.\n\nIf *X* is a vector, *Y* is a numeric vector of the same length as *X*. *Y* is not required if *X* is not a vector.\n\n#### Returns\n\nReturn a dictionary with the following keys:\n\n* pValue: p-value of the test\n\n* df: degree of freedom\n\n* chiSquaredValue: Chi-squared test statistic\n\n* method: either \"Chi-squared test for given expected values\" or \"Pearson's Chi-squared test\"\n\n#### Examples\n\nExample 1. *X* is a vector.\n\n```\nx=rand(10.0,50)\ny=rand(10.0,50)\nchiSquareTest(x,y);\n\n/* output\npValue->0\ndf->49\nchiSquaredValue->947.388015\nmethod->Chi-squared test for given expected values\n*/\n```\n\nExample 2. *X* is a matrix.\n\n```\nx = matrix([762, 484], [327, 239], [468, 477])\nx.rename!(`female`male, `Democrat`Independent`Republican)\nx;\n```\n\n|        | Democrat | Independent | Republican |\n| ------ | -------- | ----------- | ---------- |\n| female | 762      | 327         | 468        |\n| male   | 484      | 239         | 477        |\n\n```\nchiSquareTest(x);\n/* output\npValue->2.953589E-7\ndf->2\nchiSquaredValue->30.070149\nmethod->Pearson's Chi-squared test\n*/\n```\n"
    },
    "cholesky": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cholesky.html",
        "signatures": [
            {
                "full": "cholesky(obj, [lower=true])",
                "name": "cholesky",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[lower=true]",
                        "name": "lower",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [cholesky](https://docs.dolphindb.com/en/Functions/c/cholesky.html)\n\n\n\n#### Syntax\n\ncholesky(obj, \\[lower=true])\n\n#### Details\n\nConduct Cholesky decomposition of a symmetric positive-definite matrix.\n\n#### Parameters\n\n**obj** is a symmetric positive definite matrix.\n\n**lower** (optional) is a Boolean value indicating whether the result is a lower triangular matrix (true, default) or an upper triangular matrix (false).\n\n#### Returns\n\nA matrix of type DOUBLE.\n\n#### Examples\n\n```\nm=[1, 0, 1, 0, 2, 0, 1, 0, 3]$3:3\nL=cholesky(m);\nL;\n```\n\n| #0 | #1       | #2       |\n| -- | -------- | -------- |\n| 1  | 0        | 0        |\n| 0  | 1.414214 | 0        |\n| 1  | 0        | 1.414214 |\n\n```\nL**transpose(L);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 0  | 1  |\n| 0  | 2  | 0  |\n| 1  | 0  | 3  |\n\n```\ncholesky(m, false);\n```\n\n| #0 | #1       | #2       |\n| -- | -------- | -------- |\n| 1  | 0        | 1        |\n| 0  | 1.414214 | 0        |\n| 0  | 0        | 1.414214 |\n"
    },
    "cj": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cj.html",
        "signatures": [
            {
                "full": "cj(X, Y)",
                "name": "cj",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cj](https://docs.dolphindb.com/en/Functions/c/cj.html)\n\n\n\n#### Syntax\n\ncj(X, Y)\n\n#### Details\n\nPerform a cross join between two tables and returns their Cartesian product. If *X* has n rows and *Y* has m rows, then cj(X,Y) has n\\*m rows.\n\n#### Parameters\n\n**X** and **Y** are tables.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\na=table(1..3 as x,`IBM`C`AAPL as y)\nb=table(172.3 25 106.5 as z)\nc=cj(a,b);\nc;\n```\n\n| x | y    | z     |\n| - | ---- | ----- |\n| 1 | IBM  | 172.3 |\n| 1 | IBM  | 25    |\n| 1 | IBM  | 106.5 |\n| 2 | C    | 172.3 |\n| 2 | C    | 25    |\n| 2 | C    | 106.5 |\n| 3 | AAPL | 172.3 |\n| 3 | AAPL | 25    |\n| 3 | AAPL | 106.5 |\n\n```\n// in contrast, the join (<-) operation simply merges two tables' columns\na join b;\n```\n\n| x | y    | z     |\n| - | ---- | ----- |\n| 1 | IBM  | 172.3 |\n| 2 | C    | 25    |\n| 3 | AAPL | 106.5 |\n"
    },
    "cleanOutdateLogFiles": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cleanOutdateLogFiles.html",
        "signatures": [
            {
                "full": "cleanOutdateLogFiles([retentionTime=30])",
                "name": "cleanOutdateLogFiles",
                "parameters": [
                    {
                        "full": "[retentionTime=30]",
                        "name": "retentionTime",
                        "optional": true,
                        "default": "30"
                    }
                ]
            }
        ],
        "markdown": "### [cleanOutdateLogFiles](https://docs.dolphindb.com/en/Functions/c/cleanOutdateLogFiles.html)\n\n\n\n#### Syntax\n\ncleanOutdateLogFiles(\\[retentionTime=30])\n\n#### Details\n\nCall this command to remove the log files kept for over *retentionTime*.\n\n#### Parameters\n\n**retentionTime** (optional) is the amount of time to keep a log file. The default value is 30 (days).\n\n#### Returns\n\nNone.\n"
    },
    "clear!": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clear!.html",
        "signatures": [
            {
                "full": "clear!(X)",
                "name": "clear!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [clear!](https://docs.dolphindb.com/en/Functions/c/clear!.html)\n\n\n\n#### Syntax\n\nclear!(X)\n\n#### Details\n\nClear the contents of *X*. After execution *X* still exists. It retains its initial data type and can be appended with new data.\n\n#### Parameters\n\n**X** can be a vector, matrix, set, dictionary, or in-memory table.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx=1 2 3;\nclear!(x);\n// output: []\n\ntypestr x;\n// output: FAST INT VECTOR\n\nsize x;\n// output: 0\n\nx.append!(1..6);\n// output: [1,2,3,4,5,6]\n\ny=set(8 9 4 6);\ny.clear!();\n// output: set()\n\nx=1..3;\ny=4..6;\nz=dict(x,y);\nz;\n/* output\n3->6\n1->4\n2->5\n*/\nz.clear!();\n\nt = table(1 2 3 as id, 1.0 2.0 3.0 as value)\nt.clear!()\n```\n"
    },
    "clearAllCache": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearAllCache.html",
        "signatures": [
            {
                "full": "clearAllCache()",
                "name": "clearAllCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [clearAllCache](https://docs.dolphindb.com/en/Functions/c/clearAllCache.html)\n\n\n\n#### Syntax\n\nclearAllCache()\n\n#### Details\n\nClear the following cached data:\n\n* the data of dimension table stored in memory\n* the data of OLAP DFS tables that has been loaded into memory\n* the cached level file index of TSDB engine\n* the cached SYMBOL base of TSDB engine\n* the intermediate results of the map-reduce tasks in distributed computing\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n\n#### Examples\n\n```\nclearAllCache();\n```\n"
    },
    "clearAllIOTDBLatestKeyCache": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearAllIOTDBLatestKeyCache.html",
        "signatures": [
            {
                "full": "clearAllIOTDBLatestKeyCache()",
                "name": "clearAllIOTDBLatestKeyCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [clearAllIOTDBLatestKeyCache](https://docs.dolphindb.com/en/Functions/c/clearAllIOTDBLatestKeyCache.html)\n\n\n\n#### Syntax\n\nclearAllIOTDBLatestKeyCache()\n\n#### Details\n\nClear the latest value table cache.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n\n#### Examples\n\n```\nclearAllIOTDBLatestKeyCache()\n```\n"
    },
    "clearAllIOTDBStaticTableCache": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearAllIOTDBStaticTableCache.html",
        "signatures": [
            {
                "full": "clearAllIOTDBStaticTableCache()",
                "name": "clearAllIOTDBStaticTableCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [clearAllIOTDBStaticTableCache](https://docs.dolphindb.com/en/Functions/c/clearAllIOTDBStaticTableCache.html)\n\n\n\n#### Syntax\n\nclearAllIOTDBStaticTableCache()\n\n#### Details\n\nClear the static table cache.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n\n#### Examples\n\n```\nclearAllIOTDBStaticTableCache()\n```\n"
    },
    "clearAllTSDBSymbolBaseCache": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearAllTSDBSymbolBaseCache.html",
        "signatures": [
            {
                "full": "clearAllTSDBSymbolBaseCache()",
                "name": "clearAllTSDBSymbolBaseCache",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [clearAllTSDBSymbolBaseCache](https://docs.dolphindb.com/en/Functions/c/clearAllTSDBSymbolBaseCache.html)\n\n\n\n#### Syntax\n\nclearAllTSDBSymbolBaseCache()\n\n#### Details\n\nClear all cached SYMBOL base entries that are absent from both the cache engine and ongoing transactions.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n\n#### Examples\n\n```\nclearAllTSDBSymbolBaseCache();\n```\n"
    },
    "clearCachedDatabase": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearCachedDatabase.html",
        "signatures": [
            {
                "full": "clearCachedDatabase(dbUrl, [tableName])",
                "name": "clearCachedDatabase",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [clearCachedDatabase](https://docs.dolphindb.com/en/Functions/c/clearCachedDatabase.html)\n\n\n\n#### Syntax\n\nclearCachedDatabase(dbUrl, \\[tableName])\n\n#### Details\n\nClears the cached tables in memory loaded from a DFS database. You can check the memory usage with function [getSessionMemoryStat](https://docs.dolphindb.com/en/Functions/g/getSessionMemoryStat.html).\n\n#### Parameters\n\n**dbUrl** is a string indicating the path to a DFS database.\n\n**tableName** (optional) is a string indicating the table name. It can be a dimension table or DFS partitionted table.\n\n#### Returns\n\nNone\n"
    },
    "clearCachedModules": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearCachedModules.html",
        "signatures": [
            {
                "full": "clearCachedModules()",
                "name": "clearCachedModules",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [clearCachedModules](https://docs.dolphindb.com/en/Functions/c/clearCachedModules.html)\n\n\n\n#### Syntax\n\nclearCachedModules()\n\n#### Details\n\nClear all cached modules. After updating a module, execute this command to clear the cached module data. When you call the module via `use`, the system reloads it from the module file instead of using the cached data, and there is no need to restart the node.\n\nNote: This function can only be executed by administrators.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n\n#### Examples\n\nDefine a module.\n\n```\nmodule printLog\ndef printLog(){\nprint \"hello\"\n}\n```\n\nLoad the module.\n\n```\nuse printLog\nprintLog()\n// output: hello\n```\n\nUpdate the module.\n\n```\nmodule printLog\ndef printLog(){\nprint \"hello new\"\n}\n```\n\nBefore loading the updated module, call `clearCachedModules` to clear the cached module.\n\n```\nlogin(\"admin\", \"123456\")\n\nclearCachedModules();\n\nuse printLog\nprintLog()\n// output: hello new\n```\n"
    },
    "clearComputeNodeCache": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearComputeNodeCache.html",
        "signatures": [
            {
                "full": "clearComputeNodeCache(database, [table], [partition])",
                "name": "clearComputeNodeCache",
                "parameters": [
                    {
                        "full": "database",
                        "name": "database"
                    },
                    {
                        "full": "[table]",
                        "name": "table",
                        "optional": true
                    },
                    {
                        "full": "[partition]",
                        "name": "partition",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [clearComputeNodeCache](https://docs.dolphindb.com/en/Functions/c/clearComputeNodeCache.html)\n\n\n\n#### Syntax\n\nclearComputeNodeCache(database, \\[table], \\[partition])\n\n#### Details\n\nCall the function on a compute node within a compute group to clear the memory and disk cache.\n\nNote: Executing this function does not guarantee that all cached data will be cleared.\n\n#### Parameters\n\n**database**is a string indicating the database name.\n\n**table** (optional) is a string indicating the table name. It can contain the following wildcards:\n\n* \"\\*\" (default): matches all;\n\n* \"?\": matches a single character;\n\n* \"%\": matches 0, 1 or more characters.\n\n**partition** (optional) is a STRING scalar or vector indicating the DFS path of a partition. If *partition* is not specified, it indicates all partitions.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nClear the memory cache and disk cache of the “database\\_compute” database.\n\n```\nclearComputeNodeCache(\"dfs://database_compute\")      \n```\n\nClear the memory cache and disk cache of tables with the prefix of “pt” in the “database\\_compute” database.\n\n```\nclearComputeNodeCache(\"dfs://database_compute\",\"pt%\")              \n```\n"
    },
    "clearComputeNodeDiskCache": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearcomputenodediskcache.html",
        "signatures": [
            {
                "full": "clearComputeNodeDiskCache(database, [table], [partition])",
                "name": "clearComputeNodeDiskCache",
                "parameters": [
                    {
                        "full": "database",
                        "name": "database"
                    },
                    {
                        "full": "[table]",
                        "name": "table",
                        "optional": true
                    },
                    {
                        "full": "[partition]",
                        "name": "partition",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [clearComputeNodeDiskCache](https://docs.dolphindb.com/en/Functions/c/clearcomputenodediskcache.html)\n\n\n\n#### Syntax\n\nclearComputeNodeDiskCache(database, \\[table], \\[partition])\n\n#### Details\n\nOn a compute node in the compute group, invoke the function to clear the disk cache. Note that this operation cannot guarantee a complete cache clearing.\n\n#### Parameters\n\n**database** is a string indicating the database name.\n\n**table** (optional) is a string indicating the table name. It can contain the following wildcards:\n\n* \"\\*\" (default): matches all;\n\n* \"?\": matches a single character;\n\n* \"%\": matches 0, 1 or more characters.\n\n**partition** (optional) is a STRING scalar or vector indicating the DFS path of a partition. If *partition* is not specified, it indicates all partitions.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nClear the disk cache of the “database\\_compute” database.\n\n```\nclearComputeNodeDiskCache(\"dfs://database_compute\")      \n```\n\nClear the disk cache of tables with the prefix of “pt” in the “database\\_compute” database.\n\n```\nclearComputeNodeDiskCache(\"dfs://database_compute\",\"pt%\")           \n```\n"
    },
    "clearDSCache!": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearDSCache!.html",
        "signatures": [
            {
                "full": "clearDSCache!(ds)",
                "name": "clearDSCache!",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    }
                ]
            }
        ],
        "markdown": "### [clearDSCache!](https://docs.dolphindb.com/en/Functions/c/clearDSCache!.html)\n\n\n\n#### Syntax\n\nclearDSCache!(ds)\n\n#### Details\n\nInstruct the system to clear the cache after the next time the data source is executed.\n\n#### Parameters\n\n**ds** is a data source or a list of data sources.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nPTNDB_DIR = \"/home/db_testing\"\ndbName = database(PTNDB_DIR + \"/NYSETAQByName\")\nTrades = dbName.loadTable(`Trades)\n\nds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)\nds.cacheDS!()        //cache the data\nds.clearDSCache!()   //clear the cache\n```\n"
    },
    "clearDSCacheNow": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearDSCacheNow.html",
        "signatures": [
            {
                "full": "clearDSCacheNow(ds)",
                "name": "clearDSCacheNow",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    }
                ]
            }
        ],
        "markdown": "### [clearDSCacheNow](https://docs.dolphindb.com/en/Functions/c/clearDSCacheNow.html)\n\n\n\n#### Syntax\n\nclearDSCacheNow(ds)\n\n#### Details\n\nImmediately clear the data source and cache.\n\n#### Parameters\n\n**ds** is a data source or a list of data sources.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nPTNDB_DIR = \"/home/db_testing\"\ndbName = database(PTNDB_DIR + \"/NYSETAQByName\")\nTrades = dbName.loadTable(`Trades)\n\nds=sqlDS(<select Time,Exchange,Symbol,Trade_Volume as Vol, Trade_Price as Price from Trades>)\nds.cacheDSNow()        //cache the data immediately\nds.clearDSCacheNow()   //clear the cache immediately\n```\n"
    },
    "clearTablePersistence": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clearTablePersistence.html",
        "signatures": [
            {
                "full": "clearTablePersistence(table)",
                "name": "clearTablePersistence",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [clearTablePersistence](https://docs.dolphindb.com/en/Functions/c/clearTablePersistence.html)\n\n\n\n#### Syntax\n\nclearTablePersistence(table)\n\n#### Details\n\nDisable a table's persistence to disk, then delete the content of the table on disk. The table schema remains.\n\n#### Parameters\n\n**table** is a table object.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ncolName=[\"time\",\"x\"]\ncolType=[\"timestamp\",\"int\"]\nt = streamTable(100:0, colName, colType);\nenableTableShareAndPersistence(table=t, tableName=`st, cacheSize=1200000)\ngo;\n```\n\n```\nfor(s in 0:200){\n   n=10000\n   time=2019.01.01T00:00:00.000+s*n+1..n\n   x=rand(10.0, n)\n   insert into st values(time, x)\n}\nclearTablePersistence(st);\n```\n\nRelated commands: [enableTablePersistence](https://docs.dolphindb.com/en/Functions/e/enableTablePersistence.html), [disableTablePersistence](https://docs.dolphindb.com/en/Functions/d/disableTablePersistence.html)\n"
    },
    "clip": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clip.html",
        "signatures": [
            {
                "full": "clip(X,Y,Z)",
                "name": "clip",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "Z",
                        "name": "Z"
                    }
                ]
            }
        ],
        "markdown": "### [clip](https://docs.dolphindb.com/en/Functions/c/clip.html)\n\n\n\n#### Syntax\n\nclip(X,Y,Z)\n\n#### Details\n\nClips *X* to specified range.\n\n**Return value**: *X'* of the same data type and form as *X*.\n\nThe following rules determine how *X* is clipped (If *X* is a dictionary, \"element\" indicates the dictionary value):\n\n* When *Y* and *Z* are scalars, the clipping range is \\[*Y, Z*]. Values outside this range are clipped to the nearest boundary.\n  * Null *Y* or *Z* indicates no limit on the lower or upper bound.\n  * If *Y* is greater than *Z*, all elements in *X'*are*Z*.\n* When *Y* and *Z* are vectors, matrices, or tables, each element*Xi* is clipped within the range \\[*Yi, Zi*]. Note: If any element in *Y* or *Z* is null, the corresponding element in *X'* is also null.\n* When *Y* or *Z* is a scalar, and the other is a vector, matrix, or table, each element *Xi* is clipped within the range *\\[Y,Zi]* or *\\[Yi,Z].*\n  * The scalar represents a fixed boundary for all elements in *X*, while vector/matrix/table specify the boundary limits for *Xi* in the corresponding position.\n  * If the scalar is null, no limit is set on the boundary. If any element in the vector, matrix or table is null, the corresponding element in *X'* is also null.\n  * If *Y* is greater than *Z* for a specific position, the corresponding element in *X'* is set to *Z*.\n\nIf *X* is a matrix or table, the aforementioned calculations will be performed on each column.\n\n#### Parameters\n\n**X** is a numeric or temporal scalar/vector/matrix/table, or a dictionary with numeric or temporal values.\n\n**Y** is a numeric or temporal scalar/vector/matrix/table indicating the lower bound for the clipping range.\n\n**Z** is a numeric or temporal scalar/vector/matrix/table indicating the upper bound for the clipping range.\n\n**Data Type Requirements:**\n\n* If *X* is INTEGRAL, *Y* and *Z* must be INTEGRAL.\n* If *X* is FLOATING or DECIMAL, *Y* and *Z* can be INTEGRAL, FLOATING or DECIMAL.\n* If *X* is TEMPORAL, *Y* and *Z* must be the same TEMPORAL type.\n\n**Data Form Requirements:**\n\n* If *X* is a scalar or dictionary, *Y* and *Z* must be scalars.\n* If *X* is a vector, *Y* and *Z* can be scalars, or vectors of the same length as *X*.\n* If *X* is a matrix, *Y* and *Z* can be scalars, or matrices of the same dimension as *X*.\n* If *X* is a table, *Y* and *Z* can be scalars, or tables of the same dimension as *X*.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\nExample 1. When *Y* and *Z* are scalars.\n\nSet upper bound to 5:\n\n```\nX = table(1..10 as val1, 10..1 as val2)\nY = NULL // NULL means no limit\nZ = 5\n\nclip(X,Y,Z)\n```\n\n| val1 | val2 |\n| ---- | ---- |\n| 1    | 5    |\n| 2    | 5    |\n| 3    | 5    |\n| 4    | 5    |\n| 5    | 5    |\n| 5    | 5    |\n| 5    | 4    |\n| 5    | 3    |\n| 5    | 2    |\n| 5    | 1    |\n\nSet all elements to 3 (with *Y*>*Z*):\n\n```\nX = 1..10\nY = 6\nZ = 3\nclip(X,Y,Z) \n// output:[3,3,3,3,3,3,3,3,3,3]\n```\n\nSet a range \\[3,5]:\n\n```\nX = dict(`a`b`c`d`e`f,[1,2,3,4,5,6])\nY = 3\nZ = 5\nclip(X,Y,Z)\n\n/*\noutput:\na->3\nb->3\nc->3\nd->4\ne->5\nf->5\n*/\n```\n\nExample 2. When *Y* and *Z* are vectors\n\n```\nX = [1,2,3,4,5,6,7,8,9,10]\nY = [0,1,2,5,6,6,6,NULL,7,7]\nZ = [3,4,5,6,7,8,NULL,5,5,9]\nclip(X,Y,Z)\n// output:[1,2,3,5,6,6,,,5,9]\n```\n\nExample 3. When *Y* or *Z* is a scalar, and the other is a vector, matrix, or table\n\nSet a clipping range \\[4,Z\\[i,j]]:\n\n```\nX = 1..8$2:4\nY = 4\nZ = [5,6,5,6,NULL,3,5,6]$2:4\nclip(X,Y,Z)\n```\n\n<table id=\"table_n52_mny_gdc\"><tbody><tr><td align=\"left\">\n\n4\n\n</td><td align=\"left\">\n\n4\n\n</td><td align=\"left\">\n\n \n\n</td><td align=\"left\">\n\n5\n\n</td></tr><tr><td align=\"left\">\n\n4\n\n</td><td align=\"left\">\n\n4\n\n</td><td align=\"left\">\n\n3\n\n</td><td align=\"left\">\n\n6\n\n</td></tr></tbody>\n</table>\n"
    },
    "clip!": {
        "url": "https://docs.dolphindb.com/en/Functions/c/clip_.html",
        "signatures": [
            {
                "full": "clip!(X,Y,Z)",
                "name": "clip!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "Z",
                        "name": "Z"
                    }
                ]
            }
        ],
        "markdown": "### [clip!](https://docs.dolphindb.com/en/Functions/c/clip_.html)\n\n\n\n#### Syntax\n\nclip!(X,Y,Z)\n\n#### Details\n\nClips *X* to specified range. The exclamation mark (!) means in-place change in DolphinDB.\n\n#### Returns\n\nNone.\n"
    },
    "close": {
        "url": "https://docs.dolphindb.com/en/Functions/c/close.html",
        "signatures": [
            {
                "full": "close(X)",
                "name": "close",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [close](https://docs.dolphindb.com/en/Functions/c/close.html)\n\n\n\n#### Syntax\n\nclose(X)\n\n#### Details\n\nClose an opened file handle or a remote call connection. It must be executed by a logged-in user.\n\n#### Parameters\n\n**X** is a file handle or a remote call connection.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nfout.writeLine(\"hello world!\");\n// output: 1\n\nfout.close();\nfin = file(\"test3.txt\");\nprint fin.readLine();\nhello world!\nfin.close();\n```\n"
    },
    "closeSessions": {
        "url": "https://docs.dolphindb.com/en/Functions/c/closeSessions.html",
        "signatures": [
            {
                "full": "closeSessions(sessionId)",
                "name": "closeSessions",
                "parameters": [
                    {
                        "full": "sessionId",
                        "name": "sessionId"
                    }
                ]
            }
        ],
        "markdown": "### [closeSessions](https://docs.dolphindb.com/en/Functions/c/closeSessions.html)\n\n\n\n#### Syntax\n\ncloseSessions(sessionId)\n\n#### Details\n\nForce close one or multiple sessions.\n\n#### Parameters\n\n**sessionId** is a LONG scalar or vector indicating one or multiple session IDs.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ngetSessionMemoryStat();\n```\n\n| userId                   | sessionId     | memSize | remoteIP    | remotePort | createTime              | lastActiveTime          |\n| ------------------------ | ------------- | ------- | ----------- | ---------- | ----------------------- | ----------------------- |\n| \\_DimensionalTable\\_     | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_SharedTable\\_          | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_OLAPTablet\\_           | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_OLAPCacheEngine\\_      | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_OLAPCachedSymbolBase\\_ | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_DFSMetadata\\_          | 13,571        | 0.0.0.0 |             |            |                         |                         |\n| \\_TSDBCacheEngine\\_      | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_TSDBLevelFileIndex\\_   | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_TSDBCachedSymbolBase\\_ | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_StreamingPubQueue\\_    | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_StreamingSubQueue\\_    | 0             | 0.0.0.0 |             |            |                         |                         |\n| guest                    | 1,769,725,800 | 16      | 36.27.51.13 | 63,133     | 1970.01.01T00:00:00.000 | 2023.08.31T22:35:27.385 |\n| admin                    | 2,882,591,513 | 6,449   | 36.27.51.13 | 60,812     | 1970.01.01T00:00:00.000 | 2023.08.31T22:18:27.562 |\n\n```\ncloseSessions(getSessionMemoryStat().sessionId[11]);\n```\n\n| userId                   | sessionId     | memSize | remoteIP    | remotePort | createTime              | lastActiveTime          |\n| ------------------------ | ------------- | ------- | ----------- | ---------- | ----------------------- | ----------------------- |\n| \\_DimensionalTable\\_     | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_SharedTable\\_          | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_OLAPTablet\\_           | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_OLAPCacheEngine\\_      | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_OLAPCachedSymbolBase\\_ | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_DFSMetadata\\_          | 13,571        | 0.0.0.0 |             |            |                         |                         |\n| \\_StreamingPubQueue\\_    | 0             | 0.0.0.0 |             |            |                         |                         |\n| \\_StreamingSubQueue\\_    | 0             | 0.0.0.0 |             |            |                         |                         |\n| guest                    | 1,769,725,800 | 16      | 36.27.51.13 | 63,133     | 1970.01.01T00:00:00.000 | 2023.08.31T22:35:27.385 |\n| admin                    | 2,882,591,513 | 6,449   | 36.27.51.13 | 60,812     | 1970.01.01T00:00:00.000 | 2023.08.31T22:18:27.562 |\n\n```\ncloseSessions(getSessionMemoryStat().sessionId[8]);\n```\n"
    },
    "cmFutAmericanOptionPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cmfutamericanoptionpricer.html",
        "signatures": [
            {
                "full": "cmFutAmericanOptionPricer(instrument, pricingDate, futPrice, discountCurve, volSurf, [setting], [model], [method])",
                "name": "cmFutAmericanOptionPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "futPrice",
                        "name": "futPrice"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "volSurf",
                        "name": "volSurf"
                    },
                    {
                        "full": "[setting]",
                        "name": "setting",
                        "optional": true
                    },
                    {
                        "full": "[model]",
                        "name": "model",
                        "optional": true
                    },
                    {
                        "full": "[method]",
                        "name": "method",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [cmFutAmericanOptionPricer](https://docs.dolphindb.com/en/Functions/c/cmfutamericanoptionpricer.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\ncmFutAmericanOptionPricer(instrument, pricingDate, futPrice, discountCurve, volSurf, \\[setting], \\[model], \\[method])\n\n#### Details\n\nPrices American commodity futures options.\n\n#### Parameters\n\n**instrument**: An INSTRUMENT scalar or vector specifying the American commodity futures options to be priced.\n\n**pricingDate**: A DATE scalar or vector specifying the pricing date.\n\n**futPrice**: A DOUBLE scalar or vector specifying the current price of the underlying futures contract.\n\n**domesticCurve**: A MKTDATA scalar or vector specifying the domestic discount curve.\n\n**volSurf** : A MKTDATA scalar or vector specifying the volatility surface.\n\n**setting** (optional): A dictionary used to configure pricing outputs. It supports the following keys:\n\n* **calcDelta**: Set a boolean value to specify whether to calculate delta.\n\n* **calcGamma**: Set a boolean value to specify whether to calculate gamma.\n\n* **calcVega**: Set a boolean value to specify whether to calculate vega.\n\n* **calcTheta**: Set a boolean value to specify whether to calculate theta.\n\n* **calcRho**: Set a boolean value to specify whether to calculate rho.\n\n**model** (optional): A STRING scalar specifying the pricing model to use. Valid values:\n\n* **\"Black76\"**: Black 76 formula\n\n* **\"BAW\"** (default): Barone-Adesi-Whaley formula\n\n* **\"AmericanBinomialTree\"**: American-style binomial tree pricing model\n\n**method** (optional): A STRING scalar specifying the calculation method. Valid values:\n\n* **\"Analytic\"** (default): Analytic method\n\n* **\"Tree\"**: Tree method, supports the model *AmericanBinomialTree*\n\n#### Returns\n\n* If *setting* is not specified, returns a DOUBLE scalar indicating the net present value (NPV) of the option.\n\n* If *setting* is specified, returns a dictionary containing the NPV and the Greeks as specified in *setting* .\n\n#### Examples\n\n```\n// ================================================================\n// AUTO-GENERATED DolphinDB Script\n// Function   : cmFutAmericanOptionPricer  Commodity futures American option pricing example\n// Underlying : Shanghai Futures Exchange copper futures options (cu)\n// PricingDate: 2026-02-13\n//\n// Data sources:\n//   Futures settlement price : akshare get_futures_daily(market='SHFE')\n//   Options settlement price : akshare option_hist_shfe('copper options', '20260213')\n//   Interest rate curve      : ChinaMoney FX implied rate curve (CNY, USD.CNY/Shibor/swap points)\n//                              https://www.chinamoney.com.cn/chinese/bkcurvuiruuh/\n//                              API: POST /ags/ms/cm-u-bk-fx/IuirCurvHis  2026-02-13\n//\n// Pricing instrument : CU2605 copper futures American call option\n//                      strike=102000  opt_expiry=2026-04-24\n//                      fut_price=101230\n// ================================================================\n\npricingDate   = 2026.02.13\nreferenceDate = pricingDate\n\n// ------------------------------------------------------------------\n// 1. Discount curve (CNY_FR_007) ── ChinaMoney FX implied rate curve\n//    Data source: https://www.chinamoney.com.cn/chinese/bkcurvuiruuh/\n//    USD.CNY / Shibor / spot quote average / swap points  →  rmbRateStr field\n// ------------------------------------------------------------------\ndiscountCurveDict = {\n    \"mktDataType\"       : \"Curve\",\n    \"curveType\"         : \"IrYieldCurve\",\n    \"referenceDate\"     : referenceDate,\n    \"currency\"          : \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\"       : \"Continuous\",\n    \"interpMethod\"      : \"Linear\",\n    \"extrapMethod\"      : \"Flat\",\n    \"frequency\"         : \"Annual\",\n    \"dates\"             : [referenceDate + 1, referenceDate + 7, referenceDate + 14, referenceDate + 21, referenceDate + 30, referenceDate + 61, referenceDate + 91, referenceDate + 182, referenceDate + 273, referenceDate + 365, referenceDate + 547, referenceDate + 730, referenceDate + 1095],\n    \"values\"            : [0.016134, 0.016107, 0.016102, 0.016102, 0.016102, 0.016103, 0.016029, 0.015832, 0.015889, 0.015898, 0.015561, 0.015583, 0.015892],\n    \"name\"              : \"CNY_FR_007\"\n}\ndiscountCurve = parseMktData(discountCurveDict)\n\n// ------------------------------------------------------------------\n// 2. Futures price curve (AssetPriceCurve)\n//    Settlement prices of copper futures across maturities\n// ------------------------------------------------------------------\nfutPriceCurveDict = {\n    \"mktDataType\" : \"Curve\",\n    \"curveType\"   : \"AssetPriceCurve\",\n    \"referenceDate\": referenceDate,\n    \"currency\"    : \"CNY\",\n    \"asset\"       : \"CU\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\"       : [2026.04.15, 2026.05.15, 2026.06.15, 2026.07.15, 2026.08.17, 2026.09.15],\n    \"values\"      : [100980.0, 101230.0, 101240.0, 101100.0, 101230.0, 101250.0]\n}\nfutPriceCurve = parseMktData(futPriceCurveDict)\n\n// ------------------------------------------------------------------\n// 3. Option market data ── build volatility surface\n//    Number of expiries: 6\n//    Use OTM options: K < F → Put, K >= F → Call\n// ------------------------------------------------------------------\noptionExpiries = [2026.03.25, 2026.04.24, 2026.05.25, 2026.06.24, 2026.07.27, 2026.08.25]\nfutMaturities  = [2026.04.15, 2026.05.15, 2026.06.15, 2026.07.15, 2026.08.17, 2026.09.15]\n\n// ------------------------------------------------------------------\n// 4. Build volatility surface ── BAW formula + SVI model\n//    Use BAW formula to compute implied volatility of American options\n// ------------------------------------------------------------------\nvolSurf = cmFutVolatilitySurfaceBuilder(\n    referenceDate, futMaturities, optionExpiries,\n    strikes, optionPrices, payoffTypes,\n    discountCurve, futPriceCurve,\n    formula=\"BAW\", model=\"SVI\",\n    surfaceName=\"cu_vol_surface_20260213\"\n)\nprint(volSurf)\n\n// ------------------------------------------------------------------\n// 5. Define pricing instrument ── copper futures American call option\n//    Underlying: CU2605  Strike: 102000  Expiry: 2026-04-24\n// ------------------------------------------------------------------\ncmFutAmericanOption = {\n    \"productType\"       : \"Option\",\n    \"optionType\"        : \"AmericanOption\",\n    \"assetType\"         : \"CmFutAmericanOption\",\n    \"instrumentId\"      : \"CU2605C102000\",\n    \"notionalAmount\"    : 5.0,\n    \"notionalCurrency\"  : \"CNY\",\n    \"strike\"            : 102000.0,\n    \"maturity\"          : 2026.04.24,\n    \"payoffType\"        : \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\"        : \"CU2605\",\n    \"domesticCurve\"     : \"CNY_FR_007\"\n}\ninstrument = parseInstrument(cmFutAmericanOption)\n\n// ------------------------------------------------------------------\n// 6. Pricing ── single instrument NPV (BAW model)\n// ------------------------------------------------------------------\nspot = 101230.0\nnpv = cmFutAmericanOptionPricer(instrument, pricingDate, spot, discountCurve, volSurf, model=\"BAW\")\nprint(\"NPV = \" + string(npv))\n\n// ------------------------------------------------------------------\n// 7. Pricing ── with Greeks\n// ------------------------------------------------------------------\nsetting = {\n    \"calcDelta\" : true,\n    \"calcGamma\" : true,\n    \"calcVega\"  : true,\n    \"calcTheta\" : true,\n    \"calcRho\"   : true\n}\nresult = cmFutAmericanOptionPricer(instrument, pricingDate, spot, discountCurve, volSurf, setting, model=\"BAW\")\nprint(result)\n\n// ------------------------------------------------------------------\n// 8. Batch pricing ── price multiple Call options with different strikes for CU2605 maturity\n// ------------------------------------------------------------------\nallStrikes = [82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000, 100000, 102000, 104000, 106000, 108000, 110000, 112000, 114000, 116000, 118000, 120000]\nresults = array(DOUBLE, 0)\nfor (k in allStrikes) {\n    iDict = {\n        \"productType\"       : \"Option\",\n        \"optionType\"        : \"AmericanOption\",\n        \"assetType\"         : \"CmFutAmericanOption\",\n        \"instrumentId\"      : \"CU2605C\" + string(int(k)),\n        \"notionalAmount\"    : 5.0,\n        \"notionalCurrency\"  : \"CNY\",\n        \"strike\"            : k,\n        \"maturity\"          : 2026.04.24,\n        \"payoffType\"        : \"Call\",\n        \"dayCountConvention\": \"Actual365\",\n        \"underlying\"        : \"CU2605\",\n        \"domesticCurve\"     : \"CNY_FR_007\"\n    }\n    iOpt = parseInstrument(iDict)\n    results.append!(cmFutAmericanOptionPricer(iOpt, pricingDate, spot, discountCurve, volSurf, model=\"BAW\"))\n}\nt = table(allStrikes as strike, results as npv)\nprint(t)\n```\n\n#### Field requirements\n\n| Field Name         | Type   | Description                                                                                                                                                                 | Required |\n| ------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| productType        | STRING | Fixed value: \"Option\"                                                                                                                                                       | Yes      |\n| optionType         | STRING | Fixed value: \"AmericanOption\"                                                                                                                                               | Yes      |\n| assetType          | STRING | Fixed value: \"CmFutAmericanOption\"                                                                                                                                          | Yes      |\n| notionalAmount     | DOUBLE | Notional principal amount                                                                                                                                                   | Yes      |\n| notionalCurrency   | STRING | Notional currency                                                                                                                                                           | Yes      |\n| instrumentId       | STRING | Contract code, standard format: Underlying futures contract code + Contract expiry month + Option type code + Strike price, e.g., Sugar option SR2509P6300 = SR+2509+P+6300 | No       |\n| direction          | STRING | Trading direction. Valid values: “Buy” (default), “Sell”.                                                                                                                   | No       |\n| maturity           | DATE   | Maturity date                                                                                                                                                               | Yes      |\n| strike             | DOUBLE | Strike price                                                                                                                                                                | Yes      |\n| payoffType         | STRING | Payoff type. Valid values: “Call”, “Put”                                                                                                                                    | Yes      |\n| underlying         | STRING | Underlying futures contract code, e.g., SR2509                                                                                                                              | Yes      |\n| dayCountConvention | STRING | Day count convention. Valid values: \"ActualActualISDA\", \"ActualActualISMA\", \"Actual365\", \"Actual360\"                                                                        | Yes      |\n| discountCurve      | STRING | Discount curve name for pricing reference. The default valud for RMB deposits is \"CNY\\_FR\\_007\".                                                                            | No       |\n\n**Related Functions:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html), [cmFutVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/c/cmFutVolatilitySurfaceBuilder.html)\n"
    },
    "cmFutEuropeanOptionPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cmfuteuropeanoptionpricer.html",
        "signatures": [
            {
                "full": "cmFutEuropeanOptionPricer(instrument, pricingDate, futPrice, discountCurve, futPriceCurve, volSurf, [setting], [model], [method])",
                "name": "cmFutEuropeanOptionPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "futPrice",
                        "name": "futPrice"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "futPriceCurve",
                        "name": "futPriceCurve"
                    },
                    {
                        "full": "volSurf",
                        "name": "volSurf"
                    },
                    {
                        "full": "[setting]",
                        "name": "setting",
                        "optional": true
                    },
                    {
                        "full": "[model]",
                        "name": "model",
                        "optional": true
                    },
                    {
                        "full": "[method]",
                        "name": "method",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [cmFutEuropeanOptionPricer](https://docs.dolphindb.com/en/Functions/c/cmfuteuropeanoptionpricer.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\ncmFutEuropeanOptionPricer(instrument, pricingDate, futPrice, discountCurve, futPriceCurve, volSurf, \\[setting], \\[model], \\[method])\n\n#### Details\n\nPrices European commodity futures options.\n\n#### Parameters\n\n**instrument**: An INSTRUMENT scalar or vector specifying the European commodity futures options to be priced.\n\n**pricingDate**: A DATE scalar or vector specifying the pricing date.\n\n**futPrice**: A DOUBLE scalar or vector specifying the futures price of the underlying contract at the pricing date.\n\n**discountCurve**: A MKTDATA scalar or vector specifying the [discount curve (IrYieldCurve)](https://docs.dolphindb.com/en/Functions/p/parseMktData.md#).\n\n**futPriceCurve**: A MKTDATA scalar or vector specifying the [futures price curve (AssetPriceCurve)](https://docs.dolphindb.com/en/Functions/p/parseMktData.md#).\n\n**volSurf**: A MKTDATA scalar or vector specifying the volatility surface (VolatilitySurface). The surface is built using `cmFutVolatilitySurfaceBuilder`.\n\n**setting** (optional)\\*:\\*A dictionary (\\<STRING, BOOL>) specifying whether to calculate option price sensitivities (Greeks). Supported keys:\n\n| Key       | Value                      | Description                                                                                    |\n| --------- | -------------------------- | ---------------------------------------------------------------------------------------------- |\n| calcDelta | Boolean; defaults to false | Whether to calculate Delta, the sensitivity of the option price to the underlying asset price. |\n| calcGamma | Boolean; defaults to false | Whether to calculate Gamma, the sensitivity of Delta to the underlying asset price.            |\n| calcVega  | Boolean; defaults to false | Whether to calculate Vega, the sensitivity of the option price to volatility.                  |\n| calcTheta | Boolean; defaults to false | Whether to calculate Theta, the sensitivity of the option price to the passage of time.        |\n| calcRho   | Boolean; defaults to false | Whether to calculate Rho, the sensitivity of the option price to the risk-free interest rate.  |\n\n**model** (optional): A STRING scalar. The default and only supported value is \"Black76\", indicating that the Black-76 model is used.\n\n**method** (optional): A STRING scalar. The default and only supported value is \"Analytic\", indicating that an analytical method is used.\n\n#### Returns\n\n* If the *settings* parameter is not specified, returns a DOUBLE scalar indicating the option’s net present value (NPV), i.e., the theoretical option price.\n* If the *settings* parameter is specified, returns a dictionary (\\<STRING, DOUBLE>) containing the option’s NPV and the option price sensitivities represented by the Greeks. For details on Greeks, see the description of the *settings* parameter.\n\n#### Examples\n\n```\npricingDate = 2019.07.08\nspot = 2800.0\nstrike = spot * 1.2\nnominal = 1.0\n\n// Discount curve (CNY FR007) — zero rates\ndiscountCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": [pricingDate+2, pricingDate+8, pricingDate+93, pricingDate+185, pricingDate+276, pricingDate+367,\n              pricingDate+732, pricingDate+1099, pricingDate+1463, pricingDate+1828, pricingDate+2558, pricingDate+3654],\n    \"values\": [0.0145993931630537, 0.0229075517972275, 0.0253020667393029, 0.0257564866303201,\n               0.0259751440992468, 0.0260355181479988, 0.0265336263144786, 0.0272721454114050,\n               0.0282024453631075, 0.0290231222075799, 0.0304665029488732, 0.0319855013976250]\n}\ndiscountCurve = parseMktData(discountCurveInfo)\n\n// Futures price curve (Soymeal)\nfutPriceCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"AssetPriceCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"asset\": \"SOY_MEAL\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": [2019.09.16, 2019.11.14, 2019.12.13, 2020.01.15, 2020.03.13],\n    \"values\": [2784, 2821, 2772, 2847, 2775]\n}\nfutPriceCurve = parseMktData(futPriceCurveInfo)\n\n// Option expiries, futures maturities, strikes, market prices, payoff types\noptionExpiries = [2019.08.07, 2019.10.11, 2019.11.07, 2019.12.06, 2020.02.07]\nfutMaturities = [2019.09.16, 2019.11.14, 2019.12.13, 2020.01.15, 2020.03.13]\nstrikes = [\n    [2600,2650,2700,2750,2800,2850,2900,2950,3000,3050],\n    [2600,2650,2700,2750,2800,2850,2900,2950,3000,3050],\n    [2650,2700,2750,2800,2850,2900,2950,3000],\n    [2650,2700,2750,2800,2850,2900,2950,3000],\n    [2600,2650,2700,2750,2800,2850,2900]\n]\noptionPrices = [\n    [9,17,30,48.5,57,37.5,23,13.5,7.5,4],\n    [29,41.5,56.5,75.5,98,95.5,75,58.5,44.5,33.5],\n    [50,68.5,90.5,89,69,52.5,39,29],\n    [56,72,91,113,134.5,112.5,93,76.5],\n    [58.5,75.5,95,118,119.5,98.5,80.5]\n]\npayoffTypes = [\n    [\"Put\",\"Put\",\"Put\",\"Put\",\"Call\",\"Call\",\"Call\",\"Call\",\"Call\",\"Call\"],\n    [\"Put\",\"Put\",\"Put\",\"Put\",\"Put\",\"Call\",\"Call\",\"Call\",\"Call\",\"Call\"],\n    [\"Put\",\"Put\",\"Put\",\"Call\",\"Call\",\"Call\",\"Call\",\"Call\"],\n    [\"Put\",\"Put\",\"Put\",\"Put\",\"Call\",\"Call\",\"Call\",\"Call\"],\n    [\"Put\",\"Put\",\"Put\",\"Put\",\"Call\",\"Call\",\"Call\"]\n]\n\n// Build vol surface from quotes\nvolSurf = cmFutVolatilitySurfaceBuilder(pricingDate, futMaturities, optionExpiries, strikes, optionPrices, payoffTypes, discountCurve, futPriceCurve)\nprint(volSurf)\n// Instrument\ncmFutEuropeanOption = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"CmFutEuropeanOption\",\n    \"instrumentId\": \"SOYMEAL_CALL\",\n    \"notionalAmount\": nominal,\n    \"notionalCurrency\": \"CNY\",\n    \"strike\": strike,\n    \"maturity\": pricingDate + 180,\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"SOY_MEAL\",\n    \"domesticCurve\": \"CNY_FR_007\"\n}\ninstrument = parseInstrument(cmFutEuropeanOption)\n\n// Price\nresult = cmFutEuropeanOptionPricer(instrument, pricingDate, spot, discountCurve, volSurf)\n```\n\n**Related Functions:** [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html), [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [cmFutVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/c/cmFutVolatilitySurfaceBuilder.html)\n"
    },
    "cmFutVolatilitySurfaceBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cmFutVolatilitySurfaceBuilder.html",
        "signatures": [
            {
                "full": "cmFutVolatilitySurfaceBuilder(referenceDate, futMaturities, optionExpiries, strikes, optionPrices, payoffTypes, discountCurve, futPriceCurve, [formula=\"Black76\"], [model=\"SVI\"], [surfaceName])",
                "name": "cmFutVolatilitySurfaceBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "futMaturities",
                        "name": "futMaturities"
                    },
                    {
                        "full": "optionExpiries",
                        "name": "optionExpiries"
                    },
                    {
                        "full": "strikes",
                        "name": "strikes"
                    },
                    {
                        "full": "optionPrices",
                        "name": "optionPrices"
                    },
                    {
                        "full": "payoffTypes",
                        "name": "payoffTypes"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "futPriceCurve",
                        "name": "futPriceCurve"
                    },
                    {
                        "full": "[formula=\"Black76\"]",
                        "name": "formula",
                        "optional": true,
                        "default": "\"Black76\""
                    },
                    {
                        "full": "[model=\"SVI\"]",
                        "name": "model",
                        "optional": true,
                        "default": "\"SVI\""
                    },
                    {
                        "full": "[surfaceName]",
                        "name": "surfaceName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [cmFutVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/c/cmFutVolatilitySurfaceBuilder.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\ncmFutVolatilitySurfaceBuilder(referenceDate, futMaturities, optionExpiries, strikes, optionPrices, payoffTypes, discountCurve, futPriceCurve, \\[formula=\"Black76\"], \\[model=\"SVI\"], \\[surfaceName])\n\n#### Details\n\nBuilds a volatility surface for the commodity futures and options.\n\n#### Parameters\n\n**Notes**: All vector inputs must be of equal length.\n\n**referenceDate**A DATE scalar representing the reference date, i.e., the date when the curve is generated.\n\n**futMaturities** A DATE vector representing the maturity dates of the future contracts.\n\n**optionExpiries** A DATE vector representing the expiration dates of the option contracts.\n\n**strikes** A tuple indicating the strike prices, with each element a DOUBLE vector.\n\n**optionPrices** A tuple indicating the option prices, with each element a DOUBLE vector.\n\n**payoffTypes** A tuple indicating the pay/off types, with each element a STRING vector. It can be “Call” or “Put”.\n\n**Notes**: The elements at corresponding positions in vectors *strikes*, *optionPrices* and *payoffTypes* must be of equal length.\n\n**discountCurve** An IrYieldCurve object representing the discount curve.\n\n**futPriceCurve** An AssetPriceCurve object representing the future price curve.\n\n**formula** (optional) A STRING scalar representing the implied volatility formula, which can be:\n\n* “Black76” (default): Black76 model, generally used for European options.\n* “BAW”: Barone-Adesi Whaley formula, generally used for American options.\n\n**model** (optional) A STRING scalar specifying the model used to construct the surface. Options:\n\n* “SVI” (default): Stochastic Volatility Inspired model\n\n* “SABR”: Stochastic Alpha Beta Rho model\n\n* “Linear”: Linear interpolation model\n\n* “CubicSpline”: Cubic spline interpolation model\n\n**surfaceName** (optional) A STRING scalar representing the surface name.\n\n#### Returns\n\nA VolatilitySurface object of MKTDATA type.\n\n#### Examples\n\nBuild the volatility surface for copper futures options:\n\n```\n// cu (copper futures options)\n\nreferenceDate = 2025.12.02\n\noptionExpiries = [2025.12.25, 2026.01.26, 2026.02.13, 2026.03.25, 2026.04.24, 2026.05.25, 2026.06.24, 2026.07.27]\n                \n\nfutMaturities  = [2026.01.15, 2026.02.24, 2026.03.16, 2026.04.15, 2026.05.15, 2026.06.15, 2026.07.15, 2026.08.17]\n\n// strikes: list of strike vectors (each vector corresponds to a set of strikes for each option expiration date)\nstrikes = [\n    [64000, 65000, 66000, 67000, 68000, 69000, 70000, 71000, 72000, 73000, 74000, 75000, 76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000, 100000],  //1\n    [64000, 65000, 66000, 67000, 68000, 69000, 70000, 71000, 72000, 73000, 74000, 75000, 76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000, 100000], //2\n    [64000, 65000, 66000, 67000, 68000, 69000, 70000, 71000, 72000, 73000, 74000, 75000, 76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000, 100000], //3\n    [68000, 69000, 70000, 71000, 72000, 73000, 74000, 75000, 76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000, 100000], //4\n    [70000, 71000, 72000, 73000, 74000, 75000, 76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000, 100000], //5\n    [76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000], //6\n    [76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000], //7\n    [76000, 77000, 78000, 79000, 80000, 82000, 84000, 86000, 88000, 90000, 92000, 94000, 96000, 98000] //8\n]\n\n// optionPrices: A vector of option prices corresponding to each expiration date\n\noptionPrices = [\n    [25090, 24090, 23090, 22090, 21090, 20090, 19090, 18090, 17090, 16090, 15090, 14090, 13090, 12092, 11100, 10114, 9138 , 7240 , 5468 , 3898 , 2600 , 1608 , 914  , 482  , 232  , 102  , 40   ], // 1\n    [25080, 24080, 23080, 22080, 21080, 20080, 19080, 18080, 17080, 16080, 15084, 14092, 13106, 12132, 11168, 10218, 9290 , 7520 , 5896 , 4462 , 3246 , 2266 , 1516 , 972  , 596  , 350  , 196  ], // 2\n    [25030, 24030, 23030, 22030, 21030, 20030, 19030, 18030, 17034, 16044, 15058, 14082, 13116, 12164, 11230, 10316, 9426 , 7736 , 6196 , 4832 , 3660 , 2696 , 1930 , 1338 , 894  , 586  , 370   ], // 3\n    [20970, 19970, 18970, 17972, 16980, 15996, 15018, 14052, 13100, 12162, 11244, 10348, 9478 , 7830 , 6336 , 5010 , 3864 , 2906 , 2136 , 1522 , 1066 , 722  , 480   ], // 4\n    [18952, 17958, 16974, 15996, 15030, 14076, 13136, 12214, 11314, 10438, 9590 , 7986 , 6522 , 5228 , 4102 , 3150 , 2370 , 1742 , 1254 , 886  , 608   ], // 5\n    [12830, 11924, 11040, 10182, 9350 , 7786 , 6372 , 5110 , 4030 , 3104 , 2354 , 1740 , 1270 , 904  ], // 6\n    [13176, 12314, 11476, 10670, 9888 , 8416 , 7068 , 5874 , 4814 , 3890 , 3102 , 2450 , 1908 , 1468  ], // 7\n    [12848, 11988, 11148, 10346, 9568 , 8102 , 6772 , 5590 , 4546 , 3644 , 2890 , 2260 , 1740 , 1320  ] // 8\n]\n\n// payoffTypes: Represented by strings \"Put\" or \"Call\"\npayoffTypes = [\n    take(\"Call\", size(optionPrices[0])),\n    take(\"Call\", size(optionPrices[1])),\n    take(\"Call\", size(optionPrices[2])),\n    take(\"Call\", size(optionPrices[3])),\n    take(\"Call\", size(optionPrices[4])),\n    take(\"Call\", size(optionPrices[5])),\n    take(\"Call\", size(optionPrices[6])),\n    take(\"Call\", size(optionPrices[7]))\n]\n\npillar_dates = [\n    referenceDate + 2,\n    referenceDate + 8,\n    referenceDate + 93,\n    referenceDate + 185,\n    referenceDate + 276,\n    referenceDate + 367,\n    referenceDate + 732,\n    referenceDate + 1099,\n    referenceDate + 1463,\n    referenceDate + 1828,\n    referenceDate + 2558,\n    referenceDate + 3654\n]\n\npillar_values = [\n    0.0145993931630537,\n    0.0229075517972275,\n    0.0253020667393029,\n    0.0257564866303201,\n    0.0259751440992468,\n    0.0260355181479988,\n    0.0265336263144786,\n    0.0272721454114050,\n    0.0282024453631075,\n    0.0290231222075799,\n    0.0304665029488732,\n    0.0319855013976250\n]\n\ncurve_dict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"\", \n    \"dates\": pillar_dates,\n    \"values\": pillar_values,\n    \"name\": \"CNY_FR_007\"\n}\n\ndiscountCurve = parseMktData(curve_dict)\n\nprint(discountCurve)\n\ncurve_dict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"AssetPriceCurve\",\n    \"referenceDate\": referenceDate,\n    \"dates\":[2025.12.15, 2026.01.15, 2026.02.24, 2026.03.16, 2026.04.15, 2026.05.15, 2026.06.15, 2026.07.15, 2026.08.17, 2026.09.15, 2026.10.15, 2026.11.16],\n    \"values\":[88770, 89090, 89080, 89030, 88970, 88950, 88590, 88660, 88350, 88120, 87910, 87840]\n}\nfutPriceCurve = parseMktData(curve_dict)\nprint(futPriceCurve)\n\nsurf = cmFutVolatilitySurfaceBuilder(referenceDate, futMaturities, optionExpiries, strikes, optionPrices, payoffTypes, discountCurve, futPriceCurve, formula='Black76', model='SVI', surfaceName='cu_future_option_vol_surface');\n\ndts = (0..20)*0.05\nks = (0..40)*((max(strikes[0])-min(strikes[0]))\\40)+min(strikes[0])\nm = optionVolPredict(surf, dts, ks).rename!(dts, ks)\n\nplot(\n    m,\n    title=[\"Vol Surface\", \"K\", \"T\", \"vol\"],\n    chartType=SURFACE)\n    \n```\n\n**Related Functions**: [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "coevent": {
        "url": "https://docs.dolphindb.com/en/Functions/c/coevent.html",
        "signatures": [
            {
                "full": "coevent(event, eventTime, window, [orderSensitive=false])",
                "name": "coevent",
                "parameters": [
                    {
                        "full": "event",
                        "name": "event"
                    },
                    {
                        "full": "eventTime",
                        "name": "eventTime"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[orderSensitive=false]",
                        "name": "orderSensitive",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [coevent](https://docs.dolphindb.com/en/Functions/c/coevent.html)\n\n\n\n#### Syntax\n\ncoevent(event, eventTime, window, \\[orderSensitive=false])\n\n#### Details\n\nCount the number of occurrences of two events within the specified intervals.\n\n#### Parameters\n\n**event** is a vector indicating events.\n\n**eventTime** is a temporal or integer vector of the same length as event indicating the timestamps of events.\n\n**window** is a non-negative integer indicating the length of an interval.\n\n**orderSensitive** (optional) is a Boolean value indicating whether the order of the two events matters. The default value is false.\n\n#### Returns\n\nReturn a table with 3 columns: event1, event2 and hits. The values of event1 and event2 are based on the column event. Column hits is the number of occurrences of the event pair.\n\n#### Examples\n\n```\nsensor_id=`A`B`C`D`C`A`B\ntime=[2012.06.13T12:30:00,2012.06.13T12:30:02,2012.06.13T12:30:04,2012.06.13T12:30:05,2012.06.13T12:30:06,2012.06.13T12:30:09,2012.06.13T12:30:10];\n\ncoevent(sensor_id, time, 2);\n```\n\n| event1 | event2 | hits |\n| ------ | ------ | ---- |\n| B      | C      | 1    |\n| C      | D      | 2    |\n| C      | C      | 1    |\n| A      | B      | 2    |\n\n```\ncoevent(sensor_id, time, 2, true);\n```\n\n| event1 | event2 | hits |\n| ------ | ------ | ---- |\n| C      | C      | 1    |\n| B      | C      | 1    |\n| C      | D      | 1    |\n| D      | C      | 1    |\n| A      | B      | 2    |\n"
    },
    "coint": {
        "url": "https://docs.dolphindb.com/en/Functions/c/coint.html",
        "signatures": [
            {
                "full": "coint(Y0, Y1, [trend=\"c\"], [method=\"aeg\"], [maxLag], [autoLag=\"aic\"])",
                "name": "coint",
                "parameters": [
                    {
                        "full": "Y0",
                        "name": "Y0"
                    },
                    {
                        "full": "Y1",
                        "name": "Y1"
                    },
                    {
                        "full": "[trend=\"c\"]",
                        "name": "trend",
                        "optional": true,
                        "default": "\"c\""
                    },
                    {
                        "full": "[method=\"aeg\"]",
                        "name": "method",
                        "optional": true,
                        "default": "\"aeg\""
                    },
                    {
                        "full": "[maxLag]",
                        "name": "maxLag",
                        "optional": true
                    },
                    {
                        "full": "[autoLag=\"aic\"]",
                        "name": "autoLag",
                        "optional": true,
                        "default": "\"aic\""
                    }
                ]
            }
        ],
        "markdown": "### [coint](https://docs.dolphindb.com/en/Functions/c/coint.html)\n\n\n\n#### Syntax\n\ncoint(Y0, Y1, \\[trend=\"c\"], \\[method=\"aeg\"], \\[maxLag], \\[autoLag=\"aic\"])\n\n#### Details\n\nTest for no-cointegration of a univariate equation.\n\n#### Parameters\n\n**Y0**is a numeric vector indicating the first element in cointegrated system. Null values are not supported.\n\n**Y1**is a numeric vector or matrix indicating the remaining elements in cointegrated system. The number of elements in Y1 and Y0 must be equal. Null values are not supported.\n\n**trend**is a scalar specifying the trend term included in regression for cointegrating equation. It can be\n\n* \"c\" : constant.\n\n* \"ct\" : constant and linear trend.\n\n* \"ctt\" : constant, and linear and quadratic trend.\n\n* \"n\" : no constant, no trend.\n\n**method** is a string indicating the method for cointegration testing. Only \"aeg\" (augmented Engle-Granger) is available.\n\n**maxLag** is a non-negative integer indicating the largest number of lags, which is used as an argument for `adfuller`.\n\n**autoLag** is a string indicating the lag selection criterion, which is used as an argument for `adfuller`. It can be:\n\n* \"aic\": The number of lags is chosen to minimize the Akaike information criterion.\n\n* \"bic\": The number of lags is chosen to minimize the Bayesian information criterion.\n\n* \"tstat\": Start with *maxLag* and drops a lag until the t-statistic on the last lag length is significant using a 5%-sized test.\n\n* \"max\": The number of included lags is set to *maxLag*.\n\n#### Returns\n\nA dictionary containing the following keys\n\n* tStat: A floating-point scalar indicating the t-statistic of unit-root test on residuals.\n\n* pValue: A floating-point scalar indicating the MacKinnon's approximate p-value based on MacKinnon (1994, 2010).\n\n* criticalValues: A dictionary containing the critical values for the test statistic at the 1 %, 5 %, and 10 % levels based on regression curve.\n\n#### Examples\n\n```\nY0 = 234 267 289 301 312 323 334 345 356;\nY1 = 267 289 301 312 323 334 345 356 367;\ncoint(Y0, Y1);\n```\n\nA dictionary is returned:\n\n```\ntValue->-1.498236972489574\npValue->0.761867238199341\ncriticalValues->[-5.789286875000001,-4.206501875,-3.6171]\n```\n"
    },
    "col": {
        "url": "https://docs.dolphindb.com/en/Functions/c/col.html",
        "signatures": [
            {
                "full": "col(obj, index)",
                "name": "col",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "index",
                        "name": "index"
                    }
                ]
            },
            {
                "full": "column(obj, index)",
                "name": "column",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "index",
                        "name": "index"
                    }
                ]
            }
        ],
        "markdown": "### [col](https://docs.dolphindb.com/en/Functions/c/col.html)\n\n\n\n#### Syntax\n\ncol(obj, index)\n\nor\n\ncolumn(obj, index)\n\n#### Details\n\nReturn one or more columns of a vector/matrix/table. Please check related function: [row](https://docs.dolphindb.com/en/Functions/r/row.html).\n\n#### Parameters\n\n**obj** is a vector/matrix/table.\n\n**index** is an integral scalar or pair.\n\n#### Returns\n\nAn object with the same data type and form as *obj*.\n\n#### Examples\n\n```\nx=1..6$3:2;\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\ncol(x,0);\n// output: [1,2,3]\n\nx.col(1);\n// output: [4,5,6]\n\na=table(1..3 as x,`IBM`C`AAPL as y);\na;\n```\n\n| x | y    |\n| - | ---- |\n| 1 | IBM  |\n| 2 | C    |\n| 3 | AAPL |\n\n```\na col 1;\n// output: [\"IBM\",\"C\",\"AAPL\"]\n\ncol(a, 0:2)\n```\n\n| x | y    |\n| - | ---- |\n| 1 | IBM  |\n| 2 | C    |\n| 3 | AAPL |\n"
    },
    "cols": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cols.html",
        "signatures": [
            {
                "full": "cols(X)",
                "name": "cols",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cols](https://docs.dolphindb.com/en/Functions/c/cols.html)\n\n\n\n#### Syntax\n\ncols(X)\n\n#### Details\n\nReturn the total number of columns in *X*. Please check related function: [rows](https://docs.dolphindb.com/en/Functions/r/rows.html).\n\n#### Parameters\n\n**X** is of any data type in any data forms.\n\n#### Returns\n\nA scalar of type INT.\n\n#### Examples\n\n```\nx=1..6$2:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\ncols x;\n// output: 3\n\na=table(1..3 as x,`IBM`C`AAPL as y);\na;\n```\n\n| x | y    |\n| - | ---- |\n| 1 | IBM  |\n| 2 | C    |\n| 3 | AAPL |\n\n```\ncols a;\n// output: 2\n\ny=1 2 3;\ncols(y);\n// output: 1  // a vector can be viewed as an n*1 matrix\n```\n"
    },
    "columnNames": {
        "url": "https://docs.dolphindb.com/en/Functions/c/columnNames.html",
        "signatures": [
            {
                "full": "columnNames(X)",
                "name": "columnNames",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [columnNames](https://docs.dolphindb.com/en/Functions/c/columnNames.html)\n\n\n\n#### Syntax\n\ncolumnNames(X)\n\n#### Details\n\nReturn the column names of *X* as a vector. Please check related function: [rowNames](https://docs.dolphindb.com/en/Functions/r/rowNames.html).\n\n#### Parameters\n\n**X** is a matrix/table.\n\n#### Returns\n\nA vector of type STRING.\n\n#### Examples\n\n```\nx=1..6$2:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nx.rename!(`a`b`c);\n```\n\n| a | b | c |\n| - | - | - |\n| 1 | 3 | 5 |\n| 2 | 4 | 6 |\n\n```\nx.columnNames();\n// output: [\"a\",\"b\",\"c\"]\n\nt = table(1 2 3 as id, 4 5 6 as value, `IBM`MSFT`GOOG as name);\nt;\n```\n\n| id | value | name |\n| -- | ----- | ---- |\n| 1  | 4     | IBM  |\n| 2  | 5     | MSFT |\n| 3  | 6     | GOOG |\n\n```\ncolumnNames t;\n// output: [\"id\",\"value\",\"name\"]\n\nt[t.columnNames().tail()];\n// output: [\"IBM\",\"MSFT\",\"GOOG\"] // retrieve the last column of a table as a vector\n```\n"
    },
    "complex": {
        "url": "https://docs.dolphindb.com/en/Functions/c/complex.html",
        "signatures": [
            {
                "full": "complex(X, Y)",
                "name": "complex",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [complex](https://docs.dolphindb.com/en/Functions/c/complex.html)\n\n\n\n#### Syntax\n\ncomplex(X, Y)\n\n#### Details\n\nCreate a complex number `X+Y*i`.\n\nThe length of a complex number is 16 bytes. The low 8 bytes are stored in *X*, and the high 8 bytes are stored in *Y*.\n\n#### Parameters\n\n**X** and **Y** are numeric scalars, pairs, vectors or matrices. They can be of Integral (excluding compress and INT128) or Floating type.\n\n#### Returns\n\nA scalar or vector of type COMPLEX.\n\n#### Examples\n\n```\ncomplex(2, 5)\n// output: 2.0+5.0i\n\na=1.0 2.3\nb=3 4\ncomplex(a,b)\n```\n\n| 0        | 1        |\n| -------- | -------- |\n| 1.0+3.0i | 2.3+4.0i |\n\nRelated functions: [highDouble](https://docs.dolphindb.com/en/Functions/h/highDouble.html), [lowDouble](https://docs.dolphindb.com/en/Functions/l/lowDouble.html)\n"
    },
    "compose": {
        "url": "https://docs.dolphindb.com/en/Functions/c/compose.html",
        "signatures": [
            {
                "full": "compose(first, second)",
                "name": "compose",
                "parameters": [
                    {
                        "full": "first",
                        "name": "first"
                    },
                    {
                        "full": "second",
                        "name": "second"
                    }
                ]
            }
        ],
        "markdown": "### [compose](https://docs.dolphindb.com/en/Functions/c/compose.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ncompose(first, second)\n\n#### Details\n\nThe `compose` function creates a composite function from two functions, equivalent to `second(first())`. The logic works as follows:\n\n1. Call the *first*function with all the provided arguments.\n\n2. Take the result from *first*and pass it as the only argument to the *second*function.\n\n3. Return the result of `second(first(...))`.\n\nFor example, for the composite function `f = compose(add, sin)`, `f(x, y)` will return the same result as `sin(add(x, y))`.\n\n**Use cases:** The `compose` function is used to combine multiple functions into a new function that executes them in sequence. It is suitable for data processing pipelines, function reuse, logic encapsulation, and functional programming scenarios, improving code readability and maintainability while simplifying complex logic.\n\n#### Parameters\n\n**first**indicates the first function to be called, which accepts one or more arguments.\n\n**second**indicates the second function to be called, which accepts only one argument (the return value of *first*).\n\n#### Returns\n\nA new function (of type FUNCTIONDEF) is returned, with the same parameters as the *first*function.\n\n#### Examples\n\n```\ng = def(x, y, z) { return x * y + z }\nf = def(x) { return abs(x * 3) }\ncompo_func = compose(g, f) // Equivalent to f(g(*))\n\ncompo_func(-1, 5, 3) // Output: 6\n```\n"
    },
    "compress": {
        "url": "https://docs.dolphindb.com/en/Functions/c/compress.html",
        "signatures": [
            {
                "full": "compress(X, [method='lz4'])",
                "name": "compress",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[method='lz4']",
                        "name": "method",
                        "optional": true,
                        "default": "'lz4'"
                    }
                ]
            }
        ],
        "markdown": "### [compress](https://docs.dolphindb.com/en/Functions/c/compress.html)\n\n\n\n#### Syntax\n\ncompress(X, \\[method='lz4'])\n\n#### Details\n\nCompress a vector or a table with the specified compression algorithm. The compressed variable needs to be decompressed with function [decompress](https://docs.dolphindb.com/en/Functions/d/decompress.html) before it can be used in a calculation.\n\n#### Parameters\n\n**X** is a vector or a table.\n\n**method** (optional) is a string indicating the compression algorithm. The available options are:\n\n* \"lz4\" (by default) is suitable for almost all data types. Although the \"lz4\" method may not achieve the highest compression ratio, it provides fast compression and decompression speeds.\n\n* \"delta\" option applies delta-of-delta algorithm, which is particularly suitable for data types like SHORT, INT, LONG, and date/time data.\n\n* \"zstd\" is also suitable for almost all data types. It provides a higher compression ratio compared to \"lz4\", but the compression and decompression speed is about half as fast as \"lz4\".\n\n* \"chimp\" is suitable for DOUBLE type data with decimal parts not exceeding three digits in length.\n\n#### Returns\n\nA compressed vector or table.\n\n#### Examples\n\n```\nx=1..100000000\ny=compress(x, \"delta\");\n\ny.typestr();\n// output: HUGE COMPRESSED VECTOR\n\nz=compress(x, \"zstd\");\nz.typestr();\n// output: HUGE COMPRESSED VECTOR\n\nselect name, bytes from objs() where name in `x`y;\n```\n\n| name | bytes     |\n| ---- | --------- |\n| x    | 402653952 |\n| y    | 13634544  |\n\nPlease note that if function `size` is applied on the compressed vector y, the result is the length of the compressed vector y instead of the original vector x. To extract information about x from y, we need to decompress y first.\n\n```\ny.size();\n// output: 12670932\n\nz=decompress(y);\nz.size();\n// output: 100000000\n```\n\nRelated functions: [decompress](https://docs.dolphindb.com/en/Functions/d/decompress.html)\n"
    },
    "concat": {
        "url": "https://docs.dolphindb.com/en/Functions/c/concat.html",
        "signatures": [
            {
                "full": "concat(X, Y)",
                "name": "concat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [concat](https://docs.dolphindb.com/en/Functions/c/concat.html)\n\n\n\n#### Syntax\n\nconcat(X, Y)\n\n#### Details\n\nIf *X* is a STRING/CHAR scalar\n\n* For an empty *X*,\n\n  * if *Y* is an empty STRING/CHAR scalar, the function returns an empty string.\n\n  * if *Y* is a non-empty STRING/CHAR scalar, the function returns *Y*.\n\n* Otherwise, the function forms a new string by combining *X* and *Y* regardless of whether *Y* is an empty string or not.\n\nIf *X* is a STRING/CHAR vector\n\n* For an empty *X*, the function returns an empty string.\n\n* Otherwise,\n\n  * if *Y* is an empty STRING/CHAR scalar, the function concatenates each element in *X* and returns a string object;\n\n  * if *Y* is a non-empty STRING/CHAR scalar, *Y* serves as the separator between the elements in vector *X* and the function returns a string object.\n\nNote: The function *concat* implicitly converts all arguments to STRING type (null values to empty strings) before concatenation.\n\n#### Parameters\n\n**X** can be a STRING/CHAR scalar or vector.\n\n**Y** can be a STRING/CHAR scalar.\n\nIf *X* or *Y* is not specified, it is treated as an empty string.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\n// join two strings\nconcat (`hello, `world);\n// output: helloworld\n\n// join IBM, GOOG and APPL with \",\" as the delimiter\nx = concat(`IBM`GOOG`APPL, \",\");\nx;\n// output: IBM,GOOG,APPL\n\ntypestr x;\n// output: STRING\n\nsize x;\n// output: 1\n\nconcat(string([]),\"a\")\n// output: NULL\n\nconcat(\"55\",\"\")\n// output: 55\n\n// When Y is not specified, the function joins the elements of X to form a new string\nconcat(`a`b`c`d,)\n// output: abcd\n```\n"
    },
    "concatDateTime": {
        "url": "https://docs.dolphindb.com/en/Functions/c/concatDateTime.html",
        "signatures": [
            {
                "full": "concatDateTime(date, time)",
                "name": "concatDateTime",
                "parameters": [
                    {
                        "full": "date",
                        "name": "date"
                    },
                    {
                        "full": "time",
                        "name": "time"
                    }
                ]
            }
        ],
        "markdown": "### [concatDateTime](https://docs.dolphindb.com/en/Functions/c/concatDateTime.html)\n\n\n\n#### Syntax\n\nconcatDateTime(date, time)\n\nAlias: concatDT\n\n#### Details\n\nCombine *date* and *time* into one new variable.\n\nIf *time* is SECOND, return DATETIME.\n\nIf *time* is TIME, return TIMESTAMP.\n\nIf *time* is NANOTIME, return NANOTIMESTAMP.\n\n#### Parameters\n\n**date** is a scalar/vector of data type DATE.\n\n**time** is a scalar/vector of data type SECOND, TIME or NANOTIME.\n\nIf *date* and *time* are both vector,s they must have the same length.\n\n#### Returns\n\nA scalar or vector.\n\n#### Examples\n\n```\nconcatDateTime(2019.06.15,13:25:10);\n// output: 2019.06.15T13:25:10\n\nconcatDateTime(2019.06.15,[13:25:10, 13:25:12, 13:25:13]);\n// output: [2019.06.15T13:25:10,2019.06.15T13:25:12,2019.06.15T13:25:13]\n\ndate=[2019.06.18, 2019.06.20, 2019.06.21, 2019.06.19, 2019.06.18, 2019.06.20]\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26]\nsym = `C`MS`MS`MS`IBM`IBM$SYMBOL\nprice= 49.6 29.46 29.52 30.02 174.97 175.23\nqty = 2200 1900 2100 3200 6800 5400\nt = table(date, time, sym, qty, price);\n\nselect concatDateTime(date,time) as datetime, sym, qty, price from t;\n```\n\n| datetime            | sym | qty  | price  |\n| ------------------- | --- | ---- | ------ |\n| 2019.06.18T09:34:07 | C   | 2200 | 49.6   |\n| 2019.06.20T09:36:42 | MS  | 1900 | 29.46  |\n| 2019.06.21T09:36:51 | MS  | 2100 | 29.52  |\n| 2019.06.19T09:36:59 | MS  | 3200 | 30.02  |\n| 2019.06.18T09:32:47 | IBM | 6800 | 174.97 |\n| 2019.06.20T09:35:26 | IBM | 5400 | 175.23 |\n"
    },
    "concatMatrix": {
        "url": "https://docs.dolphindb.com/en/Functions/c/concatMatrix.html",
        "signatures": [
            {
                "full": "concatMatrix(X, [horizontal=true])",
                "name": "concatMatrix",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[horizontal=true]",
                        "name": "horizontal",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [concatMatrix](https://docs.dolphindb.com/en/Functions/c/concatMatrix.html)\n\n\n\n#### Syntax\n\nconcatMatrix(X, \\[horizontal=true])\n\n#### Details\n\nConcatenate the matrices vertically or horizontally.\n\nWhen 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.\n\n#### Parameters\n\n**X** is a tuple of multiple matrices.\n\n**horizontal** (optional) is a Boolean value indicating whether the matrices are contatenated horizontally. The default value is true. If set to false, the matrices are contatenated vertically.\n\n#### Returns\n\nThe concatenated matrix.\n\n#### Examples\n\n```\nm1 = matrix(4 0 5, 2 1 8);\nm2 = matrix(2 9 8, 3 7 -3, 6 4 2, 0 5 8);\nm3 = matrix(1 -1 6 2, 1 -3 1 9, 5 3 0 -4, 1 NULL 3 4);\nconcatMatrix([m1, m2]);\n```\n\n| col1 | col2 | col3 | col4 | col5 | col6 |\n| ---- | ---- | ---- | ---- | ---- | ---- |\n| 4    | 2    | 2    | 3    | 6    | 0    |\n| 0    | 1    | 9    | 7    | 4    | 5    |\n| 5    | 8    | 8    | -3   | 2    | 8    |\n\n```\nprint concatMatrix([m2, m3], false);\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 2    | 3    | 6    | 0    |\n| 9    | 7    | 4    | 5    |\n| 8    | -3   | 2    | 8    |\n| 1    | 1    | 5    | 1    |\n| -1   | -3   | 3    |      |\n| 6    | 1    | 0    | 3    |\n| 2    | 9    | 4    | 4    |\n"
    },
    "conditionalFilter": {
        "url": "https://docs.dolphindb.com/en/Functions/c/conditionalFilter.html",
        "signatures": [
            {
                "full": "conditionalFilter(X, condition, filterMap)",
                "name": "conditionalFilter",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "condition",
                        "name": "condition"
                    },
                    {
                        "full": "filterMap",
                        "name": "filterMap"
                    }
                ]
            }
        ],
        "markdown": "### [conditionalFilter](https://docs.dolphindb.com/en/Functions/c/conditionalFilter.html)\n\n\n\n#### Syntax\n\nconditionalFilter(X, condition, filterMap)\n\n#### Details\n\nReturn true if both of the following conditions are satisfied, otherwise return false.\n\n* An element in the vector condition is a key to the dictionary *filterMap*;\n\n* The corresponding element in *X* is one of the elements of the key's value in the dictionary *filterMap*.\n\nIf both *X* and *condition* are vectors, the result is a vector of the same length as X.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n**condition** is a scalar or a vector of the same length as *X*.\n\n**filterMap** is a dictionary indicating the filtering conditions.\n\n#### Returns\n\nA scalar or vector of type BOOL.\n\n#### Examples\n\nExample 1\n\n```\nconditionalFilter(1 2 3,`a`b`c, dict(`a`b,1 2));\n// output: [1,1,0]\n\nconditionalFilter(1 2 3,`a`b`b, dict(`a`b,[1 2,3 4]))\n// output: [1,0,1]\n```\n\nExample 2. Get the specified stock data of the specified dates from table t:\n\n2012.06.01: C, MS 2012.06.02: IBM, MS 2012.06.03: MS 2012.06.04: IBM\n\n```\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C$SYMBOL\ndate = 2012.06.01 2012.06.01 2012.06.02 2012.06.03 2012.06.01 2012.06.02 2012.06.02 2012.06.03 2012.06.04\nprice = 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nt = table(sym, date, price, qty)\nt;\n```\n\n| sym | date       | price  | qty  |\n| --- | ---------- | ------ | ---- |\n| C   | 2012.06.01 | 49.60  | 2200 |\n| MS  | 2012.06.01 | 29.46  | 1900 |\n| MS  | 2012.06.02 | 29.52  | 2100 |\n| MS  | 2012.06.03 | 30.02  | 3200 |\n| IBM | 2012.06.01 | 174.97 | 6800 |\n| IBM | 2012.06.02 | 175.23 | 5400 |\n| C   | 2012.06.02 | 50.76  | 1300 |\n| C   | 2012.06.03 | 50.32  | 2500 |\n| C   | 2012.06.04 | 51.29  | 8800 |\n\n```\nfilter = dict(2012.06.01..2012.06.04, [`C`MS, `IBM`MS, `MS, `IBM])\nselect * from t where conditionalFilter(sym, date, filter) order by date, sym;\n```\n\n| sym | date       | price  | qty  |\n| --- | ---------- | ------ | ---- |\n| C   | 2012.06.01 | 49.6   | 2200 |\n| MS  | 2012.06.01 | 29.46  | 1900 |\n| IBM | 2012.06.02 | 175.23 | 5400 |\n| MS  | 2012.06.02 | 29.52  | 2100 |\n| MS  | 2012.06.03 | 30.02  | 3200 |\n\nExample 3. The values of *filterMap* can also be pairs:\n\n```\nt=table(`aaa`aaa`bbb`bbb as id, 2020.09.03 2020.09.10 2020.09.06 2020.09.09 as date)\nt\n```\n\n| id  | date       |\n| --- | ---------- |\n| aaa | 2020.09.03 |\n| aaa | 2020.09.10 |\n| bbb | 2020.09.06 |\n| bbb | 2020.09.09 |\n\n```\nmydict = dict(`aaa`bbb, [2020.09.01 : 2020.09.09,  2020.09.05 : 2020.09.09])\nselect * from t where conditionalFilter(date, id, mydict);\n```\n\n| id  | date       |\n| --- | ---------- |\n| aaa | 2020.09.03 |\n| bbb | 2020.09.06 |\n| bbb | 2020.09.09 |\n"
    },
    "conditionalIterate": {
        "url": "https://docs.dolphindb.com/en/Functions/c/conditionalIterate.html",
        "signatures": [
            {
                "full": "conditionalIterate(cond, trueValue, falseIterFunc)",
                "name": "conditionalIterate",
                "parameters": [
                    {
                        "full": "cond",
                        "name": "cond"
                    },
                    {
                        "full": "trueValue",
                        "name": "trueValue"
                    },
                    {
                        "full": "falseIterFunc",
                        "name": "falseIterFunc"
                    }
                ]
            }
        ],
        "markdown": "### [conditionalIterate](https://docs.dolphindb.com/en/Functions/c/conditionalIterate.html)\n\n\n\n#### Syntax\n\nconditionalIterate(cond, trueValue, falseIterFunc)\n\nThis function can only be used as a state function in the [reactive state engine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html).\n\n#### Details\n\nSupposing the iteration is based only on the previous result, for the k-th (k ∈ N+) record, the calculation logic is (where the column \"factor\" holds the results):\n\n* cond\\[k] == true: factor\\[k] = trueValue\n* cond\\[k] == false: factor\\[k] = falseIterFunc(factor)\\[k-1]\n\nNote: If *falseIterFunc* is a window function, the iteration is based on multiple previous results.\n\n#### Parameters\n\n**cond** is a conditional expression or a function with BOOLEAN return values. It must contain fields from the input table. Constants/constant expressions are not supported.\n\n**trueValue** is the calculation formula.\n\n**falseIterFunc** is the function for iteration, whose only parameter is the column from the output table. Currently, only the following functions are supported (use partial application to specify functions with multiple parameters):\n\n* Moving functions: `tmove`, `tmavg`, `tmmax`, `tmmin`, `tmsum`, `mavg`, `mmax`, `mmin`, `mcount`, `msum`;\n\n* Cumulative window functions: `cumlastNot`, `cumfirstNot`;\n\n* Order-sensitive functions: `ffill`, `move`.\n\nIf *cond* returns true, the calculation of *trueValue* is triggered. If *cond* returns false, *falseIterFunc* is called for iteration.\n\n#### Note:\n\n* As the iterations are performed based on the historical data, the output for the current record is calculated based on the historical results in the output table and *X*.\n\n* When calculating with time-based moving windows, windows are determined by the current timestamp T, i.e., *(T - window, T)*.\n\n* The data type of the result column is determined by the result of *trueValue*. Therefore, the data type of the result of *trueValue* and *falseIterFunc* must be compatible. Data type compatibility rules:\n\n  * INT, SHORT, LONG and CHAR are compatible;\n\n  * FLOAT and DOUBLE are compatible;\n\n  * STRING and SYMBOL are compatible.\n\n#### Examples\n\nExample 1. Understand the calculation logic of `conditionalIterate` with the following example.\n\n```\ntrade = table(take(\"A\", 10) as sym,  take(1 3 6, 10) as val0,  take(10, 10) as val1)\ntrade\n```\n\n| sym | val0 | val1 |\n| --- | ---- | ---- |\n| A   | 1    | 10   |\n| A   | 3    | 10   |\n| A   | 6    | 10   |\n| A   | 1    | 10   |\n| A   | 3    | 10   |\n| A   | 6    | 10   |\n| A   | 1    | 10   |\n| A   | 3    | 10   |\n| A   | 6    | 10   |\n| A   | 1    | 10   |\n\nDefine a reactive state stream engine and group the data by \"sym\" for calculation.\n\n* If val0 > 5 returns true, the formula is *factor\\[k]=trueValue*. Output the value of val1.\n\n* If val0 > 5 returns false, the corresponding formula is *factor\\[k]=falseIterFunc(factor)\\[k-1]*. When k=3, then the corresponding val0=1, val1=10, factor=\\[NULL, NULL, 10], the result is *msum(\\[NULL, NULL, 10], 3)\\[2]=10*. Similarly, when k=4, the corresponding val0=3, val1=10, factor=\\[NULL, NULL, 10, 10], the result is *msum(\\[NULL, NULL, 10, 10], 3)\\[3]=20*.\n\n```\ninputTable = streamTable(1:0, `sym`val0`val1, [SYMBOL, INT, INT])\noutputTable = table(100:0, `sym`factor, [STRING, DOUBLE])\nrse = createReactiveStateEngine(name=\"rsTest\", metrics=<conditionalIterate(val0 > 5, val1, msum{, 3})>, dummyTable=inputTable, outputTable=outputTable, keyColumn=\"sym\")\nrse.append!(trade)\nselect * from outputTable\n```\n\n| sym | factor |\n| --- | ------ |\n| A   |        |\n| A   |        |\n| A   | 10     |\n| A   | 10     |\n| A   | 20     |\n| A   | 10     |\n| A   | 40     |\n| A   | 70     |\n| A   | 10     |\n| A   | 120    |\n\nExample 2. The calculation logic of \"factor\":\n\n```\ndef factor(TotalVolumeTrade, TotalValueTrade, HighPx, LowPx){\n    factorValue = iif(TotalVolumeTrade < 1500000, pow(HighPx*LowPx, 0.5)-(TotalVolumeTrade/TotalValueTrade), mavg(factor(TotalVolumeTrade, TotalValueTrade, HighPx, LowPx), 3))\n    return factorValue\n}\n```\n\nThe calculation of factor involves recursion. You can use function `conditionalIterate` to implement the factor in a reactive state engine with the following script:\n\n```\n@state\ndef factor1(TotalVolumeTrade, TotalValueTrade, HighPx, LowPx){\n   factorValue = conditionalIterate(TotalVolumeTrade < 1500000, (pow(HighPx*LowPx, 0.5)-(TotalVolumeTrade/TotalValueTrade)), mavg{,3})\n   return factorValue\n}\n\nSecurityID =  [\"000001.SZ\",\"000001.SZ\",\"000001.SZ\",\"000001.SZ\",\"000001.SZ\",\"000001.SZ\",\"000001.SZ\",\"000001.SZ\",\"000001.SZ\",\"000001.SZ\"]$SYMBOL\nDate = [2022.04.01,2022.04.01,2022.04.01,2022.04.01,2022.04.01,2022.04.01,2022.04.01,2022.04.01,2022.04.01,2022.04.01]\nTime = [09:30:00.000,09:30:03.000,09:30:06.000,09:30:09.000,09:30:12.000,09:30:15.000,09:30:18.000,09:30:21.000,09:30:24.000,09:30:27.000]\nTotalVolumeTrade = [844800,1035700,1240100,1304500,1457800,1522400,1550900,1663800,1692100,1767100]\nTotalValueTrade = [12982101,15908020,19038479,20022525,22363886,23349799,23784950,25506625.75,25937850.75,27080561.75]\nHighPx = [15.37,15.37,15.37,15.37,15.37,15.37,15.37,15.37,15.37,15.37]\nLowPx = [15.3,15.3,15.29,15.28,15.24,15.24,15.24,15.22,15.22,15.22]\ntrade = table(SecurityID, Date, Time, TotalVolumeTrade, TotalValueTrade, HighPx, LowPx)\n\nresult = table(1:0, `SecurityID`Date`Time`Factor, `SYMBOL`DATE`TIME`DOUBLE)\n\nfactor=[<Date>,<Time>, <factor1(TotalVolumeTrade, TotalValueTrade, HighPx, LowPx)>]\nrse = createReactiveStateEngine(name=\"rsTest\", metrics=factor, dummyTable=trade, outputTable=result, keyColumn=\"SecurityID\")\nrse.append!(trade)\n\ntrade1 = select *,  (pow(HighPx*LowPx, 0.5)-(TotalVolumeTrade/TotalValueTrade)) as Factor0 from trade\nselect * from lj(trade1, result, `SecurityID`Date`Time)\ndropStreamEngine(\"rsTest\")\n```\n\nThe following is part of the result:\n\n![](https://docs.dolphindb.com/en/images/conditionalIterate_output.png)\n\nFor records in blue box, data in column Factor is the results of *trueValue*, which are the same as the output in Factor0. For records in red box, data in column Factor is the results of *falseIterFunc*, and each of them is the average of the previous three results.\n\nRelated functions: [stateIterate](https://docs.dolphindb.com/en/Functions/s/stateIterate.html)\n"
    },
    "condValueAtRisk": {
        "url": "https://docs.dolphindb.com/en/Functions/c/condValueAtRisk.html",
        "signatures": [
            {
                "full": "condValueAtRisk(returns, method, [confidenceLevel=0.95])",
                "name": "condValueAtRisk",
                "parameters": [
                    {
                        "full": "returns",
                        "name": "returns"
                    },
                    {
                        "full": "method",
                        "name": "method"
                    },
                    {
                        "full": "[confidenceLevel=0.95]",
                        "name": "confidenceLevel",
                        "optional": true,
                        "default": "0.95"
                    }
                ]
            }
        ],
        "markdown": "### [condValueAtRisk](https://docs.dolphindb.com/en/Functions/c/condValueAtRisk.html)\n\n#### Syntax\n\ncondValueAtRisk(returns, method, \\[confidenceLevel=0.95])\n\nAlias: CVaR\n\n#### Details\n\nCalculate Conditional Value at Risk (CVaR), or expected shortfall (ES) to estimate the average losses incurred beyond the VaR level.\n\n#### Parameters\n\n**returns** is a numeric vector representing the returns. The element must be greater than -1 and cannot be empty.\n\n**method** is a string indicating the CVaR calculation method, which can be:\n\n* 'normal': parametric method with normal distribution\n* 'logNormal': parametric method with log-normal distribution\n* 'historical': historical method\n* 'monteCarlo': Monte Carlo simulation\n\n**confidenceLevel** (optional) is a numeric scalar representing the confidence level, with a valid range of (0,1). The default value is 0.95.\n\n#### Returns\n\nA DOUBLE value indicating the absolute value of the average losses that exceed the VaR. The value of VaR is returned if there is no return beyond the level.\n\n#### Examples\n\nCalculate CVaR using historical method at a confidence level of 0.9 based on given returns:\n\n```\nreturns = [0.0, -0.0023816107391389394, -0.0028351258634076834, 0.00789570628538656, 0.0022056267475062397, -0.004515475812603498, 0.0031189325339843646, 0.010774648811452205, 0.0030816164453268957, 0.02172541561228001, 0.011106185767699728, -0.005369098699244845, -0.0096490689793588, 0.0025152212699484314, 0.017822140037111668, -0.02837536728283525, 0.018373545076599204, -0.0026401111537113003, 0.019524374522517898, -0.010800546314337627, 0.014073362622486131, -0.00398277532382243, 0.008398647051501285, 0.0024056749358184904, 0.007093080335863512, -0.005332549248384733, -0.008471915938733665, -0.0038788486165083342, -0.01308504169086584, 0.00350496242864784, 0.009036118926745962, 0.0013358223875250545, 0.0036426642608267563, 0.003974568474545581, -0.003944066366522669, -0.011969668605022311, 0.015116930499066374, 0.006931427295653037, -0.0032650627551519267, 0.003407880132851648]\ncondValueAtRisk(returns, 'historical', 0.9);\n//output: 0.016057655973\n```\n\n"
    },
    "constantDesc": {
        "url": "https://docs.dolphindb.com/en/Functions/c/constantDesc.html",
        "signatures": [
            {
                "full": "constantDesc(obj)",
                "name": "constantDesc",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [constantDesc](https://docs.dolphindb.com/en/Functions/c/constantDesc.html)\n\n\n\n#### Syntax\n\nconstantDesc(obj)\n\n#### Details\n\nThis function provides a description of an object.\n\n#### Parameters\n\n**obj** is an object.\n\n#### Returns\n\nA dictionary with the following keys:\n\n| Key                      | Description                                                                                            |\n| ------------------------ | ------------------------------------------------------------------------------------------------------ |\n| form                     | the data form                                                                                          |\n| vectorType               | the specific vector type, returns only when *obj* is a vector                                          |\n| isIndexedMatrix          | whether it is an indexed matrix, returns only when *obj* is a matrix                                   |\n| isIndexedSeries          | whether it is an indexed series, returns only when *obj* is a matrix                                   |\n| nullFlag                 | whether it contains null values, returns only when *obj* is a vector, pair, or matrix                  |\n| isView                   | whether it is a view, returns only when *obj* is a vector, pair, or matrix                             |\n| tableType                | the specific table type, returns only when *obj* is a table                                            |\n| type                     | the data type                                                                                          |\n| codeType                 | the specific metacode type, returns only when *obj* is metacode                                        |\n| functionDefType          | the specific function type, returns only when *obj* is a function                                      |\n| isTransformFunction      | whether is a transform function, returns only when *obj* is a function                                 |\n| isAggregateFunction      | whether is an aggregate function, returns only when *obj* is a function                                |\n| isOrderSensitiveFunction | whether is an order-sensitive function, returns only when *obj* is a function                          |\n| isHigherOrderFunction    | whether is a higher-order function, returns only when *obj* is a function                              |\n| scale                    | the number of decimal places, returns only when *obj* is of DECIMAL type                               |\n| isColumnarTuple          | whether it is a columnar tuple, returns only when *obj* is a tuple, excluding any view representations |\n| category                 | the data type category                                                                                 |\n| isTemporary              | whether it is a temporary object                                                                       |\n| isIndependent            | whether it is an independent object                                                                    |\n| isReadonly               | whether it is a read-only object                                                                       |\n| isReadonlyArgument       | whether it is a read-only argument                                                                     |\n| isStatic                 | whether it is a static object                                                                          |\n| isTransient              | whether it is a transient object                                                                       |\n| copyOnWrite              | whether it employs copy-on-write behavior                                                              |\n| refCount                 | the count that has been referenced                                                                     |\n| address                  | the hexadecimal address                                                                                |\n| rows                     | the row count                                                                                          |\n| columns                  | the column count                                                                                       |\n| memoryAllocated          | the memory allocated                                                                                   |\n\n#### Examples\n\n```\nt = table(1..3 as id, 4..6 as val)\nconstantDesc(t)\n/*\nform->TABLE\ntableType->BASIC\ntype->DICTIONARY\ncategory->MIXED\nisTemporary->false\nisIndependent->true\nisReadonly->false\nisReadonlyArgument->false\nisStatic->false\nisTransient->false\ncopyOnWrite->false\nrefCount->1\naddress->0000000028d2d1e0\nrows->3\ncolumns->2\nmemoryAllocated->208\n*/\n\n\nconstantDesc(lj)\n/*\nform->SCALAR\ntype->FUNCTIONDEF\nfunctionDefType->SYSTEM FUNCTION\ncategory->SYSTEM\nisTemporary->true\nisIndependent->true\nisReadonly->false\nisReadonlyArgument->false\nisStatic->false\nisTransient->false\ncopyOnWrite->false\nrefCount->6\naddress->000000000cabce00\nrows->1\ncolumns->1\nmemoryAllocated->10\n*/\n```\n"
    },
    "contextCount": {
        "url": "https://docs.dolphindb.com/en/Functions/c/contextCount.html",
        "signatures": [
            {
                "full": "contextCount(X, Y)",
                "name": "contextCount",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [contextCount](https://docs.dolphindb.com/en/Functions/c/contextCount.html)\n\n\n\n#### Syntax\n\ncontextCount(X, Y)\n\n#### Details\n\nCount the number of positions that are not null in both *X* and *Y*.\n\n#### Parameters\n\n**X** and **Y** are vectors of the same length.\n\n#### Returns\n\nA scalar of type INT.\n\n#### Examples\n\n```\ncontextCount(1 2 3, 1 NULL 3)\n// output: 2\n\ncontextCount(1..3,true false true)\n// output: 3\n\ncontextCount(1 2 NULL, 1 NULL 3)\n// output: 1\n```\n\nRelated functions: [contextSum](https://docs.dolphindb.com/en/Functions/c/contextSum.html), [contextSum2](https://docs.dolphindb.com/en/Functions/c/contextSum2.html)\n"
    },
    "contextSum": {
        "url": "https://docs.dolphindb.com/en/Functions/c/contextSum.html",
        "signatures": [
            {
                "full": "contextSum(X, Y)",
                "name": "contextSum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [contextSum](https://docs.dolphindb.com/en/Functions/c/contextSum.html)\n\n\n\n#### Syntax\n\ncontextSum(X, Y)\n\n#### Details\n\nGet of positions that are not null in both *X* and *Y*, and calculate the sum of the elements in *X* on these positions.\n\n#### Parameters\n\n**X** and **Y** are vectors, matrices or tables.\n\n#### Returns\n\nA scalar/vector of type LONG/DOUBLE or a table.\n\n#### Examples\n\n```\ncontextSum(1 2 3 4 5, 2 3 4 5 6)\n// output: 15\n\ncontextSum(1..3, true false true)\n// output: 6\n\ncontextSum(1 2 NULL, 1 NULL 3)\n// output: 1\n```\n\nRelated functions: [contextCount](https://docs.dolphindb.com/en/Functions/c/contextCount.html), [contextSum2](https://docs.dolphindb.com/en/Functions/c/contextSum2.html)\n"
    },
    "contextSum2": {
        "url": "https://docs.dolphindb.com/en/Functions/c/contextSum2.html",
        "signatures": [
            {
                "full": "contextSum2(X, Y)",
                "name": "contextSum2",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [contextSum2](https://docs.dolphindb.com/en/Functions/c/contextSum2.html)\n\n\n\n#### Syntax\n\ncontextSum2(X, Y)\n\n#### Details\n\nGet of positions that are not null in both *X* and *Y*, and calculate the sum of squares of the elements in *X* on these positions.\n\n#### Parameters\n\n**X** and **Y** are vectors, matrices or tables.\n\n#### Returns\n\nDOUBLE type (regardless of the data types of *X* and *Y*)\n\n#### Examples\n\n```\ncontextSum2(1 2 3, 10 NULL 30);\n// output: 10\n\ncontextSum2(1 2 3, true false true);\n// output: 14\n```\n\nRelated functions: [contextCount](https://docs.dolphindb.com/en/Functions/c/contextCount.html), [contextSum](https://docs.dolphindb.com/en/Functions/c/contextSum.html)\n"
    },
    "convertEncode": {
        "url": "https://docs.dolphindb.com/en/Functions/c/convertEncode.html",
        "signatures": [
            {
                "full": "convertEncode(str, srcEncode, destEncode)",
                "name": "convertEncode",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "srcEncode",
                        "name": "srcEncode"
                    },
                    {
                        "full": "destEncode",
                        "name": "destEncode"
                    }
                ]
            }
        ],
        "markdown": "### [convertEncode](https://docs.dolphindb.com/en/Functions/c/convertEncode.html)\n\n\n\n#### Syntax\n\nconvertEncode(str, srcEncode, destEncode)\n\n#### Details\n\nChange the encoding of strings. All encoding names must use lowercase.\n\nThe Linux version supports conversion between any two encodings. The Windows version only supports conversion between GBK and UTF-8.\n\n#### Parameters\n\n**str** can be a STRING scalar/vector, a dictionary with string values, or a table.\n\n**srcEncode** is a string indicating the original encoding name.\n\n**destEncode** is a string indicating the new encoding name.\n\n#### Returns\n\nA scalar/vector/dictionary/table of type STRING.\n\n#### Examples\n\n```\nconvertEncode(\"high-performance time-series database\",\"utf-8\",\"gbk\");\n// output: high-performance time-series database\n\nconvertEncode([\"hello\",\"DolphinDB\"],\"gbk\",\"utf-8\");\n// output: [\"hello\",\"DolphinDB\"]\n```\n\n`convertEncode` can convert a dictionary with string values.\n\n```\nx=1 2 3\ny= `C1`C2`D1\nd=dict(x,y)\nconvertEncode(d, \"UTF-8\", \"GBK\")\n// output: \n1: C1\n2: C2\n3: D1\n*/\n```\n\n`convertEncode` automatically detects and converts all string columns in a table, while ignoring columns of other data types.\n\n```\nt=table([\"t1\", \"t1\", \"t2\", \"t3\"] as type, [11, 11.5, 10, 14] as price)\nconvertEncode(t, \"UTF-8\", \"GBK\")\n```\n\n| type | price |\n| ---- | ----- |\n| t1   | 11    |\n| t1   | 11.5  |\n| t2   | 10    |\n| t3   | 14    |\n\nRelated functions: [fromUTF8](https://docs.dolphindb.com/en/Functions/f/fromUTF8.html), [toUTF8](https://docs.dolphindb.com/en/Functions/t/toUTF8.html)\n"
    },
    "convertExcelFormula": {
        "url": "https://docs.dolphindb.com/en/Functions/c/convertExcelFormula.html",
        "signatures": [
            {
                "full": "convertExcelFormula(formula, colStart, colEnd, rowStart, rowEnd)",
                "name": "convertExcelFormula",
                "parameters": [
                    {
                        "full": "formula",
                        "name": "formula"
                    },
                    {
                        "full": "colStart",
                        "name": "colStart"
                    },
                    {
                        "full": "colEnd",
                        "name": "colEnd"
                    },
                    {
                        "full": "rowStart",
                        "name": "rowStart"
                    },
                    {
                        "full": "rowEnd",
                        "name": "rowEnd"
                    }
                ]
            }
        ],
        "markdown": "### [convertExcelFormula](https://docs.dolphindb.com/en/Functions/c/convertExcelFormula.html)\n\n\n\n#### Syntax\n\nconvertExcelFormula(formula, colStart, colEnd, rowStart, rowEnd)\n\n#### Details\n\nConvert Excel formula to DolphinDB expressions.\n\nThe function only supports the following conversions: the arithmetic operations, logical operations, and aggregate functions.\n\nCurrently, it does not support converting the expressions that operate on both rows and columns.\n\nWhen applying an aggregate function on a single column, the aggregation will be performed on this column if the processing row number is equal to the actual row number. Otherwise, the aggregation will be performed on a moving window.\n\n#### Parameters\n\n**formula** is a STRING scalar/vector indicating an Excel formula.\n\n**colStart** is a STRING scalar indicating the starting column of the data in Excel.\n\n**colEnd** is a STRING scalar indicating the ending column of the data in Excel.\n\n**rowStart** is a positive integer indicating the starting row of the data in Excel.\n\n**rowEnd** is a positive integer indicating the ending row of the data in Excel. *rowEnd* must be greater than or equal to *rowStart*.\n\n#### Returns\n\nA scalar or vector of type STRING.\n\n#### Examples\n\n```\nconvertExcelFormula(\"A2+B2\", \"A\", \"Z\", 2, 10);\n// output: col0+col1\n\nconvertExcelFormula(\"SUM(A2:C2)\", \"A\", \"Z\", 2, 10);\n// output: rowSum(col0, col1, col2)\n\nconvertExcelFormula(\"SUM(A2)\", \"A\", \"Z\", 2, 10);\n// output: cumsum(col0)\n\nconvertExcelFormula(\"SUM(A2:A5)\", \"A\", \"Z\", 2, 10);\n// output: msum(col0, 4)\n\nconvertExcelFormula(\"SUM(A2:A10)\", \"A\", \"Z\", 2, 10);\n// output: sum(col0)\n\nconvertExcelFormula([\"=SUM(A1:A10)\",\"IF(A1>0,B1,0\"], \"A\", \"D\", 1, 10)\n// output: [\"sum(col0)\",\"iif(col0>0,col1,0)\"]\n```\n"
    },
    "convertibleFixedRateBondDirtyPrice": {
        "url": "https://docs.dolphindb.com/en/Functions/c/convertiblefixedratebonddirtyprice.html",
        "signatures": [
            {
                "full": "convertibleFixedRateBondDirtyPrice(settlement, issue, maturity, redemption, coupon, spread, riskFree, volatility, spot, conversionPrice, divYield, divDates, callDates, callPrices, putDates, putPrices, style, calendar, frequency, [basis=1], [convention='Following'], [method='binomial'], [kwargs])",
                "name": "convertibleFixedRateBondDirtyPrice",
                "parameters": [
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "issue",
                        "name": "issue"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "redemption",
                        "name": "redemption"
                    },
                    {
                        "full": "coupon",
                        "name": "coupon"
                    },
                    {
                        "full": "spread",
                        "name": "spread"
                    },
                    {
                        "full": "riskFree",
                        "name": "riskFree"
                    },
                    {
                        "full": "volatility",
                        "name": "volatility"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "conversionPrice",
                        "name": "conversionPrice"
                    },
                    {
                        "full": "divYield",
                        "name": "divYield"
                    },
                    {
                        "full": "divDates",
                        "name": "divDates"
                    },
                    {
                        "full": "callDates",
                        "name": "callDates"
                    },
                    {
                        "full": "callPrices",
                        "name": "callPrices"
                    },
                    {
                        "full": "putDates",
                        "name": "putDates"
                    },
                    {
                        "full": "putPrices",
                        "name": "putPrices"
                    },
                    {
                        "full": "style",
                        "name": "style"
                    },
                    {
                        "full": "calendar",
                        "name": "calendar"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "[basis=1]",
                        "name": "basis",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[convention='Following']",
                        "name": "convention",
                        "optional": true,
                        "default": "'Following'"
                    },
                    {
                        "full": "[method='binomial']",
                        "name": "method",
                        "optional": true,
                        "default": "'binomial'"
                    },
                    {
                        "full": "[kwargs]",
                        "name": "kwargs",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [convertibleFixedRateBondDirtyPrice](https://docs.dolphindb.com/en/Functions/c/convertiblefixedratebonddirtyprice.html)\n\n#### Syntax\n\nconvertibleFixedRateBondDirtyPrice(settlement, issue, maturity, redemption, coupon, spread, riskFree, volatility, spot, conversionPrice, divYield, divDates, callDates, callPrices, putDates, putPrices, style, calendar, frequency, \\[basis=1], \\[convention='Following'], \\[method='binomial'], \\[kwargs])\n\n#### Details\n\nCalculate the price of the convertible bonds, including interest, for every 100 of face value.\n\nConvertible bond is a type of bond that the holder can convert into a specified number of shares of common stock in the issuing company or cash of equal value. It is a hybrid security with debt- and equity-like features. Convertible bonds often include embedded rights for bond redemption or put options.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length. For array vector inputs, the number of rows must match the length of the other vectors.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**issue** is a DATE scalar or vector indicating the issuance date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**redemption** is a numeric scalar or vector indicating the redemption value.\n\n**coupon** is a numeric scalar or vector indicating the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.\n\n**spread** is a numeric scalar or vector indicating the interest rate spread.\n\n**riskFree** is a numeric scalar or vector indicating the risk-free interest rate.\n\n**volatility** is a numeric scalar or vector indicating the volatility.\n\n**spot** is a numeric scalar or vector that represents the current price of the issuing company's stock.\n\n**conversionPrice**is a numeric scalar or vector that represents the conversion price, i.e., the price per share to be paid when the bond is converted into stock. It determines the number of shares that can be obtained for each convertible bond.\n\n**divYield** is a numeric scalar or vector that represents the dividend yield.\n\n**divDates**is a DATE vector or array vector that represents the dividend dates.\n\n**callDates**is a DATE vector or array vector that represents the dates for the early redemption of the bond, as specified by the embedded call option.\n\n**callPrices**is a numeric vector or array vector that represents the redemption prices for the bond on the call dates specified by the embedded call option. It must correspond directly to the *callDates*.\n\n**putDates**is a DATE vector or array vector that represents the dates for the early put (sale) of the bond, as specified by the embedded put option.\n\n**putPrices** is a numeric vector or array vector that represents the prices at which the bond can be sold back (put) early, as specified by the embedded put option. It must correspond directly to the *putDates*.\n\n**style** is a STRING scalar or vector indicating the option exercise style. It can be 'european' or 'american'.\n\n**calendar** is a STRING scalar or vector indicating the trading calendar(s). See [Trading Calendar](https://docs.dolphindb.com/en/Tutorials/trading_calendar.html) for more information.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**basis**is an INT/STRING scalar or vector indicating the day-count basis. It can be:\n\n* 0/\"Thirty360US\": US (NASD) 30/360\n* 1/\"ActualActual\": actual/actual\n* 2/\"Actual360\": actual/360\n* 3/\"Actual365\": actual/365\n* 4/\"Thirty360EU\": European 30/360\n\n**convention** (optional) is a STRING scalar or vector indicating how cash flows that fall on a non-trading day are treated. The following options are available. Defaults to 'Following'.\n\n* 'Following': The following trading day.\n* 'ModifiedFollowing': The following trading day. If that day is in a different month, the preceding trading day is adopted instead.\n* 'Preceding': The preceding trading day.\n* 'ModifiedPreceding': The preceding trading day. If that day is in a different month, the following trading day is adopted instead.\n* 'Unadjusted': Unadjusted.\n* 'HalfMonthModifiedFollowing': The following trading day. If that day crosses the mid-month (15th) or the end of month, the preceding trading day is adopted instead.\n* 'Nearest': The nearest trading day. If both the preceding and following trading days are equally far away, default to following trading day.\n\n**method** (optional) is a STRING scalar indicating the valuation method used. Currently, only \"binomial\" is supported, which means the valuation is performed using the Binomial tree model.\n\n**kwargs** (optional) is a dictionary specifying other parameters required by the valuation method. When *method*='binomial', the key-values pairs should be:\n\n* 'type': A STRING scalar or vector that specifies the type of the binomial tree model. The possible values are:\n  * 'crr' (default): Cox-Ross-Rubinstein model\n  * 'jr': Jarrow-Rudd model\n* 'timeSteps': An INT scalar or vector that represents the number of time steps in the binomial tree model. The default value is 100.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\nConsider a 5-year convertible bond A issued on August 28, 2023, with a maturity date of August 28, 2028, and a trade date of August 28, 2024. The bond has a redemption price of 100, an annual coupon rate of 0.05, and pays interest annually with a spread of 0.005. The conversion price is 26, and the current stock price is 36. The dividend yield is 0.02, with dividends paid every 6 months starting from October 28, 2024, for a total of 6 payments.\n\nThe bond can be redeemed at prices of 101.5 on August 28, 2025, and 100.85 on August 30, 2027. It can also be put back at 105 on August 28, 2026. The market's risk-free interest rate is 0.06, with a volatility of 0.2. The day count convention is Actual/365, and the method for adjusting non-business days is modified following, following the NewYork Stock Exchange (XNYS) calendar.\n\nCalculate the price of the bond, including interest, for both European and American exercise options.\n\n```\nspot = 36.0\nconversionPrice = 26.0\nredemption = 100\nspread = 0.005\ndivYield = 0.02\nriskFree = 0.06\nvolatility = 0.20\nissue = 2023.08.28\nsettlement = 2024.08.28\nmaturity = 2028.08.28\nconvention = `ModifiedFollowing\ncalendar = `XNYS\nstyle = [`european, `american]\nfrequency = 1\ncoupon = 0.05\nbasis = 3\ndivFreq = 6M\nnextDivDate = 2024.10.28\ndivDates = []\nfor (i in 0..5) {\n\tdivDates.append!(nextDivDate)\n\tnextDivDate = temporalAdd(nextDivDate, divFreq)\n}\ndivDates = divDates$DATE\ncallDates = [2025.08.28, 2027.08.30]\ncallPrices = [101.5, 100.85]\nputDates = [2026.08.28]\nputPrices = [105.0]\nconvertibleFixedRateBondDirtyPrice(settlement, issue, maturity, redemption, coupon, spread, riskFree,\n                             volatility, spot, conversionPrice, divYield, divDates, callDates,\n                            callPrices, putDates, putPrices, style, calendar, frequency, basis, convention)\n// [100.14675326378128,138.45755887077215]\n```\n"
    },
    "convertTZ": {
        "url": "https://docs.dolphindb.com/en/Functions/c/convertTZ.html",
        "signatures": [
            {
                "full": "convertTZ(obj, srcTZ, destTZ)",
                "name": "convertTZ",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "srcTZ",
                        "name": "srcTZ"
                    },
                    {
                        "full": "destTZ",
                        "name": "destTZ"
                    }
                ]
            }
        ],
        "markdown": "### [convertTZ](https://docs.dolphindb.com/en/Functions/c/convertTZ.html)\n\n\n\n#### Syntax\n\nconvertTZ(obj, srcTZ, destTZ)\n\n#### Details\n\nConvert *obj* from time zone *srcTZ* to time zone *destTZ*. Daylight saving time is considered in time zone conversion.\n\n#### Parameters\n\n**obj** is a scalar or vector of DATETIME, TIMESTAMP, or NANOTIMESTAMP type.\n\n**srcTZ** and **destTZ** are both strings indicating time zones.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nconvertTZ(2016.04.25T08:25:45,\"US/Eastern\",\"Asia/Shanghai\");\n// output: 2016.04.25T20:25:45\n```\n"
    },
    "copy": {
        "url": "https://docs.dolphindb.com/en/Functions/c/copy.html",
        "signatures": [
            {
                "full": "copy(obj)",
                "name": "copy",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [copy](https://docs.dolphindb.com/en/Functions/c/copy.html)\n\n\n\n#### Syntax\n\ncopy(obj)\n\n#### Details\n\nReturns a shallow copy of *obj*. A shallow copy only copies the outer structure, while inner elements (sub-objects) still share references with the original object.\n\nThe difference between `copy` (shallow copy) and `deepCopy` (deep copy) is most evident when dealing with nested structures such as tuples or dictionaries of type ANY:\n\n* `copy` only duplicates the top-level structure, while sub-objects retain shared references (i.e., the sub-object addresses remain unchanged).\n* `deepCopy` recursively copies all sub-objects, ensuring fully independent references.\n\n#### Parameters\n\n**obj** can be of any data type.\n\n#### Returns\n\nThe shallow copy of *obj*.\n\n#### Examples\n\nExample 1. Copy a vector\n\n```\nx = 1 2 3\na = x.copy()\nb = x.deepCopy();\n\nprint constantDesc(x[0]).address  // 000000000dd3d640\nprint constantDesc(a[0]).address  // 000000000cb5a4c0\nprint constantDesc(b[0]).address  // 000000000de92c20\n```\n\nExample 2. Copy a tuple\n\n```\nx = ([[1, 2], [3, 4]], \"a\")\na = x.copy()\nb = x.deepCopy();\n\nprint constantDesc(x[0]).address  // 000000000c7ce880\nprint constantDesc(a[0]).address  // 000000000c7ce880\nprint constantDesc(b[0]).address  // 000000000c89be00\n```\n\nExample 3. Copy an ANY dictionary\n\n```\ny = dict(`A`B`C, (1 2, 3 4, 5 6))\nc = y.copy()\nd = y.deepCopy();\n\nprint constantDesc(y[`A]).address  // 000000000c88c450\nprint constantDesc(c[`A]).address  // 000000000c88c450\nprint constantDesc(d[`A]).address  // 000000000c7cde00\n```\n\nRelated Functions: [asis](https://docs.dolphindb.com/en/Functions/a/asis.html), [deepCopy](https://docs.dolphindb.com/en/Functions/d/deepCopy.html)\n"
    },
    "copyReplicas": {
        "url": "https://docs.dolphindb.com/en/Functions/c/copyReplicas.html",
        "signatures": [
            {
                "full": "copyReplicas(srcNode, destNode, chunkId)",
                "name": "copyReplicas",
                "parameters": [
                    {
                        "full": "srcNode",
                        "name": "srcNode"
                    },
                    {
                        "full": "destNode",
                        "name": "destNode"
                    },
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    }
                ]
            }
        ],
        "markdown": "### [copyReplicas](https://docs.dolphindb.com/en/Functions/c/copyReplicas.html)\n\n\n\n#### Syntax\n\ncopyReplicas(srcNode, destNode, chunkId)\n\n#### Details\n\nCopy replicas of one or multiple chunks from a node to another node. If the destination node already has the chunk, the command is skipped.\n\nThis command can only be executed by an administrator on a controller node.\n\nYou can check the execution status with function [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html) .\n\n#### Parameters\n\n**srcNode** is a string indicating the alias of origination node.\n\n**destNode** is a string indicating the alias of destination node.\n\n**chunkId** is a STRING scalar or vector indicating ID of chunk(s).\n\n#### Returns\n\nNone.\n\n#### Examples\n\nCopy replicas of all chunks on \"node1\" to \"node2\".\n\n```\nchunkIds=exec chunkId from pnodeRun(getAllChunks) where node=\"node1\"\ncopyReplicas(\"node1\",\"node2\",string(chunkIds));\n```\n"
    },
    "corr": {
        "url": "https://docs.dolphindb.com/en/Functions/c/corr.html",
        "signatures": [
            {
                "full": "corr(X,Y)",
                "name": "corr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [corr](https://docs.dolphindb.com/en/Functions/c/corr.html)\n\n\n\n#### Syntax\n\ncorr(X,Y)\n\n#### Details\n\nCalculate the correlation of *X* and *Y*.\n\nWhen the variance of X or Y is less than 10^-12, the variance is considered 0, and the result of the correlation calculation will be NULL.\n\n#### Parameters\n\n**X** and **Y** are vectors/matrices/tables of the same size. If *X* is a table, only the numeric and Boolean values are calculated.\n\n#### Returns\n\nA scalar/vector/table of type DOUBLE.\n\n#### Examples\n\n```\nx = 7 4 5 8 9 3 3 5 2 6 12 1 0 -5 32\ny=1.1 7 8 9 9 5 4 8.6 2 1 -9 -3 5 8 13\ncorr(x,y);\n// output: 0.238769\n```\n"
    },
    "corrMatrix": {
        "url": "https://docs.dolphindb.com/en/Functions/c/corrMatrix.html",
        "signatures": [
            {
                "full": "corrMatrix(X)",
                "name": "corrMatrix",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [corrMatrix](https://docs.dolphindb.com/en/Functions/c/corrMatrix.html)\n\n\n\n#### Syntax\n\ncorrMatrix(X)\n\n#### Details\n\nReturn a correlation matrix, where the (i, j) entry is the correlation between the columns *i* and *j* of *X*.\n\nNote:\n\n* For a matrix *X* without null values, the result of `corrMatrix(X)` is equivalent to `cross/pcross(corr, X)`, but the performance of function corrMatrix is significantly improved.\n\n* For a matrix with null values, the results of `corrMatrix(X)` and `cross/pcross(corr, X)` are different, because the null values are converted to 0 by default in function `corrMatrix`, but ignored in function `corr`.\n\n#### Parameters\n\n**X** is a matrix.\n\n#### Returns\n\nA matrix of type DOUBLE.\n\n#### Examples\n\n```\nm = rand(10.0, 30)$10:3\ncorrMatrix(m)\n```\n\n| #0                | #1                | #2                |\n| ----------------- | ----------------- | ----------------- |\n| 1                 | 0.167257129736134 | 0.224955585716037 |\n| 0.167257129736134 | 1                 | -0.12066768907057 |\n| 0.224955585716037 | -0.12066768907057 | 1                 |\n\n```\na = rand(1.0, 30000000).reshape(10000:3000)\na.rename!(\"s\" + string(1..3000))\n\ntimer corrMatrix(a)\n// Time elapsed: 2986.932 ms\n\ntimer pcross(corr, a)\n// Time elapsed: 45629.6 ms\n```\n\nRelated function: [covarMatrix](https://docs.dolphindb.com/en/Functions/c/covarMatrix.html)\n"
    },
    "cos": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cos.html",
        "signatures": [
            {
                "full": "cos(X)",
                "name": "cos",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cos](https://docs.dolphindb.com/en/Functions/c/cos.html)\n\n\n\n#### Syntax\n\ncos(X)\n\n#### Details\n\nApplies the function of cos to X.\n\n**Note:**\n\n* Equivalent to NumPy's [numpy.cos](https://numpy.org/doc/stable/reference/generated/numpy.cos.html), except that it only accepts a single parameter, *X*, and does not support parameters like *out* or *where* in `numpy.cos`.\n* Equivalent to TA-Lib's `COS` function. The difference is that DolphinDB `cos` accepts scalars, vectors, and matrices as input, whereas TA-Lib `COS` is primarily designed for one-dimensional NumPy arrays and does not support scalar or matrix inputs.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA scalar/vector/matrix of type DOUBLE.\n\n#### Examples\n\n```\ncos 0 1 2;\n// output: [1,0.540302,-0.416147]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html), [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html), [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "cosh": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cosh.html",
        "signatures": [
            {
                "full": "cosh(X)",
                "name": "cosh",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cosh](https://docs.dolphindb.com/en/Functions/c/cosh.html)\n\n\n\n#### Syntax\n\ncosh(X)\n\n#### Details\n\nThe hyperbolic cosine function.\n\n**Note:**\n\n* Equivalent to NumPy's [numpy.cosh](https://numpy.org/doc/stable/reference/generated/numpy.cosh.html), except that it only accepts a single parameter, *X*, and does not support parameters like *out* or *where* in `numpy.cosh`.\n* Equivalent to TA-Lib's `COSH` function. The difference is that DolphinDB `cosh` accepts scalars, vectors, and matrices as input, whereas TA-Lib `COSH` is primarily designed for one-dimensional NumPy arrays and does not support scalar or matrix inputs.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA scalar/vector/matrix of type DOUBLE.\n\n#### Examples\n\n```\ncosh 0 1 2;\n// output: [1,1.543081,3.762196]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html), [tan](https://docs.dolphindb.com/en/Functions/t/tan.html), [asinh](https://docs.dolphindb.com/en/Functions/a/asinh.html), [acosh](https://docs.dolphindb.com/en/Functions/a/acosh.html), [atanh](https://docs.dolphindb.com/en/Functions/a/atanh.html), [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html), [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n"
    },
    "cosine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cosine.html",
        "signatures": [
            {
                "full": "cosine(X, Y)",
                "name": "cosine",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cosine](https://docs.dolphindb.com/en/Functions/c/cosine.html)\n\nFirst introduced in version: 2.00.183.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\ncosine(X, Y)\n\n#### Details\n\nCompute the cosine similarity between *X* and *Y*. The cosine similarity between *X* and *Y*, is defined as (X · Y) / (||X|| × ||Y||).\n\n**Note:** Similar to the [scipy.spatial.distance.cosine](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.cosine.html) function in SciPy, the main difference lies in the following:\n\n* DolphinDB's `cosine` function calculates cosine similarity (the larger the value, the more similar), while SciPy's `scipy.spatial.distance.cosine` calculates cosine distance (the smaller the value, the more similar). The relationship between them is: cosine distance = 1 - cosine similarity.\n* `cosine` only accepts parameters *X* and *Y*, and does not support the weight parameter *w* found in `scipy.spatial.distance.cosine`.\n\n#### Parameters\n\n**X** and **Y** are numeric vectors with the same number of elements.\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\n```\nx = [1, 2, 3]  \ny = [4, 5, 6]  \ncosine(x, y);  \n// output: 0.9746318\n```\n\nRelated functions: [euclidean](https://docs.dolphindb.com/en/Functions/e/euclidean.html), [minkowski](https://docs.dolphindb.com/en/Functions/m/minkowski.html), [seuclidean](https://docs.dolphindb.com/en/Functions/s/seuclidean.html), [mahalanobis](https://docs.dolphindb.com/en/Functions/m/mahalanobis.html)\n"
    },
    "count": {
        "url": "https://docs.dolphindb.com/en/Functions/c/count.html",
        "signatures": [
            {
                "full": "count(X)",
                "name": "count",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [count](https://docs.dolphindb.com/en/Functions/c/count.html)\n\n\n\n#### Syntax\n\ncount(X)\n\n#### Details\n\n[size](https://docs.dolphindb.com/en/Functions/s/size.html) returns the number of elements in a vector or matrix, while `count` returns the number of non-null elements in a vector/matrix. `count` can be used in a SQL query, but `size` cannot. For tables, `size` and `count` both return the number of rows.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA scalar of type INT.\n\n#### Examples\n\n```\ncount(3 NULL 5 6);\n// output: 3\nsize(3 NULL 5 6);\n// output: 4\n\nm=1 2 3 NULL 4 5$2:3;\nm;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 4  |\n| 2  |    | 5  |\n\n```\ncount(m);\n// output: 5\nsize(m);\n// output: 6\n\nt = table(1 NULL 3 as id, 3 NULL 9 as qty);\nt;\n```\n\n| id | qty |\n| -- | --- |\n| 1  | 3   |\n|    |     |\n| 3  | 9   |\n\n```\ncount(t);\n// output: 3\nsize(t);\n// output: 3\n```\n\nIf you need to check the number of rows in a DFS table, you must use `count` inside a SQL query. If you call `count` directly on a DFS table handle, it will always return 0.\n\nCorrect examples:\n\n```\n// Example 1\nt=loadTable(\"dfs://csmar_l2\", `SSEL2_BOND_ORDER)\nselect count(*) from t // Returns a table containing the row count of SSEL2_BOND_ORDER\n// Example 2\nt=loadTable(\"dfs://csmar_l2\", `SSEL2_BOND_ORDER)\nt1=select * from t\nt1.count() // Returns an INT value indicating the row count of SSEL2_BOND_ORDER\n```\n\nIncorrect example:\n\n```\nt = loadTable(\"dfs://csmar_l2\", `SSEL2_BOND_ORDER)\nt.count()   // Returns 0\n```\n"
    },
    "countNanInf": {
        "url": "https://docs.dolphindb.com/en/Functions/c/countNanInf.html",
        "signatures": [
            {
                "full": "countNanInf(X, [includeNull=false])",
                "name": "countNanInf",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[includeNull=false]",
                        "name": "includeNull",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [countNanInf](https://docs.dolphindb.com/en/Functions/c/countNanInf.html)\n\n\n\n#### Syntax\n\ncountNanInf(X, \\[includeNull=false])\n\n#### Details\n\nAn aggregate function that counts the number of NaN values and Inf values in *X*. When *includeNull* = true, the result includes the number of null values.\n\n#### Parameters\n\n**X** is a DOUBLE type scalar, vector or matrix.\n\n**includeNull** (optional) is a BOOLEAN value. The default value is false.\n\n#### Returns\n\nA scalar of type INT.\n\n#### Examples\n\n```\nx = [1.5, float(`nan), 2.3, float(`inf), NULL, 3.7]  \n  \n// includeNull = false (defaule), the result does not include the number of null values  \ncountNanInf(x)  \n// output: 2\n\n// includeNull = true, the result includes the number of null values \ncountNanInf(x,true) \n// output: 3\n```\n\n**Related function**: [isNanInf](https://docs.dolphindb.com/en/Functions/i/isNanInf.html)\n"
    },
    "covar": {
        "url": "https://docs.dolphindb.com/en/Functions/c/covar.html",
        "signatures": [
            {
                "full": "covar(X,Y)",
                "name": "covar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [covar](https://docs.dolphindb.com/en/Functions/c/covar.html)\n\n\n\n#### Syntax\n\ncovar(X,Y)\n\n#### Details\n\nCalculate the covariance of *X* and *Y*.\n\n#### Parameters\n\n**X** and **Y** are vectors/matrices/tables of the same size. If *X* is a table, only the numeric and Boolean columns are calculated.\n\n#### Returns\n\nA scalar/vector of type DOUBLE or a table.\n\n#### Examples\n\n```\nx=7 4 5 8 9 3 3 5 2 6 12 1 0 -5 32\ny=1.1 7 8 9 9 5 4 8.6 2 1 -9 -3 5 8 13\ncovar(x,y);\n// output: 10.881429\n```\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "covarMatrix": {
        "url": "https://docs.dolphindb.com/en/Functions/c/covarMatrix.html",
        "signatures": [
            {
                "full": "covarMatrix(X)",
                "name": "covarMatrix",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [covarMatrix](https://docs.dolphindb.com/en/Functions/c/covarMatrix.html)\n\n\n\n#### Syntax\n\ncovarMatrix(X)\n\n#### Details\n\nReturn a covariance matrix, where the (i, j) entry is the covariance between the columns *i* and *j* of *X*.\n\nNote:\n\n* For a matrix *X* without null values, the result of `covarMatrix(X)` is equivalent to `cross/pcross(covar, X)`, but the performance of function covarMatrix is significantly improved.\n\n* For a matrix with null values, the results of `covarMatrix(X)` and `cross/pcross(covar, X)` are different, because the null values are converted to 0 by default in function `covarMatrix`, but ignored in function `covar`.\n\n#### Parameters\n\n**X** is a matrix.\n\n#### Returns\n\nA matrix of type DOUBLE.\n\n#### Examples\n\n```\nm = rand(10.0, 30)$10:3\ncovarMatrix(m)\n```\n\n| #0                | #1                 | #2                 |\n| ----------------- | ------------------ | ------------------ |\n| 6.116181845352529 | 1.107026927999891  | 1.306707566911273  |\n| 1.107026927999891 | 7.162534080771522  | -0.758517799304199 |\n| 1.306707566911273 | -0.758517799304199 | 5.516744365930221  |\n\n```\na = rand(1.0, 30000000).reshape(10000:3000)\na.rename!(\"s\" + string(1..3000))\n\ntimer covarMatrix(a)\n// Time elapsed: 2927.264 ms\n\ntimer pcross(covar, a)\n// Time elapsed: 29484.85 ms\n```\n\nRelated function: [corrMatrix](https://docs.dolphindb.com/en/Functions/c/corrMatrix.html)\n"
    },
    "covarp": {
        "url": "https://docs.dolphindb.com/en/Functions/c/covarp.html",
        "signatures": [
            {
                "full": "covarp(X, Y)",
                "name": "covarp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ncovarp(X, Y)\n\n#### Details\n\nCalculates the population covariance of *X* and *Y*.\n\n#### Parameters\n\n**X** and **Y** are scalars/vectors/matrices/tables of the same size. If *X* is a table, only the numeric columns are calculated.\n\n#### Returns\n\n* When both *X* and *Y* are scalars or vectors of equal length, a DOUBLE scalar is returned.\n* When either *X* or *Y* is a matrix, a DOUBLE vector is returned.\n* When either *X* or *Y* is a table, a table is returned.\n\n#### Examples\n\n```\nx = [100, 100, 100, 1100]\ny = [0.98, 0.95, 0.92, 0.88]\ncovarp(x,y);\n\n// output: -13.13\n\nx=matrix([0.010,  0.012, -0.005, 0.008], [0.009,  0.011, -0.004, 0.007], [0.011,  0.013, -0.006, 0.009])\ny=[0.008, 0.010, -0.003, 0.006]\ncovarp(x,y)\n\n// output: 3\n\n```\n\n**Related Function:** [covar](https://docs.dolphindb.com/en/Functions/c/covar.html)\n"
    },
    "crc32": {
        "url": "https://docs.dolphindb.com/en/Functions/c/crc32.html",
        "signatures": [
            {
                "full": "crc32(str, [cksum=0])",
                "name": "crc32",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "[cksum=0]",
                        "name": "cksum",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [crc32](https://docs.dolphindb.com/en/Functions/c/crc32.html)\n\n\n\n#### Syntax\n\ncrc32(str, \\[cksum=0])\n\n#### Details\n\nCreate a CRC32 hash from STRING. The result is of data type INT.\n\n#### Parameters\n\n**str** is a STRING scalar/vector.\n\n**cksum** (optional) is an integral scalar/vector. The default value is 0.\n\n#### Returns\n\nA scalar/vector of type INT or a table.\n\n#### Examples\n\n```\na=crc32(`aa`cc,1);\na;\n// output: [512829590,-1029100744]\n\ntypestr(a);\n// output: FAST INT VECTOR\n```\n"
    },
    "createAnomalyDetectionEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createAnomalyDetectionEngine.html",
        "signatures": [
            {
                "full": "createAnomalyDetectionEngine(name, metrics, dummyTable, outputTable, timeColumn, [keyColumn], [windowSize], [step], [garbageSize], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup],[anomalyDescription])",
                "name": "createAnomalyDetectionEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[windowSize]",
                        "name": "windowSize",
                        "optional": true
                    },
                    {
                        "full": "[step]",
                        "name": "step",
                        "optional": true
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[anomalyDescription]",
                        "name": "anomalyDescription",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createAnomalyDetectionEngine](https://docs.dolphindb.com/en/Functions/c/createAnomalyDetectionEngine.html)\n\n\n\n#### Syntax\n\ncreateAnomalyDetectionEngine(name, metrics, dummyTable, outputTable, timeColumn, \\[keyColumn], \\[windowSize], \\[step], \\[garbageSize], \\[roundTime=true], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[raftGroup],\\[anomalyDescription])\n\n#### Details\n\nThis function creates an anomaly detection engine and returns a table object. Data inserted into this table is used to calculate specified metrics to detect anomalies.\n\nNote that the following functions are not supported in metrics: `next`, `talibNull`, `linearTimeTrend`, `iterate`, or aggregate function nested within an order-sensitive function (e.g., `tmsum(sum())`).\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n##### Calculation Rules\n\nThe anomaly detection engine uses different calculation rules for the following 3 types of anomaly metrics:\n\n* Comparison between a column and a constant or between columns. Only non-aggregate functions can be included. For examples: `qty < 4`, `qty > price`, `lt(qty, prev(qty))`, `isNull(qty) == false`, etc. For these metrics, the engine conducts calculations for each row and determines whether to output the result.\n\n* Comparison between aggregate function result and a constant or between aggregate function results. Non-aggregate functions may be used, but their arguments may only include aggregate functions and/or constants, not columns. For examples: `avg(qty - price) > 10`, `percentile(qty, 90) < 100`, `max(qty) < avg(qty) * 2`, `le(sum(qty), 5)`, etc. For these metrics, the engine conducts calculations at frequencies determined by the parameter *step* and determines whether to output the result.\n\n* Comparison between aggregate function result and a column, or non-aggregate functions are used and their arguments include aggregate functions and columns. For examples: `avg(qty) > qty`, `le(med(qty), price)`, etc. For these metrics, the engine conducts calculations at frequencies determined by the parameter *step* and determines whether to output the result.\n\n**Note:**\n\n* If an aggregate function is used in *metrics*, the parameters *windowSize* and *step* must be specified. The anomaly metrics are calculated in a window of *windowSize* at every step. To facilitate observation and comparison of calculation results, the engine automatically adjusts the starting point of the first window. See [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html) for the alignment rules.\n* Processing rules for out-of-order data:\n  * If aggregation is required, the timestamps indicated by *timeColumn* in the input stream table must be non-decreasing. If a grouping column (*keyColumn*) is also specified, the timestamps within each group must be non-decreasing. Otherwise, out-of-order data will be discarded and not included in the computation.\n  * If aggregation is not required, the engine can accept out-of-order data.\n\n##### Other Features:\n\n* Data cleanup: If an aggregate function or order-sensitive function is specified for *metrics*, the engine keeps the historical data. You can specify the parameter *garbageSize* to clean up the data that are no longer needed. If *keyColumn* is specified, data cleanup is performed within each group independently.\n\n* Snapshot: Snapshot mechanism is used to restore the streaming engine to the latest snapshot after system interruption. (See parameters *snapshotDir* and *snapshotIntervalInMsgCount*)\n\n* High availability: To enable high availability for the streaming engines, specify the parameter *raftGroup* on the leader of a raft group on the subscriber. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table.\n\n#### Parameters\n\n**name** is a string indicating the name of the anomaly detection engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores, and must start with a letter.\n\n**metrics** is metacode or tuple specifying the formulas for anomaly detection. It uses functions or expressions such as `<[sum(qty)>5, avg(qty)>qty, qty<4]>` that indicate anomaly conditions and return Boolean values.\n\nNote: The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**dummyTable** is a table object whose schema must be the same as the input table to which the engine subscribes.\n\n**outputTable** is the output table of detected anomalies. It can be an in-memory table or a DFS table. Create an empty table before calling the function.\n\nThe output columns are in the following order:\n\n(1) The first column is of temporal data type and stores the time when an anomaly is detected.\n\n(2) The following column(s) are *keyColumn* (if specified).\n\n(3) Then followed by an INT column indicating the position of the condition in metrics;\n\n(4) And a STRING/SYMBOL column indicating the content of the anomaly conditions or description.\n\n**timeColumn** is a string indicating the name of the temporal column of the input stream table.\n\n**keyColumn** (optional) is a STRING scalar or vector indicating the grouping columns. The anomaly detection engine conducts calculations within each group specified by *keyColumn*.\n\n**windowSize** (optional) is a positive integer indicating the size of window for calculation. Only the left boundary is included in the window.\n\n**step** (optional) is a positive integer indicating the duration between 2 adjacent windows. The value of *windowSize* must be a multiple of *step*.\n\nNote: If aggregate functions are used in *metrics*, parameters *windowSize* and *step* must be specified.\n\n**garbageSize** (optional) is a positive integer. The default value is 2,000 (in Bytes).\n\n* If *keyColumn* is not specified, when the number of historical records in memory exceeds *garbageSize*, the system will clear the records that are no longer needed.\n\n* If *keyColumn* is specified, garbage collection is conducted separately in each group. When the number of historical records in a group exceeds *garbageSize*, the system will clear the records that are no longer needed within the group.\n\nNote that *garbageSize* only takes effect when aggregate function(s) are specified in parameter metrics.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary if the time column is in millisecond or second precision and step is greater than one minute. The default value is true indicating the alignment is based on the multi-minute rule. False means alignment is based on the one-minute rule (See [Alignment Rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)).\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**raftGroup** (optional) is an integer greater than 1, indicating the ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. Specify *raftGroup* to enable high availability on the streaming engine. When an engine is created on the leader, it is also created on each follower and the engine snapshot is synchronized to the 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.\n\n**anomalyDescription** (optional) is a STRING vector, where each element indicates a custom description for the corresponding anomaly condition specified in *metrics*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1: The following example creates a table \"engine\" with `createAnomalyDetectionEngine`, then subscribes to the stream table trades and writes data to the engine. The engine conducts calculations by group based on column sym and saves the results to *outputTable*.\n\n```\nshare streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(1000:0, `time`sym`type`metric, [TIMESTAMP, SYMBOL, INT, STRING]) as outputTable\nengine = createAnomalyDetectionEngine(name=\"anomalyDetection1\", metrics=<[sum(qty) > 5, avg(qty) > qty, qty < 4]>, dummyTable=trades, outputTable=outputTable, timeColumn=`time, keyColumn=`sym, windowSize=3, step=3)\nsubscribeTable(tableName=\"trades\", actionName=\"anomalyDetectionSub1\", offset=0, handler=append!{engine}, msgAsTable=true)\n\ndef writeData(n){\ntimev = 2018.10.08T01:01:01.001 + 1..n\nsymv =take(`A`B, n)\nqtyv = n..1\ninsert into trades values(timev, symv, qtyv)\n}\n\nwriteData(6);\n\nselect * from trades;\n```\n\n| time                    | sym | qty |\n| ----------------------- | --- | --- |\n| 2018.10.08T01:01:01.002 | A   | 6   |\n| 2018.10.08T01:01:01.003 | B   | 5   |\n| 2018.10.08T01:01:01.004 | A   | 4   |\n| 2018.10.08T01:01:01.005 | B   | 3   |\n| 2018.10.08T01:01:01.006 | A   | 2   |\n| 2018.10.08T01:01:01.007 | B   | 1   |\n\n```\nselect * from outputTable;\n```\n\n| time                    | sym | type | metric         |\n| ----------------------- | --- | ---- | -------------- |\n| 2018.10.08T01:01:01.003 | A   | 0    | sum(qty) > 5   |\n| 2018.10.08T01:01:01.004 | A   | 1    | avg(qty) > qty |\n| 2018.10.08T01:01:01.005 | B   | 2    | qty < 4        |\n| 2018.10.08T01:01:01.006 | A   | 1    | avg(qty) > qty |\n| 2018.10.08T01:01:01.006 | A   | 2    | qty < 4        |\n| 2018.10.08T01:01:01.006 | B   | 0    | sum(qty) > 5   |\n| 2018.10.08T01:01:01.007 | B   | 1    | avg(qty) > qty |\n| 2018.10.08T01:01:01.007 | B   | 2    | qty < 4        |\n\nThe calculation process of the anomaly detection engine is explained in details below:\n\n(1) The indicator `sum(qty)>5` represents the comparison between the aggregate result and a constant, the anomaly detection engine checks this indicator during the calculation in each window.\n\n* The first window ranges from 2018.10.08T01:01:01.000 to 2018.10.08T01:01:01.002, and the `sum(qty)` of A and B is calculated respectively. At 2018.10.08T01:01:01.003 the engine starts to judge whether it meets the condition `sum(qty)>5`.\n\n* The second window ranges from 2018.10.08T01:01:01.003 to 2018.10.08T01:01:01.005, at 2018.10.08T01:01:01.006, the engine starts to judge whether it meets the condition `sum(qty)>5`, and so on.\n\n(2) The indicator `avg(qty)>qty` represents the comparison between the aggregate result and a certain column. Therefore, whenever data arrives, the anomaly detection engine compares the data with the aggregate result of the previous window. Until the next aggregation is triggered, the engine checks whether the result meets the conditions and outputs it.\n\n* The first window ranges from 2018.10.08T01:01:01.000 to 2018.10.08T01:01:01.002, the `avg(qty)` of A and B is calculated respectively. Each qty between 2018.10.08T01:01:01.003 and 2018.10.08T01:01:01.005 will be compared with the `avg(qty)` of the previous window.\n\n* The window moves at 2018.10.08T01:01:01.005.\n\n* The second window ranges from 2018.10.08T01:01:01.003 to 2018.10.08T01:01:01.005. In the second window, the `avg(qty)` of A and B is calculated, each qty between 2018.10.08T01:01:01.006 and 2018.10.08T01:01:01.008 will be compared with the `avg(qty)` of the previous window, and so on.\n\n(3) The metric `qty<4` represents the comparison between a column and a constant. Therefore, whenever a new record arrives, the anomaly detection engine compares the value with 4.\n\nExample 2: The following example demonstrates how the *anomalyDescription* parameter works.\n\n```\nshare streamTable(1000:0, `time`temp, [TIMESTAMP, DOUBLE]) as sensordata\nshare streamTable(1000:0, `time`anomalyType`anomalyString, [TIMESTAMP, INT, SYMBOL]) as outputTable\nengine = createAnomalyDetectionEngine(name = \"engineB\", metrics=<[temp > 65, temp > percentile(temp, 75)]>, dummyTable = sensordata, outputTable = outputTable, timeColumn = `time, windowSize = 6, step = 3, anomalyDescription=[\"The temperature is higher than 65°C\", \"The temperature is larger than 75% values of the last window\"])\nsubscribeTable(,tableName = \"sensordata\", actionName = \"sensorAnomalyDetection\", offset = 0, handler = append!{engine}, msgAsTable = true)\n\ntimev = 2018.10.08T01:01:01.001 + 1..10\ntempv = 59 66 57 60 63 51 53 52 56 55\ninsert into sensordata values(timev, tempv)\n\nsleep(10)\nselect * from outputTable\n```\n\n| time                    | anomalyType | anomalyString                                                |\n| ----------------------- | ----------- | ------------------------------------------------------------ |\n| 2018.10.08T01:01:01.003 | 0           | The temperature is higher than 65°C                          |\n| 2018.10.08T01:01:01.003 | 1           | The temperature is larger than 75% values of the last window |\n| 2018.10.08T01:01:01.005 | 1           | The temperature is larger than 75% values of the last window |\n| 2018.10.08T01:01:01.006 | 1           | The temperature is larger than 75% values of the last window |\n"
    },
    "createAsofJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createAsofJoinEngine.html",
        "signatures": [
            {
                "full": "createAsofJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, [timeColumn], [useSystemTime=false], [delayedTime], [garbageSize], [sortByTime], [outputElapsedMicroseconds=false], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createAsofJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[delayedTime]",
                        "name": "delayedTime",
                        "optional": true
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[sortByTime]",
                        "name": "sortByTime",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createAsofJoinEngine](https://docs.dolphindb.com/en/Functions/c/createAsofJoinEngine.html)\n\n\n\n#### Syntax\n\ncreateAsofJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, \\[timeColumn], \\[useSystemTime=false], \\[delayedTime], \\[garbageSize], \\[sortByTime], \\[outputElapsedMicroseconds=false], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\n#### Details\n\nCreate an asof join streaming engine. Streams are ingested into the left table and the right table and joined on *matchingColumn* and *timeColumn* (or system time). For each record in the left table, join it with the right table record (1) with matching *matchingColumn* value and (2) whose timestamp is the last of the timestamps that are less than or equal to the timestamp of the left table record. This function returns a table object holding the asof join results.\n\nAsof join engine joins records that have no exact match on time columns. For each timestamp in one table, the engine obtains the latest (i.e., current as of the timestamp) value from another table.\n\nNote:\n\n* The records in the left table and the right table must be sequenced by time.\n\n* If *delayedTime* is not specified, a join operation is only triggered when the right table receives a record whose timestamp is greater than the timestamp of the latest record in the left table.\n\n* If *delayedTime* is specified, a join operation is triggered when either of the following conditions is met:\n\n  * In the left table, the difference between the timestamp of the latest record and the timestamp of the previous unjoined record is greater than *delayedTime*.\n\n  * The record is still not joined after 2 \\* *delayedTime* or 2 seconds, whichever is larger, since its ingestion into the left table.\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n#### Parameters\n\n**name** is a string indicating the name of the asof join engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**leftTable** and **rightTable** are table objects whose schema must be the same as the stream table to which the engine subscribes. Since version 2.00.11, array vectors are allowed for *leftTable* and *rightTable*.\n\n**outputTable** is a table to which the engine inserts calculation result. It can be an in-memory table or a DFS table. Before calling a function, an empty table with specified column names must be created.Since version 2.00.11, array vectors are allowed for *outputTable*.\n\nThe columns of *outputTable* are in the following order:\n\n(1) The first column must be a temporal column.\n\n* if *useSystemTime* = true, the data type must be TIMESTAMP;\n\n* if *useSystemTime* = false, it has the same data type as *timeColumn*.\n\n(2) Then followed by one or more columns on which the tables are joined, arranged in the same order as specified in *matchingColumn*.\n\n(3) Further followed by one or more columns which are the calculation results of *metrics*.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://test.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions), or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n* *metrics* can be functions with multiple returns and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\n* To specify a column that exists in both the left and the right tables, use the format *tableName.colName*.\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**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.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the columns are named \"orderNo\" and \"sym\" in the left table, whereas in the right table they're named \"orderNo\" and \"sym1\", then *matchingColumn* = \\[\\[\\`orderNo, \\`sym], \\[\\`orderNo,\\`sym1]].\n\n**timeColumn** (optional) specifies the name of the time column in the left table and the right table. The time columns must have the same data type. When *useSystemTime* = false, it must be specified. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**useSystemTime** (optional) indicates whether the left table and the right table are joined on the system time, instead of on *timeColumn*.\n\n* *useSystemTime* = true: join records based on the system time (timestamp with millisecond precision) when they are ingested into the engine.\n* *useSystemTime* = false (default): join records based on the specified \\*timeColumn\\* from the left table and the right table.\n\n**delayedTime** (optional) is a positive integer with the same precision as *timeColumn*, indicating the maximum time to wait before the engine joins an uncalculated record in the left table with a right table record. To specify *delayedTime*, *timeColumn* must be specified. For more information, see Details.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (rows). As the subscribed data is ingested into the engine, it continues to take up the memory. Within the left/right table, the records are grouped by *matchingColumn* values; When the number of records in a group exceeds *garbageSize*, the system will remove those already been calculated from memory.\n\n**sortByTime** (optional) is a Boolean value that indicates whether the output data is globally sorted by time. The default value is false, meaning the output data is sorted only within groups. Note that if *sortByTime* is set to true, the parameter *delayedTime* cannot be specified, and the data input to the left and right tables must be globally sorted.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades\nshare streamTable(1:0, `time`sym`bid`ask, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE]) as quotes\nshare table(100:0, `time`sym`price`bid`ask`spread, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE, DOUBLE]) as prevailingQuotes\n\najEngine=createAsofJoinEngine(name=\"aj1\", leftTable=trades, rightTable=quotes, outputTable=prevailingQuotes, metrics=<[price, bid, ask, abs(price-(bid+ask)/2)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false)\ntmp1=table(2020.08.27T09:30:00.000+2 8 20 22 23 24 as time, take(`A`B, 6) as sym, 20.01 20.04 20.07 20.08 20.4 20.5 as price)\ntmp2=table(2020.08.27T09:30:00.000+1 5 6 11 19 20 21 as time, take(`A`B, 7) as sym, 20 20.02 20.03 20.05 20.06 20.6 20.4 as bid,  20.01 20.03 20.04 20.06 20.07 20.5 20.6 as ask)\ntmp1.sortBy!(`time)\ntmp2.sortBy!(`time)\n\nsubscribeTable(tableName=\"trades\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{ajEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"quotes\", actionName=\"joinRight\", offset=0, handler=appendForJoin{ajEngine, false}, msgAsTable=true)\n\ntrades.append!(tmp1)\nquotes.append!(tmp2)\n\nsleep(100)\nselect time, sym, bid from prevailingQuotes\n\n/* output\ntime\tsym\tbid\n2020.08.27T09:30:00.002\tA\t20\n2020.08.27T09:30:00.020\tA\t20.06\n2020.08.27T09:30:00.008\tB\t20.02\n*/\n```\n\n```\n// clean environment\nunsubscribeTable(tableName=\"trades\", actionName=\"joinLeft\")\nunsubscribeTable(tableName=\"quotes\", actionName=\"joinRight\")\nundef(`trades,SHARED)\nundef(`quotes,SHARED)\ndropAggregator(name=\"aj1\")\n\n//define an asof join engine and set sortByTime=true\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades\nshare streamTable(1:0, `time`sym`bid`ask, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE]) as quotes\nshare table(100:0, `time`sym`price`bid`ask`spread, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE, DOUBLE]) as prevailingQuotes\najEngine=createAsofJoinEngine(name=\"aj1\", leftTable=trades, rightTable=quotes, outputTable=prevailingQuotes, metrics=<[price, bid, ask, abs(price-(bid+ask)/2)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false, sortByTime=true)\n\ntmp1=table(2020.08.27T09:30:00.000+2 8 20 22 23 24 as time, take(`A`B, 6) as sym, 20.01 20.04 20.07 20.08 20.4 20.5 as price)\ntmp2=table(2020.08.27T09:30:00.000+1 5 6 11 19 20 21 as time, take(`A`B, 7) as sym, 20 20.02 20.03 20.05 20.06 20.6 20.4 as bid,  20.01 20.03 20.04 20.06 20.07 20.5 20.6 as ask)\ntmp1.sortBy!(`time)\ntmp2.sortBy!(`time)\n\n//only appendForJoin can be used to insert data\nsubscribeTable(tableName=\"trades\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{ajEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"quotes\", actionName=\"joinRight\", offset=0, handler=appendForJoin{ajEngine, false}, msgAsTable=true)\n\ntrades.append!(tmp1)\nquotes.append!(tmp2)\n\nsleep(100)\n\n//check the output table\nselect time, sym, bid from prevailingQuotes\n\n/* output\ntime                   sym   bid\n2020.08.27T09:30:00.002      A       20\n2020.08.27T09:30:00.008      B       20.02\n2020.08.27T09:30:00.020      A       20.06\n*/\n```\n"
    },
    "createCatalog": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createCatalog.html",
        "signatures": [
            {
                "full": "createCatalog(catalog)",
                "name": "createCatalog",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    }
                ]
            }
        ],
        "markdown": "### [createCatalog](https://docs.dolphindb.com/en/Functions/c/createCatalog.html)\n\n#### Syntax\n\ncreateCatalog(catalog)\n\n#### Details\n\nCreate a catalog.\n\n#### Parameters\n\n**catalog**is a string specifying the catalog name.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ncreateCatalog(\"cat1\")\n```\n\n"
    },
    "createCrossSectionalAggregator": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createCrossSectionalAggregator.html",
        "signatures": [
            {
                "full": "createCrossSectionalEngine(name, [metrics], dummyTable, [outputTable], keyColumn, [triggeringPattern='perBatch'], [triggeringInterval=1000], [useSystemTime=true], [timeColumn], [lastBatchOnly=false], [contextByColumn], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup], [outputElapsedMicroseconds=false], [roundTime=true], [keyFilter], [updatedContextGroupsOnly=false])",
                "name": "createCrossSectionalEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[metrics]",
                        "name": "metrics",
                        "optional": true
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "[outputTable]",
                        "name": "outputTable",
                        "optional": true
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[triggeringPattern='perBatch']",
                        "name": "triggeringPattern",
                        "optional": true,
                        "default": "'perBatch'"
                    },
                    {
                        "full": "[triggeringInterval=1000]",
                        "name": "triggeringInterval",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[useSystemTime=true]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[lastBatchOnly=false]",
                        "name": "lastBatchOnly",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[contextByColumn]",
                        "name": "contextByColumn",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[keyFilter]",
                        "name": "keyFilter",
                        "optional": true
                    },
                    {
                        "full": "[updatedContextGroupsOnly=false]",
                        "name": "updatedContextGroupsOnly",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createCrossSectionalAggregator](https://docs.dolphindb.com/en/Functions/c/createCrossSectionalAggregator.html)\n\nAlias for [createCrossSectionalEngine](https://docs.dolphindb.com/en/Functions/c/createCrossSectionalEngine.html)\n\n\nDocumentation for the `createCrossSectionalEngine` function:\n### [createCrossSectionalEngine](https://docs.dolphindb.com/en/Functions/c/createCrossSectionalEngine.html)\n\n\n\n#### Syntax\n\ncreateCrossSectionalEngine(name, \\[metrics], dummyTable, \\[outputTable], keyColumn, \\[triggeringPattern='perBatch'], \\[triggeringInterval=1000], \\[useSystemTime=true], \\[timeColumn], \\[lastBatchOnly=false], \\[contextByColumn], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[raftGroup], \\[outputElapsedMicroseconds=false], \\[roundTime=true], \\[keyFilter], \\[updatedContextGroupsOnly=false])\n\nAlias: createCrossSectionalAggregator\n\n#### Details\n\nThis function creates a cross-sectional streaming engine and returns a keyed table with *keyColumn* as the key.\n\nThe keyed table is updated every time a new record arrives. If the parameter *lastBatchOnly* is set to true, the table only maintains the latest record in each group. When new data is ingested into the engine,\n\n* if *metrics* and *outputTable* are specified, the engine first updates the keyed table, then performs calculations on the latest data and outputs the results to *outputTable*.\n\n* if *metrics* and *outputTable* are not specified, the engine only updates the keyed table.\n\n##### Calculation Rules\n\nThe calculation can be triggered by the number of records or time interval. If *triggeringPattern* is set to \"keyCount\", the timestamps indicated by *timeColumn* in the input stream table must be non-decreasing. If a grouping column (*keyColumn*) is also specified, the timestamps within each group must be non-decreasing. Otherwise, out-of-order data will be discarded and not included in the computation. For details, refer to the descriptions of the `triggeringPattern` and `triggeringInterval` parameters.\n\n**Note:** If *contextByColumn* is specified, the data will be grouped by the specified columns and calculated by group.\n\n##### Features\n\n* Snapshot: Snapshot mechanism is used to restore the streaming engine to the latest snapshot after system interruption. (See parameters *snapshotDir* and *snapshotIntervalInMsgCount*)\n\n* High availability: To enable high availability for streaming engines, specify the parameter *raftGroup* on the leader of the raft group on the subscriber. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table.\n\n#### Parameters\n\n**name** is a string of the engine name. It is the only identifier of a cross sectional engine on a data/compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**metrics** (optional) is metacode or a tuple specifying the formulas for calculation. It can be:\n\n* Built-in or user-defined aggregate functions, e.g., `<[sum(qty), avg(price)]>`; Or expressions on previous results, e.g., `<[avg(price1)-avg(price2)]>`; Or calculation on multiple columns, e.g., `<[std(price1-price2)]>`\n\n* Functions with multiple returns, such as `<func(price) as `col1`col2>`. The column names can be specified or not. For more information about metacode, see [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter. For versions 2.00.14/3.00.2 and later, *dummyTable* can include array vector columns.\n\n**outputTable** (optional) is the output table for the results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function. Make sure that data types of columns storing calculation results are the same as the results of metrics. The output columns are in the following order:\n\n(1) The first column is of TIMESTAMP type.\n\n* If *useSystemTime* = true, the column stores the time when each calculation starts;\n\n* If *useSystemTime* = false, it takes the values of *timeColumn*.\n\n(2) The following column is the *contextByColumn* (if specified).\n\n(3) If the *outputElapsedMicroseconds* is set to true, specify two more columns: a LONG column and an INT column.\n\n(4) The remaining columns store the calculation results of metrics.\n\n**keyColumn** is a STRING scalar or vector that specifies one or more columns in the stream table as the key columns. For each unique value in the *keyColumn*, only the latest record is used in the calculation.\n\n**triggeringPattern** (optional) is a STRING scalar specifying how to trigger the calculations. The engine returns a result every time a calculation is triggered. It can take one of the following values:\n\n* 'perBatch' (default): calculates when a batch of data arrives.\n\n* 'perRow': calculates when a new record arrives.\n\n* 'interval': calculates at intervals specified by *triggeringInterval*, using system time.\n\n* 'keyCount': When data with the same timestamp arrives in batches, the calculation is triggered when:\n\n  * if the number of keys with the latest timestamp reaches *triggeringInterval*;\n\n  * or data with newer timestamp arrives.\n\n* 'dataInterval': calculates at intervals based on timestamps in the data. To use this, *timeColumn* must be specified and *useSystemTime* must be false.\n\nNote: To set *triggeringPattern* as 'keyCount', *timeColumn* must be specified and *useSystemTime* must be set to false. In this case, the out-of-order data will be discarded.\n\n**triggeringInterval** (optional) can be an integer or a tuple. Below explains its optional values and triggering rules:\n\n* If *triggeringPattern* = 'interval', *triggeringInterval* is a positive integer indicating the interval in milliseconds between 2 adjacent calculations. The default value is 1,000. Every *triggeringInterval* milliseconds, the system checks if the data in the engine has been calculated; if not, a calculation is triggered.\n\n* If *triggeringPattern* = 'keyCount', *triggeringInterval* can be:\n\n  * an integer specifying a threshold. Before data with a greater timestamp arrives, a calculation is triggered when the number of uncalculated records reaches the threshold.\n\n  * a tuple of 2 elements. The first element is an integer indicating the threshold of the number records with the latest timestamp to trigger calculation. The second element is an integer or duration value.\n\n  For example, when *triggeringInterval* is set to (c1, c2):\n\n  * If c2 is an integer and the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system goes on to save data with greater 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 greater timestamp t3 (t3>t2) arrives. Note that c2 must be smaller than c1.\n\n  * If c2 is a duration and the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system goes on to save data with greater 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 greater timestamp t3 (t3>t2) arrives, or the duration c2 comes to an end.\n\n* If *triggeringPattern*= 'dataInterval', *triggeringInterval* is a positive integer measured in the same units as the timestamps in *timeColumn*. The default is 1,000. Starting with the first record, a window is started at intervals defined by *triggeringInterval*, based on the timestamp units. When the first record of the next window arrives, a calculation is triggered on all data in the current window.\n\n  * In versions 2.00.11.21.30.23.2 and earlier, a calculation is triggered for each window.\n\n  * Since version 2.00.11.31.30.23.3, a calculation is triggered only for windows containing data.\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* If *useSystemTime* = true, the time column of outputTable is the system time;\n\n* If *useSystemTime* = false, the parameter timeColumn must be specified. The time column of *outputTable* uses the timestamp of each record.\n\n**timeColumn** (optional) is a STRING scalar which specifies the time column in the stream table to which the engine subscribes if *useSystemTime* = false. It can only be of TIMESTAMP type.\n\n**lastBatchOnly** (optional) is a Boolean value indicating whether to keep only the records with the latest timestamp in the engine. When *lastBatchOnly* = true, *triggeringPattern* must take the value 'keyCount', and the cross-sectional engine only maintains key values with the latest timestamp for calculation. Otherwise, the engine updates and retains all values for calculation.\n\n**contextByColumn** (optional) is a STRING scalar or vector indicating the grouping column(s) based on which calculations are performed by group. This parameter only takes effect if *metrics* and *outputTable* are specified. If *metrics* only contains aggregate functions, the calculation results would be the same as a SQL query using `group by`. Otherwise, the results would be consistent with that using `context by`.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**raftGroup** (optional) is an integer greater than 1, indicating ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. Specify *raftGroup* to enable high availability for the streaming engines. When an engine is created on the leader, it is also created on each follower and the engine snapshot is synchronized to the 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.\n\n**outputElapsedMicroseconds** (optional) is a Boolean value. The default value is false. It determines whether to output:\n\n* the elapsed time (in microseconds) from the ingestion of data to the output of result in each batch.\n\n* the total row number of each batch.\n\n**Note**: When both *outputElapsedMicroseconds*and *useSystemTime*parameters are set to true, aggregate function cannot be used in *metrics*.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary when *triggeringPattern*='dataInterval'. The default value is true indicating the alignment is based on the multi-minute rule (see the [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.md#) of time-series engine). False means alignment is based on the one-minute rule.\n\n**keyFilter** (optional) is metacode of an expression or function call that returns a Boolean vector. It specifies the conditions for filtering keys in the keyed table returned by the engine. Only data with keys satisfying the filtering conditions will be taken for calculation.\n\n**updatedContextGroupsOnly** (optional) is a Boolean scalar indicating whether to compute only the groups that have been updated with new data since the last output. Defaults to false.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1. A table \"csEngine1\" is created with function `createCrossSectionalEngine` and it subscribes to the stream table trades1. We set *triggeringPattern* to 'perRow', so each row that is inserted into table csEngine1 triggers a calculation.\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades1\nshare table(1:0, `time`avgPrice`volume`dollarVolume`count, [TIMESTAMP,DOUBLE,INT,DOUBLE,INT]) as outputTable\ncsEngine1=createCrossSectionalEngine(name=\"csEngineDemo1\", metrics=<[avg(price), sum(volume), sum(price*volume), count(price)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perRow\", useSystemTime=false, timeColumn=`time)\nsubscribeTable(tableName=\"trades1\", actionName=\"tradesStats\", offset=-1, handler=append!{csEngine1}, msgAsTable=true)\ninsert into trades1 values(2020.08.12T09:30:00.000 + 123 234 456 678 890 901, `A`B`A`B`B`A, 10 20 10.1 20.1 20.2 10.2, 20 10 20 30 40 20);\n\nselect * from trades1;\n```\n\n| time                    | sym | price | volume |\n| ----------------------- | --- | ----- | ------ |\n| 2020.08.12T09:30:00.123 | A   | 10    | 20     |\n| 2020.08.12T09:30:00.234 | B   | 20    | 10     |\n| 2020.08.12T09:30:00.456 | A   | 10.1  | 20     |\n| 2020.08.12T09:30:00.678 | B   | 20.1  | 30     |\n| 2020.08.12T09:30:00.890 | B   | 20.2  | 40     |\n| 2020.08.12T09:30:00.901 | A   | 10.2  | 20     |\n\n```\nselect * from outputTable;\n```\n\n| time                    | avgPrice | volume | dollarVolume | count |\n| ----------------------- | -------- | ------ | ------------ | ----- |\n| 2020.08.12T09:30:00.123 | 10       | 20     | 200          | 1     |\n| 2020.08.12T09:30:00.234 | 15       | 30     | 400          | 2     |\n| 2020.08.12T09:30:00.456 | 15.05    | 30     | 402          | 2     |\n| 2020.08.12T09:30:00.678 | 15.1     | 50     | 805          | 2     |\n| 2020.08.12T09:30:00.890 | 15.15    | 60     | 1010         | 2     |\n| 2020.08.12T09:30:00.901 | 15.2     | 60     | 1012         | 2     |\n\nExample 2. When*triggeringPattern* is set to 'perBatch', insert 2 batches of data.\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades2\nshare table(1:0, `time`avgPrice`volume`dollarVolume`count, [TIMESTAMP,DOUBLE,INT,DOUBLE,INT]) as outputTable\ncsEngine2=createCrossSectionalEngine(name=\"csEngineDemo2\", metrics=<[avg(price), sum(volume), sum(price*volume), count(price)]>, dummyTable=trades2, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perBatch\", useSystemTime=false, timeColumn=`time)\nsubscribeTable(tableName=\"trades2\", actionName=\"tradesStats\", offset=-1, handler=append!{csEngine2}, msgAsTable=true)\ninsert into trades2 values(2020.08.12T09:30:00.000 + 123 234 456, `A`B`A, 10 20 10.1, 20 10 20);\nsleep(1)\ninsert into trades2 values(2020.08.12T09:30:00.000 + 678 890 901, `B`B`A, 20.1 20.2 10.2, 30 40 20);\n\nselect * from outputTable;\n```\n\n| time                    | avgPrice | volume | dollarVolume | count |\n| ----------------------- | -------- | ------ | ------------ | ----- |\n| 2020.08.12T09:30:00.456 | 15.05    | 30     | 402          | 2     |\n| 2020.08.12T09:30:00.901 | 15.2     | 60     | 1012         | 2     |\n\nExample 3. The following example sets *triggeringPattern* to 'keyCount' and *lastBatchOnly* to true. Only the data with the latest timestamp will participate in calculation. Since there are both aggregate and non-aggregate functions set in metrics, the number of rows in the result table will be the same as that in the input table.\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades1\nshare table(1:0, `time`factor1`factor2, [TIMESTAMP, DOUBLE,INT]) as outputTable\nagg=createCrossSectionalEngine(name=\"csEngineDemo4\", metrics=<[price+ 0.1, sum(volume)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"keyCount\", triggeringInterval=5, useSystemTime=false, timeColumn=`time,lastBatchOnly=true)\nsubscribeTable(tableName=`trades1, actionName=\"csEngineDemo4\", msgAsTable=true, handler=append!{agg})\nnum=10\ntime=array(TIMESTAMP)\ntime=take(2018.01.01T09:30:00.000,num)\nsym=take(\"A\"+string(1..10),num)\nprice=1..num\nvolume=1..num\ntmp=table(time, sym, price, volume)\ntrades1.append!(tmp)\n\n// Only the latest 5 records will participate in calculation.\nnum=5\ntime = array(TIMESTAMP)\ntime=take(2018.01.01T09:30:01.000,num)\nsym=take(\"A\"+string(1..10),num)\nprice=6..10\nvolume=6..10\ntmp=table(time, sym, price, volume)\ntrades1.append!(tmp)\n```\n\n| time                    | factor1 | factor2 |\n| ----------------------- | ------- | ------- |\n| 2018.01.01T09:30:00.000 | 1.1     | 55      |\n| 2018.01.01T09:30:00.000 | 2.1     | 55      |\n| 2018.01.01T09:30:00.000 | 3.1     | 55      |\n| 2018.01.01T09:30:00.000 | 4.1     | 55      |\n| 2018.01.01T09:30:00.000 | 5.1     | 55      |\n| 2018.01.01T09:30:00.000 | 6.1     | 55      |\n| 2018.01.01T09:30:00.000 | 7.1     | 55      |\n| 2018.01.01T09:30:00.000 | 8.1     | 55      |\n| 2018.01.01T09:30:00.000 | 9.1     | 55      |\n| 2018.01.01T09:30:00.000 | 10.1    | 55      |\n| 2018.01.01T09:30:01.000 | 6.1     | 40      |\n| 2018.01.01T09:30:01.000 | 7.1     | 40      |\n| 2018.01.01T09:30:01.000 | 8.1     | 40      |\n| 2018.01.01T09:30:01.000 | 9.1     | 40      |\n| 2018.01.01T09:30:01.000 | 10.1    | 40      |\n\nExample 4. Set *triggeringPattern* to 'interval' and *triggeringInterval* to 500 (milliseconds).\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades3\nshare table(1:0, `time`avgPrice`volume`dollarVolume`count, [TIMESTAMP,DOUBLE,INT,DOUBLE,INT]) as outputTable\ncsEngine3=createCrossSectionalEngine(name=\"csEngineDemo3\", metrics=<[avg(price), sum(volume), sum(price*volume), count(price)]>, dummyTable=trades3, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"interval\", triggeringInterval=500)\nsubscribeTable(tableName=\"trades3\", actionName=\"tradesStats\", offset=-1, handler=append!{csEngine3}, msgAsTable=true);\n\ninsert into trades3 values(2020.08.12T09:30:00.000, `A, 10, 20)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 500, `B, 20, 10)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 1000, `A, 10.1, 20)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 2000, `B, 20.1, 30)\nsleep(500)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 2500, `B, 20.2, 40)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 3000, `A, 10.2, 20);\nsleep(500)\n\nselect * from outputTable;\n```\n\n| time                    | avgPrice | volume | dollarVolume | count |\n| ----------------------- | -------- | ------ | ------------ | ----- |\n| 2022.03.02T11:17:02.341 | 15.1     | 50     | 805          | 2     |\n| 2022.03.02T11:17:02.850 | 15.2     | 60     | 1,012        | 2     |\n\nThe calculation is triggered every 500 ms based on the system time. Only the records with the latest timestamp participate in the calculation, even if there are multiple uncalculated records with the same key.\n\nIn the above example, the table returned by cross sectional engine is usually an intermediate result for the calculation. But it can also be a final result. For example, if you need to regularly refresh the latest trading price of a certain stock, the basic way is to filter the stocks by code from the real-time trading table and retrieve the last record. However, the amount of data in the trading table is growing rapidly over time. For frequent queries, it is not the best practice in terms of system resource consumption or query performance. The cross sectional table only saves the latest transaction data of all stocks, the data amount is stable. So it is very suitable for the timing polling scenario.\n\nTo use a cross sectional table as a final result, you need to set *metrics* and *outputTable* to be empty.\n\n```\ntradesCrossEngine=createCrossSectionalEngine(name=\"CrossSectionalDemo\", dummyTable=trades, keyColumn=`sym, triggeringPattern=`perRow)\n```\n\nExample 5. Group data by volume and trigger computation each time new data arrives.\n\n```\ntry{dropStreamEngine(`csEngineDemo)}catch(ex){}\ntry{dropStreamTable(`trades1)}catch(ex){}\n\nshare streamTable(10:0,`time`sym`price`volume,[SECOND,SYMBOL,DOUBLE,INT]) as trades1\noutputTable = table(1:0, `time`volume`factor1`factor2, [SECOND, INT, DOUBLE, DOUBLE])\nagg1=createCrossSectionalEngine(name=\"csEngineDemo\", metrics=<[avg(price), sum(volume)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perRow\",useSystemTime=false, timeColumn=`time, outputElapsedMicroseconds=false, contextByColumn=`volume, updatedContextGroupsOnly=false)\nnum=4\ntime = take(09:30:00, num)\nsym= take(`A1`B1`C1`D1, num)\nprice=rand(100.0, num)\nvolume=take(1 1 2 2, num)\ntmp=table(time, sym, price, volume)\nagg1.append!(tmp)\noutputTable\n```\n\nWhen *updatedContextGroupsOnly* = false, the engine does not check if the data in each group has been updated. Every time a record is inserted, it triggers the computation and output for all groups. The result table contains 6 records:\n\n| time     | volume | factor1 | factor2 |\n| -------- | ------ | ------- | ------- |\n| 09:30:00 | 1      | 82.3447 | 1       |\n| 09:30:00 | 1      | 69.9793 | 2       |\n| 09:30:00 | 1      | 69.9793 | 2       |\n| 09:30:00 | 2      | 95.262  | 2       |\n| 09:30:00 | 1      | 69.9793 | 2       |\n| 09:30:00 | 2      | 80.5988 | 4       |\n\n```\ntry{dropStreamEngine(`csEngineDemo)}catch(ex){}\ntry{dropStreamTable(`trades1)}catch(ex){}\n\nshare streamTable(10:0,`time`sym`price`volume,[SECOND,SYMBOL,DOUBLE,INT]) as trades1\noutputTable = table(1:0, `time`volume`factor1`factor2, [SECOND, INT, DOUBLE, DOUBLE])\nagg1=createCrossSectionalEngine(name=\"csEngineDemo\", metrics=<[avg(price), sum(volume)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perRow\",useSystemTime=false, timeColumn=`time, outputElapsedMicroseconds=false, contextByColumn=`volume, updatedContextGroupsOnly=true)\nnum=4\ntime = take(09:30:00, num)\nsym= take(`A1`B1`C1`D1, num)\nprice=rand(100.0, num)\nvolume=take(1 1 2 2, num)\ntmp=table(time, sym, price, volume)\nagg1.append!(tmp)\noutputTable\n```\n\nWhen *updatedContextGroupsOnly* = true, the engine only computes the groups with updated data in this insertion. The result table contains 4 records:\n\n| time     | volume | factor1 | factor2 |\n| -------- | ------ | ------- | ------- |\n| 09:30:00 | 1      | 54.6926 | 1       |\n| 09:30:00 | 1      | 40.5904 | 2       |\n| 09:30:00 | 2      | 73.1741 | 2       |\n| 09:30:00 | 2      | 46.0153 | 4       |\n\nExample 7. Set *triggeringPattern*=\"dataInterval\", *triggeringInterval*, and *outputElapsedMicroseconds*\n\nIn this example, the cross-sectional engine maintains the latest state for each branch by branchId and outputs cross-sectional aggregate results in 1-minute windows.\n\n```\nshare streamTable(1:0, `quoteTime`branchId`marginUsed`riskRate, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE]) as snapshot\nshare table(100:0, `time`totalMarginUsed`avgRiskRate`elapsedUs`batchRows, [TIMESTAMP, DOUBLE, DOUBLE, LONG, INT]) as outputTable\n\nengine = createCrossSectionalEngine(\n   name=\"csDataIntervalDemo\",\n   metrics=<[sum(marginUsed), avg(riskRate)]>,\n   dummyTable=snapshot,\n   outputTable=outputTable,\n   keyColumn=`branchId,\n   triggeringPattern=\"dataInterval\",\n   triggeringInterval=60000,\n   useSystemTime=false,\n   timeColumn=`quoteTime,\n   outputElapsedMicroseconds=true\n)\n\nsubscribeTable(tableName=`snapshot, actionName=\"csDataIntervalDemo\", msgAsTable=true, handler=append!{engine})\n\ninsert into snapshot values(2024.06.03T09:30:00.000, `BJ01, 12000000.0, 0.42)\ninsert into snapshot values(2024.06.03T09:30:10.000, `SH02, 12000000.0, 0.55)\ninsert into snapshot values(2024.06.03T09:30:40.000, `SZ03, 9800000.0, 0.37)\ninsert into snapshot values(2024.06.03T09:31:05.000, `BJ01, 12300000.0, 0.44)\n\nsleep(500)\n\nselect * from outputTable\n```\n\nThe output may look like this:\n\n| time                    | totalMarginUsed | avgRiskRate | elapsedUs | batchRows |\n| ----------------------- | --------------- | ----------- | --------- | --------- |\n| 2024.06.03 09:31:00.000 | 33,800,000      | 0.4466667   | 3         | 1         |\n\n* *triggeringPattern*=\"dataInterval\" indicates that computation is triggered based on time intervals. In this example, *triggeringInterva*l=60000, so the window is 1 minute.\n\n* The record at 2024.06.03T09:31:05.000 is the first record to arrive after the window ends, so it triggers computation and output for the previous window \\[09:30:00, 09:31:00); it does not itself participate in this output.\n\n* Within the first window, the latest state of each branch is as follows:\n\n  * BJ01: marginUsed=12000000; riskRate=0.42\n\n  * SH02: marginUsed=12000000; riskRate=0.55\n\n  * SZ03: marginUsed=9800000; riskRate=0.37\n\nTherefore, totalMarginUsed=33,800,000 and avgRiskRate=(0.42+0.55+0.37)/3=0.4466667.\n\n* After setting *outputElapsedMicroseconds*=true, the output table must include a LONG column and an INT column after the metric column to record the elapsed time for this output and the batch row count, respectively.\n\n* elapsedUs varies with the deployment environment and workload.\n\nExample 8. Use *roundTime* and *triggeringPattern*=\"dataInterval\" to control how windows are aligned.\n\nThis example simulates inventory snapshots for retail stores. The two engines differ only in their *roundTime* setting; all other parameters are identical. They are used to compare the boundary differences of the first window.\n\n```\nshare streamTable(1:0, `eventTime`sku`onHandQty, [TIMESTAMP, SYMBOL, INT]) as inventory\nshare table(100:0, `time`totalOnHandQty, [TIMESTAMP, INT]) as outputRTTrue\nshare table(100:0, `time`totalOnHandQty, [TIMESTAMP, INT]) as outputRTFalse\n\nengineRTTrue = createCrossSectionalEngine(\n   name=\"engineRTTrue\",\n   metrics=<[sum(onHandQty)]>,\n   dummyTable=inventory,\n   outputTable=outputRTTrue,\n   keyColumn=`sku,\n   triggeringPattern=\"dataInterval\",\n   triggeringInterval=120000,\n   useSystemTime=false,\n   timeColumn=`eventTime,\n   roundTime=true\n)\n\nengineRTFalse = createCrossSectionalEngine(\n   name=\"engineRTFalse\",\n   metrics=<[sum(onHandQty)]>,\n   dummyTable=inventory,\n   outputTable=outputRTFalse,\n   keyColumn=`sku,\n   triggeringPattern=\"dataInterval\",\n   triggeringInterval=120000,\n   useSystemTime=false,\n   timeColumn=`eventTime,\n   roundTime=false\n)\n\nsubscribeTable(tableName=\"inventory\", actionName=\"engineRTTrue\", offset=0, handler=append!{engineRTTrue}, msgAsTable=true)\nsubscribeTable(tableName=\"inventory\", actionName=\"engineRTFalse\", offset=0, handler=append!{engineRTFalse}, msgAsTable=true)\n\ninsert into inventory values(2024.06.03T10:03:30.500, `SKU1001, 120)\ninsert into inventory values(2024.06.03T10:04:20.000, `SKU2008, 80)\ninsert into inventory values(2024.06.03T10:05:10.000, `SKU3012, 60)\n\n```\n\nFor the engine with *roundTime*=true, run `select * from outputRTTrue`. The output is as follows:\n\n| time                    | totalOnHandQty |\n| ----------------------- | -------------- |\n| 2024.06.03 10:04:00.000 | 120            |\n\nFor the engine with *roundTime*=false, run `select * from outputRTFalse`. The output is as follows:\n\n| time                    | totalOnHandQty |\n| ----------------------- | -------------- |\n| 2024.06.03 10:05:00.000 | 200            |\n\n* In this example, *triggeringPattern*=\"dataInterval\" and *triggeringInterval*=120000, meaning the window is 2 minutes.\n\n* The timestamp of the first record is 2024.06.03T10:03:30.500.\n\n* When *roundTime*=true, the first window is aligned to a 2-minute boundary, so it is \\[10:02:00, 10:04:00). Therefore, only SKU1001=120 falls into the first window; when the data at 10:04:20.000 arrives, it triggers output, and the result is 120.\n\n* When *roundTime*=false, the first window is aligned to a 1-minute boundary, so it is \\[10:03:00, 10:05:00). Therefore, both SKU1001=120 and SKU2008=80 fall into the first window; when the data at 10:05:10.000 arrives, it triggers output, and the result is 200.\n"
    },
    "createCrossSectionalEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createCrossSectionalEngine.html",
        "signatures": [
            {
                "full": "createCrossSectionalEngine(name, [metrics], dummyTable, [outputTable], keyColumn, [triggeringPattern='perBatch'], [triggeringInterval=1000], [useSystemTime=true], [timeColumn], [lastBatchOnly=false], [contextByColumn], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup], [outputElapsedMicroseconds=false], [roundTime=true], [keyFilter], [updatedContextGroupsOnly=false])",
                "name": "createCrossSectionalEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[metrics]",
                        "name": "metrics",
                        "optional": true
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "[outputTable]",
                        "name": "outputTable",
                        "optional": true
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[triggeringPattern='perBatch']",
                        "name": "triggeringPattern",
                        "optional": true,
                        "default": "'perBatch'"
                    },
                    {
                        "full": "[triggeringInterval=1000]",
                        "name": "triggeringInterval",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[useSystemTime=true]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[lastBatchOnly=false]",
                        "name": "lastBatchOnly",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[contextByColumn]",
                        "name": "contextByColumn",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[keyFilter]",
                        "name": "keyFilter",
                        "optional": true
                    },
                    {
                        "full": "[updatedContextGroupsOnly=false]",
                        "name": "updatedContextGroupsOnly",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createCrossSectionalEngine](https://docs.dolphindb.com/en/Functions/c/createCrossSectionalEngine.html)\n\n\n\n#### Syntax\n\ncreateCrossSectionalEngine(name, \\[metrics], dummyTable, \\[outputTable], keyColumn, \\[triggeringPattern='perBatch'], \\[triggeringInterval=1000], \\[useSystemTime=true], \\[timeColumn], \\[lastBatchOnly=false], \\[contextByColumn], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[raftGroup], \\[outputElapsedMicroseconds=false], \\[roundTime=true], \\[keyFilter], \\[updatedContextGroupsOnly=false])\n\nAlias: createCrossSectionalAggregator\n\n#### Details\n\nThis function creates a cross-sectional streaming engine and returns a keyed table with *keyColumn* as the key.\n\nThe keyed table is updated every time a new record arrives. If the parameter *lastBatchOnly* is set to true, the table only maintains the latest record in each group. When new data is ingested into the engine,\n\n* if *metrics* and *outputTable* are specified, the engine first updates the keyed table, then performs calculations on the latest data and outputs the results to *outputTable*.\n\n* if *metrics* and *outputTable* are not specified, the engine only updates the keyed table.\n\n##### Calculation Rules\n\nThe calculation can be triggered by the number of records or time interval. If *triggeringPattern* is set to \"keyCount\", the timestamps indicated by *timeColumn* in the input stream table must be non-decreasing. If a grouping column (*keyColumn*) is also specified, the timestamps within each group must be non-decreasing. Otherwise, out-of-order data will be discarded and not included in the computation. For details, refer to the descriptions of the `triggeringPattern` and `triggeringInterval` parameters.\n\n**Note:** If *contextByColumn* is specified, the data will be grouped by the specified columns and calculated by group.\n\n##### Features\n\n* Snapshot: Snapshot mechanism is used to restore the streaming engine to the latest snapshot after system interruption. (See parameters *snapshotDir* and *snapshotIntervalInMsgCount*)\n\n* High availability: To enable high availability for streaming engines, specify the parameter *raftGroup* on the leader of the raft group on the subscriber. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table.\n\n#### Parameters\n\n**name** is a string of the engine name. It is the only identifier of a cross sectional engine on a data/compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**metrics** (optional) is metacode or a tuple specifying the formulas for calculation. It can be:\n\n* Built-in or user-defined aggregate functions, e.g., `<[sum(qty), avg(price)]>`; Or expressions on previous results, e.g., `<[avg(price1)-avg(price2)]>`; Or calculation on multiple columns, e.g., `<[std(price1-price2)]>`\n\n* Functions with multiple returns, such as `<func(price) as `col1`col2>`. The column names can be specified or not. For more information about metacode, see [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter. For versions 2.00.14/3.00.2 and later, *dummyTable* can include array vector columns.\n\n**outputTable** (optional) is the output table for the results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function. Make sure that data types of columns storing calculation results are the same as the results of metrics. The output columns are in the following order:\n\n(1) The first column is of TIMESTAMP type.\n\n* If *useSystemTime* = true, the column stores the time when each calculation starts;\n\n* If *useSystemTime* = false, it takes the values of *timeColumn*.\n\n(2) The following column is the *contextByColumn* (if specified).\n\n(3) If the *outputElapsedMicroseconds* is set to true, specify two more columns: a LONG column and an INT column.\n\n(4) The remaining columns store the calculation results of metrics.\n\n**keyColumn** is a STRING scalar or vector that specifies one or more columns in the stream table as the key columns. For each unique value in the *keyColumn*, only the latest record is used in the calculation.\n\n**triggeringPattern** (optional) is a STRING scalar specifying how to trigger the calculations. The engine returns a result every time a calculation is triggered. It can take one of the following values:\n\n* 'perBatch' (default): calculates when a batch of data arrives.\n\n* 'perRow': calculates when a new record arrives.\n\n* 'interval': calculates at intervals specified by *triggeringInterval*, using system time.\n\n* 'keyCount': When data with the same timestamp arrives in batches, the calculation is triggered when:\n\n  * if the number of keys with the latest timestamp reaches *triggeringInterval*;\n\n  * or data with newer timestamp arrives.\n\n* 'dataInterval': calculates at intervals based on timestamps in the data. To use this, *timeColumn* must be specified and *useSystemTime* must be false.\n\nNote: To set *triggeringPattern* as 'keyCount', *timeColumn* must be specified and *useSystemTime* must be set to false. In this case, the out-of-order data will be discarded.\n\n**triggeringInterval** (optional) can be an integer or a tuple. Below explains its optional values and triggering rules:\n\n* If *triggeringPattern* = 'interval', *triggeringInterval* is a positive integer indicating the interval in milliseconds between 2 adjacent calculations. The default value is 1,000. Every *triggeringInterval* milliseconds, the system checks if the data in the engine has been calculated; if not, a calculation is triggered.\n\n* If *triggeringPattern* = 'keyCount', *triggeringInterval* can be:\n\n  * an integer specifying a threshold. Before data with a greater timestamp arrives, a calculation is triggered when the number of uncalculated records reaches the threshold.\n\n  * a tuple of 2 elements. The first element is an integer indicating the threshold of the number records with the latest timestamp to trigger calculation. The second element is an integer or duration value.\n\n  For example, when *triggeringInterval* is set to (c1, c2):\n\n  * If c2 is an integer and the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system goes on to save data with greater 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 greater timestamp t3 (t3>t2) arrives. Note that c2 must be smaller than c1.\n\n  * If c2 is a duration and the number of keys with the latest timestamp t1 doesn't reach c1, calculation will not be triggered and the system goes on to save data with greater 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 greater timestamp t3 (t3>t2) arrives, or the duration c2 comes to an end.\n\n* If *triggeringPattern*= 'dataInterval', *triggeringInterval* is a positive integer measured in the same units as the timestamps in *timeColumn*. The default is 1,000. Starting with the first record, a window is started at intervals defined by *triggeringInterval*, based on the timestamp units. When the first record of the next window arrives, a calculation is triggered on all data in the current window.\n\n  * In versions 2.00.11.21.30.23.2 and earlier, a calculation is triggered for each window.\n\n  * Since version 2.00.11.31.30.23.3, a calculation is triggered only for windows containing data.\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* If *useSystemTime* = true, the time column of outputTable is the system time;\n\n* If *useSystemTime* = false, the parameter timeColumn must be specified. The time column of *outputTable* uses the timestamp of each record.\n\n**timeColumn** (optional) is a STRING scalar which specifies the time column in the stream table to which the engine subscribes if *useSystemTime* = false. It can only be of TIMESTAMP type.\n\n**lastBatchOnly** (optional) is a Boolean value indicating whether to keep only the records with the latest timestamp in the engine. When *lastBatchOnly* = true, *triggeringPattern* must take the value 'keyCount', and the cross-sectional engine only maintains key values with the latest timestamp for calculation. Otherwise, the engine updates and retains all values for calculation.\n\n**contextByColumn** (optional) is a STRING scalar or vector indicating the grouping column(s) based on which calculations are performed by group. This parameter only takes effect if *metrics* and *outputTable* are specified. If *metrics* only contains aggregate functions, the calculation results would be the same as a SQL query using `group by`. Otherwise, the results would be consistent with that using `context by`.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**raftGroup** (optional) is an integer greater than 1, indicating ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. Specify *raftGroup* to enable high availability for the streaming engines. When an engine is created on the leader, it is also created on each follower and the engine snapshot is synchronized to the 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.\n\n**outputElapsedMicroseconds** (optional) is a Boolean value. The default value is false. It determines whether to output:\n\n* the elapsed time (in microseconds) from the ingestion of data to the output of result in each batch.\n\n* the total row number of each batch.\n\n**Note**: When both *outputElapsedMicroseconds*and *useSystemTime*parameters are set to true, aggregate function cannot be used in *metrics*.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary when *triggeringPattern*='dataInterval'. The default value is true indicating the alignment is based on the multi-minute rule (see the [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.md#) of time-series engine). False means alignment is based on the one-minute rule.\n\n**keyFilter** (optional) is metacode of an expression or function call that returns a Boolean vector. It specifies the conditions for filtering keys in the keyed table returned by the engine. Only data with keys satisfying the filtering conditions will be taken for calculation.\n\n**updatedContextGroupsOnly** (optional) is a Boolean scalar indicating whether to compute only the groups that have been updated with new data since the last output. Defaults to false.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1. A table \"csEngine1\" is created with function `createCrossSectionalEngine` and it subscribes to the stream table trades1. We set *triggeringPattern* to 'perRow', so each row that is inserted into table csEngine1 triggers a calculation.\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades1\nshare table(1:0, `time`avgPrice`volume`dollarVolume`count, [TIMESTAMP,DOUBLE,INT,DOUBLE,INT]) as outputTable\ncsEngine1=createCrossSectionalEngine(name=\"csEngineDemo1\", metrics=<[avg(price), sum(volume), sum(price*volume), count(price)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perRow\", useSystemTime=false, timeColumn=`time)\nsubscribeTable(tableName=\"trades1\", actionName=\"tradesStats\", offset=-1, handler=append!{csEngine1}, msgAsTable=true)\ninsert into trades1 values(2020.08.12T09:30:00.000 + 123 234 456 678 890 901, `A`B`A`B`B`A, 10 20 10.1 20.1 20.2 10.2, 20 10 20 30 40 20);\n\nselect * from trades1;\n```\n\n| time                    | sym | price | volume |\n| ----------------------- | --- | ----- | ------ |\n| 2020.08.12T09:30:00.123 | A   | 10    | 20     |\n| 2020.08.12T09:30:00.234 | B   | 20    | 10     |\n| 2020.08.12T09:30:00.456 | A   | 10.1  | 20     |\n| 2020.08.12T09:30:00.678 | B   | 20.1  | 30     |\n| 2020.08.12T09:30:00.890 | B   | 20.2  | 40     |\n| 2020.08.12T09:30:00.901 | A   | 10.2  | 20     |\n\n```\nselect * from outputTable;\n```\n\n| time                    | avgPrice | volume | dollarVolume | count |\n| ----------------------- | -------- | ------ | ------------ | ----- |\n| 2020.08.12T09:30:00.123 | 10       | 20     | 200          | 1     |\n| 2020.08.12T09:30:00.234 | 15       | 30     | 400          | 2     |\n| 2020.08.12T09:30:00.456 | 15.05    | 30     | 402          | 2     |\n| 2020.08.12T09:30:00.678 | 15.1     | 50     | 805          | 2     |\n| 2020.08.12T09:30:00.890 | 15.15    | 60     | 1010         | 2     |\n| 2020.08.12T09:30:00.901 | 15.2     | 60     | 1012         | 2     |\n\nExample 2. When*triggeringPattern* is set to 'perBatch', insert 2 batches of data.\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades2\nshare table(1:0, `time`avgPrice`volume`dollarVolume`count, [TIMESTAMP,DOUBLE,INT,DOUBLE,INT]) as outputTable\ncsEngine2=createCrossSectionalEngine(name=\"csEngineDemo2\", metrics=<[avg(price), sum(volume), sum(price*volume), count(price)]>, dummyTable=trades2, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perBatch\", useSystemTime=false, timeColumn=`time)\nsubscribeTable(tableName=\"trades2\", actionName=\"tradesStats\", offset=-1, handler=append!{csEngine2}, msgAsTable=true)\ninsert into trades2 values(2020.08.12T09:30:00.000 + 123 234 456, `A`B`A, 10 20 10.1, 20 10 20);\nsleep(1)\ninsert into trades2 values(2020.08.12T09:30:00.000 + 678 890 901, `B`B`A, 20.1 20.2 10.2, 30 40 20);\n\nselect * from outputTable;\n```\n\n| time                    | avgPrice | volume | dollarVolume | count |\n| ----------------------- | -------- | ------ | ------------ | ----- |\n| 2020.08.12T09:30:00.456 | 15.05    | 30     | 402          | 2     |\n| 2020.08.12T09:30:00.901 | 15.2     | 60     | 1012         | 2     |\n\nExample 3. The following example sets *triggeringPattern* to 'keyCount' and *lastBatchOnly* to true. Only the data with the latest timestamp will participate in calculation. Since there are both aggregate and non-aggregate functions set in metrics, the number of rows in the result table will be the same as that in the input table.\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades1\nshare table(1:0, `time`factor1`factor2, [TIMESTAMP, DOUBLE,INT]) as outputTable\nagg=createCrossSectionalEngine(name=\"csEngineDemo4\", metrics=<[price+ 0.1, sum(volume)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"keyCount\", triggeringInterval=5, useSystemTime=false, timeColumn=`time,lastBatchOnly=true)\nsubscribeTable(tableName=`trades1, actionName=\"csEngineDemo4\", msgAsTable=true, handler=append!{agg})\nnum=10\ntime=array(TIMESTAMP)\ntime=take(2018.01.01T09:30:00.000,num)\nsym=take(\"A\"+string(1..10),num)\nprice=1..num\nvolume=1..num\ntmp=table(time, sym, price, volume)\ntrades1.append!(tmp)\n\n// Only the latest 5 records will participate in calculation.\nnum=5\ntime = array(TIMESTAMP)\ntime=take(2018.01.01T09:30:01.000,num)\nsym=take(\"A\"+string(1..10),num)\nprice=6..10\nvolume=6..10\ntmp=table(time, sym, price, volume)\ntrades1.append!(tmp)\n```\n\n| time                    | factor1 | factor2 |\n| ----------------------- | ------- | ------- |\n| 2018.01.01T09:30:00.000 | 1.1     | 55      |\n| 2018.01.01T09:30:00.000 | 2.1     | 55      |\n| 2018.01.01T09:30:00.000 | 3.1     | 55      |\n| 2018.01.01T09:30:00.000 | 4.1     | 55      |\n| 2018.01.01T09:30:00.000 | 5.1     | 55      |\n| 2018.01.01T09:30:00.000 | 6.1     | 55      |\n| 2018.01.01T09:30:00.000 | 7.1     | 55      |\n| 2018.01.01T09:30:00.000 | 8.1     | 55      |\n| 2018.01.01T09:30:00.000 | 9.1     | 55      |\n| 2018.01.01T09:30:00.000 | 10.1    | 55      |\n| 2018.01.01T09:30:01.000 | 6.1     | 40      |\n| 2018.01.01T09:30:01.000 | 7.1     | 40      |\n| 2018.01.01T09:30:01.000 | 8.1     | 40      |\n| 2018.01.01T09:30:01.000 | 9.1     | 40      |\n| 2018.01.01T09:30:01.000 | 10.1    | 40      |\n\nExample 4. Set *triggeringPattern* to 'interval' and *triggeringInterval* to 500 (milliseconds).\n\n```\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades3\nshare table(1:0, `time`avgPrice`volume`dollarVolume`count, [TIMESTAMP,DOUBLE,INT,DOUBLE,INT]) as outputTable\ncsEngine3=createCrossSectionalEngine(name=\"csEngineDemo3\", metrics=<[avg(price), sum(volume), sum(price*volume), count(price)]>, dummyTable=trades3, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"interval\", triggeringInterval=500)\nsubscribeTable(tableName=\"trades3\", actionName=\"tradesStats\", offset=-1, handler=append!{csEngine3}, msgAsTable=true);\n\ninsert into trades3 values(2020.08.12T09:30:00.000, `A, 10, 20)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 500, `B, 20, 10)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 1000, `A, 10.1, 20)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 2000, `B, 20.1, 30)\nsleep(500)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 2500, `B, 20.2, 40)\ninsert into trades3 values(2020.08.12T09:30:00.000 + 3000, `A, 10.2, 20);\nsleep(500)\n\nselect * from outputTable;\n```\n\n| time                    | avgPrice | volume | dollarVolume | count |\n| ----------------------- | -------- | ------ | ------------ | ----- |\n| 2022.03.02T11:17:02.341 | 15.1     | 50     | 805          | 2     |\n| 2022.03.02T11:17:02.850 | 15.2     | 60     | 1,012        | 2     |\n\nThe calculation is triggered every 500 ms based on the system time. Only the records with the latest timestamp participate in the calculation, even if there are multiple uncalculated records with the same key.\n\nIn the above example, the table returned by cross sectional engine is usually an intermediate result for the calculation. But it can also be a final result. For example, if you need to regularly refresh the latest trading price of a certain stock, the basic way is to filter the stocks by code from the real-time trading table and retrieve the last record. However, the amount of data in the trading table is growing rapidly over time. For frequent queries, it is not the best practice in terms of system resource consumption or query performance. The cross sectional table only saves the latest transaction data of all stocks, the data amount is stable. So it is very suitable for the timing polling scenario.\n\nTo use a cross sectional table as a final result, you need to set *metrics* and *outputTable* to be empty.\n\n```\ntradesCrossEngine=createCrossSectionalEngine(name=\"CrossSectionalDemo\", dummyTable=trades, keyColumn=`sym, triggeringPattern=`perRow)\n```\n\nExample 5. Group data by volume and trigger computation each time new data arrives.\n\n```\ntry{dropStreamEngine(`csEngineDemo)}catch(ex){}\ntry{dropStreamTable(`trades1)}catch(ex){}\n\nshare streamTable(10:0,`time`sym`price`volume,[SECOND,SYMBOL,DOUBLE,INT]) as trades1\noutputTable = table(1:0, `time`volume`factor1`factor2, [SECOND, INT, DOUBLE, DOUBLE])\nagg1=createCrossSectionalEngine(name=\"csEngineDemo\", metrics=<[avg(price), sum(volume)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perRow\",useSystemTime=false, timeColumn=`time, outputElapsedMicroseconds=false, contextByColumn=`volume, updatedContextGroupsOnly=false)\nnum=4\ntime = take(09:30:00, num)\nsym= take(`A1`B1`C1`D1, num)\nprice=rand(100.0, num)\nvolume=take(1 1 2 2, num)\ntmp=table(time, sym, price, volume)\nagg1.append!(tmp)\noutputTable\n```\n\nWhen *updatedContextGroupsOnly* = false, the engine does not check if the data in each group has been updated. Every time a record is inserted, it triggers the computation and output for all groups. The result table contains 6 records:\n\n| time     | volume | factor1 | factor2 |\n| -------- | ------ | ------- | ------- |\n| 09:30:00 | 1      | 82.3447 | 1       |\n| 09:30:00 | 1      | 69.9793 | 2       |\n| 09:30:00 | 1      | 69.9793 | 2       |\n| 09:30:00 | 2      | 95.262  | 2       |\n| 09:30:00 | 1      | 69.9793 | 2       |\n| 09:30:00 | 2      | 80.5988 | 4       |\n\n```\ntry{dropStreamEngine(`csEngineDemo)}catch(ex){}\ntry{dropStreamTable(`trades1)}catch(ex){}\n\nshare streamTable(10:0,`time`sym`price`volume,[SECOND,SYMBOL,DOUBLE,INT]) as trades1\noutputTable = table(1:0, `time`volume`factor1`factor2, [SECOND, INT, DOUBLE, DOUBLE])\nagg1=createCrossSectionalEngine(name=\"csEngineDemo\", metrics=<[avg(price), sum(volume)]>, dummyTable=trades1, outputTable=outputTable, keyColumn=`sym, triggeringPattern=\"perRow\",useSystemTime=false, timeColumn=`time, outputElapsedMicroseconds=false, contextByColumn=`volume, updatedContextGroupsOnly=true)\nnum=4\ntime = take(09:30:00, num)\nsym= take(`A1`B1`C1`D1, num)\nprice=rand(100.0, num)\nvolume=take(1 1 2 2, num)\ntmp=table(time, sym, price, volume)\nagg1.append!(tmp)\noutputTable\n```\n\nWhen *updatedContextGroupsOnly* = true, the engine only computes the groups with updated data in this insertion. The result table contains 4 records:\n\n| time     | volume | factor1 | factor2 |\n| -------- | ------ | ------- | ------- |\n| 09:30:00 | 1      | 54.6926 | 1       |\n| 09:30:00 | 1      | 40.5904 | 2       |\n| 09:30:00 | 2      | 73.1741 | 2       |\n| 09:30:00 | 2      | 46.0153 | 4       |\n\nExample 7. Set *triggeringPattern*=\"dataInterval\", *triggeringInterval*, and *outputElapsedMicroseconds*\n\nIn this example, the cross-sectional engine maintains the latest state for each branch by branchId and outputs cross-sectional aggregate results in 1-minute windows.\n\n```\nshare streamTable(1:0, `quoteTime`branchId`marginUsed`riskRate, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE]) as snapshot\nshare table(100:0, `time`totalMarginUsed`avgRiskRate`elapsedUs`batchRows, [TIMESTAMP, DOUBLE, DOUBLE, LONG, INT]) as outputTable\n\nengine = createCrossSectionalEngine(\n   name=\"csDataIntervalDemo\",\n   metrics=<[sum(marginUsed), avg(riskRate)]>,\n   dummyTable=snapshot,\n   outputTable=outputTable,\n   keyColumn=`branchId,\n   triggeringPattern=\"dataInterval\",\n   triggeringInterval=60000,\n   useSystemTime=false,\n   timeColumn=`quoteTime,\n   outputElapsedMicroseconds=true\n)\n\nsubscribeTable(tableName=`snapshot, actionName=\"csDataIntervalDemo\", msgAsTable=true, handler=append!{engine})\n\ninsert into snapshot values(2024.06.03T09:30:00.000, `BJ01, 12000000.0, 0.42)\ninsert into snapshot values(2024.06.03T09:30:10.000, `SH02, 12000000.0, 0.55)\ninsert into snapshot values(2024.06.03T09:30:40.000, `SZ03, 9800000.0, 0.37)\ninsert into snapshot values(2024.06.03T09:31:05.000, `BJ01, 12300000.0, 0.44)\n\nsleep(500)\n\nselect * from outputTable\n```\n\nThe output may look like this:\n\n| time                    | totalMarginUsed | avgRiskRate | elapsedUs | batchRows |\n| ----------------------- | --------------- | ----------- | --------- | --------- |\n| 2024.06.03 09:31:00.000 | 33,800,000      | 0.4466667   | 3         | 1         |\n\n* *triggeringPattern*=\"dataInterval\" indicates that computation is triggered based on time intervals. In this example, *triggeringInterva*l=60000, so the window is 1 minute.\n\n* The record at 2024.06.03T09:31:05.000 is the first record to arrive after the window ends, so it triggers computation and output for the previous window \\[09:30:00, 09:31:00); it does not itself participate in this output.\n\n* Within the first window, the latest state of each branch is as follows:\n\n  * BJ01: marginUsed=12000000; riskRate=0.42\n\n  * SH02: marginUsed=12000000; riskRate=0.55\n\n  * SZ03: marginUsed=9800000; riskRate=0.37\n\nTherefore, totalMarginUsed=33,800,000 and avgRiskRate=(0.42+0.55+0.37)/3=0.4466667.\n\n* After setting *outputElapsedMicroseconds*=true, the output table must include a LONG column and an INT column after the metric column to record the elapsed time for this output and the batch row count, respectively.\n\n* elapsedUs varies with the deployment environment and workload.\n\nExample 8. Use *roundTime* and *triggeringPattern*=\"dataInterval\" to control how windows are aligned.\n\nThis example simulates inventory snapshots for retail stores. The two engines differ only in their *roundTime* setting; all other parameters are identical. They are used to compare the boundary differences of the first window.\n\n```\nshare streamTable(1:0, `eventTime`sku`onHandQty, [TIMESTAMP, SYMBOL, INT]) as inventory\nshare table(100:0, `time`totalOnHandQty, [TIMESTAMP, INT]) as outputRTTrue\nshare table(100:0, `time`totalOnHandQty, [TIMESTAMP, INT]) as outputRTFalse\n\nengineRTTrue = createCrossSectionalEngine(\n   name=\"engineRTTrue\",\n   metrics=<[sum(onHandQty)]>,\n   dummyTable=inventory,\n   outputTable=outputRTTrue,\n   keyColumn=`sku,\n   triggeringPattern=\"dataInterval\",\n   triggeringInterval=120000,\n   useSystemTime=false,\n   timeColumn=`eventTime,\n   roundTime=true\n)\n\nengineRTFalse = createCrossSectionalEngine(\n   name=\"engineRTFalse\",\n   metrics=<[sum(onHandQty)]>,\n   dummyTable=inventory,\n   outputTable=outputRTFalse,\n   keyColumn=`sku,\n   triggeringPattern=\"dataInterval\",\n   triggeringInterval=120000,\n   useSystemTime=false,\n   timeColumn=`eventTime,\n   roundTime=false\n)\n\nsubscribeTable(tableName=\"inventory\", actionName=\"engineRTTrue\", offset=0, handler=append!{engineRTTrue}, msgAsTable=true)\nsubscribeTable(tableName=\"inventory\", actionName=\"engineRTFalse\", offset=0, handler=append!{engineRTFalse}, msgAsTable=true)\n\ninsert into inventory values(2024.06.03T10:03:30.500, `SKU1001, 120)\ninsert into inventory values(2024.06.03T10:04:20.000, `SKU2008, 80)\ninsert into inventory values(2024.06.03T10:05:10.000, `SKU3012, 60)\n\n```\n\nFor the engine with *roundTime*=true, run `select * from outputRTTrue`. The output is as follows:\n\n| time                    | totalOnHandQty |\n| ----------------------- | -------------- |\n| 2024.06.03 10:04:00.000 | 120            |\n\nFor the engine with *roundTime*=false, run `select * from outputRTFalse`. The output is as follows:\n\n| time                    | totalOnHandQty |\n| ----------------------- | -------------- |\n| 2024.06.03 10:05:00.000 | 200            |\n\n* In this example, *triggeringPattern*=\"dataInterval\" and *triggeringInterval*=120000, meaning the window is 2 minutes.\n\n* The timestamp of the first record is 2024.06.03T10:03:30.500.\n\n* When *roundTime*=true, the first window is aligned to a 2-minute boundary, so it is \\[10:02:00, 10:04:00). Therefore, only SKU1001=120 falls into the first window; when the data at 10:04:20.000 arrives, it triggers output, and the result is 120.\n\n* When *roundTime*=false, the first window is aligned to a 1-minute boundary, so it is \\[10:03:00, 10:05:00). Therefore, both SKU1001=120 and SKU2008=80 fall into the first window; when the data at 10:05:10.000 arrives, it triggers output, and the result is 200.\n"
    },
    "createCryptoOrderBookEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createCryptoOrderBookEngine.html",
        "signatures": [
            {
                "full": "createCryptoOrderBookEngine(name, dummyTable, inputColMap, [outputTable], depth, [updateRule='direct'], [errorHandler=NULL], [cachingInterval=5000], [timeout=-1], [outputHandler], [msgAsTable=false], [cachedDepth], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createCryptoOrderBookEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "inputColMap",
                        "name": "inputColMap"
                    },
                    {
                        "full": "[outputTable]",
                        "name": "outputTable",
                        "optional": true
                    },
                    {
                        "full": "depth",
                        "name": "depth"
                    },
                    {
                        "full": "[updateRule='direct']",
                        "name": "updateRule",
                        "optional": true,
                        "default": "'direct'"
                    },
                    {
                        "full": "[errorHandler=NULL]",
                        "name": "errorHandler",
                        "optional": true,
                        "default": "NULL"
                    },
                    {
                        "full": "[cachingInterval=5000]",
                        "name": "cachingInterval",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[timeout=-1]",
                        "name": "timeout",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[outputHandler]",
                        "name": "outputHandler",
                        "optional": true
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[cachedDepth]",
                        "name": "cachedDepth",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createCryptoOrderBookEngine](https://docs.dolphindb.com/en/Functions/c/createCryptoOrderBookEngine.html)\n\n\n\n#### Syntax\n\ncreateCryptoOrderBookEngine(name, dummyTable, inputColMap, \\[outputTable], depth, \\[updateRule='direct'], \\[errorHandler=NULL], \\[cachingInterval=5000], \\[timeout=-1], \\[outputHandler], \\[msgAsTable=false], \\[cachedDepth], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\n**Note:** This function is not supported by Community Edition. You can contact DolphinDB technical support and request a trial license.\n\n#### Details\n\nThis engine maintains a real-time cryptocurrency order book, updated based on full order book snapshots and incremental order book updates, and outputs order book information at a specified depth.\n\nThe engine is typically used together with exchange market data interfaces:\n\n1. Retrieve a full order book snapshot once via the REST API.\n\n2. Subscribe to incremental order book updates via WebSocket.\n\n3. Feed the snapshot and subsequent incremental updates into the engine, which maintains a real-time local order book.\n\n4. If incremental data loss is detected, a new snapshot can be requested via REST to resynchronize the order book.\n\nWhen missing or out-of-order incremental updates are detected, a user-defined handler can be executed through errorHandler (for example, requesting a new full snapshot).\n\nThe engine supports general order book update rules, and provides dedicated rules for Binance spot (Binance-spot) and futures (Binance-futures) markets. For other exchanges, the general or direct rule can be used, provided that the incremental updates are properly ordered and the update logic is maintained.\n\n#### Parameters\n\n**name** is a string of the engine name. It is the only identifier of the crypto order book engine. It can contain letters, numbers and underscores, and must start with a letter.\n\n**dummyTable** is a table object representing the input table. The input columns should be mapped to specific columns through parameter *inputColMap*.\n\nThe following columns are required for input tables:\n\n| Name          | Type                      | Description                            |\n| ------------- | ------------------------- | -------------------------------------- |\n| symbol        | SYMBOL                    | Crypto symbol                          |\n| isIncremental | BOOL                      | Whether the input data is incremental. |\n| eventTime     | TIMESTAMP / NANOTIMESTAMP | Event time                             |\n| askQty        | DECIMAL\\[] / DOUBLE\\[]    | Ask quantity                           |\n| askPrice      | DECIMAL\\[] / DOUBLE\\[]    | Ask price                              |\n| bidQty        | DECIMAL\\[] / DOUBLE\\[]    | Bid quantity                           |\n| bidPrice      | DECIMAL\\[] / DOUBLE\\[]    | Bid price                              |\n\nAdditionally,\n\n* If *updateRule*=“direct“, no extra columns are required.\n\n* If *updateRule*=“general”, the following columns are required:\n\n  | Name         | Type | Description        |\n  | ------------ | ---- | ------------------ |\n  | prevUpdateId | LONG | Previous record ID |\n  | updateId     | LONG | Current record ID  |\n\n* If *updateRule*=“Binance-spot“, the following columns are required:\n\n  | Name          | Type | Description              |\n  | ------------- | ---- | ------------------------ |\n  | lastUpdateId  | LONG | Last record ID in event  |\n  | firstUpdateId | LONG | First record ID in event |\n\n* If *updateRule*=“Binance-futures“, the following columns are required:\n\n  | Name             | Type | Description                                                                            |\n  | ---------------- | ---- | -------------------------------------------------------------------------------------- |\n  | lastUpdateId     | LONG | Last record ID in event                                                                |\n  | firstUpdateId    | LONG | First record ID in event                                                               |\n  | prevLastUpdateId | LONG | Previous record ID based on current record in event, i.e., lastUpdateId in last stream |\n\nExcept the above-mentioned columns, all other columns from the input table will be copied to the output table.\n\n**inputColMap** is a dictionary mapping column names in *dummyTable* to the required columns.\n\n**outputTable** (optional) is a table object for storing the updated order book. This table should have the same schema as *dummyTable*.\n\n**depth** is an integer or dictionary specifying the depth of the order book.\n\n* Integer: Applies the same depth for all cryptocurrencies.\n* Dictionary: Keys are cryptocurrency codes, and values are the depth for each. If a cryptocurrency is not specified, it will not output an order book result.\n\n**updateRule** (optional) is a string specifying the order book update rule.\n\n* \"direct\" (default): Updates directly based on isIncremental field (true for update, false for overwrite).\n* \"general\": General update rule, requiring streaming data with monotonically increasing update IDs.\n* \"Binance-spot\": Update rule for Binance spot data.\n* \"Binance-futures\": Update rule for Binance futures data.\n\n**Note:** The engine’s update behavior is determined by this parameter, not by the exchange. Any exchange’s data can be processed provided it conforms to the chosen rule.\n\n**errorHandler** (optional) is a UDF to handle errors when incremental data is missing. It takes two arguments:\n\n* The first argument is a string representing the cryptocurrency code.\n* The second argument is an integer representing the error code, with possible values:\n  * **1**: Received old data.\n  * **2**: Received out-of-order data expected at a future time.\n  * **3**: Timeout, indicating no new order book update within the specified time.\n  * **4**: Crossed prices error, where the highest bid is greater than or equal to the lowest ask.\n\n**cachingInterval**(optional) is an integer indicating the interval (in milliseconds) within which incremental data is cached. The default is 5000. For each crypto, data is retained in the cache if the time difference between the first data in cache and the latest is no greater than *cachingInterval*.\n\n**timeout** (optional) is an integer specifying the timeout period in milliseconds. The default is -1 (no timeout). If order book is not updated within this period, the *errorHandler* will be invoked.\n\n**outputHandler** (optional) is a unary function. If set, the engine will use this function to process the calculation results instead of writing to the output table.\n\n**msgAsTable** (optional) is a Boolean value specifying whether to form the engine's results as a table. The default value is false, indicating the output data is a tuple of columns. This parameter only takes effect when *outputHandler* is set.\n\n**cachedDepth** (optional) is an integer or dictionary specifying the depth for cached order books.\n\n* Integer: Applies the same depth for cached order books for all cryptocurrencies.\n* Dictionary: Keys are cryptocurrency codes, and values are the depth for each. If a cryptocurrency is not specified, full-depth order books are cached.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1. Creating a Crypto Order Book Engine for Binance Futures\n\nThis example uses the \"Binance-futures\" rule to process data retrieved from Binance's futures market. The sample data begins with incremental depth data, followed by a full-depth 1000-level snapshot.\n\n```\n// Define input/output table schema\ncolNames = `isIncremental`exchange`eventTime`transactionTime`symbol`firstUpdateId`lastUpdateId`prevLastUpdateId`bidPrice`bidQty`askPrice`askQty\ncolTypes = [BOOL, SYMBOL, TIMESTAMP, TIMESTAMP, SYMBOL, LONG, LONG, LONG, DECIMAL128(18)[], DECIMAL128(8)[], DECIMAL128(18)[], DECIMAL128(8)[]]\n\n// Create input/output tables\nshare table(1:0, colNames, colTypes) as outputTable\nshare table(1:0, colNames, colTypes) as inputTable\n\ninputTarget = [\"symbol\", \"eventTime\", \"isIncremental\", \"bidPrice\", \"bidQty\", \"askPrice\", \"askQty\", \"lastUpdateId\", \"firstUpdateId\", \"prevLastUpdateId\"]\ninputSource = [\"symbol\", \"eventTime\", 'isIncremental', 'bidPrice', 'bidQty', 'askPrice', 'askQty', 'lastUpdateId', 'firstUpdateId', 'prevLastUpdateId']\n\n// Map input columns\ninputColMap = dict(inputTarget, inputSource)\n\n// Set depth\ndepth = dict([\"BTCUSDT\"], [1000])\ncachedDepth = dict([\"BTCUSDT\"], [1500])\n\n// Define error handler\ndef errorHandler(instrument, code) {\n    if (code == 1) {\n        writeLog(\"handle hisotorical msg...\")\n    } else if (code == 2) {\n        writeLog(\"handle unordered msg...\")\n    } else if (code == 3) {\n        writeLog(\"handle timeout...\")\n    } else if (code == 4) {\n        writeLog(\"handle corssed price...\")\n    } else {\n        writeLog(\"unknown error!\")\n    }\n}\n\n// Create engine\nengine = createCryptoOrderBookEngine(name=\"binanceFutures\", dummyTable=inputTable, inputColMap=inputColMap, outputTable=outputTable, \n                                        depth=depth, updateRule=\"Binance-futures\", errorHandler=errorHandler, cachingInterval=5000, \n                                        timeout=6000, msgAsTable=true, cachedDepth=cachedDepth)\n\n\n// Load and append sample data\nfin=file(\"binanceFuturesTestData.bin\")\nbinanceFuturesTestData = fin.readObject()\nfin.close();\n\ngetStreamEngine(\"binanceFutures\").append!(binanceFuturesTestData)\n\n// Clean environments\nundef(\"inputTable\", SHARED)\nundef(\"outputTable\", SHARED)\ndropStreamEngine(\"binanceFutures\")\n```\n\nExample 2. Creating a Crypto Order Book Engine for OKX Perpetual Swaps using the “general” rule. The sample data begins with 400-level snapshot data, followed by incremental snapshot data.\n\n```\n// Define input/output table schema\ncolNames=['isIncremental', 'symbol', 'askPrice', 'askVolume', 'askNum', 'bidPrice', 'bidVolume', 'bidNum', 'checksum', 'prevSeqId', 'seqId', 'updateTime'];\ncolTypes=[BOOL, SYMBOL, DECIMAL128(18)[], DECIMAL128(8)[], INT[], DECIMAL128(18)[], DECIMAL128(8)[], INT[], LONG, LONG, LONG, TIMESTAMP];\n\n// Create input/output tables\nshare table(1:0, colNames, colTypes) as inputTable\nshare table(1:0, colNames, colTypes) as outputTable\n\ninputTarget = [\"symbol\", \"eventTime\", \"isIncremental\", \"bidPrice\", \"bidQty\", \"askPrice\", \"askQty\", \"prevUpdateId\", \"updateId\"];\ninputSource = [\"symbol\", \"updateTime\", 'isIncremental', 'bidPrice', 'bidVolume', 'askPrice', 'askVolume', 'prevSeqId', 'seqId'];\n\n// Map input columns\ninputColMap = dict(inputTarget, inputSource)\n\n// Set depth\ndepth = dict([\"BTC-USD-SWAP\"], [400])\ncachedDepth = dict([\"BTC-USD-SWAP\"], [800])\n\n// Define error handler\ndef errorHandler(instrument, code) {\n    if (code == 1) {\n        writeLog(\"handle hisotorical msg...\")\n    } else if (code == 2) {\n        writeLog(\"handle unordered msg...\")\n    } else if (code == 3) {\n        writeLog(\"handle timeout...\")\n    } else if (code == 4) {\n        writeLog(\"handle corssed price...\")\n    } else {\n        writeLog(\"unknown error!\")\n    }\n}\n\n// Create engine\nengine = createCryptoOrderBookEngine(name=\"okxSwap\", dummyTable=inputTable, inputColMap=inputColMap, outputTable=outputTable, \n                                        depth=depth, updateRule=\"general\", errorHandler=errorHandler, cachingInterval=5000, \n                                        timeout=6000, msgAsTable=true, cachedDepth=cachedDepth)\n\n// Load and append sample data\nfin=file(\"okxTestData.bin\")\nokxTestData = fin.readObject()\nfin.close();\n\ngetStreamEngine(\"okxSwap\").append!(okxTestData)\n\n// Clean environments\nundef(\"inputTable\", SHARED)\nundef(\"outputTable\", SHARED)\ndropStreamEngine(\"okxSwap\")\n```\n\n**Sample data:**\n\n* [binanceFuturesTestData.bin](https://docs.dolphindb.com/en/Functions/resources/binanceFuturesTestData.bin)\n* [okxTestData.bin](https://docs.dolphindb.com/en/Functions/resources/okxTestData.bin)\n"
    },
    "createDailyTimeSeriesEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createDailyTimeSeriesEngine.html",
        "signatures": [
            {
                "full": "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], [keyPurgeFreqInSec=-1], [closed='left'], [outputElapsedMicroseconds=false], [subWindow], [parallelism=1], [acceptedDelay=0], [outputHandler], [msgAsTable=false], [keyPurgeDaily=true], [mergeLastWindow=false], [mergeSession])",
                "name": "createDailyTimeSeriesEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "windowSize",
                        "name": "windowSize"
                    },
                    {
                        "full": "step",
                        "name": "step"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime]",
                        "name": "useWindowStartTime",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[sessionBegin]",
                        "name": "sessionBegin",
                        "optional": true
                    },
                    {
                        "full": "[sessionEnd]",
                        "name": "sessionEnd",
                        "optional": true
                    },
                    {
                        "full": "[mergeSessionEnd=false]",
                        "name": "mergeSessionEnd",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[forceTriggerSessionEndTime]",
                        "name": "forceTriggerSessionEndTime",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSec=-1]",
                        "name": "keyPurgeFreqInSec",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[subWindow]",
                        "name": "subWindow",
                        "optional": true
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[acceptedDelay=0]",
                        "name": "acceptedDelay",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[outputHandler]",
                        "name": "outputHandler",
                        "optional": true
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyPurgeDaily=true]",
                        "name": "keyPurgeDaily",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[mergeLastWindow=false]",
                        "name": "mergeLastWindow",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[mergeSession]",
                        "name": "mergeSession",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createDailyTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createDailyTimeSeriesEngine.html)\n\n\n\n#### Syntax\n\ncreateDailyTimeSeriesEngine(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], \\[keyPurgeFreqInSec=-1], \\[closed='left'], \\[outputElapsedMicroseconds=false], \\[subWindow], \\[parallelism=1], \\[acceptedDelay=0], \\[outputHandler], \\[msgAsTable=false], \\[keyPurgeDaily=true], \\[mergeLastWindow=false], \\[mergeSession])\n\n#### Details\n\nThis function creates a daily time-series streaming engine. The windowing logic and calculation rules of the daily time-series engine are similar to those of the time-series engine. Features exclusive to the daily time-series engine are listed as follows:\n\n* Window calculations are performed only within a specified time period (known as a \"session\") of a calendar day. A day can have multiple sessions, such as 9:00-12:00, 13:00-15:00, and so on. A session’s start time and end time are automatically aligned unless *mergeLastWindow* is specified.\n\n* Data that arrives before the start of a session within a calendar day will be included in the calculation of the first window of that session.\n\n* Data that arrives after the end of the last session of that day will be discarded.\n\nNote: If *keyColumn* is specified to group data by the column values, the calculations described above will be performed within each group. For information on processing out-of-order data, refer to the **Calculation Rules** section in [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html).\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n#### Parameters\n\nThe daily time-series engine is an extension of the time-series engine ([createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)) and inherits all of its parameters. In this section, we will only cover the parameters specific to this engine.\n\n**sessionBegin** (optional) can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the starting time of each session. If it is a vector, it must be increasing.\n\n**sessionEnd** (optional) can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the end time of each session. Specify *sessionEnd* as 00:00:00 to indicate the beginning of the next day (i.e., 24:00:00 of the current day).\n\n**Note:**\n\nEach session is defined by a pair of values sessionBegin\\[i] and sessionEnd\\[i].\n\n* If sessionBegin\\[i] > sessionEnd\\[i], sessionEnd\\[i] is interpreted as a time on the next calendar day, and all sessions thereafter are also considered to be on the next day. For example, if sessionBegin = \\[21:00:00, 23:30:00, 09:00:00, 13:00:00] and sessionEnd = \\[22:00:00, 02:00:00, 11:30:00, 15:00:00], then the sessions are 21:00:00 to 22:00:00, 23:30:00 to 02:00:00 (next day), 09:00:00 to 11:30:00 (next day), and 13:00:00 to 15:00:00 (next day). The first session is 21:00:00 to 22:00:00. In this case, *keyPurgeDaily* takes effect before 21:00:00, and any data between 15:00:00 and 21:00:00 is discarded.\n\n  * If i = 0, the session is considered the first session of the trading day. For instance, if sessionBegin = \\[21:00:00, 09:00:00, 13:00:00] and sessionEnd = \\[01:00:00, 11:30:00, 15:00:00], the sessions are 21:00:00 to 01:00:00 (next day), 09:00:00 to 11:30:00 (next day), and 13:00:00 to 15:00:00 (next day). The first session is 21:00:00 to 01:00:00, and *keyPurgeDaily* takes effect before 21:00:00, discarding any data between 15:00:00 and 21:00:00.\n\n  * If i = size(sessionBegin) - 1, the session is treated as the last session of the trading day. For example, given sessionBegin = \\[09:00:00, 13:00:00, 21:00:00] and sessionEnd = \\[11:30:00, 15:00:00, 01:00:00], the sessions are 09:00:00 to 11:30:00, 13:00:00 to 15:00:00, and 21:00:00 to 01:00:00 (next day). The first session is 09:00:00 to 11:30:00. *keyPurgeDaily* takes effect before 09:00:00, and data between 01:00:00 and 09:00:00 is discarded.\n\n* If sessionBegin\\[i] < sessionEnd\\[i - 1], then sessionBegin\\[i] is interpreted as a time on the next calendar day, and subsequent sessions are all considered to be on the next day. For instance, if sessionBegin = \\[21:00:00, 09:00:00, 13:00:00] and sessionEnd = \\[23:00:00, 11:30:00, 15:00:00], the sessions are 21:00:00 to 23:00:00, 09:00:00 to 11:30:00 (next day), and 13:00:00 to 15:00:00 (next day). The first session is 21:00:00 to 23:00:00. In this case, *keyPurgeDaily* takes effect before 21:00:00, and data between 15:00:00 and 21:00:00 is discarded.\n\nOther examples:\n\n* When sessionBegin = \\[00:00:00, 09:00:00, 13:00:00, 21:00:00] and sessionEnd = \\[01:00:00, 11:30:00, 15:00:00, 00:00:00], the sessions are 21:00:00 to 01:00:00 (next day), 09:00:00 to 11:30:00, and 13:00:00 to 15:00:00. The first session is 21:00:00 to 01:00:00, and *keyPurgeDaily* takes effect before 21:00:00. **Before version 2.00.14.4, this setting has no effect, and data from 15:00:00 to 21:00:00 would be included in the 21:00:00 session window.**\n\n* When sessionBegin = \\[09:00:00, 13:00:00] and sessionEnd = \\[11:30:00, 15:00:00], the sessions are 09:00:00 to 11:30:00 and 13:00:00 to 15:00:00. *keyPurgeDaily* takes effect after 15:00:00, so data between 15:00:00 and 24:00:00 is discarded, while data from 00:00:00 to 09:00:00 is merged into the first session.\n\n**mergeSessionEnd** (optional) is a Boolean value. This parameter is only applicable when *closed* = 'left'. It determines whether the record arriving at the end of a session will be included in the calculation of the last window of that session. The default value is false, which means the record will not be included in the last window but will trigger its calculation. If the current session is not the last session of the day, the record will participate in the calculation of the first window of the next session.\n\n**forceTriggerSessionEndTime** (optional) is a positive integer. The unit of *forceTriggerSessionEndTime* is consistent with the precision of *timeColumn*. It indicates the waiting time to force trigger calculation in the window containing the *sessionEnd*, if it ends without calculation.\n\nIf no data is ingested into a group after the last window is calculated, and new data continues to ingest into other groups, the specified *fill* parameter can be used to fill the results of empty windows of that group. This ensures that the group's windows will still be output at the latest time point. If parameter *fill* is not specified, no new windows will be generated for that group after the calculation of the last window.\n\n**Note:** Computation is triggered when the system time reaches **sessionEnd + forceTriggerSessionEndTime**; therefore, this parameter does not apply in replay scenarios.\n\n**keyPurgeDaily** (optional) is a Boolean value determining if existing data groups are automatically removed when newer data of a subsequent calendar day is ingested. The default value is true. If set to false, groups of the previous calendar day are retained.\n\n**mergeLastWindow**(optional) is a boolean value which defaults to false. It handles session periods that can’t be divided into equal-length windows (as specified by *windowSize*). When set to *true*, the engine merges any data from the last incomplete window (smaller than *windowSize*) into the preceding window for calculation. This parameter cannot be used simultaneously with *subWindow*.\n\n**mergeSession** (optional) is a boolean vector of `length number of sessions - 1`. A value of true at mergeSession\\[i] indicates that session\\[i] and session\\[i+1] should be merged. When two sessions are merged, mergeSessionEnd, forceTriggerSessionEndTime, and mergeLastWindow do not take effect at the sessionEnd of the preceding session.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1:\n\n```\nshare streamTable(1000:0, `date`second`sym`volume, [DATE, SECOND, SYMBOL, INT]) as trades\nshare keyedTable(`time`sym, 10000:0, `time`sym`sumVolume, [DATETIME, SYMBOL, INT]) as output1\nengine1 = 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)\nsubscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);\n\ninsert into trades values(2018.10.08,09:25:31,`A,8)\ninsert into trades values(2018.10.08,09:26:01,`B,10)\ninsert into trades values(2018.10.08,09:30:02,`A,26)\ninsert into trades values(2018.10.08,09:30:10,`B,14)\ninsert into trades values(2018.10.08,11:29:46,`A,30)\ninsert into trades values(2018.10.08,11:29:50,`B,11)\ninsert into trades values(2018.10.08,11:30:00,`A,14)\ninsert into trades values(2018.10.08,11:30:00,`B,4)\ninsert into trades values(2018.10.08,13:00:10,`A,16)\ninsert into trades values(2018.10.08,13:00:12,`B,9)\ninsert into trades values(2018.10.08,14:59:56,`A,20)\ninsert into trades values(2018.10.08,14:59:58,`B,20)\ninsert into trades values(2018.10.08,15:00:00,`A,10)\ninsert into trades values(2018.10.08,15:00:00,`B,29)\n\nsleep(1000)\nselect * from output1\n```\n\n| time                | sym | sumVolume |\n| ------------------- | --- | --------- |\n| 2018.10.08T09:31:00 | A   | 34        |\n| 2018.10.08T09:31:00 | B   | 24        |\n| 2018.10.08T11:30:00 | A   | 44        |\n| 2018.10.08T11:30:00 | B   | 15        |\n| 2018.10.08T13:01:00 | A   | 16        |\n| 2018.10.08T13:01:00 | B   | 9         |\n| 2018.10.08T15:00:00 | A   | 30        |\n| 2018.10.08T15:00:00 | B   | 49        |\n\nExample 2:\n\n```\nshare streamTable(1000:0, `date`second`sym`volume, [DATE, SECOND, SYMBOL, INT]) as trades\nshare keyedTable(`time`sym, 10000:0, `time`sym`sumVolume, [DATETIME, SYMBOL, INT]) as output1\nengine1 = 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)\nsubscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);\n\ninsert into trades values(date(now()),09:25:31,`A,8)\ninsert into trades values(date(now()),09:26:01,`B,10)\ninsert into trades values(date(now()),09:30:02,`A,26)\ninsert into trades values(date(now()),09:30:10,`B,14)\ninsert into trades values(date(now()),11:29:46,`A,30)\ninsert into trades values(date(now()),11:29:50,`B,11)\ninsert into trades values(date(now()),11:30:00,`B,14)\ninsert into trades values(date(now()),11:30:01,`A,4)\n\nselect * from output1\n```\n\n| time                | sym | sumVolume |\n| ------------------- | --- | --------- |\n| 2022.03.24T09:31:00 | A   | 34        |\n| 2022.03.24T09:31:00 | B   | 24        |\n| 2022.03.24T11:30:00 | A   | 30        |\n\nSet *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.\n\n```\nsleep(10000)\nselect * from output1\n```\n\n| time                | sym | sumVolume |\n| ------------------- | --- | --------- |\n| 2022.03.24T09:31:00 | A   | 34        |\n| 2022.03.24T09:31:00 | B   | 24        |\n| 2022.03.24T11:30:00 | A   | 30        |\n| 2022.03.24T11:30:00 | B   | 25        |\n\nExample 3:\n\nSet *keyPurgeDaily*=false. When the engine receives data of 2024.09.11, it will not remove groups of 2024.09.10.\n\n```\nshare streamTable(1000:0, `date`second`sym`volume, [DATE, SECOND, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [DATETIME, SYMBOL, INT]) as output1\nengine1 = createDailyTimeSeriesEngine(name=\"engine1\", windowSize=30*60, step=30*60, \n  metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, \n  timeColumn=`date`second, useSystemTime=false, keyColumn=`sym, garbageSize=50,\n  useWindowStartTime=false, sessionBegin=09:30:00 13:00:00, \n  sessionEnd=11:30:00 15:00:00,mergeSessionEnd=true, keyPurgeDaily=false, \n  fill=\"null\", forceTriggerTime=60)\n\ninsert into engine1 values(2024.09.10,13:00:10,`A,16)\ninsert into engine1 values(2024.09.10,13:00:12,`B,9)\ninsert into engine1 values(2024.09.10,13:00:12,`C,9)\ninsert into engine1 values(2024.09.10,14:59:56,`A,20)\ninsert into engine1 values(2024.09.10,14:59:58,`B,20)\ninsert into engine1 values(2024.09.10,15:00:00,`A,10)\ninsert into engine1 values(2024.09.10,15:00:00,`B,29)\n\ninsert into engine1 values(2024.09.11,09:30:02,`A,26)\ninsert into engine1 values(2024.09.11,09:30:10,`B,14)\ninsert into engine1 values(2024.09.11,10:30:46,`A,30)\ninsert into engine1 values(2024.09.11,10:30:50,`B,11)\n\nselect * from output1\n```\n\n| time                | sym | sumVolume |\n| ------------------- | --- | --------- |\n| 2024.09.10T13:30:00 | A   | 16        |\n| 2024.09.10T13:30:00 | B   | 9         |\n| 2024.09.10T13:30:00 | C   | 9         |\n| 2024.09.10T14:00:00 | A   | 11        |\n| 2024.09.10T14:00:00 | B   | 30        |\n| 2024.09.10T14:00:00 | C   | 13        |\n| 2024.09.10T14:30:00 | A   | 20        |\n| 2024.09.10T14:30:00 | B   | 20        |\n| 2024.09.10T14:30:00 | C   | 10        |\n| 2024.09.10T15:00:00 | A   | 30        |\n| 2024.09.10T15:00:00 | B   | 49        |\n| 2024.09.10T15:00:00 | C   |           |\n| 2024.09.11T10:00:00 | A   | 26        |\n| 2024.09.11T10:00:00 | B   | 14        |\n| 2024.09.11T10:00:00 | C   |           |\n| 2024.09.11T10:30:00 | A   |           |\n\nIt can be seen that group C is still present in the results for 2024.09.11, even though the data for this day does not include group C.\n\nExample 4:\n\nIf the difference between *sessionEnd* and *sessionBegin* cannot be evenly divided by *step*, the last window of the session will not be output due to insufficient window size. To output the data for this window, you need to set *roundTime* = false, which will align the window according to the one-minute basis.\n\n```\n// clear variables\ndropStreamEngine(\"engine1\")\nunsubscribeTable(tableName=\"trades\", actionName=\"engine1\")\nundef(`trades, SHARED)\nundef(`output1,SHARED)\n\nshare streamTable(1000:0, `date`time`sym`volume, [DATE, TIME, SYMBOL, INT]) as trades\nshare keyedTable(`timestamp`sym, 10000:0, `timestamp`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\n\n// Create the engine, specifying a window length of 10 minutes. The last sessionEnd is 14:57:00\nengine1 = createDailyTimeSeriesEngine(name=\"engine1\", windowSize=600000, step=600000, \n  metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`date`time, garbageSize=50, updateTime=2, \n  useSystemTime=false, keyColumn=`sym,  useWindowStartTime=false, mergeSessionEnd=true,\n  sessionBegin=09:30:00.000 13:00:00.000,  sessionEnd=11:30:00.000 14:57:00.000, roundTime=false)\n  \nsubscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, \n  handler=append!{engine1}, msgAsTable=true);\n\n// Simulate data insertion into the stream table\n// The last data point is at 14:56:00, which will be aligned to the 14:57:00 window\ninsert into trades values(2024.09.10,14:00:10.988,`A,16)\ninsert into trades values(2024.09.10,14:00:12.458,`B,9)\ninsert into trades values(2024.09.10,14:21:10.772,`A,13)\ninsert into trades values(2024.09.10,14:22:12.090,`B,15)\ninsert into trades values(2024.09.10,14:29:56.953,`A,20)\ninsert into trades values(2024.09.10,14:29:58.537,`B,20)\ninsert into trades values(2024.09.10,14:31:00.612,`A,10)\ninsert into trades values(2024.09.10,14:56:00.000,`B,29)\n\nsleep(1000)\nselect * from output1\n```\n\nExample 5:\n\nSet the time of the second session to 13:00:00-15:00:30, and set *mergeLastWindow*to true. The start time and end time of the session will not be aligned, and the data from the last incomplete window \\[15:00:00, 15:00:30) will join the previous window \\[14:59:00, 15:00:00), forming a \\[14:59:00,15:00:30) window for calculation.\n\n```\ndropStreamEngine(\"engine1\")\nunsubscribeTable(tableName=\"trades\", actionName=\"engine1\")\nundef(`trades, SHARED)\nundef(`output1,SHARED)\n\nshare streamTable(1000:0, `date`second`sym`volume, [DATE, SECOND, SYMBOL, INT]) as trades\nshare keyedTable(`time`sym, 10000:0, `time`sym`sumVolume, [DATETIME, SYMBOL, INT]) as output1\nengine1 = createDailyTimeSeriesEngine(name=\"engine1\", windowSize=60, step=60, timeColumn=`date`second,\n  metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1,  \n  useSystemTime=false, keyColumn=`sym, garbageSize=50, \n  useWindowStartTime=false, sessionBegin=09:00:00 13:00:00, \n  sessionEnd=11:30:00 15:00:30, roundTime=false, mergeLastWindow=true)\nsubscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, \n  handler=append!{engine1}, msgAsTable=true);\n\ninsert into trades values(2018.10.08,13:00:10,`A,16)\ninsert into trades values(2018.10.08,13:00:12,`B,9)\ninsert into trades values(2018.10.08,14:29:56,`A,20)\ninsert into trades values(2018.10.08,14:29:58,`B,20)\ninsert into trades values(2018.10.08,14:31:00,`A,10)\ninsert into trades values(2018.10.08,14:55:00,`B,29)\ninsert into trades values(2018.10.08,14:56:00,`B,29)\ninsert into trades values(2018.10.08,14:57:01,`A,29)\ninsert into trades values(2018.10.08,14:57:01,`B,29)\ninsert into trades values(2018.10.08,14:59:01,`B,29)\ninsert into trades values(2018.10.08,14:59:01,`A,29)\ninsert into trades values(2018.10.08,15:00:01,`B,29)\ninsert into trades values(2018.10.08,15:00:01,`A,29)\ninsert into trades values(2018.10.08,15:00:31,`B,29)\ninsert into trades values(2018.10.08,15:00:31,`A,29)\nsleep(2000)\nselect * from output1\n```\n\n| **Time**            | **Symbol** | **Sum Volume** |\n| ------------------- | ---------- | -------------- |\n| 2018.10.08T13:01:00 | A          | 16             |\n| 2018.10.08T13:01:00 | B          | 9              |\n| 2018.10.08T14:30:00 | A          | 20             |\n| 2018.10.08T14:30:00 | B          | 20             |\n| 2018.10.08T14:56:00 | B          | 29             |\n| 2018.10.08T14:32:00 | A          | 10             |\n| 2018.10.08T14:57:00 | B          | 29             |\n| 2018.10.08T14:58:00 | A          | 29             |\n| 2018.10.08T14:58:00 | B          | 29             |\n| 2018.10.08T15:00:30 | A          | 58             |\n| 2018.10.08T15:00:30 | B          | 58             |\n"
    },
    "createDeviceEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createDeviceEngine.html",
        "signatures": [
            {
                "full": "createDeviceEngine(name, metrics, dummyTable, outputTable, [keyColumn],[keepOrder])",
                "name": "createDeviceEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[keepOrder]",
                        "name": "keepOrder",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createDeviceEngine](https://docs.dolphindb.com/en/Functions/c/createDeviceEngine.html)\n\n**Note:** This function is not supported by Community Edition. You can [get a trial](https://dolphindb.com/product#downloads-down) of Shark from DolphinDB official website.\n\n#### Syntax\n\ncreateDeviceEngine(name, metrics, dummyTable, outputTable, \\[keyColumn],\\[keepOrder])\n\n#### Details\n\nCreate a device engine which conducts the calculations defined in the *metrics*with GPU acceleration.\n\n**Note:** The device engine does not retain any state information from one batch of data to the next. In other words, when two batches are processed, the second batch is processed independently of the first batch.\n\nThe following functions can be accelerated using GPUs:\n\n* Basic unary operation: not, neg, cast, log, log2, log10 ,log1p ,abs, sign, sqrt, sin, sinh, asin, asinh, cos, cosh, acos, acosh, tan, tanh, atan, atanh, reciprocal, cbrt, exp, exp2, expm1\n\n* Basic binary operation: add, sub, mul, div, ratio, pow, lt, gt, le, ge, eq, ne, and, or, or\\_\\_, max, min\n\n* Binary operation on integers: mod, bitAnd, bitOr, bitXor, lshift, rshift\n\n* Ternary operation: iif\n\n* Unary moving functions: mavg, msum, mcount, mprod, mvar, mvarp, mstd, mstdp, mskew, mkurtosis, mmin, mmax, mimin, mimax, sma, wma, mfirst, mlast, mrank, mmaxPositiveStreak, mmed, mpercentile, mmad (*useMedian* is currently not supported)\n\n* TALib-series Unary moving functions: sma, ema, wma, dema, tema, trima, t3, wilder, gema, linearTimeTrend, ma, talib (only the `m-` /moving functions and `mTopN-`/moving TopN functions are accepted)\n\n* Binary moving functions: mcorr, mbeta, mcovar, mwsum, mwavg\n\n* Other moving functions: linearTimeTrend, mslr\n\n* Unary cumulative functions: cumsum, cumprod, cummin, cummax, cumvar, cumvarp, cumstd, cumstdp, cumnunique, cumfirstNot, cumlastNot, cumavg, cumcount, cumPositiveStreak\n\n* Binary cumulative functions: cumcorr, cumcovar, cumbeta, cumwsum, cumwavg\n\n* Order-sensitive functions: deltas, ratios, ffill, move, prev, next, percentChange, iterate, prevState, ewmMean, ewmVar, ewmStd, ewmCov, ewmCorr\n\n  **Note:** For `ewmVar`, `ewmStd`, `ewmCov`, and `ewmCorr`, the *adjust* parameter must be set to false and *bias*must be true.\n\n* Moving TopN functions: msumTopN, mavgTopN, mstdpTopN, mstdTopN, mvarTopN, mvarpTopN, mwsumTopN, mcorrTopN, mcovarTopN, mbetaTopN, mskewTopN, mkurtosisTopN\n\n* Row-based functions: rowMin, rowMax, rowAnd, rowOr, rowXor, rowProd, rowSum, rowSum2, rowSize, rowCount, rowAvg, rowVar, rowVarp, rowStd, rowStdp\n\n* Time-based moving functions: tmsum, tmsum2, tmavg, tmprod, tmcount, tmvar, tmvarp, tmstd, tmstdp, tmcovar, tmcorr, tmwavg, tmwsum, tmbeta, tmfirst, tmlast, tmmin, tmmax, tmskew, tmkurtosis, tmove\n\n* Other functions: TrueRange, topRange, lowRange, stateMavg\n\n**Note:** Starting from version 3.00.1, when the absolute value of a calculation result is less than DBL\\_EPSILON\\*10000 *(approximately 2.22\\**10^-12), all moving functions and cumulative window functions will retain full precision instead of rounding the result.\n\n#### Parameters\n\n**name** is a string of the engine name. It is the only identifier of a reactive state engine on a data/compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**metrics** is metacode specifying the formulas for calculation. It can include one or more expressions, built-in functions, or user-defined functions. User-defined functions must have a single return value and must not contain embedded for loops or any loops that exceed 100 iterations. It can also include a constant or a vector of constants (in which case, the output column must be of the array vector type). For more information about metacode, refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter.\n\n**outputTable** is the output table for the results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the grouping column(s).\n\n**keepOrder** (optional) specifies whether to preserve the insertion order of the records in the output table. The default value is false, meaning data is sorted by *keyColumn*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\n// create a device engine\ndummyTb = table(1:0, `sym`id`value, [SYMBOL,INT,DOUBLE])\nshare table(100:0, `sym`id`flag`value`factor, [SYMBOL,INT,SYMBOL,DOUBLE,DOUBLE]) as result\nde = createDeviceEngine(name=\"myDe\", metrics=[<id>,<\"flag\"+\"_A\">,<value>,<mavg(value,5)>], dummyTable=dummyTb, outputTable=result, keyColumn=\"sym\")\n\n// simulate data\ndata1 = table(take(\"A\", 100) as sym, 1..100 as id, double(10+1..100) as value)\ndata2 = table(take(\"B\", 100) as sym, 1..100 as id, double(20+1..100) as value)\ndata3 = table(take(\"C\", 100) as sym, 1..100 as id, double(30+1..100) as value)\ndata = data1.unionAll(data2).unionAll(data3).sortBy!(`id)\n\n// write data\nde.append!(data)\nselect top 10 * from result\n```\n\n| sym | id | flag    | value | factor |\n| --- | -- | ------- | ----- | ------ |\n| A   | 1  | flag\\_A | 11    |        |\n| A   | 2  | flag\\_A | 12    |        |\n| A   | 3  | flag\\_A | 13    |        |\n| A   | 4  | flag\\_A | 14    |        |\n| A   | 5  | flag\\_A | 15    | 13     |\n| A   | 6  | flag\\_A | 16    | 14     |\n| A   | 7  | flag\\_A | 17    | 15     |\n| A   | 8  | flag\\_A | 18    | 16     |\n| A   | 9  | flag\\_A | 19    | 17     |\n| A   | 10 | flag\\_A | 20    | 18     |\n\nIn the above example, the *keepOrder* parameter is not specified, so the output table is sorted by *keyColumn*. If `keepOrder=true` is specified when creating the engine, the output table preserves the insertion order, as shown in the following example.\n\n```\n// create a device engine\ndummyTb = table(1:0, `sym`id`value, [SYMBOL,INT,DOUBLE])\nshare table(100:0, `sym`id`flag`value`factor, [SYMBOL,INT,SYMBOL,DOUBLE,DOUBLE]) as result\nde = createDeviceEngine(name=\"myDe\", metrics=[<id>,<\"flag\"+\"_A\">,<value>,<mavg(value,5)>], dummyTable=dummyTb, outputTable=result, keyColumn=\"sym\",keepOrder=true)\n\n// simulate data\ndata1 = table(take(\"A\", 100) as sym, 1..100 as id, double(10+1..100) as value)\ndata2 = table(take(\"B\", 100) as sym, 1..100 as id, double(20+1..100) as value)\ndata3 = table(take(\"C\", 100) as sym, 1..100 as id, double(30+1..100) as value)\ndata = data1.unionAll(data2).unionAll(data3).sortBy!(`id)\n\n// write data\nde.append!(data)\nselect top 10 * from result\n```\n\n| sym | id | flag    | value | factor |\n| --- | -- | ------- | ----- | ------ |\n| A   | 1  | flag\\_A | 11    |        |\n| B   | 1  | flag\\_A | 21    |        |\n| C   | 1  | flag\\_A | 31    |        |\n| A   | 2  | flag\\_A | 12    |        |\n| B   | 2  | flag\\_A | 22    |        |\n| C   | 2  | flag\\_A | 32    |        |\n| A   | 3  | flag\\_A | 13    |        |\n| B   | 3  | flag\\_A | 23    |        |\n| C   | 3  | flag\\_A | 33    |        |\n| A   | 4  | flag\\_A | 14    |        |\n\n"
    },
    "createDimensionTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createDimensionTable.html",
        "signatures": [
            {
                "full": "createDimensionTable(dbHandle, table, tableName, [compressMethods], [sortColumns|primaryKey], [keepDuplicates=ALL], [softDelete=false], [indexes]), [encryptMode='plaintext'])",
                "name": "createDimensionTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[compressMethods]",
                        "name": "compressMethods",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns|primaryKey]",
                        "name": "[sortColumns|primaryKey]"
                    },
                    {
                        "full": "[keepDuplicates=ALL]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "ALL"
                    },
                    {
                        "full": "[softDelete=false]",
                        "name": "softDelete",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[indexes])",
                        "name": "indexes",
                        "optional": true
                    },
                    {
                        "full": "[encryptMode='plaintext']",
                        "name": "encryptMode",
                        "optional": true,
                        "default": "'plaintext'"
                    }
                ]
            },
            {
                "full": "createDimensionTable(dbHandle, table, tableName, [compressMethods], [sortColumns], [keepDuplicates=ALL], [softDelete=false]), [encryptMode='plaintext'])",
                "name": "createDimensionTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[compressMethods]",
                        "name": "compressMethods",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns]",
                        "name": "sortColumns",
                        "optional": true
                    },
                    {
                        "full": "[keepDuplicates=ALL]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "ALL"
                    },
                    {
                        "full": "[softDelete=false])",
                        "name": "softDelete",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[encryptMode='plaintext']",
                        "name": "encryptMode",
                        "optional": true,
                        "default": "'plaintext'"
                    }
                ]
            }
        ],
        "markdown": "### [createDimensionTable](https://docs.dolphindb.com/en/Functions/c/createDimensionTable.html)\n\n\n\n#### Syntax\n\ncreateDimensionTable(dbHandle, table, tableName, \\[compressMethods], \\[sortColumns|primaryKey], \\[keepDuplicates=ALL], \\[softDelete=false], \\[indexes]), \\[encryptMode='plaintext'])\n\ncreateDimensionTable(dbHandle, table, tableName, \\[compressMethods], \\[sortColumns], \\[keepDuplicates=ALL], \\[softDelete=false]), \\[encryptMode='plaintext'])\n\nAlias: createTable\n\n#### Details\n\nThis function creates an empty dimension (non-partitioned) table in a DFS database, used to store small datasets with infrequent updates. During query, all data in a dimension table will be loaded into the memory.\n\nThe system will regularly check the memory usage. When memory usage exceeds *warningMemSize*, the system will discard the least recently used (LRU) data from memory to clean up the cache. Users can also manually call command `clearCachedDatabase` to clear the cached data.\n\nLike partitioned tables, a dimension table can have multiple replicas (determined by the configuration parameter *dfsReplicationFactor*).\n\nTo enable concurrent writes, updates or deletes on a dimension table, set the configuration parameter *enableConcurrentDimensionalTableWrite* to true.\n\n#### Parameters\n\n**Note:** The parameters *sortColumns* and *keepDuplicates* take effect only in a TSDB storage engine (i.e., `database().engine` = TSDB).\n\n**dbHandle** is a DFS database handle returned by function [database](https://docs.dolphindb.com/en/Functions/d/database.html).\n\n**table** is a table object. The table schema will be used to construct the new dimension table.\n\n**tableName** is a string indicating the name of the dimension table. The table name can only consists of letters, digits or underscores (\\_), and must begin with a letter.\n\n**compressMethods** (optional) is a dictionary indicating which compression methods are used for specified columns. The keys are columns name and the values are compression methods (\"lz4\", \"delta\", \"zstd\" or \"chimp\"). If unspecified, use LZ4 compression method.\n\nNote:\n\n* The \"delta\" (delta-of-delta) compression method can be used for DECIMAL, SHORT, INT, LONG or temporal data types.The delta compression method applies delta-of-delta algorithm, which is particularly suitable for data types like SHORT, INT, LONG, and date/time data.\n* Save strings as SYMBOL type to enable compression of strings.\n* The chimp compression method can be used for DOUBLE type data with decimal parts not exceeding three digits in length.\n\n**sortColumns** (optional) is a STRING scalar/vector that specifies the column(s) used to sort the ingested data within each level file. The sort columns must be of Integral, Temporal, STRING, SYMBOL, or DECIMAL type. Note that *sortColumns* is not necessarily consistent with the partitioning column.\n\n* If multiple columns are specified for *sortColumns*, the last column must be either a temporal column or an integer column. The preceding columns are used as the sort keys and they cannot be of TIME, TIMESTAMP, NANOTIME, or NANOTIMESTAMP type.\n* If only one column is specified for *sortColumns*, the column is used as the sort key, and it can be a time column or not. If the sort column is a time column and *sortKeyMappingFunction* is specified, the sort column specified in a SQL where condition can only be compared with temporal values of the same data type.\n* It is recommended to specify frequently-queried columns for *sortColumns* and sort them in the descending order of query frequency, which ensures that frequently-used data is readily available during query processing.\n* The number of sort key entries (which are unique combinations of the values of the sort keys) may not exceed 1000 for optimal performance. This limitation prevents excessive memory usage and ensures efficient query processing.\n\n**primaryKey** (optional) is a STRING scalar/vector that specifies the primary key column(s), uniquely identifying each record in a DFS table of **the PKEY database**. For records with the same primary key, only the latest one is retained. Note that:\n\n* The primary key columns must be of Logical, Integral (excluding COMPRESSED), Temporal, STRING, SYMBOL, or DECIMAL type.\n* With more than one primary key column, a composite primary key is maintained. The composite primary key uses a Bloomfilter index by default (see the *indexes* parameter for details).\n\n**keepDuplicates** (optional) specifies how to deal with records with duplicate *sortColumns* values. It can have the following values:\n\n* ALL: keep all records;\n* LAST: only keep the last record;\n* FIRST: only keep the first record.\n\n**softDelete** (optional) determines whether to enable soft delete for TSDB databases. The default value is false. To use it, *keepDuplicates* must be set to 'LAST'. It is recommended to enable soft delete for databases where the row count is large and delete operations are infrequent.\n\n**indexes** (optional) is a dictionary with columns as keys and index types as values. Both keys and values are of STRING type. *indexes* can only be set for tables of PKEY databases.\n\n* Currently, only \"bloomfilter\" index type is available. Bloomfilter indexing excels in point queries on high-cardinality columns (e.g., ID card numbers, order numbers, foreign keys from upstreams).\n* It supports indexing on columns of the following data types: BOOL, CHAR, SHORT, INT, LONG, BLOB, STRING, DECIMAL32, DECIMAL64, DECIMAL128.\n* Composite primary keys are automatically indexed with Bloomfilter. Columns not specified in *indexes* default to ZoneMap indexing.\n\n**encryptMode** (optional, Linux only) is a STRING scalar specifying the encryption mode for IMOLTP tables. The default is no encryption (plaintext mode). Supported values (case-insensitive) include: plaintext, aes\\_128\\_ctr, aes\\_128\\_cbc, aes\\_128\\_ecb, aes\\_192\\_ctr, aes\\_192\\_cbc, aes\\_192\\_ecb, aes\\_256\\_ctr, aes\\_256\\_cbc, aes\\_256\\_ecb, sm4\\_128\\_cbc, sm4\\_128\\_ecb.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1\n\n```\ndb=database(\"dfs://db1\",VALUE,1 2 3)\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nt = table(timestamp, sym, qty, price);\n\ndt=db.createDimensionTable(t,`dt).append!(t);\nselect * from dt;\n```\n\n| timestamp | sym | qty  | price  |\n| --------- | --- | ---- | ------ |\n| 09:34:07  | C   | 2200 | 49.6   |\n| 09:36:42  | MS  | 1900 | 29.46  |\n| 09:36:51  | MS  | 2100 | 29.52  |\n| 09:36:59  | MS  | 3200 | 30.02  |\n| 09:32:47  | IBM | 6800 | 174.97 |\n| 09:35:26  | IBM | 5400 | 175.23 |\n| 09:34:16  | C   | 1300 | 50.76  |\n| 09:34:26  | C   | 2500 | 50.32  |\n| 09:38:12  | C   | 8800 | 51.29  |\n\nExample 2\n\n```\ndb = database(\"dfs://demodb\", VALUE, 1..10)\nt=table(take(1, 86400) as id, 2020.01.01T00:00:00 + 0..86399 as timestamp, rand(1..100, 86400) as val)\ndt = db.createDimensionTable(t, \"dt\", {timestamp:\"delta\", val:\"delta\"})\ndt.append!(t)\n```\n\nExample 3. Create a dimension table in a TSDB database\n\n```\nif(existsDatabase(\"dfs://dbctable_createDimensionTable\")){\n    dropDatabase(\"dfs://dbctable_createDimensionTable\")\n}\ndb = database(\"dfs://dbctable_createDimensionTable\", VALUE, 1..100, , \"TSDB\")\nt1 = table(1 100 100 300 300 400 500 as id, 1..7 as v)\ndb.createDimensionTable(t1, \"dt\", , \"id\").append!(t1)\ndt=loadTable(\"dfs://dbctable_createDimensionTable\",\"dt\")\n```\n\nExample 4. Create a dimension table in a PKEY database.\n\n```\ndb = database(directory=\"dfs://PKDB\", partitionType=VALUE, partitionScheme=1..10, engine=\"PKEY\")\nschematb = table(1:0,`id1`id2`val1`val2`date1`time1,[INT,INT,INT,DECIMAL32(2),DATE,TIME])\npkt = createDimensionTable(dbHandle=db, table=schematb, tableName=\"pkt\", primaryKey=`id1`id2, indexes={\"val1\": \"bloomfilter\", \"val2\": \"bloomfilter\"})\n```\n\nRelated functions: [createPartitionedTable](https://docs.dolphindb.com/en/Functions/c/createPartitionedTable.html)\n"
    },
    "createDistributedInMemoryTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createDistributedInMemoryTable.html",
        "signatures": [
            {
                "full": "createDistributedInMemoryTable(tableName, colNames, colTypes, globalPartitionType, globalPartitionScheme, globalPartitionColumn, [localPartitionType], [localPartitionScheme], [localPartitionColumn])",
                "name": "createDistributedInMemoryTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "globalPartitionType",
                        "name": "globalPartitionType"
                    },
                    {
                        "full": "globalPartitionScheme",
                        "name": "globalPartitionScheme"
                    },
                    {
                        "full": "globalPartitionColumn",
                        "name": "globalPartitionColumn"
                    },
                    {
                        "full": "[localPartitionType]",
                        "name": "localPartitionType",
                        "optional": true
                    },
                    {
                        "full": "[localPartitionScheme]",
                        "name": "localPartitionScheme",
                        "optional": true
                    },
                    {
                        "full": "[localPartitionColumn]",
                        "name": "localPartitionColumn",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/c/createDistributedInMemoryTable.html)\n\n\n\n#### Syntax\n\ncreateDistributedInMemoryTable(tableName, colNames, colTypes, globalPartitionType, globalPartitionScheme, globalPartitionColumn, \\[localPartitionType], \\[localPartitionScheme], \\[localPartitionColumn])\n\n#### Details\n\nCreate 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 in cluster mode.\n\nA distributed in-memory table is stored on different nodes (data nodes or 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.\n\nA distributed in-memory table can be partitioned on 2 different levels:\n\n* global (across nodes): a distributed in-memory table is partitioned and the partitions are stored on different nodes. The number of global partitions must be greater than or equal to 2, but no greater than the total number of data nodes and compute nodes.\n\n* local (within node, optional): data within each node can be partitioned again. If both global and local partitioning are adopted, the partitioning scheme of the distributed in-memory table is equivalent to a composite domain.\n\n**Note**:\n\n* To access the distributed in-memory table from other nodes, use function [loadDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/l/loadDistributedInMemoryTable.html) first to load the table.\n* To drop a distributed in-memory table, use command [dropDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/d/dropDistributedInMemoryTable.html).\n* Transactions are not supported currently for distributed in-memory tables.\n\n#### Parameters\n\n**tableName** is a STRING scalar indicating the name of a distributed in-memory table.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a vector indicating data types of columns specified by *colNames*.\n\n**globalPartitionType** is a required parameter indicating the partition type for a table in a cluster, which only supports RANGE, HASG, VALUE, and LIST.\n\n**globalPartitionScheme** is a required parameter indicating the partitioning scheme that describes how the partitions are created in a cluster.\n\nThe partition type and partitioning scheme are shown as follows:\n\n| Partition Type | Partition Type Symbol | Partitioning Scheme                                                                                                 |\n| -------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------- |\n| range domain   | RANGE                 | A vector. Any two adjacent elements of the vector define the range for a partition.                                 |\n| hash domain    | HASH                  | A tuple. The first element is the data type of partitioning column. The second element is the number of partitions. |\n| value domain   | VALUE                 | A vector. Each element of the vector defines a partition.                                                           |\n| list domain    | LIST                  | A vector. Each element of the vector defines a partition.                                                           |\n\n**globalPartitionColumn** is a required parameter. It is a STRING scalar indicating the partitioning column for a table in a cluster.\n\nThe 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.\n\nThe data within each node can be partitioned again through the following parameters.\n\n**localPartitionType** (optional) indicates the partition type within a node, which only supports RANGE, HASG, VALUE, and LIST.\n\n**localPartitionScheme** (optional) indicates the partitioning scheme that describes how the partitions are created within a node.\n\n**localPartitionColumn** (optional) is a STRING scalar indicating the partitioning column within a node.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nCreate a distributed in-memory table.\n\nThe 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.\n\n```\npt = createDistributedInMemoryTable(`dt, `time`id`value, `DATETIME`INT`LONG, HASH, [INT, 2],`id)\n```\n\nLoad a distributed in-memory table on node2 and insert data into it.\n\n```\ntime = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);\nid = 0..39;\nvalue = rand(100, 40);\ntmp = table(time, id, value);\n\npt = loadDistributedInMemoryTable(`dt)\npt.append!(tmp);\n\nselect * from pt;\n```\n\nCheck whether a distributed in-memory table exists.\n\n```\nobjs(true)\n```\n\nDelete a distributed in-memory table.\n\n```\ndropDistributedInMemoryTable(`dt)\n```\n"
    },
    "createDualOwnershipReactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createDualOwnershipReactiveStateEngine.html",
        "signatures": [
            {
                "full": "createDualOwnershipReactiveStateEngine(name, metrics1, metrics2, dummyTable, outputTable, keyColumn1, keyColumn2, [snapshotDir], [snapshotIntervalInMsgCount], [keyPurgeFilter1], [keyPurgeFilter2], [keyPurgeFreqInSecond=0], [raftGroup], [outputHandler], [msgAsTable=false])",
                "name": "createDualOwnershipReactiveStateEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics1",
                        "name": "metrics1"
                    },
                    {
                        "full": "metrics2",
                        "name": "metrics2"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "keyColumn1",
                        "name": "keyColumn1"
                    },
                    {
                        "full": "keyColumn2",
                        "name": "keyColumn2"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter1]",
                        "name": "keyPurgeFilter1",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter2]",
                        "name": "keyPurgeFilter2",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=0]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[outputHandler]",
                        "name": "outputHandler",
                        "optional": true
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createDualOwnershipReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createDualOwnershipReactiveStateEngine.html)\n\n\n\n#### Syntax\n\ncreateDualOwnershipReactiveStateEngine(name, metrics1, metrics2, dummyTable, outputTable, keyColumn1, keyColumn2, \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[keyPurgeFilter1], \\[keyPurgeFilter2], \\[keyPurgeFreqInSecond=0], \\[raftGroup], \\[outputHandler], \\[msgAsTable=false])\n\n#### Details\n\nThe dual-ownership reactive state streaming engine extends the functionality of the reactive state streaming engine with support for parallel computing on 2 groups with different metrics of a stream table. Compared to the cascade of reactive state streaming engines, this function has greatly improved the computing performance.\n\n**Note:**\n\n* The output table is sorted in the same order as the input, i.e., *keepOrder* is only set to true in the engine.\n* Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n#### Argument\n\nOnly the parameters of `createDualOwnershipReactiveStateEngine` and [createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html) with different usages are explained here.\n\nFor data grouped by *keyColumn1*, they are calculated based on *metrics1* and purged based on *keyPurgeFilter1*; For data grouped by *keyColumn2*, they are calculated based on *metrics2* and purged based on *keyPurgeFilter2*.\n\n**outputTable** specifies the output table. It can be an in-memory table or a DFS table. Create an empty table and specify the names and data types of the columns before calling the function.\n\nThe output columns are in the following order:\n\n(1) The common columns of *keyColumn1* and *keyColumn2*;\n\n(2) Other columns of *keyColumn1* and *keyColumn2*;\n\n(3) The result columns of *metrics1* and *metrics2*.\n\n**outputHandler** (optional) is a unary function or a partial function with a single unfixed parameter. If set, the engine will not write the calculation results to the output table directly. Instead, the results will be passed as a parameter to the *outputHandler* function.\n\n**msgAsTable** (optional) is a Boolean scalar indicating whether the output data is passed into function (specified by *outputHandler*) as a table or as a tuple. If *msgAsTable*=true, the subscribed data is passed into function as a table. The default value is false, which means the output data is passed into function as a tuple of columns.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n```\nshare streamTable(1:0, `date`time`sym`market`price`qty, [DATE, TIME, SYMBOL, CHAR, DOUBLE, INT]) as trades\noutputTable = table(100:0, `date`sym`market`factor1`factor2, [DATE, SYMBOL, CHAR, DOUBLE, DOUBLE])\ndors = createDualOwnershipReactiveStateEngine(name=\"test\", metrics1=<mfirst(price, 3)>, metrics2=<mmax(price, 3)>, dummyTable=trades, outputTable=outputTable, keyColumn1=`date`sym, keyColumn2=`date`market)\ntmp = table(1:0, `date`time`sym`market`price`qty, [DATE, TIME, SYMBOL, CHAR, DOUBLE, INT])\nsubscribeTable(tableName=`trades, actionName=\"test\",msgAsTable=true, handler=tableInsert{dors})\ninsert into tmp values(2012.01.01, 09:00:00.030, `a, 'B', 10.65, 1500)\ninsert into tmp values(2012.01.01, 09:00:00.030, `a, 'B', 10.59, 2500)\ninsert into tmp values(2012.01.01, 09:00:00.031, `b, 'A', 10.59, 2500)\ninsert into tmp values(2012.01.01, 09:00:00.031, `a, 'B', 10.65, 1500)\ninsert into tmp values(2012.01.01, 09:00:00.031, `a, 'A', 10.59, 2500)\ninsert into tmp values(2012.01.01, 09:00:00.033, `b, 'B', 10.59, 2500)\ninsert into tmp values(2012.01.01, 09:00:00.033, `a, 'A', 10.59, 2500)\ninsert into tmp values(2012.01.01, 09:00:00.034, `b, 'A', 10.59, 2500)\ninsert into tmp values(2012.01.01, 09:00:00.034, `b, 'A', 10.22, 1200)\ninsert into tmp values(2012.01.01, 09:00:00.035, `a, 'A', 11.0, 2500)\ninsert into tmp values(2012.01.02, 09:00:00.031, `b, 'A', 10.22, 1200)\ninsert into tmp values(2012.01.02, 09:00:00.032, `a, 'B', 11.0, 2500)\ninsert into tmp values(2012.01.02, 09:00:00.032, `b, 'B', 15.6, 1300)\ninsert into tmp values(2012.01.02, 09:00:00.040, `c, 'B', 13.2, 2000)\ntrades.append!(tmp)\n\nselect * from outputTable\n```\n\n| date       | sym | market | factor1 | factor2 |\n| ---------- | --- | ------ | ------- | ------- |\n| 2012.01.01 | a   | 'B'    |         |         |\n| 2012.01.01 | a   | 'B'    |         |         |\n| 2012.01.01 | b   | 'A'    |         |         |\n| 2012.01.01 | a   | 'B'    | 10.65   | 10.65   |\n| 2012.01.01 | a   | 'A'    | 10.59   |         |\n| 2012.01.01 | b   | 'B'    |         | 10.65   |\n| 2012.01.01 | a   | 'A'    | 10.65   | 10.59   |\n| 2012.01.01 | b   | 'A'    | 10.59   | 10.59   |\n| 2012.01.01 | b   | 'A'    | 10.59   | 10.59   |\n| 2012.01.01 | a   | 'A'    | 10.59   | 11      |\n| 2012.01.02 | b   | 'A'    |         |         |\n| 2012.01.02 | a   | 'B'    |         |         |\n| 2012.01.02 | b   | 'B'    |         |         |\n| 2012.01.02 | c   | 'B'    |         | 15.6    |\n\n```\nunsubscribeTable(tableName=`trades, actionName=\"dors\")\nundef(`trades,SHARED)\ndropStreamEngine(\"dors\")\n```\n"
    },
    "createEqualJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createEqualJoinEngine.html",
        "signatures": [
            {
                "full": "createEquiJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, timeColumn, [garbageSize=5000], [maxDelayedTime], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createEquiJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[garbageSize=5000]",
                        "name": "garbageSize",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[maxDelayedTime]",
                        "name": "maxDelayedTime",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createEqualJoinEngine](https://docs.dolphindb.com/en/Functions/c/createEqualJoinEngine.html)\n\nAlias for [createEquiJoinEngine](https://docs.dolphindb.com/en/Functions/c/createEquiJoinEngine.html)\n\n\nDocumentation for the `createEquiJoinEngine` function:\n### [createEquiJoinEngine](https://docs.dolphindb.com/en/Functions/c/createEquiJoinEngine.html)\n\n\n\n#### Syntax\n\ncreateEquiJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, timeColumn, \\[garbageSize=5000], \\[maxDelayedTime], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\nAlias: createEqualJoinEngine\n\n#### Details\n\nCreate an equi join streaming engine. Streams are ingested into the engine through left and right tables and joined on *matchingColumn* and *timeColumn*. Return a table object that is the equi join result of a left table and a right table. The result holds all records with matching values.\n\nThe equi-join engine is designed to process keyed streams that have the join columns and the time column as the key. Since it does not cache all the historical data, a newly ingested record may not find a match in the other table if the matching record has already been removed from cache, leading to behavior that differs from a traditional SQL equi join.\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n#### Calculation Rules\n\nWhen data is ingested into one table, the equi join streaming engine searches for records with matching values in the other table. If matches are found, the engine outputs the combined records with additional columns holding the calculation results of *metrics*.\n\n#### Parameters\n\nSome parameters of the equi join engine are the same as those of the asof join engine, please refer to the function [createAsofJoinEngine](https://docs.dolphindb.com/en/Functions/c/createAsofJoinEngine.html) for detailed information. The different parameters are described as below:\n\n**name** is a string indicating the name of the equi join streaming engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**timeColumn** is a STRING scalar or vector indicating the time columns in the left table and the right table. The time columns in the left and right tables must have the same data type. When the two time columns have the same column name, *timeColumn* is a string scalar; otherwise, *timeColumn* is vector of two strings.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (in unit of rows). When the number of rows of historical data in memory exceeds the *garbageSize*, the system will remove the historical data that is not needed for the current calculation on the following conditions:\n\n* The historical data has already been joined and returned.\n\n* For historical data that has not been joined, if the timestamp difference between the historical data and the new arriving data in left/right table has exceeded the *maxDelayedTime*, it will also be discarded.\n\n**maxDelayedTime** (optional) is a positive integer with the default value of 3 (seconds), indicating the maximum time to keep cached data in the engine. This parameter only takes effect when the conditions described in *garbageSize* are met. It is not recommended to set the *maxDelayedTime* too small in case data got removed before it is joined.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\nExample 1.\n\n```\nshare streamTable(1:0, `time`sym`price, [SECOND, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [SECOND, SYMBOL, DOUBLE]) as rightTable\nshare table(100:0, `time`sym`price`val`total, [SECOND, SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\nejEngine=createEquiJoinEngine(\"test1\", leftTable, rightTable, output, [<price>, <val>, <price*val>], `sym, `time)\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{ejEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{ejEngine, false}, msgAsTable=true)\n\ntmp1=table(13:30:10+1..20 as time, take(`AAPL, 10) join take(`IBM, 10) as sym, double(1..20) as price)\nleftTable.append!(tmp1)\ntmp2=table(13:30:10+1..20 as time, take(`AAPL, 10) join take(`IBM, 10) as sym, double(50..31) as val)\nrightTable.append!(tmp2)\n\nselect count(*) from output\n// output: 20\n```\n\nExample 2. The type of the *timeColumn* is timestamp. The default value of *maxDelayedTime* is 3000ms (3s).\n\n```\nshare streamTable(5000000:0, `timestamp`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(5000000:0, `timestamp`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\nshare table(5000000:0, `timestamp`sym`price`val`total`diff`ratio, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE]) as output\nejEngine=createEquiJoinEngine(\"test1\", leftTable, rightTable, output, <[price, val, price+val, price-val, price/val]>, `sym, `timestamp, 5000)\ntopic1=subscribeTable(tableName=\"leftTable\", actionName=\"writeLeft\", offset=0, handler=appendForJoin{ejEngine, true}, batchSize=10000, throttle=1)\ntopic2=subscribeTable(tableName=\"rightTable\", actionName=\"writeRight\", offset=0, handler=appendForJoin{ejEngine, false}, batchSize=10000, throttle=1)\ndef writeLeftTable(mutable tb){\n   batch = 1000\n   for(i in 1..300){\n           tmp = table(batch:batch, `timestamp`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\n           tmp[`timestamp]=take(2012.01.01T00:00:00.000+i, batch)\n           tmp[`sym]=shuffle(\"A\"+string(1..batch))\n           tmp[`price]=rand(100.0, batch)\n           tb.append!(tmp)\n   }\n}\n\ndef writeRightTable(mutable tb){\n   batch = 500\n   for(i in 1..200){\n           tmp = table(batch:batch, `timestamp`sym`val, [TIMESTAMP, SYMBOL, DOUBLE])\n           tmp[`timestamp]=take(2012.01.01T00:00:00.000+i, batch)\n           tmp[`sym]=shuffle(\"A\"+string(1..batch))\n           tmp[`val]=rand(100.0, batch)\n           tb.append!(tmp)\n   }\n}\n\njob1 = submitJob(\"writeLeft\", \"\", writeLeftTable, leftTable)\njob2 = submitJob(\"writeRight\", \"\", writeRightTable, rightTable)\n\nselect count(*) from output order by sym, timestamp\n// output: 100000\n```\n"
    },
    "createEquiJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createEquiJoinEngine.html",
        "signatures": [
            {
                "full": "createEquiJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, timeColumn, [garbageSize=5000], [maxDelayedTime], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createEquiJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[garbageSize=5000]",
                        "name": "garbageSize",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[maxDelayedTime]",
                        "name": "maxDelayedTime",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createEquiJoinEngine](https://docs.dolphindb.com/en/Functions/c/createEquiJoinEngine.html)\n\n\n\n#### Syntax\n\ncreateEquiJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, timeColumn, \\[garbageSize=5000], \\[maxDelayedTime], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\nAlias: createEqualJoinEngine\n\n#### Details\n\nCreate an equi join streaming engine. Streams are ingested into the engine through left and right tables and joined on *matchingColumn* and *timeColumn*. Return a table object that is the equi join result of a left table and a right table. The result holds all records with matching values.\n\nThe equi-join engine is designed to process keyed streams that have the join columns and the time column as the key. Since it does not cache all the historical data, a newly ingested record may not find a match in the other table if the matching record has already been removed from cache, leading to behavior that differs from a traditional SQL equi join.\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n#### Calculation Rules\n\nWhen data is ingested into one table, the equi join streaming engine searches for records with matching values in the other table. If matches are found, the engine outputs the combined records with additional columns holding the calculation results of *metrics*.\n\n#### Parameters\n\nSome parameters of the equi join engine are the same as those of the asof join engine, please refer to the function [createAsofJoinEngine](https://docs.dolphindb.com/en/Functions/c/createAsofJoinEngine.html) for detailed information. The different parameters are described as below:\n\n**name** is a string indicating the name of the equi join streaming engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**timeColumn** is a STRING scalar or vector indicating the time columns in the left table and the right table. The time columns in the left and right tables must have the same data type. When the two time columns have the same column name, *timeColumn* is a string scalar; otherwise, *timeColumn* is vector of two strings.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (in unit of rows). When the number of rows of historical data in memory exceeds the *garbageSize*, the system will remove the historical data that is not needed for the current calculation on the following conditions:\n\n* The historical data has already been joined and returned.\n\n* For historical data that has not been joined, if the timestamp difference between the historical data and the new arriving data in left/right table has exceeded the *maxDelayedTime*, it will also be discarded.\n\n**maxDelayedTime** (optional) is a positive integer with the default value of 3 (seconds), indicating the maximum time to keep cached data in the engine. This parameter only takes effect when the conditions described in *garbageSize* are met. It is not recommended to set the *maxDelayedTime* too small in case data got removed before it is joined.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\nExample 1.\n\n```\nshare streamTable(1:0, `time`sym`price, [SECOND, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [SECOND, SYMBOL, DOUBLE]) as rightTable\nshare table(100:0, `time`sym`price`val`total, [SECOND, SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\nejEngine=createEquiJoinEngine(\"test1\", leftTable, rightTable, output, [<price>, <val>, <price*val>], `sym, `time)\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{ejEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{ejEngine, false}, msgAsTable=true)\n\ntmp1=table(13:30:10+1..20 as time, take(`AAPL, 10) join take(`IBM, 10) as sym, double(1..20) as price)\nleftTable.append!(tmp1)\ntmp2=table(13:30:10+1..20 as time, take(`AAPL, 10) join take(`IBM, 10) as sym, double(50..31) as val)\nrightTable.append!(tmp2)\n\nselect count(*) from output\n// output: 20\n```\n\nExample 2. The type of the *timeColumn* is timestamp. The default value of *maxDelayedTime* is 3000ms (3s).\n\n```\nshare streamTable(5000000:0, `timestamp`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(5000000:0, `timestamp`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\nshare table(5000000:0, `timestamp`sym`price`val`total`diff`ratio, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE]) as output\nejEngine=createEquiJoinEngine(\"test1\", leftTable, rightTable, output, <[price, val, price+val, price-val, price/val]>, `sym, `timestamp, 5000)\ntopic1=subscribeTable(tableName=\"leftTable\", actionName=\"writeLeft\", offset=0, handler=appendForJoin{ejEngine, true}, batchSize=10000, throttle=1)\ntopic2=subscribeTable(tableName=\"rightTable\", actionName=\"writeRight\", offset=0, handler=appendForJoin{ejEngine, false}, batchSize=10000, throttle=1)\ndef writeLeftTable(mutable tb){\n   batch = 1000\n   for(i in 1..300){\n           tmp = table(batch:batch, `timestamp`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\n           tmp[`timestamp]=take(2012.01.01T00:00:00.000+i, batch)\n           tmp[`sym]=shuffle(\"A\"+string(1..batch))\n           tmp[`price]=rand(100.0, batch)\n           tb.append!(tmp)\n   }\n}\n\ndef writeRightTable(mutable tb){\n   batch = 500\n   for(i in 1..200){\n           tmp = table(batch:batch, `timestamp`sym`val, [TIMESTAMP, SYMBOL, DOUBLE])\n           tmp[`timestamp]=take(2012.01.01T00:00:00.000+i, batch)\n           tmp[`sym]=shuffle(\"A\"+string(1..batch))\n           tmp[`val]=rand(100.0, batch)\n           tb.append!(tmp)\n   }\n}\n\njob1 = submitJob(\"writeLeft\", \"\", writeLeftTable, leftTable)\njob2 = submitJob(\"writeRight\", \"\", writeRightTable, rightTable)\n\nselect count(*) from output order by sym, timestamp\n// output: 100000\n```\n"
    },
    "createGPLearnEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createGPLearnEngine.html",
        "signatures": [
            {
                "full": "createGPLearnEngine(trainData, targetData,[groupCol=''], [populationSize=1000], [generations=20], [tournamentSize=20], [stoppingCriteria=0.0], [constRange], [windowRange], [initDepth], [initMethod='half'], [initProgram=''], [functionSet], [maxSamples=1.0], [fitnessFunc='mse'], [parsimonyCoefficient=0.001], [crossoverMutationProb=0.9], [subtreeMutationProb=0.01], [hoistMutationProb=0.01], [pointMutationProb=0.01], [eliteCount =0], [restrictDepth=false], [deviceId=0], [seed], [verbose=true], [minimize=true], [useAbsFit=true])",
                "name": "createGPLearnEngine",
                "parameters": [
                    {
                        "full": "trainData",
                        "name": "trainData"
                    },
                    {
                        "full": "targetData",
                        "name": "targetData"
                    },
                    {
                        "full": "[groupCol='']",
                        "name": "groupCol",
                        "optional": true,
                        "default": "''"
                    },
                    {
                        "full": "[populationSize=1000]",
                        "name": "populationSize",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[generations=20]",
                        "name": "generations",
                        "optional": true,
                        "default": "20"
                    },
                    {
                        "full": "[tournamentSize=20]",
                        "name": "tournamentSize",
                        "optional": true,
                        "default": "20"
                    },
                    {
                        "full": "[stoppingCriteria=0.0]",
                        "name": "stoppingCriteria",
                        "optional": true,
                        "default": "0.0"
                    },
                    {
                        "full": "[constRange]",
                        "name": "constRange",
                        "optional": true
                    },
                    {
                        "full": "[windowRange]",
                        "name": "windowRange",
                        "optional": true
                    },
                    {
                        "full": "[initDepth]",
                        "name": "initDepth",
                        "optional": true
                    },
                    {
                        "full": "[initMethod='half']",
                        "name": "initMethod",
                        "optional": true,
                        "default": "'half'"
                    },
                    {
                        "full": "[initProgram='']",
                        "name": "initProgram",
                        "optional": true,
                        "default": "''"
                    },
                    {
                        "full": "[functionSet]",
                        "name": "functionSet",
                        "optional": true
                    },
                    {
                        "full": "[maxSamples=1.0]",
                        "name": "maxSamples",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[fitnessFunc='mse']",
                        "name": "fitnessFunc",
                        "optional": true,
                        "default": "'mse'"
                    },
                    {
                        "full": "[parsimonyCoefficient=0.001]",
                        "name": "parsimonyCoefficient",
                        "optional": true,
                        "default": "0.001"
                    },
                    {
                        "full": "[crossoverMutationProb=0.9]",
                        "name": "crossoverMutationProb",
                        "optional": true,
                        "default": "0.9"
                    },
                    {
                        "full": "[subtreeMutationProb=0.01]",
                        "name": "subtreeMutationProb",
                        "optional": true,
                        "default": "0.01"
                    },
                    {
                        "full": "[hoistMutationProb=0.01]",
                        "name": "hoistMutationProb",
                        "optional": true,
                        "default": "0.01"
                    },
                    {
                        "full": "[pointMutationProb=0.01]",
                        "name": "pointMutationProb",
                        "optional": true,
                        "default": "0.01"
                    },
                    {
                        "full": "[eliteCount =0]",
                        "name": "[eliteCount =0]"
                    },
                    {
                        "full": "[restrictDepth=false]",
                        "name": "restrictDepth",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[deviceId=0]",
                        "name": "deviceId",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[seed]",
                        "name": "seed",
                        "optional": true
                    },
                    {
                        "full": "[verbose=true]",
                        "name": "verbose",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[minimize=true]",
                        "name": "minimize",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[useAbsFit=true]",
                        "name": "useAbsFit",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [createGPLearnEngine](https://docs.dolphindb.com/en/Functions/c/createGPLearnEngine.html)\n\n**Note:** This function is not supported by Community Edition. You can [get a trial](https://dolphindb.com/product#downloads-down) of Shark from DolphinDB official website.\n\n#### Syntax\n\ncreateGPLearnEngine(trainData, targetData,\\[groupCol=''], \\[populationSize=1000], \\[generations=20], \\[tournamentSize=20], \\[stoppingCriteria=0.0], \\[constRange], \\[windowRange], \\[initDepth], \\[initMethod='half'], \\[initProgram=''], \\[functionSet], \\[maxSamples=1.0], \\[fitnessFunc='mse'], \\[parsimonyCoefficient=0.001], \\[crossoverMutationProb=0.9], \\[subtreeMutationProb=0.01], \\[hoistMutationProb=0.01], \\[pointMutationProb=0.01], \\[eliteCount =0], \\[restrictDepth=false], \\[deviceId=0], \\[seed], \\[verbose=true], \\[minimize=true], \\[useAbsFit=true])\n\n#### Details\n\nCreate a GPLearn engine for training and predicting with symbolic regression.\n\n#### Parameters\n\n* **trainData** is a table where all columns are of FLOAT or DOUBLE type, indicating the training data.\n* **targetData**is a vector of the same type as *trainData*, indicating the target data to be predicted.\n* **groupCol** (optional) is a STRING scalar or vector, indicating the name of grouping column based on which grouped calculation is performed. The default value is null, meaning no grouping column is specified. Note that the *groupCol*values are ignored in calculation.\n* **populationSize** (optional) is an integer indicating the generation size (i.e., the number of programs) for each generation. The default value is 1000.\n* **generations** (optional) is an integer indicating the number of generations (iterations) to evolve. The default value is 20.\n* **tournamentSize** (optional) is an integer indicating the number of programs that will compete to become part of the next generation. The default value is 20.\n* **stoppingCriteria** (optional) is a floating-point scalar, indicating the required criteria for the fitness. Evolution will be ended early if fitness is smaller than *stoppingCriteria*. The default value is 0, indicating the evolution will only end when the number of iterations reaches *generations*.\n* **constRange** (optional) can be 0 or 2-element floating-point vector, specifying the range of constants included in the programs. The default is \\[-1.0, 1.0].\n  * 0 means no constants will be included in the candidate programs.\n  * For a vector, its 2 elements specify the left and right boundaries (closed) for the range.\n* **windowRange** (optional) is an integral vector from which a random value is taken as the sliding window size. The default value is \\[2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30, 7, 14, 21, 48, 35, 42].\n* **initDepth** (optional) is a 2-element integral vector, indicating the range of tree depths for the initial population of naive formulas. The default value is \\[2, 6].\n* **initMethod** (optional) is a string indicating the initialization method. It can be:\n  * grow: Nodes are chosen at random from functions, constants and variables.\n  * full: Functions are chosen until the *initDepth*is reached, and then terminals are selected.\n  * half (default): Trees are grown through a 50/50 mix of 'full' and 'grow'.\n* **initProgram**(optional) is metacode or a tuple of metacode. The default value is null. This parameter is used to initialize the population. For example, `<mavg(price, 10)>`, where `mavg` is a built-in function, and price is a column from *trainData*.\n* **functionSet** (optional) is a STRING vector specifying the functions used when building and evolving programs. The default value is null, indicating all functions can be used. See appendix for the available functions.\n* **maxSamples** (optional) is a floating-point number in \\[0,1] indicating the fraction of samples involved in *fitnessFunc*. The default value is 1.0.\n* **fitnessFunc**(optional) is a FUNCTIONDEF or STRING scalar indicating the fitness function. It can be:\n  * 'mse' (default): mean squared error.\n  * 'rmse': root mean squared error.\n  * 'mae': mean absolute error.\n  * 'pearson': Pearson's product-moment correlation coefficient.\n  * 'spearmanr': Spearman's rank-order correlation coefficient.\n* **parsimonyCoefficient** (optional) is a floating-point number indicating the parsimony coefficient. This constant penalizes large programs by adjusting their fitness to be less favorable for selection. The default value is 0.0.\n* **crossoverMutationProb** (optional) is a floating-point number indicating the probability of performing crossover on a tournament winner. The default value is 0.9.\n* **subtreeMutationProb** (optional) is a floating-point number indicating the probability of performing subtree mutation on a tournament winner. The default value is 0.01.\n* **hoistMutationProb**(optional) is a floating-point number indicating the probability of performing hoist mutation on a tournament winner. The default value is 0.01.\n* **pointMutationProb**(optional) is a floating-point number indicating the probability of performing point mutation on a tournament winner. The default value is 0.01.\n* **useAbsFit**(optional) is a boolean value that determines if absolute values are used in fitness calculations for correlation-based fitness functions, i.e., *fitnessFunc* = 'pearson', 'spearmanr', or `corr`. The default value is true.\n* **dimReduceCol** (optional) is a STRING scalar or vector indicating the grouping column(s). The computation will perform grouped aggregation based on this parameter. When this parameter is specified, the mined formulas will include downsampling operators. **Note:** You must ensure that *targetData* is consistent with *trainData* in terms of the order after being grouped and aggregated by *dimReduceCol* and sorted in ascending order.\n\n**Note:** The above genetic operation probabilities must sum to no greater than 1.\n\n* **eliteCount** (optional) is an INT scalar indicating the number of elites to be preserved. A number of *eliteCount*programs with better fitness will be preserved to the next generation without mutation.\n\n* **restrictDepth**(optional) is a Boolean scalar specifying whether to strictly limit the program length to *initDepth*. The default value is false.\n\n* **deviceId** (optional) is an INT scalar or vector specifying the device ID to be used. The default value is 0.\n\n* **seed** (optional) is an integer indicating the seed used for training.\n\n* **verbose**(optional) is a Boolean scalar indicating whether to output the training information. The default value is true.\n\n* **minimize**(optional) is a Boolean scalar indicating whether to minimize or maximize the fitness score. The default value is true, i.e., a smaller score means better fitness.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\nSee [Quick Start Guide for Shark GPLearn](https://docs.dolphindb.com/en/Tutorials/gplearn_qsg.html)\n\n\n\n#### Appendix\n\nThe following table lists available functions for building and evolving formulas.\n\n| Function        | Description                                                                              |\n| --------------- | ---------------------------------------------------------------------------------------- |\n| add(x,y)        | Addition                                                                                 |\n| sub(x,y)        | Subtraction                                                                              |\n| mul(x,y)        | Multiplication                                                                           |\n| div(x,y)        | Division. If the absolute value of the divisor is less than 0.001, returns 1.            |\n| max(x,y)        | Maximum value                                                                            |\n| min(x,y)        | Minimum value                                                                            |\n| sqrt(x)         | Square root of the absolute value                                                        |\n| log(x)          | Logarithm. If x is less than 0.001, returns 0.                                           |\n| neg(x)          | Negation                                                                                 |\n| reciprocal(x)   | Reciprocal. If the absolute value of x is less than 0.001, returns 0.                    |\n| abs(x)          | Absolute value                                                                           |\n| sin(x)          | Sine function                                                                            |\n| cos(x)          | Cosine function                                                                          |\n| tan(x)          | Tangent function                                                                         |\n| sig(x)          | Sigmoid function                                                                         |\n| signum(x)       | Returns the sign of x                                                                    |\n| mcovar(x, y, n) | Covariance of x and y within a sliding window of size n                                  |\n| mcorr(x, y, n)  | Correlation of x and y within a sliding window of size n                                 |\n| mstd(x, n)      | Sample standard deviation of x within a sliding window of size n                         |\n| mmax(x, n)      | Maximum value of x within a sliding window of size n                                     |\n| mmin(x, n)      | Minimum value of x within a sliding window of size n                                     |\n| msum(x, n)      | Sum of x within a sliding window of size n                                               |\n| mavg(x, n)      | Average of x within a sliding window of size n                                           |\n| mprod(x, n)     | Product of x within a sliding window of size n                                           |\n| mvar(x, n)      | Sample variance of x within a sliding window of size n                                   |\n| mvarp(x, n)     | Population variance of x within a sliding window of size n                               |\n| mstdp(x, n)     | Population standard deviation of x within a sliding window of size n                     |\n| mimin(x, n)     | Index of the minimum value of x within a sliding window of size n                        |\n| mimax(x, n)     | Index of the maximum value of x within a sliding window of size n                        |\n| mbeta(x, y, n)  | Least-squares estimate of the regression coefficient of x on y within a window of size n |\n| mwsum(x, y, n)  | Iner product of x and y within a sliding window of size n                                |\n| mwavg(x, y, n)  | Weighted average of x with y as weights within a sliding window of size n                |\n| mfirst(x,n)     | First element of the window of size n                                                    |\n| mlast(x,n)      | Last element of the window of size n                                                     |\n| mrank(x,asc, n) | Rank of x within the sliding window of size n                                            |\n| ratios(x)       | Returns the value of x(n)/x(n−1)x(n) / x(n-1)                                            |\n| deltas(x)       | Returns the value of x(n)−x(n−1)x(n) - x(n-1)                                            |\n\nNote: For moving window operators (such as `mmax(x, n)`), the parameter *n*, which represents the window size, is randomly selected from the *windowRange*vector specified in the `createGPLearnEngine` function. In the following example, the training process randomly selects a value from \\[7,14,21] as the window size.\n\n```\nengine = createGPLearnEngine(source, predVec, windowRange=[7,14,21])\n```\n"
    },
    "createGroup": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createGroup.html",
        "signatures": [
            {
                "full": "createGroup(groupId, [userIds])",
                "name": "createGroup",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    },
                    {
                        "full": "[userIds]",
                        "name": "userIds",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createGroup](https://docs.dolphindb.com/en/Functions/c/createGroup.html)\n\n\n\n#### Syntax\n\ncreateGroup(groupId, \\[userIds])\n\n#### Details\n\nCreate a group of users. It can only be executed by an administrator.\n\nThe users specified by *userIds* must have been created with [createUser](https://docs.dolphindb.com/en/Functions/c/createUser.html).\n\n#### Parameters\n\n**groupId** is a string indicating a group name.\n\n**userId** (optional) is a STRING scalar/vector indicating the user names of the group members.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nCreate a group \"production\", and add a user with user name \"JohnSmith\".\n\n```\ncreateGroup(`production, `JohnSmith);\n```\n"
    },
    "createIMOLTPTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createIMOLTPTable.html",
        "signatures": [
            {
                "full": "createIMOLTPTable(dbHandle, table, tableName, primaryKey, [secondaryKey], [uniqueFlag])",
                "name": "createIMOLTPTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "primaryKey",
                        "name": "primaryKey"
                    },
                    {
                        "full": "[secondaryKey]",
                        "name": "secondaryKey",
                        "optional": true
                    },
                    {
                        "full": "[uniqueFlag]",
                        "name": "uniqueFlag",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createIMOLTPTable](https://docs.dolphindb.com/en/Functions/c/createIMOLTPTable.html)\n\n#### Syntax\n\ncreateIMOLTPTable(dbHandle, table, tableName, primaryKey, \\[secondaryKey], \\[uniqueFlag])\n\n#### Details\n\nCreate a table in an IMOLTP database.\n\n#### Parameters\n\n**dbHandle** is a database handle returned by the database function.\n\n**table** is a table object whose schema is used to define the schema for the new table in an IMOLTP database.\n\n**tableName** is a STRING scalar indicating the table name.\n\n**primaryKey** is a STRING scalar or vector that specifies the primary key column(s).\n\n**secondaryKey** (optional) is a STRING scalar or vector that specifies the secondary key column(s).\n\n**uniqueFlag**(optional) is a Boolean scalar or vector, indicating whether each secondary key is unique. When *uniqueFlag* is a vector, the size of *secondaryKey* and *uniqueFlag* must be the same.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nFirst, create a table in an IMOLTP database.\n\n```\ndbName = \"oltp://test_imoltp\"\ndb = database(directory=dbName, partitionType=VALUE, partitionScheme=1..100, engine=\"IMOLTP\")\n```\n\n(1) Create a table \"test\\_table\\_1\" in an IMOLTP database and define a primary key on the column \"id\".\n\n```\npt1 = createIMOLTPTable(\n    dbHandle=db,\n    table=table(1:0, [\"id\", \"val1\", \"val2\", \"sym\"], [LONG, INT, LONG, STRING]),\n    tableName=\"test_table_1\",\n    primaryKey=`id\n)\n```\n\n(2) Create a table \"test\\_table\\_2\" in an IMOLTP database. Define a primary key on columns \"id\" and \"sym\" and unique secondary keys on \"val2\" and \"sym\".\n\n```\npt2 = createIMOLTPTable(\n    dbHandle=db,\n    table=table(1:0, [\"id\", \"val1\", \"val2\", \"sym\"], [LONG, INT, LONG, STRING]),\n    tableName=\"test_table_2\",\n    primaryKey=`id`sym,\n    secondaryKey=`val2`sym,\n    uniqueFlag=true\n)\n```\n\n(3) Create a table \"test\\_table\\_3\" in an IMOLTP database. Define a primary key on the column \"id\", non-unique secondary key on \"val1\" and unique secondary key on \"sym\".\n\n```\npt3 = createIMOLTPTable(\n    dbHandle=db,\n    table=table(1:0, [\"id\", \"val1\", \"val2\", \"sym\"], [LONG, INT, LONG, STRING]),\n    tableName=\"test_table_3\",\n    primaryKey=`id,\n    secondaryKey=`val1`sym,\n    uniqueFlag=[false, true]\n)\n```\n\n"
    },
    "createIPCInMemoryTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createIPCInMemoryTable.html",
        "signatures": [
            {
                "full": "createIPCInMemoryTable(size, tableName, columnNames, columnTypes)",
                "name": "createIPCInMemoryTable",
                "parameters": [
                    {
                        "full": "size",
                        "name": "size"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "columnNames",
                        "name": "columnNames"
                    },
                    {
                        "full": "columnTypes",
                        "name": "columnTypes"
                    }
                ]
            }
        ],
        "markdown": "### [createIPCInMemoryTable](https://docs.dolphindb.com/en/Functions/c/createIPCInMemoryTable.html)\n\n\n\n#### Syntax\n\ncreateIPCInMemoryTable(size, tableName, columnNames, columnTypes)\n\n#### Details\n\nCreate a handle to inter-process communication (IPC) in-memory table. IPC in-memory tables are often used as output tables for streaming. In scenarios with extremely high latency requirements, user processes can directly access shared memory to obtain data through APIs, which greatly reduces the latency of network transmissions such as TCP.\n\nAn IPC in-memory table communicates between processes through shared memory (managed by the operating system). The shared table only supports sharing within the same physical server.\n\nRead/write is supported by the IPC in-memory table, whereas its schema cannot be changed. Writing to an IPC in-memory table is done in the same way as to a regular in-memory table. If the amount of data inserted at one time exceedes shared memory, an exception will be thrown.\n\n* Read/write mechanism: The process that writes to the shared memory is regarded as the producer, and the process that reads data from the shared memory as the consumer. Data written in the same batch is consumed (read) as a whole, and the batches are consumed in the same order as they are written. For example, if 100 records are written for the first time, and 200 records for the second time, the 100 records will be read first, 200 records of the second batch will be read next, and so on. The reading process will be blocked if all data in the shared table has been consumed, and will resume when new consumable data arrives.\n\nThe DolphinDB system allows processes to concurrently write to the memory, or to read and write at the same time. Note that there can only be one reading process at a time. As explained earlier, reading to the IPC in-memory table is an one-off operation. Concurrent reads will obtain the data written in different batches.\n\n**Note:** This function can only be used on Linux.\n\n#### Parameters\n\n**size** is an integer indicating the number of records that can be cached. The specified size must be greater than 1,000,000.\n\n**tableName** is a string indicating the name of inter-process communication (IPC) in-memory table to be created.\n\n**columnNames** is a STRING vector of column names.\n\n**columnTypes** is a vector indicating data types of columns specified by *columnNames*.\n\n#### Returns\n\nA handle.\n\n#### Examples\n\nCreate an IPC in-memory table that serves as the output table for subscription.\n\n```\nshare streamTable(10000:0,`timestamp`temperature, [TIMESTAMP,DOUBLE]) as pubTable\nipc_t = createIPCInMemoryTable(1000000, \"ipc_table\", `timestamp`temperature, [TIMESTAMP, DOUBLE])\ndef shm_append(mutable table, msg) {\n   table.append!(msg)\n}\nsubscribeTable(tableName=\"pubTable\", actionName=\"act3\", offset=0, handler=shm_append{ipc_t}, msgAsTable=true)\n// data input\n\nn = 200\ntimestamp = 2022.01.01T09:00:00.000 + 1..n\ntemp = 30 + rand(5.0,n)\n\ntableInsert(pubTable,timestamp,temp)\n```\n\nRelated functions: [dropIPCInMemoryTable](https://docs.dolphindb.com/en/Functions/d/dropIPCInMemoryTable.html), [loadIPCInMemoryTable](https://docs.dolphindb.com/en/Functions/l/loadIPCInMemoryTable.html)\n"
    },
    "createLeftSemiJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createLeftSemiJoinEngine.html",
        "signatures": [
            {
                "full": "createLeftSemiJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, [garbageSize=5000], [updateRightTable=false], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createLeftSemiJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[garbageSize=5000]",
                        "name": "garbageSize",
                        "optional": true,
                        "default": "5000"
                    },
                    {
                        "full": "[updateRightTable=false]",
                        "name": "updateRightTable",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createLeftSemiJoinEngine](https://docs.dolphindb.com/en/Functions/c/createLeftSemiJoinEngine.html)\n\n\n\n#### Syntax\n\ncreateLeftSemiJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, \\[garbageSize=5000], \\[updateRightTable=false], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\n#### Details\n\nCreate a left semi join engine. For each record from the left table, the left semi join engine finds the matching records from the right table, and returns a table of its joining result. Unmatched records will not be returned.\n\nIf an incoming record has the identical *matchingColumn* of an existing record in the right table, only the first/latest record (determined by parameter *updateRightTable*) is kept.\n\nNote: Only one record with the indentical *matchingColumn* is kept by the engine in the right table, and data in the right table will not be removed from memory. Therefore, a large number of distinct values of *matchingColumn* should be avoided, otherwise an OOM problem may occur.\n\nFor more details of streaming engines, refer to [streamingEngine](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n#### Parameters\n\n**name** is a string indicating the name of the left semi join engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**leftTable** is a table object whose schema must be the same as the input stream table. It does not matter whether the table contains data or not. Since version 2.00.11, array vectors are allowed for *leftTable*.\n\n**rightTable** is a table object whose schema must be the same as the input stream table. It does not matter whether the table contains data or not. Since version 2.00.11, array vectors are allowed for *RightTable*.\n\n**outputTable** is a stream table object to hold the calculation results. Create an empty table and specify the column names and types before calling the function. Since version 2.00.11, array vectors are allowed for *outputTable.* With the result column being an array vector column, user-defined aggregate functions can be used to output the results in the form of an array vector.\n\nThe columns of *outputTable* are in the following order:\n\n(1) The first column(s) are the column(s) on which the tables are joined, arranged in the same order as specified in *matchingColumn*.\n\n(2) Then followed by the calculation results of *metrics*. There can be one or multiple columns.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://test.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions), or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\nTo specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\n**Note:** The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**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.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**garbageSize** (optional) is a positive integer. The default value is 5,000. Unlike other join engines, the *garbageSize* parameter for left semi join engine is only used to remove the historical data from the left table. The system will clear the data from the left table when the number of joined records exceeds *garbageSize*.\n\n**updateRightTable** (optional) is a Boolean value indicating whether to output the first record (*updateRightTable* = true) or the latest record (*updateRightTable* = false) when there are more than one matching records in the right table. The default value is false.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n```\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym1`vol, [TIMESTAMP, SYMBOL, INT]) as rightTable\nshare table(100:0, `time`sym`price`vol`total, [TIMESTAMP, SYMBOL, DOUBLE, INT, DOUBLE]) as output\nlsjEngine=createLeftSemiJoinEngine(name=\"test1\", leftTable=leftTable, rightTable=rightTable, outputTable=output,  metrics=<[price, vol,price*vol]>, matchingColumn=[[`time,`sym], [`time,`sym1]], updateRightTable=true)\n\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{lsjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{lsjEngine, false}, msgAsTable=true)\n\nv = [1, 5, 10, 15]\ntp1=table(2012.01.01T00:00:00.000+v as time, take(`AAPL, 4) as sym, rand(100,4) as price)\nleftTable.append!(tp1)\n\nv = [1, 1, 3, 4, 5, 5, 5, 15]\ntp2=table(2012.01.01T00:00:00.000+v as time, take(`AAPL, 8) as sym, rand(100,8) as vol)\nrightTable.append!(tp2)\n\nselect * from output\n```\n\n| time                    | sym  | price | vol | total |\n| ----------------------- | ---- | ----- | --- | ----- |\n| 2012.01.01T00:00:00.001 | AAPL | 44    | 76  | 3344  |\n| 2012.01.01T00:00:00.005 | AAPL | 15    | 64  | 960   |\n| 2012.01.01T00:00:00.015 | AAPL | 24    | 75  | 1800  |\n\nTo execute the above script again, delete the engine and unsubscribe:\n\n```\ndropStreamEngine(\"test1\")\nlsjEngine=NULL\nunsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\")\nunsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\")\n```\n"
    },
    "createLookupJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createLookupJoinEngine.html",
        "signatures": [
            {
                "full": "createLookupJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, [rightTimeColumn], [checkTimes], [outputElapsedMicroseconds=false], [keepDuplicates=false], [isInnerJoin], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createLookupJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[rightTimeColumn]",
                        "name": "rightTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[checkTimes]",
                        "name": "checkTimes",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keepDuplicates=false]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[isInnerJoin]",
                        "name": "isInnerJoin",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createLookupJoinEngine](https://docs.dolphindb.com/en/Functions/c/createLookupJoinEngine.html)\n\n\n\n#### Syntax\n\ncreateLookupJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, \\[rightTimeColumn], \\[checkTimes], \\[outputElapsedMicroseconds=false], \\[keepDuplicates=false], \\[isInnerJoin], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\n#### Details\n\nCreate a lookup join engine where *matchingColumn* is used as the join column to perform a left or inner join between the left table (which must be a stream table) and the right table. The lookup join engine is commonly used in scenarios where the right table is updated infrequently (e.g., dimension tables that store daily indicators). If the right table is a non-stream table, the data must be refreshed regularly.\n\n1. Calculation is triggered only when new data is ingested to the left table.\n\n2. When *keepDuplicates* = false, the engine retains only the latest record from each group in the right table, grouped by *matchingColumn*. In this case:\n\n   * The default join type is a left join, i.e., *isInnerJoin* = false. This ensures output for every record in the left table - even if no matching record exists in the right table (in which case, null values are returned).\n   * Users can change the join type to an inner join by setting *isInnerJoin* to true.\n     When *keepDuplicates* = true, the engine retains all records in each group from the right table, grouped by *matchingColumn*. In this case, the join type can only be an inner join. This means output is only generated if a match is found; if no match exists, no output will be produced.\n\n3. If the right table is a stream table, the data in each group will be updated as new data is ingested into the right table. If the right table is an in-memory table, dimension table or SQL metacode, the system refreshes the right table at regular intervals as specified by *checkTimes*.\n\nComparison of the lookup join engine with the asof join, semi left join, and snapshot join engines:\n\n<table id=\"table_r3r_mt5_c2c\"><tbody><tr><td align=\"left\">\n\nasof join engine\n\n</td><td align=\"left\">\n\nFor the asof join engine, the first column of its output table is always the time column. There is no such restriction with the lookup join engine.\n\nWith the lookup join engine, calculation is triggered as soon as a new record is ingested into the left table. With the asof join engine, when the *timeColumn* is specified, there can be a delay before a record in the left table is joined.\n\n</td></tr><tr><td align=\"left\">\n\nleft semi join engine\n\n</td><td align=\"left\">\n\nBoth lookup join and left semi join engines only respond to new records arriving in the left table, producing output when matches are found in the right table.\n\nFor records from the left table that have no match in the right table, the lookup join engine will either output or skip them based on parameter settings. The left semi join engine, however, caches these unmatched records, waiting to output them once matching records appear in the right table.\n\nWhen caching right table records, the left semi join engine only retains either the first or the most recent record for identical join column values. This ensures that each left table record matches at most one right table record and produces output exactly once. In contrast, for the look up join engine, users can choose to retain all records within each group in the right table. As a result, each record in the left table may match multiple records in the right table, leading to multiple output records.\n\n</td></tr><tr><td align=\"left\">\n\nsnapshot join engine\n\n</td><td align=\"left\">\n\n* The lookup join engine responds only to new records in the left table, supporting both inner join and left join operations.\n* Snapshot join engine responds to new records in either the left or right table, supporting both inner join and full outer join operations.\n\n</td></tr></tbody>\n</table>For more application scenarios, see [Streaming Engines](../../Streaming/streaming_engines.md).\n\n#### Parameters\n\n**name** is a string indicating the name of the lookup join engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**leftTable** is a table object whose schema must be the same as the input stream table.\n\n**rightTable** is a table object. It can be an in-memory table, stream table, dimension table, or SQL metacode that returns a table. For regularly-updated *rightTable* that is not subscribed to, *checkTimes* must be specified for timed data refreshing.\n\n**outputTable** is a table object to hold the calculation results. Create an empty table and specify the column names and types before calling the function.\n\nThe columns of *outputTable* are in the following order:\n\n(1) The first column(s) are the column(s) on which the tables are joined, arranged in the same order as specified in *matchingColumn*.\n\n(2) Then followed by the calculation results of *metrics*.\n\n(3) If the *outputElapsedMicroseconds* is set to true, specify two more columns: a LONG column and an INT column.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://test.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions), or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as `col1`col2>.\n\nTo specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\n**Note:** The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**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.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**rightTimeColumn** (optional) 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 timestamps, only the latest record is retained. If the parameter is not specified, the latest ingested record (based) on the system time will be kept.\n\n**checkTimes** (optional) is a vector of temporal values or a DURATION scalar. If it is specified, the system will regularly update the right table (keeping only the latest data) and ingests the latest data to the lookup join engine. If the right table does not need to be updated regularly, you can leave *checkTimes* empty, but make sure to manually ingest the table data to the engine after it has been created.\n\n* If *checkTimes* is a vector of temporal values, it must be of SECOND, TIME or NANOTIME type. The lookup join engine updates the right table according to the time specified by each element in the vector on a daily basis.\n\n* If *checkTimes* is a DURATION scalar, it indicates the interval to update the right table.\n\n**outputElapsedMicroseconds** (optional) is a Boolean value. The default value is false. It determines whether to output:\n\n* the elapsed time (in microseconds) from the ingestion of data to the output of result in each batch.\n\n* the total number of each batch.\n\n**keepDuplicates** (optional) is a Boolean value indicating whether to keep all records in each group of the right table. When set to false (default), the engine keeps the latest record in each group. When set to true, the engine keeps all records in each group - in this case, the engine performs inner join, i.e., output is only generated if a match is found.\n\n**isInnerJoin** (optional) is a Boolean value indicating whether to perform an inner join. This parameter can only be adjusted when *keepDuplicates* is false. The default value is false, indicating a left join. This means results are generated for all records from the left table, with null values filling in any unmatched fields from the right table.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\nExample 1\n\n```\nlogin(`admin, `123456)\nshare streamTable(1000:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades\nshare streamTable(1000:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT]) as prices\nshare table(100:0, `sym`factor1`factor2`factor3, [SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\n\nLjEngine = createLookupJoinEngine(name=\"test1\", leftTable=trades, rightTable=prices, outputTable=output, metrics=<[price,val,price*val]>, matchingColumn=`sym)\nsubscribeTable(tableName=\"trades\", actionName=\"append_leftTable\", offset=0, handler=appendForJoin{LjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"prices\", actionName=\"append_rightTable\", offset=0, handler=appendForJoin{LjEngine, false}, msgAsTable=true)\n\nn = 15\ntem1 = 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)\nprices.append!(tem1)\nsleep(2000)\nn  = 10\ntem2 = 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)\ntrades.append!(tem2)\nsleep(100)\nselect * from output\n```\n\n| sym | factor1 | factor2 | factor3 |\n| --- | ------- | ------- | ------- |\n| A   | 10.1    | 13      | 131.3   |\n| B   | 11.1    | 14      | 155.4   |\n| C   | 12.1    | 15      | 181.5   |\n| A   | 13.1    | 13      | 170.3   |\n| B   | 14.1    | 14      | 197.4   |\n| C   | 15.1    | 15      | 226.5   |\n| A   | 16.1    | 13      | 209.3   |\n| B   | 17.1    | 14      | 239.4   |\n| C   | 8.1     | 15      | 271.5   |\n| A   | 19.1    | 13      | 248.3   |\n\nExample 2\n\n```\nshare streamTable(1000:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades\nshare streamTable(1000:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT]) as prices\nshare table(100:0, `sym`factor1`factor2`factor3, [SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\nLjEngine = createLookupJoinEngine(name=\"test1\", leftTable=trades, rightTable=prices, outputTable=output, metrics=<[price,val,price*val]>, matchingColumn=`sym, rightTimeColumn=`timestamps)\nsubscribeTable(tableName=\"trades\", actionName=\"append_leftTable\", offset=0, handler=appendForJoin{LjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"prices\", actionName=\"append_rightTable\", offset=0, handler=appendForJoin{LjEngine, false}, msgAsTable=true)\n\nn = 15\ntem1 = 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)\nprices.append!(tem1)\nsleep(2000)\nn  = 10\ntem2 = 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)\ntrades.append!(tem2)\nsleep(100)\nselect * from output\n```\n\n| sym | factor1 | factor2 | factor3 |\n| --- | ------- | ------- | ------- |\n| A   | 10.1    | 10      | 101     |\n| B   | 11.1    | 11      | 122.1   |\n| C   | 12.1    | 12      | 145.2   |\n| A   | 13.1    | 10      | 131     |\n| B   | 14.1    | 11      | 155.1   |\n| C   | 15.1    | 12      | 181.2   |\n| A   | 16.1    | 10      | 161     |\n| B   | 17.1    | 11      | 188.1   |\n| C   | 18.1    | 12      | 217.2   |\n| A   | 19.1    | 10      | 191     |\n\nExample 3. The right table is an in-memory table, so *checkTimes* must be set.\n\n```\nshare streamTable(1000:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades\nshare table(100:0, `sym`factor1`factor2`factor3, [SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\nprices=table(1000:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT])\nLjEngine = createLookupJoinEngine(name=\"test1\", leftTable=trades, rightTable=prices, outputTable=output, metrics=<[price,val,price*val]>, matchingColumn=`sym, rightTimeColumn=`timestamps, checkTimes=1s)\nsubscribeTable(tableName=\"trades\", actionName=\"append_leftTable\", offset=0, handler=appendForJoin{LjEngine, true}, msgAsTable=true)\n\nn = 15\ntem1 = 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)\nprices.append!(tem1)\nsleep(2000)\nn  = 10\ntem2 = 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)\ntrades.append!(tem2)\nsleep(100)\nselect * from output\n```\n\n| sym | factor1 | factor2 | factor3 |\n| --- | ------- | ------- | ------- |\n| A   | 10.1    | 10      | 101     |\n| B   | 11.1    | 11      | 122.1   |\n| C   | 12.1    | 12      | 145.2   |\n| A   | 13.1    | 10      | 131     |\n| B   | 14.1    | 11      | 155.1   |\n| C   | 15.1    | 12      | 181.2   |\n| A   | 16.1    | 10      | 161     |\n| B   | 17.1    | 11      | 188.1   |\n| C   | 18.1    | 12      | 217.2   |\n| A   | 19.1    | 10      | 191     |\n\nExample 4. Join the left table \"trades\" (a real-time stream table) and the right table \"prices\" (a dimension table with infrequent updates) to look up the matched records in column \"id\" from the right table.\n\n```\nshare streamTable(1000:0, `time`volume`id, [TIMESTAMP, INT,INT]) as trades\ndbPath=\"dfs://testlj\"\nif(existsDatabase(dbPath)){\n   dropDatabase(dbPath)\n}\nrt=table(1000:0, `time`price`id, [TIMESTAMP, DOUBLE, INT])\ndb=database(dbPath, VALUE, `A`B`C)\nprices=db.createDimensionTable(rt,`rightTable)\nshare table(10000:0, `id`volume`price`prod, [INT,INT,DOUBLE,DOUBLE]) as outputTable\n\ntradesLookupJoin = createLookupJoinEngine(name=\"streamLookup1\", leftTable=trades, rightTable=prices, outputTable=outputTable, metrics=<[volume,price,volume*price]>, matchingColumn=`id, rightTimeColumn=`time,checkTimes=1s)\nsubscribeTable(tableName=\"trades\", actionName=\"append_trades\", offset=0, handler=appendForJoin{tradesLookupJoin, true}, msgAsTable=true)\n\ndef writeData(t,n){\n    timev = 2021.10.08T01:01:01.001 + timestamp(1..n)\n    volumev = take(1..n, n)\n    id = take(1 2 3, n)\n    insert into t values(timev, volumev, id)\n}\n\nwriteData(rt, 10)\nprices.append!(rt)\nsleep(2000)\nwriteData(trades, 6)\nsleep(2)\n\nselect * from outputTable\n```\n\n| id | volume | price | prod |\n| -- | ------ | ----- | ---- |\n| 1  | 1      | 10    | 10   |\n| 2  | 2      | 8     | 16   |\n| 3  | 3      | 9     | 27   |\n| 1  | 4      | 10    | 40   |\n| 2  | 5      | 8     | 40   |\n| 3  | 6      | 9     | 54   |\n\nExample 5. Specify SQL metacode for *rightTable* to join columns queried from a DFS partitioned table.\n\n```\nshare streamTable(1000:0, `time`volume`id, [TIMESTAMP, INT,INT]) as trades\ndbPath=\"dfs://lookupjoinDB\"\nif(existsDatabase(dbPath)){\n   dropDatabase(dbPath)\n}\nrt=table(1000:0, `time`price`id, [TIMESTAMP, DOUBLE, INT])\ndb=database(dbPath, HASH, [INT,5])\nprices=db.createPartitionedTable(rt,`rightTable, `id)\nshare table(10000:0, `id`volume`price`prod, [INT,INT,DOUBLE,DOUBLE]) as outputTable\n\ntradesLookupJoin = createLookupJoinEngine(name=\"streamLookup1\", leftTable=trades, rightTable=<select * from loadTable(dbPath, `rightTable)>, outputTable=outputTable, metrics=<[volume,price,volume*price]>, matchingColumn=`id, rightTimeColumn=`time,checkTimes=1s)\nsubscribeTable(tableName=\"trades\", actionName=\"append_trades\", offset=0, handler=appendForJoin{tradesLookupJoin, true}, msgAsTable=true)\n\ndef writeData(t,n){\n    timev = 2021.10.08T01:01:01.001 + timestamp(1..n)\n    volumev = take(1..n, n)\n    id = take(1 2 3, n)\n    insert into t values(timev, volumev, id)\n}\n\nwriteData(rt, 10)\nprices.append!(rt)\nsleep(2000)\nwriteData(trades, 6)\nsleep(2)\n\nselect * from outputTable\n```\n\n| id | volume | price | prod |\n| -- | ------ | ----- | ---- |\n| 1  | 1      | 10    | 10   |\n| 2  | 2      | 8     | 16   |\n| 3  | 3      | 9     | 27   |\n| 1  | 4      | 10    | 40   |\n| 2  | 5      | 8     | 40   |\n| 3  | 6      | 9     | 54   |\n\nExample 6.Set *isInnerJoin*to true, so that no results are output when there is no matching record in the right table.\n\n```\nlogin(`admin, `123456)\nshare streamTable(1000:0, `timestamps`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades\nshare streamTable(1000:0, `timestamps`sym`val`id, [TIMESTAMP, SYMBOL, DOUBLE, INT]) as prices\nshare table(100:0, `sym`factor1`factor2`factor3, [SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\n\nLjEngine = createLookupJoinEngine(name=\"test1\", leftTable=trades, rightTable=prices, outputTable=output, metrics=<[price,val,price*val]>, matchingColumn=`sym, isInnerJoin=true)\n\nn = 15\ntem1 = 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)\nappendForJoin(LjEngine, false,tem1)\nsleep(2000)\n\n// The left table contains 2 records that have no matching reocrds in the right table.\nn  = 10\ntem2 = table( 2019.10.08T01:01:01.001 + 1..n as timestamps,take(`A`B`C`d, n) as sym,take(0.1+10..20,n) as price)\nappendForJoin(LjEngine, true,tem2)\nsleep(100)\nselect count(*) from output // 8\n```\n\n| sym | factor1 | factor2 | factor3 |\n| --- | ------- | ------- | ------- |\n| A   | 10.1    | 13      | 131.3   |\n| B   | 11.1    | 14      | 155.4   |\n| C   | 12.1    | 15      | 181.5   |\n| A   | 14.1    | 13      | 183.3   |\n| B   | 15.1    | 14      | 211.4   |\n| C   | 16.1    | 15      | 241.5   |\n| A   | 18.1    | 13      | 235.3   |\n| B   | 19.1    | 14      | 267.4   |\n"
    },
    "createMktDataEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createMktDataEngine.html",
        "signatures": [
            {
                "full": "createMktDataEngine(name, referenceDate, mktDataConfig, [handler], [historicalData], [engineConfig])",
                "name": "createMktDataEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "mktDataConfig",
                        "name": "mktDataConfig"
                    },
                    {
                        "full": "[handler]",
                        "name": "handler",
                        "optional": true
                    },
                    {
                        "full": "[historicalData]",
                        "name": "historicalData",
                        "optional": true
                    },
                    {
                        "full": "[engineConfig]",
                        "name": "engineConfig",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createMktDataEngine](https://docs.dolphindb.com/en/Functions/c/createMktDataEngine.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\ncreateMktDataEngine(name, referenceDate, mktDataConfig, \\[handler], \\[historicalData], \\[engineConfig])\n\n#### Details\n\nCreates a real-time market data construction engine (for curves, surfaces, etc.).\n\nThe engine automatically builds market data such as curves and surfaces based on the given configuration, and supports both historical data backfilling and real-time data updates.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine. It is the only identifier of an engine on a data or compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**referenceDate** is a DATE scalar indicating the reference date of the market data.\n\n**mktDataConfig** A dictionary or a tuple of dictionaries. Specifies the market data construction configuration. See below for details on the configuration format.\n\n**handler** (optional) is used to handle the results of market data construction. It can be a user-defined function, a shared in-memory table, or a pricing engine. The function signature or table schema depends on `engineConfig.outputTime`:\n\n* `engineConfig.outputTime=false`：The user-defined function takes parameters (kind, date, name, data); the shared in-memory table must contain four columns: kind (STRING), date (DATE), name (STRING), and data (MKTDATA).\n* `engineConfig.outputTime=true`：The user-defined function takes parameters (eventTime, kind, date, name, data); the shared in-memory table must contain five columns: eventTime (NANOTIMESTAMP), kind (STRING), date (DATE), name (STRING), and data (MKTDATA).\n\n**historicalData** (optional) is the historical market data. If the required market data cannot be obtained from the engine cache or real-time streams during construction, the engine will retrieve data from this source. It can be:\n\n* A dictionary or vector: refer to the *marketData* parameter in the [instrumentPricer](https://docs.dolphindb.com/en/Functions/i/instrumentPricer.html) function for the data format.\n* A user-defined function: the function parameters are (kind, date, name).\n\n**engineConfig** (optional) is a dictionary specifying engine runtime configuration. Supported key-value pairs include:\n\n* numThreads (optional): is an INT scalar indicating the number of worker threads. Default is 8.\n* maxQueueDepth (optional): is an INT scalar indicating the maximum queue depth. Default is 10,000,000.\n* useSystemTime (optional): is a Boolean value indicating whether to use system time as the event time. Default is true.\n* timeColumn (optional) is a string to specify a NANOTIMESTAMP column as the event time. When specified, input data must contain this column.\n* outputTime (optional) is a Boolean value indicating whether to output the event time. Default is false.\n\n#### Returns\n\nReturns a handle of a market data engine.\n\n#### mktDataConfig format and Data Insertion Schema\n\n##### Foreign Exchange Spot Rate\n\nThe configuration fields for FX spot rates are specified in the table below:\n\n<table id=\"table_pz4_wnv_f3c\"><tbody><tr><td>\n\nField Name\n\n</td><td>\n\nData Type\n\n</td><td>\n\nDescription\n\n</td><td>\n\nRequired\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nUnit for spot prices. Available options: \"EURUSD\", \"USDCNY\", \"EURCNY\", \"GBPCNY\", \"JPYCNY\", \"HKDCNY\".\n\nCurrency pairs may also use `.` or `/` as separators. For example, \"EURUSD\" can also be written as \"EUR.USD\" or \"EUR/USD\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FxSpotRate\"\n\n</td><td>\n\n√\n\n</td></tr></tbody>\n</table>**Configuration example**\n\n```\nconfig = {\n    \"name\": \"USDCNY\",\n    \"type\": \"FxSpotRate\"\n}\n```\n\n**Description:**\n\nFX spot rate curves are automatically included during the construction of related curves or surfaces, such as cross-currency interest rate swap yield curves or foreign exchange volatility surfaces, and therefore does not need to be configured separately.\n\nOnly when an FX spot rate curve needs to be output independently is explicit configuration required. In this case, it is sufficient to provide a configuration dictionary as shown in the example above.\n\n**Data insertion schema**\n\n| Column Name | Data Type | Description                                                                                  |\n| ----------- | --------- | -------------------------------------------------------------------------------------------- |\n| type        | STRING    | Must be \"FxSpotRate\"                                                                         |\n| name        | STRING    | The currency pair, for example, “USDCNY” (the currency pair can be separated by `.` or `/`). |\n| price       | DOUBLE    | Current price.                                                                               |\n\n**Note:** When inserting data, the column names and data types must conform to the definitions in the table above. The column order is not required to be consistent.\n\n**Complete example**\n\n```\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.01.01\n\nconfig1 = {\n    \"name\": \"USDCNY\",\n    \"type\": \"FxSpotRate\"\n}\nconfig2 = {\n    \"name\": \"EURUSD\",\n    \"type\": \"FxSpotRate\"\n}\nconfig3 = {\n    \"name\": \"EURCNY\",\n    \"type\": \"FxSpotRate\"\n}\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config1, config2, config3])\n\ntypeCol = [\"FxSpot\", \"FxSpot\", \"FxSpot\"]\nnameCol = [\"USDCNY\", \"USDCNY\", \"EURUSD\"]\npriceCol = [7.12, 7.13, 1.10]\n\ndata = table(typeCol as type, nameCol as name, priceCol as price)\n\nengine.append!(data)\nsleep(100)\n```\n\n* In this example, three build targets are created, representing the FX spot rates for USDCNY, EURUSD, and EURCNY.\n* The written data covers only two of these build targets, with a total of three records: two for USDCNY and one for EURUSD.\n* Data is written in asynchronous mode, so sufficient waiting time must be reserved to ensure that all data has been fully processed.\n\nAfter the build process is completed, the constructed market data can be retrieved using the `getMktData` function.\n\n```\nre = getMktData(engine, \"Price\", referenceDate, \"USDCNY\")\nprint(re)\n\nre = getMktData(engine, \"Price\", referenceDate, \"EURUSD\")\nprint(re)\n\nre = getMktData(engine, \"Price\", referenceDate, \"EURCNY\")\nprint(re)\n```\n\nThe result will return the latest market data for USDCNY and EURUSD. Since no data is written for EURCNY, calling `getMktData` for EURCNY will result in an error.\n\n##### Bond Yield Curve\n\nThe `mktDataConfig` fields required for generating a bond yield curve include the following:\n\n* **name**: Required, the name of the curve.\n* **type**: Required, must be \"BondYieldCurve\"\n* **bonds**: Required, the sample bonds used for curve construction\n* **currency**: Required, the currency code of the curve\n* **dayCountConvention**: Required, the day count convention to use\n* **compounding**: Optional, the compounding method\n* **frequency**: Optional, the interest payment frequency\n* **interpMethod**: Optional, the interpolation method\n* **extrapMethod**: Optional, the extrapolation method\n* **method**: Optional, the curve construction method\n\nAll fields are consistent with those defined for [bondYieldCurveBuilder](https://docs.dolphindb.com/en/Functions/b/bondYieldCurveBuilder.html).\n\n**Configuration example**\n\n```\nbonds = array(ANY, 5)\nfor (i in 0..4) {\n    bond_template = {\n        \"productType\": \"Cash\",\n        \"assetType\": \"Bond\",\n        \"bondType\": \"FixedRateBond\",\n        \"instrumentId\": \"88\" + lpad(string(i), 4, \"0\") + \".IB\",\n        \"start\": 2024.06.01,\n        \"maturity\": 2024.06.01 + (i + 1) * 365,\n        \"issuePrice\": 100,\n        \"coupon\": 0.02,\n        \"dayCountConvention\": \"Actual365\",\n        \"frequency\": \"Annual\"\n    };\n    bonds[i] = parseInstrument(bond_template);\n}\n\nconfig = {\n    \"name\": \"CNY_TREASURY_BOND\",\n    \"type\": \"BondYieldCurve\",\n    \"bonds\": bonds,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\"\n}\n```\n\n**Description：**\n\nBuild a bond yield curve with the curve name \"CNY\\_TREASURY\\_BOND\". Five randomly generated bonds (Instrument data) are used as reference instruments. The usage of other parameters can be found in the `bondYieldCurveBuilder` function.\n\nDuring the build process, the engine calculates the remaining time to maturity for each bond based on the reference instrument information and the *referenceDate* specified in the engine parameters, and then reorders the bonds by maturity.\n\n**Data insertion schema**\n\n| Column Name | Data Type | Description       |\n| ----------- | --------- | ----------------- |\n| type        | STRING    | Must be \"Bond\"    |\n| name        | STRING    | Bond name         |\n| price       | DOUBLE    | The market quotes |\n\n**Data insertion example**\n\n```\ntypeCol = [\"Bond\", \"Bond\", \"Bond\", \"Bond\", \"Bond\"]\nnameCol = [\"880000.IB\", \"880001.IB\", \"880002.IB\", \"880003.IB\", \"880004.IB\"]\npriceCol = [0.015, 0.016, 0.017, 0.018, 0.019]  // YTM\n\ndata = table(typeCol as type, nameCol as name, priceCol as price)\n```\n\n**Complete example**\n\n```\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.01.01\nbonds = array(ANY, 5)\nfor (i in 0..4) {\n    bond_template = {\n        \"productType\": \"Cash\",\n        \"assetType\": \"Bond\",\n        \"bondType\": \"FixedRateBond\",\n        \"instrumentId\": \"88\" + lpad(string(i), 4, \"0\") + \".IB\",\n        \"start\": 2024.06.01,\n        \"maturity\": 2024.06.01 + (i + 1) * 365,\n        \"issuePrice\": 100,\n        \"coupon\": 0.02,\n        \"dayCountConvention\": \"Actual365\",\n        \"frequency\": \"Annual\"\n    };\n    bonds[i] = parseInstrument(bond_template);\n}\n\nconfig = {\n    \"name\": \"CNY_TREASURY_BOND\",\n    \"type\": \"BondYieldCurve\",\n    \"bonds\": bonds,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\"\n}\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config])\n\ntypeCol = [\"Bond\", \"Bond\", \"Bond\", \"Bond\", \"Bond\"]\nnameCol = [\"880000.IB\", \"880001.IB\", \"880002.IB\", \"880003.IB\", \"880004.IB\"]\npriceCol = [0.015, 0.016, 0.017, 0.018, 0.019]  // YTM\n\ndata = table(typeCol as type, nameCol as name, priceCol as price)\nengine.append!(data)\nsleep(100)\n\nre = getMktData(engine, \"Curve\", referenceDate, \"CNY_TREASURY_BOND\")\nprint(re)\n```\n\n##### Single-Currency Interest Rate Swap Curve\n\nThe `mktDataConfig` fields required for generating a single-currency interest rate swap curve include the following:\n\n* **name**: Required, the curve name\n* **type**: Required, must be \"IrSingleCurrencyCurve\"\n* **insts**: Required, an Any Vector, each element is a tuple consisting of three fields: \\[instName, instType, term]. Among them, instName and instType are STRING scalars, and term is either a STRING or a DURATION scalar.\n* **currency**: Required, the currency in which the curve is defined\n* **dayCountConvention**: Required, the day count convention to use\n* **discountCurve**: Optional, the discount curve\n* **compounding**: Optional, the compounding interest\n* **frequency**: Optional, the interest payment frequency\n\nExcept for insts, all other fields follow the same requirements as the parameters of [irSingleCurrencyCurveBuilder](https://docs.dolphindb.com/en/Functions/i/irSingleCurrencyCurveBuilder.html).\n\n**Configuration example**\n\n```\nconfig = {\n    \"name\": \"CNY_FR_007\",\n    \"type\": \"IrSingleCurrencyCurve\",\n    \"insts\": [\n        [\"FR_007\", \"Deposit\", 7d],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 1M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 3M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 6M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 9M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 1y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 2y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 3y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 4y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 5y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 7y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 10y]\n    ],\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\"\n}\n```\n\n\\*\\*Note：\\*\\*This example builds a single-currency interest rate curve named CNY\\_FR\\_007, using the same set of market quotes as in Example 2 of [irSingleCurrencyCurveBuilder](https://docs.dolphindb.com/en/Functions/i/irSingleCurrencyCurveBuilder.html).\n\n**Data insertion schema**\n\n| Column Name | Data Type       | Description                                               |\n| ----------- | --------------- | --------------------------------------------------------- |\n| type        | STRING          | Currently，only \"Deposit\" or \"IrVanillaSwap\" is supported. |\n| name        | STRING          | Instrument name                                           |\n| term        | STRING/DURATION | The remaining maturity, e.g., \"1M\"                        |\n| price       | DOUBLE          | The market quotes                                         |\n\n**Data insertion example**\n\n```\ntypeCol = [\n    \"Deposit\", \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\",\n    \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\",\n    \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\"\n]\n\nnameCol = [\n    \"FR_007\", \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\",\n    \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\",\n    \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\"\n]\n\ntermCol = [\n    7d, 1M, 3M, 6M,\n    9M, 1y, 2y, 3y,\n    4y, 5y, 7y, 10y\n]\n\npriceCol = [\n    2.3500, 2.3396, 2.3125, 2.3613,\n    2.4075, 2.4513, 2.5750, 2.6763,\n    2.7650, 2.8463, 2.9841, 3.1350\n] \\ 100\n\ndata = table(typeCol as type, nameCol as name, termCol as term, priceCol as price)\n```\n\n**Complete example**\n\n```\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2021.05.26\n\nconfig = {\n    \"name\": \"CNY_FR_007\",\n    \"type\": \"IrSingleCurrencyCurve\",\n    \"insts\": [\n        [\"FR_007\", \"Deposit\", 7d],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 1M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 3M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 6M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 9M],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 1y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 2y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 3y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 4y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 5y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 7y],\n        [\"CNY_FR_007\", \"IrVanillaSwap\", 10y]\n    ],\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\"\n}\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config])\n\ntypeCol = [\n    \"Deposit\", \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\",\n    \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\",\n    \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\", \"IrVanillaSwap\"\n]\n\nnameCol = [\n    \"FR_007\", \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\",\n    \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\",\n    \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\", \"CNY_FR_007\"\n]\n\ntermCol = [\n    7d, 1M, 3M, 6M,\n    9M, 1y, 2y, 3y,\n    4y, 5y, 7y, 10y\n]\n\npriceCol = [\n    2.3500, 2.3396, 2.3125, 2.3613,\n    2.4075, 2.4513, 2.5750, 2.6763,\n    2.7650, 2.8463, 2.9841, 3.1350\n] \\ 100\n\ndata = table(typeCol as type, nameCol as name, termCol as term, priceCol as price)\n\nengine.append!(data)\nsleep(100)\n\nre = getMktData(engine, \"Curve\", referenceDate, \"CNY_FR_007\")\nprint(re)\n```\n\n##### Cross-Currency Interest Rate Swap Yield Curve\n\nThe `mktDataConfig` fields required for generating a cross-currency interest rate swap yield curve include the following:\n\n* **name**: Required, the curve name\n* **type**: Required, must be \"IrCrossCurrencyCurve\"\n* **insts**: Required, an Any Vector, each element is a tuple consisting of three fields: \\[instName, instType, term]. Among them, instName and instType are STRING scalars, and term is either a STRING or a DURATION scalar.\n* **currency**: Required, the currency in which the curve is defined\n* **currencyPair**: Required, current pair\n* **dayCountConvention**: Required, the day count convention to use\n* **discountCurve**: Required, the discount curve\n* **compounding**: Optional, the compounding interest\n* **frequency**: Optional, the interest payment frequency\n\nExcept for insts, all other fields follow the same requirements as the parameters of [irCrossCurrencyCurveBuilder](https://docs.dolphindb.com/en/Functions/i/irCrossCurrencyCurveBuilder.html).\n\n**Configuration example**\n\n```\nconfig = {\n    \"name\": \"USD_USDCNY_FX\",\n    \"type\": \"IrCrossCurrencyCurve\",\n    \"insts\": [\n        (\"USDCNY\", \"FxSwap\", \"1d\"),\n        (\"USDCNY\", \"FxSwap\", \"1w\"),\n        (\"USDCNY\", \"FxSwap\", \"2w\"),\n        (\"USDCNY\", \"FxSwap\", \"3w\"),\n        (\"USDCNY\", \"FxSwap\", \"1M\"),\n        (\"USDCNY\", \"FxSwap\", \"2M\"),\n        (\"USDCNY\", \"FxSwap\", \"3M\"),\n        (\"USDCNY\", \"FxSwap\", \"6M\"),\n        (\"USDCNY\", \"FxSwap\", \"9M\"),\n        (\"USDCNY\", \"FxSwap\", \"1y\"),\n        (\"USDCNY\", \"FxSwap\", \"18M\"),\n        (\"USDCNY\", \"FxSwap\", \"2y\"),\n        (\"USDCNY\", \"FxSwap\", \"3y\")\n    ],\n    \"currency\": \"USD\",\n    \"currencyPair\": \"USDCNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"discountCurve\": \"CNY_SHIBOR_3M\"\n}\n```\n\n**Description:**\n\nIn this example, the construction target is a cross-currency interest rate swap yield curve named \"USD\\_USDCNY\\_FX\".\n\nThe foreign exchange swap is used for pricing, and the discounting curve specified for the construction is \"CNY\\_SHIBOR\\_3M\".\n\nSince the cross-currency interest rate swap yield curve already contains the currency pair information, there is no need to additionally define a foreign exchange spot rate as the construction target.\n\nFor detailed parameter requirements, please refer to `irCrossCurrencyCurveBuilder`.\n\n**Data insertion schema**\n\n| Column Name | Data Type         | Description                           |\n| ----------- | ----------------- | ------------------------------------- |\n| type        | STRING            | currently, only “FxSwap” is supported |\n| name        | STRING            | FxSwap: the currency                  |\n| term        | STRING / DURATION | The remaining maturity, e.g., \"1M\"    |\n| price       | DOUBLE            | The market quotes                     |\n\n**Data insertion example**\n\n```\ntypeCol = [\n    \"FxSwap\", \"FxSwap\", \"FxSwap\", \"FxSwap\",\n    \"FxSwap\", \"FxSwap\", \"FxSwap\", \"FxSwap\",\n    \"FxSwap\", \"FxSwap\", \"FxSwap\", \"FxSwap\",\n    \"FxSwap\"\n]\nnameCol = [\n    \"USDCNY\", \"USDCNY\", \"USDCNY\", \"USDCNY\",\n    \"USDCNY\", \"USDCNY\", \"USDCNY\", \"USDCNY\",\n    \"USDCNY\", \"USDCNY\", \"USDCNY\", \"USDCNY\",\n    \"USDCNY\"\n]\ntermCol = [\n    \"1d\", \"1w\", \"2w\", \"3w\",\n    \"1M\", \"2M\", \"3M\", \"6M\",\n    \"9M\", \"1y\", \"18M\", \"2y\",\n    \"3y\"\n]\npriceCol = [\n    -5.54, -39.00, -75.40, -113.20,\n    -177.00, -317.00, -466.00, -898.50,\n    -1284.99, -1676.00, -2320.00, -2870.00,\n    -3962.50\n] \\ 10000\n\ndata = table(typeCol as type, nameCol as name, termCol as term, priceCol as price)\ninsert into data values(\"FxSpot\", \"USDCNY\", \"0d\", 7.1627)\n```\n\n**Complete example**\n\nIn this example, the USD implied yield curve (USD\\_USDCNY\\_FX) is automatically constructed using the market data engine from USDCNY FX swap quotes and the CNY\\_FR\\_007 curve.\n\n```\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.08.18\n\nconfig = {\n    \"name\": \"USD_USDCNY_FX\",\n    \"type\": \"IrCrossCurrencyCurve\",\n    \"insts\": [\n        (\"USDCNY\", \"FxSwap\", \"1d\"),\n        (\"USDCNY\", \"FxSwap\", \"1w\"),\n        (\"USDCNY\", \"FxSwap\", \"2w\"),\n        (\"USDCNY\", \"FxSwap\", \"3w\"),\n        (\"USDCNY\", \"FxSwap\", \"1M\"),\n        (\"USDCNY\", \"FxSwap\", \"2M\"),\n        (\"USDCNY\", \"FxSwap\", \"3M\"),\n        (\"USDCNY\", \"FxSwap\", \"6M\"),\n        (\"USDCNY\", \"FxSwap\", \"9M\"),\n        (\"USDCNY\", \"FxSwap\", \"1y\"),\n        (\"USDCNY\", \"FxSwap\", \"18M\"),\n        (\"USDCNY\", \"FxSwap\", \"2y\"),\n        (\"USDCNY\", \"FxSwap\", \"3y\")\n    ],\n    \"currency\": \"USD\",\n    \"currencyPair\": \"USDCNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"discountCurve\": \"CNY_SHIBOR_3M\"\n}\n\n\ntypeCol = [\n    \"FxSwap\", \"FxSwap\", \"FxSwap\", \"FxSwap\",\n    \"FxSwap\", \"FxSwap\", \"FxSwap\", \"FxSwap\",\n    \"FxSwap\", \"FxSwap\", \"FxSwap\", \"FxSwap\",\n    \"FxSwap\"\n]\nnameCol = [\n    \"USDCNY\", \"USDCNY\", \"USDCNY\", \"USDCNY\",\n    \"USDCNY\", \"USDCNY\", \"USDCNY\", \"USDCNY\",\n    \"USDCNY\", \"USDCNY\", \"USDCNY\", \"USDCNY\",\n    \"USDCNY\"\n]\ntermCol = [\n    \"1d\", \"1w\", \"2w\", \"3w\",\n    \"1M\", \"2M\", \"3M\", \"6M\",\n    \"9M\", \"1y\", \"18M\", \"2y\",\n    \"3y\"\n]\npriceCol = [\n    -5.54, -39.00, -75.40, -113.20,\n    -177.00, -317.00, -466.00, -898.50,\n    -1284.99, -1676.00, -2320.00, -2870.00,\n    -3962.50\n] \\ 10000\n\ndata = table(typeCol as type, nameCol as name, termCol as term, priceCol as price)\ninsert into data values(\"FxSpot\", \"USDCNY\", \"0d\", 7.1627)\n\n\ncnyShibor3mDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_SHIBOR_3M\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": [\n        2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10,\n        2025.09.22, 2025.10.20, 2025.11.20, 2026.02.20,\n        2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20,\n        2028.08.21\n    ],\n    \"values\": [\n        1.5113, 1.5402, 1.5660, 1.5574,\n        1.5556, 1.5655, 1.5703, 1.5934,\n        1.6040, 1.6020, 1.5928, 1.5842,\n        1.6068\n    ] \\ 100\n}\n\ncnyShibor3m = parseMktData(cnyShibor3mDict)\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config], historicalData=[cnyShibor3m])\n\nengine.append!(data)\nsleep(100)\n\nre = getMktData(engine, \"Curve\", referenceDate, \"USD_USDCNY_FX\")\nprint(re)\n```\n\n1. Since the construction target automatically includes foreign exchange spot rate, the input data must also contain the corresponding quotation data; otherwise, the construction will fail.\n2. In this example, CNY\\_SHIBOR\\_3M is provided to the engine as historical data rather than being built in real time, so the corresponding curve needs to be prepared in advance.\n\n##### Foreign Exchange Volatility Surface\n\nThe `mktDataConfig` fields required for generating a foreign exchange volatility surface include the following:\n\n* **name**: Required, the surface name\n* **type**: Required, must be \"FxVolatilitySurface\"\n* **names**: Required, the names of market volatility quotes，which must be a permutation of \\[\"ATM\", \"D25\\_RR\", \"D25\\_BF\", \"D10\\_RR\", \"D10\\_BF\"]\n* **terms**: Required, the tenors associated with market quotes\n* **currencyPair**: Required, current pair\n* **discountCurve**: Required, the discount curve\n* **foreignCurve**: Required, the foreign discount curve\n* **mode**: Required, the model used to construct the surface\n\nAll fields follow the same requirements as the parameters of [fxVolatilitySurfaceBuilder](https://docs.dolphindb.com/en/Functions/f/fxVolatilitySurfaceBuilder.html).\n\n**Configuration example**\n\n```\nconfig = {\n    \"name\": \"USDCNY\",\n    \"type\": \"FxVolatilitySurface\",\n    \"names\": [\"ATM\", \"D25_RR\", \"D25_BF\", \"D10_RR\", \"D10_BF\"],\n    \"terms\": [\"1d\", \"1w\", \"2w\", \"3w\", \"1M\", \"2M\", \"3M\", \"6M\", \"9M\", \"1y\", \"18M\", \"2y\", \"3y\"],\n    \"currencyPair\": \"USDCNY\",\n    \"domesticCurve\": \"CNY_FR_007\",\n    \"foreignCurve\": \"USD_USDCNY_FX\",\n    \"model\": \"SVI\"\n}\n```\n\n**Description**\n\nIn this example, the construction target is a foreign exchange volatility surface named USDCNY.\n\nThe discounting curve CNY\\_FR\\_007 is used for the domestic currency, USD\\_USDCNY\\_FX is used for the foreign currency, and the SVI model is applied to build the volatility surface.\n\n**Data insertion schema**\n\n| Column Name | Data Type         | Description                                           |\n| ----------- | ----------------- | ----------------------------------------------------- |\n| type        | STRING            | Must be FxOption                                      |\n| name        | STRING            | Currency pair                                         |\n| subType     | STRING            | “ATM” / “D25\\_RR” / “D25\\_BF” / “D10\\_RR” / “D10\\_BF” |\n| term        | STRING / DURATION | The remaining maturity, e.g., \"1M\"                    |\n| price       | DOUBLE            | The market quotes                                     |\n\n**Data insertion example**\n\n```\ntypeCol = take(\"FxOption\", 65)\nnameCol = take(\"USDCNY\", 65)\nsubTypeCol = take([\"ATM\"], 13)\n    .append!(take([\"D25_RR\"], 13))\n    .append!(take([\"D25_BF\"], 13))\n    .append!(take([\"D10_RR\"], 13))\n    .append!(take([\"D10_BF\"], 13))\ntermCol = take([\n    \"1d\", \"1w\", \"2w\", \"3w\", \"1M\", \"2M\", \"3M\", \"6M\", \"9M\", \"1y\", \"18M\", \"2y\", \"3y\"\n], 65)\npriceCol = [\n    0.030000, -0.007500, 0.003500, -0.010000, 0.005500, \n    0.020833, -0.004500, 0.002000, -0.006000, 0.003800, \n    0.022000, -0.003500, 0.002000, -0.004500, 0.004100, \n    0.022350, -0.003500, 0.002000, -0.004500, 0.004150, \n    0.024178, -0.003000, 0.002200, -0.004750, 0.005500, \n    0.027484, -0.002650, 0.002220, -0.004000, 0.005650, \n    0.030479, -0.002500, 0.002400, -0.003500, 0.005750, \n    0.035752, -0.000500, 0.002750,  0.000000, 0.006950, \n    0.038108,  0.001000, 0.002800,  0.003000, 0.007550, \n    0.039492,  0.002250, 0.002950,  0.005000, 0.007550, \n    0.040500,  0.004000, 0.003100,  0.007000, 0.007850, \n    0.041750,  0.005250, 0.003350,  0.008000, 0.008400, \n    0.044750,  0.006250, 0.003400,  0.009000, 0.008550\n].reshape(5:13).transpose().flatten()\n\ndata = table(typeCol as type, nameCol as name, subTypeCol as subType, termCol as term, priceCol as price)\ninsert into data values(\"FxSpot\", \"USDCNY\", \"\", \"0d\", 7.1627)\n```\n\n**Complete example**\n\nThis example demonstrates how to use DolphinDB’s market data engine (`createMktDataEngine`) to build and manage a USDCNY FX volatility surface. The process includes the following steps:\n\n1. Prepare volatility quotes, spot exchange rates, and yield curve data.\n2. Use `parseMktData` to convert curve data provided in dictionary format into MKTDATA objects.\n3. Create a market data engine named \"MKTDATA\\_ENGINE\" and configure the construction parameters for the USDCNY volatility surface using the SVI model. The historical curves CNY\\_FR\\_007 and USD\\_USDCNY\\_FX are then loaded into the engine.\n4. Retrieve the constructed USDCNY FX volatility surface from the engine using `getMktData`, which can be used for subsequent FX option pricing.\n\n```\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.08.18\n\nconfig = {\n    \"name\": \"USDCNY\",\n    \"type\": \"FxVolatilitySurface\",\n    \"names\": [\"ATM\", \"D25_RR\", \"D25_BF\", \"D10_RR\", \"D10_BF\"],\n    \"terms\": [\"1d\", \"1w\", \"2w\", \"3w\", \"1M\", \"2M\", \"3M\", \"6M\", \"9M\", \"1y\", \"18M\", \"2y\", \"3y\"],\n    \"currencyPair\": \"USDCNY\",\n    \"domesticCurve\": \"CNY_FR_007\",\n    \"foreignCurve\": \"USD_USDCNY_FX\",\n    \"model\": \"SVI\"\n}\n\ntypeCol = take(\"FxOption\", 65)\nnameCol = take(\"USDCNY\", 65)\nsubTypeCol = take([\"ATM\"], 13)\n    .append!(take([\"D25_RR\"], 13))\n    .append!(take([\"D25_BF\"], 13))\n    .append!(take([\"D10_RR\"], 13))\n    .append!(take([\"D10_BF\"], 13))\ntermCol = take([\n    \"1d\", \"1w\", \"2w\", \"3w\", \"1M\", \"2M\", \"3M\", \"6M\", \"9M\", \"1y\", \"18M\", \"2y\", \"3y\"\n], 65)\npriceCol = [\n    0.030000, -0.007500, 0.003500, -0.010000, 0.005500, \n    0.020833, -0.004500, 0.002000, -0.006000, 0.003800, \n    0.022000, -0.003500, 0.002000, -0.004500, 0.004100, \n    0.022350, -0.003500, 0.002000, -0.004500, 0.004150, \n    0.024178, -0.003000, 0.002200, -0.004750, 0.005500, \n    0.027484, -0.002650, 0.002220, -0.004000, 0.005650, \n    0.030479, -0.002500, 0.002400, -0.003500, 0.005750, \n    0.035752, -0.000500, 0.002750,  0.000000, 0.006950, \n    0.038108,  0.001000, 0.002800,  0.003000, 0.007550, \n    0.039492,  0.002250, 0.002950,  0.005000, 0.007550, \n    0.040500,  0.004000, 0.003100,  0.007000, 0.007850, \n    0.041750,  0.005250, 0.003350,  0.008000, 0.008400, \n    0.044750,  0.006250, 0.003400,  0.009000, 0.008550\n].reshape(5:13).transpose().flatten()\n\ndata = table(typeCol as type, nameCol as name, subTypeCol as subType, termCol as term, priceCol as price)\ninsert into data values(\"FxSpot\", \"USDCNY\", \"\", \"0d\", 7.1627)\n\ndomesticCurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveName\": \"CNY_FR_007\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": [\n        2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22,\n        2025.10.20, 2025.11.20, 2026.02.24, 2026.05.20, 2026.08.20,\n        2027.02.22, 2027.08.20, 2028.08.21\n    ],\n    \"values\": [\n        1.5113, 1.5402, 1.5660, 1.5574, 1.5556,\n        1.5655, 1.5703, 1.5934, 1.6040, 1.6020, \n        1.5928, 1.5842, 1.6068\n    ] \\ 100\n}\ndomesticCurve = parseMktData(domesticCurveDict)\n\nforeignCurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveName\": \"USD_USDCNY_FX\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": [\n        2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22,\n        2025.10.20, 2025.11.20, 2026.02.24, 2026.05.20, 2026.08.20,\n        2027.02.22, 2027.08.20, 2028.08.21\n    ],\n    \"values\": [\n        4.3345, 4.3801, 4.3119, 4.3065, 4.2922, \n        4.2196, 4.1599, 4.0443, 4.0244, 3.9698, \n        3.7740, 3.6289, 3.5003\n    ] \\ 100\n}\nforeignCurve = parseMktData(foreignCurveDict)\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config], historicalData=[domesticCurve, foreignCurve])\n\nengine.append!(data)\nsleep(100)\n\nre = getMktData(engine, \"Surface\", referenceDate, \"USDCNY\")\nprint(re)\n```\n\n1. Since the construction target automatically includes a foreign exchange spot rate curve, the input data must also contain the corresponding quotation data; otherwise, the construction will fail.\n2. In this example, CNY\\_FR\\_007 and USD\\_USDCNY\\_FX are provided to the engine as historical data rather than being built in real time, so the corresponding curves need to be prepared in advance.\n\n#### Example of the *handler* parameter\n\n**Specify a custom function**\n\nTaking the construction of a foreign exchange spot rate curve as an example, define a custom function to print the generated market data.\n\n```\ndef myHandler(kind, date, name, data) {\n    print(data)\n}\n\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.01.01\n\nconfig1 = {\n    \"name\": \"USDCNY\",\n    \"type\": \"FxSpotRate\"\n}\nconfig2 = {\n    \"name\": \"EURUSD\",\n    \"type\": \"FxSpotRate\"\n}\nconfig3 = {\n    \"name\": \"EURCNY\",\n    \"type\": \"FxSpotRate\"\n}\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config1, config2, config3], handler=myHandler)\n\ntypeCol = [\"FxSpot\", \"FxSpot\", \"FxSpot\"]\nnameCol = [\"USDCNY\", \"EURCNY\", \"EURUSD\"]\npriceCol = [7.12, 7.88, 1.10]\n\ndata = table(typeCol as type, nameCol as name, priceCol as price)\n\nengine.append!(data)\nsleep(100)\n```\n\n**Specify as a shared memory table**\n\nDefine a shared table with the following schema (the column order must be consistent).\n\n| Column Name | Data Type |\n| ----------- | --------- |\n| kind        | STRING    |\n| date        | DATE      |\n| name        | STRING    |\n| data        | MKTDATA   |\n\n**Complete example**\n\n```\nshare streamTable(1:0, `kind`date`name`data, [STRING, DATE, STRING, MKTDATA]) as st\n\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.01.01\n\nconfig1 = {\n    \"name\": \"USDCNY\",\n    \"type\": \"FxSpotRate\"\n}\nconfig2 = {\n    \"name\": \"EURUSD\",\n    \"type\": \"FxSpotRate\"\n}\nconfig3 = {\n    \"name\": \"EURCNY\",\n    \"type\": \"FxSpotRate\"\n}\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config1, config2, config3], handler=st)\n\ntypeCol = [\"FxSpot\", \"FxSpot\", \"FxSpot\"]\nnameCol = [\"USDCNY\", \"EURCNY\", \"EURUSD\"]\npriceCol = [7.12, 7.88, 1.10]\n\ndata = table(typeCol as type, nameCol as name, priceCol as price)\n\nengine.append!(data)\nsleep(100)\n\nprint(select * from st)\n```\n\n**Specify as a pricing engine**\n\nCreate a pricing engine and pass it as the *handler* parameter.\n\n**Complete example**\n\n```\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\ntry{dropStreamEngine(\"PRICING_ENGINE\")}catch(ex){}\nreferenceDate = 2025.01.01\n\nbonds = array(ANY, 5)\nfor (i in 0..4) {\n    bond_template = {\n        \"productType\": \"Cash\",\n        \"assetType\": \"Bond\",\n        \"bondType\": \"FixedRateBond\",\n        \"instrumentId\": \"88\" + lpad(string(i), 4, \"0\") + \".IB\",\n        \"start\": 2024.06.01,\n        \"maturity\": 2024.06.01 + (i + 1) * 365,\n        \"issuePrice\": 100,\n        \"coupon\": 0.02,\n        \"dayCountConvention\": \"Actual365\",\n        \"frequency\": \"Annual\"\n    };\n    bonds[i] = parseInstrument(bond_template);\n}\n\nconfig = {\n    \"name\": \"CNY_TREASURY_BOND\",\n    \"type\": \"BondYieldCurve\",\n    \"bonds\": bonds,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\"\n}\n\nbondDict = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"880010.IB\",\n    \"start\": 2024.05.01,\n    \"maturity\": 2028.05.01,\n    \"issuePrice\": 100,\n    \"coupon\": 0.02,\n    \"dayCountConvention\": \"Actual365\",\n    \"frequency\": \"Annual\",\n    \"discountCurve\": \"CNY_FR_007\"\n}\nbond = parseInstrument(bondDict)\n\nshare streamTable(1:0, `name`date`price, [STRING, DATE, DOUBLE]) as priceSt\n\npricingEngine = createPricingEngine(\"PRICING_ENGINE\", [bond], tableInsert{priceSt})\n\nmktdataEngine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config], handler=pricingEngine)\n\ntypeCol = [\"Bond\", \"Bond\", \"Bond\", \"Bond\", \"Bond\"]\nnameCol = [\"880000.IB\", \"880001.IB\", \"880002.IB\", \"880003.IB\", \"880004.IB\"]\npriceCol = [0.015, 0.016, 0.017, 0.018, 0.019]  // YTM\n\ndata = table(typeCol as type, nameCol as name, priceCol as price)\n\nmktdataEngine.append!(data)\nsleep(100)\n\nre = getMktData(mktdataEngine, \"Curve\", referenceDate, \"CNY_FR_007\")\nprint(re)\n\nprint(select * from priceSt)\n```\n\nIn this example, bonds 880000.IB to 880004.IB are used as benchmark bonds to build the curve CNY\\_TREASURY\\_BOND, which is then provided as an input curve to the price engine to price 880010.IB .\n\nFinally, the pricing results are written to the priceSt table.\n\n**Related functions**: [appendMktData](https://docs.dolphindb.com/en/Functions/a/appendMktData.html), [append!](https://docs.dolphindb.com/en/Functions/a/append!.html), [getMktData](https://docs.dolphindb.com/en/Functions/g/getMktData.html), [createPricingEngine](https://docs.dolphindb.com/en/Functions/c/createPricingEngine.html)\n"
    },
    "createNarrowReactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createNarrowReactiveStateEngine.html",
        "signatures": [
            {
                "full": "createNarrowReactiveStateEngine(name, metrics, metricNames, dummyTable, outputTable, keyColumn, [filter], [snapshotDir], [snapshotIntervalInMsgCount], [keepOrder], [keyPurgeFilter], [keyPurgeFreqInSecond=0], [raftGroup], [outputElapsedMicroseconds=false], [keyCapacity=1024], [parallelism=1])",
                "name": "createNarrowReactiveStateEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "metricNames",
                        "name": "metricNames"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[filter]",
                        "name": "filter",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[keepOrder]",
                        "name": "keepOrder",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter]",
                        "name": "keyPurgeFilter",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=0]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyCapacity=1024]",
                        "name": "keyCapacity",
                        "optional": true,
                        "default": "1024"
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [createNarrowReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createNarrowReactiveStateEngine.html)\n\n\n\n#### Syntax\n\ncreateNarrowReactiveStateEngine(name, metrics, metricNames, dummyTable, outputTable, keyColumn, \\[filter], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[keepOrder], \\[keyPurgeFilter], \\[keyPurgeFreqInSecond=0], \\[raftGroup], \\[outputElapsedMicroseconds=false], \\[keyCapacity=1024], \\[parallelism=1])\n\n#### Details\n\nCreate a reactive state engine that returns a table in narrow format. The only difference between `createNarrowReactiveStateEngine` and `createReactiveStateEngine` lies in the schema of the returned table, i.e., the former outputs results of multiple factors to a single column, while the latter outputs results of each factor to separate columns.\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n#### Parameters\n\nAs most of the parameters of `createNarrowReactiveStateEngine` are identical with those of [createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html), only the different ones are explained here.\n\n**metrics** is metacode or a tuple of metacode containing columns from the input table (excluding *keyColumn*, optional) or factors (formulas for calculation, required).\n\n**metricNames** is a STRING scalar or vector, indicating the name for each factor specified in *metrics*. The number and order of names must align to that of factors specified in *metrics*.\n\n**outputTable** is the output table for the results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\nThe output columns are in the following order:\n\n(1) The first few columns must be in the same order as that of *keyColumn*.\n\n(2) If the *outputElapsedMicroseconds* is set to true, specify two more columns: a LONG column and an INT column.\n\n(3) The references to columns from the input table specified in *metrics.*\n\n(4) A single column containing *metricNames*.\n\n(5) Then followed by one result column.\n\n**Note**: The following parameters are not supported currently: *snapshotDir*, *snapshotIntervalInMsgCount*, and *raftGroup.*\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\nCalculate the cumulative volume and the moving average and output the results of both factors to a single column.\n\n```\ndummy = streamTable(1:0, [\"securityID1\",\"securityID2\",\"securityID3\",\"createTime\",\"updateTime\",\"upToDatePrice\",\"qty\",\"value\"], [STRING,STRING,STRING,TIMESTAMP,TIMESTAMP,DOUBLE,DOUBLE,INT]) \nshare streamTable(1:0,[\"securityID1\",\"securityID2\",\"securityID3\",\"createTime\",\"updateTime\",\"metricNames\",\"factorValue\"], [STRING,STRING,STRING, TIMESTAMP,TIMESTAMP,STRING,DOUBLE]) as outputTable\n// Define two factors: cumulative volume and the moving average\nfactor = [<createTime>, <updateTime>,<cumsum(qty)>,<cumavg(upToDatePrice)>]\nNarrowtest = createNarrowReactiveStateEngine(name=\"narrowtest1\",metrics=factor,metricNames=[\"factor1\",\"factor2\"],dummyTable=dummy,outputTable=outputTable,keyColumn=[\"securityID1\",\"securityID2\",\"securityID3\"])\n\nnum = 5\ntmp = table(take(\"A\" + lpad(string(1..4),4,\"0\"),num) as securityID1,take(\"CC.HH\" + lpad(string(21..34),4,\"0\"),num) as securityID2,take(\"FFICE\" + lpad(string(13..34),4,\"0\"),num) as securityID3, 2023.09.01 00:00:00+(1..num) as createTime, 2023.09.01 00:00:00+(1..num) as updateTime,100.0+(1..num) as upToDatePrice, 130.0+(1..num) as qty,take(1..3,num) as value)\nNarrowtest.append!(tmp)\n\nselect * from outputTable\n\n/*\nsecurityID1\tsecurityID2\tsecurityID3\tcreateTime\tupdateTime\tmetricNames\tfactorValue\nA0001\tCC.HH0021\tFFICE0013\t2023.09.01T00:00:01.000\t2023.09.01T00:00:01.000\tfactor1\t131\nA0001\tCC.HH0021\tFFICE0013\t2023.09.01T00:00:01.000\t2023.09.01T00:00:01.000\tfactor2\t101\nA0002\tCC.HH0022\tFFICE0014\t2023.09.01T00:00:02.000\t2023.09.01T00:00:02.000\tfactor1\t132\nA0002\tCC.HH0022\tFFICE0014\t2023.09.01T00:00:02.000\t2023.09.01T00:00:02.000\tfactor2\t102\nA0003\tCC.HH0023\tFFICE0015\t2023.09.01T00:00:03.000\t2023.09.01T00:00:03.000\tfactor1\t133\nA0003\tCC.HH0023\tFFICE0015\t2023.09.01T00:00:03.000\t2023.09.01T00:00:03.000\tfactor2\t103\nA0004\tCC.HH0024\tFFICE0016\t2023.09.01T00:00:04.000\t2023.09.01T00:00:04.000\tfactor1\t134\nA0004\tCC.HH0024\tFFICE0016\t2023.09.01T00:00:04.000\t2023.09.01T00:00:04.000\tfactor2\t104\nA0001\tCC.HH0025\tFFICE0017\t2023.09.01T00:00:05.000\t2023.09.01T00:00:05.000\tfactor1\t135\nA0001\tCC.HH0025\tFFICE0017\t2023.09.01T00:00:05.000\t2023.09.01T00:00:05.000\tfactor2\t105\n*/\n```\n\nRelated functions: [addReactiveMetrics](https://docs.dolphindb.com/en/Functions/a/addReactiveMetrics.html), [getReactiveMetrics](https://docs.dolphindb.com/en/Functions/g/getReactiveMetrics.html)\n"
    },
    "createNearestJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createNearestJoinEngine.html",
        "signatures": [
            {
                "full": "createNearestJoinEngine(name, leftTable, rightTable, outputTable, kNearest, metrics, matchingColumn, [timeColumn], [useSystemTime=false], [garbageSize = 5000], [maxDelayedTime], [nullFill], [cachedTableCapacity=1024], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createNearestJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "kNearest",
                        "name": "kNearest"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[garbageSize = 5000]",
                        "name": "[garbageSize = 5000]"
                    },
                    {
                        "full": "[maxDelayedTime]",
                        "name": "maxDelayedTime",
                        "optional": true
                    },
                    {
                        "full": "[nullFill]",
                        "name": "nullFill",
                        "optional": true
                    },
                    {
                        "full": "[cachedTableCapacity=1024]",
                        "name": "cachedTableCapacity",
                        "optional": true,
                        "default": "1024"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createNearestJoinEngine](https://docs.dolphindb.com/en/Functions/c/createNearestJoinEngine.html)\n\nFirst introduced in version: 2.00.16.13.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\ncreateNearestJoinEngine(name, leftTable, rightTable, outputTable, kNearest, metrics, matchingColumn, \\[timeColumn], \\[useSystemTime=false], \\[garbageSize = 5000], \\[maxDelayedTime], \\[nullFill], \\[cachedTableCapacity=1024], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\n#### Details\n\nCreates a nearest-neighbor join streaming engine. The engine groups the left and right input tables by the columns specified in *matchingColumn*, and for each row in the left table, it retrieves the *k* nearest records from the right table (with timestamps not later than the current row) within each group, and computes the output based on these records in real time.\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n**Return value:** A table.\n\n#### Parameters\n\n**name** is a string indicating the name of the nearest-neighbor join streaming engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**leftTable** and **rightTable** are table objects whose schema must be the same as the input table.\n\n**outputTable** is a table to which the engine inserts calculation result. It can be an in-memory table or a DFS table. Before calling a function, an empty table with specified column names must be created.\n\nThe columns of *outputTable* are in the following order:\n\n(1) The first column must be a temporal column.\n\n* if *useSystemTime* = true, the data type must be TIMESTAMP;\n\n* if *useSystemTime* = false, it has the same data type as *timeColumn*.\n\n(2) Then followed by one or more columns on which the tables are joined, arranged in the same order as specified in *matchingColumn*.\n\n(3) Further followed by one or more columns which are the calculation results of *metrics*.\n\n**kNearest** is a positive integer. For each row in the left table, the engine retrieves the *k* nearest rows from the right table whose timestamps are less than or equal to the current row's timestamp.\n\n**metrics** is metacode (which can be a tuple) specifying the calculation formulas. For more information about metacode, please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions.\n\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\n* The columns in right table can be converted into array vectors using `toArray`, e.g., `<toArray(price)>`.\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\nIf you want to specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\nWhen an array vector result is required, explicitly apply the `toArray` function to convert the result type.\n\nThe `toColumnarTuple` function is supported to convert non-aggregated computation results into columnar tuples.\n\nThe following functions are optimized in the engine when they are applied only to the columns from the right table: `sum`, `sum2`, `avg`, `std`, `var`, `corr`, `covar`, `wavg`, `wsum`, `beta`, `max`, `min`, `last`, `first`, `med`, `percentile`.\n\n**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.\n\n* When there is only 1 column to match - 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If the names of all the columns to match are the same in both tables, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**timeColumn** (optional) When *useSystemTime* = false, it must be specified to indicate the name(s) of the time column in the left table and the right table. The time columns must have the same data type. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**useSystemTime** (optional) indicates whether the left table and the right table are joined on the system time, instead of on the *timeColumn*.\n\n* *useSystemTime* = true: join records based on the system time (timestamp with millisecond precision) when they are ingested into the engine.\n\n* *useSystemTime* = false (default): join records based on the specified timeColumn from the left table and the right table.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (rows). As the subscribed data is ingested into the engine, it continues to take up the memory. Within the left/right table, the records are grouped by *matchingColumn* values; When the number of records in a group exceeds *garbageSize*, the system will remove those already been calculated from memory.\n\n**maxDelayedTime** (optional) is a positive integer. *maxDelayedTime* only takes effect when *timeColumn* is specified and the two arguments must have the same time precision. Use *maxDelayedTime* to trigger windows which remain uncalculated long past its end. The default *maxDelayedTime* is 3 seconds. For more information about this parameter, see \"Window triggering rules\" in the Details section.\n\n**Note:** Please configure the *maxDelayedTime* parameter appropriately. When the left table contains sparse data and the right table has a high data frequency, setting *maxDelayedTime* too small may cause the system to prematurely clean up older data from the right table before certain group computations are triggered.\n\n**nullFill** (optional) is a tuple of the same size as the number of output columns. It is used to fill in the null values in the output table. The data type of each element corresponds to each output column.\n\n**cachedTableCapacity** (optional) is a positive integer indicating the initial capacity (in terms of the number of rows) of the left and right cache tables for each group. The default value is 1024.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\nshare table(100:0, `time`sym`factor1`factor2`factor3, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE[], DOUBLE]) as output\n\nnullFill= [2012.01.01T00:00:00.000, `NONE, 0.0, [], 0.0]\n\nnjEngine=createNearestJoinEngine(name=\"test1\", leftTable=leftTable, rightTable=rightTable, outputTable=output,  kNearest=8, metrics=<[price,toArray(val),sum(val)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false,nullFill=nullFill)\n\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{njEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{njEngine, false}, msgAsTable=true)\n\n\nn=10\n\ntp2=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(double(1..n),2*n) as val)\ntp2.sortBy!(`time)\nrightTable.append!(tp2)\n\n\ntp1=table(take(2012.01.01T00:00:00.003+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(NULL join rand(10.0, n-1),2*n) as price)\ntp1.sortBy!(`time)\nleftTable.append!(tp1)\n\n\ntp2=table(take(2012.01.01T00:00:00.010+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(double(1..n),2*n) as val)\ntp2.sortBy!(`time)\nrightTable.append!(tp2)\n\nselect * from output\n```\n\n| time                    | sym | factor1             | factor2                    | factor3 |\n| ----------------------- | --- | ------------------- | -------------------------- | ------- |\n| 2012.01.01 00:00:00.003 | A   | 0                   | \\[1, 2, 3, 4]              | 10      |\n| 2012.01.01 00:00:00.004 | A   | 8.049739237951693   | \\[1, 2, 3, 4, 5]           | 15      |\n| 2012.01.01 00:00:00.005 | A   | 6.31845193685475    | \\[1, 2, 3, 4, 5, 6]        | 21      |\n| 2012.01.01 00:00:00.006 | A   | 0.01247286192106635 | \\[1, 2, 3, 4, 5, 6, 7]     | 28      |\n| 2012.01.01 00:00:00.007 | A   | 8.373015887228414   | \\[1, 2, 3, 4, 5, 6, 7, 8]  | 36      |\n| 2012.01.01 00:00:00.008 | A   | 4.636610761119452   | \\[2, 3, 4, 5, 6, 7, 8, 9]  | 44      |\n| 2012.01.01 00:00:00.003 | B   | 8.049739237951693   | \\[2, 3, 4, 5]              | 14      |\n| 2012.01.01 00:00:00.004 | B   | 6.31845193685475    | \\[2, 3, 4, 5, 6]           | 20      |\n| 2012.01.01 00:00:00.005 | B   | 0.01247286192106635 | \\[2, 3, 4, 5, 6, 7]        | 27      |\n| 2012.01.01 00:00:00.006 | B   | 8.373015887228414   | \\[2, 3, 4, 5, 6, 7, 8]     | 35      |\n| 2012.01.01 00:00:00.007 | B   | 4.636610761119452   | \\[2, 3, 4, 5, 6, 7, 8, 9]  | 44      |\n| 2012.01.01 00:00:00.008 | B   | 7.700075873220435   | \\[3, 4, 5, 6, 7, 8, 9, 10] | 52      |\n| 2012.01.01 00:00:00.009 | B   | 0.5831421500989946  | \\[3, 4, 5, 6, 7, 8, 9, 10] | 52      |\n| 2012.01.01 00:00:00.009 | A   | 7.700075873220435   | \\[3, 4, 5, 6, 7, 8, 9, 10] | 52      |\n| 2012.01.01 00:00:00.010 | A   | 0.5831421500989946  | \\[4, 5, 6, 7, 8, 9, 10, 1] | 50      |\n| 2012.01.01 00:00:00.011 | A   | 5.117162734418752   | \\[5, 6, 7, 8, 9, 10, 1, 2] | 48      |\n| 2012.01.01 00:00:00.012 | A   | 8.823084861596655   | \\[6, 7, 8, 9, 10, 1, 2, 3] | 46      |\n| 2012.01.01 00:00:00.010 | B   | 5.117162734418752   | \\[5, 6, 7, 8, 9, 10, 1, 2] | 48      |\n| 2012.01.01 00:00:00.011 | B   | 8.823084861596655   | \\[6, 7, 8, 9, 10, 1, 2, 3] | 46      |\n| 2012.01.01 00:00:00.013 | B   | 0                   | \\[8, 9, 10, 1, 2, 3, 4, 5] | 42      |\n"
    },
    "createOrcaHaKeyedStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createOrcaHaKeyedStreamTable.html",
        "signatures": [
            {
                "full": "createOrcaHaKeyedStreamTable(name, keyColumn, colNames, colTypes, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "createOrcaHaKeyedStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [createOrcaHaKeyedStreamTable](https://docs.dolphindb.com/en/Functions/c/createOrcaHaKeyedStreamTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ncreateOrcaHaKeyedStreamTable(name, keyColumn, colNames, colTypes, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nCreates a high-availability keyed stream table.\n\nThe difference from `StreamGraph::haKeyedSource` is that `createOrcaHaKeyedStreamTable` does not rely on a stream graph.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** (optional) is a STRING scalar or vector specifying the primary key. When this parameter is set, a high-availability [keyed stream table](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) will be created, and its primary key cannot contain duplicate values.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nif(!existsCatalog(\"demo\")){\n    createCatalog(\"demo\")\n}\ngo\nuse catalog demo\n\ncreateOrcaHaKeyedStreamTable(\"ha_keyedTable\",`symbol, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG], 3, 50000)\n```\n"
    },
    "createOrcaHaStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createOrcaHaStreamTable.html",
        "signatures": [
            {
                "full": "createOrcaHaStreamTable(name, colNames, colTypes, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "createOrcaHaStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [createOrcaHaStreamTable](https://docs.dolphindb.com/en/Functions/c/createOrcaHaStreamTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ncreateOrcaHaStreamTable(name, colNames, colTypes, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nCreates a high-availability stream table. For details, see [haStreamTable](https://docs.dolphindb.com/en/Functions/h/haStreamTable.html).\n\nThe difference from `StreamGraph::haSource` is that `createOrcaHaStreamTable` does not rely on a stream graph.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nif(!existsCatalog(\"demo\")){\n    createCatalog(\"demo\")\n}\ngo\nuse catalog demo\n\ncreateOrcaHaStreamTable(\"ha_table\",`time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG], 3, 50000)\n```\n"
    },
    "createOrcaKeyedStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createOrcaKeyedStreamTable.html",
        "signatures": [
            {
                "full": "createOrcaKeyedStreamTable(name, keyColumn, colNames, colTypes, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "createOrcaKeyedStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createOrcaKeyedStreamTable](https://docs.dolphindb.com/en/Functions/c/createOrcaKeyedStreamTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ncreateOrcaKeyedStreamTable(name, keyColumn, colNames, colTypes, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted keyed stream table. For details, see [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) and [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\nThe difference from `StreamGraph::keyedSource` is that `createOrcaKeyedStreamTable` does not rely on a stream graph.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nif(!existsCatalog(\"demo\")){\n    createCatalog(\"demo\")\n}\ngo\nuse catalog demo\n\ncreateOrcaKeyedStreamTable(\"trade\", `symbol, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n```\n"
    },
    "createOrcaLatestKeyedStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createOrcaLatestKeyedStreamTable.html",
        "signatures": [
            {
                "full": "createOrcaLatestKeyedStreamTable(name, keyColumn, timeColumn, colNames, colTypes, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "createOrcaLatestKeyedStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createOrcaLatestKeyedStreamTable](https://docs.dolphindb.com/en/Functions/c/createOrcaLatestKeyedStreamTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ncreateOrcaLatestKeyedStreamTable(name, keyColumn, timeColumn, colNames, colTypes, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted keyed stream table that retains only the latest record for each unique primary key based on a time column. For details, see [latestKeyedStreamTable](https://docs.dolphindb.com/en/Functions/l/latestKeyedStreamTable.html) and [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\nThe difference from `StreamGraph::latestKeyedSource` is that `createOrcaLatestKeyedStreamTable` does not rely on a stream graph.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\n**timeColumn** specifies the time column(s) and can be either:\n\n* A string indicates a single column of integral or temporal type, or\n* A two-element vector indicates two columns that combine to form a unique timestamp: a DATE column and a TIME, SECOND, or NANOTIME column.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nif(!existsCatalog(\"demo\")){\n    createCatalog(\"demo\")\n}\ngo\nuse catalog demo\n\ncreateOrcaLatestKeyedStreamTable(\"trade\", `symbol, `time, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n```\n"
    },
    "createOrcaStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createOrcaStreamTable.html",
        "signatures": [
            {
                "full": "createOrcaStreamTable(name, colNames, colTypes, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "createOrcaStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createOrcaStreamTable](https://docs.dolphindb.com/en/Functions/c/createOrcaStreamTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ncreateOrcaStreamTable(name, colNames, colTypes, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted shared stream table. For details, see [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\nThe difference from `StreamGraph::source` is that `createOrcaStreamTable` does not rely on a stream graph.\n\n**Note:**\n\n* Before calling this function, you must first enable the Orca feature by setting `enableORCA=true` in the configuration file `cluster.cfg` or `controller.cfg`.\n* In a cluster environment, this function can only be executed on compute nodes within the compute group.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\ng.source(\"trade\", 1:0, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n```\n"
    },
    "createOrderBookSnapshotEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createOrderBookSnapshotEngine.html",
        "signatures": [
            {
                "full": "createOrderBookSnapshotEngine(name, exchange, orderbookDepth, intervalInMilli, date, startTime, prevClose, dummyTable, outputTable, inputColMap, [outputColMap], [outputCodeMap], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup], [outputIntervalOffsetMap], [checkRestrict], [maxPrice], [minPrice], [userDefinedMetrics], [priceNullFill], [triggerType], [forceTriggerTime], [precision], [orderBySeq], [skipCrossedMarket=true], [orderBookDetailDepth=0], [orderBookAsArray=false],[useSystemTime=false],[independentForceTriggerTime],[includeImmediateExecution=false], [securitySubType='ConvertibleBond'], [priceScale=10000], [endTime])",
                "name": "createOrderBookSnapshotEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "exchange",
                        "name": "exchange"
                    },
                    {
                        "full": "orderbookDepth",
                        "name": "orderbookDepth"
                    },
                    {
                        "full": "intervalInMilli",
                        "name": "intervalInMilli"
                    },
                    {
                        "full": "date",
                        "name": "date"
                    },
                    {
                        "full": "startTime",
                        "name": "startTime"
                    },
                    {
                        "full": "prevClose",
                        "name": "prevClose"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "inputColMap",
                        "name": "inputColMap"
                    },
                    {
                        "full": "[outputColMap]",
                        "name": "outputColMap",
                        "optional": true
                    },
                    {
                        "full": "[outputCodeMap]",
                        "name": "outputCodeMap",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[outputIntervalOffsetMap]",
                        "name": "outputIntervalOffsetMap",
                        "optional": true
                    },
                    {
                        "full": "[checkRestrict]",
                        "name": "checkRestrict",
                        "optional": true
                    },
                    {
                        "full": "[maxPrice]",
                        "name": "maxPrice",
                        "optional": true
                    },
                    {
                        "full": "[minPrice]",
                        "name": "minPrice",
                        "optional": true
                    },
                    {
                        "full": "[userDefinedMetrics]",
                        "name": "userDefinedMetrics",
                        "optional": true
                    },
                    {
                        "full": "[priceNullFill]",
                        "name": "priceNullFill",
                        "optional": true
                    },
                    {
                        "full": "[triggerType]",
                        "name": "triggerType",
                        "optional": true
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[precision]",
                        "name": "precision",
                        "optional": true
                    },
                    {
                        "full": "[orderBySeq]",
                        "name": "orderBySeq",
                        "optional": true
                    },
                    {
                        "full": "[skipCrossedMarket=true]",
                        "name": "skipCrossedMarket",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[orderBookDetailDepth=0]",
                        "name": "orderBookDetailDepth",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[orderBookAsArray=false]",
                        "name": "orderBookAsArray",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[independentForceTriggerTime]",
                        "name": "independentForceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[includeImmediateExecution=false]",
                        "name": "includeImmediateExecution",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[securitySubType='ConvertibleBond']",
                        "name": "securitySubType",
                        "optional": true,
                        "default": "'ConvertibleBond'"
                    },
                    {
                        "full": "[priceScale=10000]",
                        "name": "priceScale",
                        "optional": true,
                        "default": "10000"
                    },
                    {
                        "full": "[endTime]",
                        "name": "endTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createOrderBookSnapshotEngine](https://docs.dolphindb.com/en/Functions/c/createOrderBookSnapshotEngine.html)\n\n\n\n#### Syntax\n\ncreateOrderBookSnapshotEngine(name, exchange, orderbookDepth, intervalInMilli, date, startTime, prevClose, dummyTable, outputTable, inputColMap, \\[outputColMap], \\[outputCodeMap], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[raftGroup], \\[outputIntervalOffsetMap], \\[checkRestrict], \\[maxPrice], \\[minPrice], \\[userDefinedMetrics], \\[priceNullFill], \\[triggerType], \\[forceTriggerTime], \\[precision], \\[orderBySeq], \\[skipCrossedMarket=true], \\[orderBookDetailDepth=0], \\[orderBookAsArray=false],\\[useSystemTime=false],\\[independentForceTriggerTime],\\[includeImmediateExecution=false], \\[securitySubType='ConvertibleBond'], \\[priceScale=10000], \\[endTime])\n\n**Note:**\n\nThis order book engine is not currently supported under the Community Edition license. If you need this feature, contact technical support.\n\n#### Details\n\nCreates an order book engine. This engine generates order book snapshots in real time at a specified frequency, such as 1 second, 100 ms, or 30 ms, based on tick-by-tick order and trade data.\n\nThe output includes:\n\n* Full-depth order book information\n* Window-based statistics\n* Cumulative statistics for the full trading day\n\nThis engine supports both real-time data streaming and historical tick-by-tick replay.\n\nIf the engine produces no output or very little output after you feed in data, see [section 7.5 of the order book engine tutorial](https://docs.dolphindb.com/en/Tutorials/build_high_frequency_order_books.md#) to troubleshoot the issue.\n\n##### Supported Instrument Types\n\nThe engine currently supports building an order book for Shenzhen Stock Exchange (SZSE) stocks, SZSE bonds, and SZSE funds, as well as Shanghai Stock Exchange (SSE) stocks, SSE bonds, and SSE funds.\n\n**Note:**\n\nBond order matching follows the new rules issued after August 2022.\n\n##### Windowing Rules\n\nIf you do not specify *outputIntervalOffsetMap*, the windowing rules are as follows:\n\nThe *intervalInMilli* parameter specifies the window length in time, and the timestamp in the output table indicates the right boundary of the window. The last window is open on both ends, while all other windows are left-open and right-closed.\n\nThe upper bound of the last window's right boundary is as follows:\n\n* If *endTime* is specified, the upper bound of the last window's right boundary is *endTime*.\n* If *endTime* is not specified:\n  * When *exchange* = “XSHGBOND”, the upper bound of the last window's right boundary is 15:00:00.000.\n  * For any other value of *exchange*, the upper bound of the last window's right boundary is 14:57:00.000.\n\nIf you specify *outputIntervalOffsetMap*, the window length and boundaries are adjusted based on the *offset* configured in *outputIntervalOffsetMap*.\n\n* **First window**: The interval is \\[*startTime, startTime + intervalInMilli + offset*].\n* **Intermediate windows**: Each interval runs from the right boundary of the previous window to the current right boundary, with a fixed length of *intervalInMilli*.\n* **Last window**: The length is *intervalInMilli - offset*.\n\nFor example: *intervalInMilli* = 500 ms and *offset*= 50 ms.\n\n* First window: 09:30:00.000 - 09:30:00.550 (length: 550 ms)\n* Second window: 09:30:00.550 - 09:30:01.050 (length: 500 ms)\n* ...\n* Last window (assuming *endTime* is 14:57:00): 14:56:59.550 - 14:57:00.000 (length: 450 ms)\n\n##### Trigger Rules\n\nThe first output is triggered by the first input record whose timestamp is greater than *startTime* + *intervalInMilli*. In this case, the timestamp in the output record is *startTime* + *intervalInMilli*. Then, when a new tick arrives with a timestamp beyond the current window's right boundary, the engine outputs a snapshot for either a single instrument or all instruments, depending on the value of *triggerType*.\n\n**Note:**\n\n* An engine can accept data for at most one trading day and one channel, covering all instruments.\n* You must ensure that the tick-by-tick data inserted into the engine is sorted by its sequence number recorded by the exchange.\n\n#### Parameters\n\n**Note:**\n\nYou must specify parameter names when passing arguments.\n\n**name**: A STRING scalar that specifies the name of the order book engine. It can contain letters, digits, and underscores (\\_), but must start with a letter.\n\n**exchange**: A STRING scalar that specifies the exchange and instrument type. Valid values:\n\n* \"XSHE\" or \"XSHESTOCK\": SZSE stocks\n* \"XSHEBOND\": SZSE bonds\n* \"XSHEFUND\": SZSE funds\n* \"XSHG\" or \"XSHGSTOCK\": SSE stocks\n* \"XSHGBOND\": SSE bonds\n* \"XSHGFUND\": SSE funds\n\n**orderbookDepth**: A positive integer that specifies the maximum number of bid and ask levels displayed in the order book.\n\n**intervalInMilli**: A positive integer that specifies the interval (in milliseconds) at which a snapshot is generated and output.\n\n**date**: A DATE scalar that specifies the trading date. This parameter, together with the window's right boundary, forms the TIMESTAMP column in the output table.\n\n**startTime**: A TIME scalar that specifies the start time for triggering output. The engine outputs only data after the aligned time specified by this parameter.\n\n**prevClose**: A dictionary whose keys are STRING scalars or vectors that specify instrument symbols, and whose values are numeric values that specify the previous trading day's closing price for each instrument symbol. Note: If the value is a floating-point number, the engine treats it as the actual price and multiplies it by *priceScale* during processing to match the precision of priceColumn in the input table. If it is an integer, the engine assumes it already has the same precision as priceColumn and does not scale it further.\n\n**dummyTable**: A table object whose schema matches that of the input stream table. It can contain data or be empty.\n\n**outputTable**: A table object. If you specify *userDefinedMetrics*, the system defines the schema of the output table based on *basic* and *depth* specified by the `genOutputColumnsForOBSnapshotEngine` function, as well as the user-defined metrics. Otherwise, the system defines the table schema based on the *outputColMap* setting.\n\n**Note:**\n\nIf you need to output tradeBuyOrderTypeList and tradeSellOrderTypeList in tradeDetail, add them to *outputColMap*.\n\n**inputColMap**: A dictionary that maps column names in the input table to the columns required by the engine for computation. Where:\n\n* Each key is a string that identifies a fixed input column required by the engine. See the table below for the column names and their descriptions. Note that these keys are case-sensitive. You must specify all of them, but you can provide them in any order.\n* Each value is a string that specifies a column name in the input table.\n\n<table id=\"table_dccab8f97dd1\"><thead><tr><th>\n\nKey\n\n</th><th>\n\nData Type of Column Specified by Value\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n\"codeColumn\"\n\n</td><td>\n\nSYMBOL\n\n</td><td>\n\nInstrument symbol (for example, 300010.SZ)\n\n</td></tr><tr><td>\n\n\"timeColumn\"\n\n</td><td>\n\nTIME\n\n</td><td>\n\nTrade time\n\n</td></tr><tr><td>\n\n\"typeColumn\"\n\n</td><td>\n\nINT\n\n</td><td>\n\nTrade type:-   For tick-by-tick orders:\n\\-   1 indicates a market order\n\\-   2 indicates a limit order\n\\-   3 indicates a same-side best order\n\\-   10 indicates an order cancellation (SSE only)\n\\-   11 indicates market status (SSE only)\n\n* For tick-by-tick trades:\n  * 0 indicates a trade\n  * 1 indicates a cancellation (SZSE only)\n\n</td></tr><tr><td>\n\n\"priceColumn\"\n\n</td><td>\n\nLONG\n\n</td><td>\n\nPrice. The scale is determined by *priceScale*; by default, it is the actual price × 10000.\n\n</td></tr><tr><td>\n\n\"qtyColumn\"\n\n</td><td>\n\nLONG\n\n</td><td>\n\nNumber of shares\n\n</td></tr><tr><td>\n\n\"buyOrderColumn\"\n\n</td><td>\n\nLONG\n\n</td><td>\n\n* Tick-by-tick trade: the buy order sequence number in the original trade record.\n* Tick-by-tick order:\n  * SSE: Populate this field with the original order sequence number from the original order data, which is the unique identifier (OrderNo) used by the exchange to identify an order when adding and canceling orders.\n  * SZSE: Populate this field with 0. In the SZSE data, this field is a redundant column added to align with the SSE data format.\n\n</td></tr><tr><td>\n\n\"sellOrderColumn\"\n\n</td><td>\n\nLONG\n\n</td><td>\n\n* Tick-by-tick trade: the sell order sequence number from the original trade data.\n* Tick-by-tick order:\n  * SSE: Populate this field with the original order sequence number from the original order data, which is the unique identifier (OrderNo) used by the exchange to identify an order when adding and canceling orders.\n  * SZSE: Populate this field with 0. In the SZSE data, this field is a redundant column added to align with the SSE data format.\n\n</td></tr><tr><td>\n\n\"sideColumn\"\n\n</td><td>\n\nINT\n\n</td><td>\n\nBuy/sell:-   1 indicates a buy order\n\n* 2 indicates a sell order\n\n**Note:**\n\n* For order submission, BSFlag is required.\n* For order cancellation, BSFlag is determined by the original order and is required.\n* For order execution, BSFlag is optional.\n\n</td></tr><tr><td>\n\n\"msgTypeColumn\"\n\n</td><td>\n\nINT\n\n</td><td>\n\nData type:-   0 indicates tick-by-tick orders\n\n* 1 indicates tick-by-tick trades\n* -1 indicates product status\n\n</td></tr><tr><td>\n\n\"seqColumn\"\n\n</td><td>\n\nLONG\n\n</td><td>\n\nThe tick-by-tick data sequence number that starts from 1 and increments within each channel. For SZSE, use the appseqlnum field. If the index field is included, you can also use index. For SSE, use the bizIndex field.\n\n</td></tr><tr><td>\n\n\"receiveTime\"\n\n</td><td>\n\nNANOTIMESTAMP\n\n</td><td>\n\nThe time when the tick-by-tick data was received.\n\n</td></tr></tbody>\n</table>**Note:**\n\nThe columns listed above are defined using predefined enum values. Input values must strictly follow the defined conventions to ensure correct results. For example, the column in the input table mapped to sideColumn must use 1 for buy and 2 for sell.\n\n**outputColMap** (optional): A STRING vector that specifies the names of the columns to output. Column names are case-insensitive. For convenience, you can use the `genOutputColumnsForOBSnapshotEngine` function to generate the required output column names and assign the first element of the return value to *outputColMap*.\n\n**Note:**\n\nThe column list generated by the `genOutputColumnsForOBSnapshotEngine` function does not include the following columns:\n\n* tradeBuyOrderTypeList and tradeSellOrderTypeList in tradeDetail.\n* withdrawBuyOrderNoList and withdrawSellOrderNoList in withdrawDetail.\n* ResidualBidOrderNoList and ResidualAskOrderNoList in residualDetail.\n\nTo output the preceding columns, add them to *outputColMap*.\n\n**outputCodeMap** (optional): A STRING vector that specifies instrument symbols, for example: \"000803.SZ\". If you specify this parameter, the engine outputs data only for the specified instruments.\n\n**outputIntervalOffsetMap** (optional): A vector or dictionary that specifies the time offset, in milliseconds, for triggering calculation of each instrument in the output table.\n\n* **Calculation logic**: The engine redefines the window boundaries for each instrument based on the offset. The first window automatically includes all tick-by-tick data from *startTime* to *startTime + intervalInMilli + offset*, ensuring that data generated during the offset period is included in the current snapshot calculation.\n* **Vector**: The engine automatically splits the input instruments evenly based on the size of the vector. For example, `outputIntervalOffsetMap = [400, 500]` means the engine automatically splits the input instruments into two equal groups. It outputs one group's data after intervalInMilli + 400 (ms), and the other group's data after intervalInMilli + 500 (ms).\n* **Dictionary**: Each key is a string that specifies an instrument symbol, and each value is an integer that specifies a time offset. For example, `outputIntervalOffsetMap =dict([\"127053.sz\",\"123082.SZ\"],[400, 500])` means the engine outputs data for 127053.sz after intervalInMilli + 400 (ms), and for 123082.SZ after intervalInMilli + 500 (ms).\n\n**checkRestrict** (optional): A Boolean value. The default value is true, which enables the price band mechanism. If you set it to false, the mechanism is disabled, and instrument trading restrictions are removed; in that case, generated snapshots for ChiNext instruments may be inaccurate.\n\n**Note:**\n\nSZSE applies a price cage mechanism to ChiNext instruments whose symbol starts with 3. When *checkRestrict*=true, the engine determines whether to apply the price cage mechanism solely by checking whether the first character of the instrument symbol is 3. Therefore, when you feed ChiNext data into the engine, the instrument symbol must start with 3.\n\n**maxPrice** (optional): A dictionary. Each key is a string that specifies the instrument symbol, and each value is of type DOUBLE or INT and specifies the limit up price. Note: If *maxPrice* is a floating-point number, the engine treats it as the actual price and multiplies it by *priceScale* during processing to match the precision of priceColumn in the input table. If it is an integer, the engine assumes it already has the same precision as priceColumn and does not scale it further.\n\n**minPrice** (optional): A dictionary. Each key is a string that specifies the instrument symbol, and each value is of type DOUBLE or INT and specifies the limit down price. Note: If *minPrice* is a floating-point number, the engine treats it as the actual price and multiplies it by *priceScale* during processing to match the precision of priceColumn in the input table. If it is an integer, the engine assumes it already has the same precision as priceColumn and does not scale it further.\n\n**userDefinedMetrics** (optional): An unary function.\n\n* The function takes a table as input. Each row specifies an instrument, and the columns contain the snapshot data for that instrument. If you specify *outputColMap*, the table contains the columns configured in *outputColMap*. Otherwise, it contains the basic columns plus bid/ask prices and quantities.\n* The function returns a tuple. Each element in the tuple is a vector containing the results of the corresponding metric calculated for each instrument.\n\n**priceNullFill**: A numeric value. This parameter is used to fill missing price levels in the bid/ask ladders in the output table. For example, after an instrument reaches the limit up price, all ask prices may be NULL. If you want the ask price to be output as 0 in this case, set *priceNullFill*=0.\n\n**triggerType** (optional): A STRING scalar that specifies the trigger mode. Valid values:\n\n* \"mutual\" (default): When the engine receives a new tick whose timestamp is greater than the right boundary of the current window, it triggers snapshot generation for all instruments whose snapshot has not yet been generated. The record that triggers the calculation is not included.\n* \"independent\": When the engine receives a new tick whose timestamp is greater than the right boundary of the window, it triggers snapshot generation only for the corresponding instrument whose snapshot has not yet been generated. The record that triggers the calculation is not included.\n* \"perRow\": When the engine receives any new tick, it triggers snapshot generation for the corresponding instrument and includes the triggering record in the calculation.\n\n**forceTriggerTime** (optional): A non-negative integer, in milliseconds. In addition to normal snapshot generation triggers, some out-of-order data may fail to trigger snapshot generation and instead be cached in the engine. In this case, you can use this parameter to force the engine to generate snapshots from tick-by-tick data that has remained unprocessed for an extended period. Trigger rules:\n\n1. If the timestamp (t) of the most recently received tick-by-tick data minus the timestamp (t0) of the last processed trade record is greater than or equal to *forceTriggerTime*, the engine triggers snapshot generation for the unprocessed record with the smallest sequence number and updates the timestamp of the last processed trade record to t1.\n2. The engine repeats the preceding step. If t-t1 >= *forceTriggerTime*, it triggers snapshot generation for the unprocessed record with the smallest sequence number and updates the timestamp of the last processed trade record to t2. It continues until the difference between the two timestamps is less than *forceTriggerTime*, at which point snapshot generation stops.\n\n**precision** (optional): An integer that specifies the number of decimal places. Valid range: \\[-1, 4].\n\n* When *precision* = -1, the engine outputs price-related columns as integers. Note: The corresponding columns in the output table can be of either integer or decimal values.\n* When *precision* is set to a value in \\[0, 4], it specifies the number of decimal places. All prices in the output table are rounded to the specified number of decimal places. Otherwise, the engine outputs the original results.\n\n**orderBySeq** (optional): A tuple or Boolean value.\n\n* If you specify this parameter to a Boolean value, it indicates whether the engine processes data in ascending order of the values in the seqColumn column of the tick-by-tick data. When *exchange* = \"XSHG\" or \"XSHGFUND\", the default value is true. In all other cases, the default value is false.\n  * When *orderBySeq* = true, the engine processes tick-by-tick data in sequence order and then calculates and outputs the results. For example, if the engine receives records with sequence numbers 1 and 3, it caches both because record 2 is missing. It does not calculate or output results until record 2 arrives. In this case, you can also specify *forceTriggerTime* to force the engine to calculate and output results.\n  * When *orderBySeq* = false, the engine calculates and outputs results immediately each time it receives a record. In this case, you cannot set *forceTriggerTime*.\n* If you specify this parameter to a tuple, use the form (BOOL, INTEGER, \\[STRING]), where:\n  * The first element is a Boolean value that specifies whether to output results in sequence order for tick-by-tick data. Its effect is the same as described above.\n  * The second element is a positive integer that specifies the time interval, in milliseconds, at which the amount of cached input data is recorded.\n  * The third element is an optional STRING scalar that specifies the output log level. Valid values are \"DEBUG\" (default) and \"INFO\", which correspond to Debug-level and Info-level log output, respectively.\n\n**skipCrossedMarket** (optional): A Boolean value that specifies whether to output results when the best ask and best bid cross.\n\n* When *skipCrossedMarket* = true (default), if *useSystemTime* = false and the best ask and best bid cross, that is, the ask price <= the bid price, the engine does not output that result. If *useSystemTime* = true, the engine temporarily suppresses that snapshot when the best ask and best bid cross; if subsequently received data no longer shows a crossed market, the engine immediately outputs that snapshot.\n* When *skipCrossedMarket* = false, the engine still outputs the result even if the best ask and best bid cross.\n\n**orderBookDetailDepth** (optional): An integer that specifies the depth of the order book. The default value is 0, which means no output. This parameter must match the value of the orderBookDetailDepth column in *outputColMap*.\n\n**orderBookAsArray** (optional): A Boolean value that specifies whether to output bid/ask prices and quantities as array vectors. The default value is false, in which case prices and quantities are output in multiple columns.\n\n**Note:**\n\nIf you specify *userDefinedMetrics*, *orderBookAsArray* determines how prices and quantities are output. Otherwise, *outputColMap* determines the output format of prices and quantities, and *orderBookAsArray* is ignored.\n\n**useSystemTime** (optional): A Boolean value that specifies whether to use system time to trigger snapshot output.\n\n* When *useSystemTime* = true, during trading hours, the engine uses the current system time to trigger snapshot output at the interval specified by *intervalInMilli*. In this case, the engine does not output data during the midday break ((11:30:00.000, 13:00:00.000]), and the timestamp of the first afternoon output window is 13:00:00.000+*intervalInMilli*. Note: If *useSystemTime* = true, you cannot specify *forceTriggerTime*. You can leave *triggerType* unspecified or set *triggerType* = \"mutual\".\n* When *useSystemTime* = false (default), the engine triggers snapshot output based on event time.\n\n**independentForceTriggerTime** (optional): A non-negative integer, in milliseconds, that specifies the interval for forcing snapshot output for groups that have not output a snapshot for an extended period. This parameter takes effect only when *triggerType* = \"independent\".\n\nFor example, assume that among the data processed so far, the timestamp of the most recent record is t. For each group, let ti denote the snapshot time that should have triggered an output based on the data processed for that group. If t - ti > *independentForceTriggerTime*, the engine triggers snapshot output for the corresponding group.\n\n**includeImmediateExecution** (optional): A Boolean value that specifies whether immediate execution information is included in orderDetail statistics. The default value is false. This parameter takes effect only when generating SSE order books, and applies to stock and fund data (*exchange* set to \"XSHG\", \"XSHGSTOCK\", or \"XSHGFUND\").\n\n**Note:**\n\nIf this parameter is set to true, *inputColMap* must ensure that OrderNo values in the input data are globally ordered. Also, ensure that any previously unrecorded orderNo in immediate execution records is greater than or equal to the latest recorded OrderNo.\n\n**securitySubType** (optional): A case-insensitive STRING scalar that specifies the subtype of the instrument for which to generate the order book. It applies only when *exchange* is \"XSHEBOND\" or \"XSHGBOND\". Valid values:\n\n* \"ConvertibleBond\" (default): For \"XSHEBOND\", the order book includes only bonds with symbol prefixes \"123\", \"127\", or \"128\". For \"XSHGBOND\", the order book includes only bonds with symbol prefixes \"110\", \"111\", \"113\", or \"118\".\n* \"All\": Includes all bonds, with no symbol prefix restrictions.\n\n**priceScale** (optional): A positive integer that specifies the scaling factor for the priceColumn column in the input table. The default value is 10000. When outputting results, the engine divides the calculated values by *priceScale*.\n\n**endTime** (optional): A TIME scalar that specifies the upper bound of the last snapshot output window's right boundary. The engine outputs snapshot data for a window only if the window's right boundary timestamp is less than *endTime*.\n\nYou can set this parameter only when *triggerType* = \"mutual\". If you do not specify it, the default value of *endTime* is 15:00:00.000 when *exchange* = \"XSHGBOND\"; for all other values of *exchange*, the default value of *endTime* is 14:57:00.000.\n\nTo enable the snapshot mechanism, you must specify both *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional): A STRING scalar that specifies the directory where engine snapshots are stored.\n\n* The specified directory must already exist; otherwise, the system raises an exception.\n* When you create a streaming engine with *snapshotDir* specified, the system checks whether snapshots exist in that directory. If a snapshot exists, the system loads it and restores the engine state.\n* The system distinguishes snapshot files by engine name to allow multiple engines to use the same directory.\n* An engine snapshot may use three filenames:\n  * For temporary snapshot storage, the snapshot is named as *.tmp*.\n  * After the snapshot is generated and flushed to disk, it is saved as *.snapshot*.\n  * If a snapshot with the same name already exists, the older snapshot is automatically renamed to *.old*.\n\n**snapshotIntervalInMsgCount** (optional): An integer that specifies how many records trigger one snapshot save for the streaming engine.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nBefore you run the code, download the file [orderbookDemoInput.zip](https://docs.dolphindb.com/en/Functions/data/orderbookDemoInput.zip).\n\nExample 1: This example shows how to build a high-frequency order book from historical tick-by-tick data. In this example, the engine is configured to compute and output a 10-level bid-ask order book for SZSE stocks every second. It demonstrates the complete data processing workflow, including data loading, engine creation, data insertion, and result verification.\n\n```\n// Log in to the DolphinDB server\nlogin(\"admin\", \"123456\")\n\n// Release any existing engine\ntry { dropStreamEngine(\"demo\") } catch(ex) { print(ex) }\n\n// Create an output table, which will be passed to the outputTable parameter\nsuffix = string(1..10)\ncolNames = `SecurityID`timestamp`lastAppSeqNum`tradingPhaseCode`modified`turnover`volume`tradeNum`totalTurnover`totalVolume`totalTradeNum`lastPx`highPx`lowPx`ask`bid`askVol`bidVol`preClosePx`invalid  join (\"bids\" + suffix) join (\"bidVolumes\" + suffix) join (\"bidOrderNums\" + suffix) join (\"asks\" + suffix)  join (\"askVolumes\" + suffix) join (\"askOrderNums\" + suffix) \ncolTypes = [SYMBOL,TIMESTAMP,LONG,INT,BOOL,DOUBLE,LONG,INT,DOUBLE,LONG,INT,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,LONG,LONG,DOUBLE,BOOL] join take(DOUBLE, 10) join take(LONG, 10) join take(INT, 10) join take(DOUBLE, 10) join take(LONG, 10) join take(INT, 10) \nshare table(10000000:0, colNames, colTypes) as outTable\n\n// Create a dummy table to define the schema of the input table, which will be passed to the dummyTable parameter\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo\ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT]\ndummyOrderStream = table(1:0, colNames, colTypes)\n\n// Create a dictionary to define the meaning of each column in the input table, which will be passed to the inputColMap parameter\ninputColMap = dict(`codeColumn`timeColumn`typeColumn`priceColumn`qtyColumn`buyOrderColumn`sellOrderColumn`sideColumn`msgTypeColumn`seqColumn, `SecurityID`Time`Type`Price`Qty`BuyNo`SellNo`BSFlag`SourceType`ApplSeqNum)\n\n// Create a dictionary to define the previous day's closing prices, which will be passed to the prevClose parameter. prevClose does not affect any output columns other than the previous day's closing prices.\nprevClose = dict(`000587.SZ`002694.SZ`002822.SZ`000683.SZ`301063.SZ`300459.SZ`300057.SZ`300593.SZ`301035.SZ`300765.SZ, [1.66, 6.56, 6.10, 8.47, 38.10, 5.34, 9.14, 48.81, 60.04, 16.52])\n\n// Create the engine to compute and output a 10-level bid-ask order book for SZSE stocks every second\nengine = createOrderBookSnapshotEngine(name=\"demo\", exchange=\"XSHE\", orderbookDepth=10, intervalInMilli = 1000, date=2022.01.10, startTime=09:15:00.000, prevClose=prevClose, dummyTable=dummyOrderStream, outputTable=outTable, inputColMap=inputColMap)\n\nfilePath = \"./orderbookDemoInput.csv\"\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo\ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT]\norderTrade = table(1:0, colNames, colTypes)\norderTrade.append!(select * from loadText(filePath) order by Time)\n\n// Batch-insert tick-by-tick data of 10 stocks into the order book engine\nengine.append!(orderTrade)\nselect count(*) from outTable where SecurityID=\"300593.SZ\", timestamp between 2022.01.10T13:15:01.000 and 2022.01.10T13:15:10.000\n\n//output: 10\n```\n\nExample 2: This example demonstrates price control and output filtering. Key parameters are set as follows:\n\n* Use *maxPrice* and *minPrice* to set the limit up price and limit down price.\n* Set *priceNullFill* = 0 to fill missing prices with 0.\n* Use *priceScale* and *precision* to set the price scaling factor and the number of decimal places for output prices, respectively.\n* Set *skipCrossedMarket* = false to allow output of crossed bid-ask results.\n\n```\ntry { dropStreamEngine(\"demo\") } catch(ex) { print(ex) }  \n  \nfilePath = \"./orderbookDemoInput.csv\"  \n  \n// Create a dummy table to define the schema of the input table, which will be passed to the dummyTable parameter\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo  \ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT]  \nshare table(1:0, colNames, colTypes) as dummyOrderStream  \n  \n// Create a dictionary to define the meaning of each column in the input table, which will be passed to the inputColMap parameter\ninputColMap = dict(`codeColumn`timeColumn`typeColumn`priceColumn`qtyColumn`buyOrderColumn`sellOrderColumn`sideColumn`msgTypeColumn`seqColumn, `SecurityID`Time`Type`Price`Qty`BuyNo`SellNo`BSFlag`SourceType`ApplSeqNum)  \n  \n// Create a dictionary to define the previous day's closing prices, which will be passed to the prevClose parameter\nprevClose = dict(`000587.SZ`002694.SZ`002822.SZ`000683.SZ`301063.SZ`300459.SZ`300057.SZ`300593.SZ`301035.SZ`300765.SZ, [1.66, 6.56, 6.10, 8.47, 38.10, 5.34, 9.14, 48.81, 60.04, 16.52])  \n  \n// Set the limit up price and limit down price (actual prices; the engine automatically multiplies them by priceScale)\nmaxPrice = dict(`000587.SZ`002694.SZ`002822.SZ, [1.83, 7.22, 6.71])  \nminPrice = dict(`000587.SZ`002694.SZ`002822.SZ, [1.49, 5.90, 5.49])  \n  \n// Specify which stocks to output by symbol\noutputCodeMap = `000587.SZ`002694.SZ`002822.SZ  \n  \n// Create the output table schema\noutputColMap, outputTableSch = genOutputColumnsForOBSnapshotEngine(basic=true, time=false, depth=(10, true), tradeDetail=true, orderDetail=false, withdrawDetail=false, orderBookDetailDepth=0, prevDetail=false)  \n  \n// Create the engine and set price-related parameters and output filters\nengine = createOrderBookSnapshotEngine(  \n    name=\"demo\",   \n    exchange=\"XSHE\",   \n    orderbookDepth=10,   \n    intervalInMilli = 1000,   \n    date=2022.01.10,   \n    startTime=09:15:00.000,   \n    prevClose=prevClose,   \n    dummyTable=dummyOrderStream,   \n    outputTable=outputTableSch,   \n    inputColMap=inputColMap,   \n    outputColMap=outputColMap,  \n    outputCodeMap=outputCodeMap,  // Output only the specified stocks\n    maxPrice=maxPrice,          // Set the limit up price\n    minPrice=minPrice,          // Set the limit down price\n    priceNullFill=0,            // Fill missing prices with 0\n    priceScale=10000,           // Price scaling factor\n    precision=2,                // Keep 2 decimal places for prices\n    skipCrossedMarket=false     // Allow output with crossed bid and ask prices\n)  \n  \n// Insert data\nengine.append!(select * from loadText(filePath) order by Time)  \nselect top 10 * from outputTableSch where code in outputCodeMap, timestamp between 2022.01.10T13:15:01.000 and 2022.01.10T13:15:10.000\n```\n\nExample 3: This example demonstrates the trigger mechanism and time control. Key parameters are set as follows:\n\n* Set *triggerType* = \"independent\" to enable independent trigger mode.\n* Set *forceTriggerTime* to specify the interval for forced triggers.\n* Set *orderBySeq*=true to ensure that data is processed in sequence order.\n* Set *independentForceTriggerTime* to specify the forced trigger time for groups in independent trigger mode.\n\n```\ntry { dropStreamEngine(\"demo\") } catch(ex) { print(ex) }  \n  \nfilePath = \"./orderbookDemoInput.csv\"  \n  \n// Create a dummy table to define the schema of the input table, which will be passed to the dummyTable parameter\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo  \ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT]  \nshare table(1:0, colNames, colTypes) as dummyOrderStream  \n  \n// Create a dictionary to define the meaning of each column in the input table, which will be passed to the inputColMap parameter\ninputColMap = dict(`codeColumn`timeColumn`typeColumn`priceColumn`qtyColumn`buyOrderColumn`sellOrderColumn`sideColumn`msgTypeColumn`seqColumn, `SecurityID`Time`Type`Price`Qty`BuyNo`SellNo`BSFlag`SourceType`ApplSeqNum)  \n  \n// Create a dictionary to define the previous day's closing prices, which will be passed to the prevClose parameter\nprevClose = dict(`000587.SZ`002694.SZ`002822.SZ`000683.SZ`301063.SZ`300459.SZ`300057.SZ`300593.SZ`301035.SZ`300765.SZ, [1.66, 6.56, 6.10, 8.47, 38.10, 5.34, 9.14, 48.81, 60.04, 16.52])  \n    \n// Create the output table schema\noutputColMap, outputTableSch = genOutputColumnsForOBSnapshotEngine(basic=true, time=false, depth=(10, true), tradeDetail=true, orderDetail=false, withdrawDetail=false, orderBookDetailDepth=0, prevDetail=false)  \n  \n// Create the engine and set the trigger mechanism and time control\nengine = createOrderBookSnapshotEngine(  \n    name=\"demo\",   \n    exchange=\"XSHE\",   \n    orderbookDepth=10,   \n    intervalInMilli = 1000,   \n    date=2022.01.10,   \n    startTime=09:15:00.000,   \n    prevClose=prevClose,   \n    dummyTable=dummyOrderStream,   \n    outputTable=outputTableSch,   \n    inputColMap=inputColMap,   \n    outputColMap=outputColMap,  \n    triggerType=\"independent\",                      // Independent trigger mode\n    forceTriggerTime=5000,                          // Force a trigger after 5 seconds\n orderBySeq=true, // Process data in ID order\n    independentForceTriggerTime=3000                // Forced trigger time for independent groups\n)  \n\n// Insert data\nengine.append!(select * from loadText(filePath) order by Time)  \nselect top 10 * from outputTableSch where timestamp between 2022.01.10T13:15:01.000 and 2022.01.10T13:15:10.000\n```\n\nExample 4: This example uses *outputIntervalOffsetMap* to specify different time offsets for specific stocks. Because *outputIntervalOffsetMap* cannot be used with *triggerType* = \"independent\" or *triggerType* = \"perRow\", this example sets *triggerType* = \"mutual\" (default).\n\n```\ntry { dropStreamEngine(\"demo\") } catch(ex) { print(ex) }  \n  \nfilePath = \"./orderbookDemoInput.csv\"  \n  \n// Create a dummy table to define the schema of the input table, which will be passed to the dummyTable parameter\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo  \ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT]  \nshare table(1:0, colNames, colTypes) as dummyOrderStream  \n  \n// Create a dictionary to define the meaning of each column in the input table, which will be passed to the inputColMap parameter\ninputColMap = dict(`codeColumn`timeColumn`typeColumn`priceColumn`qtyColumn`buyOrderColumn`sellOrderColumn`sideColumn`msgTypeColumn`seqColumn, `SecurityID`Time`Type`Price`Qty`BuyNo`SellNo`BSFlag`SourceType`ApplSeqNum)  \n  \n// Create a dictionary to define the previous day's closing prices, which will be passed to the prevClose parameter\nprevClose = dict(`000587.SZ`002694.SZ`002822.SZ`000683.SZ`301063.SZ`300459.SZ`300057.SZ`300593.SZ`301035.SZ`300765.SZ, [1.66, 6.56, 6.10, 8.47, 38.10, 5.34, 9.14, 48.81, 60.04, 16.52])  \n  \n// Set output time offsets as a dictionary to assign different output time offsets to different stocks\noutputIntervalOffsetMap = dict(`000587.SZ`002694.SZ`002822.SZ, [100, 200, 300])  // Different stocks use offsets of 100 ms, 200 ms, and 300 ms\n  \n// Create the output table schema\noutputColMap, outputTableSch = genOutputColumnsForOBSnapshotEngine(basic=true, time=false, depth=(10, true), tradeDetail=true, orderDetail=false, withdrawDetail=false, orderBookDetailDepth=0, prevDetail=false)  \n  \n// Create the engine and use the default triggerType=\"mutual\" with outputIntervalOffsetMap\nengine = createOrderBookSnapshotEngine(  \n    name=\"demo\",   \n    exchange=\"XSHE\",   \n    orderbookDepth=10,   \n    intervalInMilli = 1000,   \n    date=2022.01.10,   \n    startTime=09:15:00.000,   \n    prevClose=prevClose,   \n    dummyTable=dummyOrderStream,   \n    outputTable=outputTableSch,   \n    inputColMap=inputColMap,   \n    outputColMap=outputColMap,  \n    outputIntervalOffsetMap=outputIntervalOffsetMap  // Set time offsets\n)  \n  \n// Insert data\nengine.append!(select * from loadText(filePath) order by Time)  \n  \n// View differences in output timestamps for different stocks\nselect * from outputTableSch where code in `000587.SZ`002694.SZ`002822.SZ, timestamp between 2022.01.10T13:15:00.000 and 2022.01.10T13:15:02.000 order by code, timestamp\n```\n\nSome results are shown below:\n\n![](https://docs.dolphindb.com/en/Functions/images/1.png)\n\nExample 5: Use *outputColMap*to specify the columns to output. The first element returned by `genOutputColumnsForOBSnapshotEngine` is *outputColMap*, and the second element determines the schema of *outputTable*.\n\n```\ntry { dropStreamEngine(\"demo\") } catch(ex) { print(ex) }\n\nfilePath = \"./orderbookDemoInput.csv\"\n\n// Create a dummy table to define the schema of the input table, which will be passed to the dummyTable parameter\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo\ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT]\nshare table(1:0, colNames, colTypes) as dummyOrderStream\n\n// Create a dictionary to define the meaning of each column in the input table, which will be passed to the inputColMap parameter\ninputColMap = dict(`codeColumn`timeColumn`typeColumn`priceColumn`qtyColumn`buyOrderColumn`sellOrderColumn`sideColumn`msgTypeColumn`seqColumn, `SecurityID`Time`Type`Price`Qty`BuyNo`SellNo`BSFlag`SourceType`ApplSeqNum)\n\n// Create a dictionary to define the previous day's closing prices, which will be passed to the prevClose parameter. prevClose does not affect any output columns other than the previous day's closing prices.\nprevClose = dict(`000587.SZ`002694.SZ`002822.SZ`000683.SZ`301063.SZ`300459.SZ`300057.SZ`300593.SZ`301035.SZ`300765.SZ, [1.66, 6.56, 6.10, 8.47, 38.10, 5.34, 9.14, 48.81, 60.04, 16.52])\n\n//Create outputColMap and outputTableSch to receive the return values of genOutputColumnsForOBSnapshotEngine. They are used to define outputColMap and the schema of outputTable, respectively.\noutputColMap, outputTableSch = genOutputColumnsForOBSnapshotEngine(basic=true, time=false, depth=(10, true), tradeDetail=true, orderDetail=false, withdrawDetail=false, orderBookDetailDepth=0, prevDetail=false)\n\nengine = createOrderBookSnapshotEngine(name=\"demo\", exchange=\"XSHE\", orderbookDepth=10, intervalInMilli = 1000, date=2022.01.10, startTime=09:15:00.000, prevClose=prevClose, dummyTable=dummyOrderStream, outputTable=outputTableSch, inputColMap=inputColMap, outputColMap=outputColMap, orderBookAsArray=true)\n\n// Batch-insert tick-by-tick data of 10 stocks into the order book engine\nengine.append!(select * from loadText(filePath) order by Time)\nselect top 10 * from outputTableSch where code=\"300593.SZ\", timestamp between 2022.01.10T13:15:01.000 and 2022.01.10T13:15:10.000\n```\n\nSome results are shown below:\n\n![](https://docs.dolphindb.com/en/Functions/images/2.png)\n\nYou can use `genOutputColumnsForOBSnapshotEngine` to output only the columns you need. Suppose you need to output only some columns from `tradeDetail` in the example, such as excluding the last four columns. You can process the return values of `genOutputColumnsForOBSnapshotEngine` as follows:\n\n```\noutputColMap = outputColMap[0 : (size(outputColMap) - 4)]\noutputTableSch = outputTableSch[, 0 : (outputTableSch.columns() - 4)]\nengine = createOrderBookSnapshotEngine(name=\"demo\", exchange=\"XSHE\", orderbookDepth=10, intervalInMilli = 1000, date=2022.01.10, startTime=09:15:00.000, prevClose=prevClose, dummyTable=dummyOrderStream, outputTable=outputTableSch, inputColMap=inputColMap, outputColMap=outputColMap, orderBookAsArray=true)\n```\n\nExample 6: This example uses *userDefinedMetrics* to add user-defined metrics to the engine, enabling output of user-defined metrics in addition to standard order book data.\n\n```\ntry { dropStreamEngine(\"demo\") } catch(ex) { print(ex) }\n\nfilePath = \"./orderbookDemoInput.csv\"\n\n// Create a dummy table to define the schema of the input table, which will be passed to the dummyTable parameter\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo`ReceiveTime\ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT, NANOTIMESTAMP]\nshare table(1:0, colNames, colTypes) as dummyOrderStream\n\n// Create a dictionary to define the meaning of each column in the input table, which will be passed to the inputColMap parameter\ninputColMap = dict(`codeColumn`timeColumn`typeColumn`priceColumn`qtyColumn`buyOrderColumn`sellOrderColumn`sideColumn`msgTypeColumn`seqColumn`receiveTime, `SecurityID`Time`Type`Price`Qty`BuyNo`SellNo`BSFlag`SourceType`ApplSeqNum`ReceiveTime)\n\n// Create a dictionary to define the previous day's closing prices, which will be passed to the prevClose parameter. prevClose does not affect any output columns other than the previous day's closing prices.\nprevClose = dict(`000587.SZ`002694.SZ`002822.SZ`000683.SZ`301063.SZ`300459.SZ`300057.SZ`300593.SZ`301035.SZ`300765.SZ, [1.66, 6.56, 6.10, 8.47, 38.10, 5.34, 9.14, 48.81, 60.04, 16.52])\n\n//Define only outputColMap to receive the first return value of genOutputColumnsForOBSnapshotEngine. Because the metrics defined in userDefinedMetrics require order details and withdrawal details, you must call genOutputColumnsForOBSnapshotEngine with orderDetail=false and withdrawDetail=true\noutputColMap = genOutputColumnsForOBSnapshotEngine(basic=true, time=false, depth=(10, true), tradeDetail=true, orderDetail=false, withdrawDetail=true, orderBookDetailDepth=0, prevDetail=false)[0]\n\n\n//// Define user-defined metrics\ndef userDefinedFunc(t){\n        AvgBuyDuration = rowAvg(t.TradeMDTimeList-t.TradeOrderBuyNoTimeList).int()\n        AvgSellDuration = rowAvg(t.TradeMDTimeList-t.TradeOrderSellNoTimeList).int()        \n        BuyWithdrawQty = rowSum(t.WithdrawBuyQtyList)\n        SellWithdrawQty = rowSum(t.WithdrawSellQtyList)\n        return (AvgBuyDuration, AvgSellDuration, BuyWithdrawQty, SellWithdrawQty)\n}\n\n// Define the output table for the order book engine. It must include the basic columns, multiple levels of bid/ask prices and quantities (depth), and the output of the user-defined metrics in userDefinedMetrics\noutputTableSch = genOutputColumnsForOBSnapshotEngine(basic=true, time=false, depth=(10, true), tradeDetail=false, orderDetail=false, withdrawDetail=false, orderBookDetailDepth=0, prevDetail=false)[1]\ncolNames = outputTableSch.schema().colDefs.name join (`AvgBuyDuration`AvgSellDuration`BuyWithdrawQty`SellWithdrawQty)\ncolTypes = outputTableSch.schema().colDefs.typeString join (`INT`INT`INT`INT) \noutputTable = table(1:0, colNames, colTypes)\n\n// Create the engine to generate a 10-level order book for SZSE stocks every second\n\nengine = createOrderBookSnapshotEngine(name=\"demo\", exchange=\"XSHE\", orderbookDepth=10, intervalInMilli = 1000, date=2022.01.10, startTime=09:30:00.000, prevClose=prevClose, dummyTable=dummyOrderStream, outputTable=outputTable, inputColMap=inputColMap, outputColMap=outputColMap, orderBookAsArray=true, userDefinedMetrics=userDefinedFunc)\n\nt = select * from loadText(filePath) order by Time\nupdate t set ReceiveTime = now(true) // Set the ReceiveTime column\n\ngetStreamEngine(\"demo\").append!(t)\n\nselect top 10 * from outputTable where code=\"300593.SZ\", timestamp between 2022.01.10T13:15:01.000 and 2022.01.10T13:15:10.000\n```\n\nSome results are shown below:\n\n![](https://docs.dolphindb.com/en/Functions/images/3.png)\n\nRelated function: [genOutputColumnsForOBSnapshotEngine](https://docs.dolphindb.com/en/Functions/g/genoutputcolumnsforobsnapshotengine.html)\n\nRelated tutorial: [DolphinDB Order Book Engine: Build High-Frequency Order Books from Tick-by-Tick Data](https://docs.dolphindb.com/en/Tutorials/build_high_frequency_order_books.html)\n\n#### Appendix\n\n**basic (basic columns)**\n\nIf neither *outputColMap* nor *userDefinedMetrics* is spexified, the engine outputs all columns except openPrice, maxPrice, and minPrice.\n\n<table id=\"table_b55f6fbc1c4e\"><thead><tr><th>\n\nColumn Name\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncode\n\n</td><td>\n\nSYMBOL\n\n</td><td>\n\nInstrument symbol\n\n</td></tr><tr><td>\n\ntimestamp\n\n</td><td>\n\nTIMESTAMP\n\n</td><td>\n\nSnapshot timestamp. For example, snapshots are generated at 1-second intervals: 2022.08.01T09:20:00.000, 2022.08.01T09:20:01.000\n\n</td></tr><tr><td>\n\nlastSeq\n\n</td><td>\n\nLONG\n\n</td><td>\n\nSequence number of the last tick-by-tick record\n\n</td></tr><tr><td>\n\ntradingPhaseCode\n\n</td><td>\n\nINT\n\n</td><td>\n\nTrading phase code. Enum values:-   0 (pre-open, startup)\n\n* 1 (opening call auction)\n* 2 (after the opening call auction ends and before continuous auction begins)\n* 3 (continuous auction)\n* 4 (midday break)\n* 5 (closing call auction)\n\n</td></tr><tr><td>\n\nmodified\n\n</td><td>\n\nBOOL\n\n</td><td>\n\nIf no input data is available for the current period for a given instrument, this column is false in the corresponding output row; otherwise, it is true.\n\n</td></tr><tr><td>\n\nturnover\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nTrading value for the current period\n\n</td></tr><tr><td>\n\nvolume\n\n</td><td>\n\nLONG\n\n</td><td>\n\nTrading volume for the current period\n\n</td></tr><tr><td>\n\ntradeNum\n\n</td><td>\n\nINT\n\n</td><td>\n\nNumber of trades in the current period\n\n</td></tr><tr><td>\n\nttlTurnover\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nTrading value from the open to the current time\n\n</td></tr><tr><td>\n\nttlVolume\n\n</td><td>\n\nLONG\n\n</td><td>\n\nTrading volume from the open to the current time\n\n</td></tr><tr><td>\n\nttlTradeNum\n\n</td><td>\n\nINT\n\n</td><td>\n\nNumber of trades from the open to the current time\n\n</td></tr><tr><td>\n\nlastPrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nMost recent trade price\n\n</td></tr><tr><td>\n\nhighPrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nHighest price since the open\n\n</td></tr><tr><td>\n\nlowPrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nLowest price since the open\n\n</td></tr><tr><td>\n\nopenPrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nOpening price\n\n</td></tr><tr><td>\n\navgAskPrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nWeighted average sell price = sum of price × quantity across all ask levels / total ask quantity\n\n</td></tr><tr><td>\n\navgBidPrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nWeighted average buy price = sum of price × quantity across all bid levels / total bid quantity\n\n</td></tr><tr><td>\n\naskQty\n\n</td><td>\n\nLONG\n\n</td><td>\n\nCurrent ask order volume\n\n</td></tr><tr><td>\n\nbidQty\n\n</td><td>\n\nLONG\n\n</td><td>\n\nCurrent bid order volume\n\n</td></tr><tr><td>\n\npreClosePrice\n\n</td><td>\n\nDOUBLE/INT\n\n</td><td>\n\nPrevious closing priceDefine the previous closing prices and pass it to the engine as a dictionary.\n\n</td></tr><tr><td>\n\nabnormal\n\n</td><td>\n\nBOOL\n\n</td><td>\n\nIndicates whether the input data is invalid:-   true indicates that the input data is invalid, or that the data is the first batch of order book data generated by forced trigger from discontinuous data after you set *forceTriggerTime*, as well as all subsequent data. Here, invalid data means the engine received tick-by-tick trades or cancellations but could not find the corresponding order.\n\n* false indicates that the input data is valid.\n\n</td></tr><tr><td>\n\nmaxPrice\n\n</td><td>\n\nDOUBLE/INT\n\n</td><td>\n\nLimit up price. Define the limit up price and pass it to the engine as a dictionary.\n\n</td></tr><tr><td>\n\nminPrice\n\n</td><td>\n\nDOUBLE/INT\n\n</td><td>\n\nLimit down price. Define the limit down price and pass it to the engine as a dictionary.\n\n</td></tr></tbody>\n</table>**time \\(time columns\\)**\n\n| Column Name | Type          | Description                                                                                                             |\n| ----------- | ------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| mdTime      | TIME          | Snapshot timestamp. For example, snapshots are generated at 1-second intervals: 09:20:00.000, 09:20:01.000              |\n| mdDate      | DATE          | Snapshot date. Define the snapshot date and pass it to the engine through the date parameter.                           |\n| UpdateTime1 | NANOTIMESTAMP | The receiveTime of the input record that triggers the window to close.                                                  |\n| UpdateTime2 | NANOTIMESTAMP | The system time when computation completes after the window closes; that is, the system time when the result is output. |\n\n**depth (bid/ask levels)**\n\nIf neither *outputColMap* nor *userDefinedMetrics*is specified, the engine outputs all columns in depth. There are two ways to store depth data. You can use only one of them:\n\n* Output one column for each level. For example, if bidsPrice has 10 levels, the engine outputs 10 bidsPrice columns: bidsPrice1, bidsPrice2, …, bidsPrice10.\n\n  | Column Name | Type   | Description                                                                                                        |\n  | ----------- | ------ | ------------------------------------------------------------------------------------------------------------------ |\n  | bidsPrice   | DOUBLE | Multiple columns, each storing a bid price at one level; the number of levels is determined by depth.              |\n  | bidsQty     | LONG   | Multiple columns, each storing the bid volume at one level; the number of levels is determined by depth.           |\n  | bidsCount   | INT    | Multiple columns, each storing the number of bid orders at one level; the number of levels is determined by depth. |\n  | asksPrice   | DOUBLE | Multiple columns, each storing an ask price at one level; the number of levels is determined by depth.             |\n  | asksQty     | LONG   | Multiple columns, each storing the ask volume at one level; the number of levels is determined by depth.           |\n  | asksCount   | INT    | Multiple columns, each storing the number of ask orders at one level; the number of levels is determined by depth. |\n\n* Output multiple levels into a single column whose type is an array vector. For example, if bidsPrice has 10 levels, the engine outputs those 10 levels as an array vector in a single column: bidsPriceList.\n\n  | Column Name   | Type      | Description                                                                                                    |\n  | ------------- | --------- | -------------------------------------------------------------------------------------------------------------- |\n  | bidsPriceList | DOUBLE\\[] | Array vector storing bid prices at multiple levels; the number of levels is determined by depth.               |\n  | bidsQtyList   | LONG\\[]   | Array vector storing bid volumes at multiple levels; the number of levels is determined by depth.              |\n  | bidsCountList | INT\\[]    | Array vector storing the number of bid orders at multiple levels; the number of levels is determined by depth. |\n  | asksPriceList | DOUBLE\\[] | Array vector storing ask prices at multiple levels; the number of levels is determined by depth.               |\n  | asksQtyList   | LONG\\[]   | Array vector storing ask volumes at multiple levels; the number of levels is determined by depth.              |\n  | asksCountList | INT\\[]    | Array vector storing the number of ask orders at multiple levels; the number of levels is determined by depth. |\n\n**tradeDetail**\n\n**Note:**\n\n* For SSE order books, if you set *includeImmediateExecution* = true, the engine outputs immediately executed orders in the order details. In this case, the system uses the trade execution time in the trade record as the order submission time and displays it in the tradeOrderBuyNoTimeList and tradeOrderSellNoTimeList columns.\n* When you call the `genOutputColumnsForOBSnapshotEngine` function with *tradeDetail* = true, the engine does not output the tradeBuyOrderTypeList and tradeSellOrderTypeList columns by default.\n\n| Basic Derived Column     | Type      | Description                                                                                                            |\n| ------------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------- |\n| buyQty                   | LONG      | Total buy volume in the current period = sum(trading volume where BSFlag=1). The unit is the same as in the raw data.  |\n| sellQty                  | LONG      | Total sell volume in the current period = sum(trading volume where BSFlag=2). The unit is the same as in the raw data. |\n| buyMoney                 | DOUBLE    | Total buy amount in the current period = sum(trading volume × price where BSFlag=1).                                   |\n| sellMoney                | DOUBLE    | Total sell amount in the current period = sum(trading volume × price where BSFlag=2).                                  |\n| tradePriceList           | DOUBLE\\[] | List of trade prices in the current interval                                                                           |\n| tradeQtyList             | LONG\\[]   | List of trading volumes in the current interval; the unit is the same as in the raw data.                              |\n| tradeTypeList            | INT\\[]    | List of trade types in the current interval                                                                            |\n| tradeBSFlagList          | INT\\[]    | List of trade directions in the current interval                                                                       |\n| tradeMDTimeList          | TIME\\[]   | List of trade times in the current interval                                                                            |\n| tradeBuyNoList           | LONG\\[]   | List of buy order sequence numbers in the current interval                                                             |\n| tradeSellNoList          | LONG\\[]   | List of sell order sequence numbers in the current interval                                                            |\n| tradeOrderBuyNoTimeList  | TIME\\[]   | Submission times of the buy orders corresponding to valid trades in the current interval                               |\n| tradeOrderSellNoTimeList | TIME\\[]   | Submission times of the sell orders corresponding to valid trades in the current interval                              |\n| tradeBuyOrderTypeList    | INT\\[]    | Types of buy orders corresponding to valid trades in the current interval                                              |\n| tradeSellOrderTypeList   | INT\\[]    | Types of sell orders corresponding to valid trades in the current interval                                             |\n\n**orderDetail**\n\n**Note:** For SSE order books, if you set *includeImmediateExecution* = true, the order details will include orders executed immediately.\n\n| Basic Derived Column | Type      | Description                                                                                |\n| -------------------- | --------- | ------------------------------------------------------------------------------------------ |\n| orderPriceList       | DOUBLE\\[] | List of order prices in the current interval                                               |\n| orderQtyList         | LONG\\[]   | List of order quantities in the current interval; the unit is the same as in the raw data. |\n| orderTypeList        | INT\\[]    | List of order types in the current interval                                                |\n| orderBSFlagList      | INT\\[]    | List of buy/sell flags for orders in the current interval                                  |\n| orderMDTimeList      | TIME\\[]   | List of order times in the current interval                                                |\n| orderNoList          | LONG\\[]   | List of order sequence number in the current interval                                      |\n\n**withdrawDetail (cancellation details)**\n\n**Note:**\n\n* For SSE order books, if you set *includeImmediateExecution* = true, the engine outputs immediately executed orders in the order details. In this case, the withdrawBuyOrderQtyList and WithdrawSellOrderQtyList columns will include immediately executed quantities.\n* When you call `genOutputColumnsForOBSnapshotEngine`, if *withdrawDetail*=true, it does not output the withdrawBuyOrderNoList and withdrawSellOrderNoList columns by default.\n\n| Basic Derived Column        | Type      | Description                                                                                                                                         |\n| --------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |\n| withdrawBuyPriceList        | DOUBLE\\[] | Prices of canceled buy-side orders in the current interval                                                                                          |\n| withdrawBuyQtyList          | LONG\\[]   | Quantities of canceled buy-side orders in the current interval; the unit is the same as in the raw data.                                            |\n| withdrawBuyOrderTypeList    | INT\\[]    | Types of canceled buy orders in the current interval.                                                                                               |\n| withdrawBuyMDTimeList       | TIME\\[]   | Cancellation times of buy orders in the current interval                                                                                            |\n| withdrawBuyOrderMDTimeList  | TIME\\[]   | Order submission times corresponding to canceled buy orders in the current interval                                                                 |\n| WithdrawBuyOrderQtyList     | LONG\\[]   | Order quantities in the original order data corresponding to canceled buy orders in the current interval; the unit is the same as in the raw data.  |\n| withdrawSellPriceList       | DOUBLE\\[] | Prices of canceled sell orders in the current interval                                                                                              |\n| withdrawSellQtyList         | LONG\\[]   | Quantities of canceled sell orders in the current interval; the unit is the same as in the raw data.                                                |\n| withdrawSellOrderTypeList   | INT\\[]    | Types of canceled sell orders in the current interval                                                                                               |\n| withdrawSellMDTimeList      | TIME\\[]   | Cancellation times of sell orders in the current interval                                                                                           |\n| withdrawSellOrderMDTimeList | TIME\\[]   | Order submission times corresponding to canceled sell orders in the current interval                                                                |\n| WithdrawSellOrderQtyList    | LONG\\[]   | Order quantities in the original order data corresponding to canceled sell orders in the current interval; the unit is the same as in the raw data. |\n| withdrawBuyOrderNoList      | LONG\\[]   | Order sequence numbers in the original order data corresponding to canceled buy orders in the current interval                                      |\n| withdrawSellOrderNoList     | LONG\\[]   | Order sequence numbers in the original order data corresponding to canceled sell orders in the current interval                                     |\n\n**prevDetail (details of the previous trade)**\n\n**Note:**\n\nFor SSE order books, if you set *includeImmediateExecution* = true, the engine outputs immediately executed orders in the order details. In this case, if the immediate execution price matches BuyPrice1/SellPrice1 in the previous snapshot, the prevBuyAddQtyList1 and prevSellAddQtyList1 columns will include the corresponding immediately executed order details.\n\n| Basic Derived Column     | Type    | Description                                                                                                                    |\n| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| prevBuyPrice1            | DOUBLE  | BuyPrice1 from the previous snapshot                                                                                           |\n| prevSellPrice1           | DOUBLE  | SellPrice1 from the previous snapshot                                                                                          |\n| prevBuyAddQtyList1       | LONG\\[] | Order addition details in the current interval at the previous snapshot's BuyPrice1; the unit is the same as in the raw data.  |\n| prevSellAddQtyList1      | LONG\\[] | Order addition details in the current interval at the previous snapshot's SellPrice1; the unit is the same as in the raw data. |\n| prevBuyWithdrawQtyList1  | LONG\\[] | Cancellation details in the current interval at the previous snapshot's BuyPrice1; the unit is the same as in the raw data.    |\n| prevSellWithdrawQtyList1 | LONG\\[] | Cancellation details in the current interval at the previous snapshot's SellPrice1; the unit is the same as in the raw data.   |\n\n**orderBookDetailDepth**\n\nThe engine outputs one column for each level, and each column is an array vector. For example, if buyQtyList has 20 levels, the engine outputs 20 buyQtyList fields: buyQtyList1, buyQtyList2, …, buyQtyList20. The same applies to buyValueList, sellQtyList, and sellValueList.\n\n| Basic Derived Column | Type      | Description                                                        |\n| -------------------- | --------- | ------------------------------------------------------------------ |\n| buyQtyList           | LONG\\[]   | Quantity of each buy order at each level in the latest order book  |\n| buyValueList         | DOUBLE\\[] | Value of each buy order at each level in the latest order book     |\n| sellQtyList          | LONG\\[]   | Quantity of each sell order at each level in the latest order book |\n| sellValueList        | DOUBLE\\[] | Value of each sell order at each level in the latest order book    |\n\n**seqDetail**\n\n**Note:**\n\nFor SSE order books, if you set *includeImmediateExecution* = true, the engine outputs immediately executed orders in the order details. In this case, the orderSeqList column will include order submission records for immediate executions.\n\n| Basic Derived Column | Type    | Description                                                               |\n| -------------------- | ------- | ------------------------------------------------------------------------- |\n| tradeSeqList         | LONG\\[] | List of trade sequence numbers in the current interval                    |\n| orderSeqList         | LONG\\[] | List of order sequence numbers in the current interval                    |\n| withdrawBuySeqList   | LONG\\[] | List of buy-side canceled order sequence numbers in the current interval  |\n| withdrawSellSeqList  | LONG\\[] | List of sell-side canceled order sequence numbers in the current interval |\n\n**residualDetail (remaining order details)**\n\n**Note:**\n\n* In the sell-side columns (ResidualAskPriceList, ResidualAskQtyList, ResidualAskTimeList, ResidualAskApplSeqNumList), entries at each price level are sorted in ascending order by price, then by trade time. If price and trade time are the same, the data is then sorted by the time it entered the engine in ascending order.\n* In the buy-side columns (ResidualBidPriceList, ResidualBidQtyList, ResidualBidTimeList, ResidualBidApplSeqNumList), entries at each price level are sorted in descending order by price and ascending order by trade time. If price and trade time are the same, the data is then sorted by the time it entered the engine in ascending order.\n* When you call `genOutputColumnsForOBSnapshotEngine`, if *residualDetail*=true, the ResidualBidOrderNoList and ResidualAskOrderNoList columns are not output by default.\n\n| Column Name               | Type      | Description                                   |\n| ------------------------- | --------- | --------------------------------------------- |\n| ResidualAskPriceList      | DOUBLE\\[] | Price list of remaining sell orders           |\n| ResidualAskQtyList        | LONG\\[]   | Quantity list of remaining sell orders        |\n| ResidualAskTimeList       | TIME\\[]   | Time list of remaining sell orders            |\n| ResidualAskApplSeqNumList | LONG\\[]   | ApplSeqNum list of remaining sell-side orders |\n| ResidualBidPriceList      | DOUBLE\\[] | Price list of remaining buy orders            |\n| ResidualBidQtyList        | LONG\\[]   | Quantity list of remaining buy orders         |\n| ResidualBidTimeList       | TIME\\[]   | Time list of remaining buy orders             |\n| ResidualBidApplSeqNumList | LONG\\[]   | ApplSeqNum list of remaining buy orders       |\n| ResidualBidOrderNoList    | LONG\\[]   | Sequence number list of remaining buy orders  |\n| ResidualAskOrderNoList    | LONG\\[]   | Sequence number list of remaining sell orders |\n"
    },
    "createPartitionedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createPartitionedTable.html",
        "signatures": [
            {
                "full": "createPartitionedTable(dbHandle, table, tableName, partitionColumns, [compressMethods], [sortColumns|primaryKey], [keepDuplicates=ALL], [sortKeyMappingFunction], [softDelete=false], [indexes], [latestKeyCache=false], [compressHashSortKey=true], [encryptMode='plaintext'])",
                "name": "createPartitionedTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "partitionColumns",
                        "name": "partitionColumns"
                    },
                    {
                        "full": "[compressMethods]",
                        "name": "compressMethods",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns|primaryKey]",
                        "name": "[sortColumns|primaryKey]"
                    },
                    {
                        "full": "[keepDuplicates=ALL]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "ALL"
                    },
                    {
                        "full": "[sortKeyMappingFunction]",
                        "name": "sortKeyMappingFunction",
                        "optional": true
                    },
                    {
                        "full": "[softDelete=false]",
                        "name": "softDelete",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[indexes]",
                        "name": "indexes",
                        "optional": true
                    },
                    {
                        "full": "[latestKeyCache=false]",
                        "name": "latestKeyCache",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[compressHashSortKey=true]",
                        "name": "compressHashSortKey",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[encryptMode='plaintext']",
                        "name": "encryptMode",
                        "optional": true,
                        "default": "'plaintext'"
                    }
                ]
            },
            {
                "full": "createPartitionedTable(dbHandle, table, tableName, [partitionColumns], [compressMethods], [sortColumns], [keepDuplicates=ALL], [sortKeyMappingFunction], [softDelete=false], [latestKeyCache=false], [compressHashSortKey=true],[encryptMode='plaintext'])",
                "name": "createPartitionedTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[partitionColumns]",
                        "name": "partitionColumns",
                        "optional": true
                    },
                    {
                        "full": "[compressMethods]",
                        "name": "compressMethods",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns]",
                        "name": "sortColumns",
                        "optional": true
                    },
                    {
                        "full": "[keepDuplicates=ALL]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "ALL"
                    },
                    {
                        "full": "[sortKeyMappingFunction]",
                        "name": "sortKeyMappingFunction",
                        "optional": true
                    },
                    {
                        "full": "[softDelete=false]",
                        "name": "softDelete",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[latestKeyCache=false]",
                        "name": "latestKeyCache",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[compressHashSortKey=true]",
                        "name": "compressHashSortKey",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[encryptMode='plaintext']",
                        "name": "encryptMode",
                        "optional": true,
                        "default": "'plaintext'"
                    }
                ]
            }
        ],
        "markdown": "### [createPartitionedTable](https://docs.dolphindb.com/en/Functions/c/createPartitionedTable.html)\n\n\n\n#### Syntax\n\ncreatePartitionedTable(dbHandle, table, tableName, partitionColumns, \\[compressMethods], \\[sortColumns|primaryKey], \\[keepDuplicates=ALL], \\[sortKeyMappingFunction], \\[softDelete=false], \\[indexes], \\[latestKeyCache=false], \\[compressHashSortKey=true], \\[encryptMode='plaintext'])\n\ncreatePartitionedTable(dbHandle, table, tableName, \\[partitionColumns], \\[compressMethods], \\[sortColumns], \\[keepDuplicates=ALL], \\[sortKeyMappingFunction], \\[softDelete=false], \\[latestKeyCache=false], \\[compressHashSortKey=true],\\[encryptMode='plaintext'])\n\n#### Details\n\nCreate an empty partitioned table with the same schema as the specified table.\n\n* To create a DFS table or a table on disk, parameter *table* must be a table. This function is used with [append!](https://docs.dolphindb.com/en/Functions/a/append!.html) or [tableInsert](https://docs.dolphindb.com/en/Functions/t/tableInsert.html) to generate a partitioned table. It cannot be used to create a partitioned table with sequential domain.\n* To create an in-memory partitioned table, parameter *table* can be a table or a tuple of tables. The number of tables given by the parameter *table* must be the same as the number of partitions in the database.\n\n**Note**:\n\n* Only the schema of *table* is used. None of the rows in table is imported to the newly created partitioned table.\n* For a DFS database in an OLAP engine, the maximum number of handles (including temporary handles\\*) to partitioned tables is 8,192 per node. For the TSDB storage engine, there is no limit.\n\n\\*temporary handles: If no handle is specified when you create a partitioned table in a DFS database with `createPartitionedTable`, each database creates a temporary handle to hold the return value. If you create multiple tables under the same database, the temporary handle for the database is overwritten each time.\n\n#### Parameters\n\n**Note:** The parameters *sortColumns*, *keepDuplicates* and *sortKeyMappingFunction* take effect only in a TSDB storage engine (i.e., `database().engine` = TSDB).\n\n**dbHandle** (optional) is a DFS database handle returned by function [database](https://docs.dolphindb.com/en/Functions/d/database.html). The database can be either in the local file system, or in the distributed file system.\n\n**table** (optional) is a table or a tuple of tables. The table schema will be used to construct the new partitioned table.\n\n**tableName** (optional) is a string indicating the name of the partitioned table. The table name can only consists of letters, digits or underscores (\\_), and must begin with a letter.\n\n**partitionColumns** (optional) is a STRING scalar/vector indicating the partitioning column(s). For non-sequential partitioning, this parameter is required. For a composite partition, this parameter is a STRING vector.A string can be a column name, or a function call applied to a column (e.g. `partitionFunc(id)`). If a function call is specified, it must have exactly one column argument, and the other arguments must be constant scalars. In this case, the table is partitioned based on the result of the function call. Note that optimization may be limited for SQL queries involving the partitioning column (e.g., the id column in `partitionFunc(id)`).\n\n**compressMethods** (optional) is a dictionary indicating which compression methods are used for specified columns. The keys are columns name and the values are compression methods (\"lz4\", \"delta\", \"zstd\" or \"chimp\"). If unspecified, use LZ4 compression method. Note:\n\n* The delta compression method applies delta-of-delta algorithm, which is particularly suitable for data types like SHORT, INT, LONG, and date/time data.\n* Save strings as SYMBOL type to enable compression of strings.\n* The chimp compression method can be used for DOUBLE type data with decimal parts not exceeding three digits in length.\n\n**sortColumns** (optional) is a STRING scalar/vector that specifies the column(s) used to sort the ingested data within each partitionof **the TSDB database**. The sort columns must be of Integral, Temporal, STRING, SYMBOL, or DECIMAL type. Note that *sortColumns* is not necessarily consistent with the partitioning column.\n\n* If multiple columns are specified for *sortColumns*, the last column must be either a temporal column or an integer column. The preceding columns are used as the sort keys and they cannot be of TIME, TIMESTAMP, NANOTIME, or NANOTIMESTAMP type.\n* If only one column is specified for *sortColumns*, the column is used as the sort key, and it can be a time column or not. If the sort column is a time column and *sortKeyMappingFunction* is specified, the sort column specified in a SQL where condition can only be compared with temporal values of the same data type.\n* It is recommended to specify no more than 4 frequently-queried columns for *sortColumns* and sort them in the descending order of query frequency, which ensures that frequently-used data is readily available during query processing.\n* The number of sort key entries (which are the combinations of the values of the sort keys) within each partition may not exceed 2000 for optimal performance. This limitation prevents excessive memory usage and ensures efficient query processing.\n\n**primaryKey** (optional) is a STRING scalar/vector that specifies the primary key column(s), uniquely identifying each record in a DFS table of **the PKEY database**. For records with the same primary key, only the latest one is retained. Note that:\n\n* *primaryKey* must include all partitioning columns.\n* The primary key columns must be of Logical, Integral (excluding COMPRESSED), Temporal, STRING, SYMBOL, or DECIMAL type.\n* With more than one primary key column, a composite primary key is maintained. The composite primary key uses a Bloomfilter index by default (see the *indexes* parameter for details).\n\n**keepDuplicates** (optional) specifies how to deal with records with duplicate *sortColumns* values. It can have the following values:\n\n* ALL: keep all records;\n* LAST: only keep the last record;\n* FIRST: only keep the first record.\n\nIt is recommended to specify the *sortKeyMappingFunction* parameter if there are many sort keys in a partition of a TSDB database and a small number of records with the same sort key. After dimensionality reduction, the blocks in a TSDB level file can store more data, which not only reduces the frequency of reading data blocks and disk I/O during query, but also improves the data compression ratio.\n\n**sortKeyMappingFunction** (optional) is a vector of unary functions. It has the same length as the number of sort keys. The specified mapping functions are applied to each sort key (i.e., the sort columns except for the last column) for dimensionality reduction. After the dimensionality reduction for the sort keys, records with a new sort key entry will be sorted based on the last column of *sortColumns*.\n\n**Note**:\n\n* Dimensionality reduction is performed when writing to disk, so specifying this parameter may affect write performance.\n* The functions specified in `sortKeyMappingFunction` correspond to each and every sort key. If a sort key does not require dimensionality reduction, leave the corresponding element empty in the vector.\n* If a mapping function is `hashBucket` AND the sort key to which it applies is a HASH partitioning column, make sure the number of hash partitions and *buckets* are not divisible by each other (except when *buckets*=1). Otherwise the column values from the same HASH partition would be mapped to the same hash bucket after dimensionality reduction.\n\n**softDelete** (optional) determines whether to enable soft delete for TSDB databases. The default value is false. To use it, *keepDuplicates* must be set to 'LAST'. It is recommended to enable soft delete for databases where the row count is large and delete operations are infrequent.\n\n**indexes** (optional) is a dictionary with columns as keys and index types as values. Both keys and values are of STRING type. *indexes* can only be set for tables of TSDB (*keepDuplicates*=ALL) or PKEY databases.\n\n* **bloomfilter**\n  * Only available in PKEY databases.\n  * Excels in point queries on high-cardinality columns (e.g., ID card numbers, order numbers, foreign keys from upstreams).\n  * Supports indexing on columns of the following data types: BOOL, CHAR, SHORT, INT, LONG, TEMPORAL, BLOB, STRING, BINARY, COMPLEX, DECIMAL32, DECIMAL64, DECIMAL128.\n  * Composite primary keys are automatically indexed with Bloomfilter. Columns not specified in indexes default to ZoneMap indexing.\n* **textindex**\n  * Only available in PKEY databases.\n  * Enables efficient text searches through text indexing on non-primary key columns of STRING or BLOB types.\n  * Specified in the form of `textindex(parser=english,lowercase=true,stem=true)`, where\n    * *parser* specifies the tokenizer. It has no default value and must be explicitly set. Options include none (not tokenized) and english (tokenized based on spaces and punctuations).\n    * *lowercase* specifies whether the tokenizer is case-insensitive, which only takes effect when *parser* is set to english. The default value is true. Set it to false for case-sensitive scenarios.\n    * *stem* specifies whether to match English words by their stem, which only takes effect when *parser*=english and *lowercase*=true. The default value is false, indicating exact searches. Set it to true to return related derivatives (e.g., a search for \"dark\" may also return \"darkness\").\n* **vectorindex**\n\n  * Available in PKEY and TSDB databases.\n  * Specified in the form of `vectorindex(type={t}, dim={d})`, where\n    * *type* can take the following values: flat, pq, ivf, ivfpq, hnsw.\n    * *dim* is an integer no less than 1, indicating the dimension of the vector. For index types \"pq\" or \"ivfpq\", *dim* must be divisible by 4. Note that the dimension of vectors inserted into the indexing column must match the specified *dim*.\n  * Accelerates retrieval under the following conditions:\n    * No table joins are used in queries.\n    * The `order by` clause must be sorted in ascending order and can only use `rowEuclidean` to compute distances.\n    * The first parameter passed to `rowEuclidean` must be the indexing column, i.e., `rowEuclidean(<vectorCol>, queryVec)`.\n    * A `limit` clause must be specified.\n    * If a `where` clause is specified, it must not include any sort columns.\n    * The query cannot include clauses such as `group by` and `having`.\n      **Note**: If the above-mentioned conditions are met for a PKEY engine, the query will first filter the indexing column based on the `order by` and `limit` clauses, and then filter the results with the `where` clause. This approach may output fewer results than the `limit` clause alone.\n\n**latestKeyCache** (optional) is a Boolean value indicating whether to enable the latest value cache. The default value is false. If *latestKeyCache*= true, the sort columns must have at least two columns. The sort columns usually have an ID column, multiple tag columns and a temporal column.\n\n**compressHashSortKey**(optional) is a Boolean value indicating whether to enable compression for sort columns. The default value is true when specifying *sortKeyMappingFunction*=`hashBucket`.\n\n**Note:**\n\nWhen creating a measurement point table using `createPartitionedTable`,\n\n* the storage engine must be IOTDB.\n* the IOTANY column is not supported. It can only be created using the CREATE statement.\n* *softDelete* must be set to false because features that rely on CID arenot supported.\n* sort columns of DEMICAL type are not supported.\n\n**encryptMode** (optional, Linux only) is a STRING scalar specifying the encryption mode for IMOLTP tables. The default is no encryption (plaintext mode). Supported values (case-insensitive) include: plaintext, aes\\_128\\_ctr, aes\\_128\\_cbc, aes\\_128\\_ecb, aes\\_192\\_ctr, aes\\_192\\_cbc, aes\\_192\\_ecb, aes\\_256\\_ctr, aes\\_256\\_cbc, aes\\_256\\_ecb, sm4\\_128\\_cbc, sm4\\_128\\_ecb.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1. Create a DFS table\n\nExample 1.1. Create a DFS table in OLAP database\n\n```\nn=10000\nt=table(2020.01.01T00:00:00 + 0..(n-1) as timestamp, rand(`IBM`MS`APPL`AMZN,n) as symbol, rand(10.0, n) as value)\ndb = database(\"dfs://rangedb_tradedata\", RANGE, `A`F`M`S`ZZZZ)\nTrades = db.createPartitionedTable(table=t, tableName=\"Trades\", partitionColumns=\"symbol\", compressMethods={timestamp:\"delta\"});\n```\n\nAt this point, the table Trades is empty. The schema of Trades is the same as the schema of table t. Then we append table t to table Trades.\n\n```\nTrades.append!(t);\n```\n\nNow the contents of table Trades have been updated on disk. In the DFS system, the system doesn't dynamically refresh the contents of tables. We need to load the table into memory before we can work with it interactively.\n\n```\nTrades=loadTable(db,`Trades);\nselect min(value) from Trades;\n// output: 0\n```\n\nAfter appending data to a DFS table, we don't need to use function [loadTable](https://docs.dolphindb.com/en/Functions/l/loadTable.html) to load the table before querying the table, as the system automatically refreshes the table after appending operations. After system restarts, however, we need to use `loadTable` to load a DFS table before querying the table.\n\nExample 1.2. Create a DFS table in TSDB database\n\n```\nn = 10000\nSecurityID = rand(`st0001`st0002`st0003`st0004`st0005, n)\nsym = rand(`A`B, n)\nTradeDate = 2022.01.01 + rand(100,n)\nTotalVolumeTrade = rand(1000..3000, n)\nTotalValueTrade = rand(100.0, n)\nschemaTable_snap = table(SecurityID, TradeDate, TotalVolumeTrade, TotalValueTrade).sortBy!(`SecurityID`TradeDate)\n\ndbPath = \"dfs://TSDB_STOCK\"\nif(existsDatabase(dbPath)){dropDatabase(dbPath)}\ndb_snap = database(dbPath, VALUE, 2022.01.01..2022.01.05, engine='TSDB')\nsnap=createPartitionedTable(dbHandle=db_snap, table=schemaTable_snap, tableName=\"snap\", partitionColumns=`TradeDate, sortColumns=`SecurityID`TradeDate, keepDuplicates=ALL, sortKeyMappingFunction=[hashBucket{,5}])\nsnap.append!(schemaTable_snap)\nflushTSDBCache()\n```\n\n```\nsnap = loadTable(dbPath, `snap)\nselect * from snap\n```\n\nExample 1.3. Create a distributed partitioned table in PKEY database.\n\n```\ndb = database(directory=\"dfs://PKDB\", partitionType=VALUE, partitionScheme=1..10, engine=\"PKEY\")\nschematb = table(1:0,`id1`id2`val1`val2`date1`time1,[INT,INT,INT,DECIMAL32(2),DATE,TIME])\npkt = createPartitionedTable(dbHandle=db, table=schematb, tableName=\"pkt\", partitionColumns=\"id1\", primaryKey=`id1`id2, indexes={\"val1\": \"bloomfilter\", \"val2\": \"bloomfilter\"})\n```\n\nExample 2. Create in-memory partitioned tables\n\nExample 2.1. Create a partitioned in-memory table\n\n```\nn = 20000\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nt = table(n:0, colNames, colTypes)\ndb = database(, RANGE, `A`D`F)\npt = db.createPartitionedTable(t, `pt, `sym)\n\ninsert into pt values(09:30:00.001,`AAPL,100,56.5)\ninsert into pt values(09:30:01.001,`DELL,100,15.5)\n```\n\nExample 2.2. Create a partitioned keyed table\n\n```\nn = 20000\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nt = keyedTable(`time`sym, n:0, colNames, colTypes)\ndb = database(, RANGE, `A`D`F)\npt = db.createPartitionedTable(t, `pt, `sym)\n\ninsert into pt values(09:30:00.001,`AAPL,100,56.5)\ninsert into pt values(09:30:01.001,`DELL,100,15.5)\n```\n\nExample 2.3. Create a partitioned stream table\n\nWhen creating a partitioned stream table, the second parameter of `createPartitionedTable` must be a tuple of tables, and its length must be equal to the number of partitions. Each table in the tuple represents a partition. In the following example, trades\\_stream1 and trades\\_stream2 form a partitioned stream table trades. We cannot directly write data to trades. Instead, we need to write to trades\\_stream1 and trades\\_stream2.\n\n```\nn=200000\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\ntrades_stream1 = streamTable(n:0, colNames, colTypes)\ntrades_stream2 = streamTable(n:0, colNames, colTypes)\ndb=database(, RANGE, `A`D`F)\ntrades = createPartitionedTable(db,[trades_stream1, trades_stream2], \"\", `sym)\n\ninsert into trades_stream1 values(09:30:00.001,`AAPL,100,56.5)\ninsert into trades_stream2 values(09:30:01.001,`DELL,100,15.5)\n\nselect * from trades;\n```\n\n| time         | sym  | qty | price |\n| ------------ | ---- | --- | ----- |\n| 09:30:00.001 | AAPL | 100 | 56.5  |\n| 09:30:01.001 | DELL | 100 | 15.5  |\n\nExample 2.4. Create a partitioned MVCC table\n\nSimilar to a partitioned stream table, to create a partitioned MVCC table, the second parameter of `createPartitionedTable` must be a tuple of tables, and its length must be equal to the number of partitions. Each table in the tuple represents a partition. In the following example, trades\\_mvcc1 and trades\\_mvcc2 form a partitioned MVCC table trades. We cannot directly write data to trades. Instead, we need to write to trades\\_mvcc1 and trades\\_mvcc2.\n\n```\nn=200000\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\ntrades_mvcc1 = mvccTable(n:0, colNames, colTypes)\ntrades_mvcc2 = mvccTable(n:0, colNames, colTypes)\ndb=database(, RANGE, `A`D`F)\ntrades = createPartitionedTable(db,[trades_mvcc1, trades_mvcc2], \"\", `sym)\n\ninsert into trades_mvcc1 values(09:30:00.001,`AAPL,100,56.5)\ninsert into trades_mvcc2 values(09:30:01.001,`DELL,100,15.5)\n\nselect * from trades;\n```\n\n| time         | sym  | qty | price |\n| ------------ | ---- | --- | ----- |\n| 09:30:00.001 | AAPL | 100 | 56.5  |\n| 09:30:01.001 | DELL | 100 | 15.5  |\n\nExample 3. Create a distributed partitioned table with vector index set.\n\nExample 3.1 In TSDB database.\n\n```\ndb = database(directory=\"dfs://indexesTest\", partitionType=VALUE, partitionScheme=1..10, engine=\"TSDB\")\nschematb = table(1:0,`col0`col1`col2`col3,[INT,INT,TIMESTAMP,FLOAT[]])\npt = createPartitionedTable(dbHandle=db, table=schematb, tableName=`pt, partitionColumns=`col0, sortColumns=`col1`col2, indexes={\"col3\":\"vectorindex(type=flat, dim=5)\"})\n\ntmp = cj(table(1..10 as col0),cj(table(1..10 as col1),table(now()+1..10 as col2))) join table(arrayVector(1..1000*5,1..5000) as col3)\n\npt.tableInsert(tmp)\n\nselect * from pt where col2<now() order by rowEuclidean(col3,[1339,252,105,105,829]) limit 10\n```\n\n<table id=\"table_nnw_dvp_zbc\"><tbody><tr><td>\n\ncol0\n\n</td><td>\n\ncol1\n\n</td><td>\n\ncol2\n\n</td><td>\n\ncol3\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.950\n\n</td><td>\n\n\\[526, 527, 528, 529, 530]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.949\n\n</td><td>\n\n\\[521, 522, 523, 524, 525]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.951\n\n</td><td>\n\n\\[531, 532, 533, 534, 535]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.948\n\n</td><td>\n\n\\[516, 517, 518, 519, 520]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.952\n\n</td><td>\n\n\\[536, 537, 538, 539, 540]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.947\n\n</td><td>\n\n\\[511, 512, 513, 514, 515]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.953\n\n</td><td>\n\n\\[541, 542, 543, 544, 545]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.946\n\n</td><td>\n\n\\[506, 507, 508, 509, 510]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.954\n\n</td><td>\n\n\\[546, 547, 548, 549, 550]\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n1\n\n</td><td>\n\n2024.06.27 16:56:38.945\n\n</td><td>\n\n\\[501, 502, 503, 504, 505]\n\n</td></tr></tbody>\n</table>Example 3.1 In PKEY database.\n\n```\ndb = database(directory=\"dfs://PKDB\", partitionType=VALUE, partitionScheme=1..10, engine=\"PKEY\")\nschematb = table(1:0,`id1`id2`val1`val2`val3`date1`time1,[INT,INT,INT,DECIMAL32(2),DOUBLE[],DATE,TIME])\npkt = createPartitionedTable(dbHandle=db, table=schematb, tableName=\"pkt\", \npartitionColumns=\"id1\", primaryKey=`id1`id2, \nindexes={\"val1\": \"bloomfilter\", \"val2\": \"bloomfilter\", \"val3\":\"vectorindex(type=pq, dim=4)\"})\n```\n\nExample 4. For data with a column in the format `id_date_id` (e.g., ax1ve\\_20240101\\_e37f6), partition by date using a user-defined function:\n\n```\n// Define a function to extract the date information\ndef myPartitionFunc(str,a,b) {\n    return temporalParse(substr(str, a, b),\"yyyyMMdd\")\n}\n\n// Create a database\ndata = [\"ax1ve_20240101_e37f6\", \"91f86_20240103_b781d\", \"475b4_20240101_6d9b2\", \"239xj_20240102_x983n\",\"2940x_20240102_d9237\"]\ntb = table(data as id_date, 1..5 as value, `a`b`c`d`e as sym)\ndb = database(\"dfs://testdb\", VALUE, 2024.02.01..2024.02.02)\n\n// Use myPartitionFunc to process the data column\npt = db.createPartitionedTable(table=tb, tableName=`pt, \n    partitionColumns=[\"myPartitionFunc(id_date, 6, 8)\"])\npt.append!(tb)\n\nselect * from pt\n```\n\nThe queried data are read and returned by partition. The query result shows that table pt is partitioned by the date information extracted from the id\\_date column.\n\n| id\\_date               | value | sym |\n| ---------------------- | ----- | --- |\n| ax1ve\\_20240101\\_e37f6 | 1     | a   |\n| 475b4\\_20240101\\_6d9b2 | 3     | c   |\n| 239xj\\_20240102\\_x983n | 4     | d   |\n| 2940x\\_20240102\\_d9237 | 5     | e   |\n| 91f86\\_20240103\\_b781d | 2     | b   |\n\nExample5. Create a Measurement Point Table\n\nIn the following example, we use a composite strategy to partition data by “id” and “ts”, creating a measurement point table named “pt”. This table uses “ticket” and “id2” as the columns that uniquely identify a measurement point. The compression for sort key columns is also enabled.\n\n```\ndb1 = database(, partitionType=HASH, partitionScheme=[INT, 10])\ndb2 = database(, partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)\ndb = database(dbName, COMPO, [db1, db2], engine='IOTDB')\nschematb = table(1:0,`id`ticket`id2`ts,[INT,SYMBOL,LONG,TIMESTAMP])\npt = createPartitionedTable(dbHandle=db, table=schematb, tableName=\"pt\", partitionColumns=`id`ts, sortColumns=`ticket`id2`ts, sortKeyMappingFunction = [hashBucket{, 50}, hashBucket{, 50}], latestKeyCache = true)\n```\n"
    },
    "createPricingEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createPricingEngine.html",
        "signatures": [
            {
                "full": "createPricingEngine(name, instrument, [handler], [engineConfig])",
                "name": "createPricingEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "[handler]",
                        "name": "handler",
                        "optional": true
                    },
                    {
                        "full": "[engineConfig]",
                        "name": "engineConfig",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createPricingEngine](https://docs.dolphindb.com/en/Functions/c/createPricingEngine.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\ncreatePricingEngine(name, instrument, \\[handler], \\[engineConfig])\n\n#### Details\n\nCreates a pricing engine that supports both DolphinDB's built-in functions and user-defined functions or expressions for valuation and pricing.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the engine. It is the only identifier of an engine on a data or compute node. It can contain letters, digits and \"\\_\" and must start with a letter.\n\n**instrument**is an INSTRUMENT scalar/vector, indicating the instrument(s) to be priced. During pricing, market data is matched according to the rules defined by `instrumentPricer`.\n\n**handler** (optional) is a user-defined function to handle the results of pricing.\n\n* If outputTime = true is set in *engineConfig*, the function signature is:\n\n  def(eventTime, name, date, npv)\n\n* If outputTime = false (default value) is set in *engineConfig*, the function signature is:\n\n  def(name, date, npv)\n\nParameter descriptions:\n\n* eventTime: NANOTIMESTAMP, the event time. Passed only if `outputTime=true` is set in *engineConfig*.\n\n* name: STRING, the instrument ID of the pricing target.\n\n* date: DATE, the pricing date.\n\n* npv: DOUBLE，the net present value.\n\n* **engineConfig** (optional) is a dictionary specifying engine runtime configuration. Supported key-value pairs include:\n  * numThreads (optional): is an INT scalar indicating the number of worker threads. Default is 8.\n  * maxQueueDepth (optional): is an INT scalar indicating the maximum queue depth. Default is 10,000,000.\n  * useSystemTime (optional): is a Boolean value indicating whether to use system time as the event time. Default is true.\n  * timeColumn (optional) is a STRING scalar to specify a NANOTIMESTAMP column as the event time. When specified, input data must contain this column. To specify timeColumn, useSystemTime must be set to false.\n  * outputTime (optional) is a Boolean value indicating whether to output the event time. Default is false.\n\n#### Returns\n\nA handle of the created pricing engine.\n\n#### Examples\n\nThis example defines 240025.IB as the pricing instrument. Based on the default matching rules in `instrumentPricer`, the instrument is associated with the market data CNY\\_TREASURY\\_BOND, which is subsequently added to the pricing engine using `appendMktData`.\n\n```\ntry{dropStreamEngine(\"PRICING_ENGINE\")}catch(ex){}\n\nbondDict  = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"240025.IB\",\n    \"start\": 2024.12.25,\n    \"maturity\": 2031.12.25,\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.0149,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\ninstrument = parseInstrument(bondDict)\n\npricingDate = 2025.08.18\n\ncurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"curveName\": \"CNY_TREASURY_BOND\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Compounded\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": [\n        2025.09.18, 2025.11.18, 2026.02.18, 2026.08.18, 2027.08.18,\n        2028.08.18, 2030.08.18, 2032.08.18, 2035.08.18, 2040.08.18,\n        2045.08.18, 2055.08.18, 2065.08.18, 2075.08.18\n    ],\n    \"values\": [\n        1.3000, 1.3700, 1.3898, 1.3865, 1.4299,\n        1.4471, 1.6401, 1.7654, 1.7966, 1.9930,\n        2.1834, 2.1397, 2.1987, 2.2225\n    ] \\ 100.0\n}\n\ndiscountCurve = parseMktData(curveDict)\n\nshare streamTable(1:0, `name`date`price, [STRING, DATE, DOUBLE]) as st\n\ndef myHandler(name, date, price) {\n    tableInsert(st, name, date, price)\n}\n\nengine = createPricingEngine(\"PRICING_ENGINE\", [instrument], myHandler)\n\nappendMktData(engine, discountCurve)\n\nselect * from st\n```\n\n| name      | date       | price |\n| --------- | ---------- | ----- |\n| 240025.IB | 2025.08.18 | 99.60 |\n\n**Related functions**: [appendMktData](https://docs.dolphindb.com/en/Functions/a/appendMktData.html)\n"
    },
    "createReactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html",
        "signatures": [
            {
                "full": "createReactiveStateEngine(name, metrics, dummyTable, outputTable, keyColumn, [filter], [snapshotDir], [snapshotIntervalInMsgCount], [keepOrder], [keyPurgeFilter], [keyPurgeFreqInSecond=0], [raftGroup], [outputElapsedMicroseconds=false], [keyCapacity=1024], [parallelism=1], [outputHandler], [msgAsTable=false])",
                "name": "createReactiveStateEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[filter]",
                        "name": "filter",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[keepOrder]",
                        "name": "keepOrder",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter]",
                        "name": "keyPurgeFilter",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond=0]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyCapacity=1024]",
                        "name": "keyCapacity",
                        "optional": true,
                        "default": "1024"
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[outputHandler]",
                        "name": "outputHandler",
                        "optional": true
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html)\n\n\n\n#### Syntax\n\ncreateReactiveStateEngine(name, metrics, dummyTable, outputTable, keyColumn, \\[filter], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[keepOrder], \\[keyPurgeFilter], \\[keyPurgeFreqInSecond=0], \\[raftGroup], \\[outputElapsedMicroseconds=false], \\[keyCapacity=1024], \\[parallelism=1], \\[outputHandler], \\[msgAsTable=false])\n\n#### Details\n\nThis function creates a reactive state engine and returns a table object. Writing to the table means that data is ingested into the reactive state engine for calculation.\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\nThe following state functions are optimized in DolphinDB reactive state engine. Note that unoptimized built-in state functions are not supported by this engine. Aggregate functions should be avoided.\n\n* cumulative function: [cumavg](https://docs.dolphindb.com/en/Functions/c/cumavg.html), [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html), [cumprod](https://docs.dolphindb.com/en/Functions/c/cumprod.html), [cumcount](https://docs.dolphindb.com/en/Functions/c/cumcount.html), [cummin](https://docs.dolphindb.com/en/Functions/c/cummin.html), [cummax](https://docs.dolphindb.com/en/Functions/c/cummax.html), [cumvar](https://docs.dolphindb.com/en/Functions/c/cumvar.html), [cumvarp](https://docs.dolphindb.com/en/Functions/c/cumvarp.html), [cumstd](https://docs.dolphindb.com/en/Functions/c/cumstd.html), [cumstdp](https://docs.dolphindb.com/en/Functions/c/cumstdp.html), [cumcorr](https://docs.dolphindb.com/en/Functions/c/cumcorr.html), [cumcovar](https://docs.dolphindb.com/en/Functions/c/cumcovar.html), [cumbeta](https://docs.dolphindb.com/en/Functions/c/cumbeta.html), [cumwsum](https://docs.dolphindb.com/en/Functions/c/cumwsum.html), [cumwavg](https://docs.dolphindb.com/en/Functions/c/cumwavg.html), [cumfirstNot](https://docs.dolphindb.com/en/Functions/c/cumfirstNot.html), [cumlastNot](https://docs.dolphindb.com/en/Functions/c/cumlastNot.html), [cummed](https://docs.dolphindb.com/en/Functions/c/cummed.html), [cumpercentile](https://docs.dolphindb.com/en/Functions/c/cumpercentile.html), [cumnunique](https://docs.dolphindb.com/en/Functions/c/cumnunique.html), [cumPositiveStreak](https://docs.dolphindb.com/en/Functions/c/cumPositiveStreak.html), [cummdd](https://docs.dolphindb.com/en/Functions/c/cummdd.html), [cumcovarp](https://docs.dolphindb.com/en/Functions/c/cumcovarp.html)\n\n* moving function: [ema](https://docs.dolphindb.com/en/Functions/e/ema.html), [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html), [msum](https://docs.dolphindb.com/en/Functions/m/msum.html), [mcount](https://docs.dolphindb.com/en/Functions/m/mcount.html), [mprod](https://docs.dolphindb.com/en/Functions/m/mprod.html), [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html), [mvarp](https://docs.dolphindb.com/en/Functions/m/mvarp.html), [mstd](https://docs.dolphindb.com/en/Functions/m/mstd.html), [mstdp](https://docs.dolphindb.com/en/Functions/m/mstdp.html), [mskew](https://docs.dolphindb.com/en/Functions/m/mskew.html), [mkurtosis](https://docs.dolphindb.com/en/Functions/m/mkurtosis.html), [mmin](https://docs.dolphindb.com/en/Functions/m/mmin.html), [mmax](https://docs.dolphindb.com/en/Functions/m/mmax.html), [mimin](https://docs.dolphindb.com/en/Functions/m/mimin.html), [mimax](https://docs.dolphindb.com/en/Functions/m/mimax.html), [mimaxLast](https://docs.dolphindb.com/en/Functions/m/mimaxlast.html), [miminLast](https://docs.dolphindb.com/en/Functions/m/miminlast.html), [mmed](https://docs.dolphindb.com/en/Functions/m/mmed.html), [mpercentile](https://docs.dolphindb.com/en/Functions/m/mpercentile.html), [mrank](https://docs.dolphindb.com/en/Functions/m/mrank.html), [mcorr](https://docs.dolphindb.com/en/Functions/m/mcorr.html), [mcovar](https://docs.dolphindb.com/en/Functions/m/mcovar.html), [mbeta](https://docs.dolphindb.com/en/Functions/m/mbeta.html), [mwsum](https://docs.dolphindb.com/en/Functions/m/mwsum.html), [mwavg](https://docs.dolphindb.com/en/Functions/m/mwavg.html), [mmad](https://docs.dolphindb.com/en/Functions/m/mmad.html), [mfirst](https://docs.dolphindb.com/en/Functions/m/mfirst.html), [mlast](https://docs.dolphindb.com/en/Functions/m/mlast.html), [mslr](https://docs.dolphindb.com/en/Functions/m/mslr.html), [tmove](https://docs.dolphindb.com/en/Functions/t/tmove.html), [tmfirst](https://docs.dolphindb.com/en/Functions/t/tmfirst.html), [tmlast](https://docs.dolphindb.com/en/Functions/t/tmlast.html), [tmsum](https://docs.dolphindb.com/en/Functions/t/tmsum.html), [tmavg](https://docs.dolphindb.com/en/Functions/t/tmavg.html), [tmcount](https://docs.dolphindb.com/en/Functions/t/tmcount.html), [tmvar](https://docs.dolphindb.com/en/Functions/t/tmvar.html), [tmvarp](https://docs.dolphindb.com/en/Functions/t/tmvarp.html), [tmstd](https://docs.dolphindb.com/en/Functions/t/tmstd.html), [tmstdp](https://docs.dolphindb.com/en/Functions/t/tmstdp.html), [tmprod](https://docs.dolphindb.com/en/Functions/t/tmprod.html), [tmskew](https://docs.dolphindb.com/en/Functions/t/tmskew.html), [tmkurtosis](https://docs.dolphindb.com/en/Functions/t/tmkurtosis.html), [tmmin](https://docs.dolphindb.com/en/Functions/t/tmmin.html), [tmmax](https://docs.dolphindb.com/en/Functions/t/tmmax.html), [tmmed](https://docs.dolphindb.com/en/Functions/t/tmmed.html), [tmpercentile](https://docs.dolphindb.com/en/Functions/t/tmpercentile.html), [tmrank](https://docs.dolphindb.com/en/Functions/t/tmrank.html), [tmcovar](https://docs.dolphindb.com/en/Functions/t/tmcovar.html), [tmbeta](https://docs.dolphindb.com/en/Functions/t/tmbeta.html), [tmcorr](https://docs.dolphindb.com/en/Functions/t/tmcorr.html), [tmwavg](https://docs.dolphindb.com/en/Functions/t/tmwavg.html), [tmwsum](https://docs.dolphindb.com/en/Functions/t/tmwsum.html), [tmoving](https://docs.dolphindb.com/en/Functions/Templates/tmoving.html), [moving](https://docs.dolphindb.com/en/Functions/Templates/moving.html), [sma](https://docs.dolphindb.com/en/Functions/s/sma.html), [wma](https://docs.dolphindb.com/en/Functions/w/wma.html), [dema](https://docs.dolphindb.com/en/Functions/d/dema.html), [tema](https://docs.dolphindb.com/en/Functions/t/tema.html), [trima](https://docs.dolphindb.com/en/Functions/t/trima.html), [linearTimeTrend](https://docs.dolphindb.com/en/Functions/l/linearTimeTrend.html), [talib](https://docs.dolphindb.com/en/Functions/Templates/talib.html), [t3](https://docs.dolphindb.com/en/Functions/t/t3.html), [ma](https://docs.dolphindb.com/en/Functions/m/ma.html), [mmaxPositiveStreak](https://docs.dolphindb.com/en/Functions/m/mmaxPositiveStreak.html), [movingWindowData](https://docs.dolphindb.com/en/Functions/m/movingWindowData.html), [tmovingWindowData](https://docs.dolphindb.com/en/Functions/t/tmovingWindowData.html), [mcovarp](https://docs.dolphindb.com/en/Functions/m/mcovarp.html), [tmcovarp](https://docs.dolphindb.com/en/Functions/t/tmcovarp.html)\n\n* order-sensitive function: [deltas](https://docs.dolphindb.com/en/Functions/d/deltas.html), [ratios](https://docs.dolphindb.com/en/Functions/r/ratios.html), [ffill](https://docs.dolphindb.com/en/Functions/f/ffill.html), [move](https://docs.dolphindb.com/en/Functions/m/move.html), [prev](https://docs.dolphindb.com/en/Functions/p/prev.html), [iterate](https://docs.dolphindb.com/en/Functions/i/iterate.html), [ewmMean](https://docs.dolphindb.com/en/Functions/e/ewmMean.html), [ewmVar](https://docs.dolphindb.com/en/Functions/e/ewmVar.html), [ewmStd](https://docs.dolphindb.com/en/Functions/e/ewmStd.html), [ewmCov](https://docs.dolphindb.com/en/Functions/e/ewmCov.html), [ewmCorr](https://docs.dolphindb.com/en/Functions/e/ewmCorr.html), [prevState](https://docs.dolphindb.com/en/Functions/p/prevState.html), [percentChange](https://docs.dolphindb.com/en/Functions/p/percentChange.html)\n\n* topN function: [msumTopN](https://docs.dolphindb.com/en/Functions/m/msumTopN.html), [mavgTopN](https://docs.dolphindb.com/en/Functions/m/mavgTopN.html), [mstdpTopN](https://docs.dolphindb.com/en/Functions/m/mstdpTopN.html), [mstdTopN](https://docs.dolphindb.com/en/Functions/m/mstdTopN.html), [mvarpTopN](https://docs.dolphindb.com/en/Functions/m/mvarpTopN.html), [mvarTopN](https://docs.dolphindb.com/en/Functions/m/mvarTopN.html), [mcorrTopN](https://docs.dolphindb.com/en/Functions/m/mcorrTopN.html), [mbetaTopN](https://docs.dolphindb.com/en/Functions/m/mbetaTopN.html), [mcovarTopN](https://docs.dolphindb.com/en/Functions/m/mcovarTopN.html), [mwsumTopN](https://docs.dolphindb.com/en/Functions/m/mwsumTopN.html),[cumwsumTopN](https://docs.dolphindb.com/en/Functions/c/cumwsumTopN.html), [cumsumTopN](https://docs.dolphindb.com/en/Functions/c/cumsumTopN.html), [cumvarTopN](https://docs.dolphindb.com/en/Functions/c/cumvarTopN.html), [cumvarpTopN](https://docs.dolphindb.com/en/Functions/c/cumvarpTopN.html),[cumstdTopN](https://docs.dolphindb.com/en/Functions/c/cumstdTopN.html), [cumstdpTopN](https://docs.dolphindb.com/en/Functions/c/cumstdpTopN.html), [cumcorrTopN](https://docs.dolphindb.com/en/Functions/c/cumcorrTopN.html), [cumbetaTopN](https://docs.dolphindb.com/en/Functions/c/cumbetaTopN.html),[cumavgTopN](https://docs.dolphindb.com/en/Functions/c/cumavgTopN.html), [cumskewTopN](https://docs.dolphindb.com/en/Functions/c/cumskewTopN.html), [cumkurtosisTopN](https://docs.dolphindb.com/en/Functions/c/cumkurtosisTopN.html), [mskewTopN](https://docs.dolphindb.com/en/Functions/m/mskewTopN.html), [mkurtosisTopN](https://docs.dolphindb.com/en/Functions/m/mkurtosisTopN.html), [tmsumTopN](https://docs.dolphindb.com/en/Functions/t/tmsumTopN.html), [tmavgTopN](https://docs.dolphindb.com/en/Functions/t/tmavgTopN.html), [tmstdTopN](https://docs.dolphindb.com/en/Functions/t/tmstdTopN.html), [tmstdpTopN](https://docs.dolphindb.com/en/Functions/t/tmstdpTopN.html), [tmvarTopN](https://docs.dolphindb.com/en/Functions/t/tmvarTopN.html), [tmvarpTopN](https://docs.dolphindb.com/en/Functions/t/tmvarpTopN.html), [tmskewTopN](https://docs.dolphindb.com/en/Functions/t/tmskewTopN.html), [tmkurtosisTopN](https://docs.dolphindb.com/en/Functions/t/tmkurtosisTopN.html), [tmbetaTopN](https://docs.dolphindb.com/en/Functions/t/tmbetaTopN.html), [tmcorrTopN](https://docs.dolphindb.com/en/Functions/t/tmcorrTopN.html), [tmcovarTopN](https://docs.dolphindb.com/en/Functions/t/tmcovarTopN.html), [tmwsumTopN](https://docs.dolphindb.com/en/Functions/t/tmwsumTopN.html), [mcovarpTopN](https://docs.dolphindb.com/en/Functions/m/mcovarpTopN.html), [tmcovarpTopN](https://docs.dolphindb.com/en/Functions/t/tmcovarpTopN.html), [cumcovarpTopN](https://docs.dolphindb.com/en/Functions/c/cumcovarpTopN.html)\n\n* higher-order function: [segmentby](https://docs.dolphindb.com/en/Functions/Templates/segmentby.html) (whose parameter *func* can only take cumsum, cummax, cummin, cumcount, cumavg, cumstd, cumvar, cumstdp, cumvarp), [moving](https://docs.dolphindb.com/en/Functions/Templates/moving.html), [byColumn](https://docs.dolphindb.com/en/Functions/Templates/byColumn.html), [accumulate](https://docs.dolphindb.com/en/Functions/Templates/accumulate.html), [window](https://docs.dolphindb.com/en/Functions/Templates/window.html)\n\n* others: [talibNull](https://docs.dolphindb.com/en/Functions/t/talibNull.html), [topRange](https://docs.dolphindb.com/en/Functions/t/topRange.html), [lowRange](https://docs.dolphindb.com/en/Functions/l/lowRange.html), [trueRange](https://docs.dolphindb.com/en/Functions/t/trueRange.html)\n\n* functions that can only be used in the reactive state engine: [stateIterate](https://docs.dolphindb.com/en/Functions/s/stateIterate.html), [conditionalIterate](https://docs.dolphindb.com/en/Functions/c/conditionalIterate.html), [genericStateIterate](https://docs.dolphindb.com/en/Functions/g/genericStateIterate.html), [genericTStateIterate](https://docs.dolphindb.com/en/Functions/g/genericTStateIterate.html)\n\nNote: If function `talib` is used as a state function, the first parameter *func* must be a state function.\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n##### Calculation Rules\n\nThe reactive state engine outputs a result for each input. If multiple records are ingested into the reactive state engine at the same time, the data is calculated in batches. The number of records in each batch is determined by the system.\n\n* To output only the results that met the specified conditions, set the parameter *filter*;\n\n* To perform calculations by group, set the parameter *keyColumn*;\n\n* To preserve the insertion order of the records in the output table, set the parameter *keepOrder*.\n\n##### Features\n\n* State cleanup: States in the engine are maintained by group. A large number of groups may lead to high memory overhead, and you can set a cleanup rule to clear data that are no longer needed. (See parameters *keyPurgeFilter* and *keyPurgeFreInSecond*)\n\n* Snapshot: Snapshot mechanism is used to restore the streaming engine to the latest snapshot after system interruption. (See parameters *snapshotDir* and *snapshotIntervalInMsgCount*)\n\n* High availability: To enable high availability for streaming engines, specify the parameter *raftGroup* on the leader of the raft group on the subscriber. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table.\n\n#### Parameters\n\n**name** is a string of the engine name. It is the only identifier of a reactive state engine on a data/compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**metrics** is metacode specifying the formulas for calculation. The metacode can include one or more expressions, built-in or user-defined functions, or a constant scalar/vector. Note that the output column for a constant vector must be in array vector form. For more information about metacode refer to [Metaprogramming](https://docs.dolphindb.cn/en/Programming/Metaprogramming/MetacodeWithFunction.html). To use a user-defined function in the reactive state engine,\n\n(1) Add `@state` to declare the function before the definition. For state functions, the following statements are supported:\n\n* Assignment and return statements\n\n* `if...else` statements with scalar expressions (since 1.30.21/2.00.9)\n\n* `for` loops, including `break` and `continue` (since 1.30.23/2.00.11). Loop iterations must be under 100 times. Nested `for` loops are currently unsupported.\n\n(2) Stateless or state functions can be used in a reactive state engine, but the *metrics* parameter cannot be specified as the stateless function nesting with the state function.\n\n(3) If the rvalue of an assignment statement is a built-in or user-defined function that returns multiple values, the values must be assigned to variables at the same time. In the following example, the user-defined state function references linearTimeTrend, which returns two values.\n\n```\n@state\ndef forcast2(S, N){\n\tlinearregIntercept, linearregSlope = linearTimeTrend(S, N)\n\treturn (N - 1) * linearregSlope + linearregIntercept\n}\n```\n\n(4) In the reactive state engine, custom state functions cannot contain self-assignment statements such as `a=a+b`. In the following example, when the condition is false, the `iif` expression returns out, which results in self-assignment (`out = out`) and triggers an error.\n\n```\nout = iif((p1 > 0) and (p2 == 0), p1, out)\n// An assignment statement in state function 'xxx' can't use self reference\n```\n\nNote: The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether dummyTable contains data does not matter.\n\n**outputTable** is the output table for the results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\nThe output columns are in the following order:\n\n(1) If *keyColumn* is specified, the first few columns must match its order.\n\n(2) If the *outputElapsedMicroseconds* is set to true, specify two more columns: a LONG column for elapsed time of each batch and an INT column for total records in each batch.\n\n(3) Then followed by one or more result columns.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the grouping column(s). The calculation is conducted within each group.\n\n**filter** (optional) is the metacode that indicates the filtering conditions. A filtering condition must be an expression and only columns of *dummyTable*can be included. You can specify multiple conditions with logical operators (and, or). Only the results that satisfy the filter conditions are ingested to the output table.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**keepOrder** (optional) specifies whether to preserve the insertion order of the records in the output table. If *keyColumn* contains a time column, the default value is true, and otherwise false.\n\nTo clean up the data that is no longer needed after calculation, specify parameters *keyPurgeFilter* and *keyPurgeFreqInSecond*.\n\n**keyPurgeFilter** (optional) indicates the filtering conditions that identify the data to be purged from the cache. It is metacode composed of conditional expressions, and these expressions must refer to the columns in the *outputTable*. *keyPurgeFilter* is effective only when *keyColumn* is specified.\n\n**keyPurgeFreqInSecond** (optional) is a positive integer indicating the time interval (in seconds) to trigger a purge. *keyPurgeFreqInSecond* is effective only when *keyColumn* is specified.\n\nFor each data ingestion, the engine starts a purge if all of the following conditions are satisfied:\n\n(1) The time elapsed since the last data ingestion is equal to or greater than *keyPurgeFreqInSecond* (For the first check, the time elapsed between the ingestion of data and the creation of the engine is used);\n\n(2) If the first condition is satisfied, the engine applies *keyPurgeFilter* to the cached data to get the data to be purged.\n\n(3) The number of groups which contain data to be purged is equal to or greater than 10% of the total number of groups in the engine.\n\nTo check the engine status before and after the purge, call `getStreamEngineStat().ReactiveStreamEngine` (see [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html)) where the *numGroups* field indicates the number of groups in the reactive state streaming engine.\n\n**raftGroup** (optional) is an integer greater than 1, indicating ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. Specify *raftGroup* to enable high availability for the streaming engine. When an engine is created on the leader, it is also created on each follower and the engine snapshot is synchronized to the 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.\n\n**outputElapsedMicroseconds** (optional) is a Boolean value. The default value is false. It determines whether to output:\n\n* the elapsed time (in microseconds) from the ingestion of data to the output of result in each batch.\n\n* the total number of each batch.\n\nIf specified, two additional columns must be added to the output table (see *outputTable*).\n\n**keyCapacity** (optional) is a positive integer indicating the amount of memory allocated for buffering state of each group (defined by *keyColumn*) on a row basis. The default value is 1024. For data with large amount of groups, setting of this parameter can reduce the latency that may occur.\n\n**parallelism** (optional) is a positive integer no greater than 63, indicating the maximum number of workers that can run in parallel. The default value is 1. For large computation workloads, reasonable adjustment of this parameter can effectively utilize computing resources and reduce computation time.\n\n**Note**: *parallelism* cannot exceed the lesser of the numbers of licensed cores and logical cores minus one.\n\n**outputHandler** (optional) is a unary function or a partial function with a single unfixed parameter. If set, the engine will not write the calculation results to the output table directly. Instead, the results will be passed as a parameter to the *outputHandler* function.\n\n**msgAsTable** (optional) is a Boolean scalar indicating whether the output data is passed into function (specified by *outputHandler*) as a table or as a tuple. If *msgAsTable*=true, the subscribed data is passed into function as a table. The default value is false, which means the output data is passed into function as a tuple of columns.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\nExample 1.\n\n```\ndef sum_diff(x, y){\n     return (x-y)/(x+y)\n}\n\nfactor1 = <ema(1000 * sum_diff(ema(price, 20), ema(price, 40)),10) -  ema(1000 * sum_diff(ema(price, 20), ema(price, 40)), 20)>\nshare streamTable(1:0, `sym`time`price, [STRING,DATETIME,DOUBLE]) as tickStream\nshare table(1000:0, `sym`time`factor1, [STRING,DATETIME,DOUBLE]) as result\nrse = createReactiveStateEngine(name=\"reactiveDemo\", metrics =[<time>, factor1], dummyTable=tickStream, outputTable=result, keyColumn=\"sym\", filter=<sym in [\"000001.SH\", \"000002.SH\"]>)\nsubscribeTable(tableName=`tickStream, actionName=\"factors\", handler=tableInsert{rse})\n\ndata1 = table(take(\"000001.SH\", 100) as sym, 2021.02.08T09:30:00 + 1..100 *3 as time, 10+cumsum(rand(0.1, 100)-0.05) as price)\ndata2 = table(take(\"000002.SH\", 100) as sym, 2021.02.08T09:30:00 + 1..100 *3 as time, 20+cumsum(rand(0.2, 100)-0.1) as price)\ndata3 = table(take(\"000003.SH\", 100) as sym, 2021.02.08T09:30:00 + 1..100 *3 as time, 30+cumsum(rand(0.3, 100)-0.15) as price)\ndata = data1.unionAll(data2).unionAll(data3).sortBy!(`time)\n\nreplay(inputTables=data, outputTables=tickStream, timeColumn=`time)\n\n// Execute the following code before re-run the above code.\nunsubscribeTable(tableName=`tickStream, actionName=\"factors\")\ndropStreamEngine(`reactiveDemo)\nundef(`tickStream, SHARED)\n```\n\nThe result only contains the stocks \"000001.SH\" and \"000002.SH\" that are specified in the filtering condition.\n\nExecute the following code before re-run the above code.\n\n```\nunsubscribeTable(tableName=`tickStream, actionName=\"factors\")\ndropStreamEngine(`reactiveDemo) undef(`tickStream, SHARED)\n```\n\nExample 2. Calculate in groups by date and sym column. Then output the result which time is between \"2012.01.01\" and \"2012.01.03\".\n\n```\nshare streamTable(1:0, `date`time`sym`market`price`qty, [DATE, TIME, SYMBOL, CHAR, DOUBLE, INT]) as trades\nshare table(100:0, `date`sym`factor1, [DATE, STRING, DOUBLE]) as outputTable\nengine = createReactiveStateEngine(name=\"test\", metrics=<mavg(price, 3)>, dummyTable=trades, outputTable=outputTable, keyColumn=[\"date\",\"sym\"], filter=<date between 2012.01.01 : 2012.01.03>, keepOrder=true)\nsubscribeTable(tableName=`trades, actionName=\"test\", msgAsTable=true, handler=tableInsert{engine})\n\nn=100\ntmp = table(rand(2012.01.01..2012.01.10, n) as date, rand(09:00:00.000..15:59:59.999, n) as time, rand(\"A\"+string(1..10), n) as sym, rand(['B', 'S'], n) as market, rand(100.0, n) as price, rand(1000..2000, n) as qty)\ntrades.append!(tmp)\nselect * from outputTable\n```\n\nExample 3. Since version 2.00.9, higher-order function `moving` can be called in the reactive state engine to calculate array vectors.\n\n```\ndefg myFactor(x){\n    return avg(var(x));\n}\nshare streamTable(1:0, `DateTime`SecurityID`Trade, [TIMESTAMP, SYMBOL, DOUBLE[]]) as tickStream\nshare table(1000:0, `SecurityID`DateTime`result, [SYMBOL, DATETIME, DOUBLE]) as result\nrse = createReactiveStateEngine(name=\"reactiveDemo\", metrics =<[DateTime, moving(myFactor, Trade, 3, 1)]>, dummyTable=tickStream, outputTable=result, keyColumn=\"SecurityID\")\nDateTime = 2022.09.15T09:00:00.000+1..12\nSecurityID = take(`600021, 12)\nTrade = [[10.06, 10.06], [10.04], [10.05, 10.06, 10.05, 10.08],[10.02,10.01], [10.06, 10.06, 10.05, 10.05], [10.04], [10.05,10.08, 10.09],[10.02,10.01],[10.06, 10.06, 10.05], [10.04, 10.03], [10.05, 10.06, 10.05, 10.08, 10.09],[10.02]]\nt = table(1:0, `DateTime`SecurityID`Trade, [TIMESTAMP, SYMBOL, DOUBLE[]])\ntableInsert(t, DateTime, SecurityID, Trade)\nrse.append!(t)\nselect * from result\ndropStreamEngine(\"reactiveDemo\")\n```\n\nExample 4. Define a constant in metrics indicating the factor name based on the above example.\n\n```\ndefg myFactor(x){\n   return avg(var(x));\n}\nshare streamTable(1:0, `DateTime`SecurityID`Trade, [TIMESTAMP, SYMBOL, DOUBLE[]]) as tickStream\nshare table(1000:0, `SecurityID`DateTime`factorName`result, [SYMBOL, DATETIME, STRING, DOUBLE]) as result\nrse = createReactiveStateEngine(name=\"reactiveDemo\", metrics =<[DateTime,\"factor1\", moving(myFactor, Trade, 3, 1)]>, dummyTable=tickStream, outputTable=result, keyColumn=\"SecurityID\")\nDateTime = 2022.09.15T09:00:00.000+1..12\nSecurityID = take(`600021, 12)\nTrade = [[10.06, 10.06], [10.04], [10.05, 10.06, 10.05, 10.08],[10.02,10.01], [10.06, 10.06, 10.05, 10.05], [10.04], [10.05,10.08, 10.09],[10.02,10.01],[10.06, 10.06, 10.05], [10.04, 10.03], [10.05, 10.06, 10.05, 10.08, 10.09],[10.02]]\nt = table(1:0, `DateTime`SecurityID`Trade, [TIMESTAMP, SYMBOL, DOUBLE[]])\ntableInsert(t, DateTime, SecurityID, Trade)\nrse.append!(t)\nselect * from result\n```\n\n<table id=\"table_akr_4bj_zbc\"><tbody><tr><td>\n\nSecurityID\n\n</td><td>\n\nDateTime\n\n</td><td>\n\nfactorName\n\n</td><td>\n\nresult\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0001\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.0002\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.0006\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.0004\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.0004\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.0003\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.001\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.0007\n\n</td></tr><tr><td>\n\n600021\n\n</td><td>\n\n2022.09.15 09:00:00\n\n</td><td>\n\nfactor1\n\n</td><td>\n\n0.0004\n\n</td></tr></tbody>\n</table>Example 5. Since version 3.00.5, `movingWindowData` can be called in this engine to calculate array vectors.\n\n```\nx = array(INT[], 0, 1000).append!([[1,2,3], [4,5], [6], [], [7,8,9]])\nt = table([1,1,1,2,2] as id, \"a\" +string(1..5) as sym, x as bids)\noutput = table(1:0, `id`f1`f2, [INT, ANY, ANY])\ntry {dropStreamEngine(\"testRSE\") } catch(ex) { print(ex) }\nengine = createReactiveStateEngine(name=\"testRSE\", metrics=[<movingWindowData(bids, 3)>, <movingWindowData(bids, 3, true)>], dummyTable=t, outputTable=output, keyColumn=`id)\nengine.append!(t)\n\nselect * from output \n```\n\nOutput:\n\n| id | f1                     | f2                     |\n| -- | ---------------------- | ---------------------- |\n| 1  | (\\[1,2,3])             | (,,\\[1,2,3])           |\n| 1  | (\\[1,2,3],\\[4,5])      | (,\\[1,2,3],\\[4,5])     |\n| 1  | (\\[1,2,3],\\[4,5],\\[6]) | (\\[1,2,3],\\[4,5],\\[6]) |\n| 2  | (\\[00i])               | (,,)                   |\n| 2  | (,\\[7,8,9])            | (,,\\[7,8,9])           |\n\nExample 6. This example computes the cumulative trading volume and the cumulative trading value in real time. Setting *outputElapsedMicroseconds=true* also outputs the processing time and row count for the current batch.\n\n```\nshare streamTable(1:0, `execTime`symbol`execQty`execPrice, [TIMESTAMP, SYMBOL, INT, DOUBLE]) as trades\nshare table(100:0, `symbol`elapsedUs`batchRows`execTime`cumQty`cumAmount, [SYMBOL, LONG, INT, TIMESTAMP, INT, DOUBLE]) as outputTable\n\nrseElapsedDemo = createReactiveStateEngine(\n   name=\"rseElapsedDemo\",\n   metrics=[<execTime>, <cumsum(execQty)>, <cumsum(execQty * execPrice)>],\n   dummyTable=trades,\n   outputTable=outputTable,\n   keyColumn=\"symbol\",\n   keepOrder=true,\n   outputElapsedMicroseconds=true\n)\n\nsubscribeTable(tableName=\"trades\", actionName=\"rseElapsedDemo\", offset=0, handler=append!{rseElapsedDemo}, msgAsTable=true)\n\ninsert into trades values(2024.06.03T09:30:00.000, `600519, 200, 1478.5)\ninsert into trades values(2024.06.03T09:30:00.500, `600519, 150, 1479.2)\ninsert into trades values(2024.06.03T09:30:01.200, `000001, 500, 12.36)\n\nsleep(500)\n\nselect * from outputTable\n```\n\nThe output may look like this:\n\n| symbol | elapsedUs | batchRows | execTime                | cumQty | cumAmount |\n| ------ | --------- | --------- | ----------------------- | ------ | --------- |\n| 600519 | 492       | 1         | 2024.06.03 09:30:00.000 | 200    | 295,700   |\n| 600519 | 983       | 2         | 2024.06.03 09:30:00.500 | 350    | 517,580   |\n| 000001 | 983       | 2         | 2024.06.03 09:30:01.200 | 500    | 6,180     |\n\n* After *outputElapsedMicroseconds*=true is set, *outputTable* must include a LONG column and an INT column after the grouping column to record batch processing time and batch row count, respectively.\n\n* In this example, *keyColumn*=\"symbol\", so cumQty and cumAmount are accumulated independently within each stock-symbol group.\n\n* The values in the elapsedUs column depend on machine configuration, system load, and batch partitioning, so that they will vary across environments.\n\nExample 7. This example simulates account trade processing. After *outputHandler* is set, the engine no longer writes computation results to outputTable. Instead, it calls the defined unary function to process the results. *msgAsTable* controls the structure of the callback parameter:\n\n* *msgAsTable*=false: the callback parameter is a tuple of columns;\n\n* *msgAsTable*=true: the callback parameter is a table.\n\n```\nshare streamTable(1:0, `execTime`accountId`symbol`filledQty, [TIMESTAMP, SYMBOL, SYMBOL, INT]) as fills\nshare table(100:0, `accountId`execTime`cumFilledQty, [SYMBOL, TIMESTAMP, INT]) as ignoredTuple\nshare table(100:0, `accountId`execTime`cumFilledQty, [SYMBOL, TIMESTAMP, INT]) as ignoredTable\nshare table(100:0, `accountId`execTime`cumFilledQty, [SYMBOL, TIMESTAMP, INT]) as tupleResult\nshare table(100:0, `accountId`execTime`cumFilledQty, [SYMBOL, TIMESTAMP, INT]) as tableResult\n\ndef handleTuple(msg){\n   tupleResult.tableInsert(msg[0], msg[1], msg[2])\n}\n\ndef handleTable(msg){\n   tableResult.append!(msg)\n}\n\nengineTuple = createReactiveStateEngine(\n   name=\"rseTupleHandler\",\n   metrics=[<execTime>, <cumsum(filledQty)>],\n   dummyTable=fills,\n   outputTable=ignoredTuple,\n   keyColumn=\"accountId\",\n   keepOrder=true,\n   outputHandler=handleTuple,\n   msgAsTable=false\n)\n\nengineTable = createReactiveStateEngine(\n   name=\"rseTableHandler\",\n   metrics=[<execTime>, <cumsum(filledQty)>],\n   dummyTable=fills,\n   outputTable=ignoredTable,\n   keyColumn=\"accountId\",\n   keepOrder=true,\n   outputHandler=handleTable,\n   msgAsTable=true\n)\n\nsubscribeTable(tableName=\"fills\", actionName=\"engineTuple\", offset=0, handler=append!{engineTuple}, msgAsTable=true)\nsubscribeTable(tableName=\"fills\", actionName=\"engineTable\", offset=0, handler=append!{engineTable}, msgAsTable=true)\n\n\ninsert into fills values(2024.06.03T09:35:00.000, `ACC1001, `600519, 300)\ninsert into fills values(2024.06.03T09:35:02.000, `ACC1001, `600519, 120)\ninsert into fills values(2024.06.03T09:35:05.000, `ACC2003, `000001, 180)\n\n```\n\nRun `select * from tupleResult` and `select * from tableResult`, respectively.\n\nBoth tupleResult and tableResult return the following results:\n\n| accountId | execTime                | cumFilledQty |\n| --------- | ----------------------- | ------------ |\n| ACC1001   | 2024.06.03 09:35:00.000 | 300          |\n| ACC1001   | 2024.06.03 09:35:02.000 | 420          |\n| ACC2003   | 2024.06.03 09:35:05.000 | 180          |\n\n* In engineTuple, `handleTuple` receives a tuple of columns. The unary function uses `tableInsert` to insert `msg[0]`, `msg[1]`, and `msg[2]` into the target table.\n\n* In engineTable, `handleTable` receives a result table, and the unary function uses `append!` to append the result table to the target table.\n\nRun `select * from ignoredTuple` and `select * from ignoredTable`, respectively; both outputs are empty. This is because once *outputHandler* is set, computation results are not written to ignoredTuple or ignoredTable.\n"
    },
    "createReactiveStatelessEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createReactiveStatelessEngine.html",
        "signatures": [
            {
                "full": "createReactiveStatelessEngine(name, metrics, outputTable)",
                "name": "createReactiveStatelessEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    }
                ]
            }
        ],
        "markdown": "### [createReactiveStatelessEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStatelessEngine.html)\n\n#### Syntax\n\ncreateReactiveStatelessEngine(name, metrics, outputTable)\n\n#### Details\n\nThis function creates a reactive stateless engine and returns a table object with the following schema:\n\n| Column Name | Type   |\n| ----------- | ------ |\n| productName | STRING |\n| metricName  | STRING |\n| value       | DOUBLE |\n\nWriting to the table means that data is ingested into the engine for calculation. The reactive stateless engine supports defining dependencies for dynamic calculations.\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n#### Calculation Rules\n\nThe reactive stateless engine processes each batch of input data and calculates formulas as defined in *metrics*. Once a precedent value (referred to by a metric) is ingested or updated, all dependent formulas are output accordingly. The calculation is based on the latest variable values.\n\n#### Parameters\n\n**name** is a string of the engine name. It is the only identifier of a reactive state engine on a data/compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**metrics** is a vector of dictionaries, specifying the calculation formulas and their dependencies. Each dictionary has the following key-value pairs:\n\n* \"outputName\"->productName:metricName\n\n* \"formula\"->\\<expression>\n\n  The value of *formula*is a metacode expression defining the formula for calculation, which can reference other variables. For example, the expression can be `<A*B>`, and A and B are precedent variables for this formula.\n\n* Key-value pairs specifying the precedent variable locations used in the *formula*above. For exmaple, for `<A*B>`, specify:\n\n  * \"A\"->productName:metricName\n  * \"B\"->productName:metricName\n    The *productName*and *metricName*uniquely specify the location of the variable, which can be the input or output table.\n\n**outputTable** is the output table for the results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\nThe output columns are in the following order:\n\n* productName: STRING or SYMBOL type, as defined in *metrics*.\n* metricName: STRING or SYMBOL type, as defined in *metrics*.\n* A column of DOUBLE or FLOAT type storing calculation results of *formula*defined in *metrics*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n| productName | metricName | value |\n| ----------- | ---------- | ----- |\n| product\\_A  | factor1    | 1     |\n| product\\_A  | factor2    | 2     |\n| product\\_B  | factor1    | 1     |\n| product\\_B  | value      | 4     |\n| product\\_C  | factor1    | 2     |\n| product\\_C  | value      | 8     |\n\nFor a table as above, factors (e.g., product\\_A:factor1) are ingested into the table, and values are calculated based on other variables:\n\n* product\\_B:value=product\\_A:factor1+product\\_A:factor2+product\\_B:factor1\n\n* product\\_C:value=product\\_B:value\\*product\\_C:factor1\n\nBased on the above information, create a reactive stateless engine:\n\n```\n// create output table\nnames = `product`metric`value\ntypes = [STRING, STRING, DOUBLE]\nshare table(1:0, names, types) as outputTable\n\n// define metrics\nmetrics = array(ANY, 0, 0)\nmetric1 = dict(STRING,ANY)\n// product_B:value=product_A:factor1+product_A:factor2+product_B:factor1\nmetric1[\"outputName\"] = `product_B:`value\nmetric1[\"formula\"] = <A+B+C>\nmetric1[\"A\"] = `product_A:`factor1\nmetric1[\"B\"] = `product_A:`factor2\nmetric1[\"C\"] = `product_B:`factor1\nmetrics.append!(metric1)\n// product_C:value=product_B:value*product_C:factor1\nmetric2 = dict(STRING, ANY)\nmetric2[\"outputName\"] =`product_C:`value\nmetric2[\"formula\"] = <A*B>\nmetric2[\"A\"] = `product_B:`value \nmetric2[\"B\"] = `product_C:`factor1\nmetrics.append!(metric2)\n\n// create engine\nengine1 = createReactiveStatelessEngine(\"engine1\", metrics, outputTable)\n```\n\n(1) Ingest 2 records to the engine. The dependent values cannot be calculated yet since the precedent variables are not enough. Empty results are returned.\n\n```\ninsert into engine1 values([\"product_A\",\"product_A\"],[\"factor1\",\"factor2\"],[1,2])\noutputTable\n```\n\n| product    | metric | value |\n| ---------- | ------ | ----- |\n| product\\_B | value  |       |\n| product\\_C | value  |       |\n\n(2) Then ingest 1 record for product\\_B:factor1, and the first dependent value can be calculated.\n\n```\ninsert into engine1 values(\"product_B\",\"factor1\",1)\noutputTable\n```\n\n<table id=\"table_nsd_5vx_2bc\"><tbody><tr><td>\n\nproduct\n\n</td><td>\n\nmetric\n\n</td><td>\n\nvalue\n\n</td></tr><tr><td>\n\nproduct\\_B\n\n</td><td>\n\nvalue\n\n</td><td>\n\n</td></tr><tr><td>\n\nproduct\\_C\n\n</td><td>\n\nvalue\n\n</td><td>\n\n</td></tr><tr><td>\n\nproduct\\_B\n\n</td><td>\n\nvalue\n\n</td><td>\n\n4\n\n</td></tr><tr><td>\n\nproduct\\_C\n\n</td><td>\n\nvalue\n\n</td><td>\n\n</td></tr></tbody>\n</table>\\(3\\) Ingest 1 record for product\\_C:factor1, and the second dependent value can be calculated.\n\n```\ninsert into engine1 values(\"product_C\",\"factor1\",2)\noutputTable\n```\n\n| product    | metric | value |\n| ---------- | ------ | ----- |\n| product\\_B | value  |       |\n| product\\_C | value  |       |\n| product\\_B | value  | 4     |\n| product\\_C | value  |       |\n| product\\_C | value  | 8     |\n\n(4) Ingest 1 record which updates product\\_C:factor1 from 2 to 3. One new result for product\\_C:value is calculated.\n\n```\ninsert into engine1 values(\"product_C\",\"factor1\",3)\noutputTable\n```\n\n| product    | metric | value |\n| ---------- | ------ | ----- |\n| product\\_B | value  |       |\n| product\\_C | value  |       |\n| product\\_B | value  | 4     |\n| product\\_C | value  |       |\n| product\\_C | value  | 8     |\n| product\\_C | value  | 12    |\n\n(5) Once a record is updated, related calculation results are returned even if the results do not eventually change.\n\n```\ninsert into engine1 values([\"product_A\",\"product_A\"],[\"factor1\",\"factor2\"],[2,1])\noutputTable\n```\n\n| product    | metric | value |\n| ---------- | ------ | ----- |\n| product\\_B | value  |       |\n| product\\_C | value  |       |\n| product\\_B | value  | 4     |\n| product\\_C | value  |       |\n| product\\_C | value  | 8     |\n| product\\_C | value  | 12    |\n| product\\_B | value  | 4     |\n| product\\_C | value  | 12    |\n\n"
    },
    "createRuleEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createRuleEngine.html",
        "signatures": [
            {
                "full": "createRuleEngine(name, ruleSets, dummyTable, outputColumns, outputTable, [policy], [ruleSetColumn], [callback], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createRuleEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "ruleSets",
                        "name": "ruleSets"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputColumns",
                        "name": "outputColumns"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[policy]",
                        "name": "policy",
                        "optional": true
                    },
                    {
                        "full": "[ruleSetColumn]",
                        "name": "ruleSetColumn",
                        "optional": true
                    },
                    {
                        "full": "[callback]",
                        "name": "callback",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createRuleEngine](https://docs.dolphindb.com/en/Functions/c/createRuleEngine.html)\n\n\n\n#### Syntax\n\ncreateRuleEngine(name, ruleSets, dummyTable, outputColumns, outputTable, \\[policy], \\[ruleSetColumn], \\[callback], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\n#### Details\n\nCreate a rule engine that supports multiple rules.\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n**Workflow**\n\nThe rule engine selects and applies the appropriate rules to inserted data based on a predefined rule set, then outputs the check result. The rule-matching and checking logic works as follows:\n\n1. The rule set is a dictionary in which each key corresponds to a group of rules. A NULL key indicates the default rule group.\n2. When data enters the engine, the value of its key field (specified by *ruleSetColumn*) is matched against the keys in the rule set. If the field value equals a key, that rule group is used to check the data. If *ruleSetColumn* is not specified or no rule is matched, the default rule group is used.\n3. The check result is determined by the specific rules and the configured policy. For details on policies, refer to the **Arguments** section.\n4. If a callback function is defined, the engine calls it for further data processing.\n\n**Scenarios**\n\nThe rule engine supports millisecond-level real-time responses, precise handling of large-scale time-series data, and dynamic rule adjustments. It can be applied in scenarios such as:\n\n* **IoT:** device monitoring (e.g., temperature, humidity), power monitoring (e.g., voltage, electricity usage).\n* **Finance:** risk control, such as filtering orders, monitoring stock trading volume, and setting over-limit alerts.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine.\n\n**ruleSets** is a dictionary specifying the rule set. Its key is of STRING or INT type, and the value is a tuple with metacode. If the key is NULL, the rule is treated as the default rule. If *ruleSetColumn* is not specified or the data does not match any rule, the default rule will be used for checking data. A rule set must include a default rule.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter.\n\n**outputColumns** is a STRING vector indicating the input columns to be preserved in the output table.\n\n**outputTable** is a table to which the engine inserts the check result. It can be an in-memory table or a DFS table. It includes the columns specified by *outputColumns*, along with an additional column that stores the check result. When the *policy* parameter is set to \"shortcut\", the last column is an INT scalar; otherwise, it is a BOOL vector.\n\n**policy**(optional) is a STRING scalar indicating the rule-checking policy. It can take the following values:\n\n* shortcut (default): When any rule fails (i.e., the check result is false), the rule engine immediately stops checking and returns the index of that rule (starting from 0). If all rules pass, it returns NULL. For example, if the data matches the following rules and the value of the age field is less than 18, the check result is false. The rule engine stops checking and returns 0 (the rule’s index) to the output table.\n\n  ```\n  (< age > 18 >,< income > 5000 >,< debtRatio < 0.5 >)\n  ```\n\n* all: Check all rules, and the engine returns the check result as a BOOL vector. For example, if the data matches the following rules and `voltage = 220`, `current = 37.11`, and `temperature = 39`, the check result would be `[false, false, false]`.\n\n  ```\n  (< voltage > 221.86 >,< current > 39.96 >,< temperature > 44.43 >)\n  ```\n\n**ruleSetColumn**(optional) is a STRING scalar indicating an input column name. If it is not set or the specified column does not match any rule set, then the default rule set is applied.\n\n**callback** (optional) is a function that takes a tuple as input. The table contains a record output by the engine. If specified, the callback function is invoked with each output passed in as an argument. If not specified, the engine will only insert the checking results into the output table.\n\n**snapshotDir** and **snapshotIntervalInMsgCount** (optional) are not required. They have no effect and are included solely for compatibility with the ORCA framework.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n##### Implementation steps\n\n1. Create a DFS table to store the data output by the callback function.\n2. Define the rule set that will be used to check inserted data.\n3. Define the callback function to further process the data based on the check result.\n4. Create the rule engine.\n5. Insert data into the rule engine.\n\n##### Sample code\n\n**Create a DFS table**\n\n```\n// Create a DFS table to store the data output by the callback function\ndb = database(\"dfs://temp\", VALUE, 1..3)\nt1 = table(1:0, `sym`value`price, [INT,DOUBLE,DOUBLE])\npt = db.createPartitionedTable(t1,`pt,`sym)\n```\n\n**Define the rule set**\n\nThe following rule set contains three groups of rules, with keys 1, 2, and NULL. The NULL key represents the default rule group.\n\n```\nx = [1, 2, NULL]\ny = [ [ < value > 1 > ], [ < price < 2 >, < price > 6 > ], [ < value*price > 10 > ] ]\nruleSets = dict(x, y)\n/* Output：\n->(< (value * price) > 10 >)\n2->(< price < 2 >,< price > 6 >)\n1->(< value > 1 >)\n*/\n```\n\n**Define the callback function**\n\nThe following callback function checks whether the first value in the check result of each row is `false`. If it is, the corresponding data is inserted into the DFS table.\n\n```\ndef writeBack(result){\n    if(result.rule[0]==false){\n        temp = select sym,value,price from result\n        loadTable(\"dfs://temp\",`pt).append!(temp)\n    }\n}\n```\n\n**Create the rule engine**\n\n```\nnames = `sym`value`price`quantity\ntypes = [INT, DOUBLE, DOUBLE, DOUBLE]\ndummy = table(1:0, names, types)\noutputNames = `sym`value`price`rule\noutputTypes = [INT, DOUBLE, DOUBLE, BOOL[]]\noutputTable = table(10:0, outputNames, outputTypes)\ntest = createRuleEngine(\n        name=\"ruleEngineTest\",\n        ruleSets=ruleSets,\n        dummyTable=dummy,\n        outputColumns=[\"sym\",\"value\",\"price\"],\n        outputTable=outputTable,\n        policy=\"all\",\n        ruleSetColumn=\"sym\",\n        callback=writeBack)\n```\n\n**Insert data into the rule engine**\n\nInsert two rows with `sym = 1`. These rows will be checked using the rule corresponding to `key = 1` in the rule set, namely `value > 1`.\n\n```\ntest.append!(table(1 as sym, 0 as value, 2 as price, 3 as quantity))\ntest.append!(table(1 as sym, 2 as value, 2 as price, 3 as quantity))\n```\n\nInsert three rows with `sym = 2`. These rows will be checked using the rules corresponding to `key = 2` in the rule set, namely `price < 2` and `price > 6`.\n\n```\ntest.append!(table(2 as sym, 2 as value, 0 as price, 3 as quantity))\ntest.append!(table(2 as sym, 2 as value, 4 as price, 3 as quantity))\ntest.append!(table(2 as sym, 2 as value, 8 as price, 3 as quantity))\n```\n\nInsert two rows with `sym = 3`. Since the rule set only contains rules for keys 1 and 2, these rows will be checked using the rule with `key = NULL` in the rule set, namely `value * price > 10`.\n\n```\ntest.append!(table(3 as sym, 2 as value, 3 as price, 3 as quantity))\ntest.append!(table(3 as sym, 2 as value, 6 as price, 3 as quantity))\n```\n\nView data in the outputTable.\n\n```\nselect * from outputTable\n```\n\n| sym | value | price | rule           |\n| --- | ----- | ----- | -------------- |\n| 1   | 0     | 2     | \\[false]       |\n| 1   | 2     | 2     | \\[true]        |\n| 2   | 2     | 0     | \\[true,false]  |\n| 2   | 2     | 4     | \\[false,false] |\n| 2   | 2     | 8     | \\[false,true]  |\n| 3   | 2     | 3     | \\[false]       |\n| 3   | 2     | 6     | \\[true]        |\n\nAfter processing by the callback function, all rows whose first check result is `false` have been written to the DFS table `dfs://temp/pt`.\n\n```\nselect * from loadTable(\"dfs://temp\",\"pt\")\n```\n\n| sym | value | price |\n| --- | ----- | ----- |\n| 1   | 0     | 2     |\n| 2   | 2     | 4     |\n| 2   | 2     | 8     |\n| 3   | 2     | 3     |\n\nRelated functions: [updateRule](https://docs.dolphindb.com/en/Functions/u/updateRule.html), [deleteRule](https://docs.dolphindb.com/en/Functions/d/deleteRule.html), [getRules](https://docs.dolphindb.com/en/Functions/g/getRules.html)\n"
    },
    "createSchema": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createSchema.html",
        "signatures": [
            {
                "full": "createSchema(catalog, dbUrl, schema)",
                "name": "createSchema",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    },
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    },
                    {
                        "full": "schema",
                        "name": "schema"
                    }
                ]
            }
        ],
        "markdown": "### [createSchema](https://docs.dolphindb.com/en/Functions/c/createSchema.html)\n\n#### Syntax\n\ncreateSchema(catalog, dbUrl, schema)\n\n#### Details\n\nAdd a database to a catalog. Note that a database can only be added to one catalog.\n\nThe *dbUrl*of a database is unique globally, while the schemas under difference catalogs can share the same names. When adding a database to a catalog, a schema name must be specified. Operations on this schema must use this name instead of *dbUrl*.\n\n#### Parameters\n\n**catalog**is a string specifying the catalog name.\n\n**dbUrl** is a string indicating the database URL.\n\n**schema** is a string indicating the schema name.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ncreateSchema(\"catalog1\", \"dfs://db1\", \"schema1\")\n```\n\n"
    },
    "createSessionWindowEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createSessionWindowEngine.html",
        "signatures": [
            {
                "full": "createSessionWindowEngine(name, sessionGap, metrics, dummyTable, outputTable, [timeColumn], [useSystemTime=false], [keyColumn], [updateTime], [useSessionStartTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup], [forceTriggerTime])",
                "name": "createSessionWindowEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "sessionGap",
                        "name": "sessionGap"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useSessionStartTime=true]",
                        "name": "useSessionStartTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createSessionWindowEngine](https://docs.dolphindb.com/en/Functions/c/createSessionWindowEngine.html)\n\n\n\n#### Syntax\n\ncreateSessionWindowEngine(name, sessionGap, metrics, dummyTable, outputTable, \\[timeColumn], \\[useSystemTime=false], \\[keyColumn], \\[updateTime], \\[useSessionStartTime=true], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[raftGroup], \\[forceTriggerTime])\n\n#### Details\n\nThis function creates a session window streaming engine. The session window engine shares most of its parameters with the time-series engine ([createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)), but includes two unique parameters: *sessionGap* and *useSessionStartTime*.\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\nStarting from version 2.00.11, array vectors are allowed in *dummyTable*and *outputTable*, but they cannot be involved in calculations specified in *metrics*.\n\n#### Calculation Rules\n\nWhen records are ingested into a session window, the window remains open until a specified period of inactivity passes (specified by *sessionGap*). The window end is equal to the timestamp of the last received record + the *sessionGap* interval. The calculation of this window is triggered by the arrival of the next record after the window ends.\n\n**Note:** If the system time when data is input into the engine is not used as the time column for computation, the timestamps indicated by *timeColumn* in the input stream table must be non-decreasing. If a grouping column (*keyColumn*) is also specified, the timestamps within each group must be non-decreasing. Otherwise, out-of-order data will be discarded and not included in the computation.\n\n#### Parameters\n\nAs most of the parameters of `createSessionWindowEngine` are identical with those of [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html), we only explain the following parameters of `createSessionWindowEngine` that are different from those of `createTimeSeriesEngine`.\n\n**sessionGap** a positive integer indicating the gap between 2 session windows. Its unit is determined by the parameter *useSystemTime*.\n\n**useSessionStartTime** (optional) is a Boolean value. Defaults to true indicating whether the first column in *outputTable* is the starting time of the windows, i.e., the timestamp of the first record in each window. Setting it to false means the timestamps in the output table are the ending time of the windows, i.e., timestamp of the last record in window + *sessionGap*. If *updateTime* is specified, *useSessionStartTime* must be true.\n\n**forceTriggerTime** (optional) is a non-negative integer. Its unit is the same as the time precision of *timeColumn*. *forceTriggerTime* indicates the waiting time to force trigger calculation in uncalculated windows for each group.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n**Example 1.** The following example creates a session window engine using the `createSessionWindowEngine` with *sessionGap*=5 ms, performing window partitioning based on continuous trading activity periods rather than fixed time periods (unlike time series engine).\n\nThe engine identifies each stock's trading activity period: when a stock has no new trading data within 5ms, the window ends and outputs the total trading volume within that window.\n\n```\nshare streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\nengine_sw = createSessionWindowEngine(name = \"engine_sw\", sessionGap = 5, metrics = <sum(volume)>, dummyTable = trades, outputTable = output1, timeColumn = `time, keyColumn=`sym)\nsubscribeTable(tableName=\"trades\", actionName=\"append_engine_sw\", offset=0, handler=append!{engine_sw}, msgAsTable=true)\n\nn = 5\ntimev = 2018.10.12T10:01:00.000 + (1..n)\nsymv=take(`A`B`C,n)\nvolumev = (1..n)%1000\ninsert into trades values(timev, symv, volumev)\n\nn = 5\ntimev = 2018.10.12T10:01:00.010 + (1..n)\nvolumev = (1..n)%1000\nsymv=take(`A`B`C,n)\ninsert into trades values(timev, symv, volumev)\n\nn = 6\ntimev = 2018.10.12T10:01:00.020 + 1 2 3 8 14 20\nvolumev = (1..n)%1000\nsymv=take(`A`B`C,n)\ninsert into trades values(timev, symv, volumev)\n\nselect * from output1;\n```\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.12T10:01:00.001 | A   | 5         |\n| 2018.10.12T10:01:00.002 | B   | 7         |\n| 2018.10.12T10:01:00.003 | C   | 3         |\n| 2018.10.12T10:01:00.011 | A   | 5         |\n| 2018.10.12T10:01:00.012 | B   | 7         |\n| 2018.10.12T10:01:00.013 | C   | 3         |\n| 2018.10.12T10:01:00.021 | A   | 1         |\n| 2018.10.12T10:01:00.022 | B   | 2         |\n| 2018.10.12T10:01:00.023 | C   | 3         |\n\n**Example 2.** Force trigger uncalculated window calculations by specifying *forceTriggerTime*.\n\nDrop the engine with the following script:\n\n```\ndropStreamEngine(`engine_sw)\nunsubscribeTable(, tableName=\"trades\", actionName=\"append_engine_sw\")\n```\n\nRecreate the session engine, and this time specify *forceTriggerTime* as 1000ms, which means that after the engine receives the last data, it will trigger calculation and output of all grouped data after 1000ms:\n\n```\nshare streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\nengine_sw = createSessionWindowEngine(name = \"engine_sw\", sessionGap = 5, metrics = <sum(volume)>, dummyTable = trades, outputTable = output1, timeColumn = `time, keyColumn=`sym, forceTriggerTime=1000)\nsubscribeTable(tableName=\"trades\", actionName=\"append_engine_sw\", offset=0, handler=append!{engine_sw}, msgAsTable=true)\n\nn = 5\ntimev = 2018.10.12T10:01:00.000 + (1..n)\nsymv=take(`A`B`C,n)\nvolumev = (1..n)%1000\ninsert into trades values(timev, symv, volumev)\n\nn = 5\ntimev = 2018.10.12T10:01:00.010 + (1..n)\nvolumev = (1..n)%1000\nsymv=take(`A`B`C,n)\ninsert into trades values(timev, symv, volumev)\n\nn = 6\ntimev = 2018.10.12T10:01:00.020 + 1 2 3 8 14 20\nvolumev = (1..n)%1000\nsymv=take(`A`B`C,n)\ninsert into trades values(timev, symv, volumev)\n\nsleep(1100)\nselect * from output1;\n```\n\nQuerying the output table again shows the following results, which demonstrate that setting *forceTriggerTime* to false successfully forced the calculation of the last 3 ended but uncalculated windows. While in Example 1, without setting *forceTriggerTime* and with no subsequent data to trigger calculation, these windows failed to output results:\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.12T10:01:00.001 | A   | 5         |\n| 2018.10.12T10:01:00.002 | B   | 7         |\n| 2018.10.12T10:01:00.003 | C   | 3         |\n| 2018.10.12T10:01:00.011 | A   | 5         |\n| 2018.10.12T10:01:00.012 | B   | 7         |\n| 2018.10.12T10:01:00.013 | C   | 3         |\n| 2018.10.12T10:01:00.021 | A   | 1         |\n| 2018.10.12T10:01:00.022 | B   | 2         |\n| 2018.10.12T10:01:00.023 | C   | 3         |\n| 2018.10.12T10:01:00.028 | A   | 4         |\n| 2018.10.12T10:01:00.034 | B   | 5         |\n| 2018.10.12T10:01:00.040 | C   | 6         |\n\n**Example 3.** Set *useSessionStartTime* to false to output window end time.\n\nDrop the engine with the following script:\n\n```\ndropStreamEngine(`engine_sw)\nunsubscribeTable(, tableName=\"trades\", actionName=\"append_engine_sw\")\n```\n\nRecreate the engine, and this time set *useSessionStartTime* to false, which causes the output table's time column to display each session window's end time (i.e., last data time + *sessionGap*) instead of the default window start time.\n\n```\nshare streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\nengine_sw = createSessionWindowEngine(name = \"engine_sw\", sessionGap = 5, metrics = <sum(volume)>, dummyTable = trades, outputTable = output1, timeColumn = `time, keyColumn=`sym, useSessionStartTime=false, forceTriggerTime=1000)\nsubscribeTable(tableName=\"trades\", actionName=\"append_engine_sw\", offset=0, handler=append!{engine_sw}, msgAsTable=true)\n\nn = 5\ntimev = 2018.10.12T10:01:00.000 + (1..n)\nsymv=take(`A`B`C,n)\nvolumev = (1..n)%1000\ninsert into trades values(timev, symv, volumev)\n\nn = 5\ntimev = 2018.10.12T10:01:00.010 + (1..n)\nvolumev = (1..n)%1000\nsymv=take(`A`B`C,n)\ninsert into trades values(timev, symv, volumev)\n\nn = 6\ntimev = 2018.10.12T10:01:00.020 + 1 2 3 8 14 20\nvolumev = (1..n)%1000\nsymv=take(`A`B`C,n)\ninsert into trades values(timev, symv, volumev)\n\nsleep(1100)\nselect * from output1;\n```\n\n<table id=\"table_mlh_24r_53c\"><tbody><tr><td>\n\ntime\n\n</td><td>\n\nsym\n\n</td><td>\n\nsumVolume\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.008\n\n</td><td>\n\nC\n\n</td><td>\n\n3\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.009\n\n</td><td>\n\nA\n\n</td><td>\n\n5\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.010\n\n</td><td>\n\nB\n\n</td><td>\n\n7\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.018\n\n</td><td>\n\nC\n\n</td><td>\n\n3\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.019\n\n</td><td>\n\nA\n\n</td><td>\n\n5\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.020\n\n</td><td>\n\nB\n\n</td><td>\n\n7\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.026\n\n</td><td>\n\nA\n\n</td><td>\n\n1\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.027\n\n</td><td>\n\nB\n\n</td><td>\n\n2\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.028\n\n</td><td>\n\nC\n\n</td><td>\n\n3\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.033\n\n</td><td>\n\nA\n\n</td><td>\n\n4\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.039\n\n</td><td>\n\nB\n\n</td><td>\n\n5\n\n</td></tr><tr><td>\n\n2018.10.12 10:01:00.045\n\n</td><td>\n\nC\n\n</td><td>\n\n6\n\n</td></tr></tbody>\n</table>\n"
    },
    "createSnapshotJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createSnapshotJoinEngine.html",
        "signatures": [
            {
                "full": "createSnapshotJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, [timeColumn], [outputElapsedMicroseconds=false], [keepLeftDuplicates=false], [keepRightDuplicates=false], [isInnerJoin=true], [snapshotDir], [snapshotIntervalInMsgCount])",
                "name": "createSnapshotJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keepLeftDuplicates=false]",
                        "name": "keepLeftDuplicates",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keepRightDuplicates=false]",
                        "name": "keepRightDuplicates",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[isInnerJoin=true]",
                        "name": "isInnerJoin",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createSnapshotJoinEngine](https://docs.dolphindb.com/en/Functions/c/createSnapshotJoinEngine.html)\n\n\n\n#### Syntax\n\ncreateSnapshotJoinEngine(name, leftTable, rightTable, outputTable, metrics, matchingColumn, \\[timeColumn], \\[outputElapsedMicroseconds=false], \\[keepLeftDuplicates=false], \\[keepRightDuplicates=false], \\[isInnerJoin=true], \\[snapshotDir], \\[snapshotIntervalInMsgCount])\n\n#### Details\n\nCreate a snapshot join streaming engine to receive streams through left and right tables, performing either inner or full outer joins based on the specified *matchingColumn*.\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n**Join type**: inner join or full outer join, controlled by *isInnerJoin*.\n\n**Matching behavior**: match all records or only the latest record in each group, controlled by *keepLeftDuplicates* and *keepRightDuplicates*.\n\nSnapshot join engine vs. lookup join engine:\n\n* The lookup join engine responds only to new records in the left table, supporting both inner join and left join operations.\n* Snapshot join engine responds to new records in either the left or right table, supporting both inner join and full outer join operations.\n\nSnapshot join engine vs. equi join engine:\n\n* Equi join engine joins records immediately upon finding a match. These joined records are not matched again and are removed when the garbage size limit is reached.\n* Snapshot join engine can be configured to either join only the latest records orall records in each group, while maintaining cache of joined records that can be rematched.\n\n#### Parameters\n\n**name** is a string indicating the name of the snapshot join engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**leftTable** is a table object whose schema must be the same as the input stream table.\n\n**rightTable** is a table object whose schema must be the same as the input stream table.\n\n**outputTable** is a table object to hold the calculation results. Create an empty table and specify the column names and types before calling the function.\n\nThe columns of *outputTable* are in the following order:\n\n(1) One or more columns on which the tables are joined, arranged in the same order as specified in *matchingColumn*.\n\n(2) Then followed by two time columns of left and right tables respectively. If *timeColumn* is specified, they have the same data type as *timeColumn*. If not, the data type must be TIMESTAMP.\n\n(3) Further followed by the calculation results of *metrics*.\n\n(4) If the *outputElapsedMicroseconds* is set to true, specify two more columns: a LONG column and an INT column.\n\n**metrics** is metacode (can be a tuple) specifying the calculation formulas. For more information about metacode, refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/metaprogramming.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (but not aggregate functions).\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, `<func(price) as `col1`col2>`.\n\nTo specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\n**Note:** The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\n**matchingColumn** is a STRING scalar/vector/tuple indicating the column(s) on which the tables are joined. It supports integral, temporal or literal (except UUID) types.\n\n* When there is only 1 column to match - If the names of the columns to match 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If both tables share the names of all columns to match, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**timeColumn** (optional) is a STRING scalar/vector indicating the name of the time column in the left table and the right table. The time columns must have the same data type. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**outputElapsedMicroseconds** (optional) is a Boolean value. The default value is false. It determines whether to output:\n\n* the elapsed time (in microseconds) from the ingestion of data to the output of result in each batch.\n* the total number of each batch.\n\n**keepLeftDuplicates** (optional) is a Boolean value indicating whether to match all records in each group of the left table. When set to false (default), the engine matches only the latest record in each group. When set to true, the engine matches all records in each group.\n\n**keepRightDuplicates** (optional) is a Boolean value indicating whether to match all records in each group of the right table. When set to false (default), the engine matches the latest record in each group. When set to true, the engine matches all records in each group.\n\n**isInnerJoin** (optional) is a Boolean value to determine whether an inner join or full outer join is performed.\n\n* If *isInnerJoin*=true (default), an inner join is performed. Results are only generated when matches are found between both tables.\n* If *isInnerJoin*=false, an outer join is performed. Results are generated whether or not a match is found. If there are unmatched records, entries from the other table are null padded.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1. Create a snapshot join engine that inner joins left and right tables, matching all records within each group.\n\n```\n// define the input and output tables\nshare streamTable(1:0, `timestamp`sym1`id`price`val, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as leftTable\nshare streamTable(1:0, `timestamp`sym2`id`price`qty, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as rightTable\noutput=table(100:0, [\"id\",\"sym\", \"timestamp1\", \"timestamp2\", \"factor1\", \"factor2\"], \n[INT, SYMBOL, TIMESTAMP, TIMESTAMP, DOUBLE, DOUBLE])\n\ntest_metrics = [<val*10>, <qty>]\n// create the engine\ntest_engine = createSnapshotJoinEngine(name = \"test_SJE\", leftTable=leftTable, rightTable=rightTable, \noutputTable=output, metrics=test_metrics, matchingColumn = [[\"id\",\"sym1\"],[\"id\",\"sym2\"]], \ntimeColumn = `timestamp, isInnerJoin=true, keepLeftDuplicates=true,keepRightDuplicates=true)\n\n// append data to left table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,1,2,1,5,2,4,4,1,4]\nprice = [2.53,7.61,8.07,7.87,7.29,9.39,5.98,9.49,9.20,9.17]\nval = [101,108,101,109,104,100,108,100,107,104]\nleft_data = table(timestamp as timestamp,sym as sym1,id as id,price as price,val as val)\nappendForJoin(test_engine,true, left_data)\n\n// append data to right table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,2,4,3,5,5,4,2,5,5]\nprice =  [1.08,9.08,9.97,7.60,1.91,6.77,7.81,8.81,0.61,5.92]\nqty =  [208,200,203,202,204,201,206,207,205,205]\nright_data = table(timestamp as timestamp,sym as sym2,id as id,price as price,qty as qty)\nappendForJoin(test_engine,false, right_data)\n\nselect * from output\n```\n\nYou can see from the output table that all matched records in the left table are calculated and output.\n\n| id | sym | timestamp1              | timestamp2              | factor1 | factor2 |\n| -- | --- | ----------------------- | ----------------------- | ------- | ------- |\n| 1  | a   | 2024.10.10T15:12:01.508 | 2024.10.10T15:12:01.508 | 1,010   | 208     |\n| 1  | a   | 2024.10.10T15:12:01.516 | 2024.10.10T15:12:01.508 | 1,070   | 208     |\n| 2  | b   | 2024.10.10T15:12:01.513 | 2024.10.10T15:12:01.509 | 1,000   | 200     |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.510 | 1,080   | 203     |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.512 | 1,040   | 204     |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.514 | 1,080   | 206     |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.516 | 1,040   | 205     |\n\nExample 2. Create a snapshot join engine that inner joins left and right tables, matching only the latest record within each group.\n\n```\n// drop the registered engine if you executed example 1\ndropStreamEngine(\"test_SJE\")\n\n// define the input and output tables\nshare streamTable(1:0, `timestamp`sym1`id`price`val, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as leftTable\nshare streamTable(1:0, `timestamp`sym2`id`price`qty, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as rightTable\noutput=table(100:0, [\"id\",\"sym\", \"timestamp1\", \"timestamp2\", \"factor1\", \"factor2\"], \n[INT, SYMBOL, TIMESTAMP, TIMESTAMP, DOUBLE, DOUBLE])\n\ntest_metrics = [<val*10>, <qty>]\n// create the engine\ntest_engine = createSnapshotJoinEngine(name = \"test_SJE\", leftTable=leftTable, rightTable=rightTable, \noutputTable=output, metrics=test_metrics, matchingColumn = [[\"id\",\"sym1\"],[\"id\",\"sym2\"]], \ntimeColumn = `timestamp, isInnerJoin=true, keepLeftDuplicates=false,keepRightDuplicates=true)\n\n// append data to left table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,1,2,1,5,2,4,4,1,4]\nprice = [2.53,7.61,8.07,7.87,7.29,9.39,5.98,9.49,9.20,9.17]\nval = [101,108,101,109,104,100,108,100,107,104]\nleft_data = table(timestamp as timestamp,sym as sym1,id as id,price as price,val as val)\nappendForJoin(test_engine,true, left_data)\n\n// append data to right table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,2,4,3,5,5,4,2,5,5]\nprice =  [1.08,9.08,9.97,7.60,1.91,6.77,7.81,8.81,0.61,5.92]\nqty =  [208,200,203,202,204,201,206,207,205,205]\nright_data = table(timestamp as timestamp,sym as sym2,id as id,price as price,qty as qty)\nappendForJoin(test_engine,false, right_data)\n\nselect * from output\n```\n\nYou can see from the output table that only the latest matched records in the left table are calculated and output.\n\n| id | sym | timestamp1              | timestamp2              | factor1 | factor2 |\n| -- | --- | ----------------------- | ----------------------- | ------- | ------- |\n| 1  | a   | 2024.10.10T15:12:01.516 | 2024.10.10T15:12:01.508 | 1,070   | 208     |\n| 2  | b   | 2024.10.10T15:12:01.513 | 2024.10.10T15:12:01.509 | 1,000   | 200     |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.510 | 1,080   | 203     |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.512 | 1,040   | 204     |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.514 | 1,080   | 206     |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.516 | 1,040   | 205     |\n\nExample 3. Create a snapshot join engine that full outer joins left and right tables, matching all records in the right table and only the latest record in the left table for each group.\n\n```\n// drop the registered engine if you executed examples 1 and 2\ndropStreamEngine(\"test_SJE\")\n\n// define the input and output tables\nshare streamTable(1:0, `timestamp`sym1`id`price`val, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as leftTable\nshare streamTable(1:0, `timestamp`sym2`id`price`qty, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as rightTable\noutput=table(100:0, [\"id\",\"sym\", \"timestamp1\", \"timestamp2\", \"factor1\", \"factor2\"], \n[INT, SYMBOL, TIMESTAMP, TIMESTAMP, DOUBLE, DOUBLE])\n\ntest_metrics = [<val*10>, <qty>]\n// create the engine\ntest_engine = createSnapshotJoinEngine(name = \"test_SJE\", leftTable=leftTable, rightTable=rightTable, \noutputTable=output, metrics=test_metrics, matchingColumn = [[\"id\",\"sym1\"],[\"id\",\"sym2\"]], \ntimeColumn = `timestamp, isInnerJoin=false, keepLeftDuplicates=false,keepRightDuplicates=true)\n\n// append data to left table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,1,2,1,5,2,4,4,1,4]\nprice = [2.53,7.61,8.07,7.87,7.29,9.39,5.98,9.49,9.20,9.17]\nval = [101,108,101,109,104,100,108,100,107,104]\nleft_data = table(timestamp as timestamp,sym as sym1,id as id,price as price,val as val)\nappendForJoin(test_engine,true, left_data)\n\n// append data to right table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,2,4,3,5,5,4,2,5,5]\nprice =  [1.08,9.08,9.97,7.60,1.91,6.77,7.81,8.81,0.61,5.92]\nqty =  [208,200,203,202,204,201,206,207,205,205]\nright_data = table(timestamp as timestamp,sym as sym2,id as id,price as price,qty as qty)\nappendForJoin(test_engine,false, right_data)\n\nselect * from output\n```\n\nThe output table shows that while only the latest matched records from the left table are calculated, all unmatched records are still included with null values filled in.\n\n| id | sym | timestamp1              | timestamp2              | factor1 | factor2 |\n| -- | --- | ----------------------- | ----------------------- | ------- | ------- |\n| 1  | a   | 2024.10.10T15:12:01.508 | 1,010                   |         |         |\n| 1  | b   | 2024.10.10T15:12:01.509 | 1,080                   |         |         |\n| 2  | c   | 2024.10.10T15:12:01.510 | 1,010                   |         |         |\n| 1  | d   | 2024.10.10T15:12:01.511 | 1,090                   |         |         |\n| 5  | a   | 2024.10.10T15:12:01.512 | 1,040                   |         |         |\n| 2  | b   | 2024.10.10T15:12:01.513 | 1,000                   |         |         |\n| 4  | c   | 2024.10.10T15:12:01.514 | 1,080                   |         |         |\n| 4  | d   | 2024.10.10T15:12:01.515 | 1,000                   |         |         |\n| 1  | a   | 2024.10.10T15:12:01.516 | 1,070                   |         |         |\n| 4  | b   | 2024.10.10T15:12:01.517 | 1,040                   |         |         |\n| 1  | a   | 2024.10.10T15:12:01.516 | 2024.10.10T15:12:01.508 | 1,070   | 208     |\n| 2  | b   | 2024.10.10T15:12:01.513 | 2024.10.10T15:12:01.509 | 1,000   | 200     |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.510 | 1,080   | 203     |\n| 3  | d   | 2024.10.10T15:12:01.511 | 202                     |         |         |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.512 | 1,040   | 204     |\n| 5  | b   | 2024.10.10T15:12:01.513 | 201                     |         |         |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.514 | 1,080   | 206     |\n| 2  | d   | 2024.10.10T15:12:01.515 | 207                     |         |         |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.516 | 1,040   | 205     |\n| 5  | b   | 2024.10.10T15:12:01.517 | 205                     |         |         |\n\nExample 4. Based on example 2, set *outputElapsedMicroseconds* = true to output two more columns in the output table.\n\n```\n// drop the registered engine if you executed above examples\ndropStreamEngine(\"test_SJE\")\n\n// define the input and output tables\nshare streamTable(1:0, `timestamp`sym1`id`price`val, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as leftTable\nshare streamTable(1:0, `timestamp`sym2`id`price`qty, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as rightTable\noutput=table(100:0, [\"id\",\"sym\", \"timestamp1\", \"timestamp2\", \"factor1\", \"factor2\", \"timecost\",\"batchsize\"],\n[INT, SYMBOL, TIMESTAMP, TIMESTAMP, DOUBLE, DOUBLE, LONG, INT])\n\ntest_metrics = [<val*10>, <qty>]\n// create the engine\ntest_engine = createSnapshotJoinEngine(name = \"test_SJE\", leftTable=leftTable, rightTable=rightTable, \noutputTable=output, metrics=test_metrics, matchingColumn = [[\"id\",\"sym1\"],[\"id\",\"sym2\"]],\ntimeColumn = `timestamp, outputElapsedMicroseconds=true, isInnerJoin=true,\nkeepLeftDuplicates=false,keepRightDuplicates=true)\n\n// append data to left table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,1,2,1,5,2,4,4,1,4]\nprice = [2.53,7.61,8.07,7.87,7.29,9.39,5.98,9.49,9.20,9.17]\nval = [101,108,101,109,104,100,108,100,107,104]\nleft_data = table(timestamp as timestamp,sym as sym1,id as id,price as price,val as val)\nappendForJoin(test_engine,true, left_data)\n\n// append data to right table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,2,4,3,5,5,4,2,5,5]\nprice =  [1.08,9.08,9.97,7.60,1.91,6.77,7.81,8.81,0.61,5.92]\nqty =  [208,200,203,202,204,201,206,207,205,205]\nright_data = table(timestamp as timestamp,sym as sym2,id as id,price as price,qty as qty)\nappendForJoin(test_engine,false, right_data)\n\nselect * from output\n```\n\nThe output table displays the elapsed time and total records for calculating each batch.\n\n| id | sym | timestamp1              | timestamp2              | factor1 | factor2 | timecost | batchsize |\n| -- | --- | ----------------------- | ----------------------- | ------- | ------- | -------- | --------- |\n| 1  | a   | 2024.10.10T15:12:01.516 | 2024.10.10T15:12:01.508 | 1,070   | 208     | 109      | 10        |\n| 2  | b   | 2024.10.10T15:12:01.513 | 2024.10.10T15:12:01.509 | 1,000   | 200     | 109      | 10        |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.510 | 1,080   | 203     | 109      | 10        |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.512 | 1,040   | 204     | 109      | 10        |\n| 4  | c   | 2024.10.10T15:12:01.514 | 2024.10.10T15:12:01.514 | 1,080   | 206     | 109      | 10        |\n| 5  | a   | 2024.10.10T15:12:01.512 | 2024.10.10T15:12:01.516 | 1,040   | 205     | 109      | 10        |\n\nExample 5. Set *keepRightDuplicates* = false and *keepLeftDuplicates* = false. When *timeColumn* is not specified, the time columns represent the arrival times of data to the left and right tables respectively.\n\n```\n// drop the registered engine if you executed above examples\ndropStreamEngine(\"test_SJE\")\n\n// define the input and output tables\nshare streamTable(1:0, `timestamp`sym1`id`price`val, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as leftTable\nshare streamTable(1:0, `timestamp`sym2`id`price`qty, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE]) as rightTable\noutput=table(100:0, [\"id\",\"sym\", \"timestamp1\", \"timestamp2\", \"factor1\", \"factor2\"],\n[INT, SYMBOL, TIMESTAMP, TIMESTAMP, DOUBLE, DOUBLE])\n\ntest_metrics = [<val*10>, <qty>]\n// create the engine\ntest_engine = createSnapshotJoinEngine(name = \"test_SJE\", leftTable=leftTable, rightTable=rightTable, \noutputTable=output, metrics=test_metrics, matchingColumn = [[\"id\",\"sym1\"],[\"id\",\"sym2\"]], isInnerJoin=true)\n\n// append data to left table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,1,2,1,5,2,4,4,1,4]\nprice = [2.53,7.61,8.07,7.87,7.29,9.39,5.98,9.49,9.20,9.17]\nval = [101,108,101,109,104,100,108,100,107,104]\nleft_data = table(timestamp as timestamp,sym as sym1,id as id,price as price,val as val)\nappendForJoin(test_engine,true, left_data)\n\n// append data to right table\ntimestamp = 2024.10.10T15:12:01.507+1..10\nsym = take([\"a\",\"b\",\"c\",\"d\"],10)\nid = [1,2,4,3,5,5,4,2,5,5]\nprice =  [1.08,9.08,9.97,7.60,1.91,6.77,7.81,8.81,0.61,5.92]\nqty =  [208,200,203,202,204,201,206,207,205,205]\nright_data = table(timestamp as timestamp,sym as sym2,id as id,price as price,qty as qty)\nappendForJoin(test_engine,false, right_data)\n\nselect * from output\n```\n\nYou can see from the the output table that the arrival times are output respectively.\n\n| id | sym | timestamp1              | timestamp2              | factor1 | factor2 |\n| -- | --- | ----------------------- | ----------------------- | ------- | ------- |\n| 1  | a   | 2024.12.20T15:05:49.603 | 2024.12.20T15:05:49.603 | 1,070   | 208     |\n| 2  | b   | 2024.12.20T15:05:49.603 | 2024.12.20T15:05:49.603 | 1,000   | 200     |\n| 4  | c   | 2024.12.20T15:05:49.603 | 2024.12.20T15:05:49.603 | 1,080   | 203     |\n| 5  | a   | 2024.12.20T15:05:49.603 | 2024.12.20T15:05:49.603 | 1,040   | 204     |\n| 4  | c   | 2024.12.20T15:05:49.603 | 2024.12.20T15:05:49.603 | 1,080   | 206     |\n| 5  | a   | 2024.12.20T15:05:49.603 | 2024.12.20T15:05:49.603 | 1,040   | 205     |\n"
    },
    "createSparseReactiveStateEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createSparseReactiveStateEngine.html",
        "signatures": [
            {
                "full": "createSparseReactiveStateEngine(name, metrics, dummyTable, outputTable, keyColumn, [extraColumn])",
                "name": "createSparseReactiveStateEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[extraColumn]",
                        "name": "extraColumn",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createSparseReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createSparseReactiveStateEngine.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ncreateSparseReactiveStateEngine(name, metrics, dummyTable, outputTable, keyColumn, \\[extraColumn])\n\n#### Details\n\nCreates a **SparseReactiveStateEngine** for **sparse state computation** on narrow streaming tables based on rules: state computation related to a metric (identified by *keyColumn*) is triggered only when data for that metric arrives, and the results are written to *outputTable* in a narrow-table format.\n\n* It is suitable for industrial scenarios where “rules are meaningful only for some devices/sensors”, requiring sparse computation.\n* Compared with `createReactiveStateEngine` (typically for wide-table/dense computation), this engine avoids unnecessary full metric updates.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the engine name.\n\n**metrics** is a table representing the set of sparse state computation rules. It must contain at least 3 columns: `keyColumn(s), formula, outputMetricKey`.\n\n* The first N columns are input metric identifier columns. Their count and order must match those specified by *keyColumn*. Each row provides some values of *keyColumn* in the input table (e.g., if the input table identifies metrics by `deviceID`, values can be `\"A001\"`, `\"R131\"`, etc.).\n* **formula** is a STRING scalar/vector or metacode representing the computation expression for the metric. Variable names in the expression correspond to value columns in the input table (e.g., `metricValue`; also multi-value columns such as `Value1`, `Value2`).\n* **outputMetricKey** is a STRING scalar/vector indicating the new output metric name (must be unique), e.g., `\"A001_event_B\"`.\n\n**dummyTable** is a table representing a sample table used to initialize the engine. Its schema must be identical to the subscribed streaming table. It can be an empty table or contain a small amount of data.\n\n**outputTable** is a table handle indicating the output narrow table. The engine writes computation results to this table. The required column order is: 1) input metric identifier columns (same count and order as *keyColumn*) 2) passthrough columns (same count and order as *extraColumn*, typically time columns) 3) a STRING/SYMBOL column `outputMetricKey` (output metric name) 4) a DOUBLE column `outputValue` (output metric value).\n\n**keyColumn** is a STRING scalar/vector indicating the primary key column names of the input table (used to identify “which metric/device the current row belongs to”). If *keyColumn* has N columns, *metrics* must have N corresponding leading identifier columns.\n\n**extraColumn** (optional) is a STRING scalar/vector indicating the column names in the input table that should be carried to the output table unchanged (e.g., time columns).\n\n#### Returns\n\nReturns a streaming engine handle (SparseReactiveStateEngine), which can be used to append data via `tableInsert{engine}` or `getStreamEngine(name)`.\n\n#### Examples\n\n**Example 1.** Input data contains three device IDs: A001, A002, A003.\n\nWhen data for A001 arrives, calculate the average of the data within a sliding window of length 3.\n\nWhen data for A002 arrives, calculate the difference between the maximum and minimum values within a sliding window of length 3, as well as the sum of elements in the window.\n\nNo processing is performed when data for A003 arrives.\n\nThe time column in the input data is not processed and is retained in the output table.\n\n```\n// Create the input data table (narrow table)\nshare streamTable(1:0, `timestamp`deviceID`value,\n    [TIMESTAMP, SYMBOL, DOUBLE]) as inputTable\n\n// Create the output table (narrow table)\nshare streamTable(1000:0, `deviceID`timestamp`outputMetricKey`outputValue,\n    [SYMBOL, TIMESTAMP, STRING, DOUBLE]) as outputTable\n\n// Define rules\nmetrics = table(\n    [\"A001\", \"A002\", \"A002\"] as deviceID,\n    [\n        \"mavg(value,3) \",\n        \"mmax(value,3)-mmin(value,3)\",\n        \"msum(value,3)\"\n    ] as formula,\n    [\"A001_1\", \"A002_1\", \"A002_2\"] as outputMetricKey\n)\n\n// Create the sparse reactive state engine\nstateEngine = createSparseReactiveStateEngine(\n    name=\"demoengine\",\n    metrics=metrics,\n    dummyTable=inputTable,\n    outputTable=outputTable,\n    keyColumn=\"deviceID\",\n    extraColumn=\"timestamp\"\n)\n// Subscribe to the input stream table\nsubscribeTable(tableName=\"inputTable\", actionName=\"demo1\", handler=tableInsert{stateEngine})\n// Append data\ndata = table([2026.02.07T20:29:53.927,2026.02.07T20:29:53.928,2026.02.07T20:29:53.929,2026.02.07T20:29:53.930,2026.02.07T20:29:53.931,2026.02.07T20:29:53.932,2026.02.07T20:29:53.933,2026.02.07T20:29:53.934,2026.02.07T20:29:53.935,2026.02.07T20:29:53.936,2026.02.07T20:29:53.937,2026.02.07T20:29:53.938,2026.02.07T20:29:53.939,2026.02.07T20:29:53.940,2026.02.07T20:29:53.941,2026.02.07T20:29:53.942,2026.02.07T20:29:53.943,2026.02.07T20:29:53.944,2026.02.07T20:29:53.945,2026.02.07T20:29:53.946] as time, \n    [\"A003\",\"A002\",\"A003\",\"A002\",\"A003\",\"A002\",\"A002\",\"A001\",\"A003\",\"A001\",\"A002\",\"A003\",\"A001\",\"A002\",\"A003\",\"A002\",\"A003\",\"A002\",\"A003\",\"A002\"] as deviceID, \n    [47,87,36,63,28,53,65,48,86,40,18,28,61,77,81,73,66,47,29,3] as value)\n\ninputTable.append!(data)\n// view the output\nresult = select * from outputTable\nresult\n```\n\n| deviceID | timestamp               | outputMetricKey | outputValue        |\n| -------- | ----------------------- | --------------- | ------------------ |\n| A002     | 2026.02.07 20:29:53.928 | A002\\_1         |                    |\n| A002     | 2026.02.07 20:29:53.928 | A002\\_2         |                    |\n| A002     | 2026.02.07 20:29:53.930 | A002\\_1         |                    |\n| A002     | 2026.02.07 20:29:53.930 | A002\\_2         |                    |\n| A002     | 2026.02.07 20:29:53.932 | A002\\_1         | 34                 |\n| A002     | 2026.02.07 20:29:53.932 | A002\\_2         | 203                |\n| A002     | 2026.02.07 20:29:53.933 | A002\\_1         | 12                 |\n| A002     | 2026.02.07 20:29:53.933 | A002\\_2         | 181                |\n| A001     | 2026.02.07 20:29:53.934 | A001\\_1         |                    |\n| A001     | 2026.02.07 20:29:53.936 | A001\\_1         |                    |\n| A002     | 2026.02.07 20:29:53.937 | A002\\_1         | 47                 |\n| A002     | 2026.02.07 20:29:53.937 | A002\\_2         | 136                |\n| A001     | 2026.02.07 20:29:53.939 | A001\\_1         | 49.666666666666664 |\n| A002     | 2026.02.07 20:29:53.940 | A002\\_1         | 59                 |\n| A002     | 2026.02.07 20:29:53.940 | A002\\_2         | 160                |\n| A002     | 2026.02.07 20:29:53.942 | A002\\_1         | 59                 |\n| A002     | 2026.02.07 20:29:53.942 | A002\\_2         | 168                |\n| A002     | 2026.02.07 20:29:53.944 | A002\\_1         | 30                 |\n| A002     | 2026.02.07 20:29:53.944 | A002\\_2         | 197                |\n| A002     | 2026.02.07 20:29:53.946 | A002\\_1         | 70                 |\n| A002     | 2026.02.07 20:29:53.946 | A002\\_2         | 123                |\n\n**Related functions**: [addSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/a/addSparseReactiveMetrics.html), [getSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/g/getSparseReactiveMetrics.html), [deleteSparseReactiveMetric](https://docs.dolphindb.com/en/Functions/d/deleteSparseReactiveMetric.html)\n"
    },
    "createStreamBroadcastEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createStreamBroadcastEngine.html",
        "signatures": [
            {
                "full": "createStreamBroadcastEngine(name, dummyTable, outputTables)",
                "name": "createStreamBroadcastEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTables",
                        "name": "outputTables"
                    }
                ]
            }
        ],
        "markdown": "### [createStreamBroadcastEngine](https://docs.dolphindb.com/en/Functions/c/createStreamBroadcastEngine.html)\n\n#### Syntax\n\ncreateStreamBroadcastEngine(name, dummyTable, outputTables)\n\n#### Details\n\n`createStreamBroadcastEngine` creates a stream broadcast engine that distributes the same data stream to different target tables. This function returns a table object, and by ingesting data to the table, multi-channel broadcasting of the streaming data is achieved.\n\nUse this engine when you need to process a single stream of data in multiple ways. For example, save one copy to disk while sending another copy to a computing engine for further processing.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine. It is the only identifier of an engine on a data or compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**dummyTable** is a table object whose schema must be the same as the subscribed stream table. Whether dummyTable contains data does not matter.\n\n**outputTables** is a tuple of two or more table objects (which can be in-memory tables, DFS tables, or streaming engines). The schema of each table object must be the same as *dummyTable*.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n```\nshare streamTable(1:0, `sym`price, [STRING,DOUBLE]) as tickStream\nshare streamTable(1000:0, `sym`factor1, [STRING,DOUBLE]) as resultStream\n\nt=table(100:0, `sym`price, [STRING,DOUBLE])\n\n//define the output tables: a reactive state engine and a DFS table for storing data\nrse = createReactiveStateEngine(name=\"reactiveDemo\", metrics =<cumavg(price)>, dummyTable=tickStream, outputTable=resultStream, keyColumn=\"sym\")\nif(existsDatabase(\"dfs://database1\")){\n\tdropDatabase(\"dfs://database1\")\n}\ndb=database(\"dfs://database1\", VALUE, \"A\"+string(1..10))\npt=db.createPartitionedTable(t,`pt,`sym)\n\n//create the stream broadcast engine\nbroadcastEngine=createStreamBroadcastEngine(name=\"broadcastEngine\", dummyTable=tickStream, outputTables=[loadTable(\"dfs://database1\", `pt),getStreamEngine(\"reactiveDemo\")])\n\n//subscribe to the tickStream stream table\nsubscribeTable(tableName=`tickStream, actionName=\"sub\", handler=tableInsert{broadcastEngine}, msgAsTable = true)\n\n//ingest the subscribed data into the engine\nn=100000\nsymbols=take((\"A\" + string(1..10)),n)\nprices=100+rand(1.0,n)\nt1=table(symbols as sym, prices as price)\ntickStream.append!(t1)\n\n//check the number of records in the DFS table\nselect count(*) from loadTable(\"dfs://database1\", `pt)\n// output: 100,000\n\n//check the status of the reactive state streaming engine\ngetStreamEngineStat().ReactiveStreamEngine\n```\n\n<table id=\"table_xgz_qpr_5bc\"><thead><tr><th>\n\nname\n\n</th><th>\n\nuser\n\n</th><th>\n\nstatus\n\n</th><th>\n\nlastErrMsg\n\n</th><th>\n\nnumGroups\n\n</th><th>\n\nnumRows\n\n</th><th>\n\nnumMetrics\n\n</th><th>\n\nmemoryInUsed\n\n</th><th>\n\nsnapshotDir\n\n</th><th>\n\nsnapshotInterval\n\n</th><th>\n\nsnapshotMsgId\n\n</th><th>\n\nsnapshotTimestamp\n\n</th></tr></thead><tbody><tr><td>\n\nreactiveDemo\n\n</td><td>\n\nadmin\n\n</td><td>\n\nOK\n\n</td><td>\n\n10\n\n</td><td>\n\n100,000\n\n</td><td>\n\n1\n\n</td><td>\n\n2,600\n\n</td><td>\n\n-1\n\n</td><td>\n\n \n\n</td><td>\n\n \n\n</td><td>\n\n \n\n</td><td>\n\n \n\n</td></tr></tbody>\n</table>**Parent topic:**[Functions](../../Functions/category.md)\n"
    },
    "createStreamDispatchEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createStreamDispatchEngine.html",
        "signatures": [
            {
                "full": "createStreamDispatchEngine(name, dummyTable, keyColumn, outputTable, [dispatchType='hash'], [hashByBatch=false], [outputLock=true], [queueDepth=4096], [outputElapsedTime=false], [mode='buffer'])",
                "name": "createStreamDispatchEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[dispatchType='hash']",
                        "name": "dispatchType",
                        "optional": true,
                        "default": "'hash'"
                    },
                    {
                        "full": "[hashByBatch=false]",
                        "name": "hashByBatch",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[outputLock=true]",
                        "name": "outputLock",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[queueDepth=4096]",
                        "name": "queueDepth",
                        "optional": true,
                        "default": "4096"
                    },
                    {
                        "full": "[outputElapsedTime=false]",
                        "name": "outputElapsedTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[mode='buffer']",
                        "name": "mode",
                        "optional": true,
                        "default": "'buffer'"
                    }
                ]
            }
        ],
        "markdown": "### [createStreamDispatchEngine](https://docs.dolphindb.com/en/Functions/c/createStreamDispatchEngine.html)\n\n\n\n#### Syntax\n\ncreateStreamDispatchEngine(name, dummyTable, keyColumn, outputTable, \\[dispatchType='hash'], \\[hashByBatch=false], \\[outputLock=true], \\[queueDepth=4096], \\[outputElapsedTime=false], \\[mode='buffer'])\n\n#### Details\n\n`createStreamDispatchEngine` function creates a stream dispatch engine that distributes incoming data streams to specified output tables for computational load balancing. The output tables can be in-memory tables, DFS tables, or other streaming engines. The function returns a table object.\n\nKey characteristics of the stream dispatch engine:\n\n* Supports multithreaded input and output of streams.\n\n* Used only for data dispatching, not for metrics computing.\n\nTypical usage:\n\nThe stream dispatch engine can distribute market data to one or more computational streaming engines that calculate factors. This achieves optimal performance by balancing the computational load.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine. It is the only identifier of an engine. It can contain letters, numbers and underscores but must start with a letter.\n\n**dummyTable** is a table whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter.\n\n**keyColumn** is a string. If provided, the ingested data will be distributed to output tables based on the values in this column. Unique values in *keyColumn* are treated as keys.\n\n**outputTable** is one or more tables that the engine outputs data to. When *outputElapsedTime* = false, *outputTable* must have the same schema as *dummyTable*; when *outputElapsedTime* = true, *outputTable* should have two additional columns - a LONG column and an INT column (see *outputElapsedTime*).\n\nUp to 100 tables can be specified for *outputTable*. The engine starts a thread for each output table to process the distributed data. To specify multiple output tables, pass a tuple, embedding sub-tuples if needed. For examples:\n\n* To distribute evenly to 4 tables, specify `outputTable=[table1, table2, table3, table4]`\n\n* To distribute evenly to 2 replicated table sets, specify `[[table1_1, table1_2], [table2_1, table2_2]]`. This maintains 2 replicas of the ingested data - replica 1 distributed across table1\\_1 and table1\\_2, and replica 2 distributed across table2\\_1 and table2\\_2.\n\n**dispatchType** (optional) is a string. It can be:\n\n* \"hash\" (default) - Apply a hash algorithm on *keyColumn* and distribute records based on the hash result. Hash distribution can be uneven across tables.\n\n* \"uniform\" - Evenly distribute records across output tables based on *keyColumn* values.\n\n* \"saltedHash\" - Apply a salted hash algorithm on *keyColumn* and distribute records based on the hash result. Salting ensures unique hashes even with the same input. This option is more suitable for scenarios that involve multi-level hash distribution (e.g., a dispatch engine with all nested engines using hash for data distribution).\n\nThe default \"hash\" is recommended unless data distribution is highly uneven and impacts performance. In that case, try \"uniform\".\n\n**hashByBatch** (optional) is a Boolean value. The default is false, indicating that for each batch of data ingested into the engine, group records by *keyColumn* values first, then distribute groups across tables based on *dispatchType*.\n\nTo set *hashByBatch* to true, *dispatchType* must be 'hash'. In this case, for each ingested batch of data, the engine randomly selects a key, computes its hash value, and distributes the entire batch based on the hash result.\n\nNote: Setting *hashbyBatch* = false ensures that records with identical keys are output to the same table. However, grouping records by key adds processing cost.\n\n**outputLock** (optional) is a Boolean value indicating whether to apply a lock output table(s) to prevent concurrent write conflicts. The default is true (recommended). False means not to apply lock to the output table(s).\n\nAn output table, essentially an in-memory table, does not allow concurrent writes. As threads working for other streaming engines or subscriptions may also write to the output tables, the lock ensures thread safety. However, locking comes at a performance cost. If it can be guaranteed no other threads will write to the output tables concurrently, *outputLock* can be set to false to optimize performance.\n\n**queueDepth** (optional) is a positive integer controlling the queue or buffer size for each output thread. The default is 4096 (records).\n\n* When *mode* = \"buffer\", *queueDepth* sets the size of the cache table for each thread of an output table;\n\n* When *mode* = \"queue\", *queueDepth* sets the maximum depth of each output queue.\n\nSet *queueDepth* based on the expected data volume: if the ingested amount is small, a large *queueDepth* wastes memory; if the ingested amount is large, a small *queueDepth* may cause output blocking.\n\n**outputElapsedTime** (optional) is a Boolean value indicating whether to print the elapsed time to process each ingested batch, from ingestion to output. The default is false. If *outputElapsedTime* = true, two extra columns are added to each output table: a LONG column for the time elapsed in microseconds to process each data batch internally, and an INT column for nanosecond timestamps of when each batch was output.\n\n**mode** (optional) is a string. It can be:\n\n* \"buffer\" (default) - For each thread working for an output table, the engine creates an in-memory cache table to buffer pending writes. It copies data into the cache before writing to output table. Use this mode when (1) the input source(s) may have concurrent reads/writes while ingesting data into the engine; or (2) the input source(s) frequently appends small batches of data to the engine.\n\n* \"queue\" - For each thread working for an output table, the engine maintains a queue per with references to input data. Input data is not copied, only referenced. This requires no concurrent reads/writes to the input source(s) during ingestion. This mode is best when the input source(s) infrequently append large batches of data.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n**Example 1** Distribute data of a stream table to 3 reactive state streaming engines for metric computation using the stream dispatch engine. The final results are output into one single table.\n\n```\n// define the input stream table for the stream dispatch engine\nshare streamTable(1:0, `sym`price, [STRING,DOUBLE]) as tickStream\nshare streamTable(1000:0, `sym`factor1, [STRING,DOUBLE]) as resultStream\n\n// define the output table for the reactive state engines\nfor(i in 0..2){\nrse = createReactiveStateEngine(name=\"reactiveDemo\"+string(i), metrics =<cumavg(price)>, dummyTable=tickStream, outputTable=resultStream, keyColumn=\"sym\")\n}\n// create the stream dispatch engine\ndispatchEngine=createStreamDispatchEngine(name=\"dispatchDemo\", dummyTable=tickStream, keyColumn=`sym, outputTable=[getStreamEngine(\"reactiveDemo0\"),getStreamEngine(\"reactiveDemo1\"),getStreamEngine(\"reactiveDemo2\")])\n\n// the stream dispatch engine subscribes to the stream table\nsubscribeTable(tableName=`tickStream, actionName=\"sub\", handler=tableInsert{dispatchEngine}, msgAsTable = true)\n    \n// ingest data to the stream dispatch engine\nn=100000\nsymbols=take((\"A\" + string(1..10)),n)\nprices=100+rand(1.0,n)\nt=table(symbols as sym, prices as price)\ntickStream.append!(t)\n\nselect count(*) from resultStream\n// output: 100,000\n\n// check the status of the reactive state engines\ngetStreamEngineStat().ReactiveStreamEngine\n```\n\n| name          | user  | status | lastErrMsg | numGroups | numRows | numMetrics | memoryInUsed | snapshotDir | snapshotInterval | snapshotMsgId | snapshotTimestamp |\n| ------------- | ----- | ------ | ---------- | --------- | ------- | ---------- | ------------ | ----------- | ---------------- | ------------- | ----------------- |\n| reactiveDemo2 | admin | OK     | 1          | 10,000    | 1       | 921        | -1           |             |                  |               |                   |\n| reactiveDemo1 | admin | OK     | 5          | 50,000    | 1       | 1,437      | -1           |             |                  |               |                   |\n| reactiveDemo0 | admin | OK     | 4          | 40,000    | 1       | 1,308      | -1           |             |                  |               |                   |\n\n**Example 2** Data from 30 stocks continuously streams in. To improve the throughput of factor calculation, use a streaming engine to distribute the data by stock code sym to 3 reactive state engines, and each engine independently calculates the cumavg factor.\n\n* Use hash distribution (dispatchType='hash')\n\n  ```\n  dummy = table(1:0, `sym`price, [STRING, DOUBLE])\n  // Define output tables\n  share streamTable(1000:0, `sym`factor1, [STRING, DOUBLE]) as result_hash0\n  share streamTable(1000:0, `sym`factor1, [STRING, DOUBLE]) as result_hash1\n  share streamTable(1000:0, `sym`factor1, [STRING, DOUBLE]) as result_hash2\n  // Define reactive state engines\n  for(i in 0..2) {\n      createReactiveStateEngine(name=\"rse_hash\" + string(i), metrics=<cumavg(price)>,\n          dummyTable=dummy, outputTable=objByName(\"result_hash\" + string(i)), keyColumn=\"sym\")\n  }\n  // Define the streaming engine\n  dispatchHash = createStreamDispatchEngine(name=\"dispatch_hash\", dummyTable=dummy, keyColumn=`sym,\n      outputTable=[getStreamEngine(\"rse_hash0\"), getStreamEngine(\"rse_hash1\"), getStreamEngine(\"rse_hash2\")],\n      dispatchType='hash')\n\n  // Simulate 90,000 rows of data for 30 stocks\n  n = 90000\n  t = table(take(\"A\" + string(1..30), n) as sym, (100 + rand(1.0, n)) as price)\n  dispatchHash.append!(t)\n  sleep(1000)\n\n  result_hash0.size() //27,000\n  result_hash1.size() //36,000\n  result_hash2.size() //27,000\n  ```\n\n* Use uniform distribution (dispatchType='uniform')\n\n  ```\n  dummy = table(1:0, `sym`price, [STRING, DOUBLE])\n  // Define output tables\n  share streamTable(1000:0, `sym`factor1, [STRING, DOUBLE]) as result_uniform0\n  share streamTable(1000:0, `sym`factor1, [STRING, DOUBLE]) as result_uniform1\n  share streamTable(1000:0, `sym`factor1, [STRING, DOUBLE]) as result_uniform2\n  // Define reactive state engines\n  for(i in 0..2) {\n      createReactiveStateEngine(name=\"rse_uniform\" + string(i), metrics=<cumavg(price)>,\n          dummyTable=dummy, outputTable=objByName(\"result_uniform\" + string(i)), keyColumn=\"sym\")\n  }\n  // Define the streaming engine\n  dispatchUniform = createStreamDispatchEngine(name=\"dispatch_uniform\", dummyTable=dummy, keyColumn=`sym,\n      outputTable=[getStreamEngine(\"rse_uniform0\"), getStreamEngine(\"rse_uniform1\"), getStreamEngine(\"rse_uniform2\")],\n      dispatchType='uniform')\n\n  // Simulate 90,000 rows of data for 30 stocks\n  n = 90000\n  t = table(take(\"A\" + string(1..30), n) as sym, (100 + rand(1.0, n)) as price)\n  dispatchUniform.append!(t)\n  sleep(1000)\n\n  result_uniform0.size() //30,000\n  result_uniform1.size() //30,000\n  result_uniform2.size() //30,000\n  ```\n\nIt can be seen that the row counts of the tables are more evenly distributed with uniform distribution.\n\n**Example 3** For multi-level distribution scenarios: engineA distributes to engine1 and engine2, engine1 distributes to table1\\_1 and table1\\_2, and engine2 distributes to table2\\_1 and table2\\_2. Using dispatchType='saltedHash' can effectively avoid uneven hash distribution.\n\n```\ndummy = table(1:0, `sym`price, [STRING, DOUBLE])\n// Define output tables\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as s_t1_1\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as s_t1_2\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as s_t2_1\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as s_t2_2\n// Define two levels of streaming engines\nsalt1 = createStreamDispatchEngine(name=\"salt1\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[s_t1_1, s_t1_2], dispatchType='saltedHash')\nsalt2 = createStreamDispatchEngine(name=\"salt2\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[s_t2_1, s_t2_2], dispatchType='saltedHash')\n\nsaltA = createStreamDispatchEngine(name=\"saltA\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[getStreamEngine(\"salt1\"), getStreamEngine(\"salt2\")], dispatchType='saltedHash')\n// Write data\nn = 100000\nt = table(take(\"S\" + string(1..100), n) as sym, rand(100.0, n) as price)\nhashA.append!(t)\nsaltA.append!(t)\nsleep(1000)\n\ns_t1_1.size()//27,000\ns_t1_2.size()//20,000\ns_t2_1.size()//29,000\ns_t2_2.size()//24,000\n```\n\nIf hash distribution is used, obvious uneven distribution will occur in multi-level distribution scenarios.\n\n```\ndummy = table(1:0, `sym`price, [STRING, DOUBLE])\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as h_t1_1\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as h_t1_2\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as h_t2_1\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as h_t2_2\n\nhash1 = createStreamDispatchEngine(name=\"hash1\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[h_t1_1, h_t1_2], dispatchType='hash')\nhash2 = createStreamDispatchEngine(name=\"hash2\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[h_t2_1, h_t2_2], dispatchType='hash')\n\nhashA = createStreamDispatchEngine(name=\"hashA\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[getStreamEngine(\"hash1\"), getStreamEngine(\"hash2\")], dispatchType='hash')\n\nn = 100000\nt = table(take(\"S\" + string(1..100), n) as sym, rand(100.0, n) as price)\nhashA.append!(t)\nsleep(1000)\n\nh_t1_1.size()//56,000\nh_t1_2.size()//0\nh_t2_1.size()//44,000\nh_t2_2.size()//0\n```\n\n**Example 4**hashByBatch can be used to specify whether to send the entire batch of data to the same table.\n\n```\ndummy = table(1:0, `sym`price, [STRING, DOUBLE])\n\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as out_batchOn_0\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as out_batchOn_1\n\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as out_batchOff_0\nshare streamTable(1000:0, `sym`price, [STRING, DOUBLE]) as out_batchOff_1\n\n// hashByBatch=true: all data in one batch is output to the same table\ndispatchBatchOn = createStreamDispatchEngine(name=\"dispatch_batchOn\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[out_batchOn_0, out_batchOn_1],\n    dispatchType='hash', hashByBatch=true)\n\n// hashByBatch=false: data in the same batch is grouped by key and then distributed to different tables\ndispatchBatchOff = createStreamDispatchEngine(name=\"dispatch_batchOff\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[out_batchOff_0, out_batchOff_1],\n    dispatchType='hash', hashByBatch=false)\n\n// Write data\nt = table(take(`A`B`C`D`E, 1000) as sym, rand(100.0, 1000) as price)\ndispatchBatchOn.append!(t)\ndispatchBatchOff.append!(t)\nsleep(500)\n\nout_batchOn_0.size()//0\nout_batchOn_1.size()//1,000\n\nout_batchOff_0.size()//600\nout_batchOff_1.size()//400\n```\n\nIt can be seen that when *hashByBatch* is enabled, the entire batch of data is sent to the same table; when it is disabled, both tables contain data.\n\n**Example 5** After *outputElapsedTime* is enabled, the output table records the distribution elapsed time and output timestamp.\n\n```\ndummy = table(1:0, `sym`price, [STRING, DOUBLE])\n\n// When outputElapsedTime=true, the output table must have two more columns than dummyTable: LONG (elapsed time in microseconds) + NANOTIMESTAMP (output timestamp)\nshare streamTable(1000:0, `sym`price`elapsed`ts, [STRING, DOUBLE, LONG, NANOTIMESTAMP]) as out_elapsed_0\nshare streamTable(1000:0, `sym`price`elapsed`ts, [STRING, DOUBLE, LONG, NANOTIMESTAMP]) as out_elapsed_1\n\ndispatchElapsed = createStreamDispatchEngine(name=\"dispatch_elapsed\", dummyTable=dummy, keyColumn=`sym,\n    outputTable=[out_elapsed_0, out_elapsed_1],\n    outputElapsedTime=true)\n\nt = table(take(`A`B`C, 3000) as sym, rand(100.0, 3000) as price)\ndispatchElapsed.append!(t)\nsleep(500)\n\nselect top 5 * from out_elapsed_0\n```\n\n| sym | price             | elapsed | ts                            |\n| --- | ----------------- | ------- | ----------------------------- |\n| B   | 5.156729068876414 | 81      | 2026.03.21 19:39:01.860162086 |\n| C   | 14.33727939481318 | 81      | 2026.03.21 19:39:01.860162086 |\n| B   | 56.25857125414968 | 81      | 2026.03.21 19:39:01.860162086 |\n| C   | 65.14644184269626 | 81      | 2026.03.21 19:39:01.860162086 |\n| B   | 48.80402196403686 | 81      | 2026.03.21 19:39:01.860162086 |\n"
    },
    "createStreamGraph": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createStreamGraph.html",
        "signatures": [
            {
                "full": "createStreamGraph(name)",
                "name": "createStreamGraph",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [createStreamGraph](https://docs.dolphindb.com/en/Functions/c/createStreamGraph.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ncreateStreamGraph(name)\n\n#### Details\n\nCreates a declarative stream graph. It supports the following capabilities:\n\n* **Lifecycle management**: Initialize, execute, and terminate the stream graph.\n* **Configuration**: Set parameters for subscriptions and private stream tables.\n* **Data source definition**: Define sources including persisted stream tables, high-availability stream tables, and streaming engines.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA StreamGraph object.\n\n#### Examples\n\nCreate a stream graph named “indicators”.\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\") \n```\n\n**Related functions:**[dropStreamGraph](https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html), [startStreamGraph](https://docs.dolphindb.com/en/Functions/s/startStreamGraph.html), [stopStreamGraph](https://docs.dolphindb.com/en/Functions/s/stopStreamGraph.html), [StreamGraph::dropGraph](https://docs.dolphindb.com/en/Functions/s/StreamGraph_dropGraph.html)\n"
    },
    "createTable": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createTable.html",
        "signatures": [
            {
                "full": "createDimensionTable(dbHandle, table, tableName, [compressMethods], [sortColumns|primaryKey], [keepDuplicates=ALL], [softDelete=false], [indexes]), [encryptMode='plaintext'])",
                "name": "createDimensionTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[compressMethods]",
                        "name": "compressMethods",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns|primaryKey]",
                        "name": "[sortColumns|primaryKey]"
                    },
                    {
                        "full": "[keepDuplicates=ALL]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "ALL"
                    },
                    {
                        "full": "[softDelete=false]",
                        "name": "softDelete",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[indexes])",
                        "name": "indexes",
                        "optional": true
                    },
                    {
                        "full": "[encryptMode='plaintext']",
                        "name": "encryptMode",
                        "optional": true,
                        "default": "'plaintext'"
                    }
                ]
            },
            {
                "full": "createDimensionTable(dbHandle, table, tableName, [compressMethods], [sortColumns], [keepDuplicates=ALL], [softDelete=false]), [encryptMode='plaintext'])",
                "name": "createDimensionTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[compressMethods]",
                        "name": "compressMethods",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns]",
                        "name": "sortColumns",
                        "optional": true
                    },
                    {
                        "full": "[keepDuplicates=ALL]",
                        "name": "keepDuplicates",
                        "optional": true,
                        "default": "ALL"
                    },
                    {
                        "full": "[softDelete=false])",
                        "name": "softDelete",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[encryptMode='plaintext']",
                        "name": "encryptMode",
                        "optional": true,
                        "default": "'plaintext'"
                    }
                ]
            }
        ],
        "markdown": "### [createTable](https://docs.dolphindb.com/en/Functions/c/createTable.html)\n\nAlias for [createDimensionTable](https://docs.dolphindb.com/en/Functions/c/createDimensionTable.html)\n\n\nDocumentation for the `createDimensionTable` function:\n### [createDimensionTable](https://docs.dolphindb.com/en/Functions/c/createDimensionTable.html)\n\n\n\n#### Syntax\n\ncreateDimensionTable(dbHandle, table, tableName, \\[compressMethods], \\[sortColumns|primaryKey], \\[keepDuplicates=ALL], \\[softDelete=false], \\[indexes]), \\[encryptMode='plaintext'])\n\ncreateDimensionTable(dbHandle, table, tableName, \\[compressMethods], \\[sortColumns], \\[keepDuplicates=ALL], \\[softDelete=false]), \\[encryptMode='plaintext'])\n\nAlias: createTable\n\n#### Details\n\nThis function creates an empty dimension (non-partitioned) table in a DFS database, used to store small datasets with infrequent updates. During query, all data in a dimension table will be loaded into the memory.\n\nThe system will regularly check the memory usage. When memory usage exceeds *warningMemSize*, the system will discard the least recently used (LRU) data from memory to clean up the cache. Users can also manually call command `clearCachedDatabase` to clear the cached data.\n\nLike partitioned tables, a dimension table can have multiple replicas (determined by the configuration parameter *dfsReplicationFactor*).\n\nTo enable concurrent writes, updates or deletes on a dimension table, set the configuration parameter *enableConcurrentDimensionalTableWrite* to true.\n\n#### Parameters\n\n**Note:** The parameters *sortColumns* and *keepDuplicates* take effect only in a TSDB storage engine (i.e., `database().engine` = TSDB).\n\n**dbHandle** is a DFS database handle returned by function [database](https://docs.dolphindb.com/en/Functions/d/database.html).\n\n**table** is a table object. The table schema will be used to construct the new dimension table.\n\n**tableName** is a string indicating the name of the dimension table. The table name can only consists of letters, digits or underscores (\\_), and must begin with a letter.\n\n**compressMethods** (optional) is a dictionary indicating which compression methods are used for specified columns. The keys are columns name and the values are compression methods (\"lz4\", \"delta\", \"zstd\" or \"chimp\"). If unspecified, use LZ4 compression method.\n\nNote:\n\n* The \"delta\" (delta-of-delta) compression method can be used for DECIMAL, SHORT, INT, LONG or temporal data types.The delta compression method applies delta-of-delta algorithm, which is particularly suitable for data types like SHORT, INT, LONG, and date/time data.\n* Save strings as SYMBOL type to enable compression of strings.\n* The chimp compression method can be used for DOUBLE type data with decimal parts not exceeding three digits in length.\n\n**sortColumns** (optional) is a STRING scalar/vector that specifies the column(s) used to sort the ingested data within each level file. The sort columns must be of Integral, Temporal, STRING, SYMBOL, or DECIMAL type. Note that *sortColumns* is not necessarily consistent with the partitioning column.\n\n* If multiple columns are specified for *sortColumns*, the last column must be either a temporal column or an integer column. The preceding columns are used as the sort keys and they cannot be of TIME, TIMESTAMP, NANOTIME, or NANOTIMESTAMP type.\n* If only one column is specified for *sortColumns*, the column is used as the sort key, and it can be a time column or not. If the sort column is a time column and *sortKeyMappingFunction* is specified, the sort column specified in a SQL where condition can only be compared with temporal values of the same data type.\n* It is recommended to specify frequently-queried columns for *sortColumns* and sort them in the descending order of query frequency, which ensures that frequently-used data is readily available during query processing.\n* The number of sort key entries (which are unique combinations of the values of the sort keys) may not exceed 1000 for optimal performance. This limitation prevents excessive memory usage and ensures efficient query processing.\n\n**primaryKey** (optional) is a STRING scalar/vector that specifies the primary key column(s), uniquely identifying each record in a DFS table of **the PKEY database**. For records with the same primary key, only the latest one is retained. Note that:\n\n* The primary key columns must be of Logical, Integral (excluding COMPRESSED), Temporal, STRING, SYMBOL, or DECIMAL type.\n* With more than one primary key column, a composite primary key is maintained. The composite primary key uses a Bloomfilter index by default (see the *indexes* parameter for details).\n\n**keepDuplicates** (optional) specifies how to deal with records with duplicate *sortColumns* values. It can have the following values:\n\n* ALL: keep all records;\n* LAST: only keep the last record;\n* FIRST: only keep the first record.\n\n**softDelete** (optional) determines whether to enable soft delete for TSDB databases. The default value is false. To use it, *keepDuplicates* must be set to 'LAST'. It is recommended to enable soft delete for databases where the row count is large and delete operations are infrequent.\n\n**indexes** (optional) is a dictionary with columns as keys and index types as values. Both keys and values are of STRING type. *indexes* can only be set for tables of PKEY databases.\n\n* Currently, only \"bloomfilter\" index type is available. Bloomfilter indexing excels in point queries on high-cardinality columns (e.g., ID card numbers, order numbers, foreign keys from upstreams).\n* It supports indexing on columns of the following data types: BOOL, CHAR, SHORT, INT, LONG, BLOB, STRING, DECIMAL32, DECIMAL64, DECIMAL128.\n* Composite primary keys are automatically indexed with Bloomfilter. Columns not specified in *indexes* default to ZoneMap indexing.\n\n**encryptMode** (optional, Linux only) is a STRING scalar specifying the encryption mode for IMOLTP tables. The default is no encryption (plaintext mode). Supported values (case-insensitive) include: plaintext, aes\\_128\\_ctr, aes\\_128\\_cbc, aes\\_128\\_ecb, aes\\_192\\_ctr, aes\\_192\\_cbc, aes\\_192\\_ecb, aes\\_256\\_ctr, aes\\_256\\_cbc, aes\\_256\\_ecb, sm4\\_128\\_cbc, sm4\\_128\\_ecb.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExample 1\n\n```\ndb=database(\"dfs://db1\",VALUE,1 2 3)\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nt = table(timestamp, sym, qty, price);\n\ndt=db.createDimensionTable(t,`dt).append!(t);\nselect * from dt;\n```\n\n| timestamp | sym | qty  | price  |\n| --------- | --- | ---- | ------ |\n| 09:34:07  | C   | 2200 | 49.6   |\n| 09:36:42  | MS  | 1900 | 29.46  |\n| 09:36:51  | MS  | 2100 | 29.52  |\n| 09:36:59  | MS  | 3200 | 30.02  |\n| 09:32:47  | IBM | 6800 | 174.97 |\n| 09:35:26  | IBM | 5400 | 175.23 |\n| 09:34:16  | C   | 1300 | 50.76  |\n| 09:34:26  | C   | 2500 | 50.32  |\n| 09:38:12  | C   | 8800 | 51.29  |\n\nExample 2\n\n```\ndb = database(\"dfs://demodb\", VALUE, 1..10)\nt=table(take(1, 86400) as id, 2020.01.01T00:00:00 + 0..86399 as timestamp, rand(1..100, 86400) as val)\ndt = db.createDimensionTable(t, \"dt\", {timestamp:\"delta\", val:\"delta\"})\ndt.append!(t)\n```\n\nExample 3. Create a dimension table in a TSDB database\n\n```\nif(existsDatabase(\"dfs://dbctable_createDimensionTable\")){\n    dropDatabase(\"dfs://dbctable_createDimensionTable\")\n}\ndb = database(\"dfs://dbctable_createDimensionTable\", VALUE, 1..100, , \"TSDB\")\nt1 = table(1 100 100 300 300 400 500 as id, 1..7 as v)\ndb.createDimensionTable(t1, \"dt\", , \"id\").append!(t1)\ndt=loadTable(\"dfs://dbctable_createDimensionTable\",\"dt\")\n```\n\nExample 4. Create a dimension table in a PKEY database.\n\n```\ndb = database(directory=\"dfs://PKDB\", partitionType=VALUE, partitionScheme=1..10, engine=\"PKEY\")\nschematb = table(1:0,`id1`id2`val1`val2`date1`time1,[INT,INT,INT,DECIMAL32(2),DATE,TIME])\npkt = createDimensionTable(dbHandle=db, table=schematb, tableName=\"pkt\", primaryKey=`id1`id2, indexes={\"val1\": \"bloomfilter\", \"val2\": \"bloomfilter\"})\n```\n\nRelated functions: [createPartitionedTable](https://docs.dolphindb.com/en/Functions/c/createPartitionedTable.html)\n"
    },
    "createThresholdEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createThresholdEngine.html",
        "signatures": [
            {
                "full": "createThresholdEngine(name, threshold, metrics, dummyTable, outputTable, thresholdColumn, [keyColumn], [timeColumn], [sessionBegin], [sessionEnd], [keyPurgeDaily=false], [forceTriggerSessionEndTime=0], [snapshotDir], [snapshotIntervalInMsgCount], [outputElapsedMicroseconds=false], [outputThreshold=false])",
                "name": "createThresholdEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "threshold",
                        "name": "threshold"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "thresholdColumn",
                        "name": "thresholdColumn"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[sessionBegin]",
                        "name": "sessionBegin",
                        "optional": true
                    },
                    {
                        "full": "[sessionEnd]",
                        "name": "sessionEnd",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeDaily=false]",
                        "name": "keyPurgeDaily",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[forceTriggerSessionEndTime=0]",
                        "name": "forceTriggerSessionEndTime",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[outputThreshold=false]",
                        "name": "outputThreshold",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createThresholdEngine](https://docs.dolphindb.com/en/Functions/c/createThresholdEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ncreateThresholdEngine(name, threshold, metrics, dummyTable, outputTable, thresholdColumn, \\[keyColumn], \\[timeColumn], \\[sessionBegin], \\[sessionEnd], \\[keyPurgeDaily=false], \\[forceTriggerSessionEndTime=0], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[outputElapsedMicroseconds=false], \\[outputThreshold=false])\n\n#### Details\n\nThis function creates a threshold engine to implement aggregate calculations triggered by cumulative value thresholds. Each time the cumulative value of the threshold column (*thresholdColumn*) reaches a specific threshold (*threshold*\\*n), an aggregate calculation is triggered:\n\n* If *keyColumn*is specified, the aggregate calculation will be performed independently in each group.\n* If *sessionBegin* and *sessionEnd* are specified, only data in the range \\[sessionBegin, sessionEnd] will be included in the calculation.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine. It is the only identifier of an engine on a data or compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**threshold**is a positive integer indicating the threshold step size.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter.\n\n**outputTable** is a table to which the engine inserts calculation results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\nThe output columns are in the following order:\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\n**timeColumn** (optional) is a STRING scalar or vector specifying the time column(s) of the subscribed stream table. When *useSystemTime* = false, it must be specified.\n\nNote: If *timeColumn* is a vector, it must have a date element (of DATE type) and a time element (of TIME, SECOND or NANOTIME type). In this case, the first column in *outputTable* must take the data type of concatDateTime(date, time).\n\n**sessionBegin** (optional) can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the starting time of each session. If it is a vector, it must be increasing.\n\n**sessionEnd** (optional) can be a scalar or vector of type SECOND, TIME or NANOTIME corresponding to the data type of the time column, indicating the end time of each session. Specify *sessionEnd* as 00:00:00 to indicate the beginning of the next day (i.e., 24:00:00 of the current day).\n\n**keyPurgeDaily** (optional) is a Boolean value determining if existing data groups are automatically removed when newer data of a subsequent calendar day is ingested. The default value is true. If set to false, groups of the previous calendar day are retained.\n\n**forceTriggerSessionEndTime** (optional) is a non-negative integer. The unit of *forceTriggerSessionEndTime* is consistent with the precision of *timeColumn*. It indicates the waiting time to force trigger calculation in the window containing the *sessionEnd*, if it ends without calculation. The default value is 0, indicating the calculation will not be triggered in this way.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: temporary snapshot\n  * *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n  * *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**outputElapsedMicroseconds** (optional) is a BOOLEAN value. The default value is false. It determines whether to output the elapsed time (in microseconds) from the time the calculation is triggered to the output of result for each window.\n\n**outputThreshold**(optional) is a BOOLEAN value. It determines whether to output the threshold window values and the cumulative sums of *thresholdColumn*.\n\n#### Returns\n\nA table object. Data written to this table is ingested into the engine for aggregation.\n\n#### Examples\n\n**Example 1**\n\n```\n// data preparation\nn = 1000000;\nsampleDate = 2019.11.07;\nsymbols = `600519`000001`600000`601766;\ntrade = table(take(sampleDate, n) as date, \n\t(09:30:00.000 + rand(7200000, n/2)).sort!() join (13:00:00.000 + rand(7200000, n/2)).sort!() as time, \n\trand(symbols, n) as symbol, \n\t100+cumsum(rand(0.02, n)-0.01) as price, \n\trand(1000, n) as volume)\n\n// create the dummyTable and outputTable\t\nshare(streamTable(10:0,`date`time`symbol`price`volumn,[DATE, TIME, SYMBOL, DOUBLE, DOUBLE]), `trades);\nshare(table(1:0, `timestamp`symbol`open`high`low`close, [TIMESTAMP,SYMBOL,DOUBLE,DOUBLE,DOUBLE,DOUBLE]), `outputTable);\ngo\n// create the threshold engine\nthresholdEngine = createThresholdEngine(name=\"demo\", threshold=1000000, metrics=<[first(price), max(price), min(price), last(price)]>, dummyTable=trades, outputTable=outputTable, thresholdColumn=`volumn, keyColumn=`symbol, timeColumn=[`date, `time]);\n\n// insert data\nthresholdEngine.append!(trade);\n\n// query the result\nselect * from outputTable\n```\n\nSome of results are as follows:\n\n| timestamp               | symbol | open               | high               | low                | close              |\n| ----------------------- | ------ | ------------------ | ------------------ | ------------------ | ------------------ |\n| 2019.11.07 09:31:54.986 | 000001 | 99.98404977017083  | 100.52950904161203 | 99.56823161885143  | 100.5279260600172  |\n| 2019.11.07 09:33:51.890 | 000001 | 100.51835866520182 | 100.92578917419537 | 100.49741881850642 | 100.70077057819347 |\n| 2019.11.07 09:35:48.298 | 000001 | 100.71148486480116 | 100.787968895277   | 99.84565304366406  | 100.61527177638374 |\n| 2019.11.07 09:37:49.058 | 000001 | 100.61627630640287 | 101.55438607632183 | 100.48305282644462 | 101.33690219670534 |\n| 2019.11.07 09:39:44.562 | 000001 | 101.32348716112786 | 101.55176323080435 | 100.74830873960164 | 100.77029377058614 |\n| 2019.11.07 09:41:38.118 | 000001 | 100.78262700690422 | 101.24037498458289 | 100.67253582042176 | 100.7765302780131  |\n\n**Example 2** Restrict calculations to specified trading sessions with *sessionBegin* and *sessionEnd*\n\n```\n// Prepare data\nt = table(\n    2024.01.02 2024.01.02 2024.01.02 2024.01.02 2024.01.02 as date,\n    09:20:00.000 09:31:00.000 10:15:00.000 11:35:00.000 13:05:00.000 as time,\n    `A`A`A`A`A as sym,\n    10.1 10.2 10.3 10.4 10.5 as price,\n    200 500 600 700 800 as volume\n)\n\n```\n\n| date       | time         | sym | price | volume |\n| ---------- | ------------ | --- | ----- | ------ |\n| 2024.01.02 | 09:20:00.000 | A   | 10.1  | 200    |\n| 2024.01.02 | 09:31:00.000 | A   | 10.2  | 500    |\n| 2024.01.02 | 10:15:00.000 | A   | 10.3  | 600    |\n| 2024.01.02 | 11:35:00.000 | A   | 10.4  | 700    |\n| 2024.01.02 | 13:05:00.000 | A   | 10.5  | 800    |\n\n```\n// Create dummyTable and outputTable\nshare(streamTable(10:0, `date`time`sym`price`volume, [DATE, TIME, SYMBOL, DOUBLE, DOUBLE]), `trades1)\nshare(table(10:0, `timestamp`sym`sumVol, [TIMESTAMP, SYMBOL, DOUBLE]), `outputTable1)\ngo\n// Create threshold engine\nengine = createThresholdEngine(\n    name=\"thresholdDemo1\",\n    threshold=1000,\n    metrics=<[sum(volume)]>,\n    dummyTable=trades1,\n    outputTable=outputTable1,\n    thresholdColumn=`volume,\n    keyColumn=`sym,\n    timeColumn=[`date, `time],\n    sessionBegin=09:30:00.000 13:00:00.000,\n    sessionEnd=11:30:00.000 15:00:00.000\n)\n\n// Insert data\nengine.append!(t)\n\n// Query the results\nselect * from outputTable1\n```\n\n| timestamp               | sym | sumVol |\n| ----------------------- | --- | ------ |\n| 2024.01.02 10:15:00.000 | A   | 1,100  |\n\n**Example 3** Control whether group states are cleared across trading days with *keyPurgeDaily*\n\n```\n// Prepare data\nt = table(\n    2024.01.02 2024.01.03 2024.01.03 as date,\n    14:59:00.000 09:31:00.000 09:31:01.000 as time,\n    `A`A`A as sym,\n    10.1 10.2 10.3 as price,\n    600 500 700 as volume\n)\n\n// Create dummyTable and outputTable\nshare(streamTable(10:0, `date`time`sym`price`volume, [DATE, TIME, SYMBOL, DOUBLE, DOUBLE]), `trades)\nshare(table(10:0, `timestamp`sym`sumVol, [TIMESTAMP, SYMBOL, DOUBLE]), `output1)\nshare(table(10:0, `timestamp`sym`sumVol, [TIMESTAMP, SYMBOL, DOUBLE]), `output2)\ngo\n\n// keyPurgeDaily=true: clear the previous day's group state upon receiving data of a new date\nengine1 = createThresholdEngine(\n    name=\"thresholdDemo2_true\",\n    threshold=1000,\n    metrics=<[sum(volume)]>,\n    dummyTable=trades,\n    outputTable=output1,\n    thresholdColumn=`volume,\n    keyColumn=`sym,\n    timeColumn=[`date, `time],\n    keyPurgeDaily=true\n)\n\n// keyPurgeDaily=false: keep the previous day's group state upon receiving data of a new date\nengine2 = createThresholdEngine(\n    name=\"thresholdDemo2_false\",\n    threshold=1000,\n    metrics=<[sum(volume)]>,\n    dummyTable=trades,\n    outputTable=output2,\n    thresholdColumn=`volume,\n    keyColumn=`sym,\n    timeColumn=[`date, `time],\n    keyPurgeDaily=false\n)\n\n// Insert data\nengine1.append!(t)\nengine2.append!(t)\n\n// Query the results\nselect * from output1\n```\n\n| timestamp               | sym | sumVol |\n| ----------------------- | --- | ------ |\n| 2024.01.02 14:59:00.000 | A   | 600    |\n| 2024.01.03 09:31:01.000 | A   | 1,200  |\n\n```\nselect * from output2\n```\n\n| timestamp               | sym | sumVol |\n| ----------------------- | --- | ------ |\n| 2024.01.03 09:31:00.000 | A   | 1,100  |\n\n**Example 4** Output the elapsed time of each calculation with *outputElapsedMicroseconds*\n\n```\n// Prepare data\nt = table(\n    2024.01.02 2024.01.02 2024.01.02 as date,\n    09:31:00.000 09:32:00.000 09:33:00.000 as time,\n    `A`A`A as sym,\n    10.1 10.2 10.3 as price,\n    300 400 500 as volume\n)\n\n// Create dummyTable and outputTable\n\nshare(streamTable(10:0, `date`time`sym`price`volume, [DATE, TIME, SYMBOL, DOUBLE, DOUBLE]), `trades)\nshare(table(10:0, `timestamp`sym`elapsed`avgPrice`sumVol, [TIMESTAMP, SYMBOL, LONG, DOUBLE, DOUBLE]), `outputTable)\ngo\n// Create threshold engine\nengine = createThresholdEngine(\n    name=\"thresholdDemo4\",\n    threshold=1000,\n    metrics=<[avg(price), sum(volume)]>,\n    dummyTable=trades,\n    outputTable=outputTable,\n    thresholdColumn=`volume,\n    keyColumn=`sym,\n    timeColumn=[`date, `time],\n    outputElapsedMicroseconds=true\n)\n\n// Insert data\nengine.append!(t)\n\n// Query the results\nselect * from outputTable\n```\n\n| timestamp               | sym | elapsed | avgPrice | sumVol |\n| ----------------------- | --- | ------- | -------- | ------ |\n| 2024.01.02 09:33:00.000 | A   | 1       | 10.2     | 1,200  |\n\n**Example 5** Output the threshold window value and cumulative thresholdColumn with *outputThreshold*\n\n```\n// Prepare data\nt = table(\n    2024.01.02 2024.01.02 2024.01.02 as date,\n    09:31:00.000 09:32:00.000 09:33:00.000 as time,\n    `A`A`A as sym,\n    10.1 10.2 10.3 as price,\n    300 400 500 as volume\n)\n\n// Create dummyTable and outputTable\nshare(streamTable(10:0, `date`time`sym`price`volume, [DATE, TIME, SYMBOL, DOUBLE, DOUBLE]), `trades)\nshare(table(10:0, `timestamp`sym`thresholdValue`cumThreshold`lastPrice, [TIMESTAMP, SYMBOL, LONG, DOUBLE, DOUBLE]), `outputTable)\ngo\n\n// Create threshold engine\nengine = createThresholdEngine(\n    name=\"thresholdDemo5\",\n    threshold=1000,\n    metrics=<[last(price)]>,\n    dummyTable=trades,\n    outputTable=outputTable,\n    thresholdColumn=`volume,\n    keyColumn=`sym,\n    timeColumn=[`date, `time],\n    outputThreshold=true\n)\n\n// Insert data\nengine.append!(t)\n\n// Query the results\nselect * from outputTable\n```\n\n| timestamp               | sym | thresholdValue | cumThreshold | lastPrice |\n| ----------------------- | --- | -------------- | ------------ | --------- |\n| 2024.01.02 09:33:00.000 | A   | 1,000          | 1,200        | 10.3      |\n"
    },
    "createTimeBucketEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createTimeBucketEngine.html",
        "signatures": [
            {
                "full": "createTimeBucketEngine(name,timeCutPoints,metrics,dummyTable,outputTable,timeColumn,[keyColumn],[useWindowStartTime],[closed='left'],[fill='none'],[keyPurgeFreqInSec=-1],[outputElapsedMicroseconds=false],[parallelism=1],[outputHandler],[msgAsTable=false],[snapshotDir],[snapshotIntervalInMsgCount])",
                "name": "createTimeBucketEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "timeCutPoints",
                        "name": "timeCutPoints"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime]",
                        "name": "useWindowStartTime",
                        "optional": true
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[keyPurgeFreqInSec=-1]",
                        "name": "keyPurgeFreqInSec",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[outputHandler]",
                        "name": "outputHandler",
                        "optional": true
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createTimeBucketEngine](https://docs.dolphindb.com/en/Functions/c/createTimeBucketEngine.html)\n\n\n\n#### Syntax\n\ncreateTimeBucketEngine(name,timeCutPoints,metrics,dummyTable,outputTable,timeColumn,\\[keyColumn],\\[useWindowStartTime],\\[closed='left'],\\[fill='none'],\\[keyPurgeFreqInSec=-1],\\[outputElapsedMicroseconds=false],\\[parallelism=1],\\[outputHandler],\\[msgAsTable=false],\\[snapshotDir],\\[snapshotIntervalInMsgCount])\n\n#### Details\n\nCreates a time-series aggregation engine that processes data in custom time windows. The engine segments incoming data by timestamp into equal or variable-length windows, and performs incremental calculations within each window. It is typically used downstream of time-series engine ([createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)) to process second or minute-level aggregation results (like OHLC bars).\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n##### Windowing Logic\n\n* Window boundaries: Defined by adjacent elements in the *timeCutPoints* vector.\n* Boundary types: Controlled by the *closed*parameter. Can be left-closed, right-open or left-open, right-closed.\n* Window triggering conditions:\n  * Left-open windows close upon receiving a record with timestamp ≥ right boundary\n  * Right-open windows close upon receiving a record with timestamp ≥ (right boundary - 1 ), where \"1\" represents one unit at the timestamp's precision level. For example, window \\[09:00, 09:05) closes at timestamp ≥ 09:04.\n* Output timestamps: Precision matches *timeColumn*. If *useWindowStartTime*=true, uses window start time; otherwise uses window end time.\n\n##### Calculation Rules\n\n* Time range: Processes records between the first and last elements of *timeCutPoints*. The time range precision matches *timeCutPoints*. For example, with *timeCutPoints*=\\[09:00m, 09:05m], *closed*=left (left-closed-right-open):\n  * window includes: 09:00m ≤ timestamps ≤ 09:04m\n  * window excludes: timestamps > 09:04m (e.g., 09:04:00.100)\n* Grouping:\n  * With *keyColumn*: Groups calculations by *keyColumn*\n  * Without *keyColumn*: Performs global calculations\n* Result Filling: If *fill* is unspecified or \"None\", only windows with calculation results are output. If *fill* is specified, all windows are output, and the empty windows are filled using the specified filling method.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine. It is the only identifier of an engine on a data or compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**timeCutPoints** is a vector of MINUTE or SECOND type defining window boundaries. Each adjacent pair of elements forms a window. Note:\n\n* Must contain no null values.\n* The timestamp precision of *timeCutPoints* must be equal to or coarser than the precision of *timeColumn*.\n* Its precision determines the exact window boundary behavior. For example, minute-precision window \\[09:00, 09:05) excludes data ≥ 09:04:00; second-precision window \\[09:00:00, 09:05:00) excludes data ≥ 09:04:59.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter.\n\n**outputTable** is a table to which the engine inserts calculation results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\nThe output columns are in the following order:\n\n(1) The first column must be a time column.\n\n* When *timeColumn* is a scalar, the data type of the time column is the same as that of *timeColumn*.\n* When *timeColumn* is a vector, the time column’s data type is determined by applying the `concatDateTime` function to the date and time columns specified in *timeColumn*.\n\n(2) If *keyColumn* is specified, the subsequent column(s) must be in the same order as that specified by *keyColumn*.\n\n(3) If *outputElapsedMicroseconds* is set to true, you need to specify a column of LONG type. See the *outputElapsedMicroseconds* parameter for details.\n\n(4) Then followed by one or more result columns.\n\n**timeColumn** is a STRING scalar or vector specifying the time column(s) of the subscribed stream table.\n\nNote: If *timeColumn* is a vector, it must have a date element (of DATE type) and a time element (of TIME, SECOND or NANOTIME type). In this case, the first column in *outputTable* must take the data type of concatDateTime(date, time).\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\n**useWindowStartTime** (optional) is a Boolean value indicating whether the time column in *outputTable* is the starting time of the windows. The default value is false, which means the timestamps in the output table are the end time of the windows.\n\n**closed** (optional) is a STRING indicating whether the left or the right boundary is included.\n\n* closed = 'left': left-closed, right-open\n* closed = 'right': left-open, right-closed\n\n**fill** (optional) is a vector/scalar indicating the filling method to deal with an empty window (in a group). It can be:\n\n* 'none': no result\n* 'null': output a null value.\n* 'ffill': output the result in the last window.\n* specific value: output the specified value. Its type should be the same as metrics output's type.\n\n*fill* could be a vector to specify different filling method for each metric. The size of the vector must be consistent with the number of elements specified in *metrics*. The element in vector cannot be 'none'.\n\n**keyPurgeFreqInSec** (optional) 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.\n\nNote: To specify this parameter, parameter *keyColumn* must be specified and parameter *fill* cannot be specified.\n\n**outputElapsedMicroseconds** (optional) is a BOOLEAN value. The default value is false. It determines whether to output the elapsed time (in microseconds) from the time the calculation is triggered to the output of result for each window.\n\n**parallelism** (optional) is a positive integer no greater than 63, representing the number of worker threads for parallel computation. The default value is 1. For compute-intensive workloads, adjusting this parameter appropriately can effectively utilize computing resources and reduce computation time. It is recommended to set a value less than the number of CPU cores, normally from 4 to 8.\n\n**outputHandler** (optional) is a unary function or a partial function with a single unfixed parameter. If set, the engine will not write the calculation results to the output table directly. Instead, the results will be passed as a parameter to the *outputHandler* function.\n\n**msgAsTable** (optional) is a Boolean scalar indicating whether the output data is passed into function (specified by *outputHandler*) as a table or as a tuple. If *msgAsTable*=true, the subscribed data is passed into function as a table. The default value is false, which means the output data is passed into function as a tuple of columns.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n#### Returns\n\nA table object. Ingest data into the table for engine processing.\n\n#### Examples\n\nUse `createTimeSeriesEngine` to calculate 1-minute OHLC. Then use `createTimeBucketEngine` to downsample the result to 5-minute intervals. When the windows are set to left-closed, right-open, the time bucket engine is faster than the time-series engine for the downsampling, because it triggers window calculations one minute earlier.\n\n```\nshare streamTable(1000:0, `time`sym`price`volume, [TIMESTAMP, SYMBOL, DOUBLE, INT]) as trades\nshare streamTable(10000:0, `time`sym`firstPrice`maxPrice`minPrice`lastPrice`sumVolume, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE, DOUBLE, INT]) as output1\ntimeSeries1 = createTimeSeriesEngine(name=\"timeSeries1\", windowSize=60000, step=60000, metrics=<[first(price), max(price), min(price), last(price), sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, useWindowStartTime=false)\nsubscribeTable(tableName=\"trades\", actionName=\"timeSeries1\", offset=0, handler=append!{timeSeries1}, msgAsTable=true);\n\n// define the output table and windows of time bucket engine\nshare streamTable(10000:0, `time`sym`firstPrice`maxPrice`minPrice`lastPrice`sumVolume, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE, DOUBLE, INT]) as output2\ntimeCutPoints=[10:00m, 10:05m, 10:10m, 10:15m]\n\ntimeBucket1 = createTimeBucketEngine(name=\"timeBucket1\", timeCutPoints=timeCutPoints, metrics=<[first(firstPrice), max(maxPrice), min(minPrice), last(lastPrice), sum(sumVolume)]>, dummyTable=output1, outputTable=output2, timeColumn=`time,  keyColumn=`sym)\nsubscribeTable(tableName=\"output1\", actionName=\"timeBucket1\", offset=0, handler=append!{timeBucket1}, msgAsTable=true);\n\n\ninsert into trades values(2024.10.08T10:01:01.785,`A, 10.83, 2110)\ninsert into trades values(2024.10.08T10:01:02.125,`B,21.73, 1600)\ninsert into trades values(2024.10.08T10:01:12.457,`A,10.79, 2850)\ninsert into trades values(2024.10.08T10:03:10.789,`A,11.81, 2250)\ninsert into trades values(2024.10.08T10:03:12.005,`B, 22.96, 1980)\ninsert into trades values(2024.10.08T10:08:02.236,`A, 11.25, 2400)\ninsert into trades values(2024.10.08T10:08:04.412,`B, 23.03, 2130)\ninsert into trades values(2024.10.08T10:08:05.152,`B, 23.18, 1900)\ninsert into trades values(2024.10.08T10:08:30.021,`A, 11.04, 2300)\ninsert into trades values(2024.10.08T10:10:20.123,`A, 11.85, 2200)\ninsert into trades values(2024.10.08T10:11:02.236,`A, 11.06, 2200)\ninsert into trades values(2024.10.08T10:13:04.412,`B, 23.15, 1880)\ninsert into trades values(2024.10.08T10:15:12.005,`B, 22.06, 2100)\n\nsleep(10)\n\n// check 1-min OHLC prices\nselect * from output1;\n\n```\n\n| time                    | sym | firstPrice | maxPrice | minPrice | lastPrice | sumVolume |\n| ----------------------- | --- | ---------- | -------- | -------- | --------- | --------- |\n| 2024.10.08T10:02:00.000 | A   | 10.83      | 10.83    | 10.79    | 10.79     | 4,960     |\n| 2024.10.08T10:02:00.000 | B   | 21.73      | 21.73    | 21.73    | 21.73     | 1,600     |\n| 2024.10.08T10:04:00.000 | A   | 11.81      | 11.81    | 11.81    | 11.81     | 2,250     |\n| 2024.10.08T10:04:00.000 | B   | 22.96      | 22.96    | 22.96    | 22.96     | 1,980     |\n| 2024.10.08T10:09:00.000 | A   | 11.25      | 11.25    | 11.04    | 11.04     | 4,700     |\n| 2024.10.08T10:09:00.000 | B   | 23.03      | 23.18    | 23.03    | 23.18     | 4,030     |\n| 2024.10.08T10:11:00.000 | A   | 11.85      | 11.85    | 11.85    | 11.85     | 2,200     |\n| 2024.10.08T10:14:00.000 | B   | 23.15      | 23.15    | 23.15    | 23.15     | 1,880     |\n\nCheck the 5-min OHLC prices:\n\n```\nselect * from output2;\n```\n\n| time                    | sym | firstPrice | maxPrice | minPrice | lastPrice | sumVolume |\n| ----------------------- | --- | ---------- | -------- | -------- | --------- | --------- |\n| 2024.10.08T10:05:00.000 | A   | 10.83      | 11.81    | 10.79    | 11.81     | 7,210     |\n| 2024.10.08T10:05:00.000 | B   | 21.73      | 22.96    | 21.73    | 22.96     | 3,580     |\n| 2024.10.08T10:10:00.000 | A   | 11.25      | 11.25    | 11.04    | 11.04     | 4,700     |\n| 2024.10.08T10:10:00.000 | B   | 23.03      | 23.18    | 23.03    | 23.18     | 4,030     |\n| 2024.10.08T10:15:00.000 | B   | 23.15      | 23.15    | 23.15    | 23.15     | 1,880     |\n"
    },
    "createTimeSeriesAggregator": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createTimeSeriesAggregator.html",
        "signatures": [
            {
                "full": "createTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, [timeColumn], [useSystemTime=false], [keyColumn], [garbageSize], [updateTime], [useWindowStartTime], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [fill='none'], [forceTriggerTime], [raftGroup], [keyPurgeFreqInSec=-1], [closed='left'], [outputElapsedMicroseconds=false], [subWindow], [parallelism=1], [acceptedDelay=0], [outputHandler], [msgAsTable=false])",
                "name": "createTimeSeriesEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "windowSize",
                        "name": "windowSize"
                    },
                    {
                        "full": "step",
                        "name": "step"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime]",
                        "name": "useWindowStartTime",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSec=-1]",
                        "name": "keyPurgeFreqInSec",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[subWindow]",
                        "name": "subWindow",
                        "optional": true
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[acceptedDelay=0]",
                        "name": "acceptedDelay",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[outputHandler]",
                        "name": "outputHandler",
                        "optional": true
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createTimeSeriesAggregator](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesAggregator.html)\n\nAlias for [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)\n\n\nDocumentation for the `createTimeSeriesEngine` function:\n### [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)\n\n\n\n#### Syntax\n\ncreateTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, \\[timeColumn], \\[useSystemTime=false], \\[keyColumn], \\[garbageSize], \\[updateTime], \\[useWindowStartTime], \\[roundTime=true], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[fill='none'], \\[forceTriggerTime], \\[raftGroup], \\[keyPurgeFreqInSec=-1], \\[closed='left'], \\[outputElapsedMicroseconds=false], \\[subWindow], \\[parallelism=1], \\[acceptedDelay=0], \\[outputHandler], \\[msgAsTable=false])\n\nAlias: createTimeSeriesAggregator\n\n#### Details\n\nThis function creates a time-series streaming engine to conduct real-time time-series calculations with moving windows, and returns a table object where data is ingested for window calculations.\n\nThere are two types of aggregate operators in the time-series engine: incremental operators and full operators. Incremental operators incrementally aggregate the data as they arrive without keeping the historical data. Full operators (e.g., user-defined aggregate functions, unoptimized built-in aggregate functions, or functions with nested state functions) keep all the data in a window and recompute the output as a full refresh whenever new data arrives.\n\nThe following aggregate operators in the time-series engine are optimized for incremental computations: corr, covar, first, last, max, med, min, percentile, quantile, std, var, sum, sum2, sum3, sum4, wavg, wsum, count, firstNot, ifirstNot, lastNot, ilastNot, imax, imin, nunique, prod, sem, mode, searchK, beta, avg, covarp.\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n##### Windowing logic\n\nWindow boundaries: The engine automatically adjusts the starting point of the first window. (see parameter description for *step* and *roundTime*, and [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html#alignment-rules)).\n\nWindow properties:\n\n* *windowSize* - the size of each window;\n* *closed* - whether the left/right boundaries of a window is inclusive/exclusive;\n* *step* - the duration of time between windows;\n* *useSystemTime* specifies how values are windowed - based on the time column in the data or the system time of data ingestion.\n\n##### Calculation Rules\n\n* Processing rules for out-of-order data:\n  * If *timeColumn* is specified, its values must be non-decreasing. If *keyColumn* is specified to group the data, the values in *timeColumn* must be non-decreasing with each group specified by *keyColumn*. Otherwise, out-of-order data will be discarded.\n  * If you want to receive out-of-order data within a specific range, you can set *acceptedDelay*. For details, refer to the description of the *acceptedDelay* parameter.\n* If *useSystemTime* = true, the calculation of a window is triggered as soon as the window ends. If *useSystemTime* = false (with *timeColumn* specified), the calculation of a window is triggered by the arrival of the next record after the window ends. To trigger the calculation for the uncalculated windows, you can specify the parameter *updateTime* or *forceTriggerTime*.\n* If *fill* is unspecified or \"None\", only windows with calculation results are output. If *fill* is specified, all windows are output, and the empty windows are filled using the specified filling method.\n* Since version 2.00.11, if *updateTime* = 0, incoming records in the current window can be immediately calculated and output.\n\n##### Other Features\n\n* Data/state cleanup: You can set a cleanup rule to clear historical data. (See parameters *garbageSize* and *keyPurgeFreqInSec*)\n\n* Snapshot: Snapshot mechanism is used to restore the streaming engine to the latest snapshot after system interruption. (See parameters *snapshotDir* and *snapshotIntervalInMsgCount*)\n\n* High availability: To enable high availability for streaming engines, specify the parameter *raftGroup* on the leader of the raft group on the subscriber. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine. It is the only identifier of an engine on a data or compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**windowSize** is a scalar or vector with positive integers that specifies the size of the windows for calculation.\n\n**step** is a positive integer indicating how much each window moves forward relative to the previous one. Note that step must be divisible by *windowSize*, otherwise an exception will be thrown.\n\nThe unit of *windowSize* and *step* are determined by the value of *useSystemTime*.\n\n* If *useSystemTime* =true, the unit of *windowSize* and *step* is millisecond.\n* If *useSystemTime* =false, the unit of *windowSize* and *step* is the same as the unit of *timeColumn*.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n* The metacode can be a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n* If *metrics* is a tuple with multiple formulas, *windowSize* is specified as a vector of the same length as *metrics*. Each element of *windowSize* corresponds to the elements 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)>]]`.\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter.\n\n**outputTable** is a table to which the engine inserts calculation results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\nThe output columns are in the following order:\n\n(1) The first column must be a time column.\n\n* If *useSystemTime* = true, it is TIMESTAMP; Otherwise, it has the same data type as *timeColumn*;\n* If *useWindowStartTime* = true, the column displays the start time of each window; Otherwise, it displays the end time of each window.\n\n(2) If *keyColumn* is specified, the subsequent column(s) must be in the same order as that specified by *keyColumn*.\n\n(3) If *outputElapsedMicroseconds* is set to true, you need to specify a column of LONG type. See the *outputElapsedMicroseconds* parameter for details.\n\n(4) Then followed by one or more result columns.\n\n**Note**: Starting from version 2.00.10, the engine supports a user-defined aggregate function to merge multiple results in an array vector column. The result column in the output table must be in the form of array vector (i.e., append a pair of square brackets (\\[]) to the data type). See example 3.\n\n**timeColumn** (optional) is a STRING scalar or vector specifying the time column(s) of the subscribed stream table. When *useSystemTime* = false, it must be specified.\n\nNote: If *timeColumn* is a vector, it must have a date element (of DATE type) and a time element (of TIME, SECOND or NANOTIME type). In this case, the first column in *outputTable* must take the data type of concatDateTime(date, time).\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* *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.\n* *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. Note that the record which triggers the calculation will not participate in this calculation.\n\nFor 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.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\nGrouping column(s) can be array vectors (see Example 5). When the *keyColumn* contains an array vector, the engine first flattens the array vector into a one-dimensional vector and then performs grouping based on the flattened records. In this case, the following conditions must be met:\n\n* All array vectors must have the same number of elements in each row.\n* The length of the calculation results for expressions in metrics must match the total length of the flattened array vectors (e.g. `sum(iif(flatten(orderTypeList)!=2,0，flatten(orderQtyList)/180))` ).\n\n**garbageSize** (optional) is a positive integer. The default value is 50,000 (rows). The subscribed data continues to accumulate in the engine. When the number of rows of historical data in the memory exceeds *garbageSize*, the system will clear the historical data that is no longer needed.\n\n**Note:** For incremental operators, the data no longer needed will be automatically removed from memory. However, for full operators, this parameter must be specified to enable garbage collection.\n\n**updateTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*. It is used to trigger window calculations at an interval shorter than *step*. *step* must be a multiple of *updateTime*. To specify *updateTime*, *useSystemTime* must be set to false.\n\nIf *updateTime* is not specified, calculation for a window will not occur before the window ends. By specifying *updateTime*, you can calculate the values for several times in an window of which calculation hasn't been triggered for a long time.\n\nThe calculations within a window are triggered with the following rules:\n\n* Starting from the left boundary of the window, every time a new record arrives after the specified *updateTime* interval, all the data before this record within the current window will be calculated. If it still has unprocessed data after 2\\**updateTime* (at least 2 seconds), all data in this window is calculated.\n* If *keyColumn* is specified, these rules apply within each group.\n\nIt is recommended to specify a keyed table for *outputTable* if *updateTime* is set. If *outputTable* is a standard in-memory table or stream table, it will have multiple results for each timestamp (in each group). It is not recommended to use a keyed stream table either as the records of a keyed stream table cannot be updated.\n\n**useWindowStartTime** (optional) is a Boolean value indicating whether the time column in *outputTable* is the starting time of the windows. The default value is false, which means the timestamps in the output table are the end time of the windows. If the *windowSize* is a vector, *useWindowStartTime* must be false.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary if the time precision is milliseconds or seconds and step is bigger than one minute. The default value is true indicating the alignment is based on the multi-minute rule (see the [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html#alignment-rules)). False means alignment is based on the one-minute rule.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**fill** (optional) is a vector/scalar indicating the filling method to deal with an empty window (in a group). It can be:\n\n* 'none': no result\n* 'null': output a null value.\n* 'ffill': output the result in the last window.\n* specific value: output the specified value. Its type should be the same as metrics output's type.\n\n*fill* could be a vector to specify different filling method for each metric. The size of the vector must be consistent with the number of elements specified in *metrics*. The element in vector cannot be 'none'.\n\n**forceTriggerTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*, indicating the waiting time to force trigger calculation in the uncalculated windows for each group. If *forceTriggerTime* is set, *useSystemTime* must be false and *updateTime* cannot be specified.\n\nThe rules are as follow:\n\n(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.\n\n(2) If no data is ingested into a group after the last window is calculated, and new data continues to ingest into other groups, the specified *fill* parameter can be used to fill results for empty windows of that group. The group's windows will still be output at the latest time point. If parameter *fill* is not specified, no new windows will be generated for that group after the last window has been triggered for computation.\n\nNote the following points when setting *forceTriggerTime* or *updateTime*:\n\n* If *updateTime* is specified, the result of the current window calculation will be updated again when data belonging to the current window still arrives after the calculation is triggered.\n* If *forceTriggerTime* is specified, the incoming data with a timestamp within the current window will be discarded after the calculation is forced to be triggered.\n* If the time specified by `timeColumn` is of type `TIME`, it cannot determine the chronological order of data across different days based on time alone. As a result, forced triggering may fail when data spans multiple days. The time in `timeColumn` needs to include the date.\n\n**raftGroup** (optional) is an integer greater than 1, indicating ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. Specify *raftGroup* to enable high availability on the streaming engine. When an engine is created on the leader, it is also created on each follower and the engine snapshot is synchronized to the 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.\n\n**keyPurgeFreqInSec** (optional) is a positive integer, measured in seconds. It controls the periodic cleanup of keys corresponding to groups where \"window data is empty,\" in order to prevent excessive memory usage caused by the continuous growth of keys. When this parameter is specified, if the time interval between the current data insertion time and the last cleanup time is greater than or equal to *keyPurgeFreqInSec*, the group with empty window data and its corresponding key will be deleted.\n\nNote: To specify this parameter, parameter *forceTriggerTime* must be specified and parameter *fill* cannot be specified.\n\nYou can check the number of groups in a time-series streaming engine based on the column \"numGroups\" returned by [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html).\n\n**closed** (optional) is a STRING indicating whether the left or the right boundary is included.\n\n* closed = 'left': left-closed, right-open\n* closed = 'right': left-open, right-closed\n\n**outputElapsedMicroseconds** (optional) is a BOOLEAN value. The default value is false. It determines whether to output the elapsed time (in microseconds) from the time the calculation is triggered to the output of result for each window.\n\n**subWindow**(optional)is a pair of integers or DURATION values, indicating the range of the subwindow within the window specified by *windowSize*. If specified, only results calculated within subwindows will be returned and the time column of the output table displays the end time of each subwindow. The calculation of the subwindow will be triggered by the arrival of the next record after the subwindow ends. The boundary of the subwindow is determined by parameter *closed*. When *subWindow* is a pair of integers, it takes the same time precision as *timeColumn*.\n\nIf it is specified, note that:\n\n* *windowSize* must be equal to *step*.\n* Shall not specify *updateTime*>0 and *useSystemTime*=true.\n\n**parallelism** (optional) is a positive integer no greater than 63, representing the number of worker threads for parallel computation. The default value is 1. For compute-intensive workloads, adjusting this parameter appropriately can effectively utilize computing resources and reduce computation time. It is recommended to set a value less than the number of CPU cores, normally from 4 to 8.\n\n**acceptedDelay** (optional) is a positive integer specifying the maximum delay for each window to accept data. The default value is 0.\n\n* When *useSystemTime*=true, data received within the *acceptedDelay*time after the window ends will still be considered part of the current window and participate in the computation, and will not be included in the computation of the next window.\n* When *useSystemTime*=false, a window with t as right boundary will wait until a record with a timestamp equal to or later than t + *acceptedDelay* arrives. When such a record arrives, the current window closes and performs a calculation on all records within the window frame. This handles scenarios with out-of-order data.\n\n**outputHandler** (optional) is a unary function or a partial function with a single unfixed parameter. If set, the engine will not write the calculation results to the output table directly. Instead, the results will be passed as a parameter to the *outputHandler* function.\n\n**msgAsTable** (optional) is a Boolean scalar indicating whether the output data is passed into function (specified by *outputHandler*) as a table or as a tuple. If *msgAsTable*=true, the subscribed data is passed into function as a table. The default value is false, which means the output data is passed into function as a tuple of columns.\n\n#### Returns\n\nA table object.\n\n#### Alignment Rules\n\nTo facilitate observation and comparison of calculation results, the engine automatically adjusts the starting point of the first window. The alignment size (integer) will be decided by parameter *step*, *roundTime*, and the precision of *timeColumn*. When engine calculates within groups, all groups' windows will be uniformly aligned. The boundaries of each window are the same for each group.\n\n* If the data type of *timeColumn* is MONTH, the window begins in January of the year corresponding to the first arriving record.\n\n* If the data type of *timeColumn* is DATE, the boudary of the first window will not be adjusted.\n\n* If the data type of *timeColumn* is MINUTE(HH:mm), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step   | alignmentSize |\n  | ------ | ------------- |\n  | 0\\~2   | 2             |\n  | 3      | 3             |\n  | 4\\~5   | 5             |\n  | 6\\~10  | 10            |\n  | 11\\~15 | 15            |\n  | 16\\~20 | 20            |\n  | 21\\~30 | 30            |\n  | >30    | 60 (1 hour)   |\n\n  *if roundTime=true*:\n\n  The value of *alignmentSize* is same as above table if *step*<=30; The value of *alignmentSize* is as folllows if *step*>30:\n\n  | step       | alignmentSize   |\n  | ---------- | --------------- |\n  | 31\\~60     | 60 (1 hour)     |\n  | 60\\~120    | 120 (2 hours)   |\n  | 121\\~180   | 180 (3 hours)   |\n  | 181\\~300   | 300 (5 hours)   |\n  | 301\\~600   | 600 (10 hours)  |\n  | 601\\~900   | 900 (15 hours)  |\n  | 901\\~1200  | 1200 (20 hours) |\n  | 1201\\~1800 | 1800 (30 hours) |\n  | >1800      | 3600 (60 hours) |\n\n* If the data type of *timeColumn* is DATETIME (yyyy-MM-dd HH:mm:ss) or SECOND (HH:mm:ss), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step   | alignmentSize |\n  | ------ | ------------- |\n  | 0\\~2   | 2             |\n  | 3      | 3             |\n  | 4\\~5   | 5             |\n  | 6\\~10  | 10            |\n  | 11\\~15 | 15            |\n  | 16\\~20 | 20            |\n  | 21\\~30 | 30            |\n  | >30    | 60 (1 minute) |\n\n  *if roundTime=true*:\n\n  The value of *alignmentSize* is same as above table if step<=30; The value of *alignmentSize* is as folllows if step>30:\n\n  | step       | alignmentSize     |\n  | ---------- | ----------------- |\n  | 31\\~60     | 60 (1 minute)     |\n  | 61\\~120    | 120 (2 minutes)   |\n  | 121\\~180   | 180 (3 minutes)   |\n  | 181\\~300   | 300 (5 minutes)   |\n  | 301\\~600   | 600 (10 minutes)  |\n  | 601\\~900   | 900 (15 minutes)  |\n  | 901\\~1200  | 1200 (20 minutes) |\n  | 1201\\~1800 | 1800 (30 minutes) |\n  | >1800      | 3600 (1 hour)     |\n\n* If the data type of *timeColumn* is TIMESTAMP(yyyy-MM-dd HH:mm:ss.mmm) or TIME(HH:mm:ss.mmm), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step         | alignmentSize      |\n  | ------------ | ------------------ |\n  | 0\\~2         | 2                  |\n  | 3\\~5         | 5                  |\n  | 6\\~10        | 10                 |\n  | 11\\~20       | 20                 |\n  | 21\\~25       | 25                 |\n  | 26\\~50       | 50                 |\n  | 51\\~100      | 100                |\n  | 101\\~200     | 200                |\n  | 201\\~250     | 250                |\n  | 251\\~500     | 500                |\n  | 501\\~1000    | 1000 (1 second)    |\n  | 1001\\~2000   | 2000 (2 seconds)   |\n  | 2001\\~3000   | 3000 (3 seconds)   |\n  | 3001\\~5000   | 5000 (5 seconds)   |\n  | 5001\\~10000  | 10000 (10 seconds) |\n  | 10001\\~15000 | 15000 (15 seconds) |\n  | 15001\\~20000 | 20000 (20 seconds) |\n  | 20001\\~30000 | 30000 (30 seconds) |\n  | >30000       | 60000 (1 minute)   |\n\n  *if roundTime=true:*\n\n  The value of *alignmentSize* is same as above table if step<=30000; The value of *alignmentSize* is as folllows if step>30000:\n\n  | step             | alignmentSize        |\n  | ---------------- | -------------------- |\n  | 30001\\~60000     | 60000 (1 minute)     |\n  | 60001\\~120000    | 120000 (2 minutes)   |\n  | 120001\\~300000   | 300000 (5 minutes)   |\n  | 300001\\~600000   | 600000 (10 minutes)  |\n  | 600001\\~900000   | 900000 (15 minutes)  |\n  | 900001\\~1200000  | 1200000 (20 minutes) |\n  | 1200001\\~1800000 | 1800000 (30 minutes) |\n  | >1800000         | 3600000 (1 hour)     |\n\n* If the data type of *timeColumn* is NANOTIMESTAMP(yyyy-MM-dd HH:mm:ss.nnnnnnnnn) or NANOTIME(HH:mm:ss.nnnnnnnnn), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step         | alignmentSize |\n  | ------------ | ------------- |\n  | 0\\~2ns       | 2ns           |\n  | 3ns\\~5ns     | 5ns           |\n  | 6ns\\~10ns    | 10ns          |\n  | 11ns\\~20ns   | 20ns          |\n  | 21ns\\~25ns   | 25ns          |\n  | 26ns\\~50ns   | 50ns          |\n  | 51ns\\~100ns  | 100ns         |\n  | 101ns\\~200ns | 200ns         |\n  | 201ns\\~250ns | 250ns         |\n  | 251ns\\~500ns | 500ns         |\n  | >500ns       | 1000ns        |\n\n  *if roundTime=true*:\n\n  | step        | alignmentSize |\n  | ----------- | ------------- |\n  | 1000ns\\~1ms | 1ms           |\n  | 1ms\\~10ms   | 10ms          |\n  | 10ms\\~100ms | 100ms         |\n  | 100ms\\~1s   | 1s            |\n  | 1s\\~2s      | 2s            |\n  | 2s\\~3s      | 3s            |\n  | 3s\\~5s      | 5s            |\n  | 5s\\~10s     | 10s           |\n  | 10s\\~15s    | 15s           |\n  | 15s\\~20s    | 20s           |\n  | 20s\\~30s    | 30s           |\n  | >30s        | 1min          |\n\nIf the time of the first record is x with data type of TIMESTAMP, then the starting time of the first window is adjusted to be `timeType_cast(x/alignmentSize*alignmentSize+step-windowSize)`, where \"/\" produces only the integer part after division. For example, if the time of the first record is 2018.10.08T01:01:01.365, *windowSize* = 120000, and *step* = 60000, then *alignmentSize* = 60000, and the starting time of the first window is timestamp(2018.10.08T01:01:01.365/60000\\*60000+60000-120000)=2018.10.08T01:01:00.000.\n\n#### Examples\n\n**Example 1**\n\nIn the following example, the time-series engine1 subscribes to the stream table \"trades\" and calculates sum(volume) for each stock in the last minute in real time. The result is saved in table output1.\n\n```\nshare streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\nengine1 = createTimeSeriesEngine(name=\"engine1\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=false)\nsubscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);\n\ninsert into trades values(2018.10.08T01:01:01.785,`A,10)\ninsert into trades values(2018.10.08T01:01:02.125,`B,26)\ninsert into trades values(2018.10.08T01:01:10.263,`B,14)\ninsert into trades values(2018.10.08T01:01:12.457,`A,28)\ninsert into trades values(2018.10.08T01:02:10.789,`A,15)\ninsert into trades values(2018.10.08T01:02:12.005,`B,9)\ninsert into trades values(2018.10.08T01:02:30.021,`A,10)\ninsert into trades values(2018.10.08T01:04:02.236,`A,29)\ninsert into trades values(2018.10.08T01:04:04.412,`B,32)\ninsert into trades values(2018.10.08T01:04:05.152,`B,23)\n\nsleep(10)\n\nselect * from output1;\n```\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.08T01:02:00.000 | A   | 38        |\n| 2018.10.08T01:02:00.000 | B   | 40        |\n| 2018.10.08T01:03:00.000 | A   | 25        |\n| 2018.10.08T01:03:00.000 | B   | 9         |\n\nThe following paragraphs explain in details how the time-series engine conducts the calculations. For simplicity, regarding the \"time\" column we ignore the part of \"2018.10.08T\" and only use the \"hour:minute:second.millisecond\" part.\n\nFirst, the time-series engine adjusts the starting time of the first window to be 01:01:00.000. The first window is from 01:01:00.000 (inclusive) to 01:02:00.000 (exclusive). When the record (01:02:10.789,\\`A,15) arrives, it triggers the calculation of group A for the first window; the arrival of (01:02:12.005,\\`B,9) triggers the calculation of group B for the first window.\n\nThe second window is from 01:02:00.000 (inclusive) to 01:03:00.000 (exclusive). When the record (01:04:02.236,\\`A,29) arrives, it triggers the calculation of group A for the second window; the arrival of (01:04:04.412,\\`B,32) triggers the calculation of group B for the second window.\n\nAs there are no records since 01:05:00.000, no calculations are triggered for the window of \\[01:04:00.000, 01:05:00.000).\n\nThe table output1 stores the calculation results of the time-series engine. As *useWindowStartTime*=false, the timestamps in the output table are the end time of the windows. If *useWindowStartTime*=true, then the timestamps in the output table are the starting time of the windows, as illustrated in the following example:\n\n```\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output2\nengine2 = createTimeSeriesEngine(name=\"engine2\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output2, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=true)\nsubscribeTable(tableName=\"trades\", actionName=\"engine2\", offset=0, handler=append!{engine2}, msgAsTable=true)\n\nsleep(10)\nselect * from output2;\n```\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.08T01:01:00.000 | A   | 38        |\n| 2018.10.08T01:01:00.000 | B   | 40        |\n| 2018.10.08T01:02:00.000 | A   | 25        |\n| 2018.10.08T01:02:00.000 | B   | 9         |\n\n**Example 2**\n\nIn the following example, we specify *updateTime* to be 1000 (milliseconds):\n\n```\nshare keyedTable(`time`sym,10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output3\nengine3 = 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)\nsubscribeTable(tableName=\"trades\", actionName=\"engine3\", offset=0, handler=append!{engine3}, msgAsTable=true)\n\nsleep(2001)\nselect * from output3;\n```\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.08T01:02:00.000 | A   | 38        |\n| 2018.10.08T01:02:00.000 | B   | 40        |\n| 2018.10.08T01:03:00.000 | A   | 25        |\n| 2018.10.08T01:03:00.000 | B   | 9         |\n| 2018.10.08T01:05:00.000 | B   | 55        |\n| 2018.10.08T01:05:00.000 | A   | 29        |\n\nNext, we will explain the calculations triggered in the last window from 01:04:00.000 to 01:05:00.000.\n\n(1) At 01:04:04.236, 2000 milliseconds after the first record of group A arrived, a group A calculation is triggered. The result (01:05:00.000, \\`A, 29) is written to the output table.\n\n(2) The record of group B at 01:04:05.152 is the first record after the small window of \\[01:04:04.000, 01:04:05.000) that contains the group B record at 01:04:04.412. It triggers a group B calculation. The result (01:05:00.000,\"B\",32) is written to the output table.\n\n(3) 2000 milliseconds later, at 01:04:07.152, as the B group record at 1:04:05.152 has not been used in a calculation, a group B calculation is triggered. The result is (01:05:00.000,\"B\",55). As the output table's keys are columns 'time' and 'sym', the record of (01:05:00.000,\\`B,32) in the output table is updated and becomes (01:05:00.000,\\`B,55).\n\nIn the example, the shared stream table \"pubT\" contains two time columns with the type of DATE and SECOND. When creating time series engine, the two time columns could be combined into one column with the type of DATETIME in output table \"streamMinuteBar\\_1min\" by setting *timeColumn*.\n\n```\ncolNames=`symbol`date`minute`price`type`volume\ncolTypes=`SYMBOL`DATE`SECOND`DOUBLE`STRING`INT\npubTable = streamTable(10000:0,colNames,colTypes)\nshare pubTable as pubT\n\ncolNames = `time`symbol`open`max`min`close`volume`amount`ret`vwap\ncolTypes = `DATETIME`SYMBOL`DOUBLE`DOUBLE`DOUBLE`DOUBLE`INT`DOUBLE`DOUBLE`DOUBLE\nshare streamTable(10000:0,colNames, colTypes) as streamMinuteBar_1min\n\ntsAggrOHLC = createTimeSeriesEngine(name=\"subT\", windowSize=60, step=60, metrics=<[first(price) as open ,max(price) as max,min(price) as min ,last(price) as close ,sum(volume) as volume ,wsum(volume, price) as amount ,(last(price)-first(price)/first(price)) as ret, (wsum(volume, price)/sum(volume)) as vwap]>, dummyTable=pubTable, outputTable=streamMinuteBar_1min, timeColumn=`date`minute, useSystemTime=false, keyColumn='symbol', fill=`none)\nsubscribeTable(tableName=\"pubT\", actionName=\"subT\", offset=-1, handler=append!{tsAggrOHLC}, msgAsTable=true)\n\ninsert into pubT values(`000001, 2021.04.05, 09:25:01, 1, 'B', 1)\ninsert into pubT values(`000001, 2021.04.05, 09:30:05, 2, 'B', 1)\ninsert into pubT values(`000001, 2021.04.05, 09:31:06, 3, 'B', 1)\ninsert into pubT values(`000001, 2021.04.05, 09:35:05, 4, 'S', 4)\ninsert into pubT values(`000001, 2021.04.05, 09:40:05, 5, 'S', 5)\ninsert into pubT values(`000001, 2021.04.06, 09:25:05, 6, 'S', 6)\n```\n\n| symbol | date       | minute   | price | type | volume |\n| ------ | ---------- | -------- | ----- | ---- | ------ |\n| 000001 | 2021.04.05 | 09:25:01 | 1     | B    | 1      |\n| 000001 | 2021.04.05 | 09:30:05 | 2     | B    | 1      |\n| 000001 | 2021.04.05 | 09:31:06 | 3     | B    | 1      |\n| 000001 | 2021.04.05 | 09:35:05 | 4     | S    | 4      |\n| 000001 | 2021.04.05 | 09:40:05 | 5     | S    | 5      |\n| 000001 | 2021.04.06 | 09:25:05 | 6     | S    | 6      |\n\n```\nselect * from streamMinuteBar_1min\n```\n\n| time                | symbol | open | max | min | close | volume | amount | ret | vwap |\n| ------------------- | ------ | ---- | --- | --- | ----- | ------ | ------ | --- | ---- |\n| 2021.04.05T09:26:00 | 000001 | 1    | 1   | 1   | 1     | 1      | 1      | 0   | 1    |\n| 2021.04.05T09:31:00 | 000001 | 2    | 2   | 2   | 2     | 1      | 2      | 1   | 2    |\n| 2021.04.05T09:32:00 | 000001 | 3    | 3   | 3   | 3     | 1      | 3      | 2   | 3    |\n| 2021.04.05T09:36:00 | 000001 | 4    | 4   | 4   | 4     | 4      | 16     | 3   | 4    |\n| 2021.04.05T09:41:00 | 000001 | 5    | 5   | 5   | 5     | 5      | 25     | 4   | 5    |\n\n```\nshare streamTable(1000:0, `time`sym`qty, [DATETIME, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumQty, [DATETIME, SYMBOL, INT]) as output3\n\nengine = createTimeSeriesEngine(name=\"engine\", windowSize=6, step=6, metrics=<sum(qty)>, dummyTable=trades, outputTable=output3, timeColumn=`time,keyColumn=`sym, forceTriggerTime=7,fill=1000)\nsubscribeTable(tableName=\"trades\", actionName=\"engine\", offset=0, handler=append!{engine}, msgAsTable=true)\nsleep(1000)\ninsert into engine values(2018.08.01T14:05:43,`A,1)\ninsert into engine values(2018.08.01T14:05:43,`C,3)\nsleep(10)\ninsert into engine values(2018.08.01T14:05:44,`B,1)\nsleep(80)\ninsert into engine values(2018.08.01T14:05:52,`B,3)\nsleep(20)\ninsert into engine values(2018.08.01T14:05:54,`A,3)\nsleep(10)\ninsert into engine values(2018.08.01T14:05:55,`A,5)\nsleep(20)\ninsert into engine values(2018.08.01T14:05:57,`B,5)\nsleep(50)\ninsert into engine values(2018.08.01T14:06:12,`A,1)\nsleep(50)\nselect * from output3 order by sym\n```\n\n| time                | sum | Qty   |\n| ------------------- | --- | ----- |\n| 2018.08.01T14:05:46 | A   | 1     |\n| 2018.08.01T14:05:52 | A   | 1,000 |\n| 2018.08.01T14:05:58 | A   | 8     |\n| 2018.08.01T14:06:04 | A   | 1,000 |\n| 2018.08.01T14:06:10 | A   | 1,000 |\n| 2018.08.01T14:05:46 | B   | 1     |\n| 2018.08.01T14:05:52 | B   | 1,000 |\n| 2018.08.01T14:05:58 | B   | 8     |\n| 2018.08.01T14:05:46 | C   | 3     |\n| 2018.08.01T14:05:52 | C   | 1,000 |\n\n**Example 3**\n\nThe following example calculates the first/last volume in each window and merges the result in an array vector column.\n\n```\n// Define a function toVector with defg. The results are merged into array vectors\ndefg toVector(x){\n    return x\n}\nshare streamTable(1000:0, `time`sym`volume`price, [TIMESTAMP, SYMBOL, DOUBLE,DOUBLE]) as trades\n// Define the output table and specify the result column as DOUBLE[] type\nshare table(10000:0, `time`sym`sumVolume`avg, [TIMESTAMP,STRING,DOUBLE[],DOUBLE]) as output1\n// Call toVector in metrics to combine the first and last volumes in a 1-minute window into an array vector\nengine1 = createTimeSeriesEngine(name=\"engine1\", windowSize=60000, step=60000, metrics=<[toVector([first(volume),last(volume)]),avg(volume+price)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, keyColumn=`sym , useSystemTime=false, garbageSize=50, useWindowStartTime=false)\n\ntimes = sort(2023.10.08T00:00:00.000 + rand(1..(1+3000*200), 30))\nsyms = rand(\"A\"+string(1..10), 30)\nvolumes = rand(rand(100.0, 10) join 2.3 NULL NULL NULL NULL, 30)\nprices = rand(rand(100.0, 10) join 2.3 NULL NULL NULL NULL, 30)\nt=table(times as time, syms as sym, volumes as volume,prices as price)\n\nengine1.append!(t)\n\nselect * from output1 where time between 2023.10.08T00:01:00.000 and 2023.10.08T00:05:00.000 order by time,sym \n```\n\n| time                    | sym | sumVolume                             | avg                |\n| ----------------------- | --- | ------------------------------------- | ------------------ |\n| 2023.10.08 00:01:00.000 | A1  | \\[, ]                                 |                    |\n| 2023.10.08 00:02:00.000 | A4  | \\[2.3, 2.3]                           |                    |\n| 2023.10.08 00:03:00.000 | A10 | \\[68.5665876371786, 68.5665876371786] | 121.97567140683532 |\n| 2023.10.08 00:03:00.000 | A6  | \\[, 22.65533998142928]                | 33.386794407851994 |\n\n**Example 4**\n\nThe following example specifies the parameter *subWindow*.\n\n```\n\nshare streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\n//specify a 10-second subwindow within a 1-min window. With closed unspecified, the subwindow takes the default value, i.e., left-closed, right-open window, [0s, 10s).\nengine4 = createTimeSeriesEngine(name=\"engine4\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=true, subWindow=0s:10s)\n\nsubscribeTable(tableName=\"trades\", actionName=\"engine4\", offset=0, handler=append!{engine4}, msgAsTable=true);\n\ninsert into trades values(2018.10.08T01:01:01.785,`A,10)\ninsert into trades values(2018.10.08T01:01:02.125,`B,26)\ninsert into trades values(2018.10.08T01:01:10.000,`A,14)\ninsert into trades values(2018.10.08T01:01:12.457,`A,28)\n\nsleep(10)\n\nselect * from output1;\n\n```\n\nThe calculation for group \"A\" within the subwindow \\[2018.10.08T01:01:00.000, 2018.10.08T01:01:10.000) is triggered by the arrival of data at 2018.10.08T01:01:10.000. No new data from group \"B\" is received after the subwindow ends, so the calculation of group \"B\" is not triggered.\n\n<table id=\"table_mzg_pwy_21c\"><thead><tr><th>\n\ntime\n\n</th><th>\n\nsym\n\n</th><th>\n\nsumVolume\n\n</th></tr></thead><tbody><tr><td>\n\n2018.10.08T01:01:10.000\n\n</td><td>\n\nA\n\n</td><td>\n\n10\n\n</td></tr></tbody>\n</table>**Example 5**\n\nThis example shows how to aggregate order value and order count for each price level by stock symbol and buy/sell side, where order prices are provided as array vectors.\n\n```\nshare streamTable(1000:0, [\"time\",\"sym\",\"side\",\"orderPrice\",\"orderQty\"],   \n    [TIMESTAMP, SYMBOL, SYMBOL, DOUBLE[], INT[]]) as orderStream  \n  \nshare table(10000:0, [\"time\",\"sym\",\"side\", \"orderPrice\", \"totalValue\", \"orderCount\"],   \n    [TIMESTAMP, SYMBOL, SYMBOL, DOUBLE, DOUBLE, INT]) as result  \n  \n// Create a time-series engine: group by stock symbol, buy/sell side, and order price \nengine = createTimeSeriesEngine(  \n    name=\"orderEngine\",   \n    windowSize=60000,   \n    step=60000,   \n    metrics=<[  \n        sum(orderPrice * orderQty),               \n        count(orderPrice)                 \n    ]>,   \n    dummyTable=orderStream,   \n    outputTable=result,   \n    timeColumn=\"time\",   \n    keyColumn=`sym`side`orderPrice, \n    useSystemTime=false  \n)  \n\n \nn = 100  \ntime = 2023.01.01T09:30:00.000 + (1..n)*1000  \nsym = take(`AAPL`MSFT, n)  \nside = take(`Buy`Sell, n)  \norderPrice = arrayVector((1..n) * 5, rand(100.0 105.0, 5*n))  \norderQty = arrayVector((1..n) * 5, rand(100 1000, 5*n)) \n   \ninsert into engine values(time, sym, side, orderPrice, orderQty)\n\n// View the result\nselect * from result\n```\n\n| time                    | sym  | side | orderPrice | totalValue | orderCount |\n| ----------------------- | ---- | ---- | ---------- | ---------- | ---------- |\n| 2023.01.01 09:31:00.000 | AAPL | Buy  | 100        | 4,430,000  | 74         |\n| 2023.01.01 09:31:00.000 | AAPL | Buy  | 105        | 5,050,500  | 76         |\n| 2023.01.01 09:31:00.000 | MSFT | Sell | 100        | 4,720,000  | 76         |\n| 2023.01.01 09:31:00.000 | MSFT | Sell | 105        | 3,654,000  | 69         |\n\n**Example 6**\n\nSet *windowSize* to a vector to compute data in 1-minute windows and 3-minute windows simultaneously.\n\nWhen *windowSize* is a vector, each window length can correspond to a separate set of metrics. This example outputs both the 1-minute sum of volume and the 3-minute average price at the same time.\n\n```\nshare streamTable(1000:0, [\"time\",\"sym\",\"volume\",\"price\"], [TIMESTAMP, SYMBOL, INT, DOUBLE]) as tradesWS\nshare table(1000:0, [\"time\",\"sym\",\"sum1m\",\"avgPrice3m\"], [TIMESTAMP, SYMBOL, INT, DOUBLE]) as outputWS\n\nengineWS = createTimeSeriesEngine(\n  name=\"engineWS\",\n  windowSize=[60000, 180000],\n  step=60000,\n  metrics=(<[sum(volume) as sum1m]>, <[avg(price) as avgPrice3m]>),\n  dummyTable=tradesWS,\n  outputTable=outputWS,\n  timeColumn=\"time\",\n  keyColumn=\"sym\",\n  useSystemTime=false\n)\n\nsubscribeTable(tableName=\"tradesWS\", actionName=\"engineWS\", offset=0, handler=append!{engineWS}, msgAsTable=true)\n\ninsert into tradesWS values(2024.01.01T10:00:10.000, `A, 10, 100.0)\ninsert into tradesWS values(2024.01.01T10:00:20.000, `B, 16, 104.0)\ninsert into tradesWS values(2024.01.01T10:00:40.000, `A, 20, 101.0)\ninsert into tradesWS values(2024.01.01T10:01:10.000, `A, 15, 102.0)\ninsert into tradesWS values(2024.01.01T10:01:20.000, `B, 20, 105.0)\ninsert into tradesWS values(2024.01.01T10:02:05.000, `A, 30, 103.0)\ninsert into tradesWS values(2024.01.01T10:03:10.000, `A, 12, 104.0)\n\nsleep(10)\nselect * from outputWS\n```\n\nThe output is as follows:\n\n| time                    | sym | sum1m | avgPrice3m |\n| ----------------------- | --- | ----- | ---------- |\n| 2024.01.01 10:01:00.000 | A   | 30    | 100.5      |\n| 2024.01.01 10:01:00.000 | B   | 16    | 104        |\n| 2024.01.01 10:02:00.000 | A   | 15    | 101        |\n| 2024.01.01 10:03:00.000 | A   | 30    | 101.5      |\n\nWhere:\n\n* Elements in `windowSize=[60000, 180000]` correspond to 1-minute and 3-minute windows, respectively.\n\n* The first element in *metrics* corresponds to the 1-minute window, and the second element corresponds to the 3-minute window.\n\n* The two columns in the output table store the aggregation results for different window lengths, respectively.\n\n**Example 7**\n\nSet *roundTime* and *step* to control how windows are aligned.\n\nWhen the time precision is milliseconds or seconds and *step* is greater than 1 minute, *roundTime* affects how the first window boundary is aligned. This example compares two engines with the same parameters except for different *roundTime* values.\n\n```\nshare streamTable(1000:0, [\"time\",\"volume\"], [TIMESTAMP, INT]) as tradesRT\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputRTTrue\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputRTFalse\n\nengineRTTrue = createTimeSeriesEngine(\n   name=\"engineRTTrue\",\n   windowSize=240000,\n   step=120000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesRT,\n   outputTable=outputRTTrue,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   roundTime=true\n)\n\nengineRTFalse = createTimeSeriesEngine(\n   name=\"engineRTFalse\",\n   windowSize=240000,\n   step=120000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesRT,\n   outputTable=outputRTFalse,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   roundTime=false\n)\n\nsubscribeTable(tableName=\"tradesRT\", actionName=\"engineRTTrue\", offset=0, handler=append!{engineRTTrue}, msgAsTable=true)\nsubscribeTable(tableName=\"tradesRT\", actionName=\"engineRTFalse\", offset=0, handler=append!{engineRTFalse}, msgAsTable=true)\n\ninsert into tradesRT values(2024.01.01T10:03:30.500, 10)\ninsert into tradesRT values(2024.01.01T10:04:20.000, 20)\ninsert into tradesRT values(2024.01.01T10:06:01.000, 5)\n```\n\nFor the engine with *roundTime*=true, execute `select * from outputRTTrue`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:04:00.000 | 10        |\n| 2024.01.01 10:06:00.000 | 30        |\n\nFor the engine with *roundTime*=false, execute `select * from outputRTFalse`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:05:00.000 | 30        |\n\n* In this example, the time of the first data record is `x=2024.01.01T10:03:30.500`; *windowSize* is 240000 (4 minutes).\n\n* When *roundTime*=true, *step*=120000 falls within the 60001\\~120000 range at millisecond precision, and the corresponding alignmentSize is 120000 (2 minutes). First, align x to 2 minutes: `timestamp(x/120000*120000)=2024.01.01T10:02:00.000`; Then substitute into the formula to get the left boundary `2024.01.01T10:02:00.000 + 120000 - 240000 = 2024.01.01T10:00:00.000`, so the first window is \\[10:00:00.000, 10:04:00.000).\n\n* When *roundTime*=false, the data is at millisecond precision and *step*>30000, so the corresponding alignmentSize is 60000 (1 minute). First, align x to 1 minute: `timestamp(x/60000*60000)=2024.01.01T10:03:00.000`; Then substitute into the formula to get the left boundary `2024.01.01T10:03:00.000 + 120000 - 240000 = 2024.01.01T10:01:00.000`, so the first window is \\[10:01:00.000, 10:05:00.000).\n\n* The record at 10:03:30.500 falls into the first window under both settings, but the start and end ranges of the first window differ; Furthermore, 10:04:20.000 falls into the next window \\[10:02, 10:06) when *roundTime*=true, but still falls into the first window \\[10:01, 10:05) when *roundTime*=false.\n\n**Example 8**\n\nSet *closed* to control how boundary values are handled.\n\n*closed*='left' indicates left-closed right-open, and *closed*='right' indicates left-open right-closed. If the data falls exactly on a window boundary, different settings affect which window the data belongs to.\n\n```\nshare streamTable(1000:0, [\"time\",\"volume\"], [TIMESTAMP, INT]) as tradesCL\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputLeft\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputRight\n\nengineLeft = createTimeSeriesEngine(\n   name=\"engineLeft\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesCL,\n   outputTable=outputLeft,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   closed=\"left\"\n)\n\nengineRight = createTimeSeriesEngine(\n   name=\"engineRight\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesCL,\n   outputTable=outputRight,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   closed=\"right\"\n)\n\nsubscribeTable(tableName=\"tradesCL\", actionName=\"engineLeft\", offset=0, handler=append!{engineLeft}, msgAsTable=true)\nsubscribeTable(tableName=\"tradesCL\", actionName=\"engineRight\", offset=0, handler=append!{engineRight}, msgAsTable=true)\n\ninsert into tradesCL values(2024.01.01T10:00:10.000, 10)\ninsert into tradesCL values(2024.01.01T10:01:00.000, 20)\ninsert into tradesCL values(2024.01.01T10:01:10.000, 1)\n```\n\nFor the engine with *closed*=\"left\", execute `select * from outputLeft`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:01:00.000 | 10        |\n\nFor the engine with *closed*=\"right\", execute `select * from outputRight`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:01:00.000 | 30        |\n\n* When *closed*=\"left\", the time of the second record is exactly 10:01:00.000, which belongs to the next window \\[10:01, 10:02), so the first window only counts 10.\n\n* When *closed*=\"right\", the same boundary data belongs to the previous window (10:00, 10:01], so the result for the first window becomes `10 + 20 = 30`.\n\n**Example 9**\n\nSet *outputElapsedMicroseconds* and *acceptedDelay*.\n\n* Use *acceptedDelay* to accept out-of-order data that arrives within a certain range after the window ends;\n\n* Use *outputElapsedMicroseconds*=true to output the elapsed time from the computation trigger to output for each result.\n\n```\nshare streamTable(1000:0, [\"time\",\"sym\",\"volume\"], [TIMESTAMP, SYMBOL, INT]) as tradesAD\nshare table(1000:0, [\"time\",\"sym\",\"elapsedUs\",\"sumVolume\"], [TIMESTAMP, SYMBOL, LONG, INT]) as outputAD\n\nengineAD = createTimeSeriesEngine(\n   name=\"engineAD\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesAD,\n   outputTable=outputAD,\n   timeColumn=\"time\",\n   keyColumn=\"sym\",\n   useSystemTime=false,\n   acceptedDelay=5000,\n   outputElapsedMicroseconds=true\n)\n\nsubscribeTable(tableName=\"tradesAD\", actionName=\"engineAD\", offset=0, handler=append!{engineAD}, msgAsTable=true)\n\ninsert into tradesAD values(2024.01.01T10:00:10.000, `A, 10)\ninsert into tradesAD values(2024.01.01T10:00:40.000, `A, 20)\ninsert into tradesAD values(2024.01.01T10:01:02.000, `A, 1)\ninsert into tradesAD values(2024.01.01T10:00:55.000, `A, 30)\ninsert into tradesAD values(2024.01.01T10:01:06.000, `A, 2)\n\nsleep(10)\nselect * from outputAD\n```\n\nThe output is as follows:\n\n| time                    | sym | elapsedUs | sumVolume |\n| ----------------------- | --- | --------- | --------- |\n| 2024.01.01 10:01:00.000 | A   | 2         | 60        |\n\n* In this example, the window is \\[10:00:00, 10:01:00).\n\n* When *acceptedDelay*=5000, the window can still accept data within 5 seconds after it ends.\n\n* Although record 4 with time 10:00:55.000 arrives later than 10:01:02.000, it is still within the allowed delay range, so it is still counted in the first window.\n\n* Record 5 has a time of 10:01:06.000, which satisfies the condition “data received with a timestamp greater than or equal to the current window's end timestamp + acceptedDelay”, thus triggering the output of the first window, with the result `10 + 20 + 30 = 60`.\n\n**Example 10**\n\nSet outputHandler and msgAsTable.\n\nAfter setting *outputHandler*, the computation results are not written to the outputTable; instead, the defined unary function is called to process the computation results. *msgAsTable* is used to control the structure of the callback parameter:\n\n* *msgAsTable*=false: the callback parameter is a tuple composed of columns;\n\n* *msgAsTable*=true: the callback parameter is a table.\n\n```\nshare streamTable(1000:0, [\"time\",\"volume\"], [TIMESTAMP, INT]) as tradesOH\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as ignoredTuple\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as ignoredTable\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as tupleResult\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as tableResult\n\ndef handleTuple(msg){\n   tupleResult.tableInsert(msg[0],msg[1])\n}\n\ndef handleTable(msg){\n   tableResult.append!(msg)\n}\n\nengineTuple = createTimeSeriesEngine(\n   name=\"engineTuple\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesOH,\n   outputTable=ignoredTuple,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   outputHandler=handleTuple,\n   msgAsTable=false\n)\n\nengineTable = createTimeSeriesEngine(\n   name=\"engineTable\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesOH,\n   outputTable=ignoredTable,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   outputHandler=handleTable,\n   msgAsTable=true\n)\n\nsubscribeTable(tableName=\"tradesOH\", actionName=\"engineTuple\", offset=0, handler=append!{engineTuple}, msgAsTable=true)\nsubscribeTable(tableName=\"tradesOH\", actionName=\"engineTable\", offset=0, handler=append!{engineTable}, msgAsTable=true)\n\ninsert into tradesOH values(2024.01.01T10:00:10.000, 10)\ninsert into tradesOH values(2024.01.01T10:00:40.000, 20)\ninsert into tradesOH values(2024.01.01T10:01:10.000, 5)\n```\n\nExecute `select * from tupleResult` and `select * from tableResult`, respectively.\n\nThe results of tupleResult and tableResult are both:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:01:00.000 | 30        |\n\n* In engineTuple, `handleTuple` receives column tuples, and the unary function uses `tableInsert` to insert `msg[0]` and `msg[1]` into the target table.\n\n* In engineTable, `handleTable` directly receives the result table, and the unary function uses `append!` to insert the result table into the target table.\n\nExecute `select * from ignoredTuple` and `select * from ignoredTable`, respectively; both outputs are empty. This is because *outputHandler* is set, so the computation results are not written to ignoredTuple or ignoredTable.\n"
    },
    "createTimeSeriesEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html",
        "signatures": [
            {
                "full": "createTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, [timeColumn], [useSystemTime=false], [keyColumn], [garbageSize], [updateTime], [useWindowStartTime], [roundTime=true], [snapshotDir], [snapshotIntervalInMsgCount], [fill='none'], [forceTriggerTime], [raftGroup], [keyPurgeFreqInSec=-1], [closed='left'], [outputElapsedMicroseconds=false], [subWindow], [parallelism=1], [acceptedDelay=0], [outputHandler], [msgAsTable=false])",
                "name": "createTimeSeriesEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "windowSize",
                        "name": "windowSize"
                    },
                    {
                        "full": "step",
                        "name": "step"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColumn]",
                        "name": "keyColumn",
                        "optional": true
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime]",
                        "name": "useWindowStartTime",
                        "optional": true
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSec=-1]",
                        "name": "keyPurgeFreqInSec",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[subWindow]",
                        "name": "subWindow",
                        "optional": true
                    },
                    {
                        "full": "[parallelism=1]",
                        "name": "parallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[acceptedDelay=0]",
                        "name": "acceptedDelay",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[outputHandler]",
                        "name": "outputHandler",
                        "optional": true
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)\n\n\n\n#### Syntax\n\ncreateTimeSeriesEngine(name, windowSize, step, metrics, dummyTable, outputTable, \\[timeColumn], \\[useSystemTime=false], \\[keyColumn], \\[garbageSize], \\[updateTime], \\[useWindowStartTime], \\[roundTime=true], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[fill='none'], \\[forceTriggerTime], \\[raftGroup], \\[keyPurgeFreqInSec=-1], \\[closed='left'], \\[outputElapsedMicroseconds=false], \\[subWindow], \\[parallelism=1], \\[acceptedDelay=0], \\[outputHandler], \\[msgAsTable=false])\n\nAlias: createTimeSeriesAggregator\n\n#### Details\n\nThis function creates a time-series streaming engine to conduct real-time time-series calculations with moving windows, and returns a table object where data is ingested for window calculations.\n\nThere are two types of aggregate operators in the time-series engine: incremental operators and full operators. Incremental operators incrementally aggregate the data as they arrive without keeping the historical data. Full operators (e.g., user-defined aggregate functions, unoptimized built-in aggregate functions, or functions with nested state functions) keep all the data in a window and recompute the output as a full refresh whenever new data arrives.\n\nThe following aggregate operators in the time-series engine are optimized for incremental computations: corr, covar, first, last, max, med, min, percentile, quantile, std, var, sum, sum2, sum3, sum4, wavg, wsum, count, firstNot, ifirstNot, lastNot, ilastNot, imax, imin, nunique, prod, sem, mode, searchK, beta, avg, covarp.\n\nFor more application scenarios, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n##### Windowing logic\n\nWindow boundaries: The engine automatically adjusts the starting point of the first window. (see parameter description for *step* and *roundTime*, and [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html#alignment-rules)).\n\nWindow properties:\n\n* *windowSize* - the size of each window;\n* *closed* - whether the left/right boundaries of a window is inclusive/exclusive;\n* *step* - the duration of time between windows;\n* *useSystemTime* specifies how values are windowed - based on the time column in the data or the system time of data ingestion.\n\n##### Calculation Rules\n\n* Processing rules for out-of-order data:\n  * If *timeColumn* is specified, its values must be non-decreasing. If *keyColumn* is specified to group the data, the values in *timeColumn* must be non-decreasing with each group specified by *keyColumn*. Otherwise, out-of-order data will be discarded.\n  * If you want to receive out-of-order data within a specific range, you can set *acceptedDelay*. For details, refer to the description of the *acceptedDelay* parameter.\n* If *useSystemTime* = true, the calculation of a window is triggered as soon as the window ends. If *useSystemTime* = false (with *timeColumn* specified), the calculation of a window is triggered by the arrival of the next record after the window ends. To trigger the calculation for the uncalculated windows, you can specify the parameter *updateTime* or *forceTriggerTime*.\n* If *fill* is unspecified or \"None\", only windows with calculation results are output. If *fill* is specified, all windows are output, and the empty windows are filled using the specified filling method.\n* Since version 2.00.11, if *updateTime* = 0, incoming records in the current window can be immediately calculated and output.\n\n##### Other Features\n\n* Data/state cleanup: You can set a cleanup rule to clear historical data. (See parameters *garbageSize* and *keyPurgeFreqInSec*)\n\n* Snapshot: Snapshot mechanism is used to restore the streaming engine to the latest snapshot after system interruption. (See parameters *snapshotDir* and *snapshotIntervalInMsgCount*)\n\n* High availability: To enable high availability for streaming engines, specify the parameter *raftGroup* on the leader of the raft group on the subscriber. When a leader is down, the raft group automatically switches to a new leader to resubscribe to the stream table.\n\n#### Parameters\n\n**name** is a string indicating the name of the engine. It is the only identifier of an engine on a data or compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**windowSize** is a scalar or vector with positive integers that specifies the size of the windows for calculation.\n\n**step** is a positive integer indicating how much each window moves forward relative to the previous one. Note that step must be divisible by *windowSize*, otherwise an exception will be thrown.\n\nThe unit of *windowSize* and *step* are determined by the value of *useSystemTime*.\n\n* If *useSystemTime* =true, the unit of *windowSize* and *step* is millisecond.\n* If *useSystemTime* =false, the unit of *windowSize* and *step* is the same as the unit of *timeColumn*.\n\n**metrics** is metacode or a tuple specifying the calculation formulas. For more information about metacode please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* It can use one or more built-in or user-defined aggregate functions (which must be defined by the `defg` keyword) such as `<[sum(volume), avg(price)]>`, or expressions of aggregate functions such as as `<[avg(price1)-avg(price2)]>`, or aggregate functions involving multiple columns such as `<[std(price1-price2)]>`.\n* You can specify functions that return multiple values for *metrics*, such as `<func(price) as `col1`col2>` (it's optional to specify the column names).\n* The metacode can be a constant scalar/vector. Note that the output column for a constant vector must be in array vector form.\n* If *metrics* is a tuple with multiple formulas, *windowSize* is specified as a vector of the same length as *metrics*. Each element of *windowSize* corresponds to the elements 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)>]]`.\n\n**Note:**\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n* Nested aggregate function calls are not supported in *metrics*.\n\n**dummyTable** is a table object whose schema must be the same as the input stream table. Whether *dummyTable* contains data does not matter.\n\n**outputTable** is a table to which the engine inserts calculation results. It can be an in-memory table or a DFS table. Create an empty table and specify the column names and types before calling the function.\n\nThe output columns are in the following order:\n\n(1) The first column must be a time column.\n\n* If *useSystemTime* = true, it is TIMESTAMP; Otherwise, it has the same data type as *timeColumn*;\n* If *useWindowStartTime* = true, the column displays the start time of each window; Otherwise, it displays the end time of each window.\n\n(2) If *keyColumn* is specified, the subsequent column(s) must be in the same order as that specified by *keyColumn*.\n\n(3) If *outputElapsedMicroseconds* is set to true, you need to specify a column of LONG type. See the *outputElapsedMicroseconds* parameter for details.\n\n(4) Then followed by one or more result columns.\n\n**Note**: Starting from version 2.00.10, the engine supports a user-defined aggregate function to merge multiple results in an array vector column. The result column in the output table must be in the form of array vector (i.e., append a pair of square brackets (\\[]) to the data type). See example 3.\n\n**timeColumn** (optional) is a STRING scalar or vector specifying the time column(s) of the subscribed stream table. When *useSystemTime* = false, it must be specified.\n\nNote: If *timeColumn* is a vector, it must have a date element (of DATE type) and a time element (of TIME, SECOND or NANOTIME type). In this case, the first column in *outputTable* must take the data type of concatDateTime(date, time).\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time when data is ingested into the engine.\n\n* *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.\n* *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. Note that the record which triggers the calculation will not participate in this calculation.\n\nFor 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.\n\n**keyColumn** (optional) is a STRING scalar/vector indicating the name of the grouping column(s). If it is specified, the engine conducts the calculations within each group. For example, group the data by stock symbol and apply moving aggregation functions to each stock.\n\nGrouping column(s) can be array vectors (see Example 5). When the *keyColumn* contains an array vector, the engine first flattens the array vector into a one-dimensional vector and then performs grouping based on the flattened records. In this case, the following conditions must be met:\n\n* All array vectors must have the same number of elements in each row.\n* The length of the calculation results for expressions in metrics must match the total length of the flattened array vectors (e.g. `sum(iif(flatten(orderTypeList)!=2,0，flatten(orderQtyList)/180))` ).\n\n**garbageSize** (optional) is a positive integer. The default value is 50,000 (rows). The subscribed data continues to accumulate in the engine. When the number of rows of historical data in the memory exceeds *garbageSize*, the system will clear the historical data that is no longer needed.\n\n**Note:** For incremental operators, the data no longer needed will be automatically removed from memory. However, for full operators, this parameter must be specified to enable garbage collection.\n\n**updateTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*. It is used to trigger window calculations at an interval shorter than *step*. *step* must be a multiple of *updateTime*. To specify *updateTime*, *useSystemTime* must be set to false.\n\nIf *updateTime* is not specified, calculation for a window will not occur before the window ends. By specifying *updateTime*, you can calculate the values for several times in an window of which calculation hasn't been triggered for a long time.\n\nThe calculations within a window are triggered with the following rules:\n\n* Starting from the left boundary of the window, every time a new record arrives after the specified *updateTime* interval, all the data before this record within the current window will be calculated. If it still has unprocessed data after 2\\**updateTime* (at least 2 seconds), all data in this window is calculated.\n* If *keyColumn* is specified, these rules apply within each group.\n\nIt is recommended to specify a keyed table for *outputTable* if *updateTime* is set. If *outputTable* is a standard in-memory table or stream table, it will have multiple results for each timestamp (in each group). It is not recommended to use a keyed stream table either as the records of a keyed stream table cannot be updated.\n\n**useWindowStartTime** (optional) is a Boolean value indicating whether the time column in *outputTable* is the starting time of the windows. The default value is false, which means the timestamps in the output table are the end time of the windows. If the *windowSize* is a vector, *useWindowStartTime* must be false.\n\n**roundTime** (optional) is a Boolean value indicating the method to align the window boundary if the time precision is milliseconds or seconds and step is bigger than one minute. The default value is true indicating the alignment is based on the multi-minute rule (see the [alignment rules](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html#alignment-rules)). False means alignment is based on the one-minute rule.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**fill** (optional) is a vector/scalar indicating the filling method to deal with an empty window (in a group). It can be:\n\n* 'none': no result\n* 'null': output a null value.\n* 'ffill': output the result in the last window.\n* specific value: output the specified value. Its type should be the same as metrics output's type.\n\n*fill* could be a vector to specify different filling method for each metric. The size of the vector must be consistent with the number of elements specified in *metrics*. The element in vector cannot be 'none'.\n\n**forceTriggerTime** (optional) is a non-negative integer which takes the same time precision as *timeColumn*, indicating the waiting time to force trigger calculation in the uncalculated windows for each group. If *forceTriggerTime* is set, *useSystemTime* must be false and *updateTime* cannot be specified.\n\nThe rules are as follow:\n\n(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.\n\n(2) If no data is ingested into a group after the last window is calculated, and new data continues to ingest into other groups, the specified *fill* parameter can be used to fill results for empty windows of that group. The group's windows will still be output at the latest time point. If parameter *fill* is not specified, no new windows will be generated for that group after the last window has been triggered for computation.\n\nNote the following points when setting *forceTriggerTime* or *updateTime*:\n\n* If *updateTime* is specified, the result of the current window calculation will be updated again when data belonging to the current window still arrives after the calculation is triggered.\n* If *forceTriggerTime* is specified, the incoming data with a timestamp within the current window will be discarded after the calculation is forced to be triggered.\n* If the time specified by `timeColumn` is of type `TIME`, it cannot determine the chronological order of data across different days based on time alone. As a result, forced triggering may fail when data spans multiple days. The time in `timeColumn` needs to include the date.\n\n**raftGroup** (optional) is an integer greater than 1, indicating ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. Specify *raftGroup* to enable high availability on the streaming engine. When an engine is created on the leader, it is also created on each follower and the engine snapshot is synchronized to the 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.\n\n**keyPurgeFreqInSec** (optional) is a positive integer, measured in seconds. It controls the periodic cleanup of keys corresponding to groups where \"window data is empty,\" in order to prevent excessive memory usage caused by the continuous growth of keys. When this parameter is specified, if the time interval between the current data insertion time and the last cleanup time is greater than or equal to *keyPurgeFreqInSec*, the group with empty window data and its corresponding key will be deleted.\n\nNote: To specify this parameter, parameter *forceTriggerTime* must be specified and parameter *fill* cannot be specified.\n\nYou can check the number of groups in a time-series streaming engine based on the column \"numGroups\" returned by [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html).\n\n**closed** (optional) is a STRING indicating whether the left or the right boundary is included.\n\n* closed = 'left': left-closed, right-open\n* closed = 'right': left-open, right-closed\n\n**outputElapsedMicroseconds** (optional) is a BOOLEAN value. The default value is false. It determines whether to output the elapsed time (in microseconds) from the time the calculation is triggered to the output of result for each window.\n\n**subWindow**(optional)is a pair of integers or DURATION values, indicating the range of the subwindow within the window specified by *windowSize*. If specified, only results calculated within subwindows will be returned and the time column of the output table displays the end time of each subwindow. The calculation of the subwindow will be triggered by the arrival of the next record after the subwindow ends. The boundary of the subwindow is determined by parameter *closed*. When *subWindow* is a pair of integers, it takes the same time precision as *timeColumn*.\n\nIf it is specified, note that:\n\n* *windowSize* must be equal to *step*.\n* Shall not specify *updateTime*>0 and *useSystemTime*=true.\n\n**parallelism** (optional) is a positive integer no greater than 63, representing the number of worker threads for parallel computation. The default value is 1. For compute-intensive workloads, adjusting this parameter appropriately can effectively utilize computing resources and reduce computation time. It is recommended to set a value less than the number of CPU cores, normally from 4 to 8.\n\n**acceptedDelay** (optional) is a positive integer specifying the maximum delay for each window to accept data. The default value is 0.\n\n* When *useSystemTime*=true, data received within the *acceptedDelay*time after the window ends will still be considered part of the current window and participate in the computation, and will not be included in the computation of the next window.\n* When *useSystemTime*=false, a window with t as right boundary will wait until a record with a timestamp equal to or later than t + *acceptedDelay* arrives. When such a record arrives, the current window closes and performs a calculation on all records within the window frame. This handles scenarios with out-of-order data.\n\n**outputHandler** (optional) is a unary function or a partial function with a single unfixed parameter. If set, the engine will not write the calculation results to the output table directly. Instead, the results will be passed as a parameter to the *outputHandler* function.\n\n**msgAsTable** (optional) is a Boolean scalar indicating whether the output data is passed into function (specified by *outputHandler*) as a table or as a tuple. If *msgAsTable*=true, the subscribed data is passed into function as a table. The default value is false, which means the output data is passed into function as a tuple of columns.\n\n#### Returns\n\nA table object.\n\n#### Alignment Rules\n\nTo facilitate observation and comparison of calculation results, the engine automatically adjusts the starting point of the first window. The alignment size (integer) will be decided by parameter *step*, *roundTime*, and the precision of *timeColumn*. When engine calculates within groups, all groups' windows will be uniformly aligned. The boundaries of each window are the same for each group.\n\n* If the data type of *timeColumn* is MONTH, the window begins in January of the year corresponding to the first arriving record.\n\n* If the data type of *timeColumn* is DATE, the boudary of the first window will not be adjusted.\n\n* If the data type of *timeColumn* is MINUTE(HH:mm), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step   | alignmentSize |\n  | ------ | ------------- |\n  | 0\\~2   | 2             |\n  | 3      | 3             |\n  | 4\\~5   | 5             |\n  | 6\\~10  | 10            |\n  | 11\\~15 | 15            |\n  | 16\\~20 | 20            |\n  | 21\\~30 | 30            |\n  | >30    | 60 (1 hour)   |\n\n  *if roundTime=true*:\n\n  The value of *alignmentSize* is same as above table if *step*<=30; The value of *alignmentSize* is as folllows if *step*>30:\n\n  | step       | alignmentSize   |\n  | ---------- | --------------- |\n  | 31\\~60     | 60 (1 hour)     |\n  | 60\\~120    | 120 (2 hours)   |\n  | 121\\~180   | 180 (3 hours)   |\n  | 181\\~300   | 300 (5 hours)   |\n  | 301\\~600   | 600 (10 hours)  |\n  | 601\\~900   | 900 (15 hours)  |\n  | 901\\~1200  | 1200 (20 hours) |\n  | 1201\\~1800 | 1800 (30 hours) |\n  | >1800      | 3600 (60 hours) |\n\n* If the data type of *timeColumn* is DATETIME (yyyy-MM-dd HH:mm:ss) or SECOND (HH:mm:ss), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step   | alignmentSize |\n  | ------ | ------------- |\n  | 0\\~2   | 2             |\n  | 3      | 3             |\n  | 4\\~5   | 5             |\n  | 6\\~10  | 10            |\n  | 11\\~15 | 15            |\n  | 16\\~20 | 20            |\n  | 21\\~30 | 30            |\n  | >30    | 60 (1 minute) |\n\n  *if roundTime=true*:\n\n  The value of *alignmentSize* is same as above table if step<=30; The value of *alignmentSize* is as folllows if step>30:\n\n  | step       | alignmentSize     |\n  | ---------- | ----------------- |\n  | 31\\~60     | 60 (1 minute)     |\n  | 61\\~120    | 120 (2 minutes)   |\n  | 121\\~180   | 180 (3 minutes)   |\n  | 181\\~300   | 300 (5 minutes)   |\n  | 301\\~600   | 600 (10 minutes)  |\n  | 601\\~900   | 900 (15 minutes)  |\n  | 901\\~1200  | 1200 (20 minutes) |\n  | 1201\\~1800 | 1800 (30 minutes) |\n  | >1800      | 3600 (1 hour)     |\n\n* If the data type of *timeColumn* is TIMESTAMP(yyyy-MM-dd HH:mm:ss.mmm) or TIME(HH:mm:ss.mmm), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step         | alignmentSize      |\n  | ------------ | ------------------ |\n  | 0\\~2         | 2                  |\n  | 3\\~5         | 5                  |\n  | 6\\~10        | 10                 |\n  | 11\\~20       | 20                 |\n  | 21\\~25       | 25                 |\n  | 26\\~50       | 50                 |\n  | 51\\~100      | 100                |\n  | 101\\~200     | 200                |\n  | 201\\~250     | 250                |\n  | 251\\~500     | 500                |\n  | 501\\~1000    | 1000 (1 second)    |\n  | 1001\\~2000   | 2000 (2 seconds)   |\n  | 2001\\~3000   | 3000 (3 seconds)   |\n  | 3001\\~5000   | 5000 (5 seconds)   |\n  | 5001\\~10000  | 10000 (10 seconds) |\n  | 10001\\~15000 | 15000 (15 seconds) |\n  | 15001\\~20000 | 20000 (20 seconds) |\n  | 20001\\~30000 | 30000 (30 seconds) |\n  | >30000       | 60000 (1 minute)   |\n\n  *if roundTime=true:*\n\n  The value of *alignmentSize* is same as above table if step<=30000; The value of *alignmentSize* is as folllows if step>30000:\n\n  | step             | alignmentSize        |\n  | ---------------- | -------------------- |\n  | 30001\\~60000     | 60000 (1 minute)     |\n  | 60001\\~120000    | 120000 (2 minutes)   |\n  | 120001\\~300000   | 300000 (5 minutes)   |\n  | 300001\\~600000   | 600000 (10 minutes)  |\n  | 600001\\~900000   | 900000 (15 minutes)  |\n  | 900001\\~1200000  | 1200000 (20 minutes) |\n  | 1200001\\~1800000 | 1800000 (30 minutes) |\n  | >1800000         | 3600000 (1 hour)     |\n\n* If the data type of *timeColumn* is NANOTIMESTAMP(yyyy-MM-dd HH:mm:ss.nnnnnnnnn) or NANOTIME(HH:mm:ss.nnnnnnnnn), the value of *alignmentSize* is as follows:\n\n  *if roundTime=false*:\n\n  | step         | alignmentSize |\n  | ------------ | ------------- |\n  | 0\\~2ns       | 2ns           |\n  | 3ns\\~5ns     | 5ns           |\n  | 6ns\\~10ns    | 10ns          |\n  | 11ns\\~20ns   | 20ns          |\n  | 21ns\\~25ns   | 25ns          |\n  | 26ns\\~50ns   | 50ns          |\n  | 51ns\\~100ns  | 100ns         |\n  | 101ns\\~200ns | 200ns         |\n  | 201ns\\~250ns | 250ns         |\n  | 251ns\\~500ns | 500ns         |\n  | >500ns       | 1000ns        |\n\n  *if roundTime=true*:\n\n  | step        | alignmentSize |\n  | ----------- | ------------- |\n  | 1000ns\\~1ms | 1ms           |\n  | 1ms\\~10ms   | 10ms          |\n  | 10ms\\~100ms | 100ms         |\n  | 100ms\\~1s   | 1s            |\n  | 1s\\~2s      | 2s            |\n  | 2s\\~3s      | 3s            |\n  | 3s\\~5s      | 5s            |\n  | 5s\\~10s     | 10s           |\n  | 10s\\~15s    | 15s           |\n  | 15s\\~20s    | 20s           |\n  | 20s\\~30s    | 30s           |\n  | >30s        | 1min          |\n\nIf the time of the first record is x with data type of TIMESTAMP, then the starting time of the first window is adjusted to be `timeType_cast(x/alignmentSize*alignmentSize+step-windowSize)`, where \"/\" produces only the integer part after division. For example, if the time of the first record is 2018.10.08T01:01:01.365, *windowSize* = 120000, and *step* = 60000, then *alignmentSize* = 60000, and the starting time of the first window is timestamp(2018.10.08T01:01:01.365/60000\\*60000+60000-120000)=2018.10.08T01:01:00.000.\n\n#### Examples\n\n**Example 1**\n\nIn the following example, the time-series engine1 subscribes to the stream table \"trades\" and calculates sum(volume) for each stock in the last minute in real time. The result is saved in table output1.\n\n```\nshare streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\nengine1 = createTimeSeriesEngine(name=\"engine1\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=false)\nsubscribeTable(tableName=\"trades\", actionName=\"engine1\", offset=0, handler=append!{engine1}, msgAsTable=true);\n\ninsert into trades values(2018.10.08T01:01:01.785,`A,10)\ninsert into trades values(2018.10.08T01:01:02.125,`B,26)\ninsert into trades values(2018.10.08T01:01:10.263,`B,14)\ninsert into trades values(2018.10.08T01:01:12.457,`A,28)\ninsert into trades values(2018.10.08T01:02:10.789,`A,15)\ninsert into trades values(2018.10.08T01:02:12.005,`B,9)\ninsert into trades values(2018.10.08T01:02:30.021,`A,10)\ninsert into trades values(2018.10.08T01:04:02.236,`A,29)\ninsert into trades values(2018.10.08T01:04:04.412,`B,32)\ninsert into trades values(2018.10.08T01:04:05.152,`B,23)\n\nsleep(10)\n\nselect * from output1;\n```\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.08T01:02:00.000 | A   | 38        |\n| 2018.10.08T01:02:00.000 | B   | 40        |\n| 2018.10.08T01:03:00.000 | A   | 25        |\n| 2018.10.08T01:03:00.000 | B   | 9         |\n\nThe following paragraphs explain in details how the time-series engine conducts the calculations. For simplicity, regarding the \"time\" column we ignore the part of \"2018.10.08T\" and only use the \"hour:minute:second.millisecond\" part.\n\nFirst, the time-series engine adjusts the starting time of the first window to be 01:01:00.000. The first window is from 01:01:00.000 (inclusive) to 01:02:00.000 (exclusive). When the record (01:02:10.789,\\`A,15) arrives, it triggers the calculation of group A for the first window; the arrival of (01:02:12.005,\\`B,9) triggers the calculation of group B for the first window.\n\nThe second window is from 01:02:00.000 (inclusive) to 01:03:00.000 (exclusive). When the record (01:04:02.236,\\`A,29) arrives, it triggers the calculation of group A for the second window; the arrival of (01:04:04.412,\\`B,32) triggers the calculation of group B for the second window.\n\nAs there are no records since 01:05:00.000, no calculations are triggered for the window of \\[01:04:00.000, 01:05:00.000).\n\nThe table output1 stores the calculation results of the time-series engine. As *useWindowStartTime*=false, the timestamps in the output table are the end time of the windows. If *useWindowStartTime*=true, then the timestamps in the output table are the starting time of the windows, as illustrated in the following example:\n\n```\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output2\nengine2 = createTimeSeriesEngine(name=\"engine2\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output2, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=true)\nsubscribeTable(tableName=\"trades\", actionName=\"engine2\", offset=0, handler=append!{engine2}, msgAsTable=true)\n\nsleep(10)\nselect * from output2;\n```\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.08T01:01:00.000 | A   | 38        |\n| 2018.10.08T01:01:00.000 | B   | 40        |\n| 2018.10.08T01:02:00.000 | A   | 25        |\n| 2018.10.08T01:02:00.000 | B   | 9         |\n\n**Example 2**\n\nIn the following example, we specify *updateTime* to be 1000 (milliseconds):\n\n```\nshare keyedTable(`time`sym,10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output3\nengine3 = 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)\nsubscribeTable(tableName=\"trades\", actionName=\"engine3\", offset=0, handler=append!{engine3}, msgAsTable=true)\n\nsleep(2001)\nselect * from output3;\n```\n\n| time                    | sym | sumVolume |\n| ----------------------- | --- | --------- |\n| 2018.10.08T01:02:00.000 | A   | 38        |\n| 2018.10.08T01:02:00.000 | B   | 40        |\n| 2018.10.08T01:03:00.000 | A   | 25        |\n| 2018.10.08T01:03:00.000 | B   | 9         |\n| 2018.10.08T01:05:00.000 | B   | 55        |\n| 2018.10.08T01:05:00.000 | A   | 29        |\n\nNext, we will explain the calculations triggered in the last window from 01:04:00.000 to 01:05:00.000.\n\n(1) At 01:04:04.236, 2000 milliseconds after the first record of group A arrived, a group A calculation is triggered. The result (01:05:00.000, \\`A, 29) is written to the output table.\n\n(2) The record of group B at 01:04:05.152 is the first record after the small window of \\[01:04:04.000, 01:04:05.000) that contains the group B record at 01:04:04.412. It triggers a group B calculation. The result (01:05:00.000,\"B\",32) is written to the output table.\n\n(3) 2000 milliseconds later, at 01:04:07.152, as the B group record at 1:04:05.152 has not been used in a calculation, a group B calculation is triggered. The result is (01:05:00.000,\"B\",55). As the output table's keys are columns 'time' and 'sym', the record of (01:05:00.000,\\`B,32) in the output table is updated and becomes (01:05:00.000,\\`B,55).\n\nIn the example, the shared stream table \"pubT\" contains two time columns with the type of DATE and SECOND. When creating time series engine, the two time columns could be combined into one column with the type of DATETIME in output table \"streamMinuteBar\\_1min\" by setting *timeColumn*.\n\n```\ncolNames=`symbol`date`minute`price`type`volume\ncolTypes=`SYMBOL`DATE`SECOND`DOUBLE`STRING`INT\npubTable = streamTable(10000:0,colNames,colTypes)\nshare pubTable as pubT\n\ncolNames = `time`symbol`open`max`min`close`volume`amount`ret`vwap\ncolTypes = `DATETIME`SYMBOL`DOUBLE`DOUBLE`DOUBLE`DOUBLE`INT`DOUBLE`DOUBLE`DOUBLE\nshare streamTable(10000:0,colNames, colTypes) as streamMinuteBar_1min\n\ntsAggrOHLC = createTimeSeriesEngine(name=\"subT\", windowSize=60, step=60, metrics=<[first(price) as open ,max(price) as max,min(price) as min ,last(price) as close ,sum(volume) as volume ,wsum(volume, price) as amount ,(last(price)-first(price)/first(price)) as ret, (wsum(volume, price)/sum(volume)) as vwap]>, dummyTable=pubTable, outputTable=streamMinuteBar_1min, timeColumn=`date`minute, useSystemTime=false, keyColumn='symbol', fill=`none)\nsubscribeTable(tableName=\"pubT\", actionName=\"subT\", offset=-1, handler=append!{tsAggrOHLC}, msgAsTable=true)\n\ninsert into pubT values(`000001, 2021.04.05, 09:25:01, 1, 'B', 1)\ninsert into pubT values(`000001, 2021.04.05, 09:30:05, 2, 'B', 1)\ninsert into pubT values(`000001, 2021.04.05, 09:31:06, 3, 'B', 1)\ninsert into pubT values(`000001, 2021.04.05, 09:35:05, 4, 'S', 4)\ninsert into pubT values(`000001, 2021.04.05, 09:40:05, 5, 'S', 5)\ninsert into pubT values(`000001, 2021.04.06, 09:25:05, 6, 'S', 6)\n```\n\n| symbol | date       | minute   | price | type | volume |\n| ------ | ---------- | -------- | ----- | ---- | ------ |\n| 000001 | 2021.04.05 | 09:25:01 | 1     | B    | 1      |\n| 000001 | 2021.04.05 | 09:30:05 | 2     | B    | 1      |\n| 000001 | 2021.04.05 | 09:31:06 | 3     | B    | 1      |\n| 000001 | 2021.04.05 | 09:35:05 | 4     | S    | 4      |\n| 000001 | 2021.04.05 | 09:40:05 | 5     | S    | 5      |\n| 000001 | 2021.04.06 | 09:25:05 | 6     | S    | 6      |\n\n```\nselect * from streamMinuteBar_1min\n```\n\n| time                | symbol | open | max | min | close | volume | amount | ret | vwap |\n| ------------------- | ------ | ---- | --- | --- | ----- | ------ | ------ | --- | ---- |\n| 2021.04.05T09:26:00 | 000001 | 1    | 1   | 1   | 1     | 1      | 1      | 0   | 1    |\n| 2021.04.05T09:31:00 | 000001 | 2    | 2   | 2   | 2     | 1      | 2      | 1   | 2    |\n| 2021.04.05T09:32:00 | 000001 | 3    | 3   | 3   | 3     | 1      | 3      | 2   | 3    |\n| 2021.04.05T09:36:00 | 000001 | 4    | 4   | 4   | 4     | 4      | 16     | 3   | 4    |\n| 2021.04.05T09:41:00 | 000001 | 5    | 5   | 5   | 5     | 5      | 25     | 4   | 5    |\n\n```\nshare streamTable(1000:0, `time`sym`qty, [DATETIME, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumQty, [DATETIME, SYMBOL, INT]) as output3\n\nengine = createTimeSeriesEngine(name=\"engine\", windowSize=6, step=6, metrics=<sum(qty)>, dummyTable=trades, outputTable=output3, timeColumn=`time,keyColumn=`sym, forceTriggerTime=7,fill=1000)\nsubscribeTable(tableName=\"trades\", actionName=\"engine\", offset=0, handler=append!{engine}, msgAsTable=true)\nsleep(1000)\ninsert into engine values(2018.08.01T14:05:43,`A,1)\ninsert into engine values(2018.08.01T14:05:43,`C,3)\nsleep(10)\ninsert into engine values(2018.08.01T14:05:44,`B,1)\nsleep(80)\ninsert into engine values(2018.08.01T14:05:52,`B,3)\nsleep(20)\ninsert into engine values(2018.08.01T14:05:54,`A,3)\nsleep(10)\ninsert into engine values(2018.08.01T14:05:55,`A,5)\nsleep(20)\ninsert into engine values(2018.08.01T14:05:57,`B,5)\nsleep(50)\ninsert into engine values(2018.08.01T14:06:12,`A,1)\nsleep(50)\nselect * from output3 order by sym\n```\n\n| time                | sum | Qty   |\n| ------------------- | --- | ----- |\n| 2018.08.01T14:05:46 | A   | 1     |\n| 2018.08.01T14:05:52 | A   | 1,000 |\n| 2018.08.01T14:05:58 | A   | 8     |\n| 2018.08.01T14:06:04 | A   | 1,000 |\n| 2018.08.01T14:06:10 | A   | 1,000 |\n| 2018.08.01T14:05:46 | B   | 1     |\n| 2018.08.01T14:05:52 | B   | 1,000 |\n| 2018.08.01T14:05:58 | B   | 8     |\n| 2018.08.01T14:05:46 | C   | 3     |\n| 2018.08.01T14:05:52 | C   | 1,000 |\n\n**Example 3**\n\nThe following example calculates the first/last volume in each window and merges the result in an array vector column.\n\n```\n// Define a function toVector with defg. The results are merged into array vectors\ndefg toVector(x){\n    return x\n}\nshare streamTable(1000:0, `time`sym`volume`price, [TIMESTAMP, SYMBOL, DOUBLE,DOUBLE]) as trades\n// Define the output table and specify the result column as DOUBLE[] type\nshare table(10000:0, `time`sym`sumVolume`avg, [TIMESTAMP,STRING,DOUBLE[],DOUBLE]) as output1\n// Call toVector in metrics to combine the first and last volumes in a 1-minute window into an array vector\nengine1 = createTimeSeriesEngine(name=\"engine1\", windowSize=60000, step=60000, metrics=<[toVector([first(volume),last(volume)]),avg(volume+price)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, keyColumn=`sym , useSystemTime=false, garbageSize=50, useWindowStartTime=false)\n\ntimes = sort(2023.10.08T00:00:00.000 + rand(1..(1+3000*200), 30))\nsyms = rand(\"A\"+string(1..10), 30)\nvolumes = rand(rand(100.0, 10) join 2.3 NULL NULL NULL NULL, 30)\nprices = rand(rand(100.0, 10) join 2.3 NULL NULL NULL NULL, 30)\nt=table(times as time, syms as sym, volumes as volume,prices as price)\n\nengine1.append!(t)\n\nselect * from output1 where time between 2023.10.08T00:01:00.000 and 2023.10.08T00:05:00.000 order by time,sym \n```\n\n| time                    | sym | sumVolume                             | avg                |\n| ----------------------- | --- | ------------------------------------- | ------------------ |\n| 2023.10.08 00:01:00.000 | A1  | \\[, ]                                 |                    |\n| 2023.10.08 00:02:00.000 | A4  | \\[2.3, 2.3]                           |                    |\n| 2023.10.08 00:03:00.000 | A10 | \\[68.5665876371786, 68.5665876371786] | 121.97567140683532 |\n| 2023.10.08 00:03:00.000 | A6  | \\[, 22.65533998142928]                | 33.386794407851994 |\n\n**Example 4**\n\nThe following example specifies the parameter *subWindow*.\n\n```\n\nshare streamTable(1000:0, `time`sym`volume, [TIMESTAMP, SYMBOL, INT]) as trades\nshare table(10000:0, `time`sym`sumVolume, [TIMESTAMP, SYMBOL, INT]) as output1\n//specify a 10-second subwindow within a 1-min window. With closed unspecified, the subwindow takes the default value, i.e., left-closed, right-open window, [0s, 10s).\nengine4 = createTimeSeriesEngine(name=\"engine4\", windowSize=60000, step=60000, metrics=<[sum(volume)]>, dummyTable=trades, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50, useWindowStartTime=true, subWindow=0s:10s)\n\nsubscribeTable(tableName=\"trades\", actionName=\"engine4\", offset=0, handler=append!{engine4}, msgAsTable=true);\n\ninsert into trades values(2018.10.08T01:01:01.785,`A,10)\ninsert into trades values(2018.10.08T01:01:02.125,`B,26)\ninsert into trades values(2018.10.08T01:01:10.000,`A,14)\ninsert into trades values(2018.10.08T01:01:12.457,`A,28)\n\nsleep(10)\n\nselect * from output1;\n\n```\n\nThe calculation for group \"A\" within the subwindow \\[2018.10.08T01:01:00.000, 2018.10.08T01:01:10.000) is triggered by the arrival of data at 2018.10.08T01:01:10.000. No new data from group \"B\" is received after the subwindow ends, so the calculation of group \"B\" is not triggered.\n\n<table id=\"table_mzg_pwy_21c\"><thead><tr><th>\n\ntime\n\n</th><th>\n\nsym\n\n</th><th>\n\nsumVolume\n\n</th></tr></thead><tbody><tr><td>\n\n2018.10.08T01:01:10.000\n\n</td><td>\n\nA\n\n</td><td>\n\n10\n\n</td></tr></tbody>\n</table>**Example 5**\n\nThis example shows how to aggregate order value and order count for each price level by stock symbol and buy/sell side, where order prices are provided as array vectors.\n\n```\nshare streamTable(1000:0, [\"time\",\"sym\",\"side\",\"orderPrice\",\"orderQty\"],   \n    [TIMESTAMP, SYMBOL, SYMBOL, DOUBLE[], INT[]]) as orderStream  \n  \nshare table(10000:0, [\"time\",\"sym\",\"side\", \"orderPrice\", \"totalValue\", \"orderCount\"],   \n    [TIMESTAMP, SYMBOL, SYMBOL, DOUBLE, DOUBLE, INT]) as result  \n  \n// Create a time-series engine: group by stock symbol, buy/sell side, and order price \nengine = createTimeSeriesEngine(  \n    name=\"orderEngine\",   \n    windowSize=60000,   \n    step=60000,   \n    metrics=<[  \n        sum(orderPrice * orderQty),               \n        count(orderPrice)                 \n    ]>,   \n    dummyTable=orderStream,   \n    outputTable=result,   \n    timeColumn=\"time\",   \n    keyColumn=`sym`side`orderPrice, \n    useSystemTime=false  \n)  \n\n \nn = 100  \ntime = 2023.01.01T09:30:00.000 + (1..n)*1000  \nsym = take(`AAPL`MSFT, n)  \nside = take(`Buy`Sell, n)  \norderPrice = arrayVector((1..n) * 5, rand(100.0 105.0, 5*n))  \norderQty = arrayVector((1..n) * 5, rand(100 1000, 5*n)) \n   \ninsert into engine values(time, sym, side, orderPrice, orderQty)\n\n// View the result\nselect * from result\n```\n\n| time                    | sym  | side | orderPrice | totalValue | orderCount |\n| ----------------------- | ---- | ---- | ---------- | ---------- | ---------- |\n| 2023.01.01 09:31:00.000 | AAPL | Buy  | 100        | 4,430,000  | 74         |\n| 2023.01.01 09:31:00.000 | AAPL | Buy  | 105        | 5,050,500  | 76         |\n| 2023.01.01 09:31:00.000 | MSFT | Sell | 100        | 4,720,000  | 76         |\n| 2023.01.01 09:31:00.000 | MSFT | Sell | 105        | 3,654,000  | 69         |\n\n**Example 6**\n\nSet *windowSize* to a vector to compute data in 1-minute windows and 3-minute windows simultaneously.\n\nWhen *windowSize* is a vector, each window length can correspond to a separate set of metrics. This example outputs both the 1-minute sum of volume and the 3-minute average price at the same time.\n\n```\nshare streamTable(1000:0, [\"time\",\"sym\",\"volume\",\"price\"], [TIMESTAMP, SYMBOL, INT, DOUBLE]) as tradesWS\nshare table(1000:0, [\"time\",\"sym\",\"sum1m\",\"avgPrice3m\"], [TIMESTAMP, SYMBOL, INT, DOUBLE]) as outputWS\n\nengineWS = createTimeSeriesEngine(\n  name=\"engineWS\",\n  windowSize=[60000, 180000],\n  step=60000,\n  metrics=(<[sum(volume) as sum1m]>, <[avg(price) as avgPrice3m]>),\n  dummyTable=tradesWS,\n  outputTable=outputWS,\n  timeColumn=\"time\",\n  keyColumn=\"sym\",\n  useSystemTime=false\n)\n\nsubscribeTable(tableName=\"tradesWS\", actionName=\"engineWS\", offset=0, handler=append!{engineWS}, msgAsTable=true)\n\ninsert into tradesWS values(2024.01.01T10:00:10.000, `A, 10, 100.0)\ninsert into tradesWS values(2024.01.01T10:00:20.000, `B, 16, 104.0)\ninsert into tradesWS values(2024.01.01T10:00:40.000, `A, 20, 101.0)\ninsert into tradesWS values(2024.01.01T10:01:10.000, `A, 15, 102.0)\ninsert into tradesWS values(2024.01.01T10:01:20.000, `B, 20, 105.0)\ninsert into tradesWS values(2024.01.01T10:02:05.000, `A, 30, 103.0)\ninsert into tradesWS values(2024.01.01T10:03:10.000, `A, 12, 104.0)\n\nsleep(10)\nselect * from outputWS\n```\n\nThe output is as follows:\n\n| time                    | sym | sum1m | avgPrice3m |\n| ----------------------- | --- | ----- | ---------- |\n| 2024.01.01 10:01:00.000 | A   | 30    | 100.5      |\n| 2024.01.01 10:01:00.000 | B   | 16    | 104        |\n| 2024.01.01 10:02:00.000 | A   | 15    | 101        |\n| 2024.01.01 10:03:00.000 | A   | 30    | 101.5      |\n\nWhere:\n\n* Elements in `windowSize=[60000, 180000]` correspond to 1-minute and 3-minute windows, respectively.\n\n* The first element in *metrics* corresponds to the 1-minute window, and the second element corresponds to the 3-minute window.\n\n* The two columns in the output table store the aggregation results for different window lengths, respectively.\n\n**Example 7**\n\nSet *roundTime* and *step* to control how windows are aligned.\n\nWhen the time precision is milliseconds or seconds and *step* is greater than 1 minute, *roundTime* affects how the first window boundary is aligned. This example compares two engines with the same parameters except for different *roundTime* values.\n\n```\nshare streamTable(1000:0, [\"time\",\"volume\"], [TIMESTAMP, INT]) as tradesRT\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputRTTrue\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputRTFalse\n\nengineRTTrue = createTimeSeriesEngine(\n   name=\"engineRTTrue\",\n   windowSize=240000,\n   step=120000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesRT,\n   outputTable=outputRTTrue,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   roundTime=true\n)\n\nengineRTFalse = createTimeSeriesEngine(\n   name=\"engineRTFalse\",\n   windowSize=240000,\n   step=120000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesRT,\n   outputTable=outputRTFalse,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   roundTime=false\n)\n\nsubscribeTable(tableName=\"tradesRT\", actionName=\"engineRTTrue\", offset=0, handler=append!{engineRTTrue}, msgAsTable=true)\nsubscribeTable(tableName=\"tradesRT\", actionName=\"engineRTFalse\", offset=0, handler=append!{engineRTFalse}, msgAsTable=true)\n\ninsert into tradesRT values(2024.01.01T10:03:30.500, 10)\ninsert into tradesRT values(2024.01.01T10:04:20.000, 20)\ninsert into tradesRT values(2024.01.01T10:06:01.000, 5)\n```\n\nFor the engine with *roundTime*=true, execute `select * from outputRTTrue`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:04:00.000 | 10        |\n| 2024.01.01 10:06:00.000 | 30        |\n\nFor the engine with *roundTime*=false, execute `select * from outputRTFalse`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:05:00.000 | 30        |\n\n* In this example, the time of the first data record is `x=2024.01.01T10:03:30.500`; *windowSize* is 240000 (4 minutes).\n\n* When *roundTime*=true, *step*=120000 falls within the 60001\\~120000 range at millisecond precision, and the corresponding alignmentSize is 120000 (2 minutes). First, align x to 2 minutes: `timestamp(x/120000*120000)=2024.01.01T10:02:00.000`; Then substitute into the formula to get the left boundary `2024.01.01T10:02:00.000 + 120000 - 240000 = 2024.01.01T10:00:00.000`, so the first window is \\[10:00:00.000, 10:04:00.000).\n\n* When *roundTime*=false, the data is at millisecond precision and *step*>30000, so the corresponding alignmentSize is 60000 (1 minute). First, align x to 1 minute: `timestamp(x/60000*60000)=2024.01.01T10:03:00.000`; Then substitute into the formula to get the left boundary `2024.01.01T10:03:00.000 + 120000 - 240000 = 2024.01.01T10:01:00.000`, so the first window is \\[10:01:00.000, 10:05:00.000).\n\n* The record at 10:03:30.500 falls into the first window under both settings, but the start and end ranges of the first window differ; Furthermore, 10:04:20.000 falls into the next window \\[10:02, 10:06) when *roundTime*=true, but still falls into the first window \\[10:01, 10:05) when *roundTime*=false.\n\n**Example 8**\n\nSet *closed* to control how boundary values are handled.\n\n*closed*='left' indicates left-closed right-open, and *closed*='right' indicates left-open right-closed. If the data falls exactly on a window boundary, different settings affect which window the data belongs to.\n\n```\nshare streamTable(1000:0, [\"time\",\"volume\"], [TIMESTAMP, INT]) as tradesCL\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputLeft\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as outputRight\n\nengineLeft = createTimeSeriesEngine(\n   name=\"engineLeft\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesCL,\n   outputTable=outputLeft,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   closed=\"left\"\n)\n\nengineRight = createTimeSeriesEngine(\n   name=\"engineRight\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesCL,\n   outputTable=outputRight,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   closed=\"right\"\n)\n\nsubscribeTable(tableName=\"tradesCL\", actionName=\"engineLeft\", offset=0, handler=append!{engineLeft}, msgAsTable=true)\nsubscribeTable(tableName=\"tradesCL\", actionName=\"engineRight\", offset=0, handler=append!{engineRight}, msgAsTable=true)\n\ninsert into tradesCL values(2024.01.01T10:00:10.000, 10)\ninsert into tradesCL values(2024.01.01T10:01:00.000, 20)\ninsert into tradesCL values(2024.01.01T10:01:10.000, 1)\n```\n\nFor the engine with *closed*=\"left\", execute `select * from outputLeft`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:01:00.000 | 10        |\n\nFor the engine with *closed*=\"right\", execute `select * from outputRight`, and the output is as follows:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:01:00.000 | 30        |\n\n* When *closed*=\"left\", the time of the second record is exactly 10:01:00.000, which belongs to the next window \\[10:01, 10:02), so the first window only counts 10.\n\n* When *closed*=\"right\", the same boundary data belongs to the previous window (10:00, 10:01], so the result for the first window becomes `10 + 20 = 30`.\n\n**Example 9**\n\nSet *outputElapsedMicroseconds* and *acceptedDelay*.\n\n* Use *acceptedDelay* to accept out-of-order data that arrives within a certain range after the window ends;\n\n* Use *outputElapsedMicroseconds*=true to output the elapsed time from the computation trigger to output for each result.\n\n```\nshare streamTable(1000:0, [\"time\",\"sym\",\"volume\"], [TIMESTAMP, SYMBOL, INT]) as tradesAD\nshare table(1000:0, [\"time\",\"sym\",\"elapsedUs\",\"sumVolume\"], [TIMESTAMP, SYMBOL, LONG, INT]) as outputAD\n\nengineAD = createTimeSeriesEngine(\n   name=\"engineAD\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesAD,\n   outputTable=outputAD,\n   timeColumn=\"time\",\n   keyColumn=\"sym\",\n   useSystemTime=false,\n   acceptedDelay=5000,\n   outputElapsedMicroseconds=true\n)\n\nsubscribeTable(tableName=\"tradesAD\", actionName=\"engineAD\", offset=0, handler=append!{engineAD}, msgAsTable=true)\n\ninsert into tradesAD values(2024.01.01T10:00:10.000, `A, 10)\ninsert into tradesAD values(2024.01.01T10:00:40.000, `A, 20)\ninsert into tradesAD values(2024.01.01T10:01:02.000, `A, 1)\ninsert into tradesAD values(2024.01.01T10:00:55.000, `A, 30)\ninsert into tradesAD values(2024.01.01T10:01:06.000, `A, 2)\n\nsleep(10)\nselect * from outputAD\n```\n\nThe output is as follows:\n\n| time                    | sym | elapsedUs | sumVolume |\n| ----------------------- | --- | --------- | --------- |\n| 2024.01.01 10:01:00.000 | A   | 2         | 60        |\n\n* In this example, the window is \\[10:00:00, 10:01:00).\n\n* When *acceptedDelay*=5000, the window can still accept data within 5 seconds after it ends.\n\n* Although record 4 with time 10:00:55.000 arrives later than 10:01:02.000, it is still within the allowed delay range, so it is still counted in the first window.\n\n* Record 5 has a time of 10:01:06.000, which satisfies the condition “data received with a timestamp greater than or equal to the current window's end timestamp + acceptedDelay”, thus triggering the output of the first window, with the result `10 + 20 + 30 = 60`.\n\n**Example 10**\n\nSet outputHandler and msgAsTable.\n\nAfter setting *outputHandler*, the computation results are not written to the outputTable; instead, the defined unary function is called to process the computation results. *msgAsTable* is used to control the structure of the callback parameter:\n\n* *msgAsTable*=false: the callback parameter is a tuple composed of columns;\n\n* *msgAsTable*=true: the callback parameter is a table.\n\n```\nshare streamTable(1000:0, [\"time\",\"volume\"], [TIMESTAMP, INT]) as tradesOH\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as ignoredTuple\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as ignoredTable\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as tupleResult\nshare table(1000:0, [\"time\",\"sumVolume\"], [TIMESTAMP, INT]) as tableResult\n\ndef handleTuple(msg){\n   tupleResult.tableInsert(msg[0],msg[1])\n}\n\ndef handleTable(msg){\n   tableResult.append!(msg)\n}\n\nengineTuple = createTimeSeriesEngine(\n   name=\"engineTuple\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesOH,\n   outputTable=ignoredTuple,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   outputHandler=handleTuple,\n   msgAsTable=false\n)\n\nengineTable = createTimeSeriesEngine(\n   name=\"engineTable\",\n   windowSize=60000,\n   step=60000,\n   metrics=<[sum(volume) as sumVolume]>,\n   dummyTable=tradesOH,\n   outputTable=ignoredTable,\n   timeColumn=\"time\",\n   useSystemTime=false,\n   outputHandler=handleTable,\n   msgAsTable=true\n)\n\nsubscribeTable(tableName=\"tradesOH\", actionName=\"engineTuple\", offset=0, handler=append!{engineTuple}, msgAsTable=true)\nsubscribeTable(tableName=\"tradesOH\", actionName=\"engineTable\", offset=0, handler=append!{engineTable}, msgAsTable=true)\n\ninsert into tradesOH values(2024.01.01T10:00:10.000, 10)\ninsert into tradesOH values(2024.01.01T10:00:40.000, 20)\ninsert into tradesOH values(2024.01.01T10:01:10.000, 5)\n```\n\nExecute `select * from tupleResult` and `select * from tableResult`, respectively.\n\nThe results of tupleResult and tableResult are both:\n\n| time                    | sumVolume |\n| ----------------------- | --------- |\n| 2024.01.01 10:01:00.000 | 30        |\n\n* In engineTuple, `handleTuple` receives column tuples, and the unary function uses `tableInsert` to insert `msg[0]` and `msg[1]` into the target table.\n\n* In engineTable, `handleTable` directly receives the result table, and the unary function uses `append!` to insert the result table into the target table.\n\nExecute `select * from ignoredTuple` and `select * from ignoredTable`, respectively; both outputs are empty. This is because *outputHandler* is set, so the computation results are not written to ignoredTuple or ignoredTable.\n"
    },
    "createUser": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createUser.html",
        "signatures": [
            {
                "full": "createUser(userId, password, [groupIds], [isAdmin=false], [authMode])",
                "name": "createUser",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    },
                    {
                        "full": "password",
                        "name": "password"
                    },
                    {
                        "full": "[groupIds]",
                        "name": "groupIds",
                        "optional": true
                    },
                    {
                        "full": "[isAdmin=false]",
                        "name": "isAdmin",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[authMode]",
                        "name": "authMode",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createUser](https://docs.dolphindb.com/en/Functions/c/createUser.html)\n\n\n\n#### Syntax\n\ncreateUser(userId, password, \\[groupIds], \\[isAdmin=false], \\[authMode])\n\n#### Details\n\nCreate a user. It can only be executed by an administrator.\n\nThe groups in *groupIds* must have been created with [createGroup](https://docs.dolphindb.com/en/Functions/c/createGroup.html).\n\n#### Parameters\n\n**userId** is a string indicating a user name. It can only contain letters, underscores, or numbers. It cannot start with numbers or underscores. The length cannot exceed 30 characters.\n\n**password** is a string indicating the password. It cannot contain space or control characters.\n\nSince DolphinDB 2.00.10.10, users can determine whether to verify the complexity of *password* by setting the configuration *enhancedSecurityVerification*. If it is not specified, no verification will be applied; if it is set to true, the password must meet the following conditions:\n\n* 8-20 characters\n\n* at least 1 capital letter\n\n* at least 1 special character, including !\"#$%&'()\\*+,-./:;<=>?@\\[]^\\_\\`{|}\\~\n\n**groupIds** (optional) is a STRING scalar/vector indicating the group(s) the user belongs to.\n\n**isAdmin** (optional) is a Boolean value indicating whether the user is an administrator.\n\n**authMode**(optional) specifies the authentication method for user login. By default, it uses \"sha256\", allowing users to log in via the `login` function with SHA-256 authentication. Alternatively, you can set it to \"scram\", which enables login via the SCRAM (Salted Challenge Response Authentication Mechanism) protocol for enhanced security.\n\n**Note:**\n\nSCRAM is implemented based on the [IETF's RFC 5802 standard](https://datatracker.ietf.org/doc/html/rfc5802). Through high-strength hash algorithms, mutual authentication, and other measures, it provides higher security for password-based login.\n\nDolphinDB's API already supports SCRAM authentication:\n\n* When connecting to a DolphinDB server using the API's native methods, the API will prioritize SCRAM authentication.\n* If the user has not enabled SCRAM authentication, it will automatically fall back to the default login method.\n* If not using the API's encapsulated interfaces and opting for manual SCRAM login, you need to call the scramClientFirstand scramClientFinal functions from the server side. For specific procedures, refer to the function documentation.\n\nAfter enabling SCRAM authentication, password-related functions such as `login`, `resetPwd`, and `changePwd` remain valid.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nCreate a non-admin user with username 'JohnSmith' and password 'Qb0507'. This user will use the default SHA-256 authentication method for login. This user belongs to group \"research\" and group \"production. He is not an administrator.\n\n```\ncreateUser(`JohnSmith, \"Qb0507#$\", `research`production);\n```\n"
    },
    "createWindowJoinEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createWindowJoinEngine.html",
        "signatures": [
            {
                "full": "createWindowJoinEngine(name, leftTable, rightTable, outputTable, window, metrics, matchingColumn, [timeColumn], [useSystemTime=false], [garbageSize = 5000], [maxDelayedTime], [nullFill], [outputElapsedMicroseconds=false], [sortByTime], [closed], [snapshotDir], [snapshotIntervalInMsgCount],[cachedTableCapacity=1024], [keyPurgeFreqInSec], [timeoutTrigger])",
                "name": "createWindowJoinEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "leftTable",
                        "name": "leftTable"
                    },
                    {
                        "full": "rightTable",
                        "name": "rightTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "matchingColumn",
                        "name": "matchingColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[garbageSize = 5000]",
                        "name": "[garbageSize = 5000]"
                    },
                    {
                        "full": "[maxDelayedTime]",
                        "name": "maxDelayedTime",
                        "optional": true
                    },
                    {
                        "full": "[nullFill]",
                        "name": "nullFill",
                        "optional": true
                    },
                    {
                        "full": "[outputElapsedMicroseconds=false]",
                        "name": "outputElapsedMicroseconds",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[sortByTime]",
                        "name": "sortByTime",
                        "optional": true
                    },
                    {
                        "full": "[closed]",
                        "name": "closed",
                        "optional": true
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[cachedTableCapacity=1024]",
                        "name": "cachedTableCapacity",
                        "optional": true,
                        "default": "1024"
                    },
                    {
                        "full": "[keyPurgeFreqInSec]",
                        "name": "keyPurgeFreqInSec",
                        "optional": true
                    },
                    {
                        "full": "[timeoutTrigger]",
                        "name": "timeoutTrigger",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [createWindowJoinEngine](https://docs.dolphindb.com/en/Functions/c/createWindowJoinEngine.html)\n\n\n\n#### Syntax\n\ncreateWindowJoinEngine(name, leftTable, rightTable, outputTable, window, metrics, matchingColumn, \\[timeColumn], \\[useSystemTime=false], \\[garbageSize = 5000], \\[maxDelayedTime], \\[nullFill], \\[outputElapsedMicroseconds=false], \\[sortByTime], \\[closed], \\[snapshotDir], \\[snapshotIntervalInMsgCount],\\[cachedTableCapacity=1024], \\[keyPurgeFreqInSec], \\[timeoutTrigger])\n\n#### Details\n\nCreate a window join streaming engine. Return a table object that is the real-time [window join](https://docs.dolphindb.com/en/Programming/SQLStatements/TableJoiners/windowjoin.html) result of a left table and a right table.\n\nData ingested into the engine is grouped by *matchingColumn*. Within a group, for each record in the left table, calculate the *metrics* over the specified window in the right table and return the metrics in additional columns.\n\n**Standard windows (i.e., *window* = *a:b*)**:\n\nThe windows over the right table are determined by the current timestamp in the left table and the specified parameter *window*. Suppose the current timestamp in the left table is *t*, and window is set to *a:b*, then the corresponding window in the right table consists of records with timestamps in \\[t+a, t+b]. The engine returns the join result containing the results of the metrics calculated using the windowed data.\n\nWindow triggering rules:\n\n* A window is triggered when a timestamp (with the same *matchingColumn* value) past the end of that window arrives in the right table. The record itself does not participate in the calculation of that window.\n* If *maxDelayedTime* is specified - a new timestamp *t* (regardless of its *matchingColumn* value) in the right table triggers an uncalculated window when *t > b + maxDelayedTime*\n\n**Special windows (i.e., *window* = *0:0*):**\n\nThe windows over the right table are determined by the current timestamp (*t*) in the left table and its previous timestamp (*t0*). By default, the window is left-closed and right-open, meaning it includes records from the right table with timestamps in the interval \\[*t0, t*). The window boundary can be adjusted using the *closed*parameter. The window triggering rules are as follows:\n\n* When *useSystemTime* = false\n  * A window is triggered when a record in the right table (same group) arrives with a timestamp exceeding the window's right boundary.\n  * If a window remains uncomputed, the window is triggered when a new record in the right table (regardless of group) arrives with a timestamp exceeding the window's right boundary + *maxDelayedTime*.\n* When *useSystemTime* = true, a window is triggered immediately upon ingestion of each record in the left table (same group).\n\nNote: When *window* = *0:0*, if *metrics* contains a non-aggregate function which applies to a right table column, the corresponding output column must be specified as an array vector of the appropriate data type.\n\nFor more application scenarios of streaming engines, see [Streaming Engines](https://docs.dolphindb.com/en/Streaming/streaming_engines.html).\n\n#### Parameters\n\n**name** is a string indicating the name of the window join streaming engine. It is the unique identifier of the engine on a data/compute node. It can contain letters, numbers and underscores and must start with a letter.\n\n**leftTable** and **rightTable** are table objects whose schema must be the same as the input stream table. Since version 2.00.10, array vectors are allowed for *leftTable*.\n\n**outputTable** is a table to which the engine inserts calculation result. It can be an in-memory table or a DFS table. Before calling a function, an empty table with specified column names must be created.\n\nThe columns of *outputTable* are in the following order:\n\n(1) The first column must be a temporal column.\n\n* if *useSystemTime* = true, the data type must be TIMESTAMP;\n\n* if *useSystemTime* = false, it has the same data type as *timeColumn*.\n\n(2) Then followed by one or more columns on which the tables are joined, arranged in the same order as specified in *matchingColumn*.\n\n(3) Further followed by one or more columns which are the calculation results of *metrics*.\n\n(4) If the *outputElapsedMicroseconds* is set to true, specify two more columns: a LONG column and an INT column.\n\n**window** is a pair of integers or duration values, indicating the range of a sliding window, including both left and right bounds.\n\n**metrics** is metacode (which can be a tuple) specifying the calculation formulas. For more information about metacode, please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* *metrics* can use one or more expressions, built-in or user-defined functions (both aggregate functions and non-aggregate functions are accepted).\n\n* *metrics* can be functions that return multiple values and the columns in the output table to hold the return values must be specified. For example, \\<func(price) as \\`col1\\`col2>.\n\n* The column names specified in *metrics* are not case-sensitive and can be inconsistent with the column names of the input tables.\n\nIf you want to specify a column that exists in both the left and the right tables, use the format *tableName.colName*. By default, the column from the left table is used.\n\nWhen an array vector result is required, explicitly apply the `toArray` function to convert the result type.\n\nThe `toColumnarTuple` function is supported to convert non-aggregated computation results into columnar tuples.\n\nThe following functions are optimized in the engine when they are applied only to the columns from the right table: `sum`, `sum2`, `avg`, `std`, `var`, `corr`, `covar`, `wavg`, `wsum`, `beta`, `max`, `min`, `last`, `first`, `med`, `percentile`.\n\n**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.\n\n* When there is only 1 column to match - 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 column is named \"sym\" in the left table and \"sym1\" in the right table, then *matchingColumn* = \\[\\[\\`sym],\\[\\`sym1]].\n* When there are multiple columns to match - If the names of all the columns to match are the same in both tables, *matchingColumn* is a STRING vector; otherwise it's a tuple of two elements. For example, if the 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]].\n\n**timeColumn** (optional) When *useSystemTime* = false, it must be specified to indicate the name(s) of the time column in the left table and the right table. The time columns must have the same data type. If the names of the time column in the left table and the right table are the same, *timeColumn* is a string. Otherwise, it is a vector of 2 strings indicating the time column in each table.\n\n**useSystemTime** (optional) indicates whether the left table and the right table are joined on the system time, instead of on the *timeColumn*.\n\n* *useSystemTime* = true: join records based on the system time (timestamp with millisecond precision) when they are ingested into the engine.\n\n* *useSystemTime* = false (default): join records based on the specified timeColumn from the left table and the right table.\n\n**garbageSize** (optional) is a positive integer with the default value of 5,000 (rows). As the subscribed data is ingested into the engine, it continues to take up the memory. Within the left/right table, the records are grouped by *matchingColumn* values; When the number of records in a group exceeds *garbageSize*, the system will remove those already been calculated from memory.\n\n**maxDelayedTime** (optional) is a positive integer. *maxDelayedTime* only takes effect when *timeColumn* is specified and the two arguments must have the same time precision. Use *maxDelayedTime* to trigger windows which remain uncalculated long past its end. The default *maxDelayedTime* is 3 seconds. For more information about this parameter, see \"Window triggering rules\" in the Details section.\n\n**nullFill** (optional) is a tuple of the same size as the number of output columns. It is used to fill in the null values in the output table. The data type of each element corresponds to each output column.\n\n**outputElapsedMicroseconds** (optional) is a Boolean value, indicating whether to output the elapsed time to calculate each batch and the number of records in each batch in the output table. The default value is false. When *outputElapsedMicroseconds* = true, two additional columns are required when specifying outputTables (see the Arguments section).\n\n**sortByTime** (optional) is a Boolean value that indicates whether the output data is globally sorted by time. The default value is false, meaning the output data is sorted only within groups. Note that if *sortByTime* is set to true, the data input to the left and right tables must be globally sorted, and the parameter *maxDelayedTime* cannot be specified (i.e., no delayed triggering allowed).\n\n**closed**(optional) is a string that indicates whether the left or the right boundary is included. It only takes effect when *window*=0:0.\n\n* *closed*= 'left': left-closed, right-open.\n\n* *closed*= 'right': left-open, right-closed. The parameter *useSystemTime*must be set to false.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** (optional) is a string indicating the directory where the streaming engine snapshot is saved. The directory must already exist, otherwise an exception is thrown. If the *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state. Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\nThe file extension of a snapshot can be:\n\n* *\\<engineName>.tmp*: a temporary snapshot\n* *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n* *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** (optional) is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**cachedTableCapacity** (optional) is a positive integer indicating the initial capacity (in terms of the number of rows) of the left and right cache tables for each group. The default value is 1024.\n\n**keyPurgeFreqInSec**(optional) is a positive integer indicating the interval (in seconds) at which the system checks for groups that can be removed. This parameter does not take effect when *window*=0:0. Removal rules:\n\n* If the left cache table has no unprocessed messages, the group can be removed either when the right cache table is empty or when the timestamp of its last record is earlier than (latest right timestamp − *maxDelayedTime* − window size).\n* The engine triggers removal when the number of purgeable groups reaches 10% of the total number of groups.\n\n**timeoutTrigger**(optional) is a boolean scalar specifying whether to trigger computation when the right table has no data input for a certain period. This ensures that all data starts processing within the time range of the window's right boundary + \\[1, 3) \\* maxDelayedTime. Enable *timeoutTrigger* under the following conditions:\n\n* *useSystemTime* must be set to false.\n* *sortByTime* must be set tofalse.\n* *maxDelayedTime*must be set to a positive integer.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n```\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\nshare table(100:0, `time`sym`factor1`factor2`factor3, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\n\nnullFill= [2012.01.01T00:00:00.000, `NONE, 0.0, 0.0, 0.0]\nwjEngine=createWindowJoinEngine(name=\"test1\", leftTable=leftTable, rightTable=rightTable, outputTable=output, window=-2:2, metrics=<[price,val,sum(val)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false,nullFill=nullFill)\n\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{wjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{wjEngine, false}, msgAsTable=true)\n\nn=10\ntp1=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`AAPL, n) join take(`IBM, n) as sym, take(NULL join rand(10.0, n-1),2*n) as price)\ntp1.sortBy!(`time)\nleftTable.append!(tp1)\n\ntp2=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`AAPL, n) join take(`IBM, n) as sym, take(double(1..n),2*n) as val)\ntp2.sortBy!(`time)\nrightTable.append!(tp2)\n\nselect * from output where time between 2012.01.01T00:00:00.000:2012.01.01T00:00:00.001\n```\n\n| time                    | sym  | factor1 | factor2 | factor3 |\n| ----------------------- | ---- | ------- | ------- | ------- |\n| 2012.01.01T00:00:00.000 | AAPL | 0       | 1       | 6       |\n| 2012.01.01T00:00:00.000 | AAPL | 0       | 2       | 6       |\n| 2012.01.01T00:00:00.000 | AAPL | 0       | 3       | 6       |\n| 2012.01.01T00:00:00.001 | AAPL | 5.2705  | 1       | 10      |\n| 2012.01.01T00:00:00.001 | AAPL | 5.2705  | 2       | 10      |\n| 2012.01.01T00:00:00.001 | AAPL | 5.2705  | 3       | 10      |\n| 2012.01.01T00:00:00.001 | AAPL | 5.2705  | 4       | 10      |\n| 2012.01.01T00:00:00.000 | IBM  | 5.2705  | 2       | 9       |\n| 2012.01.01T00:00:00.000 | IBM  | 5.2705  | 3       | 9       |\n| 2012.01.01T00:00:00.000 | IBM  | 5.2705  | 4       | 9       |\n| 2012.01.01T00:00:00.001 | IBM  | 1.0179  | 2       | 14      |\n| 2012.01.01T00:00:00.001 | IBM  | 1.0179  | 3       | 14      |\n| 2012.01.01T00:00:00.001 | IBM  | 1.0179  | 4       | 14      |\n| 2012.01.01T00:00:00.001 | IBM  | 1.0179  | 5       | 14      |\n\nExample for *window* = 0:0:\n\n```\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\n\nv = [1, 5, 10, 15]\ntp1=table(2012.01.01T00:00:00.000+v as time, take(`AAPL, 4) as sym, rand(10.0,4) as price)\n\nv = [1, 2, 3, 4, 5, 6, 9, 15]\ntp2=table(2012.01.01T00:00:00.000+v as time, take(`AAPL, 8) as sym, rand(10.0,8) as val)\n\nshare table(100:0, `time`sym`price`val`sum_val, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE[], DOUBLE]) as output\nwjEngine=createWindowJoinEngine(name=\"test1\", leftTable=leftTable, rightTable=rightTable, outputTable=output,  window=0:0, metrics=<[price, val, sum(val)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false)\n\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{wjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{wjEngine, false}, msgAsTable=true)\n\nleftTable.append!(tp1)\nrightTable.append!(tp2)\n```\n\n| time                    | sym  | price  | val                             | sum\\_val |\n| ----------------------- | ---- | ------ | ------------------------------- | -------- |\n| 2012.01.01T00:00:00.001 | AAPL | 8.8252 | \\[]                             |          |\n| 2012.01.01T00:00:00.005 | AAPL | 7.1195 | \\[7.495792,9.417891,1.419681,…] | 21.3741  |\n| 2012.01.01T00:00:00.010 | AAPL | 5.2217 | \\[4.840462,8.086567,3.495306]   | 16.4223  |\n| 2012.01.01T00:00:00.015 | AAPL | 9.2517 | \\[]                             |          |\n\n```\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\n\nv = [1, 5, 10, 15]\ntp1=table(2012.01.01T00:00:00.000+v as time, take(`A, 4) as sym, rand(10.0,4) as price)\n\nv = [1, 2, 3, 4, 5, 6, 9, 15]\ntp2=table(2012.01.01T00:00:00.000+v as time, take(`A, 8) as sym, rand(10.0,8) as val)\n\nshare table(100:0, `time`sym`price`sum_val, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE]) as output\nwjEngine=createWindowJoinEngine(name=\"test1\", leftTable=leftTable, rightTable=rightTable, outputTable=output,  window=0:0, metrics=<[price, sum(val)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false)\n\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{wjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{wjEngine, false}, msgAsTable=true)\n\nleftTable.append!(tp1)\nrightTable.append!(tp2)\n```\n\n<table id=\"table_eky_352_hzb\"><tbody><tr><td align=\"left\">\n\ntime\n\n</td><td align=\"left\">\n\nsym\n\n</td><td align=\"left\">\n\nprice\n\n</td><td align=\"left\">\n\nsum\\_val\n\n</td></tr><tr><td align=\"left\">\n\n2012.01.01T00:00:00.001\n\n</td><td align=\"left\">\n\nA\n\n</td><td align=\"left\">\n\n8.8252\n\n</td><td align=\"left\">\n\n \n\n</td></tr><tr><td align=\"left\">\n\n2012.01.01T00:00:00.005\n\n</td><td align=\"left\">\n\nA\n\n</td><td align=\"left\">\n\n7.1195\n\n</td><td align=\"left\">\n\n21.3741\n\n</td></tr><tr><td align=\"left\">\n\n2012.01.01T00:00:00.010\n\n</td><td align=\"left\">\n\nA\n\n</td><td align=\"left\">\n\n5.2217\n\n</td><td align=\"left\">\n\n16.4223\n\n</td></tr><tr><td align=\"left\">\n\n2012.01.01T00:00:00.015\n\n</td><td align=\"left\">\n\nA\n\n</td><td align=\"left\">\n\n9.2517\n\n</td><td align=\"left\">\n\n \n\n</td></tr></tbody>\n</table>When *window*=0:0, the window is left-closed and right-open by default. The following example uses a left-open and right-closed window by setting *closed*to 'right'.\n\n```\nunsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\")\nunsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\")\nundef(`leftTable,SHARED)\nundef(`rightTable,SHARED)\ndropAggregator(name=\"test1\")\n\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\n\nv1 = [1, 5, 10, 15]\ntp1=table(2012.01.01T00:00:00.000+v1 as time, take(`A, 4) as sym, rand(10.0,4) as price)\n\nv2 = [1, 2, 3, 4, 5, 6, 9, 15]\ntp2=table(2012.01.01T00:00:00.000+v2 as time, take(`A, 8) as sym, rand(10.0,8) as val)\n\nshare table(100:0, `time`sym`price`val`sum_val, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE[], DOUBLE]) as output\nwjEngine=createWindowJoinEngine(name=\"test1\", leftTable=leftTable, rightTable=rightTable, outputTable=output,  window=0:0, metrics=<[price, val, sum(val)]>, matchingColumn=\"sym\", timeColumn=\"time\", useSystemTime=false, closed=\"right\")\n\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{wjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{wjEngine, false}, msgAsTable=true)\n\nleftTable.append!(tp1)\nrightTable.append!(tp2)\nsleep(100)\nselect * from output\n/* output\ntime\t                  sym\tprice\tval\t                      sum_val\n2012.01.01T00:00:00.001\tA\t9.7366\t[7.8310]\t                  7.831\n2012.01.01T00:00:00.005\tA\t2.6537\t[1.8564,4.6238,8.2536,3.1028]     17.8368\n2012.01.01T00:00:00.010\tA\t3.9586\t[0.8413,8.0684]\t           8.9098\n*/\n```\n\nThe following example shows that when *sortByTime* =true, the engine outputs data sorted by time.\n\n```\nunsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\")\nunsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\")\nundef(`leftTable,SHARED)\nundef(`rightTable,SHARED)\ndropAggregator(name=\"test1\")\n\n//define a window join engine\nshare streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as leftTable\nshare streamTable(1:0, `time`sym`val, [TIMESTAMP, SYMBOL, DOUBLE]) as rightTable\nshare table(100:0, `time`sym`factor1`factor2`factor3, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE, DOUBLE]) as output\nnullFill= [2012.01.01T00:00:00.000, `NONE, 0.0, 0.0, 0.0]\nwjEngine=createWindowJoinEngine(name=\"test1\", leftTable=leftTable, rightTable=rightTable, outputTable=output,  window=-2:2, metrics=<[price,val,sum(val)]>, matchingColumn=`sym, timeColumn=`time, useSystemTime=false,nullFill=nullFill, sortByTime=true)\n\n//subscribe data\nsubscribeTable(tableName=\"leftTable\", actionName=\"joinLeft\", offset=0, handler=appendForJoin{wjEngine, true}, msgAsTable=true)\nsubscribeTable(tableName=\"rightTable\", actionName=\"joinRight\", offset=0, handler=appendForJoin{wjEngine, false}, msgAsTable=true)\n\nn=10\ntp1=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(NULL join rand(10.0, n-1),2*n) as price)\ntp1.sortBy!(`time)\nleftTable.append!(tp1)\n\ntp2=table(take(2012.01.01T00:00:00.000+0..10, 2*n) as time, take(`A, n) join take(`B, n) as sym, take(double(1..n),2*n) as val)\ntp2.sortBy!(`time)\nrightTable.append!(tp2)\n\nsleep(100)\nselect * from output where time between 2012.01.01T00:00:00.000:2012.01.01T00:00:00.001\n\n\n/* output\ntime                    sym   factor1        factor2 factor3\n2012.01.01T00:00:00.000      A       0        1        6\n2012.01.01T00:00:00.000      A       0        2        6\n2012.01.01T00:00:00.000      A       0        3        6\n2012.01.01T00:00:00.000      B     3.9389     2        9\n2012.01.01T00:00:00.000      B     3.9389     3        9\n2012.01.01T00:00:00.000      B     3.9389     4        9\n2012.01.01T00:00:00.001      A     3.9389     1        10\n2012.01.01T00:00:00.001      A     3.9389     2        10\n2012.01.01T00:00:00.001      A     3.9389     3        10\n2012.01.01T00:00:00.001      A     3.9389     4        10\n2012.01.01T00:00:00.001      B     4.9875     2        14\n2012.01.01T00:00:00.001      B     4.9875     3        14\n2012.01.01T00:00:00.001      B     4.9875     4        14\n2012.01.01T00:00:00.001      B     4.9875     5        14\n*/\n```\n"
    },
    "createYieldCurveEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/createyieldcurveengine.html",
        "signatures": [
            {
                "full": "createYieldCurveEngine(name, dummyTable, assetType, fitMethod, keyColumn, modelOutput, frequency, [timeColumn], [predictDummyTable],[predictInputColumn], [predictKeyColumn],[predictTimeColumn], [predictOutput], [extraMetrics],[fitAfterPredict=false])",
                "name": "createYieldCurveEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "assetType",
                        "name": "assetType"
                    },
                    {
                        "full": "fitMethod",
                        "name": "fitMethod"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "modelOutput",
                        "name": "modelOutput"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[predictDummyTable]",
                        "name": "predictDummyTable",
                        "optional": true
                    },
                    {
                        "full": "[predictInputColumn]",
                        "name": "predictInputColumn",
                        "optional": true
                    },
                    {
                        "full": "[predictKeyColumn]",
                        "name": "predictKeyColumn",
                        "optional": true
                    },
                    {
                        "full": "[predictTimeColumn]",
                        "name": "predictTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[predictOutput]",
                        "name": "predictOutput",
                        "optional": true
                    },
                    {
                        "full": "[extraMetrics]",
                        "name": "extraMetrics",
                        "optional": true
                    },
                    {
                        "full": "[fitAfterPredict=false]",
                        "name": "fitAfterPredict",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createYieldCurveEngine](https://docs.dolphindb.com/en/Functions/c/createyieldcurveengine.html)\n\n#### Syntax\n\ncreateYieldCurveEngine(name, dummyTable, assetType, fitMethod, keyColumn, modelOutput, frequency, \\[timeColumn], \\[predictDummyTable],\\[predictInputColumn], \\[predictKeyColumn],\\[predictTimeColumn], \\[predictOutput], \\[extraMetrics],\\[fitAfterPredict=false])\n\n#### Details\n\nCreate a yield curve engine to fit a curve, primarily used in financial applications to model the relationship between interest rates (or yields) and maturities of financial instruments (currently supporting **bonds only**).\n\nThe engine constructs and predicts yield curves using different interpolation or fitting methods based on the specified *fitMethod*. Supported techniques include linear interpolation, cubic spline interpolation, Krogh interpolation, piecewise regression, polynomial fitting, and NSS models.\n\n#### Arguments\n\n**name** is a STRING scalar indicating the engine name. It is the only identifier of a yield curve engine on a data/compute node. It can have letter, number and \"\\_\" and must start with a letter.\n\n**dummyTable** is a table object whose schema must be the same as the input table. It requires the following columns:\n\n| **Column**     | **Type**   | **Description**                                                       |\n| -------------- | ---------- | --------------------------------------------------------------------- |\n| symbol         | SYMBOL     | bond code                                                             |\n| sendingTime    | TIMESTAMP  | timestamp                                                             |\n| askDirtyprice1 | DECIMAL    | best ask (dirty price)                                                |\n| bidDirtyprice1 | DECIMAL    | best bid (dirty price)                                                |\n| midDirtyprice1 | DECIMAL    | mid dirty price                                                       |\n| askyield1      | DECIMAL    | best ask yield                                                        |\n| bidyield1      | DECIMAL    | best bid yield                                                        |\n| midyield1      | DECIMAL    | mid yield                                                             |\n| timetoMaturity | DOUBLE     | term to maturity                                                      |\n| assetType      | INT/STRING | user-defined asset type                                               |\n| dataSource     | INT        | user-defined data source, e.g., 0 represents X-Bond; 1 represents ESP |\n| clearRate      | STRING     | settlement date, e.g., \"T0”, “T1”, “T2”                               |\n\n**assetType** is an INT or STRING vector where each element identifies a unique asset. It must match the data type of “assetType“ column defined in *dummyTable*.\n\n**fitMethod** is a metacode tuple of fit methods that map to each asset in *assetType*. Supported fit methods: cubicSpline, cubicHermiteSplineFit, kroghInterpolateFit, linearInterpolateFit, nss, piecewiseLinFit, polyFit.\n\nNote that the length of *fitMethod* must be the same as *assetType*.\n\n**keyColumn** is a STRING scalar (“assetType“) or vector indicating the grouping column(s). If it is a vector, the first element must be \"assetType\", while the remaining elements specify grouping columns within each asset.\n\n**modelOutput** is the output table for fitted model. The columns of *modelOutput* are in the following order:\n\n(1) The first column must be a time column. It has the same data type as *timeColumn*if specified, otherwise uses system time (TIMESTAMP type).\n\n(2) Followed by *keyColumn*.\n\n(3) A BLOB column for models.\n\n**frequency**can be an interger or a DURATION scalar that determines how often the model updates.\n\n* When given an integer, the model updates once the cumulative count of data entries that have not been used in the model fitting reaches the specified threshold.\n* When given a DURATION value, the model updates every *frequency* time.\n  * if *timeColumn* is specified, model updates by event time, starting from the rounded timestamp of the first record in each group. For example, given timestamps \\[09:30:00.100, 09:32:00.100, 09:35:00.100, 09:45:00.100, 09:50:00.100], if *frequency*=5m, the model updates at 09:35:00.000, 09:40:00.000, 09:50:00.000. The right boundary is open, meaning the model's output at 09:35:00.000 does not include data from 09:35:00.000.\n  * if not, model updates based on system time, starting from rounded timestamp of the first record's arrival. If no records arrive within the window, no updates occur.\n\n**timeColumn** (optional) is a temporal vector indicating the time column of the input table. If not set, the system time is used.\n\n**predictDummyTable** (optional) is a table object, serving as the input table for prediction. It has the same schema as*dummyTable*by default.\n\n**predictInputColumn**(optional) is a STRING scalar specifying the input data for prediction.\n\n**predictKeyColumn**(optional) is a STRING scalar or vector indicating the grouping column(s) of *predictDummyTable*. Predictions are grouped by this column, defaulting to *keyColumn*.\n\n**predictTimeColumn**(optional) is a temporal vector indicating the time column of the input table. Defaults to*timeColumn*.\n\n**predictOutput** (optional) is the output table for prediction results. The columns of *predictOutput* are in the following order:\n\n(1) The first column must be a time column. It has the same data type as *predictTimeColumn*if specified, otherwise uses system time (TIMESTAMP type).\n\n(2) The *predictKeyColumn*column.\n\n(3) The *predictInputColumn*column.\n\n(4) A column for prediction results.\n\n(5) Additional output matching the results of metrics specified in *extraMetrics*.\n\n**Note:** For data prediction, *predictOutput* is required.\n\n**extraMetrics** (optional) is metacode or a tuple of metacode indicating the additional output beyond predict results, including columns from the input table (excluding *keyColumn*) or factors (formulas for calculation).\n\n**fitAfterPredict** (optional) is a boolean value.\n\n* If set to true, the incoming data will first be ingested into the *predictDummyTable* for prediction using the existing model, and then it will be ingested into the *dummyTable* for model fitting.\n* If set to false (default), the incoming data is directly ingested into the *dummyTable* for model fitting. You can separately use the `appendForPredict` method to add data to the *predictDummyTable* for prediction purposes.\n\n#### Examples\n\n```\n// define the input table, asset types and corresponding fitting methods\ndummyTable = table(1:0, `symbol`sendingtime`askDirtyPrice1`bidDirtyPrice1`midDirtyPirce1`askyield1`bidyield1`midyield1`timetoMaturity`assetType`datasource`clearRate, \n                        [SYMBOL, TIMESTAMP,DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DECIMAL32(3),DOUBLE,INT,INT,STRING])\nassetType=[0,1,2]\nfitMethod=[<piecewiseLinFit(timetoMaturity, midyield1, 10)>,\n            <nss(timetoMaturity,bidyield1)>,\n            <piecewiseLinFit(timetoMaturity, askyield1, 5)>]\n\n// define the output tables\nmodelOutput=table(1:0, `time`assetType`dataSource`clearRate`model,\n                        [TIMESTAMP,INT,INT,SYMBOL,BLOB])\npredictOutput=table(1:0, `time`assetType`dataSource`clearRate`x`y,[TIMESTAMP,INT,INT,SYMBOL,DOUBLE,DOUBLE])\n\n// create a yield curve engine\nengine = createYieldCurveEngine(name=\"test\", dummyTable=dummyTable,assetType=assetType,fitMethod=fitMethod,\n                                keyColumn=`assetType`dataSource`clearRate, modelOutput=modelOutput,\n                                frequency=10,predictInputColumn=`timetoMaturity,predictTimeColumn=`sendingtime, \n                                predictOutput=predictOutput,fitAfterPredict=true)\n                                \n// append data for fitting\ndata = table(take(`a`b`c, 30) as  symbol, take(now(), 30) as time, decimal32(rand(10.0, 30),3) as p1,  decimal32(rand(10.0, 30),3) as p2,  decimal32(rand(10.0, 30),3) as p3, decimal32(rand(10.0, 30),3) as p4,  decimal32(rand(10.0, 30),3) as p5,  decimal32(rand(10.0, 30),3) as p6, (rand(10.0, 30)+10).sort() as timetoMaturity, take(0 1 2, 30) as assetType, take([1], 30) as datasource, take(\"1\", 30) as clearRate)\nengine.append!(data)\n```\n\n**Related Function**: [appendForPrediction](https://docs.dolphindb.com/en/Functions/a/appendforprediction.html)\n"
    },
    "createCEPEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html",
        "signatures": [
            {
                "full": "createCEPEngine(name, monitors, dummyTable, eventSchema, [deserializeParallelism=1], [timeColumn], [eventQueueDepth=1024], [outputTable], [dispatchKey], [dispatchBucket], [useSystemTime=true], [eventTimeField=\"eventTime\"])",
                "name": "createCEPEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "monitors",
                        "name": "monitors"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "eventSchema",
                        "name": "eventSchema"
                    },
                    {
                        "full": "[deserializeParallelism=1]",
                        "name": "deserializeParallelism",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[eventQueueDepth=1024]",
                        "name": "eventQueueDepth",
                        "optional": true,
                        "default": "1024"
                    },
                    {
                        "full": "[outputTable]",
                        "name": "outputTable",
                        "optional": true
                    },
                    {
                        "full": "[dispatchKey]",
                        "name": "dispatchKey",
                        "optional": true
                    },
                    {
                        "full": "[dispatchBucket]",
                        "name": "dispatchBucket",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=true]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[eventTimeField=\"eventTime\"]",
                        "name": "eventTimeField",
                        "optional": true,
                        "default": "\"eventTime\""
                    }
                ]
            }
        ],
        "markdown": "### [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html)\n\n\n\n#### Syntax\n\ncreateCEPEngine(name, monitors, dummyTable, eventSchema, \\[deserializeParallelism=1], \\[timeColumn], \\[eventQueueDepth=1024], \\[outputTable], \\[dispatchKey], \\[dispatchBucket], \\[useSystemTime=true], \\[eventTimeField=\"eventTime\"])\n\n#### Details\n\nThe CEP engine processes real-time events primarily by subscribing to heterogeneous stream tables (through `subscribeTable`). Event data can be written to these tables either by using the `replay` function or through APIs.\n\n**Note:** To write events directly to the CEP engine, use the [appendEvent](https://docs.dolphindb.com/en/Functions/a/append_event.html) function. This function enables direct appending of events to the event input queue.\n\n#### Parameters\n\n**name**is a string scalar indicating the name of the CEP engine. It consists of letters, digits, and underscores(\\_) and must start with a letter.\n\n**monitors**is metacode or a tuple of metacode containing one or more constructors of `Monitor` class. If multiple constructors are specified, the monitor objects will be constructed in order. For the instructions on how to define a monitor, refer to [Defining Monitors](https://docs.dolphindb.com/en/3.00.5/Streaming/DefineMonitors.html).\n\n**dummyTable** is a non-partitioned in-memory table or a stream table. The columns are in the following order:\n\n(1) A time column of TIMESTAMP type (if *eventTimeField* is specified);\n\n(2) A STRING column indicating the events;\n\n(3) A BLOB column that stores the serialized result of each event;\n\n**eventSchema**is a scalar or vector of class definition of event types, indicating the events (subscribed from APIs or plugins) to be processed. For the instructions on how to define an event, refer to [Defining Events](https://docs.dolphindb.com/en/3.00.5/Streaming/DefineEvents.html).\n\n**deserializeParallelism** (optional) is an integer that specifies the number of workers to deserialize the subscribed stream table. The default value is 1.\n\n**timeColumn** (optional) is a STRING scalar or vector indicating the time column(s) of *dummyTable*. If specified, it is used as the initialized event time for event streams.\n\n**eventQueueDepth**(optional) is an integer that specifies the queue depth for event input and output queue. The default value is 1024.\n\n**outputTable** (optional) can be specified as a single or multiple serializers, each returned by `streamEventSerializer`. It is used with the `emitEvent` function to output events to the table(s) specified by the serializer(s). The serialization and output processes of different serializers are independent and executed concurrently.\n\n**dispatchKey**(optional) is a string scalar indicating the event fields.\n\n* If specified,the engine creates sub-engines based on the number of unique values of the event field.\n\n* If not specified, the engine only creates a single sub-engine with the same name as CEP engine (*name*).\n\n**dispatchBucket** (optional) is an integer indicating the number of hash buckets. It is used to group the specified event field (*dispatchKey*) using hash algorithm. To specify this parameter, *dispatchKey* must be specified. If specified, the engine creates the sub-engines based on bucket numbers specified by *dispatchBucket*.\n\n**useSystemTime** (optional) is a Boolean value indicating whether the calculations are performed based on the system time (in millisecond) when the event is ingested into the engine. The default value is true. If set to false, the calculations are performed based on the *timeColumn.*\n\n**eventTimeField** (optional) is a STRING scalar or vector indicating the time column(s) of events. It only takes effect when *useSystemTime* = false. It is a scalar if all events use the same time column name. Otherwise, it is a vector of the same length as *eventSchema*, where each element represents the time column for each event. This parameter is required if event streams are ingested into the CEP engine using `appendEvent`.\n\n#### Returns\n\nIt returns a table.\n\n#### Examples\n\nExample 1. This example creates three types of events (market data, orders, and trades), and defines a dedicated serializer for each event type. Events are then ingested into the engine via `appendEvent`, where the engine selects the corresponding serializer based on the event type and outputs the data to different stream tables. In addition, by setting `dispatchKey='code'` and `dispatchBucket=4`, the example enables parallel processing grouped by stock.\n\n```\nclass MarketData{\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def MarketData(m,c,p,q){\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n\nclass Orders{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def Orders(t, m,c,p,q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n\nclass Trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def Trades(t, m,c,p,q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as MarketDataChannel\nserializer1 = streamEventSerializer(name=`MarketDataChannel, eventSchema=[MarketData], outputTable=MarketDataChannel)\n\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as OrdersChannel\nserializer2 = streamEventSerializer(name=`OrdersChannel, eventSchema=[Orders], outputTable=OrdersChannel)\n\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as TradesChannel\nserializer3 = streamEventSerializer(name=`TradesChannel, eventSchema=[Trades], outputTable=TradesChannel)\n\nclass SimpleShareSearch:CEPMonitor {\n\t// Constructor\n\tdef SimpleShareSearch(){\n\t}\n\tdef processMarketData(event){\n        emitEvent(event,,\"MarketDataChannel\")\n    }\n    def processOrders(event){\n        emitEvent(event,,\"OrdersChannel\")\n    }\n    def processTrades(event){\n        emitEvent(event,,\"TradesChannel\")\n    }\n\t// After creating the CEP sub-engine, the system automatically instantiates the SimpleShareSearch class as a Monitor instance and invokes the onload function.\n\tdef onload() {\n\t\t// Listen to StockTick events\n\t\taddEventListener(handler=processMarketData, eventType=\"MarketData\", times=\"all\")\n\t\taddEventListener(handler=processOrders, eventType=\"Orders\", times=\"all\")\n\t\taddEventListener(handler=processTrades, eventType=\"Trades\", times=\"all\")\n\t}\n}\n\ndummy = table(array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\nengine = createCEPEngine(name='cep1', monitors=<SimpleShareSearch()>, dummyTable=dummy,   \n                        eventSchema=[MarketData,Orders,Trades],   \n                        outputTable=[serializer1,serializer2,serializer3],  \n                        dispatchKey=`code, dispatchBucket=4)\n\nm= MarketData(\"m\", \"c\", 10.0, 100)\nappendEvent(engine, m)\n\no = Orders(\"a\",\"m\", \"c\", 10.0, 100)\nt = Trades(\"a\",\"m\", \"c\", 10.0, 100)\n\nappendEvent(engine, o)\nappendEvent(engine, t)\n```\n\nIn Example 1, since *useSystemTime* is not specified, the engine uses system time by default. In the internal event listener (`addEventListener`), time-related parameters (such as `within` and `exceedTime`) are evaluated based on the system time when events are ingested.\n\nTo use event time instead, configure the parameters as shown in Example 2.\n\nExample 2. This example demonstrates how to use the timestamp from the data (event time) for calculation. Key CEP engine settings are:\n\n* `useSystemTime=false`: use event time instead of system time\n* `timeColumn`: specifies the time column in the dummy table\n* `eventTimeField`: specifies the time field in the event\n\nExample 2.\n\n```\n// First, clean up the environment\ndef cleanupCEPEngine(){  \n    try { dropStreamEngine(\"cep1\") } catch(ex) {}  \n    try { dropStreamEngine(\"MarketDataChannel\") } catch(ex) {}  \n    try { dropStreamEngine(\"OrdersChannel\") } catch(ex) {}  \n    try { dropStreamEngine(\"TradesChannel\") } catch(ex) {}  \n      \n    try { dropStreamTable(\"MarketDataChannel\") } catch(ex) {}  \n    try { dropStreamTable(\"OrdersChannel\") } catch(ex) {}  \n    try { dropStreamTable(\"TradesChannel\") } catch(ex) {}  \n      \n    try { undef(\"MarketDataChannel\", SHARED) } catch(ex) {}  \n    try { undef(\"OrdersChannel\", SHARED) } catch(ex) {}  \n    try { undef(\"TradesChannel\", SHARED) } catch(ex) {}  \n      \n    print(\"CEP engine environment cleanup completed\")  \n}  \ncleanupCEPEngine()  \n\nclass MarketData{  \n    market :: STRING  \n    code :: STRING  \n    price :: DOUBLE  \n    qty :: INT  \n    eventTime :: TIMESTAMP  \n    def MarketData(m,c,p,q,et){  \n        market = m  \n        code = c  \n        price = p  \n        qty = q  \n        eventTime = et  \n    }  \n}  \n  \nclass Orders{  \n    trader :: STRING  \n    market :: STRING  \n    code :: STRING  \n    price :: DOUBLE  \n    qty :: INT  \n    eventTime :: TIMESTAMP  \n    def Orders(t, m,c,p,q,et){  \n        trader = t  \n        market = m  \n        code = c  \n        price = p  \n        qty = q  \n        eventTime = et  \n    }  \n}  \n  \nclass Trades{  \n    trader :: STRING  \n    market :: STRING  \n    code :: STRING  \n    price :: DOUBLE  \n    qty :: INT  \n    eventTime :: TIMESTAMP  \n    def Trades(t, m,c,p,q,et){  \n        trader = t  \n        market = m  \n        code = c  \n        price = p  \n        qty = q  \n        eventTime = et  \n    }  \n}  \n  \nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as MarketDataChannel  \nserializer1 = streamEventSerializer(name=`MarketDataChannel, eventSchema=[MarketData], outputTable=MarketDataChannel)  \n  \nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as OrdersChannel  \nserializer2 = streamEventSerializer(name=`OrdersChannel, eventSchema=[Orders], outputTable=OrdersChannel)  \n  \nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as TradesChannel  \nserializer3 = streamEventSerializer(name=`TradesChannel, eventSchema=[Trades], outputTable=TradesChannel)  \n  \nclass SimpleShareSearch:CEPMonitor {  \n    def SimpleShareSearch(){  \n    }  \n    def processMarketData(event){  \n        emitEvent(event,,\"MarketDataChannel\")  \n    }  \n    def processOrders(event){  \n        emitEvent(event,,\"OrdersChannel\")  \n    }  \n    def processTrades(event){  \n        emitEvent(event,,\"TradesChannel\")  \n    }  \n    def onload() {  \n        addEventListener(handler=processMarketData, eventType=\"MarketData\", times=\"all\")  \n        addEventListener(handler=processOrders, eventType=\"Orders\", times=\"all\")  \n        addEventListener(handler=processTrades, eventType=\"Trades\", times=\"all\")  \n    }  \n}  \n  \n// Create CEP engine and modify dummy table schema by adding eventTime column  \ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)  \n  \n// Create CEP engine and specify timeColumn and eventTimeField  \nengine = createCEPEngine(name='cep1', monitors=<SimpleShareSearch()>, dummyTable=dummy,   \n                        eventSchema=[MarketData,Orders,Trades],   \n                        outputTable=[serializer1,serializer2,serializer3],  \n                        dispatchKey=`market, dispatchBucket=4,  \n                        useSystemTime=false, timeColumn=`eventTime,  \n                        eventTimeField=`eventTime)  \n  \n// Create and ingest events\n// Specify eventTime when creating events  \ncurrentTime = 2026.03.01T09:30:00.000  \nm1 = MarketData(\"NASDAQ\", \"AAPL\", 10.0, 100, currentTime)  \nm2 = MarketData(\"NYSE\", \"IBM\", 150.0, 200, currentTime)  \n  \ncurrentTime = 2026.03.01T09:30:01.000  \no1 = Orders(\"trader1\",\"NASDAQ\", \"AAPL\", 10.0, 100, currentTime)  \no2 = Orders(\"trader2\",\"NYSE\", \"IBM\", 150.0, 200, currentTime)  \n  \ncurrentTime = 2026.03.01T09:30:02.000  \nt1 = Trades(\"trader1\",\"NASDAQ\", \"AAPL\", 10.0, 100, currentTime)  \nt2 = Trades(\"trader2\",\"NYSE\", \"IBM\", 150.0, 200, currentTime)  \n  \n// Ingest events  \nappendEvent(engine, m1)  \nappendEvent(engine, m2)  \nappendEvent(engine, o1)  \nappendEvent(engine, o2)  \nappendEvent(engine, t1)  \nappendEvent(engine, t2)\n```\n\n**Related functions**: [addEventListener](https://docs.dolphindb.com/en/Functions/a/add_event_listener.html), [dropStreamEngine](https://docs.dolphindb.com/en/Functions/d/dropStreamEngine.html), [getCEPEngineStat](https://docs.dolphindb.com/en/Functions/g/get_cep_engine_stat.html), [stopSubEngine](https://docs.dolphindb.com/en/Functions/s/stop_subengine.html)\n"
    },
    "createDataViewEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/c/create_data_view_engine.html",
        "signatures": [
            {
                "full": "createDataViewEngine(name, outputTable, keyColumns, timeColumn, [useSystemTime=true], [throttle],[includeOperationType=false])",
                "name": "createDataViewEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[useSystemTime=true]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[throttle]",
                        "name": "throttle",
                        "optional": true
                    },
                    {
                        "full": "[includeOperationType=false]",
                        "name": "includeOperationType",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [createDataViewEngine](https://docs.dolphindb.com/en/Functions/c/create_data_view_engine.html)\n\n\n\n#### Syntax\n\ncreateDataViewEngine(name, outputTable, keyColumns, timeColumn, \\[useSystemTime=true], \\[throttle],\\[includeOperationType=false])\n\n#### Details\n\nThe `createDataViewEngine` function allows you to create a data view engine that returns a keyed table with *keyColumns* as the key. The table maintains the latest record for each key. The data view engine is responsible for maintaining an up-to-date snapshot of each monitored variable and exporting the data to a target table, usually a stream table, which can be subscribed by other clients.\n\n#### Parameters\n\n**name** is a string indicating the name of the data view engine. It consists of letters, digits, or underscores (\\_) and must start with a letter.\n\n**outputTable** is an in-memory table or a DFS table. If you want to display real-time data, or to graph trends of the data, it must be a stream table.\n\n**keyColumns** is a STRING scalar or vector that specifies one or more columns in the outputTable as the key columns. For each unique value in the *keyColumn*, only the latest record is retained.\n\n**timeColumn** is a STRING scalar which specifies the time column in the output table.\n\n**useSystemTime** (optional) is a Boolean value indicating whether to use the system time as the time column for the output table.\n\n* If the input data does not contain a time column, *useSystemTime* should set to true, i.e., the time column of *outputTable* is the system time.\n\n* If the input data contain a time column, *useSystemTime* should set to false, i.e., the time column of *outputTable* uses the timestamp of each record.\n\n**throttle**(optional) is of DURATION type, which specifies the time interval between data writes to the *outputTable*.\n\n**includeOperationType** (optional) is a Boolean value indicating whether the output includes a column specifying the type of operation performed on each record. The default value is false.\n\nWhen set to true, the output table will include an additional leading column of type CHAR that specifies the operation applied to each record:\n\n* 'A': insert\n* 'U': update\n* 'D': delete\n\n**Note**: Deleted records are not emitted by default. When *includeOperationType* is enabled, deleted records are emitted with operation type 'D', which may result in a different number of output records.\n\n#### Returns\n\nReturns a keyed table with *keyColumns* as the key.\n\n#### Examples\n\nExample 1. This example demonstrates how to use the CEP (Complex Event Processing) engine to maintain the latest state of stock orders in real time, including order insertion and deletion operations.\n\n```\nclass Orders{\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def Orders(m,c,p,q){\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\nclass DeleteOrder{\n \n    code :: STRING\n  \n    def DeleteOrder(c){\n        code = c\n    }\n}\n// Define the monitor\nclass MainMonitor:CEPMonitor {\n    def MainMonitor(){\n    }\n    // Automatically called when the engine is deleted: drops the shared stream table\n    def onunload(){ undef('orderDV', SHARED) }\n    def checkOrders(newOrder)\n    def deleteOrder(order)\n    // Create a data view engine with the primary key set to the code column to maintain the latest order information for each stock\n    def onload(){\n        addEventListener(checkOrders,'Orders',,'all') \n        orderDV = streamTable(array(CHAR, 0) as type, array(STRING, 0) as market, array(STRING, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(TIMESTAMP, 0) as updateTime)\n        share(orderDV,'orderDV')\n        createDataViewEngine('orderDV', objByName('orderDV'), `code, `updateTime, true, ,true)\n        addEventListener(deleteOrder,'DeleteOrder',,'all') \n    }\n    // Update the latest order information for each stock\n    def checkOrders(newOrder){\n        getDataViewEngine('orderDV').append!(table(newOrder.market as market, newOrder.code as code, newOrder.price as price, newOrder.qty as qty))\n    }\n    def deleteOrder(order){\n        deleteDataViewItems('orderDV',order.code )\n    }\n}\n// Create the CEP engine\ndummy = table(array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\ntry{dropStreamEngine('cep1')}catch(ex){print(ex)}\nengine = createCEPEngine(name='cep1', monitors=<MainMonitor()>, dummyTable=dummy, eventSchema=[Orders,DeleteOrder])\nengine.appendEvent(Orders(\"m1\", \"c1\", 10.0, 100))\nengine.appendEvent(Orders(\"m1\", \"c2\", 10.0, 100))\nengine.appendEvent(Orders(\"m1\", \"c2\", 9.5, 100))\nengine.appendEvent(DeleteOrder(\"c2\"))\n\n// Query order data from orderDV\nselect * from orderDV\n```\n\n| type | market | code | price | qty | updateTime              |\n| ---- | ------ | ---- | ----- | --- | ----------------------- |\n| A    | m1     | c1   | 10    | 100 | 2026.02.01 14:53:12.928 |\n| A    | m1     | c2   | 10    | 100 | 2026.02.01 14:53:12.928 |\n| U    | m1     | c2   | 9.5   | 100 | 2026.02.01 14:53:12.928 |\n| D    | m1     | c2   | 9.5   | 100 | 2026.02.01 14:53:12.928 |\n\nIf the operation type for order updates is not required, you can set `includeOperationType=false` and modify the schema of the orderDV table accordingly. Replace the `onload` script with the following code:\n\n```\ndef onload(){\n    addEventListener(checkOrders,'Orders',,'all') \n    orderDV = streamTable(array(STRING, 0) as market, array(STRING, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(TIMESTAMP, 0) as updateTime)\n    share(orderDV,'orderDV')\n    createDataViewEngine(name='orderDV', outputTable=objByName('orderDV'), keyColumns=`code, timeColumn=`updateTime, useSystemTime=true, includeOperationType=false)\n    addEventListener(deleteOrder,'DeleteOrder',,'all') \n}\n```\n\nThe orderDV table is shown below. It can be seen that when `includeOperationType=false`, the engine does not output records for deleted data, resulting in a different number of rows compared to when *includeOperationType* is true.\n\n| market | code | price | qty | updateTime              |\n| ------ | ---- | ----- | --- | ----------------------- |\n| m1     | c1   | 10    | 100 | 2026.04.17 17:35:42.313 |\n| m1     | c2   | 10    | 100 | 2026.04.17 17:35:42.313 |\n| m1     | c2   | 9.5   | 100 | 2026.04.17 17:35:42.313 |\n\nExample 2. This example demonstrates the effect of the *throttle* parameter. When creating the Data View engine, if the *throttle* parameter is set to 30 seconds, the engine will only write data to the output table at 30-second intervals. Modify the `onload` function as follows:\n\n```\ndef onload(){\n    addEventListener(checkOrders,'Orders',,'all') \n    orderDV = streamTable(array(STRING, 0) as market, array(STRING, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(TIMESTAMP, 0) as updateTime)\n    share(orderDV,'orderDV')\n    createDataViewEngine(name='orderDV', outputTable=objByName('orderDV'), keyColumns=`code, timeColumn=`updateTime, useSystemTime=true, throttle=30s, includeOperationType=false)\n    addEventListener(deleteOrder,'DeleteOrder',,'all') \n}\n```\n\nAfter ingesting events into the engine and waiting 30 seconds, check the orderDV table. You will see that only one record, c1, remains in the table. This is because before the engine outputs the data, a `DeleteOrder` event has already entered the engine and removed the record c2.\n\n**Related functions**: [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [deleteDataViewItems](https://docs.dolphindb.com/en/Functions/d/delete_data_view_items.html), [dropDataViewEngine](https://docs.dolphindb.com/en/Functions/d/drop_data_view_engine.html), [getDataViewEngine](https://docs.dolphindb.com/en/Functions/g/get_data_view_engine.html)\n"
    },
    "crossStat": {
        "url": "https://docs.dolphindb.com/en/Functions/c/crossStat.html",
        "signatures": [
            {
                "full": "crossStat(X, Y)",
                "name": "crossStat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [crossStat](https://docs.dolphindb.com/en/Functions/c/crossStat.html)\n\n\n\n#### Syntax\n\ncrossStat(X, Y)\n\n#### Details\n\nReturn a tuple with the following elements: count(X), sum(X), sum(Y), sum2(X), sum2(Y), sum(X\\*Y)\n\n#### Parameters\n\n**X** and **Y** are numeric vectors of the same size.\n\n#### Examples\n\n```\nx=1 NULL 2 3\ny=4 3 NULL 2\ncrossStat(x,y);\n// output: (2,4,6,10,20,10)\n```\n"
    },
    "cubicHermiteSplineFit": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cubichermitesplinefit.html",
        "signatures": [
            {
                "full": "cubicHermiteSplineFit(X, Y, derivative, [extrapolate=true])",
                "name": "cubicHermiteSplineFit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "derivative",
                        "name": "derivative"
                    },
                    {
                        "full": "[extrapolate=true]",
                        "name": "extrapolate",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [cubicHermiteSplineFit](https://docs.dolphindb.com/en/Functions/c/cubichermitesplinefit.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ncubicHermiteSplineFit(X, Y, derivative, \\[extrapolate=true])\n\n#### Details\n\nThis function performs cubic Hermite interpolation on the given vectors *X* and *Y*.\n\n#### Parameters\n\n**X** is a numeric vector representing the x-coordinates (independent variable) of the interpolation points. *X* must be strictly increasing and contain at least two elements.\n\n**Y** is a numeric vector of the same length as *X*, representing the y-coordinates (dependent variable) of the interpolation points.\n\n**derivative** is a numeric vector of the same length as *X*, representing the first derivatives of *Y* with respect to *X*.\n\n**extrapolate** (optional) is a Boolean scalar indicating whether to allow extrapolation when prediction points fall outside the data range. Defaults to true.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* modelName: A string \"CubicHermiteSpline\" indicating the model name.\n* X: The numeric vector representing the x-coordinates used for interpolation (i.e., the input *X*).\n* extrapolate: A Boolean scalar. The input *extrapolate*.\n* coeffs: A numeric vector containing the polynomial coefficients fitted from the input data points.\n* predict: The prediction function of the model. You can call `model.predict(X)` or `predict(model, X)` to make predictions with the generated model.\n  * model: The output dictionary of `cubicHermiteSplineFit`.\n  * X: A numeric vector representing the x-coordinates.\n\n#### Examples\n\nPerform cubic Hermite interpolation on the given vectors *x* and *y*.\n\n```\nx = [0.0000,0.0800,0.1000,0.1700,0.2000,0.2500,0.3000,0.4000,0.5000,0.6000,0.7000,0.7500,0.8000,0.9000,1.0000]\ny = [1.2157,1.4000,1.4000,1.4000,1.4055,1.4323,1.4585,1.5096,1.5291,1.4985,1.4562,1.4440,1.4427,1.4461,1.4504]\nN = shape(x)[0]\nderv = take([0.0], N)\nderv[0] = (y[1] - y[0]) \\ (x[1] - x[0])\nderv[N-1]  = (y[N-1] - y[N-2]) \\ (x[N-1] - x[N-2])\nfor (i in 1..(N-2)) {\n\tderv[i] = (y[i+1] - y[i-1]) \\ (x[i+1] - x[i-1])\n}\n\nmodel = cubicHermiteSplineFit(x, y, derv)\nmodel;\n\n/* output:\nmodelName->CubicHermiteSpline\nX->[0,0.08,0.1,0.17,0.2,0.25,0.3,0.4,0.5,0.6,0.7,0.75,0.8,0.9,1]\ncoeffs->#0                   #1                   #2                 #3    \n-------------------- -------------------- ------------------ ------\n-71.992187499999985  5.759375             2.303749999999999  1.2157\n4607.499999999995452 -184.299999999999869 1.842999999999999  1.4   \n11.224489795918488   -0.785714285714294   0                  1.4   \n102.314814814811015  1.208333333333494    0.055000000000001  1.4   \n-55.2999999999993    5.409999999999942    0.40375            1.4055\n-1.066666666666638   -0.066666666666655   0.53               1.4323\n-15.366666666666818  1.493333333333353    0.515333333333334  1.4585\n-9.249999999999774   -0.655000000000037   0.353              1.5096\n19.199999999999896   -4.424999999999982   -0.055500000000001 1.5291\n11.816666666666725   -1.766666666666675   -0.3645            1.4985\n-4.133333333332982   2.593333333333321    -0.363333333333333 1.4562\n-27.600000000001628  3.560000000000105    -0.134999999999998 1.444 \n-1.549999999999794   0.354999999999965    0.014              1.4427\n-0.450000000000062   0.090000000000012    0.038499999999999  1.4461\n\nextrapolate->1\npredict->cubicHermiteSplinePredict\n*/\n```\n\nEvaluate the interpolation model at the given x points with `predict`.\n\n```\npreds = predict(model, x)\npreds;\n\n// output: [1.2157,1.4,1.4,1.4,1.4055,1.4323,1.4585,1.5096,1.5291,1.4985,1.4562,1.444,1.4427,1.4461,1.4504]\n```\n"
    },
    "cubicSpline": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cubicspline.html",
        "signatures": [
            {
                "full": "cubicSpline(x, y, bc_type=\"not-a-knot\")",
                "name": "cubicSpline",
                "parameters": [
                    {
                        "full": "x",
                        "name": "x"
                    },
                    {
                        "full": "y",
                        "name": "y"
                    },
                    {
                        "full": "bc_type=\"not-a-knot\"",
                        "name": "bc_type=\"not-a-knot\""
                    }
                ]
            }
        ],
        "markdown": "### [cubicSpline](https://docs.dolphindb.com/en/Functions/c/cubicspline.html)\n\n\n\n#### Syntax\n\ncubicSpline(x, y, bc\\_type=\"not-a-knot\")\n\n#### Details\n\nCubic spline data interpolator.\n\n#### Parameters\n\n**x** is a numeric vector containing values of the independent variable. The length of *x*must be no smaller than 3. Its values must be real and in strictly increasing order.\n\n**y** is a numeric vector containing values of the dependent variable. The length of *y* must match the length of *x*.\n\n**bc\\_type** is of STRING type, which can be a scalar, pair, or a vector of length no greater than 2. It specifies the boundary condition type.\n\n* If *bc\\_type*is a string or a vector of length 1, the specified condition will be applied at both ends of a spline.\n\n* If *bc\\_type*is a pair or a vector of length 2, the first and the second value will be applied at the curve start and end respectively.\n\nIts value can be:\n\n* \"not-a-knot\" (default): The first and second segment at a curve end are the same polynomial.\n\n* \"clamped\": The first derivative at curves ends are zero.\n\n* \"natural\": The second derivative at curve ends are zero.\n\n#### Returns\n\nA dictionary withthe following keys:\n\n* c: Coefficients of the polynomials on each segment.\n* x: Breakpoints. The input *x*.\n* predict: A prediction function of the model, which returns the cubic spline interpolation result at point X. It can be called using `model.predict(X)` or `predict(model, X)`, where\n  * model: A dictionary indicating the output of `cubicSpline`.\n  * X: A numeric vector indicating the X-coordinate of the point to be queried.\n* modelName: A string indicating the model name, which is “`cubicSpline`”.\n\n#### Examples\n\n```\nn = 10\nx = 0..(n-1)\ny = sin(x)\nmodel = cubicSpline(x, y, bc_type=\"not-a-knot\")\nmodel\n\n/* output\nx->[0,1,2,3,4,5,6,7,8,9]\npredict->cubicSplinePredict\nmodelName->cubicSpline\nc->[-0.0418500756165063,-0.2612720445455365,1.1445931049699394,0.0,-0.0418500756165067,-0.3868222713950554,0.4964987890293473,0.8414709848078965,0.1468910600890447,-0.5123724982445756,...]\n*/\n```\n\nRelated Function: [cubicSplinePredict](https://docs.dolphindb.com/en/Functions/c/cubicsplinepredict.html)\n"
    },
    "cubicSplinePredict": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cubicsplinepredict.html",
        "signatures": [
            {
                "full": "cubicSplinePredict(model, x)",
                "name": "cubicSplinePredict",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "x",
                        "name": "x"
                    }
                ]
            }
        ],
        "markdown": "### [cubicSplinePredict](https://docs.dolphindb.com/en/Functions/c/cubicsplinepredict.html)\n\n\n\n#### Syntax\n\ncubicSplinePredict(model, x)\n\n#### Details\n\nPredict the corresponding y for x with the given model.\n\n#### Parameters\n\n**model** is a dictionary with two keys, c and x. The value of c is the coefficients of the polynomials on each segment, and the value of x is the polynomial breakpoints. The length of c is equal to `(the length of x -1)*4`. Neither c nor x can contain null values. The model can be obtained with function `cubicSpline`.\n\n**x** is a numeric scalar or vector containing the independent variable to be predicted.\n\n#### Returns\n\nA vector of type DOUBLE.\n\n#### Examples\n\n```\nn = 10\nx = 0..(n-1)\ny = sin(x)\nmodel = cubicSpline(x, y, bc_type=\"not-a-knot\")\n\nnewx = [-0.5, 0.5, 0.7, 1.2, 4.5, 8.9, 9.3]\nret = cubicSplinePredict(model, newx)\n\n// output: [-0.632383304169291,0.501747281896522,0.658837295715183,0.924963051153032,-0.974025627606784,0.515113155358425,0.03881591118089]\n```\n\nRelated Function: [cubicSpline](https://docs.dolphindb.com/en/Functions/c/cubicspline.html)\n"
    },
    "cumavg": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumavg.html",
        "signatures": [
            {
                "full": "cumavg(X)",
                "name": "cumavg",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumavg](https://docs.dolphindb.com/en/Functions/c/cumavg.html)\n\n\n\n#### Syntax\n\ncumavg(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCalculate the cumulative average of *X*.\n\n#### Returns\n\nDOUBLE type, with the same data form as *X*.\n\n#### Examples\n\n```\nx=[2,3,NULL,4];\ncumavg(x);\n// output: [2,2.5,2.5,3]\n\nm=matrix(1 2 3 NULL 4, 5 6 NULL 7 8);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 5  |\n| 2  | 6  |\n| 3  |    |\n|    | 7  |\n| 4  | 8  |\n\n```\ncumavg(m);\n```\n\n| #0  | #1  |\n| --- | --- |\n| 1   | 5   |\n| 1.5 | 5.5 |\n| 2   | 5.5 |\n| 2   | 6   |\n| 2.5 | 6.5 |\n\nRelated functions: [cummax](https://docs.dolphindb.com/en/Functions/c/cummax.html), [cummin](https://docs.dolphindb.com/en/Functions/c/cummin.html), [cumprod](https://docs.dolphindb.com/en/Functions/c/cumprod.html), [cumPositiveStreak](https://docs.dolphindb.com/en/Functions/c/cumPositiveStreak.html), [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html)\n"
    },
    "cumavgTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumavgTopN.html",
        "signatures": [
            {
                "full": "cumavgTopN(X, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumavgTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumavgTopN](https://docs.dolphindb.com/en/Functions/c/cumavgTopN.html)\n\n\n\n#### Syntax\n\ncumavgTopN(X, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the average of the first *top* elements in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumavgTopN(X, S, 6, 4)\n// output: [1,1.5,2,4,23.199,20,20.167]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumavgTopN(X, S, 6, 4)\n```\n\n| #0   | #1      |\n| ---- | ------- |\n| 1    |         |\n| 1.5  | 12      |\n| 2    | 12.5    |\n| 2    | 13      |\n| 2.75 | 13      |\n| 3.4  | 13.75   |\n| 4    | 14.4    |\n| 5    | 15      |\n| 5    | 15.8333 |\n| 5    | 16      |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumavgTopN(price, id, 6, 4) as result from t\n```\n\n| result  |\n| ------- |\n| 94      |\n| 69.5    |\n| 46.3333 |\n| 55.75   |\n| 57.8    |\n| 49.6667 |\n| 50.5    |\n| 50.5    |\n| 51.5    |\n| 51.5    |\n"
    },
    "cumbeta": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumbeta.html",
        "signatures": [
            {
                "full": "cumbeta(Y, X)",
                "name": "cumbeta",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumbeta](https://docs.dolphindb.com/en/Functions/c/cumbeta.html)\n\n\n\n#### Syntax\n\ncumbeta(Y, X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the coefficient estimate of the regression of *Y* on *X*.\n\n#### Returns\n\nA vector of the same length as *X*.\n\n#### Examples\n\n```\nx=1 3 5 7 11 16 23\ny=1 6 9 8 15 23 34;\n\ncumbeta(y,x);\n// output: [,2.5,2,1.2,1.256757,1.365322,1.440948]\n```\n"
    },
    "cumbetaTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumbetaTopN.html",
        "signatures": [
            {
                "full": "cumbetaTopN(Y, X, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumbetaTopN",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumbetaTopN](https://docs.dolphindb.com/en/Functions/c/cumbetaTopN.html)\n\n\n\n#### Syntax\n\ncumbetaTopN(Y, X, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the coefficient estimate ordinary-least-squares regressions of *Y* on *X* in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nY=1 2 3 10 100 4 3\nX=1 7 8 9 0 5 8\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumbetaTopN(Y, X, S, 6)\n// output: [,0.1666,0.2441,0.7483,-6.4428,-6.4428,-6.2293]\n```\n"
    },
    "cumcorr": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumcorr.html",
        "signatures": [
            {
                "full": "cumcorr(X,Y)",
                "name": "cumcorr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cumcorr](https://docs.dolphindb.com/en/Functions/c/cumcorr.html)\n\n\n\n#### Syntax\n\ncumcorr(X,Y)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the correlation of *X* and *Y*.\n\n#### Returns\n\nA vector of the same length as *X*.\n\n#### Examples\n\n```\nx = 7 4 5 8 9\ny = 1 7 8 9 0\ncumcorr(x, y);\n// output: [,-1,-0.893405,-0.1524,-0.518751]\n```\n"
    },
    "cumcorrTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumcorrTopN.html",
        "signatures": [
            {
                "full": "cumcorrTopN(X, Y, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumcorrTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumcorrTopN](https://docs.dolphindb.com/en/Functions/c/cumcorrTopN.html)\n\n\n\n#### Syntax\n\ncumcorrTopN(X, Y, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the correlation of the first *top* pairs of elements in *X* and *Y* in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 13 4 3\nY = 1 7 8 9 0 5 8\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumcorrTopN(X, Y, S, 6, 3)\n// output: [,1,0.9244,0.6588,-0.1784,-0.1764,-0.1825]\n```\n"
    },
    "cumcount": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumcount.html",
        "signatures": [
            {
                "full": "cumcount(X)",
                "name": "cumcount",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumcount](https://docs.dolphindb.com/en/Functions/c/cumcount.html)\n\n\n\n#### Syntax\n\ncumcount(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the number of non-null elements in *X*.\n\n#### Returns\n\nINT type, with the same data form as *X*.\n\n#### Examples\n\n```\nx=[1,2,NULL,3,4,NULL,5,6]\ncumcount(x);\n// output: [1,2,2,3,4,4,5,6]\n\nm=matrix(1 2 3 NULL 4, 5 6 NULL NULL 8);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 5  |\n| 2  | 6  |\n| 3  |    |\n|    |    |\n| 4  | 8  |\n\n```\ncumcount(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 2  | 2  |\n| 3  | 2  |\n| 3  | 2  |\n| 4  | 3  |\n"
    },
    "cumcovar": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumcovar.html",
        "signatures": [
            {
                "full": "cumcovar(X,Y)",
                "name": "cumcovar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cumcovar](https://docs.dolphindb.com/en/Functions/c/cumcovar.html)\n\n\n\n#### Syntax\n\ncumcovar(X,Y)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the covariance of *X* and *Y*.\n\n#### Returns\n\nA vector of the same length as *X*.\n\n#### Examples\n\n```\nx = 7 4 5 8 9\ny = 1 7 8 9 0\ncumcovar(x, y);\n// output: [,-9,-5.166667,-1,-4.5]\n```\n"
    },
    "cumcovarp": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumcovarp.html",
        "signatures": [
            {
                "full": "cumcovarp(X,Y)",
                "name": "cumcovarp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cumcovarp](https://docs.dolphindb.com/en/Functions/c/cumcovarp.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ncumcovarp(X,Y)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCumulatively calculates the population covariance of *X* and *Y*.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\n```\nx = 7 4 5 8 9\ny = 1 7 8 9 0\ncumcovarp(x, y);\n// output: [0,-4.5,-3.44,-0.75,-3.6]\n```\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "cumcovarpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumcovarpTopN.html",
        "signatures": [
            {
                "full": "cumcovarpTopN(X, Y, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumcovarpTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumcovarpTopN](https://docs.dolphindb.com/en/Functions/c/cumcovarpTopN.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ncumcovarpTopN(X, Y, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a cumulative window, the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the population covariance of the first *top* pairs of elements in *X* and *Y*.\n\n#### Returns\n\nDOUBLE type, with its form determined by *X* (or *Y*).\n\n#### Examples\n\n```\nX=1 2 3 10 13 4 3\nY = 1 7 8 9 0 5 8\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumcovarpTopN(X, Y, S, 6)\n// output: [0,1.5,2.33,7.25,-3.2,-2.67,-2.78]\n```\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "cumcovarTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumcovarTopN.html",
        "signatures": [
            {
                "full": "cumcovarTopN(X, Y, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumcovarTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumcovarTopN](https://docs.dolphindb.com/en/Functions/c/cumcovarTopN.html)\n\n\n\n#### Syntax\n\ncumcovarTopN(X, Y, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the covariance of the first *top* pairs of elements in *X* and *Y* in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 13 4 3\nY = 1 7 8 9 0 5 8\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumcovarTopN(X, Y, S, 6, 3)\n// output: [,3,3.5,9.6666,-4,-3.2,-3.3333]\n```\n"
    },
    "cumdenserank": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumdenseRank.html",
        "signatures": [
            {
                "full": "cumdenseRank(X, [ascending=true], [ignoreNA=true], [percent=false], [norm='max'])",
                "name": "cumdenseRank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[norm='max']",
                        "name": "norm",
                        "optional": true,
                        "default": "'max'"
                    }
                ]
            }
        ],
        "markdown": "### [cumdenserank](https://docs.dolphindb.com/en/Functions/c/cumdenseRank.html)\n\n\n\n#### Syntax\n\ncumdenseRank(X, \\[ascending=true], \\[ignoreNA=true], \\[percent=false], \\[norm='max'])\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nIf *X* is a vector, for each element in *X*, return the position ranking from the first element to the current element. Rank values are consecutive integers and not skipped in the event of ties. The result is of the same length as *X*.\n\n* The sorting order is specified by *ascending*.\n\n* If *ignoreNA* = true, null values return NULL.\n\nIf *X* is a matrix or in-memory table, conduct the aforementioned calculation within each column of *X*. The result is a matrix or in-memory table with the same shape as *X*.\n\n#### Parameters\n\n**X** is a vector/matrix/in-memory table.\n\n**ascending** (optional) is a Boolean value indicating whether to sort data in ascending order. The default value is true.\n\n**ignoreNA** (optional) is a Boolean value indicating whether null values are ignored in ranking. True means ignoring null values, and false (default) means the null values participate in the calculation and are ranked the lowest.\n\n**percent** (optional) is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n**norm** (optional) is a string that can be either 'max' or 'minmax'. This parameter determines whether the ranking starts at 0 or 1, which impacts the percentile calculation. If *norm* = 'max', the ranking numbers start at 1; if *norm* = 'minmax', they start at 0. For example, when cumulative dense ranking \\[3,1,2] with result returned in percentiles:\n\n* if *norm* = 'max', the rank of \"2\" is 2 out of a max rank of 3 in the last cumulative window, so the percentile is 2\\3.\n\n* if *norm* = 'minmax', the rank of \"2\" is 1 out of a max rank of 2, so the result will be 1\\2.\n\nNote: To use *norm*, *percent* must be true.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\na = 1 3 2 3 4\ncumdenseRank(X=a, ascending=true, ignoreNA=true, percent=false)\n// output: [0,1,1,2,3]\n\ncumdenseRank(X=a, ascending=true, ignoreNA=true, percent=true, norm=\"max\")\n//output: [1,1,0.6667,1,1]\n\ncumdenseRank(X=a, ascending=true, ignoreNA=true, percent=true, norm=\"minmax\")\n// output: [1,1,0.5,1,1]\n\nm = matrix(1 6 2 NULL, 3 0 1 6, 7 3 NULL 2)\ncumdenseRank(X=m, ascending=true, ignoreNA=true, percent=false)\n/* output\n#0 #1 #2\n-- -- --\n0  0  0 \n1  0  0 \n1  1    \n   3  0\n */\n\nt = table([4,10,3,4,8,1] as val1, [10,8,1,8,5,2]  as val2)\ncumdenseRank(X=t, ascending=true, ignoreNA=true, percent=false)\n/* output\n\tval1    val2\n0\t0\t0\n1\t1\t0\n2\t0\t0\n3\t1\t1\n4\t2\t1\n5\t0\t1\n*/\n```\n\nRelated function: [cumrank](https://docs.dolphindb.com/en/Functions/c/cumrank.html)\n"
    },
    "cumfirstNot": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumfirstNot.html",
        "signatures": [
            {
                "full": "cumfirstNot(X, [k])",
                "name": "cumfirstNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[k]",
                        "name": "k",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [cumfirstNot](https://docs.dolphindb.com/en/Functions/c/cumfirstNot.html)\n\n\n\n#### Syntax\n\ncumfirstNot(X, \\[k])\n\n#### Details\n\nIf *X* is a vector:\n\n* If *k* is unspecified, return the first non-null element in *X*;\n* If *k* is specified, return the first element that is not *k*.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.\n\n#### Parameters\n\n**k** is a scalar.\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx=[NULL,1,2,6,NULL,3,4,NULL]\ncumfirstNot(x);\n// output: [,1,1,1,1,1,1,1]\n\ncumfirstNot(x, 1)\n// output: [,,2,2,2,2,2,2]\n\nm=matrix(1 2 3 NULL 4, NULL NULL 8 8 9);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  |    |\n| 2  |    |\n| 3  | 8  |\n|    | 8  |\n| 4  | 9  |\n\n```\ncumfirstNot(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  |    |\n| 1  |    |\n| 1  | 8  |\n| 1  | 8  |\n| 1  | 8  |\n\nRelated function: [firstNot](https://docs.dolphindb.com/en/Functions/f/firstNot.html)\n"
    },
    "cumkurtosisTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumkurtosisTopN.html",
        "signatures": [
            {
                "full": "cumkurtosisTopN(X, S, top, [biased=true], [ascending=true], [tiesMethod='latest'])",
                "name": "cumkurtosisTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumkurtosisTopN](https://docs.dolphindb.com/en/Functions/c/cumkurtosisTopN.html)\n\n\n\n#### Syntax\n\ncumkurtosisTopN(X, S, top, \\[biased=true], \\[ascending=true], \\[tiesMethod='latest'])\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the moving kurtosis of the first *top* elements in a cumulative window.\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumkurtosisTopN(X, S, 6, 4)\n// output: [,,1.5,2.2304,3.2152,4.1525,4.1554]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumkurtosisTopN(X, S, 6, 4)\n```\n\n| #0     | #1     |\n| ------ | ------ |\n|        |        |\n|        |        |\n| 1.5    |        |\n| 1.5    | 1.5    |\n| 1.8457 | 1.5    |\n| 1.5092 | 1.8457 |\n| 1.5    | 1.5092 |\n| 1.9204 | 1.5    |\n| 1.9204 | 1.6107 |\n| 1.9204 | 1.7297 |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumkurtosisTopN(price, id, 6, 4) as result from t\n```\n\n| result |\n| ------ |\n|        |\n|        |\n| 1.5    |\n| 1.4036 |\n| 1.537  |\n| 1.8185 |\n| 1.8838 |\n| 2.0968 |\n| 2.6695 |\n| 2.6695 |\n"
    },
    "cumlastNot": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumlastNot.html",
        "signatures": [
            {
                "full": "cumlastNot(X, [k])",
                "name": "cumlastNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[k]",
                        "name": "k",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [cumlastNot](https://docs.dolphindb.com/en/Functions/c/cumlastNot.html)\n\n\n\n#### Syntax\n\ncumlastNot(X, \\[k])\n\n#### Details\n\nIf *X* is a vector:\n\n* If *k* is unspecified, return the last non-null element in *X*;\n* If *k* is specified, return the last element that is not *k*.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.\n\n#### Parameters\n\n**k** is a scalar.\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx=[NULL,1,2,6,NULL,3,4,NULL]\ncumlastNot(x);\n// output: [,1,2,6,6,3,4,4]\n\ncumlastNot(x, 4)\n// output: [,1,2,6,6,3,3,3]\n\nm=matrix(1 2 3 NULL 4, NULL NULL 8 8 9);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  |    |\n| 2  |    |\n| 3  | 8  |\n|    | 8  |\n| 4  | 9  |\n\n```\ncumlastNot(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  |    |\n| 2  |    |\n| 3  | 8  |\n| 3  | 8  |\n| 4  | 9  |\n\nRelated function: [lastNot](https://docs.dolphindb.com/en/Functions/l/lastNot.html)\n"
    },
    "cummax": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cummax.html",
        "signatures": [
            {
                "full": "cummax(X)",
                "name": "cummax",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cummax](https://docs.dolphindb.com/en/Functions/c/cummax.html)\n\n\n\n#### Syntax\n\ncummax(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the maximum values in *X*. It can be used to calculate maximum drawdown, for example.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx = [7,4,5,8,9]\ncummax(x);\n// output: [7,7,7,8,9]\n\nm = matrix(6 5 7 8 1, 3 9 4 2 10);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 6  | 3  |\n| 5  | 9  |\n| 7  | 4  |\n| 8  | 2  |\n| 1  | 10 |\n\n```\ncummax(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 6  | 3  |\n| 6  | 9  |\n| 7  | 9  |\n| 8  | 9  |\n| 8  | 10 |\n\nRelated functions: [cummin](https://docs.dolphindb.com/en/Functions/c/cummin.html), [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html), [cumprod](https://docs.dolphindb.com/en/Functions/c/cumprod.html)\n"
    },
    "cummdd": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cummdd.html",
        "signatures": [
            {
                "full": "cummdd(X, [ratio=true])",
                "name": "cummdd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ratio=true]",
                        "name": "ratio",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [cummdd](https://docs.dolphindb.com/en/Functions/c/cummdd.html)\n\n#### Syntax\n\ncummdd(X, \\[ratio=true])\n\n#### Details\n\nCumulatively calculate the maximum drawdown for the input *X*. Null values are ignored in calculation.\n\n#### Parameters\n\n**X** is a numeric vector, indicating the input data for calculating maximum drawdown (MDD), commonly cumulative return (or rate).\n\n**ratio** (optional) is a Boolean scalar indicating whether to express the MDD in ratio or absolute value.\n\n* true (default): Return the ratio of MDD over the peak.\n\n  ![](https://docs.dolphindb.com/en/images/mdd1.png)\n\n* false: Return the absolute value of MDD.\n\n  ![](https://docs.dolphindb.com/en/images/mdd2.png)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the windowing logic.\n\n#### Returns\n\nA vector of the same type as *X*.\n\n#### Examples\n\nSuppose the daily returns for a portfolio are as follows:\n\n| Date       | Returns |\n| ---------- | ------- |\n| 2024-10-01 | 36      |\n| 2024-10-02 | 96      |\n| 2024-10-03 | 42      |\n| 2024-10-04 | 100     |\n| 2024-10-05 | 59      |\n| 2024-10-06 | 86      |\n| 2024-10-07 | 25      |\n| 2024-10-08 | 72      |\n\nCalculate the maximum drawdown:\n\n```\nx = [36,96,42,100,59,86,25,64,72]\ncummdd(x)\n// Output: [0,0,0.5625,0.5625,0.5625,0.5625,0.75,0.75,0.75]\ncummdd(x, false)\n// Output: [0,0,54,54,54,54,75,75,75]\n```\n\n"
    },
    "cummed": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cummed.html",
        "signatures": [
            {
                "full": "cummed(X)",
                "name": "cummed",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cummed](https://docs.dolphindb.com/en/Functions/c/cummed.html)\n\n\n\n#### Syntax\n\ncummed(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCalculate the cumulative median of *X*.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx = [7,9,5,NULL,9]\ncummed(x);\n// output: [7,8,7,7,8]\n\nm = matrix(6 5 7 8 1, 3 9 4 2 10);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 6  | 3  |\n| 5  | 9  |\n| 7  | 4  |\n| 8  | 2  |\n| 1  | 10 |\n\n```\ncummed(m);\n```\n\n| #0  | #1  |\n| --- | --- |\n| 6   | 3   |\n| 5.5 | 6   |\n| 6   | 4   |\n| 6.5 | 3.5 |\n| 6   | 4   |\n\nRelated functions: [cummax](https://docs.dolphindb.com/en/Functions/c/cummax.html), [cummin](https://docs.dolphindb.com/en/Functions/c/cummin.html), [med](https://docs.dolphindb.com/en/Functions/m/med.html)\n"
    },
    "cummin": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cummin.html",
        "signatures": [
            {
                "full": "cummin(X)",
                "name": "cummin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cummin](https://docs.dolphindb.com/en/Functions/c/cummin.html)\n\n\n\n#### Syntax\n\ncummin(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the minimum values in *X*.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx = [7,4,5,NULL,9]\ncummin(x);\n// output: [7,4,4,4,4]\n\nm = matrix(6 5 7 8 1, 3 9 4 2 10);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 6  | 3  |\n| 5  | 9  |\n| 7  | 4  |\n| 8  | 2  |\n| 1  | 10 |\n\n```\ncummin(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 6  | 3  |\n| 5  | 3  |\n| 5  | 3  |\n| 5  | 2  |\n| 1  | 2  |\n\nRelated functions:[cummax](https://docs.dolphindb.com/en/Functions/c/cummax.html), [min](https://docs.dolphindb.com/en/Functions/m/min.html)\n"
    },
    "cumnunique": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumnunique.html",
        "signatures": [
            {
                "full": "cumnunique(X, [ignoreNull=false])",
                "name": "cumnunique",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ignoreNull=false]",
                        "name": "ignoreNull",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [cumnunique](https://docs.dolphindb.com/en/Functions/c/cumnunique.html)\n\n#### Syntax\n\ncumnunique(X, \\[ignoreNull=false])\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nReturn the cumulative count of unique elements in *X*.\n\n**Note:** Null values are included in the calculation.\n\n#### Parameters\n\n**ignoreNull** (optional) is a Boolean value. If set to true, only non-null elements will be included in the calculation. The default value is false.\n\n#### Returns\n\nINT type, with the same data form as *X*.\n\n#### Examples\n\n```\nv = [NULL, 1, 2, -6, 0, 1, 2]\ncumnunique(v)\n// output: [1,2,3,4,5,5,5]\n\nt = table(`a`a`b`c`a`b as id, 20 20 10 40 30 20 as val)\nselect cumnunique(id) as cumVal from t\n```\n\n| cumVal |\n| ------ |\n| 1      |\n| 1      |\n| 2      |\n| 3      |\n| 3      |\n| 3      |\n\n"
    },
    "cumpercentile": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumpercentile.html",
        "signatures": [
            {
                "full": "cumpercentile(X, percent, [interpolation='linear'])",
                "name": "cumpercentile",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "percent",
                        "name": "percent"
                    },
                    {
                        "full": "[interpolation='linear']",
                        "name": "interpolation",
                        "optional": true,
                        "default": "'linear'"
                    }
                ]
            }
        ],
        "markdown": "### [cumpercentile](https://docs.dolphindb.com/en/Functions/c/cumpercentile.html)\n\n\n\n#### Syntax\n\ncumpercentile(X, percent, \\[interpolation='linear'])\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\n* If *X* is a vector, cumulatively calculate the given percentile of a vector. The calculation ignores null values.\n* If *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.\n\n#### Parameters\n\n**X** is a vector or matrix.\n\n**percent** is an integer or a floating point number between 0 and 100.\n\n**interpolation** (optional) is a string indicating the interpolation method to use if the specified percentile is between two elements in *X* (assuming the i-th and (i+1)-th element in the sorted *X*) . It can take the following values:\n\n* 'linear': Return X(i)+(X(t+1)-X(t))\\*fraction, where fraction = ((percentile100)-(i(size-1)))(1(size-1))\n\n* 'lower': Return X(i)\n\n* 'higher': Return X(i+1)\n\n* 'nearest': Return X(i) or X(i+1) that is closest to the specified percentile\n\n* 'midpoint': Return (X(i)+X(i+1))2\n\nThe default value of interpolation is 'linear'.\n\n#### Returns\n\nDOUBLE type, with the same data form as *X*.\n\n#### Examples\n\n```\na=1..10;\n\ncumpercentile(a,25);\n// output: [1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25]\n\ncumpercentile(a,25,'lower');\n// output: [1,1,1,1,2,2,2,2,3,3]\n\ncumpercentile(a,25,'higher');\n// output: [1,2,2,2,2,3,3,3,3,4]\n\ncumpercentile(a,25,'midpoint');\n// output: [1,1.5,1.5,1.5,2,2.5,2.5,2.5,3,3.5]\n\ncumpercentile(a,25,'nearest');\n// output: [1,1,1,2,2,2,2,3,3,3]\n\ncumpercentile(a,50.5);\n// output: [1,1.505,2.01,2.515,3.02,3.525,4.03,4.535,5.04,5.545]\n\nm=matrix(1..10, 11..20);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 11 |\n| 2  | 12 |\n| 3  | 13 |\n| 4  | 14 |\n| 5  | 15 |\n| 6  | 16 |\n| 7  | 17 |\n| 8  | 18 |\n| 9  | 19 |\n| 10 | 20 |\n\n```\ncumpercentile(m,25);\n```\n\n| #0   | #1    |\n| ---- | ----- |\n| 1    | 11    |\n| 1.25 | 11.25 |\n| 1.5  | 11.5  |\n| 1.75 | 11.75 |\n| 2    | 12    |\n| 2.25 | 12.25 |\n| 2.5  | 12.5  |\n| 2.75 | 12.75 |\n| 3    | 13    |\n| 3.25 | 13.25 |\n\nRelated functions: [percentile](https://docs.dolphindb.com/en/Functions/p/percentile.html)\n"
    },
    "cumPositiveStreak": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumPositiveStreak.html",
        "signatures": [
            {
                "full": "cumPositiveStreak(X)",
                "name": "cumPositiveStreak",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumPositiveStreak](https://docs.dolphindb.com/en/Functions/c/cumPositiveStreak.html)\n\n\n\n#### Syntax\n\ncumPositiveStreak(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the sum of consecutive positive elements of *X* after the last non-positive element to the left.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx=1 0 -1 1 2 2 2 1 0 -1 0 2;\n\ncumPositiveStreak x;\n// output: [1,0,0,1,3,5,7,8,0,0,0,2]\n\nm=matrix(1 0 -1 1 2 2 2 1 0 -1 0 2, -1 -2 -1 0 1 3 6 7 0 -1 -2 0);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | -1 |\n| 0  | -2 |\n| -1 | -1 |\n| 1  | 0  |\n| 2  | 1  |\n| 2  | 3  |\n| 2  | 6  |\n| 1  | 7  |\n| 0  | 0  |\n| -1 | -1 |\n| 0  | -2 |\n| 2  | 0  |\n\n```\ncumPositiveStreak(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 0  |\n| 0  | 0  |\n| 0  | 0  |\n| 1  | 0  |\n| 3  | 1  |\n| 5  | 4  |\n| 7  | 10 |\n| 8  | 17 |\n| 0  | 0  |\n| 0  | 0  |\n| 0  | 0  |\n| 2  | 0  |\n\nrelaated functions: [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html), [cummax](https://docs.dolphindb.com/en/Functions/c/cummax.html), [cummin](https://docs.dolphindb.com/en/Functions/c/cummin.html), [cumprod](https://docs.dolphindb.com/en/Functions/c/cumprod.html)\n"
    },
    "cumprod": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumprod.html",
        "signatures": [
            {
                "full": "cumprod(X)",
                "name": "cumprod",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumprod](https://docs.dolphindb.com/en/Functions/c/cumprod.html)\n\n\n\n#### Syntax\n\ncumprod(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the product of the elements in *X*.\n\n**Note:** Similar to NumPy's [numpy.cumprod](https://numpy.org/doc/stable/reference/generated/numpy.cumprod.html), but DolphinDB's `cumprod` computes cumulative products along columns by default for matrices (equivalent to numpy.cumsum with *axis*=0), and only accepts one parameter *X* without support for the *axis*, *dtype*, or *out* parameters available in `numpy.cumprod`.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\ncumprod(2 3 4);\n// output: [2,6,24]  // equivalent to  [2, 2*3, 2*3*4]\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\ncumprod(m);\n```\n\n| #0 | #1  |\n| -- | --- |\n| 1  | 4   |\n| 2  | 20  |\n| 6  | 120 |\n\nRelated functions: [prod](https://docs.dolphindb.com/en/Functions/p/prod.html)\n"
    },
    "cumrank": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumrank.html",
        "signatures": [
            {
                "full": "cumrank(X, [ascending=true], [ignoreNA=true], [tiesMethod='min'], [percent=false])",
                "name": "cumrank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='min']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'min'"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [cumrank](https://docs.dolphindb.com/en/Functions/c/cumrank.html)\n\n\n\n#### Syntax\n\ncumrank(X, \\[ascending=true], \\[ignoreNA=true], \\[tiesMethod='min'], \\[percent=false])\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nIf *X* is a vector, for each element in *X*, return the position ranking from the first element to the current element. The result is of the same length as *X*. If *ignoreNA* = true, null values return NULL.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.\n\n#### Parameters\n\n**X** is a vector/ matrix.\n\n**ascending** (optional) is a Boolean value indicating whether to sort in ascending order. It is an optional parameter and the default value is true.\n\n**ignoreNA** (optional) is a Boolean value indicating whether null values are ignored in ranking. True means ignoring the null value, and false means the null values participate in the calculation. The default value is true. If null values participate in the ranking, they are ranked the lowest.\n\n**tiesMethod** (optional) is a string indicating how to rank the group of records with the same value (i.e., ties):\n\n* 'min': lowest rank of the group\n\n* 'max': highest rank of the group\n\n* 'average': average rank of the group\n\n**percent** (optional) is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n#### Returns\n\nINT type, with the same data form as *X*.\n\n#### Examples\n\n```\ncumrank(1 3 2 3 4);\n// output: [0,1,1,2,4]\n\ncumrank(1 3 2 2 4 NULL, ignoreNA=true);\n// output: [0,1,1,1,4,]\n\ncumrank(1 3 2 2 4 NULL, ignoreNA=false);\n// output: [0,1,1,1,4,0]\n\ncumrank(1 3 2 2 4 NULL, ignoreNA=false, tiesMethod='max');\n// output: [0,1,1,2,4,0]\n\nm=matrix(1 4 2 3 4, 4 NULL 6 1 2);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 4  |    |\n| 2  | 6  |\n| 3  | 1  |\n| 4  | 2  |\n\n```\ncumrank(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 0  | 0  |\n| 1  |    |\n| 1  | 1  |\n| 2  | 0  |\n| 3  | 1  |\n\nRelated function: [rank](https://docs.dolphindb.com/en/Functions/r/rank.html)\n"
    },
    "cumskewTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumskewTopN.html",
        "signatures": [
            {
                "full": "cumskewTopN(X, S, top, [biased=true], [ascending=true], [tiesMethod='latest'])",
                "name": "cumskewTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumskewTopN](https://docs.dolphindb.com/en/Functions/c/cumskewTopN.html)\n\n\n\n#### Syntax\n\ncumskewTopN(X, S, top, \\[biased=true], \\[ascending=true], \\[tiesMethod='latest'])\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the moving skewness of the first *top* elements in a cumulative window.\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumskewTopN(X, S, 6, 4)\n// output: [,0,0,1.0182,1.4754,1.7635,1.7650]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumskewTopN(X, S, 6, 4)\n```\n\n| #0      | #1      |\n| ------- | ------- |\n|         |         |\n| 0       |         |\n| 0       | 0       |\n| 0       | 0       |\n| 0.4373  | 0       |\n| 0.158   | 0.4347  |\n| 0       | 0.158   |\n| -0.4448 | 0       |\n| -0.4448 | -0.3599 |\n| -0.4448 | -0.1413 |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumskewTopN(price, id, 6, 4) as result from t\n```\n\n| result  |\n| ------- |\n|         |\n| 0       |\n| -0.6435 |\n| -0.7353 |\n| -0.209  |\n| -0.2864 |\n| -0.0042 |\n| 0.0955  |\n| 0.0955  |\n| -0.5659 |\n"
    },
    "cumstd": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumstd.html",
        "signatures": [
            {
                "full": "cumstd(X)",
                "name": "cumstd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumstd](https://docs.dolphindb.com/en/Functions/c/cumstd.html)\n\n\n\n#### Syntax\n\ncumstd(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the standard deviation of *X*.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nx = [1,2,4,NULL,8];\ncumstd(x);\n// output: [,0.707107,1.527525,1.527525,3.095696]\n\nm=matrix(0.15 0.08 0.03 -0.14 -0.09, 0.2 -0.12 -0.16 0.08 0.16);\nm;\n```\n\n| #0    | #1    |\n| ----- | ----- |\n| 0.15  | 0.2   |\n| 0.08  | -0.12 |\n| 0.03  | -0.16 |\n| -0.14 | 0.08  |\n| -0.09 | 0.16  |\n\n```\ncumstd(m);\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n| 0.049497474683058 | 0.226274169979695 |\n| 0.060277137733417 | 0.19731531449265  |\n| 0.123558353285671 | 0.169705627484771 |\n| 0.119707978013163 | 0.16346253393362  |\n\nRelated functions: [std](https://docs.dolphindb.com/en/Functions/s/std.html)\n"
    },
    "cumstdp": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumstdp.html",
        "signatures": [
            {
                "full": "cumstdp(X)",
                "name": "cumstdp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumstdp](https://docs.dolphindb.com/en/Functions/c/cumstdp.html)\n\n\n\n#### Syntax\n\ncumstdp(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the population standard deviation of *X*.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\ncumstdp(1 2 4 NULL 8);\n// output: [0, 0.5, 1.247219128924647, 1.247219128924647, 2.680951323690902]\n```\n\n```\nm=matrix(0.15 0.08 0.03 -0.14 -0.09, 0.2 -0.12 -0.16 0.08 0.16);\nm;\n```\n\n| #0    | #1    |\n| ----- | ----- |\n| 0.15  | 0.2   |\n| 0.08  | -0.12 |\n| 0.03  | -0.16 |\n| -0.14 | 0.08  |\n| -0.09 | 0.16  |\n\n```\ncumstdp(m);\n```\n\n| col1   | col2   |\n| ------ | ------ |\n| 0      | 0      |\n| 0.035  | 0.16   |\n| 0.0492 | 0.1611 |\n| 0.107  | 0.147  |\n| 0.1071 | 0.1462 |\n\nRelated function: [stdp](https://docs.dolphindb.com/en/Functions/s/stdp.html)\n"
    },
    "cumstdpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumstdpTopN.html",
        "signatures": [
            {
                "full": "cumstdpTopN(X, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumstdpTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumstdpTopN](https://docs.dolphindb.com/en/Functions/c/cumstdpTopN.html)\n\n\n\n#### Syntax\n\ncumstdpTopN(X, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the population standard deviation of the first *top* elements in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumstdpTopN(X, S, 6, 4)\n// output: [0,0.5,0.8164,3.5355,38.5299,35.8933,35.8116]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumstdpTopN(X, S, 6, 4)\n```\n\n| #1     | #2     |\n| ------ | ------ |\n| 0      |        |\n| 0.5    | 0      |\n| 0.8165 | 0.5    |\n| 0.8165 | 0.8165 |\n| 1.479  | 0.8165 |\n| 1.8547 | 1.479  |\n| 2.1602 | 1.8547 |\n| 2.3805 | 2.1602 |\n| 2.3805 | 2.5441 |\n| 2.3805 | 2.7689 |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumstdpTopN(price, id, 6, 4) as result from t\n```\n\n| result  |\n| ------- |\n| 0       |\n| 28.5    |\n| 26.8701 |\n| 24.8294 |\n| 22.2657 |\n| 29.4543 |\n| 29.4543 |\n| 30.8081 |\n| 25.5435 |\n| 25.5435 |\n"
    },
    "cumstdTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumstdTopN.html",
        "signatures": [
            {
                "full": "cumstdTopN(X, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumstdTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumstdTopN](https://docs.dolphindb.com/en/Functions/c/cumstdTopN.html)\n\n\n\n#### Syntax\n\ncumstdTopN(X, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the unbiased sample standard deviation of the first *top* elements in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumstdTopN(X, S, 6, 4)\n// output: [,0.70,1,4.08,43.07,39.31,39.22]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumstdTopN(X, S, 6, 4)\n```\n\n| #0     | #1     |\n| ------ | ------ |\n|        |        |\n| 0.7071 |        |\n| 1      | 0.7071 |\n| 1      | 1      |\n| 1.7078 | 1      |\n| 2.0736 | 1.7078 |\n| 2.3664 | 2.0736 |\n| 2.6077 | 2.3664 |\n| 2.6077 | 2.7869 |\n| 2.6077 | 3.0332 |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumavgTopN(price, id, 6, 4) as result from t\n```\n\n| result  |\n| ------- |\n| 94      |\n| 69.5    |\n| 46.3333 |\n| 55.75   |\n| 57.8    |\n| 49.6667 |\n| 50.5    |\n| 50.5    |\n| 51.5    |\n| 51.5    |\n"
    },
    "cumsum": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumsum.html",
        "signatures": [
            {
                "full": "cumsum(X)",
                "name": "cumsum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html)\n\n\n\n#### Syntax\n\ncumsum(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the sum of the elements in *X*.\n\n**Note:** DolphinDB's `cumsum` function works the same as NumPy's [numpy.cumsum](https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html), except that it only accepts a single parameter, *X*, and does not support parameters like *axis*, *dtype*, or *out* in `numpy.cumsum`.\n\nSimilar to NumPy's [numpy.cumsum](https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html), but DolphinDB's `cumsum` accumulates along columns by default for matrices (equivalent to `numpy.cumsum` with *axis*=0), and only accepts one parameter *X* without support for the *axis*, *dtype*, or *out* parameters available in `numpy.cumsum`.\n\n#### Returns\n\nLONG/DOUBLE type, with the same data form as *X*.\n\n#### Examples\n\n```language-python\nx=[2,3,4];\ncumsum(x);\n// output: [2,5,9]\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```language-python\ncumsum(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 3  | 9  |\n| 6  | 15 |\n\nRelated functions: [cumsum2](https://docs.dolphindb.com/en/Functions/c/cumsum2.html), [cumsum3](https://docs.dolphindb.com/en/Functions/c/cumsum3.html), [cumsum4](https://docs.dolphindb.com/en/Functions/c/cumsum4.html)\n"
    },
    "cumsum2": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumsum2.html",
        "signatures": [
            {
                "full": "cumsum2(X)",
                "name": "cumsum2",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumsum2](https://docs.dolphindb.com/en/Functions/c/cumsum2.html)\n\n\n\n#### Syntax\n\ncumsum2(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the sum of squares of the elements in *X*.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nx=[2,3,4];\ncumsum2 x;\n// output: [4,13,29]\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 16 |\n| 5  | 41 |\n| 14 | 77 |\n\nRelated function: [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html), [cumsum3](https://docs.dolphindb.com/en/Functions/c/cumsum3.html), [cumsum4](https://docs.dolphindb.com/en/Functions/c/cumsum4.html)\n"
    },
    "cumsum3": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumsum3.html",
        "signatures": [
            {
                "full": "cumsum3(X)",
                "name": "cumsum3",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumsum3](https://docs.dolphindb.com/en/Functions/c/cumsum3.html)\n\n\n\n#### Syntax\n\ncumsum3(X)\n\nPlease see [cumFunctions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCumulatively calculate the cubes of squares of the elements in *X*.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nx=[2,3,4];\ncumsum3 x;\n// output: [8,35,99]\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\ncumsum3(m);\n```\n\n| #0 | #1  |\n| -- | --- |\n| 1  | 64  |\n| 9  | 189 |\n| 36 | 405 |\n\nRelated functions: [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html), [cumsum2](https://docs.dolphindb.com/en/Functions/c/cumsum2.html), [cumsum4](https://docs.dolphindb.com/en/Functions/c/cumsum4.html)\n"
    },
    "cumsum4": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumsum4.html",
        "signatures": [
            {
                "full": "cumsum4(X)",
                "name": "cumsum4",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumsum4](https://docs.dolphindb.com/en/Functions/c/cumsum4.html)\n\n\n\n#### Syntax\n\ncumsum4(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the fourth powers of the elements in *X*.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nx=[2,3,4];\ncumsum4 x;\n// output: [16,97,353]\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\ncumsum4(m);\n```\n\n| #0 | #1   |\n| -- | ---- |\n| 1  | 256  |\n| 17 | 881  |\n| 98 | 2177 |\n\nRelated functions: [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html), [cumsum2](https://docs.dolphindb.com/en/Functions/c/cumsum2.html), [cumsum3](https://docs.dolphindb.com/en/Functions/c/cumsum3.html)\n"
    },
    "cumsumTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumsumTopN.html",
        "signatures": [
            {
                "full": "cumsumTopN(X, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumsumTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumsumTopN](https://docs.dolphindb.com/en/Functions/c/cumsumTopN.html)\n\n\n\n#### Syntax\n\ncumsumTopN(X, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then sums up the first *top* elements in a cumulative window.\n\n#### Returns\n\nLONG or DOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumsumTopN(X, S, 6)\n// output: [1,3,6,16,116,120,121]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumsumTopN(X, S, 6)\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  |    |\n| 3  | 12 |\n| 6  | 25 |\n| 6  | 39 |\n| 11 | 39 |\n| 17 | 55 |\n| 24 | 72 |\n| 30 | 90 |\n| 30 | 95 |\n| 30 | 96 |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumsumTopN(price, id, 6) as result from t\n```\n\n| result |\n| ------ |\n| 32     |\n| 130    |\n| 145    |\n| 223    |\n| 283    |\n| 292    |\n| 344    |\n| 364    |\n| 406    |\n| 333    |\n"
    },
    "cumvar": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumvar.html",
        "signatures": [
            {
                "full": "cumvar(X)",
                "name": "cumvar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumvar](https://docs.dolphindb.com/en/Functions/c/cumvar.html)\n\n\n\n#### Syntax\n\ncumvar(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the variance of *X*.\n\n#### Returns\n\nDOUBLE type, with the same data form as *X*.\n\n#### Examples\n\n```\nx=[2,3,4];\ncumvar(x);\n// output: [,0.5,1]\n\nm=matrix(0.15 0.08 0.03 -0.14 -0.09, 0.2 -0.12 -0.16 0.08 0.16);\nm;\n```\n\n| #0    | #1    |\n| ----- | ----- |\n| 0.15  | 0.2   |\n| 0.08  | -0.12 |\n| 0.03  | -0.16 |\n| -0.14 | 0.08  |\n| -0.09 | 0.16  |\n\n```\ncumvar(m);\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n| 0.00245           | 0.0512            |\n| 0.003633333333333 | 0.038933333333333 |\n| 0.015266666666667 | 0.0288            |\n| 0.01433           | 0.02672           |\n\nRelated functions: [cummax](https://docs.dolphindb.com/en/Functions/c/cummax.html), [cummin](https://docs.dolphindb.com/en/Functions/c/cummin.html), [cumprod](https://docs.dolphindb.com/en/Functions/c/cumprod.html), [cumPositiveStreak](https://docs.dolphindb.com/en/Functions/c/cumPositiveStreak.html), [cumsum](https://docs.dolphindb.com/en/Functions/c/cumsum.html), [cumavg](https://docs.dolphindb.com/en/Functions/c/cumavg.html), [cumstd](https://docs.dolphindb.com/en/Functions/c/cumstd.html)\n"
    },
    "cumvarp": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumvarp.html",
        "signatures": [
            {
                "full": "cumvarp(X)",
                "name": "cumvarp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [cumvarp](https://docs.dolphindb.com/en/Functions/c/cumvarp.html)\n\n\n\n#### Syntax\n\ncumvarp(X)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCumulatively calculate the population variance of *X*.\n\n#### Returns\n\nDOUBLE type, with the same data form as *X*.\n\n#### Examples\n\n```\ncumvarp(1 2 3 NULL 4);\n// output: [ , 0.25, 0.666666666666667, 0.666666666666667, 1.25]\n```\n\n```\nm=matrix(1.1 3 5.0 7.5 9.2, 1 4.3 7.1 10.6 13.5);\nm;\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1.1  | 1    |\n| 3    | 4.3  |\n| 5    | 7.1  |\n| 7.5  | 10.6 |\n| 9.2  | 13.5 |\n\n```\ncumvarp(m);\n```\n\n| col1   | col2    |\n| ------ | ------- |\n| 0      | 0       |\n| 0.9025 | 2.7225  |\n| 2.5356 | 6.2156  |\n| 5.6425 | 12.5025 |\n| 8.5944 | 19.612  |\n\nRelated function: [varp](https://docs.dolphindb.com/en/Functions/v/varp.html)\n"
    },
    "cumvarpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumvarpTopN.html",
        "signatures": [
            {
                "full": "cumvarpTopN(X, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumvarpTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumvarpTopN](https://docs.dolphindb.com/en/Functions/c/cumvarpTopN.html)\n\n\n\n#### Syntax\n\ncumvarpTopN(X, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the population variance of the first *top* elements in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumvarpTopN(X, S, 6, 4)\n// output: [0,0.25,0.6666,12.5,1484.5599,1288.3333,1282.4722]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumvarpTopN(X, S, 6, 4)\n```\n\n| #1     | #2     |\n| ------ | ------ |\n| 0      |        |\n| 0.25   | 0      |\n| 0.6667 | 0.25   |\n| 0.6667 | 0.6667 |\n| 2.1875 | 0.6667 |\n| 3.44   | 2.1875 |\n| 4.6667 | 3.44   |\n| 5.6667 | 4.6667 |\n| 5.6667 | 6.4722 |\n| 5.6667 | 7.6667 |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumvarpTopN(price, id, 6, 4) as result from t\n```\n\n| result   |\n| -------- |\n| 0        |\n| 182.25   |\n| 124.2222 |\n| 114.5    |\n| 255.44   |\n| 428.4722 |\n| 428.4722 |\n| 416.9167 |\n| 722.9167 |\n| 722.9167 |\n"
    },
    "cumvarTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumvarTopN.html",
        "signatures": [
            {
                "full": "cumvarTopN(X, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumvarTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumvarTopN](https://docs.dolphindb.com/en/Functions/c/cumvarTopN.html)\n\n\n\n#### Syntax\n\ncumvarTopN(X, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the unbiased sample variance of the first *top* elements in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumvarTopN(X, S, 6, 4)\n// output: [,0.5,1,16.6666,1855.7,1546,1538.9666]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\ncumvarTopN(X, S, 6, 4)\n```\n\n| #0     | #1     |\n| ------ | ------ |\n|        |        |\n| 0.5    |        |\n| 1      | 0.5    |\n| 1      | 1      |\n| 2.9167 | 1      |\n| 4.3    | 2.9167 |\n| 5.6    | 4.3    |\n| 6.8    | 5.6    |\n| 6.8    | 7.7667 |\n| 6.8    | 9.2    |\n\n```\nid=rand(10,10)\nprice=rand(100,10)\nt=table(id, price)\nselect cumvarTopN(price, id, 6, 4) as result from t\n```\n\n| result   |\n| -------- |\n|          |\n| 800      |\n| 808.3333 |\n| 730.25   |\n| 825.2    |\n| 903.3667 |\n| 747.3667 |\n| 856.7    |\n| 887.4667 |\n| 994.9667 |\n"
    },
    "cumwavg": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumwavg.html",
        "signatures": [
            {
                "full": "cumwavg(X, Y)",
                "name": "cumwavg",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cumwavg](https://docs.dolphindb.com/en/Functions/c/cumwavg.html)\n\n\n\n#### Syntax\n\ncumwavg(X, Y)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCalculate the cumulative weighted average of *X* with *Y* as the weights. The result is a vector of the same length as *X*. Null values are ignored in the calculation.\n\n#### Returns\n\nDOUBLE type, with the same data form as *X(Y)*.\n\n#### Examples\n\n```\ncumwavg(2.2 1.1 3.3, 4 5 6);\n// output: [2.2,1.588889,2.273333]\n\ncumwavg(1 NULL 1, 1 1 1);\n// output: [1,1,1]\n```\n\nRelated function: [wavg](https://docs.dolphindb.com/en/Functions/w/wavg.html)\n"
    },
    "cumwsum": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumwsum.html",
        "signatures": [
            {
                "full": "cumwsum(X, Y)",
                "name": "cumwsum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [cumwsum](https://docs.dolphindb.com/en/Functions/c/cumwsum.html)\n\n\n\n#### Syntax\n\ncumwsum(X, Y)\n\nPlease see [Cumulative Window Functions](https://docs.dolphindb.com/en/Functions/Themes/cumFunctions.html) for the parameter description and windowing logic.\n\n#### Details\n\nCalculate the cumulative weighted sum of *X* with *Y* as the weights. The result is a vector of the same length as *X*. Null values are ignored in the calculation.\n\n#### Returns\n\nDOUBLE type, with the same data form as *X(Y)*.\n\n#### Examples\n\n```\ncumwsum(2.2 1.1 3.3, 4 5 6);\n// output: [8.8,14.3,34.1]\n\ncumwsum(1 NULL 1, 1 1 1);\n// output: [1,1,2]\n```\n\nRelated function: [wsum](https://docs.dolphindb.com/en/Functions/w/wsum.html)\n"
    },
    "cumwsumTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cumwsumTopN.html",
        "signatures": [
            {
                "full": "cumwsumTopN(X, Y, S, top, [ascending=true], [tiesMethod='latest'])",
                "name": "cumwsumTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [cumwsumTopN](https://docs.dolphindb.com/en/Functions/c/cumwsumTopN.html)\n\n\n\n#### Syntax\n\ncumwsumTopN(X, Y, S, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [Cumulative Moving TopN Functions](https://docs.dolphindb.com/en/Functions/Themes/cumTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nThe function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving sums of *X* with *Y* as weights in a cumulative window.\n\n#### Returns\n\nDOUBLE type.\n\n#### Examples\n\n```\nX=1 2 3 10 13 4 3\nY = 1 7 8 9 0 5 8\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\ncumwsumTopN(X, Y, S, 6, 3)\n// output: [1,15,39,129,129,149,159]\n```\n"
    },
    "curvePredict": {
        "url": "https://docs.dolphindb.com/en/Functions/c/curvePredict.html",
        "signatures": [
            {
                "full": "curvePredict(curve, dt)",
                "name": "curvePredict",
                "parameters": [
                    {
                        "full": "curve",
                        "name": "curve"
                    },
                    {
                        "full": "dt",
                        "name": "dt"
                    }
                ]
            }
        ],
        "markdown": "### [curvePredict](https://docs.dolphindb.com/en/Functions/c/curvePredict.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ncurvePredict(curve, dt)\n\n#### Details\n\nPredicts the curve value at the specified point(s) (specified by *dt*) on the given curve. Currently support only zero coupon yield curve.\n\n#### Parameters\n\n**curve** is a MKTDATA object of IrYieldCurve type.\n\n**dt** is a DOUBLE scalar/vector or a DATE scalar/vector.\n\n* A DOUBLE scalar/vector indicates time in years.\n\n* A DATE scalar/vector indicates specific date(s).\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\ncurveDict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": 2025.08.18,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"ActualActual\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": [2025.08.21,\n              2025.08.27,\n              2025.09.03,\n              2025.09.10,\n              2025.09.22,\n              2025.10.20,\n              2025.11.20,\n              2026.02.24,\n              2026.05.20,\n              2026.08.20,\n              2027.02.22,\n              2027.08.20,\n              2028.08.21],\n    \"values\":[1.5113, \n              1.5402, \n              1.5660, \n              1.5574, \n              1.5556, \n              1.5655, \n              1.5703, \n              1.5934, \n              1.6040, \n              1.6020, \n              1.5928, \n              1.5842, \n              1.6068]/100\n}\n\ncurve = parseMktData(curveDict)\n\ncurvePredict(curve, 2025.10.18)\n\n// output: 0.0156\n\ncurvePredict(curve, 1.0)\n// output: 0.0160\n\nprint curvePredict(curve, [2025.10.18, 2026.10.18])\n// output: [0.0156,0.0159]\n\nprint curvePredict(curve, [1.0, 2.0])\n// output: [0.0160,0.0158]\n```\n\n**Related function:**[parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "cut": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cut.html",
        "signatures": [
            {
                "full": "cut(X, size|cutPositions)",
                "name": "cut",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "size|cutPositions",
                        "name": "size|cutPositions"
                    }
                ]
            }
        ],
        "markdown": "### [cut](https://docs.dolphindb.com/en/Functions/c/cut.html)\n\n\n\n#### Syntax\n\ncut(X, size|cutPositions)\n\n#### Details\n\nThis function divides *X* based on the specified *size* or *cutPositions* and returns a tuple.\n\n* When *X* is a scalar, *size* can only be specified as 1.\n\n* When *X* is a vector:\n\n  * if *size* is specified, it divides *X* into a list of scalars (*size*=1) or vectors (*size*>1) of length *size*.\n\n  * if *cutPositions* is specified, it divides *X* into a list of vectors at the specified positions.\n\n* When *X* is a matrix (table):\n\n  * if *size* is specified, it divides *X* into several matrices (tables) with *size* columns (rows).\n\n  * if *cutPositions* is specified, it divides *X* into several matrices (tables) at the specified positions.\n\nRefer to function [flatten](https://docs.dolphindb.com/en/Functions/f/flatten.html) for the reverse operation.\n\n**Note:** Despite the identical name, DolphinDB's `cut` is different from Pandas' [pandas.cut](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.cut.html). DolphinDB's `cut` is used for splitting data structures and does not support parameters like *right*, *labels*, or *retbins* available in `pandas.cut`; while `pandas.cut` is used for binning and categorizing numerical data.\n\n|                                                         | DolphinDB `cut`                                | `pandas.cut`                                       |\n| ------------------------------------------------------- | ---------------------------------------------- | -------------------------------------------------- |\n| Purpose                                                 | Physically split data structures into segments | Logically categorize numerical data into intervals |\n| Parameter X / x                                         | Scalar/vector                                  | 1D array                                           |\n| Parameter *size* / *bins* (int)                         | Number of elements per segment                 | Number of intervals to create                      |\n| Parameter *cutPositions* / *bins* (sequence of scalars) | Index positions for splitting (0-based)        | Boundary values for numerical intervals            |\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n**size** is a positive integer that must be no greater than the size of *X*.\n\n**cutPositions** is a vector with increasing elements, which is used to specify the starting position of each vector in the result.\n\n#### Examples\n\n```\na=1..10;\n\ncut(a,2);\n// output: ([1,2],[3,4],[5,6],[7,8],[9,10])\n\ncut(a,3);\n// output: ([1,2,3],[4,5,6],[7,8,9],[10])\n\ncut(a,9);\n// output: ([1,2,3,4,5,6,7,8,9],[10])\n\nb = cut(a,2);\nb;\n// output: ([1,2],[3,4],[5,6],[7,8],[9,10])\n\nflatten b;\n// output: (1,2,3,4,5,6,7,8,9,10)\n\ncut(a, 0 2 7);\n// output: ([1,2],[3,4,5,6,7],[8,9,10])\n\ncut(a, 2 7);\n// output: ([3,4,5,6,7],[8,9,10])\n```\n\nThe `cut` function can be a convenient tool in time-series data analysis. In the example below, we use the cut function to calculate an aggregate measure between two events.\n\n```\nincomes=table(2016.07.31 - 10..1 as date, rand(100,10) as income);\nincomes;\n```\n\n| date       | income |\n| ---------- | ------ |\n| 2016.07.21 | 78     |\n| 2016.07.22 | 61     |\n| 2016.07.23 | 79     |\n| 2016.07.24 | 15     |\n| 2016.07.25 | 78     |\n| 2016.07.26 | 22     |\n| 2016.07.27 | 30     |\n| 2016.07.28 | 81     |\n| 2016.07.29 | 17     |\n| 2016.07.30 | 52     |\n\n```\neventdates = [2016.07.22, 2016.07.25, 2016.07.29];\n\nx = incomes.date.binsrch(eventdates);\nx;\n// output: [1,4,8]\n\nincomes.date.cut(x);\n// output: ([2016.07.22,2016.07.23,2016.07.24],[2016.07.25,2016.07.26,2016.07.27,2016.07.28],[2016.07.29,2016.07.30])\n\ntable(eventdates as startDate, each(last,incomes.date.cut(x)) as endDate, each(sum,incomes.income.cut(x)) as incomeSum);\n```\n\n| startDate  | endDate    | incomeSum |\n| ---------- | ---------- | --------- |\n| 2016.07.22 | 2016.07.24 | 155       |\n| 2016.07.25 | 2016.07.28 | 211       |\n| 2016.07.29 | 2016.07.30 | 69        |\n"
    },
    "cutPoints": {
        "url": "https://docs.dolphindb.com/en/Functions/c/cutPoints.html",
        "signatures": [
            {
                "full": "cutPoints(X, binNum, [freq])",
                "name": "cutPoints",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "binNum",
                        "name": "binNum"
                    },
                    {
                        "full": "[freq]",
                        "name": "freq",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [cutPoints](https://docs.dolphindb.com/en/Functions/c/cutPoints.html)\n\n\n\n#### Syntax\n\ncutPoints(X, binNum, \\[freq])\n\n#### Details\n\nReturn a vector with (*binNum*+1) elements such that the elements of *X* are evenly distributed within each of the *binNum* buckets indicated by the vector. Each bucket is defined by two adjacent elements of the vector. The lower bound is inclusive and the upper bound is exclusive.\n\nThe function can be used to get the partition scheme of a range domain in a distributed database.\n\n#### Parameters\n\n**X** is a vector.\n\n**binNum** is the number of buckets to be formed.\n\n**freq** (optional) is a vector with the same size as *X*. It specifies the frequency for each element in *X*. If it is specified, all the elements in *X* must be unique and sorted in ascending order.\n\n#### Returns\n\nA vector with the same data type as *X*.\n\n#### Examples\n\n```\ncutPoints(2 3 1 4, 2);\n// output: [1,3,5]\n\ncutPoints(1 2 3 4, 2, 1 1 1 3);\n// output: [1,4,5]\n```\n"
    },
    "CVaR": {
        "url": "https://docs.dolphindb.com/en/Functions/c/CVaR.html",
        "signatures": [
            {
                "full": "condValueAtRisk(returns, method, [confidenceLevel=0.95])",
                "name": "condValueAtRisk",
                "parameters": [
                    {
                        "full": "returns",
                        "name": "returns"
                    },
                    {
                        "full": "method",
                        "name": "method"
                    },
                    {
                        "full": "[confidenceLevel=0.95]",
                        "name": "confidenceLevel",
                        "optional": true,
                        "default": "0.95"
                    }
                ]
            }
        ],
        "markdown": "### [CVaR](https://docs.dolphindb.com/en/Functions/c/CVaR.html)\n\nAlias for [condValueAtRisk](https://docs.dolphindb.com/en/Functions/c/condValueAtRisk.html)\n\n\nDocumentation for the `condValueAtRisk` function:\n### [condValueAtRisk](https://docs.dolphindb.com/en/Functions/c/condValueAtRisk.html)\n\n#### Syntax\n\ncondValueAtRisk(returns, method, \\[confidenceLevel=0.95])\n\nAlias: CVaR\n\n#### Details\n\nCalculate Conditional Value at Risk (CVaR), or expected shortfall (ES) to estimate the average losses incurred beyond the VaR level.\n\n#### Parameters\n\n**returns** is a numeric vector representing the returns. The element must be greater than -1 and cannot be empty.\n\n**method** is a string indicating the CVaR calculation method, which can be:\n\n* 'normal': parametric method with normal distribution\n* 'logNormal': parametric method with log-normal distribution\n* 'historical': historical method\n* 'monteCarlo': Monte Carlo simulation\n\n**confidenceLevel** (optional) is a numeric scalar representing the confidence level, with a valid range of (0,1). The default value is 0.95.\n\n#### Returns\n\nA DOUBLE value indicating the absolute value of the average losses that exceed the VaR. The value of VaR is returned if there is no return beyond the level.\n\n#### Examples\n\nCalculate CVaR using historical method at a confidence level of 0.9 based on given returns:\n\n```\nreturns = [0.0, -0.0023816107391389394, -0.0028351258634076834, 0.00789570628538656, 0.0022056267475062397, -0.004515475812603498, 0.0031189325339843646, 0.010774648811452205, 0.0030816164453268957, 0.02172541561228001, 0.011106185767699728, -0.005369098699244845, -0.0096490689793588, 0.0025152212699484314, 0.017822140037111668, -0.02837536728283525, 0.018373545076599204, -0.0026401111537113003, 0.019524374522517898, -0.010800546314337627, 0.014073362622486131, -0.00398277532382243, 0.008398647051501285, 0.0024056749358184904, 0.007093080335863512, -0.005332549248384733, -0.008471915938733665, -0.0038788486165083342, -0.01308504169086584, 0.00350496242864784, 0.009036118926745962, 0.0013358223875250545, 0.0036426642608267563, 0.003974568474545581, -0.003944066366522669, -0.011969668605022311, 0.015116930499066374, 0.006931427295653037, -0.0032650627551519267, 0.003407880132851648]\ncondValueAtRisk(returns, 'historical', 0.9);\n//output: 0.016057655973\n```\n\n"
    },
    "ifirstHit": {
        "url": "https://docs.dolphindb.com/en/Functions/i/ifirstHit.html",
        "signatures": [
            {
                "full": "ifirstHit(func, X, target)",
                "name": "ifirstHit",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "target",
                        "name": "target"
                    }
                ]
            }
        ],
        "markdown": "### [ifirstHit](https://docs.dolphindb.com/en/Functions/i/ifirstHit.html)\n\n\n\n#### Syntax\n\nifirstHit(func, X, target)\n\n#### Details\n\nReturn the index of the first element in *X* that satisfies the condition `X func target` (e.g. X>5).\n\nIf no element in *X* satisfies the condition, return -1.\n\nNull values are ignored in `ifirstHit`.\n\n* Use [ifirstNot](https://docs.dolphindb.com/en/Functions/i/ifirstNot.html) to find the index of the first non-null value.\n\n* Use [find](https://docs.dolphindb.com/en/Functions/f/find.html) to find the index of the first null value.\n\n#### Parameters\n\n**func** can only be the following operators: `>`, `>=`, `<`, `<=`, `!=`, `<>`, `==`.\n\n**X** is a vector/matrix/table.\n\n**target** is a scalar of the same type as *X* indicating the value to be compared with *X*.\n\n#### Returns\n\n* If X is a vector, returns an integer.\n\n* If X is a matrix, returns an integeral vector.\n\n* If X is a table, returns a table.\n\n#### Examples\n\n```\nX = NULL 3.2 4.5 1.2 NULL 7.8 0.6 9.1\nifirstHit(<, X, 2.5)\n// output: 3\n\n // return -1 if no element in X satisfies the condition.\nifirstHit(>, X, 10.0)\n// output: -1\n```\n\nRelated function: [firstHit](https://docs.dolphindb.com/en/Functions/f/firstHit.html)\n"
    },
    "ifirstNot": {
        "url": "https://docs.dolphindb.com/en/Functions/i/ifirstNot.html",
        "signatures": [
            {
                "full": "ifirstNot(X)",
                "name": "ifirstNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [ifirstNot](https://docs.dolphindb.com/en/Functions/i/ifirstNot.html)\n\n\n\n#### Syntax\n\nifirstNot(X)\n\n#### Details\n\nObtains the subscript of the first non-null element.\n\n#### Parameters\n\n**X** is a vector, or a tuple of vectors of equal length, or a matrix.\n\n#### Returns\n\n* If *X* is a vector, return the subscript of the first non-null element. Return -1 if all elements are null.\n* If *X* is a tuple of vectors, return the subscript of the first position where the element in all vectors is not null.\n* If *X* is a matrix, return the subscript of the first non-null element within each column. The result is a vector.\n\n#### Examples\n\n```\nifirstNot(NULL NULL 2 4 8 NULL 1);\n// output: 2\n\nifirstNot(take(int(),5));\n// output: -1\n\nx=NULL NULL 4 7 8 NULL\ny=1 NULL NULL 4 NULL NULL\nifirstNot([x,y]);\n// output: 3\n\nx=NULL NULL 4 7 8 NULL\ny=1 2 NULL NULL NULL 6\nifirstNot([x,y]);\n// output: -1\n\nm=matrix(0 NULL 1 2 3, NULL 2 NULL 0 3);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 0  |    |\n|    | 2  |\n| 1  |    |\n| 2  | 0  |\n| 3  | 3  |\n\n```\nifirstNot(m);\n// output: [0,1]\n```\n\nRelated functions: [ilastNot](https://docs.dolphindb.com/en/Functions/i/ilastNot.html), [firstNot](https://docs.dolphindb.com/en/Functions/f/firstNot.html), [lastNot](https://docs.dolphindb.com/en/Functions/l/lastNot.html)\n"
    },
    "ifNull": {
        "url": "https://docs.dolphindb.com/en/Functions/i/ifNull.html",
        "signatures": [
            {
                "full": "ifNull(X, Y)",
                "name": "ifNull",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [ifNull](https://docs.dolphindb.com/en/Functions/i/ifNull.html)\n\n\n\n#### Syntax\n\nifNull(X, Y)\n\n#### Details\n\nDetermine whether *X* is null. If it is null, return *X*; if not, return *Y*.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\n**Y** is a scalar/pair/vector/matrix.\n\n*X* and *Y* must have the same data type.\n\n#### Returns\n\n* If *X* is null, it returns *X*.\n* If *X* not null, it returns *Y*.\n\n#### Examples\n\n```\nx = take(1..5 join NULL 6,7)\ny = 1..7\nifNull(x,y)\n// output: [1,2,3,4,5,,7]\n\ny1 = int(take(1..5 join int(),6))$2:3\nx1 = int(take(100,6))$2:3\nifNull(x1,y1)\n\n/* output:\n#0 #1 #2\n-- -- --\n1  3  5 \n2  4   \n*/\n```\n\nIf *X* is a vector and *Y* is a matrix with n rows and m columns, the length of *X* is n\\*m.\n\n```\nm=int(take(1..4 join NULL 8,6))\nifNull(m,y1)\n// output: [1,2,3,4,,]\n```\n"
    },
    "ifValid": {
        "url": "https://docs.dolphindb.com/en/Functions/i/ifValid.html",
        "signatures": [
            {
                "full": "ifValid(X, Y)",
                "name": "ifValid",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [ifValid](https://docs.dolphindb.com/en/Functions/i/ifValid.html)\n\n\n\n#### Syntax\n\nifValid(X, Y)\n\n#### Details\n\nDetermine whether *X* is valid.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\n**Y** is a scalar/pair/vector/matrix.\n\n*X* and *Y* must have the same data type.\n\n#### Returns\n\n* If *X* is null, it returns *Y*.\n* If *X* not null, it returns *X*.\n\n#### Examples\n\n```\nx = take(1..5 join NULL 6,7)\ny = 1..7\nifValid(x,y)\n// output: [1,2,3,4,5,6,6]\n```\n\n```\n\nx1 = int(take(1..5 join int(),6))$2:3\ny1 = int(take(100,6))$2:3\nifValid(x1,y1)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 3    | 5    |\n| 2    | 4    | 100  |\n\nIf *X* is a vector and *Y* is a matrix with n rows and m columns, the length of *X* is n\\*m.\n\n```\nm=int(take(1..4 join NULL 8,6))\nifValid(m,y1)\n// output: [1,2,3,4,100,8]\n```\n"
    },
    "iif": {
        "url": "https://docs.dolphindb.com/en/Functions/i/iif.html",
        "signatures": [
            {
                "full": "iif(cond, trueResult, falseResult)",
                "name": "iif",
                "parameters": [
                    {
                        "full": "cond",
                        "name": "cond"
                    },
                    {
                        "full": "trueResult",
                        "name": "trueResult"
                    },
                    {
                        "full": "falseResult",
                        "name": "falseResult"
                    }
                ]
            }
        ],
        "markdown": "### [iif](https://docs.dolphindb.com/en/Functions/i/iif.html)\n\n\n\n#### Syntax\n\niif(cond, trueResult, falseResult)\n\n#### Details\n\nPerforms an element-wise conditional operation, evaluating each element of the condition. Specifically, if cond\\[i] is true, it returns the i-th element of *trueResult*; otherwise, it returns the i-th element of *falseResult*. When cond\\[i] is a null value, it returns a null value.\n\n**Note:**\n\nThis function first parses the arguments and then returns *trueResult* or *falseResult* based on the result of *cond*.\n\n#### Parameters\n\n**cond** is a Boolean scalar/vector/matrix. It can be an expression returning Boolean values.\n\n**trueResult** and **falseResult** are scalars/vectors/tuples/matrices that have the same number of elements as *cond*. Both must have the same data type.\n\n#### Returns\n\n* When the input parameter is a scalar, the return value is a scalar.\n\n* When the input parameter is a vector, the return value is a vector with the same length as the input vector.\n\n* When the input parameter is a matrix, the return value is a matrix with the same dimensions as the input matrix.\n\n#### Examples\n\n```\niif(true true true false false false, 1..6, 6..1);\n// output: [1,2,3,3,2,1]\n\niif(1..6==3, 1, 2);\n// output: [2,2,1,2,2,2]\n\nx=9 6 8;\niif(x<=8, 10*x, 20*x-80);\n// output: [100,60,80]\n\na = 1..10\niif(isNull(a.prev()), a.cut(1), a.prev().cut(1))\n// output: (1,1,2,3,4,5,6,7,8,9)\n```\n\nUse function `iif` in a SQL statement:\n\n```\nt=table(1..5 as id, 11..15 as x);\nt1=table(take(12,5) as a, take(14,5) as b);\nt;\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 11 |\n| 2  | 12 |\n| 3  | 13 |\n| 4  | 14 |\n| 5  | 15 |\n\n```\nt1;\n```\n\n| a  | b  |\n| -- | -- |\n| 12 | 14 |\n| 12 | 14 |\n| 12 | 14 |\n| 12 | 14 |\n| 12 | 14 |\n\n```\nupdate t set x=iif(x<t1.a, t1.a, iif(x>t1.b,t1.b, x));\nt;\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 12 |\n| 2  | 12 |\n| 3  | 13 |\n| 4  | 14 |\n| 5  | 14 |\n\n```\na = NULL 1 -3 5\niif(a > 0, a, 0)\n// output: [0, 1, 0, 5]\n\niif(nullCompare(>,a,0), a, 0)\n// output: [ , 1, 0, 5]\n```\n\n```\nm1=1..6$3:2\nm2=6..1$3:2\niif(m1>m2, m1, m2);\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 6    | 4    |\n| 5    | 5    |\n| 4    | 6    |\n"
    },
    "ilastNot": {
        "url": "https://docs.dolphindb.com/en/Functions/i/ilastNot.html",
        "signatures": [
            {
                "full": "ilastNot(X)",
                "name": "ilastNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [ilastNot](https://docs.dolphindb.com/en/Functions/i/ilastNot.html)\n\n\n\n#### Syntax\n\nilastNot(X)\n\n#### Details\n\nObtains the subscript of the last non-null element.\n\nIf *X* is a vector, return the subscript of the last non-null element. Return -1 if all elements are null.\n\nIf *X* is a tuple of vectors, return the subscript of the last position where the element in all vectors is not null.\n\nIf *X* is a matrix, return the subscript of the last non-null element within each column. The result is a vector.\n\nIf *X* is a table, return the subscript of the last non-null element within each column. The result is a table.\n\n#### Parameters\n\n**X** is a vector, or a tuple of vectors of equal length, or a matrix.\n\n#### Returns\n\n* When *X* is a vector or tuple, an INT scalar is returned.\n\n* When *X* is a vector or tuple, an INT scalar is returned.\n\n* When *X* is a matrix, an INT vector is returned.\n\n* When *X* is a table, a table is returned.\n\n#### Examples\n\n```\nilastNot(NULL NULL 2 4 8 1 NULL);\n// output: 5\n\nilastNot(take(int(),5));\n// output: -1\n\nx=NULL NULL 4 7 8 NULL\ny=1 NULL NULL 4 NULL NULL\nilastNot([x,y]);\n// output: 3\n\nx=NULL NULL 4 7 8 NULL\ny=1 2 NULL NULL NULL 6\nilastNot([x,y]);\n// output: -1\n\nm=matrix(2 NULL 1 0 NULL, NULL 2 NULL 6 0);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 2  |    |\n|    | 2  |\n| 1  |    |\n| 0  | 6  |\n|    | 0  |\n\n```\nilastNot(m);\n// output: [3,4]\n```\n\nRelated functions: [ifirstNot](https://docs.dolphindb.com/en/Functions/i/ifirstNot.html), [lastNot](https://docs.dolphindb.com/en/Functions/l/lastNot.html), [firstNot](https://docs.dolphindb.com/en/Functions/f/firstNot.html)\n"
    },
    "ilike": {
        "url": "https://docs.dolphindb.com/en/Functions/i/ilike.html",
        "signatures": [
            {
                "full": "ilike(X, pattern)",
                "name": "ilike",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    }
                ]
            }
        ],
        "markdown": "### [ilike](https://docs.dolphindb.com/en/Functions/i/ilike.html)\n\n\n\n#### Syntax\n\nilike(X, pattern)\n\n#### Details\n\nCheck whether each element in *X* fits a specific pattern. The comparison is case insensitive.\n\nThe wildcard charater % indicates 0 or more characters.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n**pattern** is a string and is usually used with wildcard character %.\n\n#### Returns\n\nReturns a Boolean scalar, vector or matrix.\n\n#### Examples\n\n```\nilike(`ABCDEFG, `de);\n// output: 0\n\nilike(`ABCDEFG, \"%de%\");\n// output: 1\n\na=`IBM`ibm`MSFT`Goog`YHOO`ORCL;\na ilike  \"%OO%\";\n// output: [0,0,0,1,1,0]\n\na[a ilike  \"%OO%\"];\n// output: [\"Goog\",\"YHOO\"]\n```\n\nRelated function: [like](https://docs.dolphindb.com/en/Functions/l/like.html)\n"
    },
    "imax": {
        "url": "https://docs.dolphindb.com/en/Functions/i/imax.html",
        "signatures": [
            {
                "full": "imax(X)",
                "name": "imax",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [imax](https://docs.dolphindb.com/en/Functions/i/imax.html)\n\n\n\n#### Syntax\n\nimax(X)\n\n#### Details\n\nReturns the position of the element with the largest value in *X*. If there are multiple identical maximum values, the first maximum value starting from the left is returned.\n\nThe indexing starts from 0.\n\nIf the input is an empty vector, -1 is returned.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\n* If *X* is a scalar or vector, return an INT scalar, indicating the position of the element with the largest value.\n\n* If *X* is a matrix, return a vector containing the position of the element with the largest value in each column.\n\n* If *X* is a table, return a table. Each column of the table contains the position of the element with the largest value in the corresponding column of *X*.\n\n#### Examples\n\n```\nx = 1.2 2 NULL 6 -1 6;\nimax(x);\n// output: 3\n\nx = 5 3 1 6 4 6 $ 3:2;\nimax(x);\n// output: (0,0)\n\nx=array(int,0);\nx;\n// output: []\n\nimax(x);\n// output: -1\n// for an empty vector, imax returns -1.\n\nm=matrix(1 2 3, 6 5 4);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 6  |\n| 2  | 5  |\n| 3  | 4  |\n\n```\nimax(m);\n// output: [2,0]\n```\n"
    },
    "imaxLast": {
        "url": "https://docs.dolphindb.com/en/Functions/i/imaxlast.html",
        "signatures": [
            {
                "full": "imaxLast(X)",
                "name": "imaxLast",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [imaxLast](https://docs.dolphindb.com/en/Functions/i/imaxlast.html)\n\n\n\n#### Syntax\n\nimaxLast(X)\n\n#### Details\n\nReturns the position of the element with the largest value in *X*. If there are multiple elements with the identical largest value, return the position of the first element from the right. Same as other aggregate functions, null values are ignored.\n\nThe indexing starts from 0.\n\nIf the input is an empty vector, -1 is returned.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\n* If *X* is a scalar or vector, return an INT scalar, indicating the position of the element with the largest value.\n\n* If *X* is a matrix, return a vector containing the position of the element with the largest value in each column.\n\n* If *X* is a table, return a table. Each column of the table contains the position of the element with the largest value in the corresponding column of *X*.\n\n#### Examples\n\n```\nx = 1.2 2 NULL -1 6 -1\nimaxLast(x);\n// output: 4\n\nm=matrix(3 2 4 4 2, 1 4 2 4 3);\nimaxLast(m) \n// output: [3,3]\n\nt=table(3 3 2 as c1, 1 4 4 as c2)\nimaxLast(t)\n/* output:\nc1\tc2\n0\t2\n*/\n```\n\nRelated function: [imax](https://docs.dolphindb.com/en/Functions/i/imax.html)\n"
    },
    "imin": {
        "url": "https://docs.dolphindb.com/en/Functions/i/imin.html",
        "signatures": [
            {
                "full": "imin(X)",
                "name": "imin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [imin](https://docs.dolphindb.com/en/Functions/i/imin.html)\n\n\n\n#### Syntax\n\nimin(X)\n\n#### Details\n\nReturns the position of the minimum value in a vector or a matrix. If there are multiple identical minimum values, return the position of the first minimum value starting from the left. As with all aggregate functions, null values are not included in the calculation.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\n* If *X* is a scalar or vector, return an INT scalar, indicating the position of the element with the minimum value.\n\n* If *X* is a matrix, return a vector containing the position of the element with the minimum value in each column.\n\n* If *X* is a table, return a table. Each column of the table contains the position of the element with the minimum value in the corresponding column of *X*.\n\n#### Examples\n\n```\nx = 1.2 2 NULL -1 6 -1\nimin(x);\n// output: 3\n\nx = 5 3 1 6 4 1 $ 3:2\nimin(x);\n// output: [2,2]\n```\n\n```\nm=matrix(1 3 2 4, 4 2 3 1);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 3  | 2  |\n| 2  | 3  |\n| 4  | 1  |\n\n```\nimin(m);\n// output: [0,3]\n```\n"
    },
    "iminLast": {
        "url": "https://docs.dolphindb.com/en/Functions/i/iminlast.html",
        "signatures": [
            {
                "full": "iminLast(X)",
                "name": "iminLast",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [iminLast](https://docs.dolphindb.com/en/Functions/i/iminlast.html)\n\n\n\n#### Syntax\n\niminLast(X)\n\n#### Details\n\nReturns the position of the element with the smallest value. If there are multiple elements with the identical smallest value, return the position of the first element from the right. Same as other aggregate functions, null values are ignored.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\n* If *X* is a scalar or vector, return an INT scalar, indicating the position of the element with the smallest value.\n\n* If *X* is a matrix, return a vector containing the position of the element with the smallest value in each column.\n\n* If *X* is a table, return a table. Each column of the table contains the position of the element with the smallest value in the corresponding column of *X*.\n\n#### Examples\n\n```\nx = 1.2 2 NULL -1 6 -1\niminLast(x);\n// output: 5\n\nm=matrix(3 2 2 4 2, 1 4 2 1 3);\niminLast(m) \n// output: [4,3]\n\nt=table(3 2 2 as c1, 1 1 4 as c2)\niminLast(t)\n/* output:\nc1\tc2\n2\t1\n*/\n```\n\nRelated function: [imin](https://docs.dolphindb.com/en/Functions/i/imin.html)\n"
    },
    "imr": {
        "url": "https://docs.dolphindb.com/en/Functions/i/imr.html",
        "signatures": [
            {
                "full": "imr(ds, initValue, mapFunc, [reduceFunc], [finalFunc], terminateFunc, [carryover=false])",
                "name": "imr",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "initValue",
                        "name": "initValue"
                    },
                    {
                        "full": "mapFunc",
                        "name": "mapFunc"
                    },
                    {
                        "full": "[reduceFunc]",
                        "name": "reduceFunc",
                        "optional": true
                    },
                    {
                        "full": "[finalFunc]",
                        "name": "finalFunc",
                        "optional": true
                    },
                    {
                        "full": "terminateFunc",
                        "name": "terminateFunc"
                    },
                    {
                        "full": "[carryover=false]",
                        "name": "carryover",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [imr](https://docs.dolphindb.com/en/Functions/i/imr.html)\n\n\n\n#### Syntax\n\nimr(ds, initValue, mapFunc, \\[reduceFunc], \\[finalFunc], terminateFunc, \\[carryover=false])\n\n#### Details\n\nDolphinDB offers function `imr` for iterative computing based on the map-reduce methodology. Each iteration uses the result from the previous iteration and the input dataset. The input dataset for each iteration is unchanged so that it can be cached. Iterative computing requires initial values for the model parameters and a termination criterion.\n\n#### Parameters\n\n**ds** is the list of data sources. It must be a tuple with each element as a data source object. Even if there is only one data source, we still need a tuple to wrap the data source. In iterative computing, data sources are automatically cached and the cache will be cleared after the last iteration.\n\n**initValue** is the initial values of model parameter estimates. The format of the initial values must be the same as the output of the final function.\n\n**mapFunc** is the map function. It has 2 or 3 arguments. The first argument is the data entity represented by the corresponding data source. The second argument is the output of the final function in the previous iteration, which is an updated estimate of the model parameter. For the first iteration, it is the initial values given by the user. The last argument is the carryover object. Please check the explanation for parameter *carryover* for details.\n\n**reduceFunc** (optional) is the binary reduce function combines two map function call results. If there are *M* map calls, the reduce function will be called *M-1* times. The reduce function in most cases is trivial. An example is the addition function.\n\n**finalFunc** is the final function in each iteration. It accepts two arguments. The first argument is the output of the final function in the previous iteration. For the first iteration, it is the initial values given by the user. The second argument is the output of the reduce function call. If the reduce function is not specified, a tuple representing the collection of individual map call results would be the second argument.\n\n**terminateFunc** is either a function that determines if the computation would continue, or a specified number of iterations. The termination function accepts two parameters. The first is the output of the reduce function in the previous iteration and the second is the output of the reduce function in the current iteration. If the function returns a true value, the iterations will end.\n\n**carryover** is a Boolean value indicating whether a map function call produces a carryover object to be passed to the next iteration of the map function call. The default value is false. If it is set to true, the map function has 3 arguments and the last argument is the carryover object, and the map function output is a tuple whose last element is the carryover object. In the first iteration, the carryover object is the null object.\n\n#### Examples\n\nThe following is an example of distributed median calculation. The data are distributed on multiple nodes and we would like to calculate the median of a variable. First, for each data source, put the data into buckets and use the map function to count the number of data points in each bucket. Then use the reduce function to merge the bucket counts from multiple data sources. Locate the bucket that contains the median. In the next iteration, the chosen bucket is divided into smaller buckets. The iterations will finish when the size of the chosen bucket is no more than the specified number.\n\n```\ndef medMap(data, range, colName){\n   return bucketCount(data[colName], double(range), 1024, true)\n}\n\ndef medFinal(range, result){\n   x= result.cumsum()\n   index = x.asof(x[1025]/2.0)\n   ranges = range[1] - range[0]\n   if(index == -1)\n      return (range[0] - ranges*32):range[1]\n   else if(index == 1024)\n      return range[0]:(range[1] + ranges*32)\n   else{\n      interval = ranges / 1024.0\n      startValue = range[0] + (index - 1) * interval\n      return startValue : (startValue + interval)\n   }\n}\n\n\ndef medEx(ds, colName, range, precision){\n   termFunc = def(prev, cur): cur[1] - cur[0] <= precision\n   return imr(ds, range, medMap{,,colName}, +, medFinal, termFunc).avg()\n}\n```\n"
    },
    "in": {
        "url": "https://docs.dolphindb.com/en/Functions/i/in.html",
        "signatures": [
            {
                "full": "in(X, Y)",
                "name": "in",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [in](https://docs.dolphindb.com/en/Functions/i/in.html)\n\n\n\n#### Syntax\n\nin(X, Y)\n\n#### Details\n\nIf *Y* is a scalar:\n\n* If *Y* is of temporal types, check if each element in *X* is equal to *Y*;\n\n* If *Y* is a scalar of other data types, check if *X* and *Y* are equal.\n\nIf *Y* is a null value, return false.\n\nIf *Y* is a vector, check if each element of *X* is an element in *Y*.\n\nIf *Y* is a dictionary, check if each element of *X* is a key in the dictionary *Y*.\n\nIf *Y* is an in-memory table with one column, check if each element of *X* appears in the column of *Y*. Note the column cannot be of array vector form.\n\nIf *Y* is a keyed table or an indexed table, check if each element of *X* is a key of *Y*. The number of elements in *X* must equal the number of key columns of *Y*.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n**Y** is a scalar, vector, dictionary, in-memory table with one column, keyed table, or indexed table.\n\n#### Returns\n\nA Boolean scalar or vector.\n\n#### Examples\n\n```\nin(3 3 5 2, 2 3);\n// output: [true,true,false,true]\n\nx=dict(INT,DOUBLE);\nx[1, 2, 3]=[4.5, 6.6, 3.2];\nx;\n/* output:\n3->3.2\n1->4.5\n2->6.6\n*/\n\nin(1..6, x);\n// output: [true,true,true,false,false,false]\n\nt = table(1 3 5 7 9 as id)\n2 3 in t\n// output: [false,true]\n\nkt = keyedTable(`name`id,1000:0,`name`id`age`department,[STRING,INT,INT,STRING])\ninsert into kt values(`Tom`Sam`Cindy`Emma`Nick, 1 2 3 4 5, 30 35 32 25 30, `IT`Finance`HR`HR`IT)\nin((`Tom`Cindy, 1 3), kt);\n// output: [true,true]\n\nt1 = indexedTable(`sym`side, 10000:0, `sym`side`price`qty, [SYMBOL,CHAR,DOUBLE,INT])\ninsert into t1 values(`IBM`MSFT`GOOG, ['B','S','B'], 10.01 10.02 10.03, 10 10 20)\nin((`IBM`MSFT, ['S','S']), t1);\n// output: [false,true]\n```\n\nWhen *X* is a floating-point number and *Y* is an integer, *X* will be converted to the data type of *Y*.\n\n```\nin(10, NULL)\n// output: false\n\nin('a', 97)\n// output: true\n\nin(1, 1.1 1.2 1.3)\n// output: false\n\nin(float(1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8), 1..9)\n// output: [true,true,true,true,true,true,true,true]\n```\n\n`in` can be used with `select` for range filtering.\n\n```\nselect * from kt where name in [`Tom, `Cindy];\n```\n\n| name  | id | age | department |\n| ----- | -- | --- | ---------- |\n| Tom   | 1  | 30  | IT         |\n| Cindy | 3  | 32  | HR         |\n\nRelated functions: [find](https://docs.dolphindb.com/en/Functions/f/find.html), [binsrch](https://docs.dolphindb.com/en/Functions/b/binsrch.html).\n"
    },
    "indexedSeries": {
        "url": "https://docs.dolphindb.com/en/Functions/i/indexedSeries.html",
        "signatures": [
            {
                "full": "indexedSeries(index, value)",
                "name": "indexedSeries",
                "parameters": [
                    {
                        "full": "index",
                        "name": "index"
                    },
                    {
                        "full": "value",
                        "name": "value"
                    }
                ]
            }
        ],
        "markdown": "### [indexedSeries](https://docs.dolphindb.com/en/Functions/i/indexedSeries.html)\n\n\n\n#### Syntax\n\nindexedSeries(index, value)\n\n#### Details\n\n`indexedSeries` supports alignment operations for panel data. When performing binary operations between matrices or vectors, calculations are performed on the corresponding elements, and the shape of these matrices or vectors must be the same.\n\nBut when performing binary operations between indexed series or between indexed series and indexed matrix, the data is automatically aligned according to the row or column labels (index), and the shape of the matrices or series can be the same or not.\n\nThe following binary operations are supported:\n\n* Arithmetic operators and functions: `+`, `-`, `*`, `/`(exact division), `\\`(`ratio`), `%`(`mod`), `pow`\n\n* Logical operators and functions: `<`, `<=`, `>`, `>=`, `==`, `!=`, `<>`, `&&`, `||`, `&`, `|`, `^`\n\n* Sliding window functions: `mwavg`, `mwsum`, `mbeta`, `mcorr`, `mcovar`\n\n* Cumulative window functions: `cumwavg`, `cumwsum`, `cumbeta`, `cumcorr`, `cumcovar`\n\n* Aggregate functions: `wavg`, `wsum`, `beta`, `corr`, `covar`\n\n#### Parameters\n\n**index** and **value** are vectors of the same length. *index* must be monotonically increasing with no duplicate values.\n\n#### Returns\n\nReturns a matrix, indiating the indexed series.\n\n#### Examples\n\nExample 1. Length can be equal or unequal in operations between indexed series, The data is aligned according to the *index*.\n\n```\ns1 = indexedSeries(2012.01.01..2012.01.04, [10, 20, 30, 40])\ns2 = indexedSeries(2011.12.30..2012.01.01, [50, 60, 70])\nres = s1 + s2\n```\n\n|            | col1 |\n| ---------- | ---- |\n| 2011.12.30 |      |\n| 2011.12.31 |      |\n| 2012.01.01 | 80   |\n| 2012.01.02 |      |\n| 2012.01.03 |      |\n| 2012.01.04 |      |\n\nExample 2. In a calculation with an indexed series and a vector, the length must be equal.\n\n```\ns1 = indexedSeries(2012.01.01..2012.01.04, [10, 20, 30, 40])\nv = [1,2,3,4]\nres = s1+v\n```\n\n|            | col1 |\n| ---------- | ---- |\n| 2012.01.01 | 11   |\n| 2012.01.02 | 22   |\n| 2012.01.03 | 33   |\n| 2012.01.04 | 44   |\n\nExample 3. In a calculation with an indexed series and an indexed matrix, the inputs are aligned based on the *index*.\n\n```\ns1 = indexedSeries(2012.01.01 2012.01.03 2012.01.04 2012.01.06, [10, 20, 30, 40])\nm = matrix(1..6, 11..16).rename!(2012.01.01..2012.01.06,`x`y).setIndexedMatrix!()\ns1 + m\n```\n\n|            | IBM | MSFT |\n| ---------- | --- | ---- |\n| 2012.01.01 | 11  | 21   |\n| 2012.01.02 |     |      |\n| 2012.01.03 | 23  | 33   |\n| 2012.01.04 | 34  | 44   |\n| 2012.01.05 |     |      |\n| 2012.01.06 | 46  | 56   |\n\nExample 4. In a calculation with an indexed series and a matrix without *index*, they must be of the same length.\n\n```\ns1 = indexedSeries(2012.01.01..2012.01.04, [10, 20, 30, 40])\nm = matrix([1,1,1,1], [2,2,2,2])\nres = s1 pow m\n```\n\n| col1 | col2  |\n| ---- | ----- |\n| 10   | 100   |\n| 20   | 400   |\n| 30   | 900   |\n| 40   | 1,600 |\n"
    },
    "indexedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/i/indexedTable.html",
        "signatures": [
            {
                "full": "indexedTable(keyColumns, X, [X1], [X2], .....)",
                "name": "indexedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "indexedTable(keyColumns, capacity:size, colNames, colTypes)",
                "name": "indexedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            },
            {
                "full": "indexedTable(keyColumns, table)",
                "name": "indexedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [indexedTable](https://docs.dolphindb.com/en/Functions/i/indexedTable.html)\n\n\n\n#### Syntax\n\nindexedTable(keyColumns, X, \\[X1], \\[X2], .....)\n\nor\n\nindexedTable(keyColumns, capacity:size, colNames, colTypes)\n\nor\n\nindexedTable(keyColumns, table)\n\n#### Details\n\nCreate an indexed table, which is a special type of in-memory table with primary key. The primary key can be one column or multiple columns. The indexed table uses a red-black tree to store the primary key index. During queries, as long as the query conditions include the first column of the primary key, data can be located through the index without performing a full table scan. It is recommended to use [sliceByKey](https://docs.dolphindb.com/en/Functions/s/sliceByKey.html) to improve query performance.\n\nWhen adding new records to the table, if the primary key of the new record duplicates an existing record, the system updates the record in the table; otherwise, the new record is added to the table.\n\nThe following compares the query optimization techniques for indexed and keyed tables.\n\nFor indexed tables:\n\n* The first column of *keyColumns* must be queried, and filter conditions for this column can only use `=`, `in`, or `and`.\n* Columns other than the first column of *keyColumns* can use range queries through `between`, comparison operators, etc., with higher query efficiency than using the `in` predicate.\n* The number of distinct columns filtered with `in` should not exceed 2.\n\nFor keyed tables:\n\n* All *keyColumns* must be queried. For such queries, key tables show better performance than indexed tables.\n* Filter conditions can only use `=`, `in`, or `and`.\n* The number of distinct columns filtered with `in` should not exceed 2.\n\nQuery Optimization:\n\n1. If the filtering conditions in a SQL statement satisfy the following conditions at the same time, query performance on an indexed table is optimized and is better than that on an ordinary in-memory table:\n\n   * The query contains the first key column in *keyColumns*, the filtering condition for the first key column uses only `=` or `in` operator, and it is not followed by an `or` clause;\n   * There are at most 2 `in` operators\n2. When querying an indexed table, it is recommended to use [sliceByKey](https://docs.dolphindb.com/en/Functions/s/sliceByKey.html) to improve performance.\n3. For comparison, please refer to the optimized SQL query in [keyed table](https://docs.dolphindb.com/en/Functions/k/keyedTable.html).\n\n#### Parameters\n\n**keyColumns** is a string scalar or vector indicating the name(s) of the primary key column(s). The column type must be INTEGRAL, TEMPORAL or LITERAL.\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n  * false for Boolean type;\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n  * Null value for Literal, INT128 types.\n\n* **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a string vector of data types. The non-key columns can be specified as an array vector type or ANY type.\n\nFor the third scenario, **table** is a table (except for stream table). Please note that *keyColumns* cannot have duplicate values.\n\n#### Returns\n\nReturns an indexed table.\n\n#### Examples\n\nExample 1. Create an indexed table.\n\nThe first scenario:\n\n```\nsym=`A`B`C`D`E\nid=5 4 3 2 1\nval=52 64 25 48 71\nt=indexedTable(`sym`id,sym,id,val)\nt;\n```\n\n| sym | id | val |\n| --- | -- | --- |\n| A   | 5  | 52  |\n| B   | 4  | 64  |\n| C   | 3  | 25  |\n| D   | 2  | 48  |\n| E   | 1  | 71  |\n\nThe second scenario:\n\n```\nt=indexedTable(`sym`id,1:0,`sym`id`val,[SYMBOL,INT,INT])\ninsert into t values(`A`B`C`D`E,5 4 3 2 1,52 64 25 48 71);\n```\n\nThe third scenario:\n\n```\ntmp=table(sym, id, val)\nt=indexedTable(`sym`id, tmp);\n```\n\nCreate an indexed in-memory partitioned table:\n\n```\nt=indexedTable(`sym`id,sym,id,val)\ndb=database(\"\",VALUE, sym)\npt=db.createPartitionedTable(t,`pt,`sym).append!(t);\n```\n\nExample 2. Update an indexed table.\n\n```\nt=indexedTable(`sym,1:0,`sym`datetime`price`qty,[SYMBOL,DATETIME,DOUBLE,DOUBLE])\ninsert into t values(`APPL`IBM`GOOG,2018.06.08T12:30:00 2018.06.08T12:30:00 2018.06.08T12:30:00,50.3 45.6 58.0,5200 4800 7800)\nt;\n```\n\n| sym  | datetime            | price | qty  |\n| ---- | ------------------- | ----- | ---- |\n| APPL | 2018.06.08T12:30:00 | 50.3  | 5200 |\n| IBM  | 2018.06.08T12:30:00 | 45.6  | 4800 |\n| GOOG | 2018.06.08T12:30:00 | 58    | 7800 |\n\nInsert a new row with duplicate primary key value as an existing row. The existing row will be overwritten:\n\n```\ninsert into t values(`APPL`IBM`GOOG,2018.06.08T12:30:01 2018.06.08T12:30:01 2018.06.08T12:30:01,65.8 45.2 78.6,5800 8700 4600)\nt;\n```\n\n| sym  | datetime            | price | qty  |\n| ---- | ------------------- | ----- | ---- |\n| APPL | 2018.06.08T12:30:01 | 65.8  | 5800 |\n| IBM  | 2018.06.08T12:30:01 | 45.2  | 8700 |\n| GOOG | 2018.06.08T12:30:01 | 78.6  | 4600 |\n\nThe primary key cannot be updated:\n\n```\nupdate t set sym=\"C_\"+sym;\n// Error: Can't update a key column.\n```\n\nExample 3. Query on an indexed table.\n\nIn some cases, queries on an indexed table are optimized. In this section we will compare the performance of queries on indexed tables vs ordinary in-memory tables.\n\nFor the following examples, we first create an ordinary in-memory table *t* and an indexed table *t1* with 1 million records each:\n\n```\nid=shuffle(1..1000000)\ndate=take(2012.06.01..2012.06.10, 1000000)\ntype=take(0..9, 1000000)\nval=rand(100.0, 1000000)\nt=table(id, date, type, val)\nt1=indexedTable(`id`date`type, id, date, type, val);\n```\n\nUse the first key column in the filtering condition:\n\n```\ntimer(100) select * from t where id=500000;\n// Time elapsed: 177.286 ms\n\ntimer(100) select * from t1 where id=500000;\n// Time elapsed: 1.245 ms\n\ntimer(100) sliceByKey(t1, 500000)\n// Time elapsed: 0.742 ms\n\ntimer(100) select * from t where id in [500000, 600000, 700000];\n// Time elapsed: 1134.429 ms\n\ntimer(100) select * from t1 where id in [500000, 600000, 700000];\n// Time elapsed: 1.377 ms\n```\n\nIf the filtering condition for the first key column does not use `=` or the `in` operator, then the performance of a query on an indexed table is not optimized:\n\n```\ntimer(100) select * from t where id between 500000:500010;\n// Time elapsed: 641.544 ms\n\ntimer(100) select * from t1 where id between 500000:500010;\n// Time elapsed: 599.752 ms\n```\n\nUse the first key column and the third key column in the filtering conditions:\n\n```\ntimer(100) select * from t where id=500000, type in [3,6];\n// Time elapsed: 172.808 ms\n\ntimer(100) select * from t1 where id=500000, type in [3,6];\n// Time elapsed: 1.664 ms\n```\n\nIf the filtering conditions do not use the first key column, then the performance of a query on an indexed table is not optimized:\n\n```\ntimer(100) select * from t where date in [2012.06.03, 2012.06.06];\n// Time elapsed: 490.182 ms\n\ntimer(100) select * from t1 where date in [2012.06.03, 2012.06.06];\n// Time elapsed: 544.015 ms\n\ntimer(100) select * from t where date=2012.06.03, type=8;\n// Time elapsed: 205.443 ms\n\ntimer(100) select * from t1 where date=2012.06.03, type=8;\n// Time elapsed: 204.532 ms\n```\n\nWith more than 2 `in` operators in the filtering conditions, the performance of a query on an indexed table is not optimized:\n\n```\ntimer(100) select * from t where id in [100,200], date in [2012.06.03, 2012.06.06], type in [3,6];\n// Time elapsed: 208.714 ms\n\ntimer(100) select * from t1 where id in [100,200], date in [2012.06.03, 2012.06.06], type in [3,6];\n// Time elapsed: 198.674 ms\n```\n\nExample 4. Use an indexed table with array vectors to record the 5 levels of quotes data.\n\n```\nsym=[\"a\",\"b\",\"c \"] \ntime=22:58:52.827 22:58:53.627 22:58:53.827 \nvolume=array(INT[]).append!([[100,110,120,115,125],[200,230,220,225,230],[320,300,310,315,310]])\nprice=array(DOUBLE[]).append!([[10.5,10.6,10.7,10.77,10.85],[8.6,8.7,8.76,8.83,8.9],[6.3,6.37,6.42,6.48,6.52]])\nt=indexedTable(`sym,sym,time,volume,price)\nt;\n```\n\n| sym | time         | volume                     | price                             |\n| --- | ------------ | -------------------------- | --------------------------------- |\n| a   | 22:58:52.827 | \\[100, 110, 120, 115, 125] | \\[10.5, 10.6, 10.7, 10.77, 10.85] |\n| b   | 22:58:53.627 | \\[200, 230, 220, 225, 230] | \\[8.6, 8.7, 8.76, 8.83, 8.9]      |\n| c   | 22:58:53.827 | \\[320, 300, 310, 315, 310] | \\[6.3, 6.37, 6.42, 6.48, 6.52]    |\n\n```\n// latest quote volume and price\nnewVolume=array(INT[]).append!([[130,110,110,115,120]])\nnewPrice= array(DOUBLE[]).append!([[10.55,10.57,10.62,10.68,10.5]])\n// update for stock a\nupdate t set volume=newVolume, price=newPrice where sym=\"a\"\nt;\n```\n\n| sym | time         | volume                     | price                               |\n| --- | ------------ | -------------------------- | ----------------------------------- |\n| a   | 22:58:52.827 | \\[130, 110, 110, 115, 120] | \\[10.55, 10.57, 10.62, 10.68, 10.5] |\n| b   | 22:58:53.627 | \\[200, 230, 220, 225, 230] | \\[8.6, 8.7, 8.76, 8.83, 8.9]        |\n| c   | 22:58:53.827 | \\[320, 300, 310, 315, 310] | \\[6.3, 6.37, 6.42, 6.48, 6.52]      |\n\nNote that when updating the array vector column, the number of elements in each column must be consistent with the original column. For example, if the vector of new record contains 4 elements, while the original contains 5 elements, an error is raised:\n\n```\nnewVolume=array(INT[]).append!([[130,110,110,120]])\nnewPrice= array(DOUBLE[]).append!([[10.55,10.57,10.62,10.5]])\n\nupdate t set volume=newVolume, price=newPrice where sym=\"a\"\n// error: Failed to update column: volume\n```\n\nRelated function: [keyedTable](https://docs.dolphindb.com/en/Functions/k/keyedTable.html)\n"
    },
    "initcap": {
        "url": "https://docs.dolphindb.com/en/Functions/i/initcap.html",
        "signatures": [
            {
                "full": "initcap(X)",
                "name": "initcap",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [initcap](https://docs.dolphindb.com/en/Functions/i/initcap.html)\n\n\n\n#### Syntax\n\ninitcap(X)\n\n#### Details\n\nThe function returns an object of the same type/form as *X*.\n\nFor words separated by delimiters, the first letter of each word is in uppercase, and all other letters are in lowercase. The delimiters can be any character other than letters or numbers, such as spaces, @, etc.\n\n**Note:**\n\nNumbers are treated as letters.\n\n#### Parameters\n\n**X** is a STRING scalar/vector, or a SYMBOL vector.\n\n#### Returns\n\nReturns a value of the same type as X.\n\n#### Examples\n\n```\ninitcap(\"hello world\")\n//output\nHello World\n\ninitcap(\"1aBBBBBB\")\n//output\n1abbbbbb\n\ninitcap(\"nihao, hello@you\")\n//output\nNihao, Hello@You\n\ninitcap(\"你好hello\" \"hello You\")\n//output\n[\"你好Hello\",\"Hello You\"]\ninitcap(symbol([\"adhE\",\"\",\"1yI\"]))\n//output\n[\"Adhe\",,\"1yi\"]\n```\n"
    },
    "initIMOLTPCheckpointEncryption": {
        "url": "https://docs.dolphindb.com/en/Functions/i/initIMOLTPCheckpointEncryption.html",
        "signatures": [
            {
                "full": "initIMOLTPCheckpointEncryption(mode)",
                "name": "initIMOLTPCheckpointEncryption",
                "parameters": [
                    {
                        "full": "mode",
                        "name": "mode"
                    }
                ]
            }
        ],
        "markdown": "### [initIMOLTPCheckpointEncryption](https://docs.dolphindb.com/en/Functions/i/initIMOLTPCheckpointEncryption.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ninitIMOLTPCheckpointEncryption(mode)\n\n#### Details\n\n\\[Linux Only] This function initializes the transparent data encryption for IMOLTP tables. It applies global encryption to all tables within the checkpoint.\n\n\\*\\*Note:\\*\\*Once initialized, the encryption mode for the tables cannot be changed or disabled. Please proceed with caution.\n\n#### Parameters\n\n**mode** is a STRING scalar specifying the encryption mode for IMOLTP tables. The default is no encryption (plaintext mode). Supported values (case-insensitive) include: plaintext, aes\\_128\\_ctr, aes\\_128\\_cbc, aes\\_128\\_ecb, aes\\_192\\_ctr, aes\\_192\\_cbc, aes\\_192\\_ecb, aes\\_256\\_ctr, aes\\_256\\_cbc, aes\\_256\\_ecb, sm4\\_128\\_cbc, sm4\\_128\\_ecb.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ninitIMOLTPCheckpointEncryption(`aes_128_ctr)\n```\n"
    },
    "installModule": {
        "url": "https://docs.dolphindb.com/en/Functions/i/installmodule.html",
        "signatures": [
            {
                "full": "installModule(moduleName, [serverAddr])",
                "name": "installModule",
                "parameters": [
                    {
                        "full": "moduleName",
                        "name": "moduleName"
                    },
                    {
                        "full": "[serverAddr]",
                        "name": "serverAddr",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [installModule](https://docs.dolphindb.com/en/Functions/i/installmodule.html)\n\nFirst introduced in version: 2.00.18, 2.00.16.53.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\ninstallModule(moduleName, \\[serverAddr])\n\n#### Details\n\nDownloads and extracts the specified module into the node’s module directory. Available modules can be queried using [listRemoteModules](https://docs.dolphindb.com/en/Functions/l/listremotemodules.html).\n\n#### Parameters\n\n**moduleName**: A STRING scalar specifying the module name.\n\n**serverAddr** (optional): A STRING scalar specifying the HTTP address of the module repository, which defaults to \"<http://dolphindb.cn>\".\n\n#### Returns\n\nNone.\n\n#### Examples\n\nDownload the module named ops from the marketplace:\n\n```\ninstallModule(\"ops\")\n```\n\n**Related functions**\n\n[listRemoteModules](https://docs.dolphindb.com/en/Functions/l/listremotemodules.html)\n\n[loadModule](https://docs.dolphindb.com/en/Functions/l/loadModule.html)\n"
    },
    "installPlugin": {
        "url": "https://docs.dolphindb.com/en/Functions/i/installPlugin.html",
        "signatures": [
            {
                "full": "installPlugin(pluginName, [pluginVersion], [pluginServerAddr])",
                "name": "installPlugin",
                "parameters": [
                    {
                        "full": "pluginName",
                        "name": "pluginName"
                    },
                    {
                        "full": "[pluginVersion]",
                        "name": "pluginVersion",
                        "optional": true
                    },
                    {
                        "full": "[pluginServerAddr]",
                        "name": "pluginServerAddr",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [installPlugin](https://docs.dolphindb.com/en/Functions/i/installPlugin.html)\n\n\n\n#### Syntax\n\ninstallPlugin(pluginName, \\[pluginVersion], \\[pluginServerAddr])\n\n#### Details\n\nDownload and extract the shared library and the description file (.txt) of the specified plugin into your DolphinDB plugins directory. It returns the full path of the installed plugin description file, which is required when loading the plugin.\n\n#### Parameters\n\n**pluginName** is a string indicating the plugin name.\n\n**pluginVersion** (optional) is a string indicating the plugin version to install. If it is not specified, the latest version will be installed.\n\n**pluginServerAddr** is a string indicating the HTTP address of the DolphinDB plugins repository that the system should use. It is recommended to specify it as \"<http://plugins.dolphindb.com/plugins>\".\n\n#### Returns\n\nIt returns a STRING scalar indicating the full path of the installed plugin description file.\n\n#### Examples\n\nDownload the mysql plugin on Linux:\n\n```\nloadPlugin(\"/home/DolphinDB_Linux64_V2.00.10/server/plugins/mysql/PluginMySQL.txt\")\n// Or\nloadPlugin(\"mysql\")\n\n// output: /home/DolphinDB_Linux64/server/plugins/mysql/PluginMySQL.txt\n```\n\nLoad the plugin via `loadPlugin`:\n\n```\nloadPlugin(\"/home/DolphinDB_Linux64/server/plugins/mysql/PluginMySQL.txt\")\n// Or you can use plugin name to load the plugin.\nloadPlugin(\"mysql\")\n```\n\nRelated functions: [listRemoteLists](https://docs.dolphindb.com/en/Functions/l/listRemotePlugins.html), [loadPlugin](https://docs.dolphindb.com/en/Functions/l/loadPlugin.html)\n"
    },
    "instrumentPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/i/instrumentPricer.html",
        "signatures": [
            {
                "full": "instrumentPricer(instrument, pricingDate, marketData)",
                "name": "instrumentPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "marketData",
                        "name": "marketData"
                    }
                ]
            }
        ],
        "markdown": "### [instrumentPricer](https://docs.dolphindb.com/en/Functions/i/instrumentPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ninstrumentPricer(instrument, pricingDate, marketData)\n\n#### Details\n\nPrices financial contract(s) (which can be of the same or different types).\n\nIn DolphinDB, each financial contract can be defined as an INSTRUMENT type, and each market data (Price/Curve/Surface) required for pricing can be defined as a MKTDATA type. The system automatically matches contracts with the corresponding market data based on the matching rules for batch pricing.\n\n**Note:** DolphinDB also provides basic pricing functions, such as `bondPricer` and `irDepositPricer`. `instrumentPricer` differs from these functions in the following ways:\n\n* Basic pricing functions are designed for a single asset type, and each function can price only a specific type of financial instrument. You must manually specify the market data required by each pricing function (such as discount curves, forward curves, spot exchange rates, and volatility surfaces), and the required market data varies across functions. When pricing multiple asset types, you need to call different functions separately and implement if-else logic for dispatching.\n* In contrast, `instrumentPricer` provides a unified pricing interface that supports all asset types currently supported by DolphinDB. The system automatically matches the required market data based on instrument information. Instruments of different types can be placed in the same vector and priced in batches, allowing all pricing tasks to be completed in a single call without type-specific handling.\n\n#### Parameters\n\n**instrument**is an INSTRUMENT object indicating the instrument(s) to be priced. It can be a single contract or multiple contracts.\n\n**pricingDate** is a DATE scalar specifying the pricing date.\n\n**marketData**A MKTDATA vector, a nested dictionary, the handle of a market data engine or a user-defined function, indicating the market data.\n\n* For a MKTDATA vector:\n\n  * Specify curveName for the curve market data.\n\n  * Specify surfaceName for the surface market data.\n\n* For a nested dictionary:\n\n  * First level: The key is the market data types. It can be \"Price\", \"Curve\", or \"Surface\".\n\n  * Second level: The key is the pricing date and the value is a DATE scalar.\n\n  * Third level: The key is the curve or surface name and the value is the corresponding MKTDATA scalar.\n\n* For a user-defined function: parameters should be (kind, date, name).\n\n#### Returns\n\nA DOUBLE scalar/vector indicating the pricing result(s).\n\n#### Matching Rules of Instrument and MarketData\n\nCurrently, only instrument types illustrated as leaf nodes in the classification tree below are supported:\n\n![](https://docs.dolphindb.com/en/Functions/images/instrumentPricer.png)\n\nThe system determines the market data according to the following priority when pricing:\n\n1. If the *instrument* explicitly specifies the market data, use the specified market data;\n\n2. If not, the system automatically matches suitable market data based on predefined rules.\n\nThe matching rules for different financial instruments are described in detail below.\n\n##### Bond (Bond)\n\nBond pricing requires a discount curve. Specify the discount curve name via the \"discountCurve\" field, for example:\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"1382011.IB\",\n    \"start\": \"2013.01.14\",\n    \"maturity\": \"2028.01.14\",\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.058,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n    \"currency\": \"CNY\",              //optional\n    \"subType\": \"MTN\",               //optional\n    \"creditRating\": \"AAA\",          //optional\n    \"discountCurve\": \"CNY_MTN_AAA\"  //optional\n}\n```\n\nRules for selecting the discount curve:\n\n* If \"discountCurve\" is specified, the function looks up the corresponding curve directly in the *marketData* parameter.\n\n* If \"discountCurve\" is not specified but \"currency\", \"subType\", and \"creditRating\" are specified, the system automatically generates a discount curve name of the form `currency + \"_\" + subType + \"_\" + creditRating`, where \"currency\" defaults to \"CNY\".\n\n* If none of the optional fields are provided, the discount curve defaults to \"CNY\\_TREASURY\\_BOND\".\n\n##### Treasury Futures (BondFutures)\n\nThe deliverable basket of treasury futures are treasury bonds, the rules for selecting the discount curve when defining the *instrument* are:\n\n* If the \"discountCurve\" field is specified, use the specified curve for pricing.\n\n* If not, use the default discount curve \"CNY\\_TREASURY\\_BOND\".\n\n##### Deposit (Deposit)\n\nFor deposit pricing, specify only the discount curve \"discountCurve\":\n\n* If the \"discountCurve\" field is specified, use the specified curve for pricing.\n\n* If not, the system automatically matches the discount curve based on the currency.\n\n| currency | discountCurve |\n| -------- | ------------- |\n| CNY      | CNY\\_FR\\_007  |\n| USD      | USD\\_SOFR     |\n| EUR      | EUR\\_EONIA    |\n\n##### IR Fixed-Floating Swap (IrFixedFloatingSwap)\n\nPricing an IR Fixed-Floating Swap requires three curves: discountCurve, forwardCurve, and assetPriceCurve. The current version only supports swaps that use FR\\_007 or SHIBOR\\_3M as the floating reference rate.\n\n* If the curve is specified in the *instrument* parameter, use the specified curve for pricing.\n\n* If not, the system automatically selects default curves based on the currency and the floating reference rate.\n\n| currency | iborIndex  | discountCurve | forwardCurve    | assetPriceCurve   |\n| -------- | ---------- | ------------- | --------------- | ----------------- |\n| CNY      | FR\\_007    | CNY\\_FR\\_007  | CNY\\_FR\\_007    | PRICE\\_FR\\_007    |\n| CNY      | SHIBOR\\_3M | CNY\\_FR\\_007  | CNY\\_SHIBOR\\_3M | PRICE\\_SHIBOR\\_3M |\n\nThe assetPriceCurve is the historical data of the floating reference rate, which is used to calculate the floating rate for the first cash flow of the pricing date.\n\n##### Foreign Exchange Forward (FxForward) / Foreign Exchange Swap (FxSwap)\n\nPricing these two linear products requires binding \"domesticCurve\" and \"foreignCurve\", and retrieving the corresponding \"FxSpot\" based on the \"currencyPair\".\n\n* If the user specifies \"domesticCurve\" and \"foreignCurve\", use the specified curves.\n\n* If not, the system automatically selects default curves according to the \"currencyPair\".\n\n| currencyPair | domesticCurve | foreignCurve    |\n| ------------ | ------------- | --------------- |\n| USDCNY       | CNY\\_FR\\_007  | USD\\_USDCNY\\_FX |\n| EURCNY       | CNY\\_FR\\_007  | EUR\\_EURCNY\\_FX |\n| EURUSD       | USD\\_SOFR     | EUR\\_EURUSD\\_FX |\n\nThe \"foreignCurve\" is the implied foreign discount curve inferred using the covered interest rate parity formula based on foreign exchange swap.\n\n##### Fx European Style Option (FxEuropeanOption)\n\nIn addition to \"domesticCurve\" and \"foreignCurve\", Fx European Style Option pricing also requires \"FxSpot\" and the \"FxVolatilitySurface\". Both of these market data can be automatically matched based on the \"underlying\" (the currency pair).\n\n* If the *instrument* explicitly specifies \"domesticCurve\", \"foreignCurve\", use them directly.\n\n* If not, the system automatically matches based on \"underlying\" (the currency pair).\n\n| currencyPair | fxSpot | domesticCurve | foreignCurve    | volSurf |\n| ------------ | ------ | ------------- | --------------- | ------- |\n| USDCNY       | USDCNY | CNY\\_FR\\_007  | USD\\_USDCNY\\_FX | USDCNY  |\n| EURCNY       | EURCNY | CNY\\_FR\\_007  | EUR\\_EURCNY\\_FX | EURCNY  |\n| EURUSD       | EURUSD | USD\\_SOFR     | EUR\\_EURUSD\\_FX | EURUSD  |\n\n#### Examples\n\nCreate FX forward.\n\n```\nfxFwd1 = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.10.08,\n    \"delivery\": 2025.10.10,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 7.2\n}\nfxFwdUsdCny = parseInstrument(fxFwd1)\nfxFwd2 = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.10.08,\n    \"delivery\": 2025.10.10,\n    \"currencyPair\": \"EURCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 8.2\n}\nfxFwdEurCny = parseInstrument(fxFwd2)\n```\n\nCreate FX swap.\n\n```\nfxSwap1 = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 7.2,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 7.3,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\nfxSwapUsdCny = parseInstrument(fxSwap1)\nfxSwap2 = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 8.2,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 8.3,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\nfxSwapEurCny = parseInstrument(fxSwap2)\n```\n\nCreate FX European option.\n\n```\nfxOption1 = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 7.0,\n    \"maturity\": 2025.12.08,\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"USDCNY\"\n}\nfxOptionUsdCny = parseInstrument(fxOption1)\nfxOption2 = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 8.0,\n    \"maturity\": 2025.12.08,\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"EURCNY\"\n}\nfxOptionEurCny= parseInstrument(fxOption2)\n```\n\nCreate a bond.\n\n```\nbond1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"220010.IB\",\n    \"start\": 2020.12.25,\n    \"maturity\": 2031.12.25,\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.0149,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"discountCurve\": \"CNY_TREASURY_BOND\"\n}\nbond = parseInstrument(bond1)\n```\n\nCreate a bond futures contract.\n\n```\nbondFut1 = {\n    \"productType\": \"Futures\",\n    \"futuresType\": \"BondFutures\",\n    \"instrumentId\": \"T2509\",\n    \"nominal\": 100.0,\n    \"maturity\": \"2025.09.12\",\n    \"settlement\": \"2025.09.16\",\n    \"underlying\": bond1,\n    \"nominalCouponRate\": 0.03\n}\nbondFut = parseInstrument(bondFut1)\n```\n\nCreate a deposit.\n\n```\ndeposit1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"start\": 2025.06.15,\n    \"maturity\": 2025.12.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E6,\n    \"payReceive\": \"Receive\"\n}\ndeposit = parseInstrument(deposit1)\n```\n\nCreate an IrFixedFloatingSwap\n\n```\nirs1 =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2025.06.16,\n    \"maturity\": 2028.06.16,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.018,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual365\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"FR_007\",\n    \"spread\": 0.0001,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\nirs = parseInstrument(irs1)\n```\n\nCreate market data.\n\n```\naod = 2025.08.18\nfxSpot1 = {\n    \"mktDataType\": \"Price\",\n    \"priceType\": \"FxSpotRate\",\n    \"spotDate\": aod+2 ,\n    \"referenceDate\": aod ,\n    \"value\": 7.1627,\n    \"unit\": \"USDCNY\"\n}\nfxSpotUsdCny = parseMktData(fxSpot1)\nfxSpot2 = {\n    \"mktDataType\": \"Price\",\n    \"priceType\": \"FxSpotRate\",\n    \"spotDate\": aod+2 ,\n    \"referenceDate\": aod ,\n    \"value\": 8.3768,\n    \"unit\": \"EURCNY\"\n}\nfxSpotEurCny = parseMktData(fxSpot2)\ncurve1 = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_FR_007\",\n    \"referenceDate\": aod,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24,2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20, 2028.08.21],\n    \"values\":[1.4759, 1.5331, 1.5697, 1.5239, 1.4996, 1.5144, 1.5209, \n              1.5539, 1.5461, 1.5316, 1.5376, 1.5435, 1.5699] / 100.0\n}\ncurveCnyFr007 = parseMktData(curve1)\ncurve2 = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"USD_USDCNY_FX\",\n    \"referenceDate\": aod ,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24,2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20, 2028.08.21],\n    \"values\":[4.3345, 4.3801, 4.3119, 4.3065, 4.2922, 4.2196, 4.1599, \n              4.0443, 4.0244, 3.9698, 3.7740, 3.6289, 3.5003] / 100.0\n}\ncurveUsdUsdCnyFx = parseMktData(curve2)\ncurve3 = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"EUR_EURCNY_FX\",\n    \"referenceDate\": aod,\n    \"currency\": \"EUR\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24,2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20, 2028.08.21],\n    \"values\":[1.9165, 1.9672, 1.8576, 1.8709, 1.8867, 1.8749,1.8700,\n              1.8576, 1.9253, 1.9738, 1.9908, 1.9850, 2.0362] / 100.0\n}\ncurveEurEurCnyFx = parseMktData(curve3)\nsurf1 = {\n\t\"surfaceName\": \"USDCNY\",\n\t\"mktDataType\": \"Surface\",\n\t\"surfaceType\": \"FxVolatilitySurface\",\n\t\"referenceDate\": \"2025.08.18\",\n\t\"smileMethod\": \"Linear\",\n\t\"termDates\": [\n\t\t\"2025.08.21\",\n\t\t\"2026.08.20\"\n\t],\n\t\"volSmiles\":[{\"strikes\": [6.5,7,7.5],\"vols\": [0.1,0.1,0.1]},{\"strikes\": [6.5,7,7.5],\"vols\": [0.1,0.1,0.1]}],\n\t\"currencyPair\": \"USDCNY\"\n}\nsurfUsdCny = parseMktData(surf1)\nsurf2 = {\n\t\"surfaceName\": \"EURCNY\",\n\t\"mktDataType\": \"Surface\",\n\t\"surfaceType\": \"FxVolatilitySurface\",\n\t\"referenceDate\": \"2025.08.18\",\n\t\"smileMethod\": \"Linear\",\n\t\"termDates\": [\n\t\t\"2025.08.21\",\n\t\t\"2026.08.20\"\n\t],\n\t\"volSmiles\":[{\"strikes\": [7.5,8.0,8.5],\"vols\": [0.1,0.1,0.1]},{\"strikes\": [7.5,8.0,8.5],\"vols\": [0.1,0.1,0.1]}],\n\t\"currencyPair\": \"EURCNY\"\n}\nsurfEurCny = parseMktData(surf2)\nbondCurve =  {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": aod,\n    \"currency\": \"CNY\",\n    \"curveName\": \"CNY_TREASURY_BOND\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Compounded\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    // 0.083 0.25 0.5 1.0 2.0 3.0 5.0 7.0 10.0 15.0 20.0 30.0 40.0 50.0\n    \"dates\":[2025.09.18, 2025.11.18, 2026.02.18, 2026.08.18, 2027.08.18, 2028.08.18, 2030.08.18,\n             2032.08.18, 2035.08.18, 2040.08.18, 2045.08.18, 2055.08.18,2065.08.18, 2075.08.18],\n    \"values\":[1.3000, 1.3700, 1.3898, 1.3865, 1.4299, 1.4471, 1.6401,\n              1.7654, 1.7966, 1.9930, 2.1834, 2.1397, 2.1987, 2.2225] / 100.0\n}\ncurveCnyTreasuryBond = parseMktData(bondCurve)\nfr007HistCurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"AssetPriceCurve\",\n    \"curveName\": \"PRICE_FR_007\",\n    \"referenceDate\": aod,\n    \"currency\": \"CNY\",\n    \"dates\":[2025.05.09, 2025.05.12, 2025.05.13, 2025.05.14, 2025.05.15, 2025.05.16, 2025.05.19, 2025.05.20, 2025.05.21, 2025.05.22,\n             2025.05.23, 2025.05.26, 2025.05.27, 2025.05.28, 2025.05.29, 2025.05.30, 2025.06.03, 2025.06.04, 2025.06.05, 2025.06.06,\n             2025.06.09, 2025.06.10, 2025.06.11, 2025.06.12, 2025.06.13, 2025.06.16, 2025.06.17, 2025.06.18, 2025.06.19, 2025.06.20,\n             2025.06.23, 2025.06.24, 2025.06.25, 2025.06.26, 2025.06.27, 2025.06.30, 2025.07.01, 2025.07.02, 2025.07.03, 2025.07.04,\n             2025.07.07, 2025.07.08, 2025.07.09, 2025.07.10, 2025.07.11, 2025.07.14, 2025.07.15, 2025.07.16, 2025.07.17, 2025.07.18,\n             2025.07.21, 2025.07.22, 2025.07.23, 2025.07.24, 2025.07.25, 2025.07.28, 2025.07.29, 2025.07.30, 2025.07.31, 2025.08.01,\n             2025.08.04, 2025.08.05, 2025.08.06, 2025.08.07, 2025.08.08, 2025.08.11, 2025.08.12, 2025.08.13, 2025.08.14, 2025.08.15\n       ],\n    \"values\":[1.6000, 1.5600, 1.5300, 1.5500, 1.5500, 1.6300, 1.6500, 1.6000, 1.5900, 1.5800, \n              1.6300, 1.7000, 1.7000, 1.7000, 1.7500, 1.7500, 1.5900, 1.5800, 1.5700, 1.5600, \n              1.5500, 1.5500, 1.5600, 1.5900, 1.5900, 1.5700, 1.5500, 1.5600, 1.5679, 1.6000, \n              1.5700, 1.8500, 1.8300, 1.8400, 1.8500, 1.9500, 1.6036, 1.5800, 1.5200, 1.5000, \n              1.5000, 1.5100, 1.5100, 1.5300, 1.5200, 1.5500, 1.6000, 1.5400, 1.5400, 1.5000, \n              1.5000, 1.4800, 1.5000, 1.6000, 1.7500, 1.6400, 1.6200, 1.6300, 1.6000, 1.5000, \n              1.4800, 1.4700, 1.4800, 1.4900, 1.4600, 1.4600, 1.4600, 1.4800, 1.4800, 1.4900  \n               ]\\100\n}\npriceCurveFr007 = parseMktData(fr007HistCurve)\n\n```\n\nCombine the financial instrument objects created above into an INSTRUMENT vector for batch pricing via `instrumentPricer`.\n\n```\ninstrument = [fxFwdUsdCny, fxFwdEurCny, fxSwapUsdCny, fxSwapEurCny, \n              fxOptionUsdCny, fxOptionEurCny, bond, bondFut, deposit, irs]\nmktData= [fxSpotUsdCny, fxSpotEurCny, curveCnyFr007, curveUsdUsdCnyFx, curveEurEurCnyFx, surfUsdCny, surfEurCny, curveCnyTreasuryBond, priceCurveFr007]\npricingDate = aod\nresults1 = instrumentPricer(instrument, pricingDate, mktData)\n```\n\nOrganize the market data into a nested dictionary: the outer level is keyed by market data type (Price, Curve, Surface), and the inner level is keyed by the date and maps to the specific market data objects. Then pass the nested dictionary to `instrumentPricer` for pricing.\n\n```\nspots = dict(string, MKTDATA)\nspots[\"USDCNY\"] = fxSpotUsdCny\nspots[\"EURCNY\"] = fxSpotEurCny\ncurves = dict(string, MKTDATA)\ncurves[\"CNY_FR_007\"] = curveCnyFr007\ncurves[\"USD_USDCNY_FX\"] = curveUsdUsdCnyFx\ncurves[\"EUR_EURCNY_FX\"] = curveEurEurCnyFx\ncurves[\"CNY_TREASURY_BOND\"] = curveCnyTreasuryBond\ncurves[\"PRICE_FR_007\"] = priceCurveFr007\nsurfs = dict(string, MKTDATA)\nsurfs[\"USDCNY\"] = surfUsdCny\nsurfs[\"EURCNY\"] = surfEurCny\ndSpots = dict(DATE, ANY)\ndSpots[aod] = spots\ndCurves = dict(DATE, ANY)\ndCurves[aod] = curves\ndSurfs = dict(DATE, ANY)\ndSurfs[aod] = surfs\nmktData2 = dict(STRING, ANY)\nmktData2 = {\"Price\": dSpots,\n            \"Curve\": dCurves,\n            \"Surface\": dSurfs}\nresults2 = instrumentPricer(instrument, pricingDate, mktData2)\nprint(results2)\n// output: [-65560.1519,171923.5349,180871.3848,117636.4977,29773.4419,50067.7879,99.6008,107.7764,1005141.9397,-651143.5256]\n```\n\nPrice with market data engine:\n\n```\ntbdata = table(1:0, `eventTime`type`subType`name`term`price, [NANOTIMESTAMP, STRING, STRING, STRING, STRING, DOUBLE])\ninsert into tbdata values(now(), \"Bond\", string(), \"0001\", \"1d\", 3.2415)\ninsert into tbdata values(now(), \"Bond\", string(), \"0002\", \"1d\", 2.1584)\nbond1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"version\": 0, \n    \"nominal\": 100,\n    \"instrumentId\": \"0001\",\n    \"start\": 2022.05.15,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"cashflow\":[],\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nbond2 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"version\": 0, \n    \"nominal\": 100,\n    \"instrumentId\": \"0002\",\n    \"start\": 2023.05.15,\n    \"maturity\": 2033.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"cashflow\":[],\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nbondcurveConfig = {\n\t\"name\":\"CNY_TREASURY_BOND\",\n\t\"type\": \"BondYieldCurve\",\n\t\"bonds\":[parseInstrument(bond1), parseInstrument(bond2)],\n\t\"currency\": \"CNY\",\n\t\"dayCountConvention\": \"ActualActualISDA\",\n\t\"compounding\": \"Compounded\",\n\t\"frequency\": \"Semiannual\",\n\t\"interpMethod\": \"Linear\",\n\t\"extrapMethod\": \"Flat\",\n\t\"method\": \"Bootstrap\"\n}\nengine = createMktDataEngine(\"engine\", 2022.06.10, bondcurveConfig)\nengine.append!(tbdata)\nsleep(1000)\nins = parseInstrument(bond1)\nresults3 = instrumentPricer([ins], 2022.06.10, engine)\nprint(results3)\n\n// output: 55.2648\n```\n\n**Related function**: [createMktDataEngine](https://docs.dolphindb.com/en/Functions/c/createMktDataEngine.html)\n"
    },
    "int": {
        "url": "https://docs.dolphindb.com/en/Functions/i/int.html",
        "signatures": [
            {
                "full": "int(X)",
                "name": "int",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [int](https://docs.dolphindb.com/en/Functions/i/int.html)\n\n\n\n#### Syntax\n\nint(X)\n\n#### Details\n\nConvert X to the data type of INT.\n\n#### Parameters\n\n**X** can be data of any types.\n\n#### Returns\n\nReturns an integer scalar with the same form as *X*.\n\n#### Examples\n\n```\nx=int();\nx;\n// output: 00i\n\ntypestr x;\n// output: INT\n\nint(`10.9);\n// output: 10\n\nint(2147483647);\n// output: 2147483647\n\nint(2147483648);\n// output: 00i\n// the maximum value for an INT is 2^31-1=2147483647\n```\n"
    },
    "int128": {
        "url": "https://docs.dolphindb.com/en/Functions/i/int128.html",
        "signatures": [
            {
                "full": "int128(X)",
                "name": "int128",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [int128](https://docs.dolphindb.com/en/Functions/i/int128.html)\n\n\n\n#### Syntax\n\nint128(X)\n\n#### Details\n\nConvert STRING into INT128 data type.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nReturns a scalar or vector of INT128 type.\n\n#### Examples\n\n```\na=int128(\"e1671797c52e15f763380b45e841ec32\")\n// output: e1671797c52e15f763380b45e841ec32\n\ntypestr(a);\n// output: INT128\n```\n"
    },
    "integral": {
        "url": "https://docs.dolphindb.com/en/Functions/i/integral.html",
        "signatures": [
            {
                "full": "integral(func, start, end, [start2], [end2])",
                "name": "integral",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "end",
                        "name": "end"
                    },
                    {
                        "full": "[start2]",
                        "name": "start2",
                        "optional": true
                    },
                    {
                        "full": "[end2]",
                        "name": "end2",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [integral](https://docs.dolphindb.com/en/Functions/i/integral.html)\n\n\n\n#### Syntax\n\nintegral(func, start, end, \\[start2], \\[end2])\n\n#### Details\n\nReturn the integral of *func* from start to end.\n\nIf the result is infinity or if the calculation involves complex numbers, the result is NULL.\n\n#### Parameters\n\n**func** is a unary function.\n\n**start** is a numeric scalar/vector indicating start value. Null means negative infinity.\n\n**end** is a numeric scalar/vector indicating end value. Null means positive infinity.\n\n**start2** is a numeric scalar/vector/unary function indicating the start value of the second dimension in double integral. Null means negative infinity.\n\n**end2** is a numeric scalar/vector/unary function indicating the end value of the second dimension in double integral. Null means positive infinity.\n\nIf both *start* and *end* are vectors, they must be of the same length.\n\nIf one of *start* and *end* is a scalar and the other is a vector, the scalar is treated as a vector of idential values.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\nintegral(abs, -10, 10);\n// output: 100\n\nintegral(acos, [0.1, -0.10], [0.3, 0.10]);\n// output: [0.273816,0.314159]\n\nintegral(acosh, [1, 2, 9, 9], 10);\n// output: [19.982354,19.080489,2.941187,2.941187]\n\nintegral(pow{,3}, 5, 9);\n// output: 1484\n\nintegral(abs, NULL, NULL);\n// output: 00F\n\ndef f(x1,x2){\n   fx=100*(x2-x1*2)+square(1-x1)\n   return fx\n}\n\nintegral(f,0,1,7,1)\n// output: -1802\n\nintegral(f,[0,1,2,3],7,2,[0,1,2,3])\n// output: [8255.333333, 8256, 7856.666667, 7061.333333]\n```\n"
    },
    "interpolate": {
        "url": "https://docs.dolphindb.com/en/Functions/i/interpolate.html",
        "signatures": [
            {
                "full": "interpolate(X, [method='linear'], [limit], [inplace=false], [limitDirection='forward'], [limitArea], [index])",
                "name": "interpolate",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[method='linear']",
                        "name": "method",
                        "optional": true,
                        "default": "'linear'"
                    },
                    {
                        "full": "[limit]",
                        "name": "limit",
                        "optional": true
                    },
                    {
                        "full": "[inplace=false]",
                        "name": "inplace",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[limitDirection='forward']",
                        "name": "limitDirection",
                        "optional": true,
                        "default": "'forward'"
                    },
                    {
                        "full": "[limitArea]",
                        "name": "limitArea",
                        "optional": true
                    },
                    {
                        "full": "[index]",
                        "name": "index",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [interpolate](https://docs.dolphindb.com/en/Functions/i/interpolate.html)\n\n\n\n#### Syntax\n\ninterpolate(X, \\[method='linear'], \\[limit], \\[inplace=false], \\[limitDirection='forward'], \\[limitArea], \\[index])\n\n#### Details\n\nFills in null values in a numeric vector using interpolation. By default, the function treats each element's position (0, 1, 2, ..., *size(X)-1*) in X as its x-coordinate when performing the interpolation. You can also provide custom x-coordinates through the *index* parameter.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**method** (optional) is a string indicating how to fill the null values. It can take the following values and the default value is 'linear'.\n\n* linear: for null values surrounded by valid values, fill the null values linearly. For null values outside valid values, fill the null values with the closest valid values.\n\n* pad: fill null values with existing values.\n\n* nearest: fill null values with the closest valid values.\n\n  **Note:** When *method* = 'nearest' and *limitDirection =* 'both', if a null value is equidistant from nearest valid values on both sides, the system fills it using the value on the **left**.\n\n* krogh: fill null values with krogh polynomials.\n\n**limit** (optional) is a positive integer indicating the maximum number of consecutive null values to fill.\n\n**inplace** (optional) is a Boolean value indicating whether to update the input vector array. The default value is false, which means a new vector will be returned.\n\n**limitDirection** (optional) is a string indicating the direction to fill null values. It can take the following values: 'forward', 'backward' and 'both'. The default value is 'forward'.\n\n**limitArea** (optional) is a string indicating restrictions regarding filling null values. It can take the following values and the default value is empty string \"\".\n\n* empty string: no restrictions.\n\n* inside: only fill null values surrounded by valid values.\n\n* outside: only fill null values outside valid values.\n\n**index** (optional) specifies a numeric or temporal vector that must have the same length as *X* and cannot contain null values. When *index* is provided, the function performs interpolation using these values as x-coordinates and *X* as y-coordinates to fill in any missing values in X.\n\n#### Returns\n\nA numeric vector with null values filled in.\n\n#### Examples\n\n```\na=[NULL,NULL,1,2,NULL,NULL,5,6,NULL,NULL];\n\ninterpolate(a);\n// output: [,,1,2,3,4,5,6,6,6]\n\ninterpolate(X=a, method=\"pad\");\n// output: [,,1,2,2,2,5,6,6,6]\n\ninterpolate(X=a, limitDirection='both');\n// output: [1,1,1,2,3,4,5,6,6,6]\n\ninterpolate(X=a, limit=1, limitDirection='both');\n// output: [,1,1,2,3,4,5,6,6,]\n\ninterpolate(X=a, limitDirection='both', limitArea='outside');\n// output: [1,1,1,2,,,5,6,6,6]\n\na;\n// output: [,,1,2,,,5,6,,]\n\ninterpolate(X=a, limitDirection='backward', inplace=true);\n// output: [1,1,1,2,3,4,5,6,,]\n\na;\n// output: [1,1,1,2,3,4,5,6,,]\n\ndates=[2023.10.01, 2023.10.03, 2023.10.08, 2023.10.13, 2023.10.31, 2023.11.02, 2023.11.07, 2023.11.08,2023.11.09,2023.11.14]\n\ninterpolate(X=a,index=dates)\n// output\n[,,1,2,4.160000000000001,4.400000000000001,5,6,6,6]\n\na=[10,NULL,30,NULL,50];\nindex=[0, 3, 4, 7, 8]\ninterpolate(X=a,method='linear',index=index)\n// output\n[10,25,30,45,50]\n```\n"
    },
    "intersection": {
        "url": "https://docs.dolphindb.com/en/Functions/i/intersection.html",
        "signatures": [
            {
                "full": "intersection(X, Y)",
                "name": "intersection",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [intersection](https://docs.dolphindb.com/en/Functions/i/intersection.html)\n\n\n\n#### Syntax\n\nintersection(X, Y) or X\\&Y\n\n#### Details\n\nIf both *X* and *Y* are sets, return the intersection of the two sets.\n\nIf *X* and *Y* are integer scalars/vectors, conduct the bitwise operation \"AND\".\n\n#### Parameters\n\n**X** and **Y** can be sets, or integer scalars/vectors of the same length.\n\n#### Returns\n\nIt returns a set, or an INT scalar/vector.\n\n#### Examples\n\n```\nx=set([5,5,3,4,6])\ny=set(8 9 4 4 6)\nx & y;\n// output: set(4,6)\n\n6 7 8 & 4 5 6;\n// output: [4,5,0]\n```\n"
    },
    "invBeta": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invBeta.html",
        "signatures": [
            {
                "full": "invBeta(alpha, beta, X)",
                "name": "invBeta",
                "parameters": [
                    {
                        "full": "alpha",
                        "name": "alpha"
                    },
                    {
                        "full": "beta",
                        "name": "beta"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invBeta](https://docs.dolphindb.com/en/Functions/i/invBeta.html)\n\n\n\n#### Syntax\n\ninvBeta(alpha, beta, X)\n\n#### Details\n\nReturns the value of a beta inverse cumulative distribution function.\n\n#### Parameters\n\nThe shape parameters **alpha** and **beta** are positive floating numbers.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvBeta(2.31, 0.627, [0.001, 0.5, 0.999]);\n// output: [0.068102, 0.852866, 0.999994]\n\ninvBeta(2.31, 0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.471316, 0.717156, 0.852866, 0.939378, 0.989912]]\n```\n"
    },
    "invBinomial": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invBinomial.html",
        "signatures": [
            {
                "full": "invBinomial(trials, p, X)",
                "name": "invBinomial",
                "parameters": [
                    {
                        "full": "trials",
                        "name": "trials"
                    },
                    {
                        "full": "p",
                        "name": "p"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invBinomial](https://docs.dolphindb.com/en/Functions/i/invBinomial.html)\n\n\n\n#### Syntax\n\ninvBinomial(trials, p, X)\n\n#### Details\n\nReturn the value of a binomial inverse cumulative distribution function.\n\n#### Parameters\n\n**trials** is a positive integer.\n\n**p** is a floating number between 0 and 1.\n\n*trials* and *p* are shape parameters.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvBinomial(10, 0.1, [0.1, 0.5, 0.9]);\n// output: [0, 1, 2]\n\ninvBinomial(12,0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [5, 7, 8, 8, 10]\n```\n"
    },
    "invChiSquare": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invChiSquare.html",
        "signatures": [
            {
                "full": "invChiSquare(df, X)",
                "name": "invChiSquare",
                "parameters": [
                    {
                        "full": "df",
                        "name": "df"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invChiSquare](https://docs.dolphindb.com/en/Functions/i/invChiSquare.html)\n\n\n\n#### Syntax\n\ninvChiSquare(df, X)\n\n#### Details\n\nReturn the value of a chi-squared inverse cumulative distribution function.\n\n#### Parameters\n\n**df** is a positive integer indicating the degree of freedom of a chi-squared distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvChiSquare(1, [0, 0.05, 0.15, 0.25]);\n// output: [0, 0.003932, 0.035766, 0.101531]\n\ninvChiSquare(1, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.015791, 0.148472, 0.454936, 1.074194, 2.705543]\n```\n"
    },
    "inverse": {
        "url": "https://docs.dolphindb.com/en/Functions/i/inverse.html",
        "signatures": [
            {
                "full": "inverse(X)",
                "name": "inverse",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [inverse](https://docs.dolphindb.com/en/Functions/i/inverse.html)\n\n\n\n#### Syntax\n\ninverse(X)\n\n#### Details\n\nReturn the inverse matrix of *X* if it is invertible.\n\n#### Parameters\n\n**X** is a matrix.\n\n#### Returns\n\nIf *X* is invertible, returns the inverse matrix of *X*. Otherwise, an error is raised.\n\n#### Examples\n\n```\nx=1..4$2:2;\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 2  | 4  |\n\n```\nx.inverse();\n```\n\n| #0 | #1   |\n| -- | ---- |\n| -2 | 1.5  |\n| 1  | -0.5 |\n"
    },
    "invExp": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invExp.html",
        "signatures": [
            {
                "full": "invExp(mean, X)",
                "name": "invExp",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invExp](https://docs.dolphindb.com/en/Functions/i/invExp.html)\n\n\n\n#### Syntax\n\ninvExp(mean, X)\n\n#### Details\n\nReturn the value of an exponential inverse cumulative distribution function.\n\n#### Parameters\n\n**mean** is the mean of an exponential distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvExp(1, [0.05 0.15 0.25 0.35]);\n// output: [0.051293, 0.162519, 0.287682, 0.430783]\n\ninvExp(1, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.105361, 0.356675, 0.693147, 1.203973, 2.302585]\n```\n"
    },
    "invF": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invF.html",
        "signatures": [
            {
                "full": "invF(numeratorDF, denominatorDF, X)",
                "name": "invF",
                "parameters": [
                    {
                        "full": "numeratorDF",
                        "name": "numeratorDF"
                    },
                    {
                        "full": "denominatorDF",
                        "name": "denominatorDF"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invF](https://docs.dolphindb.com/en/Functions/i/invF.html)\n\n\n\n#### Syntax\n\ninvF(numeratorDF, denominatorDF, X)\n\n#### Details\n\nReturn the value of an F inverse cumulative distribution function.\n\n#### Parameters\n\n**numeratorDF** and **denominatorDF** are positive integers indicating degrees of freedom of an F distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvF(2.31, 0.627, [0.001, 0.5, 0.7]);\n// output: [0.002024, 2.69427, 14.992595]\n\ninvF(2.31,0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.146649, 0.718555, 2.69427, 14.992595, 508.444221]\n```\n"
    },
    "invGamma": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invGamma.html",
        "signatures": [
            {
                "full": "invGamma(shape, scale, X)",
                "name": "invGamma",
                "parameters": [
                    {
                        "full": "shape",
                        "name": "shape"
                    },
                    {
                        "full": "scale",
                        "name": "scale"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invGamma](https://docs.dolphindb.com/en/Functions/i/invGamma.html)\n\n\n\n#### Syntax\n\ninvGamma(shape, scale, X)\n\n#### Details\n\nReturn the value of a gamma inverse cumulative distribution function.\n\n#### Parameters\n\nThe shape parameter **shape** is a positive floating number.\n\nThe scale parameter **scale** is a positive floating number.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvGamma(2.31, 0.627, [0.001, 0.5, 0.999]);\n// output: [0.049713, 1.245583, 6.191955]\n\ninvGamma(2.31,0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.437696, 0.843572, 1.245583, 1.760732, 2.724121]\n```\n"
    },
    "invLogistic": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invLogistic.html",
        "signatures": [
            {
                "full": "invLogistic(mean, s, X)",
                "name": "invLogistic",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "s",
                        "name": "s"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invLogistic](https://docs.dolphindb.com/en/Functions/i/invLogistic.html)\n\n\n\n#### Syntax\n\ninvLogistic(mean, s, X)\n\n#### Details\n\nReturn the value of a logistic inverse cumulative distribution function.\n\n#### Parameters\n\n**mean** is the mean of a logistic distribution.\n\n**s** is the scale parameter of a logistic distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvLogistic( 2.31, 0.627, [0.5, 0.3, 0.5, 0.7, 0.1]);\n// output: [2.31, 1.778744, 2.31, 2.841256, 0.93234]\n```\n"
    },
    "invNormal": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invNormal.html",
        "signatures": [
            {
                "full": "invNormal(mean, stdev, X)",
                "name": "invNormal",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "stdev",
                        "name": "stdev"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invNormal](https://docs.dolphindb.com/en/Functions/i/invNormal.html)\n\n\n\n#### Syntax\n\ninvNormal(mean, stdev, X)\n\n#### Details\n\nReturn the value of a normal inverse cumulative distribution function.\n\n#### Parameters\n\n**mean** is the mean of a normal distribution.\n\n**stdev** is the standard deviation of a normal distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvNormal(0,1,0.33);\n// output: -0.439913\n\ninvNormal(10, 20, [0.1 0.2 0.3]);\n// output: [-15.631031, -6.832425, -0.48801]\n```\n"
    },
    "invPoisson": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invPoisson.html",
        "signatures": [
            {
                "full": "invPoisson(mean, X)",
                "name": "invPoisson",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invPoisson](https://docs.dolphindb.com/en/Functions/i/invPoisson.html)\n\n\n\n#### Syntax\n\ninvPoisson(mean, X)\n\n#### Details\n\nReturn the value of a Poisson inverse cumulative distribution function.\n\n#### Parameters\n\n**mean** is the mean of a Poisson distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvPoisson(1, [0.91, 0.92, 0.93]);\n// output: [2, 3, 3]\n\ninvPoisson(3, [0.81, 0.83, 0.95, 0.97, 0.99]);\n// output: [4, 5, 6, 7, 8]\n```\n"
    },
    "invStudent": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invStudent.html",
        "signatures": [
            {
                "full": "invStudent(df, X)",
                "name": "invStudent",
                "parameters": [
                    {
                        "full": "df",
                        "name": "df"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invStudent](https://docs.dolphindb.com/en/Functions/i/invStudent.html)\n\n\n\n#### Syntax\n\ninvStudent(df, X)\n\n#### Details\n\nReturn the value of a Student's t inverse cumulative distribution function.\n\n#### Parameters\n\n**df** is a positive floating number indicating the degree of freedom of a Student's t-distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvStudent(1, [0.15, 0.25, 0.35]);\n// output: [-1.962611, -1, -0.509525]\n\ninvStudent(1, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [-3.077684, -0.726543, 0, 0.726543, 3.077684]\n```\n"
    },
    "invUniform": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invUniform.html",
        "signatures": [
            {
                "full": "invUniform(lower, upper, X)",
                "name": "invUniform",
                "parameters": [
                    {
                        "full": "lower",
                        "name": "lower"
                    },
                    {
                        "full": "upper",
                        "name": "upper"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invUniform](https://docs.dolphindb.com/en/Functions/i/invUniform.html)\n\n\n\n#### Syntax\n\ninvUniform(lower, upper, X)\n\n#### Details\n\nReturn the value of an uniform inverse cumulative distribution function.\n\n#### Parameters\n\n**lower** and **upper** are numeric scalars indicating the lower bound and upper bound of a continuous uniform distribution.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvUniform(0.627, 2.31, [0.001, 0.5, 0.999]);\n// output: [0.628683, 1.4685, 2.308317]\n\ninvUniform(0.627, 2.31, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.7953, 1.1319, 1.4685, 1.8051, 2.1417]\n```\n"
    },
    "invWeibull": {
        "url": "https://docs.dolphindb.com/en/Functions/i/invWeibull.html",
        "signatures": [
            {
                "full": "invWeibull(alpha, beta, X)",
                "name": "invWeibull",
                "parameters": [
                    {
                        "full": "alpha",
                        "name": "alpha"
                    },
                    {
                        "full": "beta",
                        "name": "beta"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [invWeibull](https://docs.dolphindb.com/en/Functions/i/invWeibull.html)\n\n\n\n#### Syntax\n\ninvWeibull(alpha, beta, X)\n\n#### Details\n\nReturn the value of a Weibull inverse cumulative distribution function.\n\n#### Parameters\n\nThe scale parameter **alpha** and the shape parameter **beta** are both positive floating numbers.\n\n**X** is a floating scalar or vector between 0 and 1.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ninvWeibull(2.31, 0.627, [0.001, 0.5, 0.999]);\n// output: [0.031525, 0.535009, 1.447494]\n\ninvWeibull(2.31,0.627, [0.1, 0.3, 0.5, 0.7, 0.9]);\n// output: [0.236692, 0.401279, 0.535009, 0.679464, 0.899644]\n```\n"
    },
    "ipaddr": {
        "url": "https://docs.dolphindb.com/en/Functions/i/ipaddr.html",
        "signatures": [
            {
                "full": "ipaddr(X)",
                "name": "ipaddr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [ipaddr](https://docs.dolphindb.com/en/Functions/i/ipaddr.html)\n\n\n\n#### Syntax\n\nipaddr(X)\n\n#### Details\n\nConvert STRING into IPADDR (IP address) data type.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nA IPADDR scalar or vector.\n\n#### Examples\n\n```\na=ipaddr(\"192.168.1.13\");\na;\n// output: 192.168.1.13\n\ntypestr(a);\n// output: IPADDR\n```\n"
    },
    "irCrossCurrencyCurveBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/i/irCrossCurrencyCurveBuilder.html",
        "signatures": [
            {
                "full": "irCrossCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, currencyPair, spot, dayCountConvention, discountCurve, [compounding='Continuous'], [frequency='Annual'], [curveName])",
                "name": "irCrossCurrencyCurveBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "currency",
                        "name": "currency"
                    },
                    {
                        "full": "instNames",
                        "name": "instNames"
                    },
                    {
                        "full": "instTypes",
                        "name": "instTypes"
                    },
                    {
                        "full": "terms",
                        "name": "terms"
                    },
                    {
                        "full": "quotes",
                        "name": "quotes"
                    },
                    {
                        "full": "currencyPair",
                        "name": "currencyPair"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "[compounding='Continuous']",
                        "name": "compounding",
                        "optional": true,
                        "default": "'Continuous'"
                    },
                    {
                        "full": "[frequency='Annual']",
                        "name": "frequency",
                        "optional": true,
                        "default": "'Annual'"
                    },
                    {
                        "full": "[curveName]",
                        "name": "curveName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [irCrossCurrencyCurveBuilder](https://docs.dolphindb.com/en/Functions/i/irCrossCurrencyCurveBuilder.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nirCrossCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, currencyPair, spot, dayCountConvention, discountCurve, \\[compounding='Continuous'], \\[frequency='Annual'], \\[curveName])\n\n#### Details\n\nBuilds a cross-currency interest rate swap yield curve.\n\n#### Parameters\n\n**referenceDate** A DATE scalar specifying the reference date of the yield curve.\n\n**currency** A STRING scalar specifying the currency code of the curve. Supported values: \"CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\".\n\n**instNames** A STRING vector indicating the instrument names.\n\n**instTypes** A STRING vector indicating the instrument types.\n\nCurrently *instTypes* only supports \"FxSwap\", and *instNames* should be currency pairs, e.g., \"USDCNY\".\n\n**terms** A vector of STRING or DURATION type, indicating the remaining maturity, e.g., \"1M\".\n\n**quotes** A numeric vector indicating the market quotes.\n\n**currencyPair**A STRING scalar specifying the currency pair, in the format \"EURUSD\", \"EUR.USD\", or \"EUR/USD\". Supported currency pairs include:\n\n* \"EURUSD\": Euro to US Dollar\n\n* \"USDCNY\": US Dollar to Chinese Yuan\n\n* \"EURCNY\": Euro to Chinese Yuan\n\n* \"GBPCNY\": British Pound to Chinese Yuan\n\n* \"JPYCNY\": Japanese Yen to Chinese Yuan\n\n* \"HKDCNY\": Hong Kong Dollar to Chinese Yuan\n\n**spot** A DOUBLE scalar specifying the spot exchange rate on the reference date.\n\n**dayCountConvention**is a STRING scalar or vector indicating the day count convention to use. It can be:\n\n* \"ActualActual\": actual/actual\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n* \"Thirty360EU\": European 30/360\n\n* \"Thirty360US\": US (NASD) 30/360\n\n**discountCurve**A MKTDATA object of type IrYieldCurve, indicating discount curve for the other currency in the currency pair, which must be a yield curve built using the bootstrap method. See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/i/irCrossCurrencyCurveBuilder.html#topic_n4h_sxq_ngc) for details.\n\n**compounding** (optional) A STRING scalar defining the compounding method. Options:\n\n* \"Compounded\": Discrete compounding\n\n* \"Simple\": Simple interest\n\n* \"Continuous\" (default): Continuous compounding\n\n**frequency** (optional) A STRING scalar specifying the interest payment frequency. Supported values:\n\n* \"NoFrequency\": No payment frequency\n\n* \"Annual\": Annually\n\n* \"Semiannual\": Semiannually\n\n* \"EveryFourthMonth\": Every four months\n\n* \"Quarterly\": Quarterly\n\n* \"BiMonthly\": Every two months\n\n* \"Monthly\": Monthly\n\n* \"EveryFourthWeek\": Every four weeks\n\n* \"BiWeekly\": Every two weeks\n\n* \"Weekly\": Weekly\n\n* \"Daily\": Daily\n\n* \"Other\": Other frequencies\n\n**curveName** (optional) A STRING scalar indicating the yield curve name. The default value is NULL.\n\n#### Returns\n\nA MKTDATA object.\n\n#### Examples\n\n```\nrefDate = 2025.08.18\nspotDate1 = temporalAdd(refDate, 2, \"XNYS\")  \nspotDate2 = temporalAdd(refDate, 2, \"CFET\")  \nspotDate = max(spotDate1, spotDate2)\ninstNames = take(\"USDCNY\", 13)\ninstTypes = take(\"FxSwap\", 13)\nterms = [\"1d\", \"1w\", \"2w\", \"3w\", \"1M\", \"2M\", \"3M\", \"6M\", \"9M\", \"1y\", \"18M\", \"2y\", \"3y\"]\ncurveDates = array(DATE)\nfor(term in terms){\n    dur = duration(term)\n    days1 = transFreq(temporalAdd(spotDate, dur), \"XNYS\", \"right\", \"right\")\n    days2 = transFreq(temporalAdd(spotDate, dur), \"CFET\", \"right\", \"right\")\n    curveDates.append!(max(transFreq(temporalAdd(spotDate, dur), \"XNYS\", \"right\", \"right\"), transFreq(temporalAdd(spotDate, dur), \"CFET\", \"right\", \"right\")))\n }\nquotes = [-5.54, \n          -39.00, \n          -75.40, \n          -113.20, \n          -177.00, \n          -317.00, \n          -466.00, \n          -898.50, \n          -1284.99, \n          -1676.00, \n          -2320.00, \n          -2870.00, \n          -3962.50] \\ 10000  // fx swap points\n\ncnyShibor3m = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": refDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\": curveDates,\n    \"values\": [1.5113,\n               1.5402,\n               1.5660,\n               1.5574,\n               1.5556,\n               1.5655,\n               1.5703,\n               1.5934,\n               1.6040,\n               1.6020,\n               1.5928,\n               1.5842,\n               1.6068] \\ 100,\n    \"settlement\": spotDate\n}\n\ncnyShibor3m = parseMktData(cnyShibor3m)\n\nspot = 7.1627\ncurve = irCrossCurrencyCurveBuilder(refDate, \"USD\", instNames, instTypes, terms, quotes, \"USDCNY\", spot, \"Actual365\", cnyShibor3m, \"Continuous\")\ncurveDict = extractMktData(curve)\nfor(i in 0..(size(quotes)-1) ){\n    print(curveDict[\"values\"][i]*100)\n}\n```\n\n**Releated functions:**[bondYieldCurveBuilder](https://docs.dolphindb.com/en/Functions/b/bondYieldCurveBuilder.html), [irSingleCurrencyCurveBuilder](https://docs.dolphindb.com/en/Functions/i/irSingleCurrencyCurveBuilder.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n\n#### Curve Field Specifications\n\n<table id=\"table_ok5_3cr_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; Currently, only \"Bootstrap\" is supported.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>\n"
    },
    "irDepositPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/i/irDepositPricer.html",
        "signatures": [
            {
                "full": "irDepositPricer(instrument, pricingDate, discountCurve)",
                "name": "irDepositPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    }
                ]
            }
        ],
        "markdown": "### [irDepositPricer](https://docs.dolphindb.com/en/Functions/i/irDepositPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nirDepositPricer(instrument, pricingDate, discountCurve)\n\n#### Details\n\nPrices the certificate of deposit (CDs).\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**instrument** is an INSTRUMENT scalar/vector of Deposit type indicating the deposit(s) to be priced.\n\n**pricingDate** is a DATE scalar/vector specifying the pricing date(s).\n\n**discountCurve** is a MKTDATA scalar/vector of type IrYieldCurve representing the discount curve(s).\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\ndeposit =  {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"start\": 2025.05.15,\n    \"maturity\": 2025.08.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E6,\n    \"payReceive\": \"Receive\"\n}\nrate = deposit[\"rate\"]\ninstrument = parseInstrument(deposit)\nprint(instrument)\npricingDate = 2025.06.10\ncurve_dict = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  //Continuous compounding\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\":[2025.07.25, 2030.09.25],\n    \"values\":[0.015, 0.015]\n}\ndiscountCurve = parseMktData(curve_dict)\nirDepositPricer(instrument,2025.06.10,discountCurve)   // output:1002388.613154108868911\nirDepositPricer([instrument, instrument],pricingDate,discountCurve)\nirDepositPricer(instrument,[pricingDate, pricingDate, pricingDate],discountCurve)\nirDepositPricer(instrument,pricingDate,[discountCurve, discountCurve, discountCurve])\n```\n\n**Related functions:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "irFixedFloatingSwapPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/i/irFixedFloatingSwapPricer.html",
        "signatures": [
            {
                "full": "irFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, forwardCurve, assetPriceCurve, [setting])",
                "name": "irFixedFloatingSwapPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "discountCurve",
                        "name": "discountCurve"
                    },
                    {
                        "full": "forwardCurve",
                        "name": "forwardCurve"
                    },
                    {
                        "full": "assetPriceCurve",
                        "name": "assetPriceCurve"
                    },
                    {
                        "full": "[setting]",
                        "name": "setting",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [irFixedFloatingSwapPricer](https://docs.dolphindb.com/en/Functions/i/irFixedFloatingSwapPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nirFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, forwardCurve, assetPriceCurve, \\[setting])\n\n#### Details\n\nPrices the IR Fixied-Floating Swap(s).\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**instrument** is an INSTRUMENT scalar/vector of IrFixedFloatingSwap type representing the IR Fixied-Floating Swap(s) to be priced.\n\n**pricingDate** is a DATE scalar/vector specifying the pricing date(s).\n\n**discountCurve** is a MKTDATA scalar/vector of IrYieldCurve type representing the discount curve(s) used to compute discount factors.\n\n**forwardCurve** is a MKTDATA scalar/vector of IrYieldCurve type representing the spot curve(s) used to compute forward rates.\n\n**assetPriceCurve** is a MKTDATA scalar/vector of AssetPriceCurve type used to pass the historical data for the floating reference rate of an interest rate swap.\n\n**setting** (optional)is a Dictionary\\<STRING, ANY> specifying the calculation configuration with the following key-value pair:\n\n| key          | value | describe                       |\n| ------------ | ----- | ------------------------------ |\n| calcCashFlow | BOOL  | whether to calculate cash flow |\n\n#### Returns\n\n* If specify calcCashFlow in *setting*, it returns a dictionary or a tuple of dictionaries.\n\n* Otherwise, it returns a DOUBLE scalar/vector.\n\n#### Examples\n\nExample 1. Interest rate swap pricing based on FR\\_007 as the reference rate.\n\n```\nirs =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2025.06.16,\n    \"maturity\": 2028.06.16,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.018,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual365\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"FR_007\",\n    \"spread\": 0.0001,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\n\npricingDate = 2025.08.18\n\ncurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"curveName\": \"CNY_FR_007\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",     \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24, 2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20,2028.08.21],\n    \"values\":[1.4759, 1.5331, 1.5697, 1.5239, 1.4996, 1.5144, 1.5209,\n              1.5539, 1.5461, 1.5316, 1.5376, 1.5435,1.5699] / 100\n}\n\n// To calculate the floating rate used for the first cash flow after the valuation date, historical data of the reference rate must be provided.\n// Since the payment frequency of the FR_007 interest rate swap is quarterly, it is recommended to provide no fewer than 70 trading days of historical FR_007 fixing data.\nfr007HistCurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"AssetPriceCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"dates\":[2025.05.09, 2025.05.12, 2025.05.13, 2025.05.14, 2025.05.15, 2025.05.16, 2025.05.19, 2025.05.20, 2025.05.21, 2025.05.22,\n             2025.05.23, 2025.05.26, 2025.05.27, 2025.05.28, 2025.05.29, 2025.05.30, 2025.06.03, 2025.06.04, 2025.06.05, 2025.06.06,\n             2025.06.09, 2025.06.10, 2025.06.11, 2025.06.12, 2025.06.13, 2025.06.16, 2025.06.17, 2025.06.18, 2025.06.19, 2025.06.20,\n             2025.06.23, 2025.06.24, 2025.06.25, 2025.06.26, 2025.06.27, 2025.06.30, 2025.07.01, 2025.07.02, 2025.07.03, 2025.07.04,\n             2025.07.07, 2025.07.08, 2025.07.09, 2025.07.10, 2025.07.11, 2025.07.14, 2025.07.15, 2025.07.16, 2025.07.17, 2025.07.18,\n             2025.07.21, 2025.07.22, 2025.07.23, 2025.07.24, 2025.07.25, 2025.07.28, 2025.07.29, 2025.07.30, 2025.07.31, 2025.08.01,\n             2025.08.04, 2025.08.05, 2025.08.06, 2025.08.07, 2025.08.08, 2025.08.11, 2025.08.12, 2025.08.13, 2025.08.14, 2025.08.15\n       ],\n    \"values\":[1.6000, 1.5600, 1.5300, 1.5500, 1.5500, 1.6300, 1.6500, 1.6000, 1.5900, 1.5800, \n              1.6300, 1.7000, 1.7000, 1.7000, 1.7500, 1.7500, 1.5900, 1.5800, 1.5700, 1.5600, \n              1.5500, 1.5500, 1.5600, 1.5900, 1.5900, 1.5700, 1.5500, 1.5600, 1.5679, 1.6000, \n              1.5700, 1.8500, 1.8300, 1.8400, 1.8500, 1.9500, 1.6036, 1.5800, 1.5200, 1.5000, \n              1.5000, 1.5100, 1.5100, 1.5300, 1.5200, 1.5500, 1.6000, 1.5400, 1.5400, 1.5000, \n              1.5000, 1.4800, 1.5000, 1.6000, 1.7500, 1.6400, 1.6200, 1.6300, 1.6000, 1.5000, \n              1.4800, 1.4700, 1.4800, 1.4900, 1.4600, 1.4600, 1.4600, 1.4800, 1.4800, 1.4900  \n               ]\\100\n}\n\ninstrument = parseInstrument(irs)\ncurve = parseMktData(curve)\ndiscountCurve = curve\nforwardCurve = curve\nassetPriceCurve = parseMktData(fr007HistCurve)\n\n// Calculate npv\nnpv = irFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, forwardCurve, assetPriceCurve)\nprint(npv)\n\n// Calculate npv, cash flow\nsetting = {\n    \"calcCashFlow\": true\n}\nirFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, forwardCurve, assetPriceCurve, setting)\n// Interest rate swaps pricing for multiple instruments/pricing dates/discount curves/forward curves/asset price curves.\nirFixedFloatingSwapPricer([instrument, instrument], pricingDate, discountCurve, forwardCurve, assetPriceCurve, setting)\nirFixedFloatingSwapPricer(instrument, [pricingDate, pricingDate], discountCurve, forwardCurve, assetPriceCurve, setting)\nirFixedFloatingSwapPricer(instrument, pricingDate, [discountCurve, discountCurve], forwardCurve, assetPriceCurve, setting)\nirFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, [forwardCurve, forwardCurve], assetPriceCurve, setting)\nirFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, forwardCurve, [assetPriceCurve, assetPriceCurve], setting)\n```\n\nExample 2. Interest rate swap pricing based on SHIBOR\\_3M as the reference rate.\n\n```\nirs =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2025.06.16,\n    \"maturity\": 2028.06.16,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.018,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Receive\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0001,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\n\npricingDate = 2025.08.18\n\ncurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": pricingDate,\n    \"currency\": \"CNY\",\n    \"curveName\": \"CNY_SHIBOR_3M\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",     \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24, 2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20,2028.08.21],\n    \"values\":[1.5113, 1.5402, 1.5660, 1.5574, 1.5556, 1.5655, 1.5703, \n              1.5934, 1.6040, 1.6020, 1.5928, 1.5842, 1.6068] / 100\n}\n\n// To calculate the floating rate for the first cash flow after the valuation date, historical data of the reference rate must be provided.\n// Since the payment frequency of the SHIBOR_3M interest rate swap is quarterly, it is recommended to provide at least 70 trading days of historical SHIBOR_3M fixing data.\nshibor3mHistCurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"AssetPriceCurve\",\n    \"referenceDate\": 2022.05.15,\n    \"currency\": \"CNY\",\n    \"dates\":[2025.05.09, 2025.05.12, 2025.05.13, 2025.05.14, 2025.05.15, 2025.05.16, 2025.05.19, 2025.05.20, 2025.05.21, 2025.05.22,\n             2025.05.23, 2025.05.26, 2025.05.27, 2025.05.28, 2025.05.29, 2025.05.30, 2025.06.03, 2025.06.04, 2025.06.05, 2025.06.06,\n             2025.06.09, 2025.06.10, 2025.06.11, 2025.06.12, 2025.06.13, 2025.06.16, 2025.06.17, 2025.06.18, 2025.06.19, 2025.06.20,\n             2025.06.23, 2025.06.24, 2025.06.25, 2025.06.26, 2025.06.27, 2025.06.30, 2025.07.01, 2025.07.02, 2025.07.03, 2025.07.04,\n             2025.07.07, 2025.07.08, 2025.07.09, 2025.07.10, 2025.07.11, 2025.07.14, 2025.07.15, 2025.07.16, 2025.07.17, 2025.07.18,\n             2025.07.21, 2025.07.22, 2025.07.23, 2025.07.24, 2025.07.25, 2025.07.28, 2025.07.29, 2025.07.30, 2025.07.31, 2025.08.01,\n             2025.08.04, 2025.08.05, 2025.08.06, 2025.08.07, 2025.08.08, 2025.08.11, 2025.08.12, 2025.08.13, 2025.08.14, 2025.08.15\n       ],\n    \"values\":[1.6960, 1.6720, 1.6620, 1.6530, 1.6450, 1.6470, 1.6450, 1.6420, 1.6400, 1.6400, \n              1.6420, 1.6430, 1.6440, 1.6470, 1.6520, 1.6520, 1.6520, 1.6520, 1.6520, 1.6510, \n              1.6490, 1.6450, 1.6420, 1.6390, 1.6380, 1.6360, 1.6340, 1.6300, 1.6300, 1.6290, \n              1.6290, 1.6290, 1.6300, 1.6300, 1.6300, 1.6300, 1.6280, 1.6195, 1.6060, 1.5970, \n              1.5790, 1.5700, 1.5620, 1.5590, 1.5570, 1.5610, 1.5590, 1.5590, 1.5570, 1.5550, \n              1.5530, 1.5490, 1.5510, 1.5530, 1.5590, 1.5600, 1.5600, 1.5640, 1.5660, 1.5630, \n              1.5590, 1.5580, 1.5590, 1.5600, 1.5544, 1.5490, 1.5480, 1.5480, 1.5490, 1.5470  \n               ]\\100\n}\n\ninstrument = parseInstrument(irs)\ncurve = parseMktData(curve)\ndiscountCurve = curve\nforwardCurve = curve\nassetPriceCurve = parseMktData(shibor3mHistCurve)\n\n// Calculate npv\nnpv = irFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, forwardCurve, assetPriceCurve)\nprint(npv)\n\n// Calculate npv, cash flow\nsetting = {\n    \"calcCashFlow\": true\n}\nresults = irFixedFloatingSwapPricer(instrument, pricingDate, discountCurve, forwardCurve, assetPriceCurve, setting)\nprint(results)\n```\n\n**Related functions:** [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "irs": {
        "url": "https://docs.dolphindb.com/en/Functions/i/irs.html",
        "signatures": [
            {
                "full": "irs(settlement, resetInterval, start, maturity, notional, fixedRate, spread, curve, frequency, calendar, [convention='ModifiedFollowing'], [basis=1], [rateType=0])",
                "name": "irs",
                "parameters": [
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "resetInterval",
                        "name": "resetInterval"
                    },
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "notional",
                        "name": "notional"
                    },
                    {
                        "full": "fixedRate",
                        "name": "fixedRate"
                    },
                    {
                        "full": "spread",
                        "name": "spread"
                    },
                    {
                        "full": "curve",
                        "name": "curve"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "calendar",
                        "name": "calendar"
                    },
                    {
                        "full": "[convention='ModifiedFollowing']",
                        "name": "convention",
                        "optional": true,
                        "default": "'ModifiedFollowing'"
                    },
                    {
                        "full": "[basis=1]",
                        "name": "basis",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[rateType=0]",
                        "name": "rateType",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [irs](https://docs.dolphindb.com/en/Functions/i/irs.html)\n\n#### Syntax\n\nirs(settlement, resetInterval, start, maturity, notional, fixedRate, spread, curve, frequency, calendar, \\[convention='ModifiedFollowing'], \\[basis=1], \\[rateType=0])\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**resetInterval**is a DURATION scalar or vector indicating how often the interest rate is reset.\n\n**start** is a DATE scalar or vector indicating the start date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**notional** is a numeric scalar or vector indicating the notional amount.\n\n**fixedRate** is a numeric scalar or vector indicating the fixed rate(s).\n\n**spread** is a numeric scalar or vector indicating the interest rate spread.\n\n**curve** is a dictionary scalar or vector indicating the fitted yield curve.\n\n**frequency** is an INT scalar/vector indicating the number of payments, or a STRING scalar/vector indicating payment frequency. It can be:\n\n* 0/\"Once\": Bullet payment at maturity.\n* 1/\"Annual\": Annual payments.\n* 2/\"Semiannual\": Semi-annual payments.\n* 4/\"Quarterly\": Quarterly payments.\n* 12/\"Monthly\": Monthly payments.\n\n**calendar** is a STRING scalar or vector indicating the trading calendar(s). See [Trading Calendar](https://docs.dolphindb.com/en/Tutorials/trading_calendar.html) for more information.\n\n**convention** (optional) is a STRING scalar or vector indicating how cash flows that fall on a non-trading day are treated. The following options are available. Defaults to 'ModifiedFollowing'.\n\n* 'Following': The following trading day.\n* 'ModifiedFollowing': The following trading day. If that day is in a different month, the preceding trading day is adopted instead.\n* 'Preceding': The preceding trading day.\n* 'ModifiedPreceding': The preceding trading day. If that day is in a different month, the following trading day is adopted instead.\n* 'Unadjusted': Unadjusted.\n* 'HalfMonthModifiedFollowing': The following trading day. If that day crosses the mid-month (15th) or the end of month, the preceding trading day is adopted instead.\n* 'Nearest': The nearest trading day. If both the preceding and following trading days are equally far away, default to following trading day.\n\n**basis**is an INT/STRING scalar or vector indicating the day-count basis. It can be:\n\n* 0/\"Thirty360US\": US (NASD) 30/360\n* 1/\"ActualActual\": actual/actual\n* 2/\"Actual360\": actual/360\n* 3/\"Actual365\": actual/365\n* 4/\"Thirty360EU\": European 30/360\n\n**rateType** (optional) is an INT/STRING scalar or vector indicating compound interest. It can be:\n\n* 0/\"CC\" (default): continuous compounding\n* 1/\"C\": discrete compounding\n\n#### Details\n\nThe `irs` function prices an interest rate swap (IRS) for the floating-rate side.\n\nAn IRS is a derivative contract in which two parties agree to exchange one stream of interest payments for another over a set period of time. The most commonly traded IRS is the exchange of a fixed interest rate payment and a floating rate payment (typically benchmarked to an interbank offered rate LIBOR).\n\n**Return Value**: A DOUBLE scalar or vector.\n\n#### Examples\n\nThis example describes an interest rate swap where fixed and floating rate payments are exchanged weekly over a 5-year period (2023.07.10-2028.01.10). The swap uses the XNYS calendar for determining trading days and applies a US (NASD) 30/360 day-count basis and continuous compounding for interest calculations.\n\n```\nsettlement = 2023.07.10\ncalendar = `XNYS\nday0 = temporalAdd(settlement, 0, calendar)\ncurveRateTime = [10y, 14d, 1d, 1M, 1y, 2y, 3M, 3y, 4y, 5y, 6M, 7d, 7y, 9M]\ncurveRateValue = [ 2.7013, 1.8, 1.27, 1.9425, 2.0263, 2.1265, 1.9725, 2.2438, 2.3575, 2.4538, 1.9938, 1.86, 2.5863, 2.0088] * 0.01\ndates = []\nfor (dur in curveRateTime) {\n\tdates.append!(temporalAdd(settlement, dur))\n}\nX = (dates - day0)$INT\n// a curve for base rate (without spread)\ncurve = linearInterpolateFit(X, curveRateValue)\nresetIntv = 7d\nstart = 2023.01.10\nmaturity = 2028.01.10\nnotional = 100.0\nfixedRate = 0.02765\nspread = 0.0\nfreq = 3M\nbasis = 0\nirs(settlement, resetIntv, start, maturity, notional, fixedRate, spread, curve, freq, calendar, basis = basis)\n// -1.54\n```\n"
    },
    "irSingleCurrencyCurveBuilder": {
        "url": "https://docs.dolphindb.com/en/Functions/i/irSingleCurrencyCurveBuilder.html",
        "signatures": [
            {
                "full": "irSingleCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, dayCountConvention, [discountCurve], [compounding='Continuous'], [frequency='Annual'], [curveName])",
                "name": "irSingleCurrencyCurveBuilder",
                "parameters": [
                    {
                        "full": "referenceDate",
                        "name": "referenceDate"
                    },
                    {
                        "full": "currency",
                        "name": "currency"
                    },
                    {
                        "full": "instNames",
                        "name": "instNames"
                    },
                    {
                        "full": "instTypes",
                        "name": "instTypes"
                    },
                    {
                        "full": "terms",
                        "name": "terms"
                    },
                    {
                        "full": "quotes",
                        "name": "quotes"
                    },
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "[discountCurve]",
                        "name": "discountCurve",
                        "optional": true
                    },
                    {
                        "full": "[compounding='Continuous']",
                        "name": "compounding",
                        "optional": true,
                        "default": "'Continuous'"
                    },
                    {
                        "full": "[frequency='Annual']",
                        "name": "frequency",
                        "optional": true,
                        "default": "'Annual'"
                    },
                    {
                        "full": "[curveName]",
                        "name": "curveName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [irSingleCurrencyCurveBuilder](https://docs.dolphindb.com/en/Functions/i/irSingleCurrencyCurveBuilder.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nirSingleCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, dayCountConvention, \\[discountCurve], \\[compounding='Continuous'], \\[frequency='Annual'], \\[curveName])\n\n#### Details\n\nBuild a yield curve using single-currency interest rate swaps. Currently, only CNY\\_FR\\_007 and CNY\\_SHIBOR\\_3M curves are supported.\n\n#### Parameters\n\n**referenceDate** A DATE scalar indicating the reference date of the curve.\n\n**currency** A STRING scalar indicating the currency in which the curve is defined. Currently, only \"CNY\" is supported.\n\n**instNames** A STRING vector indicating the instrument names.\n\n**instTypes** A STRING vector indicating the instrument types. Currently supports \"Deposit\" and \"IrVanillaSwap\".\n\n**terms** A vector of DURATION type, indicating the remaining maturity, e.g., \"1M\".\n\n**quotes** A numeric vector indicating the market quotes.\n\n**dayCountConvention**A STRING scalar indicating the day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n**discountCurve** (optional) An MKTDATA object of type IrYieldCurve indicating the discount curve. See [Curve Field Specifications](https://docs.dolphindb.com/en/Functions/i/irSingleCurrencyCurveBuilder.html#topic_oqh_xvq_ngc) for details.\n\n* If the market instruments used for building the target curve require an external discount curve for pricing, specify it using this parameter.\n\n* If not provided, no external discount curve will be used by default.\n\n**compounding** (optional) A STRING scalar specifying the compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\" (default): continuous compounding.\n\n**frequency** (optional) A STRING scalar specifying the interest payment frequency. Supported values:\n\n* \"NoFrequency\": No payment frequency\n\n* \"Annual\": Annually\n\n* \"Semiannual\": Semiannually\n\n* \"EveryFourthMonth\": Every four months\n\n* \"Quarterly\": Quarterly\n\n* \"BiMonthly\": Every two months\n\n* \"Monthly\": Monthly\n\n* \"EveryFourthWeek\": Every four weeks\n\n* \"BiWeekly\": Every two weeks\n\n* \"Weekly\": Weekly\n\n* \"Daily\": Daily\n\n* \"Other\": Other frequencies\n\n**curveName** (optional) A STRING scalar indicating the yield curve name. The default value is NULL.\n\n#### Returns\n\nA MKTDATA object.\n\n#### Examples\n\nExample 1. Build a CNY-denominated interest rate swap curve referencing the FR007 floating rate.\n\n```\nreferenceDate = 2021.05.26\ncurrency = \"CNY\"\nterms = [7d, 1M, 3M, 6M, 9M, 1y, 2y, 3y, 4y, 5y, 7y, 10y]\ninstNames = take(\"CNY_FR_007\", size(terms))\ninstNames[0] = \"FR_007\"\ninstTypes = take(\"IrVanillaSwap\", size(terms))\ninstTypes[0] = \"Deposit\"\nquotes = [2.3500, 2.3396, 2.3125, 2.3613, 2.4075, 2.4513, 2.5750, 2.6763, 2.7650, 2.8463, 2.9841, 3.1350]\\100\ndayCountConvention = \"Actual365\"\ncurve = irSingleCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, dayCountConvention, curveName=\"CNY_FR_007\")\ncurveDict = extractMktData(curve)\nprint(curveDict)\n```\n\nExample 2. Build a CNY interest rate swap yield curve based on short-term deposit and interest rate swap market quotes.\n\n```\nreferenceDate = 2021.05.26\ncurrency = \"CNY\"\nterms = [1w, 2w, 1M, 3M, 6M, 9M, 1y, 2y, 3y, 4y, 5y, 7y, 10y]\ninstNames = take(\"CNY_SHIBOR_3M\", size(terms))\ninstNames[0] = \"SHIBOR_1W\"\ninstNames[1] = \"SHIBOR_2W\"\ninstNames[2] = \"SHIBOR_1M\"\ninstNames[3] = \"SHIBOR_3M\"\ninstTypes = take(\"IrVanillaSwap\", size(terms))\ninstTypes[0] = \"Deposit\"\ninstTypes[1] = \"Deposit\"\ninstTypes[2] = \"Deposit\"\ninstTypes[3] = \"Deposit\"\nquotes = [2.269,\n          2.311,\n          2.405,\n          2.479,\n          2.6013,\n          2.7038,\n          2.7725,\n          2.9625,\n          3.11,\n          3.24,\n          3.3513,\n          3.5313,\n          3.7125]/100\ndayCountConvention = \"Actual365\"\ncurve = irSingleCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, dayCountConvention)\ncurveDict = extractMktData(curve)\nprint(curveDict)\n```\n\nExample 3. Build a dual-curve interest rate swap yield curve (CNY\\_SHIBOR\\_3M).\n\n```\nreferenceDate = 2021.05.26\ncurrency = \"CNY\"\ncurveName = \"CNY_SHIBOR_3M\"\ndiscountCurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_FR_007\",\n    \"referenceDate\": referenceDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2021.06.02,2021.06.28,2021.08.27,2021.11.29,2022.02.28,2022.05.27,2023.05.29,2024.05.27,2025.05.27,2026.05.27,2028.05.29,2031.05.27],\n    \"values\": [2.3495, 2.3376, 2.3063, 2.3543, 2.4004, 2.4442, 2.5686, 2.6715, 2.7625, 2.8468, 2.9922, 3.1559] / 100.0\n}\ndiscountCurve = parseMktData(discountCurve)\nterms = [1w, 2w, 1M, 3M, 6M, 9M, 1y, 2y, 3y, 4y, 5y, 7y, 10y]\ninstNames = take(\"CNY_SHIBOR_3M\", size(terms))\ninstNames[0] = \"SHIBOR_1W\"\ninstNames[1] = \"SHIBOR_2W\"\ninstNames[2] = \"SHIBOR_1M\"\ninstNames[3] = \"SHIBOR_3M\"\ninstTypes = take(\"IrVanillaSwap\", size(terms))\ninstTypes[0] = \"Deposit\"\ninstTypes[1] = \"Deposit\"\ninstTypes[2] = \"Deposit\"\ninstTypes[3] = \"Deposit\"\nquotes = [2.269,\n          2.311,\n          2.405,\n          2.479,\n          2.6013,\n          2.7038,\n          2.7725,\n          2.9625,\n          3.11,\n          3.24,\n          3.3513,\n          3.5313,\n          3.7125]/100\ndayCountConvention = \"Actual365\"\n\ncurve = irSingleCurrencyCurveBuilder(referenceDate, currency, instNames, instTypes, terms, quotes, dayCountConvention, discountCurve)\ncurveDict = extractMktData(curve)\nprint(curveDict)\n```\n\n**Releated functions:**[bondYieldCurveBuilder](https://docs.dolphindb.com/en/Functions/b/bondYieldCurveBuilder.html), [extractMktData](https://docs.dolphindb.com/en/Functions/e/extractMktData.html), [irCrossCurrencyCurveBuilder](https://docs.dolphindb.com/en/Functions/i/irCrossCurrencyCurveBuilder.html), [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n\n#### Curve Field Specifications\n\n<table id=\"table_a1k_1m1_4gc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; Currently, only \"Bootstrap\" is supported.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>\n"
    },
    "isAlNum": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isAlNum.html",
        "signatures": [
            {
                "full": "isAlNum(X)",
                "name": "isAlNum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isAlNum](https://docs.dolphindb.com/en/Functions/i/isAlNum.html)\n\n\n\n#### Syntax\n\nisAlNum(X)\n\n#### Details\n\nReturn \"true\" if all characters in string X are alphanumeric (either alphabets or numbers).\n\nIf *X* is a table, the function is applied only to columns of character types (CHAR, STRING, or SYMBOL). Other column types are ignored.\n\n#### Parameters\n\n**X** is a CHAR/STRING/SYMBOL scalar, vector, or table.\n\n#### Returns\n\n* When *X* is a scalar, a Boolean scalar is returned.\n* When *X* is a vector, a Boolean vector is returned.\n* When *X* is a table, a table is returned.\n\n#### Examples\n\n```\nisAlNum(\"123456\");\n// output: true\n\nisAlNum(\"1And1\");\n// output: true\n\nisAlNum(\"10.05\");\n// output: false\n\nisAlNum(string());\n// output: false\n```\n"
    },
    "isAlpha": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isAlpha.html",
        "signatures": [
            {
                "full": "isAlpha(X)",
                "name": "isAlpha",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isAlpha](https://docs.dolphindb.com/en/Functions/i/isAlpha.html)\n\n\n\n#### Syntax\n\nisAlpha(X)\n\n#### Details\n\nReturn \"true\" if all characters in the string are alphabets. For null values of the STRING type, return \"false\".\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\n* When *X* is a scalar, a Boolean scalar is returned.\n* When *X* is a vector, a Boolean vector is returned.\n* When *X* is a table, a table is returned.\n\n#### Examples\n\n```\nisAlpha(\"hello\");\n// output: true\n\nisAlpha(\"hello world\");\n// output: false\n\nisAlpha(\"1And1\");\n// output: false\n\nisAlpha(string());\n// output: false\n```\n"
    },
    "isCheckpointingHaMvcc": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isCheckpointingHaMvcc.html",
        "signatures": [
            {
                "full": "isCheckpointingHaMvcc(groupId)",
                "name": "isCheckpointingHaMvcc",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [isCheckpointingHaMvcc](https://docs.dolphindb.com/en/Functions/i/isCheckpointingHaMvcc.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nisCheckpointingHaMvcc(groupId)\n\n#### Details\n\nChecks whether the specified HA MVCC Raft group is currently performing a checkpoint.\n\n#### Parameters\n\n**groupId** is an integer indicating the HA MVCC Raft group ID.\n\n#### Returns\n\nReturns a BOOL scalar. true indicates that a checkpoint is in progress; false indicates that no checkpoint is in progress (or it has completed).\n\n#### Examples\n\n```\nisCheckpointingHaMvcc(5)\n// output:false\n```\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "isChunkNodeInit": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isChunkNodeInit.html",
        "signatures": [
            {
                "full": "isDataNodeInitialized()",
                "name": "isDataNodeInitialized",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [isChunkNodeInit](https://docs.dolphindb.com/en/Functions/i/isChunkNodeInit.html)\n\nAlias for [isDataNodeInitialized](https://docs.dolphindb.com/en/Functions/i/isDataNodeInitialized.html)\n\n\nDocumentation for the `isDataNodeInitialized` function:\n### [isDataNodeInitialized](https://docs.dolphindb.com/en/Functions/i/isDataNodeInitialized.html)\n\n\n\n#### Syntax\n\nisDataNodeInitialized()\n\nAlias: isChunkNodeInit\n\n#### Details\n\nReturn true if the current node has been started; return false otherwise. The function can only be executed on data nodes or compute nodes and cannot be executed on agent or controller nodes.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\nisDataNodeInitialized()\n// output: true\n```\n"
    },
    "isClientAuth": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isclientauth.html",
        "signatures": [
            {
                "full": "isClientAuth()",
                "name": "isClientAuth",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [isClientAuth](https://docs.dolphindb.com/en/Functions/i/isclientauth.html)\n\n\n\n#### Syntax\n\nisClientAuth()\n\n#### Details\n\nThis function returns a boolean value indicating the value of the *enableClientAuth* configuration parameter.\n\nWhen *enableClientAuth* is set to true, guest users must log in before executing scripts. They can execute a limited set of maintenance functions via API calls, including: `isClientAuth`, `getNodeType`, `getNodeAlias`, `login`, `authenticateByTicket`, `getControllerAlias`, `version`, `license`, `getActiveMaster`, `getClusterPerf`, `loadClusterNodesConfigs`, `getConfig`, `oauthLogin`, `getCurrentSessionAndUser`, `getDynamicPublicKey`.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA Boolean scalar.\n"
    },
    "isColumnarTuple": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isColumnarTuple.html",
        "signatures": [
            {
                "full": "isColumnarTuple(X)",
                "name": "isColumnarTuple",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isColumnarTuple](https://docs.dolphindb.com/en/Functions/i/isColumnarTuple.html)\n\n#### Syntax\n\nisColumnarTuple(X)\n\n#### Details\n\nCheck if *X* is a columnar tuple.\n\n#### Parameters\n\n**X** is a tuple.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\ntp = [[1,2,3], [4,5,6], [7,8]]\nisColumnarTuple(tp)\n// output: false\n\ntp.setColumnarTuple!()\nisColumnarTuple(tp)\n// output: true\n```\n\n```\nid = 3 2 1 4\nval = [`aa`bb, `aa`cc`dd, `bb, `cc`dd]\nt = table(id, val)\n\nisColumnarTuple(t.val)\n// output: true\n\nisColumnarTuple(t.id)\n// output: false\n\nexec isColumnarTuple(val) from t\n// output: true\n\nav = array(INT[], 0, 10).append!([1 1 1 3, 2 4 2 5, 8 9 7 1, 5 4 3])\nt = table(id, av)\nisColumnarTuple(t.av)\n// output: false\n```\n\n"
    },
    "isControllerInitialized": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isControllerInitialized.html",
        "signatures": [
            {
                "full": "isControllerInitialized()",
                "name": "isControllerInitialized",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [isControllerInitialized](https://docs.dolphindb.com/en/Functions/i/isControllerInitialized.html)\n\n\n\n#### Syntax\n\nisControllerInitialized()\n\n#### Details\n\nCheck whether the controller is initialized. True if it is initialized, otherwise false. In a cluster, it is called only on the controller; in a cluster with high-availability enabled, it is called only on the leader.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA Boolean scalar.\n\n#### Example\n\n```\nisControllerInitialized()\n// output: true\n```\n\nRelated Functions: [isDataNodeInitialized](https://docs.dolphindb.com/en/Functions/i/isDataNodeInitialized.html)\n"
    },
    "isDataNodeInitialized": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isDataNodeInitialized.html",
        "signatures": [
            {
                "full": "isDataNodeInitialized()",
                "name": "isDataNodeInitialized",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [isDataNodeInitialized](https://docs.dolphindb.com/en/Functions/i/isDataNodeInitialized.html)\n\n\n\n#### Syntax\n\nisDataNodeInitialized()\n\nAlias: isChunkNodeInit\n\n#### Details\n\nReturn true if the current node has been started; return false otherwise. The function can only be executed on data nodes or compute nodes and cannot be executed on agent or controller nodes.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\nisDataNodeInitialized()\n// output: true\n```\n"
    },
    "isDigit": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isDigit.html",
        "signatures": [
            {
                "full": "isDigit(X)",
                "name": "isDigit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isDigit](https://docs.dolphindb.com/en/Functions/i/isDigit.html)\n\n\n\n#### Syntax\n\nisDigit(X)\n\n#### Details\n\nReturn \"true\" if all characters in the string are numbers. For null values of the STRING type, return \"false\".\n\n**Note:** `isDigit` and [isNumeric](https://docs.dolphindb.com/en/Functions/i/isNumeric.html) are equivalent and can be used interchangeably.\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\n* When *X* is a scalar, it returns a Boolean scalar.\n* When *X* is a vector, it returns a Boolean vector.\n* When *X* is a table, it returns a table.\n\n#### Examples\n\n```\nisDigit(\"123456\");\n// output: true\n\nisDigit(\"1And1\");\n// output: false\n\nisDigit(\"10.05\");\n// output: false\n\nisDigit(string());\n// output: false\n```\n"
    },
    "isDuplicated": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isDuplicated.html",
        "signatures": [
            {
                "full": "isDuplicated(X, [keep=FIRST])",
                "name": "isDuplicated",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[keep=FIRST]",
                        "name": "keep",
                        "optional": true,
                        "default": "FIRST"
                    }
                ]
            }
        ],
        "markdown": "### [isDuplicated](https://docs.dolphindb.com/en/Functions/i/isDuplicated.html)\n\n\n\n#### Syntax\n\nisDuplicated(X, \\[keep=FIRST])\n\n#### Details\n\nReturn a vector or a tuple of vectors of Boolean values. If an element has no duplicate values, it returns 0.\n\n* If keep=FIRST, the first duplicate value returns 0 while all other duplicate values return 1.\n\n* If keep=LAST, the last duplicate value returns 0 while all other duplicate values return 1.\n\n* If keep=NONE, all duplicate values return 1.\n\n#### Parameters\n\n**X** is a vector or a tuple of vectors of same length.\n\n**keep** can take the value of FIRST, LAST or NONE. It indicates how the system processes duplicate values. The default value is FIRST.\n\n#### Returns\n\n* If *X* is a vector, the result is a Boolean vector with the same length as *X*.\n* If *X* is a tuple, the result is a Boolean vector with the same length as each element in *X*.\n\n#### Examples\n\n```\nv = [1,3,1,-6,NULL,2,NULL,1]\nisDuplicated(v,FIRST);\n// output: [false,false,true,false,false,false,true,true]\n// 1 appears three time in v, the locations are the 0th, the 2nd and the 7th. Since keep = FIRST, the 0th result is set to false, and the 2nd and 7th results are set to true.\n\nv = [1,3,1,-6,NULL,2,NULL,1]\nisDuplicated(v,LAST);\n// output: [true,false,true,false,true,false,false,false]\n// 1 appears three time in v, the locations are the the 0th, the 2nd and the 7th. Since keep = LAST, the 7th result is set to false, and the 0th and 2nd results are set to true.\n\nv = [1,3,1,-6,NULL,2,NULL,1]\nisDuplicated(v,NONE);\n// output: [true,false,true,false,true,false,true,true]\n// 1 appears three time in v, the locations are the 0th, the 2nd and the 7th. Since keep = NONE, the 0th, the 2nd and the 7th result are all set to true.\n```\n\nTo delete duplicate records from a table:\n\n```\nt=table(1 2 4 8 4 2 7 1 as id, 10 20 40 80 40 20 70 10 as val);\nt;\n```\n\n| id | val |\n| -- | --- |\n| 1  | 10  |\n| 2  | 20  |\n| 4  | 40  |\n| 8  | 80  |\n| 4  | 40  |\n| 2  | 20  |\n| 7  | 70  |\n| 1  | 10  |\n\n```\nselect * from t where isDuplicated([id,val],FIRST)=false;\n// Only keep the first duplicated record and delete the others.\n```\n\n| id | val |\n| -- | --- |\n| 1  | 10  |\n| 2  | 20  |\n| 4  | 40  |\n| 8  | 80  |\n| 7  | 70  |\n\nSince version 2.00.13/3.00.1, the `isDuplicated` function supports the BLOB data.\n\n```\na=[blob(\"s1\"), blob(\"s2\")]\nisDuplicated(a)\n// output: [false, false]\na1=[blob(\"s1\"), blob(\"s2\"), blob(\"s1\"), blob(\"s2\")]\nisDuplicated(a1)\n// output: [false, false, true, true]\n```\n"
    },
    "isIndexedMatrix": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isIndexedMatrix.html",
        "signatures": [
            {
                "full": "isIndexedMatrix(X)",
                "name": "isIndexedMatrix",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isIndexedMatrix](https://docs.dolphindb.com/en/Functions/i/isIndexedMatrix.html)\n\n\n\n#### Syntax\n\nisIndexedMatrix(X)\n\n#### Details\n\nDetermine if *X* is an indexed matrix.\n\n#### Parameters\n\n**X** is a matrix.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\nm=matrix(1..10, 11..20)\nm.rename!(2020.01.01..2020.01.10, `A`B);\n\nisIndexedMatrix(m);\n// output: false\n\nm.setIndexedMatrix!()\nisIndexedMatrix(m);\n// output: true\n```\n"
    },
    "isIndexedSeries": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isIndexedSeries.html",
        "signatures": [
            {
                "full": "isIndexedSeries(X)",
                "name": "isIndexedSeries",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isIndexedSeries](https://docs.dolphindb.com/en/Functions/i/isIndexedSeries.html)\n\n\n\n#### Syntax\n\nisIndexedSeries(X)\n\n#### Details\n\nDetermine if *X* is an indexed series.\n\n#### Parameters\n\n**X** is a matrix with only 1 column.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\ns=matrix(1..10).rename!(2020.01.01..2020.01.10, );\n\nisIndexedSeries(s);\n// output: false\n\ns.setIndexedSeries!()\nisIndexedSeries(s);\n// output: true\n```\n"
    },
    "isLeapYear": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isLeapYear.html",
        "signatures": [
            {
                "full": "isLeapYear(X)",
                "name": "isLeapYear",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isLeapYear](https://docs.dolphindb.com/en/Functions/i/isLeapYear.html)\n\n\n\n#### Syntax\n\nisLeapYear(X)\n\n#### Details\n\nDetermine if each element in *X* is in a leap year.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nReturn a Boolean scalar or vector.\n\n#### Examples\n\n```\nisLeapYear(2012.06.12T12:30:00);\n// output: true\n\nisLeapYear([2012.01.01,2013.01.01,2014.01.01,2015.01.01]);\n// output: [true,false,false,false]\n```\n"
    },
    "isLoggedIn": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isLoggedIn.html",
        "signatures": [
            {
                "full": "isLoggedIn(userId)",
                "name": "isLoggedIn",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    }
                ]
            }
        ],
        "markdown": "### [isLoggedIn](https://docs.dolphindb.com/en/Functions/i/isLoggedIn.html)\n\n\n\n#### Syntax\n\nisLoggedIn(userId)\n\n#### Details\n\nCheck whether the specified user is logged in.\n\n#### Parameters\n\n**userId** a string indicating a user name. It can only contain letters, underscores, or numbers. It cannot start with numbers. The length cannot exceed 30 characters.\n\n#### Returns\n\nReturn a Boolean scalar.\n\n#### Examples\n\n```\nisLoggedIn(`AlexSmith)\n// output: false\n```\n"
    },
    "isLower": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isLower.html",
        "signatures": [
            {
                "full": "isLower(X)",
                "name": "isLower",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isLower](https://docs.dolphindb.com/en/Functions/i/isLower.html)\n\n\n\n#### Syntax\n\nisLower(X)\n\n#### Details\n\nCheck whether all the case-based characters (letters) of the string are lowercase.\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\n* When *X* is a scalar, it returns a Boolean scalar.\n* When *X* is a vector, it returns a Boolean vector.\n* When *X* is a table, it returns a table.\n\n#### Examples\n\n```\nisLower(\"this is string example....wow!!!\");\n// output: true\n\nisLower(\"THIS is string example....wow!!!\");\n// output: false\n\nisLower(\"123456abc\");\n// output: true\n\nisLower(\"123\");\n// output: false\n\nisLower([\"  \",string()]);\n// output: [false,false]\n```\n\nRelated funcitons: [isUpper](https://docs.dolphindb.com/en/Functions/i/isUpper.html), [isTitle](https://docs.dolphindb.com/en/Functions/i/isTitle.html)\n"
    },
    "isMonotonic": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isMonotonic.html",
        "signatures": [
            {
                "full": "isMonotonicIncreasing(X)",
                "name": "isMonotonicIncreasing",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isMonotonic](https://docs.dolphindb.com/en/Functions/i/isMonotonic.html)\n\nAlias for [isMonotonicIncreasing](https://docs.dolphindb.com/en/Functions/i/isMonotonicIncreasing.html)\n\n\nDocumentation for the `isMonotonicIncreasing` function:\n### [isMonotonicIncreasing](https://docs.dolphindb.com/en/Functions/i/isMonotonicIncreasing.html)\n\n\n\n#### Syntax\n\nisMonotonicIncreasing(X)\n\nAlias: isMonotonic\n\n#### Details\n\nCheck whether the elements in *X* are monotonically increasing.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\na = [2023.01M,2023.02M,2023.03M,2023.04M,2023.05M,2023.06M]\nisMonotonicIncreasing(a);\n// output: true\n\na = [1,3,6,5,7,9]\nisMonotonicIncreasing(a);\n// output: false\n\na = [1,3,3,5,7,9]\nisMonotonicIncreasing(a);\n// output: true\n\na = [NULL,1,3,5,7,9]\nisMonotonicIncreasing(a);\n// output: true\n\na = [1,3,5,NULL,7,9]\nisMonotonicIncreasing(a);\n// output: false\n```\n\nRelated functions: [isMonotonicDecreasing](https://docs.dolphindb.com/en/Functions/i/isMonotonicDecreasing.html), [isMonotonic](https://docs.dolphindb.com/en/Functions/i/isMonotonic.html)\n"
    },
    "isMonotonicDecreasing": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isMonotonicDecreasing.html",
        "signatures": [
            {
                "full": "isMonotonicDecreasing(X)",
                "name": "isMonotonicDecreasing",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isMonotonicDecreasing](https://docs.dolphindb.com/en/Functions/i/isMonotonicDecreasing.html)\n\n\n\n#### Syntax\n\nisMonotonicDecreasing(X)\n\n#### Details\n\nCheck whether the elements in *X* are monotonically decreasing.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\na = [10,8,6,4,2]\nisMonotonicDecreasing(a);\n// output: true\n\na = [10,8,6,7,2]\nisMonotonicDecreasing(a);\n// output: false\n\na = [10,8,6,6,4,2]\nisMonotonicDecreasing(a);\n// output: true\n\na = [10,8,6,NULL,4,2]\nisMonotonicDecreasing(a);\n// output: false\n\na = [10,8,6,4,2,NULL]\nisMonotonicDecreasing(a);\n// output: true\n```\n\nRelated functions: [isMonotonicIncreasing](https://docs.dolphindb.com/en/Functions/i/isMonotonicIncreasing.html), [isMonotonic](https://docs.dolphindb.com/en/Functions/i/isMonotonic.html)\n"
    },
    "isMonotonicIncreasing": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isMonotonicIncreasing.html",
        "signatures": [
            {
                "full": "isMonotonicIncreasing(X)",
                "name": "isMonotonicIncreasing",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isMonotonicIncreasing](https://docs.dolphindb.com/en/Functions/i/isMonotonicIncreasing.html)\n\n\n\n#### Syntax\n\nisMonotonicIncreasing(X)\n\nAlias: isMonotonic\n\n#### Details\n\nCheck whether the elements in *X* are monotonically increasing.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\na = [2023.01M,2023.02M,2023.03M,2023.04M,2023.05M,2023.06M]\nisMonotonicIncreasing(a);\n// output: true\n\na = [1,3,6,5,7,9]\nisMonotonicIncreasing(a);\n// output: false\n\na = [1,3,3,5,7,9]\nisMonotonicIncreasing(a);\n// output: true\n\na = [NULL,1,3,5,7,9]\nisMonotonicIncreasing(a);\n// output: true\n\na = [1,3,5,NULL,7,9]\nisMonotonicIncreasing(a);\n// output: false\n```\n\nRelated functions: [isMonotonicDecreasing](https://docs.dolphindb.com/en/Functions/i/isMonotonicDecreasing.html), [isMonotonic](https://docs.dolphindb.com/en/Functions/i/isMonotonic.html)\n"
    },
    "isMonthEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isMonthEnd.html",
        "signatures": [
            {
                "full": "isMonthEnd(X)",
                "name": "isMonthEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isMonthEnd](https://docs.dolphindb.com/en/Functions/i/isMonthEnd.html)\n\n\n\n#### Syntax\n\nisMonthEnd(X)\n\n#### Details\n\nDetermine if each element in *X* is the last day of a month.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\nisMonthEnd(2012.05.31);\n// output: true\n\nisMonthEnd([2012.05.30,2012.05.31]);\n// output: [false,true]\n```\n\nRelated function: [isMonthStart](https://docs.dolphindb.com/en/Functions/i/isMonthStart.html)\n"
    },
    "isMonthStart": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isMonthStart.html",
        "signatures": [
            {
                "full": "isMonthStart(X)",
                "name": "isMonthStart",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isMonthStart](https://docs.dolphindb.com/en/Functions/i/isMonthStart.html)\n\n\n\n#### Syntax\n\nisMonthStart(X)\n\n#### Details\n\nDetermine if each element in *X* is the first day of a month.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\nisMonthStart(2012.05.01);\n// output: true\n\nisMonthStart([2012.05.01,2012.05.02]);\n// output: [true,false]\n```\n\nRelated function: [isMonthEnd](https://docs.dolphindb.com/en/Functions/i/isMonthEnd.html)\n"
    },
    "isNanInf": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isNanInf.html",
        "signatures": [
            {
                "full": "isNanInf(X, [includeNull=false])",
                "name": "isNanInf",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[includeNull=false]",
                        "name": "includeNull",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [isNanInf](https://docs.dolphindb.com/en/Functions/i/isNanInf.html)\n\n\n\n#### Syntax\n\nisNanInf(X, \\[includeNull=false])\n\n#### Details\n\nCheck each element in *X* to see if it is a NaN/Inf value. Return a BOOLEAN type of the same length as *X*. If *includeNull* is set to true, null values will return true. The default value of *includeNull* is false.\n\n#### Parameters\n\n**X** is a DOUBLE type scalar, vector or matrix.\n\n**includeNull** is a BOOLEAN.\n\n#### Returns\n\nReturns a Boolean value with the same form as *X*.\n\n#### Examples\n\n```\nx = [1.5, float(`nan), 2.3, float(`inf), NULL, 3.7]  \n  \n// includeNull = false (defaule), null values will return false  \nisNanInf(x)  \n// output: [false,true,false,true,false,false]\n\n// includeNull = true, null values will return false \nisNanInf(x)  \n// output: [false,true,false,true,true,false]\n```\n\n**Related function**: [countNanInf](https://docs.dolphindb.com/en/Functions/c/countNanInf.html)\n"
    },
    "isNothing": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isNothing.html",
        "signatures": [
            {
                "full": "isNothing(X)",
                "name": "isNothing",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isNothing](https://docs.dolphindb.com/en/Functions/i/isNothing.html)\n\n\n\n#### Syntax\n\nisNothing(X)\n\n#### Details\n\n`isNothing` tests if a function argument is provided by the user.\n\n\"Nothing\" is one of the two objects in VOID type.\n\n#### Parameters\n\n**X** can be of any data type or form.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\nf=def(x,y): isNothing(y);\nf(5,);\n// output: true\n\nf(5, NULL);\n// output: false\n```\n"
    },
    "isNull": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isNull.html",
        "signatures": [
            {
                "full": "isNull(X)",
                "name": "isNull",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isNull](https://docs.dolphindb.com/en/Functions/i/isNull.html)\n\n\n\n#### Syntax\n\nisNull(X)\n\n#### Details\n\nReturns true if an element is NULL. Starting from version 2.00.5, when *X* is a dictionary, tuple, array vector, or table, this function checks whether each element in each row is NULL and returns a dictionary, tuple, or table with the same dimensions as *X*.\n\n**Note:**\n\nBoth DolphinDBisNull and [pandas.isnull](https://pandas.pydata.org/docs/reference/api/pandas.isnull.html) can be used to determine whether a value is null. The differences are as follows:\n\n* DolphinDB `isNull` is designed for detecting NULL values within DolphinDB's own type system and supports scalars, vectors, matrices, and other DolphinDB objects.\n\n* `pandas.isnull` is intended for missing-value detection in Python data analysis workflows. It primarily identifies values such as NaN, NaT, pd.NA, and None.\n\n#### Parameters\n\n**X** is a scalar, pair, vector, matrix, or memory table.\n\n#### Returns\n\nReturns a Boolean value with the same form as *X*.\n\n#### Examples\n\n```\nisNull(00i);\n// output: true\n\nisNull(1 NULL NULL 6 NULL 7);\n// output: [false,true,true,false,true,false]\n\nisNull(1/0);\n// output: 1\n\nx=1 NULL 5 NULL 4 6$2:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 5  | 4  |\n|    |    | 6  |\n\n```\nisNull(x);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 0  | 0  | 0  |\n| 1  | 1  | 0  |\n\nRelated functions: [hasNull](https://docs.dolphindb.com/en/Functions/h/hasNull.html), [nullFill](https://docs.dolphindb.com/en/Functions/n/nullFill.html)\n"
    },
    "isNumeric": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isNumeric.html",
        "signatures": [
            {
                "full": "isNumeric(X)",
                "name": "isNumeric",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isNumeric](https://docs.dolphindb.com/en/Functions/i/isNumeric.html)\n\n\n\n#### Syntax\n\nisNumeric(X)\n\n#### Details\n\nReturn true if all characters in the string are numbers. For null values of the STRING type, return false.\n\n**Note:** `isNumeric` and [isDigit](https://docs.dolphindb.com/en/Functions/i/isDigit.html) are equivalent and can be used interchangeably.\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\n* When *X* is a scalar, it returns a Boolean scalar.\n* When *X* is a vector, it returns a Boolean vector.\n* When *X* is a table, it returns a table.\n\n#### Examples\n\n```\nisNumeric(\"123456\");\n// output: true\n\nisNumeric(\"1And1\");\n// output: false\n\nisNumeric(\"10.05\");\n// output: false\n\nisNumeric(string());\n// output: false\n```\n"
    },
    "isOrderedDict": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isOrderedDict.html",
        "signatures": [
            {
                "full": "isOrderedDict(X)",
                "name": "isOrderedDict",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isOrderedDict](https://docs.dolphindb.com/en/Functions/i/isOrderedDict.html)\n\n\n\n#### Syntax\n\nisOrderedDict(X)\n\n#### Details\n\nThe function returns \"true\" if *X* is an ordered dictionary.\n\n#### Parameters\n\n`X` is a dictionary.\n\n#### Returns\n\nReturns a Boolean scalar.\n\n#### Examples\n\n```\nx=1 2 3\ny=4.5 7.8 4.3\nz=dict(x,y);\nisOrderedDict(z)\n// output: false\n\nz1=dict(x,y,true);\nisOrderedDict(z1)\n// output: true\n```\n"
    },
    "isort!": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isort!.html",
        "signatures": [
            {
                "full": "isort!(X, [ascending=true], indices)",
                "name": "isort!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "indices",
                        "name": "indices"
                    }
                ]
            }
        ],
        "markdown": "### [isort!](https://docs.dolphindb.com/en/Functions/i/isort!.html)\n\n\n\n#### Syntax\n\nisort!(X, \\[ascending=true], indices)\n\n#### Details\n\n`isort!(x, ascending, y)` is equivalent to `y[isort(x,ascending)]`. The result is assigned to *y*.\n\n#### Parameters\n\n**X** is a vector or a tuple of vectors of the same length.\n\n**ascending** is a Boolean scalar indicating whether to sort *X* (or vectors of *X* sequentially) in ascending order or descending order. The default value is true (ascending order).\n\n**indices** is a vector of the same length as each vector in *X*.\n\n#### Returns\n\nReturns a sorted vector with the same type as *X*.\n\n#### Examples\n\n```\nx=3 1 NULL 2\ny=5 7 8 3\nisort!(x, false, y);\n// output: [5, 3, 7, 8]\n// after sorted, x is [3, 2, 1, NULL], the first element 3 is corresponding to 5 in y, the second element 2 is corresponding to 3 in y, the third element 1 is corresponding to 7 in y, ... and so on.\n\nx=2 2 1 1\ny=2 1 1 2\nisort!([x,y],[1,0],5 4 3 2);\n// output: [2,3,5,4]\n```\n"
    },
    "isort": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isort.html",
        "signatures": [
            {
                "full": "isort(X, [ascending=true])",
                "name": "isort",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [isort](https://docs.dolphindb.com/en/Functions/i/isort.html)\n\n\n\n#### Syntax\n\nisort(X, \\[ascending=true])\n\n#### Details\n\nInstead of returning a sorted vector like [sort!](https://docs.dolphindb.com/en/Functions/s/sort!.html), `isort` returns the indexes in the original vector for each element in the sorted vector.\n\n`X[isort X]` is equivalent to `sort!(X)`.\n\n#### Parameters\n\n**X** is a vector or a tuple of vectors of the same length.\n\n**ascending** is a Boolean scalar or vector indicating whether to sort *X* (or vectors of *X* sequentially) in ascending order or descending order. The default value is true (ascending order).\n\n#### Returns\n\nReturns an integer vector indicating the indices of each element in the original vector after sorting.\n\n#### Examples\n\n```\nx = 4 1 3 2;\ny = isort(x);\ny;\n// output: [1,3,2,0]\n// for the sorted x: [1 2 3 4], the first element 1 is from position 1 of the original x, the second element 2 is from position 3 of the original x, ... etc.\nx[y];\n// output: [1,2,3,4]\n// equivalent to sort!(x)\n\nz=isort(x, false);\nz;\n// output: [0,2,3,1]\n\nx[z];\n// output: [4,3,2,1]\n\nx=2 2 1 1\ny=2 1 1 2\nisort([x,y]);\n// output: [2,3,1,0]\nisort([x,y],[0,0]);\n\n// output: [0,1,3,2]\n```\n\nSort a table based on one of its columns:\n\n```\nt2 = table(4 2 3 1 as x, 9 6 7 3 as y);\nt2;\n```\n\n| x | y |\n| - | - |\n| 4 | 9 |\n| 2 | 6 |\n| 3 | 7 |\n| 1 | 3 |\n\n```\nt2[isort(t2.x)];\n```\n\n| x | y |\n| - | - |\n| 1 | 3 |\n| 2 | 6 |\n| 3 | 7 |\n| 4 | 9 |\n\n```\nt2[isort(t2.x, false)];\n```\n\n| x | y |\n| - | - |\n| 4 | 9 |\n| 3 | 7 |\n| 2 | 6 |\n| 1 | 3 |\n\nSort a table based on multiple columns:\n\n```\na=5 5 5 3 3 8 7 7;\nb=`MSFT`GOOG`IBM`YHOO`X`YHOO`C`ORCL;\nt=table(a,b);\nt;\n```\n\n| a | b    |\n| - | ---- |\n| 5 | MSFT |\n| 5 | GOOG |\n| 5 | IBM  |\n| 3 | YHOO |\n| 3 | X    |\n| 8 | YHOO |\n| 7 | C    |\n| 7 | ORCL |\n\n```\nt[isort([a,b], false true)];\n// first sort descending on a, then sort ascending on b\n```\n\n| a | b    |\n| - | ---- |\n| 8 | YHOO |\n| 7 | C    |\n| 7 | ORCL |\n| 5 | GOOG |\n| 5 | IBM  |\n| 5 | MSFT |\n| 3 | X    |\n| 3 | YHOO |\n\n```\nt[isort([a,b], false)];\n// equivalent to t[isort([a,b], false false)];\n```\n\n| a | b    |\n| - | ---- |\n| 8 | YHOO |\n| 7 | ORCL |\n| 7 | C    |\n| 5 | MSFT |\n| 5 | IBM  |\n| 5 | GOOG |\n| 3 | YHOO |\n| 3 | X    |\n"
    },
    "isortTop": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isortTop.html",
        "signatures": [
            {
                "full": "isortTop(X, top, [ascending=true])",
                "name": "isortTop",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [isortTop](https://docs.dolphindb.com/en/Functions/i/isortTop.html)\n\n\n\n#### Syntax\n\nisortTop(X, top, \\[ascending=true])\n\n#### Details\n\nReturn the first few elements of the result of `isort(X, [ascending])`.\n\n#### Parameters\n\n**X** is a vector or a tuple of vectors of the same length.\n\n**top** is a positive integer no more than the size of a vector in *X*.\n\n**ascending** is a Boolean scalar or vector indicating whether to sort *X* (or vectors of *X* sequentially) in ascending order or descending order. The default value is true (ascending order).\n\n#### Returns\n\nReturns an INT vector.\n\n#### Examples\n\n```\nisortTop(2 1 4 3 6 5, 3);\n// output: [1,0,3]\n\nisortTop(2 1 4 3 6 5, 3, false);\n// output: [4,5,2]\n```\n\nThe following example first sorts m in descending order. For the identical elements in m, sort them based on descending n values at the corresponding positions. Return the original indices of the first three elements of sorted m.\n\n```\nm=1 1 2 2 3 3\nn=1 2 1 2 1 2\nisortTop([m,n], 3, [false, false]);\n// output: [5,4,3]\n```\n"
    },
    "isPeak": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isPeak.html",
        "signatures": [
            {
                "full": "isPeak(X, [strict=true])",
                "name": "isPeak",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[strict=true]",
                        "name": "strict",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [isPeak](https://docs.dolphindb.com/en/Functions/i/isPeak.html)\n\n\n\n#### Syntax\n\nisPeak(X, \\[strict=true])\n\n#### Details\n\nIf *X* is a vector, check if each element in *X* is the peak.\n\nIf *X* is a matrix, perform the aforementioned calculations on each column and return a matrix of the same size as *X*.\n\nIf *X* is a table, only the numeric columns are involved in the calculations.\n\n#### Parameters\n\n**X** is a numeric vector/matrix/table.\n\n**strict** is a Boolean value. For a segment of continuous identical numbers forming a local maximum (referred to as a plateau), the value of *strict*determines whether the entire plateau is considered a peak.\n\n* When *strict* = true, the plateau is not considered a peak, meaning all elements in the plateau return false.\n\n* When *strict*= false,\n\n  * If the number of elements in plateau is odd, the element at the middle will return true, while the others return false.\n\n  * If even, the element on the left side of the two middle elements will return true, while the others return false.\n\n#### Returns\n\n* When *X* is a vector, it returns a Boolean vector.\n* When *X* is a matrix, it returns a Boolean matrix.\n* When *X* is a table, it returns a table.\n\n#### Examples\n\n```\nv = [1, 2.2, 2.2, 2.2, 2.3, 1, 1.2]\nisPeak(v)\n// output: [false,false,false,false,true,false,false]\n\nv = [1, 2.2, 2.2, 2.2, 1.6, 1, 1.2]\nisPeak(v)\n// output: [false,false,false,false,false,false,false]\n\nisPeak(v, false)\n// output: [false,false,true,false,false,false,false]\n\n// Perform the calculations on each column in a matrix\nm = matrix(3.3 2.8 5.6 NULL 2.5 1.2, 4.5 3.5 4.6 2.8 3.9 NULL)\nisPeak(m)\n```\n\n| #0    | #1    |\n| ----- | ----- |\n| false | false |\n| false | false |\n| false | true  |\n| false | false |\n| false | false |\n| false | false |\n\n```\n// Perform the calculations on the numeric columns in a table\nt = table(`01`01`00`01`02`00 as id, 2022.01.01 + 1..6 as date, 388.3 390.6 390.8 390.6 390.3 391.5 as price)\nisPeak(t)\n```\n\n| id | date  | price |\n| -- | ----- | ----- |\n| 01 | false | false |\n| 01 | false | false |\n| 00 | false | true  |\n| 01 | false | false |\n| 02 | false | false |\n| 00 | false | false |\n\nRelated function: [isValley](https://docs.dolphindb.com/en/Functions/i/isValley.html)\n"
    },
    "isQuarterEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isQuarterEnd.html",
        "signatures": [
            {
                "full": "isQuarterEnd(X)",
                "name": "isQuarterEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isQuarterEnd](https://docs.dolphindb.com/en/Functions/i/isQuarterEnd.html)\n\n\n\n#### Syntax\n\nisQuarterEnd(X)\n\n#### Details\n\nDetermine if each element in *X* is the last day of a quarter.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\nisQuarterEnd(2012.06.30);\n// output: true\n\nisQuarterEnd([2012.06.30,2012.07.01]);\n// output: [true,false]\n```\n\nRelated function: [isQuarterStart](https://docs.dolphindb.com/en/Functions/i/isQuarterStart.html)\n"
    },
    "isQuarterStart": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isQuarterStart.html",
        "signatures": [
            {
                "full": "isQuarterStart(X)",
                "name": "isQuarterStart",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isQuarterStart](https://docs.dolphindb.com/en/Functions/i/isQuarterStart.html)\n\n\n\n#### Syntax\n\nisQuarterStart(X)\n\n#### Details\n\nDetermine if each element in *X* is the first day of a quarter.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nReturns a Boolean scalar or vector.\n\n#### Examples\n\n```\nisQuarterStart(2012.04.01);\n// output: true\n\nisQuarterStart([2012.04.01,2012.05.01]);\n// output: [true,false]\n```\n\nRelated function: [isQuarterEnd](https://docs.dolphindb.com/en/Functions/i/isQuarterEnd.html)\n"
    },
    "isSorted": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isSorted.html",
        "signatures": [
            {
                "full": "isSorted(X, [ascending=true])",
                "name": "isSorted",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [isSorted](https://docs.dolphindb.com/en/Functions/i/isSorted.html)\n\n\n\n#### Syntax\n\nisSorted(X, \\[ascending=true])\n\n#### Details\n\nCheck whether a vector is sorted or not.\n\n#### Parameters\n\n**X** is a vector.\n\n**ascending** is a Boolean indicating whether *X* is sorted in ascending order(true) or descending order(false). The default value is true.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\nx=NULL 1 2 3\nisSorted(x);\n// output: true\n\nt=table(9 7 5 3 as x, 1 5 2 4 as y)\nt.x.isSorted(false);\n// output: true\n\nt.y.isSorted();\n// output: false\n```\n"
    },
    "isSpace": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isSpace.html",
        "signatures": [
            {
                "full": "isSpace(X)",
                "name": "isSpace",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isSpace](https://docs.dolphindb.com/en/Functions/i/isSpace.html)\n\n\n\n#### Syntax\n\nisSpace(X)\n\n#### Details\n\nCheck whether the string *X* consists of only space. Return \"true\" if all characters in *X* are space, \"\\t\" (tab), \"\\r\" (carriage return) or \"\\n\" (newline escape).\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\n* When *X* is a scalar, it returns a Boolean scalar.\n* When *X* is a vector, it returns a Boolean vector.\n* When *X* is a table, it returns a table.\n\n#### Examples\n\n```\nisSpace(\"hello world\");\n// output: false\n\nisSpace(\" \\t \");\n// output: true\n\nisSpace(string());\n// output: false\n```\n"
    },
    "isTitle": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isTitle.html",
        "signatures": [
            {
                "full": "isTitle(X)",
                "name": "isTitle",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isTitle](https://docs.dolphindb.com/en/Functions/i/isTitle.html)\n\n\n\n#### Syntax\n\nisTitle(X)\n\n#### Details\n\nCheck if *X* is a titlecased string, which has the first character in each word uppercase and the remaining all characters lowercase alphabets.\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\nA Boolean scalar or vector.\n\n#### Examples\n\n```\nisTitle(\"Hello World\");\n// output: true\n\nisTitle(\"Hello world\");\n// output: false\n\nisTitle([\"Hello\",\"468\",\"  \"]);\n// output: [true,false,false]\n\nisTitle(\"1And1\");\n// output: true\n```\n\nRelated functions: [isLower](https://docs.dolphindb.com/en/Functions/i/isLower.html), [isUpper](https://docs.dolphindb.com/en/Functions/i/isUpper.html)\n"
    },
    "isTransferCompressionToComputeNodeEnabled": {
        "url": "https://docs.dolphindb.com/en/Functions/i/istransfercompressiontocomputenodeenabled.html",
        "signatures": [
            {
                "full": "isTransferCompressionToComputeNodeEnabled()",
                "name": "isTransferCompressionToComputeNodeEnabled",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [isTransferCompressionToComputeNodeEnabled](https://docs.dolphindb.com/en/Functions/i/istransfercompressiontocomputenodeenabled.html)\n\n\n\n#### Syntax\n\nisTransferCompressionToComputeNodeEnabled()\n\n#### Details\n\nChecks whether compression is enabled for data transfer from the data node to the compute node.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nA boolean value.\n\n* true: compression is enabled.\n* false: compression is disabled.\n\n#### Examples\n\n```\nisTransferCompressionToComputeNodeEnabled()\n\n// Output：true\n```\n\n**Related Function:** [enableTransferCompressionToComputeNode](https://docs.dolphindb.com/en/Functions/e/enabletransfercompressiontocomputenode.html)\n"
    },
    "isUpper": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isUpper.html",
        "signatures": [
            {
                "full": "isUpper(X)",
                "name": "isUpper",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isUpper](https://docs.dolphindb.com/en/Functions/i/isUpper.html)\n\n\n\n#### Syntax\n\nisUpper(X)\n\n#### Details\n\nCheck whether all the case-based characters (letters) of the string are uppercase.\n\n#### Parameters\n\n**X** is a STRING scalar or vector.\n\n#### Returns\n\nA Boolean scalar or vector.\n\n#### Examples\n\n```\nisUpper(\"THIS IS STRING EXAMPLE....WOW!!!\");\n// output: true\n\nisUpper(\"THIS is string example....wow!!!\");\n// output: false\n\nisUpper(\"123456ABC\");\n// output: true\n\nisUpper(\"123\");\n// output: false\n\nisUpper([\"  \",string()]);\n// output: [false,false]\n```\n\nRelated functions: [isLower](https://docs.dolphindb.com/en/Functions/i/isLower.html), [isTitle](https://docs.dolphindb.com/en/Functions/i/isTitle.html)\n"
    },
    "isValid": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isValid.html",
        "signatures": [
            {
                "full": "isValid(X)",
                "name": "isValid",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isValid](https://docs.dolphindb.com/en/Functions/i/isValid.html)\n\n\n\n#### Syntax\n\nisValid(X)\n\n#### Details\n\nDetermine if each element of X is null. Return true if at least one element is not null and false otherwise.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA Boolean scalar, pair, vector or matrix.\n\n#### Examples\n\n```\nisValid(00i);\n// output: false\n\nisValid(1 NULL NULL 6 NULL 7);\n// output: [true,false,false,true,false,true]\n\nisValid(1/0);\n// output: false\n```\n"
    },
    "isValley": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isValley.html",
        "signatures": [
            {
                "full": "isValley(X, [strict=true])",
                "name": "isValley",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[strict=true]",
                        "name": "strict",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [isValley](https://docs.dolphindb.com/en/Functions/i/isValley.html)\n\n\n\n#### Syntax\n\nisValley(X, \\[strict=true])\n\n#### Details\n\nIf *X* is a vector, check if each element in *X* is the valley.\n\nIf *X* is a matrix, perform the aforementioned calculations on each column and return a matrix of the same size as *X*.\n\nIf *X* is a table, only the numeric columns are involved in the calculations.\n\n#### Parameters\n\n**X** is a numeric vector/matrix/table.\n\n**strict** is a Boolean value. For a segment of continuous identical numbers forming a local maximum (referred to as a plateau), the value of *strict*determines whether the entire plateau is considered a valley.\n\n* When *strict*= true, the plateau is not considered a valley, meaning all elements in the plateau return false.\n\n* When *strict*= false,\n\n  * If the number of elements in plateau is odd, the element at the middle will return true, while the others return false.\n\n  * If even, the element on the left side of the two middle elements will return true, while the others return false.\n\n#### Returns\n\n* When *X* is a vector, it returns a Boolean vector.\n* When *X* is a matrix, it returns a Boolean matrix.\n* When *X* is a table, it returns a table.\n\n#### Examples\n\n```\nv = [3.1, 2.2, 2.2, 2.2, 1.3, 2.1, 1.2]\nisValley(v)\n// output: [false,false,false,false,true,false,false]\n\nv = [3.1, 2.2, 2.2, 2.2, 2.6, 1, 1.2]\nisValley(v)\n// output: [false,false,false,false,false,true,false]\n\nisValley(v, false)\n// output: [false,false,true,false,false,true,false]\n\n// Perform the calculations on each column in a matrix\nm = matrix(5.3 5.8 5.6 NULL 5.7 1.2, 4.5 3.5 4.6 2.8 3.9 NULL)\nisValley(m)\n```\n\n| #0    | #1    |\n| ----- | ----- |\n| false | false |\n| false | true  |\n| false | false |\n| false | true  |\n| false | false |\n| false | false |\n\n```\n// Perform the calculations on the numeric columns in a table\nt = table(`01`01`00`01`02`00 as id, 2022.01.01 + 1..6 as date, 388.3 390.6 390.8 390.6 390.3 391.5 as price)\nisValley(t)\n```\n\n| id | date  | price |\n| -- | ----- | ----- |\n| 01 | false | false |\n| 01 | false | false |\n| 00 | false | false |\n| 01 | false | false |\n| 02 | false | true  |\n| 00 | false | false |\n\nRelated function: [isPeak](https://docs.dolphindb.com/en/Functions/i/isPeak.html)\n"
    },
    "isVoid": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isVoid.html",
        "signatures": [
            {
                "full": "isVoid(X)",
                "name": "isVoid",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isVoid](https://docs.dolphindb.com/en/Functions/i/isVoid.html)\n\n\n\n#### Syntax\n\nisVoid(X)\n\n#### Details\n\nCheck if an object is VOID type. There are two types of objects with VOID type: NULL object and Nothing object. Please see [isNothing](https://docs.dolphindb.com/en/Functions/i/isNothing.html).\n\n#### Parameters\n\n**X** can be of any data form.\n\n#### Returns\n\nA Boolean value with the same form as *X*.\n\n#### Examples\n\n```\nisVoid(NULL);\n// output: true\n\nisVoid(1 NULL 2);\n// output: false\n\n// compare with function isNull\nisNull(1 NULL 2);\n// output: [false,true,false]\n```\n"
    },
    "isYearEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isYearEnd.html",
        "signatures": [
            {
                "full": "isYearEnd(X)",
                "name": "isYearEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isYearEnd](https://docs.dolphindb.com/en/Functions/i/isYearEnd.html)\n\n\n\n#### Syntax\n\nisYearEnd(X)\n\n#### Details\n\nDetermine if each element in *X* is the last day of a year.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nA Boolean scalar or vector.\n\n#### Examples\n\n```\nisYearEnd(2012.12.31);\n// output: true\n\nisYearEnd([2012.12.30,2012.12.31]);\n// output: [false,true]\n```\n\nRelated function: [isYearStart](https://docs.dolphindb.com/en/Functions/i/isYearStart.html)\n"
    },
    "isYearStart": {
        "url": "https://docs.dolphindb.com/en/Functions/i/isYearStart.html",
        "signatures": [
            {
                "full": "isYearStart(X)",
                "name": "isYearStart",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [isYearStart](https://docs.dolphindb.com/en/Functions/i/isYearStart.html)\n\n\n\n#### Syntax\n\nisYearStart(X)\n\n#### Details\n\nDetermine if each element in *X* is the first day of a year.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nA Boolean scalar or vector.\n\n#### Examples\n\n```\nisYearStart(2012.01.01);\n// output: true\n\nisYearStart([2012.01.01,2012.02.01]);\n// output: [true,false]\n```\n\nRelated function: [isYearEnd](https://docs.dolphindb.com/en/Functions/i/isYearEnd.html)\n"
    },
    "iterate": {
        "url": "https://docs.dolphindb.com/en/Functions/i/iterate.html",
        "signatures": [
            {
                "full": "iterate(init, coeffs, input)",
                "name": "iterate",
                "parameters": [
                    {
                        "full": "init",
                        "name": "init"
                    },
                    {
                        "full": "coeffs",
                        "name": "coeffs"
                    },
                    {
                        "full": "input",
                        "name": "input"
                    }
                ]
            }
        ],
        "markdown": "### [iterate](https://docs.dolphindb.com/en/Functions/i/iterate.html)\n\n\n\n#### Syntax\n\niterate(init, coeffs, input)\n\n#### Details\n\nIf *init*, *coeffs* and *input* are all scalars, return a geometric sequence \\[*init\\*coeffs, init\\*coeffs^2, init\\*coeffs^3*, …]. The length of the sequence is *input*.\n\nIf *init* and *coeffs* are scalars and *input* is a vector, return an array x with x\\[0]=`init*coeffs` + *input\\[0]* and x\\[n]=x\\[n-1]\\* *coeffs* + *input\\[n]*.\n\nIf *init* and *coeffs* are vectors and *input* is a scalar, return an array x with x\\[n]=y(n)\\*\\* *coeffs*, y(n)=y(n-1)\\[1:].append!(x\\[n-1]), y(0)= *init*. The length of x is *input*. \\*\\* returns the inner product of 2 vectors.\n\nIf *init*, *coeffs* and *input* are all vectors, return an array x with x\\[n]=y(n)\\*\\* *coeffs* + *input\\[n]*, y(n)=y(n-1)\\[1:].append!(x\\[n-1]), y(0)= *init*. The length of x is *input*. \\*\\* returns the inner product of 2 vectors.\n\n#### Parameters\n\n**init** a scalar or a vector.\n\n**coeffs** a scalar or a vector. init and coeffs have the same length.\n\n**input** a scalar or a vector. If *input* is a scalar, it must be an integer and it means the number of iterations; if *input* is a vector, its length means the number of iterations and each element of *input* is added to the result of the corresponding iteration.\n\n#### Returns\n\nA DOUBLE vector.\n\n#### Examples\n\n```\niterate(1, 0.8, 3);\n// output: [0.8,0.64,0.512]\n// 1*0.8=0.8, 0.8*0.8=0.64, 0.64*0.8=0.512\n\niterate(1, 0.8, 0.1 0.2 0.3);\n// output: [0.9,0.92,1.036]\n// 1*0.8+0.1=0.9, 0.9*0.8+0.2=0.92, 0.92*0.8+0.3=1.036\n\niterate(1 1, 1 1, 10);\n// output: [2,3,5,8,13,21,34,55,89,144]\n// this is the Fibonacci series: 1*1 + 1*1=2; 1*1+2*1=3; 2*1+3*1=5; 3*1+5*1=8; ... ; 55*1+89*1=144.\n\niterate(1 1, 1 1, 1 2 3 4 5);\n// output: [3,6,12,22,39]\n// 1*1+1*1+1=3; 1*1+3*1+2=6; 3*1+6*1+3=12; 6*1+12*1+4=22; 12*1+22*1+5=39.\n```\n"
    },
    "kama": {
        "url": "https://docs.dolphindb.com/en/Functions/k/kama.html",
        "signatures": [
            {
                "full": "kama(X, window)",
                "name": "kama",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [kama](https://docs.dolphindb.com/en/Functions/k/kama.html)\n\n\n\n#### Syntax\n\nkama(X, window)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Kaufman Adaptive Moving Average for *X* with a rolling *window*. The length of the window is given by the parameter *window*. The result is of the same length as *X*. The first (*window*-1) elements of the result are null values.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nx=[51.65, 81.18, 43.37, 11.26, 82.79, 13.4, 81.87, 63.53, 21.28, 94.23]\nkama(x, 5);\n// output: [,,,,,81.006144,81.009907,80.793626,80.344572,80.456788]\n\nt=table(take(`A`B,10) as sym, rand(100.0,10) as close)\nselect sym, kama(close, 3) as kama from t context by sym;\n```\n\n| sym | kama      |\n| --- | --------- |\n| A   |           |\n| A   |           |\n| A   |           |\n| A   | 66.342572 |\n| A   | 62.500023 |\n| B   |           |\n| B   |           |\n| B   |           |\n| B   | 17.376469 |\n| B   | 42.27882  |\n"
    },
    "kendall": {
        "url": "https://docs.dolphindb.com/en/Functions/k/kendall.html",
        "signatures": [
            {
                "full": "kendall(X, Y)",
                "name": "kendall",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [kendall](https://docs.dolphindb.com/en/Functions/k/kendall.html)\n\n\n\n#### Syntax\n\nkendall(X, Y)\n\n#### Details\n\nCalculate the [Kendall rank correlation coefficient](https://en.wikipedia.org/wiki/Kendall_rank_correlation_coefficient) between *X* and *Y*. Null values are ignored in the calculation.\n\nIf *X* or *Y* is a matrix, perform the aforementioned calculation on each column and return a vector.\n\nIf *X* or *Y* is an in-memory table, perform the aforementioned calculation on each numeric column of the table and return a table (where null values are returned for non-numeric columns).\n\n#### Parameters\n\n**X** is a scalar, vector, matrix or in-memory table.\n\n**Y** is a scalar, vector, matrix or in-memory table.\n\n#### Returns\n\nA DOUBLE scalar/vector/table.\n\n#### Examples\n\n```\nx = [33,21,46,-11,78,47,18,20,-5,66]\ny = [1,NULL,10,6,10,3,NULL,NULL,5,3]\nkendall(x, y)\n// output: 0.05\n```\n\nIf *X* is a matrix, *Y* can be a vector of the same length as the number of rows in *X*, or a matrix of the same dimension as *X*. The result is a vector of the same length as the number of columns in *X*.\n\n```\nm=1..20$10:2\nkendall(x,m)\n// output: [-0.0222,-0.0222]\n\nn=rand(20,20)$10:2\nkendall(m,n)\n// output: [0.3865,-0.1591]\n```\n\nIf *X* is a table, *Y* can be a vector of the same length as the number of rows in *X*, or a table of the same dimension as *X*. The result is a vector of the same length as the number of columns in *X*.\n\n```\nt=table(2..11 as id, \"a\"+string(2..11) as name)\nkendall(t,x)\n/* output:\nid\t     name\n-0.0222\n*/\t\n\nt1=table(x as col1, y as col2)\nkendall(t,t1)\n/* output:\nid\t     name\n-0.0222\n*/\n```\n"
    },
    "kernelRidge": {
        "url": "https://docs.dolphindb.com/en/Functions/k/kernelRidge.html",
        "signatures": [
            {
                "full": "kernelRidge(ds, yColName, xColNames, [alpha=1.0], [kernel='linear'], [gamma=0], [degree=3], [coef0=1], [swColName])",
                "name": "kernelRidge",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[alpha=1.0]",
                        "name": "alpha",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[kernel='linear']",
                        "name": "kernel",
                        "optional": true,
                        "default": "'linear'"
                    },
                    {
                        "full": "[gamma=0]",
                        "name": "gamma",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[degree=3]",
                        "name": "degree",
                        "optional": true,
                        "default": "3"
                    },
                    {
                        "full": "[coef0=1]",
                        "name": "coef0",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [kernelRidge](https://docs.dolphindb.com/en/Functions/k/kernelRidge.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nkernelRidge(ds, yColName, xColNames, \\[alpha=1.0], \\[kernel='linear'], \\[gamma=0], \\[degree=3], \\[coef0=1], \\[swColName])\n\n#### Details\n\nThis function combines ridge regression regularization with the kernel trick to model complex nonlinear relationships in the data and outputs a regression prediction model.\n\nThe objective function is:\n\n![](https://docs.dolphindb.com/en/Functions/images/kernelRidge.png)\n\n#### Parameters\n\n**ds**is an in-memory table or a data source usually generated by the [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html) function.\n\n**yColName**is a string indicating the column name of the dependent variable in *ds*, corresponding to`y`in the objective function.\n\n**xColNames**is a string scalar/vector indicating the column names of the independent variables in *ds*, corresponding to `X` in the objective function.\n\n**alpha**(optional) is a positive floating-point number indicating the regularization strength, corresponding to `alpha` in the objective function. The default value is 1.0.\n\n**kernel**(optional) is a string indicating the kernel, corresponding to `Φ` in the objective function. It can take one of the following values:\n\n* 'linear' (default): the linear kernel `<x, y>`\n* 'rbf': the RBF (Gaussian) kernel `exp(-gamma * ||x - y||²)`\n* 'poly'/'polynomial': the polynomial kernel `(gamma * <x, y> + coef0)^degree`\n* 'sigmoid': the sigmoid kernel `tanh(gamma * <x, y> + coef0)`\n* 'laplacian': the laplacian kernel `exp(-gamma * ||x - y||₁)`\n* 'cosine': the cosine similarity kernel `<x, y> / (||x|| * ||y||)`\n* 'additive\\_chi2': the additive chi-squared kernel `-∑[(x - y)² / (x + y)]`\n* 'chi2': the chi-squared kernel `exp(-gamma * ∑[(x - y)² / (x + y)])`\n\n**gamma**(optional) is a numeric scalar indicating the gamma parameter for kernels. The default value is 0, indicating that gamma will be automatically determined based on the number of features.\n\n**degree**(optional) is a numeric scalar indicating the degree of the polynomial kernel.\n\n**coef0**(optional) is a numeric scalar indicating the zero coefficient for kernels.\n\n**swColName**(optional) is a string indicating a column name in *ds* as the sample weight. If it is not specified, the sample weight is treated as 1.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* modelName: A string indicating the model name, which is ‘kernelRidge’.\n* coefficients: A numeric vector indicating the parameters, corresponding to the `w` in the objective function.\n* xFit: A numeric matrix indicating the independent variables.\n* predict: The prediction function of the model.\n* The other keys, including xColNames, alpha, kernel, gamma, degree and coef0, correspond to the arguments with the same names.\n\n#### Examples\n\n```\nx1 = [-1.5, 2.3, 4.2, 1.6];\nx2 = [-2.2, 3.9, 2.8, 0.5];\nsw = [2, 5, 8, 1];\ny = [0.0, 0.9, 3.2, 3.1];\nt = table(y, x1, x2, sw);\n\nm = kernelRidge(t, `y, `x1`x2, 1, 'laplacian', 0, 3, 1, `sw);\nm\n/*\nmodelName->kernelRidge\ncoefficients->#0                \n------------------\n-0.061436450468451\n0.09192514209272  \n2.716894143137368 \n1.428547958639275 \n\nxColNames->[\"x1\",\"x2\"]\nxFit->#0                #1  \n----------------- ----\n-1.5              -2.2\n2.3               3.9 \n4.200000000000001 2.8 \n1.6               0.5 \n\nalpha->1\nkernel->laplacian\ngamma->0.5\ndegree->3\ncoef0->1\npredict->kernelRidgePredict\n*/\n\n\n\nx1 = [-1.2, 4.6, 2.4];\nx2 = [-1.0, 2.8, -4.7];\nt_test = table(x1, x2);\npredict(m, t_test);\n/*\n#0               \n-----------------\n0.166070925673076\n2.34188781136904 \n0.095783250622374\n*/\n\n```\n"
    },
    "keyedStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html",
        "signatures": [
            {
                "full": "keyedStreamTable(keyColumn, X, [X1], [X2], .....)",
                "name": "keyedStreamTable",
                "parameters": [
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "keyedStreamTable(keyColumn, capacity:size, colNames, colTypes)",
                "name": "keyedStreamTable",
                "parameters": [
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            }
        ],
        "markdown": "### [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html)\n\n\n\n#### Syntax\n\nkeyedStreamTable(keyColumn, X, \\[X1], \\[X2], .....)\n\nor\n\nkeyedStreamTable(keyColumn, capacity:size, colNames, colTypes)\n\n#### Details\n\nThis function creates a stream table with one or more columns serving as the primary key. It implements idempotent writes to prevent duplicate primary key insertions due to network issues or high-availability writes.\n\nWhen new records are inserted into a keyed stream table, the system checks the values of primary key.\n\n* If the primary key of a new record is identical to an existing one in memory, the new record is not inserted, and the existing record remains unchanged.\n* If multiple new records with the same primary key (different from those in memory) are written simultaneously, only the first record is successfully inserted.\n\nNote: The uniqueness of the primary key is limited to data in memory. If persistence is enabled for the keyed stream table, a limited number of records are stored in memory, with older data being persisted to disk. The primary key of incoming data could potentially duplicate those on disk.\n\n#### Parameters\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n  * false for Boolean type;\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n  * Null value for Literal, INT128 types.\n\n* **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a string vector of data types. The non-key columns can be specified as an array vector type or ANY type.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n*Example 1*\n\n```\nid=`A`B`C`D`E\nx=1 2 3 4 5\nt1=keyedStreamTable(`id, id, x)\nt1;\n```\n\n| id | x |\n| -- | - |\n| A  | 1 |\n| B  | 2 |\n| C  | 3 |\n| D  | 4 |\n| E  | 5 |\n\n*Example 2*\n\n```\nt2=keyedStreamTable(`id,100:0,`id`x, [INT,INT])\ninsert into t2 values(1 2 3,10 20 30);\nt2;\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 10 |\n| 2  | 20 |\n| 3  | 30 |\n\nIf we try to insert a new row with duplicate primary key value as one of the existing rows, the new row will not be inserted:\n\n```\ninsert into t2 values(3 4 5,35 45 55)\nt2;\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 10 |\n| 2  | 20 |\n| 3  | 30 |\n| 4  | 45 |\n| 5  | 55 |\n\nthe record with id=3 has not been overwritten.\n\nThere are multiple columns in the primary key:\n\n```\nt=keyedStreamTable(`sym`id,1:0,`sym`id`val,[SYMBOL,INT,DOUBLE])\ninsert into t values(`A`B`C`D`E,5 4 3 2 1,52.1 64.2 25.5 48.8 71.9);\ninsert into t values(`A`B`R`T`Y,5 8 3 2 1,152.3 164.6 125.5 148.8 171.6);\nt;\n```\n\n| sym | id | val   |\n| --- | -- | ----- |\n| A   | 5  | 52.1  |\n| B   | 4  | 64.2  |\n| C   | 3  | 25.5  |\n| D   | 2  | 48.8  |\n| E   | 1  | 71.9  |\n| B   | 8  | 164.6 |\n| R   | 3  | 125.5 |\n| T   | 2  | 148.8 |\n| Y   | 1  | 171.6 |\n"
    },
    "keyedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/k/keyedTable.html",
        "signatures": [
            {
                "full": "keyedTable(keyColumns, X, [X1], [X2], .....)",
                "name": "keyedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "keyedTable(keyColumns, capacity:size, colNames, colTypes)",
                "name": "keyedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            },
            {
                "full": "keyedTable(keyColumns, table)",
                "name": "keyedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [keyedTable](https://docs.dolphindb.com/en/Functions/k/keyedTable.html)\n\n\n\n#### Syntax\n\nkeyedTable(keyColumns, X, \\[X1], \\[X2], .....)\n\nor\n\nkeyedTable(keyColumns, capacity:size, colNames, colTypes)\n\nor\n\nkeyedTable(keyColumns, table)\n\n#### Details\n\nCreate an keyed table, which is a special type of in-memory table with primary key. The primary key can be one column or multiple columns. The keyed table is implemented based on a hash table, storing the combined value of the primary key fields as a key entry, with each key entry corresponding to a record in the table. During queries, by specifying all fields of the primary key, data can be located through the index without performing a full table scan. It is recommended to use [sliceByKey](https://docs.dolphindb.com/en/Functions/s/sliceByKey.html) to improve query performance.\n\nWhen adding new records to the table, if the primary key of the new record duplicates an existing record, the system updates the record in the table; otherwise, the new record is added to the table.\n\nKeyed tables exhibit better performance for single-record updates and queries, making them an ideal choice for data caching. Keyed tables can also serve as output tables for time series engines for real time updates.\n\n**Note:** This function does not support creating a keyed table containing array vector columns.\n\nThe following compares the query optimization techniques for indexed and keyed tables.\n\nFor indexed tables:\n\n* The first column of *keyColumns* must be queried, and filter conditions for this column can only use `=`, `in`, or `and`.\n* Columns other than the first column of *keyColumns* can use range queries through `between`, comparison operators, etc., with higher query efficiency than using the `in` predicate.\n* The number of distinct columns filtered with `in` should not exceed 2.\n\nFor keyed tables:\n\n* All *keyColumns* must be queried. For such queries, key tables show better performance than indexed tables.\n* Filter conditions can only use `=`, `in`, or `and`.\n* The number of distinct columns filtered with `in` should not exceed 2.\n\nPlease refer to the optimized SQL query in [indexedTable](https://docs.dolphindb.com/en/Functions/i/indexedTable.html).\n\n#### Parameters\n\n**keyColumn** is a string scalar or vector indicating the name(s) of the primary key column(s). The column type must be INTEGRAL, TEMPORAL or LITERAL.\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n  * false for Boolean type;\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n  * Null value for Literal, INT128 types.\n\n* **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a string vector of data types. The non-key columns can be specified as an array vector type or ANY type.\n\nFor the third scenario, **table** is a table. Please note that *keyColumns* in *table* cannot have duplicate values.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n*Example 1. Create a keyed table.*\n\nThe first scenario:\n\n```\nsym=`A`B`C`D`E\nid=5 4 3 2 1\nval=52 64 25 48 71\nt=keyedTable(`sym`id,sym,id,val)\nt;\n```\n\n| id | x | val |\n| -- | - | --- |\n| A  | 5 | 52  |\n| B  | 4 | 64  |\n| C  | 3 | 25  |\n| D  | 2 | 48  |\n| E  | 1 | 71  |\n\nThe second scenario:\n\n```\nt=keyedTable(`sym`id,1:0,`sym`id`val,[SYMBOL,INT,INT])\ninsert into t values(`A`B`C`D`E,5 4 3 2 1,52 64 25 48 71);\n```\n\nThe third scenario:\n\n```\ntmp=table(sym, id, val)\nt=keyedTable(`sym`id, tmp);\n```\n\nCreate a keyed in-memory partitioned table:\n\n```\nsym=`A`B`C`D`E\nid=5 4 3 2 1\nval=52 64 25 48 71\nt=keyedTable(`sym`id,sym,id,val)\ndb=database(\"\",VALUE,sym)\npt=db.createPartitionedTable(t,`pt,`sym).append!(t);\n```\n\n*Example 2. Update a keyed table.*\n\n```\nt=keyedTable(`sym,1:0,`sym`datetime`price`qty,[SYMBOL,DATETIME,DOUBLE,DOUBLE])\ninsert into t values(`APPL`IBM`GOOG,2018.06.08T12:30:00 2018.06.08T12:30:00 2018.06.08T12:30:00,50.3 45.6 58.0,5200 4800 7800)\nt;\n```\n\n| sym  | datetime            | price | qty  |\n| ---- | ------------------- | ----- | ---- |\n| APPL | 2018.06.08T12:30:00 | 50.3  | 5200 |\n| IBM  | 2018.06.08T12:30:00 | 45.6  | 4800 |\n| GOOG | 2018.06.08T12:30:00 | 58    | 7800 |\n\nInsert a new row with duplicate primary key value as an existing row. The existing row will be overwritten:\n\n```\ninsert into t values(`APPL`IBM`GOOG,2018.06.08T12:30:01 2018.06.08T12:30:01 2018.06.08T12:30:01,65.8 45.2 78.6,5800 8700 4600)\nt;\n```\n\n| sym  | datetime            | price | qty  |\n| ---- | ------------------- | ----- | ---- |\n| APPL | 2018.06.08T12:30:01 | 65.8  | 5800 |\n| IBM  | 2018.06.08T12:30:01 | 45.2  | 8700 |\n| GOOG | 2018.06.08T12:30:01 | 78.6  | 4600 |\n\nInsert new rows among which there are duplicate primary key values:\n\n```\ninsert into t values(`MSFT`MSFT,2018.06.08T12:30:01 2018.06.08T12:30:01,45.7 56.9,3600 4500)\nt;\n```\n\n| sym  | datetime            | price | qty  |\n| ---- | ------------------- | ----- | ---- |\n| APPL | 2018.06.08T12:30:01 | 65.8  | 5800 |\n| IBM  | 2018.06.08T12:30:01 | 45.2  | 8700 |\n| GOOG | 2018.06.08T12:30:01 | 78.6  | 4600 |\n| MSFT | 2018.06.08T12:30:01 | 56.9  | 4500 |\n\nThe primary key cannot be updated:\n\n```\nupdate t set sym=\"C_\"+sym;\n// Error: Can't update a key column.\n```\n\n*Example 3. Query on a keyed table.*\n\nIn some cases, queries on a keyed table are optimized. In this section we will compare the performance of queries on keyed tables and ordinary in-memory tables.\n\nFor the following examples, we first create a keyed table and an ordinary in-memory table with 1 million records each:\n\n```\nid=shuffle(1..1000000)\ndate=take(2012.06.01..2012.06.10, 1000000)\ntype=rand(9, 1000000)\nval=rand(100.0, 1000000)\nt=table(id, date, type, val)\nkt=keyedTable(`id`date`type, id, date, type, val);\n```\n\nExample 3.1\n\n```\ntimer(100) select * from t where id=500000, date=2012.06.01, type=0;\n// Time elapsed: 161.574 ms\n\ntimer(100) select * from kt where id=500000, date=2012.06.01, type=0;\n// Time elapsed: 1.483 ms\n\ntimer(100) sliceByKey(t1, (500000, 2012.06.01, 0))\n// Time elapsed: 0.705 ms\n```\n\nExample 3.2\n\n```\ntimer(100) select * from t where id in [1, 500000], date in 2012.06.01..2012.06.05, type=5;\n// Time elapsed: 894.241 ms\n\ntimer(100) select * from kt where id in [1, 500000], date in 2012.06.01..2012.06.05, type=5;\n// Time elapsed: 2.322 ms\n```\n\nWith more than 2 \"in\" operators in the filtering conditions, however, a query on a keyed table is not optimized.\n\nExample 3.3\n\n```\ntimer(100) select * from t where id in [1, 500000], date in 2012.06.01..2012.06.05, type in 1..5;\n// Time elapsed: 801.347 ms\n\ntimer(100) select * from kt where id in [1, 500000], date in 2012.06.01..2012.06.05, type in 1..5;\n// Time elapsed: 834.184 ms\n```\n\nIf the filtering conditions do not include all key columns, a query on a keyed table is not optimized.\n\nExample 3.4\n\n```\ntimer(100) select * from t where id=500000, date in 2012.06.01..2012.06.05;\n// Time elapsed: 177.113 ms\n\ntimer(100) select * from kt where id=500000, date in 2012.06.01..2012.06.05;\n// Time elapsed: 163.265 ms\n```\n\nExample 4. Use a keyed table with array vectors to record the 5 levels of quotes data.\n\n```\nsym=[\"a\",\"b\",\"c \"] \ntime=22:58:52.827 22:58:53.627 22:58:53.827 \nvolume=array(INT[]).append!([[100,110,120,115,125],[200,230,220,225,230],[320,300,310,315,310]])\nprice=array(DOUBLE[]).append!([[10.5,10.6,10.7,10.77,10.85],[8.6,8.7,8.76,8.83,8.9],[6.3,6.37,6.42,6.48,6.52]])\nt=keyedTable(`sym,sym,time,volume,price)\nt;\n```\n\n| sym | time         | volume                     | price                             |\n| --- | ------------ | -------------------------- | --------------------------------- |\n| a   | 22:58:52.827 | \\[100, 110, 120, 115, 125] | \\[10.5, 10.6, 10.7, 10.77, 10.85] |\n| b   | 22:58:53.627 | \\[200, 230, 220, 225, 230] | \\[8.6, 8.7, 8.76, 8.83, 8.9]      |\n| c   | 22:58:53.827 | \\[320, 300, 310, 315, 310] | \\[6.3, 6.37, 6.42, 6.48, 6.52]    |\n\n```\n// latest quote volume and price\nnewVolume=array(INT[]).append!([[130,110,110,115,120]])\nnewPrice= array(DOUBLE[]).append!([[10.55,10.57,10.62,10.68,10.5]])\n// update for stock a\nupdate t set volume=newVolume, price=newPrice where sym=\"a\"\nt;\n```\n\n| sym | time         | volume                     | price                               |\n| --- | ------------ | -------------------------- | ----------------------------------- |\n| a   | 22:58:52.827 | \\[130, 110, 110, 115, 120] | \\[10.55, 10.57, 10.62, 10.68, 10.5] |\n| b   | 22:58:53.627 | \\[200, 230, 220, 225, 230] | \\[8.6, 8.7, 8.76, 8.83, 8.9]        |\n| c   | 22:58:53.827 | \\[320, 300, 310, 315, 310] | \\[6.3, 6.37, 6.42, 6.48, 6.52]      |\n\nNote that when updating the array vector column, the number of elements in each column must be consistent with the original column. For example, if the vector of new record contains 4 elements, while the original contains 5 elements, an error is raised:\n\n```\nnewVolume=array(INT[]).append!([[130,110,110,120]])\nnewPrice= array(DOUBLE[]).append!([[10.55,10.57,10.62,10.5]])\n\nupdate t set volume=newVolume, price=newPrice where sym=\"a\"\n// error: Failed to update column: volume\n```\n\nRelated function: [indexedTable](https://docs.dolphindb.com/en/Functions/i/indexedTable.html)\n"
    },
    "keys": {
        "url": "https://docs.dolphindb.com/en/Functions/k/keys.html",
        "signatures": [
            {
                "full": "keys(X)",
                "name": "keys",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [keys](https://docs.dolphindb.com/en/Functions/k/keys.html)\n\n\n\n#### Syntax\n\nkeys(X)\n\n#### Details\n\nReturn the keys of a dictionary as a vector, or return the column names of a table as a vector, or convert a set into a vector.\n\n#### Parameters\n\n**X** is a dictionary/table/set.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nz=dict(`INT,`DOUBLE)\nz[5]=7.9\nz[3]=6\nz.keys();\n// output: [3,5]\n\nt = table(1 2 3 as id, 4 5 6 as x, `IBM`MSFT`GOOG as name);\nkeys(t);\n// output: [\"id\",\"x\",\"name\"]\n\na=set(1 2 4)\na.keys();\n// output: [4,2,1]\n```\n\nRelated function: [values](https://docs.dolphindb.com/en/Functions/v/values.html)\n"
    },
    "kmeans": {
        "url": "https://docs.dolphindb.com/en/Functions/k/kmeans.html",
        "signatures": [
            {
                "full": "kmeans(X, k, [maxIter=300], [randomSeed], [init='random'])",
                "name": "kmeans",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "k",
                        "name": "k"
                    },
                    {
                        "full": "[maxIter=300]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "300"
                    },
                    {
                        "full": "[randomSeed]",
                        "name": "randomSeed",
                        "optional": true
                    },
                    {
                        "full": "[init='random']",
                        "name": "init",
                        "optional": true,
                        "default": "'random'"
                    }
                ]
            }
        ],
        "markdown": "### [kmeans](https://docs.dolphindb.com/en/Functions/k/kmeans.html)\n\n\n\n#### Syntax\n\nkmeans(X, k, \\[maxIter=300], \\[randomSeed], \\[init='random'])\n\n#### Details\n\nK-means clustering.\n\n#### Parameters\n\n**X** is a table. Each row is an observation and each column is a feature.\n\n**k** is a positive integer indicating the number of clusters to form.\n\n**maxIter** is a positive integer indicating the maximum number of iterations of the k-means algorithm for a single run. The default value is 300.\n\n**randomSeed** is an integer indicating the seed in the random number generator.\n\n**init** is a STRING scalar or matrix indicating the optional method for initialization. The default value is \"random\".\n\n* If *init* is a STRING scalar, it can be \"random\" or \"k-means++\": \"random\" means to choose observations at random from data for the initial centroids; \"k-means++\" means to generate cluster centroids using the k-means++ algorithm.\n\n* If *init* is a matrix, it indicates the centroid starting locations. The number of columns is the same as *X* and the number of rows is *k*.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* centers: a k\\*m (m is the number of columns of *X*) matrix. Each row is the coordinates of a cluster center.\n\n* predict: a clustering function for prediction of FUNCTIONDEF type.\n\n* modelName: string \"KMeans\".\n\n* model: a RESOURCE data type variable. It is an internal binary resource generated by function `kmeans` to be used by function [predict](https://docs.dolphindb.com/en/Functions/p/predict.html).\n\n* labels: a vector indicating which cluster each row of X belongs to.\n\n#### Examples\n\n```\nt = table(100:0, `x0`x1, [DOUBLE, DOUBLE])\nx0 = norm(1.0, 1.0, 50)\nx1 = norm(1.0, 1.5, 50)\ninsert into t values (x0, x1)\nx0 = norm(2.0, 1.0, 50)\nx1 = norm(-1.0, 1.5, 50)\ninsert into t values (x0, x1)\nx0 = norm(-1.0, 1.0, 50)\nx1 = norm(-3.0, 1.5, 50)\ninsert into t values (x0, x1);\n\nmodel = kmeans(t, 3);\nmodel;\n\n/* output:\ncenters->\n\n0        #1\n--------- ---------\n-1.048027 -3.809539\n1.110899  1.24216\n1.677974  -1.19158\n\npredict->kmeansPredict\nmodelName->KMeans\nmodel->KMeans\nlabels->[2,2,2,2,2,2,3,2,3,2,...]\n*/\n```\n"
    },
    "knn": {
        "url": "https://docs.dolphindb.com/en/Functions/k/knn.html",
        "signatures": [
            {
                "full": "knn(Y, X, type, nNeighbor, [power=2])",
                "name": "knn",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "type",
                        "name": "type"
                    },
                    {
                        "full": "nNeighbor",
                        "name": "nNeighbor"
                    },
                    {
                        "full": "[power=2]",
                        "name": "power",
                        "optional": true,
                        "default": "2"
                    }
                ]
            }
        ],
        "markdown": "### [knn](https://docs.dolphindb.com/en/Functions/k/knn.html)\n\n\n\n#### Syntax\n\nknn(Y, X, type, nNeighbor, \\[power=2])\n\n#### Details\n\nImplement the k-nearest neighbors (k-NN) algorithm with a brute-force search for classification and regression.\n\n#### Parameters\n\n**Y** is a vector with the same length as the number of rows of *X*. Each element is a label corresponding to each row in *X*.\n\n**X** is a table. Each row is an observation and each column is a feature.\n\n**type** is a string. It can be either \"regressor\" or \"classifier\".\n\n**nNeighbor** is a positive integer indicating the number of nearest neighbors in training.\n\n**power** is a positive integer indicating the parameter of Minkowski distance used in training. The default value is 2 indicating Euclidean distance. If *power*=1, it means Manhattan distance is used in training.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* nNeighbor: the number of nearest neighbors in training.\n\n* modelName: string \"KNN\".\n\n* model: the model to be saved.\n\n* power: the parameter of Minkowski distance used in training.\n\n* type: \"regressor\" or \"classifier\".\n\n#### Examples\n\n```\nheight = 158 158 158 160 160 163 163 160 163 165 165 165 168 168 168 170 170 170\nweight = 58 59 63 59 60 60 61 64 64 61 62 65 62 63 66 63 64 68\nt=table(height, weight)\nlabels=take(1,7) join take(2,11)\nmodel = knn(labels,t,\"classifier\", 5);\n```\n"
    },
    "kroghInterpolate": {
        "url": "https://docs.dolphindb.com/en/Functions/k/kroghInterpolate.html",
        "signatures": [
            {
                "full": "kroghInterpolate(X, Y, newX, [der=0])",
                "name": "kroghInterpolate",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "newX",
                        "name": "newX"
                    },
                    {
                        "full": "[der=0]",
                        "name": "der",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [kroghInterpolate](https://docs.dolphindb.com/en/Functions/k/kroghInterpolate.html)\n\n\n\n#### Syntax\n\nkroghInterpolate(X, Y, newX, \\[der=0])\n\n#### Details\n\nInterpolating polynomial for a set of points. The polynomial passes through all the pairs `(X, Y)` and returns the derivative interpolated at the x-points.\n\nOne may additionally specify a number of derivatives at each point *Xi*; this is done by repeating the value *Xi* and specifying the derivatives as successive *Yi* values.\n\n* When the vector of *Xi*contains only distinct values, *Yi* represents the function value.\n\n* When an element of *Xi*occurs two or more times in a row, the corresponding *Yi* represents derivative values. For example, if X = \\[0,0,1,1] and Y = \\[1,0,2,3], then Y\\[0]=f(0), Y\\[1]=f'(0), Y\\[2]=f(1) and Y\\[3]=f'(1).\n\n#### Parameters\n\n**X** is a numeric vector indicating the x-coordinates. It must be sorted in increasing order with no null values contained.\n\n**Y** is a numeric vector of the same length as *Xi*, indicating the y-coordinates. It cannot contain null values.\n\n**newX** is a numeric vector specifying the points at which to evaluate the derivatives.\n\n**der** (optional) is a non-negative integer indicating how many derivatives to evaluate. The default value is 0, meaning the function value is used as the 0th derivative.\n\n#### Returns\n\nA DOUBLE vector.\n\n#### Examples\n\nTake `sin` as an example to interpolate the value and first derivative at the point of xx.\n\n```\ndef linspace(start, end, num, endpoint=true){\n\tif(endpoint) return end$DOUBLE\\(num-1), start + end$DOUBLE\\(num-1)*0..(num-1)\n\telse return start + end$DOUBLE\\(num-1)*0..(num-1)\t\n}\n\nx = 0 1 2 3 4 5\ny = sin(x)\nxx = linspace(0.0, 5.0, 10)[1]\nyy=kroghInterpolate(x,y,xx)\nyy;\n// output: [0,0.515119011157387,0.898231239576709,0.998548648650381,0.793484053410063,0.354287125066207,-0.188319604452395,-0.678504737959061,-0.969692008469677,-0.958924274663139]\n\nyy1=kroghInterpolate(x,y,xx,1)\nyy1;\n// output: [0.885486080979582,0.875967413938641,0.459031117252456,-0.103633680213926,-0.612193041424271,-0.92866822117116,-0.976935666075988,-0.742727014588963,-0.273629096989106,0.320916064615744]\n```\n"
    },
    "kroghInterpolateFit": {
        "url": "https://docs.dolphindb.com/en/Functions/k/kroghInterpolateFit.html",
        "signatures": [
            {
                "full": "kroghInterpolateFit(X, Y, [der=0])",
                "name": "kroghInterpolateFit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[der=0]",
                        "name": "der",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [kroghInterpolateFit](https://docs.dolphindb.com/en/Functions/k/kroghInterpolateFit.html)\n\n\n\n#### Syntax\n\nkroghInterpolateFit(X, Y, \\[der=0])\n\n#### Details\n\nThis function performs polynomial interpolation for a given set of points, ensuring the polynomial passes through all points in the set.\n\nMultiple derivative values at each point of *X* can be specified by repeating *X* values and assigning corresponding derivative values as consecutive Y values:\n\n* If an *X* value appears only once, the corresponding *Y* is the value of the polynomial f(X).\n* If an *X* value appears multiple times, the first *Y* is the value of f(X), the second Y is the first derivative f′(X), the third Y is the second derivative f′′(X), and so on. For example, with inputs X=\\[0,0,1,1] and Y=\\[1,0,2,3], the interpretation is Y\\[0]=f(0), Y\\[1]=f′(0), Y\\[2]=f(1), Y\\[3]=f′(1).\n\n#### Parameters\n\n**X** is a numeric vector representing the x-coordinates of the points to be interpolated. Values in *X* must be in increasing order. Null values are not allowed.\n\n**Y** is a numeric vector of the same length as *X*, representing the y-coordinates of the points. Null values are not allowed.\n\n**der** (optional) is a non-negative integer representing the derivative order to compute. The default value is 0, meaning to compute the polynomial's value.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* modelName: A string \"kroghInterpolate\" indicating the model name.\n* X: The numeric vector representing the x-coordinates used for interpolation (i.e., the input *X*).\n* der: The non-negative integer representing the derivative order (i.e., the input *der*).\n* coeffs: A numeric vector containing the polynomial coefficients fitted from the input data points.\n* predict: The prediction function of the model. You can call `model.predict(X)` or `predict(model, X)` to make predictions with the generated model. It takes the following parameters:\n  * model: A dictionary, which is the output of `kroghInterpolateFit`.\n  * X: A numeric vector representing the x-coordinates at which to evaluate the polynomial.\n\n#### Examples\n\nPerform polynomial interpolation for the `sin` function and compute the polynomial estimates at specific points:\n\n```\nx = 0 1 2 3 4 5\ny = sin(x)\nmodel = kroghInterpolateFit(x,y)\nmodel\n\n/*\noutput:\nX->[0,1,2,3,4,5]\nder->0\npredict->kroghInterpolateFitPredict\nmodelName->kroghInterpolate\ncoeffs->[0.0,0.841470984807,-0.386822271395,-0.010393219665,0.032025753923,-0.005411092181,0.0]\n*/\n```\n\nPredict with the generated model using a UDF `linspace`:\n\n```\ndef linspace(start, end, num, endpoint=true){\n\tif(endpoint) return end$DOUBLE\\(num-1), start + end$DOUBLE\\(num-1)*0..(num-1)\n\telse return start + end$DOUBLE\\(num-1)*0..(num-1)\t\n}\nxx = linspace(0.0, 5.0, 10)[1]\nmodel.predict(xx)\n\n// output: [0,0.515119011157387,0.898231239576709,0.998548648650381,0.793484053410063,0.354287125066207,-0.188319604452395,-0.678504737959061,-0.969692008469677,-0.958924274663139]\n```\n\n**Related Functions**: [predict](https://docs.dolphindb.com/en/Functions/p/predict.html), [kroghInterpolate](https://docs.dolphindb.com/en/Functions/k/kroghInterpolate.html)\n"
    },
    "ksTest": {
        "url": "https://docs.dolphindb.com/en/Functions/k/ksTest.html",
        "signatures": [
            {
                "full": "ksTest(X, Y)",
                "name": "ksTest",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [ksTest](https://docs.dolphindb.com/en/Functions/k/ksTest.html)\n\n\n\n#### Syntax\n\nksTest(X, Y)\n\n#### Details\n\nConduct Kolmogorov-Smirnov test on *X* and *Y*.\n\n#### Parameters\n\n**X** and **Y** are numeric vectors indicating the samples for the test.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* ksValue: Kolmogorov-Smirnov statistic\n\n* pValue: p-value of the test\n\n* D: D-stat\n\n* method: \"Two-sample Kolmogorov-Smirnov test\"\n\n#### Examples\n\n```\nx = norm(0.0, 1.0, 50)\ny = norm(0.0, 1.0, 20)\nksTest(x, y);\n\n/* output:\nksValue->0.739301\npValue->0.645199\nD->0.19\nmethod->Two-sample Kolmogorov-Smirnov test\n*/\n```\n"
    },
    "kurtosis": {
        "url": "https://docs.dolphindb.com/en/Functions/k/kurtosis.html",
        "signatures": [
            {
                "full": "kurtosis(X, [biased=true])",
                "name": "kurtosis",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [kurtosis](https://docs.dolphindb.com/en/Functions/k/kurtosis.html)\n\n\n\n#### Syntax\n\nkurtosis(X, \\[biased=true])\n\n#### Details\n\nReturn the kurtosis of *X*. The calculation skips null values.\n\nThe calculation uses the following formulas:\n\n* when *biased* =true:\n\n  ![](https://docs.dolphindb.com/en/images/k1.png)\n\n* when *biased*=false:\n\n  ![](https://docs.dolphindb.com/en/images/k0.png)\n\nIf *X* is a matrix, calculate the skewness of each column of *X* and return a vector.\n\nIf *X* is a table, calculate the skewness of each column of *X* and return a table.\n\n`kurtosis` also supports querying partitioned tables and distributed tables with bias correction.\n\nFunction `kurtosis` in DolphinDB returns a biased result by default (*biased* = true), while in pandas and Excel it is unbiased estimation, and the kurtosis value 3 of the normal distribution is subtracted.\n\nRefer to the following example, you can make the kurtosis results of DolphinDB consistent with that of pandas and excel:\n\n```\n// python\nm = [1111, 323, 43, 51]\ndf = pandas.DataFrame(m)\ny = df.kurt()\n// output: 2.504252\n\n// dolphindb\nm=matrix(1111 323 43 51)\nkurtosis(m, false) - 3\n// output: 2.5043\n```\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n**biased** is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\nA DOUBLE scalar/vector/table.\n\n#### Examples\n\nPlease note that as the example below uses the random number generator [norm](https://docs.dolphindb.com/en/Functions/n/norm.html), the result is slightly different each time it is executed.\n\n```\nx=norm(0, 1, 1000000);\nkurtosis(x);\n// output: 3.000249\n\nx[0]=100;\nkurtosis(x);\n// output: 100.626722\n\nm=matrix(1..10, 1 2 3 4 5 6 7 8 9 100);\nm;\n```\n\n| #0 | #1  |\n| -- | --- |\n| 1  | 1   |\n| 2  | 2   |\n| 3  | 3   |\n| 4  | 4   |\n| 5  | 5   |\n| 6  | 6   |\n| 7  | 7   |\n| 8  | 8   |\n| 9  | 9   |\n| 10 | 100 |\n\n```\nkurtosis(m);\n// output: [1.775757575757576,7.997552566718839]\n```\n"
    },
    "garch": {
        "url": "https://docs.dolphindb.com/en/Functions/g/garch.html",
        "signatures": [
            {
                "full": "garch(ds, endogColName, order, [maxIter=50])",
                "name": "garch",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "endogColName",
                        "name": "endogColName"
                    },
                    {
                        "full": "order",
                        "name": "order"
                    },
                    {
                        "full": "[maxIter=50]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "50"
                    }
                ]
            }
        ],
        "markdown": "### [garch](https://docs.dolphindb.com/en/Functions/g/garch.html)\n\n#### Syntax\n\ngarch(ds, endogColName, order, \\[maxIter=50])\n\n#### Details\n\nUse the generalized autoregressive conditional heteroskedasticity (GARCH) model to model the conditional volatility of univariate time series.\n\n#### Parameters\n\n**ds** is an in-memory table or a vector consisting of DataSource objects, containing the multivariate time series to be analyzed. *ds* cannot be empty.\n\n**endogColName** is a string indicating the column names of the endogenous variables in *ds*.\n\n**order** is a positive integral vector of length 2 indicating the orders. For example, order=\\[1,2] means p=1, q=2 for a GARCH model, where *p* is the order of the GARCH terms and *q* is the order of the ARCH terms.\n\n**maxIter** (optional) is a positive integer indicating the maximum iterations. The default value is 50.\n\n#### Returns\n\nReturn a dictionary with the following keys:\n\n* volConstant: A floating-point scalar, representing the Vol Constant obtained through optimization.\n* returnsConstant: A floating-point scalar, representing the Returns Constant obtained through optimization.\n* archTerm: A floating-point vector, representing the ARCH Term obtained through optimization.\n* garchTerm: A floating-point vector, representing the GARCH Term obtained through optimization.\n* iterations: An integer representing the number of iterations.\n* aic: A floating-point scalar, representing the value of the AIC criterion.\n* bic: A floating-point scalar, representing the value of the BIC criterion.\n* nobs: An integer representing the number of observations in the time series, i.e., the amount of data used for fitting.\n* model: A dictionary containing the basic information of the fitted model, with the following members:\n  * order: A vector with 2 positive integers, representing the order of the model.\n  * endog: A floating-point matrix, representing the observed data converted from *ds*.\n  * coefficients: A floating-point vector, representing the values of the exogenous variables after fitting.\n* predict: The prediction function of the model. It can be called using `model.predict(x)`, where:\n  * model: A dictionary indicating the output of `garch`.\n  * x: A positive integer representing the prediction step.\n* modelName: The model name, which is GARCH.\n\n#### Examples\n\nAnalyze the data in the [macrodata.csv](https://docs.dolphindb.com/en/Functions/resources/macrodata.csv) file with garch model:\n\n```\ndata = loadText(\"macrodata.csv\");\nmodel = garch(data, \"realgdp\", [1,1]);\nprint(model)\n\n/* output:\nvolConstant->0.000005999433551\nreturnsConstant->0.008474617943101\narchTerm->[0.70725452294378]\ngarchTerm->[0.248859733003604]\naic->-1353.789403416915774\nbic->-1340.576183784679415\nnobs->201\niterations->38\npredict->garchPredict\nstate->order->[1,1]\nendog->#0                \n------------------\n0.024942130816387 \n-0.001192952110668\n0.003494532654372 \n...\n\nstart->[-12.023845501294935,-1.104702991485461,0.882087052766567,0.008474617943101]\n*/\n```\n\n"
    },
    "gaussianKde": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gaussianKde.html",
        "signatures": [
            {
                "full": "gaussianKde(X,[weights],[bwMethod=\"scott\"])",
                "name": "gaussianKde",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[weights]",
                        "name": "weights",
                        "optional": true
                    },
                    {
                        "full": "[bwMethod=\"scott\"]",
                        "name": "bwMethod",
                        "optional": true,
                        "default": "\"scott\""
                    }
                ]
            }
        ],
        "markdown": "### [gaussianKde](https://docs.dolphindb.com/en/Functions/g/gaussianKde.html)\n\n\n\n#### Syntax\n\ngaussianKde(X,\\[weights],\\[bwMethod=\"scott\"])\n\n#### Details\n\nEstimate the probability density of the random variable using the Gaussian kernel from kernel density estimation (KDE).\n\nThe generated model can be used as the input for the `gaussianKdePredict` function.\n\n#### Parameters\n\n**X** is a numeric vector, matrix, tuple, or table indicating the input dataset. Each row in *X* corresponds to a data point with consistent dimensions and a minimum of 2 elements (i.e., a data point must have at least 2 dimensions). The dataset must contain more rows than columns. Distributed tables are currently not supported.\n\n**weights** (optional) is a numeric vector indicating the weight of each data point. By default, all data points are equally weighted. The values in *weights* must be non-negative and not all zeros. The length of *weights* must be the same as the number of rows in *X*.\n\n**bwMethod**(optional) indicates the method for generating the bandwidth. It can be:\n\n* A STRING scalar, \"scott\" (default) or \"silverman\"\n\n* A numeric scalar indicating the bandwidth size\n\n* A function used to calculate the bandwidth based on *X* and return a numeric scalar.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* **X** is a floating-point vector or matrix indicating the input dataset *X*.\n\n* **cov** is a floating-point matrix indicating the Cholesky decomposition of the covariance matrix generated from *weights*, *X*, and bandwidth.\n\n* **weights** is a floating-point vector indicating the corresponding weight of each data point.\n\n* **predict** is a function pointer indicating the corresponding prediction function. It is used with the syntax `model.gaussianKdePredict(model, X)`. For details, see [gaussianKdePredict](https://docs.dolphindb.com/en/Functions/g/gaussianKdePredict.html).\n\n* **bandwidth** is a floating-point scalar indicating the generated bandwidth.\n\n#### Examples\n\nEstimate the probability density of the input file *trainset.txt*.\n\n```\ntrainData = loadText(\"trainset.txt\",\" \");\nmodel = gaussianKde(trainData)\nmodel\n```\n\nOutput:\n\n```\nX->\n#0      #1     \n0.1460  -0.1659\n-1.3717 -1.6650\n-1.6957 -1.1680\n-0.7976 0.6081 \n0.1088  2.5113 \n-0.0724 -0.8210\n-1.7548 -0.3485\n1.1202  0.9004 \n1.0234  0.7907 \n-0.4256 0.7169 \n\npredict->gaussianKdePredict\ncov->\n#0     #1    \n0.7040 0.0   \n0.4921 0.6700\n\nweights->[0.1000,0.1000,0.1000,0.1000,0.1000,0.1000,0.1000,0.1000,0.1000,0.1000]\nbandwidth->0.6812\n```\n\n`gaussianKde` can also be used with the `gaussianKdePredict` function to predict the probability density of another input file, *testset.txt*, as shown below.\n\n```\ntestData = loadText(\"testset.txt\",\" \");\nmodel.predict(testData)\n```\n\nOutput:\n\n```\n->[0.0623,0.0730,0.0336,0.0030,0.0001,0.0552....]\n```\n\nRelated Function: [gaussianKdePredict](https://docs.dolphindb.com/en/Functions/g/gaussianKdePredict.html)\n\n#### Appendix\n\n[trainset.txt](https://docs.dolphindb.com/en/Functions/resources/trainset.txt)\n\n[testset.txt](https://docs.dolphindb.com/en/Functions/resources/testset.txt)\n"
    },
    "gaussianKdePredict": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gaussianKdePredict.html",
        "signatures": [
            {
                "full": "gaussianKdePredict(model,X)",
                "name": "gaussianKdePredict",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [gaussianKdePredict](https://docs.dolphindb.com/en/Functions/g/gaussianKdePredict.html)\n\n\n\n#### Syntax\n\ngaussianKdePredict(model,X)\n\n#### Details\n\nPredict the probability density of the input data based on the model generated by `gaussianKde`.\n\n#### Parameters\n\n**model** is a dictionary indicating the model generated by `gaussianKde`.\n\n**X** is a numeric vector, matrix, tuple, or table indicating the data to be predicted. Its dimensions must be the same as those of the dataset used in `gaussianKde`.\n\n#### Returns\n\nA floating-point vector of the same size as the number of rows in *X*, indicating the prediction result of each data point in *X*.\n\n#### Examples\n\nThe following example first uses the `gaussianKde` function to estimate the probability density of the input *trainset.txt*. based on the Gaussian kernel estimation and generate a model. Then, the `gaussianKdePredict` function is called to apply this model to another input file, *testset.txt*, to predict its probability density results.\n\n```\ntrainData = loadText(\"trainset.txt\",\" \");\ntestData = loadText(\"testset.txt\",\" \");\nmodel = gaussianKde(trainData)\ngaussianKdePredict(model, testData)\n```\n\nOutput:\n\n```\n->[0.0623,0.0730,0.0336,0.0030,0.0001,0.0552....]\n```\n\nRelated Function: [gaussianKde](https://docs.dolphindb.com/en/Functions/g/gaussianKde.html)\n\n#### Appendix\n\n[trainset.txt](https://docs.dolphindb.com/en/Functions/resources/trainset.txt)\n\n[testset.txt](https://docs.dolphindb.com/en/Functions/resources/testset.txt)\n"
    },
    "gaussianNB": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gaussianNB.html",
        "signatures": [
            {
                "full": "gaussianNB(Y, X, [varSmoothing=1e-9])",
                "name": "gaussianNB",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[varSmoothing=1e-9]",
                        "name": "varSmoothing",
                        "optional": true,
                        "default": "1e-9"
                    }
                ]
            }
        ],
        "markdown": "### [gaussianNB](https://docs.dolphindb.com/en/Functions/g/gaussianNB.html)\n\n\n\n#### Syntax\n\ngaussianNB(Y, X, \\[varSmoothing=1e-9])\n\n#### Details\n\nConduct the Naive Bayesian classification.\n\n#### Parameters\n\n**Y** is a vector with the same length as table *X*. Each element of labels indicates the class that the correponding row in *X* belongs to.\n\n**X** is a table indicating the training set. Each row is a sample and each column is a feature.\n\n**varSmoothing** (optional) is a positive floating number indicating the portion of the largest variance of all features that is added to variances for calculation stability. The default value is 1e-9.\n\n#### Returns\n\nReturn a dictionary with the following keys:\n\n* model: a RESOURCE data type variable. It is an internal binary resource generated by function `gaussianNB` and to be used by function [predict](https://docs.dolphindb.com/en/Functions/p/predict.html).\n\n* modelName: string \"GaussianNB\".\n\n* varSmoothing: varSmoothing parameter value.\n\n#### Examples\n\nThe dataset iris.data used in the following example can be downloaded from <https://archive.ics.uci.edu/ml/datasets/iris>.\n\n```\nDATA_DIR = \"C:/DolphinDB/Data\"\nt = loadText(DATA_DIR+\"/iris.data\")\nt.rename!(`col0`col1`col2`col3`col4, `sepalLength`sepalWidth`petalLength`petalWidth`class)\nt[`classType] = take(0, t.size())\nupdate t set classType = 1 where class = \"Iris-versicolor\"\nupdate t set classType = 2 where class = \"Iris-virginica\"\n\ntraining = select sepalLength, sepalWidth, petalLength, petalWidth from t\nlabels = t.classType\n\nmodel = gaussianNB(labels, training);\n\npredict(model, training);\n```\n"
    },
    "ge": {
        "url": "https://docs.dolphindb.com/en/Functions/g/ge.html",
        "signatures": [
            {
                "full": "ge(X, Y)",
                "name": "ge",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [ge](https://docs.dolphindb.com/en/Functions/g/ge.html)\n\n\n\n#### Syntax\n\nge(X, Y)\n\nor\n\nX>=Y\n\n#### Details\n\nIf neither *X* nor *Y* is a set, return the element-by-element comparison of *X*>=*Y*.\n\nIf both *X* and *Y* are sets, check if *Y* is a subset of *X*.\n\n#### Parameters\n\n**X** / **Y** can be a scalar/pair/vector/matrix/set. If X or Y is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\n* If neither *X* nor *Y* is a set, returns a Boolean result with the same form as the input arguments.\n\n* If both *X* and *Y* are sets, returns a Boolean scalar indicating whether *Y* is a subset of *X*.\n\n#### Examples\n\n```\n1 2 3 >= 2;\n// output: [false,true,true]\n\n1 2 3 >= 0 2 4;\n// output: [true,true,false]\n\n2:3>=1:6;\n// output: [true,false]\n\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1 ge 4;\n```\n\n| #0    | #1    | #2   |\n| ----- | ----- | ---- |\n| false | false | true |\n| false | true  | true |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1>=m2;\n```\n\n| #0    | #1    | #2   |\n| ----- | ----- | ---- |\n| false | false | true |\n| false | true  | true |\n\nSet operation: If X>=Y then Y is a subset of X\n\n```\nx=set(4 6);\nx;\n// output: set(6,4)\n\ny=set(8 9 4 6);\ny;\n// output: set(6,4,9,8)\n\ny>=x;\n// output: true\n\nx>=y;\n// output: false\n\nx>=x;\n// output: true  \n// x is a subset of x\n```\n"
    },
    "gema": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gema.html",
        "signatures": [
            {
                "full": "gema(X, window, alpha)",
                "name": "gema",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "alpha",
                        "name": "alpha"
                    }
                ]
            }
        ],
        "markdown": "### [gema](https://docs.dolphindb.com/en/Functions/g/gema.html)\n\n\n\n#### Syntax\n\ngema(X, window, alpha)\n\nPlease see [TA-Lib Functions](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Exponential Moving Average (ema) for *X* in a sliding window of the given length.\n\nDifferent from [ema](https://docs.dolphindb.com/en/Functions/e/ema.html), the function `gema` uses a smoothing factor alpha for EMA. The formula is:\n\n![](https://docs.dolphindb.com/en/images/gema.png)\n\nwhere ![](https://docs.dolphindb.com/en/images/gema_k.png) is the *k-th* exponential moving average, *alpha* is the smoothing factor, and Xk is the *k-th* element of the vector *X*.\n\n#### Parameters\n\n**alpha** is a floating-point number in (0,1) indicating the smoothing factor alpha.\n\n#### Returns\n\nA value of type DOUBLE, with the same form as *X*.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\ngema(x,3,0.5);\n// output: [,,12.299999999999998,12.55,12.225000000000001,11.912500000000001,11.55625]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\ngema(x,3,0.1);\n```\n\n| col1    | col2    |\n| ------- | ------- |\n|         |         |\n|         |         |\n| 12.3    | 15.6667 |\n| 12.35   | 16      |\n| 12.305  | 16.5    |\n| 12.2345 | 16.05   |\n| 12.131  | 15.445  |\n\nRelated functions: [ema](https://docs.dolphindb.com/en/Functions/e/ema.html), [wilder](https://docs.dolphindb.com/en/Functions/w/wilder.html), [tema](https://docs.dolphindb.com/en/Functions/t/tema.html)\n"
    },
    "generateMachineFingerprint": {
        "url": "https://docs.dolphindb.com/en/Functions/g/generateMachineFingerprint.html",
        "signatures": [
            {
                "full": "generateMachineFingerprint(outputPath)",
                "name": "generateMachineFingerprint",
                "parameters": [
                    {
                        "full": "outputPath",
                        "name": "outputPath"
                    }
                ]
            }
        ],
        "markdown": "### [generateMachineFingerprint](https://docs.dolphindb.com/en/Functions/g/generateMachineFingerprint.html)\n\n\n\n#### Syntax\n\ngenerateMachineFingerprint(outputPath)\n\n#### Arguments\n\n**outputPath** a string indicating the path of the file with fingerprint.\n\n#### Details\n\nGenerate a file with the fingerprint of the computer. This command must be executed by a logged-in user on Linux, or an administrator on Windows.\n\n#### Examples\n\n```\ngenerateMachineFingerprint(\"/home/DolphinDB\")\n```\n"
    },
    "generateUserTicket": {
        "url": "https://docs.dolphindb.com/en/Functions/g/generateuserticket.html",
        "signatures": [
            {
                "full": "generateUserTicket(userName, expire)",
                "name": "generateUserTicket",
                "parameters": [
                    {
                        "full": "userName",
                        "name": "userName"
                    },
                    {
                        "full": "expire",
                        "name": "expire"
                    }
                ]
            }
        ],
        "markdown": "### [generateUserTicket](https://docs.dolphindb.com/en/Functions/g/generateuserticket.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngenerateUserTicket(userName, expire)\n\n#### Details\n\nAn administrator can use this function to generate a dynamic login ticket for the user and set the expiration time of the ticket. The user can then use the generated ticket for passwordless login via the `authenticateByTicket(ticket)` function.\n\n#### Parameters\n\n**userName**is a STRING scalar indicating the user name for which the login ticket will be generated.\n\n**expire** is a DATETIME scalar indicating the expiration time of the ticket.\n\n#### Returns\n\nA STING scalar.\n\n#### Examples\n\n```\nlogin(\"admin\", \"123456\")\ncreateUser(\"user1\", \"123456\")\ntik = generateUserTicket(\"user1\", 2030.12.31T12:00:00)\nauthenticateByTicket(tik)\n//check the user of the current session\ngetCurrentSessionAndUser() \n// output: (1659657455,\"user1\",\"192.168.1.177\",57958)\n```\n"
    },
    "genericStateIterate": {
        "url": "https://docs.dolphindb.com/en/Functions/g/genericStateIterate.html",
        "signatures": [
            {
                "full": "genericStateIterate(X, initial, window, func)",
                "name": "genericStateIterate",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "initial",
                        "name": "initial"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    }
                ]
            }
        ],
        "markdown": "### [genericStateIterate](https://docs.dolphindb.com/en/Functions/g/genericStateIterate.html)\n\n#### Syntax\n\ngenericStateIterate(X, initial, window, func)\n\n#### Details\n\nThis function belongs to the reactive state engine and performs calculation with count-based sliding windows iteratively.\n\nSuppose *X* is specified as \\[X1, X2, ..., Xn], column \"factor\" in the output table holds the calculation results, column \"initial\" is the initial column, *window* is set to \"w\", and the iterate function is \"func\". For the k-th record, the calculation rule is:\n\n* k <= w: factor\\[k-1] = initial\\[k-1]\n\n* k > w: factor\\[k-1] = func(factor\\[(k-1-w):k-1], X1\\[k-1], X2\\[k-1], … , Xn\\[k-1])\n\n* When w-0:\n\n  * k=1: factor\\[0] = func(initial\\[0], X1\\[0], X2\\[0], … , Xn\\[0])\n\n  * k>1: factor\\[k-1] = func(factor\\[(k-2)], X1\\[k-1], X2\\[k-1], … , Xn\\[k-1])\n\n* When w>0:\n\n  * k <= w: factor\\[k-1] = initial\\[k-1]\n\n  * k > w: factor\\[k-1] = func(factor\\[(k-1-w):k-1], X1\\[k-1], X2\\[k-1], … , Xn\\[k-1])\n\nNote that when a pair is used to indicate index, the right boundary is not inclusive, i.e., the range of (k-1-w):k-1 is \\[k-1-w, k-1).\n\n#### Parameters\n\n**X** can be column(s) from the input table, or the calculation results by applying a vector function to the column(s). You can set *X* to \\[] to leave it unspecified; or use a tuple to specify multiple columns for *X*.\n\n**initial** can be a column from the input table, or the calculation results by applying a vector function to it. It is used to fill the first to window-th records in the output table.\n\n**window** is a non-negative integeran integer greater than 1that specifies the window size (measured by the number of records).\n\n**func** is a stateless user-defined function with one scalar as the return value. Arguments passed to *func* are as follows:\n\n* The first argument is a vector containing the previous window resultsif *window*>0, or the previous result if *window*=0.\n\n* Then followed by columns specified in *X*.\n\n* \\[Optional] Other fixed constants to be passed to *func*. In this case, you can fix the arguments with partial application.\n\n#### Examples\n\n```\n// define a function\ndef myfunc(x, w){\n    re = sum(x*w)\n    return re\n}\n\ndateTime = 2021.09.09T09:30:00.000 2021.09.09T09:31:00.000 2021.09.09T09:32:00.000 2021.09.09T09:33:00.000 2021.09.09T09:34:00.000\nsecurityID = `600021`600021`600021`600021`600021\nvolume = 310 280 300 290 240\nprice = 1.5 1.6 1.7 1.6 1.5\nt = table(1:0, `dateTime`securityID`volume`price, [TIMESTAMP, SYMBOL, INT, DOUBLE])\ntableInsert(t, dateTime, securityID, volume, price)\noutput = table(100:0, `securityID`dateTime`factor1, [SYMBOL, TIMESTAMP, DOUBLE])\n\nengine = createReactiveStateEngine(name=\"test\", metrics=[<dateTime>, <genericStateIterate(volume,price,3,myfunc{,})>], dummyTable=t, outputTable=output, keyColumn=`SecurityID, keepOrder=true)\nengine.append!(t)\ndropStreamEngine(`test)\n```\n\n| securityID | dateTime                | factor1 |\n| ---------- | ----------------------- | ------- |\n| 600021     | 2021.09.09T09:30:00.000 | 1.5     |\n| 600021     | 2021.09.09T09:31:00.000 | 1.6     |\n| 600021     | 2021.09.09T09:32:00.000 | 1.7     |\n| 600021     | 2021.09.09T09:33:00.000 | 1,392   |\n| 600021     | 2021.09.09T09:34:00.000 | 334,872 |\n\nThe above example is calculated as follows:\n\n* As *window* is set to 3, the first 3 records of factor1 in the initial window take the corresponding values of column price.\n\n* When the 4th record arrives, the initial window \\[1.5, 1.6, 1.7] and the current value of volume 290 are used for iteration. The result of myfunc(\\[1.5, 1.6, 1.7], 290) is 1392.\n\n* When the 5th record arrives, the previous \\[1.6, 1.7, 1392] and the current value of volume 240 are used for iteration. The result of myfunc(\\[1.6, 1.7, 1392], 240) is 334872.\n\nThe calculation process is preceded in the same way if data ingestion continues.\n\nRelated function: [genericTStateIterate](https://docs.dolphindb.com/en/Functions/g/genericTStateIterate.html)\n\n"
    },
    "genericTStateIterate": {
        "url": "https://docs.dolphindb.com/en/Functions/g/genericTStateIterate.html",
        "signatures": [
            {
                "full": "genericTStateIterate(T, X, initial, window, func, [leftClosed=false])",
                "name": "genericTStateIterate",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "initial",
                        "name": "initial"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "[leftClosed=false]",
                        "name": "leftClosed",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [genericTStateIterate](https://docs.dolphindb.com/en/Functions/g/genericTStateIterate.html)\n\n#### Syntax\n\ngenericTStateIterate(T, X, initial, window, func, \\[leftClosed=false])\n\n#### Details\n\nThis function belongs to the reactive state engine and performs calculation with time-based windows iteratively.\n\nSuppose T is a time column, X is \\[X1, X2, ..., Xn], column \"factor\" in the output table holds the calculation results, column \"initial\" is the initial column, window is set to \"w\", and the iterate function is \"func\".\n\nFor the k-th record (with its timestamp Tk), the calculation rule is:\n\n* Tk ∈ \\[T1, T1+w): factor\\[k] = initial\\[k]\n\n* factor\\[k] = func(subFactor, X1\\[k], X2\\[k], … , Xn\\[k]), where\n\n  * *subFactor* is the value of factor in the current window\n\n  * the window for the (k+1)th record is (Tk-w, Tk] (when leftClosed=false) or \\[Tk-w, Tk] (when leftClosed=true).\n\n#### Parameters\n\n**T** is a non-strictly increasing vector of temporal or integral type. It cannot contain null values. Note that out-of-order data is discarded in the calculation.\n\n**X** can be column(s) from the input table, or the calculation results by applying a vector function to the column(s). You can set *X* to \\[] to leave it unspecified; or use a tuple to specify multiple columns for *X*.\n\n**initial** is the column used to fill the initial window in the result column of the output table. It can be a column from the input table, or the calculation results by applying a vector function to it. Suppose the timestamp of the first record is t0, the initial window is \\[t0, t0 + window), measured by time interval.\n\n**window** is a positive integer or a DURATION scalar that specifies the window size. When window is an integer, it has the same time unit as *T*.\n\n**func** is a stateless user-defined function with one scalar as the return value. Arguments passed to *func* are as follows:\n\n* The first argument is a vector containing the previous window results.\n\n* Then followed by columns specified in *X*.\n\n* \\[Optional] Other fixed constants to be passed to func. In this case, you can fix the arguments with partial application.\n\n**leftClosed** (optional) is a Boolean value indicating whether the left boundary of the window is inclusive. The default value is false.\n\n#### Examples\n\nExample 1. When *leftClosed* is set to false:\n\n```\n// define a function\ndef myfunc(x, w){\nre = sum(x*w)\nreturn re\n}\n\ndateTime = 2021.09.09T09:28:00.000 2021.09.09T09:28:30.000 2021.09.09T09:30:00.000 2021.09.09T09:31:00.000 2021.09.09T09:32:00.000\nsecurityID = `600021`600021`600021`600021`600021\nvolume = 310 280 300 290 240\nprice = 1.5 1.6 1.7 1.6 1.5\nt = table(1:0, `dateTime`securityID`volume`price, [TIMESTAMP, SYMBOL, INT, DOUBLE])\ntableInsert(t, dateTime, securityID, volume, price)\noutput = table(100:0, `securityID`dateTime`factor1, [SYMBOL, TIMESTAMP, DOUBLE])\n\nengine = createReactiveStateEngine(name=\"test\", metrics=[<dateTime>, <genericTStateIterate(dateTime,volume,price,2m,myfunc{,})>], dummyTable=t, outputTable=output, keyColumn=`SecurityID, keepOrder=true)\nengine.append!(t)\ndropStreamEngine(`test)\n```\n\n| securityID | dateTime                | factor1    |\n| ---------- | ----------------------- | ---------- |\n| 600021     | 2021.09.09T09:28:00.000 | 1.5        |\n| 600021     | 2021.09.09T09:28:30.000 | 1.6        |\n| 600021     | 2021.09.09T09:30:00.000 | 930        |\n| 600021     | 2021.09.09T09:31:00.000 | 270,164    |\n| 600021     | 2021.09.09T09:32:00.000 | 65,062,560 |\n\nThe above example is calculated as follows:\n\n* As the timestamp of the first record is 09:28:00.000 and window size is 2 min, the initial window is \\[2021.09.09T09:28:00.000, 2021.09.09T09:30:00.000). For the first 2 records are included in the window, corresponding values of price are output to factor1 directly.\n\n* The 3rd record belongs to window (2021.09.09T09:26:30.000, 2021.09.09T09:28:30.000]. Data in the previous window \\[1.5, 1.6] and volume 300 are used for iteration. The result of myfunc(\\[1.5, 1.6], 300) is 930.\n\n* The 4th record belongs to window (2021.09.09T09:28:00.000, 2021.09.09T09:30:00.000]. Data in the previous window \\[1.6, 930] and volume 290 are used for iteration. The result of myfunc(\\[1.6, 930], 290) is 270164.\n\nThe calculation process is preceded in the same way if data ingestion continues.\n\nExample 2. When *leftClosed* is set to true:\n\n```\n$ engine = createReactiveStateEngine(name=\"test\", metrics=[<dateTime>, <genericTStateIterate(dateTime,volume,price,2m,myfunc{,},true)>], dummyTable=t, outputTable=output, keyColumn=`SecurityID, keepOrder=true)\n```\n\n| securityID | dateTime                | factor1    |\n| ---------- | ----------------------- | ---------- |\n| 600021     | 2021.09.09T09:28:00.000 | 1.5        |\n| 600021     | 2021.09.09T09:28:30.000 | 1.6        |\n| 600021     | 2021.09.09T09:30:00.000 | 930        |\n| 600021     | 2021.09.09T09:31:00.000 | 270,599    |\n| 600021     | 2021.09.09T09:32:00.000 | 65,166,960 |\n\nThe above example is calculated as follows:\n\n* As the timestamp of the first record is 09:28:00.000 and window size is 2 min, the initial window is \\[2021.09.09T09:28:00.000, 2021.09.09T09:30:00.000). For the first 2 records are included in the window, corresponding values of price are output to factor1 directly.\n\n* The 3rd record belongs to window \\[2021.09.09T09:26:30.000, 2021.09.09T09:28:30.000]. Data in the previous window is \\[1.5, 1.6] and volume is 300. The result of myfunc(\\[1.5, 1.6], 300) is 930.\n\n* The 4th record belongs to window \\[2021.09.09T09:28:00.000, 2021.09.09T09:30:00.000]. Data in the previous window \\[1.5, 1.6, 930] and volume 290 are used for iteration. The result of myfunc(\\[1.5, 1.6, 930], 290) is 270599.\n\nThe calculation process is preceded in the same way if data ingestion continues.\n\nRelated function: [genericStateIterate](https://docs.dolphindb.com/en/Functions/g/genericStateIterate.html)\n\n"
    },
    "genOutputColumnsForOBSnapshotEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/g/genoutputcolumnsforobsnapshotengine.html",
        "signatures": [
            {
                "full": "genOutputColumnsForOBSnapshotEngine([basic=true], [time=true], [depth], [tradeDetail=true], [orderDetail=true], [withdrawDetail=true], [orderBookDetailDepth=0], [prevDetail=true], [seqDetail=false], [residualDetail=false])",
                "name": "genOutputColumnsForOBSnapshotEngine",
                "parameters": [
                    {
                        "full": "[basic=true]",
                        "name": "basic",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[time=true]",
                        "name": "time",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[depth]",
                        "name": "depth",
                        "optional": true
                    },
                    {
                        "full": "[tradeDetail=true]",
                        "name": "tradeDetail",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[orderDetail=true]",
                        "name": "orderDetail",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[withdrawDetail=true]",
                        "name": "withdrawDetail",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[orderBookDetailDepth=0]",
                        "name": "orderBookDetailDepth",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[prevDetail=true]",
                        "name": "prevDetail",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[seqDetail=false]",
                        "name": "seqDetail",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[residualDetail=false]",
                        "name": "residualDetail",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [genOutputColumnsForOBSnapshotEngine](https://docs.dolphindb.com/en/Functions/g/genoutputcolumnsforobsnapshotengine.html)\n\n#### Syntax\n\ngenOutputColumnsForOBSnapshotEngine(\\[basic=true], \\[time=true], \\[depth], \\[tradeDetail=true], \\[orderDetail=true], \\[withdrawDetail=true], \\[orderBookDetailDepth=0], \\[prevDetail=true], \\[seqDetail=false], \\[residualDetail=false])\n\n#### Details\n\nThis function works with the order book engine and simplifies the process of creating an order book engine.\n\n#### Parameters\n\nThe following parameters specify which columns the order book should include. Each parameter name represents a column category, and each category contains multiple columns. See the [Appendix](https://docs.dolphindb.com/en/Functions/c/createOrderBookSnapshotEngine.md#) in `createOrderBookSnapshotEngine` for the column categories and the columns included in each category.\n\n**basic**: A Boolean value that specifies whether to output the columns in the basic category. The default value is true.\n\n**time**: A Boolean value that specifies whether to output the fields in the time category. The default value is true.\n\n**depth**: A tuple. Its length is 2, and the default value is (10, true).\n\n* The first element is an integer scalar in the range \\[0, 100], specifying the number of bid and ask levels for price and quantity. If it is 0, no columns in depth are output.\n* The second element is a Boolean value that determines how the price and quantity for multiple bid/ask levels are output. If it is false, the data is output in multiple columns; if it is true, the data is output as array vectors.\n\n**tradeDetail**: A Boolean value that specifies whether to output the columns in tradeDetail, excluding tradeBuyOrderTypeList and tradeSellOrderTypeList. The default value is true.\n\n**orderDetail**: A Boolean value that specifies whether to output the columns in orderDetail. The default value is true.\n\n**withdrawDetail**: A Boolean value that specifies whether to output the columns in withdrawDetail, excluding withdrawBuyOrderNoList and withdrawSellOrderNoList. The default value is true.\n\n**orderbookDetailDepth**: An integer scalar that specifies the depth level of order book details to output\\*.\\* The default value is 0, indicating that nothing is output. This parameter must have the same value as the *orderbookDetailDepth* parameter of `createOrderBookSnapshotEngine`.\n\n**prevDetail**: A Boolean value that specifies whether to output the columns in prevDetail. The default value is true.\n\n**seqDetail**: A Boolean value that specifies whether to output the columns in seqDetail. The default value is false.\n\n**residualDetail**: A Boolean value that specifies whether to output the columns in the remaining order details (residualDetail), excluding ResidualBidOrderNoList and ResidualAskOrderNoList. The default value is false.\n\n#### Returns\n\nA tuple containing two elements.\n\n* The first element is a string vector that lists the columns to include in the order book and can be used as the *outputColMap* parameter of `createOrderBookSnapshotEngine`.\n* The second element is an empty in-memory table that indicates the table schema required by the order book and can be used as the *outputTable* parameter of `createOrderBookSnapshotEngine`.\n\n#### Examples\n\nWhen you create an order book engine, use the *outputColMap* parameter to specify the columns to output and the *outputTable* parameter to specify the output table.\n\n`genOutputColumnsForOBSnapshotEngine` simplifies the process of defining these two parameters. Before you create the order book engine, perform the following steps:\n\nFirst, use `genOutputColumnsForOBSnapshotEngine` to specify the columns to output.\n\nThen, set *outputColMap* to the first element returned by `genOutputColumnsForOBSnapshotEngine`, and set *outputTable* to the second element.\n\nBefore you run the code, download the file [orderbookDemoInput.zip](https://docs.dolphindb.com/en/Functions/data/orderbookDemoInput.zip).\n\n```\ntry { dropStreamEngine(\"demo\") } catch(ex) { print(ex) }\n\nfilePath = \"./orderbookDemoInput.csv\"\n\n// Create a dummy table to define the schema of the input table, which will be passed to the dummyTable parameter\ncolNames = `SecurityID`Date`Time`SecurityIDSource`SecurityType`Index`SourceType`Type`Price`Qty`BSFlag`BuyNo`SellNo`ApplSeqNum`ChannelNo\ncolTypes = [SYMBOL, DATE, TIME, SYMBOL, SYMBOL, LONG, INT, INT, LONG, LONG, INT, LONG, LONG, LONG, INT]\ndummyOrderStream = table(1:0, colNames, colTypes)\n\n// Create a dictionary to define the meaning of each column in the input table, which will be passed to the inputColMap parameter\ninputColMap = dict(`codeColumn`timeColumn`typeColumn`priceColumn`qtyColumn`buyOrderColumn`sellOrderColumn`sideColumn`msgTypeColumn`seqColumn, `SecurityID`Time`Type`Price`Qty`BuyNo`SellNo`BSFlag`SourceType`ApplSeqNum)\n\n// Create a dictionary to define the previous day's closing prices, which will be passed to the prevClose parameter. prevClose does not affect any output columns other than the previous day's closing prices.\nprevClose = dict(`000587.SZ`002694.SZ`002822.SZ`000683.SZ`301063.SZ`300459.SZ`300057.SZ`300593.SZ`301035.SZ`300765.SZ, [1.66, 6.56, 6.10, 8.47, 38.10, 5.34, 9.14, 48.81, 60.04, 16.52])\n\n//Create outputColMap and outputTableSch to receive the return values of genOutputColumnsForOBSnapshotEngine. They are used to define outputColMap and the schema of outputTable, respectively.\noutputColMap, outputTableSch = genOutputColumnsForOBSnapshotEngine(basic=true, time=false, depth=(10, true), tradeDetail=true, orderDetail=false, withdrawDetail=false, orderBookDetailDepth=0, prevDetail=false)\nshare(outputTableSch, `sharedOutputTable)\ngo\n\nengine = createOrderBookSnapshotEngine(name=\"demo\", exchange=\"XSHE\", orderbookDepth=10, intervalInMilli = 1000, date=2022.01.10, startTime=09:15:00.000, prevClose=prevClose, dummyTable=dummyOrderStream, outputTable=outputTableSch, inputColMap=inputColMap, outputColMap=outputColMap, orderBookAsArray=true)\n\n// Batch-insert tick-by-tick data of 10 stocks into the order book engine\nengine.append!(select * from loadText(filePath) order by Time)\nselect top 10 * from sharedOutputTable where code=\"300593.SZ\", timestamp between 2022.01.10T13:15:01.000 and 2022.01.10T13:15:10.000\n```\n\nSome results are shown below:\n\n![](https://docs.dolphindb.com/en/Functions/images/4.png)\n\n"
    },
    "genShortGenomeSeq": {
        "url": "https://docs.dolphindb.com/en/Functions/g/genShortGenomeSeq.html",
        "signatures": [
            {
                "full": "genShortGenomeSeq(X, window)",
                "name": "genShortGenomeSeq",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [genShortGenomeSeq](https://docs.dolphindb.com/en/Functions/g/genShortGenomeSeq.html)\n\n#### Syntax\n\ngenShortGenomeSeq(X, window)\n\nAlias: genSGS\n\n#### Details\n\nThis function slides a window of fixed size (based on the number of characters) over the input DNA sequence. It encodes the characters in each window and returns an integral vector containing the encoded values.\n\n**Note**:\n\n* This function adopts a forward sliding window approach, starting from the first character of the sequence. The sliding window moves by one character at a time. It first takes the current character, then the next character, continuing until window characters are included.\n\n* If *window* exceeds the total length of *X*, an empty integral vector is returned.\n\n#### Parameters\n\n**X** is a STRING scalar or CHAR vector.\n\n**window** is a positive integer in \\[2,28].\n\n#### Returns\n\nReturns an integer vector whose length is equal to the number of characters in *X*, as specified below:\n\n| *window* Range | Return Type       |\n| -------------- | ----------------- |\n| \\[2,4]         | FAST SHORT VECTOR |\n| \\[5,12]        | FAST INT VECTOR   |\n| \\[13,28]       | FAST LONG VECTOR  |\n\n#### Examples\n\n```\ngenShortGenomeSeq(\"NNNNNNNNTCGGGGCAT\",3)\n// output: [,,,,,,,,795,815,831,831,830,824,801,,]\n\ngenShortGenomeSeq(\"TCGGGGCATNGCCCG\",4)\n// output: [1135,1215,1279,1278,1272,1249,,,,,1258,1195,,,]\n\ngenShortGenomeSeq(\"GCCCGATNNNNN\",6)\n// output: [396972,395953,,,,,,,,,,]\n\ngenShortGenomeSeq(\"TCGATCGTCGATCGTCGATCGTCGATCGG\",5)\n// output: [328113,328390,328475,327789,328118,328411,328556,328113,328390,328475,327789,328118,328411,328556,328113,328390,328475,327789,328118,328411,328556,328113,328390,328475,327791,,,,]\n\ngenShortGenomeSeq(\"ACTT\",8)\n// output: [,,,]\n```\n\nRelated functions: [encodeShortGenomeSeq](https://docs.dolphindb.com/en/Functions/e/encodeShortGenomeSeq.html), [decodeShortGenomeSeq](https://docs.dolphindb.com/en/Functions/d/decodeShortGenomeSeq.html)\n\n"
    },
    "geoWithin": {
        "url": "https://docs.dolphindb.com/en/Functions/g/geoWithin.html",
        "signatures": [
            {
                "full": "geoWithin(X, polygonVertices, [containBoundary=true])",
                "name": "geoWithin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "polygonVertices",
                        "name": "polygonVertices"
                    },
                    {
                        "full": "[containBoundary=true]",
                        "name": "containBoundary",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [geoWithin](https://docs.dolphindb.com/en/Functions/g/geoWithin.html)\n\n#### Syntax\n\ngeoWithin(X, polygonVertices, \\[containBoundary=true])\n\n#### Details\n\nDetermine whether *X* lies inside or outside *polygonVertices*.\n\n#### Parameters\n\n**X** is a POINT scalar/vector, indicating one or multiple points.\n\n**polygonVertices** is a POINT vector, indicating a polygon.\n\n**containBoundary** (optional) is a Boolean scalar, indicating whether the points on the polygon boundary are considered inside. The default value is true.\n\n#### Returns\n\nA Boolean scalar/vector.\n\n#### Examples\n\n```\npoint1 = point(1,1)\npoint2 = point(2,3)\npoint3 = point(2,1)\npolygon = [point(0,0),point(0,2),point(2,2),point(2,0)]\ngeoWithin([point1,point2],polygon)\n// output: [true,false,true]\ngeoWithin([point1,point2,point3],polygon,false)\n// output: [true,false,false]\n```\n\n"
    },
    "getAclAuditLog": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getaclauditlog.html",
        "signatures": [
            {
                "full": "getAclAuditLog([userId], [startTime], [endTime], [opType])",
                "name": "getAclAuditLog",
                "parameters": [
                    {
                        "full": "[userId]",
                        "name": "userId",
                        "optional": true
                    },
                    {
                        "full": "[startTime]",
                        "name": "startTime",
                        "optional": true
                    },
                    {
                        "full": "[endTime]",
                        "name": "endTime",
                        "optional": true
                    },
                    {
                        "full": "[opType]",
                        "name": "opType",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getAclAuditLog](https://docs.dolphindb.com/en/Functions/g/getaclauditlog.html)\n\n#### Syntax\n\ngetAclAuditLog(\\[userId], \\[startTime], \\[endTime], \\[opType])\n\n#### Details\n\nObtain the ACL operations of specific *opType* executed by user *userId* between *startTime* and *endTime* (exclusive).\n\n#### Parameters\n\n**userId** (optional) is a STRING scalar or vector indicating the user ID. If it is not provided (left as the default value of null), it means that ACL operations of all users are obtained.\n\n**startTime**(optional) is an integral scalar or temporal scalar of DATE, MONTH, DATETIME, TIMESTAMP, DATEHOUR, or NANOTIMESTAMP type. It is the start time of the log. The default value is 1970.01.01, indicating midnight on January 1, 1970.\n\n**endTime**(optional) is an integral scalar or temporal scalar of DATE, MONTH, DATETIME, TIMESTAMP, DATEHOUR, or NANOTIMESTAMP type. It is the end time of the log. The default value is null, indicating the current time. Note that *endTime* must be greater than *startTime*.\n\n**opType**(optional) is a STRING scalar or vector indicating the operation type. If it is not provided (left as the default value of null), it means that all ACL operations are obtained. For *opType* options, see the descriptions in the table following this discussion of Arguments.\n\n#### Returns\n\nA table containing the following columns:\n\n* userId: The ID of the user perform the operation.\n* startTime: The time when the operation started.\n* endTime: The time when the operation ended.\n* opType: The operation type.\n* opDetail: The detailed operation.\n* remoteIp: The IP address of the client that submits the operation.\n* remotePort: The port of the client that submits the operation.\n* nodeAlias: The alias of the node where the operation is submitted.\n\nThe corresponding *opDetail* of each *opType*are shown below:\n\n| opType                  | opDetail                                           | Description                                                                              |\n| ----------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| login                   | login userId=xxx encrypted=true/false              | user login                                                                               |\n| logout                  | logout userId=xxx sessionOnly=true/false           | user logout                                                                              |\n| createUser              | userId=xxx groupId=xxx isAdmin=true/false          | create user                                                                              |\n| createGroup             | groupId=xxx userIds=\\[xxx,xxx,…]                   | create user group                                                                        |\n| resetPwd                | userId=xxx                                         | reset password                                                                           |\n| changePwd               |                                                    | change password                                                                          |\n| deleteUser              | userId=xxx                                         | delete user                                                                              |\n| deleteGroup             | groupId=xxx                                        | delete user group                                                                        |\n| addGroupMember          | userIds=\\[xxx,xxx,…] groupIds=\\[xxx,xxx,…]         | add member(s) to group                                                                   |\n| deleteGroupMember       | userIds=\\[xxx,xxx,…] groupIds=\\[xxx,xxx,…]         | delete member(s) from group                                                              |\n| grant                   | userOrGroupId=xxx accessType=xxx objs=\\[xxx,xxx,…] | grant privilege                                                                          |\n| deny                    | userOrGroupId=xxx accessType=xxx objs=\\[xxx,xxx,…] | deny privilege                                                                           |\n| revokeByDFSOperation    | oldObj=xxx newObjs=\\[xxx,xxx,…]                    | revoke related privilegesperforming upon executingdropDatabase, dropTable or dropColumn! |\n| replaceByDFSOperation   | oldObj=xxx newObjs=\\[xxx,xxx,…]                    | update related privileges upon executingrenameTable and replaceColumn!                   |\n| revoke                  | userOrGroupId=xxx accessType=xxx objs=\\[xxx,xxx,…] | revoke privilege                                                                         |\n| createCatalog           | catalog=xxx                                        | create catalog                                                                           |\n| dropCatalog             | catalog=xxx                                        | delete catalog                                                                           |\n| renameCatalog           | catalog=xxx new catalog=xxx                        | rename catalog                                                                           |\n| renameSchema            | catalog=xxx schema=xxx new schema=xxx              | rename schema                                                                            |\n| createSchema            | catalog=xxx dbUrl=xxx schema=xxx                   | create schema                                                                            |\n| dropSchema              | catalog=xxx schema=xxx                             | delete schema                                                                            |\n| tryDropSchemaByDatabase | dbUrl=xxx                                          | remove corresponding schemas from the catalog upon deleting the database                 |\n| setMaxJobPriority       | maxJobPriority=xxx                                 | specify the highest priority of the jobs                                                 |\n| setMaxJobParallelism    | maxJobParallelism=xxx                              | specify the maximum number of task that can be concurrently executed for the jobs        |\n| newConnection           |                                                    | receive a new connection                                                                 |\n| closeConnection         |                                                    | close connection                                                                         |\n| saveClusterNodes        |                                                    | modify *nodes.cfg*                                                                       |\n| saveClusterNodesConfigs |                                                    | modify *cluster.cfg*                                                                     |\n| saveControllerConfigs   |                                                    | modify *controller.cfg*                                                                  |\n| loadClusterNodesConfigs |                                                    | read *nodes.cfg*                                                                         |\n| loadControllerConfigs   |                                                    | read *controller.cfg*                                                                    |\n\n#### Examples\n\nFirst, set *enableAuditLog*=true in the configuration file. Then, use getAclAuditLog to query all ACL operations.\n\n```\nlogin(\"admin\",\"123456\")\ncreateUser(\"user1\",\"abcdec\")\ngrant(\"user1\",TABLE_READ,\"*\")\nlogout()\nlogin(\"admin\",\"123456\")\ngetAclAuditLog()\n```\n\nOutput:\n\n| userId | time                          | opType        | opDetail                                            | remoteIp      | remotePort | nodeAlias |\n| ------ | ----------------------------- | ------------- | --------------------------------------------------- | ------------- | ---------- | --------- |\n| guest  | 2025.01.02 14:26:52.738224592 | newConnection |                                                     | 192.168.0.130 | 55,428     | datanode1 |\n| guest  | 2025.01.02 14:26:53.049518446 | login         | login userId=admin encrypted=false                  | 192.168.0.130 | 55,428     | datanode1 |\n| admin  | 2025.01.02 14:26:53.059963095 | createUser    | userId=user1 groupIds=\\[] isAdmin=false             | 192.168.0.130 | 55,428     | datanode1 |\n| admin  | 2025.01.02 14:26:53.060387348 | grant         | userOrGroupId=user1 accessType=TABLE\\_READ objs=\\[] | 192.168.0.130 | 55,428     | datanode1 |\n| guest  | 2025.01.02 14:26:53.060426785 | logout        | logout userId=admin sessionOnly=true                | 192.168.0.130 | 55,428     | datanode1 |\n| guest  | 2025.01.02 14:26:53.060576365 | login         | login userId=admin encrypted=false                  | 192.168.0.130 | 55,428     | datanode1 |\n| guest  | 2025.01.08 09:46:49.710254224 | newConnection |                                                     | 192.168.0.130 | 41,746     | datanode1 |\n| guest  | 2025.01.08 09:46:52.124830142 | login         | login userId=admin encrypted=false                  | 192.168.0.130 | 41,746     | datanode1 |\n| admin  | 2025.01.08 09:46:52.127153771 | createUser    | userId=user1 groupIds=\\[] isAdmin=false             | 192.168.0.130 | 41,746     | datanode1 |\n| admin  | 2025.01.08 09:46:52.127752666 | grant         | userOrGroupId=user1 accessType=TABLE\\_READ objs=\\[] | 192.168.0.130 | 41,746     | datanode1 |\n\n"
    },
    "getActiveMaster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getActiveMaster.html",
        "signatures": [
            {
                "full": "getActiveMaster()",
                "name": "getActiveMaster",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getActiveMaster](https://docs.dolphindb.com/en/Functions/g/getActiveMaster.html)\n\n\n\n#### Syntax\n\ngetActiveMaster()\n\n#### Details\n\nReturn the alias of the controller node of a cluster. For a cluster with multiple controller nodes, return the alias of the Leader controller node. Please note that this function can only be executed on the controller.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetActiveMaster();\n// output: controller1\n```\n"
    },
    "getAggregator": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAggregator.html",
        "signatures": [
            {
                "full": "getStreamEngine(name)",
                "name": "getStreamEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getAggregator](https://docs.dolphindb.com/en/Functions/g/getAggregator.html)\n\nAlias for [getStreamEngine](https://docs.dolphindb.com/en/Functions/g/getStreamEngine.html)\n\n\nDocumentation for the `getStreamEngine` function:\n### [getStreamEngine](https://docs.dolphindb.com/en/Functions/g/getStreamEngine.html)\n\n\n\n#### Syntax\n\ngetStreamEngine(name)\n\n#### Parameters\n\n**name** is a string indicating the name of the stream engine. It is the only identifier of the stream engine. It can have letter, number and \"\\_\". It must start with a letter.\n\n#### Details\n\nReturn the handle of a stream engine. It can be used as the handler of [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html).\n\n#### Examples\n\n```\nshare streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT]) as trades\noutputTable = table(10000:0, `time`sym`sumQty, [TIMESTAMP, SYMBOL, INT])\ntradesAggregator = createTimeSeriesEngine(\"StreamAggregatorDemo\",3, 3, <[sum(qty)]>, trades, outputTable, `time, false,`sym, 50)\nsubscribeTable(, \"trades\", \"tradesAggregator\", 0, append!{tradesAggregator}, true)\n\ndef writeData(n){\n   timev = 2018.10.08T01:01:01.001 + timestamp(1..n)\n   symv =take(`A`B, n)\n   qtyv = take(1, n)\n   insert into trades values(timev, symv, qtyv)\n}\n\nwriteData(6);\nh = getStreamEngine(\"StreamAggregatorDemo\")\n```\n"
    },
    "getAggregatorStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAggregatorStat.html",
        "signatures": [
            {
                "full": "getStreamEngineStat()",
                "name": "getStreamEngineStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getAggregatorStat](https://docs.dolphindb.com/en/Functions/g/getAggregatorStat.html)\n\nAlias for [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html)\n\n\nDocumentation for the `getStreamEngineStat` function:\n### [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html)\n\n\n\n#### Syntax\n\ngetStreamEngineStat()\n\nAlias: getAggregatorStat\n\n#### Details\n\nGet the status of the stream engine.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a dictionary of tables with various metrics about all stream engines.\n\n* Table *TimeSeriesEngine* returns the following columns about time-series engines:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | windowTime        | the length of the data window                                                  |\n  | step              | the duration between 2 adjacent windows                                        |\n  | useSystemTime     | the value of parameter useSystemTime in function createTimeSeriesEngine        |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | numGroups         | the number of groups that the stream engine has handled                        |\n  | numRows           | the number of records that has entered the stream engine                       |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | memoryUsed        | the amount of memory used                                                      |\n  | snapshotDir       | the directory to save engine snapshot                                          |\n  | snapshotInterval  | the interval to save snapshot                                                  |\n  | snapshotMsgId     | the msgId of engine snapshot                                                   |\n  | snapshotTimestamp | the timestamp of snapshot                                                      |\n\n* Table *CrossSectionalEngine* returns the following columns about cross-sectional engines:\n\n  | Column Name        | Description                                                                  |\n  | ------------------ | ---------------------------------------------------------------------------- |\n  | name               | name of the stream engine                                                    |\n  | user               | name of the user who created the stream engine                               |\n  | status             | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg         | the latest error message                                                     |\n  | numRows            | the number of records that has entered the stream engine                     |\n  | numMetrics         | the number of metrics calculated by the stream engine                        |\n  | metrics            | the metacode of the metrics calculated by the stream engine                  |\n  | triggeringPattern  | how calculations are triggered                                               |\n  | triggeringInterval | the duration in milliseconds between 2 adjacent calculations                 |\n  | memoryUsed         | the amount of memory used                                                    |\n\n* Table *AnomalyDetectionEngine* returns the following columns about the anomaly detection engines:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | numGroups         | the number of groups that the stream engine has handled                        |\n  | numRows           | the number of records that has entered the stream engine                       |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | snapshotDir       | the directory to save engine snapshot                                          |\n  | snapshotInterval  | the interval to save snapshot                                                  |\n  | snapshotMsgId     | the msgId of engine snapshot                                                   |\n  | snapshotTimestamp | the timestamp of snapshot                                                      |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | memoryUsed        | the amount of memory used                                                      |\n\n* Table *ReactiveStreamEngine* returns the following columns about the reactive state engines:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the reactive state engine                                            |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | metrics           | the metacode of the metrics calculated by the stream engine                  |\n  | snapshotDir       | the directory to save engine snapshot                                        |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the msgId of engine snapshot                                                 |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *SessionWindowEngine* returns the following columns about the session window engine:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                    |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | memoryUsed        | the amount of memory used                                                    |\n  | snapshotDir       | the directory to save snapshot                                               |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                    |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *DailyTimeSeriesEngine* returns the following columns about the daily time series engine:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | windowTime        | the length of the window                                                       |\n  | step              | the duration between 2 adjacent windows                                        |\n  | useSystemTime     | the value of parameter useSystemTime in function createDailyTimeSeriesEngine   |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | numGroups         | the number of groups that the stream engine has handled                        |\n  | numRows           | the number of records that has entered the stream engine                       |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | memoryUsed        | the amount of memory used                                                      |\n  | snapshotDir       | the directory to save snapshot                                                 |\n  | snapshotInterval  | the interval to save snapshot                                                  |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                      |\n  | snapshotTimestamp | the timestamp of snapshot                                                      |\n\n* Table *AsofJoinEngine* returns the following columns about the as of join engine:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | useSystemTime     | the value of parameter useSystemTime in function createAsofJoinEngine          |\n  | delayedTime       | the value of parameter delayedTime in function createAsofJoinEngine            |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | leftTableNumRows  | the number of records in the left table of stream engine                       |\n  | rightTableNumRows | the number of records in the right table of stream engine                      |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | memoryUsed        | the amount of memory used                                                      |\n\n* Table *EquiJoinEngine* returns the following columns about the equi join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n\n* Table *WindowJoinEngine* returns the following columns about the window join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n  | numGroups         | the number of groups                                                                |\n\n* Table *LookupJoinEngine* returns the following columns about the lookup join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n\n* Table *LeftSemiJoinEngine* returns the following columns about the left semi join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n\n* Table *SnapshotJoinEngine* returns the following columns about snapshot join engines:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                    |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | leftTableNumRows  | the number of records in the left table of stream engine                     |\n  | rightTableNumRows | the number of records in the right table of stream engine                    |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | metrics           | the metacode of the metrics calculated by the stream engine                  |\n  | memoryUsed        | the amount of memory used                                                    |\n\n* Table *DualOwnershipReactiveStreamEngine* returns the following columns about the dual ownership reactive state engine:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the engine                                                           |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | memoryUsed        | the amount of memory used                                                    |\n  | snapshotDir       | the directory to save snapshot                                               |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                    |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *NarrowReactiveStreamEngine* returns the following columns about the narrow reactive state engine:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the engine                                                           |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | memoryUsed        | the amount of memory used                                                    |\n  | snapshotDir       | the directory to save snapshot                                               |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                    |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *StreamFilter* returns the following columns about stream filter:\n\n  | Column Name | Description                                                                  |\n  | ----------- | ---------------------------------------------------------------------------- |\n  | name        | name of the stream engine                                                    |\n  | user        | name of the user who created the stream engine                               |\n  | status      | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg  | the latest error message                                                     |\n  | numRows     | the number of records that has entered the stream engine                     |\n  | filters     | the filtering condition                                                      |\n\n* Table *StreamDispatchEngine* returns the following columns about stream dispatch engines:\n\n  | Column Name | Description                                                                  |\n  | ----------- | ---------------------------------------------------------------------------- |\n  | name        | name of the stream engine                                                    |\n  | user        | name of the user who created the stream engine                               |\n  | status      | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg  | the latest error message                                                     |\n  | numRows     | the number of records that has entered the stream engine                     |\n  | memoryUsed  | the amount of memory used                                                    |\n\n* Table *TimeBucketEngine* returns the following columns about time bucket engines:\n\n  | Column Name | Description                                                                       |\n  | ----------- | --------------------------------------------------------------------------------- |\n  | name        | name of the time bucket engine                                                    |\n  | user        | name of the user who created the time bucket engine                               |\n  | status      | status of the time bucket engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg  | the latest error message                                                          |\n  | numGroups   | the number of groups that the time bucket engine has handled                      |\n  | numRows     | the number of records that has entered the time bucket engine                     |\n  | numMetrics  | the number of metrics calculated by the time bucket engine                        |\n  | metrics     | the metacode of the metrics calculated by the time bucket engine                  |\n  | memoryUsed  | the amount of memory used                                                         |\n\n#### Examples\n\n```\nshare streamTable(10:0,`time`sym`price`qty,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades\noutputTable1 = table(10000:0, `time`sym`sumQty, [TIMESTAMP, SYMBOL, INT])\noutputTable2 = table(1:0, `time`avgPrice`sumqty`Total, [TIMESTAMP,DOUBLE,INT,DOUBLE])\ntradesTsEngine = createTimeSeriesEngine(name=\"TimeSeriesDemo\", windowSize=3, step=3, metrics=<[sum(qty)]>, dummyTable=trades, outputTable=outputTable1, timeColumn=`time, keyColumn=`sym, garbageSize=50)\ntradesCsEngine=createCrossSectionalEngine(name=\"CrossSectionalDemo\", metrics=<[avg(price), sum(qty), sum(price*qty)]>, dummyTable=trades, outputTable=outputTable2, keyColumn=`sym, triggeringPattern=`perRow)\nsubscribeTable(tableName=\"trades\", actionName=\"tradesTsEngine\", offset=0, handler=append!{tradesTsEngine}, msgAsTable=true)\nsubscribeTable(tableName=\"trades\", actionName=\"tradesCsEngine\", offset=0, handler=append!{tradesCsEngine}, msgAsTable=true)\n\ndef writeData(n){\n   timev = 2000.10.08T01:01:01.001 + timestamp(1..n)\n   symv =take(`A`B, n)\n   pricev=take(102.1 33.4 73.6 223,n)\n   qtyv = take(60 74 82 59, n)\n   insert into trades values(timev, symv, pricev,qtyv)\n}\n\nwriteData(4);\n\ngetStreamEngineStat().TimeSeriesEngine;\ngetStreamEngineStat().CrossSectionalEngine;\n```\n"
    },
    "getAllCatalogs": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAllCatalogs.html",
        "signatures": [
            {
                "full": "getAllCatalogs()",
                "name": "getAllCatalogs",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getAllCatalogs](https://docs.dolphindb.com/en/Functions/g/getAllCatalogs.html)\n\n#### Syntax\n\ngetAllCatalogs()\n\n#### Details\n\nGet all available catalogs.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING vector containing all catalog names.\n\n#### Examples\n\n```\ngetAllCatalogs()\n//Output: [\"catalog1\", \"catalog2\", \"catalog3\"]\n```\n\n"
    },
    "getAllClusters": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAllClusters.html",
        "signatures": [
            {
                "full": "getAllClusters()",
                "name": "getAllClusters",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getAllClusters](https://docs.dolphindb.com/en/Functions/g/getAllClusters.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetAllClusters()\n\n#### Details\n\nReturn the names of all clusters. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table with the following columns:\n\n* clusterName: A string indicating the name of the cluster.\n* clusterType: A string indicating the type of the cluster. “momCluster” refers to the an MoM cluster in a multi-cluster environment, while ”memberCluster” refers to a member cluster.\n* status: An integer indicating whether the cluster is alive. 0: Abnormal; 1: Alive.\n\n#### Examples\n\n```\ngetAllClusters()\n```\n\n| clusterName      | clusterType   | status |\n| ---------------- | ------------- | ------ |\n| member\\_cluster2 | memberCluster | 1      |\n| mom\\_cluster1    | momCluster    | 1      |\n| member\\_cluster1 | memberCluster | 1      |\n"
    },
    "getAllDBGranularity": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAllDBGranularity.html",
        "signatures": [
            {
                "full": "getAllDBGranularity()",
                "name": "getAllDBGranularity",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getAllDBGranularity](https://docs.dolphindb.com/en/Functions/g/getAllDBGranularity.html)\n\n#### Syntax\n\ngetAllDBGranularity()\n\n#### Details\n\nThis function can only be executed on a data node. It returns the chunk granularity of all databases on the current node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA dictionary, where\n\n* key: the database name;\n\n* value: the chunk granularity (TABLE or DATABASE). Refer to parameter *chunkGranularity* of function [database](https://docs.dolphindb.com/en/Functions/d/database.html) for details.\n\n#### Examples\n\n```\ngetAllDBGranularity()\n// output: /valuedb->TABLE\n```\n\n"
    },
    "getAllDBs": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAllDBs.html",
        "signatures": [
            {
                "full": "getAllDBs()",
                "name": "getAllDBs",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getAllDBs](https://docs.dolphindb.com/en/Functions/g/getAllDBs.html)\n\n\n\n#### Syntax\n\ngetAllDBs()\n\n#### Details\n\nObtain the distributed database on the current node.\n\n**Note**: In the cluster mode, this function may not return all databases. To obtain all databases in the entire cluster, you can use the [`getClusterDFSDatabases()`](https://docs.dolphindb.com/en/Functions/g/getClusterDFSDatabases.html) function, or use `[pnodeRun](../p/pnodeRun.md)(getAllDBs)` to get database information on specified node in the cluster.\n\nFrom version 1.30.21/2.00.9 onwards,\n\n* For an administrator or a non-admin user granted with DB\\_MANAGE privilege, the function returns all DFS databases on the current node;\n\n* Otherwise, the function returns DFS databases to which the user is granted with the DB\\_OWNER privilege.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a dictionary containing the information of DFS databases on the current node. The keys are the database names and the values are the table names, and the following numbers indicates the number of the table in this database (starting from 1), whether it has been deleted (1 means it has been deleted).\n\n#### Examples\n\n```\ngetAllDBs();\n```\n\n| key     | value         |\n| ------- | ------------- |\n| /listdb | pt:2:0:pt\\_2; |\n"
    },
    "getAuditLog": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAuditLog.html",
        "signatures": [
            {
                "full": "getAuditLog([userId], [startTime], [endTime], [opType])",
                "name": "getAuditLog",
                "parameters": [
                    {
                        "full": "[userId]",
                        "name": "userId",
                        "optional": true
                    },
                    {
                        "full": "[startTime]",
                        "name": "startTime",
                        "optional": true
                    },
                    {
                        "full": "[endTime]",
                        "name": "endTime",
                        "optional": true
                    },
                    {
                        "full": "[opType]",
                        "name": "opType",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getAuditLog](https://docs.dolphindb.com/en/Functions/g/getAuditLog.html)\n\n#### Syntax\n\ngetAuditLog(\\[userId], \\[startTime], \\[endTime], \\[opType])\n\n#### Details\n\nObtain the DDL operations of specific *opType* executed by user *userId* between *startTime* and *endTime* (exclusive).\n\nThe corresponding *opDetail* of each *opType*are shown below:\n\n| opType                     | opDetail                                          | Description                                                                                                |\n| -------------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| CREATE\\_DB                 |                                                   | create databases                                                                                           |\n| DROP\\_DB                   |                                                   | drop databases                                                                                             |\n| CREATE\\_TABLE              |                                                   | create dimension tables                                                                                    |\n| CREATE\\_PARTITIONED\\_TABLE |                                                   | create partitioned tables                                                                                  |\n| DROP\\_TABLE                |                                                   | drop tables                                                                                                |\n| DROP\\_PARTITION            | deletedPartitions=xxx                             | drop partitions                                                                                            |\n| RENAME\\_TABLE              | tableName=\\[xxx], newTableName=\\[xxx]             | rename tables                                                                                              |\n| SQL\\_DELETE                | script=\\[xxx], deletedRows=xxx                    | SQL delete                                                                                                 |\n| SQL\\_UPDATE                | script=\\[xxx], updatedRows=xxx                    | SQL update                                                                                                 |\n| UPSERT                     | insertedRows=xxx, updatedRows=xxx                 | update data with `upsert!`                                                                                 |\n| ADD\\_COLUMN                | colName=\\[xxx], colType=\\[xxx]                    | add columns                                                                                                |\n| SET\\_COLUMN\\_COMMENT       | colName=\\[xxx], colComment=\\[xxx]                 | set column comment                                                                                         |\n| TRUNCATE\\_TABLE            |                                                   | truncate tables                                                                                            |\n| RENAME\\_COLUMN             | colName=\\[xxx], newColName=\\[xxx]                 | rename columns                                                                                             |\n| REPLACE\\_COLUMN            | colName=\\[xxx], colType=\\[xxx], newColType=\\[xxx] | replace columns with `replaceColumn!`                                                                      |\n| DROP\\_COLUMN               | columnName=\\[xxx]                                 | drop columns                                                                                               |\n| ADD\\_RANGE\\_PARTITION      |                                                   | add RANGE partitions with `addRangePartitions`                                                             |\n| ADD\\_VALUE\\_PARTITION      |                                                   | add VALUE partitions with `addValuePartitions`                                                             |\n| APPEND                     | appendedRows=xxx                                  | append data to databases (with *atomic*='TRANS') or dimension tables of databases (with *atomic*='CHUNKS') |\n| APPEND\\_CHUNK\\_GRANULARITY | appendedRows=xxx                                  | append data to partitioned tables of databases (with *atomic*='CHUNKS')                                    |\n\n#### Parameters\n\n**userId** (optional) is a STRING scalar or vector indicating the user ID. If it is not provided (left as the default value of null), it means that DDL operations of all users are obtained.\n\n**startTime**(optional) is an integral scalar or temporal scalar of DATE, MONTH, DATETIME, TIMESTAMP, DATEHOUR, or NANOTIMESTAMP type. It is the start time of the log. The default value is 1970.01.01.\n\n**endTime**(optional) is an integral scalar or temporal scalar of DATE, MONTH, DATETIME, TIMESTAMP, DATEHOUR, or NANOTIMESTAMP type. It is the end time of the log. The default value is null, indicating the current time. Note that *endTime* must be greater than *startTime*.\n\n**opType**(optional) is a STRING scalar or vector indicating the operation type. If it is not provided (left as the default value of null), it means that all DDL operations are obtained. For *opType* options, see the descriptions in the table following this discussion of Arguments.\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* userId: The ID of the user perform the operation.\n* startTime: The time when the transaction started.\n* endTime: The time when the transaction ended.\n* dbName: The database name.\n* tbName: The table name.\n* opType: The operation type.\n* opDetail: The detailed operation.\n* tid: The transaction ID.\n* cid: The commit ID.\n* remoteIp: The IP address of the client that submits the operation.\n* remotePort: The port of the client that submits the operation.\n* nodeAlias: The alias of the node where the operation is submitted.\n\n#### Examples\n\n```\n// Perform DDL operations\nlogin(\"admin\",\"123456\")\nn = 3\nid = rand(`st0001`st0002`st0003`st0004`st0005, n)\nsym = rand(`A`B, n)\ntradeDate = take(2022.01.01..2022.01.10, 3)\nval = 1..n\ndummyTb = table(id, sym,tradeDate, val)\n\ndbPath = \"dfs://auditTest\"\nif(existsDatabase(dbPath)){dropDatabase(dbPath)}\ndb = database(directory=dbPath, partitionType=VALUE, partitionScheme=2022.01.01..2022.01.05, engine='TSDB')\npt = createPartitionedTable(dbHandle=db, table=dummyTb, tableName=\"snap\", partitionColumns=`TradeDate, sortColumns=`id`tradeDate, keepDuplicates=ALL)\npt.append!(dummyTb)\n\nrenameTable(db, `snap, `snap_2)\n\n// Get the log of the above operations\ngetAuditLog()\n```\n\nOutput:\n\n| userName | startTime                     | endTime                       | dbName           | tbName | opType                     | opDetail                                   | tid | cid | remoteIp      | nodeAlias |\n| -------- | ----------------------------- | ----------------------------- | ---------------- | ------ | -------------------------- | ------------------------------------------ | --- | --- | ------------- | --------- |\n| admin    | 2024.03.26 14:40:43.659196080 | 2024.03.26 14:40:43.676082419 | dfs\\://auditTest |        | CREATE\\_DB                 |                                            | 1   | 1   | 192.168.0.140 | datanode1 |\n| admin    | 2024.03.26 14:40:43.676154581 | 2024.03.26 14:40:43.687319577 | dfs\\://auditTest | snap   | CREATE\\_PARTITIONED\\_TABLE |                                            | 2   | 2   | 192.168.0.140 | datanode1 |\n| admin    | 2024.03.26 14:40:45.135000207 | 2024.03.26 14:40:45.160530442 | dfs\\://auditTest | snap   | RENAME\\_TABLE              | tableName=\\[snap], newTableName=\\[snap\\_2] | 4   | 4   | 192.168.0.14  | datanode1 |\n\n"
    },
    "getAuthenticatedUsers": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getAuthenticatedUsers.html",
        "signatures": [
            {
                "full": "getAuthenticatedUsers()",
                "name": "getAuthenticatedUsers",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getAuthenticatedUsers](https://docs.dolphindb.com/en/Functions/g/getAuthenticatedUsers.html)\n\n\n\n#### Syntax\n\ngetAuthenticatedUsers()\n\n#### Details\n\nObtain the information about users who are currently logged in on all nodes.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ngetAuthenticatedUsers()\n// output: [\"admin\",\"a1\",\"a3\",\"a2\",\"a4\"]\n```\n"
    },
    "getAuthenticatedUserTicket": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getauthenticateduserticket.html",
        "signatures": [
            {
                "full": "getAuthenticatedUserTicket([expire])",
                "name": "getAuthenticatedUserTicket",
                "parameters": [
                    {
                        "full": "[expire]",
                        "name": "expire",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getAuthenticatedUserTicket](https://docs.dolphindb.com/en/Functions/g/getauthenticateduserticket.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetAuthenticatedUserTicket(\\[expire])\n\n#### Details\n\nA currently logged in user can use this function to generate a dynamic ticket and set the expiration time of the ticket. The user can then use the generated ticket for passwordless login via the `authenticateByTicket(ticket)` function.\n\n#### Parameters\n\n**expire** is a DATETIME scalar indicating the expiration time of the user ticket to be generated.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nlogin(\"user1\", \"123456\")\ngetAuthenticatedUserTicket(2030.12.31T12:00:00)\n/ output: \nVQEpuZYCbwhPDj6qvuyW+zDwdnQI3HiUhfJOpyUW/J5X5XZmponkmE6n5COI1xUP\nxCVr29VHsNYOV00tGZrFkGKPOJhjWJtSt85ok5s8EVYXwZCgdrYjdharJLBk/e04\nu1oBC0/6nD4WdDM68pCbsZgUqDe94+czqG0M21Sy8PA=\n/\n```\n"
    },
    "getBackupList": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getBackupList.html",
        "signatures": [
            {
                "full": "getBackupList(backupDir, dbPath, tableName)",
                "name": "getBackupList",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [getBackupList](https://docs.dolphindb.com/en/Functions/g/getBackupList.html)\n\n\n\n#### Syntax\n\ngetBackupList(backupDir, dbPath, tableName)\n\n#### Details\n\nObtain all backup information for the spicified DFS table.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory where the backup is saved.\n\n**dbPath** is a string indicating the path of a distributed database.\n\n**tableName** is a string indicating a distributed table name.\n\n#### Returns\n\nReturn a table with information about the backups of a DFS table. Each row of the table corresponds to a backed-up partition. The table contains the following columns:\n\n* chunkID: the chunk ID\n\n* chunkPath: the DFS path to database chunks\n\n* cid: the commit ID\n\n* rows: the number of records in a chunk\n\n* updateTime: the last update time\n\n#### Examples\n\n```\nif(existsDatabase(\"dfs://valuedb\")){\n   dropDatabase(\"dfs://valuedb\")\n}\nn=3000000\nmonth=take(2000.01M..2000.04M, n);\nx=1..n\nt=table(month,x);\n\n\ndb=database(\"dfs://valuedb\", VALUE, 2000.01M..2000.04M)\npt = db.createPartitionedTable(t, `pt, `month);\npt.append!(t);\nbackup(\"/home/DolphinDB/backup\",\"dfs://valuedb\",tableName=\"pt\");\ngetBackupList(\"/home/DolphinDB/backup\",\"dfs://valuedb\",\"pt\");\n```\n\n| chunkID                              | chunkPath                  | cid    | rows    | updateTime              |\n| ------------------------------------ | -------------------------- | ------ | ------- | ----------------------- |\n| 0061427c-4b24-e3b6-425c-c0e1553d3c35 | dfs\\://valuedb/200001M/b39 | 13,348 | 750,000 | 2022.09.21T15:45:50.931 |\n| dabbd90d-6001-f8a9-4d3e-8000d96eba68 | dfs\\://valuedb/200002M/b39 | 13,348 | 750,000 | 2022.09.21T15:45:50.931 |\n| f5c259b4-4be3-f385-46d4-1a1a2d224e9d | dfs\\://valuedb/200003M/b39 | 13,348 | 750,000 | 2022.09.21T15:45:50.931 |\n| 6ed58eb9-a2ae-6197-4f81-3186ca1e8b20 | dfs\\://valuedb/200004M/b39 | 13,348 | 750,000 | 2022.09.21T15:45:50.931 |\n"
    },
    "getBackupMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getBackupMeta.html",
        "signatures": [
            {
                "full": "getBackupMeta(backupDir, dbPath, partition, tableName)",
                "name": "getBackupMeta",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "partition",
                        "name": "partition"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [getBackupMeta](https://docs.dolphindb.com/en/Functions/g/getBackupMeta.html)\n\n\n\n#### Syntax\n\ngetBackupMeta(backupDir, dbPath, partition, tableName)\n\n#### Details\n\nObtain all backup information about the specified partition in a DFS table.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory where the backup is saved.\n\n**dbPath** is a string indicating the path of a DFS database. For example: \"dfs\\://demo\".\n\n**partition** is a string indicating the path of a partition under the database. For example: \"/20190101/GOOG\".\n\n**Note**: For versions 1.30.16/2.00.4 -1.30.18/2.00.6, if *chunkGranularity* is set to \"TABLE\" when creating the database, *partition* must include the physical index (which you can get with the `listTables` function) of the selected partition. For example, if the physical index of the \"/20190101/GOOG\" partition is 8, then specify partition as \"/20190101/GOOG/8\" to load its backup information.\n\n**tableName** is a string indicating a distributed table name.\n\n#### Returns\n\nReturn a dictionary with information about the backup of a partition in a DFS table, which contains the following keys:\n\n* schema: the schema of the table\n\n* dfsPath: the DFS path to database chunks\n\n* rows: the number of records in a chunk\n\n* chunkID: the chunk ID\n\n* cid: the commit ID\n\n#### Examples\n\n```\ngetBackupMeta(\"/home/DolphinDB/backup\",\"dfs://valuedb\", \"/200001M\",\"pt\")\n/* output:\nschema->\nname  typeString typeInt extra comment\n----- ---------- ------- ----- -------\nmonth MONTH      7\nx     INT        4\n\ndfsPath->dfs://valuedb/200001M/b39\nrows->750000\nchunkID->0061427c-4b24-e3b6-425c-c0e1553d3c35\ncid->13349\n*/\n```\n"
    },
    "getBackupStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getBackupStatus.html",
        "signatures": [
            {
                "full": "getBackupStatus([userName])",
                "name": "getBackupStatus",
                "parameters": [
                    {
                        "full": "[userName]",
                        "name": "userName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getBackupStatus](https://docs.dolphindb.com/en/Functions/g/getBackupStatus.html)\n\n\n\n#### Syntax\n\ngetBackupStatus(\\[userName])\n\n#### Details\n\nGet the status of backup/restore tasks.\n\n**Note:**\n\n* The number of tasks generated for a backup statement is the same as the number of the backup partitions.\n\n* Administrators can check the tasks submitted by all users, or the tasks submitted by a specified user by specifying a *userName*.\n\n* When a non-administrator executes the function, return the status of backup/restore tasks submitted by the current user.\n\n#### Parameters\n\n**userName** is a string indicating the user name.\n\n#### Returns\n\nReturn a table where each row represents the information of a task.\n\n* userName: user name\n\n* type: backup/restore types.\n\n  * BACKUP\\_BY\\_SQL/RESTORE\\_BY\\_SQL: backup/restore by SQL statement\n\n  * BACKUP\\_BY\\_COPY\\_FILE/RESTORE\\_BY\\_COPY\\_FILE: backup/restore by copying files\n\n* startTime: when the task starts\n\n* dbName: database path\n\n* tableName: table name\n\n* totalPartitions: the number of partitions to be backed up/restored\n\n* completedPartitions: the number of partitions have been backed up/restored\n\n* percentComplete: the completion percentage\n\n* endTime: return the end time of a task if it has ended, otherwise return the estimated completion time\n\n* completed: whether the task is completed. Return 1 if it is completed, otherwise 0.\n\n#### Examples\n\n```\ngetBackupStatus()\n```\n\n| userName | type                   | startTime               | dbName         | tableName | totalPartitions | completedPartitions | percentComplete | endTime                 | completed |\n| -------- | ---------------------- | ----------------------- | -------------- | --------- | --------------- | ------------------- | --------------- | ----------------------- | --------- |\n| u1       | BACKUP\\_BY\\_COPY\\_FILE | 2022.09.21T17:18:04.264 | dfs\\://valuedb | pt        | 1               | 1                   | 100             | 2022.09.21T17:18:04.269 | 1         |\n| u1       | BACKUP\\_BY\\_SQL        | 2022.09.21T17:13:04.344 | dfs\\://valuedb | pt        | 4               | 4                   | 100             | 2022.09.21T17:13:04.413 | 1         |\n| u1       | BACKUP\\_BY\\_COPY\\_FILE | 2022.09.21T17:18:04.264 | dfs\\://valuedb | pt1       | 1               | 1                   | 100             | 2022.09.21T17:18:04.265 | 1         |\n| admin    | BACKUP\\_BY\\_COPY\\_FILE | 2022.09.21T16:47:42.798 | dfs\\://valuedb | pt        | 4               | 4                   | 100             | 2022.09.21T16:47:42.859 | 1         |\n| admin    | BACKUP\\_BY\\_COPY\\_FILE | 2022.09.21T16:37:33.725 | dfs\\://valuedb | pt        | 4               | 4                   | 100             | 2022.09.21T16:37:33.790 | 1         |\n| admin    | BACKUP\\_BY\\_SQL        | 2022.09.21T15:10:05.016 | dfs\\://compoDB | pt2       | 10              | 10                  | 100             | 2022.09.21T15:10:05.075 | 1         |\n"
    },
    "getCachedSymbolBaseMemSize": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getCachedSymbolBaseMemSize.html",
        "signatures": [
            {
                "full": "getCachedSymbolBaseMemSize()",
                "name": "getCachedSymbolBaseMemSize",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getCachedSymbolBaseMemSize](https://docs.dolphindb.com/en/Functions/g/getCachedSymbolBaseMemSize.html)\n\n\n\n#### Syntax\n\ngetCachedSymbolBaseMemSize()\n\n#### Details\n\nObtain the cache size (in Bytes) of SYMBOL base (i.e., a dictionary that stores integers encoded from the data of SYMBOL type) of the storage engine.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA LONG scalar.\n"
    },
    "getCacheEngineMemSize": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getCacheEngineMemSize.html",
        "signatures": [
            {
                "full": "getCacheEngineMemSize()",
                "name": "getCacheEngineMemSize",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getCacheEngineMemSize](https://docs.dolphindb.com/en/Functions/g/getCacheEngineMemSize.html)\n\n\n\n#### Syntax\n\ngetCacheEngineMemSize()\n\n#### Details\n\nObtain the memory status (in Byte) of the OLAP cache engine on the current node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a tuple:\n\n* The 1st element indicates the memory occupied by the cache engine;\n* The 2nd element indicates the memory occupied by the column files stored in the cache engine;\n* The 3rd element indicates the memory occupied by the column file pointers;\n* The 4th element indicates the maximum memory allocated to the cache engine.\n\n#### Examples\n\n```\nsetCacheEngineMemSize(0.4)\ngetCacheEngineMemSize()\n// output: (0,0,0,429496729)\n```\n\nRelated function: [setCacheEngineMemSize](https://docs.dolphindb.com/en/Functions/s/setCacheEngineMemSize.html)\n"
    },
    "getCacheEngineStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getCacheEngineStat.html",
        "signatures": [
            {
                "full": "getCacheEngineStat()",
                "name": "getCacheEngineStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getCacheEngineStat](https://docs.dolphindb.com/en/Functions/g/getCacheEngineStat.html)\n\n\n\n#### Syntax\n\ngetCacheEngineStat()\n\n#### Details\n\nGet the status of the OLAP cache engine on the current node. The function can only be called on the data node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a table containing the following columns:\n\n* chunkId: the chunk ID\n\n* physicalName: the physical name of the table to which the chunk belongs\n\n* timeSinceLastWrite: the time elapsed (in milliseconds) since last write\n\n* cachedRowsOfCompletedTxn: the number of cached records of completed transactions\n\n* cachedRowsOfUncompletedTxn: the number of cached records of uncompleted transactions. Note: For each chunk, only the last transaction may not have been completed.\n\n* cachedMemOfCompletedTxn: the memory usage (in Bytes) of completed transactions\n\n* cachedMemOfUncompletedTxn: the memory usage (in Bytes) of uncompleted transactions\n\n* cachedTids: list of transaction IDs (tid)\n\n#### Examples\n\n```\ngetCacheEngineStat()\n```\n\n| chunkId                              | physicalName | timeSinceLastWrite | cachedRowsOfCompletedTxn | cachedRowsOfUncompletedTxn | cachedMemOfCompletedTxn | cachedMemOfUncompletedTxn | cachedTids |\n| ------------------------------------ | ------------ | ------------------ | ------------------------ | -------------------------- | ----------------------- | ------------------------- | ---------- |\n| e4558d3c-fa41-52b5-418b-94e26cb70a75 | pt\\_2        | 1056               | 222,386                  | 0                          | 3,558,176               | 0                         | 2052       |\n"
    },
    "getCacheRulesForComputeGroup": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getcacherulesforcomputegroup.html",
        "signatures": [
            {
                "full": "getCacheRulesForComputeGroup([name])",
                "name": "getCacheRulesForComputeGroup",
                "parameters": [
                    {
                        "full": "[name]",
                        "name": "name",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/g/getcacherulesforcomputegroup.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ngetCacheRulesForComputeGroup(\\[name])\n\n#### Details\n\nReturns the cache rules that are configured in all compute groups or in a specified compute group.\n\n#### Parameters\n\n**name** (optional): A STRING scalar specifying the name of the compute group. If not specified, returns the cache rules for all compute groups.\n\n#### Returns\n\nA table with the following columns:\n\n* **computeGroup**: Name of the compute group.\n* **tableName**: Table specified for caching in the compute group’s cache path.\n\n#### Examples\n\n```\ngetCacheRulesForComputeGroup(\"cgroup1\")\n```\n\n| computeGroup | tableName                |\n| ------------ | ------------------------ |\n| cgroup1      | dfs\\://compute\\_test/tb1 |\n\n**Related Functions**: [removeCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/r/removecacherulesforcomputegroup.html), [addCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/a/addcacherulesforcomputegroup.html)\n"
    },
    "getCatalogsByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getCatalogsByCluster.html",
        "signatures": [
            {
                "full": "getCatalogsByCluster(clusterName)",
                "name": "getCatalogsByCluster",
                "parameters": [
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    }
                ]
            }
        ],
        "markdown": "### [getCatalogsByCluster](https://docs.dolphindb.com/en/Functions/g/getCatalogsByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetCatalogsByCluster(clusterName)\n\n#### Details\n\nReturn all catalogs in the specified cluster. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**clusterName** is a STRING scalar or vector, indicating the cluster name(s).\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\n// MoMSender cluster:\ncreateCatalog(\"catalog1\")\ncreateCatalog(\"catalog2\")\ncreateCatalog(\"catalog3\")\ncreateCatalog(\"catalog4\")\n   \n// MoM cluster:\ngetCatalogsByCluster(\"MoMSender\")\n// Output: [\"catalog1\",\"catalog2\",\"catalog3\",\"catalog4\"]    \n```\n"
    },
    "getChunkPath": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getChunkPath.html",
        "signatures": [
            {
                "full": "getChunkPath(ds)",
                "name": "getChunkPath",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    }
                ]
            }
        ],
        "markdown": "### [getChunkPath](https://docs.dolphindb.com/en/Functions/g/getChunkPath.html)\n\n\n\n#### Syntax\n\ngetChunkPath(ds)\n\n#### Details\n\nReturn the paths of the chunks that the given data sources represent.\n\n#### Parameters\n\n**ds** is one or multiple data sources.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\nif(existsDatabase(\"dfs://valuedb\")){\n  dropDatabase(\"dfs://valuedb\")\n}\n\ndb=database(\"dfs://valuedb\", VALUE, 1..10)\nn=1000000\nt=table(rand(1..10, n) as id, rand(100.0, n) as val)\npt=db.createPartitionedTable(t, `pt, `id).append!(t);\nds=sqlDS(<select * from pt where id in 1..3>)\ngetChunkPath(ds);\n\n// output: [\"/valuedb/1\",\"/valuedb/2\",\"/valuedb/3\"]\n```\n"
    },
    "getChunksMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getChunksMeta.html",
        "signatures": [
            {
                "full": "getChunksMeta([chunkPath], [top=1024])",
                "name": "getChunksMeta",
                "parameters": [
                    {
                        "full": "[chunkPath]",
                        "name": "chunkPath",
                        "optional": true
                    },
                    {
                        "full": "[top=1024]",
                        "name": "top",
                        "optional": true,
                        "default": "1024"
                    }
                ]
            }
        ],
        "markdown": "### [getChunksMeta](https://docs.dolphindb.com/en/Functions/g/getChunksMeta.html)\n\n\n\n#### Syntax\n\ngetChunksMeta(\\[chunkPath], \\[top=1024])\n\n#### Details\n\nReturns the metadata of specified database chunks on the current data node. If *chunkPath* is not specified, returns the metadata of all database chunks on the current data node.\n\n#### Parameters\n\n**chunkPath** (optional) is the DFS path to one or more database chunks. It supports wildcards \\*, % and ?.\n\n* \\* matches any number of any characters. For example, \"/testDB/\\*\" matches all paths that start with /testDB/.\n* % matches zero, one, or more characters. For example, \"/testDB/%/8\" matches all paths that start with /testDB/ and end with /8.\n* ? matches exactly one character. For example, \"/testDB/1?/8\" matches paths such as /testDB/10/8, /testDB/11/8, etc.\n\n**top** (optional) is a positive number specifying the maximum number of chunks in the output. The default value is 1024. If it is set to -1, the number of returned chunks is not limited.\n\n#### Returns\n\nA table with the following columns:\n\n* site: Alias of the node\n* chunkId: The chunk ID\n* path: The path to database chunks\n* dfsPath: The DFS path to database chunks\n* type: The partition type. 0 for file chunk; 1 for tablet chunk.\n* flag: Flag for deletion. flag=0: The chunk can be queried and accessed; flag=1: The chunk has been logically marked as deleted and cannot be queried, but it has not been removed from disk.\n  * When data is deleted using a delete statement, the corresponding chunk is not removed, so the flag of that chunk in the returned result remains 0.\n  * When executing the [dropPartition](https://docs.dolphindb.com/en/Functions/d/dropPartition.html), [dropDatabase](https://docs.dolphindb.com/en/Functions/d/dropDatabase.html), or [dropTable](https://docs.dolphindb.com/en/Functions/d/dropTable.html) functions, or the [drop](https://docs.dolphindb.com/en/Programming/SQLStatements/drop.html) statement, the flag of the corresponding chunk will be set to 1. However, once the deletion transaction is completed and flag = 1, the metadata of that chunk will no longer be returned, so results with flag = 1 are usually not visible. To see chunks with flag = 1, `getChunksMeta` must be executed before the deletion transaction finishes.\n* size: The disk space (in bytes) occupied by the file chunk. It returns 0 for tablet chunks. Use the [getTabletsMeta](https://docs.dolphindb.com/en/Functions/g/getTabletsMeta.html) function to check the disk space tablet chunk occupies.\n* version: the version number\n* state: Chunk state.\n  * 0 (final state): Transaction has been completed or rolled back.\n  * 1 (before-commit state): The transaction is being executed on the chunk, such as writing or deleting data.\n  * 2 (after-commit state): The transaction has been committed.\n  * 3 (waiting-for-recovery state): When there is a version conflict or data corruption, this state occurs after the data node sends a recovery request to the controller and before the controller initiates the recovery.\n  * 4 (in-recovery state): This state occurs after the controller receives the recovery request and initiates the recovery. Upon the completion of recovery, the chunk reverts to the final state (0).\n* versionList: version list.\n* resolved: Whether the transaction of the chunk is in the commit phase that needs to be resolved. True indicates the transaction is in the resolution phase or needs to be resolved; False indicates the transaction has already completed the resolution phase or it is not required.\n\n#### Examples\n\n```\nif(existsDatabase(\"dfs://testDB\")){\n  dropDatabase(\"dfs://testDB\")\n}\ndb=database(\"dfs://testDB\", VALUE, 1..10)\n\nn=1000000\nt=table(rand(1..10, n) as id, rand(100.0, n) as x)\ndb.createPartitionedTable(t, `p1, `id).append!(t)\n\nn=2000000\nt=table(rand(1..10, n) as id, rand(100.0, n) as x, rand(100, n) as y)\ndb.createPartitionedTable(t, `pt2, `id).append!(t)\ngetChunksMeta(\"/testDB%\");\n```\n\n| site     | chunkId                              | path             | dfsPath         | type | flag | size | version | state | versionList     | resolved |\n| -------- | ------------------------------------ | ---------------- | --------------- | ---- | ---- | ---- | ------- | ----- | --------------- | -------- |\n| P2-node1 | 092d5e12-e595-6f9e-b049-83cba1716997 | /ssd/ssd5/jzVol… | /testDB/pt2.tbl | 0    | 0    | 49   | 1       | 0     | 2052:49;        | false    |\n| P2-node1 | d31e6b47-18f0-37a6-0146-45bf6e266c56 | /ssd/ssd6/jzVol… | /testDB/7       | 1    | 0    | 0    | 2       | 0     | cid : 2053,pt1… | false    |\n| P2-node1 | cd99d9ef-d864-f3bc-4945-f97017d43bf1 | /ssd/ssd5/jzVol… | /testDB/2       | 1    | 0    | 0    | 2       | 0     | cid : 2053,pt1… | false    |\n| P2-node1 | 8da4bea8-31d0-31b5-784f-67aa6339633d | /ssd/ssd5/jzVol… | /testDB/pt1.tbl | 0    | 0    | 41   | 1       | 0     | 2050:41;        | false    |\n| P2-node1 | dd5fc885-f6a6-bfae-8543-254f9fb92484 | /ssd/ssd6/jzVol… | /testDB/10      | 1    | 0    | 0    | 2       | 0     | cid : 2053,pt1… | false    |\n| P2-node1 | 4b8aaed1-2dd6-acb7-5148-4add878c3b33 | /ssd/ssd6/jzVol… | /testDB/domain  | 0    | 0    | 88   | 1       | 0     | 2049:88;        | false    |\n| P2-node1 | 28cb59ec-185a-0ebf-a849-267e769936af | /ssd/ssd6/jzVol… | /testDB/8       | 1    | 0    | 0    | 2       | 0     | cid : 2053,pt1… | false    |\n| P2-node1 | b2facbd2-e301-428f-f94f-8579023f78af | /ssd/ssd6/jzVol… | /testDB/3       | 1    | 0    | 0    | 2       | 0     | cid : 2053,pt1… | false    |\n| P2-node1 | 8bec6445-bc6d-3693-7f46-d1bcdd350182 | /ssd/ssd6/jzVol… | /testDB/5       | 1    | 0    | 0    | 2       | 0     | cid : 2053,pt1… | false    |\n\n**Related function**: [getTabletsMeta](https://docs.dolphindb.com/en/Functions/g/getTabletsMeta.html)\n"
    },
    "getClusterChunksStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getClusterChunksStatus.html",
        "signatures": [
            {
                "full": "getClusterChunksStatus()",
                "name": "getClusterChunksStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getClusterChunksStatus](https://docs.dolphindb.com/en/Functions/g/getClusterChunksStatus.html)\n\n#### Syntax\n\ngetClusterChunksStatus()\n\n#### Details\n\nThis function obtains the metadata about all database chunks (file chunks and tablet chunks) on the data nodes in a cluster. It can be executed only on a controller.\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* chunkId: the chunk ID.\n\n* file: the chunk path.\n\n* size: The disk space occupied by the file chunk (in Bytes). Return 0 for a tablet chunk. Use [getTabletsMeta](https://docs.dolphindb.com/en/Functions/g/getTabletsMeta.html) to check the disk usage of a tablet chunk.\n\n* version: the version number of the current chunk.\n\n* vcLength: length of the version chain.\n\n* versionChain: version chain of the chunk, e.g. \"18441:76:1:346 -> 18441:0:0:346 -> \", where\n\n  | 18441          | 76         | 1              | 346               |\n  | -------------- | ---------- | -------------- | ----------------- |\n  | cid (chunk ID) | chunk size | version number | sid (snapshot ID) |\n\n* state: the chunk state. It can be\n\n  * CONSTRUCTING: in transaction;\n\n  * RECOVERING: recovering;\n\n  * COMPLETE: transaction completed.\n\n* replicas: Information about the distribution of data replicas. Each replica is formatted as `nodeAlias:replicaVersion:corrupted:inResolution:timestamp:volumeID`. Multiple replicas are separated by commas.\n\n* replicaCount: the number of replica(s).\n\n* lastUpdated: the timestamp for last update. Note that lastUpdated column is supported since version 1.30.20/2.00.1. For a chunk created before, it returns a null value.\n\n* permission: the chunk permission. It can be READ\\_WRITE (default), READ\\_ONLY, WRITE\\_ONLY, and UNKNOWN. Chunks that are being transferred or stored in S3 are READ\\_ONLY.\n\nFor READ\\_ONLY chunks:\n\n* Data cannot be appended or updated. Only drop operations can be performed to delete records. Transaction is supported in the READ\\_ONLY chunks (except for those stored in S3).\n* Operations such as recovery and rebalance cannot be performed.\n* Level files in the TSDB engine cannot be merged.\n\n#### Examples\n\n```\nrpc(getControllerAlias(), getClusterChunksStatus);\n```\n\n| chunkId           | file            | size | version | vcLength | versionChain      | state    | replicas          | replicaCount | lastUpdated             | permission  |\n| ----------------- | --------------- | ---- | ------- | -------- | ----------------- | -------- | ----------------- | ------------ | ----------------------- | ----------- |\n| 092d5e12-e595-6f… | /testDB/pt2.tbl | 49   | 1       | 1        | 2052:49:1 ->      | COMPLETE | P1-node1:1:0,P2-… | 2            | 2022.03.31T18:09:41.138 | READ\\_WRITE |\n| 42936e31-8be0-fa… | /testDB/9/i     | 0    | 2       | 2        | 2053:0:2 -> 2051… | COMPLETE | P3-node1:2:0,P1-… | 2            | 2022.03.31T18:09:41.138 | READ\\_WRITE |\n| d31e6b47-18f0-37… | /testDB/7/i     | 0    | 2       | 2        | 2053:0:2 -> 2051… | COMPLETE | P1-node1:2:0,P2-… | 2            | 2022.03.31T18:09:41.138 | READ\\_WRITE |\n| 647a5fd6-cd85-3b… | /testDB/6/i     | 0    | 2       | 2        | 2053:0:2 -> 2051… | COMPLETE | P1-node1:2:0,P3-… | 2            | 2022.03.31T18:09:41.138 | READ\\_WRITE |\n| 8bec6445-bc6d-36… | /testDB/5/i     | 0    | 2       | 2        | 2053:0:2 -> 2051… | COMPLETE | P2-node1:2:0,P3-… | 2            | 2022.03.31T18:09:41.138 | READ\\_WRITE |\n| ca690ba5-be73-a6… | /testDB/4/i     | 0    | 2       | 2        | 2053:0:2 -> 2051… | COMPLETE | P3-node1:2:0,P1-… | 2            | 2022.03.31T18:09:41.138 | READ\\_WRITE |\n\n"
    },
    "getClusterDFSDatabases": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getClusterDFSDatabases.html",
        "signatures": [
            {
                "full": "getClusterDFSDatabases([includeSysDb=true])",
                "name": "getClusterDFSDatabases",
                "parameters": [
                    {
                        "full": "[includeSysDb=true]",
                        "name": "includeSysDb",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [getClusterDFSDatabases](https://docs.dolphindb.com/en/Functions/g/getClusterDFSDatabases.html)\n\n\n\n#### Syntax\n\ngetClusterDFSDatabases(\\[includeSysDb=true])\n\n#### Details\n\nWhen executed by an administrator, this function returns distributed databases in the cluster.\n\nWhen executed by a non-admin user, it returns the distributed databases in the cluster for which the user has any of the following permissions: DB\\_MANAGE, DB\\_OWNER, DB\\_READ, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE, DBOBJ\\_CREATE, DBOBJ\\_DELETE.\n\n#### Parameters\n\nNone\n\n**includeSysDb** (optional): A boolean value that controls whether system databases are included in the returned results. The default value is true. This parameter applies only to admin users. Regular users cannot view system databases, even if *includeSysDb* is set to true.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ngetClusterDFSDatabases()\n// output: [\"dfs://demohash\",\"dfs://myDataYesDB\",\"dfs://testDB\"]\n```\n"
    },
    "getClusterDFSTables": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getClusterDFSTables.html",
        "signatures": [
            {
                "full": "getClusterDFSTables([includeSysTable=true])",
                "name": "getClusterDFSTables",
                "parameters": [
                    {
                        "full": "[includeSysTable=true]",
                        "name": "includeSysTable",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [getClusterDFSTables](https://docs.dolphindb.com/en/Functions/g/getClusterDFSTables.html)\n\n\n\n#### Syntax\n\ngetClusterDFSTables(\\[includeSysTable=true])\n\n#### Details\n\nThe function returns a vector that lists DFS tables in the cluster.\n\nFrom version 1.30.212.00.9 onwards,\n\n* For an administrator, it returns all DFS tables under the specified database in the cluster.\n* When executed by a non-admin user, it will return:\n  * All DFS tables in databases where the user has any of the following permissions:DB\\_OWNER, DB\\_MANAGE, DB\\_READ, DB\\_WRITE, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE.\n  * DFS tables where the user has any of the following permissions: TABLE\\_READ, TABLE\\_INSERT, TABLE\\_WRITE, TABLE\\_UPDATE, or TABLE\\_DELETE.\n\nStarting from version 2.00.10.2, this function returns all DFS tables created by the user regardless of the table permissions.\n\nStarting from version 1.30.23, this function returns all DFS tables created by the user regardless of the table permissions.\n\n#### Parameters\n\nNone\n\n**includeSysTable** (optional): A boolean value that controls whether system tables are included in the returned results. The default value is true. This parameter applies only to admin users. Regular users cannot view system tables, even if *includeSysTable* is set to true.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ngetClusterDFSTables()\n// output: [\"dfs://demohash/pt\",\"dfs://myDataYesDB/tick\",\"dfs://testDB/pt1\",\"dfs://testDB/pt2\"]\n```\n"
    },
    "getClusterPerf": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getClusterPerf.html",
        "signatures": [
            {
                "full": "getClusterPerf([includeMaster=false])",
                "name": "getClusterPerf",
                "parameters": [
                    {
                        "full": "[includeMaster=false]",
                        "name": "includeMaster",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [getClusterPerf](https://docs.dolphindb.com/en/Functions/g/getClusterPerf.html)\n\n#### Syntax\n\ngetClusterPerf(\\[includeMaster=false])\n\n#### Details\n\nReturns configurations and performance measures for each node in the cluster.\n\n#### Parameters\n\n**includeMaster** (optional) indicates whether to include the controller information in the output.\n\n#### Returns\n\nIt returns a table with the following columns:\n\n| Field                 | Description                                                                                                                                                                 | Unit      |\n| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |\n| computeGroup          | Compute group name                                                                                                                                                          |           |\n| host                  | Host name                                                                                                                                                                   |           |\n| port                  | Port number                                                                                                                                                                 |           |\n| site                  | (LAN) site                                                                                                                                                                  |           |\n| mode                  | Node type or deployment mode. 0: data node;1: agent; 2: controller; 3: standalone mode; 4: compute node.                                                                    |           |\n| state                 | A Boolean value indicating whether the node is alive.                                                                                                                       |           |\n| agentSite             | Agent information of the current node.                                                                                                                                      |           |\n| maxConnections        | The maximum number of connections (from GUI, API, other nodes, etc.) to the local node.                                                                                     |           |\n| maxMemSize            | The maximum memory allocated to DolphinDB.                                                                                                                                  | GB        |\n| workerNum             | The size of worker pool for regular interactive jobs. The default value is the number of CPU cores                                                                          |           |\n| executorNum           | The number of local executors. The default value is the number of CPU cores - 1                                                                                             |           |\n| connectionNum         | The number of connections to a local node. Note that the return value for the agent is a random number.                                                                     |           |\n| name                  | Node alias                                                                                                                                                                  |           |\n| memoryUsed            | Memory used by the node                                                                                                                                                     | Bytes     |\n| memoryAlloc           | Total memory allocated to DolphinDB on the node.                                                                                                                            | Bytes     |\n| cpuUsage              | CPU usage                                                                                                                                                                   |           |\n| avgLoad               | Average CPU load                                                                                                                                                            |           |\n| maxRunningQueryTime   | The maximum elapsed time of the queries that are currently running.                                                                                                         | ns        |\n| runningJobs           | The number of running jobs                                                                                                                                                  |           |\n| queuedJobs            | The number of jobs in queue                                                                                                                                                 |           |\n| runningTasks          | The number of running tasks                                                                                                                                                 |           |\n| queuedTasks           | The number of tasks in queue                                                                                                                                                |           |\n| jobLoad               | CPU load of a job                                                                                                                                                           |           |\n| diskCapacity          | Disk capacity                                                                                                                                                               | Bytes     |\n| diskFreeSpace         | Available disk space                                                                                                                                                        | Bytes     |\n| diskFreeSpaceRatio    | Available space ratio                                                                                                                                                       |           |\n| diskWriteRate         | The rate at which data are written to disk.                                                                                                                                 | Bytes/sec |\n| diskReadRate          | The rate at which data are read from disk.                                                                                                                                  | Bytes/sec |\n| lastMinuteWriteVolume | The data written to disk in the last minute.                                                                                                                                | Bytes     |\n| lastMinuteReadVolume  | The data read from disk in the last minute.                                                                                                                                 | Bytes     |\n| networkSendRate       | The rate at which data are sent.                                                                                                                                            | Bytes/sec |\n| networkRecvRate       | The rate at which data are received.                                                                                                                                        | Bytes/sec |\n| lastMinuteNetworkSend | Data sent in the last minute                                                                                                                                                | Byte      |\n| lastMinuteNetworkRecv | Data received in the last minute                                                                                                                                            | Byte      |\n| publicName            | Returns publicName for a controller configured with publicName;Otherwise returns the MAC (Media Access Control) Address of the server for a controller, data node or agent. |           |\n| lastMsgLatency        | Latency of the last received message                                                                                                                                        | ns        |\n| cumMsgLatency         | Cumulative latency of the messages                                                                                                                                          | ns        |\n| isLeader              | Whether it is the leader of a raft group. It only returns for a raft group of controllers. Note that it will return NULL for a raft group with crashed node.                |           |\n| zone                  | The zone to which the node belongs                                                                                                                                          |           |\n\nThe following measures are displayed only when the configuration parameter *perfMonitoring* is set to 1.\n\n| Field               | Description                                                      | Unit |\n| ------------------- | ---------------------------------------------------------------- | ---- |\n| medLast10QueryTime  | The median execution time of the previous 10 finished queries.   | ns   |\n| maxLast10QueryTime  | The maximum execution time of the previous 10 finished queries.  | ns   |\n| medLast100QueryTime | The median execution time of the previous 100 finished queries.  | ns   |\n| maxLast100QueryTime | The maximum execution time of the previous 100 finished queries. | ns   |\n\n#### Examples\n\n```\ngetClusterPerf()\n```\n\n"
    },
    "getClusterStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getClusterStatus.html",
        "signatures": [
            {
                "full": "getClusterStatus(clusterName)",
                "name": "getClusterStatus",
                "parameters": [
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    }
                ]
            }
        ],
        "markdown": "### [getClusterStatus](https://docs.dolphindb.com/en/Functions/g/getClusterStatus.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetClusterStatus(clusterName)\n\n#### Details\n\nReturn the status of a specified cluster. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**clusterName** is a STRING scalar or vector, indicating the name of the cluster.\n\n#### Returns\n\nA table. Except for the “clusterName” and ”computeGroup” columns, all other fields are consistent with the result of the [getClusterPerf](https://docs.dolphindb.com/en/Functions/g/getClusterPerf.html):\n\n* clusterName: Name of the cluster.\n* computeGroup: Name of the compute group. If there are no compute group in the cluster, this field will be empty.\n\n#### Examples\n\n```\ngetClusterStatus(\"ShangHai_cluster2\")\n```\n\n| clusterName        | computeGroup | host      | port  | site                          | mode | state | agentSite             | maxConnections | maxMemSize | workerNum | executorNum | connectionNum | name           | memoryUsed  | memoryAlloc | cpuUsage           | avgLoad             | medLast10QueryTime | maxLast10QueryTime | medLast100QueryTime | maxLast100QueryTime | maxRunningQueryTime | runningJobs | queuedJobs | runningTasks | queuedTasks | jobLoad | diskCapacity | diskFreeSpace | diskFreeSpaceRatio | diskWriteRate | diskReadRate | lastMinuteWriteVolume | lastMinuteReadVolume | networkSendRate | networkRecvRate | lastMinuteNetworkSend | lastMinuteNetworkRecv | publicName | lastMsgLatency | cumMsgLatency | isLeader |\n| ------------------ | ------------ | --------- | ----- | ----------------------------- | ---- | ----- | --------------------- | -------------- | ---------- | --------- | ----------- | ------------- | -------------- | ----------- | ----------- | ------------------ | ------------------- | ------------------ | ------------------ | ------------------- | ------------------- | ------------------- | ----------- | ---------- | ------------ | ----------- | ------- | ------------ | ------------- | ------------------ | ------------- | ------------ | --------------------- | -------------------- | --------------- | --------------- | --------------------- | --------------------- | ---------- | -------------- | ------------- | -------- |\n| ShangHai\\_cluster2 |              | localhost | 8,921 | localhost:8921:agent1         | 1    | 1     | localhost:8921:agent1 | 32             | 4          | 4         | 0           | 0             | agent1         | 0           | 0           | 0                  | 0                   | 0                  | 0                  | 0                   | 0                   | 0                   | 0           | 0          | 0            | 0           | 0       | 0            | 0             | 0                  | 0             | 0            | 0                     | 0                    | 0               | 0               | 0                     | 0                     |            | 0              | 0             |          |\n| ShangHai\\_cluster2 |              | localhost | 8,923 | localhost:8923:cnode1         | 4    | 0     | localhost:8921:agent1 | 0              | 0          | 0         | 0           | 0             | cnode1         | 0           | 0           | 0                  | 0                   | 0                  | 0                  | 0                   | 0                   | 0                   | 0           | 0          | 0            | 0           | 0       | 0            | 0             | 0                  | 0             | 0            | 0                     | 0                    | 0               | 0               | 0                     | 0                     |            | 0              | 0             |          |\n| ShangHai\\_cluster2 |              | localhost | 8,922 | localhost:8922:dnode1         | 0    | 0     | localhost:8921:agent1 | 0              | 0          | 0         | 0           | 0             | dnode1         | 0           | 0           | 0                  | 0                   | 0                  | 0                  | 0                   | 0                   | 0                   | 0           | 0          | 0            | 0           | 0       | 0            | 0             | 0                  | 0             | 0            | 0                     | 0                    | 0               | 0               | 0                     | 0                     |            | 0              | 0             |          |\n| ShangHai\\_cluster2 |              | localhost | 8,920 | localhost:8920:controller8920 | 2    | 1     |                       | 512            | 8          | 4         | 0           | 2             | controller8920 | 123,862,496 | 127,377,408 | 16.049382716049383 | 0.16049382716049382 | 0                  | 0                  | 0                   | 0                   | 0                   | 0           | 0          | 0            | 0           | 0       | 0            | 0             | 0                  | 148           | 0            | 21,028                | 0                    | 0               | 0               | 0                     | 0                     |            | 0              | 0             |          |\n"
    },
    "getClusterTDEKeys": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getclustertdekeys.html",
        "signatures": [
            {
                "full": "getClusterTDEKeys()",
                "name": "getClusterTDEKeys",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getClusterTDEKeys](https://docs.dolphindb.com/en/Functions/g/getclustertdekeys.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetClusterTDEKeys()\n\n#### Details\n\n\\[Linux Only] This function retrieves encryption information for encrypted tables in the cluster.\n\n\\*\\*Note:\\*\\*When executed by an administrator or a user with DB\\_MANAGE privileges, the function returns encryption information for all encrypted tables in the cluster. Otherwise, it only returns encryption information for tables that the user has access to. Access privileges include: `DB_MANAGE`, `DBOBJ_CREATE`, `DB_OWNER`, `TABLE_READ`, `TABLE_WRITE`, `TABLE_INSERT`, `TABLE_UPDATE`, `TABLE_DELETE`, `DB_READ`, `DB_WRITE`, `DB_INSERT`, `DB_UPDATE`, `DB_DELETE`.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table with the following columns:\n\n* tableName: name of the encrypted table.\n* mode: encryption mode in uppercase.\n* version: TDE key version.\n\n#### Examples\n\n```\ngetClusterTDEKeys()\n```\n\n| **tableName**    | **mode**      | **version**   |\n| ---------------- | ------------- | ------------- |\n| dfs\\://db/table1 | `AES_128_CTR` | 3,698,850,997 |\n| dfs\\://db/table2 | `AES_128_CTR` | 5,768,669,747 |\n"
    },
    "getClusterVolumeUsage": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getClusterVolumeUsage.html",
        "signatures": [
            {
                "full": "getClusterVolumeUsage()",
                "name": "getClusterVolumeUsage",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getClusterVolumeUsage](https://docs.dolphindb.com/en/Functions/g/getClusterVolumeUsage.html)\n\nFirst introduced in version: 2.00.173.00.4\n\n\n\n#### Syntax\n\ngetClusterVolumeUsage()\n\n#### Details\n\nChecks the disk usage status of each node in the cluster. This function can only be executed by an administrator.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table with the following columns:\n\n* node: Node name\n* volumePath: Path of the volume on disk\n* volumeId: Internal ID of the volume\n* usage: Current disk usage (in bytes)\n* capacity: Total disk capacity (in bytes)\n\n#### Examples\n\n```\ngetClusterVolumeUsage()\n```\n\n| node      | volumePath                     | volumeId    | usage           | capacity        |\n| --------- | ------------------------------ | ----------- | --------------- | --------------- |\n| local8999 | /home/server/local8999/storage | 109,993,503 | 138,556,121,088 | 250,438,021,120 |\n"
    },
    "getCompletedQueries": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getCompletedQueries.html",
        "signatures": [
            {
                "full": "getCompletedQueries([top])",
                "name": "getCompletedQueries",
                "parameters": [
                    {
                        "full": "[top]",
                        "name": "top",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getCompletedQueries](https://docs.dolphindb.com/en/Functions/g/getCompletedQueries.html)\n\n\n\n#### Syntax\n\ngetCompletedQueries(\\[top])\n\n#### Details\n\nReturn descriptive information about the most recently finished *top* SQL queries on DFS databases at the local node.\n\nOnly administrators can use this function. Before using the function, set the configuration parameter *perfMonitoring*=1 to enable performance monitoring.\n\n#### Parameters\n\n**top** (optional) is a positive integer. The default value is 10.\n\n#### Returns\n\nIt returns a table with the following columns:\n\n| Name      | Meaning                                                                                                                                              |\n| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userID    | the user ID                                                                                                                                          |\n| sessionID | the session ID                                                                                                                                       |\n| jobID     | the job ID                                                                                                                                           |\n| rootID    | the root job ID                                                                                                                                      |\n| level     | the level of jobs. The root job starts from level 0, the tasks broken down from the root job are marked as level 1, and subtasks level 2, and so on. |\n| startTime | the start time of a query (of NANOTIMESTAMP type)                                                                                                    |\n| endTime   | the end time of a query (of NANOTIMESTAMP type)                                                                                                      |\n| jobDesc   | the job description                                                                                                                                  |\n| errorMsg  | error messages                                                                                                                                       |\n| remoteIP  | the IP address of the client that initiates a query                                                                                                  |\n\n#### Examples\n\n```\nn=1000000\nID=rand(10, n)\nx=rand(1.0, n)\nt=table(ID, x)\ndb=database(\"dfs://rangedb16\", RANGE,  0 5 10)\npt = db.createPartitionedTable(t, `pt, `ID)\npt.append!(t)\nt1 = select count(x) from pt;\nt2 = select * from pt where ID=1;\nt3 = select * from pt where ID=5;\n\ngetCompletedQueries()\n```\n\n| userID | sessionID  | jobID                                | rootID                               | level | startTime                     | endTime                       | jobDesc                             | errorMsg | remoteIP  |\n| ------ | ---------- | ------------------------------------ | ------------------------------------ | ----- | ----------------------------- | ----------------------------- | ----------------------------------- | -------- | --------- |\n| admin  | 1166953221 | 4be0f403-a62d-7bae-4ded-43938cc2b4e9 | 4be0f403-a62d-7bae-4ded-43938cc2b4e9 | 0     | 2021.06.28T18:05:34.366483000 | 2021.06.28T18:05:34.372467000 | select ID,x from pt where ID == 1   |          | 127.0.0.1 |\n| admin  | 1166953221 | 9e9132c5-60c2-b3ab-41da-039ad2dcb6ff | 4be0f403-a62d-7bae-4ded-43938cc2b4e9 | 0     | 2021.06.28T18:05:34.366483000 | 2021.06.28T18:05:34.372467000 | select ID,x from pt where ID == 5   |          | 127.0.0.1 |\n| admin  | 1166953221 | 98275891-9c9b-948e-425c-6c3083713d84 | 98275891-9c9b-948e-425c-6c3083713d84 | 0     | 2021.06.28T18:05:34.344272000 | 2021.06.28T18:05:34.359201000 | select count(x) as count\\_x from pt |          | 127.0.0.1 |\n\n```\ngetCompletedQueries().keys()\n// output: [\"userID\",\"sessionID\",\"jobID\",\"rootID\",\"level\",\"startTime\",\"endTime\",\"jobDesc\",\"errorMsg\"]\n\ngetCompletedQueries().ErrorMsg\n// output: [,,]\n\ngetCompletedQueries().jobDesc\n// output: [\"select ID,x from pt where ID == 5\",\"select ID,x from pt where ID == 1\",\"select count(x) as count_x from pt\"]\n```\n"
    },
    "getComputeGroupChunksStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getComputeGroupChunksStatus.html",
        "signatures": [
            {
                "full": "getComputeGroupChunksStatus([computeGroup])",
                "name": "getComputeGroupChunksStatus",
                "parameters": [
                    {
                        "full": "[computeGroup]",
                        "name": "computeGroup",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getComputeGroupChunksStatus](https://docs.dolphindb.com/en/Functions/g/getComputeGroupChunksStatus.html)\n\n\n\n#### Syntax\n\ngetComputeGroupChunksStatus(\\[computeGroup])\n\n#### Details\n\nThis function obtains the metadata about all database chunks (file chunks and tablet chunks) on the compute nodes. It must be executed on a controller.\n\n#### Parameters\n\n**computeGroup** (optional) is a string indicating the compute group.\n\n#### Returns\n\nA table containing the following columns:\n\n* chunkId: Chunk ID.\n* file: Chunk path.\n* routedTo: Compute node to which queries are routed.\n* cachedOn: Compute node on which the chunk is cached, in the format `alias:[version]`. For example, orca2:\\[29] means the compute node orca2 caches chunk data of version 29.\n* computeGroup: Compute group(s) where the chunk is cached.\n* size: Disk space occupied by the file chunk (in Bytes). Return 0 for a tablet chunk. Use [getTabletsMeta](https://docs.dolphindb.com/en/Functions/g/getTabletsMeta.html) to check the disk usage of a tablet chunk.\n* version: Version number of the current chunk.\n* vcLength: Length of the version chain.\n* versionChain: Version chain of the chunk, e.g. \"18441:76:1:346 -> 18441:0:0:346 -> \".\n* state: Chunk state. It can be\n  * CONSTRUCTING: in transaction.\n  * RECOVERING: recovering.\n  * COMPLETE: transaction completed.\n* dataNodeReplicas: Replica information of the chunk on data nodes.\n* dataNodeReplicaCount: Number of replica(s) on data nodes.\n* lastUpdated: Last modification timestamp.\n* permission: Chunk permission. It can be READ\\_WRITE (default) and READ\\_ONLY. Chunks that are being transferred or stored in S3 are READ\\_ONLY.\n\n#### Examples\n\n```\ngetComputeGroupChunksStatus()\n```\n\n| chunkId | path                                 | routedTo                                             | cachedOn | computeGroup  | size | version | vcLength | versionChain | state            | dataNodeReplicas | dataNodeReplicaCount | lastUpdated | permission              |\n| ------- | ------------------------------------ | ---------------------------------------------------- | -------- | ------------- | ---- | ------- | -------- | ------------ | ---------------- | ---------------- | -------------------- | ----------- | ----------------------- |\n| 0       | abec288a-49f7-61b9-464e-56bf134c8340 | /Storage\\_compute\\_separation\\_tsdb/20120110/Key19/2 | orca3    | \\[NOT CACHED] | orca | 0       | 1        | 1            | 1466:0:1:1466 -> | COMPLETE         | dnode2:1:0:false:0   | 1           | 2024.10.12 17:26:51.757 |\n| 1       | fdb95a8e-72f0-21a7-0443-2cbe02feeca2 | /Storage\\_compute\\_separation\\_tsdb/20120229/Key1/2  | orca1    | \\[NOT CACHED] | orca | 0       | 1        | 1            | 1463:0:1:1463 -> | COMPLETE         | dnode3:1:0:false:0   | 1           | 2024.10.12 17:26:51.708 |\n| 2       | 55020019-8b2c-75a1-3b40-7ad2469abe48 | /Storage\\_compute\\_separation\\_tsdb/20120110/Key13/2 | orca3    | \\[NOT CACHED] | orca | 0       | 1        | 1            | 1458:0:1:1458 -> | COMPLETE         | dnode3:1:0:false:0   | 1           | 2024.10.12 17:26:51.618 |\n| 3       | 96678f5f-6ae5-2b98-9944-5d4370473dee | /Storage\\_compute\\_separation\\_tsdb/20120110/Key7/2  | orca2    | \\[NOT CACHED] | orca | 0       | 1        | 1            | 1456:0:1:1456 -> | COMPLETE         | dnode1:1:0:false:0   | 1           | 2024.10.12 17:26:51.583 |\n"
    },
    "getComputeNodeCacheDetails": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getComputeNodeCacheDetails.html",
        "signatures": [
            {
                "full": "getComputeNodeCacheDetails(granularity)",
                "name": "getComputeNodeCacheDetails",
                "parameters": [
                    {
                        "full": "granularity",
                        "name": "granularity"
                    }
                ]
            }
        ],
        "markdown": "### [getComputeNodeCacheDetails](https://docs.dolphindb.com/en/Functions/g/getComputeNodeCacheDetails.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetComputeNodeCacheDetails(granularity)\n\n#### Details\n\nIn the storage-compute separation architecture, execute this function on a compute node within a compute group to obtain detailed cache information on that node.\n\nUnlike `getComputeNodeCacheStat`, which provides the overall cache usage and limit for the current node, `getComputeNodeCacheDetails` allows users to query the detailed composition of the cache.\n\nUsers can choose to query by table or by partition to view detailed cache information such as the type and size of the cached data.\n\nFor details about the storage-compute separation architecture and related configurations, refer to [Storage-Compute Separation](https://docs.dolphindb.com/en/Database/DatabaseandDistributedComputing/storage_compute_separation.html).\n\n#### Parameters\n\n**granularity**: A string scalar that specifies the level of detail for the query:\n\n* \"CHUNK\": Queries cache information at the partition level.\n* \"TABLE\": Queries cache information at the table level. This option is useful when there are many partitions, as it helps control the number of table rows returned.\n\n#### Returns\n\n* When querying by partition (*granularity*=\"CHUNK\"), the function returns a table with the following columns:\n  * dbName: Database name\n  * tableName: Table name\n  * dfsPath: DFS path of the partition\n  * cid: Version identifier for the current cache\n  * cacheType: Type of cache, can be \"MEM” or \"DISK\". If the partition is cached in both, both types will be listed separately.\n  * size: Cache size in bytes, corresponding to the cache type\n* When querying by table (*granularity*=\"TABLE\"), a single record is returned for each DFS table, containing the following columns:\n  * dbName\n  * tableName\n  * partitionCount: Number of cached partitions in the table\n  * cacheType\n  * size: Total cache size in bytes\n\n#### Examples\n\n```\ngetComputeNodeCacheDetails(\"CHUNK\");\n```\n\n| **dbName**    | **tableName** | **dfsPath**  | **cid** | **cacheType** | **size** |\n| ------------- | ------------- | ------------ | ------- | ------------- | -------- |\n| dfs\\://demo   | pt1           | /demo/43/G6  | 509     | MEM           | 222      |\n| dfs\\://demo   | pt1           | /demo/15/G6  | 509     | MEM           | 184      |\n| dfs\\://test01 | pt01          | /test01/1/8c | 515     | MEM           | 280      |\n| …             |               |              |         |               |          |\n\n```\ngetComputeNodeCacheDetails(\"TABLE\");\n```\n\n| **dbName**  | **tableName** | **partitionCount** | **cacheType** | **size** |\n| ----------- | ------------- | ------------------ | ------------- | -------- |\n| dfs\\://demo | pt1           | 27                 | MEM           | 5804     |\n\n**Related functions:**[clearComputeNodeCache](https://docs.dolphindb.com/en/Functions/c/clearComputeNodeCache.html), [clearComputeNodeDiskCache](https://docs.dolphindb.com/en/Functions/c/clearcomputenodediskcache.html), `[getComputeNodeCacheStat](getComputeNodeCacheStat.md)`\n"
    },
    "getComputeNodeCacheStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getComputeNodeCacheStat.html",
        "signatures": [
            {
                "full": "getComputeNodeCacheStat()",
                "name": "getComputeNodeCacheStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getComputeNodeCacheStat](https://docs.dolphindb.com/en/Functions/g/getComputeNodeCacheStat.html)\n\n\n\n#### Syntax\n\ngetComputeNodeCacheStat()\n\n#### Details\n\nCall the function on a compute node within a compute group to obtain the cache statistics.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table with the following memory and disk cache metrics (all values in MB):\n\n* memCacheUsage: Current memory used by cached data.\n* memCacheSize: Maximum allocated memory cache capacity.\n* diskCacheUsage: Current disk space used by cached data.\n* diskCacheSize: Maximum allocated disk cache capacity.\n\n#### Examples\n\n```\ngetComputeNodeCacheStat()\n```\n\n| memCacheUsage      | memCacheSize | diskCacheUsage | diskCacheSize |\n| ------------------ | ------------ | -------------- | ------------- |\n| 114.51725769042969 | 1,024        | 0              | 65,536        |\n"
    },
    "getComputeNodeCacheWarmupJobStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getcomputenodecachewarmupjobstatus.html",
        "signatures": [
            {
                "full": "getComputeNodeCacheWarmupJobStatus([jobId])",
                "name": "getComputeNodeCacheWarmupJobStatus",
                "parameters": [
                    {
                        "full": "[jobId]",
                        "name": "jobId",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getComputeNodeCacheWarmupJobStatus](https://docs.dolphindb.com/en/Functions/g/getcomputenodecachewarmupjobstatus.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetComputeNodeCacheWarmupJobStatus(\\[jobId])\n\n#### Details\n\nRetrieve the status of specified warm-up job. If *jobId* is unspecified, it returns the status of all warm-up jobs.\n\n#### Parameters\n\n**jobId** (optional) is a STRING scalar or vector indicating the warm-up job ID.\n\n#### Returns\n\nA table with the following columns:\n\n* jobId: The job ID of the warm-up job.\n\n* tableName: The database and table name.\n\n* jobStatus: The status of the job, which can be one of the following:\n\n  * Pending: Waiting to be executed.\n\n  * Running: Executing.\n\n  * Finished: Completed successfully.\n\n  * Error: An error occurred.\n\n* parallelism: The parallelism of the job. A value of -1 means no parallelism limit for the job.\n\n* elapsed: The execution time of the job in milliseconds.\n\n* errMsg: The error message.\n\n#### Examples\n\n```\ngetComputeNodeCacheWarmupJobStatus()\n```\n"
    },
    "getComputeNodeCachingDelay": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getComputeNodeCachingDelay.html",
        "signatures": [
            {
                "full": "getComputeNodeCachingDelay()",
                "name": "getComputeNodeCachingDelay",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getComputeNodeCachingDelay](https://docs.dolphindb.com/en/Functions/g/getComputeNodeCachingDelay.html)\n\n\n\n#### Syntax\n\ngetComputeNodeCachingDelay()\n\n#### Details\n\nGet the value of *computeNodeCachingDelay* on the current node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn integer.\n\n#### Examples\n\n```\ngetComputeNodeCachingDelay()\n// output: 580\n```\n\n**Related Function**: [setComputeNodeCachingDelay](https://docs.dolphindb.com/en/Functions/s/setComputeNodeCachingDelay.html)\n"
    },
    "getConfig": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getConfig.html",
        "signatures": [
            {
                "full": "getConfig([key])",
                "name": "getConfig",
                "parameters": [
                    {
                        "full": "[key]",
                        "name": "key",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getConfig](https://docs.dolphindb.com/en/Functions/g/getConfig.html)\n\n\n\n#### Syntax\n\ngetConfig(\\[key])\n\n#### Details\n\nRetrieve the configuration information of the system. Configuration items are internally classified into three security levels: sensitive, standard, and non-sensitive.\n\n* Sensitive configurations: clusterReplicationExecutionPassword, s3SecretAccessKey, oauthClientSecret, and metricsToken.\n\n* Non-sensitive configurations: webLoginRequired, webModules, oauth, oauthWebType, oauthAuthUri, oauthRedirectUri, oauthClientId, and oauthAllowPasswordLoginNodes.\n\n* Standard configurations: all other configuration items not included in the above two categories.\n\nWhen configuration access control is enabled (`enableConfigAccessControl=true`), the function returns only configuration items that the current user has permission to access. If access control is not enabled, no permission checks are performed.\n\n**User permission description**\n\n| User Role         | Non-sensitive Configuration | Standard Configuration | Sensitive Configuration |\n| ----------------- | --------------------------- | ---------------------- | ----------------------- |\n| Guest users       | Readable                    | Readable               | Not readable            |\n| Non-administrator | Readable                    | Readable               | Not readable            |\n| Administrator     | Readable                    | Readable               | Not readable            |\n\nFor more information on the returned configuration parameters, see [Configuration](https://docs.dolphindb.com/en/Database/Configuration/configuration.html).\n\n#### Parameters\n\n**key** (optional) is a string indicating the name of a configuration parameter.\n\n#### Returns\n\n* If *key* is not specified, return a dictionary with all configuration items that the current user has permission to read along with their corresponding values.\n\n* If *key* is specified:\n\n  * If it is a valid configuration parameter and the user has read permission, return a string scalar or vector indicating the value(s) of the parameter.\n\n  * If it is not a configuration parameter or a valid parameter without read permission, return a null value.\n"
    },
    "getConnections": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getConnections.html",
        "signatures": [
            {
                "full": "getConnections()",
                "name": "getConnections",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getConnections](https://docs.dolphindb.com/en/Functions/g/getConnections.html)\n\n\n\n#### Syntax\n\ngetConnections()\n\n#### Details\n\nReturn information about all network connections on the local node. It can be executed on all nodes.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table with three columns:\n\n* The first column (server) is the IP address and port number of the local node.\n\n* The second column (client) is the IP address and port number of a remote node.\n\n* The third column (startTime) is timestamp when the connection was established.\n\n#### Examples\n\n```\ngetConnections()\n```\n\n| server         | client          | startTime               |\n| -------------- | --------------- | ----------------------- |\n| localhost:8848 | 127.0.0.1:62546 | 2021.09.02T16:50:57.814 |\n| localhost:8848 | 127.0.0.1:63081 | 2021.09.02T10:50:16.350 |\n| localhost:8848 | 127.0.0.1:57559 | 2021.09.02T16:50:57.736 |\n"
    },
    "getConsoleJobs": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getConsoleJobs.html",
        "signatures": [
            {
                "full": "getConsoleJobs()",
                "name": "getConsoleJobs",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getConsoleJobs](https://docs.dolphindb.com/en/Functions/g/getConsoleJobs.html)\n\n\n\n#### Syntax\n\ngetConsoleJobs()\n\n#### Details\n\nReturn the descriptive information about the running interactive jobs of the local node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table with the following columns:\n\n| Name                | Meaning                                                                                                                                                      |\n| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| node                | the alias of the local node                                                                                                                                  |\n| userID              | the user ID                                                                                                                                                  |\n| rootJobId           | the root job ID                                                                                                                                              |\n| jobType             | the job type                                                                                                                                                 |\n| desc                | the job description                                                                                                                                          |\n| priority            | priority of the job which is marked as integers ranging from 0 to 9                                                                                          |\n| parallelism         | the parallelism, i.e., the maximum number of jobs that can run in parallel                                                                                   |\n| receiveTime         | the time when a job is received by the node                                                                                                                  |\n| sessionId           | the ID of the session where the job is submitted                                                                                                             |\n| remoteIP            | the IP address of the client where the job is submitted                                                                                                      |\n| remotePort          | the port number of the client where the job is submitted                                                                                                     |\n| totalTasks          | the total tasks broken down from the job                                                                                                                     |\n| finishedTasks       | the number of finished tasks                                                                                                                                 |\n| runningTask         | the number of running tasks                                                                                                                                  |\n| firstTaskStartTime  | the start time of the first task                                                                                                                             |\n| latestTaskStartTime | the start time of the latest task                                                                                                                            |\n| queue               | the task queues: The value can be normal queue (for level 0 workers); web queue (for web workers); local task queue (for level 1-5 workers); batch job queue |\n\n#### Examples\n\n```\ngetConsoleJobs()\n```\n\n| node     | userID | rootJobId                            | jobType | desc             | priority | parallelism | receiveTime             | sessionId  | remoteIP  | remotePort | totalTasks | finishedTasks | runningTask | firstTaskStartTime      | latestTaskStartTime     | queue        |\n| -------- | ------ | ------------------------------------ | ------- | ---------------- | -------- | ----------- | ----------------------- | ---------- | --------- | ---------- | ---------- | ------------- | ----------- | ----------------------- | ----------------------- | ------------ |\n| P2-node1 | admin  | 26681f9c-f914-81ae-47dd-8b8e6e106c48 | script  | getConsoleJobs() | 4        | 2           | 2022.01.05T11:05:06.778 | 1823289176 | 127.0.0.1 | 50595      | 1          | 0             | 1           | 2022.01.05T11:05:06.778 | 2022.01.05T11:05:06.778 | normal queue |\n"
    },
    "getControllerAlias": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getControllerAlias.html",
        "signatures": [
            {
                "full": "getControllerAlias()",
                "name": "getControllerAlias",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getControllerAlias](https://docs.dolphindb.com/en/Functions/g/getControllerAlias.html)\n\n\n\n#### Syntax\n\ngetControllerAlias()\n\n#### Details\n\nGet the alias of the controller. The controller alias is specified by *localSite* in the configuration file *controller.cfg* by default.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```language-python\ngetControllerAlias();\n// output: master\n```\n\nRelated: [getNodeAlias](https://docs.dolphindb.com/en/Functions/g/getNodeAlias.html)\n"
    },
    "getControllerElectionTick": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getControllerElectionTick.html",
        "signatures": [
            {
                "full": "getControllerElectionTick()",
                "name": "getControllerElectionTick",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getControllerElectionTick](https://docs.dolphindb.com/en/Functions/g/getControllerElectionTick.html)\n\n\n\n#### Syntax\n\ngetControllerElectionTick()\n\n#### Details\n\nObtain the election tick in the raft group composed of controllers. The election tick is specified by the parameter *tickCount* of command [setRaftElectionTick](https://docs.dolphindb.com/en/Functions/s/setRaftElectionTick.html) or the configuration parameter *raftElectionTick*.\n\nRelated Functions: [setRaftElectionTick](https://docs.dolphindb.com/en/Functions/s/setRaftElectionTick.html), [getRaftElectionTick](https://docs.dolphindb.com/en/Functions/g/getRaftElectionTick.html)\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn INT scalar.\n"
    },
    "getCurrentCatalog": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getCurrentCatalog.html",
        "signatures": [
            {
                "full": "getCurrentCatalog()",
                "name": "getCurrentCatalog",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getCurrentCatalog](https://docs.dolphindb.com/en/Functions/g/getCurrentCatalog.html)\n\n#### Syntax\n\ngetCurrentCatalog()\n\n#### Details\n\nGet the catalog used for the current session.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nuse CATALOG cat1;\nselect * from db1.table1 \ngetCurrentCatalog() \n// output: \"cat1\"\n```\n\n"
    },
    "getCurrentSessionAndUser": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getCurrentSessionAndUser.html",
        "signatures": [
            {
                "full": "getCurrentSessionAndUser()",
                "name": "getCurrentSessionAndUser",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getCurrentSessionAndUser](https://docs.dolphindb.com/en/Functions/g/getCurrentSessionAndUser.html)\n\n\n\n#### Syntax\n\ngetCurrentSessionAndUser()\n\n#### Details\n\nGet the session ID, username (\"guest\" if not logged in), remote IP address, and remote port number of the current session.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA tuple containing the above-mentioned elements.\n\n#### Examples\n\n```\ngetCurrentSessionAndUser()  \n// output: (2333906441, \"admin\", \"127.0.0.1\", 60302)\n```\n"
    },
    "getCurrentTDEKeyVersion": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getcurrenttdekeyversion.html",
        "signatures": [
            {
                "full": "getCurrentTDEKeyVersion()",
                "name": "getCurrentTDEKeyVersion",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getCurrentTDEKeyVersion](https://docs.dolphindb.com/en/Functions/g/getcurrenttdekeyversion.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetCurrentTDEKeyVersion()\n\n#### Details\n\n\\[Linux Only] This function retrieves the current TDE key version.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA LONG scalar.\n\n#### Examples\n\n```\ngetCurrentTDEKeyVersion()\n// output: long(3,698,850,997)\n```\n"
    },
    "getDatabaseClusterReplicationStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDatabaseClusterReplicationStatus.html",
        "signatures": [
            {
                "full": "getDatabaseClusterReplicationStatus()",
                "name": "getDatabaseClusterReplicationStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getDatabaseClusterReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getDatabaseClusterReplicationStatus.html)\n\n#### Syntax\n\ngetDatabaseClusterReplicationStatus()\n\n#### Details\n\nThis function checks whether asynchronous replication is enabled in all databases. It can only be executed by an administrator on the data node of a master cluster.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table containing the following columns:\n\n* dbName: the database name.\n\n* enabled: a Boolean value indicating whether asynchronous replication is enabled.\n\n* executionSet: the execution set ID to which the task belongs.\n\nRelated functions: [setDatabaseForClusterReplication](https://docs.dolphindb.com/en/Functions/s/setDatabaseForClusterReplication.html)\n\n"
    },
    "getDatabasesByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDatabasesByCluster.html",
        "signatures": [
            {
                "full": "getDatabasesByCluster(clusterName)",
                "name": "getDatabasesByCluster",
                "parameters": [
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    }
                ]
            }
        ],
        "markdown": "### [getDatabasesByCluster](https://docs.dolphindb.com/en/Functions/g/getDatabasesByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetDatabasesByCluster(clusterName)\n\n#### Details\n\nGet all databases of the specified cluster. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**clusterName** is a STRING scalar indicating the name of the cluster.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ngetDatabasesByCluster(\"MoMSender\")\n\n// Output:  [\"dfs://db2\",\"dfs://db1\"]\n```\n"
    },
    "getDatanodeRestartInterval": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getdatanoderestartinterval.html",
        "signatures": [
            {
                "full": "getDatanodeRestartInterval()",
                "name": "getDatanodeRestartInterval",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getDatanodeRestartInterval](https://docs.dolphindb.com/en/Functions/g/getdatanoderestartinterval.html)\n\n\n\n#### Syntax\n\ngetDatanodeRestartInterval()\n\n#### Details\n\nGet the value of *datanodeRestartInterval*. It can only be executed by an administrator on the controller.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn integer scalar.\n\nRelated function: [setDatanodeRestartInterval](https://docs.dolphindb.com/en/Functions/s/setdatanoderestartinterval.html)\n"
    },
    "getDBAccess": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDBAccess.html",
        "signatures": [
            {
                "full": "getDBAccess(dbUrl)",
                "name": "getDBAccess",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    }
                ]
            }
        ],
        "markdown": "### [getDBAccess](https://docs.dolphindb.com/en/Functions/g/getDBAccess.html)\n\n\n\n#### Syntax\n\ngetDBAccess(dbUrl)\n\n#### Details\n\nAllow users to get a detailed view of users and groups with privileges of the specified database.\n\n\\*\\*Note:\\*\\*This function can only be invoked by administrators or by users with DB\\_OWNER or DB\\_MANAGE privileges of the database.\n\n#### Parameters\n\n**dbUrl** is a string indicating the database URL.\n\n#### Returns\n\nA table with the following columns:\n\n* name: The user or group name.\n* type: User or group.\n* DB\\_READ, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE, DBOBJ\\_CREATE, DBOBJ\\_DELETE, DB\\_MANAGE: The specific privileges. The states can be ALLOW, DENY, or NONE. For more information on user access privileges, please refer to [User Access Control](https://docs.dolphindb.com/en/Tutorials/access_control.html).\n\n#### Examples\n\nUser1 with the DB\\_OWNER privilege creates the database dfs\\://testDB with following settings:\n\n* Grants DB\\_READ privilege to user2.\n* Denies DB\\_INSERT privilege to user3.\n* Grants DBOBJ\\_CREATE privilege to group1.\n\nUse getDBAccess to view the permission set of testDB.\n\n```\nlogin(`user1, `123456)\ngetDBAccess(\"dfs://testDB\")\n```\n\nOutput:\n\n| name   | type  | DB\\_READ | DB\\_INSERT | DB\\_UPDATE | DB\\_DELETE | DBOBJ\\_CREATE | DBOBJ\\_DELETE | DB\\_MANAGE |\n| :----- | :---- | :------- | :--------- | :--------- | :--------- | :------------ | :------------ | :--------- |\n| group1 | group | NONE     | NONE       | NONE       | NONE       | ALLOW         | NONE          | NONE       |\n| user3  | user  | NONE     | DENY       | NONE       | NONE       | NONE          | NONE          | NONE       |\n| user2  | user  | ALLOW    | NONE       | NONE       | NONE       | NONE          | NONE          | NONE       |\n| admin  | user  | ALLOW    | ALLOW      | ALLOW      | ALLOW      | ALLOW         | ALLOW         | ALLOW      |\n\nRelated functions: [getTableAccess](https://docs.dolphindb.com/en/Functions/g/getTableAccess.html)\n"
    },
    "getDFSDatabasesByOwner": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getdfsdatabasebyowner.html",
        "signatures": [
            {
                "full": "getDFSDatabasesByOwner(user)",
                "name": "getDFSDatabasesByOwner",
                "parameters": [
                    {
                        "full": "user",
                        "name": "user"
                    }
                ]
            }
        ],
        "markdown": "### [getDFSDatabasesByOwner](https://docs.dolphindb.com/en/Functions/g/getdfsdatabasebyowner.html)\n\n\n\n#### Syntax\n\ngetDFSDatabasesByOwner(user)\n\n#### Details\n\nReturn a vector that lists databases created by the specific user. This function can only be executed by administrators.\n\n#### Parameters\n\n**user** is a STRING scalar indicating a user name.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ngetDFSDatabasesByOwner(user=\"user1\")\n// output:[\"dfs://tsdb1\",\"dfs://tsdb2\"]\n```\n"
    },
    "getDFSDatabases": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDFSDatabases.html",
        "signatures": [
            {
                "full": "getDFSDatabases()",
                "name": "getDFSDatabases",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getDFSDatabases](https://docs.dolphindb.com/en/Functions/g/getDFSDatabases.html)\n\n\n\n#### Syntax\n\ngetDFSDatabases()\n\n#### Details\n\nThis function returns a vector that lists DFS databases on the current node.\n\nFrom version 1.30.21/2.00.9 onwards,\n\n* For an administrator or a non-admin user granted with DB\\_MANAGE privilege, the function returns all DFS databases on the current node;\n\n* Otherwise, the function returns DFS databases to which the user is granted with the DB\\_OWNER privilege.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetDFSDatabases()\n```\n"
    },
    "getDfsRebalanceConcurrency": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDfsRebalanceConcurrency.html",
        "signatures": [
            {
                "full": "getDfsRebalanceConcurrency()",
                "name": "getDfsRebalanceConcurrency",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getDfsRebalanceConcurrency](https://docs.dolphindb.com/en/Functions/g/getDfsRebalanceConcurrency.html)\n\n#### Syntax\n\ngetDfsRebalanceConcurrency()\n\n#### Details\n\nGet the number of worker threads used by the current node for chunk rebalance. It can only be executed by an administrator on the controller.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn integer scalar.\n\n#### Examples\n\n```\ngetDfsRecoveryConcurrency()\n```\n\nRelated functions: [resetDfsRebalanceConcurrency](https://docs.dolphindb.com/en/Functions/r/resetDfsRebalanceConcurrency.html)\n\n"
    },
    "getDfsRecoveryConcurrency": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDfsRecoveryConcurrency.html",
        "signatures": [
            {
                "full": "getDfsRecoveryConcurrency()",
                "name": "getDfsRecoveryConcurrency",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getDfsRecoveryConcurrency](https://docs.dolphindb.com/en/Functions/g/getDfsRecoveryConcurrency.html)\n\n#### Syntax\n\ngetDfsRecoveryConcurrency()\n\n#### Details\n\nGet the number of worker threads used by the current node for chunk recovery. It can only be executed by an administrator on the controller.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn integer scalar.\n\n#### Examples\n\n```\ngetDfsRecoveryConcurrency()\n```\n\nRelated functions: [resetDfsRecoveryConcurrency](https://docs.dolphindb.com/en/Functions/r/resetDfsRecoveryConcurrency.html)\n\n"
    },
    "getDFSTablesByDatabase": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDFSTablesByDatabase.html",
        "signatures": [
            {
                "full": "getDFSTablesByDatabase(directory)",
                "name": "getDFSTablesByDatabase",
                "parameters": [
                    {
                        "full": "directory",
                        "name": "directory"
                    }
                ]
            }
        ],
        "markdown": "### [getDFSTablesByDatabase](https://docs.dolphindb.com/en/Functions/g/getDFSTablesByDatabase.html)\n\n\n\n#### Syntax\n\ngetDFSTablesByDatabase(directory)\n\n#### Details\n\nThis functions returns a vector that lists tables under the specified DFS directory.\n\nFrom version 1.30.21/2.00.9 onwards,\n\n* For an administrator, it returns all DFS tables under the specified database on the current node.\n* When executed by a non-admin user, it will return:\n  * All DFS tables in databases where the user has any of the following permissions:DB\\_OWNER, DB\\_MANAGE, DB\\_READ, DB\\_WRITE, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE.\n  * Within the specified database,the DFS tables where the user has any of the following permissions: TABLE\\_READ, TABLE\\_INSERT, TABLE\\_WRITE, TABLE\\_UPDATE, or TABLE\\_DELETE.\n\n#### Parameters\n\n**directory** is the directory where a DFS database is located.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetDFSTablesByDatabase(\"dfs://db\")\n// output: [\"dfs://db/dt\", \"dfs://db/dt1\"]\n```\n"
    },
    "getDiskIOStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDiskIOStat.html",
        "signatures": [
            {
                "full": "getDiskIOStat()",
                "name": "getDiskIOStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getDiskIOStat](https://docs.dolphindb.com/en/Functions/g/getDiskIOStat.html)\n\n\n\n#### Syntax\n\ngetDiskIOStat()\n\n#### Details\n\nGet disk I/O statistics.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a dictionary with 2 pairs.\n\n* *diskIOQueueDepths* is a vector indicating the length of each I/O queue. All I/O tasks in the same DolphinDB instance belong to the same I/O queue.\n\n* *diskIOConcurrnecyLevel* is an integer indicating the number of I/O queues.\n\n#### Examples\n\n```\ngetDiskIOStat()\n/* output:\ndiskIOQueueDepths->[0]\ndiskIOConcurrnecyLevel->1\n*/\n```\n"
    },
    "getDynamicConfig": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getDynamicConfig.html",
        "signatures": [
            {
                "full": "getDynamicConfig()",
                "name": "getDynamicConfig",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getDynamicConfig](https://docs.dolphindb.com/en/Functions/g/getDynamicConfig.html)\n\n#### Syntax\n\ngetDynamicConfig()\n\n#### Details\n\nGet all configuration parameters that can be modified by function `setDynamicConfig`.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\ngetDynamicConfig();\n// output: [\"TSDBVectorIndexCacheSize\",\"TSDBCacheEngineSize\",\"dfsChunkNodeHeartBeatTimeout\",\"reservedMemSize\",\"recoveryWorkers\",\"OLAPCacheEngineSize\",\"memLimitOfTempResult\",\"maxMemSize\",\"memLimitOfAllTempResults\",\"maxPartitionNumPerQuery\",\"memLimitOfTaskGroupResult\",\"memLimitOfQueryResult\",\"maxConnections\",\"maxBlockSizeForReservedMemory\",\"TSDBBlockCacheSize\",\"logLevel\",\"enableNullSafeJoin\",\"enableMultiThreadMerge\"]\n```\n\n"
    },
    "getEnableNullSafeJoin": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getenablenullsafejoin.html",
        "signatures": [
            {
                "full": "getEnableNullSafeJoin()",
                "name": "getEnableNullSafeJoin",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getEnableNullSafeJoin](https://docs.dolphindb.com/en/Functions/g/getenablenullsafejoin.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetEnableNullSafeJoin()\n\n#### Details\n\nGet the dynamically modified configuration value of *enableNullSafeJoin*(for detailed usage, see[Configuration > Reference](https://docs.dolphindb.com/en/Database/Configuration/reference.html)).\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\n// Set enableNullSafeJoin to true\nsetDynamicConfig(\"enableNullSafeJoin\", true)\n// Check the modified configuration value\ngetEnableNullSafeJoin()\n// output: true\n```\n"
    },
    "getEnv": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getEnv.html",
        "signatures": [
            {
                "full": "getEnv(name, [default])",
                "name": "getEnv",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[default]",
                        "name": "default",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getEnv](https://docs.dolphindb.com/en/Functions/g/getEnv.html)\n\n\n\n#### Syntax\n\ngetEnv(name, \\[default])\n\n#### Details\n\nReturn the value of the specified environment variable. Otherwise return *default*.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of an environment variable.\n\n**default** is a STRING scalar indicating the value to be returned when the environment variable does not exist. If it is unspecified, return an empty string.\n\n#### Returns\n\nA Boolean scalar.\n\n#### Examples\n\n```\ngetEnv(\"path\")\n// output: C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Program Files\\Docker\\Docker\\Resources\\bin;\n\ngetEnv(\"JAVA_HOME\");\n// output: C:\\Program Files\\Java\\jdk1.8.0_191\n\ngetEnv(\"not_exist\",\"not exist\")\n// output: not exist\n```\n"
    },
    "getExecDir": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getExecDir.html",
        "signatures": [
            {
                "full": "getExecDir()",
                "name": "getExecDir",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getExecDir](https://docs.dolphindb.com/en/Functions/g/getExecDir.html)\n\nFirst introduced in versions: 2.00.17, 2.00.16.23.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\ngetExecDir()\n\n#### Details\n\nGet the absolute path of the directory where the dolphindb executable file is located.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetExecDir()\n// output: /home/dolphindb/server \n```\n"
    },
    "getFunctionViews": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getFunctionViews.html",
        "signatures": [
            {
                "full": "getFunctionViews()",
                "name": "getFunctionViews",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getFunctionViews](https://docs.dolphindb.com/en/Functions/g/getFunctionViews.html)\n\n\n\n#### Syntax\n\ngetFunctionViews()\n\n#### Details\n\nWhen this function is executed by an administrator, it returns all the function views. When executed by a user with VIEW\\_OWNER permission, it only returns the function views created by the user.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table with four columns:\n\n* name: The function name.\n\n* body: The function body. For function views that are directly wrapped by a dom module, or created by wrapping functions after loading a dom module using `use <moduleName>`, this field displays only the function name rather than the function body.\n\n* **owner**: The creator of the function view.\n\n  **createTime**: The creation time of the function view.\n\n#### Examples\n\n```\ndef myFunc(){\n    print \"myFunc\"\n}\n\naddFunctionView(udf=myFunc)\ngetFunctionViews()\n```\n\n| name   | body                            | owner | createTime              |\n| ------ | ------------------------------- | ----- | ----------------------- |\n| myFunc | def myFunc(){ print(\"myFunc\") } | admin | 2026.02.02 11:10:54.114 |\n\n**Related Function**: [addFunctionView](https://docs.dolphindb.com/en/Functions/a/addFunctionView.html)\n"
    },
    "getGroupAccess": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getGroupAccess.html",
        "signatures": [
            {
                "full": "getGroupAccess(groupIds)",
                "name": "getGroupAccess",
                "parameters": [
                    {
                        "full": "groupIds",
                        "name": "groupIds"
                    }
                ]
            }
        ],
        "markdown": "### [getGroupAccess](https://docs.dolphindb.com/en/Functions/g/getGroupAccess.html)\n\n\n\n#### Syntax\n\ngetGroupAccess(groupIds)\n\n#### Details\n\nQuery privileges for one or multiple groups. It can only be executed by an administrator.\n\n**Note:**\n\n* Since version 3.00.5, privileges for Orca graphs and stream tables returned.\n\n* Since version 3.00.2, compute group privileges are returned.\n\n* Since version 3.00.0, catalog privileges are returned.\n\n#### Parameters\n\n**groupIds** is a STRING scalar/vector indicating one or multiple group names.\n\n#### Returns\n\nA table.\n"
    },
    "getGroupAccessByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getGroupAccessByCluster.html",
        "signatures": [
            {
                "full": "getGroupAccessByCluster(groupIds, clusterName)",
                "name": "getGroupAccessByCluster",
                "parameters": [
                    {
                        "full": "groupIds",
                        "name": "groupIds"
                    },
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    }
                ]
            }
        ],
        "markdown": "### [getGroupAccessByCluster](https://docs.dolphindb.com/en/Functions/g/getGroupAccessByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetGroupAccessByCluster(groupIds, clusterName)\n\n#### Details\n\nGet the privileges for specified user group. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n**Return value**: A table with the same structure as the return value of the `getGroupAccess` function.\n\n#### Parameters\n\n**groupIds** is a STRING scalar or vector, indicating group name(s).\n\n**clusterName** is a STRING scalar or vector, indicating cluster name(s).\n\n#### Returns\n\nA table with the same structure as the return value of the `getGroupAccess` function.\n\n#### Examples\n\n```\ngetGroupAccessByCluster([\"group2\"], \"MoMSender\")  \n```\n\n| groupName | users | ACCESS\\_READ | ACCESS\\_INSERT | ACCESS\\_UPDATE | ACCESS\\_DELETE | VIEW\\_EXEC | SCRIPT\\_EXEC | TEST\\_EXEC | DBOBJ\\_CREATE | ... |\n| --------- | ----- | ------------ | -------------- | -------------- | -------------- | ---------- | ------------ | ---------- | ------------- | --- |\n| group2    | user2 | none         | allow          | none           | none           | none       | none         | none       | none          | ... |\n\nRelated Function: [getGroupAccess](https://docs.dolphindb.com/en/Functions/g/getGroupAccess.html)\n"
    },
    "getGroupList": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getGroupList.html",
        "signatures": [
            {
                "full": "getGroupList()",
                "name": "getGroupList",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getGroupList](https://docs.dolphindb.com/en/Functions/g/getGroupList.html)\n\n\n\n#### Syntax\n\ngetGroupList()\n\n#### Details\n\nReturn a list of group names. It can only be executed by an administrator.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING vector.\n"
    },
    "getGroupListOfAllClusters": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getGroupListOfAllClusters.html",
        "signatures": [
            {
                "full": "getGroupListOfAllClusters()",
                "name": "getGroupListOfAllClusters",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getGroupListOfAllClusters](https://docs.dolphindb.com/en/Functions/g/getGroupListOfAllClusters.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetGroupListOfAllClusters()\n\n#### Details\n\nGet the list of user groups across all clusters in a multi-cluster environment. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA dictionary with the following keys:\n\n* key: Name of the cluster.\n* value: A list of user group names.\n\n#### Examples\n\n```\ngetGroupListOfAllClusters()\n      \n/* Output:\nmasterOfMaster->[\"group1\"]\nMoMSender->[\"group2\"]  \n*/  \n```\n"
    },
    "getGroupsByUserId": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getGroupsByUserId.html",
        "signatures": [
            {
                "full": "getGroupsByUserId(userId)",
                "name": "getGroupsByUserId",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    }
                ]
            }
        ],
        "markdown": "### [getGroupsByUserId](https://docs.dolphindb.com/en/Functions/g/getGroupsByUserId.html)\n\n\n\n#### Syntax\n\ngetGroupsByUserId(userId)\n\n#### Details\n\nGet the group names that the user belongs to. It can only be executed by an administrator.\n\n#### Parameters\n\n**userId** is a string indicating a user name.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ngetGroupsByUserId(\"admin\")\n// output: [\"MVP\",\"MYMVP\"]\n```\n"
    },
    "getHaMvccLeader": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getHaMvccLeader.html",
        "signatures": [
            {
                "full": "getHaMvccLeader(groupId)",
                "name": "getHaMvccLeader",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [getHaMvccLeader](https://docs.dolphindb.com/en/Functions/g/getHaMvccLeader.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ngetHaMvccLeader(groupId)\n\n#### Details\n\nRetrieves the Leader node name of the specified HA Mvcc Raft group.\n\n#### Parameters\n\n**groupId** is an integer indicating the HA MVCC Raft group ID.\n\n#### Returns\n\nReturns a STRING scalar indicating the Leader node name.\n\n#### Examples\n\n```\ngetHaMvccLeader(2)\n// output\n\"datanode8907\"\n```\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "getHaMvccRaftGroups": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getHaMvccRaftGroups.html",
        "signatures": [
            {
                "full": "getHaMvccRaftGroups()",
                "name": "getHaMvccRaftGroups",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getHaMvccRaftGroups](https://docs.dolphindb.com/en/Functions/g/getHaMvccRaftGroups.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ngetHaMvccRaftGroups()\n\n#### Details\n\nRetrieves the Raft group information related to HA MVCC on the current node.\n\n#### Returns\n\nReturns a table:\n\n* `id`: an INT column indicating the Raft group ID (HA-MVCC-related groups only).\n* `sites`: a STRING column indicating the node information included in the Raft group.\n\n#### Examples\n\n```\ngetHaMvccRaftGroups()\n```\n\n| id | sites                                  |\n| -- | -------------------------------------- |\n| 2  | datanode8905,datanode8906,datanode8907 |\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "getHaMvccTableInfo": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getHaMvccTableInfo.html",
        "signatures": [
            {
                "full": "getHaMvccTableInfo(groupId)",
                "name": "getHaMvccTableInfo",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [getHaMvccTableInfo](https://docs.dolphindb.com/en/Functions/g/getHaMvccTableInfo.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ngetHaMvccTableInfo(groupId)\n\n#### Details\n\nRetrieves the metadata of all HA MVCC tables in the specified HA MVCC Raft group.\n\n**Notes:** This function must be executed on a member node of the Raft group.\n\n#### Parameters\n\n**groupId** is an integer indicating the HA MVCC Raft group ID.\n\n#### Returns\n\nReturns a table containing the following columns (column names are subject to the actual system output):\n\n* `tableName`: STRING\n* `rows`: LONG\n* `memoryUsed`: LONG, in bytes\n* `schema`: STRING\n* `defaultValues`: STRING\n* `allowNull`: STRING\n\n#### Examples\n\n```\ngetHaMvccTableInfo(5)\n```\n\n| tableName  | rows | memoryUsed | schema                            | defaultValues | allowNull          |\n| ---------- | ---- | ---------- | --------------------------------- | ------------- | ------------------ |\n| demoHaMvcc | 0    | 640        | name:STRING, id:INT, value:DOUBLE | A001, 1, 3.6  | false, true, false |\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "getHomeDir": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getHomeDir.html",
        "signatures": [
            {
                "full": "getHomeDir()",
                "name": "getHomeDir",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getHomeDir](https://docs.dolphindb.com/en/Functions/g/getHomeDir.html)\n\n\n\n#### Syntax\n\ngetHomeDir()\n\n#### Details\n\nGet the home directory of the local node, which is defined in the configuration file *dolphindb.cfg*.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetHomeDir()\n// output: /data/ddb/server\n```\n"
    },
    "getInstrumentCalendar": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentCalendar.html",
        "signatures": [
            {
                "full": "getInstrumentCalendar(instrument)",
                "name": "getInstrumentCalendar",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentCalendar](https://docs.dolphindb.com/en/Functions/g/getInstrumentCalendar.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentCalendar(instrument)\n\n#### Details\n\nGet the trading calendar of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\nins = parseInstrument(swap)\ngetInstrumentCalendar(ins)\n// output: CFET\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentCoupon": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentCoupon.html",
        "signatures": [
            {
                "full": "getInstrumentCoupon(instrument)",
                "name": "getInstrumentCoupon",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentCoupon](https://docs.dolphindb.com/en/Functions/g/getInstrumentCoupon.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentCoupon(instrument)\n\n#### Details\n\nGet the coupon rate of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DOUBLE type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"nominal\": 100,\n    \"instrumentId\": \"0001\",\n    \"start\": 2022.05.15,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nins = parseInstrument(bond)\ngetInstrumentCoupon(ins)\n// output: 0.0276\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentCreditRating": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentcreditrating.html",
        "signatures": [
            {
                "full": "getInstrumentCreditRating(instrument)",
                "name": "getInstrumentCreditRating",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentCreditRating](https://docs.dolphindb.com/en/Functions/g/getinstrumentcreditrating.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentCreditRating(instrument)\n\n#### Details\n\nGet the credit rating of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the STRING type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"0001\",\n    \"start\": 1996.03.01,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"subType\":\"TREASURY_BOND\",\n    \"creditRating\":\"B\",\n    \"settlement\": 2022.05.15 \n}\nins = parseInstrument(bond)\ngetInstrumentCreditRating(ins)\n// output: B\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentCurrency": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentCurrency.html",
        "signatures": [
            {
                "full": "getInstrumentCurrency(instrument)",
                "name": "getInstrumentCurrency",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentCurrency](https://docs.dolphindb.com/en/Functions/g/getInstrumentCurrency.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentCurrency(instrument)\n\n#### Details\n\nGet the currency type of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"nominal\": 100,\n    \"instrumentId\": \"0001\",\n    \"start\": 2022.05.15,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"currency\": \"USD\"\n}\nins = parseInstrument(bond)\ngetInstrumentCurrency(ins)\n// output: USD\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentCurrencyPair": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentCurrencyPair.html",
        "signatures": [
            {
                "full": "getInstrumentCurrencyPair(instrument)",
                "name": "getInstrumentCurrencyPair",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentCurrencyPair](https://docs.dolphindb.com/en/Functions/g/getInstrumentCurrencyPair.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentCurrencyPair(instrument)\n\n#### Details\n\nGet the currency pair of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nforward = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.09.24,\n    \"delivery\": 2025.09.26,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E8,\n    \"strike\": 7.2\n}\nins = parseInstrument(forward)\ngetInstrumentCurrencyPair(ins)\n// output: USDCNY\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentDayCountConvention": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentDayCountConvention.html",
        "signatures": [
            {
                "full": "getInstrumentDayCountConvention(instrument)",
                "name": "getInstrumentDayCountConvention",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentDayCountConvention](https://docs.dolphindb.com/en/Functions/g/getInstrumentDayCountConvention.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentDayCountConvention(instrument)\n\n#### Details\n\nGet the day count convention of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"nominal\": 100,\n    \"instrumentId\": \"0001\",\n    \"start\": 2022.05.15,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nins = parseInstrument(bond)\ngetInstrumentDayCountConvention(ins)\n\n// output: ActualActualISDA\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentDelivery": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentDelivery.html",
        "signatures": [
            {
                "full": "getInstrumentDelivery(instrument)",
                "name": "getInstrumentDelivery",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentDelivery](https://docs.dolphindb.com/en/Functions/g/getInstrumentDelivery.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentDelivery(instrument)\n\n#### Details\n\nGet the delivery date of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DATE type.\n\n#### Examples\n\n```\nforward =  {\n   \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.09.24,\n    \"delivery\": 2025.09.26,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E8,\n    \"strike\": 7.2\n}\nins = parseInstrument(forward)\ngetInstrumentDelivery(ins)\n\n// output: 2025.09.26\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentDirection": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentDirection.html",
        "signatures": [
            {
                "full": "getInstrumentDirection(instrument)",
                "name": "getInstrumentDirection",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentDirection](https://docs.dolphindb.com/en/Functions/g/getInstrumentDirection.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentDirection(instrument)\n\n#### Details\n\nGet the trade direction of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nforward = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.09.24,\n    \"delivery\": 2025.09.26,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E8,\n    \"strike\": 7.2\n}\nins = parseInstrument(forward)\ngetInstrumentDirection(ins)\n// output: Buy         \n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentExpiry": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentexpiry.html",
        "signatures": [
            {
                "full": "getInstrumentExpiry(instrument)",
                "name": "getInstrumentExpiry",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentExpiry](https://docs.dolphindb.com/en/Functions/g/getinstrumentexpiry.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentExpiry(instrument)\n\n#### Details\n\nGet the expiry date of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\n```\nforward =  {\n   \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.09.24,\n    \"delivery\": 2025.09.26,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E8,\n    \"strike\": 7.2\n}\nins = parseInstrument(forward)\ngetInstrumentExpiry(ins)\n\n// Output: 2025.09.24\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentFarDelivery": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentFarDelivery.html",
        "signatures": [
            {
                "full": "getInstrumentFarDelivery(instrument)",
                "name": "getInstrumentFarDelivery",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentFarDelivery](https://docs.dolphindb.com/en/Functions/g/getInstrumentFarDelivery.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentFarDelivery(instrument)\n\n#### Details\n\nGet the far delivery date of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DATE type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURUSD\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 1.1,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 1.2,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\nins = parseInstrument(swap)\ngetInstrumentFarDelivery(ins)\n\n// output: 2026.06.10\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentFarExpiry": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentFarExpiry.html",
        "signatures": [
            {
                "full": "getInstrumentFarExpiry(instrument)",
                "name": "getInstrumentFarExpiry",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentFarExpiry](https://docs.dolphindb.com/en/Functions/g/getInstrumentFarExpiry.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentFarExpiry(instrument)\n\n#### Details\n\nGet the far expiry date of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DATE type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURUSD\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 1.1,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 1.2,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\nins = parseInstrument(swap)\ngetInstrumentFarExpiry(ins)\n\n// output: 2026.06.08\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentFarStrike": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentfarstrike.html",
        "signatures": [
            {
                "full": "getInstrumentFarStrike(instrument)",
                "name": "getInstrumentFarStrike",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentFarStrike](https://docs.dolphindb.com/en/Functions/g/getinstrumentfarstrike.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentFarStrike(instrument)\n\n#### Details\n\nGet the far-leg strike price of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DOUBLE type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURUSD\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 1.1,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 1.2,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\ninstrument = parseInstrument(swap)\ngetInstrumentFarStrike(instrument)\n\n// output: 1.2\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentField": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html",
        "signatures": [
            {
                "full": "getInstrumentField(instrument, key, [default])",
                "name": "getInstrumentField",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "key",
                        "name": "key"
                    },
                    {
                        "full": "[default]",
                        "name": "default",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentField(instrument, key, \\[default])\n\n#### Details\n\nGet the value of the specified field (key) from one or more instruments:\n\n* If *default* is not set, the function returns the field value if it exists; otherwise, it returns a null value.\n* If *default* is set, the function returns the field value converted to the type specified by *default* if the field has a valid value; otherwise, it returns *default*.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n**key** is a scalar of the STRING type, indicating a field from the instrument. The value must match a field name defined in *instrument*.\n\n**default** is a scalar, indicating the default value for *key*. The following types are supported: LOGICAL, INTEGRAL (except COMPRESSED), TEMPORAL (except DATEHOUR), FLOATING, LITERAL, and DECIMAL.\n\n#### Returns\n\n* If *instrument* is a scalar, the function returns a scalar.\n* If *instrument* is a vector, the function returns a vector of the same length as *instrument*.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"0001\",\n    \"start\": 1996.03.01,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"subType\":\"TREASURY_BOND\",\n    \"creditRating\":\"B\",\n    \"settlement\": 2022.05.15 \n}\nins = parseInstrument(bond)\ngetInstrumentField(ins, \"productType\")\n// output: Cash\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentFixedDayCountConvention": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentfixeddaycountconvention.html",
        "signatures": [
            {
                "full": "getInstrumentFixedDayCountConvention(instrument)",
                "name": "getInstrumentFixedDayCountConvention",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentFixedDayCountConvention](https://docs.dolphindb.com/en/Functions/g/getinstrumentfixeddaycountconvention.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentFixedDayCountConvention(instrument)\n\n#### Details\n\nGet the fixed-leg day count convention of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the STRING type.\n\n#### Examples\n\n```\nswap =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\ninstrument = parseInstrument(swap)\ngetInstrumentFixedDayCountConvention(instrument)\n\n// output: Actual365\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentFixedRate": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentfixedrate.html",
        "signatures": [
            {
                "full": "getInstrumentFixedRate(instrument)",
                "name": "getInstrumentFixedRate",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentFixedRate](https://docs.dolphindb.com/en/Functions/g/getinstrumentfixedrate.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentFixedRate(instrument)\n\n#### Details\n\nGet the fixed-leg rate of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DOUBLE type.\n\n#### Examples\n\n```\nswap =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\ninstrument = parseInstrument(swap)\ngetInstrumentFixedRate(instrument)\n\n// output: 0.02\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentFloatingDayCountConvention": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentfloatingdaycountconvention.html",
        "signatures": [
            {
                "full": "getInstrumentFloatingDayCountConvention(instrument)",
                "name": "getInstrumentFloatingDayCountConvention",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentFloatingDayCountConvention](https://docs.dolphindb.com/en/Functions/g/getinstrumentfloatingdaycountconvention.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentFloatingDayCountConvention(instrument)\n\n#### Details\n\nGet the floating-leg day count convention of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the STRING type.\n\n#### Examples\n\n```\nswap =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\ninstrument = parseInstrument(swap)\ngetInstrumentFloatingDayCountConvention(instrument)\n\n// output: Actual360\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentFrequency": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentFrequency.html",
        "signatures": [
            {
                "full": "getInstrumentFrequency(instrument)",
                "name": "getInstrumentFrequency",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentFrequency](https://docs.dolphindb.com/en/Functions/g/getInstrumentFrequency.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentFrequency(instrument)\n\n#### Details\n\nGet the coupon frequency of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"nominal\": 100,\n    \"instrumentId\": \"0001\",\n    \"start\": 2022.05.15,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nins = parseInstrument(bond)\ngetInstrumentFrequency(ins)\n\n// output: Semiannual\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentIborIndex": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentIborIndex.html",
        "signatures": [
            {
                "full": "getInstrumentIborIndex(instrument)",
                "name": "getInstrumentIborIndex",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentIborIndex](https://docs.dolphindb.com/en/Functions/g/getInstrumentIborIndex.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentIborIndex(instrument)\n\n#### Details\n\nGet the interbank offered rate (IBOR) of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\nins = parseInstrument(swap)\ngetInstrumentIborIndex(ins)\n// output: SHIBOR_3M\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentInstrumentId": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentinstrumentid.html",
        "signatures": [
            {
                "full": "getInstrumentInstrumentId(instrument)",
                "name": "getInstrumentInstrumentId",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentInstrumentId](https://docs.dolphindb.com/en/Functions/g/getinstrumentinstrumentid.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentInstrumentId(instrument)\n\n#### Details\n\nGet the ID of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the STRING type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"DiscountBond\",\n    \"instrumentId\": \"259924.IB\",\n    \"start\": 2025.04.17,\n    \"maturity\": 2025.07.17,\n    \"issuePrice\": 99.664,\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\ninstrument = parseInstrument(bond)\ngetInstrumentInstrumentId(instrument)\n\n// output: 259924.IB\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentIssuePrice": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentIssuePrice.html",
        "signatures": [
            {
                "full": "getInstrumentIssuePrice(instrument)",
                "name": "getInstrumentIssuePrice",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentIssuePrice](https://docs.dolphindb.com/en/Functions/g/getInstrumentIssuePrice.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentIssuePrice(instrument)\n\n#### Details\n\nGet the issue price of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DOUBLE type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"nominal\": 100,\n    \"instrumentId\": \"0001\",\n    \"start\": 2022.05.15,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nins = parseInstrument(bond)\ngetInstrumentIssuePrice(ins)\n\n// output: 100\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentKeys": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html",
        "signatures": [
            {
                "full": "getInstrumentKeys(instrument)",
                "name": "getInstrumentKeys",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentKeys(instrument)\n\n#### Details\n\nGet the fields defined in one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\n* If *instrument* is a scalar, the function returns a STRING vector.\n* If *instrument* is a vector, the function returns a tuple consisting of STRING vectors.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"0001\",\n    \"start\": 1996.03.01,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"subType\":\"TREASURY_BOND\",\n    \"creditRating\":\"B\",\n    \"settlement\": 2022.05.15 \n}\nins = parseInstrument(bond)\ngetInstrumentKeys(ins)\n// output: [\"coupon\",\"subType\",\"discountCurve\",\"cashflow\",\"currency\",\"calendar\",\"dayCountConvention\",\"start\",\"nominal\",\"instrumentId\",\"creditRating\",\"maturity\",\"bondType\",\"version\",\"spreadCurve\",\"productType\",\"assetType\",\"settlement\",\"frequency\",\"cashFlow\",\"issuePrice\"]\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html)\n"
    },
    "getInstrumentMaturity": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentmaturity.html",
        "signatures": [
            {
                "full": "getInstrumentMaturity(instrument)",
                "name": "getInstrumentMaturity",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentMaturity](https://docs.dolphindb.com/en/Functions/g/getinstrumentmaturity.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentMaturity(instrument)\n\n#### Details\n\nGet the maturity date of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"0001\",\n    \"start\": 1996.03.01,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"subType\":\"TREASURY_BOND\",\n    \"creditRating\":\"B\",\n    \"settlement\": 2022.05.15 \n}\nins = parseInstrument(bond)\ngetInstrumentMaturity(ins)\n\n// output: 2032.05.15\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNearDelivery": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentNearDelivery.html",
        "signatures": [
            {
                "full": "getInstrumentNearDelivery(instrument)",
                "name": "getInstrumentNearDelivery",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNearDelivery](https://docs.dolphindb.com/en/Functions/g/getInstrumentNearDelivery.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentNearDelivery(instrument)\n\n#### Details\n\nGet the near delivery date of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DATE type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURUSD\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 1.1,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 1.2,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\nins = parseInstrument(swap)\ngetInstrumentNearDelivery(ins)\n\n// output: 2025.12.10\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNearExpiry": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentNearExpiry.html",
        "signatures": [
            {
                "full": "getInstrumentNearExpiry(instrument)",
                "name": "getInstrumentNearExpiry",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNearExpiry](https://docs.dolphindb.com/en/Functions/g/getInstrumentNearExpiry.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentNearExpiry(instrument)\n\n#### Details\n\nGet the near expiry date of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DATE type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURUSD\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 1.1,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 1.2,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\nins = parseInstrument(swap)\ngetInstrumentNearExpiry(ins)\n\n// output: 2025.12.08\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNearStrike": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentnearstrike.html",
        "signatures": [
            {
                "full": "getInstrumentNearStrike(instrument)",
                "name": "getInstrumentNearStrike",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNearStrike](https://docs.dolphindb.com/en/Functions/g/getinstrumentnearstrike.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentNearStrike(instrument)\n\n#### Details\n\nGet the near-leg strike price of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DOUBLE type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURUSD\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 1.1,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 1.2,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\ninstrument = parseInstrument(swap)\n\ngetInstrumentNearStrike(instrument)\n// output: 1.1\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNominal": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentNominal.html",
        "signatures": [
            {
                "full": "getInstrumentNominal(instrument)",
                "name": "getInstrumentNominal",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNominal](https://docs.dolphindb.com/en/Functions/g/getInstrumentNominal.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentNominal(instrument)\n\n#### Details\n\nGet the nominal value of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DOUBLE type.\n\n#### Examples\n\n```\ndeposit =  {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"nominal\":100,\n    \"start\": 2025.05.15,\n    \"maturity\": 2025.08.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E6,\n    \"payReceive\": \"Receive\"\n}\nins = parseInstrument(deposit)\ngetInstrumentNominal(ins)\n\n// output: 100\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNominalCouponRate": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentnominalcouponrate.html",
        "signatures": [
            {
                "full": "getInstrumentNominalCouponRate(instrument)",
                "name": "getInstrumentNominalCouponRate",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNominalCouponRate](https://docs.dolphindb.com/en/Functions/g/getinstrumentnominalcouponrate.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentNominalCouponRate(instrument)\n\n#### Details\n\nGet the nominal coupon rate of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DOUBLE type.\n\n#### Examples\n\n```\nfutures =  {\n    \"productType\": \"Futures\",\n    \"futuresType\": \"BondFutures\",\n    \"instrumentId\": \"T2509\",  \n    \"nominal\": 100.0,\n    \"maturity\": \"2022.09.09\",\n    \"settlement\": \"2022.09.11\",\n    \"underlying\": bond,\n    \"nominalCouponRate\": 0.03  \n}\ninstrument = parseInstrument(futures)\ngetInstrumentNominalCouponRate(instrument)\n\n// output: 0.03\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNotional": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentnotional.html",
        "signatures": [
            {
                "full": "getInstrumentNotional(instrument)",
                "name": "getInstrumentNotional",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNotional](https://docs.dolphindb.com/en/Functions/g/getinstrumentnotional.html)\n\nFirst introduced in version: 3.00.4.1\n\n#### Syntax\n\ngetInstrumentNotional(instrument)\n\n#### Details\n\nGet the notional principal amount of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nAn ANY vector.\n\n#### Examples\n\n```\ndeposit =  {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"version\": 0, \n    \"start\": 2025.05.15,\n    \"maturity\": 2025.08.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notional\":[\"CNY\", 1E6],\n    \"payReceive\": \"Receive\"\n}\ninstrument = parseInstrument(deposit)\ngetInstrumentNotional(instrument)\n\n// output: (\"CNY\",1000000)\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNotionalAmount": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentNotionalAmount.html",
        "signatures": [
            {
                "full": "getInstrumentNotionalAmount(instrument)",
                "name": "getInstrumentNotionalAmount",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNotionalAmount](https://docs.dolphindb.com/en/Functions/g/getInstrumentNotionalAmount.html)\n\nFirst introduced in version: 3.00.4.3\n\n\n\n#### Syntax\n\ngetInstrumentNotionalAmount(instrument)\n\n#### Details\n\nGet the notional principal amount of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\ndeposit =  {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"start\": 2025.05.15,\n    \"maturity\": 2025.08.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalAmount\":1E6,\n    \"notionalCurrency\":\"CNY\",\n    \"payReceive\": \"Receive\"\n}\ninstrument = parseInstrument(deposit)\ngetInstrumentNotionalAmount(instrument)\n\n// output: 1000000\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentNotionalCurrency": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentNotionalCurrency.html",
        "signatures": [
            {
                "full": "getInstrumentNotionalCurrency(instrument)",
                "name": "getInstrumentNotionalCurrency",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentNotionalCurrency](https://docs.dolphindb.com/en/Functions/g/getInstrumentNotionalCurrency.html)\n\nFirst introduced in version: 3.00.4.3\n\n\n\n#### Syntax\n\ngetInstrumentNotionalCurrency(instrument)\n\n#### Details\n\nGet the notional principal of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\ndeposit =  {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"start\": 2025.05.15,\n    \"maturity\": 2025.08.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalAmount\":1E6,\n    \"notionalCurrency\":\"CNY\",\n    \"payReceive\": \"Receive\"\n}\ninstrument = parseInstrument(deposit)\ngetInstrumentNotionalCurrency(instrument)\n\n// output: \"CNY\"\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentPayoffType": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentPayoffType.html",
        "signatures": [
            {
                "full": "getInstrumentPayoffType(instrument)",
                "name": "getInstrumentPayoffType",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentPayoffType](https://docs.dolphindb.com/en/Functions/g/getInstrumentPayoffType.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentPayoffType(instrument)\n\n#### Details\n\nGet the payoff type of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\noption = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1000000.0,\n    \"strike\": 1.2,\n    \"maturity\": \"2025.10.08\",\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"EURUSD\"\n}\nins = parseInstrument(option)\ngetInstrumentPayoffType(ins)\n// output: Call   \n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentPayReceive": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentPayReceive.html",
        "signatures": [
            {
                "full": "getInstrumentPayReceive(instrument)",
                "name": "getInstrumentPayReceive",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentPayReceive](https://docs.dolphindb.com/en/Functions/g/getInstrumentPayReceive.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentPayReceive(instrument)\n\n#### Details\n\nSpecify the direction of payments (pay/receive) of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\nins = parseInstrument(swap)\ngetInstrumentPayReceive(ins)\n// output: Pay\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentRate": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentRate.html",
        "signatures": [
            {
                "full": "getInstrumentRate(instrument)",
                "name": "getInstrumentRate",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentRate](https://docs.dolphindb.com/en/Functions/g/getInstrumentRate.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentRate(instrument)\n\n#### Details\n\nGet the deposit interest rate of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of DOUBLE type.\n\n#### Examples\n\n```\ndeposit =  {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"start\": 2025.05.15,\n    \"maturity\": 2025.08.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E6,\n    \"payReceive\": \"Receive\"\n}\ninstrument = parseInstrument(deposit)\ngetInstrumentRate(instrument)\n\n// output: 0.02\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentSettlement": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentsettlement.html",
        "signatures": [
            {
                "full": "getInstrumentSettlement(instrument)",
                "name": "getInstrumentSettlement",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentSettlement](https://docs.dolphindb.com/en/Functions/g/getinstrumentsettlement.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentSettlement(instrument)\n\n#### Details\n\nGet the settlement date of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"0001\",\n    \"start\": 1996.03.01,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"subType\":\"TREASURY_BOND\",\n    \"creditRating\":\"B\",\n    \"settlement\": 2022.05.15 \n}\nins = parseInstrument(bond)\ngetInstrumentSettlement(ins)\n// output: 2022.05.15\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentSpread": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentspread.html",
        "signatures": [
            {
                "full": "getInstrumentSpread(instrument)",
                "name": "getInstrumentSpread",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentSpread](https://docs.dolphindb.com/en/Functions/g/getinstrumentspread.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentSpread(instrument)\n\n#### Details\n\nGet the interest rate spread of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DOUBLE type.\n\n#### Examples\n\n```\nswap =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\ninstrument = parseInstrument(swap)\n\ngetInstrumentSpread(instrument)\n// output: 0.0005\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentStart": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentstart.html",
        "signatures": [
            {
                "full": "getInstrumentStart(instrument)",
                "name": "getInstrumentStart",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentStart](https://docs.dolphindb.com/en/Functions/g/getinstrumentstart.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentStart(instrument)\n\n#### Details\n\nGet the start date of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"0001\",\n    \"start\": 1996.03.01,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"subType\":\"TREASURY_BOND\",\n    \"creditRating\":\"B\",\n    \"settlement\": 2022.05.15 \n}\nins = parseInstrument(bond)\ngetInstrumentStart(ins)\n// output: 1996.03.01\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentStrike": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getinstrumentstrike.html",
        "signatures": [
            {
                "full": "getInstrumentStrike(instrument)",
                "name": "getInstrumentStrike",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentStrike](https://docs.dolphindb.com/en/Functions/g/getinstrumentstrike.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentStrike(instrument)\n\n#### Details\n\nGet the strike price of one or more instruments.\n\n#### Parameters\n\n**instrument** is a scalar or vector of the INSTRUMENT type, indicating one or more instruments.\n\n#### Returns\n\nA scalar or vector of the DOUBLE type.\n\n#### Examples\n\n```\nforward =  {\n   \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.09.24,\n    \"delivery\": 2025.09.26,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E8,\n    \"strike\": 7.2\n}\ninstrument = parseInstrument(forward)\n\ngetInstrumentStrike(instrument)\n// output: 7.2\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentSubType": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentSubType.html",
        "signatures": [
            {
                "full": "getInstrumentSubType(instrument)",
                "name": "getInstrumentSubType",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentSubType](https://docs.dolphindb.com/en/Functions/g/getInstrumentSubType.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentSubType(instrument)\n\n#### Details\n\nGet the subtype of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"0001\",\n    \"start\": 1996.03.01,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\",\n    \"subType\":\"TREASURY_BOND\",\n    \"creditRating\":\"B\",\n    \"settlement\": 2022.05.15 \n}\nins = parseInstrument(bond)\ngetInstrumentSubType(ins)\n\n// output: TREASURY_BOND\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getInstrumentUnderlying": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getInstrumentUnderlying.html",
        "signatures": [
            {
                "full": "getInstrumentUnderlying(instrument)",
                "name": "getInstrumentUnderlying",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    }
                ]
            }
        ],
        "markdown": "### [getInstrumentUnderlying](https://docs.dolphindb.com/en/Functions/g/getInstrumentUnderlying.html)\n\nFirst introduced in version: 3.00.4.1\n\n\n\n#### Syntax\n\ngetInstrumentUnderlying(instrument)\n\n#### Details\n\nGet the underlying asset of the input instrument(s).\n\n#### Parameters\n\n**instrument** is an INSTRUMENT scalar/vector indicating one or more instrument objects.\n\n#### Returns\n\nA scalar/vector of STRING type.\n\n#### Examples\n\n```\noption = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1000000.0,\n    \"strike\": 1.2,\n    \"maturity\": \"2025.10.08\",\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"EURUSD\"\n}\nins = parseInstrument(option)\ngetInstrumentUnderlying(ins)\n// output: EURUSD\n```\n\nRelated functions: [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html), [getInstrumentField](https://docs.dolphindb.com/en/Functions/g/getinstrumentfield.html), [getInstrumentKeys](https://docs.dolphindb.com/en/Functions/g/getinstrumentkeys.html)\n"
    },
    "getIPBlackList": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getipblacklist.html",
        "signatures": [
            {
                "full": "getIPBlackList()",
                "name": "getIPBlackList",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getIPBlackList](https://docs.dolphindb.com/en/Functions/g/getipblacklist.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetIPBlackList()\n\n#### Details\n\nGet the current IP blacklist of the cluster.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\naddIPBlackList([\"1.1.1.1\", \"2.2.2.2\", \"3.3.3.3\"])\nremoveIPBlackList(\"2.2.2.2\")\ngetIPBlackList()\n// output: [\"1.1.1.1\", \"3.3.3.3\"]\n```\n\nRelated functions: [addIPBlackList](https://docs.dolphindb.com/en/Functions/a/addipblacklist.html), [removeIPBlackList](https://docs.dolphindb.com/en/Functions/r/removeipblacklist.html)\n"
    },
    "getIPConnectionLimit": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getIPConnectionLimit.html",
        "signatures": [
            {
                "full": "getIPConnectionLimit()",
                "name": "getIPConnectionLimit",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getIPConnectionLimit](https://docs.dolphindb.com/en/Functions/g/getIPConnectionLimit.html)\n\nFirst introduced in version: 2.00.17, 2.00.16.23.00.4\n\n\n\n#### Syntax\n\ngetIPConnectionLimit()\n\n#### Details\n\nGet the connection limit for different IP addresses on the current node. This limit applies to API and `xdb` connections but does not affect internal connections between cluster nodes (e.g., `rpc`).\n\nThis function can only be executed by an administrator on Linux.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table containing the following columns:\n\n* remoteIP: The IP address.\n* limit: The maximum number of connections allowed from that IP address.\n\n#### Examples\n\n```\ngetIPConnectionLimit();\n```\n\n| remoteIP     | limit |\n| ------------ | ----- |\n| 192.168.1.56 | 10    |\n| 192.168.1.57 | 20    |\n\nRelated function: [setIPConnectionLimit](https://docs.dolphindb.com/en/Functions/s/setIPConnectionLimit.html)\n"
    },
    "getIPWhiteList": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getipwhitelist.html",
        "signatures": [
            {
                "full": "getIPWhiteList()",
                "name": "getIPWhiteList",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getIPWhiteList](https://docs.dolphindb.com/en/Functions/g/getipwhitelist.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetIPWhiteList()\n\n#### Details\n\nGet the current IP whitelist of the cluster.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING vector\n\n#### Examples\n\n```\naddIPWhiteList([\"1.1.1.1\", \"2.2.2.2\", \"3.3.3.3\"])\nremoveIPWhiteList(\"2.2.2.2\")\ngetIPWhiteList()\n// output: [\"1.1.1.1\", \"3.3.3.3\"]\n```\n\nRelated functions: [addIPWhiteList](https://docs.dolphindb.com/en/Functions/a/addipwhitelist.html), [removeIPWhiteList](https://docs.dolphindb.com/en/Functions/r/removeipwhitelist.html)\n"
    },
    "getJobMessage": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getJobMessage.html",
        "signatures": [
            {
                "full": "getJobMessage(jobId)",
                "name": "getJobMessage",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    }
                ]
            }
        ],
        "markdown": "### [getJobMessage](https://docs.dolphindb.com/en/Functions/g/getJobMessage.html)\n\n\n\n#### Syntax\n\ngetJobMessage(jobId)\n\n#### Details\n\nRetrieve the intermediate messages from a scheduled or batch job. For details about batch jobs please refer to [Batch Job Management](https://docs.dolphindb.com/en/Maintenance/BatchJobManagement.html).\n\n#### Parameters\n\n**jobId** is a string indicating the job ID.\n\n#### Returns\n\nIf the return value exceeds 65535 bytes, it will be returned as a BLOB type (64 MB at max); otherwise, it will be returned as a STRING type (64 kb at max).\n\n#### Examples\n\n```\ndef f():1+2;\nscheduleJob(jobId=`daily, jobDesc=\"Daily Job 1\", jobFunc=f, scheduleTime=10:22m, startDate=2026.06.16, endDate=2026.06.30, frequency='D');\ngetJobMessage(`daily)\n/* output:\n2026-06-16 10:22:12.342530 Start the job [daily]: Daily Job 1\n2026-06-16 10:22:12.342553 The job is done.\n*/\n\ndef job1(n){\n   s = 0\n   for (x in 1 : n) {\n       s += sum(sin rand(1.0, 100000000)-0.5)\n       print(\"iteration \" + x + \" \" + s)\n   }\n   return s\n}\njob1_ID=submitJob(\"job1_ID\",\"\", job1, 100);\n```\n\nRun the following command after the job is completed.\n\n```\ngetJobMessage(job1_ID);\n\n/* output:\n2025-05-26 14:44:58.090748 Start the job [job1_ID202505260000]: job1\n2025-05-26 14:44:59.394245 iteration 1 -2067.639360414350903\n2025-05-26 14:45:00.571536 iteration 2 -3394.027760215838497\n2025-05-26 14:45:01.728218 iteration 3 -6658.143178910555434\n2025-05-26 14:45:02.955152 iteration 4 -9995.435727637650415\n2025-05-26 14:45:04.362283 iteration 5 -8653.510696739111153\n2025-05-26 14:45:05.542019 iteration 6 -10801.809641761219609\n2025-05-26 14:45:06.702139 iteration 7 -12924.020454809666262\n2025-05-26 14:45:07.850191 iteration 8 -10882.168276451939163\n2025-05-26 14:45:09.060107 iteration 9 -14318.061736551684589\n2025-05-26 14:45:10.428853 iteration 10 -11516.30579954075074\n2025-05-26 14:45:11.570470 iteration 11 -13945.02455184262908\n2025-05-26 14:45:12.706159 iteration 12 -15082.415793091910018\n2025-05-26 14:45:13.845771 iteration 13 -16508.837934508221223\n2025-05-26 14:45:14.980443 iteration 14 -12171.185820641085228\n2025-05-26 14:45:16.133074 iteration 15 -11497.140285110303011\n2025-05-26 14:45:17.305225 iteration 16 -12546.300852946240411\n2025-05-26 14:45:18.469218 iteration 17 -8682.138463782639519\n2025-05-26 14:45:19.636227 iteration 18 -8287.05071118341948\n2025-05-26 14:45:20.797512 iteration 19 -6045.8953755881721\n2025-05-26 14:45:21.989929 iteration 20 -1587.853404830938416\n2025-05-26 14:45:23.366825 iteration 21 -1061.898133246364068\n2025-05-26 14:45:24.509909 iteration 22 -5604.016581881107413\n2025-05-26 14:45:25.658594 iteration 23 -681.276543087000391\n2025-05-26 14:45:26.814315 iteration 24 798.217304283653447\n2025-05-26 14:45:27.967876 iteration 25 -2357.82192257714496\n2025-05-26 14:45:29.122764 iteration 26 1474.997463642485854\n2025-05-26 14:45:30.264584 iteration 27 2351.139591280943477\n2025-05-26 14:45:31.408370 iteration 28 1037.512168873698328\n2025-05-26 14:45:32.548303 iteration 29 3893.945455537286761\n2025-05-26 14:45:33.699278 iteration 30 4148.650282345925006\n2025-05-26 14:45:34.894419 iteration 31 4031.307766634015024\n2025-05-26 14:45:36.285051 iteration 32 4107.605624560140313\n2025-05-26 14:45:37.452961 iteration 33 5929.91120327810222\n2025-05-26 14:45:38.623867 iteration 34 9425.642810558107157\n2025-05-26 14:45:39.791290 iteration 35 13047.809822686220286\n2025-05-26 14:45:40.965689 iteration 36 10245.933230357943102\n2025-05-26 14:45:42.117447 iteration 37 5432.54276188393851\n2025-05-26 14:45:43.253473 iteration 38 5227.81294757969772\n2025-05-26 14:45:44.241254 iteration 39 1356.898505138993641\n2025-05-26 14:45:44.860755 iteration 40 -1671.878041062590909\n2025-05-26 14:45:45.484119 iteration 41 -1021.138518814122107\n2025-05-26 14:45:46.108090 iteration 42 -2321.149447111632525\n2025-05-26 14:45:46.720242 iteration 43 -5246.586195028939982\n2025-05-26 14:45:47.339880 iteration 44 -8492.119388688672188\n2025-05-26 14:45:47.994839 iteration 45 -8663.850570230377343\n2025-05-26 14:45:48.798468 iteration 46 -10024.085162459703497\n2025-05-26 14:45:49.416817 iteration 47 -7627.128519907962072\n2025-05-26 14:45:50.050123 iteration 48 -8859.465736911144631\n2025-05-26 14:45:50.696957 iteration 49 -11600.588771286853443\n2025-05-26 14:45:51.332706 iteration 50 -12023.426188408715461\n2025-05-26 14:45:51.958107 iteration 51 -13738.331148613655386\n2025-05-26 14:45:52.574174 iteration 52 -14245.913822854639875\n2025-05-26 14:45:53.228183 iteration 53 -15609.22655546905662\n2025-05-26 14:45:53.840108 iteration 54 -14109.554485099233716\n2025-05-26 14:45:54.455551 iteration 55 -15457.235974196633833\n2025-05-26 14:45:55.109167 iteration 56 -14926.928231457419315\n2025-05-26 14:45:55.901304 iteration 57 -13535.493685042154538\n2025-05-26 14:45:56.512054 iteration 58 -11137.324502514182313\n2025-05-26 14:45:57.126833 iteration 59 -8467.404657879153091\n2025-05-26 14:45:57.742143 iteration 60 -1746.003070659520744\n2025-05-26 14:45:58.353437 iteration 61 -3325.876159699668278\n2025-05-26 14:45:58.966068 iteration 62 588.700051641846584\n2025-05-26 14:45:59.574346 iteration 63 -5367.267372965314279\n2025-05-26 14:46:00.185607 iteration 64 -5910.796992469990073\n2025-05-26 14:46:00.828945 iteration 65 -3960.193144167483296\n2025-05-26 14:46:01.458748 iteration 66 122.939722062535111\n2025-05-26 14:46:02.128915 iteration 67 -704.828146272833123\n2025-05-26 14:46:02.955747 iteration 68 3864.606686010478824\n2025-05-26 14:46:03.584085 iteration 69 5186.69739255679724\n2025-05-26 14:46:04.210760 iteration 70 5384.310290306410024\n2025-05-26 14:46:04.832343 iteration 71 3535.338795232024494\n2025-05-26 14:46:05.451344 iteration 72 7529.76101041288075\n2025-05-26 14:46:06.070711 iteration 73 5539.502143333455023\n2025-05-26 14:46:06.719013 iteration 74 7597.268444337500113\n2025-05-26 14:46:07.342229 iteration 75 14728.821072668564738\n2025-05-26 14:46:07.979907 iteration 76 18934.636409439837734\n2025-05-26 14:46:08.596204 iteration 77 19498.750036070654459\n2025-05-26 14:46:09.252392 iteration 78 19268.594342755670368\n2025-05-26 14:46:10.059616 iteration 79 20036.702738540243444\n2025-05-26 14:46:10.734090 iteration 80 24399.283123330875241\n2025-05-26 14:46:11.401129 iteration 81 26353.387390017069265\n2025-05-26 14:46:12.020258 iteration 82 25021.36744718257978\n2025-05-26 14:46:12.640379 iteration 83 20515.896296028589858\n2025-05-26 14:46:13.271550 iteration 84 18948.980154855420551\n2025-05-26 14:46:13.888417 iteration 85 22251.157044437986769\n2025-05-26 14:46:14.509057 iteration 86 21076.744112906457303\n2025-05-26 14:46:15.129712 iteration 87 19794.661956942076358\n2025-05-26 14:46:15.750538 iteration 88 20416.494072026296635\n2025-05-26 14:46:16.401382 iteration 89 19871.931658841131138\n2025-05-26 14:46:17.209955 iteration 90 18276.697674308263231\n2025-05-26 14:46:17.828958 iteration 91 19967.525665167577244\n2025-05-26 14:46:18.461022 iteration 92 22098.668749747052061\n2025-05-26 14:46:19.079399 iteration 93 17969.401810196610313\n2025-05-26 14:46:19.711974 iteration 94 18239.368392132648295\n2025-05-26 14:46:20.358000 iteration 95 18944.493373054185212\n2025-05-26 14:46:21.011468 iteration 96 14969.713016859974231\n2025-05-26 14:46:21.648286 iteration 97 12863.562367756972889\n2025-05-26 14:46:22.289103 iteration 98 12659.014405440735572\n2025-05-26 14:46:22.917878 iteration 99 14069.1513439974442\n2025-05-26 14:46:22.917878 The job is done.\n*/\n*/\n```\n"
    },
    "getJobReturn": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getJobReturn.html",
        "signatures": [
            {
                "full": "getJobReturn(jobId, [blocking=false])",
                "name": "getJobReturn",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    },
                    {
                        "full": "[blocking=false]",
                        "name": "blocking",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [getJobReturn](https://docs.dolphindb.com/en/Functions/g/getJobReturn.html)\n\n\n\n#### Syntax\n\ngetJobReturn(jobId, \\[blocking=false])\n\n#### Details\n\nRetrieves job results for scheduled jobs and batch jobs. For details about batch jobs please refer to [Batch Job Management](https://docs.dolphindb.com/en/Maintenance/BatchJobManagement.html).\n\n#### Parameters\n\n**jobId** is a string indicating the job ID.\n\n**blocking** (optional) is a Boolean value indicating whether the blocking mode is enabled. If *blocking* is false (default), 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.\n\n#### Returns\n\nIt depends on the return value of the job itself.\n\n#### Examples\n\n```\ndef f():1+2;\nscheduleJob(jobId=`daily, jobDesc=\"Daily Job 1\", jobFunc=f, scheduleTime=10:22m, startDate=2026.06.16, endDate=2026.06.30, frequency='D');\ngetJobReturn(`daily)\n// output: 3\n\ndef job1(n){\n   s = 0\n   for (x in 1 : n) {\n       s += sum(sin rand(1.0, 100000000)-0.5)\n       print(\"iteration \" + x + \" \" + s)\n   }\n   return s\n}\n\njob1_ID=submitJob(\"job1_ID\",\"\", job1, 100);\ngetJobReturn(job1_ID);\n// output: The job [job1_ID20210428] is not complete yet.\n```\n\nRerun the `getJobReturn` command after the job is completed:\n\n```\ngetJobReturn(job1_ID);\n// output: -13318.181243\n```\n\nIf we would like `getJobReturn` to hold off returning results until the job is completed, we can set the optional parameter *blocking* to true. This feature is useful in handling batch job dependencies.\n\n```\njob1_ID = submitJob(\"job1_ID\",\"\", job1, 100)\ngetJobReturn(job1_ID, true);\n// output: -31900.013922\n```\n"
    },
    "getJobStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getJobStat.html",
        "signatures": [
            {
                "full": "getJobStat()",
                "name": "getJobStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getJobStat](https://docs.dolphindb.com/en/Functions/g/getJobStat.html)\n\n\n\n#### Syntax\n\ngetJobStat()\n\n#### Details\n\nMonitor the number of jobs and tasks that are are running or in the job queue.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a dictionary with the following keys:\n\n| Keys              | Meaning                                         |\n| ----------------- | ----------------------------------------------- |\n| queuedLocalTasks  | the number of local tasks waiting in the queue  |\n| runningLocalTasks | the number of running local tasks               |\n| queuedJobs        | the number of jobs in the queue                 |\n| runningJobs       | the number of running jobs                      |\n| queuedRemoteTasks | the number of remote tasks waiting in the queue |\n\n#### Examples\n\n```\ngetJobStat();\n\n/* output:\nqueuedLocalTasks->0\nrunnningJobs->0\nqueuedRemoteTasks->0\nqueuedJobs->0\nrunningLocalTasks->0\n*/\n```\n"
    },
    "getJobStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getJobStatus.html",
        "signatures": [
            {
                "full": "getJobStatus(jobId)",
                "name": "getJobStatus",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    }
                ]
            }
        ],
        "markdown": "### [getJobStatus](https://docs.dolphindb.com/en/Functions/g/getJobStatus.html)\n\n\n\n#### Syntax\n\ngetJobStatus(jobId)\n\n#### Details\n\nRetrieve the status of a specified scheduled or batch job. For details about batch jobs please refer to [Batch Job Management](https://docs.dolphindb.com/en/Maintenance/BatchJobManagement.html).\n\n#### Parameters\n\n**jobId** is a string indicating the job ID.\n\n#### Returns\n\nIt returns a table with the following columns:\n\n| Name         | Meaning                                                                    |\n| ------------ | -------------------------------------------------------------------------- |\n| node         | the alias of the local node                                                |\n| userID       | the user ID                                                                |\n| jobId        | the job ID                                                                 |\n| rootJobId    | the root job ID                                                            |\n| jobDesc      | the job description                                                        |\n| priority     | priority of the job which is marked as integers ranging from 0 to 9        |\n| parallelism  | the parallelism, i.e., the maximum number of jobs that can run in parallel |\n| clientIp     | the IP address of the client where the job is submitted                    |\n| clientPort   | the port number of the client where the job is submitted                   |\n| receivedTime | the time (of TIMESTAMP type) when a job is received by the node            |\n| startTime    | the start time of jobs (of TIMESTAMP type)                                 |\n| endTime      | the end time of jobs (of TIMESTAMP type)                                   |\n| errorMessage | error messages                                                             |\n\n#### Examples\n\n```\ndef job1(n){\n   s = 0\n   for (x in 1 : n) {\n       s += sum(sin rand(1.0, 100000000)-0.5)\n       print(\"iteration \" + x + \" \" + s)\n   }\n   return s\n}\n\njob1_ID=submitJob(\"job1_ID\",\"\", job1, 100);\ngetJobStatus(job1_ID);\n```\n\n| node        | userID | jobId               | rootJobId                            | jobDesc | priority | parallelism | clientIp       | clientPort | receivedTime            | startTime | endTime | errorMsg |\n| ----------- | ------ | ------------------- | ------------------------------------ | ------- | -------- | ----------- | -------------- | ---------- | ----------------------- | --------- | ------- | -------- |\n| controller2 | guest  | job1\\_ID20210428... | b9263bfd-50b8-70b3-9845-e595f9b0c506 | job1    | 4        | 1           | 115.204.199.28 | 61537      | 2023.12.12T02:50:32.598 |           |         |          |\n\n*endTime* is empty. This means the job is still running. After the job is completed, rerun `getJobStatus`:\n\n```\ngetJobStatus(job1_ID);\n```\n\n| node        | userID | jobId               | rootJobId                            | jobDesc | priority | parallelism | clientIp       | clientPort | receivedTime            | startTime               | endTime                 | errorMsg |\n| ----------- | ------ | ------------------- | ------------------------------------ | ------- | -------- | ----------- | -------------- | ---------- | ----------------------- | ----------------------- | ----------------------- | -------- |\n| controller2 | guest  | job1\\_ID20210428... | b9263bfd-50b8-70b3-9845-e595f9b0c506 | job1    | 4        | 1           | 115.204.199.28 | 61537      | 2023.12.12T02:50:32.598 | 2023.12.12T02:50:32.599 | 2023.12.12T02:52:32.477 |          |\n"
    },
    "getLeftStream": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getLeftStream.html",
        "signatures": [
            {
                "full": "getLeftStream(joinEngine)",
                "name": "getLeftStream",
                "parameters": [
                    {
                        "full": "joinEngine",
                        "name": "joinEngine"
                    }
                ]
            }
        ],
        "markdown": "### [getLeftStream](https://docs.dolphindb.com/en/Functions/g/getLeftStream.html)\n\n\n\n#### Syntax\n\ngetLeftStream(joinEngine)\n\n#### Details\n\nReturn the schema of the left table of the join engine. The data ingested into this schema will be ingested into *joinEngine*.\n\nThe result of an engine can be ingested into the join engine to realize the cascade between engines.\n\n#### Parameters\n\n**joinEngine** is a table object returned by creating a join engine. The join engines currently supported by DolphinDB are:\n\n* createAsofJoinEngine\n\n* createEquiJoinEngine\n\n* createLookupJoinEngine\n\n* createWindowJoinEngine\n\n* createLeftSemiJoinEngine\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nshare streamTable(1000:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE]) as trades\n\noutput=table(100:0, `timestamp`sym`price1`price2, [TIMESTAMP, SYMBOL, DOUBLE, DOUBLE])\n\nleftTable=table(1:0, `sym`timestamp`price, [SYMBOL, TIMESTAMP, DOUBLE])\nrightTable=table(1:0, `sym`timestamp`price, [SYMBOL, TIMESTAMP, DOUBLE])\n\najEngine = createAsofJoinEngine(\"asofjoin_engine\", leftTable, rightTable, output, <[leftTable.price, rightTable.price]>, `sym, `timestamp)\n\nleftEngine = createReactiveStateEngine(name=`left_reactive_engine, metrics=<[time,msum(price,3)]>, dummyTable=trades, outputTable=getLeftStream(ajEngine), keyColumn=\"sym\")\nrightEngine = createReactiveStateEngine(name=`right_reactive_engine, metrics=<[time,mfirst(price,3)]>, dummyTable=trades, outputTable=getRightStream(ajEngine), keyColumn=\"sym\")\n\nsubscribeTable(, \"trades\", \"left_reactive_engine\", 0, append!{leftEngine}, true)\nsubscribeTable(, \"trades\", \"right_reactive_engine\", 0, append!{rightEngine}, true)\n\nt = table(2022.01.01 + 1..20 as time, take(`AMZN`IBM`APPL, 20) as sym, rand(100.0, 20) as price)\ntrades.append!(t)\nselect * from output order by timestamp,sym\n```\n\n| timestamp               | sym  | price1   | price2  |\n| ----------------------- | ---- | -------- | ------- |\n| 2022.01.02T00:00:00.000 | AMZN |          |         |\n| 2022.01.03T00:00:00.000 | IBM  |          |         |\n| 2022.01.04T00:00:00.000 | APPL |          |         |\n| 2022.01.05T00:00:00.000 | AMZN |          |         |\n| 2022.01.06T00:00:00.000 | IBM  |          |         |\n| 2022.01.07T00:00:00.000 | APPL |          |         |\n| 2022.01.08T00:00:00.000 | AMZN | 102.192  | 26.2273 |\n| 2022.01.09T00:00:00.000 | IBM  | 152.2704 | 43.6296 |\n| 2022.01.10T00:00:00.000 | APPL | 126.1056 | 74.929  |\n| 2022.01.11T00:00:00.000 | AMZN | 137.4656 | 57.6015 |\n| 2022.01.12T00:00:00.000 | IBM  | 116.7775 | 54.2854 |\n| 2022.01.13T00:00:00.000 | APPL | 58.8909  | 49.3149 |\n| 2022.01.14T00:00:00.000 | AMZN | 148.5405 | 18.3633 |\n| 2022.01.15T00:00:00.000 | IBM  | 141.0848 | 54.3554 |\n| 2022.01.16T00:00:00.000 | APPL | 93.9003  | 1.8618  |\n| 2022.01.17T00:00:00.000 | AMZN | 210.4329 | 61.5008 |\n| 2022.01.18T00:00:00.000 | IBM  | 88.7772  | 8.1367  |\n\nRelated function: [getRightStream](https://docs.dolphindb.com/en/Functions/g/getRightStream.html).\n"
    },
    "getLevelFileIndexCacheStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getLevelFileIndexCacheStatus.html",
        "signatures": [
            {
                "full": "getLevelFileIndexCacheStatus()",
                "name": "getLevelFileIndexCacheStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getLevelFileIndexCacheStatus](https://docs.dolphindb.com/en/Functions/g/getLevelFileIndexCacheStatus.html)\n\n\n\n#### Syntax\n\ngetLevelFileIndexCacheStatus()\n\n#### Details\n\nObtain the memory usage of the indexes of all level files.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a dictionary with the following keys:\n\n* capacity: is the maximum size of level file index in the TSDB engine.\n\n* usage: is the size of the memory used (in bytes).\n\n#### Examples\n\n```\ngetLevelFileIndexCacheStatus()\n/* output:\nusage->0\ncapacity->429496729\n*/\n```\n"
    },
    "getLicenseExpiration": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getLicenseExpiration.html",
        "signatures": [
            {
                "full": "getLicenseExpiration()",
                "name": "getLicenseExpiration",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getLicenseExpiration](https://docs.dolphindb.com/en/Functions/g/getLicenseExpiration.html)\n\n\n\n#### Syntax\n\ngetLicenseExpiration()\n\n#### Details\n\nReturn the expiration date of the license on the current node. It can be used to verify whether the license file has been updated.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA DATE scalar.\n\n#### Examples\n\n```\ngetLicenseExpiration()\n// output: 2021.09.30\n```\n"
    },
    "getLoadedModules": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getloadedmodules.html",
        "signatures": [
            {
                "full": "getLoadedModules()",
                "name": "getLoadedModules",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getLoadedModules](https://docs.dolphindb.com/en/Functions/g/getloadedmodules.html)\n\nFirst introduced in version: 2.00.18, 2.00.16.53.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\ngetLoadedModules()\n\n#### Details\n\nLists modules that have been loaded in the current session.\n\n**Note:**\n\nIf a module is loaded via the *preloadModules* parameter, it is automatically loaded in every session and will appear in the result.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nA table with the following columns:\n\n* moduleName: the name of the module.\n* moduleVersion: the version of the module.\n* isFree: Indicates whether the module is free.\n\nFor user-defined modules, moduleVersion is empty and isFree is true.\n\n#### Examples\n\nAssume the alphalens and ops modules have been loaded using the `use` statement:\n\n```\ngetLoadedModules()\n```\n\nReturns a table like the following:\n\n| moduleName | moduleVersion | isFree |\n| ---------- | ------------- | ------ |\n| alphalens  | 1.0.0         | true   |\n| ops        | 1.0.0         | true   |\n\n**Related functions**\n\n[loadModule](https://docs.dolphindb.com/en/Functions/l/loadModule.html)\n"
    },
    "getLoadedPlugins": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getLoadedPlugins.html",
        "signatures": [
            {
                "full": "getLoadedPlugins()",
                "name": "getLoadedPlugins",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getLoadedPlugins](https://docs.dolphindb.com/en/Functions/g/getLoadedPlugins.html)\n\n\n\n#### Syntax\n\ngetLoadedPlugins()\n\n#### Details\n\nThis function retrieves a list of plugins loaded on the node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table containing the following columns:\n\n* plugin: name of the plugin.\n* version: plugin version as specified in the *Plugin\\<name>.txt* file.\n* user: name of the user who loaded the plugin.\n* time: date and time when the plugin was loaded.\n\n#### Examples\n\n```\nlogin(\"admin\",\"123456\")\nloadPlugin(\"zip\")\nlogin(\"user1\",\"123456\")\nloadPlugin(\"httpclient\")\n\ngetLoadedPlugins()\n```\n\nOutput:\n\n| plugin     | version | user  | time                    |\n| ---------- | ------- | ----- | ----------------------- |\n| zip        | 3.00.1  | admin | 2024.09.01T10:00:01.000 |\n| httpClient | 3.00.1  | user1 | 2024.09.01T10:00:02.000 |\n"
    },
    "getLocalIOTDBStaticTable": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getLocalIOTDBStaticTable.html",
        "signatures": [
            {
                "full": "getLocalIOTDBStaticTable(dbUrl, tableName, [dfsPath])",
                "name": "getLocalIOTDBStaticTable",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[dfsPath]",
                        "name": "dfsPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getLocalIOTDBStaticTable](https://docs.dolphindb.com/en/Functions/g/getLocalIOTDBStaticTable.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\ngetLocalIOTDBStaticTable(dbUrl, tableName, \\[dfsPath])\n\n#### Details\n\nRetrive the static table at the local node. This function can only be called on the data node by the users with TABLE\\_READ privilege to the table or DB\\_READ privilege to the database.\n\n#### Parameters\n\n**dbUrl** is a STRING scalar indicating the path to a DFS database.\n\n**tableName** is a STRING scalar indicating the table name.\n\n**dfsPath** is the DFS path to a database chunk. It can be derived by removing the time partition and any subsequent components from the `dfsPath` column in the result of `getChunksMeta`. For example, if a chunk's `dfsPath` is `/db/Key1/20250428/gP`, this parameter should be set to `/db/Key1`. By default, the function returns all static tables of the *tableName* at the local node.\n\n#### Returns\n\nA table with the following columns:\n\n* innerId: The internal ID corresponding to the measurement point.\n* Measurement point columns: They are determined by the sort key (the sort columns except for the last column). If one column is named `id` or `type`, it will be automatically renamed to `_id_` or `_type_` in the returned table.\n* valueType: The type of the IOTANY column corresponding to the measurement point.\n\n#### Examples\n\n```\ngetLocalIOTDBStaticTable(dbUrl=\"dfs://db\", tableName=\"pt\", dfsPath=\"/db/Key1\")\n```\n\n| innerId | deviceId | location | valueType |\n| ------- | -------- | -------- | --------- |\n| 1       | 1        | loc2     | DOUBLE    |\n| 0       | 1        | loc1     | INT       |\n"
    },
    "getMarketCalendar": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMarketCalendar.html",
        "signatures": [
            {
                "full": "getMarketCalendar(marketName, [startDate], [endDate])",
                "name": "getMarketCalendar",
                "parameters": [
                    {
                        "full": "marketName",
                        "name": "marketName"
                    },
                    {
                        "full": "[startDate]",
                        "name": "startDate",
                        "optional": true
                    },
                    {
                        "full": "[endDate]",
                        "name": "endDate",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getMarketCalendar](https://docs.dolphindb.com/en/Functions/g/getMarketCalendar.html)\n\n#### Syntax\n\ngetMarketCalendar(marketName, \\[startDate], \\[endDate])\n\n#### Details\n\nDolphinDB provides trading calendars of more than 50 exchanges (with corresponding CSV files stored in *marketHolidayDir*). This function is used to get the trading calendar in the time interval determined by *startDate* and *endDate*.\n\n#### Parameters\n\n**marketName** is a STRING scalar, indicating the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name. It must exist in the directory specified by configuration parameter *marketHolidayDir*, otherwise an error will be reported.\n\n**startDate** (optional) is a scalar of DATE type. If it is not specified, the default value is January 1st of the earliest year in the file named *marketName*.\n\n**endDate** (optional) is a scalar of DATE type. If it is not specified, the default value is December 31st of the latest year in the file named *marketName*.\n\n#### Returns\n\nA DATE vector.\n\n#### Examples\n\n```\naddMarketHoliday(\"CFFEX\",2022.01.03 2022.01.05)\ngetMarketCalendar(\"CFFEX\",2022.01.01, 2022.01.10)\n// output: [2022.01.04,2022.01.06,2022.01.07,2022.01.10]\n```\n\nRelated functions: [addMarketHoliday](https://docs.dolphindb.com/en/Functions/a/addMarketHoliday.html), [updateMarketHoliday](https://docs.dolphindb.com/en/Functions/u/updateMarketHoliday.html)\n\n"
    },
    "getMasterReplicationStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMasterReplicationStatus.html",
        "signatures": [
            {
                "full": "getMasterReplicationStatus([limit=-1])",
                "name": "getMasterReplicationStatus",
                "parameters": [
                    {
                        "full": "[limit=-1]",
                        "name": "limit",
                        "optional": true,
                        "default": "-1"
                    }
                ]
            }
        ],
        "markdown": "### [getMasterReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getMasterReplicationStatus.html)\n\n#### Syntax\n\ngetMasterReplicationStatus(\\[limit=-1])\n\n#### Details\n\nThis function displays the cluster replication task status in the master cluster. It returns a table where finished tasks are listed first, then followed by unfinished tasks.\n\n* If *limit* is not specified, there is no limit on the number of tasks returned.\n\n* If *limit* is specified, up to *limit* records (including finished and unfinished tasks) can be returned.\n\nA maximum of 10,000 records of finished tasks are returned, and the unfinished tasks are displayed from the earliest time until the specified number of records is met.\n\nIt can only be executed by an administrator on the controller of a master cluster.\n\n#### Parameters\n\n**limit** (optional) is an integer that specifies the maximum tasks that can be returned in the result. The default value is -1, meaning no limit is placed.\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* taskId: ID of replication task.\n\n* tid: transaction ID.\n\n* groupId: ID of the group to which the replication task belongs to.\n\n* operationType: the operation type.\n\n* submitTime: task submission time (of NANOTIMESTAMP type).\n\n* dbName: the database name.\n\n* tableName: the table name.\n\n* srcIP: IP of the data node where data of write tasks is stored.\n\n* srcPort: port of the data node where data of write tasks is stored.\n\n* isTruncated: whether the task has been finished and garbage-collected from the push queue.\n\n#### Examples\n\n```\ngetMasterReplicationStatus();\n```\n\n| taskId | tid | groupId | operationType              | submitTime                    | dbName                          | tableName | srcIP     | srcPort | isTruncated |\n| ------ | --- | ------- | -------------------------- | ----------------------------- | ------------------------------- | --------- | --------- | ------- | ----------- |\n| 1      | 1   | 1       | CREATE\\_DB                 | 2022.11.08T10:50:35.442141722 | db://test\\_dropPartition\\_value |           | 127.0.0.1 | 8002    | true        |\n| 2      | 2   | 2       | CREATE\\_PARTITIONED\\_TABLE | 2022.11.08T10:50:35.447716190 | db://test\\_dropPartition\\_value | pt        | 127.0.0.1 | 8002    | true        |\n| 3      | 3   | 3       | APPEND                     | 2022.11.08T10:50:35.584920262 | db://test\\_dropPartition\\_value | pt        | 127.0.0.1 | 8002    | true        |\n| 4      | 4   | 4       | DROP\\_PARTITION            | 2022.11.08T10:50:35.632575800 |                                 | pt        | 127.0.0.1 | 8002    | false       |\n\nRelated functions: [getSlaveReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getSlaveReplicationStatus.html)\n\n"
    },
    "getMCPPrompt": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMCPPrompt.html",
        "signatures": [
            {
                "full": "getMCPPrompt(name, [args], [published])",
                "name": "getMCPPrompt",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[args]",
                        "name": "args",
                        "optional": true
                    },
                    {
                        "full": "[published]",
                        "name": "published",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getMCPPrompt](https://docs.dolphindb.com/en/Functions/g/getMCPPrompt.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ngetMCPPrompt(name, \\[args], \\[published])\n\n#### Details\n\nCall the specified MCP prompt template.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the prompt template.\n\n**args** (optional) is a dictionary with STRING keys and ANY or STRING values indicating the arguments passed to the prompt template.\n\n**published** (optional) is a Boolean indicating whether to call the published version. Defaults to false, meaning to call the unpublished version.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\n// define a prompt template\naddMCPPrompt(\n  name = \"stock_summary\",\n  message = \"Summary the trend of ${stock} from ${startDate} to ${endDate}.\",\n  description = \"Generate a natural-language overview of a stock over a time period\",\n  extraInfo = {title : \"Stock Trend Summary\"}\n)\npublishMCPPrompts(\"stock_summary\")\n\n// update a prompt template and do not publish it\nupdateMCPPrompt(\n  name = \"stock_summary\",\n  message = \"Find the highest and lowest prices of ${stock} from ${startDate} to ${endDate}.\",\n  description = \"description after updating\"\n)\n\n// call the published stock_summary\ngetMCPPrompt(name=\"stock_summary\", args={\"stock\":\"000111\", \"startDate\":2025.01.01, \"endDate\":2025.08.01}, published=true)\n// output:Summary the trend of 000111 from 2025.01.01 to 2025.08.01.\n\n// Call the published stock_summary\ngetMCPPrompt(name=\"stock_summary\", args={\"stock\":\"000111\", \"startDate\":2025.01.01, \"endDate\":2025.08.01}, published=false)\n// output:Find the highest and lowest prices of 000111 from 2025.01.01 to 2025.08.01.\n```\n"
    },
    "getMemLimitOfAllTempResults": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMemLimitOfAllTempResults.html",
        "signatures": [
            {
                "full": "getMemLimitOfAllTempResults()",
                "name": "getMemLimitOfAllTempResults",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getMemLimitOfAllTempResults](https://docs.dolphindb.com/en/Functions/g/getMemLimitOfAllTempResults.html)\n\n\n\n#### Syntax\n\ngetMemLimitOfAllTempResults()\n\n#### Details\n\nGet the value of *memLimitOfAllTempResults*. It can only be executed by an administrator on the data node or compute node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\n```\ngetMemLimitOfAllTempResults ()\n// output: 3.0\n```\n"
    },
    "getMemLimitOfQueryResult": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMemLimitOfQueryResult.html",
        "signatures": [
            {
                "full": "getMemLimitOfQueryResult()",
                "name": "getMemLimitOfQueryResult",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getMemLimitOfQueryResult](https://docs.dolphindb.com/en/Functions/g/getMemLimitOfQueryResult.html)\n\n\n\n#### Syntax\n\ngetMemLimitOfQueryResult()\n\n#### Details\n\nGet the memory limit (in units of bytes) for the result of each query.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA DOUBLE scalar\n\n#### Examples\n\n```\nsetMemLimitOfQueryResult(0.2)\ngetMemLimitOfQueryResult() / 1024 / 1024 / 1024\n// output: 0.2\n```\n\nRelated function: [setMemLimitOfQueryResult](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfQueryResult.html)\n"
    },
    "getMemLimitOfTaskGroupResult": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMemLimitOfTaskGroupResult.html",
        "signatures": [
            {
                "full": "getMemLimitOfTaskGroupResult()",
                "name": "getMemLimitOfTaskGroupResult",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getMemLimitOfTaskGroupResult](https://docs.dolphindb.com/en/Functions/g/getMemLimitOfTaskGroupResult.html)\n\n\n\n#### Syntax\n\ngetMemLimitOfTaskGroupResult()\n\n#### Details\n\nGet the memory limit of a task group sent from the current node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\n```\nsetMemLimitOfTaskGroupResult(10)\ngetMemLimitOfTaskGroupResult() / 1024 / 1024 / 1024\n// output: 10\n```\n\nRelated function: [setMemLimitOfTaskGroupResult](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfTaskGroupResult.html)\n"
    },
    "getMemoryStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMemoryStat.html",
        "signatures": [
            {
                "full": "getMemoryStat()",
                "name": "getMemoryStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getMemoryStat](https://docs.dolphindb.com/en/Functions/g/getMemoryStat.html)\n\n\n\n#### Syntax\n\ngetMemoryStat()\n\n#### Details\n\nReturn the allocated memory and the unused memory. The difference between the two is the used memory.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a dictionary with the following keys:\n\n* allocatedBytes: the allocated memory (in Bytes) for the current node.\n\n* freeBytes: the allocated but unused memory (in Bytes) for the current node.\n\n#### Examples\n\n```\ngetMemoryStat();\n/* output:\nfreeBytes->6430128\nallocatedBytes->35463168\n*/\n```\n"
    },
    "getMktData": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getMktData.html",
        "signatures": [
            {
                "full": "getMktData(dataSet, type, date, name)",
                "name": "getMktData",
                "parameters": [
                    {
                        "full": "dataSet",
                        "name": "dataSet"
                    },
                    {
                        "full": "type",
                        "name": "type"
                    },
                    {
                        "full": "date",
                        "name": "date"
                    },
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getMktData](https://docs.dolphindb.com/en/Functions/g/getMktData.html)\n\n\n\n#### Syntax\n\ngetMktData(dataSet, type, date, name)\n\n#### Details\n\nRetrieves the corresponding market data from a dataset for a specified valuation date, based on the market data type and name.\n\n#### Parameters\n\n**dataSet** is a set of market data. Supported types:\n\n* A market data engine created via `createMktDataEngine`\n* A vector or dictionary representing a set of market data defined by users. The data structure must comply with the market data input specification required by `instrumentPricer`.\n\n**type** is a STRING scalar indicating the type of the market data. Supported types:\n\n* \"Price\": option underlying price\n* \"Curve\": Yield curve\n* \"Surface\": Volatility surface\n\n**date**is a DATE scalar indicating the reference date.\n\n**name**is a STRING scalar indicating the name of the market data, such as curve or surface name.\n\n#### Returns\n\nA MKTDATA scalar.\n\n#### Examples\n\nThis example uses `createMktDataEngine` to build three types of market data in real time—USD/CNY, EUR/USD, and EUR/CNY—and then uses `getMktData` to retrieve the spot price data generated by the engine.\n\n```\n\ntry{dropStreamEngine(\"MKTDATA_ENGINE\")}catch(ex){}\nreferenceDate = 2025.07.01\n\nconfig1 = {\n    \"name\": \"USDCNY\",\n    \"type\": \"FxSpotRate\"\n}\nconfig2 = {\n    \"name\": \"EURUSD\",\n    \"type\": \"FxSpotRate\"\n}\nconfig3 = {\n    \"name\": \"EURCNY\",\n    \"type\": \"FxSpotRate\"\n}\n\nengine = createMktDataEngine(\"MKTDATA_ENGINE\", referenceDate, [config1, config2, config3])\n\ntypeCol = [\"FxSpot\", \"FxSpot\", \"FxSpot\"]\nnameCol = [\"USDCNY\", \"EURCNY\", \"EURUSD\"]\npriceCol = [7.12, 7.88, 1.10]\n\ndata = table(typeCol as type, nameCol as name, priceCol as price)\n\nengine.append!(data)\nsleep(100)\n\nre = getMktData(engine, \"Price\", referenceDate, \"USDCNY\")\nprint(re)\n```\n\n**Related functions**: [createMktDataEngine](https://docs.dolphindb.com/en/Functions/c/createMktDataEngine.html), [instrumentPricer](https://docs.dolphindb.com/en/Functions/i/instrumentPricer.html)\n"
    },
    "getNodeAlias": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getNodeAlias.html",
        "signatures": [
            {
                "full": "getNodeAlias()",
                "name": "getNodeAlias",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getNodeAlias](https://docs.dolphindb.com/en/Functions/g/getNodeAlias.html)\n\n\n\n#### Syntax\n\ngetNodeAlias()\n\n#### Details\n\nReturn the alias of the local node, which is defined in the configuration file *dolphindb.cfg*.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetNodeAlias();\n// output: controller2\n```\n"
    },
    "getNodeHost": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getNodeHost.html",
        "signatures": [
            {
                "full": "getNodeHost()",
                "name": "getNodeHost",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getNodeHost](https://docs.dolphindb.com/en/Functions/g/getNodeHost.html)\n\n\n\n#### Syntax\n\ngetNodeHost()\n\n#### Details\n\nReturn the host name of the local node, which is defined in the configuration file *dolphindb.cfg*.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetNodeHost();\n// output: 10.6.0.6\n```\n"
    },
    "getNodePort": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getNodePort.html",
        "signatures": [
            {
                "full": "getNodePort()",
                "name": "getNodePort",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getNodePort](https://docs.dolphindb.com/en/Functions/g/getNodePort.html)\n\n\n\n#### Syntax\n\ngetNodePort()\n\n#### Details\n\nReturn the port number of the local node, which is defined in the configuration file *dolphindb.cfg*.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn Integer scalar.\n\n#### Examples\n\n```\ngetNodePort();\n// output: 8081\n```\n"
    },
    "getNodeType": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getNodeType.html",
        "signatures": [
            {
                "full": "getNodeType()",
                "name": "getNodeType",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getNodeType](https://docs.dolphindb.com/en/Functions/g/getNodeType.html)\n\n\n\n#### Syntax\n\ngetNodeType()\n\n#### Details\n\nReturn the type of the node.\n\n0: data node\n\n1: agent\n\n2: controller\n\n3: standalone mode\n\n4: compute node\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn Integer scalar.\n\n#### Examples\n\n```\ngetNodeType();\n// output: 2\n```\n"
    },
    "getOLAPCachedSymbolBaseMemSize": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOLAPCachedSymbolBaseMemSize.html",
        "signatures": [
            {
                "full": "getOLAPCachedSymbolBaseMemSize()",
                "name": "getOLAPCachedSymbolBaseMemSize",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getOLAPCachedSymbolBaseMemSize](https://docs.dolphindb.com/en/Functions/g/getOLAPCachedSymbolBaseMemSize.html)\n\n#### Syntax\n\ngetOLAPCachedSymbolBaseMemSize()\n\n#### Details\n\nObtain the cache size (in Bytes) of SYMBOL base (i.e., a dictionary that stores integers encoded from the data of SYMBOL type) of the OLAP engine.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA LONG scalar.\n\n"
    },
    "getOLAPCacheEngineSize": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOLAPCacheEngineSize.html",
        "signatures": [
            {
                "full": "getOLAPCacheEngineSize()",
                "name": "getOLAPCacheEngineSize",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getOLAPCacheEngineSize](https://docs.dolphindb.com/en/Functions/g/getOLAPCacheEngineSize.html)\n\n\n\n#### Syntax\n\ngetOLAPCacheEngineSize()\n\nAlias: getCacheEngineMemSize\n\n#### Details\n\nObtain the memory status (in Byte) of the OLAP cache engine on the current node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a tuple:\n\nThe 1st element indicates the memory occupied by the cache engine;\n\nThe 2nd element indicates the memory occupied by the column files stored in the cache engine;\n\nThe 3rd element indicates the memory occupied by the column file pointers;\n\nThe 4th element indicates the maximum memory allocated to the cache engine.\n\n#### Examples\n\n```\nsetOLAPCacheEngineSize(0.4)\ngetOLAPCacheEngineSize()\n// output: (0,0,0,429496729)\n```\n\nRelated Function: [setOLAPCacheEngineSize](https://docs.dolphindb.com/en/Functions/s/setOLAPCacheEngineSize.html)\n"
    },
    "getOLAPCacheEngineStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOLAPCacheEngineStat.html",
        "signatures": [
            {
                "full": "getOLAPCacheEngineStat()",
                "name": "getOLAPCacheEngineStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getOLAPCacheEngineStat](https://docs.dolphindb.com/en/Functions/g/getOLAPCacheEngineStat.html)\n\n\n\n#### Syntax\n\ngetOLAPCacheEngineStat()\n\nAlias: getCacheEngineStat\n\n#### Details\n\nGet the status of the OLAP cache engine on the current node. The function can only be called on the data node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a table containing the following columns:\n\n* chunkId: the chunk ID.\n\n* physicalName: the physical name of the table to which the chunk belongs.\n\n* timeSinceLastWrite: the time elapsed (in milliseconds) since last write.\n\n* cachedRowsOfCompletedTxn: the number of cached records of completed transactions.\n\n* cachedRowsOfUncompletedTxn: the number of cached records of uncompleted transactions. For each chunk, only the last transaction may not have been completed.\n\n* cachedMemOfCompletedTxn: the memory usage (in Bytes) of completed transactions.\n\n* cachedMemOfUncompletedTxn: the memory usage (in Bytes) of uncompleted transactions.\n\n* cachedTids: list of transaction IDs (tid).\n\n#### Examples\n\n```\ngetOLAPCacheEngineStat()\n```\n\n| chunkId                              | physicalName | timeSinceLastWrite | cachedRowsOfCompletedTxn | cachedRowsOfUncompletedTxn | cachedMemOfCompletedTxn | cachedMemOfUncompletedTxn | cachedTids |\n| ------------------------------------ | ------------ | ------------------ | ------------------------ | -------------------------- | ----------------------- | ------------------------- | ---------- |\n| e4558d3c-fa41-52b5-418b-94e26cb70a75 | pt\\_2        | 1056               | 222,386                  | 0                          | 3,558,176               | 0                         | 2052       |\n"
    },
    "getOrcaCheckpointConfig": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaCheckpointConfig.html",
        "signatures": [
            {
                "full": "getOrcaCheckpointConfig(name)",
                "name": "getOrcaCheckpointConfig",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaCheckpointConfig](https://docs.dolphindb.com/en/Functions/g/getOrcaCheckpointConfig.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetOrcaCheckpointConfig(name)\n\n#### Details\n\nRetrieve the Checkpoint configuration of the specified streaming graph.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA dictionary containing the following fields:\n\n<table id=\"table_uzn_dlj_3fc\"><thead><tr><th align=\"left\">\n\nkey\n\n</th><th align=\"left\">\n\nDescription\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nenable\n\n</td><td align=\"left\">\n\nWhether Checkpoint is enabled\n\n</td></tr><tr><td align=\"left\">\n\ncheckpointMod\n\n</td><td align=\"left\">\n\nConsistency level of the streaming graph, excluding sink nodes: -   exactly\\_once: Exactly-once\n\n* executionat\\_least\\_once: At-least-once execution\n\n</td></tr><tr><td align=\"left\">\n\ninterval\n\n</td><td align=\"left\">\n\nTime interval to trigger Checkpoint, in milliseconds\n\n</td></tr><tr><td align=\"left\">\n\ntimeout\n\n</td><td align=\"left\">\n\nTimeout for Checkpoint. If Checkpoint is not completed within the specified time, it will be considered failed, in milliseconds\n\n</td></tr><tr><td align=\"left\">\n\nalignedTimeout\n\n</td><td align=\"left\">\n\nTimeout for Barrier alignment. If alignment is not completed within the specified time, the Checkpoint will be considered failed, in milliseconds\n\n</td></tr><tr><td align=\"left\">\n\nminIntervalBetweenCkpt\n\n</td><td align=\"left\">\n\nMinimum time interval between the completion of the last Checkpoint and the initiation of the next Checkpoint\n\n</td></tr><tr><td align=\"left\">\n\nconsecutiveFailures\n\n</td><td align=\"left\">\n\nMaximum number of consecutive Checkpoint failures. If exceeded, the status of the entire streaming graph will be switched to ERROR.\n\n</td></tr><tr><td align=\"left\">\n\nmaxConcurrentCheckpoints\n\n</td><td align=\"left\">\n\nMaximum number of concurrent Checkpoints allowed. Please note that allowing concurrent Checkpoints may impact running streaming jobs.\n\n</td></tr><tr><td align=\"left\">\n\nmaxRetainedCheckpoints\n\n</td><td align=\"left\">\n\nThe system will periodically clean up historical Checkpoint data.\n\n</td></tr></tbody>\n</table>## Examples\n\n```\n// where name is the name of the streaming graph\ngetOrcaCheckpointConfig(\"streamGraph1\")\n\n// where name is the fully qualified name\ngetOrcaCheckpointConfig(\"catalog1.orca_graph.streamGraph1\")\n\n```\n"
    },
    "getOrcaCheckpointJobInfo": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaCheckpointJobInfo.html",
        "signatures": [
            {
                "full": "getOrcaCheckpointJobInfo([name])",
                "name": "getOrcaCheckpointJobInfo",
                "parameters": [
                    {
                        "full": "[name]",
                        "name": "name",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaCheckpointJobInfo](https://docs.dolphindb.com/en/Functions/g/getOrcaCheckpointJobInfo.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetOrcaCheckpointJobInfo(\\[name])\n\n#### Details\n\nIf *name* is not specified, the function returns the Checkpoint job information of all streaming graphs in Orca.\n\n#### Parameters\n\n**name** (optional) is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA table containing the following fields:\n\n* **checkpointId:** Checkpoint ID.\n* **jobId:** Streaming graph ID.\n* **createdTimeStamp:** Creation timestamp of the Checkpoint job.\n* **finishedTimeStamp:** Completion timestamp of the Checkpoint job.\n* **status:** Status of the Checkpoint job:\n  * **RUNNING:** Currently running.\n  * **ERROR:** General error occurred; a new Checkpoint will be retried.\n  * **FAILED:** Critical error occurred; retry is not possible.\n  * **SUCCESS:** Checkpoint completed successfully and is available.\n  * **CANCELED:** Checkpoint job was canceled by the system, typically because multiple Checkpoint jobs are running simultaneously in the same graph; when the latest Checkpoint succeeds, the system automatically cancels older Checkpoints.\n  * **PURGED:** The system retains only the most recent successful Checkpoints (managed by the parameter maxRetainedCheckpoints); older Checkpoints will be automatically cleaned up.\n* **extra:** Additional information, such as error details of the Checkpoint.\n* **partitionId:** The ID of the partition where the checkpoint metadata is located.\n\n#### Examples\n\n```\ngetOrcaCheckpointJobInfo(\"streamGraph1\")// name is the name of the streaming graph\ngetOrcaCheckpointJobInfo(\"catalog1.orca_graph.streamGraph1\") // name is the fully qualified name\n```\n"
    },
    "getOrcaCheckpointSubjobInfo": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaCheckpointSubjobInfo.html",
        "signatures": [
            {
                "full": "getOrcaCheckpointSubjobInfo([name])",
                "name": "getOrcaCheckpointSubjobInfo",
                "parameters": [
                    {
                        "full": "[name]",
                        "name": "name",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaCheckpointSubjobInfo](https://docs.dolphindb.com/en/Functions/g/getOrcaCheckpointSubjobInfo.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetOrcaCheckpointSubjobInfo(\\[name])\n\n#### Details\n\nRetrieve the Checkpoint subtask information of the specified streaming graph.\n\nIf *name* is not specified, the function returns the Checkpoint subtask information of all streaming graphs in Orca.\n\n#### Parameters\n\n**name** (optional) is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA table containing the following fields:\n\n* **checkpointId:** Checkpoint ID.\n* **jobId:** Streaming graph ID.\n* **subjobId:** Subtask ID.\n* **firstBarrierArrTs:** The timestamp when the subtask receives the first Barrier.\n* **barrierAlignTs:** The timestamp when Barrier alignment is completed in the subtask.\n* **barrierForwardTs:** The timestamp when the subtask forwards the Barrier to downstream operators.\n* **status:** Status of the Checkpoint subtask, including running, success, and failed.\n* **snapshotChannelsId:** IDs of input channels for the Checkpoint subtask.\n* **downstreamSubscribeOffsets:** Offsets of downstream subscriptions.\n* **snapshotMeta:** Metadata of the Checkpoint snapshot.\n* **extra:** Additional information, such as error details of the Checkpoint.\n\n#### Examples\n\n```\ngetOrcaCheckpointSubjobInfo(\"streamGraph1\") // name is the name of the streaming graph\ngetOrcaCheckpointSubjobInfo(\"catalog1.orca_graph.streamGraph1\") // name is the fully qualified name\n```\n"
    },
    "getOrcaDataLineage": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaDataLineage.html",
        "signatures": [
            {
                "full": "getOrcaDataLineage(name)",
                "name": "getOrcaDataLineage",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaDataLineage](https://docs.dolphindb.com/en/Functions/g/getOrcaDataLineage.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ngetOrcaDataLineage(name)\n\n#### Details\n\n**When*****name*****is a table name**, this function retrieves the data lineage of the specified public stream table within the stream graph, including both the current lineage and any historical lineage that previously existed.\n\nIt returns a JSON object that contains information about the upstream dependencies of the table in each stream graph where it exists.\n\nEach stream graph is represented as a key–value pair, where the key is the internal name, and the value contains the stream graph’s attributes and upstream nodes:\n\n* fnq: A STRING scalar. Represents the fully qualified name of the stream graph.\n* isDeleted: A Boolean value. Indicates whether the stream graph has been deleted.\n* Each node is represented as a key–value pair, where the key is the node name, and the value is an object with the following properties:\n  * isRoot: A Boolean value. Indicates whether the node is a root node.\n  * parent: A STRING vector. Contains the names of all direct parent nodes. For root nodes, this is an empty array `[]`.\n  * isTable: A Boolean value. Indicates whether the node is a table.\n  * isEngine: A Boolean value. Indicates whether the node is an engine.\n\n**When*****name*****is a TimerEngine name**, return a JSON object with the following fields:\n\n* input: Information about the engine *func*’s input parameters. Keys are parameter names and values are data types. If there are no inputs, it is `{}`.\n* output: Information about the engine *func*’s return value.\n  * If the return value is a table, the keys are column names and the values are column types.\n  * If the return value is any other kind of scalar, the key is \"return\" and the value is the data type.\n  * In other cases, the key is \"return\" and the value describes the data form.\n\n#### Parameters\n\n**name** is a string indicating the name of the table or timer engine to be queried. The table name supports two formats:\n\n* Fully qualified name, e.g. `\"catalog_name.orca_table.table_name\"`\n* Internal name format, e.g. `\"public_stream_table_05056f34_92b0_16b2_204e_c3c63e3f8a84\"`\n\n#### Returns\n\nA JSON object.\n\n#### Examples\n\n```\n// Create and submit the stream graph\ncreateCatalog(\"test\")\ngo\nuse catalog test\n\ndef myFunc(x,y,z){\n    return table(x as col1,y as col2,z as col3)\n}\na = [\"aaa\"]\nb = [\"bbb\"]\nc = [\"ccc\"]\nt = table(1..100 as id, 1..100 as value, take(09:29:00.000..13:00:00.000, 100) as timestamp)\n\ng1 = createStreamGraph(\"factor1\")\ng1.source(\"snapshot1\", schema(t).colDefs.name, schema(t).colDefs.typeString)\n  .reactiveStateEngine([<cumsum(value)>, <timestamp>])\n  .setEngineName(\"rse1\")\n  .timerEngine(3, myFunc, a, b, c)\n  .setEngineName(\"myJob\")\n  .buffer(\"end\")\ng1.submit()\n\ng2 = createStreamGraph(\"factor2\")\ng2.source(\"snapshot2\", schema(t).colDefs.name, schema(t).colDefs.typeString)\n  .reactiveStateEngine([<cumsum(value)>, <timestamp>])\n  .setEngineName(\"rse2\")\n  .buffer(\"end\")\ng2.submit()\n\n// drop stream graph \"factor2\"\ndropStreamGraph(\"factor2\")\n\n// retrieves the data lineage\ngetOrcaDataLineage(\"test.orca_table.end\")\n/*\n{\n  \"40d12999-f8f3-9cb5-4a49-813bdee46a9f\": {\n    \"fqn\": \"test.orca_graph.factor1\",\n    \"isDeleted\": false,\n    \"test.orca_engine.rse1\": {\n      \"isRoot\": false,\n      \"isTable\": false,\n      \"isEngine\": true,\n      \"parents\": [\n        \"test.orca_table.snapshot1\"\n      ]\n    },\n    \"test.orca_table.end\": {\n      \"isRoot\": false,\n      \"isTable\": true,\n      \"isEngine\": false,\n      \"parents\": [\n        \"test.orca_engine.rse1\"\n      ]\n    },\n    \"test.orca_table.snapshot1\": {\n      \"isRoot\": true,\n      \"isTable\": true,\n      \"isEngine\": false,\n      \"parents\": []\n    }\n  },\n  \"4cee4ed3-007b-f38a-8743-f6776a6172d9\": {\n    \"fqn\": \"test.orca_graph.factor2\",\n    \"isDeleted\": true,\n    \"test.orca_engine.rse2\": {\n      \"isRoot\": false,\n      \"isTable\": false,\n      \"isEngine\": true,\n      \"parents\": [\n        \"test.orca_table.snapshot2\"\n      ]\n    },\n    \"test.orca_table.end\": {\n      \"isRoot\": false,\n      \"isTable\": true,\n      \"isEngine\": false,\n      \"parents\": [\n        \"test.orca_engine.rse2\"\n      ]\n    },\n    \"test.orca_table.snapshot2\": {\n      \"isRoot\": true,\n      \"isTable\": true,\n      \"isEngine\": false,\n      \"parents\": []\n    }\n  }\n}\n*/\n\n// check timerEngine func\ngetOrcaDataLineage(\"test.orca_engine.myJob\")\n/*\n{\n  \"input\": {\n    \"x\": \"STRING\",\n    \"y\": \"STRING\",\n    \"z\": \"STRING\"\n  },\n  \"output\": {\n    \"col1\": \"STRING\",\n    \"col2\": \"STRING\",\n    \"col3\": \"STRING\"\n  }\n}\n*/\n```\n"
    },
    "getOrcaStateMachineEventTaskStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaStateMachineEventTaskStatus.html",
        "signatures": [
            {
                "full": "getOrcaStateMachineEventTaskStatus()",
                "name": "getOrcaStateMachineEventTaskStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaStateMachineEventTaskStatus](https://docs.dolphindb.com/en/Functions/g/getOrcaStateMachineEventTaskStatus.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetOrcaStateMachineEventTaskStatus()\n\n#### Details\n\nStream Master treats incoming requests as events, which are added to the state machine queue and wait for execution. This function is used to retrieve the status of tasks in the state machine.\n\n#### Returns\n\nA table containing the following fields:\n\n* **id:** Event ID.\n* **type:** Type of the event. Possible values include:\n  * SUBMIT\\_REQUEST\\*\\*:\\*\\* Event triggered by a user request to submit a streaming graph.\n  * SUBMIT\\*\\*:\\*\\* Streaming graph submission event.\n  * RESUBMIT\\_REQUEST\\*\\*:\\*\\* Event triggered by a user request to resubmit a streaming graph.\n  * DROP\\_REQUEST\\*\\*:\\*\\* Event triggered by a user request to delete a streaming graph.\n  * DROP\\_CALLBACK\\*\\*:\\*\\* Internal event for the deletion callback of a streaming graph.\n  * DROP\\*\\*:\\*\\* Streaming graph destruction event.\n  * NODE\\_DOWN\\*\\*:\\*\\* Node failure event.\n  * NODE\\_READY\\*\\*:\\*\\* Node restart event.\n  * RECOVER\\*\\*:\\*\\* Task recovery event.\n  * INTERNAL\\*\\*:\\*\\* Internal event.\n* **state:** Running status of the event, including pending, running, and finished.\n* **retries:** Number of retries. When the event is not processed correctly, the state machine will attempt retries.\n* **scheduledTime:** Scheduled time indicating when the event should be executed.\n* **startTime:** Actual start time when the event processing began.\n* **endTime:** End time of the event processing.\n* **detail:** Properties related to the event.\n* **errorMessage:** Error message generated during event processing, if any.\n\n#### Examples\n\n```\ngetOrcaStateMachineEventTaskStatus()\n```\n"
    },
    "getOrcaStreamEngineMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaStreamEngineMeta.html",
        "signatures": [
            {
                "full": "getOrcaStreamEngineMeta(name)",
                "name": "getOrcaStreamEngineMeta",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaStreamEngineMeta](https://docs.dolphindb.com/en/Functions/g/getOrcaStreamEngineMeta.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetOrcaStreamEngineMeta(name)\n\n#### Details\n\nRetrieve the metadata of all streaming engines in the specified streaming graph.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA table containing the following fields:\n\n* **taskId:** ID of the task that owns the engine.\n* **name:** Name of the engine.\n* **type:** Type of the engine.\n* **schema:** Field types of the engine's output table.\n* **fqn:** Fully qualified name defined by `setEngineName`.\n\n#### Examples\n\n```\ngetOrcaStreamEngineMeta(\"streamGraph1\") // name is the name of the streaming graph\ngetOrcaStreamEngineMeta(\"catalog1.orca_graph.streamGraph1\") // name is the fully qualified name\n```\n"
    },
    "getOrcaStreamTableMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaStreamTableMeta.html",
        "signatures": [
            {
                "full": "getOrcaStreamTableMeta([name])",
                "name": "getOrcaStreamTableMeta",
                "parameters": [
                    {
                        "full": "[name]",
                        "name": "name",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaStreamTableMeta](https://docs.dolphindb.com/en/Functions/g/getOrcaStreamTableMeta.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetOrcaStreamTableMeta(\\[name])\n\n#### Details\n\nReturn the metadata of the specified streaming table in Orca.\n\nIf *name* is not specified, the function returns the metadata of all streaming tables in Orca.\n\n#### Parameters\n\n**name** (optional) is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA table containing the following fields:\n\n* **id:** Streaming table ID.\n* **fqn:** Fully qualified name of the streaming table.\n* **site:** Name of the node where the streaming table resides.\n* **graphRefs:** List of streaming graph IDs that reference this streaming table.\n* **raftGroupId:** Raft group ID of the high-availability streaming table; returns 0 for non-HA streaming tables.\n\n#### Examples\n\n```\ngetOrcaStreamTableMeta(\"trade1\") // name is the name of the streaming table\ngetOrcaStreamTableMeta(\"catalog1.orca_table.trade1\") // name is the fully qualified name\n```\n"
    },
    "getOrcaStreamTaskSubscriptionMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOrcaStreamTaskSubscriptionMeta.html",
        "signatures": [
            {
                "full": "getOrcaStreamTaskSubscriptionMeta(name)",
                "name": "getOrcaStreamTaskSubscriptionMeta",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getOrcaStreamTaskSubscriptionMeta](https://docs.dolphindb.com/en/Functions/g/getOrcaStreamTaskSubscriptionMeta.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetOrcaStreamTaskSubscriptionMeta(name)\n\n#### Details\n\nRetrieve the subscription information of all streaming tasks in the specified streaming graph.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA table containing the following fields:\n\n* **taskId:** Streaming task ID.\n* **tableName:** Name of the streaming table.\n* **actionName:** Name of the subscription task.\n\n#### Examples\n\n```\ngetOrcaStreamTaskSubscriptionMeta(\"streamGraph1\") // name is the name of the streaming graph\ngetOrcaStreamTaskSubscriptionMeta(\"catalog1.orca_graph.streamGraph1\") // name is the fully qualified name\n```\n"
    },
    "getOS": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOS.html",
        "signatures": [
            {
                "full": "getOS()",
                "name": "getOS",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getOS](https://docs.dolphindb.com/en/Functions/g/getOS.html)\n\n\n\n#### Syntax\n\ngetOS()\n\n#### Details\n\nReturn the operating system where DolphinDB is running.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetOS();\n// output: linux\n```\n"
    },
    "getOSBit": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getOSBit.html",
        "signatures": [
            {
                "full": "getOSBit()",
                "name": "getOSBit",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getOSBit](https://docs.dolphindb.com/en/Functions/g/getOSBit.html)\n\n\n\n#### Syntax\n\ngetOSBit()\n\n#### Details\n\nIndicate whether the operating system is 32-bit or 64-bit.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn Integer scalar.\n\n#### Examples\n\n```\ngetOSBit();\n// output: 64\n```\n"
    },
    "getPerf": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getPerf.html",
        "signatures": [
            {
                "full": "getPerf()",
                "name": "getPerf",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getPerf](https://docs.dolphindb.com/en/Functions/g/getPerf.html)\n\n\n\n#### Syntax\n\ngetPerf()\n\n#### Details\n\n`getPerf` returns various performance monitoring metrics of the local node as a dictionary.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a dictionary contains the following fields:\n\n* runningJobs: The number of running jobs.\n\n* jobLoad: The CPU load of a job.\n\n* avgLoad: average CPU load.\n\n* queuedJobs: The number of jobs in queue.\n\n* lastMinuteNetworkSend: The data (in bytes) sent in the last minute.\n\n* lastMinuteNetworkRecv: The data (in bytes) received in the last minute.\n\n* lastMinuteReadVolume: The data (in bytes) read from disk in the last minute.\n\n* lastMinuteWriteVolume: The data (in bytes) written to disk in the last minute.\n\n* lastMsgLatency: The latency (in ns) of the last received message.\n\n* cumMsgLatency: The cumulative latency (in ns) of the messages.\n\n* maxLast10QueryTime: The maximum execution time (in ns) of the previous 10 finished queries.\n\n* maxLast100QueryTime: The maximum execution time (in ns) of the previous 100 finished queries.\n\n* medLast10QueryTime: The median execution time (in ns) of the previous 10 finished queries.\n\n* medLast100QueryTime: The median execution time (in ns) of the previous 100 finished queries.\n\n* maxRunningQueryTime: The maximum elapsed time (in ns) of the queries that are currently running.\n\n* diskFreeSpaceRatio: The available space ratio.\n\n* diskReadRate: The rate (in bytes/s) at which data are read from disk.\n\n* diskWriteRate: The rate (in bytes/s) at which data are written to disk.\n\n* diskFreeSpace: The available disk space (in bytes).\n\n* diskCapacity: The disk capacity (in bytes).\n\n* cpuUsage: CPU usage.\n\n* memoryAlloc: The total memory (in bytes) allocated to DolphinDB on the node.\n\n* memoryUsed: The memory (in bytes) used by the node.\n\n* networkSendRate: The rate at which data are sent (in bytes/s).\n\n* networkRecvRate: The rate at which data are received (in bytes/s).\n\n* connectionNum: The number of connections to the local node.\n\n#### Examples\n\n```\ngetPerf();\n/* output:\nlastMinuteWriteVolume->684\nrunningJobs->0\nlastMsgLatency->0\nmaxLast100QueryTime->0\navgLoad->0.0040625\ndiskWriteRate->144\nlastMinuteNetworkSend->228528\nqueuedJobs->0\nlastMinuteNetworkRecv->525533\nmaxLast10QueryTime->0\nmedLast100QueryTime->0\nmaxRunningQueryTime->0\ndiskReadRate->2663\ncumMsgLatency->0\nmedLast10QueryTime->0\ndiskFreeSpaceRatio->0\ncpuUsage->0.306748466257669\nmemoryUsed->29053456\njobLoad->0\nnetworkSendRate->4460\nmemoryAlloc->35463168\nlastMinuteReadVolume->159940\nnetworkRecvRate->8950\ndiskCapacity->0\ndiskFreeSpace->0\n*/\n```\n"
    },
    "getPersistenceMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getPersistenceMeta.html",
        "signatures": [
            {
                "full": "getPersistenceMeta(table)",
                "name": "getPersistenceMeta",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [getPersistenceMeta](https://docs.dolphindb.com/en/Functions/g/getPersistenceMeta.html)\n\n\n\n#### Syntax\n\ngetPersistenceMeta(table)\n\n#### Details\n\nGet metadata of a persistent stream table.\n\n#### Parameters\n\n**table** is a table object.\n\n#### Returns\n\nReturn a dictionary with the following keys:\n\n* lastLogSeqNum: the latest log sequence number of raft log.\n\n* totalSize: the total number of records during the lifecycle of the stream table.\n\n* sizeInMemory: the number of records in memory.\n\n* memoryOffset: the offset position of the first message in memory relative to totalSize. memoryOffset = totalSize - sizeInMemory.\n\n* sizeOnDisk: the number of records that have been persisted to disk.\n\n* diskOffset: the offset position of the first message on disk relative to totalSize.\n\n* asynWrite: whether to persist data with asynchronous mode.\n\n* compress: whether to save compressed data.\n\n* retentionMinutes: how long (in terms of minutes) the log file will be kept. The default value is 1440 minutes (1 day).\n\n* persistenceDir: the path to the persistent data.\n\n* hashValue: the identifier of the thread responsible for persisting the table to disk. If persistenceWorkerNum>1, hashValue may not be 0.\n\n* raftGroup: the ID of the Raft group to which the HA stream table belongs. For regular stream tables, this value is -1.\n\n* tableId: the unique identifier of the HA stream table within the Raft group. This is only returned when the table is an HA stream table.\n\n#### Examples\n\n```\ncolName=[\"time\",\"x\"]\ncolType=[\"timestamp\",\"int\"]\nt = streamTable(100:0, colName, colType);\nenableTableShareAndPersistence(table=t, tableName=`st, cacheSize=1200000)\ngo;\n\nfor(s in 0:200){\n   n=10000\n   time=2019.01.01T00:00:00.000+s*n+1..n\n   x=rand(10.0, n)\n   insert into st values(time, x)\n}\n\ngetPersistenceMeta(st);\n\n/* output:\nastLogSeqNum->-1\nsizeInMemory->800000\nasynWrite->true\ntotalSize->2000000\nraftGroup->-1\ncompress->true\nmemoryOffset->1200000\nretentionMinutes->1440\nsizeOnDisk->2000000\npersistenceDir->/dolphindb/server/streamPersistDir/st\nhashValue->0\ndiskOffset->0\n*/\n```\n"
    },
    "getPKEYCompactionTaskStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getPKEYCompactionTaskStatus.html",
        "signatures": [
            {
                "full": "getPKEYCompactionTaskStatus([count])",
                "name": "getPKEYCompactionTaskStatus",
                "parameters": [
                    {
                        "full": "[count]",
                        "name": "count",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getPKEYCompactionTaskStatus](https://docs.dolphindb.com/en/Functions/g/getPKEYCompactionTaskStatus.html)\n\n\n\n#### Syntax\n\ngetPKEYCompactionTaskStatus(\\[count])\n\n#### Details\n\nObtain the status of PKEY level file compaction tasks, including all pending tasks and completed tasks.The optional *count* limits the number of completed tasks returned. The function can only be executed on a data node.\n\n#### Parameters\n\n**count** (optional) is a non-negative integer that specifies how many recent completed compaction tasks (successful or failed) to report per volume. The default value is 0, indicating that all completed compaction tasks are returned.\n\n#### Returns\n\nA table with the following columns:\n\n* volume: the volume where the compaction is performed. It is set by the configuration parameter *volumes*.\n* level: the level of files that are involved in the current compaction. An empty cell means the compaction hasn’t started, is ongoing, or failed.A compaction involves up to two levels at a time.\n* chunkId: the ID of chunk where the compaction is performed.\n* tableName: the physical name of the table where the compaction is performed.\n* files: the level files involved in the current compaction. An empty cell means the compaction hasn’t started, is ongoing, or failed.\n* force: whether the compaction is triggered by `triggerPKEYCompaction`.\n* receivedTime: the timestamp when the compaction task enqueued.\n* startTime: the timestamp when the compaction task started.\n* endTime: the timestamp when the compaction task ended.\n* errorMessage: If a task failed, the column displays the failure cause; otherwise it is left empty.\n\n#### Examples\n\n```\ngetPKEYCompactionTaskStatus()\n```\n\n| volume                                   | level | chunkId                              | tableName | files           | force | receivedTime            | startTime               | endTime                 | errorMessage |\n| ---------------------------------------- | ----- | ------------------------------------ | --------- | --------------- | ----- | ----------------------- | ----------------------- | ----------------------- | ------------ |\n| /home/dolphindb/server/local8848/storage | 2     | ac872f06-abed-339c-8642-ce7dcf415691 | pt1\\_2    | 2-000000046-002 | true  | 2024.09.24 13:52:37.746 | 2024.09.24 13:52:37.746 | 2024.09.24 13:52:37.816 |              |\n| /home/dolphindb/server/local8848/storage | 1     | ac872f06-abed-339c-8642-ce7dcf415691 | pt1\\_2    | 1-000000046-001 | true  | 2024.09.24 13:52:32.431 | 2024.09.24 13:52:32.431 | 2024.09.24 13:52:32.437 |              |\n| /home/dolphindb/server/local8848/storage | 0     | ac872f06-abed-339c-8642-ce7dcf415691 | pt1\\_2    | 0-000000046-000 | true  | 2024.09.24 11:58:42.006 | 2024.09.24 11:58:42.006 | 2024.09.24 11:58:42.011 |              |\n| /home/dolphindb/server/local8848/storage | 0     | 62ab7ebb-03f2-10a5-5445-c537512aee06 | pt1\\_2    | 0-000000045-000 | true  | 2024.09.24 11:57:13.596 | 2024.09.24 11:57:13.596 | 2024.09.24 11:57:13.601 |              |\n"
    },
    "getPKEYMetaData": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getPKEYMetaData.html",
        "signatures": [
            {
                "full": "getPKEYMetaData()",
                "name": "getPKEYMetaData",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getPKEYMetaData](https://docs.dolphindb.com/en/Functions/g/getPKEYMetaData.html)\n\n\n\n#### Syntax\n\ngetPKEYMetaData()\n\n#### Details\n\nObtain the metadata of all chunks in the PKEY engine. The function can only be executed on a data node.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nA table with the following columns:\n\n* chunkId: the chunk ID\n* chunkPath: the physical path of the chunk\n* level: the file level\n* table: the table name\n* files: the level file name\n\n#### Examples\n\n```\ngetPKEYMetaData()\n```\n\n| chunkId                              | chunkPath                                                                     | level | table  | files           |\n| ------------------------------------ | ----------------------------------------------------------------------------- | ----- | ------ | --------------- |\n| a0a7b031-15b8-32be-664b-21b156dc94c0 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200102/Key94/1B8 | 0     | pt1\\_2 | 0-000000006-000 |\n| b3307046-77cb-bbb4-2244-dc4dcdd4c4e2 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200104/Key39/1B8 | 0     | pt1\\_2 | 0-000000009-000 |\n| 1b47193f-39a4-8b93-3f44-d1b32b892126 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200105/Key94/1B8 | 0     | pt1\\_2 | 0-000000007-000 |\n| 65ac20af-e1ea-21a6-254a-0c7a1f4a1bcf | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200102/Key39/1B8 | 0     | pt1\\_2 | 0-000000003-000 |\n| 600e024e-e280-62bb-084d-b440f7ccc349 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200101/Key94/1B8 | 0     | pt1\\_2 | 0-000000002-000 |\n| 4f33838b-1b90-3f84-6943-e0da5fda3e10 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200104/Key94/1B8 | 0     | pt1\\_2 | 0-000000005-000 |\n| e625607d-03ce-00bc-ab47-a419ae5af3f3 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200103/Key94/1B8 | 0     | pt1\\_2 | 0-000000004-000 |\n| 9e0004ea-33b5-b2b4-d947-065c9333709f | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200101/Key39/1B8 | 0     | pt1\\_2 | 0-000000001-000 |\n| 595d1703-88b4-4397-4b46-281eb8014251 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200103/Key39/1B8 | 0     | pt1\\_2 | 0-000000008-000 |\n| 280b3b44-8006-52a8-694e-1133e8740c07 | /home/dolphindb/server/local8848/storage/CHUNKS/test\\_pkey/20200105/Key39/1B8 | 0     | pt1\\_2 | 0-000000010-000 |\n"
    },
    "getPrefetchComputeNodeData": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getPrefetchComputeNodeData.html",
        "signatures": [
            {
                "full": "getPrefetchComputeNodeData()",
                "name": "getPrefetchComputeNodeData",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getPrefetchComputeNodeData](https://docs.dolphindb.com/en/Functions/g/getPrefetchComputeNodeData.html)\n\n\n\n#### Syntax\n\ngetPrefetchComputeNodeData()\n\n#### Details\n\nGet the value of *enableComputeNodePrefetchData* on the current node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\ngetPrefetchComputeNodeData()\n// output: false\n```\n\n**Related Function**: [setPrefetchComputeNodeData](https://docs.dolphindb.com/en/Functions/s/setPrefetchComputeNodeData.html)\n"
    },
    "getQueryStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getQueryStatus.html",
        "signatures": [
            {
                "full": "getQueryStatus()",
                "name": "getQueryStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getQueryStatus](https://docs.dolphindb.com/en/Functions/g/getQueryStatus.html)\n\n\n\n#### Syntax\n\ngetQueryStatus()\n\n#### Details\n\nGet the status of a running query initialized on the current node.\n\nThe function can only be called on the node where a query is initialized.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a table with the following columns:\n\n* id: The total count of the query tasks that have been executed.\n\n* sessionId: ID of the session where the query is initialized. Please note that sessionId of the jobs submitted with `submitJob` cannot be obtained.\n\n* userId: The user who initialized the task.\n\n* query: The query statement.\n\n* startTime: The timestamp when the query starts.\n\n* elapsedTimeInMs: The elapsed time (in ms) of the query.\n\n* memoryUsage: The memory used by the variables and results of the query (in bytes).\n\n* totalTaskCount: Total count of tasks.\n\n* completedTaskCount: Count of completed tasks.\n\n* percentComplete: The completion percentage of the query.\n\n#### Examples\n\n```\ngetQueryStatus();\n```\n\n| id | sessionId  | userId | query                        | startTime               | elapsedTimeInMs | memoryUsage | totalTaskCount | completedTaskCount | percentComplete |\n| -- | ---------- | ------ | ---------------------------- | ----------------------- | --------------- | ----------- | -------------- | ------------------ | --------------- |\n| 2  | 1166953221 | admin  | select ticker, id, x from pt | 2022.06.14 08:15:00.606 | 1052            | 184550000   | 4              | 1                  | 0.25            |\n"
    },
    "getRaftElectionTick": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRaftElectionTick.html",
        "signatures": [
            {
                "full": "getRaftElectionTick(groupId)",
                "name": "getRaftElectionTick",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [getRaftElectionTick](https://docs.dolphindb.com/en/Functions/g/getRaftElectionTick.html)\n\n\n\n#### Syntax\n\ngetRaftElectionTick(groupId)\n\n#### Details\n\nObtain the election tick in the specified raft group. The election tick is specified by the parameter *tickCount* of command `setRaftElectionTick` or the configuration parameter *raftElectionTick*.\n\n#### Parameters\n\n**groupId** is a positive integer indicating the raft group ID. Currently it can only be 1, referring to the ID of the raft group composed of controllers.\n\n#### Returns\n\nAn integer scalar.\n\nRelated Functions: [setRaftElectionTick](https://docs.dolphindb.com/en/Functions/s/setRaftElectionTick.html), [getControllerElectionTick](https://docs.dolphindb.com/en/Functions/g/getControllerElectionTick.html)\n"
    },
    "getRaftLearnersStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRaftLearnersStatus.html",
        "signatures": [
            {
                "full": "getRaftLearnersStatus(groupId)",
                "name": "getRaftLearnersStatus",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [getRaftLearnersStatus](https://docs.dolphindb.com/en/Functions/g/getRaftLearnersStatus.html)\n\n\n\n#### Syntax\n\ngetRaftLearnersStatus(groupId)\n\n#### Details\n\nRetrieve the status of all Learner nodes in a specified Raft group.\n\n#### Parameters\n\n**groupId** is an integer greater than 1 indicating raft group ID.\n\n#### Returns\n\nA table with the following columns:\n\n* nameName: The node name.\n* nodeId: The node ID.\n* matchIndex: The highest log entry index that the Leader has confirmed as replicated to the Learner.\n* nextIndex: The index of the next log entry the Leader will send to the Learner.\n* replicationLag: The number of log entries delayed in replication. A smaller value indicates lower latency.\n* lastActiveTime: The timestamp of the most recent successful communication between the Leader and the Learner.\n* snapshotProgress: Snapshot transfer progress. 0 indicates that no snapshot transfer is currently in progress.\n\n#### Examples\n\n```\ngetRaftLearnersStatus(3)\n```\n\n| nodeName               | nodeId | matchIndex | nextIndex | replicationLag | lastActiveTime          | snapshotProgress |\n| ---------------------- | ------ | ---------- | --------- | -------------- | ----------------------- | ---------------- |\n| datanode8922\\@cluster2 | 256    | 10,004     | 10,005    | 0              | 2025.08.18 14:00:15.349 | 0                |\n"
    },
    "getRawScriptLog": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRawScriptLog.html",
        "signatures": [
            {
                "full": "getRawScriptLog([userId], [startTime], [endTime])",
                "name": "getRawScriptLog",
                "parameters": [
                    {
                        "full": "[userId]",
                        "name": "userId",
                        "optional": true
                    },
                    {
                        "full": "[startTime]",
                        "name": "startTime",
                        "optional": true
                    },
                    {
                        "full": "[endTime]",
                        "name": "endTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getRawScriptLog](https://docs.dolphindb.com/en/Functions/g/getRawScriptLog.html)\n\n\n\n#### Syntax\n\ngetRawScriptLog(\\[userId], \\[startTime], \\[endTime])\n\n#### Details\n\nReturns the raw script logs of specified users. This function can only be executed by an administrator.\n\n**Note:** Each script execution generates two log records: The first record is written before execution starts and contains startTime and script, while endTime and errorMsg are left empty. The second record is written after execution completes and contains endTime and errorMsg (if an error occurred during execution), while script is left empty.\n\n#### Parameters\n\n**userId** (optional) is a string scalar or vector specifying which users' raw script logs to query. Defaults to empty, meaning all users.\n\n**startTime** (optional) is an integral or temporal scalar specifying the query start time. Defaults to 0 (i.e., from 1970.01.01).\n\n**endTime** (optional) is an integral or temporal scalar specifying the query end time. Defaults to empty, meaning up to the current time. *startTime* must be no larger than *endTime*.\n\n#### Returns\n\nA table containing the following fields:\n\n* node: STRING, node alias where the script was executed.\n\n* username: STRING, user who ran the script.\n\n* sessionID: LONG, current session ID.\n\n* rootJobID: STRING, current root job ID.\n\n* remoteIP: IPADDR, user IP address.\n\n* remotePort: INT, user port.\n\n* startTime: NANOTIMESTAMP, script execution start time.\n\n* endTime: NANOTIMESTAMP, script execution end time.\n\n* script: STRING, full script code.\n\n* errorMsg: STRING, error message if the script execution failed, empty otherwise.\n\n#### Examples\n\nQuery raw script logs for user1:\n\n```\ngetRawScriptLog(`user1)\n```\n"
    },
    "getReactiveMetrics": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getReactiveMetrics.html",
        "signatures": [
            {
                "full": "getReactiveMetrics(name)",
                "name": "getReactiveMetrics",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getReactiveMetrics](https://docs.dolphindb.com/en/Functions/g/getReactiveMetrics.html)\n\n\n\n#### Syntax\n\ngetReactiveMetrics(name)\n\n#### Details\n\nGet factors specified in *metric*s of the engine generated by `createNarrowReactiveStateEngine`.\n\n#### Parameters\n\n**name**is a string indicating the engine name.\n\n#### Returns\n\nIt returns a table cotaining two columns:\n\n* metricName: the name of factors.\n\n* metricCode: the detailed formula for calculations.\n\n#### Examples\n\n```\ndummy = streamTable(1:0, [\"securityID1\",\"securityID2\",\"securityID3\",\"createTime\",\"updateTime\",\"upToDatePrice\",\"qty\",\"value\"], [STRING,STRING,STRING,TIMESTAMP,TIMESTAMP,DOUBLE,DOUBLE,INT]) \noutputTable = streamTable(1:0,[\"securityID1\",\"securityID2\",\"securityID3\",\"createTime\",\"updateTime\",\"metricNames\",\"factorValue\"], [STRING,STRING,STRING, TIMESTAMP,TIMESTAMP,STRING,DOUBLE])\nfactor = [<createTime>, <updateTime>,<cumsum(qty)>]\nNarrowtest = createNarrowReactiveStateEngine(name=\"narrowtest1\",metrics=factor,metricNames=\"factor1\",dummyTable=dummy,outputTable=outputTable,keyColumn=[\"securityID1\",\"securityID2\",\"securityID3\"])\ngetReactiveMetrics(\"narrowtest1\")\n\nmetricName\tmetricCode\nfactor1     cumsum(qty)\n```\n\nRelated functions: [createNarrowReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createNarrowReactiveStateEngine.html),[addReactiveMetrics](https://docs.dolphindb.com/en/Functions/a/addReactiveMetrics.html)\n"
    },
    "getRecentJobs": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRecentJobs.html",
        "signatures": [
            {
                "full": "getRecentJobs(n)",
                "name": "getRecentJobs",
                "parameters": [
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [getRecentJobs](https://docs.dolphindb.com/en/Functions/g/getRecentJobs.html)\n\n\n\n#### Syntax\n\ngetRecentJobs(n)\n\n#### Details\n\nRetrieves the status of most recent n jobs on the local node, including scheduled jobs and batch jobs.\n\nFor details please refer to [Batch Job Management](https://docs.dolphindb.com/en/Maintenance/BatchJobManagement.html).\n\n#### Parameters\n\n**n** is a positive integer. If it is unspecified, return all jobs since the session is started.\n\n#### Returns\n\nIt returns a table with the following columns:\n\n| Name         | Meaning                                                                    |\n| ------------ | -------------------------------------------------------------------------- |\n| node         | the alias of the local node                                                |\n| userID       | the user ID                                                                |\n| jobId        | the job ID                                                                 |\n| rootJobId    | the root job ID                                                            |\n| jobDesc      | the job description                                                        |\n| priority     | priority of the job which is marked as integers ranging from 0 to 9        |\n| parallelism  | the parallelism, i.e., the maximum number of jobs that can run in parallel |\n| clientIp     | the IP address of the client where the job is submitted                    |\n| clientPort   | the port number of the client where the job is submitted                   |\n| receivedTime | the time (of TIMESTAMP type) when a job is received by the node            |\n| startTime    | the start time of jobs (of TIMESTAMP type)                                 |\n| endTime      | the end time of jobs (of TIMESTAMP type)                                   |\n| errorMessage | error messages                                                             |\n\n#### Examples\n\n```\ndef jobDemo(n){\n   s = 0\n   for (x in 1 : n) {\n       s += sum(sin rand(1.0, 100000000)-0.5)\n       print(\"iteration \" + x + \" \" + s)\n   }\n   return s\n};\n\nsubmitJob(\"jobDemo1\",\"job demo\", jobDemo, 100);\nsubmitJob(\"jobDemo2\",, jobDemo, 10);\n\n// Schedule a function to run periodically\ndef f():1+2;\nscheduleJob(jobId=`daily, jobDesc=\"Daily Job 1\", jobFunc=f, scheduleTime=10:22m, startDate=2026.06.16, endDate=2026.06.30, frequency='D');\n\n// Retrieve the status of the 10 most recent jobs\ngetRecentJobs(10);\n```\n\n| node       | userID | jobId    | rootJobId                            | jobDesc     | priority | parallelism | clientIp      | clientPort | receivedTime            | startTime               | endTime                 | errorMsg |\n| ---------- | ------ | -------- | ------------------------------------ | ----------- | -------- | ----------- | ------------- | ---------- | ----------------------- | ----------------------- | ----------------------- | -------- |\n| local11454 | admin  | jobDemo1 | 463f12b1-9530-caa9-f246-5934582eaa24 | job demo    | 4        | 2           | 192.168.1.193 | 63,309     | 2026.06.16 10:21:01.875 | 2026.06.16 10:21:01.875 | 2026.06.16 10:22:05.678 |          |\n| local11454 | admin  | jobDemo2 | b119031d-4d47-3190-e846-f4db8c2a6e35 | jobDemo     | 4        | 2           | 192.168.1.193 | 63,309     | 2026.06.16 10:21:01.875 | 2026.06.16 10:21:01.875 | 2026.06.16 10:21:08.127 |          |\n| local11454 | admin  | daily    | 75311d80-f938-dc9f-5547-778a5c4ff136 | Daily Job 1 | 4        | 2           |               | 0          | 2026.06.16 10:22:12.342 | 2026.06.16 10:22:12.342 | 2026.06.16 10:22:12.342 |          |\n"
    },
    "getRecentSlaveReplicationInfo": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRecentSlaveReplicationInfo.html",
        "signatures": [
            {
                "full": "getRecentSlaveReplicationInfo()",
                "name": "getRecentSlaveReplicationInfo",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getRecentSlaveReplicationInfo](https://docs.dolphindb.com/en/Functions/g/getRecentSlaveReplicationInfo.html)\n\n#### Syntax\n\ngetRecentSlaveReplicationInfo()\n\n#### Details\n\nThis function displays the latest task in each slave cluster where cluster replication is enabled. It can only be executed by an administrator on the controller of a master cluster.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* connectedController: ip:port of the controller of slave cluster.\n\n* allControllersInRaft: ip:port of each controller in a raft group for a HA cluster.\n\n* lastFinishedTaskId: ID of the last finished task.\n\n* lastPullTime: the last time when the slave cluster pulls tasks from the master cluster.\n\n#### Examples\n\n```\ngetRecentSlaveReplicationInfo()\n```\n\n| connectedController | allControllersInRaft                               | lastFinishedTaskId | lastPullTime            |\n| ------------------- | -------------------------------------------------- | ------------------ | ----------------------- |\n| 192.168.2.2:1111    | 192.168.2.2:1111,192.168.2.2:1112,192.168.2.2:1113 | 233                | 2022.11.11T11:11:11.111 |\n\n"
    },
    "getRecoveryTaskStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html",
        "signatures": [
            {
                "full": "getRecoveryTaskStatus()",
                "name": "getRecoveryTaskStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html)\n\n\n\n#### Syntax\n\ngetRecoveryTaskStatus()\n\n#### Details\n\nGet the status of recovery tasks. This function can only be executed on a controller.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a table containing the following columns:\n\n* TaskId: The job ID of the recovery task.\n\n* TaskType: The type of the recovery task. It can be \"LoadRebalance\" and \"ChunkRecovery\".\n\n* ChunkId: The chunk ID.\n\n* ChunkPath: The DFS path of the chunk.\n\n* Source: The source node for data recovery.\n\n* Dest: The destination node for data recovery.\n\n* Status: The status of the recovery task. It can be \"Waiting\", \"In-Progress\", and \"Finished\" or \"Aborted\".\n\n* AttemptCount: The number of recovery attempts that have been made.\n\n* DeleteSource: Whether to delete the replica on the source node. When *TaskType* is \"ChunkRecovery\", it is false. When *TaskType* is \"LoadRebalance\", it can be true or false.\n\n* StartTime: The time when the recovery task is created.\n\n* LastDequeueTime: The last time when the recovery task is dequeued.\n\n* LastStartTime: The last time when the recovery task started.\n\n* FinishTime: The time when the recovery task was finished.\n\n* IsIncrementalRecovery: Whether incremental replication is enabled.\n\n* IsAsyncRecovery: Whether asynchronous replication is enabled.\n\n* ChangeFromIncrementalToFull: Whether incremental replication has been changed to full replication. The recovery will be automatically changed to full recovery after multiple attempts for incremental recovery fail.\n\n* ChangeToSyncTime: The time when the online recovery is changed from asynchronous to synchronous.\n\n* FailureReason: The reason for the failure of the recovery tasks.\n\n#### Examples\n\n```\ngetRecoveryTaskStatus();\n```\n"
    },
    "getRecoveryWorkerNum": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRecoveryWorkerNum.html",
        "signatures": [
            {
                "full": "getRecoveryWorkerNum()",
                "name": "getRecoveryWorkerNum",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getRecoveryWorkerNum](https://docs.dolphindb.com/en/Functions/g/getRecoveryWorkerNum.html)\n\n\n\n#### Syntax\n\ngetRecoveryWorkerNum()\n\n#### Details\n\nGet the number of worker threads used by the current node for chunk recovery. It can only be executed on the data node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn integer scalar.\n\n#### Examples\n\n```\nresetRecoveryWorkerNum(2)\ngetRecoveryWorkerNum()\n// output: 2\n```\n\nRelated functions: [resetRecoveryWorkerNum](https://docs.dolphindb.com/en/Functions/r/resetRecoveryWorkerNum.html)\n"
    },
    "getRedoLogGCStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRedoLogGCStat.html",
        "signatures": [
            {
                "full": "getRedoLogGCStat()",
                "name": "getRedoLogGCStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getRedoLogGCStat](https://docs.dolphindb.com/en/Functions/g/getRedoLogGCStat.html)\n\n\n\n#### Syntax\n\ngetRedoLogGCStat()\n\n#### Details\n\nGet the status of garbage collection of the redo log.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a table containing the following columns:\n\n* physicalName: physical name of the table in the format of */\\<databaseName>/\\<physicalName>*.\n\n* txnCount: the number of transactions that have not been garbage-collected.\n\n* numOfTxnPendingGC: the number of transactions that can be garbage-collected.\n\n* minTidPendingGC: the minimum tid (transaction ID) of the transactions that can be garbage-collected.\n\n* numOfTxnPendingFlush: the number of transactions that can be flushed to disk from the cache engine.\n\n* minTidPendingFlush: the minimum tid of the transactions that can be flushed to disk from the cache engine.\n\n#### Examples\n\n```\ngetRedoLogGCStat()\n```\n\n| physicalName  | txnCount | numOfTxnPendingGC | minTidPendingGC | numOfTxnPendingFlush | minTidPendingFlush |\n| ------------- | -------- | ----------------- | --------------- | -------------------- | ------------------ |\n| /test/pt\\_2   | 2        | 0                 |                 | 2                    | 1031               |\n| /listdb/pt\\_2 | 1        | 1                 | 1033            | 0                    |                    |\n"
    },
    "getRightStream": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRightStream.html",
        "signatures": [
            {
                "full": "getRightStream(joinEngine)",
                "name": "getRightStream",
                "parameters": [
                    {
                        "full": "joinEngine",
                        "name": "joinEngine"
                    }
                ]
            }
        ],
        "markdown": "### [getRightStream](https://docs.dolphindb.com/en/Functions/g/getRightStream.html)\n\n\n\n#### Syntax\n\ngetRightStream(joinEngine)\n\n#### Details\n\nReturn the schema of the right table of the join engine. The data ingested into this schema will be inserted into *joinEngine*.\n\nThe result of an engine can be directly ingested into the join engine to realize the cascade between engines.\n\nPlease refer to [getLeftStream](https://docs.dolphindb.com/en/Functions/g/getLeftStream.html) for specific examples.\n\n#### Parameters\n\n**joinEngine** is a table object returned by creating a join engine. The join engines currently supported by DolphinDB are:\n\n* createAsofJoinEngine\n\n* createEquiJoinEngine\n\n* createLookupJoinEngine\n\n* createWindowJoinEngine\n\n* createLeftSemiJoinEngine\n\n#### Returns\n\nA table.\n"
    },
    "getRules": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRules.html",
        "signatures": [
            {
                "full": "getRules([engineName])",
                "name": "getRules",
                "parameters": [
                    {
                        "full": "[engineName]",
                        "name": "engineName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getRules](https://docs.dolphindb.com/en/Functions/g/getRules.html)\n\n\n\n#### Syntax\n\ngetRules(\\[engineName])\n\n#### Details\n\nGet the rules of the specified rule engine, including the rule set, checking policy, and callback function.\n\n#### Parameters\n\n**engineName** (optional) is a STRING vector indicating the rule engine name(s). If unspecified, the function returns the rules of all rule engines on the current node.\n\n#### Returns\n\nA dictionary whose key is the engine name and value is another dictionary containing:\n\n* ruleSets: A dictionaryindicating the rule sets of the engine, where:\n  * key: Rule name. Return a default rule set with the key “Default“.\n  * value: Specific rules.\n* policy: The checking policy of the engine.\n* callback: The callback function of the engine. If unspecified, it is an empty string.\n\n#### Examples\n\n```\n// Specify the rule set\nx = [1, 2, NULL]\ny = [ [ < value > 1 > ], [ < price < 2 >, < price > 6 > ], [ < value*price > 10 > ] ]\nruleSets = dict(x, y)\n\n// Create rule engines\nnames = `sym`value`price`quantity\ntypes = [INT, DOUBLE, DOUBLE, DOUBLE]\ndummy = table(1:0, names, types)\noutputNames = `sym`value`price`rule\noutputTypes = [INT, DOUBLE, DOUBLE, BOOL[]]\noutputTable = table(10:0, outputNames, outputTypes)\ntest = createRuleEngine(name=\"ruleEngineTest\", ruleSets=ruleSets, dummyTable=dummy, outputColumns=[\"sym\",\"value\",\"price\"], outputTable=outputTable, policy=\"all\", ruleSetColumn=\"sym\")\ntest2 = createRuleEngine(name=\"ruleEngineTest2\", ruleSets=ruleSets, dummyTable=dummy, outputColumns=[\"sym\",\"value\",\"price\"], outputTable=outputTable, policy=\"all\", ruleSetColumn=\"sym\")\n\n// Query the rules of the specified engine\ngetRules([\"ruleEngineTest\"])\n/*\nruleEngineTest->\n    ruleSets->\n        Default->(value * price > 10)\n        1->(value > 1)\n        2->(price < 2, price > 6)\n\n    policy->all\n    callback->\n*/\n\n// Update the rules of the specified engine\nupdateRule(\"ruleEngineTest\", 1, [<value > 2>])\n\n// Query the rules again after update\ngetRules()\n/*\nruleEngineTest->\n    ruleSets->\n        Default->(value * price > 10)\n        1->(value > 2)\n        2->(price < 2, price > 6)\n\n    policy->all\n    callback->\n*/\n```\n\nRelated functions: [createRuleEngine](https://docs.dolphindb.com/en/Functions/c/createRuleEngine.html), [updateRule](https://docs.dolphindb.com/en/Functions/u/updateRule.html), and [deleteRule](https://docs.dolphindb.com/en/Functions/d/deleteRule.html).\n"
    },
    "getRunningQueries": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getRunningQueries.html",
        "signatures": [
            {
                "full": "getRunningQueries()",
                "name": "getRunningQueries",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getRunningQueries](https://docs.dolphindb.com/en/Functions/g/getRunningQueries.html)\n\n\n\n#### Syntax\n\ngetRunningQueries()\n\n#### Details\n\nReturn descriptive information about the SQL queries that are being executed on the local node.\n\nTo use this function, we must set *perfMonitoring*=1 in the configuration file to enable performance monitoring.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table with the following columns:\n\n| Name      | Meaning                                                                                                                                              |\n| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |\n| userID    | the user ID                                                                                                                                          |\n| sessionID | the session ID                                                                                                                                       |\n| jobID     | the job ID                                                                                                                                           |\n| rootID    | the root job ID                                                                                                                                      |\n| level     | the level of jobs. The root job starts from level 0, the tasks broken down from the root job are marked as level 1, and subtasks level 2, and so on. |\n| startTime | the start time of a query (of NANOTIMESTAMP type)                                                                                                    |\n| endTime   | the end time of a query (of NANOTIMESTAMP type)                                                                                                      |\n| jobDesc   | the job description                                                                                                                                  |\n| errorMsg  | error messages                                                                                                                                       |\n| remoteIP  | the IP address of the client that initiates a query                                                                                                  |\n\n#### Examples\n\n```\ngetRunningQueries();\n```\n\n| userID | sessionID | jobID                                | rootID                               | level | startTime                     | endTime | jobDesc                           | errorMsg | remoteIP      |\n| ------ | --------- | ------------------------------------ | ------------------------------------ | ----- | ----------------------------- | ------- | --------------------------------- | -------- | ------------- |\n| admin  | 738481026 | 88e738a8-a749-4dcb-9cfe-740df2d9ce7d | 88e738a8-a749-4dcb-9cfe-740df2d9ce7d | 0     | 2019.02.07T19:02:26.809905612 |         | select count(\\*) as count from pt |          | 192.168.1.106 |\n"
    },
    "getScheduledJobs": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getScheduledJobs.html",
        "signatures": [
            {
                "full": "getScheduledJobs([jobIdPattern])",
                "name": "getScheduledJobs",
                "parameters": [
                    {
                        "full": "[jobIdPattern]",
                        "name": "jobIdPattern",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getScheduledJobs](https://docs.dolphindb.com/en/Functions/g/getScheduledJobs.html)\n\n\n\n#### Syntax\n\ngetScheduledJobs(\\[jobIdPattern])\n\n#### Details\n\nReturn a table of scheduled jobs. If *jobIdPattern* is not specified, return all scheduled jobs.\n\n#### Parameters\n\n**jobIdPattern** is a string indicating a job ID or a pattern of job ID. It supports wildcard characters (% and ?).\n\n#### Returns\n\nIt returns a table with the following columns:\n\n| Name          | Meaning                                                                         |\n| ------------- | ------------------------------------------------------------------------------- |\n| userId        | the user ID                                                                     |\n| jobId         | the job ID                                                                      |\n| jobDesc       | the job description                                                             |\n| startDate     | the start date of the scheduled job (of DATE type)                              |\n| endDate       | the end date of the scheduled job (of DATE type)                                |\n| frequency     | the frequency to execute the scheduled job                                      |\n| scheduledTime | the specified time to execute each job (of MINUTE type)                         |\n| days          | the specified days to execute the scheduled job when *frequency* is 'W' or 'M'. |\n\n#### Examples\n\n```\ngetScheduledJobs();\n```\n\n| userId | jobId   | jobDesc     | startDate  | endDate    | frequency | scheduleTime | days |\n| ------ | ------- | ----------- | ---------- | ---------- | --------- | ------------ | ---- |\n| root   | monthly | Monthly Job | 2018.01.01 | 2018.12.31 | M         | 17:00m       | 1    |\n| root   | weekly  | Weekly Job  | 2018.01.01 | 2018.12.31 | W         | 17:30m       | 2    |\n| root   | daily   | Daily Job   | 2018.01.01 | 2018.12.31 | D         | 18:00m       |      |\n"
    },
    "getSchemaByCatalog": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSchemaByCatalog.html",
        "signatures": [
            {
                "full": "getSchemaByCatalog(catalog)",
                "name": "getSchemaByCatalog",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    }
                ]
            }
        ],
        "markdown": "### [getSchemaByCatalog](https://docs.dolphindb.com/en/Functions/g/getSchemaByCatalog.html)\n\n#### Syntax\n\ngetSchemaByCatalog(catalog)\n\n#### Details\n\nGet schemas within a catalog.\n\n#### Parameters\n\n**catalog**is a string specifying the catalog name.\n\n#### Returns\n\nA table containing the schema name and dbUrl.\n\n#### Examples\n\n```\ngetSchemasByCatalog(\"catalog1\")\n```\n\n| schema  | dbUrl      |\n| ------- | ---------- |\n| schema1 | dfs\\://db1 |\n| schema2 | dfs\\://db2 |\n\n"
    },
    "getSchemasByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSchemasByCluster.html",
        "signatures": [
            {
                "full": "getSchemasByCluster(clusterName, catalogName)",
                "name": "getSchemasByCluster",
                "parameters": [
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    },
                    {
                        "full": "catalogName",
                        "name": "catalogName"
                    }
                ]
            }
        ],
        "markdown": "### [getSchemasByCluster](https://docs.dolphindb.com/en/Functions/g/getSchemasByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetSchemasByCluster(clusterName, catalogName)\n\n#### Details\n\nReturn all schemas under the specified catalog in the cluster. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**clusterName** is a STRING scalar indicating the name of the cluster.\n\n**catalogName** is a STRING scalar indicating the name of the catalog.\n\n#### Returns\n\nA table with the following columns:\n\n* schema: A string indicating the name of the schema.\n* dbUrl: A string indicating the path of the database.\n\n#### Examples\n\n```\n// MoMSender cluster: \ndatabase(directory=\"dfs://db1\", partitionType=RANGE, partitionScheme=0 5 10)\ndatabase(directory=\"dfs://db2\", partitionType=RANGE, partitionScheme=0 5 10)\ncreateSchema(\"catalog1\", \"dfs://db1\", \"schema1\")\ncreateSchema(\"catalog1\", \"dfs://db2\", \"schema2\")\n\n// MOM cluster: \ngetSchemasByCluster(\"MoMSender\", \"catalog1\")\n```\n\n| schema  | dbUrl      |\n| ------- | ---------- |\n| schema1 | dfs\\://db1 |\n| schema2 | dfs\\://db2 |\n"
    },
    "getSessionExpiredTime": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getsessionexpiredtime.html",
        "signatures": [
            {
                "full": "getSessionExpiredTime()",
                "name": "getSessionExpiredTime",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getSessionExpiredTime](https://docs.dolphindb.com/en/Functions/g/getsessionexpiredtime.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetSessionExpiredTime()\n\n#### Details\n\nCheck the session duration when strict security policy is enabled (see configuration parameter *strictSecurityPolicy*).\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA null value or DURATION scalar.\n\n#### Examples\n\n```\ngetSessionExpiredTime() // output: 1H\n```\n"
    },
    "getSessionMemoryStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSessionMemoryStat.html",
        "signatures": [
            {
                "full": "getSessionMemoryStat()",
                "name": "getSessionMemoryStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getSessionMemoryStat](https://docs.dolphindb.com/en/Functions/g/getSessionMemoryStat.html)\n\n\n\n#### Syntax\n\ngetSessionMemoryStat()\n\n#### Details\n\nReturn information about memory usage of all sessions on the current node.\n\nThe cache type can be:\n\n| Cache Types                   | Description                                                        |\n| ----------------------------- | ------------------------------------------------------------------ |\n| \\_\\_DimensionalTable\\_\\_      | the cache of dimension tables (in bytes)                           |\n| \\_\\_SharedTable\\_\\_           | the cache of shared tables (in bytes)                              |\n| \\_\\_OLAPTablet\\_\\_            | the cache of the OLAP databases (in bytes)                         |\n| \\_\\_OLAPCacheEngine\\_\\_       | the memory usage of OLAP cache engine (in bytes)                   |\n| \\_\\_OLAPCachedSymbolBase\\_\\_  | the cache of SYMBOL base in OLAP engine (in bytes)                 |\n| \\_\\_DFSMetadata\\_\\_           | the memory usage of DFS metadata in distributed storage (in bytes) |\n| \\_\\_TSDBCacheEngine\\_\\_       | the cache of the TSDB engine (in bytes)                            |\n| \\_\\_TSDBLevelFileIndex\\_\\_    | the cache of level file index in the TSDB engine (in bytes)        |\n| \\_\\_TSDBCachedSymbolBase\\_\\_  | the cache of SYMBOL base in TSDB engine (in bytes)                 |\n| \\_\\_PKEYCachedSymbolBase\\_\\_  | the cache of SYMBOL base in PKEY engine (in bytes)                 |\n| \\_\\_PKEYCacheEngine\\_\\_       | the memory usage of PKEY cache engine (in bytes)                   |\n| \\_\\_StreamingPubQueue\\_\\_     | the unprocessed messages in a publisher queue                      |\n| \\_\\_StreamingSubQueue\\_\\_     | the unprocessed messages in a subscriber queue                     |\n| \\_\\_IOTDBStaticTableCache\\_\\_ | the static table (in bytes)                                        |\n| \\_\\_IOTDBLatestKeyCache\\_\\_   | the latest value table (in bytes)                                  |\n\nNote:\n\n* This function does not return the memory occupied by tasks being executed in the session.\n\n* For the columns *createTime* and *lastActiveTime* in the result table, versions before 1.30.21.4/2.00.9.4 return GMT time. From version 1.30.21.4/2.00.9.4 onwards, these columns return time in your current time zone.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* userId: the user ID or the cache type (in the format of \\_\\_xxx\\_\\_).\n\n* sessionId: the session ID.\n\n* memSize: memory usage of all sessions (in Bytes).\n\n* remoteIP: the IP address of the client that initiates the session.\n\n* remotePort: the port number of the client that initiates the session.\n\n* createTime: the creation time (of TIMESTAMP data type) of session.\n\n* lastActiveTime: last timestamp of the execution.\n\n#### Examples\n\n```\nt = getSessionMemoryStat();\nt;\n```\n\n| userId                       | sessionId  | memSize | remoteIP     | remotePort | createTime              | lastActiveTime          |\n| ---------------------------- | ---------- | ------- | ------------ | ---------- | ----------------------- | ----------------------- |\n| \\_\\_DimensionalTable\\_\\_     |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_SharedTable\\_\\_          |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_OLAPTablet\\_\\_           |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_OLAPCacheEngine\\_\\_      |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_OLAPCachedSymbolBase\\_\\_ |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_DFSMetadata\\_\\_          |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_TSDBCacheEngine\\_\\_      |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_TSDBLevelFileIndex\\_\\_   |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_TSDBCachedSymbolBase\\_\\_ |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_PKEYCachedSymbolBase\\_\\_ |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_PKEYCacheEngine\\_\\_      |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_StreamingPubQueue\\_\\_    |            | 0       | 0.0.0.0      |            |                         |                         |\n| \\_\\_StreamingSubQueue\\_\\_    |            | 0       | 0.0.0.0      |            |                         |                         |\n| admin                        | 2882591513 | 1416    | 60.176.105.0 | 20861      | 2023.02.15T02:15:22.384 | 2023.02.15T02:24:16.307 |\n"
    },
    "getSlaveReplicationExecutionStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getslavereplicationexecutionstatus.html",
        "signatures": [
            {
                "full": "getSlaveReplicationExecutionStatus()",
                "name": "getSlaveReplicationExecutionStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getSlaveReplicationExecutionStatus](https://docs.dolphindb.com/en/Functions/g/getslavereplicationexecutionstatus.html)\n\n\n\n#### Syntax\n\ngetSlaveReplicationExecutionStatus()\n\n#### Details\n\nThis function can only be executed by an administrator on a datanode of a slave cluster. It displays the status of the execution queues for each thread on the data node.\n\nThis function returns a table containing the following columns:\n\n* executionSet: the execution set ID to which the task belongs.\n* worker: ID of thread executing the task.\n* taskId: ID of the asynchronous replication task.\n* state: the task status, including TRANSMITTED (data transmission complete, waiting for execution) and EXECUTING.\n\n#### Returns\n\nReturn a table containing the following columns:\n\n* executionSet: the execution set ID to which the task belongs.\n* worker: ID of thread executing the task.\n* taskId: ID of the asynchronous replication task.\n* state: the task status, including TRANSMITTED (data transmission complete, waiting for execution) and EXECUTING.\n\n#### Examples\n\n```\ngetSlaveReplicationExecutionStatus()\n```\n\n| executionSet | worker | taskId | state     |\n| ------------ | ------ | ------ | --------- |\n| 0            | 3      | 25     | EXECUTING |\n"
    },
    "getSlaveReplicationQueueStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSlaveReplicationQueueStatus.html",
        "signatures": [
            {
                "full": "getSlaveReplicationQueueStatus()",
                "name": "getSlaveReplicationQueueStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getSlaveReplicationQueueStatus](https://docs.dolphindb.com/en/Functions/g/getSlaveReplicationQueueStatus.html)\n\n#### Syntax\n\ngetSlaveReplicationQueueStatus()\n\n#### Details\n\nThe function obtains the status of each execution queue in the slave cluster of asynchronous replication.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* executionSet: the execution set ID to which the task belongs.\n\n* queueId: ID of the execution queue to which the replication task belongs.\n\n* unfinishedTasks: the number of unfinished tasks in the queue.\n\n* executionGroupId: ID of the group to which the running replication task belongs.\n\n* executionNode: the data node where the task is executed.\n\n* executionTime: the time spent by the current group executing replication tasks.\n\n* status: the task status, including EXECUTING, FINISHED, STOPPED and FAILED.\n\n#### Examples\n\n```\ngetSlaveReplicationQueueStatus()\n```\n\n| queueId | unfinishedTasks | executionGroupId | executionNode | executionTime | status   |\n| :------ | :-------------- | :--------------- | :------------ | :------------ | :------- |\n| 0       | 0               | -1               | dnode1        | 00:00:00.000  | FINISHED |\n| 1       | 0               | -1               | dnode2        | 00:00:00.000  | FINISHED |\n\nRelated functions: [getSlaveReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getSlaveReplicationStatus.html), [getMasterReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getMasterReplicationStatus.html)\n\n"
    },
    "getSlaveReplicationStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSlaveReplicationStatus.html",
        "signatures": [
            {
                "full": "getSlaveReplicationStatus([limit=-1])",
                "name": "getSlaveReplicationStatus",
                "parameters": [
                    {
                        "full": "[limit=-1]",
                        "name": "limit",
                        "optional": true,
                        "default": "-1"
                    }
                ]
            }
        ],
        "markdown": "### [getSlaveReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getSlaveReplicationStatus.html)\n\n#### Syntax\n\ngetSlaveReplicationStatus(\\[limit=-1])\n\n#### Details\n\nThis function displays the cluster replication task status in the slave cluster. It can only be executed by an administrator on the controller of a slave cluster. If *slaveReplicationDBScope* is configured, the function only returns replication status for the specified databases. Finished tasks are listed first, followed by unfinished tasks.\n\nThe function returns:\n\n* All tasks if *limit* is not specified\n* Up to *limit* tasks (including both completed and pending) if specified\n* Maximum of 10,000 most recent completed tasks\n* Pending tasks starting from the earliest timestamp until reaching the specified limit\n\n#### Parameters\n\n**limit** (optional) is an integer that specifies the maximum tasks that can be returned in the result. The default value is -1, meaning no limit is placed.\n\n#### Returns\n\n**Return value:** A table where finished tasks are listed first, then followed by unfinished tasks. The function returns:\n\n* All tasks if *limit* is not specified\n* Up to *limit* tasks (including both completed and pending) if specified\n* Maximum of 10,000 most recent completed tasks\n* Pending tasks starting from the earliest timestamp until reaching the specified limit\n\nReturn columns:\n\n* taskId: ID of asynchronous replication task.\n* masterTid: transaction ID in the master cluster.\n* groupId: ID of the group to which the asynchronous replication task belongs.\n* executionSet: ID of the execution set to which the replication task belongs.\n* queueId: ID of the execution queue to which the replication task belongs.\n* operationType: operation type of the replication task.\n* createTime: the time (of NANOTIMESTAMP type) when the slave cluster receives the task from the master cluster.\n* dbName: the database name where the task is executed.\n* tableName: the table name where the task is executed.\n* srcIP: IP of the data node where data of write tasks is stored.\n* srcPort: port of the data node where data of write tasks is stored.\n* finishTime: the time (of NANOTIMESTAMP type) when the task is finished.\n* executionNode: the data node where the task is executed.\n* state: the task state, including WAITING, EXECUTING, FINISH, and FAILED.\n* details: If state = FAILED, returns the failure cause; If state = FINISH, provides additional description on the task.\n\n#### Examples\n\n```\ngetSlaveReplicationStatus();\n```\n\n| taskId | masterTid | groupId | executionSet | queueId | operationType              | createTime                    | dbName                          | tableName | srcIP     | srcPort | finishTime                    | executionNode | state  | details |\n| ------ | --------- | ------- | ------------ | ------- | -------------------------- | ----------------------------- | ------------------------------- | --------- | --------- | ------- | ----------------------------- | ------------- | ------ | ------- |\n| 1      | 1         | 1       | 0            | 0       | CREATE\\_DOMAIN             | 2022.11.08T10:50:37.425056956 | db://test\\_dropPartition\\_value |           | localhost | 8002    | 2022.11.08T10:50:37.452792885 | NODE2         | FINISH |         |\n| 2      | 2         | 2       | 0            | 1       | CREATE\\_PARTITIONED\\_TABLE | 2022.11.08T10:50:37.425056988 | db://test\\_dropPartition\\_value | pt        | localhost | 8002    | 2022.11.08T10:50:37.479906033 | NODE3         | FINISH |         |\n| 3      | 3         | 3       | 0            | 2       | APPEND                     | 2022.11.08T10:50:37.425057012 | db://test\\_dropPartition\\_value | pt        | localhost | 8002    | 2022.11.08T10:50:37.638746819 | NODE1         | FINISH |         |\n| 4      | 4         | 4       | 0            | 3       | DROP\\_PARTITION            | 2022.11.08T10:50:37.425057037 |                                 | pt        | localhost | 8002    | 2022.11.08T10:50:37.869783336 | NODE2         | FINISH |         |\n\nRelated functions: [getMasterReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getMasterReplicationStatus.html)\n\n"
    },
    "getSnapshotMsgId": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSnapshotMsgId.html",
        "signatures": [
            {
                "full": "getSnapshotMsgId(engine)",
                "name": "getSnapshotMsgId",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    }
                ]
            }
        ],
        "markdown": "### [getSnapshotMsgId](https://docs.dolphindb.com/en/Functions/g/getSnapshotMsgId.html)\n\n\n\n#### Syntax\n\ngetSnapshotMsgId(engine)\n\n#### Details\n\nGet the message ID (msgId) of the last snapshot of the specified streaming engine when resubscibing after an interruption of subscription. If snapshot is enabled, during resubscription the parameter *offset* of function [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html) is set to `getSnapshotMsgId(engine)+1`. The streaming engine will load the snapshot and start to subcribe from the next message after `getSnapshotMsgId(engine)`.\n\n#### Parameters\n\n**engine** is a built-in streaming engine, i.e., the abstract table object return by functions such as [createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html).\n\n#### Returns\n\nAn integer scalar.\n"
    },
    "getSparseReactiveMetrics": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSparseReactiveMetrics.html",
        "signatures": [
            {
                "full": "getSparseReactiveMetrics(name)",
                "name": "getSparseReactiveMetrics",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/g/getSparseReactiveMetrics.html)\n\n\n\n#### Syntax\n\ngetSparseReactiveMetrics(name)\n\n#### Details\n\nRetrieves the currently configured sparse state computation rules table of the specified SparseReactiveStateEngine.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the SparseReactiveStateEngine.\n\n#### Returns\n\nReturns a table (the metrics table) with columns `keyColumn(s), formula, outputMetricKey`, representing the existing rules of the engine.\n\n#### Examples\n\n```\ngetSparseReactiveMetrics(\"demoengine\")\n```\n\n| deviceID | formula                     | outputMetricKey |\n| -------- | --------------------------- | --------------- |\n| A001     | mavg(value,3)               | A001\\_1         |\n| A002     | mmax(value,3)-mmin(value,3) | A002\\_1         |\n| A002     | msum(value,3)               | A002\\_2         |\n\n**Related functions**: [createSparseReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createSparseReactiveStateEngine.html), [addSparseReactiveMetrics](https://docs.dolphindb.com/en/Functions/a/addSparseReactiveMetrics.html), [deleteSparseReactiveMetric](https://docs.dolphindb.com/en/Functions/d/deleteSparseReactiveMetric.html)\n"
    },
    "getStreamEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamEngine.html",
        "signatures": [
            {
                "full": "getStreamEngine(name)",
                "name": "getStreamEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamEngine](https://docs.dolphindb.com/en/Functions/g/getStreamEngine.html)\n\n\n\n#### Syntax\n\ngetStreamEngine(name)\n\n#### Parameters\n\n**name** is a string indicating the name of the stream engine. It is the only identifier of the stream engine. It can have letter, number and \"\\_\". It must start with a letter.\n\n#### Details\n\nReturn the handle of a stream engine. It can be used as the handler of [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html).\n\n#### Examples\n\n```\nshare streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT]) as trades\noutputTable = table(10000:0, `time`sym`sumQty, [TIMESTAMP, SYMBOL, INT])\ntradesAggregator = createTimeSeriesEngine(\"StreamAggregatorDemo\",3, 3, <[sum(qty)]>, trades, outputTable, `time, false,`sym, 50)\nsubscribeTable(, \"trades\", \"tradesAggregator\", 0, append!{tradesAggregator}, true)\n\ndef writeData(n){\n   timev = 2018.10.08T01:01:01.001 + timestamp(1..n)\n   symv =take(`A`B, n)\n   qtyv = take(1, n)\n   insert into trades values(timev, symv, qtyv)\n}\n\nwriteData(6);\nh = getStreamEngine(\"StreamAggregatorDemo\")\n```\n"
    },
    "getStreamEngineList": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamEngineList.html",
        "signatures": [
            {
                "full": "getStreamEngineList()",
                "name": "getStreamEngineList",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getStreamEngineList](https://docs.dolphindb.com/en/Functions/g/getStreamEngineList.html)\n\n\n\n#### Syntax\n\ngetStreamEngineList()\n\n#### Details\n\nGet information about all streaming engines on the current node.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nReturn a table with the following columns:\n\n* engineType: the type of the engine.\n* engineName: the name of the engine.\n* user: the engine creator.\n\n#### Examples\n\nIf the current node contains three engines - one time-series engine and one window join engine created by admin, and one reactive state engine created by user1 - `getStreamEngineList` will return info of all three engines as follows.\n\n```\ngetStreamEngineList()\n```\n\n| engineType           | engineName   | user  |\n| -------------------- | ------------ | ----- |\n| ReactiveStreamEngine | reactiveDemo | user1 |\n| WindowJoinEngine     | test1        | admin |\n| TimeSeriesEngine     | engine1      | admin |\n"
    },
    "getStreamEngineStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html",
        "signatures": [
            {
                "full": "getStreamEngineStat()",
                "name": "getStreamEngineStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getStreamEngineStat](https://docs.dolphindb.com/en/Functions/g/getStreamEngineStat.html)\n\n\n\n#### Syntax\n\ngetStreamEngineStat()\n\nAlias: getAggregatorStat\n\n#### Details\n\nGet the status of the stream engine.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a dictionary of tables with various metrics about all stream engines.\n\n* Table *TimeSeriesEngine* returns the following columns about time-series engines:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | windowTime        | the length of the data window                                                  |\n  | step              | the duration between 2 adjacent windows                                        |\n  | useSystemTime     | the value of parameter useSystemTime in function createTimeSeriesEngine        |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | numGroups         | the number of groups that the stream engine has handled                        |\n  | numRows           | the number of records that has entered the stream engine                       |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | memoryUsed        | the amount of memory used                                                      |\n  | snapshotDir       | the directory to save engine snapshot                                          |\n  | snapshotInterval  | the interval to save snapshot                                                  |\n  | snapshotMsgId     | the msgId of engine snapshot                                                   |\n  | snapshotTimestamp | the timestamp of snapshot                                                      |\n\n* Table *CrossSectionalEngine* returns the following columns about cross-sectional engines:\n\n  | Column Name        | Description                                                                  |\n  | ------------------ | ---------------------------------------------------------------------------- |\n  | name               | name of the stream engine                                                    |\n  | user               | name of the user who created the stream engine                               |\n  | status             | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg         | the latest error message                                                     |\n  | numRows            | the number of records that has entered the stream engine                     |\n  | numMetrics         | the number of metrics calculated by the stream engine                        |\n  | metrics            | the metacode of the metrics calculated by the stream engine                  |\n  | triggeringPattern  | how calculations are triggered                                               |\n  | triggeringInterval | the duration in milliseconds between 2 adjacent calculations                 |\n  | memoryUsed         | the amount of memory used                                                    |\n\n* Table *AnomalyDetectionEngine* returns the following columns about the anomaly detection engines:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | numGroups         | the number of groups that the stream engine has handled                        |\n  | numRows           | the number of records that has entered the stream engine                       |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | snapshotDir       | the directory to save engine snapshot                                          |\n  | snapshotInterval  | the interval to save snapshot                                                  |\n  | snapshotMsgId     | the msgId of engine snapshot                                                   |\n  | snapshotTimestamp | the timestamp of snapshot                                                      |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | memoryUsed        | the amount of memory used                                                      |\n\n* Table *ReactiveStreamEngine* returns the following columns about the reactive state engines:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the reactive state engine                                            |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | metrics           | the metacode of the metrics calculated by the stream engine                  |\n  | snapshotDir       | the directory to save engine snapshot                                        |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the msgId of engine snapshot                                                 |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *SessionWindowEngine* returns the following columns about the session window engine:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                    |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | memoryUsed        | the amount of memory used                                                    |\n  | snapshotDir       | the directory to save snapshot                                               |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                    |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *DailyTimeSeriesEngine* returns the following columns about the daily time series engine:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | windowTime        | the length of the window                                                       |\n  | step              | the duration between 2 adjacent windows                                        |\n  | useSystemTime     | the value of parameter useSystemTime in function createDailyTimeSeriesEngine   |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | numGroups         | the number of groups that the stream engine has handled                        |\n  | numRows           | the number of records that has entered the stream engine                       |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | memoryUsed        | the amount of memory used                                                      |\n  | snapshotDir       | the directory to save snapshot                                                 |\n  | snapshotInterval  | the interval to save snapshot                                                  |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                      |\n  | snapshotTimestamp | the timestamp of snapshot                                                      |\n\n* Table *AsofJoinEngine* returns the following columns about the as of join engine:\n\n  | Column Name       | Description                                                                    |\n  | ----------------- | ------------------------------------------------------------------------------ |\n  | name              | name of the stream engine                                                      |\n  | user              | name of the user who created the stream engine                                 |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable   |\n  | lastErrMsg        | the latest error message                                                       |\n  | useSystemTime     | the value of parameter useSystemTime in function createAsofJoinEngine          |\n  | delayedTime       | the value of parameter delayedTime in function createAsofJoinEngine            |\n  | garbageSize       | the threshold of the number of records in memory that triggers memory cleaning |\n  | leftTableNumRows  | the number of records in the left table of stream engine                       |\n  | rightTableNumRows | the number of records in the right table of stream engine                      |\n  | numMetrics        | the number of metrics calculated by the stream engine                          |\n  | metrics           | the metacode of the metrics calculated by the stream engine                    |\n  | memoryUsed        | the amount of memory used                                                      |\n\n* Table *EquiJoinEngine* returns the following columns about the equi join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n\n* Table *WindowJoinEngine* returns the following columns about the window join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n  | numGroups         | the number of groups                                                                |\n\n* Table *LookupJoinEngine* returns the following columns about the lookup join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n\n* Table *LeftSemiJoinEngine* returns the following columns about the left semi join engine:\n\n  | Column Name       | Description                                                                         |\n  | ----------------- | ----------------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                           |\n  | user              | name of the user who created the stream engine                                      |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable        |\n  | lastErrMsg        | the latest error message                                                            |\n  | garbageSize       | whether the stream engine is triggered as soon as data are ingested into the system |\n  | leftTableNumRows  | the number of records that has entered the left table of the stream engine          |\n  | rightTableNumRows | the number of records that has entered the right table of the stream engine         |\n  | numMetrics        | the number of metrics calculated by the stream engine                               |\n  | metrics           | the metacode of the metrics calculated by the stream engine                         |\n  | memoryUsed        | the amount of memory used                                                           |\n\n* Table *SnapshotJoinEngine* returns the following columns about snapshot join engines:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the stream engine                                                    |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | leftTableNumRows  | the number of records in the left table of stream engine                     |\n  | rightTableNumRows | the number of records in the right table of stream engine                    |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | metrics           | the metacode of the metrics calculated by the stream engine                  |\n  | memoryUsed        | the amount of memory used                                                    |\n\n* Table *DualOwnershipReactiveStreamEngine* returns the following columns about the dual ownership reactive state engine:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the engine                                                           |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | memoryUsed        | the amount of memory used                                                    |\n  | snapshotDir       | the directory to save snapshot                                               |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                    |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *NarrowReactiveStreamEngine* returns the following columns about the narrow reactive state engine:\n\n  | Column Name       | Description                                                                  |\n  | ----------------- | ---------------------------------------------------------------------------- |\n  | name              | name of the engine                                                           |\n  | user              | name of the user who created the stream engine                               |\n  | status            | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg        | the latest error message                                                     |\n  | numGroups         | the number of groups that the stream engine has handled                      |\n  | numRows           | the number of records that has entered the stream engine                     |\n  | numMetrics        | the number of metrics calculated by the stream engine                        |\n  | memoryUsed        | the amount of memory used                                                    |\n  | snapshotDir       | the directory to save snapshot                                               |\n  | snapshotInterval  | the interval to save snapshot                                                |\n  | snapshotMsgId     | the message ID (msgId) of engine snapshot                                    |\n  | snapshotTimestamp | the timestamp of snapshot                                                    |\n\n* Table *StreamFilter* returns the following columns about stream filter:\n\n  | Column Name | Description                                                                  |\n  | ----------- | ---------------------------------------------------------------------------- |\n  | name        | name of the stream engine                                                    |\n  | user        | name of the user who created the stream engine                               |\n  | status      | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg  | the latest error message                                                     |\n  | numRows     | the number of records that has entered the stream engine                     |\n  | filters     | the filtering condition                                                      |\n\n* Table *StreamDispatchEngine* returns the following columns about stream dispatch engines:\n\n  | Column Name | Description                                                                  |\n  | ----------- | ---------------------------------------------------------------------------- |\n  | name        | name of the stream engine                                                    |\n  | user        | name of the user who created the stream engine                               |\n  | status      | status of the stream engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg  | the latest error message                                                     |\n  | numRows     | the number of records that has entered the stream engine                     |\n  | memoryUsed  | the amount of memory used                                                    |\n\n* Table *TimeBucketEngine* returns the following columns about time bucket engines:\n\n  | Column Name | Description                                                                       |\n  | ----------- | --------------------------------------------------------------------------------- |\n  | name        | name of the time bucket engine                                                    |\n  | user        | name of the user who created the time bucket engine                               |\n  | status      | status of the time bucket engine. \"OK\" means available; \"FATAL\" means unavailable |\n  | lastErrMsg  | the latest error message                                                          |\n  | numGroups   | the number of groups that the time bucket engine has handled                      |\n  | numRows     | the number of records that has entered the time bucket engine                     |\n  | numMetrics  | the number of metrics calculated by the time bucket engine                        |\n  | metrics     | the metacode of the metrics calculated by the time bucket engine                  |\n  | memoryUsed  | the amount of memory used                                                         |\n\n#### Examples\n\n```\nshare streamTable(10:0,`time`sym`price`qty,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades\noutputTable1 = table(10000:0, `time`sym`sumQty, [TIMESTAMP, SYMBOL, INT])\noutputTable2 = table(1:0, `time`avgPrice`sumqty`Total, [TIMESTAMP,DOUBLE,INT,DOUBLE])\ntradesTsEngine = createTimeSeriesEngine(name=\"TimeSeriesDemo\", windowSize=3, step=3, metrics=<[sum(qty)]>, dummyTable=trades, outputTable=outputTable1, timeColumn=`time, keyColumn=`sym, garbageSize=50)\ntradesCsEngine=createCrossSectionalEngine(name=\"CrossSectionalDemo\", metrics=<[avg(price), sum(qty), sum(price*qty)]>, dummyTable=trades, outputTable=outputTable2, keyColumn=`sym, triggeringPattern=`perRow)\nsubscribeTable(tableName=\"trades\", actionName=\"tradesTsEngine\", offset=0, handler=append!{tradesTsEngine}, msgAsTable=true)\nsubscribeTable(tableName=\"trades\", actionName=\"tradesCsEngine\", offset=0, handler=append!{tradesCsEngine}, msgAsTable=true)\n\ndef writeData(n){\n   timev = 2000.10.08T01:01:01.001 + timestamp(1..n)\n   symv =take(`A`B, n)\n   pricev=take(102.1 33.4 73.6 223,n)\n   qtyv = take(60 74 82 59, n)\n   insert into trades values(timev, symv, pricev,qtyv)\n}\n\nwriteData(4);\n\ngetStreamEngineStat().TimeSeriesEngine;\ngetStreamEngineStat().CrossSectionalEngine;\n```\n"
    },
    "getStreamGraph": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamGraph.html",
        "signatures": [
            {
                "full": "getStreamGraph(name)",
                "name": "getStreamGraph",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamGraph](https://docs.dolphindb.com/en/Functions/g/getStreamGraph.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetStreamGraph(name)\n\n#### Details\n\nRetrieves a previously submitted stream graph.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA StreamGraph object.\n\n#### Examples\n\n```\ng = getStreamGraph(\"demo.orca_graph.indicators\")\ng;\n// output: '<Instance of Class '::StreamGraph'>'\n```\n"
    },
    "getStreamGraphInfo": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamGraphInfo.html",
        "signatures": [
            {
                "full": "getStreamGraphInfo([name])",
                "name": "getStreamGraphInfo",
                "parameters": [
                    {
                        "full": "[name]",
                        "name": "name",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getStreamGraphInfo](https://docs.dolphindb.com/en/Functions/g/getStreamGraphInfo.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetStreamGraphInfo(\\[name])\n\n#### Details\n\nReturn the metadata of the specified streaming graph.\n\nIf *name* is not specified, the function returns the metadata of all streaming graphs.\n\n#### Parameters\n\n**name** (optional) is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA table containing the following fields:\n\n* **id:** Streaming graph ID.\n* **fqn:** Fully qualified name of the streaming graph.\n* **graph:** The structure of the streaming graph in JSON format, including:\n  * **version:** Version number of the graph structure, used to prevent compatibility issues caused by version upgrades.\n  * **nodes:** Nodes in the graph, each containing:\n    * **id:** Node ID.\n    * **subgraphId:** Subgraph ID the node belongs to.\n    * **taskid:** Streaming task ID.\n    * **parallelism:**\n      * **keyName:** The column name used for partitioning parallel tasks.\n      * **count:** Number of parallel tasks.\n    * **properties:** Node properties.\n    * **inEdges:** List of incoming edge IDs.\n    * **outEdges:** List of outgoing edge IDs.\n  * **edges:** Edges in the graph, each containing:\n    * **id:** Edge ID.\n    * **inNodeId:** ID of the upstream node.\n    * **outNodeId:** ID of the downstream node.\n    * **partitionType:**\n      * **FORWARD:** Directly send upstream data to downstream.\n      * **NESTED:** Distribute upstream data to downstream according to the nested relationship of parallelism.\n      * **SHUFFLE:** Recombine upstream data into a single set and distribute to downstream based on parallelism.\n    * **filter:** Filter condition on the edge.\n    * **handlers:** List of functions to process upstream data; these functions will be merged into the `handler` parameter of `subscribeTable`.\n  * **config:** Global configuration of the streaming graph.\n* **meta:** Scheduling metadata of the streaming graph in JSON format, including:\n  * **id:** Streaming graph ID.\n  * **status:** Running status of the streaming graph:\n    * **building:** Graph has been scheduled and is under construction.\n    * **running:** Graph construction completed and running normally.\n    * **error:** Recoverable fault encountered (e.g., node OOM); the system will reschedule the tasks.\n    * **failed:** Unrecoverable fault encountered (e.g., user script error); the system will preserve the scene for later analysis.\n    * **destroying:** Graph is being destroyed.\n    * **destroyed:** Graph has been destroyed.\n  * **semantics:** Consistency semantics, possible values:\n    * **exactly-once:** Exactly-once execution.\n    * **at-least-once:** At-least-once execution.\n  * **tasks:** Scheduling information of streaming tasks.\n  * **createTime:** Creation time.\n  * **reason:** Reason for state transition.\n\n#### Examples\n\n```\ngetStreamGraphInfo(\"streamGraph1\") // name is the name of the streaming graph\ngetStreamGraphInfo(\"catalog1.orca_graph.streamGraph1\") // name is the fully qualified name\n```\n"
    },
    "getStreamGraphMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamGraphMeta.html",
        "signatures": [
            {
                "full": "getStreamGraphMeta([name])",
                "name": "getStreamGraphMeta",
                "parameters": [
                    {
                        "full": "[name]",
                        "name": "name",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getStreamGraphMeta](https://docs.dolphindb.com/en/Functions/g/getStreamGraphMeta.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetStreamGraphMeta(\\[name])\n\n#### Details\n\nReturn the metadata of the specified streaming graph.\n\nIf *name* is not specified, the function returns the metadata of all streaming graphs.\n\n#### Parameters\n\n**name** (optional) is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA table containing the following fields:\n\n* **id:** Streaming graph ID.\n* **fqn:** Fully qualified name of the streaming graph.\n* **status:** Running status of the streaming graph:\n  * **building:** Graph has been scheduled and is under construction.\n  * **running:** Graph construction completed and running normally.\n  * **error:** Recoverable fault encountered (e.g., node OOM); the system will reschedule the tasks.\n  * **failed:** Unrecoverable fault encountered (e.g., user script error); the system will preserve the scene for later analysis.\n  * **destroying:** Graph is being destroyed.\n  * **destroyed:** Graph has been destroyed.\n* **semantics:** Consistency semantics, possible values:\n  * **exactly-once:** Exactly-once execution.\n  * **at-least-once:** At-least-once execution.\n* **checkpointConfig:** Checkpoint-related configuration, which can be modified using the `setCheckpointConfig` interface.\n* **tasks:** Scheduling metadata of the streaming graph, including:\n  * **id:** Task ID.\n  * **node:** Name of the node running the task.\n  * **status:** Execution status of the task.\n  * **reason:** Reason for `error` or `failed`.\n* **createTime:** Creation time.\n* **owner:** Creator of the streaming graph.\n* \\*\\*reason:\\*\\*Reason for state transition.\n\n#### Examples\n\n```\ngetStreamGraphMeta(\"streamGraph1\") // name is the name of the streaming graph\ngetStreamGraphMeta(\"catalog1.orca_graph.streamGraph1\") // name is the fully qualified name\n```\n"
    },
    "getStreamingLeader": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamingLeader.html",
        "signatures": [
            {
                "full": "getStreamingLeader(groupId)",
                "name": "getStreamingLeader",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamingLeader](https://docs.dolphindb.com/en/Functions/g/getStreamingLeader.html)\n\n\n\n#### Syntax\n\ngetStreamingLeader(groupId)\n\n#### Details\n\nGet the node alias of the Leader in a Raft group.\n\n#### Parameters\n\n**groupId** is an integer indicating a Raft group ID\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetStreamingLeader(11);\n// output: DFS_NODE2\n```\n"
    },
    "getStreamingRaftGroups": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamingRaftGroups.html",
        "signatures": [
            {
                "full": "getStreamingRaftGroups()",
                "name": "getStreamingRaftGroups",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getStreamingRaftGroups](https://docs.dolphindb.com/en/Functions/g/getStreamingRaftGroups.html)\n\n\n\n#### Syntax\n\ngetStreamingRaftGroups()\n\n#### Details\n\nGet the information about the Raft group that the local node belongs to.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a table with information about the Raft group that the local node belongs to. The first column is Raft group ID; the second column is information about the data nodes in the Raft group.\n\n#### Examples\n\n```\ngetStreamingRaftGroups();\n```\n\n| id | sites                                                                         |\n| -- | ----------------------------------------------------------------------------- |\n| 12 | 192.168.1.135:18102:NODE1,192.168.1.135:18103:NODE2,192.168.1.135:18104:NODE3 |\n| 11 | 192.168.1.135:18102:NODE1,192.168.1.135:18103:NODE2,192.168.1.135:18105:NODE4 |\n\nUse the following script to get information about all Raft groups in the cluster:\n\n```\nselect id,sites from pnodeRun(getStreamingRaftGroups) where isDuplicated([id,sites],FIRST)=false;\n```\n"
    },
    "getStreamingSQLStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamingSQLStatus.html",
        "signatures": [
            {
                "full": "getStreamingSQLStatus([queryId])",
                "name": "getStreamingSQLStatus",
                "parameters": [
                    {
                        "full": "[queryId]",
                        "name": "queryId",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getStreamingSQLStatus](https://docs.dolphindb.com/en/Functions/g/getStreamingSQLStatus.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ngetStreamingSQLStatus(\\[queryId])\n\n#### Details\n\nGet the status of streaming SQL query.\n\n* If specify the *queryId*, return its status.\n* If not specify, return the status of all streaming SQL queries of the current user. Return streaming SQL queries of all users if called by the admin.\n\n#### Parameters\n\n**queryId** (optional) A STRING scalar representing the ID name for the registered streaming SQL query.\n\n#### Returns\n\nA table containing the following columns:\n\n* queryId: The ID name for the registered streaming SQL query.\n* user: Name of the user who register the query.\n* registerTime: The time of query registration.\n* status: The status of the current query, which can be:\n  * SQL\\_REGISTERED: Registered but not running.\n  * SQL\\_RUNNING: Running normally and results are updated in real time.\n  * SQL\\_STOPPED: Stopped.\n  * INTERNAL\\_ERROR: Error.\n* sqlQuery: The statement of streaming SQL query.\n* involvedTables: Tables involved in the query.\n* lastErrorMessage: The last error message, if any.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\nregisterStreamingSQL(\"select avg(val) from st\",\"sql_avg\") \n\n// Get the status of streaming SQL query\ngetStreamingSQLStatus(\"sql_avg\")\n\n```\n\n| queryId  | user  | registerTime            | status          | sqlQuery                | involvedTables | lastErrorMessage |\n| -------- | ----- | ----------------------- | --------------- | ----------------------- | -------------- | ---------------- |\n| sql\\_avg | admin | 2025.08.09 03:33:40.781 | SQL\\_REGISTERED | select avg(val) from st | st             |                  |\n\n**Related functions:** [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html), [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html)\n"
    },
    "getStreamingSQLSubscriptionInfo": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getstreamingsqlsubscriptioninfo.html",
        "signatures": [
            {
                "full": "getStreamingSQLSubscriptionInfo(queryId)",
                "name": "getStreamingSQLSubscriptionInfo",
                "parameters": [
                    {
                        "full": "queryId",
                        "name": "queryId"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamingSQLSubscriptionInfo](https://docs.dolphindb.com/en/Functions/g/getstreamingsqlsubscriptioninfo.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\ngetStreamingSQLSubscriptionInfo(queryId)\n\n#### Details\n\nRetrieves the metadata of a specified Streaming SQL query.\n\n#### Parameters\n\n**queryId** is a string indicating the ID of a streaming SQL query.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* leadingRecordInsertTime: the insertion time of the earliest inserted row among the data that triggered the most recent update.\n\n* lastRecordInsertTime: the insertion time of the latest inserted row among the data that triggered the most recent update.\n\n* lastUpdateTime: the time when the current result set was updated.\n\n#### Examples\n\n```\n// declare tables as the input tables of streaming SQL\nshare keyedTable(`id, 1:0, `id`value, [INT, DOUBLE]) as leftTable;\nshare keyedTable(`id, 1:0, `id`value, [INT, DOUBLE]) as rightTable;\ngo;\ndeclareStreamingSQLTable(leftTable);\ndeclareStreamingSQLTable(rightTable);\n// register a streaming SQL query\nqueryId = registerStreamingSQL(\"select id, leftTable.value + rightTable.value from leftTable left join rightTable on leftTable.id=rightTable.id\");\n// subscribe to the results of the streaming SQL query\nresult = subscribeStreamingSQL(,queryId)\nt = table(1 2 3 4 5 as id, 0.1 0.2 0.3 0.4 0.5 as value);\nleftTable.append!(t);\nt = table(1 2 3 4 5 as id, 0.1 0.2 0.3 0.4 0.5 as value)\nrightTable.append!(t)\n// retrieves the metadata of the Streaming SQL query\ngetStreamingSQLSubscriptionInfo(queryId)\n/*\noutput:\nleadingRecordInsertTime->2026.01.29T17:42:08.297\nlastRecordInsertTime->2026.01.29T17:42:08.297\nlastUpdateTime->2026.01.29T17:42:08.297\n*/\n```\n"
    },
    "getStreamingStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamingStat.html",
        "signatures": [
            {
                "full": "getStreamingStat()",
                "name": "getStreamingStat",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getStreamingStat](https://docs.dolphindb.com/en/Functions/g/getStreamingStat.html)\n\n\n\n#### Syntax\n\ngetStreamingStat()\n\n#### Details\n\nMonitors the status of streaming jobs.\n\n#### Parameters\n\n**stat** (optional) is a STRING scalar or vector, specifying which status table(s) to return. Available options include: pubConns, subConns, pubTables, persistWorkers, subWorkers, udpPubTables.\n\n#### Returns\n\n* If *stat* specifies a single table, it returns the corresponding status table.\n* If *stat* specifies multiple tables or is not specified, it returns a dictionary containing status tables.\n\nThe status tables include:\n\n* Table *pubConns* displays the status of the connections between the local publisher node and all of its subscriber nodes. Each row represents a subscriber node.\n\n  | Column Name     | Description                                                                                      |\n  | --------------- | ------------------------------------------------------------------------------------------------ |\n  | client          | IP address and port number of a subscriber node                                                  |\n  | queueDepthLimit | The maximum depth (number of records) of the message queue that is allowed on the publisher node |\n  | queueDepth      | Current depth (number of records) of the message queue on the publisher node                     |\n  | tables          | All shared streaming tables in the publisher node                                                |\n\n* Table *subConns* displays the status of the connections between the local subscriber node and the publisher nodes. Each row is a publisher node that the local node subscribes to.\n\n  | Column Name    | Description                                    |\n  | -------------- | ---------------------------------------------- |\n  | publisher      | A publisher node alias                         |\n  | cumMsgCount    | The number of messages that have been received |\n  | cumMsgLatency  | The average latency of all received messages   |\n  | LastMsgLatency | The latency of the last received message       |\n  | lastUpdate     | The last time a message was received           |\n\n  Latency in this table means the time consumed from the moment a message arrives at the publisher node message queue to the moment the message arrives at the subscriber node message queue.\n\n* Table *pubTables* displays the status of stream tables. Each row represents a stream table.\n\n  | Column Name | Description                                     |\n  | ----------- | ----------------------------------------------- |\n  | tableName   | the shared stream table                         |\n  | subscriber  | IP address and port number of a subscriber node |\n  | msgOffset   | offset of the last published record             |\n  | actions     | the subscription task name                      |\n\n* Table *persistWorkers* displays the status of workers (threads) responsible for stream table persistence.\n\n  | Column Name     | Description                                                                                    |\n  | --------------- | ---------------------------------------------------------------------------------------------- |\n  | workerId        | Worker ID                                                                                      |\n  | queueDepthLimit | The maximum depth (number of records) of a message queue that is allowed for table persistence |\n  | queueDepth      | Current depth (number of records) of the message queue for table persistence                   |\n  | tables          | Names of the persisted streaming tables                                                        |\n\n* Table *subWorkers* displays the status of workers of subscriber nodes.\n\n  | Column Name         | Description                                                                                                                                                               |\n  | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n  | workerId            | Worker ID. An empty \"workerId\" column means the subscriber node has not received data.                                                                                    |\n  | topics              | Subscription topics                                                                                                                                                       |\n  | type                | The subscription method, which can be tcp (TCP) or udp (UDP multicast).                                                                                                   |\n  | queueDepthLimit     | The maximum depth (number of records) of a message queue that is allowed on the subscriber node                                                                           |\n  | queueDepth          | Current depth (number of records) of the message queue on the subscriber node                                                                                             |\n  | processedMsgCount   | The number of messages that have been processed                                                                                                                           |\n  | lastMsgId           | the last message ID                                                                                                                                                       |\n  | failedMsgCount      | The number of messages that failed to be processed                                                                                                                        |\n  | lastFailedMsgId     | the last failed message ID                                                                                                                                                |\n  | lastFailedTimestamp | The timestamp of the latest failed message                                                                                                                                |\n  | lastErrMsg          | the last error information on the failed message                                                                                                                          |\n  | msgAsTable          | a BOOLEAN value indicating how the subscribed data is ingested into handler. True means the data is ingested as a table, and false means data is ingested as a tuple.     |\n  | batchSize           | the number of messages batch processed by the handler                                                                                                                     |\n  | throttle            | a numeric scalar (in seconds), indicating the waiting time for the handler to process the messages if the batchSize condition has not been reached since the last process |\n  | hash                | a non-negative integer, indicating which subscription executor to process the incoming messages                                                                           |\n  | filter              | the filtering column of a stream table                                                                                                                                    |\n  | persistOffset       | a Boolean value, indicating whether to persist the offset of the last processed message                                                                                   |\n  | timeTrigger         | a Boolean value. True means that the handler is triggered at the intervals specified by the parameter throttle even if no new messages arrive                             |\n  | handlerNeedMsgId    | a Boolean value, default false. True means that the handler supports two parameters: msgBody and msgId                                                                    |\n  | raftGroup           | the raft group ID                                                                                                                                                         |\n\n* Table *udpPubTables*displays the publishing status using UDP multicast.\n\n  | Column Name | Description                             |\n  | ----------- | --------------------------------------- |\n  | tableName   | The publisher table                     |\n  | channel     | The UDP channel                         |\n  | msgOffset   | The offset of the last published record |\n  | actions     | The subscription task name              |\n  | subNum      | The number of subscriptions             |\n\n#### Examples\n\n```\ngetStreamingStat().pubConns;\ngetStreamingStat().subConns;\ngetStreamingStat().pubTables;\ngetStreamingStat().persistWorkers;\ngetStreamingStat().subWorkers;\n```\n"
    },
    "getStreamTableCacheOffset": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamTableCacheOffset.html",
        "signatures": [
            {
                "full": "getStreamTableCacheOffset(streamTable)",
                "name": "getStreamTableCacheOffset",
                "parameters": [
                    {
                        "full": "streamTable",
                        "name": "streamTable"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamTableCacheOffset](https://docs.dolphindb.com/en/Functions/g/getStreamTableCacheOffset.html)\n\n#### Syntax\n\ngetStreamTableCacheOffset(streamTable)\n\n#### Details\n\nCheck number of records that have been purged from cache by calculating the difference between the number of records retained in memory and the number of records written to the table.\n\n#### Parameters\n\n**streamTable** is a non-persisted stream table that has cache purge enabled (with either `enableTableShareAndCachePurge` or `enableTableCachePurge`).\n\n#### Returns\n\nAn Integer scalar.\n\n#### Examples\n\n```\nt = streamTable(1000:0, `time`sym`volume, [DATETIME, SYMBOL, INT])\nenableTableShareAndCachePurge(table=t, tableName=`st, cachePurgeTimeColumn=`time,\n cachePurgeInterval=30m, cacheRetentionTime=20m)\n\ntime = datetime(2024.01.01T09:00:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\n\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n// output: 0\n\ntime = datetime(2024.01.01T09:35:00) +1..1000*2\nsym=take(`a`b`c, 1000)\nvolume = rand(10,1000)\ninsert into t values([time, sym, volume])\ngetStreamTableCacheOffset(t)\n//output: 999\n```\n\n"
    },
    "getStreamTableChangelog": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamTableChangelog.html",
        "signatures": [
            {
                "full": "getStreamTableChangelog(streamTable)",
                "name": "getStreamTableChangelog",
                "parameters": [
                    {
                        "full": "streamTable",
                        "name": "streamTable"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamTableChangelog](https://docs.dolphindb.com/en/Functions/g/getStreamTableChangelog.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\ngetStreamTableChangelog(streamTable)\n\n#### Details\n\nGets a keyed stream table with a status column.\n\n#### Parameters\n\n**streamTable** is a stream table.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\ngetStreamTableChangelog(tickStream)\n```\n\n|   | changelog\\_type | sym       | time                | price              |\n| - | --------------- | --------- | ------------------- | ------------------ |\n| 0 | N               | 000001.SH | 2021.02.08 09:30:01 | 14.666441912917989 |\n| 1 | N               | 000001.SH | 2021.02.08 09:30:02 | 105.60469803298001 |\n| 2 | U               | 000001.SH | 2021.02.08 09:30:01 | 89.723076797026    |\n| 3 | U               | 000001.SH | 2021.02.08 09:30:02 | 69.34098429496888  |\n\n**Related function**: [changelogStreamTable](https://docs.dolphindb.com/en/Functions/c/changelogStreamTable.html)\n"
    },
    "getStreamTableFilterColumn": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getStreamTableFilterColumn.html",
        "signatures": [
            {
                "full": "getStreamTableFilterColumn(streamTable)",
                "name": "getStreamTableFilterColumn",
                "parameters": [
                    {
                        "full": "streamTable",
                        "name": "streamTable"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamTableFilterColumn](https://docs.dolphindb.com/en/Functions/g/getStreamTableFilterColumn.html)\n\n\n\n#### Syntax\n\ngetStreamTableFilterColumn(streamTable)\n\n#### Parameters\n\n**streamTable** is a stream table object.\n\n#### Details\n\nReturn the filter column name of a stream table. The filter column is specified by the function [setStreamTableFilterColumn](https://docs.dolphindb.com/en/Functions/s/setStreamTableFilterColumn.html).\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nshare streamTable(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT]) as trades\nsetStreamTableFilterColumn(trades, `symbol)\ntrades_1=table(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT])\nfilter=symbol(`IBM`GOOG)\nsubscribeTable(tableName=`trades, actionName=`trades_1, handler=append!{trades_1}, msgAsTable=true, filter=filter);\n\nn=100\ntime=take(2018.01.01T09:30:00.000,n)\nsymbol=take((`IBM`GOOG`AAPL`C`BABA),n)\nprice=1..n\n\nt=table(time,symbol,price)\ntrades.append!(t)\n\n// Obtain the filtering column of trades which is specified by the function setStreamTableFilterColumn\ngetStreamTableFilterColumn(trades); \n// output: symbol\n```\n"
    },
    "getStreamTables": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getstreamtables.html",
        "signatures": [
            {
                "full": "getStreamTables([option=0])",
                "name": "getStreamTables",
                "parameters": [
                    {
                        "full": "[option=0]",
                        "name": "option",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [getStreamTables](https://docs.dolphindb.com/en/Functions/g/getstreamtables.html)\n\n\n\n#### Syntax\n\ngetStreamTables(\\[option=0])\n\n#### Details\n\nGet the information of specified stream tables.\n\n#### Parameters\n\n**option** (optional) is an integral scalar indicating the type of the stream table to be obtained. It can take the following values:\n\n* 0: all stream tables;\n\n* 1: persisted stream tables;\n\n* 2: non-persisted stream tables;\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* name: Table name.\n* shared: Whether the table is shared.\n* persisted: Whether the table is persisted.\n* cachePurgeEnabled: Whether cache purge is enabled.\n* loaded: Whether the table is loaded into memory.\n* columns: The number of columns.\n* rowsInMemory: The number of rows in memory.\n* totalRows: The total number of rows.\n* memoryUsed: Memory used (in bytes).\n\nNote: If the persisted table has not been loaded to memory, only \"name\", \"persisted\", and \"loaded\" columns are returned. Null values are returned for the rest of columns.\n\n#### Examples\n\n```\nid=`XOM`GS`AAPL;\nx=102.1 33.4 73.6;\n\nrt=streamTable(id, x);\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades1;\nshare streamTable(10:0,`time`sym`price`volume,[TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades2;\n\ngetStreamTables()\n```\n\nOutput:\n\n| name    | shared | persisted | cachePurgeEnabled | loaded | columns | rowsInMemory | totalRows | memoryUsed |\n| ------- | ------ | --------- | ----------------- | ------ | ------- | ------------ | --------- | ---------- |\n| rt      | false  | false     | false             | true   | 2       | 3            | 3         | 152        |\n| trades1 | true   | false     | false             | true   | 4       | 0            | 0         | 240        |\n| trades2 | true   | false     | false             | true   | 4       | 0            | 0         | 240        |\n"
    },
    "getSubscriptionTopic": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSubscriptionTopic.html",
        "signatures": [
            {
                "full": "getSubscriptionTopic(tableName, [actionName])",
                "name": "getSubscriptionTopic",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[actionName]",
                        "name": "actionName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getSubscriptionTopic](https://docs.dolphindb.com/en/Functions/g/getSubscriptionTopic.html)\n\n\n\n#### Syntax\n\ngetSubscriptionTopic(tableName, \\[actionName])\n\n#### Details\n\nGet the subscription topic name and column names of the stream table. It can only be executed on a publisher node.\n\nThe subscription topic name is a combination of the information about the node that the stream table is located (the intranet IP address, port number and node alias separated by \":\"), the stream table name, and the subscription task name (if actionName is specified) separated by \"/\". For example, if the intranet IP of the server is \"localhost:8848:nodeA\" and the stream table name is \"trades\", the topic is \"localhost:8848:nodeA/trades\"; If the subscription task name is \"vwap\", then the topic is \"localhost:8848:nodeA/trades/vwap\".\n\n#### Parameters\n\n**tableName** is a string indicating the name of the shared stream table.\n\n**actionName** (optional) is a string indicating the name of the subscription task. It can use letters, digits and underscore.\n\n#### Returns\n\nReturn a tuple with 2 elements: the subscription topic name and a list of column names of the stream table.\n\n#### Examples\n\nThe following script is executed on a node with alias \"rh8502\":\n\n```\nt=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])\nshare t as trades\ntrades_1=streamTable(1000000:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])\nsubscribeTable(tableName=`trades, actionName=`vwap, offset=-1, handler=append!{trades_1})\ngetSubscriptionTopic(`trades,`vwap);\n// output: (\"192.168.1.135:8502/rh8502/trades/vwap\",[\"date\",\"time\",\"sym\",\"qty\",\"price\",\"exch\"])\n```\n"
    },
    "getSupportBundle": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSupportBundle.html",
        "signatures": [
            {
                "full": "getSupportBundle([dir])",
                "name": "getSupportBundle",
                "parameters": [
                    {
                        "full": "[dir]",
                        "name": "dir",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getSupportBundle](https://docs.dolphindb.com/en/Functions/g/getSupportBundle.html)\n\n\n\n#### Syntax\n\ngetSupportBundle(\\[dir])\n\n#### Details\n\nGenerate a file of support bundle containing all configuration information and return the file path. The function can only be called on a data node or compute node.\n\nThe file contains the following information:\n\n<table id=\"table_vz5_gdp_yhc\"><thead><tr><th>\n\nBlock\n\n</th><th>\n\nDescription\n\n</th><th>\n\nInfo Source\n\n</th></tr></thead><tbody><tr><td>\n\nVERSION\n\n</td><td>\n\nthe server version\n\n</td><td>\n\n`version()`\n\n</td></tr><tr><td>\n\nCONFIGS\n\n</td><td>\n\nthe configuration information.\n\n</td><td>\n\n* standalone mode: *dolphindb.cfg*;\n* cluster mode: *cluster.cfg*, *cluster.nodes*, *controller.cfg*\n\n</td></tr><tr><td>\n\nDB AND TABLE SCHEMA\n\n</td><td>\n\nthe schema of each database and table\n\n</td><td>\n\n`schema`\n\n</td></tr><tr><td>\n\nLICENSE AND MACHINE INFO\n\n</td><td>\n\nlicense, CPU cores and memory usage\n\n</td><td>\n\nlicense file: *dolphindb.lic*\n\n</td></tr><tr><td>\n\nOLAP CACHE ENGINE STATUS\n\n</td><td>\n\nThe status of OLAP cache engine on the current node and the memory usage of each node\n\n</td><td>\n\n`pnodeRun(getOLAPCacheEngineSize)` `pnodeRun(getOLAPCacheEngineStat)`\n\n</td></tr><tr><td>\n\nTSDB META\n\n</td><td>\n\nthe metadata of all chunks in the TSDB database\n\n</td><td>\n\n`pnodeRun(getTSDBMetaData)`\n\n</td></tr><tr><td>\n\nREDO LOG GC STATUS\n\n</td><td>\n\nthe redo log status\n\n</td><td>\n\n`pnodeRun(getRedoLogGCStat)`\n\n</td></tr><tr><td>\n\nTRANSACTION STATUS\n\n</td><td>\n\nthe transaction status\n\n</td><td>\n\n`pnodeRun(getTransactionStatus)`\n\n</td></tr><tr><td>\n\nTABLETS META\n\n</td><td>\n\nthe metadata of the 100 chunks in the cluster with the most rows\n\n</td><td>\n\n`select top 100 * from pnodeRun(getTabl etsMeta{\"%\",\"%\",false,-1}) order by rowNum desc`\n\n</td></tr><tr><td>\n\nANOMALOUS CHUNK STATUS\n\n</td><td>\n\nthe status of anomalous chunks. Anomaly means chunks in recovery, with different version or replica counts.\n\n</td><td>\n\n`getClusterChunksStatus()`\n\n</td></tr></tbody>\n</table>## Parameters\n\n**dir** (optional) specifies the directory to store the support bundle. The default path is *\\<HomeDir>*(which can be obtained with [getHomeDir](https://docs.dolphindb.com/en/Functions/g/getHomeDir.html)) for a standalone mode, and the sibling directory of *\\<HomeDir>* for a cluster mode.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetSupportBundle()\n// output: /home/dolphindb/server/getSupportBundle.1655869793424\n\ngetSupportBundle(\"/home/dolphindb/sup\")\n// output: /home/dolphindb/sup/getSupportBundle.1655869853178\n```\n"
    },
    "getSystemCpuUsage": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSystemCpuUsage.html",
        "signatures": [
            {
                "full": "getSystemCpuUsage()",
                "name": "getSystemCpuUsage",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getSystemCpuUsage](https://docs.dolphindb.com/en/Functions/g/getSystemCpuUsage.html)\n\n\n\n#### Syntax\n\ngetSystemCpuUsage()\n\n#### Parameters\n\nNone\n\n#### Details\n\nThis function returns the CPU utilization rate taken by a DolphinDB process on the current node.\n\n**Note:** If a DolphinDB process uses multiple CPU cores, the total usage rate is returned.\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\n```\ngetSystemCpuUsage();\n// output: 1.771654\n```\n"
    },
    "getSystemLoadAvg": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getSystemLoadAvg.html",
        "signatures": [
            {
                "full": "getSystemLoadAvg()",
                "name": "getSystemLoadAvg",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getSystemLoadAvg](https://docs.dolphindb.com/en/Functions/g/getSystemLoadAvg.html)\n\n\n\n#### Syntax\n\ngetSystemLoadAvg()\n\n#### Details\n\nReturn real-time system load average. To use this function, we must set *perfMonitoring*=1 in the configuration file to enable performance monitoring.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\n```\ngetSystemLoadAvg();\n// output: 5.664062\n```\n"
    },
    "getTableAccess": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTableAccess.html",
        "signatures": [
            {
                "full": "getTableAccess(dbUrl, table)",
                "name": "getTableAccess",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [getTableAccess](https://docs.dolphindb.com/en/Functions/g/getTableAccess.html)\n\n\n\n#### Syntax\n\ngetTableAccess(dbUrl, table)\n\n#### Details\n\nAllow users to get a detailed view of users and groups with privileges of the specified DFS table.\n\n\\*\\*Note:\\*\\*This function can only be invoked by administrators or by users with DB\\_OWNER or DB\\_MANAGE privileges of the database.\n\n#### Parameters\n\n**dbUrl** is a string indicating the database URL.\n\n**table** is a string indicating the table name.\n\n#### Returns\n\nA table with the following columns:\n\n* name: The user or group name.\n* type: User or group.\n* TABLE\\_READ, TABLE\\_INSERT, TABLE\\_UPDATE, TABLE\\_DELETE: The specific privileges. The states can be ALLOW, DENY, or NONE. For more information on user access privileges, please refer to [User Access Control](https://docs.dolphindb.com/en/Tutorials/access_control.html).\n\n#### Examples\n\nUser1 with the DB\\_OWNER privilege creates the DFS table dfs\\://testDB/pt with following settings\n\n* Grants TABLE\\_READ privilege to user2.\n* Denies TABLE\\_INSERT privilege to user3.\n* Grants TABLE\\_DELETE privilege to group1.\n\nUse `getTableAccess` to view the permission set of testDB.\n\n```\nlogin(`user1, `123456)\ngetTableAccess(\"dfs://testDB\", \"pt\")\n```\n\nOutput:\n\n| name   | type  | TABLE\\_READ | TABLE\\_INSERT | TABLE\\_UPDATE | TABLE\\_DELETE |\n| :----- | :---- | :---------- | :------------ | :------------ | :------------ |\n| group1 | group | NONE        | NONE          | NONE          | ALLOW         |\n| user3  | user  | NONE        | DENY          | NONE          | NONE          |\n| user2  | user  | ALLOW       | NONE          | NONE          | NONE          |\n| admin  | user  | ALLOW       | ALLOW         | ALLOW         | ALLOW         |\n\nRelated functions: [getDBAccess](https://docs.dolphindb.com/en/Functions/g/getDBAccess.html)\n"
    },
    "getTableAccessByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTableAccessByCluster.html",
        "signatures": [
            {
                "full": "getTableAccessByCluster(table)",
                "name": "getTableAccessByCluster",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [getTableAccessByCluster](https://docs.dolphindb.com/en/Functions/g/getTableAccessByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetTableAccessByCluster(table)\n\n#### Details\n\nGet all user privileges for a specified table. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**table** is a STRING scalar indicating a table in the format: `{catalog}.{schema}.{pt}@{cluster}`.\n\n#### Returns\n\nA table with the same structure as the return value of the `getTableAccess` function.\n\n#### Examples\n\n```\ngetTableAccessByCluster(\"catalog1.schema1.dt@MoMSender\")\n```\n\n| name  | type | TABLE\\_READ | TABLE\\_INSERT | TABLE\\_UPDATE | TABLE\\_DELETE |\n| ----- | ---- | ----------- | ------------- | ------------- | ------------- |\n| admin | user | ALLOW       | ALLOW         | ALLOW         | ALLOW         |\n\nRelated Function: [getTableAccess](https://docs.dolphindb.com/en/Functions/g/getTableAccess.html)\n"
    },
    "getTables": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTables.html",
        "signatures": [
            {
                "full": "getTables(dbHandle)",
                "name": "getTables",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    }
                ]
            }
        ],
        "markdown": "### [getTables](https://docs.dolphindb.com/en/Functions/g/getTables.html)\n\n\n\n#### Syntax\n\ngetTables(dbHandle)\n\n#### Details\n\nReturn a list of tables saved in the specified database:\n\n* For an administrator, it returns all DFS tables under the specified database.\n\n* When executed by a non-admin user, it will return:\n\n  * All DFS tables in databases where the user has any of the following permissions: DB\\_OWNER, DB\\_MANAGE, DB\\_READ, DB\\_WRITE, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE.\n\n  * Within the specified database, the DFS tables where the user has any of the following permissions: TABLE\\_READ, TABLE\\_INSERT, TABLE\\_WRITE, TABLE\\_UPDATE, or TABLE\\_DELETE.\n\n#### Parameters\n\n**dbHandle** is a database handle.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nn=1000000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\ny=rand(10, n)\nt1=table(ID, date, x)\nt2=table(ID, date, y)\ndb = database(\"dfs://valueDB\", VALUE, 2017.08.07..2017.08.11)\npt1 = db.createPartitionedTable(t1, `pt1, `date)\npt1.append!(t1)\npt2 = db.createPartitionedTable(t2, `pt2, `date)\npt2.append!(t2);\ngetTables(db);\n// output: [\"pt1\",\"pt2\"]\n```\n"
    },
    "getTablesByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTablesByCluster.html",
        "signatures": [
            {
                "full": "getTablesByCluster(clusterName, dbUrl)",
                "name": "getTablesByCluster",
                "parameters": [
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    },
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    }
                ]
            }
        ],
        "markdown": "### [getTablesByCluster](https://docs.dolphindb.com/en/Functions/g/getTablesByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetTablesByCluster(clusterName, dbUrl)\n\n#### Details\n\nReturn all tables in the specified database of the specified cluster. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**clusterName** is a STRING scalar indicating the name of the cluster.\n\n**dbUrl** is a STRING scalar indicating the path of the database.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\n// MoMSender cluster: \ndb = database(directory=\"dfs://db1\", partitionType=RANGE, partitionScheme=0 5 10)\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nt = table(timestamp, sym, qty, price);\ndt=db.createDimensionTable(t,`dt).append!(t);\n   \n// MoM cluster: \ngetTablesByCluster(\"MoMSender\", \"dfs://db1\")\n// Output:  [\"dt\"]\n```\n"
    },
    "getTableSchemaByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTableSchemaByCluster.html",
        "signatures": [
            {
                "full": "getTableSchemaByCluster(clusterName, dbUrl, table)",
                "name": "getTableSchemaByCluster",
                "parameters": [
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    },
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [getTableSchemaByCluster](https://docs.dolphindb.com/en/Functions/g/getTableSchemaByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetTableSchemaByCluster(clusterName, dbUrl, table)\n\n#### Details\n\nGet the schema of the specified table. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**clusterName** is a STRING scalar indicating the name of the cluster.\n\n**dburl** is a STRING scalar indicating the path of the database.\n\n**table** is a STRING scalar indicating the name of the table.\n\n#### Returns\n\nA dictionary. See function [schema(table)](https://docs.dolphindb.com/en/Functions/s/schema.html) for details.\n\n#### Examples\n\n```\ngetTableSchemaByCluster(\"MoMSender\", \"dfs://db1\", \"dt\")\n   \n/* Output:\n   colDefs->name      typeString typeInt extra comment\n   --------- ---------- ------- ----- -------\ntimestamp SECOND     10                   \n   sym       STRING     18                   \n   qty       INT        4                    \n   price     DOUBLE     16                   \n   chunkPath->\n   partitionColumnIndex->-1\n   \n*/\n```\n\nRelated Function: [schema](https://docs.dolphindb.com/en/Functions/s/schema.html).\n"
    },
    "getTablesOfAllClusters": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTablesOfAllClusters.html",
        "signatures": [
            {
                "full": "getTablesOfAllClusters()",
                "name": "getTablesOfAllClusters",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getTablesOfAllClusters](https://docs.dolphindb.com/en/Functions/g/getTablesOfAllClusters.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetTablesOfAllClusters()\n\n#### Details\n\nSimilar to the `getClusterDFSTables` function, but this function gets all tables that the current user has access to across multiple clusters.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ngetTablesOfAllClusters()\n// Output:  [\"dfs://testDB/pt1\", \"trading.schema.pt@cluster3\"]\n```\n"
    },
    "getTablet": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTablet.html",
        "signatures": [
            {
                "full": "getTablet(table, partition)",
                "name": "getTablet",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "partition",
                        "name": "partition"
                    }
                ]
            }
        ],
        "markdown": "### [getTablet](https://docs.dolphindb.com/en/Functions/g/getTablet.html)\n\n\n\n#### Syntax\n\ngetTablet(table, partition)\n\n#### Details\n\nGet the information of the specified partition or partitions.\n\n#### Parameters\n\n**table** is an in-memory partitioned table.\n\n**partition** is a scalar/vector indicating a partition or partitions. If an element of *partition* belongs to the partitioning scheme of a partition, it represents the entire partition.\n\n#### Returns\n\n* If partition is a scalar, return a table.\n* If partition is a vertor, return a tuple in which every element is a table.\n\n#### Examples\n\n```\ndb=database(partitionType=RANGE, partitionScheme=2012.06.01 2012.06.10 2012.06.20 2012.07.01)\nn=30\nt=table(take(2012.06.01..2012.06.30, n) as date, n..1 as val)\npt=db.createPartitionedTable(table=t, tableName=`pt, partitionColumns=`date).append!(t);\n\ngetTablet(pt, 2012.06.05);\n```\n\n| date       | val |\n| ---------- | --- |\n| 2012.06.01 | 30  |\n| 2012.06.02 | 29  |\n| 2012.06.03 | 28  |\n| 2012.06.04 | 27  |\n| 2012.06.05 | 26  |\n| 2012.06.06 | 25  |\n| 2012.06.07 | 24  |\n| 2012.06.08 | 23  |\n| 2012.06.09 | 22  |\n\n```\nresult=getTablet(pt, 2012.06.22 2012.06.11);\nresult.size();\n// output: 2\n\nresult[0];\n```\n\n| date       | val |\n| ---------- | --- |\n| 2012.06.20 | 11  |\n| 2012.06.21 | 10  |\n| 2012.06.22 | 9   |\n| 2012.06.23 | 8   |\n| 2012.06.24 | 7   |\n| 2012.06.25 | 6   |\n| 2012.06.26 | 5   |\n| 2012.06.27 | 4   |\n| 2012.06.28 | 3   |\n| 2012.06.29 | 2   |\n| 2012.06.30 | 1   |\n"
    },
    "getTabletsMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTabletsMeta.html",
        "signatures": [
            {
                "full": "getTabletsMeta([chunkPath],[tableName],[diskUsage=false],[top=124])",
                "name": "getTabletsMeta",
                "parameters": [
                    {
                        "full": "[chunkPath]",
                        "name": "chunkPath",
                        "optional": true
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    },
                    {
                        "full": "[diskUsage=false]",
                        "name": "diskUsage",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[top=124]",
                        "name": "top",
                        "optional": true,
                        "default": "124"
                    }
                ]
            }
        ],
        "markdown": "### [getTabletsMeta](https://docs.dolphindb.com/en/Functions/g/getTabletsMeta.html)\n\n\n\n#### Syntax\n\ngetTabletsMeta(\\[chunkPath],\\[tableName],\\[diskUsage=false],\\[top=124])\n\n#### Details\n\nReturn metadata of specified tablet chunks on the local node. To get metadata about all tablet chunks of a distributed table, use `getTabletsMeta` together with [pnodeRun](https://docs.dolphindb.com/en/Functions/p/pnodeRun.html).\n\n**Note:** Chunks with zero rows are excluded. Use [getClusterChunksStatus](https://docs.dolphindb.com/en/Functions/g/getClusterChunksStatus.html) to retrieve their metadata.\n\n#### Parameters\n\n**chunkPath** (optional) is the DFS path to one or multiple database chunks. It supports wildcards '%', '\\*' and '?'. '\\*' matches any number of any characters, '?' matches a single character, and '%' matches zero, one, or multiple characters.\n\n**tableName** (optional) is a string indicating a table name.\n\n**diskUsage** (optional) is a Boolean value indicating whether the result includes the column of diskUsage.\n\n**top** (optional) is a positive number indicating the maximum number of chunks in the output. The default value is 1024. To remove the upper limit of chunks in the output, set top to -1.\n\n#### Returns\n\nReturn a table with the following columns:\n\n* chunkId: the unique identifier of chunk.\n\n* path: the physical path of the partition.\n\n* dfsPath: the dfs path of the partition.\n\n* tableName: the table name.\n\n* version: the version number.\n\n* rowNum: the number of records in the partition.\n\n* createCids: the Cids created when updating/deleting the table.\n\n* latestPhysicalDir: the temporary physical directory storing the data generated by the operation with the latest Cid.\n\n* diskUsage: the disk space occupied by partition (in Bytes).\n\n#### Examples\n\n```\nif(existsDatabase(\"dfs://testDB\")){\n   dropDatabase(\"dfs://testDB\")\n}\ndb=database(\"dfs://testDB\", VALUE, 1..10)\nn=1000000\nt=table(rand(1..10, n) as id, rand(100.0, n) as x)\ndb.createPartitionedTable(t, `pt1, `id).append!(t)\nn=2000000\nt=table(rand(1..10, n) as id, rand(100.0, n) as x, rand(100, n) as y)\ndb.createPartitionedTable(t, `pt2, `id).append!(t)\nupdate loadTable(\"dfs://testDB\",`pt1) set x=x*10\ngetTabletsMeta(\"/testDB/%\", `pt1, true);\n```\n\n| chunkId                              | path            | dfsPath    | tableName | version | rowNum | createCids | latestPhysicalDir |\n| ------------------------------------ | --------------- | ---------- | --------- | ------- | ------ | ---------- | ----------------- |\n| dbfd1767-f9ca-689e-4d5e-643b8506e82d | C:UsersDownl... | /testDB/10 | pt1       | 2       | 99815  | \\[2059]    | pt1\\_2\\_2059      |\n| d221b457-fa7b-5990-4caa-13c99f56f716 | C:UsersDownl... | /testDB/9  | pt1       | 2       | 99975  | \\[2059]    | pt1\\_2\\_2059      |\n| 92904d3b-0147-9bb8-4a28-f99525b250e7 | C:UsersDownl... | /testDB/8  | pt1       | 2       | 99844  | \\[2059]    | pt1\\_2\\_2059      |\n| 7478c15a-0629-c8ab-47ee-a1d12c3c1cd6 | C:UsersDownl... | /testDB/1  | pt1       | 2       | 100237 | \\[2059]    | pt1\\_2\\_2059      |\n| 8bc48c11-86ca-97ac-4ee4-8f829de92cc8 | C:UsersDownl... | /testDB/5  | pt1       | 2       | 99991  | \\[2059]    | pt1\\_2\\_2059      |\n| 6b3a0a09-bc64-3bab-4535-344b7316d244 | C:UsersDownl... | /testDB/2  | pt1       | 2       | 100120 | \\[2059]    | pt1\\_2\\_2059      |\n| a7452c44-5d2b-6f82-4150-7bc48e941d64 | C:UsersDownl... | /testDB/4  | pt1       | 2       | 99535  | \\[2059]    | pt1\\_2\\_2059      |\n| a1a375cc-b6c0-29b2-485a-330af7447564 | C:UsersDownl... | /testDB/6  | pt1       | 2       | 100518 | \\[2059]    | pt1\\_2\\_2059      |\n| b04b4c04-6d43-0d8d-4000-6ae88e349eda | C:UsersDownl... | /testDB/3  | pt1       | 2       | 99919  | \\[2059]    | pt1\\_2\\_2059      |\n| b20df3a7-678b-1cbe-400d-d8e566706682 | C:UsersDownl... | /testDB/7  | pt1       | 2       | 100046 | \\[2059]    | pt1\\_2\\_2059      |\n"
    },
    "getTopicProcessedOffset": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTopicProcessedOffset.html",
        "signatures": [
            {
                "full": "getTopicProcessedOffset(topic)",
                "name": "getTopicProcessedOffset",
                "parameters": [
                    {
                        "full": "topic",
                        "name": "topic"
                    }
                ]
            }
        ],
        "markdown": "### [getTopicProcessedOffset](https://docs.dolphindb.com/en/Functions/g/getTopicProcessedOffset.html)\n\n\n\n#### Syntax\n\ngetTopicProcessedOffset(topic)\n\n#### Details\n\n* If parameter *persistOffset* of function `subscribeTable` is true, return the offset of the last subscribed message that has been processed.\n* If parameter *persistOffset* of function `subscribeTable` is false, return -1.\n\n#### Parameters\n\n**topic** is the subscription topic returned by function [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html).\n\n#### Returns\n\nA integral scalar.\n\n#### Examples\n\n```\nshare streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT]) as trades\ntrades_1 = streamTable(1000:0, `time`sym`qty, [TIMESTAMP, SYMBOL, INT])\ntopic=subscribeTable(tableName=\"trades\", actionName=\"trades_1\", offset=0, handler=append!{trades_1}, msgAsTable=true, persistOffset=true)\ndef writeData(n){\n   timev = 2018.10.08T01:01:01.001 + timestamp(1..n)\n   symv =take(`A`B, n)\n   qtyv = take(1, n)\n   insert into trades values(timev, symv, qtyv)\n}\nwriteData(6);\nselect * from trades_1;\n```\n\n| time                    | sym | qty |\n| ----------------------- | --- | --- |\n| 2018.10.08T01:01:01.002 | A   | 1   |\n| 2018.10.08T01:01:01.003 | B   | 1   |\n| 2018.10.08T01:01:01.004 | A   | 1   |\n| 2018.10.08T01:01:01.005 | B   | 1   |\n| 2018.10.08T01:01:01.006 | A   | 1   |\n| 2018.10.08T01:01:01.007 | B   | 1   |\n\n```\ngetTopicProcessedOffset(topic);\n// output: 5\n```\n"
    },
    "getTradingCalendarType": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTradingCalendarType.html",
        "signatures": [
            {
                "full": "getTradingCalendarType(marketName)",
                "name": "getTradingCalendarType",
                "parameters": [
                    {
                        "full": "marketName",
                        "name": "marketName"
                    }
                ]
            }
        ],
        "markdown": "### [getTradingCalendarType](https://docs.dolphindb.com/en/Functions/g/getTradingCalendarType.html)\n\n\n\n#### Syntax\n\ngetTradingCalendarType(marketName)\n\n#### Details\n\nGet the type of the trading calendar of a specified exchange.\n\n#### Parameters\n\n**marketName** is a STRING scalar, indicating the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name.\n\n#### Returns\n\nA STRING scalar of \"holidayDate\" or \"tradingDate\".\n\n#### Examples\n\n```\ngetTradingCalendarType(\"SZSE\")\n```\n\nOutput: holidayDate\n"
    },
    "getTransactionStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTransactionStatus.html",
        "signatures": [
            {
                "full": "getTransactionStatus()",
                "name": "getTransactionStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getTransactionStatus](https://docs.dolphindb.com/en/Functions/g/getTransactionStatus.html)\n\n\n\n#### Syntax\n\ngetTransactionStatus()\n\n#### Details\n\nGet the status of transactions.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturn a table containing the following columns:\n\n* tid: The transaction ID.\n\n* startTime: The time when the transaction started.\n\n* type: The type of operations involved in the transaction, including APPEND, DROP, SQLUPDATE, SQLUPSERT, SQLDELETE, FILEOPERATE, or UNKNOWN.\n\n* status: The transaction status. It can be BEGIN, COMMIT, COMPLETE, or ROLLBACK.\n\n* partitionCount: The number of partitions involved in the transaction.\n\n* endTime: The time when the transaction ended.\n\n* elapsedTime: The elapsed time (in milliseconds) of the transaction.\n\n#### Examples\n\n```\ngetTransactionStatus()\n```\n\n| tid  | startTime               | type   | status | partitionCount | endTime                 | elapsedTime |\n| ---- | ----------------------- | ------ | ------ | -------------- | ----------------------- | ----------- |\n| 3135 | 2022.06.07 16:19:48.477 | APPEND | BEGIN  | 4              |                         | 584         |\n| 3143 | 2022.06.07 16:11:27.489 | APPEND | COMMIT | 4              | 2022.06.07 16:11:33.100 | 484         |\n"
    },
    "getTSDBCachedSymbolBaseMemSize": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTSDBCachedSymbolBaseMemSize.html",
        "signatures": [
            {
                "full": "getTSDBCachedSymbolBaseMemSize()",
                "name": "getTSDBCachedSymbolBaseMemSize",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getTSDBCachedSymbolBaseMemSize](https://docs.dolphindb.com/en/Functions/g/getTSDBCachedSymbolBaseMemSize.html)\n\n#### Syntax\n\ngetTSDBCachedSymbolBaseMemSize()\n\n#### Details\n\nObtain the cache size (in Bytes) of SYMBOL base (i.e., a dictionary that stores integers encoded from the data of SYMBOL type) of the TSDB engine.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA LONG scalar.\n\n"
    },
    "getTSDBCacheEngineSize": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTSDBCacheEngineSize.html",
        "signatures": [
            {
                "full": "getTSDBCacheEngineSize()",
                "name": "getTSDBCacheEngineSize",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getTSDBCacheEngineSize](https://docs.dolphindb.com/en/Functions/g/getTSDBCacheEngineSize.html)\n\n\n\n#### Syntax\n\ngetTSDBCacheEngineSize()\n\n#### Details\n\nObtain the maximum memory (in Bytes) allocated to the TSDB cache engine.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA LONG scalar.\n\n#### Examples\n\n```\nsetTSDBCacheEngineSize(0.5)\ngetTSDBCacheEngineSize()\n// output: 536870912\n```\n\nRelated function: [setTSDBCacheEngineSize](https://docs.dolphindb.com/en/Functions/s/setTSDBCacheEngineSize.html)\n"
    },
    "getTSDBCompactionTaskStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTSDBCompactionTaskStatus.html",
        "signatures": [
            {
                "full": "getTSDBCompactionTaskStatus([count])",
                "name": "getTSDBCompactionTaskStatus",
                "parameters": [
                    {
                        "full": "[count]",
                        "name": "count",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getTSDBCompactionTaskStatus](https://docs.dolphindb.com/en/Functions/g/getTSDBCompactionTaskStatus.html)\n\n\n\n#### Syntax\n\ngetTSDBCompactionTaskStatus(\\[count])\n\n#### Details\n\nObtain the status of TSDB level file compaction tasks. The function can only be executed on a data node.\n\n#### Parameters\n\n**count** (optional) is a non-negative integer. Return the status of the latest count compaction tasks. The default value is 0, indicating that all completed compaction tasks (up to 256 latest tasks) and uncompleted tasks are returned.\n\n#### Returns\n\nReturn a table with the following columns:\n\n* volume: the volume where the compaction is performed. It is set by the configuration parameter *volumes*.\n\n* level: the level of files for compaction.\n\n* chunkId: the ID of chunk where the compaction is performed.\n\n* tableName: the physical name of the table where the compaction is performed.\n\n* files: the level files involved in the current compaction.\n\n* force: whether the compaction is triggered by `triggerTSDBCompaction`.\n\n* receivedTime: the timestamp when the compaction task enqueued.\n\n* startTime: the timestamp when the compaction task started.\n\n* endTime: the timestamp when the compaction task ended.\n\n* errorMessage: If a task failed, the column displays the failure cause; otherwise it is left empty.\n\n#### Examples\n\n```\ngetTSDBCompactionTaskStatus()\n```\n\n| volume                                                                            | level | chunkId                              | tableName | files                    | force | receivedTime            | startTime               | endTime                 | errorMessage |\n| --------------------------------------------------------------------------------- | ----- | ------------------------------------ | --------- | ------------------------ | ----- | ----------------------- | ----------------------- | ----------------------- | ------------ |\n| /home/DolphinDB/DolphinDB\\_Linux64\\_V2.00.9/server/clusterDemo/data/node1/storage | 0     | e0e00bc2-b81e-6eb9-4d01-7bb17fb39595 | pt\\_2     | 0\\_00000006,0\\_00000011, | true  | 2023.06.22T12:47:32.009 | 2023.06.22T12:47:32.010 | 2023.06.22T12:47:32.182 |              |\n| /home/DolphinDB/DolphinDB\\_Linux64\\_V2.00.9/server/clusterDemo/data/node1/storage | 1     | a9dfccad-cec1-0786-480a-9ae809481a8b | pt\\_2     | 0\\_00000003,0\\_00000007, | true  | 2023.06.22T12:47:32.010 | 2023.06.22T12:47:32.182 | 2023.06.22T12:47:32.326 |              |\n| /home/DolphinDB/DolphinDB\\_Linux64\\_V2.00.9/server/clusterDemo/data/node1/storage | 1     | 331324ce-b49f-94ac-4da8-a4bcf6c34e1c | pt\\_2     | 0\\_00000004,0\\_00000010, | true  | 2023.06.22T12:47:32.010 | 2023.06.22T12:47:32.326 | 2023.06.22T12:47:32.451 |              |\n| /home/DolphinDB/DolphinDB\\_Linux64\\_V2.00.9/server/clusterDemo/data/node1/storage | 2     | f3597e0f-6ad9-6eb6-45c8-d42adc5c50f7 | pt\\_2     | 0\\_00000002,0\\_00000008, | true  | 2023.06.22T12:47:32.010 | 2023.06.22T12:47:32.451 | 2023.06.22T12:47:32.527 |              |\n| /home/DolphinDB/DolphinDB\\_Linux64\\_V2.00.9/server/clusterDemo/data/node1/storage | 2     | d36ac640-3428-069b-4382-0b9608b94d17 | pt\\_2     | 0\\_00000005,0\\_00000009, | true  | 2023.06.22T12:47:32.010 | 2023.06.22T12:47:32.527 | 2023.06.22T12:47:32.616 |              |\n| /home/DolphinDB/DolphinDB\\_Linux64\\_V2.00.9/server/clusterDemo/data/node1/storage | 2     | e0e00bc2-b81e-6eb9-4d01-7bb17fb39595 | pt\\_2     | 0\\_00000016,0\\_00000021, | true  | 2023.06.22T12:47:33.058 | 2023.06.22T12:47:33.058 | 2023.06.22T12:47:33.151 |              |\n\nRelated function: [triggerTSDBCompaction](https://docs.dolphindb.com/en/Functions/t/triggerTSDBCompaction.html)\n"
    },
    "getTSDBDataStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTSDBDataStat.html",
        "signatures": [
            {
                "full": "getTSDBDataStat([dbName=\"*\"], [tableName=\"*\"], [chunkId])",
                "name": "getTSDBDataStat",
                "parameters": [
                    {
                        "full": "[dbName=\"*\"]",
                        "name": "dbName",
                        "optional": true,
                        "default": "\"*\""
                    },
                    {
                        "full": "[tableName=\"*\"]",
                        "name": "tableName",
                        "optional": true,
                        "default": "\"*\""
                    },
                    {
                        "full": "[chunkId]",
                        "name": "chunkId",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getTSDBDataStat](https://docs.dolphindb.com/en/Functions/g/getTSDBDataStat.html)\n\n\n\n#### Syntax\n\ngetTSDBDataStat(\\[dbName=\"\\*\"], \\[tableName=\"\\*\"], \\[chunkId])\n\n#### Details\n\nGet the number of level files and sort key entries of specified chunks on the current node. You can also use function `pnodeRun` to check the number of level files and sort key entries of tables in a cluster.\n\n#### Parameters\n\n**dbName** (optional) is a string indicating the database name. It can contain wildcards (\"\\*\", \"%\", and \"?\"). The default value is \"\\*\".\n\n**tableName** (optional) is a string indicating the table name. It can contain wildcards (\"\\*\", \"%\", and \"?\"). The default value is \"\\*\".\n\n**chunkId** (optional) is a STRING scalar or vector indicating chunk ID(s). If *chunkId* is specified, *dbName* and *tableName* must be empty or “\\*”.\n\n\"\\*\" matches all; \"?\" matches a single character; \"%\" matches 0, 1 or more characters.\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* dbName: he database name.\n\n* chunkId: the chunk ID.\n\n* tableName: the table name.\n\n* levelFileCount: the number of level files of tables for each chunk.\n\n* sortKeyEntryCount: the number of sort key entries that has not been deduplicated in all level files for each chunk.\n\n#### Examples\n\n```\nt = table(1 2 1 1 2 2 3 as month, `Rome`Paris`London`Paris`Rome`London`Rome as city, 200 500 100 300 300 400 400 as sold)\ndb_name = \"dfs://window_function\"\nif (existsDatabase(db_name)) {\n    dropDatabase(db_name)\n}\ndb = database(db_name, HASH, [INT, 4], , 'TSDB')\n\npt = db.createPartitionedTable(t, \"pt\", \"month\", ,\"sold\")\npt.append!(t)\n\npt1 = db.createPartitionedTable(t, \"pt1\", \"month\", ,\"sold\")\npt1.append!(t)\n```\n\nGet the number of level files and sort key entries for all tables in the databases starting with *dfs\\://window*.\n\n```\ngetTSDBDataStat(\"dfs://window%\")  \n/* output\ndbName                chunkId                              tableName levelFileCount sortKeyEntryCount\n--------------------- ------------------------------------ --------- -------------- -----------------\ndfs://window_function 520e78eb-49b9-93a8-4c28-7f367007aa14 pt        1              3                \ndfs://window_function 4859462b-62e7-9782-42f1-5c32a7109782 pt1       1              3                \ndfs://window_function 9bcc10db-ffe7-4994-4ac7-f37a8cb69c65 pt        1              3                \ndfs://window_function 1d2b7a5e-6da9-2d9f-4eff-e0e60e49e785 pt1       1              3                \ndfs://window_function 4ca5d901-6d86-2db8-40eb-ee1d63184b99 pt        1              1                \ndfs://window_function c7da5329-569d-4888-4ed4-746a28b09079 pt1       1              1           \n*/\n```\n\nGet the number of level files and sort key entries for table \"pt\" in the databases starting with *dfs\\://window*.\n\n```\ngetTSDBDataStat(\"dfs://window%\",\"pt\") \n/* output\ndbName                chunkId                              tableName levelFileCount sortKeyEntryCount\n--------------------- ------------------------------------ --------- -------------- -----------------\ndfs://window_function 520e78eb-49b9-93a8-4c28-7f367007aa14 pt        1              3                \ndfs://window_function 9bcc10db-ffe7-4994-4ac7-f37a8cb69c65 pt        1              3                \ndfs://window_function 4ca5d901-6d86-2db8-40eb-ee1d63184b99 pt        1              1       \n*/\n```\n\nGet the number of level files and sort key entries for specified chunk:\n\n```\ngetTSDBDataStat(chunkId=\"520e78eb-49b9-93a8-4c28-7f367007aa14\")\n```\n\n| dbName                  | chunkId                              | tableName | levelFileCount | sortKeyEntryCount |\n| ----------------------- | ------------------------------------ | --------- | -------------- | ----------------- |\n| dfs\\://window\\_function | 520e78eb-49b9-93a8-4c28-7f367007aa14 | pt        | 1              | 3                 |\n"
    },
    "getTSDBMetaData": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTSDBMetaData.html",
        "signatures": [
            {
                "full": "getTSDBMetaData()",
                "name": "getTSDBMetaData",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getTSDBMetaData](https://docs.dolphindb.com/en/Functions/g/getTSDBMetaData.html)\n\n\n\n#### Syntax\n\ngetTSDBMetaData()\n\n#### Details\n\nObtain the metadata of all chunks in the TSDB engine. The function can only be executed on a data node.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nIt returns a table with the following columns:\n\n* chunkId: the chunk ID\n\n* chunkPath: the physical path of the chunk\n\n* level: the file level\n\n* table: the table name\n\n* files: the level file name\n\n#### Examples\n\n```\ngetTSDBMetaData()\n```\n\n| chunkId                          | chunkPath           | level | table | files                    |\n| -------------------------------- | ------------------- | ----- | ----- | ------------------------ |\n| 7e0c65ca-5e4a-4594-2948-fa0b5... | /hdd/hdd7/test/v... | 0     | pt\\_2 | 0\\_00211490,0\\_002115580 |\n| 7e0c65ca-5e4a-4594-2948-fa0b5... | /hdd/hdd7/test/v... | 1     | pt\\_2 | 1\\_00013041              |\n"
    },
    "getTSDBSortKeyEntry": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTSDBSortKeyEntry.html",
        "signatures": [
            {
                "full": "getTSDBSortKeyEntry(chunkId, [tableName])",
                "name": "getTSDBSortKeyEntry",
                "parameters": [
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getTSDBSortKeyEntry](https://docs.dolphindb.com/en/Functions/g/getTSDBSortKeyEntry.html)\n\n#### Syntax\n\ngetTSDBSortKeyEntry(chunkId, \\[tableName])\n\n#### Details\n\nThis function obtains information on the sort key entries of each chunk (See the parameter [sortColumns](https://docs.dolphindb.com/en/Functions/c/createPartitionedTable.html)).\n\nNote that the function cannot check data in the cache engine. You can call [flushTSDBCache](https://docs.dolphindb.com/en/Functions/f/flushTSDBCache.html) to forcibly flush the completed transactions cached in the TSDB cache engine to disk.\n\n#### Parameters\n\n**chunkId** is a STRING scalar or vector indicating the chunk ID. Note: When *chunkId* is a vector, its length cannot exceed 1024.\n\n**tableName** (optional) is a STRING scalar indicating the DFS table name. If not specified, all tables under the specified chunk are checked.\n\n#### Returns\n\nIt returns a table containing the following information:\n\n* chunkId: The chunk ID.\n\n* chunkPath: The DFS path to the chunk.\n\n* tableName: The DFS table name.\n\n* file: The level file name.\n\n* key: The sort key entry. Use an underscore \"\\_\" to separate sort keys.\n\n* size: The number of records with the sort key entry.\n\n#### Examples\n\n```\nn = 10000\nSecurityID = rand(`st0001`st0002`st0003`st0004`st0005, n)\nsym = rand(`A`B`C`D`E, n)\nTradeDate = 2022.01.01 + rand(100,n)\nTotalVolumeTrade = rand(1000..3000, n)\nTotalValueTrade = rand(100.0, n)\nschemaTable_snap = table(SecurityID, sym, TradeDate, TotalVolumeTrade, TotalValueTrade).sortBy!(`SecurityID`sym`TradeDate)\n\ndbPath = \"dfs://TSDB_STOCK\"\nif(existsDatabase(dbPath)){dropDatabase(dbPath)}\ndb_snap = database(dbPath, VALUE, 2022.01.01..2022.01.05, engine='TSDB')\n\nsnap=createPartitionedTable(dbHandle=db_snap, table=schemaTable_snap, tableName=\"snap\", partitionColumns=`TradeDate, sortColumns=`SecurityID`sym`TradeDate, keepDuplicates=ALL, sortKeyMappingFunction=[hashBucket{,3}, hashBucket{,2}])\nsnap.append!(schemaTable_snap)\n\nsnap1=createPartitionedTable(dbHandle=db_snap, table=schemaTable_snap, tableName=\"snap1\", partitionColumns=`TradeDate, sortColumns=`SecurityID`sym`TradeDate, keepDuplicates=ALL)\nsnap1.append!(schemaTable_snap)\n\nflushTSDBCache()\n```\n\n```\ngetChunksMeta()\n```\n\n| site        | chunkId                              | path                                                                 | dfsPath                  | type | flag | size | version | state | versionList                   | resolved |\n| ----------- | ------------------------------------ | -------------------------------------------------------------------- | ------------------------ | ---- | ---- | ---- | ------- | ----- | ----------------------------- | -------- |\n| server11352 | fe93077a-5a05-34a8-554c-67467415bf68 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220410/yv | /TSDB\\_STOCK/20220410/yv | 1    | 0    | 0    | 1       | 0     | cid : 2134,snap1=>2134:89; #  | false    |\n| server11352 | 5c30ef71-3e51-c5ac-6b4d-4458feb8454a | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220407/yv | /TSDB\\_STOCK/20220407/yv | 1    | 0    | 0    | 1       | 0     | cid : 2134,snap1=>2134:95; #  | false    |\n| server11352 | 4216dbe9-c238-49a9-4d45-66829c98a7b5 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220406/yv | /TSDB\\_STOCK/20220406/yv | 1    | 0    | 0    | 1       | 0     | cid : 2134,snap1=>2134:92; #  | false    |\n| server11352 | 47ea0d35-7ea9-c3b3-cc4b-cc6cd1fe039d | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220401/yv | /TSDB\\_STOCK/20220401/yv | 1    | 0    | 0    | 1       | 0     | cid : 2134,snap1=>2134:100; # | false    |\n| server11352 | aafd71c5-a197-63a9-2d4c-b65cbced3d21 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220330/yv | /TSDB\\_STOCK/20220330/yv | 1    | 0    | 0    | 1       | 0     | cid : 2134,snap1=>2134:97; #  | false    |\n\n```\ngetTSDBSortKeyEntry(\"fe93077a-5a05-34a8-554c-67467415bf68\")\n```\n\n| chunkId                              | chunkPath                                                            | tableName | file        | key       | size |\n| ------------------------------------ | -------------------------------------------------------------------- | --------- | ----------- | --------- | ---- |\n| fe93077a-5a05-34a8-554c-67467415bf68 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220410/yv | snap1     | 0\\_00000058 | st0001\\_A | 2    |\n| fe93077a-5a05-34a8-554c-67467415bf68 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220410/yv | snap1     | 0\\_00000058 | st0001\\_B | 3    |\n| fe93077a-5a05-34a8-554c-67467415bf68 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220410/yv | snap1     | 0\\_00000058 | st0001\\_C | 2    |\n| fe93077a-5a05-34a8-554c-67467415bf68 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220410/yv | snap1     | 0\\_00000058 | st0001\\_D | 6    |\n| fe93077a-5a05-34a8-554c-67467415bf68 | /dolphindb/server/server11352/storage/CHUNKS/TSDB\\_STOCK/20220410/yv | snap1     | 0\\_00000058 | st0002\\_A | 4    |\n\n"
    },
    "getTSDBTableIndexCacheStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getTSDBTableIndexCacheStatus.html",
        "signatures": [
            {
                "full": "getTSDBTableIndexCacheStatus()",
                "name": "getTSDBTableIndexCacheStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getTSDBTableIndexCacheStatus](https://docs.dolphindb.com/en/Functions/g/getTSDBTableIndexCacheStatus.html)\n\n#### Syntax\n\ngetTSDBTableIndexCacheStatus()\n\n#### Details\n\nWhen querying a TSDB table, the indexes (including zonemap) of related level files will be loaded to the memory. This function is used to obtain the memory usage (in bytes) of the level file indexes for each loaded table. Combined with function `getTSDBDataStat`, it helps you to check whether the number of sort keys set for tables is reasonable.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturns a table with the following columns:\n\n* dbName: the database name.\n\n* chunkId: the chunk ID.\n\n* tableName: the table name.\n\n* memUsage: the size of the memory used (in bytes).\n\n#### Examples\n\n```\nt = table(1 2 1 1 2 2 3 as month, `Rome`Paris`London`Paris`Rome`London`Rome as city, 200 500 100 300 300 400 400 as sold)\ndb_name = \"dfs://tsdb_01\"\nif (existsDatabase(db_name)) {\n    dropDatabase(db_name)\n}\ndb = database(db_name, HASH, [INT, 4], , 'TSDB')\n\npt = db.createPartitionedTable(t, \"pt\", \"month\", ,\"sold\")\npt.append!(t)\n\npt1 = db.createPartitionedTable(t, \"pt1\", \"month\", ,\"sold\")\npt1.append!(t)\n\nflushTSDBCache()\n\ngetTSDBTableIndexCacheStatus()\n```\n\n| dbName          | chunkId                              | tableName | memUsage |\n| --------------- | ------------------------------------ | --------- | -------- |\n| dfs\\://tsdb\\_01 | 01e891fa-f66d-7599-7544-4e0449f4e608 | pt1\\_3    | 680      |\n| dfs\\://tsdb\\_01 | 81c0f8f7-e195-b298-da4a-d007492f4733 | pt1\\_3    | 680      |\n| dfs\\://tsdb\\_01 | 17f8bc0b-946e-f688-374c-955c586faccf | pt\\_2     | 296      |\n| dfs\\://tsdb\\_01 | 1df88c41-bccf-449b-504c-5978df9cc03f | pt\\_2     | 680      |\n| dfs\\://tsdb\\_01 | 10371e0c-685a-51b1-3042-1ba289514bb9 | pt1\\_3    | 296      |\n| dfs\\://tsdb\\_01 | 0be81d1e-1962-108b-274e-3dc2632921bc | pt\\_2     | 680      |\n\nRelated functions: [getTSDBDataStat](https://docs.dolphindb.com/en/Functions/g/getTSDBDataStat.html), [getLevelFileIndexCacheStatus](https://docs.dolphindb.com/en/Functions/g/getLevelFileIndexCacheStatus.html)\n\n"
    },
    "getUdfEngineVariable": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUdfEngineVariable.html",
        "signatures": [
            {
                "full": "getUdfEngineVariable(engine, name)",
                "name": "getUdfEngineVariable",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [getUdfEngineVariable](https://docs.dolphindb.com/en/Functions/g/getUdfEngineVariable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\ngetUdfEngineVariable(engine, name)\n\n#### Details\n\nQuery the current value of a specified external variable in a given `DStream::udfEngine`.\n\n#### Parameters\n\n**engine**A STRING scalar indicating the name of the user-defined engine created in the stream graph by `DStream::udfEngine`.\n\n**name**A STRING scalar indicating the name of the external variable, which must be one of the variables defined in *variableNames* when creating `DStream::udfEngine.`\n\n#### Returns\n\nThe current value of the specified variable. Its type and format depend on the variable itself.\n\n#### Examples\n\n```\ndef callTimes(mutable cnt, msg) {\n    cnt += 1;\n    return msg\n}\ng = createStreamGraph(\"indicators\")\ng.source(\"trade\", 1024:0, `price`volume, [DOUBLE,INT])\n    .udfEngine(callTimes, [`price,`volume] ,[`number], [5])\n    .setEngineName(\"udf\")\n    .sink(\"output111\")\ng.submit()\n\ngo\nn = 1000\nprice = rand(100, n)\nvolume = rand(1000, n)\nt = table(price, volume)\nappendOrcaStreamTable(\"trade\", t)\n\n// Obtain the current value of number\nuseOrcaStreamEngine(\"udf\", getUdfEngineVariable, \"number\")\n// output: 1005\n```\n\n**Related function:** [DStream::udfEngine](https://docs.dolphindb.com/en/Functions/d/DStream_udfEngine.html)\n"
    },
    "getUnresolvedTxn": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUnresolvedTxn.html",
        "signatures": [
            {
                "full": "getUnresolvedTxn()",
                "name": "getUnresolvedTxn",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getUnresolvedTxn](https://docs.dolphindb.com/en/Functions/g/getUnresolvedTxn.html)\n\n\n\n#### Syntax\n\ngetUnresolvedTxn()\n\n#### Details\n\nGet transactions and nodes in the resolution phase. This can only be executed by an administrator on the controller.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nReturns a table containing the following columns:\n\n* tid: the transaction ID\n\n* cid: the commit ID\n\n* chunkId: the chunk ID\n\n* initiatingNode: the node that initiates the resolution\n\n* firstResolutionAt: the starting time of the resolution\n\n* lastResolutionAt: the starting time of the last resolution when there are multiple resolutions in the transaction\n"
    },
    "getUserAccess": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUserAccess.html",
        "signatures": [
            {
                "full": "getUserAccess([userIds], [finalAccess=false])",
                "name": "getUserAccess",
                "parameters": [
                    {
                        "full": "[userIds]",
                        "name": "userIds",
                        "optional": true
                    },
                    {
                        "full": "[finalAccess=false]",
                        "name": "finalAccess",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [getUserAccess](https://docs.dolphindb.com/en/Functions/g/getUserAccess.html)\n\n#### Syntax\n\ngetUserAccess(\\[userIds], \\[finalAccess=false])\n\n#### Details\n\nThis function returns privileges for specific users.\n\nWhen *userId* is not specified, it returns the privileges for the current user.\n\nWhen *userId*is specified (only by administrators):\n\n* If *finalAccess* = false, the obtained access is the explicit privileges applied to the user.\n\n* If *finalAccess* = true, the obtained access is the privileges that ultimately take effect.\n\n#### Parameters\n\n**userId** (optional) is a STRING scalar/vector indicating one or multiple user names.\n\n**finalAccess** (optional) is a Boolean value that specifies whether the obtained result is the privileges that ultimately take effect, i.e., the privileges for both the user and the groups the user belongs to are taken into account. The default value is false.\n\n#### Returns\n\nA table with the following columns:\n\n| Column                          | Description                                                                                                                                                                                                        |\n| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| userId                          | The user name                                                                                                                                                                                                      |\n| groups                          | The group to which the user belongs                                                                                                                                                                                |\n| isAdmin                         | Whether the user is an administrator                                                                                                                                                                               |\n| MAX\\_JOB\\_PRIORITY              | An integer between 0 and 8 indicating the highest priority of the jobs submitted by the user. It is specified by the command `setMaxJobPriority`.                                                                  |\n| MAX\\_PARALLELISM                | An integer indicating the maximum number of tasks that can be executed in parallel for a job submitted by the user. It is specified by the command `setMaxJobParallelism`.                                         |\n| QUERY\\_RESULT\\_MEM\\_LIMIT       | The memory limit for a query result. It is a floating-point number indicating memory usage (in GB). You can use `grant` to set the limit and `revoke` to remove.                                                   |\n| TASK\\_GROUP\\_MEM\\_LIMIT         | The memory limit of a task group. It is a floating-point number indicating memory usage in GB. You can use `grant` to set the limit and `revoke` to remove.                                                        |\n| MAX\\_PARTITION\\_NUM\\_PER\\_QUERY | The maximum number of partitions that can be queried at one time. It is an integer and a value of -1 indicates that this privilege is not configured. You can use `grant` to set the limit and `revoke` to remove. |\n\nThe following privileges are listed with permission state \"allow\" / \"none\" / \"deny\": ACCESS\\_READ, ACCESS\\_INSERT, ACCESS\\_UPDATE, ACCESS\\_DELETE, VIEW\\_EXEC, SCRIPT\\_EXEC, TEST\\_EXEC, DBOBJ\\_CREATE, DBOBJ\\_DELETE, DB\\_MANAGE, DB\\_OWNER, VIEW\\_OWNER, COMPUTE\\_GROUP\\_EXEC, TABLE\\_SENSITIVE\\_VIEW, DB\\_SENSITIVE\\_VIEW, CREATE\\_SHARED\\_VARS, MCP\\_MANAGE, MCP\\_DEVELOP, MCP\\_EXEC, ORCA\\_MANAGE, ORCA\\_GRAPH\\_CONTROL, ORCA\\_GRAPH\\_CREATE, ORCA\\_GRAPH\\_DROP, ORCA\\_TABLE\\_READ, ORCA\\_TABLE\\_WRITE, ORCA\\_TABLE\\_CREATE, ORCA\\_TABLE\\_DROP, ORCA\\_ENGINE\\_MANAGE.\n\n**Note:**\n\n* Since version 3.00.5, privileges for Orca graphs and stream tables returned.\n* Since version 3.00.2, compute group privileges are returned.\n* Since version 3.00.0, catalog privileges are returned.\n* Version 1.30.21/2.00.9 onwards extends privileges at the table level. The original TABLE\\_WRITE field is now replaced with fields TABLE\\_INSERT, TABLE\\_UPDATE, and TABLE\\_DELETE.\n* As the DB\\_READ, DB\\_WRITE, DB\\_INSERT, DB\\_UPDATE, and DB\\_DELETE privileges apply to tables in databases, only table-level privileges are returned.\n\nThe remaining columns in the table display the specific objects (tables, views or databases) that the user is granted/denied access to:\n\n| objs                                   |\n| -------------------------------------- |\n| TABLE\\_READ\\_allowed                   |\n| TABLE\\_READ\\_denied                    |\n| TABLE\\_INSERT\\_allowed                 |\n| TABLE\\_INSERT\\_denied                  |\n| TABLE\\_UPDATE\\_allowed                 |\n| TABLE\\_UPDATE\\_denied                  |\n| TABLE\\_DELETE\\_allowed                 |\n| TABLE\\_DELETE\\_denied                  |\n| DB\\_READ\\_allowed                      |\n| DB\\_READ\\_denied                       |\n| DB\\_INSERT\\_allowed                    |\n| DB\\_INSERT\\_denied                     |\n| DB\\_UPDATE\\_allowed                    |\n| DB\\_UPDATE\\_denied                     |\n| DB\\_DELETE\\_allowed                    |\n| DB\\_DELETE\\_denied                     |\n| VIEW\\_EXEC\\_allowed                    |\n| VIEW\\_EXEC\\_denied                     |\n| DBOBJ\\_CREATE\\_allowed                 |\n| DBOBJ\\_CREATE\\_denied                  |\n| DBOBJ\\_DELETE\\_allowed                 |\n| DBOBJ\\_DELETE\\_denied                  |\n| DB\\_OWNER\\_allowed                     |\n| DB\\_MANAGE\\_allowed                    |\n| DB\\_MANAGE\\_denied                     |\n| CATALOG\\_READ\\_allowed                 |\n| CATALOG\\_READ\\_denied                  |\n| CATALOG\\_INSERT\\_allowed               |\n| CATALOG\\_INSERT\\_denied                |\n| CATALOG\\_UPDATE\\_allowed               |\n| CATALOG\\_UPDATE\\_denied                |\n| CATALOG\\_DELETE\\_allowed               |\n| CATALOG\\_DELETE\\_denied                |\n| COMPUTE\\_GROUP\\_EXEC\\_allowed          |\n| COMPUTE\\_GROUP\\_EXEC\\_denied           |\n| TABLE\\_SENSITIVE\\_VIEW\\_allowed        |\n| TABLE\\_SENSITIVE\\_VIEW\\_denied         |\n| DB\\_SENSITIVE\\_VIEW\\_allowed           |\n| DB\\_SENSITIVE\\_VIEW\\_denied            |\n| MCP\\_EXEC\\_allowed                     |\n| MCP\\_EXEC\\_denied                      |\n| ORCA\\_MANAGE\\_allowed                  |\n| ORCA\\_MANAGE\\_denied                   |\n| ORCA\\_CATALOG\\_GRAPH\\_CONTROL\\_allowed |\n| ORCA\\_CATALOG\\_GRAPH\\_CONTROL\\_denied  |\n| ORCA\\_GRAPH\\_CONTROL\\_allowed          |\n| ORCA\\_GRAPH\\_CONTROL\\_denied           |\n| ORCA\\_CATALOG\\_GRAPH\\_CREATE\\_allowed  |\n| ORCA\\_CATALOG\\_GRAPH\\_CREATE\\_denied   |\n| ORCA\\_CATALOG\\_GRAPH\\_DROP\\_allowed    |\n| ORCA\\_CATALOG\\_GRAPH\\_DROP\\_denied     |\n| ORCA\\_CATALOG\\_TABLE\\_READ\\_allowed    |\n| ORCA\\_CATALOG\\_TABLE\\_READ\\_denied     |\n| ORCA\\_TABLE\\_READ\\_allowed             |\n| ORCA\\_TABLE\\_READ\\_denied              |\n| ORCA\\_CATALOG\\_TABLE\\_WRITE\\_allowed   |\n| ORCA\\_CATALOG\\_TABLE\\_WRITE\\_denied    |\n| ORCA\\_TABLE\\_WRITE\\_allowed            |\n| ORCA\\_TABLE\\_WRITE\\_denied             |\n| ORCA\\_CATALOG\\_TABLE\\_CREATE\\_allowed  |\n| ORCA\\_CATALOG\\_TABLE\\_CREATE\\_denied   |\n| ORCA\\_CATALOG\\_TABLE\\_DROP\\_allowed    |\n| ORCA\\_CATALOG\\_TABLE\\_DROP\\_denied     |\n| ORCA\\_CATALOG\\_ENGINE\\_MANAGE\\_allowed |\n| ORCA\\_CATALOG\\_ENGINE\\_MANAGE\\_denied  |\n| ORCA\\_ENGINE\\_MANAGE\\_allowed          |\n| ORCA\\_ENGINE\\_MANAGE\\_denied           |\n\n"
    },
    "getUserAccessByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUserAccessByCluster.html",
        "signatures": [
            {
                "full": "getUserAccessByCluster(users, cluster, finalAccess)",
                "name": "getUserAccessByCluster",
                "parameters": [
                    {
                        "full": "users",
                        "name": "users"
                    },
                    {
                        "full": "cluster",
                        "name": "cluster"
                    },
                    {
                        "full": "finalAccess",
                        "name": "finalAccess"
                    }
                ]
            }
        ],
        "markdown": "### [getUserAccessByCluster](https://docs.dolphindb.com/en/Functions/g/getUserAccessByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetUserAccessByCluster(users, cluster, finalAccess)\n\n#### Details\n\nGet the privileges for specified users in a multi-cluster environment. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\n**users** is a STRING vector indicating the usernames.\n\n**cluster** is a STRING scalar indicating the name of the cluster where the users reside.\n\n**finalAccess** is a BOOLEAN scalar indicating whether to return the privileges that ultimately take effect, i.e., the privileges for both the user and the groups the user belongs to are taken into account.\n\n#### Returns\n\nIt returns a table. See function [getUserAccess](https://docs.dolphindb.com/en/Functions/g/getUserAccess.html) for details.\n\n#### Examples\n\n```\ngetUserAccessByCluster([\"admin\"], \"masterOfMaster\", true) \n```\n\n| userId | groups | isAdmin | ACCESS\\_READ | ACCESS\\_INSERT | ACCESS\\_UPDATE | ACCESS\\_DELETE | VIEW\\_EXEC | SCRIPT\\_EXEC | TEST\\_EXEC | DBOBJ\\_CREATE | ... |\n| ------ | ------ | ------- | ------------ | -------------- | -------------- | -------------- | ---------- | ------------ | ---------- | ------------- | --- |\n| admin  |        | 1       | allow        | allow          | allow          | allow          | allow      | allow        | allow      | allow         | ... |\n\nReleated Function: [getUserAccess](https://docs.dolphindb.com/en/Functions/g/getUserAccess.html)\n"
    },
    "getUserHardwareUsage": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getuserhardwareusage.html",
        "signatures": [
            {
                "full": "getUserHardwareUsage([from=0], [to])",
                "name": "getUserHardwareUsage",
                "parameters": [
                    {
                        "full": "[from=0]",
                        "name": "from",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[to]",
                        "name": "to",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getUserHardwareUsage](https://docs.dolphindb.com/en/Functions/g/getuserhardwareusage.html)\n\n\n\n#### Syntax\n\ngetUserHardwareUsage(\\[from=0], \\[to])\n\n#### Details\n\nUse this function to retrieve hardware resource usage of users within a specified time period from query logs (*\\<HomeDir>/resource/hardware.log*). This function requires resource tracking to be enabled (configured via *resourceSamplingInterval*) and can only be called by the administrator on a data node.\n\n#### Parameters\n\n**from** (optional) is an integral or temporal number indicating the start time of the query. The default value is 0, indicating the queried records starts from the record at 1970.01.01 00:00.\n\n**to** (optional) is an integral or temporal number indicating the end time of the query. The default value is null, indicating the query includes records up to the current time.\n\nNote that *from* must be no greater than *to*.\n\n#### Returns\n\nIt returns a table containing the following columns:\n\n* timestamp: a timestamp of NANOTIMESTAMP type.\n* userId: the user ID.\n* cpu: the number of CPU threads used by the user.\n* memory: the memory used (in bytes) by the user.\n* send: the amount of data (in bytes) sent during a sampling interval.\n* recv: the amount of data (in bytes) received during a sampling interval. Note that there may be some discrepancy in the measured data volume, with a potential deviation of up to 2KB.\n\n#### Examples\n\n```\nlogin(\"admin\", \"123456\")\nselect sum(send), sum(recv) from pnodeRun(getUserHardwareUsage) group by userId, node\n```\n\nOutput:\n\n| userId | node         | sum\\_send | sum\\_recv |\n| ------ | ------------ | --------- | --------- |\n| admin  | datanode8902 | 197,783   | 464       |\n| admin  | datanode8903 | 375,911   | 438       |\n| admin  | datanode8904 | 1,080,171 | 735,817   |\n| guest  | datanode8902 | 2,144     | 216       |\n| guest  | datanode8903 | 120       | 0         |\n| guest  | datanode8904 | 399       | 0         |\n| user1  | datanode8902 | 80,222    | 0         |\n| user1  | datanode8903 | 120       | 0         |\n| user1  | datanode8904 | 83,361    | 328       |\n| user2  | datanode8902 | 80,100    | 0         |\n"
    },
    "getUserList": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUserList.html",
        "signatures": [
            {
                "full": "getUserList()",
                "name": "getUserList",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getUserList](https://docs.dolphindb.com/en/Functions/g/getUserList.html)\n\n\n\n#### Syntax\n\ngetUserList()\n\n#### Details\n\nReturns a list of user names other than the administrators. This function can only be executed by administrators.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\nlogin(`admin, `123456);\ngetUserList().sort();\n// output: [\"AA\",\"AAA\",\"BB\",\"BBB\",\"CC\",\"DeionSanders\",\"EliManning\",\"JoeFlacco\"]\n```\n"
    },
    "getUserListOfAllClusters": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUserListOfAllClusters.html",
        "signatures": [
            {
                "full": "getUserListOfAllClusters()",
                "name": "getUserListOfAllClusters",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getUserListOfAllClusters](https://docs.dolphindb.com/en/Functions/g/getUserListOfAllClusters.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngetUserListOfAllClusters()\n\n#### Details\n\nGets users for all clusters in the multi-cluster environment. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA dictionary with the following keys:\n\n* key: Name of the cluster.\n* value: List of the user.\n\n#### Examples\n\n```\ngetUserListOfAllClusters()\n      \n/* Output:\nmasterOfMaster->[\"user1\",\"user2\",\"admin\"]\nMoMSender->[\"admin\",\"user2\"]  \n*/   \n```\n"
    },
    "getUserLockedStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUserLockedStatus.html",
        "signatures": [
            {
                "full": "getUserLockedStatus()",
                "name": "getUserLockedStatus",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getUserLockedStatus](https://docs.dolphindb.com/en/Functions/g/getUserLockedStatus.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\ngetUserLockedStatus()\n\n#### Details\n\nRetrieve the lock status of users in the system. It can only be executed by administrators when the configuration parameter *enhancedSecurityVerification* is set to true.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table with the following columns:\n\n* user: The username of the locked user.\n* IP: The IP address from which the user is locked. If the user was locked by an administrator using the `lockUser` function, this column displays “\\*“.\n* lockTime: The time when the lock was initiated.\n* unlockTime: The expected unlock time. If the user was locked by an administrator using the `lockUser` function, this column is empty.\n\n#### Examples\n\n```\ngetUserLockedStatus()\n```\n\n| user  | IP            | lockTime                | unlockTime              |\n| ----- | ------------- | ----------------------- | ----------------------- |\n| user2 | \\*            | 2025.03.27 11:27:36.597 |                         |\n| user1 | 192.168.0.140 | 2025.03.27 11:27:23.916 | 2025.03.27 11:32:23.916 |\n"
    },
    "getUserPasswordStatus": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUserPasswordStatus.html",
        "signatures": [
            {
                "full": "getUserPasswordStatus([user])",
                "name": "getUserPasswordStatus",
                "parameters": [
                    {
                        "full": "[user]",
                        "name": "user",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getUserPasswordStatus](https://docs.dolphindb.com/en/Functions/g/getUserPasswordStatus.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\ngetUserPasswordStatus(\\[user])\n\n#### Details\n\nRetrieves the password status of the specified user. If *user* is unspecified, the password status of all users in the system except for admin is returned.\n\n#### Parameters\n\n**user**(optional) is a string indicating a user name.\n\n#### Returns\n\nA table with the following columns:\n\n* user: The username.\n* setTime: The time when the current password was set.\n* expireTime: The password expiration time.\n* authMode: The authentication method, which can be either \"SHA256\" or \"SCRAM\".\n\n#### Examples\n\n```\ngetUserPasswordStatus(`user1)\n```\n\n| user  | setTime                       | expireTime                    | authMode |\n| ----- | ----------------------------- | ----------------------------- | -------- |\n| user1 | 2025.03.27 11:51:09.154259866 | 2025.04.26 11:51:09.154259866 | SHA256   |\n"
    },
    "getUsersByGroupId": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getUsersByGroupId.html",
        "signatures": [
            {
                "full": "getUsersByGroupId(groupId)",
                "name": "getUsersByGroupId",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    }
                ]
            }
        ],
        "markdown": "### [getUsersByGroupId](https://docs.dolphindb.com/en/Functions/g/getUsersByGroupId.html)\n\n\n\n#### Syntax\n\ngetUsersByGroupId(groupId)\n\n#### Details\n\nObtains the user names that belong to the specified group. It can only be executed by an administrator.\n\n#### Parameters\n\n**groupId** a string indicating a group name.\n\n#### Returns\n\nReturns a STRING vecto.\n"
    },
    "getUserTableAccessRecords": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getusertableaccessrecords.html",
        "signatures": [
            {
                "full": "getUserTableAccessRecords([from=0], [to])",
                "name": "getUserTableAccessRecords",
                "parameters": [
                    {
                        "full": "[from=0]",
                        "name": "from",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[to]",
                        "name": "to",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getUserTableAccessRecords](https://docs.dolphindb.com/en/Functions/g/getusertableaccessrecords.html)\n\n\n\n#### Syntax\n\ngetUserTableAccessRecords(\\[from=0], \\[to])\n\n#### Details\n\nGet the information stored in query logs (located at *\\<HomeDir>/resource/access.log)* within the specified time range. This function can only be called by the administrator on a data node.\n\n#### Parameters\n\n**from** (optional) is an integral or temporal number indicating the start time of the query. The default value is 0, indicating the queried records starts from the record at 1970.01.01 00:00.\n\n**to** (optional) is an integral or temporal number indicating the end time of the query. The default value is null, indicating the query includes records up to the current time.\n\nNote that *from* must be no greater than *to*.\n\n#### Returns\n\nIt returns a table containing the following fields:\n\n* timestamp: a timestamp of NANOTIMESTAMP type. If type is sql, it indicates the time when the query execution starts; If type is rowCount or memUsage, it indicates the time when data is read.\n\n* rootQueryId: the query ID of a SQL query. It is the unique identifier for DFS SQL queries. A DFS query is split into multiple sub-queries by partition. This ID is the root ID for the DFS query and its sub-queries.\n\n* userId: the login user ID.\n\n* database: the queried database.\n\n* table: the queried table.\n\n* type: the message type, which can be sql, rowCount or memUsage.\n\n* value:\n\n  * the execution count (always 1) when type is *sql*.\n  * the number of records involved in the query when type is rowCount.\n  * the memory usage (in bytes) of the query results when type is *memUsage*.\n\n#### Examples\n\n```\ngetUserTableAccessRecords(2023.12.30T09:18:35.894150296,2023.12.30T09:18:35.894538439)\n```\n\nOutput:\n\n| timestamp                     | rootQueryId                          | userId | database       | table | type     | value | script                              |\n| ----------------------------- | ------------------------------------ | ------ | -------------- | ----- | -------- | ----- | ----------------------------------- |\n| 2023.12.30T09:18:35.894150296 | e892855b-7843-1492-0140-a85810662006 | admin  | dfs\\://rangedb | pt    | sql      | 1     | select count(x) as count\\_x from pt |\n| 2023.12.30T09:18:35.894497304 | e892855b-7843-1492-0140-a85810662006 | admin  | dfs\\://rangedb | pt    | rowCount | 43    |                                     |\n| 2023.12.30T09:18:35.894501600 | e892855b-7843-1492-0140-a85810662006 | admin  | dfs\\://rangedb | pt    | memUsage | 516   |                                     |\n"
    },
    "getWorkDir": {
        "url": "https://docs.dolphindb.com/en/Functions/g/getWorkDir.html",
        "signatures": [
            {
                "full": "getWorkDir()",
                "name": "getWorkDir",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [getWorkDir](https://docs.dolphindb.com/en/Functions/g/getWorkDir.html)\n\nFirst introduced in versions: 2.00.17, 2.00.16.23.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\ngetWorkDir()\n\n#### Details\n\nGets the absolute path of the working directory at the time the dolphindb process is started.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\ngetWorkDir()\n// output: /home/dolphindb/server/clusterDemo  \n```\n"
    },
    "getCEPEngineMonitor": {
        "url": "https://docs.dolphindb.com/en/Functions/g/get_cep_engine_monitor.html",
        "signatures": [
            {
                "full": "getCEPEngineMonitor(engine, subEngineName, [monitorName])",
                "name": "getCEPEngineMonitor",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "subEngineName",
                        "name": "subEngineName"
                    },
                    {
                        "full": "[monitorName]",
                        "name": "monitorName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getCEPEngineMonitor](https://docs.dolphindb.com/en/Functions/g/get_cep_engine_monitor.html)\n\n\n\n#### Syntax\n\ngetCEPEngineMonitor(engine, subEngineName, \\[monitorName])\n\n#### Details\n\nGet a specified or all initial (non-spawned) monitor instances from the specified CEP engine for inspecting their member variables.\n\n#### Parameters\n\n**engine** is an engine object or name.\n\n**subEngineName** is a STRING scalar indicating the name of the CEP sub-engine.\n\n**monitorName** (optional) is a STRING scalar indicating the monitor name. If not specified, returns all initial monitors.\n\n#### Returns\n\nA monitor instance, or a dictionary where the key is the monitor name and the value is the monitor instance.\n\n#### Examples\n\n```\nclass mainMonitor:CEPMonitor{      \n    ordersTable :: ANY  \n    def mainMonitor(){\n        ordersTable = array(ANY, 0)  \n    }\n    \n    def updateOrders(event) {\n        ordersTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n    }\n   \n    def onload(){\n        addEventListener(updateOrders, 'Orders',,'all') \n    }\n}\n\nclass Orders{\n    eventTime :: TIMESTAMP \n    sym :: STRING\n    val0 :: INT\n    val1 :: FLOAT\n    val2 :: DOUBLE\n    def Orders(s,v0,v1,v2){\n        sym = s\n        val0 = v0\n        val1 = v1\n        val2 = v2\n        eventTime = now()\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\ntry{dropStreamEngine(\"cep1\")}catch(ex){}\nengine=createCEPEngine(\"cep1\",<mainMonitor()>,dummy,Orders,,'eventTime',,,\"sym\")\n\nappendEvent(`cep1,Orders(\"a000\", 3, 3.0, 30.0))\n\ngetCEPEngineStat('cep1').subEngineStat[\"subEngineName\"]\n\nmonitors = getCEPEngineMonitor('cep1', 'a000', 'mainMonitor')\n```\n"
    },
    "getCEPEngineStat": {
        "url": "https://docs.dolphindb.com/en/Functions/g/get_cep_engine_stat.html",
        "signatures": [
            {
                "full": "getCEPEngineStat(engine)",
                "name": "getCEPEngineStat",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    }
                ]
            }
        ],
        "markdown": "### [getCEPEngineStat](https://docs.dolphindb.com/en/Functions/g/get_cep_engine_stat.html)\n\n\n\n#### Syntax\n\ngetCEPEngineStat(engine)\n\n#### Details\n\nCheck the status of a specific CEP engine.\n\n#### Parameters\n\n**engine** is the engine object returned by `createCEPEngine`.\n\n#### Returns\n\nIt returns a dictionary containing the following keys:\n\n* EngineStat: a dictionary with the info of engine status (same as the returned info as `getStreamEngineStat().CEPEngine`).\n\n* eventSchema: a table with the info of all events received.\n\n| Column Name | Description                                                                                                                                        |\n| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| eventType   | the event type                                                                                                                                     |\n| eventField  | the field names (separated by comma) of the event type                                                                                             |\n| fieldType   | data types (separated by comma) of *eventField*                                                                                                    |\n| fieldTypeId | data type IDs of *eventField*                                                                                                                      |\n| fieldFormId | data form IDs of eventField (0: scalar; 1: vector; 2: pair; 3: matrix; 4: set; 5: dictionary; 6: table). Currently, only 0 and 1 will be returned. |\n\n* subEngineStat: a table with the info of sub-engine status.\n\n| Column Name        | Description                                                                                                                                                           |\n| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| subEngineName      | the name of the sub-engine                                                                                                                                            |\n| eventsOnInputQueue | the number of events in the input queue                                                                                                                               |\n| monitorNumber      | the number of monitors                                                                                                                                                |\n| listeners          | the number of listeners                                                                                                                                               |\n| timers             | the number of timers. When using `addEventListener` with any of the following parameters specified: *at*, *wait*, *within*, or *exceedTime*, a timer will be created. |\n| eventsRouted       | the number of events routed to the front of the input queue                                                                                                           |\n| eventsSent         | the number of events sent to the end of the input queue                                                                                                               |\n| eventsReceived     | the number of receivedevents                                                                                                                                          |\n| eventsConsumed     | the number of matched events                                                                                                                                          |\n| lastEventTime      | the timestamp of the last event                                                                                                                                       |\n| lastErrorMessage   | the last error message                                                                                                                                                |\n| lastErrorTimestamp | the timestamp of the last error message                                                                                                                               |\n\n* dataViewEngines: a table with the info of data view engines' status.\n\n| Column Name        | Description                                                                                                         |\n| ------------------ | ------------------------------------------------------------------------------------------------------------------- |\n| name               | the name of the data view engine                                                                                    |\n| user               | the name of the user who creates the engine                                                                         |\n| status             | data view engine status                                                                                             |\n| lastErrorMessage   | the last error message                                                                                              |\n| lastErrorTimestamp | the timestamp of the last error message                                                                             |\n| keyColumns         | key column(s) (separated by space) specified by parameter keyColumns.                                               |\n| outputTableName    | the output table name                                                                                               |\n| useSystemTime      | whether *useSystemTime* is set to true                                                                              |\n| throttle           | the time interval between data writes to the *outputTable*. If *throttle* parameter is not specified, returns NULL. |\n| numItems           | the row count                                                                                                       |\n| memoryUsed         | the memory (in bytes) occupied by data view engine                                                                  |\n\n#### Examples\n\n```\nclass Orders{\n    eventTime :: TIMESTAMP \n    sym :: STRING\n    val0 :: INT\n    val1 :: FLOAT\n    val2 :: DOUBLE\n    def Orders(s,v0,v1,v2){\n        sym = s\n        val0 = v0\n        val1 = v1\n        val2 = v2\n        eventTime = now()\n    }\n}\nclass mainMonitor:CEPMonitor {\n    ordersTable :: ANY \n    def mainMonitor(){\n        ordersTable = array(ANY, 0)  \n    }    \n\n    def updateOrders(event) {\n        ordersTable.append!([event.sym, event.val0, event.val1, event.val2])\n    }\n    def onload(){\n        addEventListener(updateOrders, 'Orders',,'all') \n    }\n}\ndummy = table(array(TIMESTAMP, 0) as eventTime,array(STRING, 0) as eventType,  array(BLOB, 0) as blobs)\nengine=createCEPEngine(name=\"cep_engine\",monitors=<mainMonitor()>,dummyTable=dummy,eventSchema=Orders,timeColumn='eventTime')\n\nappendEvent(`cep_engine,Orders(\"a000\", 3, 3.0, 30.0))\n\ngetCEPEngineStat(`cep_engine)\n```\n\n**Related functions**: [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [dropStreamEngine](https://docs.dolphindb.com/en/Functions/d/dropStreamEngine.html)\n"
    },
    "getCEPEngineSubMonitor": {
        "url": "https://docs.dolphindb.com/en/Functions/g/get_cep_engine_sub_monitor.html",
        "signatures": [
            {
                "full": "getCEPEngineSubMonitor(engine, subEngineName, monitorName)",
                "name": "getCEPEngineSubMonitor",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "subEngineName",
                        "name": "subEngineName"
                    },
                    {
                        "full": "monitorName",
                        "name": "monitorName"
                    }
                ]
            }
        ],
        "markdown": "### [getCEPEngineSubMonitor](https://docs.dolphindb.com/en/Functions/g/get_cep_engine_sub_monitor.html)\n\n\n\n#### Syntax\n\ngetCEPEngineSubMonitor(engine, subEngineName, monitorName)\n\n#### Details\n\nReturns the sub-monitors spawned by the specified monitor within a CEP engine.\n\nIf the specified monitor is an initial (non-spawned) monitor, the function returns all sub-monitors it has spawned. If it is already a sub-monitor, the function only returns the monitors directly spawned from it (i.e., one level below).\n\n#### Parameters\n\n**engine** is an engine object or name.\n\n**subEngineName** is a STRING scalar indicating the name of the CEP sub-engine.\n\n**monitorName** is a STRING scalar indicating the monitor name.\n\n#### Returns\n\nA dictionary where the keys are monitor names and the values are the corresponding monitor instances.\n\n#### Examples\n\n```\nclass mainMonitor:CEPMonitor{      \n    ordersTable :: ANY  \n    def mainMonitor(){\n        ordersTable = array(ANY, 0)  \n    }\n    \n    def updateOrders(event) {\n        ordersTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n    }\n   \n    def onload(){\n        addEventListener(updateOrders, 'Orders',,'all') \n    }\n}\n\nclass Orders{\n    eventTime :: TIMESTAMP \n    sym :: STRING\n    val0 :: INT\n    val1 :: FLOAT\n    val2 :: DOUBLE\n    def Orders(s,v0,v1,v2){\n        sym = s\n        val0 = v0\n        val1 = v1\n        val2 = v2\n        eventTime = now()\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\ntry{dropStreamEngine(\"cep1\")}catch(ex){}\nengine=createCEPEngine(\"cep1\",<mainMonitor()>,dummy,Orders,,'eventTime',,,\"sym\")\n\nappendEvent(`cep1,Orders(\"a000\", 3, 3.0, 30.0))\n\ngetCEPEngineStat('cep1').subEngineStat[\"subEngineName\"]\n\nmonitors = getCEPEngineMonitor('cep1', 'a000', 'mainMonitor')\n```\n"
    },
    "getDataViewEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/g/get_data_view_engine.html",
        "signatures": [
            {
                "full": "getDataViewEngine([CEPEngine], dataViewEngineName)",
                "name": "getDataViewEngine",
                "parameters": [
                    {
                        "full": "[CEPEngine]",
                        "name": "CEPEngine",
                        "optional": true
                    },
                    {
                        "full": "dataViewEngineName",
                        "name": "dataViewEngineName"
                    }
                ]
            }
        ],
        "markdown": "### [getDataViewEngine](https://docs.dolphindb.com/en/Functions/g/get_data_view_engine.html)\n\n\n\n#### Syntax\n\ngetDataViewEngine(\\[CEPEngine], dataViewEngineName)\n\n#### Details\n\nGets the handle of data view engine defined in a specific CEP engine.\n\n#### Parameters\n\n**CEPEngine** (optional) is the handle of a CEP engine.\n\n**dataViewEngineName** is the name of data view engine.\n\n#### Returns\n\nA table that records the latest record for each key.\n\n#### Examples\n\n```\nclass trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    eventTime :: TIMESTAMP\n    def trades(t, m, c, p, q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n        eventTime = now()\n    }\n}\n\nclass mainMonitor:CEPMonitor{\n    tradesTable :: ANY\n    isBusy :: BOOL\n    def mainMonitor(){\n        tradesTable = array(ANY, 0)\n        isBusy = false\n    }\n\n    def updateTrades(event)\n\n    def updateTrades2(event)\n\n    def unOnload(){\n        undef('traderDV', SHARED)\n    }\n\n    def onload(){\n        addEventListener(updateTrades, `trades, , \"all\",,,,,\"trades1\")\n        addEventListener(updateTrades2, `trades, , \"all\",,,,,\"trades2\")\n        traderDV = streamTable(array(STRING, 0) as trader, array(STRING, 0) as market, array(SYMBOL, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(INT, 0) as tradeCount, array(BOOL, 0) as busy, array(DATE, 0) as orderDate, array(TIMESTAMP, 0) as updateTime)\n        share(traderDV, 'traderDV')\n        createDataViewEngine('traderDV', objByName('traderDV'), `trader, `updateTime, true)\n    }\n\n    def updateTrades(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n\n    def updateTrades2(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\nengineCep = createCEPEngine('cep1', <mainMonitor()>, dummy, [trades], 1, 'eventTime', 10000)\ntrade1 = trades('t1', 'sz', 's001', 11.0, 10)\ngo\nappendEvent(engineCep, trade1)\n\nmonitors = getCEPEngineMonitor('cep1',\"cep1\",\"mainMonitor\")\n\nlisteners = monitors.getEventListener()\nprint(listeners)\nlisteners['trades1'].terminate()\nprint(listeners)\n```\n\n**Related functions**: [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [createDataViewEngine](https://docs.dolphindb.com/en/Functions/c/create_data_view_engine.html), [deleteDataViewItems](https://docs.dolphindb.com/en/Functions/d/delete_data_view_items.html), [dropDataViewEngine](https://docs.dolphindb.com/en/Functions/d/drop_data_view_engine.html)\n"
    },
    "getEventListener": {
        "url": "https://docs.dolphindb.com/en/Functions/g/get_event_listener.html",
        "signatures": [
            {
                "full": "getEventListener([listenerName])",
                "name": "getEventListener",
                "parameters": [
                    {
                        "full": "[listenerName]",
                        "name": "listenerName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [getEventListener](https://docs.dolphindb.com/en/Functions/g/get_event_listener.html)\n\n\n\n#### Syntax\n\ngetEventListener(\\[listenerName])\n\n#### Details\n\nIn the CEP engine, `getEventListener` is a member method of the monitor, used to query the event listener instances registered in the current monitor. If a *listenerName* is specified, it returns the corresponding event listener instance; otherwise, it returns all event listener instances.\n\n#### Parameters\n\n**listenerName** (optional) is a STRING scalar indicating the name of the event listener.\n\n#### Returns\n\nReturns an event listener instance, or a dictionary where keys are listener names and values are listener instances.\n\n#### Examples\n\n```\nclass trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    eventTime :: TIMESTAMP\n    def trades(t, m, c, p, q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n        eventTime = now()\n    }\n}\n\nclass mainMonitor:CEPMonitor{\n    tradesTable :: ANY\n    isBusy :: BOOL\n    def mainMonitor(){\n        tradesTable = array(ANY, 0)\n        isBusy = false\n    }\n\n    def updateTrades(event)\n\n    def updateTrades2(event)\n\n    def unOnload(){\n        undef('traderDV', SHARED)\n    }\n\n    def onload(){\n        addEventListener(updateTrades, `trades, , \"all\",,,,,\"trades1\")\n        addEventListener(updateTrades2, `trades, , \"all\",,,,,\"trades2\")\n        traderDV = streamTable(array(STRING, 0) as trader, array(STRING, 0) as market, array(SYMBOL, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(INT, 0) as tradeCount, array(BOOL, 0) as busy, array(DATE, 0) as orderDate, array(TIMESTAMP, 0) as updateTime)\n        share(traderDV, 'traderDV')\n        createDataViewEngine('traderDV', objByName('traderDV'), `trader, `updateTime, true)\n    }\n\n    def updateTrades(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n\n    def updateTrades2(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\nengineCep = createCEPEngine('cep1', <mainMonitor()>, dummy, [trades], 1, 'eventTime', 10000)\ntrade1 = trades('t1', 'sz', 's001', 11.0, 10)\ngo\nappendEvent(engineCep, trade1)\n\nmonitors = getCEPEngineMonitor('cep1',\"cep1\",\"mainMonitor\")\n\nlisteners = monitors.getEventListener()\nprint(listeners)\n// Terminate listener\nlisteners['trades1'].terminate()\nprint(listeners)\n```\n\n**Related function**: [addEventListener](https://docs.dolphindb.com/en/Functions/a/add_event_listener.html)\n"
    },
    "glm": {
        "url": "https://docs.dolphindb.com/en/Functions/g/glm.html",
        "signatures": [
            {
                "full": "glm(ds, yColName, xColNames, [family], [link], [tolerance=1e-6], [maxIter=100])",
                "name": "glm",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[family]",
                        "name": "family",
                        "optional": true
                    },
                    {
                        "full": "[link]",
                        "name": "link",
                        "optional": true
                    },
                    {
                        "full": "[tolerance=1e-6]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "1e-6"
                    },
                    {
                        "full": "[maxIter=100]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "100"
                    }
                ]
            }
        ],
        "markdown": "### [glm](https://docs.dolphindb.com/en/Functions/g/glm.html)\n\n\n\n#### Syntax\n\nglm(ds, yColName, xColNames, \\[family], \\[link], \\[tolerance=1e-6], \\[maxIter=100])\n\n#### Details\n\nFit a generalized linear model.\n\n#### Parameters\n\n**ds** is the data source to be trained. It can be generated with function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**yColName** is a string indicating the dependent variable column.\n\n**xColNames** is a STRING scalar/vector indicating the names of the indepenent variable columns.\n\n**family** (optional) is a string indicating the type of distribution. It can be gaussian (default), poisson, gamma, inverseGaussian or binomial.\n\n**link** (optional) is a string indicating the type of the link function.\n\nPossible values of *link* and the dependent variable for each *family*:\n\n| family          | link                                    | default link    | dependent variable   |\n| --------------- | --------------------------------------- | --------------- | -------------------- |\n| gaussian        | identity, inverse, log                  | identity        | DOUBLE type          |\n| poisson         | log, sqrt, identity                     | log             | non-negative integer |\n| gamma           | inverse, identity, log                  | inverse         | y>=0                 |\n| inverseGaussian | inverseOfSquare, inverse, identity, log | inverseOfSquare | y>=0                 |\n| binomial        | logit, probit                           | logit           | y=0,1                |\n\n**tolerance** (optional) is a numeric scalar. The iterations stops if the difference in the value of the log likelihood functions of 2 adjacent iterations is smaller than tolerance. The default value is 0.000001.\n\n**maxIter** (optional) is a positive integer indicating the maximum number of iterations. The default value is 100.\n\n#### Returns\n\nIt returns a dictionary with the following keys: coefficients, link, tolerance, family, xColNames, tolerance, modelName, residualDeviance, iterations and dispersion.\n\n* coefficients is a table with the coefficient estimate, standard deviation, t value and p value for each coefficient;\n* modelName is \"Generalized Linear Model\";\n* iterations is the number of iterations;\n* dispersion is the dispersion coefficient of the model.\n\n#### Examples\n\nFit a generalized linear model model with simulated data:\n\n```\nx1 = rand(100.0, 100)\nx2 = rand(100.0, 100)\nb0 = 6\nb1 = 1\nb2 = -2\nerr = norm(0, 10, 100)\ny = b0 + b1 * x1 + b2 * x2 + err\nt = table(x1, x2, y)\nmodel = glm(sqlDS(<select * from t>), `y, `x1`x2, `gaussian, `identity);\nmodel;\n\n/* output:\ncoefficients->\n\nbeta     stdError tstat      pvalue\n-------- -------- ---------- --------\n1.027483 0.032631 31.487543  0\n-1.99913 0.03517  -56.842186 0\n5.260677 2.513633 2.092858   0.038972\n\nlink->identity\ntolerance->1.0E-6\nfamily->gaussian\nxColNames->[\"x1\",\"x2\"]\nmodelName->Generalized Linear Model\nresidualDeviance->8873.158697\niterations->5\ndispersion->91.475863\n*/\n```\n\nUse the fitted model in forecasting:\n\n```\npredict(model, t);\n```\n\nSave the fitted model to disk:\n\n```\nsaveModel(model, \"C:/DolphinDB/Data/GLMModel.txt\");\n```\n\nLoad a saved model:\n\n```\nloadModel(\"C:/DolphinDB/Data/GLMModel.txt\");\n```\n"
    },
    "gmd5": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gmd5.html",
        "signatures": [
            {
                "full": "gmd5(X)",
                "name": "gmd5",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [gmd5](https://docs.dolphindb.com/en/Functions/g/gmd5.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\ngmd5(X)\n\n#### Details\n\nCreate an MD5 hash from all elements of *X*.\n\n#### Parameters\n\n**X** is a scalar/vector/tuple/array vector/pair/matrix.\n\n#### Returns\n\nA scalar of INT128 type\n\n#### Examples\n\n```\ngmd5([1 2 3])\n// output: 2a1dd1e1e59d0a384c26951e316cd7e6\n\ngmd5([[1, 2], 3])\n// Since the data used to construct the MD5 is identical, the output will also be identical.\n// output: 2a1dd1e1e59d0a384c26951e316cd7e6\n\nxs = array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8, 9 10])\ngmd5(xs)\n// output: c457b6addd2869161f8a853c0f247aaf\n\nys = [1 2 3, 4 5, 6 7 8, 9 10]\ngmd5(ys)\n// output: c457b6addd2869161f8a853c0f247aaf\n\nm=matrix(1 2 3, 8 7 0)\ngmd5(m)\n// output: 660a82bc074f9dccc5c9fbb806f44f5c\n```\n\nRelated functions: [rowGmd5](https://docs.dolphindb.com/en/Functions/r/rowgmd5.html)\n"
    },
    "gmm": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gmm.html",
        "signatures": [
            {
                "full": "gmm(X, k, [maxIter=300], [tolerance=1e-4], [randomSeed], [mean], [sigma])",
                "name": "gmm",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "k",
                        "name": "k"
                    },
                    {
                        "full": "[maxIter=300]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "300"
                    },
                    {
                        "full": "[tolerance=1e-4]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "1e-4"
                    },
                    {
                        "full": "[randomSeed]",
                        "name": "randomSeed",
                        "optional": true
                    },
                    {
                        "full": "[mean]",
                        "name": "mean",
                        "optional": true
                    },
                    {
                        "full": "[sigma]",
                        "name": "sigma",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [gmm](https://docs.dolphindb.com/en/Functions/g/gmm.html)\n\n\n\n#### Syntax\n\ngmm(X, k, \\[maxIter=300], \\[tolerance=1e-4], \\[randomSeed], \\[mean], \\[sigma])\n\n#### Details\n\nTrains the Gaussian Mixture Model (GMM) with the given data set.\n\n#### Parameters\n\n**X** is the training data set. For univariate data, *X* is a vector; For multivariate data, *X* is a matrix/table where each column is a sample.\n\n**k** is an integer indicating the number of independent Gaussians in a mixture model.\n\n**maxlter** (optional) is a positive integer indicating the maximum EM iterations to perform. The default value is 300.\n\n**tolerance** (optional) is a floating-point number indicating the convergence tolerance. EM iterations will stop when the lower bound average gain is below this threshold. The default value is 1e-4.\n\n**randomSeed** (optional) is the random seed given to the method.\n\n**mean** (optional) is a vector or matrix indicating the initial means.\n\n* For univariate data, it is a vector of length *k*;\n\n* For multivariate data, it is a matrix whose number of columns is *k* and number of rows is the same as the number of variables in *X*;\n\n* If *mean* is unspecified, *k* values are randomly selected from *X* as the initial means.\n\n**sigma** (optional) can be\n\n* a vector, indicating the initialized variance of each submodel if *X* is univariate data;\n\n* a tuple of length *k*, indicating the covariance matrix of each submodel if *X* is multivariate data;\n\n* a vector with element values of 1 or an identity matrix if sigma is unspecified.\n\n#### Returns\n\nReturns a dictionary with the following keys:\n\n* modelName: a string \"Gaussian Mixture Model\"\n\n* prior: the prior probability of each submodel\n\n* mean: the expectation of each submodel\n\n* sigma: If *X* is univariate data, it represents the variance of each submodel; If *X* is multivariate data, it represents the covariance matrix of each submodel.\n\n#### Examples\n\n```\ndataT = 6.8 7.2 5.3 9.4 6.5 11.2 25.6 0.6 8.9 4.3 2.2 1.9 8.7 0.2 1.5\nmean = [2, 2]\nre = gmm(dataT, 2, 300, 1e-4, 42, mean)\nre\n/* output:\nsigma->[36.759822,36.759822]\nmodelName->Gaussian Mixture Model\nprior->[0.5,0.5]\nmean->[6.686667,6.686667]\n*/\n\ndataT = transpose(matrix(3.2 1.5 2.6 7.8 6.3 4.2 5.1 8.9 11.2 25.8, 25.6 4.6 8.9 4.3 2.2 1.9 8.7 0.2 1.5 9.3))\nmean = transpose(matrix([1, 0], [0, 1]))\nre = gmm(dataT, 2, 300, 1e-4, 42, mean)\nre\n/* output:\nsigma->(#0        #1\n51.001369 18.273032\n18.273032 9.34789\n,#0       #1\n1.718475 0.629584\n0.629584 67.713701\n)\nmodelName->Gaussian Mixture Model\nprior->[0.558683,0.441317]\nmean->\n#0        #1\n11.152841 3.238262\n3.341493  10.996997\n*/\n```\n"
    },
    "gmtime": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gmtime.html",
        "signatures": [
            {
                "full": "gmtime(X)",
                "name": "gmtime",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [gmtime](https://docs.dolphindb.com/en/Functions/g/gmtime.html)\n\n\n\n#### Syntax\n\ngmtime(X)\n\n#### Details\n\nConvert *X* from local time zone to GMT (Greenwich Mean Time).\n\n#### Parameters\n\n**X** is a scalar or a vector. The data type of *X* can be DATETIME, TIMESTAMP, or NANOTIMESTAMP.\n\n#### Returns\n\nThe return value shares the same data type and form as the input parameter.\n\n#### Examples\n\nThe following examples were conducted in US Eastern time zone.\n\n```\ngmtime(2018.01.22 10:20:26);\n// output: 2018.01.22T15:20:26\n\ngmtime(2017.12.16T13:30:10.008);\n// output: 2017.12.16T18:30:10.008\n```\n"
    },
    "gpFit": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gpFit.html",
        "signatures": [
            {
                "full": "gpFit(engine, [programNum=1], [programCorr=false])",
                "name": "gpFit",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "[programNum=1]",
                        "name": "programNum",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[programCorr=false]",
                        "name": "programCorr",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [gpFit](https://docs.dolphindb.com/en/Functions/g/gpFit.html)\n\n**Note:** This function is not supported by Community Edition. You can [get a trial](https://dolphindb.com/product#downloads-down) of Shark from DolphinDB official website.\n\n#### Syntax\n\ngpFit(engine, \\[programNum=1], \\[programCorr=false])\n\n#### Details\n\nGets the trained programs.\n\n#### Parameters\n\n**engine** is the engine object returned by `createGPLearnEngine`.\n\n**programNum** (optional) is an integer specifying the number of programs returned.\n\n**programCorr** (optional) is a Boolean value indicating whether to return the correlation between programs. The default value is false.\n\n#### Returns\n\nIt returns a table with the following columns:\n\n* program: STRING type, the generated programs.\n\n* fitness: DOUBLE type, the fitness.\n\n* programCorr (if *programCorr*=true): a DOUBLE array vector, the correlation between programs.\n\n#### Examples\n\nSee [Quick Start Guide for Shark GPLearn](https://docs.dolphindb.com/en/Tutorials/gplearn_qsg.html)\n\n"
    },
    "gpPredict": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gpPredict.html",
        "signatures": [
            {
                "full": "gpPredict(engine, input, [programNum=1], [groupCol], [deviceId=0])",
                "name": "gpPredict",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "input",
                        "name": "input"
                    },
                    {
                        "full": "[programNum=1]",
                        "name": "programNum",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[groupCol]",
                        "name": "groupCol",
                        "optional": true
                    },
                    {
                        "full": "[deviceId=0]",
                        "name": "deviceId",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [gpPredict](https://docs.dolphindb.com/en/Functions/g/gpPredict.html)\n\n**Note:** This function is not supported by Community Edition. You can [get a trial](https://dolphindb.com/product#downloads-down) of Shark from DolphinDB official website.\n\n#### Syntax\n\ngpPredict(engine, input, \\[programNum=1], \\[groupCol], \\[deviceId=0])\n\n#### Details\n\nUse a number of *programNum*formulas with better fitness obtained from last training for prediction. Calculation will be conducted by group if *groupCol*is specified.\n\n#### Parameters\n\n**engine** is the engine object returned by `createGPLearnEngine`.\n\n**input** is a table where all columns are of floating-point type indicating the data for prediction.\n\n**programNum** (optional) is an integer specifying the number of programs used for prediction.\n\n**groupCol**(optional) is a string indicating the grouping column. The default is empty. The grouping column will not participate in calculation.\n\n**deviceId** (optional) is an INT scalar or vector specifying the device ID to be used. The default value is 0.\n\n#### Returns\n\nIt returns a table with a number of *programNum*columns, where each column corresponds to a formula trained by `gpFit`.\n\n#### Examples\n\nSee [Quick Start Guide for Shark GPLearn](https://docs.dolphindb.com/en/Tutorials/gplearn_qsg.html)\n\n"
    },
    "gram": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gram.html",
        "signatures": [
            {
                "full": "gram(ds, [colNames], [subMean], [normalize])",
                "name": "gram",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "[colNames]",
                        "name": "colNames",
                        "optional": true
                    },
                    {
                        "full": "[subMean]",
                        "name": "subMean",
                        "optional": true
                    },
                    {
                        "full": "[normalize]",
                        "name": "normalize",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [gram](https://docs.dolphindb.com/en/Functions/g/gram.html)\n\n\n\n#### Syntax\n\ngram(ds, \\[colNames], \\[subMean], \\[normalize])\n\n#### Details\n\nCalculate the Gram matrix of the selected columns in the given table. With a given matrix A, the result is `A.tranpose() dot A`.\n\n#### Parameters\n\n**ds** is one or multiple data source. It is usually generated by function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**colNames** (optional) is a STRING vector indicating column names. The default value is all columns names in *ds*.\n\n**subMean** (optional) is a Boolean value indicating whether to substract from each column its mean. The default value is true.\n\n**normalize** (optional) is a Boolean value indicating whether to divide each column by its standard deviation. The default value is false.\n\n#### Returns\n\nA matrix.\n\n#### Examples\n\n```\nx = [7,1,1,0,5,2]\ny = [0.7, 0.9, 0.01, 0.8, 0.09, 0.23]\nt=table(x, y)\nds = sqlDS(<select * from t>);\ngram(ds);\n```\n\n| #0        | #1      |\n| --------- | ------- |\n| 37.333333 | -0.56   |\n| -0.56     | 0.75895 |\n"
    },
    "gramSchmidt": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gramSchmidt.html",
        "signatures": [
            {
                "full": "gramSchmidt(X, [normalize = false])",
                "name": "gramSchmidt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[normalize = false]",
                        "name": "[normalize = false]"
                    }
                ]
            }
        ],
        "markdown": "### [gramSchmidt](https://docs.dolphindb.com/en/Functions/g/gramSchmidt.html)\n\n\n\n#### Syntax\n\ngramSchmidt(X, \\[normalize = false])\n\n#### Details\n\nThis function converts a matrix of full column rank into an orthogonal matrix.\n\n#### Parameters\n\n**X** is a matrix where each column (as a vector) is linearly independent, i.e., the matrix has column full rank. It cannot contain any null values.\n\n**normalize** (optional) is a Boolean value indicating whether to output a normalized orthogonal matrix. The default value is false.\n\n#### Returns\n\nA matrix of DOUBLE type.\n\n#### Examples\n\n```\nx = matrix([2 3 5, 3 6 2, 8 3 6]);\ngramSchmidt(x)\n\n/* output:\ncol1    col2    col3\n2.0000  1.2105  4.7932\n3.0000  3.3157  -2.1968\n5.0000  -2.4736 -0.5991\n*/\n\n// If normalize=true, a normalized orthogonal matrix is returned.\ngramSchmidt(x, true)\n/* output:\ncol1    col2    col3\n0.3244      0.2808  0.9033\n0.4867      0.7693  -0.414\n0.8111      -0.5739 -0.1129\n*/\n\nx = matrix([1 4, 2 5, 3 6]);\ngramSchmidt(x)\n// An error is raised when the columns of the matrix are linearly dependent.\nvector set must be linearly independent\n```\n"
    },
    "grant": {
        "url": "https://docs.dolphindb.com/en/Functions/g/grant.html",
        "signatures": [
            {
                "full": "grant(userId|groupId,accessType,[objs])",
                "name": "grant",
                "parameters": [
                    {
                        "full": "userId|groupId",
                        "name": "userId|groupId"
                    },
                    {
                        "full": "accessType",
                        "name": "accessType"
                    },
                    {
                        "full": "[objs]",
                        "name": "objs",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [grant](https://docs.dolphindb.com/en/Functions/g/grant.html)\n\n\n\n#### Syntax\n\ngrant(userId|groupId,accessType,\\[objs])\n\n#### Details\n\nGrant a user or group with the specified privilege. Specific functionalities include:\n\n* Administrators can grant all privileges (any accessType) to users or user groups through this command.\n\n* Administrators can grant users all privileges (*accessType*) through this command, but regular users, after having the relevant OWNER privileges, can only grant the following privileges through this command: TABLE\\_READ, TABLE\\_WRITE, TABLE\\_INSERT, TABLE\\_UPDATE, TABLE\\_DELETE, DB\\_READ, DB\\_WRITE, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE, DBOBJ\\_DELETE, DBOBJ\\_CREATE and VIEW\\_EXEC.\n\n* accessType = DB\\_OWNER\n\n  When the *accessType*is DB\\_OWNER, *objs*can be specified as a prefix rule to limit the databases that the user can create and manage. Multiple prefix rules can be passed in a vector to *objs*. If there is already a global DB\\_OWNER privilege granted, adding prefix rules will be invalid. Prefix rules do not override each other if one contains the other. The authorized prefix rules can be viewed using the `getUserAccess` function.\n\n  When a user attempts to create or manage a database, if the user's privilege is denied globally, the operation is prohibited; otherwise, the user's privileges are the union of all the prefix rules, meaning if the database name matches any of the authorized prefix rules, the operation is permitted.\n\n  Note that the prefix rules can only be specified with function `grant`, and revoked with `revoke`, but cannot be denied with `deny`. When the *accessType*is DB\\_OWNER, `deny` only takes effect at a global scope and overrides all previously-defined prefix rules.\n\n* Query Memory Limit Privilege\n\n  Set the memory limit of a query result (when *accessType* = QUERY\\_RESULT\\_MEM\\_LIMIT) or the memory limit of a task group (when *accessType* = TASK\\_GROUP\\_MEM\\_LIMIT) for a user. Different from commands [setMemLimitOfQueryResult](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfQueryResult.html) and [setMemLimitOfTaskGroupResult](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfTaskGroupResult.html), `grant` only applies to the specified user (group is not supported). You can use `revoke` to remove the memory limit set with `grant`.\n\n* accessType = CREATE\\_SHARED\\_VAR\n\n  When the accessType is CREATE\\_SHARED\\_VAR, this privilege controls whether a user can create shared variables. This privilege only takes effect if the system parameter *enableSharedVarCreationControl* is set to true. This is a global privilege and does not support object-level (objs) scoping. By default, the admin user has this privilege, while the guest user and newly created ordinary users do not have it and must be explicitly granted. Newly created administrator users also do not have this privilege by default, but they can explicitly grant it to themselves. If the parameter is set to false, the permission control is disabled and all users can create shared variables.\n\n* Orca graph and stream table privileges: See Section 6.3 at [Orca Real-time Computing Platform](https://docs.dolphindb.com/en/Streaming/orca.md#).\n\n#### Parameters\n\n**userId** | **groupId** is a string indicating a user name or a group name.\n\n**accessType** is the privilege type or memory limit.\n\n**objs** (optional) is a STRING scalar/vector indicating the objects that the priviledges specified by *accessType* applies to. \"\\*\" means all objects. When *accessType* is COMPUTE\\_GROUP\\_EXEC, *objs* must be compute group(s).\n\nSee the privilege table in [User Access Control](https://docs.dolphindb.com/en/Maintenance/UserAccessControl.html) for the values that *accessType* and *objs* can take.\n\n**Note:**\n\n* When managing privileges for shared tables, stream tables or streaming engines, *objs* must be in the format \"tableName\\@nodeAlias\" or \"nodeAlias:tableName\".\n* When managing privileges for IMOLTP databases and tables, *objs* must be in the format \"oltp\\://database/table\\@nodeAlias\" or \"oltp\\://database\\@nodeAlias\".\n\n#### Returns\n\nNone.\n\n#### Examples\n\nGrant all members of group \"production\" the read privilege to all tables and databases:\n\n```\ngrant(`production, TABLE_READ, \"*\")\n```\n\nGrant all members of group \"research\" the write privilege to the table \"dfs\\://db1/t1\":\n\n```\ngrant(`research, TABLE_WRITE, \"dfs://db1/t1\")\n```\n\nGrant all members of group \"research\" the table creation privilege to the databases \"dfs\\://db1\" and \"dfs\\://db2\":\n\n```\ngrant(\"research\", DBOBJ_CREATE, [\"dfs://db1\",\"dfs://db2\"])\n```\n\nGrant the user \"AlexSmith\" the DB\\_MANAGE privilege:\n\n```\ngrant(\"AlexSmith\", DB_MANAGE)\n```\n\nGrant the user \"AlexSmith\" the script execution privilege:\n\n```\ngrant(\"AlexSmith\", SCRIPT_EXEC)\n```\n\nGrant the user \"AlexSmith\" the script test privilege:\n\n```\ngrant(\"AlexSmith\", TEST_EXEC)\n```\n\nGrant the user \"AlexSmith\" the execution privilege of function `f1` under the namespace test1:\n\n```\ngrant(\"AlexSmith\", VIEW_EXEC, \"test1::f1\")\n```\n\nGrant the user \"AlexSmith\" the execution privilege of all functions under the namespace test2:\n\n```\ngrant(\"AlexSmith\", VIEW_EXEC, \"test2::*\")\n```\n\nThe namespace must be a module name. For example, for a module test.dos under the directory moduleDir/mod1/test.dos, grant the user the execution privileges of all functions under the module namespace:\n\n```\ngrant(\"AlexSmith\", VIEW_EXEC, \"mod1::test::*\")\n```\n\nThe following script is not supported:\n\n```\ngrant(\"AlexSmith\", VIEW_EXEC, \"mod1::*\")\n```\n\nIf privilege on a namespace is granted, and later the function views in the namespace are removed with `dropFunctionView`, once the last function view in the namespace is deleted, the authorization for that namespace will also be automatically revoked. Similarly, if there are no function views in the namespace at the time of authorization, an exception will be thrown. For function views without a namespace, they are considered global. The following two methods are equivalent:\n\n```\ngrant(\"AlexSmith\", VIEW_EXEC, \"::f\")\ngrant(\"AlexSmith\", VIEW_EXEC, f)\n```\n\nSet the memory limit of query result to 4 GB for the user \"AlexSmith\".\n\n```\ngrant(\"AlexSmith\", QUERY_RESULT_MEM_LIMIT, 4)\n```\n\nGrant user \"AlexSmith\" the privilege to create and manage databases with prefix \"dbxxx\".\n\n```\ngrant(\"AlexSmith\", DB_OWNER, \"dfs://ddb*\")\n```\n\nMultiple patterns can be passed in a vector to *objs*. For example:\n\n```\ngrant(\"AlexSmith\", DB_OWNER, [\"dfs://ddb_prefix1*\",\"dfs://ddb_prefix2*\"])\n```\n"
    },
    "groups": {
        "url": "https://docs.dolphindb.com/en/Functions/g/groups.html",
        "signatures": [
            {
                "full": "groups(X, [mode='dict'])",
                "name": "groups",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[mode='dict']",
                        "name": "mode",
                        "optional": true,
                        "default": "'dict'"
                    }
                ]
            }
        ],
        "markdown": "### [groups](https://docs.dolphindb.com/en/Functions/g/groups.html)\n\n\n\n#### Syntax\n\ngroups(X, \\[mode='dict'])\n\n#### Details\n\nFor each unique value in *X*, return the indices of all elements that hold the value.\n\n#### Parameters\n\n**X** is a vector.\n\n**mode** (optional) indicates the data form returned by the function. It can be:\n\n* \"dict\" (default): return a dictionary. The key of the dictionary stores the unique value in *X*; the value is a vector that stores the indices of all elements that hold the value.\n\n* \"table\": return a table with 2 columns, \"key\" and \"index\", storing the unique value in *X* and the corresponding indices.\n\n* \"vector\": return an array vector. The elements are the indices of each unique value in *X*, sorted in ascending order.\n\n* \"tuple\": return a tuple. The elements are stored the same as mode=\"vector\".\n\n#### Returns\n\n* If *mode* = \"dict\", return a dictionary.\n* If *mode* = \"table\", return a table with 2 columns, key and index. Each cell in the column index is an array vector.\n\n#### Examples\n\n```\nx=NULL NULL 12 15 12 16 15 14 NULL NULL\ngroups(x);\n\n/* output:\n16->[5]\n->[0,1,8,9]\n12->[2,4]\n14->[7]\n15->[3,6]\n*/\n\n\ngroups\\(x, \"vector\"\\)\n// output: \\[\\[0,1,8,9\\],\\[2,4\\],\\[7\\],\\[3,6\\],\\[5\\]\\]\n\ngroups\\(x, \"tuple\"\\)\n// output: \\(\\[0,1,8,9\\],\\[2,4\\],\\[7\\],\\[3,6\\],\\[5\\]\\)\n\ngroups\\(x, \"table\"\\)\n```\n\n| key | index      |\n| --- | ---------- |\n|     | \\[0,1,8,9] |\n| 2   | \\[2,4]     |\n| 4   | \\[7]       |\n| 5   | \\[3,6]     |\n| 6   | \\[5]       |\n"
    },
    "gt": {
        "url": "https://docs.dolphindb.com/en/Functions/g/gt.html",
        "signatures": [
            {
                "full": "gt(X, Y)",
                "name": "gt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [gt](https://docs.dolphindb.com/en/Functions/g/gt.html)\n\n\n\n#### Syntax\n\ngt(X, Y)\n\nor\n\nX>Y\n\n#### Details\n\nIf neither *X* nor *Y* is a set, return the element-by-element comparison of *X*>*Y*.\n\nIf both *X* and *Y* are sets, check if *Y* is a proper subset of *X*.\n\n#### Parameters\n\n**X** and **Y** is a scalar/pair/vector/matrix/set. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\nIt returns a Boolean value whose form is determined by the input parameter.\n\n#### Examples\n\n```\n1 2 3 > 2;\n// output: [false,false,true]\n\n1 2 3>0 2 4;\n// output: [true,false,false]\n\n2:3>1:6;\n// output: true : false\n\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1 gt 4;\n```\n\n| #0    | #1    | #2   |\n| ----- | ----- | ---- |\n| false | false | true |\n| false | false | true |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1>m2;\n```\n\n| #0    | #1    | #2   |\n| ----- | ----- | ---- |\n| false | false | true |\n| false | true  | true |\n\nSet operation: If *X*>*Y* then *Y* is a proper subset of *X*.\n\n```\nx=set(4 6);\nx;\n\nset(6,4)\n\ny=set(8 9 4 6);\ny;\n\nset(6,4,9,8)\ny>x;\n// output: true\n\nx>y;\n// output: false\n\nx>x;\n// output: false  \n// x is not a proper subset of x\n```\n"
    },
    "nanInfFill": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nanInfFill.html",
        "signatures": [
            {
                "full": "nanInfFill(X,Y)",
                "name": "nanInfFill",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [nanInfFill](https://docs.dolphindb.com/en/Functions/n/nanInfFill.html)\n\n#### Syntax\n\nnanInfFill(X,Y)\n\n#### Details\n\nIn DolphinDB, NaN and Inf values of floating-point numbers are replaced with null values. Nan and Inf values can arise in the course of data import, or during calculations involving external data sources.\n\nThis function replaces the NaN/Inf value in *X* with the specified *Y*.\n\n**Note:**\n\nWhen *X* is a dictionary, only dictionary values are replaced.\n\n#### Parameters\n\n`X` is a floating-point number of any data form except for set.\n\n`Y` is a floating-point number.\n\n#### Returns\n\nAn floating point with the same data form as *X*.\n\n#### Examples\n\n```\nx = [float(`inf), 2, 3, float(`nan), 5, 6, 7]\nnanInfFill (x, 2.2)\n\nx = matrix(1..3, [float(`inf), float(`nan), 1.0])\nnanInfFill(x, 1.2)\n```\n\nRelated functions: [isNanInf](https://docs.dolphindb.com/en/Functions/i/isNanInf.html), [countNanInf](https://docs.dolphindb.com/en/Functions/c/countNanInf.html)\n\n"
    },
    "nanosecond": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nanosecond.html",
        "signatures": [
            {
                "full": "nanosecond(X)",
                "name": "nanosecond",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n\n\n\n#### Syntax\n\nnanosecond(X)\n\n#### Details\n\nFor each element in *X*, return a number indicating which nanosecond of the second it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type TIME, TIMESTAMP, NANOTIME or NANOTIMESTAMP.\n\n#### Returns\n\nA scalar/vector of type INT.\n\n#### Examples\n\n```\nnanosecond(13:30:10.008);\n// output: 8000000\n\nnanosecond([2012.12.03 01:22:01.999999999, 2012.12.03 01:25:08.000000234]);\n// output: [999999999,234]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html)\n"
    },
    "nanotime": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nanotime.html",
        "signatures": [
            {
                "full": "nanotime(X)",
                "name": "nanotime",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [nanotime](https://docs.dolphindb.com/en/Functions/n/nanotime.html)\n\n\n\n#### Syntax\n\nnanotime(X)\n\n#### Details\n\nConvert the data type of X to NANOTIME.\n\n#### Parameters\n\n**X** is an integer or temporal scalar/vector.\n\n#### Returns\n\nA scalar/vector of type NANOTIME.\n\n#### Examples\n\n```\nnanotime(1000000000);\n// output: 00:00:01.000000000\n\nnanotime(12:06:09 13:08:01);\n// output: [12:06:09.000000000,13:08:01.000000000]\n\nnanotime(2012.12.03 01:22:01.123456789);\n// output: 01:22:01.123456789\n\nnanotime('13:30:10.008007006');\n// output: 13:30:10.008007006\n```\n\nRelated function: [nanotimestamp](https://docs.dolphindb.com/en/Functions/n/nanotimestamp.html)\n"
    },
    "nanotimestamp": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nanotimestamp.html",
        "signatures": [
            {
                "full": "nanotimestamp(X)",
                "name": "nanotimestamp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [nanotimestamp](https://docs.dolphindb.com/en/Functions/n/nanotimestamp.html)\n\n\n\n#### Syntax\n\nnanotimestamp(X)\n\n#### Details\n\nConvert the data type of X to NANOTIMESTAMP. If there is no date in the argument X, return a timestamp from 1970.01.01 00:00:00.000000000 + *X* (nanoseconds).\n\nSince version 2.00.12, converting MONTH into NANOTIMESTAMP is allowed.\n\n#### Parameters\n\n**X** is an integer or temporal scalar/vector.\n\n#### Returns\n\nA scalar/vector of type NANOTIMESTAMP.\n\n#### Examples\n\n```\nnanotimestamp(1000000000);\n// output: 1970.01.01T00:00:01.000000000\n\nnanotimestamp(2012.12.03 12:06:09 2012.12.03 13:08:01);\n// output: [2012.12.03T12:06:09.000000000,2012.12.03T13:08:01.000000000]\n\nnanotimestamp(2012.12.03 01:22:01.123456789);\n// output: 2012.12.03T01:22:01.123456789\n\nnanotimestamp('2012.12.03 13:30:10.008007006');\n// output: 2012.12.03T13:30:10.008007006\n\nnanotimestamp(2012.01M)\n// output: 2012.01.01T00:00:00.000000000\n```\n\nRelated function: [nanotime](https://docs.dolphindb.com/en/Functions/n/nanotime.html)\n"
    },
    "ne": {
        "url": "https://docs.dolphindb.com/en/Functions/n/ne.html",
        "signatures": [
            {
                "full": "ne(X, Y)",
                "name": "ne",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [ne](https://docs.dolphindb.com/en/Functions/n/ne.html)\n\n\n\n#### Syntax\n\nne(X, Y) or X!=Y\n\n#### Details\n\nIf neither *X* nor *Y* is a set, conduct the element-by-element comparison of *X* and *Y*; return 1 if the elements in *X* and *Y* are not the same.\n\nIf both *X* and *Y* are sets, check if *X* and *Y* are not identical.\n\n#### Parameters\n\n**X** and **Y** is a scalar/pair/vector/matrix/set. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\nAn INT scalar/pair/vector/matrix.\n\n#### Examples\n\n```\n1 2 3 != 2;\n// output: [1,0,1]\n\n1 2 3 ne 0 2 4;\n// output: [1,0,1]\n\n1:2 != 1:6;\n// output: 0 : 1\n```\n\n```\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1 != 4\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 1  |\n| 1  | 0  | 1  |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1 ne m2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 1  |\n| 1  | 1  | 1  |\n\nSet operation: If X!=Y then X and Y are not identical.\n\n```\nx=set(4 6);\ny=set(4 6 8);\n\nx!=y;\n// output: 1\n\nx!=x;\n// output: 0\n```\n"
    },
    "neg": {
        "url": "https://docs.dolphindb.com/en/Functions/n/neg.html",
        "signatures": [
            {
                "full": "neg(X)",
                "name": "neg",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [neg](https://docs.dolphindb.com/en/Functions/n/neg.html)\n\n\n\n#### Syntax\n\nneg(X)\n\n#### Details\n\nReturn the negative of *X*.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\nThough `neg` and the `-` operator often serve analogous purposes, precedence behavior differs:\n\n* The `neg` function, when parenthesized carries the highest priority, e.g., neg(3) + 5 is -3 + 5. Without parentheses, `neg` has lower precedence than the following expression, e.g., neg 3 + 5 is treated as -(3 + 5) resulting -8.\n\n* The `-` operator always follows the precedence rule. For example: -3 + 5 results in 2.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx=1:2;\n-x;\n// output: -1 : -2\n\nx=1 0 1;\n-x;\n// output: [-1,0,-1]\n```\n\n```\nm=1 1 1 0 0 0 $ 2:3;\nm;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 0  |\n| 1  | 0  | 0  |\n\n```\n-m\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| -1 | -1 | 0  |\n| -1 | 0  | 0  |\n"
    },
    "neville": {
        "url": "https://docs.dolphindb.com/en/Functions/n/neville.html",
        "signatures": [
            {
                "full": "neville(X, Y, resampleRule, [closed='left'], [origin='start_day'], [outputX=false])",
                "name": "neville",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "resampleRule",
                        "name": "resampleRule"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    },
                    {
                        "full": "[outputX=false]",
                        "name": "outputX",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [neville](https://docs.dolphindb.com/en/Functions/n/neville.html)\n\n\n\n#### Syntax\n\nneville(X, Y, resampleRule, \\[closed='left'], \\[origin='start\\_day'], \\[outputX=false])\n\n#### Details\n\nResample *X* based on the specified *resampleRule*, *closed* and *origin*. Perform neville interpolation on *Y* based on the resampled *X*.\n\nIf *outputX* is unspecified, return a vector of *Y* after the interpolation.\n\nIf *outputX*=true, return a tuple where the first element is the vector of resampled *X* and the second element is a vector of *Y* after the interpolation.\n\n#### Parameters\n\n**X** is a strictly increasing vector of temporal type.\n\n**Y** is a numeric vector of the same length as *X*.\n\n**resampleRule** is a string. See the parameter *rule* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html) for the optional values.\n\n**closed** and **origin** are the same as the parameters *closed* and *origin* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html).\n\n**outputX** is a Boolean value indicating whether to output the resampled *X*. The default value is false.\n\n#### Returns\n\nA DOUBLE vector/tuple.\n\n#### Examples\n\n**Example 1**\n\n```\nneville([2016.02.14 00:00:00, 2016.02.15 00:00:00, 2016.02.16 00:00:00], [1.0, 2.0, 4.0], resampleRule=`60min);\n\n/* output:\n[1,1.0217,1.0451,1.0703,1.0972,1.1259,1.1562,1.1884,1.2222,1.2578,\n1.2951,1.3342,1.375,1.4175,1.4618,1.5078,1.5556,1.605,1.6562,1.7092,\n1.7639,1.8203,1.8785,1.9384,2,2.0634,2.1285,2.1953,2.2639,2.3342,\n2.4062,2.48,2.5556,2.6328,2.7118,2.7925,2.875,2.9592,3.0451,3.1328,\n3.2222,3.3134,3.4062,3.5009,3.5972,3.6953,3.7951,3.8967,4]\n*/\n```\n\n**Example 2** Different values of *closed* affect the result.\n\n```\n// Data points fall exactly on 3-minute boundaries\nX = 2022.01.01T00:00:00 + [0, 3, 6, 9] * 60  // 00:00, 00:03, 00:06, 00:09\nY = [1.0, 3.0, 7.0, 13.0]\n\n// closed='left' (default): interval [t, t+3min); 00:03 is the start of the second bucket\nneville(X, Y, `3min, closed=`left, outputX=true)\n\n// closed='right': interval (t, t+3min]; 00:03 is the end of the first bucket\n// Bucket boundaries shift, interpolation curve changes accordingly\nneville(X, Y, `3min, closed=`right, outputX=true)\n```\n\n**Example 3** Different values of *origin* affect the result.\n\n```\n// Data starts at 00:00:30 and is not aligned to whole minutes\nX = 2022.01.01T00:00:30 + (0..4) * 60  // 00:00:30, 00:01:30, ..., 00:04:30\nY = [2.0, 4.0, 7.0, 11.0, 16.0]\n\n// origin='start_day' (default): align to 00:00:00 of the same day\n// Resampled X: 00:00:00, 00:01:00, 00:02:00, 00:03:00, 00:04:00\nneville(X, Y, `1min, origin=`start_day, outputX=true)\n\n// origin='start': align to the first data point 00:00:30\n// Resampled X: 00:00:30, 00:01:30, 00:02:30, 00:03:30, 00:04:30\nneville(X, Y, `1min, origin=`start, outputX=true)\n\n// origin=custom timestamp: align to 00:00:10\n// Resampled X: 00:00:10, 00:01:10, 00:02:10, 00:03:10, 00:04:10\nneville(X, Y, `1min, origin=2022.01.01T00:00:10, outputX=true)\n```\n\n**Example 4** Different values of *outputX* affect the result.\n\n```\nX = [2016.02.14T00:00:00, 2016.02.15T00:00:00, 2016.02.16T00:00:00]\nY = [1.0, 2.0, 4.0]\n\n// outputX=false (default): return only the interpolated Y vector\nneville(X, Y, `60min)\n\n// outputX=true: return a tuple; [0] is the resampled timestamp vector, [1] is the interpolated Y\nresult = neville(X, Y, `60min, outputX=true)\nresult[0]  // One timestamp per hour, 49 in total\nresult[1]  // Corresponding interpolated Y values, 49 in total\n```\n"
    },
    "next": {
        "url": "https://docs.dolphindb.com/en/Functions/n/next.html",
        "signatures": [
            {
                "full": "next(X)",
                "name": "next",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [next](https://docs.dolphindb.com/en/Functions/n/next.html)\n\n\n\n#### Syntax\n\nnext(X)\n\n#### Details\n\nShift the elements of a vector to the left for one position. In comparison, [prev](https://docs.dolphindb.com/en/Functions/p/prev.html) shifts the elements of a vector to the right for one position; [move](https://docs.dolphindb.com/en/Functions/m/move.html) shifts the elements of a vector for multiple positions.\n\nIn Python, the `next` function retrieves the next element from an iterator. In contrast, `next(X)` in DolphinDB is equivalent to `shift(X, -1)` in Python.\n\n#### Parameters\n\n**X** is a vector/matrix/table.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nx = 1..5;\nnext(x);\n// output: [2,3,4,5,]\n```\n\n```\nx = matrix(1 2 3 4 5);\nnext(x)\n```\n\n| #0 |\n| -- |\n| 2  |\n| 3  |\n| 4  |\n| 5  |\n|    |\n\n```\nt=table(1 2 3 as a, `x`y`z as b, 10.8 7.6 3.5 as c);\nnext(t)\n```\n\n| a | b | c   |\n| - | - | --- |\n| 2 | y | 7.6 |\n| 3 | z | 3.5 |\n|   |   |     |\n"
    },
    "nextState": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nextState.html",
        "signatures": [
            {
                "full": "nextState(X)",
                "name": "nextState",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [nextState](https://docs.dolphindb.com/en/Functions/n/nextState.html)\n\n\n\n#### Syntax\n\nnextState(X)\n\n#### Details\n\nConsecutive elements in *X* with the same value feature the same state, and a null value has no state. The state of each element is equal to its value. Return the next state of the current state for each element in *X*. If it is null, return the next adjacent state.\n\nIf *X* is a matrix, return the next state for each column of the matrix.\n\n#### Parameters\n\n**X** is a vector or matrix of temporal/Boolean/numeric type.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nX = [1, 2.2, NULL, 2.2, 2.3, 1, 1.2]\nnext(X)\n// output: [2.2,,2.2,2.3,1,1.2,]\n\nnextState(X)\n// output: [2.2,2.2,2.2,2.3,1,1.2,]\n\nX = matrix([1.0, 1.1, 1.0, 0.9], [NULL, 1.3, 2.5, 5.5], [5.5, 4.2, 1.6, 1.8])\nnextState(X)\n```\n\n| #0  | #1  | #2  |\n| --- | --- | --- |\n| 1.1 | 1.3 | 4.2 |\n| 1   | 2.5 | 1.6 |\n| 0.9 | 5.5 | 1.8 |\n|     |     |     |\n\nRelated function: [prevState](https://docs.dolphindb.com/en/Functions/p/prevState.html)\n"
    },
    "norm": {
        "url": "https://docs.dolphindb.com/en/Functions/n/norm.html",
        "signatures": [
            {
                "full": "norm(mean, std, count)",
                "name": "norm",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "std",
                        "name": "std"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [norm](https://docs.dolphindb.com/en/Functions/n/norm.html)\n\n\n\n#### Syntax\n\nnorm(mean, std, count)\n\nAlias: normal\n\n#### Details\n\nReturn a vector (matrix) that follows a normal distribution.\n\nIn Python, `numpy.linalg.norm` is used to compute the norm of a matrix or vector, while `scipy.stats.norm` can be used to generate a normal distribution object.\n\n#### Parameters\n\n**mean** is a numeric scalar indicating the mean of a normal distribution.\n\n**std** is a numeric scalar indicating standard deviation of a normal distribution.\n\n**count** is an integral scalar/pair. A scalar indicates the length of the output vector. A pair indicates the dimension of the output matrix.\n\n#### Returns\n\nA DOUBLE vector/matrix.\n\n#### Examples\n\n```\nnorm(2.0,0.1,3);\n// output: [2.026602,1.988621,2.101107]\n\nmean norm(3,1,10000);\n// output: 3.007866\n\nstd norm(3,1,10000);\n// output: 0.995806\n\n//Generate a random matrix\nnorm(0, 1, 3:2)\n```\n\n| col1    | col2    |\n| ------- | ------- |\n| -0.5399 | -0.8475 |\n| -1.0029 | 1.811   |\n| -0.0485 | -0.4339 |\n"
    },
    "normal": {
        "url": "https://docs.dolphindb.com/en/Functions/n/normal.html",
        "signatures": [
            {
                "full": "norm(mean, std, count)",
                "name": "norm",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "std",
                        "name": "std"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [normal](https://docs.dolphindb.com/en/Functions/n/normal.html)\n\nAlias for [norm](https://docs.dolphindb.com/en/Functions/n/norm.html)\n\n\nDocumentation for the `norm` function:\n### [norm](https://docs.dolphindb.com/en/Functions/n/norm.html)\n\n\n\n#### Syntax\n\nnorm(mean, std, count)\n\nAlias: normal\n\n#### Details\n\nReturn a vector (matrix) that follows a normal distribution.\n\nIn Python, `numpy.linalg.norm` is used to compute the norm of a matrix or vector, while `scipy.stats.norm` can be used to generate a normal distribution object.\n\n#### Parameters\n\n**mean** is a numeric scalar indicating the mean of a normal distribution.\n\n**std** is a numeric scalar indicating standard deviation of a normal distribution.\n\n**count** is an integral scalar/pair. A scalar indicates the length of the output vector. A pair indicates the dimension of the output matrix.\n\n#### Returns\n\nA DOUBLE vector/matrix.\n\n#### Examples\n\n```\nnorm(2.0,0.1,3);\n// output: [2.026602,1.988621,2.101107]\n\nmean norm(3,1,10000);\n// output: 3.007866\n\nstd norm(3,1,10000);\n// output: 0.995806\n\n//Generate a random matrix\nnorm(0, 1, 3:2)\n```\n\n| col1    | col2    |\n| ------- | ------- |\n| -0.5399 | -0.8475 |\n| -1.0029 | 1.811   |\n| -0.0485 | -0.4339 |\n"
    },
    "not": {
        "url": "https://docs.dolphindb.com/en/Functions/n/not.html",
        "signatures": [
            {
                "full": "not(X)",
                "name": "not",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [not](https://docs.dolphindb.com/en/Functions/n/not.html)\n\n\n\n#### Syntax\n\nnot(X) or !(X)\n\n#### Details\n\nReturn NOT of each element of *X*. Returned values are 0, 1, or null. NOT of 0 is 1; NOT of null is still null; NOT of all other values is 0.\n\nThough `not` and the `!` operator often serve analogous purposes, precedence behavior differs:\n\n* The `not` function, when parenthesized carries the highest priority. Without parentheses, `not` has lower precedence than the following expression, e.g., `not false and false` is equivalent to `not(false and false)`, which returns true.\n\n* The `!` operator always follows the precedence rule. For example: `！false and false` is equivalent to `(!false) and false`, which returns false.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\n#### Returns\n\nBOOL type with the same data form as *X*.\n\n#### Examples\n\n```\n!1.5;\n// output: 0\n\nnot 0;\n// output: 1\n\nx=1 0 2;\nnot x;\n// output: [0,1,0]\n```\n\n```\nm=1 1 1 1 1 0 0 0 0 0$2:5;\nm;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 1  | 1  | 0  | 0  |\n| 1  | 1  | 0  | 0  | 0  |\n\n```\nnot m;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 0  | 0  | 0  | 1  | 1  |\n| 0  | 0  | 1  | 1  | 1  |\n\n```\n(1).not();\n// output: 0\n\n(!NULL)==NULL;\n// output: 1\n```\n\nRelated functions: [and](https://docs.dolphindb.com/en/Functions/a/and.html), [or](https://docs.dolphindb.com/en/Programming/Operators/OperatorReferences/or.html)\n"
    },
    "notBetween": {
        "url": "https://docs.dolphindb.com/en/Functions/n/notbetween.html",
        "signatures": [
            {
                "full": "notBetween(X, Y)",
                "name": "notBetween",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [notBetween](https://docs.dolphindb.com/en/Functions/n/notbetween.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nnotBetween(X, Y)\n\n#### Details\n\nCheck if each element of *X* is outside the range specified by *Y*.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\n**Y** is a pair indicating a range (both boundaries are inclusive).\n\n#### Returns\n\nA Boolean scalar or vector/matrix of the same dimension as *X*.\n\n#### Examples\n\n```\nnotBetween([1, 5.5, 6, 8], 1:6);\n// output: [false,false,false,true]\n\nnotBetween(1 2.4 3.6 2 3.9, 2.4:3.6);\n// output: [true,false,false,true,true]\n```\n\n`notBetween` can be used with SQL SELECT tocheck whether values fall outside the specified range:\n\n```\nt = table(`abb`aac`aaa as sym, 1.8 2.3 3.7 as price);\nselect * from t where price notBetween 1:3;\n```\n\n| sym | price |\n| --- | ----- |\n| aaa | 3.7   |\n\n`notBetween`can also be applied to queries on DFS tables:\n\n```\nlogin(`admin,`123456)\ndbName=\"dfs://database1\"\nif(existsDatabase(dbName)){\n\tdropDatabase(dbName)\n}\ndb=database(dbName,VALUE,2019.01.01..2019.01.03)\nn=100\ndatetime=take(2019.01.01 +0..100,n)\nsym = take(`C`MS`MS`MS`IBM`IBM`IBM`C`C$SYMBOL,n)\nprice= take(49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29,n)\nqty = take(2200 1900 2100 3200 6800 5400 1300 2500 8800,n)\nt=table(datetime, sym, price, qty)\ntrades=db.createPartitionedTable(t,`trades,`datetime).append!(t)\n\nselect * from trades where qty notBetween 1300:6800\n```\n\n| datetime   | sym | price | qty   |\n| ---------- | --- | ----- | ----- |\n| 2019.01.09 | C   | 51.29 | 8,800 |\n| 2019.01.18 | C   | 51.29 | 8,800 |\n| 2019.01.27 | C   | 51.29 | 8,800 |\n| 2019.02.05 | C   | 51.29 | 8,800 |\n| 2019.02.14 | C   | 51.29 | 8,800 |\n| 2019.02.23 | C   | 51.29 | 8,800 |\n| 2019.03.04 | C   | 51.29 | 8,800 |\n| 2019.03.13 | C   | 51.29 | 8,800 |\n| 2019.03.22 | C   | 51.29 | 8,800 |\n| 2019.03.31 | C   | 51.29 | 8,800 |\n| 2019.04.09 | C   | 51.29 | 8,800 |\n\nRelated function: [between](https://docs.dolphindb.com/en/Functions/b/between.html)\n"
    },
    "notIn": {
        "url": "https://docs.dolphindb.com/en/Functions/n/notin.html",
        "signatures": [
            {
                "full": "notIn(X, Y)",
                "name": "notIn",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [notIn](https://docs.dolphindb.com/en/Functions/n/notin.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nnotIn(X, Y)\n\n#### Details\n\n* If *Y* is a scalar:\n  * If *Y* is of temporal types, check if each element in *X* is not in*Y*;\n  * If *Y* is a scalar of other data types, check if *X* and *Y* are not equal.\n  * If *Y* is a null value, return true.\n* If *Y* is a vector, check if each element of *X* is notin *Y*.\n* If *Y* is a dictionary, check if each element of *X* is not a key in the dictionary *Y*.\n* If *Y* is an in-memory table with one column, check if each element of *X* is not a value in the column of *Y*. Note the column cannot be array vector.\n* If *Y* is a keyed table or an indexed table, check if each element of *X* is not a key of *Y*. The number of elements in *X* must equal the number of key columns of *Y*.\n\n#### Parameters\n\n**X** is a scalar, vector, tuple, matrix, array vector, dictionary, in-memory table with one column, keyed table, or indexed table.\n\n**Y** is a scalar, vector, dictionary, in-memory table with one column, keyed table, or indexed table.\n\n#### Returns\n\nA Boolean scalar or vector.\n\n#### Examples\n\n```\nx=18:21:35+0..2\ny=18:21:35\nnotIn(x,y)\n// output: [false,true,true]\n\nnotIn(3 3 5 2, 2 3);\n// output: [false,false,true,false]\n\nx=dict(INT,DOUBLE);\nx[1, 2, 3]=[4.5, 6.6, 3.2];\nx;\n/* output\n3->3.2\n1->4.5\n2->6.6\n*/\n\nnotIn(1..6, x);\n// output: [false,false,false,true,true,true]\n\nt = table(1 3 5 7 9 as id)\n2 3 notIn t\n// output: [true,false]\n\nkt = keyedTable(`name`id,1000:0,`name`id`age`department,[STRING,INT,INT,STRING])\ninsert into kt values(`Tom`Sam`Cindy`Emma`Nick, 1 2 3 4 5, 30 35 32 25 30, `IT`Finance`HR`HR`IT)\nnotIn((`Tom`Cindy, 1 3), kt);\n// output: [false,false]\n\nt1 = indexedTable(`sym`side, 10000:0, `sym`side`price`qty, [SYMBOL,CHAR,DOUBLE,INT])\ninsert into t1 values(`IBM`MSFT`GOOG, ['B','S','B'], 10.01 10.02 10.03, 10 10 20)\nnotIn((`IBM`MSFT, ['S','S']), t1);\n// output: [true,false]\n```\n\nWhen *X* is a floating-point number and *Y* is an integer, *X* will be converted to the data type of *Y*.\n\n```\nnotIn(10, NULL)\n// output: true\n\nnotIn('a', 97)\n// output: false\n\nnotIn(1, 1.1 1.2 1.3)\n// output: true\n\nnotIn(float(1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8), 1..9)\n// output: [false,false,false,false,false,false,false,false]\n```\n\n`in` can be used SQL SELECT for range filtering.\n\n```\nselect * from kt where name notIn [`Tom, `Cindy];\n```\n\n| name | id | age | department |\n| ---- | -- | --- | ---------- |\n| Sam  | 2  | 35  | Finance    |\n| Emma | 4  | 25  | HR         |\n| Nick | 5  | 30  | IT         |\n\n`notIn` can also be applied to queries on DFS tables:\n\n```\nlogin(`admin,`123456)\ndbName=\"dfs://database1\"\nif(existsDatabase(dbName)){\n\tdropDatabase(dbName)\n}\ndb=database(dbName,VALUE,2019.01.01..2019.01.03)\nn=100\ndatetime=take(2019.01.01 +0..100,n)\nsym = take(`C`MS`MS`MS`IBM`IBM`IBM`C`C$SYMBOL,n)\nprice= take(49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29,n)\nqty = take(2200 1900 2100 3200 6800 5400 1300 2500 8800,n)\nt=table(datetime, sym, price, qty)\ntrades=db.createPartitionedTable(t,`trades,`datetime).append!(t)\n\nselect * from trades where sym notIn `IBM`C\n```\n\nRelated function: [in](https://docs.dolphindb.com/en/Functions/i/in.html)\n"
    },
    "notLike": {
        "url": "https://docs.dolphindb.com/en/Functions/n/notlike.html",
        "signatures": [
            {
                "full": "notLike(X, pattern)",
                "name": "notLike",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    }
                ]
            }
        ],
        "markdown": "### [notLike](https://docs.dolphindb.com/en/Functions/n/notlike.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nnotLike(X, pattern)\n\n#### Details\n\nThis function checks whether *X* does not match the pattern specified by *pattern*. The comparison is case-sensitive.\n\n#### Parameters\n\n**X** is a STRING scalar/vector.\n\n**pattern** is a string, usually containing wildcards (e.g., \"%\").\n\n#### Returns\n\nA Boolean scalar or vector.\n\n#### Examples\n\n```\nnotLike(`DEFG, `DE);\n// output: true\n\nnotLike(`DEFG, \"%DE%\");\n// output: false\n\n\na=`IBM`ibm`MSFT`Goog;\nnotLike(a, \"%OO%\");\n// output: [true,true,true,true]\n\nprint a[notLike(a, \"%OO%\")];\n// output: [\"IBM\",\"ibm\",\"MSFT\",\"Goog\"]\n```\n\n`notLike` can be used with SQL SELECT to exclude records matching certain conditions:\n\n```\nt = table(`abb`aac`aaa as sym, 1.8 2.3 3.7 as price);\nselect * from t where sym notLike \"%aa%\";\n```\n\n| sym | price |\n| --- | ----- |\n| abb | 1.8   |\n\n`notLike`can also be applied to queries on DFS tables:\n\n```\n\ndbName=\"dfs://database1\"\nif(existsDatabase(dbName)){\n\tdropDatabase(dbName)\n}\ndb=database(dbName,VALUE,2019.01.01..2019.01.03)\nn=100\ndatetime=take(2019.01.01 +0..100,n)\nsym = take(`C`MS`MS`MS`IBM`IBM`IBM`C`C$SYMBOL,n)\nprice= take(49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29,n)\nqty = take(2200 1900 2100 3200 6800 5400 1300 2500 8800,n)\nt=table(datetime, sym, price, qty)\ntrades=db.createPartitionedTable(t,`trades,`datetime).append!(t)\n\nselect * from trades where sym notLike \"%IBM%\"\n```\n\nReleated function: [like](https://docs.dolphindb.com/en/Functions/l/like.html)\n"
    },
    "now": {
        "url": "https://docs.dolphindb.com/en/Functions/n/now.html",
        "signatures": [
            {
                "full": "now([nanoSecond=false])",
                "name": "now",
                "parameters": [
                    {
                        "full": "[nanoSecond=false]",
                        "name": "nanoSecond",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [now](https://docs.dolphindb.com/en/Functions/n/now.html)\n\n\n\n#### Syntax\n\nnow(\\[nanoSecond=false])\n\n#### Details\n\nReturn the current timestamp.\n\n**Note:** Nanosecond precision may not be supported on certain versions of Windows. Therefore, even if `nanoSecond=true` is specified, it may still return timestamps with millisecond precision.\n\n#### Parameters\n\n**nanoSecond** a Boolean value indicating whether to display the result with nanosecond precision.\n\n#### Returns\n\nA TIMESTAMP/NANOTIMESTAMP scalar.\n\n#### Examples\n\n```\nnow();\n// output: 2016.05.12T19:32:49.613\n\nnow(true);\n// output: 2016.05.12T19:32:49.614243000\n```\n"
    },
    "ns": {
        "url": "https://docs.dolphindb.com/en/Functions/n/ns.html",
        "signatures": [
            {
                "full": "ns(maturity, yield, [method='nm'], [maxIter], [bounds], [initialGuess], [seed])",
                "name": "ns",
                "parameters": [
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "yield",
                        "name": "yield"
                    },
                    {
                        "full": "[method='nm']",
                        "name": "method",
                        "optional": true,
                        "default": "'nm'"
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[bounds]",
                        "name": "bounds",
                        "optional": true
                    },
                    {
                        "full": "[initialGuess]",
                        "name": "initialGuess",
                        "optional": true
                    },
                    {
                        "full": "[seed]",
                        "name": "seed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ns](https://docs.dolphindb.com/en/Functions/n/ns.html)\n\n\n\n#### Syntax\n\nns(maturity, yield, \\[method='nm'], \\[maxIter], \\[bounds], \\[initialGuess], \\[seed])\n\n#### Details\n\nFit yield curve using NS (Nelson-Siegel) model.\n\n#### Parameters\n\n**maturity** is a numeric vector with non-negative elements, indicating the maturity (in years) of a bond.\n\n**yield** is a numeric vector of the same length as *maturity*, indicating the bond yield.\n\n**method** (optional) is a string indicating the model used. It can be:\n\n* 'nm' (default): Nelder-Mead simplex algorithm.\n* 'bfgs': BFGS algorithm.\n* 'lbfgs': LBFGS algorithm.\n* 'slsqp': Sequential Least Squares Programming algorithm.\n* 'de': Differential Evolution algorithm.\n\n**maxIter** (optional) is an integral scalar or vector indicating the maximum number of iterations for the optimization algorithm during the fitting process.\n\n**bounds** (optional) is a numeric matrix in the shape of (N,2), where N is the number of parameters to be optimized. The two elements of each row defines the bounds (min, max) on that parameter. Note that *bounds* only takes effect when method is 'lbfgs', ‘slsqp’ or ‘de’.\n\n**initialGuess** (optional) is a numeric vector indicating the initial guess for the parameters that optimize the function.\n\nNS model: The vector contains 4 elements: initial guess of β0, β1, β2, λ, with the default value \\[0.01, 0.01, 0.01, 1.0].\n\nNSS model: The vector contains 6 elements: initial guess of β0, β1, β2, β3, λ0, λ1, with the default value \\[0.01, 0.01, 0.01, 0.01, 1.0, 1.0].\n\n**seed** (optional) is an integer indicating the random number seed used in the differential evolution algorithm to ensure the reproducibility of results. It only takes effect when *method*='de'. If not specified, a non-deterministic random number generator is used.\n\n#### Returns\n\nReturns a dictionary with the following keys:\n\n* modelName: The model used.\n* params: The fitted model parameters.\n  * NS model: a vector of length 4, containing β0, β1, β2, λ.\n  * NSS model: a vector of length 6, containing β0, β1, β2, β3, λ0, λ1.\n* fminResult: The optimization result.\n  * 'nm' : See fmin.\n  * 'bfgs': See fminBFGS.\n  * 'lbfgs': See fminLBFGSB.\n  * 'slsqp': See fminSLSQP.\n  * 'de': See differentialEvolution.\n* predict: The prediction function of the model, which returns the predicted yield with this model. It can be called using `model.predict(T)` or `predict(model, T)`, where T is the maturity in years.\n\n#### Examples\n\nUse the bfgs method to fit yield curve based on NS (Nelson-Siegel) model.\n\n```\nmaturity = [1,2,3,4,5,8,10,15,20,25,30]\nyield = [0.0039,0.0061,NULL,NULL,0.0166,NULL,0.0258,NULL,NULL,0.0332,NULL]\nmodel = ns(maturity, yield, method='bfgs');\nmodel;\n/*Output\nmodelName->ns\nparams->[0.037907009765789,-0.032345632006991,-0.048221596538028,1.48711064869407]\nfminResult->xopt->[0.037907009765789,-0.032345632006991,-0.048221596538028,1.48711064869407]\nfopt->7.682740281926149E-8\ngopt->[0.000007050477817,-0.000001557728067,8.217072418048589E-7,-7.435919702203364E-8]\niterations->29\nHinv->#0                  #1                    #2                   #3                   \n------------------- --------------------- -------------------- ---------------------\n1.046957491287936   -2.422265785994416    4.016547235964936    174.575362711334378  \n-2.422265785994413  20.767722224747515    -55.516118469836506  -1160.911707217612729\n4.016547235964929   -55.516118469836506   162.441840532431541  3127.297987855009978 \n174.575362711334378 -1160.911707217613638 3127.297987855011797 72743.950482441126951\n\nwarnFlag->0\nfcalls->165\ngcalls->33\n\npredict->nssPredict\n*/\n```\n\nUse the nm method to fit yield curve based on NS (Nelson-Siegel) model.\n\n```\nmodel = ns(maturity, yield, method='nm');\nmodel;\n/*Output\nmodelName->ns\nmodelName->ns\nparams->[-0.017297505365068,0.016544815374471,0.142682692134247,14.720778706012911]\nfminResult->xopt->[-0.017297505365068,0.016544815374471,0.142682692134247,14.720778706012911]\nfopt->0.000001443427918\niterations->446\nfcalls->740\nwarnFlag->0\n\npredict->nssPredict\n*/\n```\n\nRelated Function: [nss](https://docs.dolphindb.com/en/Functions/n/nss.html)\n"
    },
    "nss": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nss.html",
        "signatures": [
            {
                "full": "nss(maturity, yield, [method='nm'], [maxIter], [bounds], [initialGuess], [seed])",
                "name": "nss",
                "parameters": [
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "yield",
                        "name": "yield"
                    },
                    {
                        "full": "[method='nm']",
                        "name": "method",
                        "optional": true,
                        "default": "'nm'"
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[bounds]",
                        "name": "bounds",
                        "optional": true
                    },
                    {
                        "full": "[initialGuess]",
                        "name": "initialGuess",
                        "optional": true
                    },
                    {
                        "full": "[seed]",
                        "name": "seed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [nss](https://docs.dolphindb.com/en/Functions/n/nss.html)\n\n\n\n#### Syntax\n\nnss(maturity, yield, \\[method='nm'], \\[maxIter], \\[bounds], \\[initialGuess], \\[seed])\n\n#### Details\n\nFit yield curve using NSS (Nelson-Siegel-Svensson) model.\n\n#### Parameters\n\n**maturity** is a numeric vector with non-negative elements, indicating the maturity (in years) of a bond.\n\n**yield** is a numeric vector of the same length as *maturity*, indicating the bond yield.\n\n**method** (optional) is a string indicating the model used. It can be:\n\n* 'nm' (default): Nelder-Mead simplex algorithm.\n* 'bfgs': BFGS algorithm.\n* 'lbfgs': LBFGS algorithm.\n* 'slsqp': Sequential Least Squares Programming algorithm.\n* 'de': Differential Evolution algorithm.\n\n**maxIter** (optional) is an integral scalar or vector indicating the maximum number of iterations for the optimization algorithm during the fitting process.\n\n**bounds** (optional) is a numeric matrix in the shape of (N,2), where N is the number of parameters to be optimized. The two elements of each row defines the bounds (min, max) on that parameter. Note that *bounds* only takes effect when method is 'lbfgs', ‘slsqp’ or ‘de’.\n\n**initialGuess** (optional) is a numeric vector indicating the initial guess for the parameters that optimize the function.\n\nNS model: The vector contains 4 elements: initial guess of β0, β1, β2, λ, with the default value \\[0.01, 0.01, 0.01, 1.0].\n\nNSS model: The vector contains 6 elements: initial guess of β0, β1, β2, β3, λ0, λ1, with the default value \\[0.01, 0.01, 0.01, 0.01, 1.0, 1.0].\n\n**seed** (optional) is an integer indicating the random number seed used in the differential evolution algorithm to ensure the reproducibility of results. It only takes effect when *method*='de'. If not specified, a non-deterministic random number generator is used.\n\n#### Returns\n\nReturns a dictionary with the following keys:\n\n* modelName: The model used.\n* params: The fitted model parameters.\n  * NS model: a vector of length 4, containing β0, β1, β2, λ.\n  * NSS model: a vector of length 6, containing β0, β1, β2, β3, λ0, λ1.\n* fminResult: The optimization result.\n  * 'nm' : See fmin.\n  * 'bfgs': See fminBFGS.\n  * 'lbfgs': See fminLBFGSB.\n  * 'slsqp': See fminSLSQP.\n  * 'de': See differentialEvolution.\n* predict: The prediction function of the model, which returns the predicted yield with this model. It can be called using `model.predict(T)` or `predict(model, T)`, where T is the maturity in years.\n\n#### Examples\n\nUse the bfgs method to fit yield curve based on NSS (Nelson-Siegel-Svensson) model.\n\n```\nmaturity = [1,2,3,4,5,8,10,15,20,25,30]\nyield = [0.0039,0.0061,NULL,NULL,0.0166,NULL,0.0258,NULL,NULL,0.0332,NULL]\nmodel = nss(maturity, yield, method='bfgs');\nmodel;\n\n/*Output\nmodelName->nss\nparams->[0.036140551464406,-0.017389058792285,-0.039552798745696,-0.039554933812457,1.001838685848857,1.000930288743548]\nfminResult->xopt->[0.036140551464406,-0.017389058792285,-0.039552798745696,-0.039554933812457,1.001838685848857,1.000930288743548]\nfopt->0.000003185056025\ngopt->[4.415407204305666E-7,8.382398277717584E-7,-2.683916591195157E-7,-4.651950860079524E-7,-0.000008569511408,-0.000008564345961]\niterations->10\nHinv->#0                 #1                 #2                 #3                 #4                 #5                \n------------------ ------------------ ------------------ ------------------ ------------------ ------------------\n0.492426526437359  0.696702464055202  -1.643864246164442 -1.644086017367336 0.08871259052824   0.037055616913674 \n0.696702464055203  9.022078200827937  -9.027640937693616 -9.027654505585944 0.659730122918773  0.302144825834614 \n-1.643864246164441 -9.027640937693616 12.179963755936533 11.180865226841653 -0.737531568671335 -0.323934330889313\n-1.644086017367337 -9.027654505585944 11.180865226841657 12.181767428775573 -0.737537584440894 -0.32392102429678 \n0.08871259052824   0.659730122918772  -0.737531568671335 -0.737537584440894 1.053013492023418  0.024560701245749 \n0.037055616913674  0.302144825834614  -0.323934330889313 -0.32392102429678  0.024560701245749  1.011692492570688 \n\nwarnFlag->0\nfcalls->84\ngcalls->12\n\npredict->nssPredict\n*/\n```\n\nUse the nm method to fit yield curve based on NSS (Nelson-Siegel-Svensson) model.\n\n```\nmodel = ns(maturity, yield, method='nm');\nmodel;\n/*Output\nmodelName->nss\nparams->[0.038184469794996,-0.048575389082029,-0.022287414169806,0.047523360012739,1.873046195772644,0.161159907274023]\nfminResult->xopt->[0.038184469794996,-0.048575389082029,-0.022287414169806,0.047523360012739,1.873046195772644,0.161159907274023]\nfopt->5.456415848001168E-9\niterations->541\nfcalls->860\nwarnFlag->0\n\npredict->nssPredict\n*/\n```\n\nRelated Functions: [nsspredict](https://docs.dolphindb.com/en/Functions/n/nssPredict.html), [ns](https://docs.dolphindb.com/en/Functions/n/ns.html)\n"
    },
    "nssPredict": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nssPredict.html",
        "signatures": [
            {
                "full": "nssPredict(model, T)",
                "name": "nssPredict",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "T",
                        "name": "T"
                    }
                ]
            }
        ],
        "markdown": "### [nssPredict](https://docs.dolphindb.com/en/Functions/n/nssPredict.html)\n\n#### Syntax\n\nnssPredict(model, T)\n\n#### Details\n\nPredict yield using the NS/NSS model.\n\n#### Parameters\n\n**model** is a dictionary with the following key-value pairs:\n\n* modelName: A string \"ns\" (Nelson-Siegel) or \"nss\" (Nelson-Siegel-Svensson).\n\n* params: A numeric vector indicating the fitted model parameters.\n\n  * NS model: a vector of length 4, containing β0, β1, β2, λ.\n\n  * NSS model: a vector of length 6, containing β0, β1, β2, β3, λ0, λ1.\n\n**T** is a numeric vector with positive elements, indicating the maturity (in years) of a bond.\n\n#### Returns\n\nA DOUBLE vector.\n\n#### Examples\n\n```\nmodel = dict(STRING, ANY)\nmodel[`modelName] = `nss\nmodel[`params] = [0.038184469794996,-0.048575389082029,-0.022287414169806,0.047523360012739,1.873046195772644,0.161159907274023]\nT = [3,1]\nnssPredict(model, T)\n//output: [0.009904201306,0.003891991292041]\n```\n\n"
    },
    "nullFill!": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nullFill!.html",
        "signatures": [
            {
                "full": "nullFill!(X, newValue)",
                "name": "nullFill!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "newValue",
                        "name": "newValue"
                    }
                ]
            }
        ],
        "markdown": "### [nullFill!](https://docs.dolphindb.com/en/Functions/n/nullFill!.html)\n\n\n\n#### Syntax\n\nnullFill!(X, newValue)\n\n#### Details\n\nPlease refer to [nullFill](https://docs.dolphindb.com/en/Functions/n/nullFill.html). The only difference between `nullFill` and `nullFill!` is that the latter assigns the result to *X* and thus changing the value of *X* after the execution.\n"
    },
    "nullFill": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nullFill.html",
        "signatures": [
            {
                "full": "nullFill(X, Y)",
                "name": "nullFill",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [nullFill](https://docs.dolphindb.com/en/Functions/n/nullFill.html)\n\n\n\n#### Syntax\n\nnullFill(X, Y)\n\n#### Details\n\nWhen *X* is a scalar, *Y* must be a scalar, and the function replaces the null value in *X* with *Y*.\n\nWhen *X* is a vector/matrix:\n\n* If *Y* is a scalar: replaces the null values in *X* with *Y*.\n\n* If *Y* is a vector/matrix : replaces the null values in *X* with the values of corresponding elements in *Y*.\n\nWhen *X* is a table, *Y* must be a scalar, and the function replaces all null values in *X* with *Y*. It is especially useful when we would like to replace all null values in a table with a certain value, such as -999999. Note that the system will convert the data type of *Y* to the specified column during the replacement. If *Y* cannot be converted, an error is raised.\n\nThe function always returns a new object. Input *X* is not altered.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n**Y** is either a scalar, or a vector/matrix with the same dimension as *X*.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\nEx 1. For vectors:\n\n```\nx=1 NULL NULL 6 NULL 7;\nnullFill(x,0);\n// output: [1,0,0,6,0,7]\n\ny=1..6\nnullFill(x,y);\n// output: [1,2,3,6,5,7]\n```\n\nUse function `nullFill` on a vector in a table in a SQL statement:\n\n```\nID=take(1,6) join take(2,6)\ndate=take(2018.01.01..2018.01.06, 12)\nx=3.2 5.2 NULL 7.4 NULL NULL NULL NULL 8 NULL NULL 11\nt=table(ID, date, x)\nt;\n```\n\n| ID | date       | x   |\n| -- | ---------- | --- |\n| 1  | 2018.01.01 | 3.2 |\n| 1  | 2018.01.02 | 5.2 |\n| 1  | 2018.01.03 |     |\n| 1  | 2018.01.04 | 7.4 |\n| 1  | 2018.01.05 |     |\n| 1  | 2018.01.06 |     |\n| 2  | 2018.01.01 |     |\n| 2  | 2018.01.02 |     |\n| 2  | 2018.01.03 | 8   |\n| 2  | 2018.01.04 |     |\n| 2  | 2018.01.05 |     |\n| 2  | 2018.01.06 | 11  |\n\n```\nupdate t set x=x.nullFill(avg(x)) context by id;\nt;\n```\n\n| ID | date       | x        |\n| -- | ---------- | -------- |\n| 1  | 2018.01.01 | 3.2      |\n| 1  | 2018.01.02 | 5.2      |\n| 1  | 2018.01.03 | 5.266667 |\n| 1  | 2018.01.04 | 7.4      |\n| 1  | 2018.01.05 | 5.266667 |\n| 1  | 2018.01.06 | 5.266667 |\n| 2  | 2018.01.01 | 9.5      |\n| 2  | 2018.01.02 | 9.5      |\n| 2  | 2018.01.03 | 8        |\n| 2  | 2018.01.04 | 9.5      |\n| 2  | 2018.01.05 | 9.5      |\n| 2  | 2018.01.06 | 11       |\n\nEx 2. For matrices:\n\n```\nx=1 NULL 2 NULL 3 4 $ 3:2;\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  |    |\n|    | 3  |\n| 2  | 4  |\n\n```\nx.nullFill(0);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 0  |\n| 0  | 3  |\n| 2  | 4  |\n\nEx 3. For tables:\n\n```\nt=table(1..6 as id, 2.1 2.2 NULL NULL 2.4 2.6 as x, 4.3 NULL 3.6 6.7 8.8 NULL as y);\nnullFill(t, -999999);\n```\n\n| id | x       | y       |\n| -- | ------- | ------- |\n| 1  | 2.1     | 4.3     |\n| 2  | 2.2     | -999999 |\n| 3  | -999999 | 3.6     |\n| 4  | -999999 | 6.7     |\n| 5  | 2.4     | 8.8     |\n| 6  | 2.6     | -999999 |\n\nRelated functions: [isNull](https://docs.dolphindb.com/en/Functions/i/isNull.html), [hasNull](https://docs.dolphindb.com/en/Functions/h/hasNull.html), [bfill](https://docs.dolphindb.com/en/Functions/b/bfill.html), [ffill](https://docs.dolphindb.com/en/Functions/f/ffill.html), [lfill](https://docs.dolphindb.com/en/Functions/l/lfill.html)\n"
    },
    "nunique": {
        "url": "https://docs.dolphindb.com/en/Functions/n/nunique.html",
        "signatures": [
            {
                "full": "nunique(X, [ignoreNull=false])",
                "name": "nunique",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ignoreNull=false]",
                        "name": "ignoreNull",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [nunique](https://docs.dolphindb.com/en/Functions/n/nunique.html)\n\n\n\n#### Syntax\n\nnunique(X, \\[ignoreNull=false])\n\n#### Details\n\nIf *X* is a vector/array vector, return the number of unique elements in *X*.\n\nIf *X* is a tuple, elements of each vector at the same position forms a key, and this function returns the number of unique keys.\n\n**Note:** In SQL-92, `COUNT(DISTINCT ...)` is commonly used to count unique values. DolphinDB does not currently support this syntax. Use `nunique(...)` as an equivalent alternative. That is, `nunique(...)` in DolphinDB is equivalent to `COUNT(DISTINCT ...)` in SQL-92. See the examples below for details.\n\n#### Parameters\n\n**X** is a vector/array vector or a tuple composed of multiple vectors with same length.\n\n**ignoreNull** (optional) is a Boolean value. If set to true, only non-null elements will be included in the calculation. The default value is false. Note that if *X* is a tuple or array vector, *ignoreNull* must be set to false.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\nv = [1,3,1,-6,NULL,2,NULL,1];\nnunique(v);\n// output: 5\n\n// set ignoreNull=true\nnunique(v,true);\n// output: 4\n```\n\n```\na = array(INT[], 0, 10).append!([1 2 3, 3 5, 6 8 8, 9 10])\nnunique(a)\n// output: 8\n```\n\n```\nt=table(1 2 4 8 4 2 7 1 as id, 10 20 40 80 40 20 70 10 as val);\nselect nunique([id,val]) from t;\n```\n\n| nunique |\n| ------- |\n| 5       |\n\n```\ndbName = \"dfs://testdb\"\nif(existsDatabase(dbName)){\n   dropDatabase(dbName)\n}\n\ndb=database(\"dfs://testdb\", VALUE, 2012.01.11..2012.01.29)\n\nn=100\nt=table(take(2012.01.11..2012.01.29, n) as date, symbol(take(\"A\"+string(21..60), n)) as sym, take(100, n) as val)\n\npt=db.createPartitionedTable(t, `pt, `date).append!(t)\nselect nunique(date) from pt group by sym\n```\n\n```\ndbName = \"dfs://testdb\"\nif(existsDatabase(dbName)){\ndropDatabase(dbName)\n}\n\ndb=database(\"dfs://testdb\", VALUE, 2012.01.11..2012.01.29)\n\nn=100\nt=table(take(2012.01.11..2012.01.29, n) as date, symbol(take(\"A\"+string(21..60), n)) as sym, take(100, n) as val)\n\npt=db.createPartitionedTable(t, `pt, `date).append!(t)\nselect nunique(date) from pt group by sym\n```\n\nThe following examples demonstrate how to count unique users in MySQL and DolphinDB, respectively.\n\nThe MySQL example below returns a result of 4.\n\n```\nCREATE TABLE orders (\n    order_id INT,\n    user_id INT,\n    product_id INT,\n    order_date DATE\n);\n\nINSERT INTO orders VALUES\n(1, 1001, 101, '2026-01-01'),\n(2, 1002, 101, '2026-01-02'),\n(3, 1001, 102, '2026-01-03'),\n(4, 1003, 101, '2026-01-04'),\n(5, 1002, 102, '2026-01-05'),\n(6, 1004, 103, '2026-01-06'),\n(7, 1001, 101, '2026-01-07');\n\nSELECT count(distinct user_id) AS unique_users\nFROM orders;\n```\n\nThe DolphinDB example also returns a result of 4.\n\n```\nCREATE TABLE orders (\n    order_id INT,\n    user_id INT,\n    product_id INT,\n    order_date DATE\n);\n\nINSERT INTO orders VALUES(1, 1001, 101, '2026-01-01')\nINSERT INTO orders VALUES(2, 1002, 101, '2026-01-02')\nINSERT INTO orders VALUES(3, 1001, 102, '2026-01-03')\nINSERT INTO orders VALUES(4, 1003, 101, '2026-01-04')\nINSERT INTO orders VALUES(5, 1002, 102, '2026-01-05')\nINSERT INTO orders VALUES(6, 1004, 103, '2026-01-06')\nINSERT INTO orders VALUES(7, 1001, 101, '2026-01-07')\n\nselect nunique(user_id) FROM orders;\n```\n"
    },
    "lasso": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lasso.html",
        "signatures": [
            {
                "full": "lasso(ds, yColName, xColNames, [alpha=1.0], [intercept=true], [normalize=false], [maxIter=1000], [tolerance=0.0001], [positive=false], [swColName], [checkInput=true])",
                "name": "lasso",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[alpha=1.0]",
                        "name": "alpha",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[normalize=false]",
                        "name": "normalize",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[maxIter=1000]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[tolerance=0.0001]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "0.0001"
                    },
                    {
                        "full": "[positive=false]",
                        "name": "positive",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    },
                    {
                        "full": "[checkInput=true]",
                        "name": "checkInput",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [lasso](https://docs.dolphindb.com/en/Functions/l/lasso.html)\n\n\n\n#### Syntax\n\nlasso(ds, yColName, xColNames, \\[alpha=1.0], \\[intercept=true], \\[normalize=false], \\[maxIter=1000], \\[tolerance=0.0001], \\[positive=false], \\[swColName], \\[checkInput=true])\n\n#### Parameters\n\n**ds** is an in-memory table or a data source usually generated by the [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html) function.\n\n**yColName** is a string indicating the column name of the dependent variable in *ds*.\n\n**xColNames** is a string scalar/vector indicating the column names of the independent variables in *ds*.\n\n**alpha** is a floating number representing the constant that multiplies the L1-norm. The default value is 1.0.\n\n**intercept** is a Boolean value indicating whether to include the intercept in the regression. The default value is true.\n\n**normalize** is a Boolean value. If true, the regressors will be normalized before regression by subtracting the mean and dividing by the L2-norm. If *intercept* =false, this parameter will be ignored. The default value is false.\n\n**maxIter** is a positive integer indicating the maximum number of iterations. The default value is 1000.\n\n**tolerance** is a floating number. The iterations stop when the improvement in the objective function value is smaller than *tolerance*. The default value is 0.0001.\n\n**positive** is a Boolean value indicating whether to force the coefficient estimates to be positive. The default value is false.\n\n**swColName** is a STRING indicating a column name of *ds*. The specified column is used as the sample weight. If it is not specified, the sample weight is treated as 1.\n\n**checkInput** is a BOOLEAN value. It determines whether to enable validation check for parameters *yColName*, *xColNames*, and *swColName*.\n\n* If *checkInput* = true (default), it will check the invalid value for parameters and throw an error if the null value exists.\n\n* If *checkInput* = false, the invalid value is not checked.\n\nIt is recommended to specify *checkInput* = true. If it is false, it must be ensured that there are no invalid values in the input parameters and no invalid values are generated during intermediate calculations, otherwise the returned model may be inaccurate.\n\n#### Details\n\nEstimate a Lasso regression that performs L1 regularization.\n\nMinimize the following objective function: ![](https://docs.dolphindb.com/en/images/lasso.png)\n\n#### Examples\n\n```\ny = [225.720746,-76.195841,63.089878,139.44561,-65.548346,2.037451,22.403987,-0.678415,37.884102,37.308288];\nx0 = [2.240893,-0.854096,0.400157,1.454274,-0.977278,-0.205158,0.121675,-0.151357,0.333674,0.410599];\nx1 = [0.978738,0.313068,1.764052,0.144044,1.867558,1.494079,0.761038,0.950088,0.443863,-0.103219];\nt = table(y, x0, x1);\n\nlasso(t, `y, `x0`x1);\n```\n\nIf *t* is a DFS table, then the input should be a data source:\n\n```\nlasso(sqlDS(<select * from t>), `y, `x0`x1);\n```\n"
    },
    "lassoBasic": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lassoBasic.html",
        "signatures": [
            {
                "full": "lassoBasic(Y, X, [mode=0], [alpha=1.0], [intercept=true], [normalize=false], [maxIter=1000], [tolerance=0.0001], [positive=false], [swColName], [checkInput=true])",
                "name": "lassoBasic",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[mode=0]",
                        "name": "mode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[alpha=1.0]",
                        "name": "alpha",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[normalize=false]",
                        "name": "normalize",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[maxIter=1000]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[tolerance=0.0001]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "0.0001"
                    },
                    {
                        "full": "[positive=false]",
                        "name": "positive",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    },
                    {
                        "full": "[checkInput=true]",
                        "name": "checkInput",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [lassoBasic](https://docs.dolphindb.com/en/Functions/l/lassoBasic.html)\n\n\n\n#### Syntax\n\nlassoBasic(Y, X, \\[mode=0], \\[alpha=1.0], \\[intercept=true], \\[normalize=false], \\[maxIter=1000], \\[tolerance=0.0001], \\[positive=false], \\[swColName], \\[checkInput=true])\n\n#### Details\n\nPerform lasso regression.\n\nMinimize the following objective function:\n\n![](https://docs.dolphindb.com/en/images/lasso.png)\n\n#### Parameters\n\n**Y** is a numeric vector indicating the dependent variables.\n\n**X** is a numeric vector/tuple/matrix/table, indicating the independent variables.\n\n* When *X* is a vector/tuple, its length must be equal to the length of *Y*.\n\n* When *X* is a matrix/table, its number of rows must be equal to the length of *Y*.\n\n**mode** is an integer that can take the following three values:\n\n* 0 (default) : a vector of the coefficient estimates.\n\n* 1: a table with coefficient estimates, standard error, t-statistics, and p-values.\n\n* 2: a dictionary with the following keys: ANOVA, RegressionStat, Coefficient and Residual\n\n  | Source of Variance | DF (degree of freedom) | SS (sum of square)             | MS (mean of square)               | F (F-score) | Significance |\n  | ------------------ | ---------------------- | ------------------------------ | --------------------------------- | ----------- | ------------ |\n  | Regression         | p                      | sum of squares regression, SSR | regression mean square, MSR=SSR/R | MSR/MSE     | p-value      |\n  | Residual           | n-p-1                  | sum of squares error, SSE      | mean square error, MSE=MSE/E      |             |              |\n  | Total              | n-1                    | sum of squares total, SST      |                                   |             |              |\n\n  | Item         | Description                                                                                                                                   |\n  | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |\n  | R2           | R-squared                                                                                                                                     |\n  | AdjustedR2   | The adjusted R-squared corrected based on the degrees of freedom by comparing the sample size to the number of terms in the regression model. |\n  | StdError     | The residual standard error/deviation corrected based on the degrees of freedom.                                                              |\n  | Observations | The sample size.                                                                                                                              |\n\n  | Item     | Description                                                             |\n  | -------- | ----------------------------------------------------------------------- |\n  | factor   | Independent variables                                                   |\n  | beta     | Estimated regression coefficients                                       |\n  | StdError | Standard error of the regression coefficients                           |\n  | tstat    | t statistic, indicating the significance of the regression coefficients |\n\n  Residual: the difference between each predicted value and the actual value.\n\n**alpha** is a floating number representing the constant that multiplies the L1-norm. The default value is 1.0.\n\n**intercept** is a Boolean variable indicating whether the regression includes the intercept. If it is true, the system automatically adds a column of \"1\"s to *X* to generate the intercept. The default value is true.\n\n**normalize** is a Boolean value. If true, the regressors will be normalized before regression by subtracting the mean and dividing by the L2-norm. If *intercept* =false, this parameter will be ignored. The default value is false.\n\n**maxIter** is a positive integer indicating the maximum number of iterations. The default value is 1000.\n\n**tolerance** is a floating number. The iterations stop when the improvement in the objective function value is smaller than *tolerance*. The default value is 0.0001.\n\n**positive** is a Boolean value indicating whether to force the coefficient estimates to be positive. The default value is false.\n\n**swColName** is a STRING indicating a column name of *ds*. The specified column is used as the sample weight. If it is not specified, the sample weight is treated as 1.\n\n**checkInput** is a BOOLEAN value. It determines whether to enable validation check for parameters *yColName*, *xColNames*, and *swColName*.\n\n* If *checkInput* = true (default), it will check the invalid value for parameters and throw an error if the null value exists.\n\n* If *checkInput* = false, the invalid value is not checked.\n\n**Note:** It is recommended to specify *checkInput* = true. If it is false, it must be ensured that there are no invalid values in the input parameters and no invalid values are generated during intermediate calculations, otherwise the returned model may be inaccurate.\n\n#### Examples\n\n```\nx1=1 3 5 7 11 16 23\nx2=2 8 11 34 56 54 100\ny=0.1 4.2 5.6 8.8 22.1 35.6 77.2;\n\nprint(lassoBasic(y, (x1,x2), mode = 0));\n// output: [-9.133706333069543,2.535935196073186,0.189298948643987]\n\n\nprint(lassoBasic(y, (x1,x2), mode = 1));\n/* output:\nfactor    beta               stdError          tstat              pvalue\n--------- ------------------ ----------------- ------------------ -----------------\nintercept -9.133706333069543 5.247492365971091 -1.740584968222107 0.156730846105191\nx1        2.535935196073186  1.835793667840723 1.38138356205138   0.239309472176311\nx2        0.189298948643987  0.410201227095842 0.461478260277749  0.66843504931137\n*/\n\n\nprint(lassoBasic(y, (x1,x2), mode = 2));\n/* output:\nCoefficient->\nfactor    beta               stdError          tstat              pvalue\n--------- ------------------ ----------------- ------------------ -----------------\nintercept -9.133706333069543 5.247492365971091 -1.740584968222107 0.156730846105191\nx1        2.535935196073186  1.835793667840723 1.38138356205138   0.239309472176311\nx2        0.189298948643987  0.410201227095842 0.461478260277749  0.66843504931137\n\nRegressionStat->\nitem         statistics\n------------ -----------------\nR2           0.931480447323074\nAdjustedR2   0.897220670984611\nStdError     8.195817208870076\nObservations 7\n\nANOVA->\nBreakdown  DF SS                   MS                   F                  Significance\n---------- -- -------------------- -------------------- ------------------ -----------------\nRegression 2  4165.242566095043912 2082.621283047521956 31.004574440904473 0.003672076469395\nResidual   4  268.685678884843582  67.171419721210895\nTotal      6  4471.637142857141952\n\nResidual->\n[6.319173239708383,4.21150915569809,-0.028258082380245,-6.254004293338318,-7.262321947798779,-6.063400030876729,9.077301958987561]\n*/\n```\n"
    },
    "lassoCV": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lassocv.html",
        "signatures": [
            {
                "full": "lassoCV(ds, yColName, xColNames, [alphas], [intercept], [normalize], [maxIter], [tolerance], [positive], [swColName], [checkInput])",
                "name": "lassoCV",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[alphas]",
                        "name": "alphas",
                        "optional": true
                    },
                    {
                        "full": "[intercept]",
                        "name": "intercept",
                        "optional": true
                    },
                    {
                        "full": "[normalize]",
                        "name": "normalize",
                        "optional": true
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[tolerance]",
                        "name": "tolerance",
                        "optional": true
                    },
                    {
                        "full": "[positive]",
                        "name": "positive",
                        "optional": true
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    },
                    {
                        "full": "[checkInput]",
                        "name": "checkInput",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [lassoCV](https://docs.dolphindb.com/en/Functions/l/lassocv.html)\n\n\n\n#### Syntax\n\nlassoCV(ds, yColName, xColNames, \\[alphas], \\[intercept], \\[normalize], \\[maxIter], \\[tolerance], \\[positive], \\[swColName], \\[checkInput])\n\n#### Parameters\n\nThe `lassoCV` function inherits all parameters of function [lasso](https://docs.dolphindb.com/en/Functions/l/lasso.html), with one added parameter, *alphas*.\n\n**alphas** (optional) is a floating-point scalar or vector that represents the coefficient multiplied by the L1 norm penalty term. The default value is \\[0.01, 0.1, 1.0].\n\n#### Details\n\nEstimate a Lasso regression using 5-fold cross-validation and return a model corresponding to the optimal parameters.\n\n**Return value**: A dictionary containing the following keys\n\n* modelName: the model name, which is \"lassoCV\" for this method\n\n* coefficients: the regression coefficients\n\n* intercept: the intercept\n\n* dual\\_gap: the dual gap\n\n* tolerance: the tolerance for the optimization\n\n* iterations: the number of iterations\n\n* xColNames: the column names of the independent variables in the data source\n\n* predict: the function used for prediction\n\n* alpha: the penalty term for cross-validation\n\n#### Examples\n\n```\ny = [225.720746,-76.195841,63.089878,139.44561,-65.548346,2.037451,22.403987,-0.678415,37.884102,37.308288]\nx0 = [2.240893,-0.854096,0.400157,1.454274,-0.977278,-0.205158,0.121675,-0.151357,0.333674,0.410599]\nx1 = [0.978738,0.313068,1.764052,0.144044,1.867558,1.494079,0.761038,0.950088,0.443863,-0.103219]\nt = table(y, x0, x1);\n\nlassoCV(t, `y, `x0`x1);\n\n/* output:\nmodelName->lassoCV\ncoefficients->[94.4493,14.3046]\nintercept->0.0313\ndual_gap->0.0009\ntolerance->0.0001\niterations->5\nxColNames->[\"x0\",\"x1\"]\npredict->coordinateDescentPredict\nalpha->0.01\n*/\n```\n"
    },
    "last": {
        "url": "https://docs.dolphindb.com/en/Functions/l/last.html",
        "signatures": [
            {
                "full": "last(X)",
                "name": "last",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [last](https://docs.dolphindb.com/en/Functions/l/last.html)\n\n\n\n#### Syntax\n\nlast(X) / last X\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nReturn the last element of a vector, or the last row of a matrix or table.\n\nIf the last element is null, the function returns NULL. To get the last non-null element, use [lastNot](https://docs.dolphindb.com/en/Functions/l/lastNot.html).\n\n#### Examples\n\n```\nlast(`hello `world);\n// output: world\n\nlast(1..10);\n// output: 10\n\nm = matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nlast(m);\n// output: [3,6]\n```\n\nRelated function: [first](https://docs.dolphindb.com/en/Functions/f/first.html)\n"
    },
    "lastNot": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lastNot.html",
        "signatures": [
            {
                "full": "lastNot(X, [k])",
                "name": "lastNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[k]",
                        "name": "k",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [lastNot](https://docs.dolphindb.com/en/Functions/l/lastNot.html)\n\n\n\n#### Syntax\n\nlastNot(X, \\[k])\n\n#### Parameters\n\n**X** is a vector, a matrix or a table.\n\n**k** (optional) is a scalar.\n\n#### Details\n\nIf *X* is a vector:\n\n* If *k* is not specified: return the last element of *X* that is not null.\n\n* If *k* is specified: return the last element of *X* that is neither *k* nor null.\n\nIf *X* is a matrix/table, conduct the aforementioned calculation within each column of *X*. The result is a vector.\n\n`lastNot` also supports querying DFS tables and partitioned tables.\n\n#### Examples\n\n```\nlastNot(1 6 0 0 0, 0);\n// output: 6\n\nlastNot(1 6 0 0 0 2 3 0 NULL, 0);\n// output: 3\n\nlastNot(1 6 0 0 0 2 3 0 NULL);\n// output: 0\n\nt=table(1 1 1 1 1 2 2 2 2 2 as id, 1 2 0 0 0 3 NULL NULL 0 0 as x);\nt;\n```\n\n| id | x |\n| -- | - |\n| 1  | 1 |\n| 1  | 2 |\n| 1  | 0 |\n| 1  | 0 |\n| 1  | 0 |\n| 2  | 3 |\n| 2  |   |\n| 2  |   |\n| 2  | 0 |\n| 2  | 0 |\n\n```\nselect lastNot(x, 0) from t group by id;\n```\n\n| id | lastNot\\_x |\n| -- | ---------- |\n| 1  | 2          |\n| 2  | 3          |\n\n```\nm=matrix(2 NULL 1 0 NULL, NULL 2 NULL 6 0);\nm;\n```\n\n| #0 | #1  |\n| -- | --- |\n| 2  | 2   |\n| 1  |     |\n| 0  | 6 0 |\n\n```\nlastNot(m, 0);\n// output: [1,6]\n```\n"
    },
    "lastWeekOfMonth": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lastWeekOfMonth.html",
        "signatures": [
            {
                "full": "lastWeekOfMonth(X, [weekday=0], [offset], [n=1])",
                "name": "lastWeekOfMonth",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[weekday=0]",
                        "name": "weekday",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [lastWeekOfMonth](https://docs.dolphindb.com/en/Functions/l/lastWeekOfMonth.html)\n\n\n\n#### Syntax\n\nlastWeekOfMonth(X, \\[weekday=0], \\[offset], \\[n=1])\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**weekday** is an integer from 0 to 6. 0 means Monday, 1 means Tuesday, ..., and 6 means Sunday. The default value is 0.\n\n**offset** is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** is a positive integer. The default value is 1.\n\n#### Details\n\nIn the calendar month of *X*, suppose the last \"weekday\" is d.\n\n* If *X* \\<d: return the last \"weekday\" in the previous calendar month.\n\n* If *X* >=d: return the last \"weekday\" in the current calendar month.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates dates based on periods consisting of *n* months. In this case, *offset* determines how the multi-month periods are aligned. Specifically, the system first calculates the date corresponding to the last occurrence of the specified *weekday* in the month containing *offset*, and uses that date as the reference point. The result is then updated every *n* months, and the function returns the target date corresponding to the period to which *X* belongs.\n\n#### Examples\n\n```\nlastWeekOfMonth(2019.11.24,2);\n// output: 2019.10.30\n// The last Wednesday of November 2019 is 2019.11.27, 2019.11.24 is before 2019.11.27, so the function returns the last Wednesday of October 2019.\n\nlastWeekOfMonth(2019.11.29,2);\n// output: 2019.11.27\n\ndate=2012.01.02 2012.02.03 2012.03.07 2012.04.08 2012.05.12 2012.06.16 2012.07.18 2012.08.20 2012.09.25 2012.10.28\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by lastWeekOfMonth(date,4,2012.01.01,2);\n```\n\n| lastWeekOfMonth\\_date | avg\\_price | sum\\_qty |\n| --------------------- | ---------- | -------- |\n| 2011.12.30            | 39.53      | 4100     |\n| 2012.02.24            | 29.77      | 5300     |\n| 2012.04.27            | 175.1      | 12200    |\n| 2012.06.29            | 50.54      | 3800     |\n| 2012.08.31            | 51.29      | 8800     |\n| 2012.10.26            | 52.38      | 4500     |\n"
    },
    "latestIndexedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/latestIndexedTable.html",
        "signatures": [
            {
                "full": "latestIndexedTable(keyColumns, timeColumn, [X1], [X2], .....)",
                "name": "latestIndexedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "latestIndexedTable(keyColumns, timeColumn, capacity:size, colNames, colTypes)",
                "name": "latestIndexedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            },
            {
                "full": "latestIndexedTable(keyColumns, timeColumn, table)",
                "name": "latestIndexedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [latestIndexedTable](https://docs.dolphindb.com/en/Functions/l/latestIndexedTable.html)\n\n#### Syntax\n\nlatestIndexedTable(keyColumns, timeColumn, \\[X1], \\[X2], .....)\n\nor\n\nlatestIndexedTable(keyColumns, timeColumn, capacity:size, colNames, colTypes)\n\nor\n\nlatestIndexedTable(keyColumns, timeColumn, table)\n\n#### Parameters\n\nCompared to the [indexedTable](https://docs.dolphindb.com/en/Functions/i/indexedTable.html) function, `latestIndexedTable` includes an additional parameter called *timeColumn* to specify the temporal dimension of the data.\n\n**timeColumn** is a string that specifies the name of the time column which can be either of integral or temporal data type.\n\n#### Details\n\nCreate an indexed table, which is a special type of in-memory table with primary key. The primary key can be one column or multiple columns. Compared to the `indexedTable`, `latestIndexedTable` adds a time column to determine whether to update records.\n\nWhen a new record is appended to the indexed table, if its timestamp is smaller than that of the existing row which has the same primary key, it does not overwrite the existing row. `latestIndexedTable` deduplicates records with the same primary key based on the time column, which affects its writing performance (relatively slow compared with `indexedTable`).\n\n**Note:** The primary key cannot be updated.\n\nRefer to `indexedTable` for the optimization of query performance on `latestIndexedTable`.\n\n#### Examples\n\nExample 1. Create an indexed table.\n\nScenario 1:\n\n```\nsym=`A`B`C`D`E\nid=5 4 3 2 1\nval=52 64 25 48 71\ntimeCol = 2022.12.07T00:00:00.001+0..4\nt=latestIndexedTable(`sym`id,`timeCol,sym,id,timeCol,val)\nt;\n```\n\n| sym | id | timeCol                 | val |\n| --- | -- | ----------------------- | --- |\n| A   | 5  | 2022.12.07T00:00:00.001 | 52  |\n| B   | 4  | 2022.12.07T00:00:00.002 | 64  |\n| C   | 3  | 2022.12.07T00:00:00.003 | 25  |\n| D   | 2  | 2022.12.07T00:00:00.004 | 48  |\n| E   | 1  | 2022.12.07T00:00:00.005 | 71  |\n\nScenario 2:\n\n```\nt=latestIndexedTable(`sym`id,`timeCol, 1:0,`sym`id`timeCol`val,[SYMBOL,INT,TIMESTAMP, INT])\ninsert into t values(`A`B`C`D`E,5 4 3 2 1,2022.12.07T00:00:00.001+0..4,52 64 25 48 71);\n```\n\nScenario 3:\n\n```\ntmp=table(sym, id, timeCol, val)\nt=latestIndexedTable(`sym`id, `timeCol, tmp);\n```\n\nExample 2. Update an indexed table.\n\nIf the new row has the same primary key value as an existing row, whether to update the record is determined by the time column.\n\n```\ninsert into t values(`A`A`E,5 5 1, 2022.12.07T00:00:00.001 2022.12.07T00:00:00.007 2022.12.07T00:00:00.003, 44 66 28);\nt;\n```\n\n| sym | id | timeCol                 | val |\n| --- | -- | ----------------------- | --- |\n| A   | 5  | 2022.12.07T00:00:00.007 | 66  |\n| B   | 4  | 2022.12.07T00:00:00.002 | 64  |\n| C   | 3  | 2022.12.07T00:00:00.003 | 25  |\n| D   | 2  | 2022.12.07T00:00:00.004 | 48  |\n| E   | 1  | 2022.12.07T00:00:00.005 | 71  |\n\nRelated functions: [keyedTable](https://docs.dolphindb.com/en/Functions/k/keyedTable.html), [indexedTable](https://docs.dolphindb.com/en/Functions/i/indexedTable.html), [latestKeyedTable](https://docs.dolphindb.com/en/Functions/l/latestKeyedTable.html)\n\n"
    },
    "latestKeyedStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/latestKeyedStreamTable.html",
        "signatures": [
            {
                "full": "latestKeyedStreamTable(keyColumns, timeColumn, [X1], [X2], .....)",
                "name": "latestKeyedStreamTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "latestKeyedStreamTable(keyColumns, timeColumn, capacity:size, colNames, colTypes)",
                "name": "latestKeyedStreamTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            }
        ],
        "markdown": "### [latestKeyedStreamTable](https://docs.dolphindb.com/en/Functions/l/latestKeyedStreamTable.html)\n\n\n\n#### Syntax\n\nlatestKeyedStreamTable(keyColumns, timeColumn, \\[X1], \\[X2], .....)\n\nor\n\nlatestKeyedStreamTable(keyColumns, timeColumn, capacity:size, colNames, colTypes)\n\n#### Parameters\n\n**keyColumns** is a string scalar or vector indicating the names of the primary key columns. The primary key columns must be of INTEGRAL, TEMPORAL, LITERAL, or FLOATING types.\n\nCompared to the [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) function, `latestKeyedStreamTable` includes an additional parameter called *timeColumn* to specify the temporal dimension of the data.\n\n**timeColumn** specifies the time column(s) and can be either:\n\n* A string indicates a single column of integral or temporal type, or\n* A two-element vector indicates two columns that combine to form a unique timestamp: a DATE column and a TIME, SECOND, or NANOTIME column.\n\nFor the first scenario: *X*, *X1*, .... are vectors.\n\nFor the second scenario:\n\n**capacity** is the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2-2 times of *capacity*, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n**size** can be 0 or 1, indicating the initial size (in terms of the number of rows) of the table. If size=0, create an empty table; If size = 1, create a table with one record, and the initialized values are:\n\n* false for Boolean type;\n\n* 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n\n* Null value for Literal, INT128 types.\n\n**colNames** is a string vector of column names.\n\n**colTypes** is a string vector of data types. As of 2.00.11.2, the non-key columns can be specified as array vectors.\n\n#### Details\n\nCreate a keyed stream table with one or more columns serving as the primary key. Compared to the `keyedStreamTable`, `latestKeyedStreamTable`maintains the most up-to-date record for each unique primary key based on a time column. When a new record arrives, the system compares its primary key to existing records in memory:\n\n* If a match is found, check the timestamps:\n  * If the new record's timestamp is more recent, it is inserted.\n  * If not, the new record is discarded.\n* If no matching primary key is found, add the new record to the table. In cases where multiple new records with the same key are written simultaneously, only the record with the most recent timestamp is inserted.\n\n#### Examples\n\n**Example 1**: Specifying a single primary key column.\n\nMethod 1:\n\n```\nid = `A`B`C`D`E\nx = 1 2 3 4 5\ntimeCol = 2024.09.10T00:00:00.001+0..4\nt1 = latestKeyedStreamTable(`id, `timeCol, id, x, timeCol)\nt1;\n```\n\nOutput:\n\n| id | x | timeCol                 |\n| -- | - | ----------------------- |\n| A  | 1 | 2024.09.10T00:00:00.001 |\n| B  | 2 | 2024.09.10T00:00:00.002 |\n| C  | 3 | 2024.09.10T00:00:00.003 |\n| D  | 4 | 2024.09.10T00:00:00.004 |\n| E  | 5 | 2024.09.10T00:00:00.005 |\n\nMethod 2:\n\n```\nt2=latestKeyedStreamTable(`id, `timeCol, 100:0, `id`x`timeCol, [INT,INT,TIMESTAMP])\ninsert into t2 values(1 2 3, 10 20 30, [2024.09.10T00:00:00.001,\n2024.09.10T00:00:00.002, 2024.09.10T00:00:00.003])\n\nt2\n```\n\nOutput:\n\n| id | x  | timeCol                 |\n| -- | -- | ----------------------- |\n| 1  | 10 | 2024.09.10T00:00:00.001 |\n| 2  | 20 | 2024.09.10T00:00:00.002 |\n| 3  | 30 | 2024.09.10T00:00:00.003 |\n\nInsert new rows to table t1.\n\n```\ninsert into t1 values(`D`E`F, 6 7 8, [2024.09.10T00:00:00.005,\n 2024.09.10T00:00:00.005, 2024.09.10T00:00:00.005])\nt1\n```\n\nOutput:\n\n| id | x | timeCol                 |\n| -- | - | ----------------------- |\n| A  | 1 | 2024.09.10T00:00:00.001 |\n| B  | 2 | 2024.09.10T00:00:00.002 |\n| C  | 3 | 2024.09.10T00:00:00.003 |\n| D  | 4 | 2024.09.10T00:00:00.004 |\n| E  | 5 | 2024.09.10T00:00:00.005 |\n| D  | 6 | 2024.09.10T00:00:00.005 |\n| F  | 8 | 2024.09.10T00:00:00.005 |\n\nWe can see from the output table that new rows are inserted into table t1 based on their id and timestamp. Row with id=D is inserted due to its newer timestamp than the existing D record. Row with id=E is discarded because it has the same timestamp as the existing E record. Row with id=F is inserted since there's no existing F record in the table.\n\n**Example 2**: Specifying multiple primary key columns.\n\n```\nt3 = latestKeyedStreamTable(`id`x, `timeCol, id, x, timeCol)\ninsert into t3 values(`D`E, 4 5, [2024.09.10T00:00:00.004, 2024.09.10T00:00:00.005])\ninsert into t3 values(`D`F, 6 7, [2024.09.10T00:00:00.004, 2024.09.10T00:00:00.005])\nt3\n```\n\nOutput:\n\n| id | x | timeCol                 |\n| -- | - | ----------------------- |\n| A  | 1 | 2024.09.10T00:00:00.001 |\n| B  | 2 | 2024.09.10T00:00:00.002 |\n| C  | 3 | 2024.09.10T00:00:00.003 |\n| D  | 4 | 2024.09.10T00:00:00.004 |\n| E  | 5 | 2024.09.10T00:00:00.005 |\n| D  | 6 | 2024.09.10T00:00:00.004 |\n| F  | 7 | 2024.09.10T00:00:00.005 |\n\n**Example 3**: Specifying two time columns.\n\n```\nid = `A`B`C`D`E\ndateCol = take(2024.09.10, 5)\ntimeCol = 00:00:00.001+0..4\nt4 = latestKeyedStreamTable(`id, `dateCol`timeCol, id, x, dateCol, timeCol)\nt4\n```\n\nOutput:\n\n| id | x | dateCol    | timeCol      |\n| -- | - | ---------- | ------------ |\n| A  | 1 | 2024.09.10 | 00:00:00.001 |\n| B  | 2 | 2024.09.10 | 00:00:00.002 |\n| C  | 3 | 2024.09.10 | 00:00:00.003 |\n| D  | 4 | 2024.09.10 | 00:00:00.004 |\n| E  | 5 | 2024.09.10 | 00:00:00.005 |\n\nInsert new rows to table t4 based on their id and timestamp. The timestamp is created by combining *dateCol* and *timeCol*, i.e.,`concatDateTime(dateCol, timeCol)`.\n\n```\ninsert into t4 values(`D`E, 4 5, [2024.09.10,  2024.09.11], [00:00:00.004, 00:00:00.005]);\nt4\n```\n\nOutput:\n\n| id | x | dateCol    | timeCol      |\n| -- | - | ---------- | ------------ |\n| A  | 1 | 2024.09.10 | 00:00:00.001 |\n| B  | 2 | 2024.09.10 | 00:00:00.002 |\n| C  | 3 | 2024.09.10 | 00:00:00.003 |\n| D  | 4 | 2024.09.10 | 00:00:00.004 |\n| E  | 5 | 2024.09.10 | 00:00:00.005 |\n| E  | 5 | 2024.09.11 | 00:00:00.005 |\n"
    },
    "latestKeyedTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/latestKeyedTable.html",
        "signatures": [
            {
                "full": "latestKeyedTable(keyColumns, timeColumn, [X1], [X2], .....)",
                "name": "latestKeyedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "latestKeyedTable(keyColumns, timeColumn, capacity:size, colNames, colTypes)",
                "name": "latestKeyedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            },
            {
                "full": "latestKeyedTable(keyColumns, timeColumn, table)",
                "name": "latestKeyedTable",
                "parameters": [
                    {
                        "full": "keyColumns",
                        "name": "keyColumns"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    }
                ]
            }
        ],
        "markdown": "### [latestKeyedTable](https://docs.dolphindb.com/en/Functions/l/latestKeyedTable.html)\n\n#### Syntax\n\nlatestKeyedTable(keyColumns, timeColumn, \\[X1], \\[X2], .....)\n\nor\n\nlatestKeyedTable(keyColumns, timeColumn, capacity:size, colNames, colTypes)\n\nor\n\nlatestKeyedTable(keyColumns, timeColumn, table)\n\n#### Parameters\n\nCompared to the [keyedTable](https://docs.dolphindb.com/en/Functions/k/keyedTable.html) function, `latestKeyedTable` includes an additional parameter called *timeColumn* to specify the temporal dimension of the data.\n\n**timeColumn** is a string that specifies the name of the time column which can be either of integral or temporal data type.\n\n#### Details\n\nCreate a keyed table, which is a special type of in-memory table with primary key. The primary key can be one column or multiple columns. Compared to the `keyedTable`, `latestKeyedTable` adds a time column to determine whether to update records.\n\nWhen a new record is appended to the keyed table, if its timestamp is smaller than that of the existing row which has the same primary key, it does not overwrite the existing row. `latestKeyedTable` deduplicates records with the same primary key based on the time column, which affects its writing performance (relatively slow compared with `keyedTable`).\n\n**Note:** The primary key cannot be modified (with functions `update`, or `replaceColumn!`) or deleted (with functions `alter`, or `dropColumns!`).\n\nRefer to `keyedTable` for the optimization of query performance on `latestKeyedTable`.\n\n#### Examples\n\nExample 1. Create a keyed table.\n\nScenario 1:\n\n```\nsym=`A`B`C`D`E\nid=5 4 3 2 1\nval=52 64 25 48 71\ntimeCol = 2022.12.07T00:00:00.001+0..4\nt=latestKeyedTable(`sym`id,`timeCol,sym,id,timeCol,val)\nt;\n    \n```\n\n| sym | id | timeCol                 | val |\n| --- | -- | ----------------------- | --- |\n| A   | 5  | 2022.12.07T00:00:00.001 | 52  |\n| B   | 4  | 2022.12.07T00:00:00.002 | 64  |\n| C   | 3  | 2022.12.07T00:00:00.003 | 25  |\n| D   | 2  | 2022.12.07T00:00:00.004 | 48  |\n| E   | 1  | 2022.12.07T00:00:00.005 | 71  |\n\nScenario 2:\n\n```\nt=latestKeyedTable(`sym`id,`timeCol, 1:0,`sym`id`timeCol`val,[SYMBOL,INT,TIMESTAMP, INT])\ninsert into t values(`A`B`C`D`E,5 4 3 2 1,2022.12.07T00:00:00.001+0..4,52 64 25 48 71);\n```\n\nScenario 3:\n\n```\ntmp=table(sym, id, timeCol, val)\nt=latestKeyedTable(`sym`id, `timeCol, tmp);\n```\n\nExample 2. Update a keyed table.\n\nIf the new row has the same primary key value as an existing row, whether to update the record is determined by the time column.\n\n```\ninsert into t values(`A`A`E,5 5 1, 2022.12.07T00:00:00.001 2022.12.07T00:00:00.007 2022.12.07T00:00:00.003, 44 66 28);\n t;\n```\n\n| sym | id | timeCol                 | val |\n| --- | -- | ----------------------- | --- |\n| A   | 5  | 2022.12.07T00:00:00.007 | 66  |\n| B   | 4  | 2022.12.07T00:00:00.002 | 64  |\n| C   | 3  | 2022.12.07T00:00:00.003 | 25  |\n| D   | 2  | 2022.12.07T00:00:00.004 | 48  |\n| E   | 1  | 2022.12.07T00:00:00.005 | 71  |\n\nRelated functions: [keyedTable](https://docs.dolphindb.com/en/Functions/k/keyedTable.html), [indexedTable](https://docs.dolphindb.com/en/Functions/i/indexedTable.html), [latestIndexedTable](https://docs.dolphindb.com/en/Functions/l/latestIndexedTable.html)\n\n"
    },
    "le": {
        "url": "https://docs.dolphindb.com/en/Functions/l/le.html",
        "signatures": [
            {
                "full": "le(X, Y)",
                "name": "le",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [le](https://docs.dolphindb.com/en/Functions/l/le.html)\n\n\n\n#### Syntax\n\nle(X, Y) or X<=Y\n\n#### Parameters\n\n**X** / **Y** is a scalar/pair/vector/matrix/set. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Details\n\nIf neither *X* nor *Y* is a set, return the element-by-element comparison of *X*<=*Y*.\n\nIf both *X* and *Y* are sets, check if *X* is a subset of *Y*.\n\n#### Examples\n\n```\n1 2 3 <= 2;\n// output: [1,1,0]\n\n1 2 3<=0 2 4;\n// output: [0,1,1]\n\n2:3<=1:6;\n// output: 0 : 1\n\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1 le 4;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 0  |\n| 1  | 1  | 0  |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1<=m2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 0  |\n| 1  | 0  | 0  |\n\nSet operation: If *X*<=*Y* then *X* is a subset of *Y*\n\n```\nx=set(4 6);\ny=set(4 6 8);\n\nx<=y;\n// output: 1\nx<=x;\n// output: 1\n```\n"
    },
    "left": {
        "url": "https://docs.dolphindb.com/en/Functions/l/left.html",
        "signatures": [
            {
                "full": "left(X,n)",
                "name": "left",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [left](https://docs.dolphindb.com/en/Functions/l/left.html)\n\n\n\n#### Syntax\n\nleft(X,n)\n\n#### Parameters\n\n**X** is a STRING scalar/vector, or table.\n\n**n** is a positive integer.\n\n#### Details\n\nReturn the first *n* characters of string *X*.\n\nIf *X* is a table, the function is applied only to columns of STRING type. Other column types are ignored.\n\n#### Examples\n\n```\nleft(\"I love this game!\", 6);\n// output: I love\n```\n"
    },
    "lfill!": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lfill!.html",
        "signatures": [
            {
                "full": "lfill!(obj)",
                "name": "lfill!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [lfill!](https://docs.dolphindb.com/en/Functions/l/lfill!.html)\n\n\n\n#### Syntax\n\nlfill!(obj)\n\n#### Parameters\n\n**obj** is a vector or a table with only numeric columns.\n\n#### Details\n\nPlease refer to [lfill](https://docs.dolphindb.com/en/Functions/l/lfill.html). The only difference between *lfill* and *lfill!* is that the latter assigns the result to *X* and thus changing the value of *X* after the execution.\n\n#### Examples\n\n```\na= NULL 1.5 NULL NULL 4.5\na.lfill!()\na;\n[NULL,1.5,2.5,3.5,4.5]\n\nb=1 NULL NULL 6\nb.lfill!()\nb;\n[1,3,4,6]\n\nt=table(1 NULL NULL 4 5 6 as id,2.1 2.2 NULL NULL 2.4 2.6 as val);\nlfill!(t);\nt;\n```\n\n| id | val      |\n| -- | -------- |\n| 1  | 2.1      |\n| 2  | 2.2      |\n| 3  | 2.266667 |\n| 4  | 2.333333 |\n| 5  | 2.4      |\n| 6  | 2.6      |\n\nRelated functions: [bfill](https://docs.dolphindb.com/en/Functions/b/bfill.html), [bfill!](https://docs.dolphindb.com/en/Functions/b/bfill!.html), [lfill!](https://docs.dolphindb.com/en/Functions/l/lfill!.html)\n"
    },
    "lfill": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lfill.html",
        "signatures": [
            {
                "full": "lfill(obj)",
                "name": "lfill",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [lfill](https://docs.dolphindb.com/en/Functions/l/lfill.html)\n\n\n\n#### Syntax\n\nlfill(obj)\n\n#### Parameters\n\n**obj** is a vector or a table with only numeric columns.\n\n#### Details\n\n* If *obj* is a vector: linearly fill the null values between 2 non-null numeric values in *obj*.\n\n* If *obj* is a table with only numeric columns: for each column of the table, linearly fill the null values between 2 non-null numeric values.\n\n*lfill* does not change *obj*, whereas *lfill!* changes *obj*.\n\n#### Examples\n\n```\na= NULL 1.5 NULL NULL 4.5\na.lfill();\n// output: [NULL,1.5,2.5,3.5,4.5]\n\nb=1 NULL NULL 6\nb.lfill();\n// output: [1,3,4,6]\n\nt=table(1 NULL NULL 4 5 6 as id,2.1 2.2 NULL NULL 2.4 2.6 as val);\nselect * from lfill(t);\n```\n\n| id | val      |\n| -- | -------- |\n| 1  | 2.1      |\n| 2  | 2.2      |\n| 3  | 2.266667 |\n| 4  | 2.333333 |\n| 5  | 2.4      |\n| 6  | 2.6      |\n\nRelated functions: [bfill](https://docs.dolphindb.com/en/Functions/b/bfill.html), [bfill!](https://docs.dolphindb.com/en/Functions/b/bfill!.html), [lfill!](https://docs.dolphindb.com/en/Functions/l/lfill!.html)\n"
    },
    "license": {
        "url": "https://docs.dolphindb.com/en/Functions/l/license.html",
        "signatures": [
            {
                "full": "license([fileName], [pubKeyFile], [read=false])",
                "name": "license",
                "parameters": [
                    {
                        "full": "[fileName]",
                        "name": "fileName",
                        "optional": true
                    },
                    {
                        "full": "[pubKeyFile]",
                        "name": "pubKeyFile",
                        "optional": true
                    },
                    {
                        "full": "[read=false]",
                        "name": "read",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [license](https://docs.dolphindb.com/en/Functions/l/license.html)\n\n\n\n#### Syntax\n\nlicense(\\[fileName], \\[pubKeyFile], \\[read=false])\n\n#### Parameters\n\n**fileName** (optional) is the path of the license.\n\n**pubKeyFile** (optional) is the path of the public key file.\n\n**read** (optional) is a Boolean value indicating whether to disable the license file verification before returning the result. The default value is false.\n\n#### Details\n\nDisplay information regarding the DolphinDB license. If *fileName* is not specified, the license information from memory is obtained by default.\n\nIt returns a dictionary with the following keys:\n\n<table><thead><tr><th align=\"left\">\n\nKeys\n\n</th><th align=\"left\">\n\nMeaning\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nauthorization\n\n</td><td align=\"left\">\n\nauthorization types: trial/test/commercial\n\n</td></tr><tr><td align=\"left\">\n\nlicenseType\n\n</td><td align=\"left\">\n\nThe license type: -   1: fingerprint authentication;\n\n* 2: online verification;\n* 3: license server;\n* 0: others\n\n</td></tr><tr><td align=\"left\">\n\nmaxMemoryPerNode\n\n</td><td align=\"left\">\n\nthe maximum memory for each node (in GB)\n\n</td></tr><tr><td align=\"left\">\n\nbindCores\n\n</td><td align=\"left\">\n\nCPU ID(s) (starting from 0) that are already bound to the DolphinDB process. Note that it takes effect only when bindCPU is configured to true.\n\n</td></tr><tr><td align=\"left\">\n\nmaxCoresPerNode\n\n</td><td align=\"left\">\n\nthe maximum cores for each node\n\n</td></tr><tr><td align=\"left\">\n\nclientName\n\n</td><td align=\"left\">\n\nthe client name\n\n</td></tr><tr><td align=\"left\">\n\nport\n\n</td><td align=\"left\">\n\nthe port number bound to the node. It is returned only for the license server and its connected nodes.\n\n</td></tr><tr><td align=\"left\">\n\nbindCPU\n\n</td><td align=\"left\">\n\nwhether a DolphinDB process is bound to a CPU\n\n</td></tr><tr><td align=\"left\">\n\nexpiration\n\n</td><td align=\"left\">\n\nthe expiration date of the license\n\n</td></tr><tr><td align=\"left\">\n\nmaxNodes\n\n</td><td align=\"left\">\n\nthe maximum number of nodes for the cluster\n\n</td></tr><tr><td align=\"left\">\n\nversion\n\n</td><td align=\"left\">\n\nthe version number of the server. Only a server that is not higher than the version can be used. If it is empty, there is no restriction on the version.\n\n</td></tr><tr><td align=\"left\">\n\nmodules\n\n</td><td align=\"left\">\n\na decimal converted from 4-bit binary number, indicating the supported modules.\n\n</td></tr><tr><td align=\"left\">\n\nmoduleNames\n\n</td><td align=\"left\">\n\nnames of supported *modules*. Currently, only *orderbook*, *internalFunction*, *cep*, *gpu*, *starfish*, *PowerTrading*,*Beluga*, *Backtest*, *MatchingEngineSimulator*, *starfishAI* will be returned.\n\n</td></tr><tr><td align=\"left\">\n\nproductKey\n\n</td><td align=\"left\">\n\nthe current product. The return value includes DOLPHIN, IOTBASIC, IOTPRO, SHARK, SWORDFISH, ORCA, DOLPHINX.\n\n</td></tr></tbody>\n</table>## Examples\n\n```language-python\nlicense();\n/* output\nclientName->internal\nbindCPU->true\nmaxNodes->128\nmoduleNames-> orderbook internalFunction cep gpu\nproductKey->DOLPHIN\nversion->3.10\nmodules->15\nauthorization->trial\nmaxMemoryPerNode->512\nlicenseType->0\nbindCores->\nmaxCoresPerNode->128\nport->0\nexpiration->2024.09.30\n*/\n```\n"
    },
    "like": {
        "url": "https://docs.dolphindb.com/en/Functions/l/like.html",
        "signatures": [
            {
                "full": "like(X, pattern)",
                "name": "like",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    }
                ]
            }
        ],
        "markdown": "### [like](https://docs.dolphindb.com/en/Functions/l/like.html)\n\n\n\n#### Syntax\n\nlike(X, pattern)\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n**pattern** is a string and is usually used with a wildcard character such as %.\n\n#### Details\n\nReturn a Boolean value scalar or vector indicating whether each element in *X* fits a specific pattern. The comparison is case sensitive.\n\n#### Examples\n\n```\nlike(`ABCDEFG, `DE);\n// output: false\n\nlike(`ABCDEFG, \"%DE%\");\n// output: true\n\na=`IBM`ibm`MSFT`Goog`YHOO`ORCL;\nlike(a, \"%OO%\");\n// output: [false,false,false,false,true,false]\n\na[like(a, \"%OO%\")];\n// output: [\"YHOO\"]\n```\n\n`like` can be used with SQL SELECT to filter columns of STRING type:\n\n```\nt = table(`abb`aac`aaa as sym, 1.8 2.3 3.7 as price);\nselect * from t where sym like \"%aa%\";\n```\n\n| sym | price |\n| --- | ----- |\n| aac | 2.3   |\n| aaa | 3.7   |\n\nRelated function: [ilike](https://docs.dolphindb.com/en/Functions/i/ilike.html)\n"
    },
    "linearInterpolateFit": {
        "url": "https://docs.dolphindb.com/en/Functions/l/linearInterpolateFit.html",
        "signatures": [
            {
                "full": "linearInterpolateFit(X, Y, [fillValue], [sorted=false])",
                "name": "linearInterpolateFit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[fillValue]",
                        "name": "fillValue",
                        "optional": true
                    },
                    {
                        "full": "[sorted=false]",
                        "name": "sorted",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [linearInterpolateFit](https://docs.dolphindb.com/en/Functions/l/linearInterpolateFit.html)\n\n\n\n#### Syntax\n\nlinearInterpolateFit(X, Y, \\[fillValue], \\[sorted=false])\n\n#### Parameters\n\n**X** is a numeric vector indicating the x-coordinates of the points for interpolation. Note that *X* must contain no less than two unique values with no null values.\n\n**Y** is a numeric vector indicating the y-coordinates of the points for interpolation. Note that *Y* must be of the same length as *X* with no null values.\n\n**fillValue** (optional) specifies how to assign values for the x-coordinate of the points outside the existing data range. The following options are supported:\n\n* A numeric pair in the form `(min, max)`, where `min` and `max` represent the values assigned when the x-coordinate of the point Xnew is smaller than the minimum of *X* or larger than the maximum of *X*, respectively. Specifically:\n  * If Xnew < Xmin, it is assigned `below`.\n  * If Xnew > Xmax, it is assigned `above`.\n* The string \"extrapolate\" (default), which indicates that extrapolation is performed.\n\n**sorted**(optional) is a Boolean scalar indicating whether the input *X* is sorted in ascending order.\n\n* If set to true, *X* must be in ascending order.\n* If set to false (default), the function will sort *X* and adjust the order of *Y* accordingly.\n\n#### Details\n\nPerform linear interpolation/extrapolation on a set of points. Interpolation estimates unknown values that fall between known data points, while extrapolation estimates values beyond the existing data range.\n\n**Return value**: A dictionary containing the following keys:\n\n* modelName: A string indicating the model name, which is \"linearInterpolate\".\n* sortedX: A DOUBLE vector indicating the input *X*sorted in ascending order.\n* sortedY: A DOUBLE vector indicating the input *Y* sorted corresponding to *sortedX*.\n* fillValue: The input *fillValue*.\n* predict: The prediction function of the model, which returns linear interpolation results. It can be called using `model.predict(X)` or `predict(model, X)`, where:\n  * model: A dictionary indicating the output of `linearInterpolateFit`.\n  * X: A numeric vector indicating the x-coordinates of the points to be predicted.\n\n#### Examples\n\n```\ndef linspace(start, end, num, endpoint=true){\n\tif(endpoint) return end$DOUBLE\\(num-1), start + end$DOUBLE\\(num-1)*0..(num-1)\n\telse return start + (end-start)$DOUBLE\\(num)*0..(num-1)\t\n}\nx = 0..9\ny = exp(-x/3.0)\nmodel = linearInterpolateFit(x, y, sorted=true)\n\n/*Output\nsortedX->[0.0,1.000000000000,2.000000000000,3.000000000000,4.000000000000,5.000000000000,6.000000000000,7.000000000000,8.000000000000,9.000000000000]\nmodelName->linearInterpolate\npredict->linearInterpolatePredict\nfillValue->extrapolate\nsortedY->[1.000000000000,0.716531310573,0.513417119032,0.367879441171,0.263597138115,0.188875602837,0.135335283236,0.096971967864,0.069483451222,0.049787068367]\n*/\n\n// Enter new values of X to predict the corresponding Y values\nmodel.predict(xnew)\n\n//Output：[1,0.829918786344274,0.67590847226555,0.554039957340832,0.455202047888132,0.367879441171442,0.305310059338013,0.248652831060094,0.203819909893195,0.167459474997182,0.135335283236613,0.112317294013288,0.091474264536084,0.074981154551122,0.061604898080826]\n```\n"
    },
    "linearTimeTrend": {
        "url": "https://docs.dolphindb.com/en/Functions/l/linearTimeTrend.html",
        "signatures": [
            {
                "full": "linearTimeTrend(X, window)",
                "name": "linearTimeTrend",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [linearTimeTrend](https://docs.dolphindb.com/en/Functions/l/linearTimeTrend.html)\n\n\n\n#### Syntax\n\nlinearTimeTrend(X, window)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving linear regression for *X*. Perform linear regression over a forward-looking window of size *window* for each element in *X*.\n\nWhen *X* contains null values:\n\n* Nulls before the first non-null element follow the handling rules of the TA-Lib series: they are ignored and preserved in the result.\n* Nulls after the first non-null element are treated as 0.\n\n#### Returns\n\nReturn a tuple with 2 elements, alpha (the Linear regression intercept *LINEARREG\\_INTERCEPT*) and beta (the linear regression slope *LINEARREG\\_SLOPE*).\n\n#### Examples\n\n```\nx = 3 3 5 7 8 9 10 11 15 13 12 11 10\nprint linearTimeTrend(x,3)\n// output: ([,,2.666666666666666,3,5.166666666666667,7,8,9,9.5,12,14.833333333333333,13,12],[,,1,2,1.5,1,1,1,2.5,1,-1.5,-1,-1])\n```\n\n```\nn = 10\nt = table(09:00:00 + 1..n as time, rand(`A`B, n) as sym, rand(100.0, n) as val1, rand(1000..2000, n) as val2)\nselect time, sym, linearTimeTrend(val1, 3) as `alpha`beta from t\n```\n\n| time     | sym | alpha   | beta     |\n| -------- | --- | ------- | -------- |\n| 09:00:01 | B   |         |          |\n| 09:00:02 | A   |         |          |\n| 09:00:03 | A   | 85.0844 | -30.0688 |\n| 09:00:04 | B   | 49.3461 | 7.3621   |\n| 09:00:05 | B   | 30.4248 | 28.3589  |\n| 09:00:06 | A   | 83.106  | -7.7515  |\n| 09:00:07 | B   | 78.4412 | -17.7575 |\n| 09:00:08 | A   | 56.8575 | 4.4732   |\n| 09:00:09 | A   | 53.8492 | -6.0653  |\n| 09:00:10 | A   | 61.7888 | -4.5586  |\n"
    },
    "linprog": {
        "url": "https://docs.dolphindb.com/en/Functions/l/linprog.html",
        "signatures": [
            {
                "full": "linprog(f, [A], [b], [Aeq], [beq], [lb], [ub], [method='simplex'])",
                "name": "linprog",
                "parameters": [
                    {
                        "full": "f",
                        "name": "f"
                    },
                    {
                        "full": "[A]",
                        "name": "A",
                        "optional": true
                    },
                    {
                        "full": "[b]",
                        "name": "b",
                        "optional": true
                    },
                    {
                        "full": "[Aeq]",
                        "name": "Aeq",
                        "optional": true
                    },
                    {
                        "full": "[beq]",
                        "name": "beq",
                        "optional": true
                    },
                    {
                        "full": "[lb]",
                        "name": "lb",
                        "optional": true
                    },
                    {
                        "full": "[ub]",
                        "name": "ub",
                        "optional": true
                    },
                    {
                        "full": "[method='simplex']",
                        "name": "method",
                        "optional": true,
                        "default": "'simplex'"
                    }
                ]
            }
        ],
        "markdown": "### [linprog](https://docs.dolphindb.com/en/Functions/l/linprog.html)\n\n\n\n#### Syntax\n\nlinprog(f, \\[A], \\[b], \\[Aeq], \\[beq], \\[lb], \\[ub], \\[method='simplex'])\n\n#### Details\n\nSolve the following optimization problem with a linear objective function and a set of linear constraints.\n\n![](https://docs.dolphindb.com/en/images/linprog.png)\n\nThe result is a 2-element tuple. The first element is the minimum value of the objective function. The second element is the value of *x* where the value of the objective function is minimized.\n\n#### Parameters\n\n**A** and **Aeq** must be matrices with the same number of columns.\n\n**f**, **b** and **beq** are vectors.\n\n**lb** and **ub** are scalars or vectors with the same length as *x* indicating the lower bounds and upper bounds of *x*.\n\n* If *lb* or *ub* is a scalar, all elements of *x* are subject to the same lower bound or upper bound constraint.\n\n* If *lb* or *ub* is null, there is no lower bound or upper bound constraint for *x*.\n\n* If *lb* or *ub* is a vector, an element of *x* is subject to the lower bound or upper bound constraint specified by the corresponding element of *lb* or *ub*.\n\n**method** is a string indicating the optimization algorithm. It can be either 'simplex' (recommended) or 'interior-point'.\n\n#### Examples\n\nExample 1. Find the minimum of x+2y subject to the constraints of\n\n![](https://docs.dolphindb.com/en/images/linprog1.png)\n\n```\nf = [1, 2];\nA = [-1, -1]$1:2;\nb = [-2];\nub = 2;\nre = linprog(f, A, b, , , , ub);\n\nre[0];\n// output: 2\n\nre[1];\n// output: [2,0]\n```\n\nExample 2. Find the minimum of -3x1-2x2 subject to the constraints of\n\n![](https://docs.dolphindb.com/en/images/linprog2.png)\n\n```\nf = [-3, -2];\nA = [2, 1, 1, 1]$2:2;\nb = [10, 8];\nub = [4, NULL];\nre = linprog(f, A, b, , , , ub);\n\nre[0];\n// output: -18\n\nre[1];\n// output: [2,6]\n```\n\nRelated function: [scs](https://docs.dolphindb.com/en/Functions/s/scs.html), [quadprog](https://docs.dolphindb.com/en/Functions/q/quadprog.html)\n"
    },
    "listAllMarkets": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listAllMarkets.html",
        "signatures": [
            {
                "full": "listAllMarkets()",
                "name": "listAllMarkets",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [listAllMarkets](https://docs.dolphindb.com/en/Functions/l/listAllMarkets.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nlistAllMarkets()\n\n#### Details\n\nRetrieves the trading calendars of all markets available on the current node.\n\n**Return value**: A vector indicating all trading calendars on the node.\n\n#### Examples\n\n```\nlistAllMarkets()\n// [\"XTSE\", \"XCSE\", \"XLIM\", \"ADDA\", \"XSTO\", \"XIST\", \"AIXK\", \"SSE\", \"XMIL\", \"XFRA\", \"INE\", \"XMEX\", \"XBUD\", \"XICE\", \"XDUB\", \"SHFE\", \"CMES\", \"XOSL\", \"DCE\", \"CCFX\", \"CFFEX\", \"XIDX\", \"BVMF\", \"XBOG\", \"XKAR\", \"XSAU\", \"XBUE\", \"XTKS\", \"XBSE\", \"XMOS\"...]\n```\n\n**Related functions:** [addMarketHoliday](https://docs.dolphindb.com/en/Functions/a/addMarketHoliday.html), [deleteMarketHoliday](https://docs.dolphindb.com/en/Functions/d/deleteMarketHoliday.html)\n"
    },
    "listMCPPrompts": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listMCPPrompts.html",
        "signatures": [
            {
                "full": "listMCPPrompts()",
                "name": "listMCPPrompts",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [listMCPPrompts](https://docs.dolphindb.com/en/Functions/l/listMCPPrompts.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nlistMCPPrompts()\n\n#### Details\n\nList MCP prompt templates for which the current user has the MCP\\_EXEC privilege.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table with the following columns:\n\n* name (STRING): The prompt template name.\n* message (STRING): The prompt template message.\n* description (STRING): The prompt template description.\n* title (STRING): The prompt template title.\n* lastModifyTime (TIMESTAMP): The last modification time.\n* publishTime (TIMESTAMP): The publication time.\n\n#### Examples\n\n```\nlistMCPPrompts()\n```\n\nOutput:\n\n| name           | message                                                                | description                | title               | lastModifyTime          | publishTime |\n| -------------- | ---------------------------------------------------------------------- | -------------------------- | ------------------- | ----------------------- | ----------- |\n| stock\\_summary | Summary the performance of ${stock} during ${startDate} to ${endDate}. | description after updating | Stock Trend Summary | 2025.08.24 17:17:29.091 |             |\n"
    },
    "listMCPTools": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listMCPTools.html",
        "signatures": [
            {
                "full": "listMCPTools()",
                "name": "listMCPTools",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [listMCPTools](https://docs.dolphindb.com/en/Functions/l/listMCPTools.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nlistMCPTools()\n\n#### Parameters\n\nNone\n\n#### Details\n\nRetrieves a list of MCP tools for which the current user has the MCP\\_EXEC privilege.\n\n**Return value**: A table with the following columns:\n\n* name: STRING, the tool name.\n* title: STRING, the tool title.\n* description: STRING, the tool description.\n* args: STRING, argument list in the format `argName1: argType1, argName2: argType2, ...`\n* lastModifyTime: TIMESTAMP, the last modification time.\n* publishTime: TIMESTAMP, publish time.\n* function: BLOB, the function definition.\n\n#### Examples\n\n```\nlistMCPTools()\n```\n\n| name   | title           | description    | args     | lastModifyTime          | publishTime             | function                             |\n| ------ | --------------- | -------------- | -------- | ----------------------- | ----------------------- | ------------------------------------ |\n| myTool | DolphinDB Tools | This is a tool | a:number | 2025.08.13 09:51:56.550 | 2025.08.13 15:14:14.255 | def myTool(x){ return (x \\* 2) + 1 } |\n"
    },
    "listPluginsByCluster": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listPluginsByCluster.html",
        "signatures": [
            {
                "full": "listPluginsByCluster(clusterName)",
                "name": "listPluginsByCluster",
                "parameters": [
                    {
                        "full": "clusterName",
                        "name": "clusterName"
                    }
                ]
            }
        ],
        "markdown": "### [listPluginsByCluster](https://docs.dolphindb.com/en/Functions/l/listPluginsByCluster.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nlistPluginsByCluster(clusterName)\n\n#### Parameters\n\n**clusterName** is a STRING scalar indicating the name of the cluster.\n\n#### Details\n\nGet the installation status of plugins on each node in the specified cluster. This function can only be executed by an administrator on the MoM (Master of Masters) cluster.\n\n**Return value**: A table with the following columns:\n\n* plugin: Name of the plugin.\n* version: Version of the plugin.\n* user: Name of the user who installed the plugin.\n* time: Installation time in milliseconds.\n* node: Name of the node where the plugin is installed.\n\n#### Examples\n\n```\n// MoMSender cluster:\ninstallPlugin(\"mysql\")\nloadPlugin(\"mysql\")\n  \n// MoM cluster:\nlistPluginsByCluster(\"MoMSender\")\n  \n```\n\n| plugin | version  | user  | time                    | node           |\n| ------ | -------- | ----- | ----------------------- | -------------- |\n| mysql  | 3.00.3   | admin | 2025.05.24T17:10:42.300 | dnode1         |\n| zip    | 3.00.3   | admin | 2025.05.24T17:10:42.285 | dnode1         |\n| mysql  | 3.00.1.3 | admin | 2025.05.24T17:10:49.135 | controller8899 |\n| zip    | 3.00.3   | admin | 2025.05.24T17:10:49.120 | controller8899 |\n"
    },
    "listRemoteModules": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listremotemodules.html",
        "signatures": [
            {
                "full": "listRemoteModules([serverAddr])",
                "name": "listRemoteModules",
                "parameters": [
                    {
                        "full": "[serverAddr]",
                        "name": "serverAddr",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [listRemoteModules](https://docs.dolphindb.com/en/Functions/l/listremotemodules.html)\n\nFirst introduced in version: 2.00.18, 2.00.16.53.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\nlistRemoteModules(\\[serverAddr])\n\n#### Details\n\nLists modules that have been released to the marketplace.\n\n#### Parameters\n\n**serverAddr** (optional): A STRING scalar specifying the HTTP address of the module repository, which defaults to \"<http://dolphindb.cn>\".\n\n#### Returns\n\nA table with the following columns:\n\n* moduleName: the name of the module.\n* moduleVersion: the version of the module.\n\n#### Examples\n\nList all modules available in the marketplace:\n\n```\nlistRemoteModules()\n```\n\nReturns a table like the following:\n\n| moduleName       | moduleVersion |\n| ---------------- | ------------- |\n| DolphinDBModules | 1.0.0         |\n| LogSearcher      | 1.0.0         |\n| alphalens        | 1.0.0         |\n| gtja191Alpha     | 1.0.0         |\n| marketHoliday    | 1.0.0         |\n| mytt             | 1.0.0         |\n| ops              | 1.0.0         |\n\n**Related functions**\n\n[installModule](https://docs.dolphindb.com/en/Functions/i/installmodule.html)\n\n[loadModule](https://docs.dolphindb.com/en/Functions/l/loadModule.html)\n"
    },
    "listRemotePlugins": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listRemotePlugins.html",
        "signatures": [
            {
                "full": "listRemotePlugins([pluginName], [pluginServerAddr])",
                "name": "listRemotePlugins",
                "parameters": [
                    {
                        "full": "[pluginName]",
                        "name": "pluginName",
                        "optional": true
                    },
                    {
                        "full": "[pluginServerAddr]",
                        "name": "pluginServerAddr",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [listRemotePlugins](https://docs.dolphindb.com/en/Functions/l/listRemotePlugins.html)\n\n\n\n#### Syntax\n\nlistRemotePlugins(\\[pluginName], \\[pluginServerAddr])\n\n#### Parameters\n\n**pluginName** (optional) is a string indicating the plugin name.\n\n**pluginServerAddr** (optional) is a string indicating the HTTP address of the DolphinDB plugins repository that the system should use. It is recommended to specify it as \"<http://plugins.dolphindb.com/plugins>\".\n\n#### Details\n\n`listRemotePlugins` returns a table listing the available DolphinDB plugins and their versions.\n\nIf *pluginName* is specified, the function returns the specified plugin. If the specified plugin does not exist, the function returns an empty record. If *pluginName* is not specified, the function returns all the specified plugins.\n\n**Note**: The returned plugin information is based on DolphinDB server version and the operation system.\n\n#### Examples\n\nList all available plugins:\n\n```\nlistRemotePlugins()\n```\n\nReturn a plugin list:\n\n| PluginName  | PluginVersion      |\n| ----------- | ------------------ |\n| hdf5        | *\\<PluginVersion>* |\n| matchEngine | *\\<PluginVersion>* |\n| mongodb     | *\\<PluginVersion>* |\n| mqtt        | *\\<PluginVersion>* |\n| mseed       | *\\<PluginVersion>* |\n| mysql       | *\\<PluginVersion>* |\n| nsq         | *\\<PluginVersion>* |\n| odbc        | *\\<PluginVersion>* |\n| opc         | *\\<PluginVersion>* |\n| opcua       | *\\<PluginVersion>* |\n| zip         | *\\<PluginVersion>* |\n\n*\\<PluginVersion>* refers to the version information of the plugin, such as \"2.00.11\" and \"1.30.23\".\n\nRelated function: [installPlugin](https://docs.dolphindb.com/en/Functions/i/installPlugin.html)\n"
    },
    "listStreamingSQLTables": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listStreamingSQLTables.html",
        "signatures": [
            {
                "full": "listStreamingSQLTables()",
                "name": "listStreamingSQLTables",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [listStreamingSQLTables](https://docs.dolphindb.com/en/Functions/l/listStreamingSQLTables.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nlistStreamingSQLTables()\n\n#### Parameters\n\nNone.\n\n#### Details\n\nList all streaming SQL tables declared via `declareStreamingSQLTable`. Return streaming SQL tables of all users in the system if called by the admin.\n\n**Return value**: A table containing the following columns: tableName, shared, users.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\n\nlistStreamingSQLTables()\n```\n\n| tableName | shared | users |\n| --------- | ------ | ----- |\n| st        | true   | admin |\n\n**Related functions:** [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html)\n"
    },
    "listTables": {
        "url": "https://docs.dolphindb.com/en/Functions/l/listTables.html",
        "signatures": [
            {
                "full": "listTables(dbUrl)",
                "name": "listTables",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    }
                ]
            }
        ],
        "markdown": "### [listTables](https://docs.dolphindb.com/en/Functions/l/listTables.html)\n\n\n\n#### Syntax\n\nlistTables(dbUrl)\n\n#### Parameters\n\n**dbUrl** is a string indicating the local path or DFS path of a database.\n\n#### Details\n\nReturn a table of two columns, tableName and physicalIndex. Please note that only the database with chunks of the table level can have physical indices.\n\n#### Examples\n\n```\nlistTables(dbPath)\n```\n\n| tableName | physicalIndex |\n| --------- | ------------- |\n| pt1       | 1By           |\n| pt        | 1Bw           |\n"
    },
    "loadBackup": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadBackup.html",
        "signatures": [
            {
                "full": "loadBackup(backupDir, dbPath, partition, tableName)",
                "name": "loadBackup",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "partition",
                        "name": "partition"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [loadBackup](https://docs.dolphindb.com/en/Functions/l/loadBackup.html)\n\n\n\n#### Syntax\n\nloadBackup(backupDir, dbPath, partition, tableName)\n\n#### Parameters\n\n**backupDir** is a string indicating the directory where the backup is saved.\n\n**dbPath** is a string indicating the path of a DFS database. For example: \"dfs\\://demo\".\n\n**partition** is a string indicating the path of a partition under the database. For example: \"/20190101/GOOG\".\n\n**Note:**\n\nFor versions between 1.30.16/2.00.4 -1.30.18/2.00.6, if *chunkGranularity* is set to \"TABLE\" when creating the database, *partition* must include the physical index (which you can get with the `listTables` function) of the selected partition. For example, if the physical index of the \"/20190101/GOOG\" partition is 8, then specify partition as \"/20190101/GOOG/8\" to load its backup.\n\n**tableName** is a string indicating a distributed table name.\n\n#### Details\n\nLoad the backup of a partition in a distributed table. It must be executed by a logged-in user.\n\nCurrently, this function only supports loading a partition backed up with SQL statement (when the parameter *sqlObj* is specified for function [backup](https://docs.dolphindb.com/en/Functions/b/backup.html)).\n\n#### Examples\n\n```\nloadBackup(\"/home/DolphinDB/backup\",\"dfs://valuedb\", \"/200001M\",\"pt\");\n```\n\n| month    | x   |\n| -------- | --- |\n| 2000.01M | 1   |\n| 2000.01M | 205 |\n| 2000.01M | 409 |\n| 2000.01M | 613 |\n| 2000.01M | 817 |\n"
    },
    "loadDistributedInMemoryTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadDistributedInMemoryTable.html",
        "signatures": [
            {
                "full": "loadDistributedInMemoryTable(tableName)",
                "name": "loadDistributedInMemoryTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [loadDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/l/loadDistributedInMemoryTable.html)\n\n\n\n#### Syntax\n\nloadDistributedInMemoryTable(tableName)\n\n#### Parameters\n\n**tableName** is a STRING scalar indicating column names of a distributed in-memory table.\n\n#### Details\n\nDelete the specified distributed in-memory table. This function can only be executed on a data node or compute node.\n\n#### Examples\n\n```\npt = createDistributedInMemoryTable(`dt, `time`id`value, `DATETIME`INT`LONG, HASH, [INT, 2],`id)\ntime = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);\nid = 0..39;\nvalue = rand(100, 40);\ntmp = table(time, id, value);\n\npt = loadDistributedInMemoryTable(`dt)\npt.append!(tmp);\nselect * from pt;\n```\n\nRelated functions: [dropDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/d/dropDistributedInMemoryTable.html), [createDistributedInMemoryTable](https://docs.dolphindb.com/en/Functions/c/createDistributedInMemoryTable.html)\n"
    },
    "loadHaMvccTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadHaMvccTable.html",
        "signatures": [
            {
                "full": "loadHaMvccTable(tableName)",
                "name": "loadHaMvccTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [loadHaMvccTable](https://docs.dolphindb.com/en/Functions/l/loadHaMvccTable.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nloadHaMvccTable(tableName)\n\n#### Details\n\nLoads and returns the handle of the HA MVCC table with the specified name.\n\n**Note:**\n\n* `loadHaMvccTable` is the only way to use an HA MVCC table on non-Leader nodes.\n* Queries (SELECT operations) on an HA MVCC table can be executed on both Leader and Follower nodes, and it is recommended to run them on the Leader node.\n\n#### Parameters\n\n**tableName** is a STRING scalar indicating the name of the HA MVCC table to load.\n\n#### Returns\n\nReturns a table handle of HA MVCC table.\n\n#### Examples\n\n```\nt = loadHaMvccTable(\"demoHaMvcc\")\n```\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "loadIPCInMemoryTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadIPCInMemoryTable.html",
        "signatures": [
            {
                "full": "loadIPCInMemoryTable(tableName)",
                "name": "loadIPCInMemoryTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [loadIPCInMemoryTable](https://docs.dolphindb.com/en/Functions/l/loadIPCInMemoryTable.html)\n\n\n\n#### Syntax\n\nloadIPCInMemoryTable(tableName)\n\n#### Parameters\n\n**tableName** is a STRING indicating the name of IPC in-memory table to be loaded.\n\n#### Details\n\nLoad an IPC in-memory table and return its handle.\n\n**Note:** This function only runs on Linux.\n\n#### Examples\n\n```\nipc_t = loadIPCInMemoryTable(\"ipc_table\")\nipc_t\n// output: timestamp temperature\n```\n"
    },
    "loadModel": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadModel.html",
        "signatures": [
            {
                "full": "loadModel(file)",
                "name": "loadModel",
                "parameters": [
                    {
                        "full": "file",
                        "name": "file"
                    }
                ]
            }
        ],
        "markdown": "### [loadModel](https://docs.dolphindb.com/en/Functions/l/loadModel.html)\n\n\n\n#### Syntax\n\nloadModel(file)\n\n#### Parameters\n\n**file** is a string indicating the absolute path and name of the output file.\n\n#### Details\n\nLoad the specifications of a trained model into memory as a dictionary.\n\n#### Examples\n\n```\nx1 = rand(100.0, 100)\nx2 = rand(100.0, 100)\nb0 = 6\nb1 = 1\nb2 = -2\nerr = norm(0, 10, 100)\ny = b0 + b1 * x1 + b2 * x2 + err\nt = table(x1, x2, y)\nmodel = randomForestRegressor(sqlDS(<select * from t>), `y, `x1`x2)\nsaveModel(model, \"C:/DolphinDB/Data/regressionModel.txt\");\n\nmodel = loadModel(\"C:/DolphinDB/Data/regressionModel.txt\")\nyhat = predict(model, t);\n```\n"
    },
    "loadModule": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadModule.html",
        "signatures": [
            {
                "full": "loadModule(name,[moduleDir])",
                "name": "loadModule",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[moduleDir]",
                        "name": "moduleDir",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [loadModule](https://docs.dolphindb.com/en/Functions/l/loadModule.html)\n\n\n\n#### Syntax\n\nloadModule(name,\\[moduleDir])\n\n#### Parameters\n\n**name** is a string indicating the module name.\n\n**moduleDir** is a string indicating the directory where the *.dos* and *.dom* files of modules are located.\n\n#### Details\n\nLoad the functions in a module or plug-in as DolphinDB built-in functions. If the module relies on other modules, the system will also load these modules. It must be executed by a logged-in user.\n\nWhen the system starts up, the configuration parameter *moduleDir* determines the directory where the module is located:\n\n* If the configuration parameter is an absolute path, it is the directory where the search module is located.\n\n* If the configuration parameter is a relative path, the system will search in the three directories: HOMEDIR, WORKDIR and EXECDIR sequentially. If it is found, use the directory as *moduleDir*; if it cannot be found, use `<HOMEDIR> + \"/\" + <moduleDir>` as the absolute path of modules.\n\n* If the configuration parameter *moduleDir* is not set, it is the same as when setting it to a relative path.\n\nIf the module directory contains both a *.dos* file and a *.dom* file with the same name, the system will only load the *.dom* file.\n\n**Note:** *loadModule* can only be used in the initialization script (*dolphindb.dos* as the default file) of the system.\n\nFunction `loadModule` has the same function with the configuration parameter *preloadModules*.\n\n#### Examples\n\nExample 1. Load modules:\n\n```\nloadModule(\"ta\");\n\nloadModule(\"system::log::fileLog\");\n```\n\nExample 2. Load plugins:\n\n```\nloadModule(\"plugins::mysql\");\n\nloadModule(\"plugins::odbc\");\n```\n\nRelated command: [saveModule](https://docs.dolphindb.com/en/Functions/s/saveModule.html)\n"
    },
    "loadModuleFromScript": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadModuleFromScript.html",
        "signatures": [
            {
                "full": "loadModuleFromScript(moduleNamespace, moduleScript, [reload=false])",
                "name": "loadModuleFromScript",
                "parameters": [
                    {
                        "full": "moduleNamespace",
                        "name": "moduleNamespace"
                    },
                    {
                        "full": "moduleScript",
                        "name": "moduleScript"
                    },
                    {
                        "full": "[reload=false]",
                        "name": "reload",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [loadModuleFromScript](https://docs.dolphindb.com/en/Functions/l/loadModuleFromScript.html)\n\n#### Syntax\n\nloadModuleFromScript(moduleNamespace, moduleScript, \\[reload=false])\n\n#### Parameters\n\n* **moduleNamespace** is a STRING scalar or vector indicating the module namespace(s). If there are dependencies between modules, namespaces for all modules must be provided.\n* **moduleScript** is a STRING scalar or vector indicating the module script(s).\n* **reload**(optional) is a Boolean value indicating whether to reload the module. If a module with the same name has been loaded before, this parameter must be set to true to make changes in *moduleScript* take effect. The default value is false.\n\n#### Details\n\nParse scripts containing module definitions and load the modules. If module references are included in the scripts, the order of dependencies in the definition does not need to be considered as they will be automatically resolved.\n\n#### Examples\n\n```\nmoduleName = \"test\"\nmoduleScript = \"module test \\n def testFunc(x,y){ return x+y }\"\nloadModuleFromScript(moduleName,moduleScript)\ngo\ntest::testFunc(2,3)\n// output: 5\n```\n\nIf module references are included:\n\n```\nmoduleNames = [\"test2\",\"test1\"]\nmoduleScripts = [\n\"module test2\nuse test1\ndef func4(x,y){\nreturn func1(x) + func2(y)\n}\n\",\n\"module test1\ndef func1(x){\nreturn x+1\n}\ndef func2(x){\nreturn x+2\n}\ndef func3(x){\nprint(func1(x)+func2(x))\n}\n\"\n]\nloadModuleFromScript(moduleNames,moduleScripts)\ngo\n\ntest1::func3(2)\n// output: 7\n\ntest2::func4(2,3)\n// output: 8\n```\n\n"
    },
    "loadMvccTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadMvccTable.html",
        "signatures": [
            {
                "full": "loadMvccTable(path, tableName)",
                "name": "loadMvccTable",
                "parameters": [
                    {
                        "full": "path",
                        "name": "path"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [loadMvccTable](https://docs.dolphindb.com/en/Functions/l/loadMvccTable.html)\n\n\n\n#### Syntax\n\nloadMvccTable(path, tableName)\n\n#### Parameters\n\n**path** is a string indicating the absolute path of the table.\n\n**tableName** is a string indicating the name of the table on disk.\n\n#### Details\n\nLoad all data of an MVCC table on disk into memory.\n\n#### Examples\n\n```\nn=5\nsyms=`IBM`C`MS`MSFT`JPM`ORCL`FB`GE\ntimestamp=09:30:00+rand(18000,n)\nsym=rand(syms,n)\nqty=100*(1+rand(100,n))\nprice=5.0+rand(100.0,n)\ntemp=table(timestamp,sym,qty,price)\nt1= mvccTable(1:0,`timestamp`sym`qty`price,[TIMESTAMP,SYMBOL,INT,DOUBLE],\"C:/DolphinDB/Data\",\"t1\")\nt1.append!(temp);\n\nloadMvccTable(\"C:/DolphinDB/Data\",t1);\n```\n\n| timestamp               | sym  | qty  | price     |\n| ----------------------- | ---- | ---- | --------- |\n| 1970.01.01T00:00:39.091 | MSFT | 4500 | 99.808702 |\n| 1970.01.01T00:00:35.293 | FB   | 3600 | 26.644715 |\n| 1970.01.01T00:00:36.334 | MSFT | 3800 | 66.754334 |\n| 1970.01.01T00:00:40.362 | ORCL | 4800 | 15.480288 |\n| 1970.01.01T00:00:35.565 | MSFT | 1700 | 23.107408 |\n"
    },
    "loadNpy": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadNpy.html",
        "signatures": [
            {
                "full": "loadNpy(fileName)",
                "name": "loadNpy",
                "parameters": [
                    {
                        "full": "fileName",
                        "name": "fileName"
                    }
                ]
            }
        ],
        "markdown": "### [loadNpy](https://docs.dolphindb.com/en/Functions/l/loadNpy.html)\n\n\n\n#### Syntax\n\nloadNpy(fileName)\n\n#### Parameters\n\n**filename** is a string indicating the path and name of an *.npy* file.\n\n#### Details\n\nLoad an *.npy* (Python Numpy) binary file and convert it into a DolphinDB vector or matrix. NaN in the *.npy* file is converted into null values in DolphinDB.\n\nRight now the function only works for *.npy* files with numerical data.\n\n#### Examples\n\nSave *.npy* files in Python:\n\n```language-python\nimport numpy as np\nnp.save(\"intVec.npy\", np.array([5,6,1,3,4,8]))\nnp.save(\"doubleMat.npy\", np.array([[1.5,5.6,-7.87],[-1.0,3.4,4.5]]))\n```\n\nLoad *.npy* files in DolphinDB:\n\n```\nloadNpy(\"intVec.npy\");\n// output: [5,6,1,3,4,8]\n\nloadNpy(\"doubleMat.npy\");\n```\n\n| #0  | #1  | #2    |\n| --- | --- | ----- |\n| 1.5 | 5.6 | -7.87 |\n| -1  | 3.4 | 4.5   |\n\nRelated function: [saveAsNpy](https://docs.dolphindb.com/en/Functions/s/saveAsNpy.html)\n"
    },
    "loadNpz": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadNpz.html",
        "signatures": [
            {
                "full": "loadNpz(fileName)",
                "name": "loadNpz",
                "parameters": [
                    {
                        "full": "fileName",
                        "name": "fileName"
                    }
                ]
            }
        ],
        "markdown": "### [loadNpz](https://docs.dolphindb.com/en/Functions/l/loadNpz.html)\n\n\n\n#### Syntax\n\nloadNpz(fileName)\n\n#### Parameters\n\n**filename** is a STRING indicating the path of *.npz* file.\n\n#### Details\n\nRead an npz binary file from Python NumPy and convert it into DolphinDB objects. NaN in *.npz* file is converted into null values in DolphinDB.\n\nConversion Table for Python np.array and DolphinDB Objects:\n\n| NumPy array       | DolphinDB Objects                             |\n| ----------------- | --------------------------------------------- |\n| one-dimensional   | vector                                        |\n| two-dimensional   | matrix                                        |\n| three-dimensional | tuple (where each element represents a matrix |\n\nData types supported for conversion are: BOOL, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE and STRING (only one-dimensional array is supported).\n\n#### Examples\n\nSave *.npz* file in Python:\n\n```language-python\nimport numpy as np\na = np.array([[[97, 98]]], dtype=np.int8)\na1 = np.array(['133', '211', '3dds', 'ddd4', 'e5', 'w6'])\nb1 = np.array([[0.7, 0.8, 9.2], [0, np.nan, np.nan], [1.5, 2.8, 0.2]])\nc1 = np.array([[[0.2, 3.3], [1.9, 4.3]], [[5, 6], [1, 2]]])\nnp.savez('my_path/array_save.npz', char=a, a1=a1, b1=b1, c1=c1)\n```\n\nLoad *.npz* file in DolphinDB:\n\n```\npath=\"my_path/array_save.npz\"\nloadNpz(path)\n/* output:\na1->[133,211,3dds,ddd4,e5,w6]\nchar->(#0  #1\n'a' 'b'\n)\nc1->(#0  #1\n0.2 3.3\n1.9 4.3\n,#0 #1\n5  6\n1  2\n)\nb1->\n#0  #1  #2\n0.7 0.8 9.2\n0\n1.5 2.8 0.2\n*/\n```\n\nRelated Function: [loadNpy](https://docs.dolphindb.com/en/Functions/l/loadNpy.html)\n"
    },
    "loadPlugin": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadPlugin.html",
        "signatures": [
            {
                "full": "loadPlugin(metaFile)",
                "name": "loadPlugin",
                "parameters": [
                    {
                        "full": "metaFile",
                        "name": "metaFile"
                    }
                ]
            }
        ],
        "markdown": "### [loadPlugin](https://docs.dolphindb.com/en/Functions/l/loadPlugin.html)\n\n\n\n#### Syntax\n\nloadPlugin(metaFile)\n\n#### Parameters\n\n**metaFile** is the absolute path of a text file that describes a DolphinDB plugin. Since version 2.00.11/1.30.23, it can be specified as the plugin name (case sensitive). The system will load the plugin through the plugin name and the configuration parameter *pluginDir*. Note that the name of a very small number of plugins differs from the name of the folder where it is located. In such cases, loading the plugin through the plugin name will fail due to the non-existent path. To resolve this, modify *metaFile* to the folder name.\n\n#### Details\n\nLoad a plugin into DolphinDB. It must be executed by a logged-in user. Note that for DolphinDB community edition users, paid plugins must be purchased separately.\n\nFor each DolphinDB plugin, there is a text file that describes the plugin. The first line of the text file includes the names of the plugin and the shared library file, separated by comma \",\". Each of the following lines includes the following information: a function in the library file, the corresponding DolphinDB function, function type (operator or system function), the minimal number of parameters, the maximum number of parameters, whether the function is an aggregate function, whether the function is order-sensitive or not.\n\nThe function returns a tuple with the names of the functions in the library file.\n\n#### Examples\n\n* Load the plugin from the Plugin Square\n\n  Take the MQTT plugin as an example. After installing the plugin with`installPlugin`, the plugin can be loaded in two ways:\n\n  * Load the plugin using the absolute path:\n\n    ```\n    installPlugin(\"mqtt\")\n    loadPlugin(\"D:/TEST/DolphinDB_Win64_V2.00.10/server/plugins/mqtt/PluginMQTT.txt\")\n    ```\n\n  **Note**: When loading a plugin with the absolute path on Windows, make sure to use \"/\" in the path, instead of \"\\\\\".\n\n  * Load the plugin by specifying its name:\n\n    ```\n    installPlugin(\"mqtt\")\n    loadPlugin(\"mqtt\")\n    ```\n\n* Load the manually compiled plugin\n\n  The file *odbc.txt* of the DolphinDB odbc plugin:\n\n  ```\n  odbc,libPluginODBC.so,2.00.10\n  odbcQuery,query,system,2,5,0\n  odbcConnect,connect,system,1,2,0\n  odbcClose,close,system,1,1,0\n  odbcExecute,execute,system,2,2,0\n  odbcAppend,append,system,3,5,0\n  ```\n\n  The odbc plugin provides 5 methods, `query`, `connect`, `close`, `execute`, and `append`. Install the plugin to use these methods. The following script shows how to load the odbc plugin and call its methods:\n\n  ```\n  loadPlugin(\"/home/DolphinDB/server/plugins/odbc/odbc.txt\")\n  // Or you can use plugin name to load the plugin.\n  loadPlugin(\"odbc\")\n  use odbc\n  ConnStr=\"Driver=MySQL;Data Source=odbc_test;Server=127.0.0.1;Uid=root;Pwd=123456;Database=odbc_test\"\n  conn=connect(connStr)      // create connection to MySQL\n\n  t=query(conn,\"select * from test\")\n  close(conn)\n  ```\n"
    },
    "loadRecord": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadRecord.html",
        "signatures": [
            {
                "full": "loadRecord(filename, schema, [skipBytes=0], [count])",
                "name": "loadRecord",
                "parameters": [
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "schema",
                        "name": "schema"
                    },
                    {
                        "full": "[skipBytes=0]",
                        "name": "skipBytes",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[count]",
                        "name": "count",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [loadRecord](https://docs.dolphindb.com/en/Functions/l/loadRecord.html)\n\n\n\n#### Syntax\n\nloadRecord(filename, schema, \\[skipBytes=0], \\[count])\n\n#### Parameters\n\n**filename** is a string indicating the path of a file.\n\n**schema** is a tuple of vectors. Each vector of the tuple represents the name and data type of a column. For a string column, we also need to specify the length of the string. If a string is shorter than the specified length, add 0s in the end to reach the specified length.\n\n**skipBytes** is a nonnegative integer indicating the number of bytes to skip in the beginning of the file. The default value is 0.\n\n**count** is a positive integer indicating the number of records to load. If it is not specified, load all records.\n\n#### Details\n\nLoad a binary file with fixed length for each column into memory.\n\n#### Examples\n\nThe following is a binary file *sample.bin*:\n\n```\n/* output:\n0000000 3036 3131 3737 532e 0048 0000 0000 0000\n0000010 0000 0000 0000 0000 0000 0000 0000 0000\n0000020 16b6 0134 d160 0578 0000 0000 0000 0000\n0000030 0000 0000 3333 4137 0000 0000 0000 0000\n0000040 0000 0000 0000 0000 0000 0000 0000 0000\n0000050 0000 0000 0000 0000 0000 0000 00c8 0000\n0000060 0000 0000 0000 0000 0000 0000 0000 0000\n*\n0000080 0000 0000 3333 4137 0000 0000 0000 0000\n0000090 0000 0000 0000 0000 0000 0000 0000 0000\n00000a0 0000 0000 0000 0000 0000 0000 00c8 0000\n00000b0 0384 0000 0000 0000 0000 0000 0000 0000\n00000c0 0000 0000 0000 0000 0000 0000 0000 0000\n00000d0 0000 0000 3036 3131 3737 532e 0048 0000\n00000e0 0000 0000 0000 0000 0000 0000 0000 0000\n00000f0 0000 0000 16b6 0134 ea58 057b 0000 0000\n0000100 0000 0000 0000 0000 3333 4137 0000 0000\n0000110 0000 0000 0000 0000 0000 0000 0000 0000\n*\n0000130 00c8 0000 0000 0000 0000 0000 0000 0000\n0000140 0000 0000 0000 0000 0000 0000 0000 0000\n0000150 0000 0000 0000 0000 3333 4137 0000 0000\n0000160 0000 0000 0000 0000 0000 0000 0000 0000\n*\n0000180 00c8 0000 0b54 0000 0000 0000 0000 0000\n0000190 0000 0000 0000 0000 0000 0000 0000 0000\n00001a0 0000 0000 0000 0000 3036 3131 3737 532e\n00001b0 0048 0000 0000 0000 0000 0000 0000 0000\n00001c0 0000 0000 0000 0000 16b6 0134 82b0 057c\n00001d0 0000 0000 0000 0000 0000 0000 3333 4137\n00001e0 0000 0000 0000 0000 0000 0000 0000 0000\n*\n0000200\n*/\n```\n\nUse function `loadRecord` to load the file into DolphinDB. Please note that the column code ia s string with fixed length of 32 in the file.\n\n```\nschema = [(\"code\", SYMBOL, 32),(\"date\", INT),(\"time\", INT),(\"last\", FLOAT),(\"volume\", INT),(\"value\", FLOAT),(\"ask1\", FLOAT),(\"ask2\", FLOAT),(\"ask3\", FLOAT),(\"ask4\", FLOAT),(\"ask5\", FLOAT),(\"ask6\", FLOAT),(\"ask7\", FLOAT),(\"ask8\", FLOAT),(\"ask9\", FLOAT),(\"ask10\", FLOAT),(\"ask_size1\", INT),(\"ask_size2\", INT),(\"ask_size3\", INT),(\"ask_size4\", INT),(\"ask_size5\", INT),(\"ask_size6\", INT),(\"ask_size7\", INT),(\"ask_size8\", INT),(\"ask_size9\", INT),(\"ask_size10\", INT),(\"bid1\", FLOAT),(\"bid2\", FLOAT),(\"bid3\", FLOAT),(\"bid4\", FLOAT),(\"bid5\", FLOAT),(\"bid6\", FLOAT),(\"bid7\", FLOAT),(\"bid8\", FLOAT),(\"bid9\", FLOAT),(\"bid10\", FLOAT),(\"bid_size1\", INT),(\"bid_size2\", INT),(\"bid_size3\", INT),(\"bid_size4\", INT),(\"bid_size5\", INT),(\"bid_size6\", INT),(\"bid_size7\", INT),(\"bid_size8\", INT),(\"bid_size9\", INT),(\"bid_size10\", INT)];\nt=loadRecord(\"/home/DolphinDB/sample.bin\",schema);\nselect code, date,time,last,volume,value,ask1,ask_size1,bid1,bid_size1 from t;\n```\n\n| code      | date     | time     | last | volume | value | ask1  | ask\\_size1 | bid1  | bid\\_size1 |\n| --------- | -------- | -------- | ---- | ------ | ----- | ----- | ---------- | ----- | ---------- |\n| 601177.SH | 20190902 | 91804000 | 0    | 0      | 0     | 11.45 | 200        | 11.45 | 200        |\n| 601177.SH | 20190902 | 92007000 | 0    | 0      | 0     | 11.45 | 200        | 11.45 | 200        |\n"
    },
    "loadTable": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadTable.html",
        "signatures": [
            {
                "full": "loadTable(database, tableName, [partitions], [memoryMode=false])",
                "name": "loadTable",
                "parameters": [
                    {
                        "full": "database",
                        "name": "database"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[partitions]",
                        "name": "partitions",
                        "optional": true
                    },
                    {
                        "full": "[memoryMode=false]",
                        "name": "memoryMode",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [loadTable](https://docs.dolphindb.com/en/Functions/l/loadTable.html)\n\n\n\n#### Syntax\n\nloadTable(database, tableName, \\[partitions], \\[memoryMode=false])\n\n#### Parameters\n\n**database** is either a database handle, or the absolute path of the folder where the database is stored. The database can be located in the local file system, or the distributed file system.\n\n**tableName** is a string indicating the name of the table on disk.\n\n**partitions** is a scalar or vector indicating which partitions of the table to load into memory.\n\n**memoryMode** is a Boolean value indicating whether to load only metadata into memory (*memoryMode* = false). If *memoryMode* = true, load all data or selected partitions into memory. Please note that this parameter only takes effect for local databases on disk. For DFS databases, only the metadata is loaded into memory.\n\n#### Details\n\nFor a DFS table: return a table object with only the metadata.\n\nFor a partitioned table in the local file system: if *memoryMode* = true, load all partitions (or selected partitions if parameter *partitions* is specified) into memory as a partitioned table; if *memoryMode* = false, only load metadata into memory.\n\n#### Examples\n\nIn the distributed file system:\n\n```\nn=1000000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt1=table(ID, date, x);\n\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndbID=database(, RANGE, 0 50 100);\ndb = database(\"dfs://compoDB\", COMPO, [dbDate, dbID]);\npt = db.createPartitionedTable(t1, `pt, `date`ID).append!(t1)\n\nt2=table(0..100 as ID,take(2017.08.07..2017.08.11,101) as date)\ndt = db.createDimensionTable(t2, `dt).append!(t2)\n```\n\n* To load a dimension table:\n\n  ```\n  tmp = loadTable(\"dfs://compoDB\", `dt)\n  select count(*) from tmp\n  ```\n\n  | count |\n  | ----- |\n  | 101   |\n\n* To load a partitioned table:\n\n  ```\n  tmp = loadTable(\"dfs://compoDB\", `pt)\n  select count(*) from tmp\n  ```\n\n  | count   |\n  | ------- |\n  | 1000000 |\n\n* For a DFS table, we cannot use *loadTable* to load specified partitions directly. To load specified partitions into memory, we can specify the filtering conditions in the SQL statement.\n\n  ```\n  tmp = loadTable(\"dfs://compoDB\", `pt)\n  select * from tmp where date=2017.08.07\n  ```\n\nWith the in-memory partitioned table, we can execute functions such as [update!](https://docs.dolphindb.com/en/Functions/u/update!.html), [drop!](https://docs.dolphindb.com/en/Functions/d/dropColumns!.html), [rename!](https://docs.dolphindb.com/en/Functions/r/rename!.html), [sortBy!](https://docs.dolphindb.com/en/Functions/s/sortBy!.html) etc.\n"
    },
    "loadTableBySQL": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadTableBySQL.html",
        "signatures": [
            {
                "full": "loadTableBySQL(sql)",
                "name": "loadTableBySQL",
                "parameters": [
                    {
                        "full": "sql",
                        "name": "sql"
                    }
                ]
            }
        ],
        "markdown": "### [loadTableBySQL](https://docs.dolphindb.com/en/Functions/l/loadTableBySQL.html)\n\n\n\n#### Syntax\n\nloadTableBySQL(sql)\n\n#### Parameters\n\n**sql** is a metacode object representing a SQL query. It can use `where` clause to filter partitions or rows and use `SELECT` statement to select columns including calculated columns. However, it cannot use `TOP` clause, `GROUP BY` clause, `ORDER BY` clause, `CONTEXT BY`, and `LIMIT`.\n\n#### Details\n\nLoad only the rows of a partitioned table that satisfy the filtering conditions in a SQL query to memory. The result is a partitioned in-memory table with the same partitioning scheme as the database on disk.\n\n**Note:** In scenarios involving large-scale data queries, this function may result in high memory usage. In such cases, it is recommended to use SQL statements directly for querying instead.\n\n#### Examples\n\n```\nn=1000000\nt=table(rand('A'..'Z',n) as sym, 2000.01.01+rand(365,n) as date, 10.0+rand(2.0,n) as price1, 100.0+rand(20.0,n) as price2, rand(10,n) as qty1, rand(100,n) as qty2)\n\ndb = database(\"dfs://tradeDB\", VALUE, 'A'..'Z')\ntrades=db.createPartitionedTable(t,`trades,`sym).append!(t)\n\nsample=select * from loadTableBySQL(<select * from trades where date between 2000.03.01 : 2000.05.01>)\nsample=select * from loadTableBySQL(<select sym, date, price1, qty1 from trades where date between 2000.03.01 : 2000.05.01>)\n\ndates = 2000.01.16 2000.02.14 2000.08.01\nst = sql(<select sym, date, price1, qty1>, trades, expr(<date>, in, dates))\nsample = select * from loadTableBySQL(st)\n\ncolNames =`sym`date`qty2`price2\nst= sql(sqlCol(colNames), trades)\nsample = select * from loadTableBySQL(st)\n```\n"
    },
    "loadText": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadText.html",
        "signatures": [
            {
                "full": "loadText(filename, [delimiter], [schema], [skipRows=0], [arrayDelimiter], [containHeader], [arrayMarker])",
                "name": "loadText",
                "parameters": [
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "[delimiter]",
                        "name": "delimiter",
                        "optional": true
                    },
                    {
                        "full": "[schema]",
                        "name": "schema",
                        "optional": true
                    },
                    {
                        "full": "[skipRows=0]",
                        "name": "skipRows",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[arrayDelimiter]",
                        "name": "arrayDelimiter",
                        "optional": true
                    },
                    {
                        "full": "[containHeader]",
                        "name": "containHeader",
                        "optional": true
                    },
                    {
                        "full": "[arrayMarker]",
                        "name": "arrayMarker",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [loadText](https://docs.dolphindb.com/en/Functions/l/loadText.html)\n\n\n\n#### Syntax\n\nloadText(filename, \\[delimiter], \\[schema], \\[skipRows=0], \\[arrayDelimiter], \\[containHeader], \\[arrayMarker])\n\n#### Parameters\n\n**filename** is the input text file name with its absolute path. Currently only *.csv* files are supported.\n\n**delimiter** (optional) is a STRING scalar indicating the table column separator. It can consist of one or more characters, with the default being a comma (',').\n\n**schema** (optional) is a table. It can have the following columns, among which \"name\" and \"type\" columns are required.\n\n| Column | Data Type            | Description                    |\n| ------ | -------------------- | ------------------------------ |\n| name   | STRING scalar        | column name                    |\n| type   | STRING scalar        | data type                      |\n| format | STRING scalar        | the format of temporal columns |\n| col    | INT scalar or vector | the columns to be loaded       |\n\n**Note:**\n\nIf \"type\" specifies a temporal data type, the format of the source data must match a DolphinDB temporal data type. If the format of the source data and the DolphinDB temporal data types are incompatible, you can specify the column type as STRING when loading the data and convert it to a DolphinDB temporal data type using the [temporalParse](https://docs.dolphindb.com/en/Functions/t/temporalParse.html) function afterwards.\n\n**skipRows** (optional) is an integer between 0 and 1024 indicating the rows in the beginning of the text file to be ignored. The default value is 0.\n\n**arrayDelimiter** (optional) is a single character indicating the delimiter for columns holding the array vectors in the file. You must use the *schema* parameter to update the data type of the type column with the corresponding array vector data type before import.\n\n**containHeader** (optional) is a Boolean value indicating whether the file contains a header row. The default value is null.\n\n**arrayMarker** is a string containing 2 characters or a CHAR pair. These two characters represent the identifiers for the left and right boundaries of an array vector. The default identifiers are double quotes (\").\n\n* It cannot contain spaces, tabs (`\\t`), or newline characters (`\\t` or `\\n`).\n\n* It cannot contain digits or letters.\n\n* If one is a double quote (`\"`), the other must also be a double quote.\n\n* If the identifier is `'`, `\"`, or `\\`, a backslash ( \\ ) escape character should be used as appropriate. For example, `arrayMarker=\"\\\"\\\"\"`.\n\n* If *delimiter*specifies a single character, *arrayMarker* cannot contain the same character.\n\n* If *delimiter*specifies multiple characters, the left boundary of *arrayMarker* cannot be the same as the first character of *delimiter*.\n\n#### Details\n\nLoad a text file into memory as a table. *loadText* loads data in single thread. To load data in multiple threads, use [ploadText](https://docs.dolphindb.com/en/Functions/p/ploadText.html) .\n\n* How a header row is determined:\n\n  * When *containHeader* is null, the first row of the file is read in string format, and the column names are parsed from that data.The first row of the file 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;\n\n  * When *containHeader* is true, the first row is determined as the header row, and the column names are parsed from that data;\n\n  * When *containHeader* is false, the system uses col0, col1, … as the column names.\n\n* How the column types are determined:\n\n  * 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 [extractTextSchema](https://docs.dolphindb.com/en/Functions/e/extractTextSchema.html) function after loading.\n  * When the input file contains dates and times:\n    * For data with delimiters (date delimiters \"-\", \"/\" and \".\", and time delimiter \":\"), it will be converted to the corresponding type. For example, \"12:34:56\" is converted to the SECOND type; \"23.04.10\" is converted to the DATE type.\n    * For data without delimiters, data in the format of \"yyMMdd\" that meets 0<=yy<=99, 0<=MM<=12, 1<=dd<=31, will be preferentially parsed as DATE; data in the format of \"yyyyMMdd\" that meets 1900<=yyyy<=2100, 0<=MM<=12, 1<=dd<=31 will be preferentially parsed as DATE.\n  * 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 [Parsing and Format of Temporal Variables](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/ParsingandFormatofTemporalVariables.html).\n\nTo load a subset of columns, specify the column index in the \"col\" column of *schema*.\n\nAs string in DolphinDB is encoded in UTF-8, we require input text files be encoded in UTF-8.\n\nColumn names in DolphinDB must only contain letters, numbers or underscores and must start with a letter. If a column name in the text file does not meet the requirements, the system automatically adjusts it:\n\n* If the column name contains characters other than letters, numbers or underscores, these characters are converted into underscores.\n\n* If the column name does not start with a letter, add \"c\" to the column name so that it starts with \"c\".\n\nA few examples:\n\n| Column name in data files | Adjusted column name |\n| ------------------------- | -------------------- |\n| 1\\_test                   | c1\\_test             |\n| test-a!                   | test\\_a\\_            |\n| \\[test]                   | c\\_test\\_            |\n\n**Note:** Starting from version 1.30.22/2.00.10, `loadText` supports files containing multiple line breaks in a single record.\n\n#### Examples\n\nUse the following script to generate the data file to be used for the examples:\n\n```\nn=10\nsym=rand(`AAPL`ORCL`MS`SUN,n)\npermno=take(10001,n)\ndate=rand(2019.06.01..2019.06.10,n)\nopen=rand(100.0,n)\nhigh=rand(200.0,n)\nclose=rand(200.0,n)\npre_close=rand(200.0,n)\nchange=rand(100.0,n)\nvol=rand(10000,n)\namount=rand(100000.0,n)\nt=table(sym,permno,date,open,high,close,pre_close,change,vol,amount)\nsaveText(t,\"C:/DolphinDB/Data/stock.csv\");\n```\n\nExample: Use *loadText* without specifying any optional parameters:\n\n```\ntt=loadText(\"C:/DolphinDB/Data/stock.csv\");\ntt;\n```\n\n| sym  | permno | date       | open      | high       | close      | pre\\_close | change    | vol  | amount       |\n| ---- | ------ | ---------- | --------- | ---------- | ---------- | ---------- | --------- | ---- | ------------ |\n| MS   | 10001  | 2019.06.06 | 90.346594 | 80.530542  | 96.474428  | 146.305659 | 0.720236  | 1045 | 90494.568297 |\n| AAPL | 10001  | 2019.06.07 | 91.165315 | 8.482074   | 85.514922  | 16.259077  | 76.797829 | 7646 | 91623.485996 |\n| AAPL | 10001  | 2019.06.03 | 45.361885 | 14.077451  | 149.848419 | 89.110375  | 45.499145 | 9555 | 98171.601654 |\n| MS   | 10001  | 2019.06.04 | 8.98688   | 0.591778   | 155.54643  | 132.423187 | 69.95799  | 1202 | 3512.927634  |\n| MS   | 10001  | 2019.06.07 | 62.866173 | 33.465237  | 174.20712  | 102.695818 | 74.580523 | 3524 | 61943.64517  |\n| MS   | 10001  | 2019.06.09 | 32.819915 | 13.319577  | 136.729618 | 63.980405  | 60.66375  | 7078 | 85138.216568 |\n| MS   | 10001  | 2019.06.07 | 90.210866 | 22.728777  | 150.212291 | 59.454705  | 73.916303 | 5306 | 19883.845607 |\n| AAPL | 10001  | 2019.06.06 | 83.752686 | 71.3501    | 98.211979  | 145.60098  | 94.428343 | 8852 | 9236.020781  |\n| ORCL | 10001  | 2019.06.01 | 81.64719  | 129.702202 | 182.784373 | 117.575967 | 74.84595  | 2942 | 43394.871242 |\n| AAPL | 10001  | 2019.06.02 | 10.068382 | 80.875383  | 181.674585 | 138.783821 | 25.298267 | 1088 | 82981.043775 |\n\n```\nschema(tt).colDefs;\n```\n\n| name       | typeString | typeInt | comment |\n| ---------- | ---------- | ------- | ------- |\n| sym        | SYMBOL     | 17      |         |\n| permno     | INT        | 4       |         |\n| date       | DATE       | 6       |         |\n| open       | DOUBLE     | 16      |         |\n| high       | DOUBLE     | 16      |         |\n| close      | DOUBLE     | 16      |         |\n| pre\\_close | DOUBLE     | 16      |         |\n| change     | DOUBLE     | 16      |         |\n| vol        | INT        | 4       |         |\n| amount     | DOUBLE     | 16      |         |\n\nExample: Specify the data type of a column before loading the file.\n\nWe may want to change the data type of column \"permno\" to be SYMBOL. For this, we need to use function [extractTextSchema](https://docs.dolphindb.com/en/Functions/e/extractTextSchema.html) to get the schema table, update it, then load the text file with the revised schema table.\n\n```\nschema=extractTextSchema(\"C:/DolphinDB/Data/stock.csv\");\nupdate schema set type=`SYMBOL where name=`permno;\ntt=loadText(\"C:/DolphinDB/Data/stock.csv\",,schema);\nschema(tt).colDefs;\n```\n\n| name       | typeString | typeInt | comment |\n| ---------- | ---------- | ------- | ------- |\n| sym        | SYMBOL     | 17      |         |\n| permno     | SYMBOL     | 17      |         |\n| date       | DATE       | 6       |         |\n| open       | DOUBLE     | 16      |         |\n| high       | DOUBLE     | 16      |         |\n| close      | DOUBLE     | 16      |         |\n| pre\\_close | DOUBLE     | 16      |         |\n| change     | DOUBLE     | 16      |         |\n| vol        | INT        | 4       |         |\n| amount     | DOUBLE     | 16      |         |\n\nYou can also specify the data types of all columns:\n\n```\nschematable=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)\ntt=loadText(\"C:/DolphinDB/Data/stock.csv\",,schematable)\nschema(tt).colDefs;\n```\n\n| name       | typeString | typeInt | comment |\n| ---------- | ---------- | ------- | ------- |\n| sym        | SYMBOL     | 17      |         |\n| permno     | SYMBOL     | 17      |         |\n| date       | DATE       | 6       |         |\n| open       | DOUBLE     | 16      |         |\n| high       | DOUBLE     | 16      |         |\n| close      | DOUBLE     | 16      |         |\n| pre\\_close | DOUBLE     | 16      |         |\n| change     | DOUBLE     | 16      |         |\n| vol        | INT        | 4       |         |\n| amount     | DOUBLE     | 16      |         |\n\nExample: Load only a subset of columns.\n\nFor example, we may only need to load the following 7 columns: sym, date, open, high, close, vol, amount. Please note that we cannot change the order of columns when loading data. To change the order of columns in the loaded table, use function [reorderColumns!](https://docs.dolphindb.com/en/Functions/r/reorderColumns!.html).\n\n```\nschema=extractTextSchema(\"C:/DolphinDB/Data/stock.csv\");\nschema=select * from schema where name in `sym`date`open`high`close`vol`amount\nschema[`col]=[0,2,3,4,5,8,9]\n\ntt=loadText(\"C:/DolphinDB/Data/stock.csv\",,schema);\ntt;\n```\n\n| sym  | date       | open      | high       | close      | vol  | amount       |\n| ---- | ---------- | --------- | ---------- | ---------- | ---- | ------------ |\n| SUN  | 2019.06.10 | 18.675316 | 72.754005  | 136.463909 | 1376 | 31371.319038 |\n| AAPL | 2019.06.05 | 42.098717 | 196.873587 | 41.513899  | 3632 | 9950.864129  |\n| ORCL | 2019.06.05 | 62.223474 | 197.099027 | 123.785675 | 3069 | 38035.800937 |\n| SUN  | 2019.06.03 | 0.18163   | 50.669866  | 4.652098   | 6213 | 1842.198893  |\n| SUN  | 2019.06.06 | 32.54134  | 67.012502  | 130.312294 | 4891 | 55744.156823 |\n| SUN  | 2019.06.07 | 56.899091 | 81.709825  | 61.786176  | 1133 | 69057.849515 |\n| AAPL | 2019.06.08 | 77.026838 | 38.504431  | 22.68496   | 3672 | 34420.187073 |\n| ORCL | 2019.06.07 | 62.752656 | 39.33621   | 48.483091  | 4382 | 41601.601639 |\n| AAPL | 2019.06.02 | 8.5487    | 17.623418  | 141.88325  | 8092 | 15449.159988 |\n| AAPL | 2019.06.02 | 26.178685 | 197.320455 | 110.52407  | 5541 | 14616.820449 |\n\nExample: Skip the first 2 rows when loading.\n\nPlease note that as the header is the first line of the text file, it is also skipped.\n\n```\nre=loadText(filename=\"C:/DolphinDB/Data/stock.csv\",skipRows=2)\nselect count(*) from re;\n```\n\n| count |\n| ----- |\n| 9     |\n\nExample: Specify the temporal format when loading the file.\n\nGenerate the text file to be used:\n\n```\ntime=[\"20190623145457\",\"20190623155423\",\"20190623163025\"]\nsym=`AAPL`MS`IBM\nqty=2200 5400 8670\nprice=54.78 59.64 65.23\nt=table(time,sym,qty,price)\nsaveText(t,\"C:/DolphinDB/Data/t2.csv\");\n```\n\nObtain the text schema with [extractTextSchema](https://docs.dolphindb.com/en/Functions/e/extractTextSchema.html) before loading the file:\n\n```\nextractTextSchema(\"C:/DolphinDB/Data/t2.csv\");\n```\n\n| name  | type   |\n| ----- | ------ |\n| time  | LONG   |\n| sym   | SYMBOL |\n| qty   | INT    |\n| price | DOUBLE |\n\nFrom the example above, if we load this text file without specifying the format of column \"time\", column \"time\" is empty as the system cannot parse the raw data correctly. For this scenario we must specify the format of the column.\n\n```\nschema=extractTextSchema(\"C:/DolphinDB/Data/t2.csv\")\nupdate schema set type = \"DATETIME\" where name = \"time\"\nschema[`format]=[\"yyyyMMddHHmmss\",,,];\n\nloadText(\"C:/DolphinDB/Data/t2.csv\",,schema);\n```\n\n| time                | sym  | qty  | price |\n| ------------------- | ---- | ---- | ----- |\n| 2019.06.23T14:54:57 | AAPL | 2200 | 54.78 |\n| 2019.06.23T15:54:23 | MS   | 5400 | 59.64 |\n| 2019.06.23T16:30:25 | IBM  | 8670 | 65.23 |\n\nExample: Load array vectors\n\nCreate a .csv file\n\n```\nbid = array(DOUBLE[], 0, 20).append!([1.4799 1.479 1.4787, 1.4796 1.479 1.4784, 1.4791 1.479 1.4784])\nask = array(DOUBLE[], 0, 20).append!([1.4821 1.4825 1.4828, 1.4818 1.482 1.4821, 1.4814 1.4818 1.482])\nTradeDate = 2022.01.01 + 1..3\nSecurityID = rand(`APPL`AMZN`IBM, 3)\nt = table(SecurityID as `sid, TradeDate as `date, bid as `bid, ask as `ask)\nt;\nsaveText(t,filename=\"/home/t.csv\",delimiter=',',append=true)\n```\n\nLoad with `loadText`\n\n```\npath = \"/home/t.csv\"\nschema=extractTextSchema(path);\nupdate schema set type = \"DOUBLE[]\" where name=\"bid\" or name =\"ask\"\nt = loadText(path, schema=schema, arrayDelimiter=\",\")\nt;\n```\n\n| sid  | date       | bid                    | ask                     |\n| ---- | ---------- | ---------------------- | ----------------------- |\n| AMZN | 2022.01.02 | \\[1.4799,1.479,1.4787] | \\[1.4821,1.4825,1.4828] |\n| AMZN | 2022.01.03 | \\[1.4796,1.479,1.4784] | \\[1.4818,1.482,1.4821]  |\n| IBM  | 2022.01.04 | \\[1.4791,1.479,1.4784] | \\[1.4814,1.4818,1.482]  |\n\nWhen exporting data to a .csv file, the default delimiter for array vectors are double quotes (\"). For example, a default exported *t.csv* would be:\n\n```\nsid,date,bid,ask\nAPPL,2022.01.02,\"1.4799,1.479,1.4787\",\"1.4821,1.4825,1.4828\"\nIBM,2022.01.03,\"1.4796,1.479,1.4784\",\"1.4818,1.482,1.4821\"\nAPPL,2022.01.04,\"1.4791,1.479,1.4784\",\"1.4814,1.4818,1.482\"\n```\n\nIf the boundary identifier is not double quote for array vectors, you can load the file with *arrayMarker*specified. For example, if the *t.csv* is in the following format:\n\n```\nsid,date,bid,ask\nAPPL,2022.01.02,[1.4799,1.479,1.4787],[1.4821,1.4825,1.4828]\nIBM,2022.01.03,[1.4796,1.479,1.4784],[1.4818,1.482,1.4821]\nAPPL,2022.01.04,[1.4791,1.479,1.4784],[1.4814,1.4818,1.482]\n```\n\nLoad it with the following script:\n\n```\npath = \"/home/DolphinDB/Data/t.csv\"\nschema=extractTextSchema(path);\nupdate schema set type = \"DOUBLE[]\" where name=\"bid\" or name =\"ask\"\nt = loadText(path, schema=schema, arrayDelimiter=\",\",arrayMarker=\"[]\")\nt;\n```\n"
    },
    "loadTextEx": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadTextEx.html",
        "signatures": [
            {
                "full": "loadTextEx(dbHandle, tableName, partitionColumns, filename, [delimiter], [schema], [skipRows=0], [transform], [sortColumns], [atomic=false], [arrayDelimiter], [containHeader], [arrayMarker])",
                "name": "loadTextEx",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "partitionColumns",
                        "name": "partitionColumns"
                    },
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "[delimiter]",
                        "name": "delimiter",
                        "optional": true
                    },
                    {
                        "full": "[schema]",
                        "name": "schema",
                        "optional": true
                    },
                    {
                        "full": "[skipRows=0]",
                        "name": "skipRows",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[transform]",
                        "name": "transform",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns]",
                        "name": "sortColumns",
                        "optional": true
                    },
                    {
                        "full": "[atomic=false]",
                        "name": "atomic",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[arrayDelimiter]",
                        "name": "arrayDelimiter",
                        "optional": true
                    },
                    {
                        "full": "[containHeader]",
                        "name": "containHeader",
                        "optional": true
                    },
                    {
                        "full": "[arrayMarker]",
                        "name": "arrayMarker",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [loadTextEx](https://docs.dolphindb.com/en/Functions/l/loadTextEx.html)\n\n\n\n#### Syntax\n\nloadTextEx(dbHandle, tableName, partitionColumns, filename, \\[delimiter], \\[schema], \\[skipRows=0], \\[transform], \\[sortColumns], \\[atomic=false], \\[arrayDelimiter], \\[containHeader], \\[arrayMarker])\n\n#### Parameters\n\n**dbHandle** the distributed database where the imported data will be saved. The database can be either in the distributed file system or an in-memory database.\n\n**tableName** a string indicating the name of the table with the imported data.\n\n**partitionColumns** a string scalar/vector indicating partitioning column(s). For sequential partition, *partitionColumns* is \"\" as it doesn't need a partitioning column. For composite partition, *partitionColumns* is a string vector.\n\n**filename** is the input text file name with its absolute path. Currently only *.csv* files are supported.\n\n**delimiter** (optional) is a STRING scalar indicating the table column separator. It can consist of one or more characters, with the default being a comma (',').\n\n**schema** (optional) is a table. It can have the following columns, among which \"name\" and \"type\" columns are required.\n\n| Column | Data Type            | Description                    |\n| ------ | -------------------- | ------------------------------ |\n| name   | STRING scalar        | column name                    |\n| type   | STRING scalar        | data type                      |\n| format | STRING scalar        | the format of temporal columns |\n| col    | INT scalar or vector | the columns to be loaded       |\n\n**Note:**\n\nIf \"type\" specifies a temporal data type, the format of the source data must match a DolphinDB temporal data type. If the format of the source data and the DolphinDB temporal data types are incompatible, you can specify the column type as STRING when loading the data and convert it to a DolphinDB temporal data type using the [temporalParse](https://docs.dolphindb.com/en/Functions/t/temporalParse.html) function afterwards.\n\n**skipRows** (optional) is an integer between 0 and 1024 indicating the rows in the beginning of the text file to be ignored. The default value is 0.\n\n**transform** (optional) is a unary function. The parameter of the function must be a table.\n\n**sortColumns** (optional) is a string scalar/vector indicating the columns based on which the table is sorted.\n\n**atomic** (optional) is a Boolean value indicating whether to guarantee atomicity when loading a file with the cache engine enabled. If it is set to true, the entire loading process of a file is a transaction; set to false to split the loading process into multiple transactions.\n\n**Note:**\n\nIt is required to set *atomic* = false if the file to be loaded exceeds the cache engine capacity. Otherwise, a transaction may get stuck: it can neither be committed nor rolled back.\n\n**arrayDelimiter** (optional) is a single character indicating the delimiter for columns holding the array vectors in the file. Since the array vectors cannot be recognized automatically, you must use the *schema* parameter to update the data type of the type column with the corresponding array vector data type before import.\n\n**containHeader** (optional) a Boolean value indicating whether the file contains a header row. The default value is null. See [loadText](https://docs.dolphindb.com/en/Functions/l/loadText.html) for the detailed determining rules.\n\n**arrayMarker** is a string containing 2 characters or a CHAR pair. These two characters represent the identifiers for the left and right boundaries of an array vector. The default identifiers are double quotes (\").\n\n* It cannot contain spaces, tabs (`\\t`), or newline characters (`\\t` or `\\n`).\n\n* It cannot contain digits or letters.\n\n* If one is a double quote (`\"`), the other must also be a double quote.\n\n* If the identifier is `'`, `\"`, or `\\`, a backslash ( \\ ) escape character should be used as appropriate. For example, `arrayMarker=\"\\\"\\\"\"`.\n\n* If *delimiter*specifies a single character, *arrayMarker* cannot contain the same character.\n\n* If *delimiter*specifies multiple characters, the left boundary of *arrayMarker* cannot be the same as the first character of *delimiter*.\n\n**chunkSize** is a positive integer with a default value of 128 (in MB). It specifies the maximum size of each chunk during parallel import. The upper limit is `max(maxMemSize / workerNum, 128MB)`, representing the greater of the maximum available memory per worker and 128MB.\n\n#### Details\n\nLoad a text file into DolphinDB database.\n\nIf *dbHandle* is specified and is not empty string \"\": load a text file to a distributed database. The result is a table object with metadata of the table.\n\nIf *dbHandle* is empty string \"\" or unspecified: load a text file as a partitioned in-memory table. For this usage, when we define *dbHandle* with function `database`, the parameter directory must also be the empty string \"\" or unspecified.\n\nIf parameter *transform* is specified, we need to first execute *createPartitionedTable* and then load the data. The system will apply the function specified in parameter *transform* and then save the results into the database.\n\nFunction `loadTextEx` and function [loadText](https://docs.dolphindb.com/en/Functions/l/loadText.html) share many common features, such as whether the first row is treated as the header, how the data types of columns are determined, how the system adjusts illegal column names, etc. For more details, please refer to function [loadText](https://docs.dolphindb.com/en/Functions/l/loadText.html).\n\n#### Examples\n\nUse the following script to generate the text file to be used:\n\n```\nn=10000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nvol=rand(1..10 join int(), n)\nt=table(ID, date, vol)\nsaveText(t, \"C:/DolphinDB/Data/t.txt\");\n```\n\n*Example:* Load *t.txt* into a DFS database with a range domain on ID.\n\n```\ndb = database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 51 101)\npt=loadTextEx(dbHandle=db,tableName=`pt, partitionColumns=`ID, filename=\"/home/DolphinDB/Data/t.txt\");\n```\n\n*Example:* For a TSDB engine:\n\n```\ndb = database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 51 101, engine='TSDB')\npt=loadTextEx(dbHandle=db, tableName=`pt, partitionColumns=`ID, filename=\"/home/DolphinDB/Data/t.txt\", sortColumns=`ID`date);\n```\n\n*Example:* To load table pt from the database:\n\n```\ndb = database(\"dfs://rangedb\")\npt = loadTable(db, `pt);\n```\n\n*Example:* Load *t.txt* into a DFS database with a composite domain.\n\n```\ndbDate = database(directory=\"\", partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)\ndbID=database(directory=\"\", partitionType=RANGE, partitionScheme=0 51 101)\ndb = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID])\npt = loadTextEx(dbHandle=db,tableName=`pt, partitionColumns=`date`ID, filename=\"/home/DolphinDB/Data/t.txt\");\n```\n\n*Example:* Load *t.txt* into a partitioned in-memory table with value domain on date.\n\n```\ndb = database(directory=\"\", partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)\npt = db.loadTextEx(tableName=\"\", partitionColumns=`date, filename=\"/home/DolphinDB/Data/t.txt\");\n\npt.sortBy!(`ID`x);\n```\n\n*Example:* Convert all null values to 0 and then load the data into a dfs database with a composite domain.\n\n```\ndbDate = database(directory=\"\", partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)\ndbID=database(directory=\"\", partitionType=RANGE, partitionScheme=0 51 101)\ndb = database(directory=\"dfs://compoDB\", partitionType=COMPO, partitionScheme=[dbDate, dbID]);\n\npt=db.createPartitionedTable(table=t, tableName=`pt, partitionColumns=`date`ID)\npt=loadTextEx(dbHandle=db, tableName=`pt, partitionColumns=`date`ID, filename=\"/home/DolphinDB/Data/t.txt\", transform=nullFill!{,0});\n```\n\n*Example:* Load array vectors\n\nCreate a csv file:\n\n```\nbid = array(DOUBLE[], 0, 20).append!([1.4799 1.479 1.4787, 1.4796 1.479 1.4784, 1.4791 1.479 1.4784])\nask = array(DOUBLE[], 0, 20).append!([1.4821 1.4825 1.4828, 1.4818 1.482 1.4821, 1.4814 1.4818 1.482])\nTradeDate = 2022.01.01 + 1..3\nSecurityID = rand(`APPL`AMZN`IBM, 3)\nt = table(SecurityID as `sid, TradeDate as `date, bid as `bid, ask as `ask)\nt;\nsaveText(t,filename=\"/home/DolphinDB/Data/t.csv\",delimiter=',',append=true)\n```\n\nLoad the file with `loadTextEx`\n\n```\ndb = database(directory=\"dfs://testDB\", partitionType=VALUE, partitionScheme=`APPL`AMZN`IBM, engine='TSDB')\npath = \"/home/DolphinDB/Data/t.csv\"\nschema = extractTextSchema(path);\nupdate schema set type = \"DOUBLE[]\" where name=\"bid\" or name =\"ask\"\nloadTextEx(dbHandle=db, tableName=`t, partitionColumns=`sid, filename=path, schema=schema, arrayDelimiter=\",\", sortColumns=`sid`date);\nselect * from t;\n```\n\n| sid  | date       | bid                           | ask                           |\n| ---- | ---------- | ----------------------------- | ----------------------------- |\n| AMZN | 2022.01.04 | \\[1.479100,1.479000,1.478400] | \\[1.481400,1.481800,1.482000] |\n| AMZN | 2022.01.03 | \\[1.479600,1.479000,1.478400] | \\[1.481800,1.482000,1.482100] |\n| AMZN | 2022.01.04 | \\[1.479100,1.479000,1.478400] | \\[1.481400,1.481800,1.482000] |\n| APPL | 2022.01.02 | \\[1.479900,1.479000,1.478700] | \\[1.482100,1.482500,1.482800] |\n| APPL | 2022.01.03 | \\[1.479600,1.479000,1.478400] | \\[1.481800,1.482000,1.482100] |\n| APPL | 2022.01.04 | \\[1.479100,1.479000,1.478400] | \\[1.481400,1.481800,1.482000] |\n| IBM  | 2022.01.02 | \\[1.479900,1.479000,1.478700] | \\[1.482100,1.482500,1.482800] |\n| IBM  | 2022.01.03 | \\[1.479600,1.479000,1.478400] | \\[1.481800,1.482000,1.482100] |\n| IBM  | 2022.01.02 | \\[1.479900,1.479000,1.478700] | \\[1.482100,1.482500,1.482800] |\n\n\\*Example:\\*Modify data types to be imported using the *schema* parameter, and use the *transform* parameter to add new columns.\n\nThe import requirements are as follows:\n\n* Add a new column during import to store the symbol.\n* Reorder the columns in the data file to match the target table schema.\n\nThis example demonstrates importing a file for a single symbol.\n\nThe file [sz000001.csv](https://docs.dolphindb.com/en/Functions/resources/sz000001.csv) contains the following columns in order: tradetime, open, close, high, low, vol.\n\nThe target table expects the following column order: symbol (to be added), datetime, vol, open, close, high, low.\n\n```\ndir = \"/home/data/sz000001.csv\"\nsym = dir.split('/').tail(1).split('.')[0]\n\n// Change the type of the tradetime column to DATETIME\nschema = extractTextSchema(dir)\nupdate schema set type=\"DATETIME\" where name=\"tradetime\"\n\nif(existsDatabase(\"dfs://stock_data\")) {\n\tdropDatabase(\"dfs://stock_data\")\n}\n\ndb=database(directory=\"dfs://stock_data\", partitionType=VALUE, partitionScheme=2000.01M..2019.12M)\n\ncolNames=`sym`tradetime`vol`open`close`high`low\ncolTypes=[SYMBOL, DATETIME, INT, DOUBLE, DOUBLE, DOUBLE, DOUBLE]\nt = table(1:0, colNames, colTypes)\npt = db.createPartitionedTable(t, `pt, `tradetime);\ndef mytrans(mutable t, sym, colNames){\n        t.replaceColumn!(`tradetime, datetime(t.tradetime))\n        // Add the first column sym\n        t1 = select sym, * from t\n        // Reorder the columns in the table using reorderColumns!\n        t1.reorderColumns!(colNames)\n        return t1\n}\n\n// Specify the schema and transform parameters to process the data\nloadTextEx(db, `pt, `tradetime, dir, schema=schema, transform=mytrans{,sym, colNames})\n\nselect top 10 * from loadTable(\"dfs://stock_data\", `pt)\n```\n\n| sym      | tradetime           | vol    | open    | close   | high    | low     |\n| -------- | ------------------- | ------ | ------- | ------- | ------- | ------- |\n| sz000001 | 2010.01.01T00:00:00 | 10,732 | 35.9484 | 35.4385 | 36.3261 | 35.9569 |\n| sz000001 | 2010.01.04T00:00:00 | 97,555 | 16.4653 | 13.6348 | 16.7255 | 14.9401 |\n| sz000001 | 2010.01.05T00:00:00 | 43,992 | 51.3616 | 53.1199 | 52.2155 | 50.4782 |\n| sz000001 | 2010.01.06T00:00:00 | 85,283 | 76.3469 | 80.0076 | 76.7017 | 74.9479 |\n| sz000001 | 2010.01.07T00:00:00 | 78,837 | 38.9411 | 35.8283 | 39.5269 | 38.2178 |\n| sz000001 | 2010.01.08T00:00:00 | 13,317 | 70.8803 | 67.9027 | 71.8693 | 70.8072 |\n| sz000001 | 2010.01.11T00:00:00 | 22,958 | 96.3163 | 97.4031 | 96.5605 | 96.364  |\n| sz000001 | 2010.01.12T00:00:00 | 45,621 | 17.2699 | 18.5016 | 17.7689 | 16.5028 |\n| sz000001 | 2010.01.13T00:00:00 | 54,886 | 75.7999 | 77.0245 | 76.4588 | 75.7482 |\n| sz000001 | 2010.01.14T00:00:00 | 3,132  | 49.8656 | 49.3416 | 50.7761 | 49.7972 |\n"
    },
    "loadVocab": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loadVocab.html",
        "signatures": [
            {
                "full": "loadVocab(filePath, vocabName)",
                "name": "loadVocab",
                "parameters": [
                    {
                        "full": "filePath",
                        "name": "filePath"
                    },
                    {
                        "full": "vocabName",
                        "name": "vocabName"
                    }
                ]
            }
        ],
        "markdown": "### [loadVocab](https://docs.dolphindb.com/en/Functions/l/loadVocab.html)\n\nFirst introduced in versions: 3.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\nloadVocab(filePath, vocabName)\n\n#### Parameters\n\n**filePath** A STRING scalar specifying the path to the vocabulary file, which can be a relative or absolute file path.\n\n**vocabName** A STRING scalar that assigns a name to the loaded vocabulary.\n\n#### Details\n\nLoads a vocabulary file into memory for text vectorization.\n\n#### Examples\n\n```\nloadVocab(\"/home/data/vocab.txt\", \"vocab1\")\n```\n\nRelated functions: [unloadVocab](https://docs.dolphindb.com/en/Functions/u/unloadVocab.html), [tokenizeBert](https://docs.dolphindb.com/en/Functions/t/tokenizeBert.html)\n"
    },
    "loc": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loc.html",
        "signatures": [
            {
                "full": "loc(obj, rowFilter, [colFilter], [view=false])",
                "name": "loc",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "rowFilter",
                        "name": "rowFilter"
                    },
                    {
                        "full": "[colFilter]",
                        "name": "colFilter",
                        "optional": true
                    },
                    {
                        "full": "[view=false]",
                        "name": "view",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [loc](https://docs.dolphindb.com/en/Functions/l/loc.html)\n\n\n\n#### Syntax\n\nloc(obj, rowFilter, \\[colFilter], \\[view=false])\n\n#### Parameters\n\n**obj** is a matrix object. It can be a standard matrix, an indexed series or an indexed matrix.\n\n**rowFilter**/**colFilter** can be:\n\n* a Boolean vector - the rows/columns marked as true will be returned. The length of the vector must match the number of rows/columns of *obj*.\n\n* a scalar, a vector or a pair whose data type is compatible with the row/column labels of obj. A pair indicates the selection range (both upper bound and lower bound are inclusive).\n\n**Note:**\n\n* If *rowFilter/colFilter* is a pair, then *obj* must be an indexed series or an indexed matrix.\n\n* Data type compatibility rules:\n\n  * INT, SHORT, LONG and CHAR are compatible\n\n  * FLOAT and DOUBLE are compatible\n\n  * STRING and SYMBOL are compatible\n\n**view** is a Boolean value. The default value is false indicating the result will be a copy of the original matrix (deep copy). If set to true, the result will be a view on the original matrix (shallow copy) and changes made to the original matrix will be reflected in the view.\n\n#### Details\n\nAccess a group of rows and columns of a matrix by label(s) or a boolean vector. Return a copy or a view of the original matrix.\n\n#### Examples\n\n```\nm=rand(12, 3:4)\nm;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 3    | 10   | 6    | 5    |\n| 4    | 11   | 6    | 0    |\n| 7    | 2    | 1    | 8    |\n\n```\na = m.loc(colFilter=[true, true, true, false], view=true)\nb = m.loc(colFilter=[true, true, true, false], view=false)\na;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 3    | 10   | 6    |\n| 4    | 11   | 6    |\n| 7    | 2    | 1    |\n\n```\nb;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 3    | 10   | 6    |\n| 4    | 11   | 6    |\n| 7    | 2    | 1    |\n\n```\n// a view reflects changes made to the original matrix whereas a copy doesn't\nm[0,0] = -1\na;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| -1   | 10   | 6    |\n| 4    | 11   | 6    |\n| 7    | 2    | 1    |\n\n```\nb;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 3    | 10   | 6    |\n| 4    | 11   | 6    |\n| 7    | 2    | 1    |\n\n```\nm = rand(48, 6:8)\nm;\n```\n\n| col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 |\n| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |\n| 27   | 31   | 47   | 21   | 12   | 43   | 22   | 11   |\n| 3    | 20   | 13   | 37   | 3    | 46   | 27   | 27   |\n| 13   | 5    | 14   | 11   | 26   | 42   | 4    | 18   |\n| 45   | 9    | 31   | 33   | 12   | 19   | 42   | 17   |\n| 2    | 19   | 30   | 25   | 36   | 27   | 21   | 6    |\n| 9    | 36   | 15   | 10   | 29   | 37   | 31   | 42   |\n\n```\n// filter with Boolean values\nm.loc(rowFilter=[true, true, false, false, true, false])\n```\n\n| col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 |\n| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |\n| 27   | 31   | 47   | 21   | 12   | 43   | 22   | 11   |\n| 3    | 20   | 13   | 37   | 3    | 46   | 27   | 27   |\n| 2    | 19   | 30   | 25   | 36   | 27   | 21   | 6    |\n\n```\nm.loc(colFilter=[true, true, false, false, true, false, false, true])\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 27   | 31   | 12   | 11   |\n| 3    | 20   | 3    | 27   |\n| 13   | 5    | 26   | 18   |\n| 45   | 9    | 12   | 17   |\n| 2    | 19   | 36   | 6    |\n| 9    | 36   | 29   | 42   |\n\n```\n// filter with labels\nm.rename!(`A`A`B`A`B`B, 2022.01.01 + 0..7)\nm;\n```\n\n| label | 2022.01.01 | 2022.01.02 | 2022.01.03 | 2022.01.04 | 2022.01.05 | 2022.01.06 | 2022.01.07 | 2022.01.08 |\n| ----- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- |\n| A     | 27         | 31         | 47         | 21         | 12         | 43         | 22         | 11         |\n| A     | 3          | 20         | 13         | 37         | 3          | 46         | 27         | 27         |\n| B     | 13         | 5          | 14         | 11         | 26         | 42         | 4          | 18         |\n| A     | 45         | 9          | 31         | 33         | 12         | 19         | 42         | 17         |\n| B     | 2          | 19         | 30         | 25         | 36         | 27         | 21         | 6          |\n| B     | 9          | 36         | 15         | 10         | 29         | 37         | 31         | 42         |\n\n```\nm.loc(rowFilter=`A);\n```\n\n| label | 2022.01.01 | 2022.01.02 | 2022.01.03 | 2022.01.04 | 2022.01.05 | 2022.01.06 | 2022.01.07 | 2022.01.08 |\n| ----- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- |\n| A     | 27         | 31         | 47         | 21         | 12         | 43         | 22         | 11         |\n| A     | 3          | 20         | 13         | 37         | 3          | 46         | 27         | 27         |\n| A     | 45         | 9          | 31         | 33         | 12         | 19         | 42         | 17         |\n\n```\nm.loc(colFilter=2022.01.02);\n```\n\n| label | 2022.01.02 |\n| ----- | ---------- |\n| A     | 31         |\n| A     | 20         |\n| B     | 5          |\n| A     | 9          |\n| B     | 19         |\n| B     | 36         |\n\n```\nm.loc(rowFilter=`B, colFilter=2022.01.03)\n```\n\n| label | 2022.01.03 |\n| ----- | ---------- |\n| B     | 14         |\n| B     | 30         |\n| B     | 15         |\n\nWhen *rowFilter* / *colFilter* is a pair, *obj* must be an indexed matrix, which can be converted using [setIndexedMatrix!](https://docs.dolphindb.com/en/Functions/s/setIndexedMatrix!.html).\n\n```\nm = rand(30, 5:6).rename!(1..5, 2022.01.01 + 0..5)\nm.setIndexedMatrix!()\nm;\n```\n\n| label | 2022.01.01 | 2022.01.02 | 2022.01.03 | 2022.01.04 | 2022.01.05 | 2022.01.06 |\n| ----- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- |\n| 1     | 5          | 27         | 26         | 18         | 29         | 3          |\n| 2     | 11         | 12         | 21         | 15         | 3          | 3          |\n| 3     | 1          | 23         | 29         | 17         | 7          | 18         |\n| 4     | 1          | 6          | 12         | 27         | 23         | 23         |\n| 5     | 15         | 7          | 3          | 19         | 4          | 8          |\n\n```\nm.loc(rowFilter=2:4, colFilter=2022.01.03:2022.01.06)\n```\n\n| label | 2022.01.03 | 2022.01.04 | 2022.01.05 | 2022.01.06 |\n| ----- | ---------- | ---------- | ---------- | ---------- |\n| 2     | 21         | 15         | 3          | 3          |\n| 3     | 29         | 17         | 7          | 18         |\n| 4     | 12         | 27         | 23         | 23         |\n\nRelated function: [at](https://docs.dolphindb.com/en/Functions/a/at.html)\n"
    },
    "localtime": {
        "url": "https://docs.dolphindb.com/en/Functions/l/localtime.html",
        "signatures": [
            {
                "full": "localtime(X)",
                "name": "localtime",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [localtime](https://docs.dolphindb.com/en/Functions/l/localtime.html)\n\n\n\n#### Syntax\n\nlocaltime(X)\n\n#### Parameters\n\n**X** is a variable/vector. The data type of *X* can be datetime, timestamp, or nanotimestamp.\n\n#### Details\n\nConvert *X* in GMT (Greenwich Mean Time) to local time zone.\n\n#### Examples\n\nThe following examples were conducted in US Eastern time zone.\n\n```\nlocaltime(2018.01.22T15:20:26);\n// output: 2018.01.22T10:20:26\n\nlocaltime(2017.12.16T18:30:10.001);\n// output: 2017.12.16T13:30:10.001\n```\n"
    },
    "lockUser": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lockUser.html",
        "signatures": [
            {
                "full": "lockUser(userId)",
                "name": "lockUser",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    }
                ]
            }
        ],
        "markdown": "### [lockUser](https://docs.dolphindb.com/en/Functions/l/lockUser.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nlockUser(userId)\n\n#### Parameters\n\n**userId** is a string indicating a user name.\n\n#### Details\n\nLock the specified user\\*.\\* It can only be executed by administrators when the configuration parameter *enhancedSecurityVerification* is set to true.\n\n#### Examples\n\n```\nlockUser(\"user1\")\n```\n\nRelated function: [unlockUser](https://docs.dolphindb.com/en/Functions/u/unlockUser.html)\n"
    },
    "loess": {
        "url": "https://docs.dolphindb.com/en/Functions/l/loess.html",
        "signatures": [
            {
                "full": "loess(X, Y, resampleRule, [closed='left'], [origin='start_day'], [outputX=false], [bandwidth=0.3], [robustnessIter=4], [accuracy=1e-12])",
                "name": "loess",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "resampleRule",
                        "name": "resampleRule"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    },
                    {
                        "full": "[outputX=false]",
                        "name": "outputX",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[bandwidth=0.3]",
                        "name": "bandwidth",
                        "optional": true,
                        "default": "0.3"
                    },
                    {
                        "full": "[robustnessIter=4]",
                        "name": "robustnessIter",
                        "optional": true,
                        "default": "4"
                    },
                    {
                        "full": "[accuracy=1e-12]",
                        "name": "accuracy",
                        "optional": true,
                        "default": "1e-12"
                    }
                ]
            }
        ],
        "markdown": "### [loess](https://docs.dolphindb.com/en/Functions/l/loess.html)\n\n\n\n#### Syntax\n\nloess(X, Y, resampleRule, \\[closed='left'], \\[origin='start\\_day'], \\[outputX=false], \\[bandwidth=0.3], \\[robustnessIter=4], \\[accuracy=1e-12])\n\n#### Parameters\n\n**X** is a strictly increasing vector of temporal type.\n\n**Y** is a numeric vector of the same length as *X*.\n\n**resampleRule** is a string. See the parameter *rule* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html) for the optional values.\n\n**closed** and **origin** are the same as the parameters *closed* and *origin* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html).\n\n**outputX** is a Boolean value indicating whether to output the resampled X. The default value is false.\n\n**bandwidth** is a numeric scalar in (0,1]. when computing the loess fit at a particular point, this fraction of source points closest to the current point is taken into account for computing a least-squares regression.\n\n**robustnessIter** is a postive interger indicating how many robustness iterations are done.\n\n**accuracy** is a number greater than 1. If the median residual at a certain robustness iteration is less than this amount, no more iterations are done.\n\n#### Details\n\nResample *X* based on the specified *resampleRule*, *closed* and *origin*. Implement Local Regression Algorithm (Loess) for interpolation on *Y* based on the resampled *X*.\n\nIf *outputX* is unspecified, return a vector of *Y* after the interpolation.\n\nIf *outputX*=true, return a tuple where the first element is the vector of resampled *X* and the second element is a vector of *Y* after the interpolation.\n\n#### Examples\n\n**Example 1**\n\n```\nloess([2016.02.14 00:00:00, 2016.02.15 00:00:00, 2016.02.16 00:00:00], [1.0, 2.0, 4.0], resampleRule=`60min, bandwidth=1)\n\n/* output:\n[1,1.0521,1.104,1.1558,1.2072,1.2582,1.3086,1.3584,1.4074,1.4556,\n1.5027,1.5488,1.5937,1.6374,1.6795,1.7202,1.7593,1.7966,1.832,1.8655,\n1.897,1.9263,1.9533,1.9779,2,2.0195,2.0366,2.0513,2.0637,2.0739,\n2.082,2.0882,2.0926,2.0952,2.0962,2.0957,2.0938,2.0905,2.0861,2.0806,\n2.0741,2.0667,2.0586,2.0498,2.0405,2.0308,2.0207,2.0104,2]\n*/\n```\n\n**Example 2** Different values of *closed* affect the result.\n\n```\nX = 2022.01.01T00:00:00 + [0, 3, 6, 9] * 60\nY = [1.0, 3.0, 7.0, 13.0]\n\n// closed='left' (default): 00:03 belongs to the start of [00:03, 00:06)\nloess(X, Y, `3min, closed=`left, outputX=true, bandwidth=1)\n\n// closed='right': 00:03 belongs to the end of (00:00, 00:03]\n// The fitted point positions differ, so the output also changes\nloess(X, Y, `3min, closed=`right, outputX=true, bandwidth=1)\n```\n\n**Example 3** Different values of *origin* affect the result.\n\n```\nX = 2022.01.01T00:00:30 + (0..4) * 60\nY = [2.0, 4.0, 7.0, 11.0, 16.0]\n\n// origin='start_day' (default): align to 00:00:00 of the same day\nloess(X, Y, `1min, origin=`start_day, outputX=true, bandwidth=1)\n\n// origin='start': align to the first data point 00:00:30\nloess(X, Y, `1min, origin=`start, outputX=true, bandwidth=1)\n\n// origin=custom timestamp: align to 00:00:10\nloess(X, Y, `1min, origin=2022.01.01T00:00:10, outputX=true, bandwidth=1)\n```\n\n**Example 4** Different values of *outputX* affect the result.\n\n```\nX = [2016.02.14T00:00:00, 2016.02.15T00:00:00, 2016.02.16T00:00:00]\nY = [1.0, 2.0, 4.0]\n\n// outputX=false (default): return only the LOESS-interpolated Y vector\nloess(X, Y, `60min, bandwidth=1)\n\n// outputX=true: return a tuple; [0] is the resampled timestamp vector, [1] is the interpolated Y\nresult = loess(X, Y, `60min, outputX=true, bandwidth=1)\nresult[0]\nresult[1]\n```\n"
    },
    "log": {
        "url": "https://docs.dolphindb.com/en/Functions/l/log.html",
        "signatures": [
            {
                "full": "log(X)",
                "name": "log",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [log](https://docs.dolphindb.com/en/Functions/l/log.html)\n\n\n\n#### Syntax\n\nlog(X)\n\n#### Parameters\n\n**X** is a scalar/vector/pair/matrix/table.\n\n**Y** (optional) is a positive number indicating the base.\n\n#### Details\n\n* If *Y* is not specified: return the natural logarithm of *X*.\n* If *Y* is specified: return the logarithm of X to base Y.\n\nDifferences from Python’s `numpy.log` and `scipy.stats.log`: `numpy.log` calculates the natural logarithm. `scipy.stats.log` is a continuous distribution object obtained by applying a logarithmic transformation to a random variable. DolphinDB’s `log` is a numeric logarithm function. `log` calculates the natural logarithm when *Y* is not specified and directly calculates the logarithm with base *Y* when *Y* is specified.\n\n#### Examples\n\n```\nlog(2.718283);\n// output: 1\nlog(0 1 2 3);\n// output: [,0,0.693147,1.098612]\nlog(100, 10)\n// output: 2\n```\n"
    },
    "log10": {
        "url": "https://docs.dolphindb.com/en/Functions/l/log10.html",
        "signatures": [
            {
                "full": "log10(X)",
                "name": "log10",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [log10](https://docs.dolphindb.com/en/Functions/l/log10.html)\n\n\n\n#### Syntax\n\nlog10(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nReturn the logarithm of *X* to the base 10.\n\nDifference from Python’s `numpy.log10`: Both functions calculate the base-10 logarithm. DolphinDB supports scalars, pairs, vectors, matrices, and tables. `numpy.log10` is a ufunc and supports broadcasting, complex numbers, *out*, *where*, and other ufunc arguments.\n\nDifferences from TA-Lib `LOG10`: DolphinDB `log10` supports scalars, vectors, pairs, matrices, and tables, whereas TA-Lib `LOG10` only supports one-dimensional arrays.\n\n#### Examples\n\n```\nlog10(100);\n// output: 2\n\nlog10(0 10 100 1000 NULL);\n// output: [,1,2,3,]\n\nlog10(10 100 1000 10000$2:2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 2  | 4  |\n"
    },
    "log1p": {
        "url": "https://docs.dolphindb.com/en/Functions/l/log1p.html",
        "signatures": [
            {
                "full": "log1p(X)",
                "name": "log1p",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [log1p](https://docs.dolphindb.com/en/Functions/l/log1p.html)\n\n\n\n#### Syntax\n\nlog1p(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nReturns log(1+X).\n\n**Note:**\n\nDolphinDB `log1p` and [numpy.log1p](https://numpy.org/doc/stable/reference/generated/numpy.log1p.html) provide the same core functionality. The difference is that DolphinDB `log1p` accepts only one parameter, *X*, whereas `numpy.log1p` supports additional parameters such as *out* and *where*.\n\n#### Examples\n\n```\nlog1p(0);\n// output: 0\n\nlog1p([0, e-1, pow(e,2)-1, pow(e,3)-1, NULL]);\n// output: [0,1,2,3,]\n\nlog1p([0, e-1, pow(e,2)-1, pow(e,3)-1]$2:2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 0  | 2  |\n| 1  | 3  |\n"
    },
    "log2": {
        "url": "https://docs.dolphindb.com/en/Functions/l/log2.html",
        "signatures": [
            {
                "full": "log2(X)",
                "name": "log2",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [log2](https://docs.dolphindb.com/en/Functions/l/log2.html)\n\n\n\n#### Syntax\n\nlog2(X)\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Details\n\nReturns the logarithm of *X* to the base 2.\n\n**Note:**\n\nDolphinDB `log2` and [numpy.log2](https://numpy.org/doc/stable/reference/generated/numpy.log2.html) provide the same core functionality. The difference is that DolphinDB `log2` accepts only one parameter, *X*, whereas `numpy.log2` supports additional parameters such as *out* and *where*.\n\n#### Examples\n\n```\nlog2(4);\n// output: 2\n\nlog2(0 2 4 8 NULL);\n// output: [,1,2,3,]\n\nlog2(1..4$2:2);\n```\n\n| #0 | #1       |\n| -- | -------- |\n| 0  | 1.584963 |\n| 1  | 2        |\n"
    },
    "login": {
        "url": "https://docs.dolphindb.com/en/Functions/l/login.html",
        "signatures": [
            {
                "full": "login(userId, password)",
                "name": "login",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    },
                    {
                        "full": "password",
                        "name": "password"
                    }
                ]
            }
        ],
        "markdown": "### [login](https://docs.dolphindb.com/en/Functions/l/login.html)\n\n\n\n#### Syntax\n\nlogin(userId, password)\n\n#### Parameters\n\n**userId** a string indicating a user name. It can only contain letters, underscores, or numbers. It cannot start with numbers. The length cannot exceed 30 characters.\n\n**password** a string indicating the password. It cannot contain space or control characters. The length must be between 6 and 20 characters.\n\n#### Details\n\nA user logs in to operate on the controller or data nodes.\n\nSince DolphinDB 2.00.10.10, users can determine whether to limit the number of failed login attempts by setting the configuration *enhancedSecurityVerification*. If it is not specified, no limit will be applied; if it is set to true, a user's account will be blocked for 10 minutes if the password is entered wrongly 5 times in a minute.\n\n#### Examples\n\n```\nlogin(`JohnSmith, `Qb0507);\n```\n"
    },
    "logisticRegression": {
        "url": "https://docs.dolphindb.com/en/Functions/l/logisticRegression.html",
        "signatures": [
            {
                "full": "logisticRegression(ds, yColName, xColNames, [intercept=true], [initTheta], [tolerance=1e-3], [maxIter=500], [regularizationCoeff=1.0], [numClasses=2])",
                "name": "logisticRegression",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[initTheta]",
                        "name": "initTheta",
                        "optional": true
                    },
                    {
                        "full": "[tolerance=1e-3]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "1e-3"
                    },
                    {
                        "full": "[maxIter=500]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "500"
                    },
                    {
                        "full": "[regularizationCoeff=1.0]",
                        "name": "regularizationCoeff",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[numClasses=2]",
                        "name": "numClasses",
                        "optional": true,
                        "default": "2"
                    }
                ]
            }
        ],
        "markdown": "### [logisticRegression](https://docs.dolphindb.com/en/Functions/l/logisticRegression.html)\n\n\n\n#### Syntax\n\nlogisticRegression(ds, yColName, xColNames, \\[intercept=true], \\[initTheta], \\[tolerance=1e-3], \\[maxIter=500], \\[regularizationCoeff=1.0], \\[numClasses=2])\n\n#### Details\n\nAnalyzes the relationship between multiple predictor variables (*xColNames*) and a target outcome variable (*yColName*) using logistic regression. The resulting model is compatible with the `predict` function, allowing you to easily classify new observations based on the learned patterns from your training data.\n\n#### Parameters\n\n**ds** is the data source to be trained. It can be generated with function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**yColName** is a string specifying the column name in *ds* that represents dependent variables (category).\n\n**xColNames** is a string scalar/vector specifying the column name(s) in *ds*that represents independent variables.\n\n**intercept** (optional) is a boolean scalar specifying whether the regression uses an intercept. The default value is true, which means that a column of 1s is added to the independent variables.\n\n**initTheta** (optional) is a vector indicating the initial values of the parameters when the iterations begin. The default value is a vector of zeroes with the length of *xColNames.size()+intercept*.\n\n**tolerance** (optional) is a numeric scalar. If the difference in the value of the log likelihood functions of 2 adjacent iterations is smaller than *tolerance*, the iterations would stop. The default value is 0.001.\n\n**maxIter** (optional) is a positive integer indicating the maximum number of iterations. The iterations will stop if the number of iterations reaches *maxIter*. The default value is 500.\n\n**regularizationCoeff** (optional) is a positive number indicating the coefficient of the regularization term. The default value is 1.0.\n\n**numClasses** (optional) is an integer no less than 2, indicating the number of categories for the dependent variable. The default value is 2.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* modelName: A string indicating the name of the model, i.e., \"Logistic Regression\".\n\n* tolerance: A floating-point number indicating the threshold for stopping the iteration.\n\n* xColNames: A string scalar or vector indicating the independent variables.\n\n* intercept: A boolean value indicating whether the regression includes an intercept term.\n\n* numClasses: A positive integer indicating the number of categories for the dependent variable.\n\n* coefficients: The estimated model parameters for each category of the dependent variable:\n\n  * For binary problems (*numClasses* = 2), returns a vector indicating the coefficients for the positive class.\n\n  * For multi-class problems (*numClasses* > 2), returns a matrix where the i-th row indicates the coefficients for the i-th class.\n\n* iterations: The number of iterations for each category of the dependent variable:\n\n  * For binary problems (*numClasses* = 2), returns an integer indicating the number of iterations for the positive class.\n\n  * For multi-class problems (*numClasses* > 2), returns a vector where the i-th element indicates the number of iterations for the i-th class.\n\n* logLikelihood: The final log-likelihood value for each category of the dependent variable after iteration:\n\n  * For binary problems (*numClasses* = 2), returns a floating-point value indicating the log-likelihood for the positive class.\n\n  * For multi-class problems (*numClasses* > 2), returns a vector where the i-th element indicates the log-likelihood for the i-th class.\n\n* predict: A callable function for making predictions on new data.\n\n#### Examples\n\nFit a logistic regression model with simulated data:\n\n```\nt = table(100:0, `y`x0`x1, [INT,DOUBLE,DOUBLE])\ny = take(0, 50)\nx0 = norm(-1.0, 1.0, 50)\nx1 = norm(-1.0, 1.0, 50)\ninsert into t values (y, x0, x1)\ny = take(1, 50)\nx0 = norm(1.0, 1.0, 50)\nx1 = norm(1.0, 1.0, 50)\ninsert into t values (y, x0, x1)\n\nmodel = logisticRegression(sqlDS(<select * from t>), yColName=`y, xColNames=`x0`x1);\n\n/* output:\nmodelName->Logistic Regression\ntolerance->0.001\nxColNames->[\"x0\",\"x1\"]\nintercept->1\nnumClasses->2\ncoefficients->[1.279258204733693,1.58441731843656,-0.107855546076936]\niterations->[5]\nlogLikelihood->[20.774272153640865]\npredict->logisticRegressionPredict\n*/\n```\n\nUse the fitted model in forecasting:\n\n```\npredict(model, t);\n```\n\nSave the fitted model to disk:\n\n```\nsaveModel(model, \"C:/DolphinDB/data/logisticModel.txt\");\n```\n\nLoad a saved model:\n\n```\nloadModel(\"C:/DolphinDB/data/logisticModel.txt\");\n```\n"
    },
    "logout": {
        "url": "https://docs.dolphindb.com/en/Functions/l/logout.html",
        "signatures": [
            {
                "full": "logout([userId], [sessionOnly=true])",
                "name": "logout",
                "parameters": [
                    {
                        "full": "[userId]",
                        "name": "userId",
                        "optional": true
                    },
                    {
                        "full": "[sessionOnly=true]",
                        "name": "sessionOnly",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [logout](https://docs.dolphindb.com/en/Functions/l/logout.html)\n\n\n\n#### Syntax\n\nlogout(\\[userId], \\[sessionOnly=true])\n\n#### Parameters\n\n**userId** is a string indicating a user name. It can only contain letters, underscores, or numbers. It cannot start with numbers. Its length cannot exceed 30 characters.\n\n**sessionOnly** is a Boolean value.\n\n#### Details\n\nThis function can be executed on a controller/data/compute node.\n\nIf *userId* is unspecified, the current user logs out.\n\nIf *sessionOnly* is true, the user logs out from the current session.\n\nIf *sessionOnly* is false, the user logs out completely from the current session, all data/compute nodes, and the controller node.\n\nAn administrator can log out another user. If an administrator logs out another user, the user is logged out from the current session, all data nodes, and the controller node.\n\n#### Examples\n\n```\nlogout();\n\nlogout(`TomFord);\n\nlogout(, false);\n```\n"
    },
    "long": {
        "url": "https://docs.dolphindb.com/en/Functions/l/long.html",
        "signatures": [
            {
                "full": "long(X)",
                "name": "long",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [long](https://docs.dolphindb.com/en/Functions/l/long.html)\n\n\n\n#### Syntax\n\nlong(X)\n\n#### Parameters\n\n**X** can be of any data type.\n\n#### Details\n\nConvert the data type of *X* to LONG.\n\n#### Examples\n\n```\nx=long();\nx;\n// output: 00l\n\ntypestr x;\n// output: LONG\n\nlong(`10.9);\n// output: 10\n\nlong(9223372036854775807l);\n// output: 9223372036854775807\n\nlong(9223372036854775808l);\n// output: 9223372036854775807\n// maximum value for a LONG is 2^63-1=9223372036854775807\n```\n"
    },
    "lowDouble": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lowDouble.html",
        "signatures": [
            {
                "full": "lowDouble(X)",
                "name": "lowDouble",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [lowDouble](https://docs.dolphindb.com/en/Functions/l/lowDouble.html)\n\n\n\n#### Syntax\n\nlowDouble(X)\n\n#### Parameters\n\n**X** is a vector/scalar which must be 16-byte data type.\n\n#### Details\n\nIt returns the low-order 8-byte double data of *X*.\n\n#### Example\n\n```\nx=1 2 3 4\ny=4 3 2 1\npoints = point(x, y)\nx1 = lowDouble(points)\n// output: [1,2,3,4]\n```\n\nGet the real part of the complex number:\n\n```\na=complex(2, 5)\nlowDouble(a)\n// output: 2\n```\n"
    },
    "lower": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lower.html",
        "signatures": [
            {
                "full": "lower(X)",
                "name": "lower",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [lower](https://docs.dolphindb.com/en/Functions/l/lower.html)\n\n\n\n#### Syntax\n\nlower(X)\n\n#### Parameters\n\n**X** is a CHAR/STRING/SYMBOL scalar, vector, or table.\n\n#### Details\n\nConvert all characters in a string or a list of strings into lower cases.\n\nIf *X* is a table, the function is applied only to columns of character types (CHAR, STRING, or SYMBOL). Other column types are ignored.\n\n#### Examples\n\n```\nx= `Ibm`C`AapL;\nx.lower();\n// output: [\"ibm\",\"c\",\"aapl\"]\n\nlower(`Chloe);\n// output: chloe\n```\n\nRelated function: [upper](https://docs.dolphindb.com/en/Functions/u/upper.html)\n"
    },
    "lowerBound": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lowerBound.html",
        "signatures": [
            {
                "full": "lowerBound(X,Y)",
                "name": "lowerBound",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [lowerBound](https://docs.dolphindb.com/en/Functions/l/lowerBound.html)\n\n#### Syntax\n\nlowerBound(X,Y)\n\n#### Parameters\n\n**X** is an increasing vector, or an indexed series/matrix.\n\n**Y** is a scalar, vector, array vector, tuple, matrix, dictionary or table.\n\n#### Details\n\nFor each element y in *Y*, get the first element that is greater than or equal to y and return its index in *X*. If no element is found, return the length of *X*.\n\n#### Examples\n\n```\nX = [1,3,5];\nY = [5,6,7];\nZ = lowerBound(X,Y);\nZ\n// output: [2,3,3]\n\nindex = [2023.05.04, 2023.05.06, 2023.05.07, 2023.05.10]\ns = indexedSeries(index, 1..4)\ny=[2023.05.04, 2023.05.06, 2023.05.09]\n\nlowerBound(s,y)\n```\n\n| label      | #0 |\n| ---------- | -- |\n| 2023.05.04 | 1  |\n| 2023.05.06 | 2  |\n| 2023.05.09 | 4  |\n\n"
    },
    "lowLong": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lowlong.html",
        "signatures": [
            {
                "full": "lowLong(X)",
                "name": "lowLong",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [lowLong](https://docs.dolphindb.com/en/Functions/l/lowlong.html)\n\n\n\n#### Syntax\n\nlowLong(X)\n\n#### Parameters\n\n**X** is a scalar/vector/table/data pair/dictionary which must be 16-byte data type (UUID, IPADDR, INT128, COMPLEX, and POINT are supported).\n\n#### Details\n\nIt returns the low-order 8-byte long integer data of *X*.\n\n#### Examples\n\n```\nx =ipaddr(\"192.168.1.13\")\nx1 = lowLong(x)\nprint(x1)\n//output\n3232235789\n```\n\n```\nx=1 2 3 4\ny=4 3 2 1\npoints = point(x, y)\nx1 = lowLong(points)\n//output\n[4607182418800017408,4611686018427387904,4613937818241073152,4616189618054758400]\n```\n\nRelated function: [highLong](https://docs.dolphindb.com/en/Functions/h/highlong.html)\n"
    },
    "lowRange": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lowRange.html",
        "signatures": [
            {
                "full": "lowRange(X)",
                "name": "lowRange",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [lowRange](https://docs.dolphindb.com/en/Functions/l/lowRange.html)\n\n\n\n#### Syntax\n\nlowRange(X)\n\n#### Parameters\n\n**X** is a vector/tuple/matrix/table.\n\n#### Details\n\nFor each element *Xi* in *X*, count the continuous nearest neighbors to its left that are larger than *Xi*.\n\nFor each element in *X*, the function return the maximum length of a window to the left of *X* where it is the max/min. For example, after how many days a stock hits a new high.\n\n#### Examples\n\n```\nlowRange([13.5, 13.6, 13.4, 13.3, 13.5, 13.9, 13.1, 20.1, 20.2, 20.3])\n// output: [0,0,2,3,0,0,6,0,0,0]\n\nm = matrix(1.5 2.6 3.2 1.4 2.5 2.2 3.7 2.0, 1.6 2.3 4.2 5.6 4.1 3.2 4.4 6.9)\nlowRange(m)\n```\n\n| #0 | #1 |\n| -- | -- |\n| 0  | 0  |\n| 0  | 0  |\n| 0  | 0  |\n| 3  | 0  |\n| 0  | 2  |\n| 1  | 3  |\n| 0  | 0  |\n| 3  | 0  |\n\n```\n//Simulate the stock price of stock A for 8 days. Use lowRange to calculate after how many days the stock hit a new low\ntrades = table(take(`A, 8) as sym,  2022.01.01 + 1..8 as date, 39.70 39.72 39.80 39.78 39.83 39.92 40.00 40.03 as price)\nselect *, lowRange(price) from trades\n```\n\n| id | date       | price | lowRange\\_price |\n| -- | ---------- | ----- | --------------- |\n| A  | 2022.01.02 | 39.7  | 0               |\n| A  | 2022.01.03 | 39.72 | 0               |\n| A  | 2022.01.04 | 39.8  | 0               |\n| A  | 2022.01.05 | 39.78 | 1               |\n| A  | 2022.01.06 | 39.83 | 0               |\n| A  | 2022.01.07 | 39.92 | 0               |\n| A  | 2022.01.08 | 40    | 0               |\n| A  | 2022.01.09 | 40.03 | 0               |\n\nRelated function: [topRange](https://docs.dolphindb.com/en/Functions/t/topRange.html)\n"
    },
    "lpad": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lpad.html",
        "signatures": [
            {
                "full": "lpad(str, length, [pattern])",
                "name": "lpad",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "length",
                        "name": "length"
                    },
                    {
                        "full": "[pattern]",
                        "name": "pattern",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [lpad](https://docs.dolphindb.com/en/Functions/l/lpad.html)\n\n\n\n#### Syntax\n\nlpad(str, length, \\[pattern])\n\n#### Parameters\n\n**str** is a STRING scalar/vector, or table. It is the string to pad characters to (the left-hand side).\n\n**length** is a positive integer indicating the number of characters to return. If *length* is smaller than the length of *str*, the *lpad* function is equivalent to `left(str, length)`. If *length* exceeds **65,536**, the system automatically caps it at **65,536**.\n\n**pattern** is a string scalar. It is the string that will be padded to the left-hand side of *str*. If it is unspecified, the *lpad* function will pad spaces to the left-side of *str*.\n\n#### Details\n\nPad the left-side of a string with a specific set of characters.\n\nIf *str* is a table, the function is applied only to columns of STRING type. Other column types are ignored.\n\n#### Examples\n\n```\nlpad(\"Hello\",2);\n// output: He\n\nlpad(`Hello, 10);\n/* output:\n     Hello\n*/\n\nlpad(`Hello, 12, `0);\n// output: 0000000Hello\n```\n"
    },
    "lshift": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lshift.html",
        "signatures": [
            {
                "full": "lshift(X,bits)",
                "name": "lshift",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "bits",
                        "name": "bits"
                    }
                ]
            }
        ],
        "markdown": "### [lshift](https://docs.dolphindb.com/en/Functions/l/lshift.html)\n\n\n\n#### Syntax\n\nlshift(X,bits) or X<\\<bits\n\n#### Parameters\n\n**X** is an integral scalar/pair/vector/matrix/table.\n\n**bits** is the number of bits to shift.\n\n#### Details\n\nShift the binary representation of *X* to the left by *bits*. The bits on the right are filled with zeros.\n\n#### Examples\n\n```\nlshift(2, 10);\n// output: 2048\n\n1..10 << 1;\n// output: [2,4,6,8,10,12,14,16,18,20]\n\n1..10 << 10;\n// output: [1024,2048,3072,4096,5120,6144,7168,8192,9216,10240]\n\n1:10<<10;\n// output: 1024 : 10240\n```\n\nRelated function: [rshift](https://docs.dolphindb.com/en/Functions/r/rshift.html).\n"
    },
    "lt": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lt.html",
        "signatures": [
            {
                "full": "lt(X, Y)",
                "name": "lt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [lt](https://docs.dolphindb.com/en/Functions/l/lt.html)\n\n\n\n#### Syntax\n\nlt(X, Y) or X\\<Y\n\n#### Parameters\n\n**X** / **Y** is a scalar/pair/vector/matrix/set. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Details\n\nIf neither *X* nor *Y* is a set, return the element-by-element comparison of *X*<*Y*.\n\nIf both *X* and *Y* are sets, check if *X* is a proper subset of *Y*.\n\n#### Examples\n\n```\n1 2 3 < 2;\n// output: [1,0,0]\n\n1 2 3<0 2 4;\n// output: [0,0,1]\n\n2:3<1:6;\n// output: 0 : 1\n\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1 lt 4;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 0  |\n| 1  | 0  | 0  |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1<m2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 0  |\n| 1  | 0  | 0  |\n\nSet operation: If *X*<*Y* then *X* is a proper subset of *Y*\n\n```\nx=set(4 6);\nx;\n// output: set(6,4)\n\ny=set(8 9 4 6);\ny;\n// output: set(6,4,9,8)\n\nx<y;\n// output: 1\n\ny<x;\n// output: 0\n\nx<x;\n// output: 0\n// x is not a proper subset of x\n```\n"
    },
    "ltrim": {
        "url": "https://docs.dolphindb.com/en/Functions/l/ltrim.html",
        "signatures": [
            {
                "full": "ltrim(X)",
                "name": "ltrim",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [ltrim](https://docs.dolphindb.com/en/Functions/l/ltrim.html)\n\n\n\n#### Syntax\n\nltrim(X)\n\n#### Parameters\n\n**X** is a STRING scalar/vector, or table.\n\n#### Details\n\nRemove leading spaces from a character expression.\n\nIf *X* is a table, the function is applied only to columns of STRING type. Other column types are ignored.\n\n#### Examples\n\n```\nltrim(\"    I love this game!\");\n// output: I love this game!\n```\n"
    },
    "lu": {
        "url": "https://docs.dolphindb.com/en/Functions/l/lu.html",
        "signatures": [
            {
                "full": "lu(obj, [permute=false])",
                "name": "lu",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[permute=false]",
                        "name": "permute",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [lu](https://docs.dolphindb.com/en/Functions/l/lu.html)\n\n\n\n#### Syntax\n\nlu(obj, \\[permute=false])\n\n#### Parameters\n\n**obj** is a matrix with no null values.\n\n**permute** is a Boolean value. The default value is false.\n\n#### Details\n\nCalculates pivoted LU decomposition of a matrix.\n\nIf *permute* is false, return 3 matrices (L, U and P) with *obj* = P'*L*U. P is a permutation matrix, L is a lower triangular matrix with unit diagonal elements, and U is an upper triangular matrix.\n\nIf *permute* is true, return 2 matrices (L and U) with *obj* = L\\*U.\n\n**Note:**\n\nDolphinDB `lu` and [scipy.linalg.lu](https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.lu.html) provide the same core functionality. The difference is that `scipy.linalg.lu` supports additional parameters such as *overwrite\\_a*, *check\\_finite*, and *p\\_indices*.\n\n#### Examples\n\n```\nA = matrix([[2, 5, 8, 7], [5, 2, 2, 8], [7, 5, 6, 6], [5, 4, 4, 8]]);\n\nP, L, U = lu(A);\nP;\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n| 0  | 0  | 1  | 0  |\n| 0  | 0  | 0  | 1  |\n| 1  | 0  | 0  | 0  |\n| 0  | 1  | 0  | 0  |\n\n```\nL;\n```\n\n| #0    | #1   | #2       | #3 |\n| ----- | ---- | -------- | -- |\n| 1     | 0    | 0        | 0  |\n| 0.875 | 1    | 0        | 0  |\n| 0.25  | 0.72 | 1        | 0  |\n| 0.625 | 0.12 | 0.233871 | 1  |\n\n```\nU;\n```\n\n| #0 | #1   | #2   | #3       |\n| -- | ---- | ---- | -------- |\n| 8  | 2    | 6    | 4        |\n| 0  | 6.25 | 0.75 | 4.5      |\n| 0  | 0    | 4.96 | 0.76     |\n| 0  | 0    | 0    | 0.782258 |\n\n```\nL, U = lu(A, true);\nL;\n```\n\n| #0    | #1   | #2       | #3 |\n| ----- | ---- | -------- | -- |\n| 0.25  | 0.72 | 1        | 0  |\n| 0.625 | 0.12 | 0.233871 | 1  |\n| 1     | 0    | 0        | 0  |\n| 0.875 | 1    | 0        | 0  |\n\n```\nU;\n```\n\n| #0 | #1   | #2   | #3       |\n| -- | ---- | ---- | -------- |\n| 8  | 2    | 6    | 4        |\n| 0  | 6.25 | 0.75 | 4.5      |\n| 0  | 0    | 4.96 | 0.76     |\n| 0  | 0    | 0    | 0.782258 |\n"
    },
    "oauthLogin": {
        "url": "https://docs.dolphindb.com/en/Functions/o/oauthLogin.html",
        "signatures": [
            {
                "full": "oauthLogin(oauthType, params)",
                "name": "oauthLogin",
                "parameters": [
                    {
                        "full": "oauthType",
                        "name": "oauthType"
                    },
                    {
                        "full": "params",
                        "name": "params"
                    }
                ]
            }
        ],
        "markdown": "### [oauthLogin](https://docs.dolphindb.com/en/Functions/o/oauthLogin.html)\n\n\n\n#### Syntax\n\noauthLogin(oauthType, params)\n\n#### Details\n\nThe `oauthLogin` function sends a login request to the specified authorization server based on the input grant type and parameters. DolphinDB currently supports three grant types of OAuth SSO: authentication code grant (for Web interface), implicit grant (for Web interface), and client credentials grant (for APIs).\n\n#### Parameters\n\n**oauthType** is a string specifying the grant type of OAuth SSO. It can be:\n\n* 'authentication code'\n\n* 'implicit'\n\n* 'client credentials'\n\n**params** is a dictionary specifying the parameters for authorization.\n\n* If *oauthType* is set to 'authentication code', *params* should be { code:string }, e.g., `{\"code\":\"9d823075cb151201925a\"}`.\n\n* If *oauthType* is set to 'implicit', *params* should be { token\\_type:string, access\\_token:string, expires\\_in?:string }, e.g., `{token_type: \"Bearer\", access_token: \"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3\", expires_in?: \"3600\"}`.\n\n* If *oauthType* is set to 'client credentials',*params* should be { … }, e.g., `{&client_id=xxxxxxxxxx&client_secret=xxxxxxxxxx}`.\n\n#### Returns\n\nToken and user information in strings.\n\n#### Examples\n\nThe following example specifies the grant type as 'authentication code' and sets *params* accordingly:\n\n```\noauthLogin(\"authorization code\",{\"code\":\"9d823075cb151201925a\"})\n```\n\n**Related information**: [Single Sign-On](https://docs.dolphindb.com/en/Database/Configuration/reference.md#).\n"
    },
    "objByName": {
        "url": "https://docs.dolphindb.com/en/Functions/o/objByName.html",
        "signatures": [
            {
                "full": "objByName(name, [sharedVar])",
                "name": "objByName",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[sharedVar]",
                        "name": "sharedVar",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [objByName](https://docs.dolphindb.com/en/Functions/o/objByName.html)\n\n\n\n#### Syntax\n\nobjByName(name, \\[sharedVar])\n\n#### Details\n\nDolphinDB parses script before execution. The parsing procedure checks if a variable has been defined locally. If not, it will throw an exception. Assume we execute a locally defined function at remote nodes and the function queries a shared table that exists at remote nodes but not at the local node. If we directly call the table name in SQL statements, the system will fail to parse.\n\nTo address this issue, we introduce function `objByName` which returns an object by name at runtime.\n\nIf *sharedVar* is not specified, the system searches in local variables before searching in shared variables. If *sharedVar* = true, the system only searches in shared variables; if *sharedVar* = false, the system only searches in local variables.\n\n#### Parameters\n\n**name** is a string indicating a table name.\n\n**sharedVar** is a Boolean value.\n\n#### Returns\n\nAn object with the same type and form as *name*.\n\n#### Examples\n\nAt the local node we have a table EarningsDates with 2 columns: *TICKER* and *date*. *date* is the earning announcement date. There is a table USPrices at a remote node with machine name \"localhost\" and port number 8081. It contains daily stock prices for all US stocks. We would like to get the stock prices from the remote node for all stocks in EarningsDates for the week after they announced earnings.\n\nAt the remote node, we import the data file to create the table USPrices, and then share it across all nodes as sharedUSPrices.\n\n```\nUSPrices = loadText(\"c:/DolphinDB/Data/USPrices.csv\")\nshare USPrices as sharedUSPrices;\n```\n\nAt the local node, we create the table EarningsDates, and send the table with the script over to the remote node. After the execution, the result is sent back to the local node.\n\n```\nEarningsDates=table(`XOM`AAPL`IBM as TICKER, 2006.10.26 2006.10.19 2006.10.17 as date)\ndef loadDailyPrice(data){\n   dateDict = dict(data.TICKER, data.date)\n   return select date, TICKER, PRC from objByName(\"sharedUSPrices\") where dateDict[TICKER]<date<=dateDict[TICKER]+7\n}\nconn = xdb(\"localhost\",8081)\nprices = conn(loadDailyPrice, EarningsDates);\n\nprices;\n```\n\n| date       | TICKER | PRC   |\n| ---------- | ------ | ----- |\n| 2006.10.27 | XOM    | 71.46 |\n| 2006.10.30 | XOM    | 70.84 |\n| 2006.10.31 | XOM    | 71.42 |\n| 2006.11.01 | XOM    | 71.06 |\n| 2006.11.02 | XOM    | 71.19 |\n| 2006.10.18 | IBM    | 89.82 |\n| 2006.10.19 | IBM    | 89.86 |\n| 2006.10.20 | IBM    | 90.48 |\n| 2006.10.23 | IBM    | 91.56 |\n| 2006.10.24 | IBM    | 91.49 |\n| 2006.10.20 | AAPL   | 79.95 |\n| 2006.10.23 | AAPL   | 81.46 |\n| 2006.10.24 | AAPL   | 81.05 |\n| 2006.10.25 | AAPL   | 81.68 |\n| 2006.10.26 | AAPL   | 82.19 |\n"
    },
    "objectChecksum": {
        "url": "https://docs.dolphindb.com/en/Functions/o/objectChecksum.html",
        "signatures": [
            {
                "full": "objectChecksum(vector, [prev])",
                "name": "objectChecksum",
                "parameters": [
                    {
                        "full": "vector",
                        "name": "vector"
                    },
                    {
                        "full": "[prev]",
                        "name": "prev",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [objectChecksum](https://docs.dolphindb.com/en/Functions/o/objectChecksum.html)\n\n\n\n#### Syntax\n\nobjectChecksum(vector, \\[prev])\n\n#### Details\n\nCalculate the checksum of a vector. The result is an integer. It is often used to verify data integrity.\n\n#### Parameters\n\n**vector** is a vector that is used for calculating checksums.\n\n**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.\n\n#### Returns\n\nAn integer scalar.\n\n#### Examples\n\n```\nprint objectChecksum(take(`A`B`C, 10))\n// output: -268298654\n\nprint objectChecksum(2.3 6.5 7.8)\n// output: -430996932\n\n//calculate checksum section by section\nprint objectChecksum(1..15)\n// output: -1877567753\n\nt0 = objectChecksum(1..5)\nt1 = objectChecksum(6..10, t0)\nt2 = objectChecksum(11..15, t1)\nprint t2\n// output: -1877567753\n```\n"
    },
    "objectComponent": {
        "url": "https://docs.dolphindb.com/en/Functions/o/objectComponent.html",
        "signatures": [
            {
                "full": "objectComponent(obj)",
                "name": "objectComponent",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [objectComponent](https://docs.dolphindb.com/en/Functions/o/objectComponent.html)\n\n\n\n#### Syntax\n\nobjectComponent(obj)\n\n#### Details\n\nGets the components of the object.\n\n#### Parameters\n\n**obj** can be of any data type.\n\n#### Returns\n\nReturn value: A dictionary.\n\n* If *obj* is not of type CODE, the function returns the components of the object.\n* If *obj* is of type CODE, the function returns the components of the object represented by *obj*.\n\n#### Examples\n\n```\nobjectComponent(<select col1,col2 from pt>)\n\n/*\noutput:\nexec->0\nselect->(< col1 >,< col2 >)\nfrom->< objByName(\"pt\") >\nwhere->()\ngroupBy->()\ngroupFlag->\ncgroups->0\ncsort->()\nhaving->\norderBy->()\nrowOffset->\nrowCount->\nhint->0\nsegment->\n*/\n```\n"
    },
    "objectType": {
        "url": "https://docs.dolphindb.com/en/Functions/o/objectType.html",
        "signatures": [
            {
                "full": "objectType(obj)",
                "name": "objectType",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [objectType](https://docs.dolphindb.com/en/Functions/o/objectType.html)\n\n\n\n#### Syntax\n\nobjectType(obj)\n\n#### Details\n\n* If *obj* is not of type CODE, the function returns \"CONSTOBJ\".\n* If *obj* is of type CODE, the function returns the type of the object represented by *obj*. Possible return values include:\n\n| Value            | Description                             |\n| ---------------- | --------------------------------------- |\n| CONSTOBJ         | Constant                                |\n| VAR              | Variable                                |\n| GLOBAL           | Global object                           |\n| ATTR             | Attribute of an object                  |\n| DIM              | Dimension                               |\n| TUPLE            | Tuple                                   |\n| FUNCTION         | Function                                |\n| EXPRESSION       | Expression                              |\n| COLUMN           | Column                                  |\n| COLUMNDEF        | Column definition                       |\n| SQLQUERY         | SQL query                               |\n| TABLEJOINER      | Table join                              |\n| VIRTUALCONST     | Virtual constant                        |\n| MAPPEDCOL        | Mapped column                           |\n| GLOBALTALBE      | Global table                            |\n| GROUPTASK        | Group of tasks                          |\n| DIMTABLE         | Dimension table                         |\n| METHODCALL       | Method call on an object                |\n| SQLUPDATE        | SQL update statement                    |\n| SQLDELETE        | SQL delete statement                    |\n| COLSELECTOR      | Column selector                         |\n| CASEWHEN         | SQL conditional expression              |\n| SQLEXISTS        | SQL existence check                     |\n| SQLWITHQUERY     | SQL common table expression             |\n| OPTOBJ           | Optimized object                        |\n| MULTITABLEJOINER | Multi-table join                        |\n| UNKNOWN          | Unknown (not matching any of the above) |\n\n#### Parameters\n\n**obj** can be of any data type.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nobjectType(<select * from pt>)\n// output: SQLQUERY\n\nobjectType(sqlColAlias(<col1>,`col))\n// output: COLUMNDEF\n\nobjectType(<x+y>)\n// output: EXPRESSION\n```\n"
    },
    "objs": {
        "url": "https://docs.dolphindb.com/en/Functions/o/objs.html",
        "signatures": [
            {
                "full": "objs([shared=false])",
                "name": "objs",
                "parameters": [
                    {
                        "full": "[shared=false]",
                        "name": "shared",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [objs](https://docs.dolphindb.com/en/Functions/o/objs.html)\n\n\n\n#### Syntax\n\nobjs(\\[shared=false])\n\n#### Details\n\nObtains the information on the variables in memory.\n\nPlease note that the function does not return the function definitions. You can use defs to check function definitions, or [memSize](https://docs.dolphindb.com/en/Functions/m/memSize.html) for the memory usage.\n\n#### Parameters\n\n**shared** is Boolean variable.\n\n* false (default): return info on all variables in the current session\n\n* true: return info on all variables in the current session and variables shared by other sessions\n\n#### Returns\n\nReturns a table with the following columns:\n\n* name: variable name\n\n* type: data type\n\n* form: data form\n\n* rows:\n\n  * If the data form is vector/dictionary/set, return the number of all elements (including null values);\n\n  * If the data form is matrix/table, return the number of rows.\n\n* columns:\n\n  * If the data form is vector/dictionary/set, return 1;\n\n  * If the data form is matrix/table, return the number of columns.\n\n* bytes: the memory (in bytes) used by the variable\n\n* shared: whether it is a shared variable\n\n* extra: the logical path to the DFS table, in the format of \"dfs\\://dbName/tableName\"\n\n* owner: the creator of shared variables. This column will only be displayed when *shared* is set to true. It will be left empty for local variables.\n\n#### Examples\n\n```\n//create a DFS database\nif(existsDatabase(\"dfs://listdb\")){\n        dropDatabase(\"dfs://listdb\")\n}\nn=1000000\nticker = rand(`MSFT`GOOG`FB`ORCL`IBM,n);\nticker[0..5]\nx=rand(1.0, n)\nt=table(ticker, x)\ndb=database(directory=\"dfs://listdb\", partitionType=HASH, partitionScheme=[STRING, 5])\npt=db.createPartitionedTable(t, `pt, `ticker)\npt.append!(t)\n\n// shared in-memory table\ntime = take(2021.08.20 00:00:00..2021.08.30 00:00:00, 40);\nid = 0..39;\nvalue = rand(100, 40);\ntmp = table(time, id, value);\nshare tmp as st\n\n// create set\ns = set([1,2,3,4,5])\n\n// create dict\nx=1 2 3\ny=4.5 7.8 4.3\nz=dict(x,y);\n\n// create matrix\nm = matrix(1 2 3, 4 5 6)\n\n// create pair\np = 1:2\n```\n\n```\nobjs(true)\n```\n\n| name   | type     | form       | rows      | columns | bytes      | shared | extra            | owner |\n| ------ | -------- | ---------- | --------- | ------- | ---------- | ------ | ---------------- | ----- |\n| n      | INT      | SCALAR     | 1         | 1       | 16         | false  |                  |       |\n| ticker | SYMBOL   | VECTOR     | 1,000,000 | 1       | 4,000,000  | false  |                  |       |\n| x      | INT      | VECTOR     | 3         | 1       | 12         | false  |                  |       |\n| t      | BASIC    | TABLE      | 1,000,000 | 2       | 12,000,312 | false  |                  |       |\n| db     | HANDLE   | SCALAR     | 1         | 1       | 24         | false  |                  |       |\n| pt     | ALIAS    | TABLE      | 0         | 2       | 12,000,000 | false  | dfs\\://listdb/pt |       |\n| time   | DATETIME | VECTOR     | 40        | 1       | 160        | false  |                  |       |\n| id     | INT      | VECTOR     | 40        | 1       | 160        | false  |                  |       |\n| value  | INT      | VECTOR     | 40        | 1       | 160        | false  |                  |       |\n| tmp    | BASIC    | TABLE      | 40        | 3       | 832        | false  |                  |       |\n| s      | INT      | SET        | 5         | 1       | 28         | false  |                  |       |\n| y      | DOUBLE   | VECTOR     | 3         | 1       | 24         | false  |                  |       |\n| z      | DOUBLE   | DICTIONARY | 3         | 1       | 199        | false  |                  |       |\n| m      | INT      | MATRIX     | 3         | 2       | 24         | false  |                  |       |\n| p      | INT      | PAIR       | 2         | 1       | 8          | false  |                  |       |\n| st     | BASIC    | TABLE      | 40        | 3       | 832        | true   |                  | admin |\n"
    },
    "ols": {
        "url": "https://docs.dolphindb.com/en/Functions/o/ols.html",
        "signatures": [
            {
                "full": "ols(Y, X, [intercept=true], [mode=0], [method='default'],[usePinv=true])",
                "name": "ols",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[mode=0]",
                        "name": "mode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[method='default']",
                        "name": "method",
                        "optional": true,
                        "default": "'default'"
                    },
                    {
                        "full": "[usePinv=true]",
                        "name": "usePinv",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [ols](https://docs.dolphindb.com/en/Functions/o/ols.html)\n\n\n\n#### Syntax\n\nols(Y, X, \\[intercept=true], \\[mode=0], \\[method='default'],\\[usePinv=true])\n\n#### Details\n\nReturn the result of an ordinary-least-squares regression of *Y* on *X*.\n\nNote that null values in *X* and *Y* are treated as 0 in calculations.\n\n#### Parameters\n\n**Y** is the dependent variable; **X** is the independent variable(s).\n\n**Y** is a vector; **X** is a vector/matrix/table/tuple.\n\nWhen *X* is a matrix,\n\n* If the number of rows equals the length of *Y*, each column of *X* is a factor;\n* If the number of rows is not the same as the length of *Y*, and the number of columns equals the length of *Y*, each row of *X* is a factor.\n\n**intercept** is a Boolean variable indicating whether the regression includes the intercept. If it is true, the system automatically adds a column of 1's to *X* to generate the intercept. The default value is true.\n\n**mode** is an integer indicating the contents in the output. It can be:\n\n* 0 (default): a vector of the coefficient estimates.\n\n* 1: a table with coefficient estimates, standard error, t-statistics, and p-values.\n\n* 2: a dictionary with the following keys: ANOVA, RegressionStat, Coefficient and Residual\n\n| Source of Variance | DF (degree of freedom) | SS (sum of square)             | MS (mean of square)               | F (F-score) | Significance |\n| ------------------ | ---------------------- | ------------------------------ | --------------------------------- | ----------- | ------------ |\n| Regression         | p                      | sum of squares regression, SSR | regression mean square, MSR=SSR/R | MSR/MSE     | p-value      |\n| Residual           | n-p-1                  | sum of squares error, SSE      | mean square error, MSE=MSE/E      |             |              |\n| Total              | n-1                    | sum of squares total, SST      |                                   |             |              |\n\n| Item         | Description                                                                                                                                   |\n| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| R2           | R-squared                                                                                                                                     |\n| AdjustedR2   | The adjusted R-squared corrected based on the degrees of freedom by comparing the sample size to the number of terms in the regression model. |\n| StdError     | The residual standard error/deviation corrected based on the degrees of freedom.                                                              |\n| Observations | The sample size.                                                                                                                              |\n\n| Item     | Description                                                             |\n| -------- | ----------------------------------------------------------------------- |\n| factor   | Independent variables                                                   |\n| beta     | Estimated regression coefficients                                       |\n| StdError | Standard error of the regression coefficients                           |\n| tstat    | t statistic, indicating the significance of the regression coefficients |\n\nResidual: the difference between each predicted value and the actual value.\n\n**method** (optional) is a string indicating the method for the ordinary-least-squares regression problem.\n\n* When set to \"default\" (by default), `ols` solves the problem by constructing coefficient matrices and inverse matrices.\n\n* When set to \"svd\", `ols` solves the problem by using singular value decomposition.\n\n**usePinv** (optional) is a Boolean value indicating whether to use pseudo-inverse method to calculate inverse of a matrix.\n\n* true (default): computing the pseudo-inverse of the matrix. It must be true for singular matrices.\n\n* false: computing the inverse of the matrix, which is only applicable to non-singular matrices.\n\n#### Returns\n\n* If *mode* = 0: Returns a vector of coefficient estimates.\n\n* If *mode* = 1: Returns a table containing the coefficient estimates, standard errors, t statistics, and p-values.\n\n* If *mode* = 2: Returns a dictionary containing ANOVA (analysis of variance), RegressionStat (regression statistics), Coefficient, and Residual.\n\n#### Examples\n\n```\nx1=1 3 5 7 11 16 23\nx2=2 8 11 34 56 54 100\ny=0.1 4.2 5.6 8.8 22.1 35.6 77.2;\n\nols(y, x1);\n// output: [-9.912821,3.378632]\n\nols(y, (x1,x2));\n// output: [-9.494813,2.806426,0.13147]\n```\n\n```\nols(y, (x1,x2), intercept=1, mode=1);\n```\n\n| factor    | beta      | stdError | tstat     | pvalue   |\n| --------- | --------- | -------- | --------- | -------- |\n| intercept | -9.494813 | 5.233168 | -1.814353 | 0.143818 |\n| x1        | 2.806426  | 1.830782 | 1.532911  | 0.20007  |\n| x2        | 0.13147   | 0.409081 | 0.321379  | 0.764015 |\n\n```\nols(y, (x1,x2), intercept=1, mode=2);\n/* output:\nANOVA->\nBreakdown  DF SS          MS          F         Significance\n---------- -- ----------- ----------- --------- ------------\nRegression 2  4204.416396 2102.208198 31.467739 0.003571\nResidual   4  267.220747  66.805187\nTotal      6  4471.637143\n\nRegressionStat->\nitem         statistics\n------------ ----------\nR2           0.940241\nAdjustedR2   0.910361\nStdError     8.173444\nObservations 7\n\nCoefficient->\nfactor    beta      stdError tstat     pvalue\n--------- --------- -------- --------- --------\nintercept -9.494813 5.233168 -1.814353 0.143818\nx1        2.806426  1.830782 1.532911  0.20007\nx2        0.13147   0.409081 0.321379  0.764015\n*/\n```\n\n```\nx=matrix(1 4 8 2 3, 1 4 2 3 8, 1 5 1 1 5);\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 1  | 1  |\n| 4  | 4  | 5  |\n| 8  | 2  | 1  |\n| 2  | 3  | 1  |\n| 3  | 8  | 5  |\n\n```\nols(1..5, x);\n// output: [1.156537,0.105505,0.91055,-0.697821]\n\nols(1..5, x.transpose());\n// output: [1.156537,0.105505,0.91055,-0.697821]\n// the system adjusts the dimensions of the dependent variable and the independent variables for the regression to go through.\n```\n\n```\nx = table([13.9782,13.4688,13.4336,12.9642,12.7905,13.4771,13.0423,12.6588,13.8933,13.9006] as col0, [195.3904,181.4090,180.4627,168.0723,163.5973,181.6342,170.1017,160.2477,193.0241,193.2270] as col1, [2731.2089,2443.3656,2424.2715,2178.9356,2092.4947,2447.9167,2218.5185,2028.5594,2681.7456,2685.9754] as col2)\ny = [-0.4002,-0.8004,-0.2002,-1.0002,-0.2001,-0.5001,-0.2501,0.0000,0.0000,0.0000]\n\nols(y, x, intercept=true, mode=0, method=\"default\")\n// output: [2.968166,13.023638,-2.016390,0.076485]\n\nols(y, x, intercept=true, mode=0, method=\"svd\")\n// output: [3266.457957,-722.195120,53.157806,-1.302769]\n```\n\nRelated functions: [olsEx](https://docs.dolphindb.com/en/Functions/o/olsEx.html), [bvls](https://docs.dolphindb.com/en/Functions/b/bvls.html)\n"
    },
    "olsEx": {
        "url": "https://docs.dolphindb.com/en/Functions/o/olsEx.html",
        "signatures": [
            {
                "full": "olsEx(ds, Y, X, [intercept=true], [mode=0])",
                "name": "olsEx",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[mode=0]",
                        "name": "mode",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [olsEx](https://docs.dolphindb.com/en/Functions/o/olsEx.html)\n\n\n\n#### Syntax\n\nolsEx(ds, Y, X, \\[intercept=true], \\[mode=0])\n\n#### Details\n\nReturn the result of an ordinary-least-squares regression of *Y* on *X*. *Y* and *X* are columns in a partitioned table.\n\nNote that null values in *X* and *Y* are treated as 0 in calculations.\n\n#### Parameters\n\n**ds** a set of data sources stored in a tuple. It is usually generated by the function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**Y** a string indicating the column name of the dependent variable from the table represented by *ds*.\n\n**X** a string scalar/vector indicating the column name(s) of independent variable(s) from the table represented by *ds*.\n\n**intercept** is a boolean variable indicating whether the regression includes the intercept. If it is true, the system automatically adds a column of 1's to *X* to generate the *intercept*. The default value is true.\n\n**mode** is an integer that could be 0,1,2. It indicates the contents in the output. The default value is 0.\n\n* 0: a vector of the coefficient estimates\n\n* 1: a table with coefficient estimates, standard error, t-statistics, and p-value\n\n* 2: a dictionary with all statistics\n\n#### Returns\n\n* If *mode* = 0: Returns a vector of coefficient estimates.\n\n* If *mode* = 1: Returns a table containing the ecoefficient estimates, standard errors, t statistics, and p-values.\n\n* If *mode* = 2: Returns a dictionary containing ANOVA (analysis of variance), RegressionStat (regression statistics), Coefficient, and Residual.\n\n#### Examples\n\n```\nn=10000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nvol=rand(1..10 join int(), n)\nprice=rand(100,n)\nt=table(ID, date, vol,price)\nsaveText(t, \"D:/DolphinDB/Data/t.txt\");\nif(existsDatabase(\"dfs://rangedb\")){\n  dropDatabase(\"dfs://rangedb\")\n}\ndb = database(directory=\"dfs://rangedb\", partitionType=RANGE, partitionScheme=0 51 101)\nUSPrices=loadTextEx(dbHandle=db,tableName=`USPrices, partitionColumns=`ID, filename=\"/home/DolphinDB/Data/t.txt\");\n\nds=sqlDS(<select vol as VS, price as SBA from USPrices where vol>5>)\nrs=olsEx(ds=ds, Y=`VS, X=`SBA, intercept=true, mode=2)\nrs;\n\n/* output:\nRegressionStat->\nitem         statistics\n------------ ----------\nR2           0.000848\nAdjustedR2   0.000628\nStdError     1.404645\nObservations 4535\n\nANOVA->\nBreakdown  DF   SS          MS       F        Significance\n---------- ---- ----------- -------- -------- ------------\nRegression 1    7.592565    7.592565 3.848178 0.049861\nResidual   4533 8943.739298 1.973029\nTotal      4534 8951.331863\n\nCoefficient->\nfactor    beta     stdError tstat      pvalue\n--------- -------- -------- ---------- --------\nintercept 7.953084 0.04185  190.039423 0\nSBA       0.001422 0.000725 1.961677   0.049861\n*/\n```\n"
    },
    "oneHot": {
        "url": "https://docs.dolphindb.com/en/Functions/o/oneHot.html",
        "signatures": [
            {
                "full": "oneHot(obj, encodingColumns)",
                "name": "oneHot",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "encodingColumns",
                        "name": "encodingColumns"
                    }
                ]
            }
        ],
        "markdown": "### [oneHot](https://docs.dolphindb.com/en/Functions/o/oneHot.html)\n\n\n\n#### Syntax\n\noneHot(obj, encodingColumns)\n\n#### Details\n\nPerform one-hot encoding on the specified columns in an in-memory table. It returns a table with columns in the order of encoded columns and non-encoded columns. The name of the encoded columns is \"original column name\\_value\".\n\n#### Parameters\n\n**obj** is an in-memory table.\n\n**encodingColumns** is a STRING scalar or vector, indicating the columns for one-hot encoding.\n\n#### Returns\n\nIt returns a table with columns in the order of encoded columns and non-encoded columns.\n\n#### Examples\n\n```\nt = table( take(`Tom`Lily`Jim, 10) as name, take(true false, 10) as gender, take(21..23,10) as age);\noneHot(t, `name`gender);\n```\n\n| name\\_Tom | name\\_Lily | name\\_Jim | gender\\_1 | gender\\_0 | age |\n| --------- | ---------- | --------- | --------- | --------- | --- |\n| 1         | 0          | 0         | 1         | 0         | 21  |\n| 0         | 1          | 0         | 0         | 1         | 22  |\n| 0         | 0          | 1         | 1         | 0         | 23  |\n| 1         | 0          | 0         | 0         | 1         | 21  |\n| 0         | 1          | 0         | 1         | 0         | 22  |\n| 0         | 0          | 1         | 0         | 1         | 23  |\n| 1         | 0          | 0         | 1         | 0         | 21  |\n| 0         | 1          | 0         | 0         | 1         | 22  |\n| 0         | 0          | 1         | 1         | 0         | 23  |\n| 1         | 0          | 0         | 0         | 1         | 21  |\n"
    },
    "optionVolPredict": {
        "url": "https://docs.dolphindb.com/en/Functions/o/optionVolPredict.html",
        "signatures": [
            {
                "full": "optionVolPredict(volsurf, dt, strike)",
                "name": "optionVolPredict",
                "parameters": [
                    {
                        "full": "volsurf",
                        "name": "volsurf"
                    },
                    {
                        "full": "dt",
                        "name": "dt"
                    },
                    {
                        "full": "strike",
                        "name": "strike"
                    }
                ]
            }
        ],
        "markdown": "### [optionVolPredict](https://docs.dolphindb.com/en/Functions/o/optionVolPredict.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\noptionVolPredict(volsurf, dt, strike)\n\n#### Details\n\nPredict the volatility at a given point based on its time and strike price from the specified volatility surface.\n\n#### Parameters\n\n**volsurf** is a MKTDATA object of VolatilitySurface type.\n\n**dt** is a DOUBLE scalar/vector or a DATE scalar/vector.\n\n* A DOUBLE scalar/vector indicates time in years.\n\n* A DATE scalar/vector indicates specific date(s).\n\n**strike** is a DOUBLE scalar/vector indicating the strike price(s).\n\n#### Returns\n\nA DOUBLE matrix with the shape size(dt) \\* size(strike). Rows are the input *dt,* and columns are the input *strike*.\n\n#### Examples\n\n```\nrefDate = 2025.08.18\nccyPair = \"USDCNY\"\nquoteTerms = ['1d', '1w', '2w', '3w', '1M', '2M', '3M', '6M', '9M', '1y', '18M', '2y', '3y']\nquoteNames = [\"ATM\", \"D25_RR\", \"D25_BF\", \"D10_RR\", \"D10_BF\"]\nquotes = [0.030000, -0.007500, 0.003500, -0.010000, 0.005500, \n          0.020833, -0.004500, 0.002000, -0.006000, 0.003800, \n          0.022000, -0.003500, 0.002000, -0.004500, 0.004100, \n          0.022350, -0.003500, 0.002000, -0.004500, 0.004150, \n          0.024178, -0.003000, 0.002200, -0.004750, 0.005500, \n          0.027484, -0.002650, 0.002220, -0.004000, 0.005650, \n          0.030479, -0.002500, 0.002400, -0.003500, 0.005750, \n          0.035752, -0.000500, 0.002750,  0.000000, 0.006950, \n          0.038108,  0.001000, 0.002800,  0.003000, 0.007550, \n          0.039492,  0.002250, 0.002950,  0.005000, 0.007550, \n          0.040500,  0.004000, 0.003100,  0.007000, 0.007850, \n          0.041750,  0.005250, 0.003350,  0.008000, 0.008400, \n          0.044750,  0.006250, 0.003400,  0.009000, 0.008550]\n\nquotes = reshape(quotes, size(quoteNames):size(quoteTerms)).transpose()\n\nspot = 7.1627\ncurveDates = [2025.08.21,\n              2025.08.27,\n              2025.09.03,\n              2025.09.10,\n              2025.09.22,\n              2025.10.20,\n              2025.11.20,\n              2026.02.24,\n              2026.05.20,\n              2026.08.20,\n              2027.02.22,\n              2027.08.20,\n              2028.08.21]\n\ndomesticCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": refDate,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[1.5113, \n              1.5402, \n              1.5660, \n              1.5574, \n              1.5556, \n              1.5655, \n              1.5703, \n              1.5934, \n              1.6040, \n              1.6020, \n              1.5928, \n              1.5842, \n              1.6068]/100\n}\nforeignCurveInfo = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": refDate,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",  \n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    \"dates\": curveDates,\n    \"values\":[4.3345, \n              4.3801, \n              4.3119, \n              4.3065, \n              4.2922, \n              4.2196, \n              4.1599, \n              4.0443, \n              4.0244, \n              3.9698, \n              3.7740, \n              3.6289, \n              3.5003]/100\n}\n\ndomesticCurve = parseMktData(domesticCurveInfo)\nforeignCurve = parseMktData(foreignCurveInfo)\n\nsurf = fxVolatilitySurfaceBuilder(refDate, ccyPair, quoteNames, quoteTerms, quotes, spot, domesticCurve, foreignCurve)\n\noptionVolPredict(surf, 2025.10.18, 7)\n```\n\n|            | 7        |\n| ---------- | -------- |\n| 2025.10.18 | 0.035427 |\n\n```\noptionVolPredict(surf, 2025.10.18, [7.1,7.2])\n```\n\n|            | 7.1                 | 7.2                 |\n| ---------- | ------------------- | ------------------- |\n| 2025.10.18 | 0.02946679951336248 | 0.02926808425498284 |\n\n```\noptionVolPredict(surf, [2025.10.18, 2026.10.18], 7)\n```\n\n<table id=\"table_irn_y2r_ngc\"><tbody><tr><td>\n\n</td><td>\n\n7\n\n</td></tr><tr><td>\n\n2025.10.18\n\n</td><td>\n\n0.03542772267328074\n\n</td></tr><tr><td>\n\n2026.10.18\n\n</td><td>\n\n0.04045352876306188\n\n</td></tr></tbody>\n</table>```\noptionVolPredict(surf, [2025.10.18, 2026.10.18], [7.1, 7.2])\n```\n\n|            | 7.1                 | 7.2                 |\n| ---------- | ------------------- | ------------------- |\n| 2025.10.18 | 0.02946679951336248 | 0.02926808425498284 |\n| 2026.10.18 | 0.04218869392416815 | 0.04440856375512336 |\n\n**Related function:**[parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n"
    },
    "osqp": {
        "url": "https://docs.dolphindb.com/en/Functions/o/osqp.html",
        "signatures": [
            {
                "full": "osqp(q, [P], [A], [lb], [ub])",
                "name": "osqp",
                "parameters": [
                    {
                        "full": "q",
                        "name": "q"
                    },
                    {
                        "full": "[P]",
                        "name": "P",
                        "optional": true
                    },
                    {
                        "full": "[A]",
                        "name": "A",
                        "optional": true
                    },
                    {
                        "full": "[lb]",
                        "name": "lb",
                        "optional": true
                    },
                    {
                        "full": "[ub]",
                        "name": "ub",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [osqp](https://docs.dolphindb.com/en/Functions/o/osqp.html)\n\n\n\n#### Syntax\n\nosqp(q, \\[P], \\[A], \\[lb], \\[ub])\n\n#### Details\n\nSolve the following optimization problem with a quadratic objective function and a set of linear constraints.\n\n![](https://docs.dolphindb.com/en/images/osqp.png)\n\n#### Parameters\n\n**q** is a vector indicating the linear coefficient of the objective function.\n\n**P** (optional) is a positive semi-definite matrix indicating the quadratic coefficients of the objective function.\n\n**A** (optional) is the coefficient matrix of linear inequality constraints.\n\n**lb** (optional) is the left-hand-side vector of the linear inequality constraint.\n\n**ub**(optional) is the right-hand-side vector of the linear inequality constraint.\n\n*A*, *lb*, and *ub* must be all specified or not.\n\n*lb* and *ub* can contain null values, but their length must match the number of rows in *A*. Null values in *ub* and *lb* are treated as positive/negative infinity and take ±1030 during computation.\n\n#### Returns\n\nA 2-element tuple:\n\n* The first element is a string indicating the state of the solution:\n\n  * solved: solution found;\n\n  * solved inaccurate: solution found but the result is inaccurate;\n\n  * primal infeasible: no feasible solution to the primal;\n\n  * dual infeasible: no feasible solution to the dual;\n\n  * maximum iterations reached: reach the maximum number of iterations;\n\n  * run time limit reached: execution timeout;\n\n  * problem non convex: the problem is non-convex;\n\n  * interrupted: solution interrupted;\n\n  * unsolved: solution not found.\n\n* The second element is the value of x where the value of the objective function is minimized.\n\n#### Examples\n\n```\nP = matrix(4e-2 6e-3 -4e-3 0.0, 6e-3 1e-2 0.0 0.0, -4e-3 0.0 2.5e-3 0.0, 0.0 0.0 0.0 0.0)\nq = [-2, -4, 2, 3]\nA = [1,2,1,1,3,-1,2,1,3,1,-1,1,-2,-4,-5,1]$4:4\nl = [,,,1.0]\nu = [3.0,2.0,-1.0,1.0]\nres = osqp(q, P, A, l, u)\n// output: (\"solved\",[-64.364818313795097,368.910318139716082,-548.041799338347459,244.496302999333039])\n```\n"
    },
    "qclp": {
        "url": "https://docs.dolphindb.com/en/Functions/q/qclp.html",
        "signatures": [
            {
                "full": "qclp(r, V, k, [A], [b], [Aeq], [beq], [x0], [c], [eps], [alpha])",
                "name": "qclp",
                "parameters": [
                    {
                        "full": "r",
                        "name": "r"
                    },
                    {
                        "full": "V",
                        "name": "V"
                    },
                    {
                        "full": "k",
                        "name": "k"
                    },
                    {
                        "full": "[A]",
                        "name": "A",
                        "optional": true
                    },
                    {
                        "full": "[b]",
                        "name": "b",
                        "optional": true
                    },
                    {
                        "full": "[Aeq]",
                        "name": "Aeq",
                        "optional": true
                    },
                    {
                        "full": "[beq]",
                        "name": "beq",
                        "optional": true
                    },
                    {
                        "full": "[x0]",
                        "name": "x0",
                        "optional": true
                    },
                    {
                        "full": "[c]",
                        "name": "c",
                        "optional": true
                    },
                    {
                        "full": "[eps]",
                        "name": "eps",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [qclp](https://docs.dolphindb.com/en/Functions/q/qclp.html)\n\n\n\n#### Syntax\n\nqclp(r, V, k, \\[A], \\[b], \\[Aeq], \\[beq], \\[x0], \\[c], \\[eps], \\[alpha])\n\n#### Details\n\nSolve the following optimization problem with a linear objective function and a set of constraints including a quadratic constraint.\n\n![](https://docs.dolphindb.com/en/images/qclp.png)\n\n#### Parameters\n\n**V**, **A** and **Aeq** must be matrices with the same number of columns.\n\n**r**, **b** and **beq** are vectors.\n\n**k** is a positive scalar.\n\n**x0** is a vector of coefficients for absolute value inequality constraints.\n\n**c** is a non-negative number representing the right-hand constant for absolute value inequality constraints.\n\n**eps** is a positive floating-point number representing the solution precision. The default value is 1e-6, and the range is \\[1e-4, 1e-9]. A solution with higher precision can be obtained by decreasing eps. If a value beyond the range is set, it will be adjusted to the default value.\n\n**alpha** is a positive floating-point number representing the relaxation parameter. The default value is 1.5, and the range is (0,2). The solution process can be sped up by increasing *alpha*. If a value beyond the range is set, it will be adjusted to the default value.\n\n#### Returns\n\nThe result is a 2-element tuple. The first element is the minimum value of the objective function. The second element is the value of x where the value of the objective function is minimized.\n\n#### Examples\n\nDetermine the optimal portfolio based on expected average returns (r) and the variance-covariance matrix (V) of selected stocks, and the constraints that the volatility of the portfolio should be no more than 11% and the weight of each stock in the portfolio is between 10% and 50%.\n\n```\nr = 0.18 0.25 0.36\nV= 0.0225 -0.003 -0.01125 -0.003 0.04 0.025 -0.01125 0.025 0.0625 $ 3:3\nk = pow(0.11, 2)\nA = (eye(3) join (-1*eye(3))).transpose()\nb = 0.5 0.5 0.5 -0.1 -0.1 -0.1\nAeq = (1 1 1)$1:3\nbeq = [1]\n\nx = qclp(-r, V, k, A, b, Aeq, beq);\n\nx[1];\n// output: [0.5,0.176297,0.323703]\n```\n\nBased on the above example, adding absolute value constraints | x1 - 0.35| + | x2 - 0.35 | + | x3 - 0.35 | ≤ 0.3 :\n\n```\nx0 = [0.35, 0.35, 0.35];\nc = 0.3;\ny = qclp(-r, V, k, A, b, Aeq, beq, x0, c);\ny[1]\n// output: [0.475001,0.247962,0.277037]\n```\n"
    },
    "qcut": {
        "url": "https://docs.dolphindb.com/en/Functions/q/qcut.html",
        "signatures": [
            {
                "full": "qcut(X, q, [labels],[dropDuplicates=false])",
                "name": "qcut",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "q",
                        "name": "q"
                    },
                    {
                        "full": "[labels]",
                        "name": "labels",
                        "optional": true
                    },
                    {
                        "full": "[dropDuplicates=false]",
                        "name": "dropDuplicates",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [qcut](https://docs.dolphindb.com/en/Functions/q/qcut.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nqcut(X, q, \\[labels],\\[dropDuplicates=false])\n\n#### Details\n\nDetermines the quantile bin for each element based on its rank in a numeric vector. For example, given 1,000 values, divides them into 10 quantile bins and returns the bin label each element belongs to.\n\nAlthough the `qcut` functions in DolphinDB and pandas both perform quantile discretization, the core differences are: DolphinDB operates directly on table columns and returns an integer index vector by default, making it suitable for efficient binning of massive datasets; pandas is an in-memory analysis tool that returns a Categorical object that preserves interval information and supports *retbins* to extract bin boundaries and *precision* to control numeric precision, making it more suitable for interactive analysis.\n\n#### Parameters\n\n**X:** A numeric vector.\n\n**q:** An INT scalar or a FLOATING vector.\n\n* An INT scalar specifies the number of quantile bins (e.g., 10 for deciles, 4 for quartiles).\n* A FLOATING vector specifies the quantile breakpoints. It must contain at least two elements, with values in the range \\[0, 1].\n\n**labels** (optional): A vector of labels for each quantile bin.\n\n* It defaults to NULL, which means the function returns an integer vector representing the bin index for each element.\n* If *q* is a scalar, the length of *labels* must equal *q*.\n* If *q* is a vector, the length of *labels* must be len(q) - 1.\n\n\\*\\*dropDuplicates:\\*\\*A boolean value specifying whether to drop duplicate bin boundaries.\n\n* It defaults to false, which means raising an error if duplicate boundaries exist.\n* If it is set to true, duplicate boundaries are removed.\n\n#### Returns\n\nA vector indicating the quantile bin to which each element belongs.\n\n#### Examples\n\n```\n// Divide the data into 4 quantile bins\nqcut([1,2,3,4,5,6,7,8,9,10], 4)\n// Output: [0 0 0 1 1 2 2 3 3 3]\n\n// Divide using custom quantile breakpoints: 0–30%, 30–70%, 70–100%\nqcut([1,2,3,4,5,6,7,8,9,10], [0, 0.3, 0.7, 1.0])\n// Output: [0 0 0 1 1 1 1 2 2 2]\n\n// Divide the data into 4 quantile bins and use custom labels\nqcut([1,2,3,4,5,6,7,8,9,10], 4, [\"Q1\", \"Q2\", \"Q3\", \"Q4\"])\n// Output: [Q1 Q1 Q1 Q2 Q2 Q3 Q3 Q4 Q4 Q4]\n\n/* Due to a large number of duplicate values in the data,\n   the quantile boundaries are not unique.\n   After enabling dropDuplicates, duplicate boundaries are automatically removed,\n   resulting in fewer than 4 quantile bins.\n*/\nqcut(X=[1, 1, 1, 1, 2, 3], q=4, dropDuplicates=true)\n// Output: [0 0 0 0 2 2]\n\n```\n"
    },
    "qr": {
        "url": "https://docs.dolphindb.com/en/Functions/q/qr.html",
        "signatures": [
            {
                "full": "qr(obj, [mode='full'], [pivoting=false])",
                "name": "qr",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[mode='full']",
                        "name": "mode",
                        "optional": true,
                        "default": "'full'"
                    },
                    {
                        "full": "[pivoting=false]",
                        "name": "pivoting",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [qr](https://docs.dolphindb.com/en/Functions/q/qr.html)\n\n\n\n#### Syntax\n\nqr(obj, \\[mode='full'], \\[pivoting=false])\n\n#### Details\n\nPerform the QR decomposition of a matrix. Decompose a matrix A into an orthogonal matrix Q and an upper triangular matrix R, with A=Q\\*R.\n\nGiven an m-by-n matrix A:\n\n* If *mode*=\"full\", return 2 matrices: Q (m-by-m) and R (m-by-n).\n\n* If *mode*=\"economic\", return 2 matrices: Q (m-by-k) and R (k-by-n) with k=min(m,n).\n\n* If *mode*=\"r\", only return matrix R (m-by-n).\n\nIf *pivoting*= true, also return a vector P which has the same length as the number of columns of the matrix. P is the pivoting for rank-revealing QR decomposition indicating the location of 1s in the permutation matrix.\n\nThe `qr` functions in DolphinDB and SciPy provide essentially the same functionality, but SciPy offers more performance-tuning parameters, including *overwrite\\_a*, *lwork*, and *check\\_finite*.\n\n#### Parameters\n\n**obj** is a matrix.\n\n**mode** is a string indicating what information is to be returned. It can be \"full\", \"economic\" or \"r\". The default value is \"full\".\n\n**pivoting** is a Boolean value. The default value is false.\n\n#### Returns\n\nIt returns a tuple or matrix.\n\n#### Examples\n\n```\nA = matrix([2,5,7,5], [5,2,5,4], [8,2,6,4]);\n\nQ,R = qr(A);\nQ;\n```\n\n| #0        | #1        | #2        | #3        |\n| --------- | --------- | --------- | --------- |\n| -0.197066 | 0.903357  | 0.300275  | 0.234404  |\n| -0.492665 | -0.418267 | 0.459245  | 0.609449  |\n| -0.68973  | -0.02475  | 0.170745  | -0.703211 |\n| -0.492665 | 0.091573  | -0.818398 | 0.281284  |\n\n```\nR;\n```\n\n| #0         | #1       | #2        |\n| ---------- | -------- | --------- |\n| -10.148892 | -7.38997 | -8.670898 |\n| 0          | 3.922799 | 6.608121  |\n| 0          | 0        | 1.071571  |\n| 0          | 0        | 0         |\n\n```\nQ,R=qr(A,mode='economic');\nQ;\n```\n\n| #0        | #1        | #2        |\n| --------- | --------- | --------- |\n| -0.197066 | 0.903357  | 0.300275  |\n| -0.492665 | -0.418267 | 0.459245  |\n| -0.68973  | -0.02475  | 0.170745  |\n| -0.492665 | 0.091573  | -0.818398 |\n\n```\nR;\n```\n\n| #0         | #1       | #2        |\n| ---------- | -------- | --------- |\n| -10.148892 | -7.38997 | -8.670898 |\n| 0          | 3.922799 | 6.608121  |\n| 0          | 0        | 1.071571  |\n\n```\nQ,T,R=qr(A,mode='raw');\nR;\n```\n\n| #0         | #1       | #2        |\n| ---------- | -------- | --------- |\n| -10.148892 | -7.38997 | -8.670898 |\n| 0.41156    | 3.922799 | 6.608121  |\n| 0.576184   | 0.3046   | 1.071571  |\n| 0.41156    | 0.156539 | 0.900419  |\n\n```\nT;\n// output: [1.197066,1.790053,1.104512]\n\nR\n```\n\n| #0         | #1       | #2        |\n| ---------- | -------- | --------- |\n| -10.148892 | -7.38997 | -8.670898 |\n| 0          | 3.922799 | 6.608121  |\n| 0          | 0        | 1.071571  |\n\n```\nQ,T,R,P = qr(A,mode='raw',pivoting=true);\nQ;\n```\n\n| #0         | #1        | #2        |\n| ---------- | --------- | --------- |\n| -10.954451 | -8.033264 | -8.215838 |\n| 0.105516   | -6.20215  | -1.45111  |\n| 0.316548   | 0.37699   | -0.627918 |\n| 0.211032   | 0.284188  | 0.936372  |\n\n```\nT;\n// output: [1.730297,1.635478,1.065648]\n\nR\n```\n\n| #0         | #1        | #2        |\n| ---------- | --------- | --------- |\n| -10.954451 | -8.033264 | -8.215838 |\n| 0          | -6.20215  | -1.45111  |\n| 0          | 0         | -0.627918 |\n\n```\nP;\n// output: [2,0,1]\n```\n"
    },
    "quadprog": {
        "url": "https://docs.dolphindb.com/en/Functions/q/quadprog.html",
        "signatures": [
            {
                "full": "quadprog(H, f, [A], [b], [Aeq], [beq])",
                "name": "quadprog",
                "parameters": [
                    {
                        "full": "H",
                        "name": "H"
                    },
                    {
                        "full": "f",
                        "name": "f"
                    },
                    {
                        "full": "[A]",
                        "name": "A",
                        "optional": true
                    },
                    {
                        "full": "[b]",
                        "name": "b",
                        "optional": true
                    },
                    {
                        "full": "[Aeq]",
                        "name": "Aeq",
                        "optional": true
                    },
                    {
                        "full": "[beq]",
                        "name": "beq",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [quadprog](https://docs.dolphindb.com/en/Functions/q/quadprog.html)\n\n\n\n#### Syntax\n\nquadprog(H, f, \\[A], \\[b], \\[Aeq], \\[beq])\n\n#### Details\n\nSolve the following optimization problem with a quadratic objective function and a set of linear constraints.\n\n![](https://docs.dolphindb.com/en/images/quadprog.png)\n\n#### Parameters\n\n**H**, **A** and **Aeq** must be matrices with the same number of columns.\n\n**f**, **b** and **beq** are vectors.\n\n**A** is the coefficient matrix of linear inequality constraints.\n\n**b** is the right-hand-side vector of the linear inequality constraint.\n\n**Aeq** is a linear equality constraint coefficient matrix.\n\n**beq** is the right-hand-side vector of the linear equality constraint.\n\n#### Returns\n\nThe result is a 2-element tuple. The first element is the minimum value of the objective function. The second element is the value of x where the value of the objective function is minimized.\n\n#### Examples\n\nExample 1: Find the minimum of ![](https://docs.dolphindb.com/en/images/quadprog1.png)\n\n```\nH=matrix([2 -2,-2 6])\nf=[-5,4]\nx=quadprog(H,f);\n\nx[0];\n// output: -6.375\n\nx[1];\n// output: [2.75,0.25]\n```\n\nExample 2: Find the minimum of\n\n![](https://docs.dolphindb.com/en/images/quadprog1.png)\n\nsubject to the constraints of\n\n![](https://docs.dolphindb.com/en/images/quadprog2.png)\n\n```\nH=matrix([2 -2,-2 6])\nf=[-5,4]\nA=matrix([1 -1 6, 1 3 1])\nb=[10, 8, 5]\nx=quadprog(H,f,A,b);\n\nx[0];\n// output: -4.092975\n\nx[1];\n// output: [0.904959, -0.429752]\n```\n\nExample 3: Find the minimum of\n\n![](https://docs.dolphindb.com/en/images/quadprog1.png)\n\nsubject to the constraints of\n\n![](https://docs.dolphindb.com/en/images/quadprog3.png)\n\n```\nH=matrix([2 -2,-2 6])\nf=[-5,4]\nA=matrix([1 -1 6, 1 3 1])\nb=[10, 8, 5]\nAeq=matrix([1],[2])\nbeq=[1]\nx=quadprog(H,f,A,b,Aeq,beq);\n\nx[0];\n// output: -3.181818\n\nx[1];\n// output: [0.818182,0.090909]\n```\n\nThe 3 examples above share the same objective function. Example 1 has no constaints and achieves the lowest minimum value. Example 3 has more constaints than example 2 and therefore can only achieve a higher minimum value than both example 2 and example 1.\n"
    },
    "quantile": {
        "url": "https://docs.dolphindb.com/en/Functions/q/quantile.html",
        "signatures": [
            {
                "full": "quantile(X, q, [interpolation='linear'])",
                "name": "quantile",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "q",
                        "name": "q"
                    },
                    {
                        "full": "[interpolation='linear']",
                        "name": "interpolation",
                        "optional": true,
                        "default": "'linear'"
                    }
                ]
            }
        ],
        "markdown": "### [quantile](https://docs.dolphindb.com/en/Functions/q/quantile.html)\n\n\n\n#### Syntax\n\nquantile(X, q, \\[interpolation='linear'])\n\n#### Details\n\nCalculates values at the given quantile in *X*.\n\nDolphinDB's `quantile` features a concise syntax and ignores null values natively, making it suitable for real-time computation on massive datasets. NumPy's `quantile` is designed for multidimensional arrays and supports passing an array to compute multiple quantiles in batch. SciPy's `quantile` not only allows you to specify different quantiles for each data slice, but also supports the Harrell-Davis statistical estimator and the *nan\\_policy* parameter, so it can handle samples with missing values natively.\n\n#### Parameters\n\n**X** is a numeric vector, matrix or table.\n\n**q** is a floating number between 0 and 1.\n\n**interpolation** is a string indicating how to interpolate if the quantile is between element i and j in *X* with i\\<j. It can take the following values:\n\n* 'linear' (default): i+(j-i)\\*fraction, where fraction is the decimal part of *q*\\*size(X).\n\n* 'lower': i\n\n* 'higher': j\n\n* 'nearest': i or j whichever is nearest.\n\n* 'midpoint': (i+ j)/2\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\na=[6, 47, 49, 15, 42, 41, 7, 39, 43, 40, 36];\nquantile(a,0.25);\n// output: 25.5\n\nquantile(a,0.5);\n// output: 40\n\nquantile(a,0.75);\n// output: 42.5\n\nquantile(a,0.75, 'lower');\n// output: 42\n```\n\nRelated function: [quantileSeries](https://docs.dolphindb.com/en/Functions/q/quantileSeries.html), [percentile](https://docs.dolphindb.com/en/Functions/p/percentile.html)\n"
    },
    "quantileSeries": {
        "url": "https://docs.dolphindb.com/en/Functions/q/quantileSeries.html",
        "signatures": [
            {
                "full": "quantileSeries(X, q, [interpolation='linear'])",
                "name": "quantileSeries",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "q",
                        "name": "q"
                    },
                    {
                        "full": "[interpolation='linear']",
                        "name": "interpolation",
                        "optional": true,
                        "default": "'linear'"
                    }
                ]
            }
        ],
        "markdown": "### [quantileSeries](https://docs.dolphindb.com/en/Functions/q/quantileSeries.html)\n\n\n\n#### Syntax\n\nquantileSeries(X, q, \\[interpolation='linear'])\n\n#### Details\n\nCalculates values at the given quantile in *X*.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**q** is a scalar or vector of floating numbers between 0 and 1.\n\n**interpolation** is a string indicating how to interpolate if the quantile is between element i and j in X with i\\<j. It can take the following values and the default value is 'linear'.\n\n* 'linear' (default): i+(j-i)\\*fraction, where fraction is the decimal part of *q*\\*size(X).\n\n* 'lower': i\n\n* 'higher': j\n\n* 'nearest': i or j whichever is nearest.\n\n* 'midpoint': (i+ j)/2\n\n#### Returns\n\nA DOUBLE vector.\n\n#### Examples\n\n```\na=[6, 47, 49, 15, 42, 41, 7, 39, 43, 40, 36];\nquantileSeries(a,[0.25,0.5,0.75]);\n// output: [25.5,40,42.5]\n\nquantileSeries(a,[0.25,0.5,0.75], 'higher');\n// output: [36,40,43]\n```\n\nRelated function: [quantile](https://docs.dolphindb.com/en/Functions/q/quantile.html)\n"
    },
    "quarterBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/q/quarterBegin.html",
        "signatures": [
            {
                "full": "quarterBegin(X, [startingMonth=1], [offset], [n=1])",
                "name": "quarterBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[startingMonth=1]",
                        "name": "startingMonth",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [quarterBegin](https://docs.dolphindb.com/en/Functions/q/quarterBegin.html)\n\n\n\n#### Syntax\n\nquarterBegin(X, \\[startingMonth=1], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first day of the quarter that *X* belongs to. The first months of the quarters are determined by *startingMonth*.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates dates based on periods consisting of *n* quarters. In this case, *offset* determines how the multi-quarter periods are aligned. Specifically, the system first calculates the start date of the quarter containing *offset* according to *startingMonth*, and uses that date as the reference point. A new period start boundary is then generated every *n* quarters, and the function returns the first day corresponding to the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**startingMonth** is an integer between 1 and 12 that specifies the starting month of the first quarter in a year. The default value is 1, which represents calendar quarters. For example, when `startingMonth = 4`, the quarters are defined as April–June, July–September, October–December, and January–March of the following year.\n\n**offset** is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** is a positive integer. The default value is 1.\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\nquarterBegin(2012.06.12);\n// output: 2012.04.01\n\nquarterBegin(2012.06.13 10:10:10.008,5);\n// output: 2012.05.01\n\ndate=2016.01.12 2016.02.25 2016.05.12 2016.06.28 2016.07.10 2016.08.18 2016.09.02 2016.10.16 2016.11.26 2016.12.30\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by quarterBegin(date,1,2016.01.01,2)\n```\n\n| quarterBegin\\_date | avg\\_price | sum\\_qty |\n| ------------------ | ---------- | -------- |\n| 2016.01.01         | 34.65      | 9400     |\n| 2016.07.01         | 92.491667  | 29300    |\n\nRelated functions: [quarterEnd](https://docs.dolphindb.com/en/Functions/q/quarterEnd.html), [businessQuarterBegin](https://docs.dolphindb.com/en/Functions/b/businessQuarterBegin.html), [businessQuarterEnd](https://docs.dolphindb.com/en/Functions/b/businessQuarterEnd.html)\n"
    },
    "quarterEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/q/quarterEnd.html",
        "signatures": [
            {
                "full": "quarterEnd(X, [endingMonth=12], [offset], [n=1])",
                "name": "quarterEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[endingMonth=12]",
                        "name": "endingMonth",
                        "optional": true,
                        "default": "12"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [quarterEnd](https://docs.dolphindb.com/en/Functions/q/quarterEnd.html)\n\n\n\n#### Syntax\n\nquarterEnd(X, \\[endingMonth=12], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first day of the quarter that *X* belongs to. The first months of the quarters are determined by *startingMonth*.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates dates based on periods consisting of *n* quarters. In this case, offset determines how the multi-quarter periods are aligned. Specifically, the system first calculates the end date of the quarter containing *offset* according to *endingMonth*, and uses that date as the reference point. A new period-ending boundary is then generated every *n* quarters, and the function returns the last day corresponding to the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**endingMonth** is an integer between 1 and 12 specifies the ending month of the last quarter in a year. The default value is 12, which represents calendar quarters. For example, when `endingMonth = 3`, the quarters are defined as April–June, July–September, October–December, and January–March of the following year.\n\n**offset** is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** is a positive integer. The default value is 1.\n\n#### Returns\n\nA DOUBLE scalar/vector.\n\n#### Examples\n\n```\nquarterEnd(2012.06.12);\n// output: 2012.06.30\n\nquarterEnd(2012.06.13 10:10:10.008,5);\n// output: 2012.08.31\n\ndate=2016.01.12 2016.02.25 2016.05.12 2016.06.28 2016.07.10 2016.08.18 2016.09.02 2016.10.16 2016.11.26 2016.12.30\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by quarterEnd(date,12,2016.01.01,2)\n```\n\n| quarterEnd\\_date | avg\\_price | sum\\_qty |\n| ---------------- | ---------- | -------- |\n| 2016.03.31       | 39.53      | 4100     |\n| 2016.09.30       | 92.1       | 18800    |\n| 2017.03.31       | 51.33      | 15800    |\n\nRelated functions: [quarterBegin](https://docs.dolphindb.com/en/Functions/q/quarterBegin.html), [businessQuarterBegin](https://docs.dolphindb.com/en/Functions/b/businessQuarterBegin.html), [businessQuarterEnd](https://docs.dolphindb.com/en/Functions/b/businessQuarterEnd.html)\n"
    },
    "quarterOfYear": {
        "url": "https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html",
        "signatures": [
            {
                "full": "quarterOfYear(X)",
                "name": "quarterOfYear",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html)\n\n\n\n#### Syntax\n\nquarterOfYear(X)\n\n#### Details\n\nFor each element in *X*, return a number from 1 to 4 indicating which quarter of the year it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, MONTH, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nAn integer scalar/vector.\n\n#### Examples\n\n```\nquarterOfYear(2012.07.02);\n// output: 3\n\nquarterOfYear([2012.06.12T12:30:00,2012.10.28T12:35:00,2013.01.06T12:36:47,2013.04.06T08:02:14]);\n// output: [2,4,1,2]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "pack": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pack.html",
        "signatures": [
            {
                "full": "pack(format, args…)",
                "name": "pack",
                "parameters": [
                    {
                        "full": "format",
                        "name": "format"
                    },
                    {
                        "full": "args…",
                        "name": "args…"
                    }
                ]
            }
        ],
        "markdown": "### [pack](https://docs.dolphindb.com/en/Functions/p/pack.html)\n\n\n\n#### Syntax\n\npack(format, args…)\n\n#### Details\n\nPacks the data into a binary byte stream according to the format specified by *format*.\n\n#### Parameters\n\n**format** is a format string. See **Appendix: Format Characters**.\n\n* A format character may be preceded by an integral repeat count. For example, the format string *4h* means exactly the same as *hhhh*.\n\n* Whitespace characters between formats are ignored; a count and its format must not contain whitespace though.\n\n* For the *s* format character, the count is interpreted as the length of the bytes, not a repeat count like for the other format characters; for example, *10s* means a single 10-byte string, while *10c* means 10 characters. If a count is not given, it defaults to 1. The string is truncated or padded with null bytes as appropriate to make it fit.\n\n**args...** The data to be packed. The arguments must match the values required by the format exactly.\n\n#### Returns\n\nReturns a bytes object packed according to the format string format.\n\n#### Examples\n\n```\nres = pack(\"N\",1);\nres1 = unpack(\"N\", res);\nprint(res1)\n// output: (1)\n\nres = pack(\"iii\", 1, 2, 3)\nres1 = unpack(\"iii\",  res);\nprint(res1)\n// output: (1,2,3)\n\nres = pack(\"x\",NULL)\nres = unpack(\"x\",pack(\"x\",NULL))\ntypestr(res[0])\n// output: VOID\n\nres = pack(\"3si\", `123, 3)\nres1 = unpack(\"3si\",  res);\nprint(res1)\n// output: (\"123\",3)\n```\n\nRelated function: [unpack](https://docs.dolphindb.com/en/Functions/u/unpack.html)\n\n#### Appendix\n\n##### Format Characters\n\nFormat mapping:\n\n| Format | C Type             | Python Type       | DolphinDB Type | Range                    |\n| ------ | ------------------ | ----------------- | -------------- | ------------------------ |\n| x      | pad byte           | no value          | VOID           |                          |\n| c      | char               | bytes of length 1 | CHAR           | -27 +1\\~27 -1            |\n| b      | signed char        | integer           | LONG           | -27 \\~27 -1              |\n| B      | unsigned char      | integer           | LONG           | 0\\~28 -1                 |\n| ?      | \\_Bool             | bool              | LONG           | -263 \\~263 -1            |\n| h      | short              | integer           | LONG           | -215 \\~215 -1            |\n| H      | unsigned short     | integer           | LONG           | 0\\~216 -1                |\n| i      | int                | integer           | LONG           | -231 \\~231 -1            |\n| I      | unsigned int       | integer           | LONG           | 0\\~232 -1                |\n| l      | long               | integer           | LONG           | -231\\~231 -1             |\n| L      | unsigned long      | integer           | LONG           | 0\\~232 -1                |\n| q      | long long          | integer           | LONG           | -263 \\~263 -1            |\n| Q      | unsigned long long | integer           | LONG           | 0\\~263 -1                |\n| n      | ssize\\_t           | integer           | LONG           | -263 \\~263 -1            |\n| N      | size\\_t            | integer           | LONG           | 0\\~263 -1                |\n| f      | float              | float             | LONG           | -3.40E+38 \\~ +3.40E+38   |\n| d      | double             | float             | LONG           | -1.79E+308 \\~ +1.79E+308 |\n| s      | char\\[]            | bytes             | STRING         |                          |\n| p      | char\\[]            | bytes             | STRING         |                          |\n| P      | void\\*             | integer           | LONG           | -263 \\~263 -1            |\n\n##### Byte Order, Size, and Alignment\n\n| Character      | Byte order    | Size     | Alignment |\n| -------------- | ------------- | -------- | --------- |\n| >              | big-endian    | standard | none      |\n| =              | native        | standard | none      |\n| <              | little-endian | standard | none      |\n| @              | native        | native   | native    |\n| !              | network       |          |           |\n| (= big-endian) | native        | none     |           |\n\nThe first character of the format string can be used to indicate the byte order, size and alignment of the packed data, see \"Appendix: Byte Order, Size and Alignment\". If the first character is not one of these characters, '@' is assumed.\n"
    },
    "pair": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pair.html",
        "signatures": [
            {
                "full": "pair(a, b)",
                "name": "pair",
                "parameters": [
                    {
                        "full": "a",
                        "name": "a"
                    },
                    {
                        "full": "b",
                        "name": "b"
                    }
                ]
            }
        ],
        "markdown": "### [pair](https://docs.dolphindb.com/en/Functions/p/pair.html)\n\n\n\n#### Syntax\n\npair(a, b) or a:b\n\n#### Details\n\nReturn a data pair.\n\n#### Parameters\n\n**a** and **b** must be scalar.\n\n#### Returns\n\nReturns a data pair with the same type as *a*/*b*.\n\n#### Examples\n\n```\n1:3+1;\n// output: 2:4\n\n1:3<0:6;\n// output: 0 : 1\n```\n"
    },
    "panel": {
        "url": "https://docs.dolphindb.com/en/Functions/p/panel.html",
        "signatures": [
            {
                "full": "panel(row, col, metrics, [rowLabel], [colLabel], [parallel=false])",
                "name": "panel",
                "parameters": [
                    {
                        "full": "row",
                        "name": "row"
                    },
                    {
                        "full": "col",
                        "name": "col"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "[rowLabel]",
                        "name": "rowLabel",
                        "optional": true
                    },
                    {
                        "full": "[colLabel]",
                        "name": "colLabel",
                        "optional": true
                    },
                    {
                        "full": "[parallel=false]",
                        "name": "parallel",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [panel](https://docs.dolphindb.com/en/Functions/p/panel.html)\n\n\n\n#### Syntax\n\npanel(row, col, metrics, \\[rowLabel], \\[colLabel], \\[parallel=false])\n\n#### Details\n\nRearrange *metrics* as a matrix (or multiple matrices). For each vector in *metrics*, return a matrix.\n\nFunction `panel` is similar to SQL [pivotBy](https://docs.dolphindb.com/en/Programming/SQLStatements/pivotBy.html) clause in that they can both rearrange data as a matrix based on 2 dimensions. The difference is that `exec... pivot by...` can only convert one column into a matrix whereas function `panel` can convert one or multiple columns into one or multiple matrices.\n\n#### Parameters\n\n**row** is a vector. Each element corresponds to a row in a matrix in the result.\n\n**col** is a vector. Each element corresponds to a column in a matrix in the result.\n\n**metrics** is one or multiple vectors. Each vector in metrics corresponds to a matrix in the result.\n\n**rowLabel** is a vector of row labels for the matrix (or matrices) in the result. It is composed of distinct values in ascending order. The result only includes the rows specified in *rowLabel*.\n\n**colLabel** is a vector of column labels for the matrix (or matrices) in the result. It is composed of distinct values in ascending order. The result only includes the columns specified in *colLabel*.\n\n**parallel** is a Boolean value indicating whether to conduct parallel computing. The default value is false.\n\n#### Returns\n\nReturns one or multiple matrices.\n\n#### Examples\n\n```\nt = table(1 1 2 2 2 3 3 as id, 2020.09.01 + 1 3 1 2 3 2 3 as date, 1..7 as value);\nt;\n```\n\n| id | date       | value |\n| -- | ---------- | ----- |\n| 1  | 2020.09.02 | 1     |\n| 1  | 2020.09.04 | 2     |\n| 2  | 2020.09.02 | 3     |\n| 2  | 2020.09.03 | 4     |\n| 2  | 2020.09.04 | 5     |\n| 3  | 2020.09.03 | 6     |\n| 3  | 2020.09.04 | 7     |\n\n```\npanel(row=t.date, col=t.id, metrics=t.value);\n```\n\n|            | 1 | 2 | 3 |\n| ---------- | - | - | - |\n| 2020.09.02 | 1 | 3 |   |\n| 2020.09.03 |   | 4 | 6 |\n| 2020.09.04 | 2 | 5 | 7 |\n\n```\npanel(row=t.date, col=t.id, metrics=t.value, rowLabel=2020.09.02 2020.09.03, colLabel=1 2);\n```\n\n|            | 1 | 2 |\n| ---------- | - | - |\n| 2020.09.02 | 1 | 3 |\n| 2020.09.03 |   | 4 |\n\n```\npanel(row=t.date, col=t.id, metrics=[t.value, t.value>0], rowLabel=2020.09.02 2020.09.03, colLabel=1 2);\n```\n\n|            | 1 | 2 |\n| ---------- | - | - |\n| 2020.09.02 | 1 | 3 |\n| 2020.09.03 |   | 4 |\n\n|            | 1 | 2 |\n| ---------- | - | - |\n| 2020.09.02 | 1 | 1 |\n| 2020.09.03 |   | 1 |\n\nCalculate the cumulative maximum price of each stock from the matrix generated by function `panel`.\n\n```\nsyms = \"sym\"+string(1..2)\ndates = 2021.12.07..2021.12.11\nt = table(loop(take{, size(syms)}, dates).flatten() as trade_date,  take(syms, size(syms)*size(dates)) as code, rand(1000, (size(syms)*size(dates))) as volume)\nvolume = panel(row=t.trade_date, col=t.code, metrics=t.volume, rowLabel=dates)\ncummax(volume)\n```\n"
    },
    "parseExpr": {
        "url": "https://docs.dolphindb.com/en/Functions/p/parseExpr.html",
        "signatures": [
            {
                "full": "parseExpr(X, [varDict], [modules], [overloadedOperators])",
                "name": "parseExpr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[varDict]",
                        "name": "varDict",
                        "optional": true
                    },
                    {
                        "full": "[modules]",
                        "name": "modules",
                        "optional": true
                    },
                    {
                        "full": "[overloadedOperators]",
                        "name": "overloadedOperators",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [parseExpr](https://docs.dolphindb.com/en/Functions/p/parseExpr.html)\n\n\n\n#### Syntax\n\nparseExpr(X, \\[varDict], \\[modules], \\[overloadedOperators])\n\n#### Details\n\nConvert string into metacode, which can be executed by function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html).\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n**varDict** is an optional parameter, which is a dictionary. If *varDict* is specified, while parsing by function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html) , the variable in *X* will be parsed as the key of *varDict*. And the value of this variable is the value of *varDict*.\n\n**modules** is an optional parameter which can be a string or an array of strings, indicating the name of the module to be loaded.\n\n**overloadedOperators** is an optional parameter, which is a dictionary. The operators are mapped to a function. The key must be a string scalar, and the value must be a binary function.\n\n#### Returns\n\n* When *X* is a scalar, it returns a CODE scalar.\n* When *X* is a vector, it returns a vector composed of CODE values.\n\n#### Examples\n\n```\na=parseExpr(\"1+2\")\na;\n// output: < 1 + 2 >\n\ntypestr(a);\n// output: CODE\n\na.eval();\n// output: 3\n```\n\nParse JSON strings into dictionaries:\n\n```\njson1 = '{\"f2\":10.71,\"f12\":\"000001\"},{\"f2\":7.24,\"f12\":\"000002\"}'\nparseExpr(json1).eval()\n\n/*\noutput:\nf2->10.71\nf12->000001\n*/\n```\n\n```\nt=table(1 2 3 4 as id, 5 6 7 8 as value, `IBM`MSFT`IBM`GOOG as name);\nparseExpr(\"select * from t where name='IBM'\").eval();\n```\n\n| id | value | name |\n| -- | ----- | ---- |\n| 1  | 3     | IBM  |\n| 3  | 7     | IBM  |\n\nWhen function `parseExpr` parses variables, it first searches local variables, and then searches shared variables. It does not, however, search local variables within function definition.\n\n```\ndef myfunc(){\n    t3 = table(1..100 as id)\n    return parseExpr(\"select * from t3 where id in 1..5\").eval()\n}\n\nmyfunc()\n```\n\nThe script above produces the following error message:\n\n```\nmyfunc() => myfunc: return ::evaluate(parseExpr(\"select * from t3 where id in 1..5\")) => Can't find the object with name t3\n```\n\nFor this issue, we can use function [sql](https://docs.dolphindb.com/en/Functions/s/sql.html) to dynamically generate SQL statements:\n\n```\ndef myfunc(){\nt3 = table(1..100 as id)\nreturn sql(sqlCol(\"*\"), t3, <id in 1..5>).eval()\n}\nmyfunc();\n```\n\n| id |\n| -- |\n| 1  |\n| 2  |\n| 3  |\n| 4  |\n| 5  |\n\nPass in the variables and values in the expression in the form of a dictionary, and assigning a value to the key of this dict is equivalent to assign a value to the variable.\n\n```\nd = dict(`a`b`c, (1, 2, 3))\nparseExpr(\"a + b*c\", d).eval()\n// output: 7\n\nd[`a] = 5;\nparseExpr(\"a + b*c\", d).eval()\n// output: 11\n```\n\nThe following example explains how to use functions in expressions. Because the variable \"first\" is not stored in dict, \"first\" is directly treated as a function when parsed.\n\n```\nindex = [2000.01.01, 2000.01.31, 2000.02.15, 2000.02.20, 2000.03.12, 2000.04.16, 2000.05.06, 2000.08.30]\ns = indexedSeries(index, 1..8)\nd1 =  dict(STRING, ANY)\nd1[\"S\"] = s\nparseExpr(\"resample(S, `M, first)\", d1).eval()\n```\n\nFunction `add` is defined in the test module under the modules directory. It is used to call the function in the module and map the binary operator \"+\" to a new function by specifying the parameter *overloadedOperators* at the same time. When the code is executed, the expression with operator \"+\" will be calculated according to the new definition.\n\n```\nparseExpr(\"test::add(1,2)+2\", modules=\"test\", overloadedOperators={\"+\": def(a, b){return a - b}}).eval()\n// output: 1\n```\n\nRelated functions: [expr](https://docs.dolphindb.com/en/Functions/e/expr.html), [eval](https://docs.dolphindb.com/en/Functions/e/eval.html)\n"
    },
    "parseInstrument": {
        "url": "https://docs.dolphindb.com/en/Functions/p/parseInstrument.html",
        "signatures": [
            {
                "full": "parseInstrument(obj)",
                "name": "parseInstrument",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [parseInstrument](https://docs.dolphindb.com/en/Functions/p/parseInstrument.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nparseInstrument(obj)\n\n#### Details\n\nParse the instrument description *obj* into an INSTRUMENT object for modeling and pricing. See Supported Instruments and Fields for details.\n\nNote: `parseInstrument` preserves non-standard scalar or vector fields (i.e., fields not defined as attributes of the financial instrument) during serialization or deserialization.\n\n#### Parameters\n\n**obj** is a dictionary, a tuple of dictionaries, an in-memory table, or a STRING scalar/vector, indicating the financial instrument description to be parsed.\n\n**Note**: If *obj* is specified as a table, it must store instruments of a single type.\n\n#### Returns\n\nAn INSTRUMENT object.\n\n#### Examples\n\nStore the description of a coupon bond in a dictionary and use `parseInstrument` to parse it into an INSTRUMENT object.\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"230205.IB\",\n    \"start\": \"2023.03.06\",\n    \"maturity\": \"2033.03.06\",\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.0302,\n    \"calendar\": \"CFET\",\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"subType\": \"CDB_BOND\",\n    \"issuer\": \"CDB\"\n}\nparseInstrument(bond)\n```\n\nParse a tuple of dictionaries and obtain INSTRUMENT objects for three bonds.\n\n```\nbond1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"DiscountBond\",\n    \"instrumentId\": \"259924.IB\",\n    \"start\": 2025.04.17,\n    \"maturity\": 2025.07.17,\n    \"issuePrice\": 99.664,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"subType\": \"TREASURY_BOND\",\n    \"issuer\": \"MOF\"\n}\n\nbond2 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"250401.IB\",\n    \"start\": 2025.01.09,\n    \"maturity\": 2026.02.05,\n    \"coupon\": 0.0119,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"subType\": \"CDB_BOND\",\n    \"issuer\": \"ADBC\"\n}\n\nparseInstrument([bond,bond1,bond2])\n```\n\nStore instrument descriptions in a table, with each column representing a field. Use `parseInstrument` to parse it and obtain an INSTRUMENT object.\n\n**Note**: If a product is missing a field required by the table columns, set that field to NULL when inserting the product into the table.\n\n```\ncreate table t (\n    productType STRING,\n    assetType STRING,\n    bondType STRING,\n    version INT,\n    instrumentId STRING,\n    start DATE,\n    maturity DATE,\n    issuePrice DOUBLE,\n    coupon DOUBLE,\n    calendar STRING,\n    frequency STRING,\n    dayCountConvention STRING,\n    subType STRING,\n    issuer STRING\n)\ngo\n\ninsert into t values( \"Cash\", \"Bond\", \"FixedRateBond\", 0, \"230205.IB\", 2023.03.06, 2033.03.06, 100.0, 0.0302, \"CFET\", \"Annual\", \"ActualActualISDA\", \"CDB_BOND\", \"CDB\")\ninsert into t values( \"Cash\", \"Bond\", \"DiscountBond\", 0, \"259924.IB\", 2025.04.17, 2025.07.17, 99.664, NULL, NULL, NULL, \"ActualActualISDA\", \"TREASURY_BOND\", \"MOF\")\ninsert into t values( \"Cash\", \"Bond\", \"ZeroCouponBond\", 0, \"250401.IB\", 2025.01.09, 2026.02.05, NULL, 0.0119, NULL, NULL, \"ActualActualISDA\", \"CDB_BOND\", \"ADBC\")\n\nparseInstrument(t)\n```\n\nWhen *obj* is a STRING scalar:\n\n```\nbond1Str = '{\"productType\": \"Cash\",\"assetType\": \"Bond\",\"bondType\": \"FixedRateBond\",\"coupon\": 0.0302,\"frequency\": \"Annual\",\"version\": 0,\"instrumentId\": \"230205.IB\",\"nominal\": 100,\"start\": \"2023.03.06\",\"maturity\": \"2033.03.06\",\"dayCountConvention\": \"ActualActualISDA\",\"calendar\": \"CFET\",\"currency\": \"CNY\",\"cashflow\": [{\"paymentDate\": \"2024.03.06\",\"coupon\": 3.026804551238871,\"notional\": 0,\"total\": 3.026804551238871},{\"paymentDate\": \"2025.03.06\",\"coupon\": 3.01319544876113,\"notional\": 0,\"total\": 3.01319544876113},{\"paymentDate\": \"2026.03.06\",\"coupon\": 3.02,\"notional\": 0,\"total\": 3.02},{\"paymentDate\": \"2027.03.06\",\"coupon\": 3.02,\"notional\": 0,\"total\": 3.02},{\"paymentDate\": \"2028.03.06\",\"coupon\": 3.026804551238871,\"notional\": 0,\"total\": 3.026804551238871},{\"paymentDate\": \"2029.03.06\",\"coupon\": 3.01319544876113,\"notional\": 0,\"total\": 3.01319544876113},{\"paymentDate\": \"2030.03.06\",\"coupon\": 3.02,\"notional\": 0,\"total\": 3.02},{\"paymentDate\": \"2031.03.06\",\"coupon\": 3.02,\"notional\": 0,\"total\": 3.02},{\"paymentDate\": \"2032.03.06\",\"coupon\": 3.026804551238871,\"notional\": 0,\"total\": 3.026804551238871},{\"paymentDate\": \"2033.03.06\",\"coupon\": 3.01319544876113,\"notional\": 100,\"total\": 103.013195448761123}],\"discountCurve\": \"\",\"spreadCurve\": \"\",\"subType\": \"CDB_BOND\",\"issuePrice\": 100,\"issuer\": \"CDB\"}'\n\nparseInstrument(bond1Str)\n```\n\nWhen *obj* is a STRING vector, parse it and obtain multiple INSTRUMENT objects:\n\n```\nbond2Str = '{\"productType\": \"Cash\",\"assetType\": \"Bond\",\"bondType\": \"DiscountBond\",\"issuePrice\": 99.664000000000001,\"version\": 0,\"instrumentId\": \"259924.IB\",\"nominal\": 100,\"start\": \"2025.04.17\",\"maturity\": \"2025.07.17\",\"dayCountConvention\": \"ActualActualISDA\",\"calendar\": \"\",\"currency\": \"CNY\",\"cashflow\": [{\"paymentDate\": \"2025.07.17\",\"coupon\": 0,\"notional\": 100,\"total\": 100}],\"discountCurve\": \"\",\"spreadCurve\": \"\",\"subType\": \"TREASURY_BOND\",\"issuer\": \"MOF\"}'\nbond3Str = '{\"productType\": \"Cash\",\"assetType\": \"Bond\",\"bondType\": \"ZeroCouponBond\",\"coupon\": 0.0119,\"version\": 0,\"instrumentId\": \"250401.IB\",\"nominal\": 100,\"start\": \"2025.01.09\",\"maturity\": \"2026.02.05\",\"dayCountConvention\": \"ActualActualISDA\",\"calendar\": \"\",\"currency\": \"CNY\",\"cashflow\": [{\"paymentDate\": \"2026.01.09\",\"coupon\": 1.190000000000002,\"notional\": 0,\"total\": 1.190000000000002},{\"paymentDate\": \"2026.02.05\",\"coupon\": 0.088027397260282,\"notional\": 100,\"total\": 100.088027397260276}],\"discountCurve\": \"\",\"spreadCurve\": \"\",\"subType\": \"CDB_BOND\",\"issuer\": \"CDB\"}'\n\nparseInstrument([bond1Str,bond2Str,bond3Str])\n```\n\n#### Supported Instruments and Fields\n\nThe INSTRUMENT type is newly introduced in DolphinDB version 3.00.4, designed to store financial instruments and provide a foundation for pricing and risk measurement of financial products.\n\nThe `parseInstrument` function generates corresponding instrument objects based on the fields of the instrument description. Currently, only instrument types illustrated as leaf nodes in the classification tree below are supported:\n\n![](https://docs.dolphindb.com/en/Functions/images/parseInstrument.png)\n\n##### Discount Bond (DiscountBond)\n\n<table id=\"table_lhn_twl_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"DiscountBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nissuePrice\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nIssue price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>Define an INSTRUMENT object of DiscountBond type.\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"DiscountBond\",\n    \"instrumentId\": \"259924.IB\",\n    \"start\": 2025.04.17,\n    \"maturity\": 2025.07.17,\n    \"issuePrice\": 99.664,\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\ninstrument = parseInstrument(bond)\nprint(instrument)\n```\n\n##### Zero Coupon Bond (ZeroCouponBond)\n\n<table id=\"table_ijm_xwl_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"ZeroCouponBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncoupon\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nCoupon rate, e.g., 0.03 means 3%\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFrequency of interest payment\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>Define an INSTRUMENT object of ZeroCouponBond type.\n\n```\ndict = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"ZeroCouponBond\",\n    \"instrumentId\": \"250401.IB\",\n    \"start\": 2025.01.09,\n    \"maturity\": 2026.02.05,\n    \"coupon\": 0.0119,\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\n```\n\n##### Fixed Rate Bond (FixedRateBond)\n\n<table id=\"table_atl_1xl_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Cash\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Bond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nbondType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FixedRateBond\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnominal\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNominal amount, defalut 100\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nBond code, e.g., \"259926.IB\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncoupon\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nCoupon rate, e.g., 0.03 means 3%\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFrequency of interest payment\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency, defaults to \"CNY\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncashFlow\n\n</td><td>\n\nTABLE\n\n</td><td>\n\nCash flow table\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve, e.g., \"CNY\\_TRASURY\\_BOND\"\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nspreadCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe credit spread curve\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nsubType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSubtypes. China's bonds include:\n\n* \"TREASURY\\_BOND\": Treasury Bonds\n\n* \"CENTRAL\\_BANK\\_BILL\": Central Bank Bills\n\n* \"CDB\\_BOND\": Policy Bank Financial Bonds (China Development Bank)\n\n* \"EIBC\\_BOND\": Policy Bank Financial Bonds (Export-Import Bank of China)\n\n* \"ADBC\\_BOND\": Policy Bank Financial Bonds (Agricultural Development Bank of China)\n\n* \"MTN\": Medium-term Notes\n\n* \"CORP\\_BOND\": Corporate Bonds\n\n* \"UNSECURED\\_CORP\\_BOND\": Unsecured Corporate Bonds\n\n* \"SHORT\\_FIN\\_BOND\": Short-term Financing Bills\n\n* \"NCD\": Negotiable Certificates of Deposit\n\n* \"LOC\\_GOV\\_BOND\": Local Government Bonds\n\n* \"COMM\\_BANK\\_FIN\\_BOND\": Commercial Bank Financial Bonds\n\n* \"BANK\\_SUB\\_CAP\\_BOND\": Bank Subordinated Capital Bonds\n\n* \"ABS\": Asset-backed Securities\n\n* \"PPN\": Privately Offered Bonds\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncreditRating\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCredit rating. It can be: \"B\", \"BB\", \"BBB\", \"BBB+\", \"A-\", \"A\", \"A+\", \"AA-\", \"AA\", \"AA+\", \"AAA-\", \"AAA\", \"AAA+\"\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>Define an INSTRUMENT object of FixedRateBond type.\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"240021.IB\",\n    \"start\": 2024.10.25,\n    \"maturity\": 2025.10.25,\n    \"issuePrice\": 100,\n    \"coupon\": 0.0133,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\ninstrument = parseInstrument(bond)\nprint(instrument)\n```\n\n##### Bond Futures (BondFutures)\n\n| Field Name        | Data Type  | Description                                                             | Required |\n| ----------------- | ---------- | ----------------------------------------------------------------------- | -------- |\n| productType       | STRING     | Must be \"Futures\"                                                       | √        |\n| futuresType       | STRING     | Must be \"BondFutures\"                                                   | √        |\n| nominal           | DOUBLE     | Nominal amount, defalut 100                                             | ×        |\n| instrumentId      | STRING     | Bond future code, e.g., \"T2509\"                                         | ×        |\n| maturity          | DATE       | Maturity date                                                           | √        |\n| settlement        | DATE       | Settlement date                                                         | √        |\n| underlying        | Dictionary | Fixed-rate bond structure, indicating the underlying deliverable bonds. | √        |\n| nominalCouponRate | DOUBLE     | Nominal coupon rate                                                     | √        |\n\nDefine an INSTRUMENT object of BondFutures type.\n\n```\nbond ={\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"220010.IB\",\n    \"start\": 2020.12.25,\n    \"maturity\": 2031.12.25,\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.0149,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n}\n\nfutures =  {\n    \"productType\": \"Futures\",\n    \"futuresType\": \"BondFutures\",\n    \"instrumentId\": \"T2509\",  //Future code\n    \"nominal\": 100.0,\n    \"maturity\": \"2022.09.09\",\n    \"settlement\": \"2022.09.11\",\n    \"underlying\": bond,\n    \"nominalCouponRate\": 0.03  //Nominal coupon rate corresponding to the bond futures. You can get it from the China Financial Futures Exchange (CFFEX).\n}\ninstrument = parseInstrument(futures)\nprint(instrument)\n```\n\n##### Deposit (Deposit)\n\n| Field Name         | Data Type | Description                                                                                           | Required |\n| ------------------ | --------- | ----------------------------------------------------------------------------------------------------- | -------- |\n| productType        | STRING    | Must be \"Cash\"                                                                                        | √        |\n| assetType          | STRING    | Must be \"Deposit\"                                                                                     | √        |\n| notionalAmount     | DOUBLE    | Notional principal amount                                                                             | √        |\n| notionalCurrency   | STRING    | Notional principal                                                                                    | √        |\n| instrumentId       | STRING    | Deposit reference rate index, e.g., \"SHIBOR\\_3M\"                                                      | ×        |\n| start              | DATE      | Value date                                                                                            | √        |\n| maturity           | DATE      | Maturity date                                                                                         | √        |\n| rate               | DOUBLE    | Deposit interest rate                                                                                 | √        |\n| dayCountConvention | STRING    | The day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\" | √        |\n| payReceive         | STRING    | Pay/Receive indicator: \"Pay\" indicates paying; \"Receive\" indicates receiving.                         | √        |\n| discountCurve      | STRING    | The domestic discount curve. The default is \"CNY\\_FR\\_007\" for CNY.                                   | ×        |\n| calendar           | STRING    | Trading calendar                                                                                      | ×        |\n\nDefine an INSTRUMENT object of Deposit type.\n\n```\ndeposit =  {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"start\": 2025.05.15,\n    \"maturity\": 2025.08.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E6,\n    \"payReceive\": \"Receive\"\n}\ninstrument = parseInstrument(deposit)\nprint(instrument)\n```\n\n##### IR Fixed-Floating Swap (IrFixedFloatingSwap)\n\n<table id=\"table_fkl_jxl_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Swap\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nswapType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrSwap\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nirSwapType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrFixedFloatingSwap\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalAmount\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNotional principal amount\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalCurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nNotional principal\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nIR fixed-floating swap name. It can be \"CNY\\_FR\\_007 or \"CNY\\_SHIBOR\\_3M\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nstart\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfixedRate\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nFixed-rate\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncalendar\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nTrading calendar\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfixedDayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfloatingDayCountConvetion\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nspread\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nInterest rate spread\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\niborIndex\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFloating reference rate. It can be \"FR\\_007\" or \"SHIBOR\\_3M\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nFrequency of interest payment\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\npayReceive\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nPay/Receive indicator\n\n* \"Pay\": pay fixed interest rate/ receive floating interest rate\n\n* \"Receive\": receive fixed interest rate/ pay floating interest rate\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndiscountCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nforwardCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nName of the forward curve used to project future floating rates\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>Define an INSTRUMENT object of IrFixedFloatingSwap type.\n\n```\nswap =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2021.05.15,\n    \"maturity\": 2023.05.15,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.02,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual360\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"SHIBOR_3M\",\n    \"spread\": 0.0005,\n    \"notionalCurrency\": \"CNY\",\n    \"notionalAmount\": 1E8\n}\ninstrument = parseInstrument(swap)\nprint(instrument)\n```\n\n##### Foreign Exchange Forward (FxForward)\n\n<table id=\"table_snc_mxl_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nProduct name. It must be \"Forward\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nforwardType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nForeign exchange forward type. It must be \"FxForward\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalAmount\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNotional principal amount\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalCurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nNotional principal\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInstrumentId ID\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nexpiry\n\n</td><td>\n\nDATE\n\n</td><td>\n\nValue date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndelivery\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrencyPair\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe currency pair, in the format \"EURUSD\", \"EUR.USD\", or \"EUR/USD\". Supported currency pairs include:\n\n* \"EURUSD\": Euro to US Dollar\n\n* \"USDCNY\": US Dollar to Chinese Yuan\n\n* \"EURCNY\": Euro to Chinese Yuan\n\n* \"GBPCNY\": British Pound to Chinese Yuan\n\n* \"JPYCNY\": Japanese Yen to Chinese Yuan\n\n* \"HKDCNY\": Hong Kong Dollar to Chinese Yuan\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndirection\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nTrading direction, can be \"Buy\" or \"Sell\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nstrike\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nStrike price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndomesticCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe domestic discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nforeignCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe foreign discount curve name\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>Define an INSTRUMENT object of FxForward type.\n\n```\nforward =  {\n   \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.09.24,\n    \"delivery\": 2025.09.26,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E8,\n    \"strike\": 7.2\n}\ninstrument = parseInstrument(forward)\nprint(instrument)\n```\n\n##### Foreign Exchange Swap (FxSwap)\n\n<table id=\"table_fz5_4xl_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nProduct name. It must be \"Swap\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nswapType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nForeign exchange swap type. It must be \"FxSwap\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalAmount\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNotional principal amount\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalCurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nNotional principal\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurrencyPair\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe currency pair, in the format \"EURUSD\", \"EUR.USD\", or \"EUR/USD\". Supported currency pairs include:\n\n* \"EURUSD\": Euro to US Dollar\n\n* \"USDCNY\": US Dollar to Chinese Yuan\n\n* \"EURCNY\": Euro to Chinese Yuan\n\n* \"GBPCNY\": British Pound to Chinese Yuan\n\n* \"JPYCNY\": Japanese Yen to Chinese Yuan\n\n* \"HKDCNY\": Hong Kong Dollar to Chinese Yuan\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnearExpiry\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date for the near leg\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnearDelivery\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date for the near leg\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndirection\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nTrading direction, can be\n\n* \"Buy\": Buy the foreign currency on the near leg and sell it on the far leg.\n\n* \"Sell\": Sell the foreign currency on the near leg and buy it back on the far leg.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnearStrike\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nStrike price for the near leg\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfarExpiry\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date for the far leg\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfarDelivery\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date for the far leg\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nfarStrike\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nStrike price for the far leg\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndomesticCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe domestic discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nforeignCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe foreign discount curve name\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>Define an INSTRUMENT object of FxSwap type.\n\n```\nswap = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURUSD\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 1.1,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 1.2,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\ninstrument = parseInstrument(swap)\nprint(instrument)\n```\n\n##### Fx European Style Option (FxEuropeanOption)\n\n<table id=\"table_pmm_rxl_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nproductType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Option\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\noptionType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"EuropeanOption\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nassetType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FxEuropeanOption\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalAmount\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nNotional principal amount\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nnotionalCurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nNotional principal\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninstrumentId\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInstrumentId ID\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nmaturity\n\n</td><td>\n\nDATE\n\n</td><td>\n\nMaturity date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nunderlying\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe currency pair, in the format \"EURUSD\", \"EUR.USD\", or \"EUR/USD\". Supported currency pairs include:\n\n* \"EURUSD\": Euro to US Dollar\n\n* \"USDCNY\": US Dollar to Chinese Yuan\n\n* \"EURCNY\": Euro to Chinese Yuan\n\n* \"GBPCNY\": British Pound to Chinese Yuan\n\n* \"JPYCNY\": Japanese Yen to Chinese Yuan\n\n* \"HKDCNY\": Hong Kong Dollar to Chinese Yuan\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndirection\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nTrading direction, can be \"Buy\" or \"Sell\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nstrike\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nStrike price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention. It can be: \"ActualActualISDA\", \"ActualActualISMA\",\" Actual365\", \"Actual360\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\npayoffType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nPayoff type. It can be \"Call\" or \"Put\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndomesticCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe domestic discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nforeignCurve\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe foreign discount curve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ndelivery\n\n</td><td>\n\nDATE\n\n</td><td>\n\nThe delivery date\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>**Note:**\n\nThe delivery field is supported starting from version 2.\n\nWhen upgrading data from versions earlier than version 2 to version 2 or later, missing delivery fields in existing records will be automatically populated with maturity + 2.\n\nDefine an INSTRUMENT object of FxEuropeanOption type.\n\n```\noption =  {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1000000.0,\n    \"strike\": 1.2,\n    \"maturity\": \"2025.10.08\",\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"EURUSD\"\n}\ninstrument = parseInstrument(option)\nprint(instrument)\n```\n\n**Related functions:** [bondPricer](https://docs.dolphindb.com/en/Functions/b/bondPricer.html) (Bond Pricing), [irDepositPricer](https://docs.dolphindb.com/en/Functions/i/irDepositPricer.html) (Deposit Pricing), [bondFuturesPricer](https://docs.dolphindb.com/en/Functions/b/bondFuturesPricer.html) (Treasury Futures Pricing), [fxForwardPricer](https://docs.dolphindb.com/en/Functions/f/fxForwardPricer.html) (FX Forward Pricing), [fxSwapPricer](https://docs.dolphindb.com/en/Functions/f/fxSwapPricer.html) (FX Swap Pricing), [irFixedFloatingSwapPricer](https://docs.dolphindb.com/en/Functions/i/irFixedFloatingSwapPricer.html) (IR Fixed-Floating Swap Pricing), [fxEuropeanOptionPricer](https://docs.dolphindb.com/en/Functions/f/fxEuropeanOptionPricer.html) (FX European Option Pricing)\n\n##### American Commodity Futures Options (cmFutAmericanOption)\n\n| Field Name         | Type   | Description                                                                                                                                                                 | Required |\n| ------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| productType        | STRING | Fixed value: \"Option\"                                                                                                                                                       | Yes      |\n| optionType         | STRING | Fixed value: \"AmericanOption\"                                                                                                                                               | Yes      |\n| assetType          | STRING | Fixed value: \"CmFutAmericanOption\"                                                                                                                                          | Yes      |\n| notionalAmount     | DOUBLE | Notional principal amount                                                                                                                                                   | Yes      |\n| notionalCurrency   | STRING | Notional currency                                                                                                                                                           | Yes      |\n| instrumentId       | STRING | Contract code, standard format: Underlying futures contract code + Contract expiry month + Option type code + Strike price, e.g., Sugar option SR2509P6300 = SR+2509+P+6300 | No       |\n| direction          | STRING | Trading direction. Valid values: “Buy” (default), “Sell”.                                                                                                                   | No       |\n| maturity           | DATE   | Maturity date                                                                                                                                                               | Yes      |\n| strike             | DOUBLE | Strike price                                                                                                                                                                | Yes      |\n| payoffType         | STRING | Payoff type. Valid values: “Call”, “Put”                                                                                                                                    | Yes      |\n| underlying         | STRING | Underlying futures contract code, e.g., SR2509                                                                                                                              | Yes      |\n| dayCountConvention | STRING | Day count convention. Valid values: \"ActualActualISDA\", \"ActualActualISMA\", \"Actual365\", \"Actual360\"                                                                        | Yes      |\n| discountCurve      | STRING | Discount curve name for pricing reference. The default valud for RMB deposits is \"CNY\\_FR\\_007\".                                                                            | No       |\n\n##### American Equity Options (eqAmericanOptions)\n\n| **Field Name**     | **Data Type** | **Description**                                                                                                                                                                                                              | **Required** |\n| ------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |\n| productType        | STRING        | Fixed value: `\"Option\"`.                                                                                                                                                                                                     | √            |\n| optionType         | STRING        | Fixed value: `\"AmericanOption\"`.                                                                                                                                                                                             | √            |\n| assetType          | STRING        | Fixed value: `\"EqAmericanOption\"` (Equity American Option).                                                                                                                                                                  | √            |\n| notionalAmount     | DOUBLE        | Notional amount.                                                                                                                                                                                                             | √            |\n| notionalCurrency   | STRING        | Notional currency. Defaults to CNY.                                                                                                                                                                                          | √            |\n| instrumentId       | STRING        | Instrument identifier. For example, `TCH250328C0040000` is interpreted as follows: `TCH` = underlying (Tencent Holdings); `250328` = maturity date (March 28, 2025); `C` = Call option; `0040000` = strike price 400.00 HKD. | ×            |\n| direction          | STRING        | Trade direction: `Buy` or `Sell`. Defaults to `Buy`.                                                                                                                                                                         | ×            |\n| maturity           | DATE          | Maturity date (expiration date).                                                                                                                                                                                             | √            |\n| strike             | DOUBLE        | Strike price.                                                                                                                                                                                                                | √            |\n| payoffType         | STRING        | Payoff type (enumeration): `Call` or `Put`.                                                                                                                                                                                  | √            |\n| underlying         | STRING        | Underlying futures contract code, e.g., `TCH`.                                                                                                                                                                               | √            |\n| dayCountConvention | STRING        | Day count convention. Available options: `\"ActualActualISDA\"`, `\"ActualActualISMA\"`, `\"Actual365\"`, `\"Actual360\"`.                                                                                                           | √            |\n| discountCurve      | STRING        | Discount curve name used for pricing. For CNY deposits, the default is `\"CNY_FR_007\"`.                                                                                                                                       | ×            |\n| dividendCurve      | STRING        | Dividend curve name used for pricing.                                                                                                                                                                                        | ×            |\n"
    },
    "parseInteger": {
        "url": "https://docs.dolphindb.com/en/Functions/p/parseInteger.html",
        "signatures": [
            {
                "full": "parseInteger(X, type, [radix=10])",
                "name": "parseInteger",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "type",
                        "name": "type"
                    },
                    {
                        "full": "[radix=10]",
                        "name": "radix",
                        "optional": true,
                        "default": "10"
                    }
                ]
            }
        ],
        "markdown": "### [parseInteger](https://docs.dolphindb.com/en/Functions/p/parseInteger.html)\n\n#### Syntax\n\nparseInteger(X, type, \\[radix=10])\n\nAlias: parseInt\n\n#### Details\n\n`parseInteger` parses *X* into an integer of the specified *type* in specified *radix*. If it encounters a character that is not a numeral in the specified *radix*, it ignores it and all succeeding characters and returns the integer value parsed up to that point. An exception will be thrown if the first character is invalid.\n\n**Note:**\n\n* Leading whitespaces or zeros are ignored during parsing.\n* Decimal values are not supported, i.e., the point `.` is considered illegal.\n* An empty string is parsed as null.\n* The sign character `+/-` indicates positive or negative only if it appears after a leading whitespace, otherwise it is considered illegal.\n\n#### Parameters\n\n**X** is a STRING scalar, vector, pair or matrix.\n\n**type** specifies the data type of the integer, which can be CHAR, SHORT, INT or LONG.\n\n**radix** (optional) is an integer in \\[2, 16] that represents the radix (the base in mathematical numeral systems) of the integer. The default value is 10.\n\n* For *radix* 2, only '0' and '1' are allowed.\n* For *radix* 11-16, 'A'/'a' to 'F'/'f' (case insensitive) are used for 10-15.\n* Specifically for *radix* 16, leading '0x' or '0X' is allowed.\n\n#### Returns\n\nA CHAR/SHORT/INT/LONG scalar/vector/pair/matrix of the same shape as *X*.\n\n#### Examples\n\n```\nparseInteger([\" \", \"000\", \"012\", \" 12\",\"12a\", \"1a2\",\"+12a\", \"-12\"], INT)\n//output: [ , 0, 12, 12, 12, 1, 12, -12]\n\nparseInteger(\"a12\", INT)\n//Error: 'Invalid string to parse.'\n\nparseInteger([\"012\", \" 12\",\"12a\", \"1a2\",\"1A2\", \"-1A2\"], INT, 11)\n//output: [13, 13, 153, 233, 233, -233]\n\nparseInteger(\"0X16\", INT)\n//output:0\n\nparseInteger([\"0x16\", \"3F\"], INT, 16)\n//output:[22, 63]\n\nparseInteger( \"9\" , INT, 8)\n//Error: 'Invalid string to parse.'\n```\n\n"
    },
    "parseJsonTable": {
        "url": "https://docs.dolphindb.com/en/Functions/p/parseJsonTable.html",
        "signatures": [
            {
                "full": "parseJsonTable(json, [schema], [keyCaseSensitive=true])",
                "name": "parseJsonTable",
                "parameters": [
                    {
                        "full": "json",
                        "name": "json"
                    },
                    {
                        "full": "[schema]",
                        "name": "schema",
                        "optional": true
                    },
                    {
                        "full": "[keyCaseSensitive=true]",
                        "name": "keyCaseSensitive",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [parseJsonTable](https://docs.dolphindb.com/en/Functions/p/parseJsonTable.html)\n\n\n\n#### Syntax\n\nparseJsonTable(json, \\[schema], \\[keyCaseSensitive=true])\n\n#### Details\n\nParses JSON objects into an in-memory table. An empty JSON object will parsed as an empty row of the table.\n\n* When *json* is a string containing multiple JSON objects, each object will be converted to a row in the table.\n* When *json* is a vector of strings, each element will be converted to a row in the table.\n\n#### Parameters\n\n**json** is a STRING scalar or vector containing JSON objects. If it is a STRING scalar, it can contain one or more JSON objects. JSON arrays and recursive JSON objects are not supported yet.\n\n**schema** (optional) is a table that specifies the column names and types. It can contain the following columns:\n\n<table id=\"table_ul4_bnx_3zb\"><thead><tr><th align=\"left\">\n\n**Column**\n\n</th><th align=\"left\">\n\n**Description**\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nname\n\n</td><td align=\"left\">\n\na string representing the column name\n\n</td></tr><tr><td align=\"left\">\n\ntype\n\n</td><td align=\"left\">\n\na string representing the column type.\n\n</td></tr><tr><td align=\"left\">\n\nformat\n\n</td><td align=\"left\">\n\na string specifying the format of date or time columns.\n\n</td></tr></tbody>\n</table>If *schema* is not specified, the function will automatically parse the schema based on the first 10 JSON objects.\n\n**keyCaseSensitive** (optional) indicates whether keys are case-sensitive. true (default) means case sensitive, false means case insensitive.\n\n#### Returns\n\nReturns an in-memory table.\n\n#### Examples\n\n```\njson1='{\"ID\":1, \"NAME\":\"cc\"}{\"NAME\":\"dd\"}'\nparseJsonTable(json1)\n```\n\n| ID | NAME |\n| -- | ---- |\n| 1  | cc   |\n|    | dd   |\n\n```\njson2 = '{\"col_test\":\"20190522150407\"}'\nschemaTB = table([\"col_test\"] as name, [\"DATETIME\"] as type, [\"yyyyMMddHHmmss\"] as format)\nparseJsonTable(json2, schemaTB)\n```\n\n| col\\_test           |\n| ------------------- |\n| 2019.05.22T15:04:07 |\n\njson is a string containing two JSON objects:\n\n```\njson3='{\"ID\":11, \"NAME\":\"dd\"}'\nschemaTB1 = table([\"ID\", \"NAME\", \"col_test\"] as name, [\"INT\", \"STRING\", \"DATETIME\"] as type, [,,\"yyyyMMddHHmmss\"] as format)\nparseJsonTable(concat([json2,json3]),schemaTB1)\n```\n\n| ID | NAME | col\\_test           |\n| -- | ---- | ------------------- |\n|    |      | 2019.05.22T15:04:07 |\n| 11 | dd   |                     |\n\njson is a STRING vector:\n\n```\nparseJsonTable([json2,json3],schemaTB1)\n```\n\n| ID | NAME | col\\_test           |\n| -- | ---- | ------------------- |\n|    |      | 2019.05.22T15:04:07 |\n| 11 | dd   |                     |\n"
    },
    "parseMktData": {
        "url": "https://docs.dolphindb.com/en/Functions/p/parseMktData.html",
        "signatures": [
            {
                "full": "parseMktData(dict)",
                "name": "parseMktData",
                "parameters": [
                    {
                        "full": "dict",
                        "name": "dict"
                    }
                ]
            }
        ],
        "markdown": "### [parseMktData](https://docs.dolphindb.com/en/Functions/p/parseMktData.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nparseMktData(dict)\n\n#### Details\n\nParses the given dictionary or JSON string into MKTDATA type.\n\n#### Parameters\n\n**dict** A dictionary or a STRING scalar representing a JSON-encoded dictionary that defines the market data to be parsed.\n\n#### Returns\n\nA MKTDATA object.\n\n#### Supported Market Data and Fields\n\nThe MKTDATA type is newly introduced in DolphinDB version 3.00.4, which provides database support for the market data used for pricing.\n\nCurrently supported types:\n\n* **Spot prices:** FxSpotRate (foreign exchange spot rate)\n\n* **Term structure curves:** IrYieldCurve (interest rate yield curve), AssetPriceCurve (asset price curve)\n\n* **Volatility surfaces:** FxVolatilitySurface (foreign exchange volatility surface)\n\n##### Price\n\n| Field Name    | Data Type | Description                                                                                                                                                                                                         | Required |\n| ------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |\n| mktDataType   | STRING    | Must be \"Price\"                                                                                                                                                                                                     | √        |\n| referenceDate | DATE      | Reference Date                                                                                                                                                                                                      | √        |\n| priceType     | STRING    | Price type. Must be \"Price\"                                                                                                                                                                                         | √        |\n| value         | DOUBLE    | Spot price                                                                                                                                                                                                          | √        |\n| unit          | STRING    | The pricing unit of value (i.e., the unit or dimension represented by the numeric value).When priceType is \"Price\", unit specifies the currency code. Supported values are \"CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\" | √        |\n\n##### FxSpotRate\n\n<table id=\"table_ydf_ksq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Price\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nspotDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSpot settlement date. Use internal static data by default.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\npriceType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSpot price type. Must be \"FxSpotRate\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalue\n\n</td><td>\n\nDOUBLE\n\n</td><td>\n\nSpot price\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nunit\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe pricing unit of value (i.e., the unit or dimension represented by the numeric value).When priceType is \"FxSpotRate\", unit specifies a currency pair. Supported values are \"EURUSD\", \"USDCNY\", \"EURCNY\", \"GBPCNY\", \"JPYCNY\", \"HKDCNY\".\n\nCurrency pairs may also use `.` or `/` as separators. For example, \"EURUSD\" can also be written as \"EUR.USD\" or \"EUR/USD\".\n\n</td><td>\n\n√\n\n</td></tr></tbody>\n</table>Define a MKTDATA object of FxSpotRate type.\n\n```\nFxSpotRate = {\n    \"mktDataType\": \"Price\",\n    \"referenceDate\": 2025.08.18,\n    \"spotDate\": 2025.08.20,\n    \"priceType\": \"FxSpotRate\",\n    \"value\": 7.2659,\n    \"unit\": \"USDCNY\"\n}\n\nmktData = parseMktData(FxSpotRate)\nprint(mktData)\n```\n\n##### IrYieldCurve\n\n<table id=\"table_usm_nsq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; It can be \"Bootstrap\" (default), \"NS\", \"NSS\".\n\nWhen the value is \"NSS\" or \"NS\", the fields interpMethod, extrapMethod, dates, and values are not required.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters. It is required when *curveModel*is \"NSS\" or \"NS\":\n\n* If curveModel = \"NS\": must include keys 'beta0', 'beta1', 'beta2', 'lambda'.\n\n* If curveModel = \"NSS\": must include keys 'beta0', ‘beta1', 'beta2', 'beta3', 'lambda0', 'lambda1'.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>Define a MKTDATA object of IrYieldCurve type.\n\n```\naod = 2025.07.01\ncurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": aod,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"Actual365\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.07.07,2025.07.10,2025.07.17,2025.07.24,2025.08.04,2025.09.03,2025.10.09,2026.01.05,\n        2026.04.03,2026.07.03,2027.01.04,2027.07.05,2028.07.03],\n    \"values\":[0.015785,0.015931,0.016183,0.016381,0.016493,0.016503,0.016478,0.016234,0.016321,\n        0.016378,0.015508,0.015185,0.014901],\n    \"settlement\": aod+2\n}\n\nmktData = parseMktData(curve)\nprint(mktData)\n```\n\n#### IrYieldCurve(non-bond)\n\n<table id=\"IrYieldCurve_nonBond\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Curve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"IrYieldCurve\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndayCountConvention\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe day count convention to use. It can be:\n\n* \"Actual360\": actual/360\n\n* \"Actual365\": actual/365\n\n* \"ActualActualISMA\": actual/actual according to ISMA (International Securities Market Association) convention\n\n* \"ActualActualISDA\": actual/actual according to ISDA (International Swaps and Derivatives Association) convention.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ninterpMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nInterpolation method. It can be:\n\n* \"Linear\": linear interpolation\n\n* \"CubicSpline\": cubic spline interpolation\n\n* \"CubicHermiteSpline\": cubic Hermite interpolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nextrapMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nExtrapolation method. It can be\n\n* Flat: flat extrapolation\n\n* Linear: linear extrapolation\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ndates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nDate of each data point\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvalues\n\n</td><td>\n\nDOUBLE vector\n\n</td><td>\n\nValue of each data point, corresponding to the elements in dates.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncurveName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrency\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurrency. It can be CNY\", \"USD\", \"EUR\", \"GBP\", \"JPY\", \"HKD\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ncompounding\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nThe compounding interest. It can be:\n\n* \"Compounded\": discrete compounding\n\n* \"Simple\": simple interest (no compounding).\n\n* \"Continuous\": continuous compounding.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsettlement\n\n</td><td>\n\nDATE\n\n</td><td>\n\nSettlement date. If specified, all subsequent tenor intervals are computed starting from \"settlement\" rather than from \"referenceDate\".\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\nfrequency\n\n</td><td>\n\nINTEGRAL/STRING\n\n</td><td>\n\nThe interest payment frequency. Supported values:\n\n* -1 or \"NoFrequency\": No payment frequency\n\n* 0 or \"Once\": Single lump-sum payment of principal and interest at maturity.\n\n* 1 or \"Annual\": Annually\n\n* 2 or \"Semiannual\": Semiannually\n\n* 3 or \"EveryFourthMonth\": Every four months\n\n* 4 or \"Quarterly\": Quarterly\n\n* 6 or \"BiMonthly\": Every two months\n\n* 12 or \"Monthly\": Monthly\n\n* 13 or \"EveryFourthWeek\": Every four weeks\n\n* 26 or \"BiWeekly\": Every two weeks\n\n* 52 or \"Weekly\": Weekly\n\n* 365 or \"Daily\": Daily\n\n* 999 or \"Other\": Other frequencies\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveModel\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nCurve construction model; Currently, only \"Bootstrap\" is supported.\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurveParams\n\n</td><td>\n\nDICT\n\n</td><td>\n\nModel parameters.\n\n</td><td>\n\n×\n\n</td></tr></tbody>\n</table>### AssetPriceCurve\n\n| Field Name    | Data Type     | Description                                                       | Required |\n| ------------- | ------------- | ----------------------------------------------------------------- | -------- |\n| mktDataType   | STRING        | Must be \"Curve\"                                                   | √        |\n| referenceDate | DATE          | Reference Date                                                    | √        |\n| curveType     | STRING        | Must be \"AssetPriceCurve\"                                         | √        |\n| dates         | DATE vector   | Date of each data point                                           | √        |\n| values        | DOUBLE vector | Value of each data point, corresponding to the elements in dates. | √        |\n| curveName     | STRING        | Curve name                                                        | ×        |\n\nDefine a MKTDATA object of AssetPriceCurve type.\n\n```\ncurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"AssetPriceCurve\",\n    \"referenceDate\": 2024.06.28,\n    \"curveName\": \"PRICE_SHIBOR_3M\",\n    \"dates\": [2024.06.21, 2024.06.24, 2024.06.25, 2024.06.26,2024.06.27],\n    \"values\": [1.923, 1.922, 1.921, 1.919, 1.918]/100\n}\n\nmktData = parseMktData(curve)\nprint(mktData)\n```\n\n##### FxVolatilitySurface\n\n<table id=\"table_lk1_5sq_ngc\"><thead><tr><th>\n\nField Name\n\n</th><th>\n\nData Type\n\n</th><th>\n\nDescription\n\n</th><th>\n\nRequired\n\n</th></tr></thead><tbody><tr><td>\n\nmktDataType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"Surface\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nreferenceDate\n\n</td><td>\n\nDATE\n\n</td><td>\n\nReference Date\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsurfaceType\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nMust be \"FxVolatilitySurface\"\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsmileMethod\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nVolatility smile method. It can be:\n\n* \"Linear\": linear smile\n\n* \"CubicSpline\": cubic-spline smile\n\n* \"SVI\": SVI-model smile\n\n* \"SABR\": SABR-model smile\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nvolSmiles\n\n</td><td>\n\nDICT(STRING, ANY)vector\n\n</td><td>\n\nVolatility smiles vector. Each element is one smile . It has the following members:\n\n* **strikes**: A DOUBLE vector indicating the strike prices.\n\n* **vols**: A DOUBLE vector indicating the volatilities corresponding to *strikes*(of the same length).\n\n* **curveParams**: A DICT(STRING, DOUBLE) indicating the model parameters for the smile method; only effective when *smileMethod*is \"SVI\" or \"SABR\":\n\n  * smileMethod = 'SVI': Must have the keys: 'a', 'b', 'rho', 'm', 'sigma'\n\n  * smileMethod = 'SABR':\n\nMust have the keys: 'alpha', 'beta', 'rho', 'nu'\n\n* **fwd** (optional ): A DOUBLE scalar indicating the forward value. It is required when *smileMethod*is \"SVI\" or \"SABR\".\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\ntermDates\n\n</td><td>\n\nDATE vector\n\n</td><td>\n\nTerm date corresponding to each smile in *volSmiles*.\n\n</td><td>\n\n√\n\n</td></tr><tr><td>\n\nsurfaceName\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nSurface name\n\n</td><td>\n\n×\n\n</td></tr><tr><td>\n\ncurrencyPair\n\n</td><td>\n\nSTRING\n\n</td><td>\n\nForeign exchange currency pair. Available options: \"EURUSD\", \"USDCNY\", \"EURCNY\", \"GBPCNY\", \"JPYCNY\", \"HKDCNY\".\n\nCurrency pairs may also use `.` or `/` as separators. For example, \"EURUSD\" can also be written as \"EUR.USD\" or \"EUR/USD\".\n\n</td><td>\n\n√\n\n</td></tr></tbody>\n</table>Define a MKTDATA object of FxVolatilitySurface type.\n\n```\nsurf = {\n\t\"surfaceName\": \"USDCNY\",\n\t\"mktDataType\": \"Surface\",\n\t\"surfaceType\": \"FxVolatilitySurface\",\n\t\"referenceDate\": \"2025.08.18\",\n\t\"smileMethod\": \"Linear\",\n\t\"termDates\": [\n\t\t\"2025.08.21\",\n\t\t\"2026.08.20\"\n\t],\n\t\"volSmiles\":[{\"strikes\": [6.5,7,7.5],\"vols\": [0.1,0.1,0.1]},{\"strikes\": [6.5,7,7.5],\"vols\": [0.1,0.1,0.1]}],\n\t\"currencyPair\": \"USDCNY\"\n}\n\nsurfUsdCny = parseMktData(surf)\n```\n"
    },
    "partial": {
        "url": "https://docs.dolphindb.com/en/Functions/p/partial.html",
        "signatures": [
            {
                "full": "partial(func, args...)",
                "name": "partial",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [partial](https://docs.dolphindb.com/en/Functions/p/partial.html)\n\n\n\n#### Syntax\n\npartial(func, args...)\n\n#### Details\n\nCreate a partial application.\n\n#### Parameters\n\n**func** is a function.\n\n**args...** are an incomplete list of the arguments of *func*.\n\n#### Returns\n\nA FUNCTIONDEF object.\n\n#### Examples\n\n```\npartial(add,1)(2);\n// output: 3\n\ndef f(a,b):a pow b\ng=partial(f, 2)\ng(3);\n// output: 8\n```\n"
    },
    "pca": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pca.html",
        "signatures": [
            {
                "full": "pca(X, [colNames], [k], [normalize], [maxIter], [svdSolver], [randomState])",
                "name": "pca",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[colNames]",
                        "name": "colNames",
                        "optional": true
                    },
                    {
                        "full": "[k]",
                        "name": "k",
                        "optional": true
                    },
                    {
                        "full": "[normalize]",
                        "name": "normalize",
                        "optional": true
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[svdSolver]",
                        "name": "svdSolver",
                        "optional": true
                    },
                    {
                        "full": "[randomState]",
                        "name": "randomState",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [pca](https://docs.dolphindb.com/en/Functions/p/pca.html)\n\n\n\n#### Syntax\n\npca(X, \\[colNames], \\[k], \\[normalize], \\[maxIter], \\[svdSolver], \\[randomState])\n\n#### Details\n\nConduct principal component analysis for the specified columns of the data source.\n\n#### Parameters\n\n**ds** is one or multiple data source. It is usually generated by function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**colNames** is a string vector indicating column names. The default value is the names of all columns in *ds*.\n\n**k** is a positive integer indicating the number of principal components. The default value is the number of columns in *ds*.\n\n**normalize** is a Boolean value indicating whether to normalize each column. The default value is false.\n\n**maxIter** is a positive integer indicating the number of iterations when *svdSolver*=\"randomized\". If it is not specified, *maxIter*=7 if *k*<0.1\\*cols and *maxIter*=7 otherwise. Here cols means the number of columns in *ds*.\n\n**svdSolver** is a string. It can take the value of \"full\", \"randomized\" or \"auto\". *svdSolver*=\"full\" is suitable for situations where *k* is close to size(*colNames*); *svdSolver*=\"randomized\" is suitable for situations where *k* is much smaller than size(*colNames*). The default value is \"auto\", which means the system automatically determines whether to use \"full\" or \"randomized\".\n\n**randomState** is an integer indicating the random seed. It only takes effect when set *svdSolver*=\"randomized\". The default value is `int(time(now()))`.\n\n#### Returns\n\nReturns a dictionary with the following keys:\n\n* components: the matrix of principal component coefficients with size(*colNames*) rows and *k* columns.\n\n* explainedVarianceRatio: a vector of length *k* with the percentage of the total variance explained by each of the first *k* principal component.\n\n* singularValues: a vector of length *k* with the principal component variances (eigenvalues of the covariance matrix).\n\n#### Examples\n\n```\nx = [7,1,1,0,5,2]\ny = [0.7, 0.9, 0.01, 0.8, 0.09, 0.23]\nt=table(x, y)\nds = sqlDS(<select * from t>);\n\npca(ds);\n\n/* output:\ncomponents->\n#0        #1\n--------- ---------\n-0.999883 0.015306\n-0.015306 -0.999883\n*/\n```\n\n```\nexplainedVarianceRatio->[0.980301,0.019699]\n// output: singularValues->[6.110802,0.866243]\n```\n"
    },
    "pchipInterpolateFit": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pchipInterpolateFit.html",
        "signatures": [
            {
                "full": "pchipInterpolateFit(X, Y, [extrapolate=true])",
                "name": "pchipInterpolateFit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[extrapolate=true]",
                        "name": "extrapolate",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [pchipInterpolateFit](https://docs.dolphindb.com/en/Functions/p/pchipInterpolateFit.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\npchipInterpolateFit(X, Y, \\[extrapolate=true])\n\n#### Details\n\nThis function applies piecewise cubic Hermite interpolation to the given numerical vectors X and Y. PCHIP stands for Piecewise Cubic Hermite Interpolating Polynomial.\n\n#### Parameters\n\n**X** is a numeric vector representing the x-coordinates (independent variable) of the interpolation points. *X* must be strictly increasing and contain at least two elements.\n\n**Y** is a numeric vector of the same length as *X*, representing the y-coordinates (dependent variable) of the interpolation points.\n\n**extrapolate** (optional) is a Boolean scalar indicating whether to allow extrapolation when prediction points fall outside the data range. Defaults to true.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* modelName: A string \"PchipInterpolate\" indicating the model name.\n* X: The DOUBLE vector representing the x-coordinates used for interpolation (i.e., the input *X*).\n* extrapolate: A Boolean scalar. The input *extrapolate*.\n* coeffs: A numeric vector containing the polynomial coefficients fitted from the input data points.\n* predict: The prediction function of the model. You can call `model.predict(X)` or `predict(model, X)` to make predictions with the generated model.\n  * model: The output dictionary of `pchipInterpolateFit`.\n  * X: A numeric vector representing the x-coordinates.\n\n#### Examples\n\nPerform piecewise cubic Hermite interpolation on the given vectors *x* and *y*.\n\n```\ndef linspace(start, end, num, endpoint=true){\n\tif(endpoint) return end$DOUBLE\\(num-1), start + end$DOUBLE\\(num-1)*0..(num-1)\n\telse return start + end$DOUBLE\\(num-1)*0..(num-1)\t\n}\n\nx_observed = linspace(0.0, 10.0, 11)[1]\ny_observed = sin(x_observed)\n\nmodel = pchipInterpolateFit(x_observed, y_observed)\nmodel;\n\n/* output:\nmodelName->PchipInterpolate\nX->[0,1,2,3,4,5,6,7,8,9,10]\ncoeffs->#0                 #1                 #2                 #3                \n------------------ ------------------ ------------------ ------------------\n-0.32911446845195  -0.057707802943105 1.228293256202952  0                 \n-0.01011863907468  -0.047589163868426 0.125534244960891  0.841470984807897 \n0.708356730424705  -1.476534149190519 0                  0.909297426825682 \n0.637878921149598  -0.707803317410469 -0.827998107106924 0.141120008059867 \n0.074275580231352  0.053570618892506  -0.329967978479069 -0.756802495307928\n-0.571482233207003 1.250991009671215  0                  -0.958924274663138\n-0.594663658922633 0.743530436118926  0.787535319721422  -0.279415498198926\n-0.174138080617811 0.015904513331029  0.490605215191374  0.656986598718789 \n0.434603140426252  -1.011842901807877 0                  0.989358246623382 \n0.046813296419378  -0.283076510213506 -0.719876382336998 0.412118485241757 \n\nextrapolate->true\npredict->cubicHermiteSplinePredict\n*/\n```\n\n**Related**: [predict](https://docs.dolphindb.com/en/Functions/p/predict.html) [cubicHermiteSplineFit](https://docs.dolphindb.com/en/Functions/c/cubichermitesplinefit.html)\n"
    },
    "pdfChiSquare": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pdfChiSquare.html",
        "signatures": [
            {
                "full": "pdfChiSquare(df, X)",
                "name": "pdfChiSquare",
                "parameters": [
                    {
                        "full": "df",
                        "name": "df"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [pdfChiSquare](https://docs.dolphindb.com/en/Functions/p/pdfChiSquare.html)\n\n#### Syntax\n\npdfChiSquare(df, X)\n\n#### Details\n\nCalculate the probability density of the specified chi-square distribution at *X*.\n\nIts functionality and usage are the same as `scipy.stats.chi2.pdf`.\n\n#### Parameters\n\n**df** is a numeric scalar representing the degrees of freedom.\n\n**X** is a numeric scalar or vector representing the points at which to compute the probability density.\n\n#### Returns\n\nA DOUBLE scalar or vector indicating the specified chi-square distribution at *X*.\n\n#### Examples\n\n```\npdfChiSquare(df=3, X=[1,2,3])\n// output: [0.241970724519143,0.207553748710297,0.154180329803769]\n```\n\n"
    },
    "pdfF": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pdfF.html",
        "signatures": [
            {
                "full": "pdfF(numeratorDF, denominatorDF, X)",
                "name": "pdfF",
                "parameters": [
                    {
                        "full": "numeratorDF",
                        "name": "numeratorDF"
                    },
                    {
                        "full": "denominatorDF",
                        "name": "denominatorDF"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [pdfF](https://docs.dolphindb.com/en/Functions/p/pdfF.html)\n\n#### Syntax\n\npdfF(numeratorDF, denominatorDF, X)\n\n#### Details\n\nCalculate the probability density of the specified F distribution at *X*.\n\nIts functionality and usage are the same as `scipy.stats.f.pdf`.\n\n#### Parameters\n\n**numeratorDF** is a numeric scalar representing the degrees of freedom for the numerator.\n\n**denominatorDF** is a numeric scalar representing the degrees of freedom for the denominator.\n\n**X** is a numeric scalar or vector representing the points at which to compute the probability density.\n\n#### Returns\n\nA DOUBLE scalar or vector indicating the probability density of the specified F distribution at *X*.\n\n#### Examples\n\n```\npdfF(numeratorDF=2, denominatorDF=19, X=[1,2,3])\n// output: [0.34963122778983,0.134514942963846,0.056045754350634]\n```\n\n"
    },
    "pdfNormal": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pdfNormal.html",
        "signatures": [
            {
                "full": "pdfNormal(mean, stdev, X)",
                "name": "pdfNormal",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "stdev",
                        "name": "stdev"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [pdfNormal](https://docs.dolphindb.com/en/Functions/p/pdfNormal.html)\n\n#### Syntax\n\npdfNormal(mean, stdev, X)\n\n#### Details\n\nCalculate the probability density of the specified normal distribution at *X*.\n\nIts functionality and usage are the same as `scipy.stats.norm.pdf`.\n\n#### Parameters\n\n**mean** is a numeric scalar representing the mean of the normal distribution.\n\n**stdev** is a numeric scalar representing the standard deviation of the normal distribution.\n\n**X** is a numeric scalar or vector representing the points at which to compute the probability density.\n\n#### Returns\n\nA DOUBLE scalar or vector indicating the probability density of the specified normal distribution at *X*.\n\n#### Examples\n\nCalculate the probability density value of the standard normal distribution at *X*=1:\n\n```\npdfNormal(mean=0, stdev=1, X=1)\n// output: 0.24197072451914337\n```\n\nCalculate the probability density values of a normal distribution with mean 1 and variance 1.5 at *X*=1, 2, 3:\n\n```\npdfNormal(mean=1, stdev=1.5, X=[1,2,3])\n// output: [0.265961520267622,0.212965337014901,0.109340049783996]\n```\n\n"
    },
    "peekAppend": {
        "url": "https://docs.dolphindb.com/en/Functions/p/peekAppend.html",
        "signatures": [
            {
                "full": "peekAppend(engine, data)",
                "name": "peekAppend",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "data",
                        "name": "data"
                    }
                ]
            }
        ],
        "markdown": "### [peekAppend](https://docs.dolphindb.com/en/Functions/p/peekAppend.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\npeekAppend(engine, data)\n\n#### Details\n\nPeeks at the immediate calculation result of adding the specified data to the engine's current state without updating the stream engine state or writing results to the outputTable. Currently only supports partial operators of TimeSeriesEngine and ReactiveStateEngine, as follows:\n\n**TimeSeriesEngine**: *keyColumn* is set and *useSystemTime*, *acceptedDelay* and *forceTriggerTime* are not set.\n\n**ReactiveStateEngine**: `cumavg`, `cumsum`, `cumstd`, `cumstdp`, `cumvar`, `cumvarp`, `cumprod`, `cumcount`, `mcount`, `msum`, `mavg`, `mstd`, `mstdp`, `mvar`, `mvarp`, as well as stateless operators (expressions, stateless functions, etc.).\n\n#### Parameters\n\n**engine**A stream engine.\n\n**data**A table or tuple representing the data to be written to the stream engine.\n\n#### Returns\n\nA table displaying the calculation result of adding *data* to the engine's current state. The engine state will not be updated, and no results will be output to the outputTable.\n\n#### Examples\n\n**For ReactiveStateEngine:**\n\n```\nshare streamTable(100:0, `sym`time`price, [STRING,DATETIME,DOUBLE]) as tickStream\nshare streamTable(1000:0, `sym`time`factor1, [STRING,DATETIME,DOUBLE]) as result\nrse = createReactiveStateEngine(name=\"reactiveDemo\", metrics =[<time>, <cumsum(price)>], dummyTable=tickStream, outputTable=result, keyColumn=\"sym\")\ndata = table(take([\"000001.SH\",\"000002.SH\",\"000003.SH\"], 3) as sym, take(2021.02.08T09:31:00 + 1..3, 3) as time, take(100.0, 3) as price)\nres = rse.peekAppend(data)\nrse.append!(data)\n```\n\n![](https://docs.dolphindb.com/en/Functions/images/peekAppend/1.png)\n\n```\nshare streamTable(100:0, `sym`time`price, [STRING,DATETIME,DOUBLE]) as tickStream\nshare streamTable(1000:0, `sym`time`factor1, [STRING,DATETIME,DOUBLE]) as result\nrse = createReactiveStateEngine(name=\"reactiveDemo\", metrics =[<time>, <cumsum(price)>], dummyTable=tickStream, outputTable=result, keyColumn=\"sym\")\n\ndata = table(take([\"000001.SH\"], 3) as sym, take(2021.02.08T09:31:00 + 1..3, 3) as time, 100 200 300 as price)\nres2 = rse.peekAppend(data)\n```\n\n![](https://docs.dolphindb.com/en/Functions/images/peekAppend/2.png)\n\n**For TimeSeriesEngine:**\n\n```\nshare streamTable(1000:0, `sym`time`volume, [STRING,DATETIME,INT]) as tickStream\nshare streamTable(1000:0, `time`sym`sumVolume, [DATETIME,STRING,INT]) as result\ntse = createTimeSeriesEngine(name=\"tse\", windowSize=60, step=60, metrics=<[sum(volume)]>, dummyTable=tickStream, outputTable=result, timeColumn=\"time\", useSystemTime=false, keyColumn=\"sym\")\n\ninsert into tse values([`\"000001.SH\", 2021.02.08T09:30:00, 100])\ndata = table(take([\"000001.SH\"], 3) as sym, take(2021.02.08T09:30:00 + 1..3, 3) as time, 100 200 300 as price)\nres = tse.peekAppend(data)\n```\n\n![](https://docs.dolphindb.com/en/Functions/images/peekAppend/3.png)\n"
    },
    "percentChange": {
        "url": "https://docs.dolphindb.com/en/Functions/p/percentChange.html",
        "signatures": [
            {
                "full": "percentChange(X, [n])",
                "name": "percentChange",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[n]",
                        "name": "n",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [percentChange](https://docs.dolphindb.com/en/Functions/p/percentChange.html)\n\n\n\n#### Syntax\n\npercentChange(X, \\[n])\n\n#### Details\n\nFor each element *Xi* in *X*, return *(Xi/ Xi-n) - 1*, representing the percentage changes between elements.\n\n#### Parameters\n\n**X** is a vector or matrix.\n\n**n** (optional) is an integer specifying the step to shift when comparing elements in *X*. The default value is 1, meaning to compare the current element with the adjacent element at left.\n\n#### Returns\n\nA vector or matrix with the same shape as *X*.\n\n#### Examples\n\n```\npercentChange([1,2,3]);\n// output: [,1,0.5]\n\npercentChange(85 90 95);\n// output: [,0.058824,0.055556]\n```\n\n```\nm=matrix(100 105 109 112 108 116, 200 212 208 199 206 210);\nm\n```\n\n| #0  | #1  |\n| --- | --- |\n| 100 | 200 |\n| 105 | 212 |\n| 109 | 208 |\n| 112 | 199 |\n| 108 | 206 |\n| 116 | 210 |\n\n```\npercentChange(m);\n```\n\n| #0                 | #1                 |\n| ------------------ | ------------------ |\n|                    |                    |\n| 0.05               | 0.06               |\n| 0.038095238095238  | -0.018867924528302 |\n| 0.027522935779817  | -0.043269230769231 |\n| -0.035714285714286 | 0.035175879396985  |\n| 0.074074074074074  | 0.019417475728155  |\n\nWhen *n*is positive:\n\n```\nr = percentChange(1..10,3);\nr;\n// output: [,,,3,1.5,1,0.75,0.6,0.5,0.43]\n```\n\n```\nm=matrix(1 3 2 NULL 6 9 3, 0 8 NULL 7 6 2 8);\nr = percentChange(m,2);\nr;\n```\n\n| 0    | 1     |\n| ---- | ----- |\n|      |       |\n|      |       |\n| 1    |       |\n|      | -0.13 |\n| 2    |       |\n|      | -0.71 |\n| -0.5 | 0.33  |\n\nWhen *n*is negative:\n\n```\nm = 3 4 6 9\nr2= percentChange(m,-2)\nr2; \n// output: [-0.5,-0.56,,]\n```\n"
    },
    "percentile": {
        "url": "https://docs.dolphindb.com/en/Functions/p/percentile.html",
        "signatures": [
            {
                "full": "percentile(X, percent, [interpolation='linear'])",
                "name": "percentile",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "percent",
                        "name": "percent"
                    },
                    {
                        "full": "[interpolation='linear']",
                        "name": "interpolation",
                        "optional": true,
                        "default": "'linear'"
                    }
                ]
            }
        ],
        "markdown": "### [percentile](https://docs.dolphindb.com/en/Functions/p/percentile.html)\n\n\n\n#### Syntax\n\npercentile(X, percent, \\[interpolation='linear'])\n\n#### Details\n\nIf *X* is a vector, return the given percentile of *X*. The calculation ignores null values.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a vector\n\nIf *X* is a table, conduct the aforementioned calculation within each column of *X*. The result is a table.\n\nDifference from Python’s `percentile`: when `X` is a matrix, `numpy.percentile` flattens the array into one dimension by default and returns a single value, whereas `percentile` in DolphinDB computes the result for each column separately. Its behavior is equivalent to `numpy.percentile(X, percent, axis=0)`.\n\n#### Parameters\n\n**X** is a vector, a matrix or a table.\n\n**percent** is an integer or a floating number between 0 and 100.\n\n**interpolation** is a string indicating the interpolation method to use if the specified percentile is between two elements in *X* (assuming the ith and (i+1)th element in the sorted *X*) . It can take the following values:\n\n* 'linear': Return ![](https://docs.dolphindb.com/en/images/linear.png), where ![](https://docs.dolphindb.com/en/images/fraction.png)\n\n* 'lower': Return ![](https://docs.dolphindb.com/en/images/xi.png)\n\n* 'higher': Return ![](https://docs.dolphindb.com/en/images/higher.png)\n\n* 'nearest': Return ![](https://docs.dolphindb.com/en/images/xi.png) or ![](https://docs.dolphindb.com/en/images/higher.png) that is closest to the specified percentile\n\n* 'midpoint': Return ![](https://docs.dolphindb.com/en/images/midpoint.png)\n\nThe default value of interpolation is 'linear'.\n\n#### Returns\n\nA DOUBLE scalar, vector or a table containing DOUBLE results.\n\n#### Examples\n\n```\na=[6, 47, 49, 15, 42, 41, 7, 39, 43, 40, 36];\n\npercentile(a,50);\n// output: 40\n\npercentile(a,54);\n// output: 40.4\n\npercentile(a,25,\"lower\");\n// output: 15\n\npercentile(a,75,\"higher\");\n// output: 43\n\npercentile(a,5,\"midpoint\");\n// output: 6.5\n\npercentile(a,5,\"nearest\");\n// output: 6\n```\n\n```\nm=matrix(1 2 5 3 4, 5 4 1 2 3);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 5  |\n| 2  | 4  |\n| 5  | 1  |\n| 3  | 2  |\n| 4  | 3  |\n\n```\npercentile(m, 75);\n// output: [4,4]\n```\n\nRelated function: [quantile](https://docs.dolphindb.com/en/Functions/q/quantile.html)\n"
    },
    "percentileRank": {
        "url": "https://docs.dolphindb.com/en/Functions/p/percentileRank.html",
        "signatures": [
            {
                "full": "percentileRank(X, score, [method='excel'])",
                "name": "percentileRank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "score",
                        "name": "score"
                    },
                    {
                        "full": "[method='excel']",
                        "name": "method",
                        "optional": true,
                        "default": "'excel'"
                    }
                ]
            }
        ],
        "markdown": "### [percentileRank](https://docs.dolphindb.com/en/Functions/p/percentileRank.html)\n\n\n\n#### Syntax\n\npercentileRank(X, score, \\[method='excel'])\n\n#### Details\n\nCalculate the percentile (0-100) of a *score* in a vector with null values ignored.\n\n#### Parameters\n\n**X** is a numeric vector/matrix/table. If it is a matrix, calculate the percentile for each column and output a vector. If it is a table, calculate the percentile for each column and output a table.\n\n**score** is a scalar. The function will calculate the rank of the score according to the X.\n\n**method** is a string indicating the method to calculate the percentline. It can be:\n\n* \"excel\" (default): The proportion of the number of elements smaller than *score* to the number of elements not equal to *score*. If *score* is not equal to any element in *X*, then percentile calculation formula will be as below:\n\n  ![](https://docs.dolphindb.com/en/images/pscore.png)\n\n  In the formula, Xi is the maximum less than score and Xi+1 is the minimum greater than score. Pi and Pi+1 is the percentile of Xi and Xi+1.\n\n* \"rank\": The percentage of the number of elements not greater than *score* to the number of elements in *X*. If there are multiple elements in *X* that is equal to *score*, take the average of their percentiles as the result.\n\n* \"strict\": The percentage of the number of elements smaller than *score* to the number of elements in *X*.\n\n* \"weak\": The percentage of the number of elements not greater than *score* to the number of elements in *X*.\n\n* \"mean\": The average value of \"strict\" and \"weak\".\n\n#### Returns\n\nA DOUBLE scalar, vector or a table containing DOUBLE results.\n\n#### Examples\n\n```\na = 2 3 4 4 5;\npercentileRank(a, 4);\n// output: 66.666667\n\npercentileRank(a, 3);\n// output: 25\n\npercentileRank(a, 4, \"rank\");\n// output: 70\n\npercentileRank(a,75,\"weak\");\n// output: 80\n\npercentileRank(a,5,\"strict\");\n// output: 40\n\npercentileRank(a,5,\"mean\");\n// output: 60\n\npercentileRank(1 5 8, 6, \"excel\")\n// output: 66.666667\n```\n"
    },
    "piecewiseLinFit": {
        "url": "https://docs.dolphindb.com/en/Functions/p/piecewiseLinFit.html",
        "signatures": [
            {
                "full": "piecewiseLinFit(X, Y, numSegments, [XC], [YC], [bounds], [lapackDriver='gelsd'], [degree=1], [weights], [method='de'], [maxIter], [initialGuess], [seed])",
                "name": "piecewiseLinFit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "numSegments",
                        "name": "numSegments"
                    },
                    {
                        "full": "[XC]",
                        "name": "XC",
                        "optional": true
                    },
                    {
                        "full": "[YC]",
                        "name": "YC",
                        "optional": true
                    },
                    {
                        "full": "[bounds]",
                        "name": "bounds",
                        "optional": true
                    },
                    {
                        "full": "[lapackDriver='gelsd']",
                        "name": "lapackDriver",
                        "optional": true,
                        "default": "'gelsd'"
                    },
                    {
                        "full": "[degree=1]",
                        "name": "degree",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[weights]",
                        "name": "weights",
                        "optional": true
                    },
                    {
                        "full": "[method='de']",
                        "name": "method",
                        "optional": true,
                        "default": "'de'"
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[initialGuess]",
                        "name": "initialGuess",
                        "optional": true
                    },
                    {
                        "full": "[seed]",
                        "name": "seed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [piecewiseLinFit](https://docs.dolphindb.com/en/Functions/p/piecewiseLinFit.html)\n\n\n\n#### Syntax\n\npiecewiseLinFit(X, Y, numSegments, \\[XC], \\[YC], \\[bounds], \\[lapackDriver='gelsd'], \\[degree=1], \\[weights], \\[method='de'], \\[maxIter], \\[initialGuess], \\[seed])\n\n#### Details\n\nFit a continuous piecewise linear function for a specified number of line segments. Use differential evolution to find the optimal location of breakpoints for a given number of line segments by minimizing the sum of the square error. Note: Due to the randomness of the differential evolution, the results of this function may vary slightly each time.\n\nThe fitted model can be used as an input for function `pwlfPredict`.\n\n#### Parameters\n\n**X** is a numeric vector indicating the data point locations of x. Null value is not allowed.\n\n**Y** is a numeric vector indicating the data point locations of y. Null value is not allowed.\n\n**numSegments** is a positive integer indicating the desired number of line segments.\n\n**XC** (optional) is a numeric vector indicating the x locations of the data points that the piecewise linear function will be forced to go through. It only takes effect when *method*='de'.\n\n**YC** (optional) is a numeric vector indicating the y locations of the data points that the piecewise linear function will be forced to go through. It only takes effect when *method*='de'.\n\n**bounds** (optional) is a numeric matrix of shape (*numSegments*-1, 2), indicating the bounds for each breakpoint location within the optimization.\n\n**lapackDriver** (optional) is a string indicating which LAPACK driver is used to solve the least-squares problem. It can be 'gelsd' (default), 'gelsy' and 'gelss'.\n\n**degree** (optional) is a non-negative integer indicating the degree of polynomial to use. The default is 1 for linear models. Use 0 for constant models.\n\n**weights** (optional) is a numeric vector indicating the weights used in least-squares algorithms. The individual weights are typically the reciprocal of the standard deviation for each data point, where *weights\\[i]* corresponds to one over the standard deviation of the ith data point. Null value is not allowed.\n\n**method** (optional) is a string indicating the model used. It can be:\n\n* 'nm' (default): Nelder-Mead simplex algorithm.\n* 'bfgs': BFGS algorithm.\n* 'lbfgs': LBFGS algorithm.\n* 'slsqp': Sequential Least Squares Programming algorithm.\n* 'de': Differential Evolution algorithm.\n\n**maxIter** (optional) is an integral scalar or vector indicating the maximum number of iterations for the optimization algorithm during the fitting process.\n\n**initialGuess** (optional) is a numeric vector indicating the initial guess for the parameters that optimize the function. Its length is *numSegments*-1.\n\n**seed** (optional) is an integer indicating the random number seed used in the differential evolution algorithm to ensure the reproducibility of results. It only takes effect when *method*='de' or *initialGuess* is null. If not specified, a non-deterministic random number generator is used.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* breaks: A floating-point vector indicating the breakpoint locations.\n\n* beta: A floating-point vector indicating the beta parameter for the linear fit.\n\n* xData: A floating-point vector indicating the input data point locations of x.\n\n* yData: A floating-point vector indicating the input data point locations of y.\n\n* XC: A floating-point vector indicating the x locations of the data points that the piecewise linear function will be forced to go through.\n\n* YC: A floating-point vector indicating the y locations of the data points that the piecewise linear function will be forced to go through.\n\n* weights: A floating-point vector indicating the weights used in least-squares algorithms.\n\n* degree: A non-negative integer indicating the degree of polynomial.\n\n* lapackDriver: A string indicating the LAPACK driver used to solve the least-squares problem.\n\n* numParameters: An integer indicating the number of parameters.\n\n* predict: The function used for prediction. The method is called by `model.predict(X, [beta], [breaks])`. See pwlfPredict.\n\n* modelName: A string \"Piecewise Linear Regression\" indicating the model name.\n\n#### Examples\n\n```\ndef linspace(start, end, num, endpoint=true){\n\tif(endpoint) return end$DOUBLE\\(num-1), start + end$DOUBLE\\(num-1)*0..(num-1)\n\telse return start + end$DOUBLE\\(num-1)*0..(num-1)\t\n}\nX = linspace(0.0, 1.0, 10)[1]\nY = [0.41703981, 0.80028691, 0.12593987, 0.58373723, 0.77572962, 0.41156172, 0.72300284, 0.32559528, 0.21812564, 0.41776427]\nmodel = piecewiseLinFit(X, Y, 3)\nmodel;\n```\n\nOutput:\n\n```\nbreaks->[0.0,0.258454644769,0.366954310101,1.000000000000]\nnumParameters->4\ndegree->1\nxData->[0.0,0.111111111111,0.222222222222,0.333333333333,0.444444444444,0.555555555555,0.666666666666,0.777777777777,0.888888888888,1.000000000000]\npredict->pwlfPredict\nyData->[0.417039810000,0.800286910000,0.125939870000,0.583737230000,0.775729620000,0.411561720000,0.723002840000,0.325595280000,0.218125640000,0.417764270000]\nyC->\nxC->\nweights->\nbeta->[0.593305500750,-1.309949743583,5.703647584013,-5.105351630664]\nlapackDriver->gelsd\n```\n\n`piecewiseLinFit` can be used with `pwlfPredict` for predication based on the model:\n\n```\nxHat = linspace(0.0, 1.0, 20)[1]\nmodel.predict(xHat)\n\n// output: [0.593305499919518 0.524360777381737 0.455416054843957 0.386471332306177 0.317526609768396 0.368043438179296 0.529813781212159 0.691584124245021 0.69295837868457  0.655502915538459 0.618047452392347 0.580591989246236 0.543136526100125 0.505681062954014 0.468225599807903 0.430770136661792 0.393314673515681 0.35585921036957  0.318403747223459 0.280948284077348]\n```\n\n**Related function**: [pwlfPredict](https://docs.dolphindb.com/en/Functions/p/pwlfPredict.html)\n"
    },
    "pinverse": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pinverse.html",
        "signatures": [
            {
                "full": "pinverse(X)",
                "name": "pinverse",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [pinverse](https://docs.dolphindb.com/en/Functions/p/pinverse.html)\n\n#### Syntax\n\npinverse(X)\n\n#### Details\n\nCalculate the pseudo-inverse matrix of *X*.\n\n#### Parameters\n\n**X** is a matrix.\n\n#### Returns\n\nA DOUBLE matrix.\n\n#### Example\n\n```\nx=1..4$2:2;\nx.pinverse()\n```\n\n<table id=\"table_nqs_twr_z1c\"><thead><tr><th>\n\ncol1\n\n</th><th>\n\ncol2\n\n</th></tr></thead><tbody><tr><td>\n\n-2\n\n</td><td>\n\n1.5\n\n</td></tr><tr><td>\n\n1\n\n</td><td>\n\n-0.5\n\n</td></tr></tbody>\n</table>```\ny=1..8$2:4\ny.pinverse(); \n```\n\n<table id=\"table_qqs_twr_z1c\"><thead><tr><th>\n\ncol1\n\n</th><th>\n\ncol2\n\n</th></tr></thead><tbody><tr><td>\n\n-1\n\n</td><td>\n\n0.85\n\n</td></tr><tr><td>\n\n-0.5\n\n</td><td>\n\n0.45\n\n</td></tr><tr><td>\n\n0\n\n</td><td>\n\n0.05\n\n</td></tr><tr><td>\n\n0.5\n\n</td><td>\n\n-0.35\n\n</td></tr></tbody>\n</table>```\ns1 = indexedSeries(2012.01.01..2012.01.04, [10, 20, 30, 40])\npinv(s1)\n```\n\n<table id=\"table_uqs_twr_z1c\"><thead><tr><th>\n\ncol1\n\n</th><th>\n\ncol2\n\n</th><th>\n\ncol3\n\n</th><th>\n\ncol4\n\n</th></tr></thead><tbody><tr><td>\n\n0.0033\n\n</td><td>\n\n0.0067\n\n</td><td>\n\n0.01\n\n</td><td>\n\n0.0133\n\n</td></tr></tbody>\n</table>```\nm=matrix(1..10, 11..20)\nm.rename!(2020.01.01..2020.01.10, `A`B);\nm.setIndexedMatrix!()\npinv(m)\n```\n\n<table id=\"table_zqs_twr_z1c\"><thead><tr><th>\n\ncol1\n\n</th><th>\n\ncol2\n\n</th><th>\n\ncol3\n\n</th><th>\n\ncol4\n\n</th><th>\n\ncol5\n\n</th><th>\n\ncol6\n\n</th><th>\n\ncol7\n\n</th><th>\n\ncol8\n\n</th><th>\n\ncol9\n\n</th><th>\n\ncol10\n\n</th></tr></thead><tbody><tr><td>\n\n-0.0945\n\n</td><td>\n\n-0.0758\n\n</td><td>\n\n-0.057\n\n</td><td>\n\n-0.0382\n\n</td><td>\n\n-0.0194\n\n</td><td>\n\n-0.0006\n\n</td><td>\n\n0.0182\n\n</td><td>\n\n0.037\n\n</td><td>\n\n0.0558\n\n</td><td>\n\n0.0745\n\n</td></tr><tr><td>\n\n0.04\n\n</td><td>\n\n0.0333\n\n</td><td>\n\n0.0267\n\n</td><td>\n\n0.02\n\n</td><td>\n\n0.0133\n\n</td><td>\n\n0.0067\n\n</td><td>\n\n0\n\n</td><td>\n\n-0.0067\n\n</td><td>\n\n-0.0133\n\n</td><td>\n\n-0.02\n\n</td></tr></tbody>\n</table>For a matrix without a full rank, calculating the inverse will raise an error. The pseudo inverse can be calculated.\n\n```\nx=1 2 3 1 2 3$2:3\ninverse(x) // Error: The argument of 'inverse' must be a square matrix.\npinverse(x)\n```\n\n| col1    | col2    |\n| ------- | ------- |\n| -0.1067 | 0.2267  |\n| 0.4133  | -0.2533 |\n| -0.0667 | 0.2667  |\n\nRelated function: [inverse](https://docs.dolphindb.com/en/Functions/i/inverse.html)\n\n"
    },
    "pipeline": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pipeline.html",
        "signatures": [
            {
                "full": "pipeline(initTasks, followers, [queueDepth=2])",
                "name": "pipeline",
                "parameters": [
                    {
                        "full": "initTasks",
                        "name": "initTasks"
                    },
                    {
                        "full": "followers",
                        "name": "followers"
                    },
                    {
                        "full": "[queueDepth=2]",
                        "name": "queueDepth",
                        "optional": true,
                        "default": "2"
                    }
                ]
            }
        ],
        "markdown": "### [pipeline](https://docs.dolphindb.com/en/Functions/p/pipeline.html)\n\n\n\n#### Syntax\n\npipeline(initTasks, followers, \\[queueDepth=2])\n\n#### Details\n\nOptimize tasks that meet the following conditions through multithreading:\n\n1. Can be decomposed into multiple sub-tasks.\n\n2. Each subtask contains multiple steps.\n\n3. The kth step of the ith subtask can only be executed after the (k-1)th step of the ith subtask and the kth step of the (i-1)th subtask are completed.\n\n#### Parameters\n\n**initTasks** is the collection of the initial steps of all tasks, which is represented by a zero-argument function. For example, if we have 10 tasks then *initialTasks* is a tuple of 10 zero-argument functions.\n\n**followers** is a set of unary functions, each of which represents a step of the task after the initial step. If a task consists of N steps, followers should have N-1 unary functions. The output of a follower is the input of the next follower. The last follower may or may not return an object. The initial step of tasks is executed in the main thread (the thread that accepted the tasks) and the remaining steps will be executed in separate threads. To execute tasks of N steps, the system creates N-1 threads and these threads will be destroyed upon completion of the job.\n\n**queueDepth** is the maximum depth of the queue for the next step. The intermediate result of each step is stored in the queue for the next follower. When the queue is full, the execution will stop when the next step comsumes data from the queue. The deeper the queue, the less waiting time for the next step. However, a deeper queue consumes more memory. *queueDepth* is optional and the default value is 2.\n\n#### Returns\n\nIf the last step (follower) returns an object, the `pipeline` function returns a tuple. Otherwise, it returns nothing.\n\n#### Examples\n\nIn the following example, we need to convert the partitioned table stockData into a CSV file. This table contains data from 2008 to 2018 and exceeds the available memory of the system, so we cannot load the entire table into memory and then converted it into a CSV file. The task can be divided into multiple sub-tasks, each of which consists of two steps: load one month of data into memory, and then store the data in the CSV file. To store the data of a month in the CSV file, it must be ensured that the data of the month has been loaded into the memory, and the that data of the previous month has been stored in the CSV file.\n\n```\nv = 2000.01M..2018.12M\ndef loadData(m){\nreturn select * from loadTable(\"dfs://stockDB\", \"stockData\") where TradingTime between datetime(date(m)) : datetime(date(m+1))\n}\n\ndef saveData(tb){\ntb.saveText(\"/hdd/hdd0/data/stockData.csv\",',', true)\n}\n\npipeline(each(partial{loadData}, v),saveData);\n```\n"
    },
    "ploadText": {
        "url": "https://docs.dolphindb.com/en/Functions/p/ploadText.html",
        "signatures": [
            {
                "full": "ploadText(filename, [delimiter], [schema], [skipRows=0], [arrayDelimiter], [containHeader], [arrayMarker])",
                "name": "ploadText",
                "parameters": [
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "[delimiter]",
                        "name": "delimiter",
                        "optional": true
                    },
                    {
                        "full": "[schema]",
                        "name": "schema",
                        "optional": true
                    },
                    {
                        "full": "[skipRows=0]",
                        "name": "skipRows",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[arrayDelimiter]",
                        "name": "arrayDelimiter",
                        "optional": true
                    },
                    {
                        "full": "[containHeader]",
                        "name": "containHeader",
                        "optional": true
                    },
                    {
                        "full": "[arrayMarker]",
                        "name": "arrayMarker",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ploadText](https://docs.dolphindb.com/en/Functions/p/ploadText.html)\n\n\n\n#### Syntax\n\nploadText(filename, \\[delimiter], \\[schema], \\[skipRows=0], \\[arrayDelimiter], \\[containHeader], \\[arrayMarker])\n\n#### Details\n\nLoad a text data file in parallel as an in-memory partitioned table. When the file is greater than 16 MB, it returns an in-memory table with sequential partitions. A regular in-memory table is returned otherwise.\n\n**Note:**\n\n* The partitioned table returned by `ploadText` distributes data evenly across all partitions. Each partition holds between 8-16 MB of data.\n* `ploadText` is faster than `loadText` with concurrent data loading.\n* From version 1.30.22/2.00.10 onwards, `ploadText` supports loading a data file that contains a record with multiple newlines.\n\n#### Parameters\n\nPlease refer to function [loadText](https://docs.dolphindb.com/en/Functions/l/loadText.html).\n\n#### Returns\n\nAn in-memory table.\n\n#### Examples\n\n```\nn=1000000\ntimestamp=09:30:00+rand(18000,n)\nID=rand(100,n)\nqty=100*(1+rand(100,n))\nprice=5.0+rand(100.0,n)\nt1 = table(timestamp,ID,qty,price)\nsaveText(t1, \"C:/DolphinDB/Data/t1.txt\");\n\ntimer tt1=loadText(\"C:/DolphinDB/Data/t1.txt\");\n// Time elapsed: 437.236 ms\n\ntimer tt2=ploadText(\"C:/DolphinDB/Data/t1.txt\");\n// Time elapsed: 241.126 ms\n\ntypestr(tt2);\n// SEGMENTED IN-MEMORY TABLE\n```\n\nFor more examples please refer to [loadText](https://docs.dolphindb.com/en/Functions/l/loadText.html).\n"
    },
    "plot": {
        "url": "https://docs.dolphindb.com/en/Functions/p/plot.html",
        "signatures": [
            {
                "full": "plot(data, [labels], [title], [chartType=LINE], [stacking=false], [extras])",
                "name": "plot",
                "parameters": [
                    {
                        "full": "data",
                        "name": "data"
                    },
                    {
                        "full": "[labels]",
                        "name": "labels",
                        "optional": true
                    },
                    {
                        "full": "[title]",
                        "name": "title",
                        "optional": true
                    },
                    {
                        "full": "[chartType=LINE]",
                        "name": "chartType",
                        "optional": true,
                        "default": "LINE"
                    },
                    {
                        "full": "[stacking=false]",
                        "name": "stacking",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[extras]",
                        "name": "extras",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [plot](https://docs.dolphindb.com/en/Functions/p/plot.html)\n\n\n\n#### Syntax\n\nplot(data, \\[labels], \\[title], \\[chartType=LINE], \\[stacking=false], \\[extras])\n\n#### Details\n\nGenerate a chart object.\n\n#### Parameters\n\n**data** could be a vector, tuple, matrix, or table.\n\n* If input is a vector, it produces a single series chart and the vector name is the series name.\n\n* If input is a tuple, each element of the tuple is viewed as a series. The elements of the tuple must all be vectors of the same length. Vectors' names are the series' names.\n\n* If input is a matrix, each column of the matrix is a series and the column labels of the matrix are the series names. If the matrix has row labels, they will serve as data point labels.\n\n* If input is a table, each column of the table is a series and the column names are the series names.\n\n**labels** are the label for each data point. All series of a chart share the same data labels. If input is a matrix, we can set matrix's row labels as data point labels. Otherwise, we need to specify data point labels here if necessary.\n\n**title** could be a string scalar/vector. If *title* is a scalar, it is the chart title; if it is a vector, the first element is the chart title, the second is X axis title, and the third is Y axis title, the second is X-axis title, and the third is Y-axis title, and the fourth is Z-axis title.\n\n**chartType** is the chart type. The default type is LINE. Other options available now are PIE, COLUMN, BAR, AREA, SCATTER and SURFACE.\n\n**stacking** indicates whether the chart is stacked. This parameter is valid when *chartType* is set to LINE or BAR.\n\n**extras** is an optional parameter to extend the properties of `plot`. *extras* must be a dictionary, and its key must be a string.\n\n**Note:**\n\n* Currently, *extras* only supports multiYAxes attribute: {multiYAxes: true}. Set to true to support multiple Y-axis, and set to false to use a shared Y-axis. If you need to use *extras* to add new attribute names and types, please contact us.\n\n* When *charType*=LINE, the multiYAxes attribute must be specified.\n\n* When chartType=SURFACE, data must be a numeric matrix, and the row and column labels of the matrix will be used as the X axis and Y axis ticks respectively. *labels*, *stacking* and *extras* are not supported.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nExample 1: plot a table\n\n```\nx=0.1*(1..100)\ny=0.1*(100..1)\nt=table(x,y)\nplot(t,extras={multiYAxes: true})\n```\n\n![](https://docs.dolphindb.com/en/images/plot01.png)\n\nThe graph above can also be generated by `plot(t[`x`y],extras={multiYAxes: true})`\n\nExample 2: plot a matrix\n\n```\nplot([sin,cos](x),x,\"cos and sin curve\",extras={multiYAxes: false})\n```\n\n![](https://docs.dolphindb.com/en/images/plot02.png)\n\nNote that function names are used as series names, and we specify data labels and the graph title.\n\nExample 3: plot a vector\n\n```\nplot(cumsum(x) as cumsumX, 2012.10.01+1..100, \"cumulative sum of x\")\n```\n\n![](https://docs.dolphindb.com/en/images/plot03.png)\n\ncumsumX are used as series names.\n\nExample 4: plot a tuple\n\n```\nplot([1..10 as x, 10..1 as y], 1..10, extras={multiYAxes: false})\n```\n\n![](https://docs.dolphindb.com/en/images/plot04.png)\n\nx and y are used as series names.\n\nExample 5: plot a bar graph\n\n```\nplot(1..5 as value, `IBM`MSFT`GOOG`XOM`C, `rank, BAR)\n```\n\n![](https://docs.dolphindb.com/en/images/plot05.png)\n\nExample 6: plot a column graph\n\n```\nplot(99 128 196 210 312 as sales, `IBM`MSFT`GOOG`XOM`C, `sales, COLUMN)\n```\n\n![](https://docs.dolphindb.com/en/images/plot06.png)\n\nExample 7: plot a pie graph\n\n```\nplot(99 128 196 210 312 as sales, `IBM`MSFT`GOOG`XOM`C, `sales, PIE)\n```\n\n![](https://docs.dolphindb.com/en/images/plot07.png)\n\nExample 8: scatter plot\n\n```\nx=rand(1.0, 1000);\ny=x+norm(0.0, 0.2, 1000);\nplot(x, y, ,SCATTER)\n```\n\n![](https://docs.dolphindb.com/en/images/plot08.png)\n\nExample 9: Set {multiYAxes : true} and y1, y2, y3 represent different Y axis.\n\n```\nt = table(1 2 3 4 5 as y1, 1200 1300 1400 1500 1600 as y2, 100 300 500 800 900 as y3, 10 20 30 40 50 as date)\nplot([t.y1, t.y2,t.y3], t.date, , LINE, ,  {multiYAxes : true})\n```\n\n![](https://docs.dolphindb.com/en/images/plot09.png)\n\nExample 10: plot a surface with the X, Y, and Z axes named \"a\", \"b\", and \"c\" respectively\n\n```\nm = matrix(\n    [27.80985,49.61936,83.08067,116.6632,130.414,150.7206,220.1871,156.1536,148.6416,203.7845,206.0386,107.1618,68.36975,45.3359,49.96142,21.89279,17.02552,11.74317,14.75226,13.6671,5.677561,3.31234,1.156517,-0.147662],\n    [27.71966,48.55022,65.21374,95.27666,116.9964,133.9056,152.3412,151.934,160.1139,179.5327,147.6184,170.3943,121.8194,52.58537,33.08871,38.40972,44.24843,69.5786,4.019351,3.050024,3.039719,2.996142,2.967954,1.999594],\n    [30.4267,33.47752,44.80953,62.47495,77.43523,104.2153,102.7393,137.0004,186.0706,219.3173,181.7615,120.9154,143.1835,82.40501,48.47132,74.71461,60.0909,7.073525,6.089851,6.53745,6.666096,7.306965,5.73684,3.625628],\n    [16.66549,30.1086,39.96952,44.12225,59.57512,77.56929,106.8925,166.5539,175.2381,185.2815,154.5056,83.0433,62.61732,62.33167,60.55916,55.92124,15.17284,8.248324,36.68087,61.93413,20.26867,68.58819,46.49812,0.2360095],\n    [8.815617,18.3516,8.658275,27.5859,48.62691,60.18013,91.3286,145.7109,116.0653,106.2662,68.69447,53.10596,37.92797,47.95942,47.42691,69.20731,44.95468,29.17197,17.91674,16.25515,14.65559,17.26048,31.22245,46.71704],\n    [6.628881,10.41339,24.81939,26.08952,30.1605,52.30802,64.71007,76.30823,84.63686,99.4324,62.52132,46.81647,55.76606,82.4099,140.2647,81.26501,56.45756,30.42164,17.28782,8.302431,2.981626,2.698536,5.886086,5.268358],\n    [21.83975,6.63927,18.97085,32.89204,43.15014,62.86014,104.6657,130.2294,114.8494,106.9873,61.89647,55.55682,86.80986,89.27802,122.4221,123.9698,109.0952,98.41956,77.61374,32.49031,14.67344,7.370775,0.03711011,0.6423392],\n    [53.34303,26.79797,6.63927,10.88787,17.2044,56.18116,79.70141,90.8453,98.27675,80.87243,74.7931,75.54661,73.4373,74.11694,68.1749,46.24076,39.93857,31.21653,36.88335,40.02525,117.4297,12.70328,1.729771,0.0],\n    [25.66785,63.05717,22.1414,17.074,41.74483,60.27227,81.42432,114.444,102.3234,101.7878,111.031,119.2309,114.0777,110.5296,59.19355,42.47175,14.63598,6.944074,6.944075,27.74936,0.0,0.0,0.09449376,0.07732264],\n    [12.827,69.20554,46.76293,13.96517,33.88744,61.82613,84.74799,121.122,145.2741,153.1797,204.786,227.9242,236.3038,228.3655,79.34425,25.93483,6.944074,6.944074,6.944075,7.553681,0.0,0.0,0.0,0.0],\n    [0.0,68.66396,59.0435,33.35762,47.45282,57.8355,78.91689,107.8275,168.0053,130.9597,212.5541,165.8122,210.2429,181.1713,189.7617,137.3378,84.65395,8.677168,6.956576,8.468093,0.0,0.0,0.0,0.0],\n    [0.0,95.17499,80.03818,59.89862,39.58476,50.28058,63.81641,80.61302,66.37824,198.7651,244.3467,294.2474,264.3517,176.4082,60.21857,77.41475,53.16981,56.16393,6.949235,7.531059,3.780177,0.0,0.0,0.0],\n    [0.0,134.9879,130.3696,96.86325,75.70494,58.86466,57.20374,55.18837,78.128,108.5582,154.3774,319.1686,372.8826,275.4655,130.2632,54.93822,25.49719,8.047439,8.084393,5.115252,5.678269,0.0,0.0,0.0],\n    [0.0,48.08919,142.5558,140.3777,154.7261,87.9361,58.11092,52.83869,67.14822,83.66798,118.9242,150.0681,272.9709,341.1366,238.664,190.2,116.8943,91.48672,14.0157,42.29277,5.115252,0.0,0.0,0.0],\n    [0.0,54.1941,146.3839,99.48143,96.19411,102.9473,76.14089,57.7844,47.0402,64.36799,84.23767,162.7181,121.3275,213.1646,328.482,285.4489,283.8319,212.815,164.549,92.29631,7.244015,1.167,0.0,0.0],\n    [0.0,6.919659,195.1709,132.5253,135.2341,89.85069,89.45549,60.29967,50.33806,39.17583,59.06854,74.52159,84.93402,187.1219,123.9673,103.7027,128.986,165.1283,249.7054,95.39966,10.00284,2.39255,0.0,0.0],\n    [0.0,21.73871,123.1339,176.7414,158.2698,137.235,105.3089,86.63255,53.11591,29.03865,30.40539,39.04902,49.23405,63.27853,111.4215,101.1956,40.00962,59.84565,74.51253,17.06316,2.435141,2.287471,-0.0003636982,0.0],\n    [0.0,0.0,62.04672,136.3122,201.7952,168.1343,95.2046,58.90624,46.94091,49.27053,37.10416,17.97011,30.93697,33.39257,44.03077,55.64542,78.22423,14.42782,9.954997,7.768213,13.0254,21.73166,2.156372,0.5317867],\n    [0.0,0.0,79.62993,139.6978,173.167,192.8718,196.3499,144.6611,106.5424,57.16653,41.16107,32.12764,13.8566,10.91772,12.07177,22.38254,24.72105,6.803666,4.200841,16.46857,15.70744,33.96221,7.575688,-0.04880907],\n    [0.0,0.0,33.2664,57.53643,167.2241,196.4833,194.7966,182.1884,119.6961,73.02113,48.36549,33.74652,26.2379,16.3578,6.811293,6.63927,6.639271,8.468093,6.194273,3.591233,3.81486,8.600739,5.21889,0.0],\n    [0.0,0.0,29.77937,54.97282,144.7995,207.4904,165.3432,171.4047,174.9216,100.2733,61.46441,50.19171,26.08209,17.18218,8.468093,6.63927,6.334467,6.334467,5.666687,4.272203,0.0,0.0,0.0,0.0],\n    [0.0,0.0,31.409,132.7418,185.5796,121.8299,185.3841,160.6566,116.1478,118.1078,141.7946,65.56351,48.84066,23.13864,18.12932,10.28531,6.029663,6.044627,5.694764,3.739085,3.896037,0.0,0.0,0.0],\n    [0.0,0.0,19.58994,42.30355,96.26777,187.1207,179.6626,221.3898,154.2617,142.1604,148.5737,67.17937,40.69044,39.74512,26.10166,14.48469,8.65873,3.896037,3.571392,3.896037,3.896037,3.896037,1.077756,0.0],\n    [0.001229679,3.008948,5.909858,33.50574,104.3341,152.2165,198.1988,191.841,228.7349,168.1041,144.2759,110.7436,57.65214,42.63504,27.91891,15.41052,8.056102,3.90283,3.879774,3.936718,3.968634,0.1236256,3.985531,-0.1835741],\n    [0.0,5.626141,7.676256,63.16226,45.99762,79.56688,227.311,203.9287,172.5618,177.1462,140.4554,123.9905,110.346,65.12319,34.31887,24.5278,9.561069,3.334991,5.590495,5.487353,5.909499,5.868994,5.833817,3.568177]\n)\nm.rename!(2026.01.01+1..25)\n\nplot(data=m,title=[\"surface\",\"a\",\"b\",\"c\"],chartType = SURFACE)\n```\n\n![](https://docs.dolphindb.com/en/images/plot10.png)\n"
    },
    "plotHist": {
        "url": "https://docs.dolphindb.com/en/Functions/p/plotHist.html",
        "signatures": [
            {
                "full": "plotHist(data, [binNum], [range], [title])",
                "name": "plotHist",
                "parameters": [
                    {
                        "full": "data",
                        "name": "data"
                    },
                    {
                        "full": "[binNum]",
                        "name": "binNum",
                        "optional": true
                    },
                    {
                        "full": "[range]",
                        "name": "range",
                        "optional": true
                    },
                    {
                        "full": "[title]",
                        "name": "title",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [plotHist](https://docs.dolphindb.com/en/Functions/p/plotHist.html)\n\n\n\n#### Syntax\n\nplotHist(data, \\[binNum], \\[range], \\[title])\n\n#### Details\n\nGenerate a histogram chart object.\n\n#### Parameters\n\n**data** is a vector, or a matrix column, or a table column.\n\n**binNum** is the number of bins the histogram shows.\n\n**range** is the data range in the histogram.\n\n**title** is graph title.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nx=norm(0.0, 1.0, 10000);\nplotHist(x, 10)\n```\n\n![](https://docs.dolphindb.com/en/images/plotHist01.png)\n\n```\nplotHist(x, 10, -2:2)\n```\n\n![](https://docs.dolphindb.com/en/images/plotHist02.png)\n"
    },
    "pnodeRun": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pnodeRun.html",
        "signatures": [
            {
                "full": "pnodeRun(function,[nodes],[addNodeAlias=true])",
                "name": "pnodeRun",
                "parameters": [
                    {
                        "full": "function",
                        "name": "function"
                    },
                    {
                        "full": "[nodes]",
                        "name": "nodes",
                        "optional": true
                    },
                    {
                        "full": "[addNodeAlias=true]",
                        "name": "addNodeAlias",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [pnodeRun](https://docs.dolphindb.com/en/Functions/p/pnodeRun.html)\n\n\n\n#### Syntax\n\npnodeRun(function,\\[nodes],\\[addNodeAlias=true])\n\n#### Details\n\nCall a local function on specified nodes in a cluster in parallel and then merge the results.\n\n* If *nodes* is specified, the function is called on specified nodes.\n* If *nodes* is not specified,\n  * When `pnodeRun` is called on a compute node within a compute group, *function* is executed on all compute nodes within the group.\n  * Otherwise it is executed on all data nodes and and compute nodes which are not included in any compute groups.\n\n#### Parameters\n\n**function** is 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.\n\n**nodes** (optional) is a STRING scalar or vector indicating node alias(es). If not specified, the system will call the function on all active data nodes and compute nodes in the cluster.\n\n**addNodeAlias** (optional) is a Boolean value specifying whether to add node aliases in results. The default value is true. Set to false if node results already contain aliases.\n\n#### Returns\n\n* If the called function returns a scalar, dictionary, or table, a table is returned.\n\n* If the called function returns a vector, a matrix is returned.\n\n* If the called function returns a dictionary, a table is returned.\n\n* If the called function is a command (with no return value), null is returned.\n\n* In other cases, a dictionary is returned.\n\n#### Examples\n\nEx. 1 Call function `getChunksMeta` without specifying parameters\n\n```\npnodeRun(getChunksMeta,,false);\n```\n\n| site      | chunkId                              | path                                                                      | dfsPath              | type | flag | size | version | state | versionList              |\n| --------- | ------------------------------------ | ------------------------------------------------------------------------- | -------------------- | ---- | ---- | ---- | ------- | ----- | ------------------------ |\n| local8848 | bd13090e-7177-01a7-4ac4-840e1b977dcf | D:130DolphinDB\\_Win64\\_Vserverlocal8848storage/CHUNKS/compo/20190605/GOOG | /compo/20190605/GOOG | 1    | 0    | 0    | 1       | 0     | cid : 40,pt2=>40:6729; # |\n| 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; # |\n| local8848 | f8ee72c9-dad3-f49e-430e-5ddb3c61ae18 | D:130DolphinDB\\_Win64\\_Vserverlocal8848storage/CHUNKS/compo/20190604/MSFT | /compo/20190604/MSFT | 1    | 0    | 0    | 1       | 0     | cid : 40,pt2=>40:6664; # |\n| local8848 | 08e26b5a-dfac-799f-4979-0dd3902eae6e | D:130DolphinDB\\_Win64\\_Vserverlocal8848storage/CHUNKS/compo/20190604/GOOG | /compo/20190604/GOOG | 1    | 0    | 0    | 1       | 0     | cid : 40,pt2=>40:6635; # |\n| local8848 | f9e53a3d-af3e-018d-4bfa-a2b4980f3561 | D:130DolphinDB\\_Win64\\_Vserverlocal8848storage/CHUNKS/compo/20190604/AAPL | /compo/20190604/AAPL | 1    | 0    | 0    | 1       | 0     | cid : 40,pt2=>40:6783; # |\n| local8848 | 417e49e9-5c61-cf9e-4b21-4b35f8e57273 | D:130DolphinDB\\_Win64\\_Vserverlocal8848storage/CHUNKS/compo/20190601/MSFT | /compo/20190601/MSFT | 1    | 0    | 0    | 1       | 0     | cid : 40,pt2=>40:6602; # |\n| local8848 | 3ee64942-1d72-bea7-4bc1-f720132d9288 | D:130DolphinDB\\_Win64\\_Vserverlocal8848storage/CHUNKS/compo/20190602/AAPL | /compo/20190602/AAPL | 1    | 0    | 0    | 1       | 0     | cid : 40,pt2=>40:6749; # |\n\nEx. 2 In the following example, the function `sum` and arguments 1..10 are wrapped into a partial application `sum{1..10}`.\n\n```\npnodeRun(sum{1..10}, `nodeA`nodeB);\n```\n\n| Node       | Value |\n| ---------- | ----- |\n| DFS\\_NODE2 | 55    |\n| DFS\\_NODE3 | 55    |\n\nEx. 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:\n\n```\ndef jobDemo(n){\n    s = 0\n    for (x in 1 : n) {\n        s += sum(sin rand(1.0, 100000000)-0.5)\n        print(\"iteration \" + x + \" \" + s)\n    }\n    return s\n};\n\nsubmitJob(\"jobDemo1\",\"job demo\", jobDemo, 10);\nsubmitJob(\"jobDemo2\",\"job demo\", jobDemo, 10);\nsubmitJob(\"jobDemo3\",\"job demo\", jobDemo, 10);\n```\n\nTo check the status of the most recent 2 completed batch jobs on each of the 4 nodes in the cluster:\n\n```\npnodeRun(getRecentJobs{2});\n```\n\n| Node       | UserID | JobID    | JobDesc  | ReceivedTime            | StartTime               | EndTime                 | ErrorMsg |\n| ---------- | ------ | -------- | -------- | ----------------------- | ----------------------- | ----------------------- | -------- |\n| DFS\\_NODE1 | root   | jobDemo2 | job demo | 2017.11.16T13:04:38.841 | 2017.11.16T13:04:38.841 | 2017.11.16T13:04:51.660 |          |\n| DFS\\_NODE1 | root   | jobDemo3 | job demo | 2017.11.16T13:04:38.841 | 2017.11.16T13:04:38.843 | 2017.11.16T13:04:51.447 |          |\n| DFS\\_NODE2 | root   | jobDemo2 | job demo | 2017.11.16T13:04:56.431 | 2017.11.16T13:04:56.432 | 2017.11.16T13:05:11.992 |          |\n| DFS\\_NODE2 | root   | jobDemo3 | job demo | 2017.11.16T13:04:56.432 | 2017.11.16T13:04:56.434 | 2017.11.16T13:05:11.670 |          |\n| DFS\\_NODE3 | root   | jobDemo2 | job demo | 2017.11.16T13:05:08.418 | 2017.11.16T13:05:08.419 | 2017.11.16T13:05:29.176 |          |\n| DFS\\_NODE3 | root   | jobDemo3 | job demo | 2017.11.16T13:05:08.419 | 2017.11.16T13:05:08.421 | 2017.11.16T13:05:29.435 |          |\n| DFS\\_NODE4 | root   | jobDemo2 | job demo | 2017.11.16T13:05:16.324 | 2017.11.16T13:05:16.325 | 2017.11.16T13:05:34.729 |          |\n| DFS\\_NODE4 | root   | jobDemo3 | job demo | 2017.11.16T13:05:16.325 | 2017.11.16T13:05:16.328 | 2017.11.16T13:05:34.716 |          |\n\n```\npnodeRun(getRecentJobs{2}, `DFS_NODE3`DFS_NODE4);\n```\n\n| Node       | UserID | JobID    | JobDesc  | ReceivedTime            | StartTime               | EndTime                 | ErrorMsg |\n| ---------- | ------ | -------- | -------- | ----------------------- | ----------------------- | ----------------------- | -------- |\n| DFS\\_NODE3 | root   | jobDemo2 | job demo | 2017.11.16T13:05:08.418 | 2017.11.16T13:05:08.419 | 2017.11.16T13:05:29.176 |          |\n| DFS\\_NODE3 | root   | jobDemo3 | job demo | 2017.11.16T13:05:08.419 | 2017.11.16T13:05:08.421 | 2017.11.16T13:05:29.435 |          |\n| DFS\\_NODE4 | root   | jobDemo2 | job demo | 2017.11.16T13:05:16.324 | 2017.11.16T13:05:16.325 | 2017.11.16T13:05:34.729 |          |\n| DFS\\_NODE4 | root   | jobDemo3 | job demo | 2017.11.16T13:05:16.325 | 2017.11.16T13:05:16.328 | 2017.11.16T13:05:34.716 |          |\n\nHow does `pnodeRun` merge the results from multiple nodes:\n\n1. If *function* returns a scalar:\n\n   Return a table with 2 columns: node alias and function results.\n\n   Continuing with the example above:\n\n   ```\n   pnodeRun(getJobReturn{`jobDemo1});\n   ```\n\n   | Node       | Value         |\n   | ---------- | ------------- |\n   | DFS\\_NODE3 | 2,123.5508    |\n   | DFS\\_NODE2 | (42,883.5404) |\n   | DFS\\_NODE1 | 3,337.4107    |\n   | DFS\\_NODE4 | (2,267.3681)  |\n\n2. If *function* returns a vector:\n\n   Return a matrix. Each column of the matrix would be the function returns from nodes. The column label of the matrix would be the nodes.\n\n3. If *function* returns a key-value dictionary:\n\n   Return a table with each row representing the function return from one node.\n\n4. If *function* returns a table:\n\n   Return a table which is the union of individual tables from multiple nodes.\n\n5. If *function* is a command (a command returns nothing):\n\n   Return nothing\n\n6. For all other cases:\n\n   Return a dictionary. The key is node alias and the value is the function return.\n"
    },
    "point": {
        "url": "https://docs.dolphindb.com/en/Functions/p/point.html",
        "signatures": [
            {
                "full": "point(X, Y)",
                "name": "point",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [point](https://docs.dolphindb.com/en/Functions/p/point.html)\n\n\n\n#### Syntax\n\npoint(X, Y)\n\n#### Details\n\nGenerate a POINT type data to store the location of a midpoint in the coordinate system.\n\nThe length of a POINT type is 16 bytes. The low 8 bytes are stored in *X* and the high 8 bytes are stored in *Y*.\n\n#### Parameters\n\n**X** and **Y** are numeric scalars, pairs, vectors or matrices. They can be of integral (compress or INT128 not included) or floating type.\n\n#### Returns\n\nA POINT scalar or vector.\n\n#### Examples\n\n```\npoint(117.60972, 24.118418)\n// output: (117.60972, 24.118418)\n\npoint(1..5,6..10)\n```\n\n| 0          | 1          | 2          | 3          | 4           |\n| ---------- | ---------- | ---------- | ---------- | ----------- |\n| (1.0, 6.0) | (2.0, 7.0) | (3.0, 8.0) | (4.0, 9.0) | (5.0, 10.0) |\n\nRelated functions: [highDouble](https://docs.dolphindb.com/en/Functions/h/highDouble.html), [lowDouble](https://docs.dolphindb.com/en/Functions/l/lowDouble.html)\n"
    },
    "poly1d": {
        "url": "https://docs.dolphindb.com/en/Functions/p/poly1d.html",
        "signatures": [
            {
                "full": "polyPredict(model, X)",
                "name": "polyPredict",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [poly1d](https://docs.dolphindb.com/en/Functions/p/poly1d.html)\n\nAlias for [polyPredict](https://docs.dolphindb.com/en/Functions/p/polyPredict.html)\n\n\nDocumentation for the `polyPredict` function:\n### [polyPredict](https://docs.dolphindb.com/en/Functions/p/polyPredict.html)\n\n\n\n#### Syntax\n\npolyPredict(model, X)\n\nAlias: poly1d\n\n#### Details\n\nCalculate the value of the dependent variable for a one-dimensional polynomial based on the given coefficients and independent variable.\n\n#### Parameters\n\n**model** is a numeric vector indicating the polynomial coefficients in ascending powers. It must not contain null values.\n\n**X** is a numeric scalar or vector indicating the independent variable. It must not contain null values.\n\n#### Returns\n\nA numeric vector of the same length as *X*.\n\n#### Examples\n\nFor a third-degree polynomial `2x^3+3x^2+4x+5` with coefficients \\[5,4,3,2] in ascending powers, the value of the dependent variable can be calculated:\n\n```\nmodel = [5,4,3,2]\nx = [2.0,5.0,3.0,3.0,4.0,5.0]\ny = poly1d(model,x)\ny\n//output: [41,350,98,98,197,350]\n```\n\nWith the model and y in the above example, the coefficients can be calculated with `polyFit`:\n\n```\npolyFit(x,y,3)\n// output: [5,4,3,2]\n```\n\nRelated function: [polyFit](https://docs.dolphindb.com/en/Functions/p/polyFit.html)\n"
    },
    "polyFit": {
        "url": "https://docs.dolphindb.com/en/Functions/p/polyFit.html",
        "signatures": [
            {
                "full": "polyFit(X, Y, n, mode)",
                "name": "polyFit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    },
                    {
                        "full": "mode",
                        "name": "mode"
                    }
                ]
            }
        ],
        "markdown": "### [polyFit](https://docs.dolphindb.com/en/Functions/p/polyFit.html)\n\n\n\n#### Syntax\n\npolyFit(X, Y, n, mode)\n\n#### Details\n\nReturn a vector indicating the least-squares fit polynomial coefficients in ascending powers for a polynomial `p(X)` of degree *n* that is a best fit (in a least-squares sense) for the data in *Y*.\n\nDifference from Python's `numpy.polyfit`: Both functions perform a least-squares polynomial fit. NumPy's `polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False)` returns coefficients in descending powers and supports parameters such as *rcond*, *full*, *w*, and *cov*. Its *y* can also be a 2-D array for fitting multiple data sets at once. DolphinDB's `polyFit(X, Y, n, mode)` requires *X* and *Y* to be numeric vectors of the same length without null values, and returns coefficients in ascending powers. DolphinDB uses *mode* to control whether to return a vector or a dictionary containing prediction-function information.\n\n#### Parameters\n\n**X**is a numeric vector specifying the query points. The points in *X*correspond to the fitted function values contained in *Y*.\n\n**Y** is a numeric vector of the same length as X, which specifies the fitted values at query points. It must not contain null values.\n\n**n** is a non-negative scalar indicating the degree of polynomial fit.\n\n**mode** is a Boolean scalar indicating whether to return a dictionary of a vector. Defaults to 0, meaning to return a vector.\n\n#### Returns\n\nA DOUBLE vector indicating the coefficients in ascending order.\n\n#### Examples\n\n```\nx = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]\ny = [0.0, 0.8, 0.9, 0.1, -0.8, -1.0]\nz = polyFit(x, y, 3)\nz\n// output: [-0.0397,1.6931,-0.8135,0.087]\n\nz = polyFit(x, y, 3, 1)\n/*output: \nmodelName->polyFit\nz->[-0.039682539682536,1.693121693121692,-0.813492063492063,0.087037037037037]\npredict->polyPredict\n*/\n```\n\nRelated Function: [polyPredict](https://docs.dolphindb.com/en/Functions/p/polyPredict.html)\n"
    },
    "polynomial": {
        "url": "https://docs.dolphindb.com/en/Functions/p/polynomial.html",
        "signatures": [
            {
                "full": "polynomial(X, coeffs)",
                "name": "polynomial",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "coeffs",
                        "name": "coeffs"
                    }
                ]
            }
        ],
        "markdown": "### [polynomial](https://docs.dolphindb.com/en/Functions/p/polynomial.html)\n\n\n\n#### Syntax\n\npolynomial(X, coeffs)\n\n#### Details\n\nApply the polynomial coefficient vector coeffs on each element of *X*.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n**coeffs** is a vector indicating the coefficients of a polynomial.\n\n#### Returns\n\nReturns a vector of the same length as *X*.\n\n#### Examples\n\nThe following example calculates ![](https://docs.dolphindb.com/en/images/polynomial.png) for each number from 1 to 10.\n\n```\npolynomial(1..10, 1 2 3);\n// output: [6,17,34,57,86,121,162,209,262,321]\n```\n"
    },
    "polyPredict": {
        "url": "https://docs.dolphindb.com/en/Functions/p/polyPredict.html",
        "signatures": [
            {
                "full": "polyPredict(model, X)",
                "name": "polyPredict",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [polyPredict](https://docs.dolphindb.com/en/Functions/p/polyPredict.html)\n\n\n\n#### Syntax\n\npolyPredict(model, X)\n\nAlias: poly1d\n\n#### Details\n\nCalculate the value of the dependent variable for a one-dimensional polynomial based on the given coefficients and independent variable.\n\n#### Parameters\n\n**model** is a numeric vector indicating the polynomial coefficients in ascending powers. It must not contain null values.\n\n**X** is a numeric scalar or vector indicating the independent variable. It must not contain null values.\n\n#### Returns\n\nA numeric vector of the same length as *X*.\n\n#### Examples\n\nFor a third-degree polynomial `2x^3+3x^2+4x+5` with coefficients \\[5,4,3,2] in ascending powers, the value of the dependent variable can be calculated:\n\n```\nmodel = [5,4,3,2]\nx = [2.0,5.0,3.0,3.0,4.0,5.0]\ny = poly1d(model,x)\ny\n//output: [41,350,98,98,197,350]\n```\n\nWith the model and y in the above example, the coefficients can be calculated with `polyFit`:\n\n```\npolyFit(x,y,3)\n// output: [5,4,3,2]\n```\n\nRelated function: [polyFit](https://docs.dolphindb.com/en/Functions/p/polyFit.html)\n"
    },
    "pop!": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pop!.html",
        "signatures": [
            {
                "full": "pop!(X)",
                "name": "pop!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [pop!](https://docs.dolphindb.com/en/Functions/p/pop!.html)\n\n\n\n#### Syntax\n\npop!(X)\n\n#### Details\n\nRemove the last element of *X*.\n\n#### Parameters\n\n**X** is a vector.\n\n#### Returns\n\nA scalar of the same type as*X*, indicating the removed element.\n\n#### Examples\n\n```\nx = 1 2 3;\npop!(x);\n// output: 3\n\nx;\n// output: [1,2]\n```\n\n**Related functions:** [drop](https://docs.dolphindb.com/en/Functions/d/drop.html), [removeHead!](https://docs.dolphindb.com/en/Functions/r/removeHead!.html), [removeTail!](https://docs.dolphindb.com/en/Functions/r/removeTail!.html), [remove!](https://docs.dolphindb.com/en/Functions/r/remove.html)\n"
    },
    "portfolioPricer": {
        "url": "https://docs.dolphindb.com/en/Functions/p/portfolioPricer.html",
        "signatures": [
            {
                "full": "portfolioPricer(instrument, amount, pricingDate, marketData)",
                "name": "portfolioPricer",
                "parameters": [
                    {
                        "full": "instrument",
                        "name": "instrument"
                    },
                    {
                        "full": "amount",
                        "name": "amount"
                    },
                    {
                        "full": "pricingDate",
                        "name": "pricingDate"
                    },
                    {
                        "full": "marketData",
                        "name": "marketData"
                    }
                ]
            }
        ],
        "markdown": "### [portfolioPricer](https://docs.dolphindb.com/en/Functions/p/portfolioPricer.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nportfolioPricer(instrument, amount, pricingDate, marketData)\n\n#### Details\n\nPrices a portfolio.\n\n#### Parameters\n\n**instrument**is an INSTRUMENT object indicating the instrument(s) to be priced. It can be a single contract or multiple contracts.\n\n**amount**is an INT scalar or a vector of the same length as *instrument*, indicating the amount of the contracts.\n\n**pricingDate** is a DATE scalar specifying the pricing date.\n\n**marketData**A MKTDATA vector, a nested dictionary, the handle of a market data engine or a user-defined function, indicating the market data.\n\n* For a MKTDATA vector:\n\n  * Specify curveName for the curve market data.\n\n  * Specify surfaceName for the surface market data.\n\n* For a nested dictionary:\n\n  * First level: The key is the market data types. It can be \"Price\", \"Curve\", or \"Surface\".\n\n  * Second level: The key is the pricing date and the value is a DATE scalar.\n\n  * Third level: The key is the curve or surface name and the value is the corresponding MKTDATA scalar.\n\n* For a user-defined function: parameters should be (kind, date, name).\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Matching Rules of Instrument and MarketData\n\nCurrently, only instrument types illustrated as leaf nodes in the classification tree below are supported:\n\n![](https://docs.dolphindb.com/en/Functions/images/instrumentPricer.png)\n\nThe system determines the market data according to the following priority when pricing:\n\n1. If the *instrument* explicitly specifies the market data, use the specified market data;\n\n2. If not, the system automatically matches suitable market data based on predefined rules.\n\nThe matching rules for different financial instruments are described in detail below.\n\n##### Bond (Bond)\n\nBond pricing requires a discount curve. Specify the discount curve name via the \"discountCurve\" field, for example:\n\n```\nbond = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"1382011.IB\",\n    \"start\": \"2013.01.14\",\n    \"maturity\": \"2028.01.14\",\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.058,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\"\n    \"currency\": \"CNY\",              //optional\n    \"subType\": \"MTN\",               //optional\n    \"creditRating\": \"AAA\",          //optional\n    \"discountCurve\": \"CNY_MTN_AAA\"  //optional\n}\n```\n\nRules for selecting the discount curve:\n\n* If \"discountCurve\" is specified, the function looks up the corresponding curve directly in the *marketData* parameter.\n\n* If \"discountCurve\" is not specified but \"currency\", \"subType\", and \"creditRating\" are specified, the system automatically generates a discount curve name of the form `currency + \"_\" + subType + \"_\" + creditRating`, where \"currency\" defaults to \"CNY\".\n\n* If none of the optional fields are provided, the discount curve defaults to \"CNY\\_TREASURY\\_BOND\".\n\n##### Treasury Futures (BondFutures)\n\nThe deliverable basket of treasury futures are treasury bonds, the rules for selecting the discount curve when defining the *instrument* are:\n\n* If the \"discountCurve\" field is specified, use the specified curve for pricing.\n\n* If not, use the default discount curve \"CNY\\_TREASURY\\_BOND\".\n\n##### Deposit (Deposit)\n\nFor deposit pricing, specify only the discount curve \"discountCurve\":\n\n* If the \"discountCurve\" field is specified, use the specified curve for pricing.\n\n* If not, the system automatically matches the discount curve based on the currency.\n\n| currency | discountCurve |\n| -------- | ------------- |\n| CNY      | CNY\\_FR\\_007  |\n| USD      | USD\\_SOFR     |\n| EUR      | EUR\\_EONIA    |\n\n##### IR Fixed-Floating Swap (IrFixedFloatingSwap)\n\nPricing an IR Fixed-Floating Swap requires three curves: discountCurve, forwardCurve, and assetPriceCurve. The current version only supports swaps that use FR\\_007 or SHIBOR\\_3M as the floating reference rate.\n\n* If the curve is specified in the *instrument* parameter, use the specified curve for pricing.\n\n* If not, the system automatically selects default curves based on the currency and the floating reference rate.\n\n| currency | iborIndex  | discountCurve | forwardCurve    | assetPriceCurve   |\n| -------- | ---------- | ------------- | --------------- | ----------------- |\n| CNY      | FR\\_007    | CNY\\_FR\\_007  | CNY\\_FR\\_007    | PRICE\\_FR\\_007    |\n| CNY      | SHIBOR\\_3M | CNY\\_FR\\_007  | CNY\\_SHIBOR\\_3M | PRICE\\_SHIBOR\\_3M |\n\nThe assetPriceCurve is the historical data of the floating reference rate, which is used to calculate the floating rate for the first cash flow of the pricing date.\n\n##### Foreign Exchange Forward (FxForward) / Foreign Exchange Swap (FxSwap)\n\nPricing these two linear products requires binding \"domesticCurve\" and \"foreignCurve\", and retrieving the corresponding \"FxSpot\" based on the \"currencyPair\".\n\n* If the user specifies \"domesticCurve\" and \"foreignCurve\", use the specified curves.\n\n* If not, the system automatically selects default curves according to the \"currencyPair\".\n\n| currencyPair | domesticCurve | foreignCurve    |\n| ------------ | ------------- | --------------- |\n| USDCNY       | CNY\\_FR\\_007  | USD\\_USDCNY\\_FX |\n| EURCNY       | CNY\\_FR\\_007  | EUR\\_EURCNY\\_FX |\n| EURUSD       | USD\\_SOFR     | EUR\\_EURUSD\\_FX |\n\nThe \"foreignCurve\" is the implied foreign discount curve inferred using the covered interest rate parity formula based on foreign exchange swap.\n\n##### Fx European Style Option (FxEuropeanOption)\n\nIn addition to \"domesticCurve\" and \"foreignCurve\", Fx European Style Option pricing also requires \"FxSpot\" and the \"FxVolatilitySurface\". Both of these market data can be automatically matched based on the \"underlying\" (the currency pair).\n\n* If the *instrument* explicitly specifies \"domesticCurve\", \"foreignCurve\", use them directly.\n\n* If not, the system automatically matches based on \"underlying\" (the currency pair).\n\n| currencyPair | fxSpot | domesticCurve | foreignCurve    | volSurf |\n| ------------ | ------ | ------------- | --------------- | ------- |\n| USDCNY       | USDCNY | CNY\\_FR\\_007  | USD\\_USDCNY\\_FX | USDCNY  |\n| EURCNY       | EURCNY | CNY\\_FR\\_007  | EUR\\_EURCNY\\_FX | EURCNY  |\n| EURUSD       | EURUSD | USD\\_SOFR     | EUR\\_EURUSD\\_FX | EURUSD  |\n\n#### Examples\n\n```\n// instrument\n\n//FX Forward\nfxFwd1 = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.10.08,\n    \"delivery\": 2025.10.10,\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 7.2\n}\n\nfxFwdUsdCny = parseInstrument(fxFwd1)\n\nfxFwd2 = {\n    \"productType\": \"Forward\",\n    \"forwardType\": \"FxForward\",\n    \"expiry\": 2025.10.08,\n    \"delivery\": 2025.10.10,\n    \"currencyPair\": \"EURCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 8.2\n}\n\nfxFwdEurCny = parseInstrument(fxFwd2)\n\n//FX Swap\nfxSwap1 = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"USDCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 7.2,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 7.3,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\n\nfxSwapUsdCny = parseInstrument(fxSwap1)\n\nfxSwap2 = {\n    \"productType\": \"Swap\",\n    \"swapType\": \"FxSwap\",\n    \"currencyPair\": \"EURCNY\",\n    \"direction\": \"Buy\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"nearStrike\": 8.2,\n    \"nearExpiry\": 2025.12.08,\n    \"nearDelivery\": 2025.12.10,\n    \"farStrike\": 8.3,\n    \"farExpiry\": 2026.06.08,\n    \"farDelivery\": 2026.06.10\n}\n\nfxSwapEurCny = parseInstrument(fxSwap2)\n\n//FX European Option\nfxOption1 = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"USD\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 7.0,\n    \"maturity\": 2025.12.08,\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"USDCNY\"\n}\n\nfxOptionUsdCny = parseInstrument(fxOption1)\n\nfxOption2 = {\n    \"productType\": \"Option\",\n    \"optionType\": \"EuropeanOption\",\n    \"assetType\": \"FxEuropeanOption\",\n    \"notionalCurrency\": \"EUR\",\n    \"notionalAmount\": 1E6,\n    \"strike\": 8.0,\n    \"maturity\": 2025.12.08,\n    \"payoffType\": \"Call\",\n    \"dayCountConvention\": \"Actual365\",\n    \"underlying\": \"EURCNY\"\n}\n\nfxOptionEurCny= parseInstrument(fxOption2)\n\n//Bond\nbond1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"instrumentId\": \"220010.IB\",\n    \"start\": 2020.12.25,\n    \"maturity\": 2031.12.25,\n    \"issuePrice\": 100.0,\n    \"coupon\": 0.0149,\n    \"frequency\": \"Annual\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"discountCurve\": \"CNY_TREASURY_BOND\"\n}\n\nbond = parseInstrument(bond1)\n\n//Government Bond Futures\nbondFut1 = {\n    \"productType\": \"Futures\",\n    \"futuresType\": \"BondFutures\",\n    \"instrumentId\": \"T2509\",\n    \"nominal\": 100.0,\n    \"maturity\": \"2025.09.12\",\n    \"settlement\": \"2025.09.16\",\n    \"underlying\": bond1,\n    \"nominalCouponRate\": 0.03\n}\n\nbondFut = parseInstrument(bondFut1)\n\n//Deposit\ndeposit1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Deposit\",\n    \"start\": 2025.06.15,\n    \"maturity\": 2025.12.15,\n    \"rate\": 0.02,\n    \"dayCountConvention\": \"Actual360\",\n    \"notionalCurrency\":\"CNY\",\n    \"notionalAmount\": 1E6,\n    \"payReceive\": \"Receive\"\n}\n\ndeposit = parseInstrument(deposit1)\n\n//Interest Rate Swap\nirs1 =  {\n    \"productType\": \"Swap\",\n    \"swapType\": \"IrSwap\",\n    \"irSwapType\": \"IrFixedFloatingSwap\",\n    \"start\": 2025.06.16,\n    \"maturity\": 2028.06.16,\n    \"frequency\": \"Quarterly\",\n    \"fixedRate\": 0.018,\n    \"calendar\": \"CFET\", \n    \"fixedDayCountConvention\": \"Actual365\",\n    \"floatingDayCountConvention\": \"Actual365\",\n    \"payReceive\": \"Pay\",\n    \"iborIndex\": \"FR_007\",\n    \"spread\": 0.0001,\n    \"notionalCurrency\":\"CNY\",\n    \"notionalAmount\": 1E8\n}\n\nirs = parseInstrument(irs1)\n\n\n//mktData\naod = 2025.08.18\n\nfxSpot1 = {\n    \"mktDataType\": \"Price\",\n    \"priceType\": \"FxSpotRate\",\n    \"spotDate\": aod+2 ,\n    \"referenceDate\": aod ,\n    \"value\": 7.1627,\n    \"unit\": \"USDCNY\"\n}\n\nfxSpotUsdCny = parseMktData(fxSpot1)\n\nfxSpot2 = {\n    \"mktDataType\": \"Price\",\n    \"priceType\": \"FxSpotRate\",\n    \"spotDate\": aod+2 ,\n    \"referenceDate\": aod ,\n    \"value\": 8.3768,\n    \"unit\": \"EURCNY\"\n}\n\nfxSpotEurCny = parseMktData(fxSpot2)\n\ncurve1 = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"CNY_FR_007\",\n    \"referenceDate\": aod,\n    \"currency\": \"CNY\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24,2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20, 2028.08.21],\n    \"values\":[1.4759, 1.5331, 1.5697, 1.5239, 1.4996, 1.5144, 1.5209, \n              1.5539, 1.5461, 1.5316, 1.5376, 1.5435, 1.5699] / 100.0\n}\n\ncurveCnyFr007 = parseMktData(curve1)\n\ncurve2 = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"USD_USDCNY_FX\",\n    \"referenceDate\": aod ,\n    \"currency\": \"USD\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24,2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20, 2028.08.21],\n    \"values\":[4.3345, 4.3801, 4.3119, 4.3065, 4.2922, 4.2196, 4.1599, \n              4.0443, 4.0244, 3.9698, 3.7740, 3.6289, 3.5003] / 100.0\n}\n\ncurveUsdUsdCnyFx = parseMktData(curve2)\n\ncurve3 = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"curveName\": \"EUR_EURCNY_FX\",\n    \"referenceDate\": aod,\n    \"currency\": \"EUR\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Continuous\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"dates\":[2025.08.21, 2025.08.27, 2025.09.03, 2025.09.10, 2025.09.22, 2025.10.20, 2025.11.20, \n             2026.02.24,2026.05.20, 2026.08.20, 2027.02.22, 2027.08.20, 2028.08.21],\n    \"values\":[1.9165, 1.9672, 1.8576, 1.8709, 1.8867, 1.8749,1.8700,\n              1.8576, 1.9253, 1.9738, 1.9908, 1.9850, 2.0362] / 100.0\n}\n\ncurveEurEurCnyFx = parseMktData(curve3)\n\nsurf1 = {\n\t\"surfaceName\": \"USDCNY\",\n\t\"mktDataType\": \"Surface\",\n\t\"surfaceType\": \"FxVolatilitySurface\",\n\t\"referenceDate\": \"2025.08.18\",\n\t\"smileMethod\": \"Linear\",\n\t\"termDates\": [\n\t\t\"2025.08.21\",\n\t\t\"2026.08.20\"\n\t],\n\t\"volSmiles\":[{\"strikes\": [6.5,7,7.5],\"vols\": [0.1,0.1,0.1]},{\"strikes\": [6.5,7,7.5],\"vols\": [0.1,0.1,0.1]}],\n\t\"currencyPair\": \"USDCNY\"\n}\n\nsurfUsdCny = parseMktData(surf1)\n\n\nsurf2 = {\n\t\"surfaceName\": \"EURCNY\",\n\t\"mktDataType\": \"Surface\",\n\t\"surfaceType\": \"FxVolatilitySurface\",\n\t\"referenceDate\": \"2025.08.18\",\n\t\"smileMethod\": \"Linear\",\n\t\"termDates\": [\n\t\t\"2025.08.21\",\n\t\t\"2026.08.20\"\n\t],\n\t\"volSmiles\":[{\"strikes\": [7.5,8.0,8.5],\"vols\": [0.1,0.1,0.1]},{\"strikes\": [7.5,8.0,8.5],\"vols\": [0.1,0.1,0.1]}],\n\t\"currencyPair\": \"EURCNY\"\n}\n\nsurfEurCny = parseMktData(surf2)\n\nbondCurve =  {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"IrYieldCurve\",\n    \"referenceDate\": aod,\n    \"currency\": \"CNY\",\n    \"curveName\": \"CNY_TREASURY_BOND\",\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"compounding\": \"Compounded\",\n    \"interpMethod\": \"Linear\",\n    \"extrapMethod\": \"Flat\",\n    \"frequency\": \"Annual\",\n    // 0.083 0.25 0.5 1.0 2.0 3.0 5.0 7.0 10.0 15.0 20.0 30.0 40.0 50.0\n    \"dates\":[2025.09.18, 2025.11.18, 2026.02.18, 2026.08.18, 2027.08.18, 2028.08.18, 2030.08.18,\n             2032.08.18, 2035.08.18, 2040.08.18, 2045.08.18, 2055.08.18,2065.08.18, 2075.08.18],\n    \"values\":[1.3000, 1.3700, 1.3898, 1.3865, 1.4299, 1.4471, 1.6401,\n              1.7654, 1.7966, 1.9930, 2.1834, 2.1397, 2.1987, 2.2225] / 100.0\n}\n\ncurveCnyTreasuryBond = parseMktData(bondCurve)\n\nfr007HistCurve = {\n    \"mktDataType\": \"Curve\",\n    \"curveType\": \"AssetPriceCurve\",\n    \"curveName\": \"PRICE_FR_007\",\n    \"referenceDate\": aod,\n    \"currency\": \"CNY\",\n    \"dates\":[2025.05.09, 2025.05.12, 2025.05.13, 2025.05.14, 2025.05.15, 2025.05.16, 2025.05.19, 2025.05.20, 2025.05.21, 2025.05.22,\n             2025.05.23, 2025.05.26, 2025.05.27, 2025.05.28, 2025.05.29, 2025.05.30, 2025.06.03, 2025.06.04, 2025.06.05, 2025.06.06,\n             2025.06.09, 2025.06.10, 2025.06.11, 2025.06.12, 2025.06.13, 2025.06.16, 2025.06.17, 2025.06.18, 2025.06.19, 2025.06.20,\n             2025.06.23, 2025.06.24, 2025.06.25, 2025.06.26, 2025.06.27, 2025.06.30, 2025.07.01, 2025.07.02, 2025.07.03, 2025.07.04,\n             2025.07.07, 2025.07.08, 2025.07.09, 2025.07.10, 2025.07.11, 2025.07.14, 2025.07.15, 2025.07.16, 2025.07.17, 2025.07.18,\n             2025.07.21, 2025.07.22, 2025.07.23, 2025.07.24, 2025.07.25, 2025.07.28, 2025.07.29, 2025.07.30, 2025.07.31, 2025.08.01,\n             2025.08.04, 2025.08.05, 2025.08.06, 2025.08.07, 2025.08.08, 2025.08.11, 2025.08.12, 2025.08.13, 2025.08.14, 2025.08.15\n       ],\n    \"values\":[1.6000, 1.5600, 1.5300, 1.5500, 1.5500, 1.6300, 1.6500, 1.6000, 1.5900, 1.5800, \n              1.6300, 1.7000, 1.7000, 1.7000, 1.7500, 1.7500, 1.5900, 1.5800, 1.5700, 1.5600, \n              1.5500, 1.5500, 1.5600, 1.5900, 1.5900, 1.5700, 1.5500, 1.5600, 1.5679, 1.6000, \n              1.5700, 1.8500, 1.8300, 1.8400, 1.8500, 1.9500, 1.6036, 1.5800, 1.5200, 1.5000, \n              1.5000, 1.5100, 1.5100, 1.5300, 1.5200, 1.5500, 1.6000, 1.5400, 1.5400, 1.5000, \n              1.5000, 1.4800, 1.5000, 1.6000, 1.7500, 1.6400, 1.6200, 1.6300, 1.6000, 1.5000, \n              1.4800, 1.4700, 1.4800, 1.4900, 1.4600, 1.4600, 1.4600, 1.4800, 1.4800, 1.4900  \n               ]\\100\n}\n\npriceCurveFr007 = parseMktData(fr007HistCurve)\n\ninstrument = [fxFwdUsdCny, fxFwdEurCny, fxSwapUsdCny, fxSwapEurCny, \n              fxOptionUsdCny, fxOptionEurCny, bond, bondFut, deposit, irs]\nmktData= [fxSpotUsdCny, fxSpotEurCny, curveCnyFr007, \n          curveUsdUsdCnyFx, curveEurEurCnyFx, surfUsdCny, \n          surfEurCny, curveCnyTreasuryBond, priceCurveFr007]\n\npricingDate = aod\n\namount = [1, 2, 3, 4, 5, 6, -7, -8, 9, 10]\n\n// case1: mktData is a vector\nresults1 = portfolioPricer(instrument, amount, pricingDate, mktData)\nprint(results1)\n\n// case2: mktData is a dict\nspots = dict(string, MKTDATA)\nspots[\"USDCNY\"] = fxSpotUsdCny\nspots[\"EURCNY\"] = fxSpotEurCny\ncurves = dict(string, MKTDATA)\ncurves[\"CNY_FR_007\"] = curveCnyFr007\ncurves[\"USD_USDCNY_FX\"] = curveUsdUsdCnyFx\ncurves[\"EUR_EURCNY_FX\"] = curveEurEurCnyFx\ncurves[\"CNY_TREASURY_BOND\"] = curveCnyTreasuryBond\ncurves[\"PRICE_FR_007\"] = priceCurveFr007\nsurfs = dict(string, MKTDATA)\nsurfs[\"USDCNY\"] = surfUsdCny\nsurfs[\"EURCNY\"] = surfEurCny\ndSpots = dict(DATE, ANY)\ndSpots[aod] = spots\ndCurves = dict(DATE, ANY)\ndCurves[aod] = curves\ndSurfs = dict(DATE, ANY)\ndSurfs[aod] = surfs\nmktData2 = dict(STRING, ANY)\nmktData2 = {\"Price\": dSpots,\n            \"Curve\": dCurves,\n            \"Surface\": dSurfs}\nresults2 = portfolioPricer(instrument, amount, pricingDate, mktData2)\nprint(results2)\n```\n\nPrice with market data engine:\n\n```\ntbdata = table(1:0, `eventTime`type`subType`name`term`price, [NANOTIMESTAMP, STRING, STRING, STRING, STRING, DOUBLE])\ninsert into tbdata values(now(), \"Bond\", string(), \"0001\", \"1d\", 3.2415)\ninsert into tbdata values(now(), \"Bond\", string(), \"0002\", \"1d\", 2.1584)\nbond1 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"nominal\": 100,\n    \"instrumentId\": \"0001\",\n    \"start\": 2022.05.15,\n    \"maturity\": 2032.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"cashflow\":[],\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nbond2 = {\n    \"productType\": \"Cash\",\n    \"assetType\": \"Bond\",\n    \"bondType\": \"FixedRateBond\",\n    \"nominal\": 100,\n    \"instrumentId\": \"0002\",\n    \"start\": 2023.05.15,\n    \"maturity\": 2033.05.15,\n    \"dayCountConvention\": \"ActualActualISDA\",\n    \"cashflow\":[],\n    \"coupon\": 0.0276,\n    \"issuePrice\": 100.0,\n    \"frequency\": \"Semiannual\"\n}\nbondcurveConfig = {\n\t\"name\":\"CNY_TREASURY_BOND\",\n\t\"type\": \"BondYieldCurve\",\n\t\"bonds\":[parseInstrument(bond1), parseInstrument(bond2)],\n\t\"currency\": \"CNY\",\n\t\"dayCountConvention\": \"ActualActualISDA\",\n\t\"compounding\": \"Compounded\",\n\t\"frequency\": \"Semiannual\",\n\t\"interpMethod\": \"Linear\",\n\t\"extrapMethod\": \"Flat\",\n\t\"method\": \"Bootstrap\"\n}\nengine1 = createMktDataEngine(\"engine1\", 2022.06.10, bondcurveConfig)\nengine1.append!(tbdata)\nsleep(1000)\nins = parseInstrument(bond1)\nresults3 = portfolioPricer([ins], [1], 2022.06.10, engine1)\nprint(results3)\n```\n\n**Related functions:** [instrumentPricer](https://docs.dolphindb.com/en/Functions/i/instrumentPricer.html), [createMktDataEngine](https://docs.dolphindb.com/en/Functions/c/createMktDataEngine.html)\n"
    },
    "pow": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pow.html",
        "signatures": [
            {
                "full": "pow(X, Y)",
                "name": "pow",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [pow](https://docs.dolphindb.com/en/Functions/p/pow.html)\n\n\n\n#### Syntax\n\npow(X, Y)\n\nAlias: power\n\n#### Details\n\nRaise all elements of *X* to the power of *Y*. The data type of the result is always DOUBLE, even if both *X* and *Y* are integers.\n\n**Note:**\n\n* The core functionality of DolphinDB `pow` is the same as that of [numpy.power](https://numpy.org/doc/stable/reference/generated/numpy.power.html) and Python's built-in [pow](https://docs.python.org/3/library/functions.html#pow). The differences are as follows:\n  * Python's built-in `pow` operates on Python numeric objects and additionally supports the three-parameter form `pow(base, exp, mod)` for efficient modular exponentiation.\n  * `numpy.power` supports more parameters, such as `out`, `where`, and `casting`.\n* `scipy.stats.power` is a function used to simulate the power of a statistical hypothesis test and is completely different from DolphinDB `pow`.\n\n#### Parameters\n\n**X** and **Y** is a scalar/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar, vector or matrix.\n\n#### Examples\n\n```\nx=1 2 3;\npow(x,3);\n// output: [1,8,27]\n\npow(3,x);\n// output: [3,9,27]\n\ny=4.5 5.5 6.5;\npow(x,y);\n// output: [1,45.254834,1262.665039]\n\npow(y,x);\n// output: [4.5,30.25,274.625]\n```\n\n```\nm=1..10$2:5;\nm;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  |\n| 2  | 4  | 6  | 8  | 10 |\n\n```\ntypestr(pow(3,4));\n// output: DOUBLE\n```\n"
    },
    "power": {
        "url": "https://docs.dolphindb.com/en/Functions/p/power.html",
        "signatures": [
            {
                "full": "pow(X, Y)",
                "name": "pow",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [power](https://docs.dolphindb.com/en/Functions/p/power.html)\n\nAlias for [pow](https://docs.dolphindb.com/en/Functions/p/pow.html)\n\n\nDocumentation for the `pow` function:\n### [pow](https://docs.dolphindb.com/en/Functions/p/pow.html)\n\n\n\n#### Syntax\n\npow(X, Y)\n\nAlias: power\n\n#### Details\n\nRaise all elements of *X* to the power of *Y*. The data type of the result is always DOUBLE, even if both *X* and *Y* are integers.\n\n**Note:**\n\n* The core functionality of DolphinDB `pow` is the same as that of [numpy.power](https://numpy.org/doc/stable/reference/generated/numpy.power.html) and Python's built-in [pow](https://docs.python.org/3/library/functions.html#pow). The differences are as follows:\n  * Python's built-in `pow` operates on Python numeric objects and additionally supports the three-parameter form `pow(base, exp, mod)` for efficient modular exponentiation.\n  * `numpy.power` supports more parameters, such as `out`, `where`, and `casting`.\n* `scipy.stats.power` is a function used to simulate the power of a statistical hypothesis test and is completely different from DolphinDB `pow`.\n\n#### Parameters\n\n**X** and **Y** is a scalar/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar, vector or matrix.\n\n#### Examples\n\n```\nx=1 2 3;\npow(x,3);\n// output: [1,8,27]\n\npow(3,x);\n// output: [3,9,27]\n\ny=4.5 5.5 6.5;\npow(x,y);\n// output: [1,45.254834,1262.665039]\n\npow(y,x);\n// output: [4.5,30.25,274.625]\n```\n\n```\nm=1..10$2:5;\nm;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  |\n| 2  | 4  | 6  | 8  | 10 |\n\n```\ntypestr(pow(3,4));\n// output: DOUBLE\n```\n"
    },
    "predict": {
        "url": "https://docs.dolphindb.com/en/Functions/p/predict.html",
        "signatures": [
            {
                "full": "predict(model, X)",
                "name": "predict",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [predict](https://docs.dolphindb.com/en/Functions/p/predict.html)\n\n\n\n#### Syntax\n\npredict(model, X)\n\n#### Details\n\nMake a prediction with the specified prediction model and data.\n\n#### Parameters\n\n**model** is a dictionary of the specifications of a prediction model. It is generated by functions such as [randomForestClassifier](https://docs.dolphindb.com/en/Functions/r/randomForestClassifier.html) or [randomForestRegressor](https://docs.dolphindb.com/en/Functions/r/randomForestRegressor.html).\n\n**X** is a table. The column names must be the same as the column names in the table used to train the prediction model.\n\n#### Returns\n\nReturns a DOUBLE vector with the same number of elements as the the number of rows in *X*. Each element of the vector corresponds to the predicted value of a row in *X*.\n\n#### Examples\n\nThe following example uses the model generated by randomForestRegressor for prediction.\n\n```\nx1 = rand(100.0, 100)\nx2 = rand(100.0, 100)\nb0 = 6\nb1 = 1\nb2 = -2\nerr = norm(0, 10, 100)\ny = b0 + b1 * x1 + b2 * x2 + err\nt = table(x1, x2, y)\nmodel = randomForestRegressor(sqlDS(<select * from t>), `y, `x1`x2)\nyhat = predict(model, t);\n// output: [-93.733842,2.213932,5.39619,-47.817339,-38.655786,-75.772237,-45.817417,43.412841,-87.333214,-51.275368,32.41792,-45.797275,-152.075001,-83.423919,-21.154954,-65.734012,58.088571,-30.00795,-149.71085,-18.699006,-82.023643,-140.455355,-43.629218,65.832865,-79.411508,-65.625276,-17.466925,-43.469005,44.639384,31.686378...]\n\nplot(y, yhat, ,SCATTER);\n```\n\n![](https://docs.dolphindb.com/en/images/predict01.png)\n"
    },
    "prev": {
        "url": "https://docs.dolphindb.com/en/Functions/p/prev.html",
        "signatures": [
            {
                "full": "prev(X)",
                "name": "prev",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [prev](https://docs.dolphindb.com/en/Functions/p/prev.html)\n\n\n\n#### Syntax\n\nprev(X)\n\n#### Details\n\nShift the elements of a vector to the right for one position. In comparison, [next](https://docs.dolphindb.com/en/Functions/n/next.html) shifts the elements of a vector to the left for one position; [move](https://docs.dolphindb.com/en/Functions/m/move.html) shifts the elements of a vector for multiple positions.\n\n#### Parameters\n\n**X** is a vector/matrix/table.\n\n#### Returns\n\nA vector, matrix or table.\n\n#### Examples\n\n```\nx=3 9 5 1 4;\nprev(x);\n// output: [,3,9,5,1]\n```\n\n```\nx = matrix(1 2 3 4 5);\nprev(x)#0\n```\n\n| #0 |\n| -- |\n|    |\n| 1  |\n| 2  |\n| 3  |\n| 4  |\n\n```\nt=table(1 2 3 as a, `x`y`z as b, 10.8 7.6 3.5 as c);\nprev(t)\n```\n\n| a | b | c    |\n| - | - | ---- |\n|   |   |      |\n| 1 | x | 10.8 |\n| 2 | y | 7.6  |\n"
    },
    "prevState": {
        "url": "https://docs.dolphindb.com/en/Functions/p/prevState.html",
        "signatures": [
            {
                "full": "prevState(X)",
                "name": "prevState",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [prevState](https://docs.dolphindb.com/en/Functions/p/prevState.html)\n\n\n\n#### Syntax\n\nprevState(X)\n\n#### Details\n\nConsecutive elements in *X* with the same value feature the same state, and a null value has no state. The state of each element refers to its value. Return the previous state of the current element. If it is null, return the previous adjacent state.\n\nIf *X* is a matrix, return the previous state for each column of the matrix.\n\n#### Parameters\n\n**X** is a vector or matrix of temporal/Boolean/numeric type.\n\n#### Returns\n\nA vector or matrix of the same type as *X*.\n\n#### Examples\n\n```\nX = [1, 2.2, NULL, 2.2, 2.3, 1, 1.2]\nprev(X)\n// output: [,1,2.2,,2.2,2.3,1]\n\nprevState(X)\n// output: [,1,2.2,2.2,2.2,2.3,1]\n\nX = matrix([1.0, 1.1, 1.0, 0.9], [NULL, 1.3, 2.5, 5.5], [5.5, 4.2, 1.6, 1.8])\nprevState(X)\n```\n\n| #0  | #1  | #2  |\n| --- | --- | --- |\n|     |     |     |\n| 1   |     | 5.5 |\n| 1.1 | 1.3 | 4.2 |\n| 1   | 2.5 | 1.6 |\n\nRelated function: [nextState](https://docs.dolphindb.com/en/Functions/n/nextState.html)\n"
    },
    "print": {
        "url": "https://docs.dolphindb.com/en/Functions/p/print.html",
        "signatures": [
            {
                "full": "print(X)",
                "name": "print",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [print](https://docs.dolphindb.com/en/Functions/p/print.html)\n\n\n\n#### Syntax\n\nprint(X)\n\n#### Details\n\nPrint out results and variable contents.\n\n**Note:**\n\nThe core functionality of DolphinDB `print` is the same as that of Python's built-in [print](https://docs.python.org/3/library/functions.html#print). The difference is that DolphinDB `print` accepts only a single DolphinDB object, whereas Python `print` can accept multiple objects and supports parameters such as *sep*, *end*, *file*, and *flush* to control the separator, line ending, output destination, and buffer flushing.\n\n#### Parameters\n\n**X** is arbitrary data.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nx=rand(10000,10);\nprint x;\n// output: [9786,9501,8116,1266,1719,789,8162,3113,2740,6323]\n```\n\nThe output format of a dictionary is \"key -> value\". The order of the keys is determined by the *ordered* parameter specified when the dictionary is created.\n\n```\nx=1 6 3\ny=4.5 7.8 4.3\n// The dictionaries are unordered if the ordered parameter is not specified.\nz=dict(x,y);\n// Unordered dictionaries do not retain the input order when output.\nprint(z)\n/* output:\n3->4.3\n6->7.8\n1->4.5\n*/\n\n// The dictionaries are ordered if ordered=true is specified.\nz1=dict(x,y,true)\n\n// Ordered dictionaries retain the input order of key-value pairs when output.\nprint(z1)\n/* output:\n1->4.5\n6->7.8\n3->4.3\n*/\n```\n"
    },
    "prod": {
        "url": "https://docs.dolphindb.com/en/Functions/p/prod.html",
        "signatures": [
            {
                "full": "prod(X)",
                "name": "prod",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [prod](https://docs.dolphindb.com/en/Functions/p/prod.html)\n\n\n\n#### Syntax\n\nprod(X)\n\n#### Details\n\nIf *X* is a vector, return the product of all the elements in *X*.\n\nIf *X* is a matrix, calculate the product of all the elements in each column of *X* and return a vector.\n\nIf *X* is a table, calculate the product of all the elements in each column of *X* and return a table.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\nFor matrices and tables, DolphinDB's `prod` function always computes the product by column; NumPy flattens the array by default and computes the global product, unless you specify a dimension with the *axis* parameter. In addition, NumPy allows you to specify the *axis* parameter to calculate across multiple axes and specify initial to set the initial value.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA numeric scalar, vector, matrix, or table.\n\n#### Examples\n\n```\nprod(1 2 NULL 3);\n// output: 6\n```\n\n```\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nprod(m);\n// output: [6,120]\n```\n"
    },
    "publishMCPPrompts": {
        "url": "https://docs.dolphindb.com/en/Functions/p/publishMCPPrompts.html",
        "signatures": [
            {
                "full": "publishMCPPrompts([names])",
                "name": "publishMCPPrompts",
                "parameters": [
                    {
                        "full": "[names]",
                        "name": "names",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [publishMCPPrompts](https://docs.dolphindb.com/en/Functions/p/publishMCPPrompts.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\npublishMCPPrompts(\\[names])\n\n#### Details\n\nPublishes the MCP prompt template(s).\n\n#### Parameters\n\n**name** is a STRING scalar/vector indicating the name of the prompt template.\n\n#### Returns\n\nA STRING vector indicating the name(s) of the successfully published prompt template(s).\n\n#### Examples\n\n```\npublishMCPPrompts(\"stock_summary\")\n// output:[\"stock_summary\"]\n```\n"
    },
    "publishMCPTools": {
        "url": "https://docs.dolphindb.com/en/Functions/p/publishMCPTools.html",
        "signatures": [
            {
                "full": "publishMCPTools([names])",
                "name": "publishMCPTools",
                "parameters": [
                    {
                        "full": "[names]",
                        "name": "names",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [publishMCPTools](https://docs.dolphindb.com/en/Functions/p/publishMCPTools.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\npublishMCPTools(\\[names])\n\n#### Details\n\nPublishes MCP tool(s).\n\n#### Parameters\n\n**names** (optional) is a STRING scalar or vector indicating the tool name(s).\n\n#### Returns\n\nA STRING vector indicating the names of published tools.\n\n#### Examples\n\n```\npublishMCPTools(\"myTool\")\n```\n"
    },
    "purgeCacheEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/p/purgeCacheEngine.html",
        "signatures": [
            {
                "full": "purgeCacheEngine()",
                "name": "purgeCacheEngine",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [purgeCacheEngine](https://docs.dolphindb.com/en/Functions/p/purgeCacheEngine.html)\n\nAlias for [flushOLAPCache](https://docs.dolphindb.com/en/Functions/f/flushOLAPCache.html)\n\n\n\n#### Syntax\n\npurgeCacheEngine()\n\n#### Parameters\n\nNone\n\n#### Details\n\nForcibly 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.\n"
    },
    "purgeStreamGraphRecords": {
        "url": "https://docs.dolphindb.com/en/Functions/p/purgeStreamGraphRecords.html",
        "signatures": [
            {
                "full": "purgeStreamGraphRecords(name)",
                "name": "purgeStreamGraphRecords",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [purgeStreamGraphRecords](https://docs.dolphindb.com/en/Functions/p/purgeStreamGraphRecords.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\npurgeStreamGraphRecords(name)\n\n#### Details\n\nDeletes the metadata record of the specified stream graph from the DFS table. This operation is only allowed if the stream graph’s status is \"destroyed\"; otherwise, an exception will be thrown.\n\nIn a cluster deployment, this function can only be run by an administrator or a user who has the COMPUTE\\_GROUP\\_EXEC permission for the compute group used when the stream graph was created. In a single-node deployment, no permission check is required.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nAfter using [dropStreamGraph](https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html) to destroy a stream graph, you can remove its record as follows:\n\n```\npurgeStreamGraphRecords(\"demo.orca_graph.indicators\")\ngetStreamGraphMeta(\"demo.orca_graph.indicators\")[\"status\"]\n\n/*\nid fqn status semantics checkpointConfig tasks createTime owner reason\n-- --- ------ --------- ---------------- ----- ---------- ----- ------\n*/\n```\n"
    },
    "push!": {
        "url": "https://docs.dolphindb.com/en/Functions/p/push!.html",
        "signatures": [
            {
                "full": "append!(obj, newData)",
                "name": "append!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "newData",
                        "name": "newData"
                    }
                ]
            }
        ],
        "markdown": "### [push!](https://docs.dolphindb.com/en/Functions/p/push!.html)\n\nAlias for [append!](https://docs.dolphindb.com/en/Functions/a/append!.html)\n\n\nDocumentation for the `append!` function:\n### [append!](https://docs.dolphindb.com/en/Functions/a/append!.html)\n\n\n\n#### Syntax\n\nappend!(obj, newData)\n\nAlias: push!\n\n#### Parameters\n\n**obj** is a local variable, and it must be a vector/tuple/matrix/table/set.\n\n**newData** is a scalar/vector/tuple/table/set.\n\n* If *obj* is a vector, *newData* is a scalar, vector, or tuple whose elements are of the same type as *obj*. The result is a vector longer than *obj*.\n\n* If *obj* is a tuple, *newData* is a scalar, vector or tuple:\n  * If *newData* is a vector, it is appended to *obj* as one tuple element;\n\n  * If *newData* is a tuple, the *appendTupleAsAWhole* configuration parameter controls whether it is appended to *obj* as one tuple element (true) or each of its elements is appended independently (false).\n\n* If *obj* is a matrix, *newData* is a vector whose length must be a multiple of the number of rows of *obj*. The result is a matrix with the same number of rows as *obj* but with more columns.\n\n* If *obj* is a table, *newData* is a table with the same number of columns as *obj*. The result is a table with the same number and name of columns as *obj* but with more rows.\n\n* If *newData* and *obj* are of different data forms, `append!` will attempt to convert *newData* to the same data form as *obj*. If it is not possible, return an error message.\n\n#### Details\n\nAppend *newData* to *obj*. The exclamation mark (!) means in-place change in DolphinDB.\n\nNote: In most cases, the column names and orders in the tables should be consistent. Please first check whether the corresponding columns in *obj* and *newData* have the same names and are arranged in the same order before executing `append!`. The function does not check the consistency of column names or align the columns if they are not arranged in the same order. It is executed as long as the corresponding columns are of the same data types.\n\n#### Examples\n\n```\nx = 1 2 3\nx.append!(4)\nx\n// output: [1,2,3,4]\n\nappend!(x, 5 6)\nx\n//output: [1,2,3,4,5,6]\n\nx.append!(7.2)\nx\n//output: [1,2,3,4,5,6,7]\n// converted DOUBLE 7.2 to INT 7\n\nx.append!(`XOM)\n// Error: Incompatible type. Expected: INT, Actual: STRING\n\nx=array(int, 0, 10) // x is an empty vector\nx\n//output: []\n\nx.append!(1)\nx\n//output: [1]\n\nx=array(symbol, 0, 100)\nappend!(x, `TEST)\nx\n//output\n[\"TEST\"]\n\nx=1..6$3:2\nx\n\nx = (1,\"X\")\ny = (2,\"Y\")\nx.append!(y)\nprint(x)\n// when appendTupleAsAWhole = true\n(1,\"X\",(2,\"Y\"))\n// when appendTupleAsAWhole = false\n(1,\"X\",2,\"Y\")\n```\n\n| 0 | 1 |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\nx.append!(7..12)\nx\n```\n\n| 0 | 1 | 2 | 3  |\n| - | - | - | -- |\n| 1 | 4 | 7 | 10 |\n| 2 | 5 | 8 | 11 |\n| 3 | 6 | 9 | 12 |\n\n```\nx=set(1 2 3 4)\nx.append!(6)\nx\n// output: set(6,1,2,3,4)\n\nt1=table(1 2 3 as x, 4 5 6 as y)\nt2=table(1.1 2.2 3.3 as a, 4.4 5.5 6.6 as b)\nt1.append!(t2)\nt1\n```\n\n| x | y |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n| 1 | 4 |\n| 2 | 6 |\n| 3 | 7 |\n\nUse `append!` to add data to a DFS table. The following example should be executed in a DFS cluster.\n\n```\nn=1000000\nt=table(rand(`IBM`MS`APPL`AMZN,n) as symbol, rand(10.0, n) as value)\ndb = database(\"dfs://rangedb_tradedata\", RANGE, `A`F`M`S`ZZZZ)\nTrades = db.createPartitionedTable(t, \"Trades\", \"symbol\")\n```\n\nWe have created an empty table Trades with the schema of t. Next, we append the empty table Trades with data from table t.\n\n```\nTrades.append!(t)\nselect count(*) from Trades;\n// output: 1000000\n```\n\nTo append table Trades with another table:\n\n```\nn=500000\nt1=table(rand(`FB`GE`MSFT,n) as symbol, rand(100.0, n) as value)\nTrades.append!(t1)\nselect count(*) from Trades\n// output: 1500000\n```\n"
    },
    "pwlfPredict": {
        "url": "https://docs.dolphindb.com/en/Functions/p/pwlfPredict.html",
        "signatures": [
            {
                "full": "pwlfPredict(model, X, [beta], [breaks])",
                "name": "pwlfPredict",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[beta]",
                        "name": "beta",
                        "optional": true
                    },
                    {
                        "full": "[breaks]",
                        "name": "breaks",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [pwlfPredict](https://docs.dolphindb.com/en/Functions/p/pwlfPredict.html)\n\n\n\n#### Syntax\n\npwlfPredict(model, X, \\[beta], \\[breaks])\n\n#### Details\n\nEvaluate the fitted continuous piecewise linear function at untested points.\n\n#### Parameters\n\n**model** is a dictionary returned by `piecewiseLinFit`.\n\n**X** is a numeric vector indicating the x locations to predict the output of the fitted continuous piecewise linear function. Null value is not allowed.\n\n**beta** (optional) is a numeric vector indicating the model parameters for the continuous piecewise linear fit. Null value is not allowed.\n\n**breaks** (optional) is a numeric vector indicating the x locations where each line segment terminates. These are referred to as breakpoints for each line segment. Null value is not allowed.\n\n#### Returns\n\nA floating-point vector.\n\n#### Examples\n\n```\ndef linspace(start, end, num, endpoint=true){\n\tif(endpoint) return end$DOUBLE\\(num-1), start + end$DOUBLE\\(num-1)*0..(num-1)\n\telse return start + end$DOUBLE\\(num-1)*0..(num-1)\t\n}\nX = linspace(0.0, 1.0, 10)[1]\nY = [0.41703981, 0.80028691, 0.12593987, 0.58373723, 0.77572962, 0.41156172, 0.72300284, 0.32559528, 0.21812564, 0.41776427]\n// Fit a continuous piecewise linear function\nmodel = piecewiseLinFit(X, Y, 3)\n// Pass x locations\nxHat = linspace(0.0, 1.0, 20)[1]\n// Evaluate xHat using the model\npwlfPredict(model, xHat)\n\n// output: [0.593305499919518 0.524360777381737 0.455416054843957 0.386471332306177 0.317526609768396 0.368043438179296 0.529813781212159 0.691584124245021 0.69295837868457  0.655502915538459 0.618047452392347 0.580591989246236 0.543136526100125 0.505681062954014 0.468225599807903 0.430770136661792 0.393314673515681 0.35585921036957  0.318403747223459 0.280948284077348]\n```\n\n**Related function**: [piecewiseLinFit](https://docs.dolphindb.com/en/Functions/p/piecewiseLinFit.html)\n"
    },
    "ma": {
        "url": "https://docs.dolphindb.com/en/Functions/m/ma.html",
        "signatures": [
            {
                "full": "ma(X, window, maType)",
                "name": "ma",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "maType",
                        "name": "maType"
                    }
                ]
            }
        ],
        "markdown": "### [ma](https://docs.dolphindb.com/en/Functions/m/ma.html)\n\n\n\n#### Syntax\n\nma(X, window, maType)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving average (whose type is determined by maType) in a sliding window of the given length.\n\nDifferences from TA-Lib `MA`:\n\n* DolphinDB ma does not currently support MAMA.\n* Missing-value handling differs: DolphinDB `ma` and TA-Lib `MA` behave similarly for leading missing values by preserving them and starting the window calculation from the first non-missing value. However, they differ when missing values appear in the middle of the series. DolphinDB `ma` typically continues the moving average calculation according to its rules and produces results, whereas some TA-Lib indicators may start returning NaN from the first NaN encountered after the initial non-missing value, which can also affect subsequent results.\n\n#### Parameters\n\n**maType** is the type of moving averages. It is an integer in \\[0,8].0= [sma](https://docs.dolphindb.com/en/Functions/s/sma.html) , 1= [ema](https://docs.dolphindb.com/en/Functions/e/ema.html) , 2= [wma](https://docs.dolphindb.com/en/Functions/w/wma.html) , 3= [dema](https://docs.dolphindb.com/en/Functions/d/dema.html) , 4= [tema](https://docs.dolphindb.com/en/Functions/t/tema.html) , 5= [trima](https://docs.dolphindb.com/en/Functions/t/trima.html) , 6= [kama](https://docs.dolphindb.com/en/Functions/k/kama.html) , 8= [t3](https://docs.dolphindb.com/en/Functions/t/t3.html) . Note that value 7 (mama) is not supported.\n\n#### Returns\n\nA DOUBLE vector.\n"
    },
    "mad": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mad.html",
        "signatures": [
            {
                "full": "mad(X, [useMedian=false])",
                "name": "mad",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[useMedian=false]",
                        "name": "useMedian",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [mad](https://docs.dolphindb.com/en/Functions/m/mad.html)\n\n\n\n#### Syntax\n\nmad(X, \\[useMedian=false])\n\n#### Details\n\nIf *X* is a vector, return the average absolute deviation of *X*.\n\nIf *X* is a matrix, the calculation is based on each column and returns a matrix.\n\nIf *X* is a table, the calculation is based on each column and returns a table.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\n#### Parameters\n\n**X** is a vector, matrix or table.\n\n**useMedian** is a Boolean value indicating whether the result is generated with the median absolute deviation or the mean absolute deviation. The default value is false and it returns the mean absolute deviation.\n\n* Mean Absolute Deviation: mean(abs(X - mean(X)))\n\n* Median Absolute Deviation: med(abs(X - med(X)))\n\n#### Returns\n\nIf *X* is a vector, it returns a DOUBLE scalar indicating the average absolute deviation of *X*.\n\nIf *X* is a matrix, it returns a DOUBLE vector.\n\nIf *X* is a table, it returns a table.\n\n#### Examples\n\n```\nmad([85, 90, 95, NULL]);\n// output: 3.333333333333333\n\nm=matrix(85 90 95, 185 190 195);\nm;\n```\n\n| #0 | #1  |\n| -- | --- |\n| 85 | 185 |\n| 90 | 190 |\n| 95 | 195 |\n\n```\nmad m;\n// output: [3.333333333333333, 3.333333333333333]\n\nmad([0, 19.618568, 67.900707, 71.65218, 73.103952, 58.275308, 18.819054, 36.940571, 48.114366], false)\n// output: 22.204817\n```\n\nRelated function: [mmad](https://docs.dolphindb.com/en/Functions/m/mmad.html)\n"
    },
    "mahalanobis": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mahalanobis.html",
        "signatures": [
            {
                "full": "mahalanobis(X, Y, Z)",
                "name": "mahalanobis",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "Z",
                        "name": "Z"
                    }
                ]
            }
        ],
        "markdown": "### [mahalanobis](https://docs.dolphindb.com/en/Functions/m/mahalanobis.html)\n\nFirst introduced in version: 2.00.183.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\nmahalanobis(X, Y, Z)\n\n#### Details\n\nCompute the Mahalanobis distance between two numeric vectors (X and Y). The distance is defined as follows:\n\n![](https://docs.dolphindb.com/en/images/mahalanobis.png)\n\nwhere *V* is the covariance matrix, and *Z* is the inverse of *V*.\n\n#### Parameters\n\n**X:** A numeric vector.\n\n**Y:** A numeric vector.\n\n**Z:** The inverse of the covariance matrix.\n\n#### Returns\n\nA scalar of type DOUBLE.\n\n#### Examples\n\n```\nlen = 50\nX = array(DOUBLE, 0).append!(take([1.2, 3.9, 0.8], len))\nY = array(DOUBLE, 0).append!(take([5.6, 0.4, 2.7], len))\nZ1 = diag(take(1, len)) Z = inverse(Z1)\n\nmahalanobis(X, Y, Z)\n//Output: 24.395286429964294\n```\n\n**Related functions**\n\n[minkowski](https://docs.dolphindb.com/en/Functions/m/minkowski.html), [seuclidean](https://docs.dolphindb.com/en/Functions/s/seuclidean.html)\n"
    },
    "makeCall": {
        "url": "https://docs.dolphindb.com/en/Functions/m/makeCall.html",
        "signatures": [
            {
                "full": "makeCall(F, args...)",
                "name": "makeCall",
                "parameters": [
                    {
                        "full": "F",
                        "name": "F"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [makeCall](https://docs.dolphindb.com/en/Functions/m/makeCall.html)\n\n\n\n#### Syntax\n\nmakeCall(F, args...)\n\n#### Details\n\nCall a function with the specified parameters to generate a piece of script. The difference between [call](https://docs.dolphindb.com/en/Functions/Templates/call.html) and *makeCall* is that *makeCall* doesn't execute the script.\n\n#### Parameters\n\n**F** is a function.\n\n**args** are the required parameters of *F*.\n\n#### Returns\n\nA metacode.\n\n#### Examples\n\nIn the following example, we create a function *generateReport* that reports selected columns from a given table with specified format.\n\n```\ndef generateReport(tbl, colNames, colFormat): sql(sqlColAlias(each(makeCall{format},sqlCol(colNames),colFormat),colNames), tbl).eval();\nt = table(1..100 as id, (1..100 + 2018.01.01) as date, rand(100.0, 100) as price, rand(10000, 100) as qty, rand(`A`B`C`D`E`F`G, 100) as city);\nt;\n```\n\n| id  | date       | price   | qty  | city |\n| --- | ---------- | ------- | ---- | ---- |\n| 1   | 2018.01.02 | 77.9896 | 375  | A    |\n| 2   | 2018.01.03 | 8.1332  | 7864 | F    |\n| 3   | 2018.01.04 | 56.7185 | 4912 | B    |\n| 4   | 2018.01.05 | 72.4173 | 534  | E    |\n| 5   | 2018.01.06 | 8.2019  | 31   | B    |\n| 6   | 2018.01.07 | 74.7275 | 4139 | A    |\n| 7   | 2018.01.08 | 7.5421  | 2725 | D    |\n| 8   | 2018.01.09 | 59.1689 | 3095 | C    |\n| 9   | 2018.01.10 | 55.8454 | 5443 | D    |\n| 10  | 2018.01.11 | 32.1285 | 6998 | G    |\n| ... |            |         |      |      |\n\n```\ngenerateReport(t, [\"id\", \"date\",\"price\",\"qty\"], [\"0\", \"MM/dd/yyyy\", \"0.00\", \"#,###\"]);\n```\n\n| id  | date       | price | qty   |\n| --- | ---------- | ----- | ----- |\n| 1   | 01/02/2018 | 77.99 | 375   |\n| 2   | 01/03/2018 | 8.13  | 7,864 |\n| 3   | 01/04/2018 | 56.72 | 4,912 |\n| 4   | 01/05/2018 | 72.42 | 534   |\n| 5   | 01/06/2018 | 8.20  | 31    |\n| 6   | 1/07/2018  | 74.73 | 4,139 |\n| 7   | 01/08/2018 | 7.54  | 2,725 |\n| 8   | 01/09/2018 | 59.17 | 3,095 |\n| 9   | 01/10/2018 | 55.85 | 5,443 |\n| 10  | 01/11/2018 | 32.13 | 6,988 |\n| ... |            |       |       |\n\nThe equivalent SQL script for the previous execution is:\n\n```\ndef generateReportSQL(tbl, colNames, colFormat): sql(sqlColAlias(each(makeCall{format},sqlCol(colNames),colFormat),colNames), tbl)\ngenerateReportSQL(t, [\"id\", \"date\",\"price\",\"qty\"], [\"0\", \"MM/dd/yyyy\", \"0.00\", \"#,###\"]);\n// output: < select format(id, \"0\") as id,format(date, \"MM/dd/yyyy\") as date,format(price, \"0.00\") as price,format(qty, \"#,###\") as qty from t >\n```\n"
    },
    "makeKey": {
        "url": "https://docs.dolphindb.com/en/Functions/m/makeKey.html",
        "signatures": [
            {
                "full": "makeKey(args...)",
                "name": "makeKey",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [makeKey](https://docs.dolphindb.com/en/Functions/m/makeKey.html)\n\n\n\n#### Syntax\n\nmakeKey(args...)\n\n#### Details\n\nCombine the specified *args* as a BLOB scalar or vector, so it can used as the key(s) of a dictionary or a set. Compared with *makeSortedKey*, *makeKey* keeps the order of the inputs in the result.\n\n#### Parameters\n\n**args** are multiple scalars or vectors of the same length.\n\n#### Returns\n\nA BLOB scalar or vector.\n\n#### Examples\n\n```\nmakeKey(`a1,`b1,`c1)\n// output: a1b1c1\n\nset(makeKey(1 2, 4 5))\n\nre=makeKey(`a1`a2, `_1`_2)\ndict(re,100 200)\n\n/* output:\na2_2->200\na1_1->100\n*/\n```\n\nRelated Function: [makeSortedKey](https://docs.dolphindb.com/en/Functions/m/makeSortedKey.html)\n"
    },
    "makeSortedKey": {
        "url": "https://docs.dolphindb.com/en/Functions/m/makeSortedKey.html",
        "signatures": [
            {
                "full": "makeSortedKey(args...)",
                "name": "makeSortedKey",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [makeSortedKey](https://docs.dolphindb.com/en/Functions/m/makeSortedKey.html)\n\n\n\n#### Syntax\n\nmakeSortedKey(args...)\n\n#### Details\n\nCombine the specified *args* as a BLOB scalar or vector. `makeSortedKey` stores the keys in sorted order internally, while returns the same result as `makeKey`.\n\n#### Parameters\n\n**args** are multiple scalars or vectors of the same length.\n\n#### Returns\n\nA BLOB scalar or vector.\n\n#### Examples\n\n```\nmakeSortedKey([`b,`a,`c], [`4,`2,`1])\n// output: [\"b4\",\"a2\",\"c1\"]\n\nset(makeSortedKey(1 2, 4 5))\n```\n\nRelated Function: [makeKey](https://docs.dolphindb.com/en/Functions/m/makeKey.html)\n"
    },
    "makeUnifiedCall": {
        "url": "https://docs.dolphindb.com/en/Functions/m/makeUnifiedCall.html",
        "signatures": [
            {
                "full": "makeUnifiedCall(func, args)",
                "name": "makeUnifiedCall",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args",
                        "name": "args"
                    }
                ]
            }
        ],
        "markdown": "### [makeUnifiedCall](https://docs.dolphindb.com/en/Functions/m/makeUnifiedCall.html)\n\n\n\n#### Syntax\n\nmakeUnifiedCall(func, args)\n\n#### Details\n\nGenerate metacode for function call. Use function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html) to execute the metacode. The difference between `makeUnifiedCall` and the template function [unifiedCall](https://docs.dolphindb.com/en/Functions/Templates/unifiedCall.html) is that `makeUnifiedCall` doesn't execute the metacode.\n\n#### Parameters\n\n**func** is a function.\n\n**args** is a tuple. Each element is a parameter of *func*. Since version 2.00.11.3, *args* can be metacode with a tuple expression.\n\n#### Returns\n\nA metacode.\n\n#### Examples\n\n```\nmc = makeUnifiedCall(matrix, (1 2 3, 4 5 6));\nmc;\n// output: < matrix([1,2,3], [4,5,6]) >\n\nmc.eval();\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 4    |\n| 2    | 5    |\n| 3    | 6    |\n\nSince version 2.00.11.3, *args* can be tuple metacode to be dynamically passed to a function. The following example illustrates the difference between passing *args* as a tuple and tuple metacode.\n\n```\nx=3\ny=5\na = makeUnifiedCall(add, (x,y)) // < add(3, 5) >\nb = makeUnifiedCall(add, <(x,y)>) // < add(x, y) >\n```\n\n* If *args* is a tuple, `makeUnifiedCall` passes the values of the variables in the tuple to *func* and generates `< add(3, 5) >`.\n\n* If *args* is metacode with a tuple expression, `makeUnifiedCall` passes the variables in the tuple expression to *func* and generates `< add(x, y) >`.\n\nWhen the value of *x* or *y* changes, the execution result of `a` remains unchanged while that of `b` changes accordingly as it dynamically passes the values of *x* and *y*.\n\n```\nx = 6\na.eval() // 3+5=8\nb.eval() //  6+5=11\n```\n\n`makeUnifiedCall` can also be used with `sqlTuple` and `sql` to dynamically generate SQL metacode. In the following example, the parameter *args* of `makeUnifiedCall` is tuple metacode generated using `sqlTuple`, and *func* is a user-defined function. The result of `makeUnifiedCall` is passed as the parameter *select* of function `sql` to generate SQL metacode `c`.\n\n```\n// Create a user-defined function\nf = def (x,y)->(x-y)/(x+y)\n\n// Create a table for query\nt = table(1.0 2.0 3.0 as qty1, 1.0 3.0 7.0 as qty2)\n\n// Generate metacode for query\nc = sql(select=makeUnifiedCall(f, sqlTuple(`qty1`qty2)), from=t)\n\n// Execute the corresponding metacode\nc.eval()\n```\n\n<table id=\"table_rg4_dwc_s1c\"><thead><tr><th align=\"left\">\n\n**\\_qty1**\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\n0\n\n</td></tr><tr><td align=\"left\">\n\n-0.2\n\n</td></tr><tr><td align=\"left\">\n\n-0.4\n\n</td></tr></tbody>\n</table>Related Information: [sqlTuple](../s/sqlTuple.md)\n"
    },
    "mannWhitneyUTest": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mannWhitneyUTest.html",
        "signatures": [
            {
                "full": "mannWhitneyUTest(X, Y, [correct=true])",
                "name": "mannWhitneyUTest",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[correct=true]",
                        "name": "correct",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [mannWhitneyUTest](https://docs.dolphindb.com/en/Functions/m/mannWhitneyUTest.html)\n\n\n\n#### Syntax\n\nmannWhitneyUTest(X, Y, \\[correct=true])\n\n#### Details\n\nPerform the Mann-Whitney U test on *X* and *Y*.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**Y** is a numeric vector.\n\n**correct** is a Boolean value indicating whether to consider continuity correction when calculating the p-value. The default value is true.\n\n#### Returns\n\nIt returns a dictionary object with the following keys:\n\n* stat: A table containing p-values under three different alternative hypotheses\n\n* correct: Whether to consider continuity correction when calculating p-value\n\n* method: The string \"Mann-Whitney U test\"\n\n* U: U statistic\n\n#### Examples\n\n```\nmannWhitneyUTest(5 1 4 3 5, 2 4 7 -1 0 4);\n\n/* output:\nstat->\n\nalternativeHypothesis                 pValue\n------------------------------------- --------\ntrue location shift is not equal to 0 0.518023\ntrue location shift is less than 0    0.259011\ntrue location shift is greater than 0 0.797036\n\ncorrect->true\nmethod->Mann-Whitney U test\nU->11\n*/\n```\n"
    },
    "manova": {
        "url": "https://docs.dolphindb.com/en/Functions/m/manova.html",
        "signatures": [
            {
                "full": "manova(X, group)",
                "name": "manova",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "group",
                        "name": "group"
                    }
                ]
            }
        ],
        "markdown": "### [manova](https://docs.dolphindb.com/en/Functions/m/manova.html)\n\n\n\n#### Syntax\n\nmanova(X, group)\n\n#### Details\n\nConduct multivariate analysis of variance (MANOVA).\n\n#### Parameters\n\n**X** is a matrix or a table whose columns are all of numeric types.\n\n**group** is a vector with the same length as each of the columns of *X* indicating groups.\n\n#### Returns\n\nA dictionary.\n\n#### Examples\n\n```\na=29.6 24.3 1.5 20.2 2.6 44.5 2.4 20 9.5\nb=27.3 68.4 3.8 34.8 4.6 26.3 5.9 20 5.6\nc=50.8 60.2 1.0 30.1 2.1 27.9 2.3 20 8.8\ng=1 1 2 1 2 1 2 1 2\nt=table(a,b,c,g)\nmanova(select a,b,c from t, t.g);\n\n/* output:\ndfT->8\ndfB->1\ngnames->[1,2]\ngmdist->\n#0        #1\n--------- ---------\n0         16.458055\n16.458055 0\n\nmdist->[5.35501,5.171516,0.132336,1.335303,0.043425,5.384036,0.07295,2.844008,0.661416]\nchisq->[10.056959]\nB->\n#0          #1          #2\n----------- ----------- -----------\n1250.307556 1601.627111 1805.355556\n1601.627111 2051.662722 2312.636111\n1805.355556 2312.636111 2606.805556\n\nlambda->[0.160648]\nW->\n#0       #1        #2\n-------- --------- --------\n453.968  -151.966  16.31\n-151.966 1477.6995 1008.395\n16.31    1008.395  1182.63\n\nT->\n#0          #1          #2\n----------- ----------- -----------\n1704.275556 1449.661111 1821.665556\n1449.661111 3529.362222 3321.031111\n1821.665556 3321.031111 3789.435556\n\nchisqdf->[3]\nP->[0.018088]\ndfW->7\neigenval->[5.224779,2.757998E-16,-1.552556E-15]\neigenvec->\n#0       #1        #2\n-------- --------- ---------\n0.099362 0.08179   0.023313\n0.029973 -0.010892 0.107448\n0.023044 -0.046981 -0.111469\n\ncanon->\n#0        #1        #2\n--------- --------- ---------\n2.047837  -0.369203 -2.271294\n2.969714  -1.691977 0.973456\n-2.596193 -0.071875 0.09971\n0.861618  -0.247207 0.622822\n-2.437568 -0.042299 0.088698\n2.970655  1.936238  0.521256\n-2.413867 -0.082213 0.201424\n0.165404  0.372149  0.153761\n-1.567601 0.196387  -0.389832\n*/\n```\n"
    },
    "mask": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mask.html",
        "signatures": [
            {
                "full": "mask(X, Y)",
                "name": "mask",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [mask](https://docs.dolphindb.com/en/Functions/m/mask.html)\n\n\n\n#### Syntax\n\nmask(X, Y)\n\n#### Details\n\nApply *Y* on each element of *X*. If the result is *false*, keep the element; if the result is *true*, change it to null. The result is of the same length as *X*.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n**Y** is a conditional expression that generates *true* or *false*.\n\n#### Returns\n\nReturns an object identical to the input *X* (a scalar returns a scalar, a vector returns a vector of the same length, and a matrix returns a matrix of the same dimensions).\n\n#### Examples\n\n```\nx=1..10\nmask(x, x>6);\n// output: [1,2,3,4,5,6,,,,]\n\nm=matrix(1 2 3, 4 5 6, 7 8 9);\nm;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 4  | 7  |\n| 2  | 5  | 8  |\n| 3  | 6  | 9  |\n\n```\nmask(m, m<6);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n|    |    | 7  |\n|    |    | 8  |\n|    | 6  | 9  |\n"
    },
    "matchAll": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchAll.html",
        "signatures": [
            {
                "full": "matchAll(textCol, terms, [scoreColName])",
                "name": "matchAll",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "terms",
                        "name": "terms"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchAll](https://docs.dolphindb.com/en/Functions/m/matchAll.html)\n\n\n\n#### Syntax\n\nmatchAll(textCol, terms, \\[scoreColName])\n\n#### Details\n\nPerform word-based text searches on the column with text indexing set in the PKEY engine. This function is used in the `where` clause of a SQL statement to filter rows. Rows containing all of the specified terms are returned by the query.\n\n#### Parameters\n\n**textCol**is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**terms** is a STRING scalar specifying the term(s) to search for. To search for multiple terms, separate them with spaces.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nIt returns a Boolean value indicating whether the column matches all specified keywords.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing \"apple\" and \"orange\"\nselect * from pt where matchAll(textCol=remark,terms=\"apple orange\")\n```\n\n| id1 | id2 | remark                                         |\n| --- | --- | ---------------------------------------------- |\n| 1   | 1   | There are some apples and oranges.             |\n| 3   | 3   | Mike traded an orange for an apple with Alice. |\n"
    },
    "matchAny": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchAny.html",
        "signatures": [
            {
                "full": "matchAny(textCol, terms, [scoreColName])",
                "name": "matchAny",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "terms",
                        "name": "terms"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchAny](https://docs.dolphindb.com/en/Functions/m/matchAny.html)\n\n\n\n#### Syntax\n\nmatchAny(textCol, terms, \\[scoreColName])\n\n#### Details\n\nPerform word-based text searches on the column with text indexing set in the PKEY engine. This function is used in the `where` clause of a SQL statement.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**terms** is a STRING scalar specifying the term(s) to search for. To search for multiple terms, separate them with spaces.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing \"apple\" or \"orange\"\nselect * from pt where matchAny(textCol=remark,terms=\"apple orange\")\n```\n\n| id1 | id2 | remark                                         |\n| --- | --- | ---------------------------------------------- |\n| 1   | 1   | There are some apples and oranges.             |\n| 1   | 2   | Mike likes apples.                             |\n| 1   | 3   | Alice likes oranges.                           |\n| 2   | 1   | Mike gives Alice an apple.                     |\n| 2   | 2   | Alice gives Mike an orange.                    |\n| 3   | 1   | Mike, can you give me some apples?             |\n| 3   | 2   | Alice, can you give me some oranges?           |\n| 3   | 3   | Mike traded an orange for an apple with Alice. |\n"
    },
    "matchedRowCount": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchedrowcount.html",
        "signatures": [
            {
                "full": "matchedRowCount()",
                "name": "matchedRowCount",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [matchedRowCount](https://docs.dolphindb.com/en/Functions/m/matchedrowcount.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nmatchedRowCount()\n\n#### Details\n\nReturns the number of rows affected by the most recent INSERT INTO, DELETE, or UPDATE statement executed in the current session.\n\nIf none of these statements have been executed in the current session, `matchedRowCount` returns 0.\n\nThe counting rules depend on the type of statement:\n\n* UPDATE: The number of matched rows, not the number of rows actually modified.\n\n* DELETE: The number of matched rows, which is equal to the number of rows actually deleted.\n\n* INSERT INTO: The number of successfully inserted rows; updated rows are not counted.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nAn integer scalar representing the number of affected rows.\n\n#### Examples\n\n```\nt=table(`XOM`GS`FB as ticker, 100 80 120 as volume);\nINSERT INTO t values(`AMZN`GS, 300 100);\nmatchedRowCount()\n// output: 2\n\nUPDATE t set volume=100 where ticker=`GS\nmatchedRowCount()\n// output: 2\n\nsym=`A`B`C`D`E\nid=5 5 3 2 1\nval=52 64 25 48 71\nt=keyedTable(`sym,sym,id,val)\n\nINSERT INTO t values(`A`K, 6 3, 20 62)\nmatchedRowCount()  \n// output: 1\n\n\nt = table(1..100 as id, rand(100, 100) as value)  \nDELETE from t where id < 50  \n\nmatchedRowCount()\n// output: 49\n\ndbName=\"dfs://matchedRowCount\"\nif(existsDatabase(dbName)){\n\tdropDatabase(dbName)\t\n}\ndb = database(dbName, VALUE, 1..10)\nt = table(1..10 as id, 1..10 as value)\npt = db.createPartitionedTable(t, `pt, `id)\n\nINSERT INTO t VALUES(11 12 13, 20 30 40)\n\nmatchedRowCount() \n// output: 3\n```\n"
    },
    "matchFuzzy": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchFuzzy.html",
        "signatures": [
            {
                "full": "matchFuzzy(textCol, term, minimumSimilarity, prefixLength, [scoreColName])",
                "name": "matchFuzzy",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "term",
                        "name": "term"
                    },
                    {
                        "full": "minimumSimilarity",
                        "name": "minimumSimilarity"
                    },
                    {
                        "full": "prefixLength",
                        "name": "prefixLength"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchFuzzy](https://docs.dolphindb.com/en/Functions/m/matchFuzzy.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nmatchFuzzy(textCol, term, minimumSimilarity, prefixLength, \\[scoreColName])\n\n#### Details\n\nThis function is used in the `where` clause of a SQL statement to perform fuzzy searches of word-based text on the column with text indexing set in the PKEY engine, so that the search results remain highly relevant even if the *term* contains spelling errors or words in the output text do not match it exactly.\n\n* When *minimumSimilarity* is set to 1, words in the output text match the searched *term* exactly, which is equivalent to the `matchAny` function.\n* Only support single word searches. Return null values when search for multiple terms.\n* When the *prefixLength* is larger than the *term*'s length, it is automatically adjusted to the the *term*’s length.\n\n#### Parameters\n\n**textCol**The column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**term** A STRING scalar specifying the term(s) to search for. Only support single word searches.\n\n**minimumSimilarity** A DOUBLE scalar representing the minimum similarity required for a search result, with the value range of \\[0,1].\n\n**prefixLength** A non-negative integer indicating that the prefix length of the search result must be the same as that of *term*.\n\n**scoreColName** (optional) A STRING scalar representing the name of the text search score column in the output. The default value is null, in which case the score column is not output. The search score represents the degree of match within the partition, and scores from different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Alice made apple pie.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, full=false, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Fuzzy search for make; The prefix must be m\nselect * from pt where matchFuzzy(textCol=remark,term=\"make\",minimumSimilarity=0.6,prefixLength=1)\n```\n\n| id1 | id2 | remark                             |\n| --- | --- | ---------------------------------- |\n| 1   | 2   | Mike likes apples.                 |\n| 2   | 1   | Mike gives Alice an apple.         |\n| 2   | 2   | Alice gives Mike an orange.        |\n| 3   | 1   | Mike, can you give me some apples? |\n| 3   | 3   | Alice made apple pie.              |\n\n```\n// Fuzzy search for make; The prefix must be m; Output the score column name as score\nselect * from pt where matchFuzzy(textCol=remark,term=\"make\",minimumSimilarity=0.6,prefixLength=2,scoreColName=\"score\")\n```\n\n| id1 | id2 | remark                | score              |\n| --- | --- | --------------------- | ------------------ |\n| 3   | 3   | Alice made apple pie. | 0.7027325630187988 |\n"
    },
    "matchPhrase": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchPhrase.html",
        "signatures": [
            {
                "full": "matchPhrase(textCol, phrase, [scoreColName])",
                "name": "matchPhrase",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "phrase",
                        "name": "phrase"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchPhrase](https://docs.dolphindb.com/en/Functions/m/matchPhrase.html)\n\n\n\n#### Syntax\n\nmatchPhrase(textCol, phrase, \\[scoreColName])\n\n#### Details\n\nPerform phrase-based text searches on the column with text indexing set in the PKEY engine. This function is used in the `where` clause of a SQL statement to filter rows. The query returns rows containing the specified phrase.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**phrase** is a STRING scalar specifying the phrase to search for.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing phrase \"give Mike\"\nselect * from pt where matchPhrase(remark,\"give Mike\")\n```\n\n| id1 | id2 | remark                     |\n| --- | --- | -------------------------- |\n| 2   | 2   | Alice gives Mike an orange |\n"
    },
    "matchPhraseInfix": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchPhraseInfix.html",
        "signatures": [
            {
                "full": "matchPhraseInfix(textCol, suffix, phrase, prefix, [scoreColName])",
                "name": "matchPhraseInfix",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "suffix",
                        "name": "suffix"
                    },
                    {
                        "full": "phrase",
                        "name": "phrase"
                    },
                    {
                        "full": "prefix",
                        "name": "prefix"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchPhraseInfix](https://docs.dolphindb.com/en/Functions/m/matchPhraseInfix.html)\n\n\n\n#### Syntax\n\nmatchPhraseInfix(textCol, suffix, phrase, prefix, \\[scoreColName])\n\n#### Details\n\nPerform text searches based on phrase, suffix, and prefix on the column with text indexing set in the PKEY engine.\n\nThis function is used in the `where` clause of a SQL statement to filter rows.\n\nThe query returns rows where the specified phrase is preceded by a word with the given suffix and followed by a word with the given prefix.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**phrase** is a STRING scalar specifying the phrase to search for.\n\n**suffix** is a STRING scalar specifying the suffix to search for.\n\n**prefix** is a STRING scalar specifying the prefix to search for.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing word \"give\" that is preceded by a word prefixed with \"al\" and followed by a word suffixed with \"ke\"\nselect * from pt where matchPhraseInfix(remark,\"ke\",\"give\",\"al\")\n```\n\n| id1 | id2 | remark                     |\n| --- | --- | -------------------------- |\n| 2   | 1   | Mike gives Alice an apple. |\n"
    },
    "matchPhrasePrefix": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchPhrasePrefix.html",
        "signatures": [
            {
                "full": "matchPhrasePrefix(textCol, phrase, prefix, [scoreColName])",
                "name": "matchPhrasePrefix",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "phrase",
                        "name": "phrase"
                    },
                    {
                        "full": "prefix",
                        "name": "prefix"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchPhrasePrefix](https://docs.dolphindb.com/en/Functions/m/matchPhrasePrefix.html)\n\n\n\n#### Syntax\n\nmatchPhrasePrefix(textCol, phrase, prefix, \\[scoreColName])\n\n#### Details\n\nPerform text searches based on both phrase and prefix on the column with text indexing set in the PKEY engine.\n\nThis function is used in the `where` clause of a SQL statement to filter rows.\n\nThe query returns rows containing the specified phrase followed by a word with the specified prefix.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**phrase** is a STRING scalar specifying the phrase to search for.\n\n**prefix** is a STRING scalar specifying the prefix to search for.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing word \"give\" followed by a word prefixed with \"mi\"\nselect * from pt where matchPhrasePrefix(remark,\"give\",\"mi\")\n```\n\n| id1 | id2 | remark                      |\n| --- | --- | --------------------------- |\n| 2   | 2   | Alice gives Mike an orange. |\n"
    },
    "matchPhraseSuffix": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchphrasesuffix.html",
        "signatures": [
            {
                "full": "matchPhraseSuffix(textCol, suffix, phrase, [scoreColName])",
                "name": "matchPhraseSuffix",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "suffix",
                        "name": "suffix"
                    },
                    {
                        "full": "phrase",
                        "name": "phrase"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchPhraseSuffix](https://docs.dolphindb.com/en/Functions/m/matchphrasesuffix.html)\n\n\n\n#### Syntax\n\nmatchPhraseSuffix(textCol, suffix, phrase, \\[scoreColName])\n\n#### Details\n\nPerform text searches based on both phrase and suffix on the column with text indexing set in the PKEY engine.\n\nThis function is used in the `where` clause of a SQL statement to filter rows.\n\nThe query returns rows containing the specified phrase that is preceded by a word with the specified suffix.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**phrase** is a STRING scalar specifying the phrase to search for.\n\n**suffix** is a STRING scalar specifying the suffix to search for.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, full=false, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing word \"give\" preceded by a word suffixed with \"ke\"\nselect * from pt where matchPhraseSuffix(remark,\"ke\",\"give\")\n```\n\n| id1 | id2 | remark                     |\n| --- | --- | -------------------------- |\n| 2   | 1   | Mike gives Alice an apple. |\n"
    },
    "matchPrefix": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchPrefix.html",
        "signatures": [
            {
                "full": "matchPrefix(textCol, prefix, [scoreColName])",
                "name": "matchPrefix",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "prefix",
                        "name": "prefix"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchPrefix](https://docs.dolphindb.com/en/Functions/m/matchPrefix.html)\n\n\n\n#### Syntax\n\nmatchPrefix(textCol, prefix, \\[scoreColName])\n\n#### Details\n\nPerform prefix-based text searches on the column with text indexing set in the PKEY engine. This function is used in the `where` clause of a SQL statement to filter rows. The query returns rows containing words with the specified prefix.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**prefix** is a STRING scalar specifying the prefix to search for.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing words prefixed with \"app\"\nselect * from pt where matchPrefix(remark,\"app\")\n```\n\n| id1 | id2 | remark                                         |\n| --- | --- | ---------------------------------------------- |\n| 1   | 1   | There are some apples and oranges.             |\n| 1   | 2   | Mike likes apples.                             |\n| 2   | 1   | Mike gives Alice an apple.                     |\n| 3   | 1   | Mike, can you give me some apples?             |\n| 3   | 3   | Mike traded an orange for an apple with Alice. |\n"
    },
    "matchPrefixSuffix": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchPrefixSuffix.html",
        "signatures": [
            {
                "full": "matchPrefixSuffix(textCol, prefix, suffix, [scoreColName])",
                "name": "matchPrefixSuffix",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "prefix",
                        "name": "prefix"
                    },
                    {
                        "full": "suffix",
                        "name": "suffix"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchPrefixSuffix](https://docs.dolphindb.com/en/Functions/m/matchPrefixSuffix.html)\n\n\n\n#### Syntax\n\nmatchPrefixSuffix(textCol, prefix, suffix, \\[scoreColName])\n\n#### Details\n\nPerform text searches based on both prefix and suffix on the column with text indexing set in the PKEY engine. This function is used in the `where` clause of a SQL statement to filter rows. This query returns rows containing words with both the specified prefix and suffix.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**prefix** is a STRING scalar specifying the prefix to search for.\n\n**suffix** is a STRING scalar specifying the suffix to search for.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing words prefixed with \"m\" and suffixed with \"ke\"\nselect * from pt where matchPrefixSuffix(remark,\"m\",\"ke\")\n```\n\n| id1 | id2 | remark                                         |\n| --- | --- | ---------------------------------------------- |\n| 1   | 2   | Mike likes apples.                             |\n| 2   | 1   | Mike gives Alice an apple.                     |\n| 2   | 2   | Alice gives Mike an orange.                    |\n| 3   | 1   | Mike, can you give me some apples?             |\n| 3   | 3   | Mike traded an orange for an apple with Alice. |\n"
    },
    "matchSpan": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchSpan.html",
        "signatures": [
            {
                "full": "matchSpan(textCol, span, slop, [scoreColName])",
                "name": "matchSpan",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "span",
                        "name": "span"
                    },
                    {
                        "full": "slop",
                        "name": "slop"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchSpan](https://docs.dolphindb.com/en/Functions/m/matchSpan.html)\n\n\n\n#### Syntax\n\nmatchSpan(textCol, span, slop, \\[scoreColName])\n\n#### Details\n\nPerform flexible text searches on the column with text indexing set in the PKEY engine.\n\nThis function is used in the `where` clause of a SQL statement to filter rows.\n\nThe query returns rows containing the specified phrase with no more than *slop* extra words (excluding stop words) before, after, or within it.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**span**is a STRING scalar specifying the phrase to search for, which is order-sensitive.\n\n**slop** is a non-negative integer specifying the number of extra words allowed before, after, or within the specified phrase.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing phrase \"mike apple\", allowing up to 3 extra words (excluding stop words) before, after, or within the phrase\nselect * from pt where matchSpan(remark, \"mike apple\", 2)\n```\n\n| id1 | id2 | remark                                         |\n| --- | --- | ---------------------------------------------- |\n| 1   | 2   | Mike likes apples.                             |\n| 2   | 1   | Mike gives Alice an apple.                     |\n| 3   | 3   | Mike traded an orange for an apple with Alice. |\n"
    },
    "matchSuffix": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchSuffix.html",
        "signatures": [
            {
                "full": "matchSuffix(textCol, suffix, [scoreColName])",
                "name": "matchSuffix",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "suffix",
                        "name": "suffix"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchSuffix](https://docs.dolphindb.com/en/Functions/m/matchSuffix.html)\n\n\n\n#### Syntax\n\nmatchSuffix(textCol, suffix, \\[scoreColName])\n\n#### Details\n\nPerform suffix-based text searches on the column with text indexing set in the PKEY engine. This function is used in the `where` clause of a SQL statement to filter rows. The query returns rows containing words with the specified suffix.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**suffix** is a STRING scalar specifying the suffix to search for.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing words suffixed with \"ke\"\nselect * from pt where matchSuffix(remark,\"ke\")\n```\n\n| id1 | id2 | remark                                                  |\n| --- | --- | ------------------------------------------------------- |\n| 1   | 2   | Mike likes apples.                                      |\n| 1   | 3   | Alice likes oranges.                                    |\n| 2   | 1   | Mike gives Alice an apple.                              |\n| 2   | 2   | Alice gives Mike an orange.                             |\n| 2   | 3   | John likes peaches, so he does not give them to anyone. |\n| 3   | 1   | Mike, can you give me some apples?                      |\n| 3   | 3   | Mike traded an orange for an apple with Alice.          |\n"
    },
    "matchUnorderedSpan": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matchUnorderedSpan.html",
        "signatures": [
            {
                "full": "matchUnorderedSpan(textCol, span, slop, [scoreColName])",
                "name": "matchUnorderedSpan",
                "parameters": [
                    {
                        "full": "textCol",
                        "name": "textCol"
                    },
                    {
                        "full": "span",
                        "name": "span"
                    },
                    {
                        "full": "slop",
                        "name": "slop"
                    },
                    {
                        "full": "[scoreColName]",
                        "name": "scoreColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matchUnorderedSpan](https://docs.dolphindb.com/en/Functions/m/matchUnorderedSpan.html)\n\n\n\n#### Syntax\n\nmatchUnorderedSpan(textCol, span, slop, \\[scoreColName])\n\n#### Details\n\nPerform flexible text searches on the column with text indexing set in the PKEY engine. This function is used in the `where` clause of a SQL statement to filter rows.\n\nThe query returns rows containing the specified phrase with no more than *slop* extra words (excluding stop words) before, after, or within it.\n\n**Note**: Unlike `matchSpan`, this function ignores the order of words within the specified phrase.\n\n#### Parameters\n\n**textCol** is the column to be searched, i.e., the column with text indexing set in the PKEY engine.\n\n**span**is a STRING scalar specifying the phrase to search for, which is order-insensitive.\n\n**slop** is a non-negative integer specifying the number of extra words allowed before, after, or within the specified phrase.\n\n**scoreColName** (optional) is a STRING scalar specifying the column name of the text matching score in the output. The default value is null, which means no score column is output. The matching score indicates the degree of matching within a partition; scores across different partitions are not comparable.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\n// Generate data for queries\nstringColumn = [\"There are some apples and oranges.\",\"Mike likes apples.\",\"Alice likes oranges.\",\"Mike gives Alice an apple.\",\"Alice gives Mike an orange.\",\"John likes peaches, so he does not give them to anyone.\",\"Mike, can you give me some apples?\",\"Alice, can you give me some oranges?\",\"Mike traded an orange for an apple with Alice.\"]\nt = table([1,1,1,2,2,2,3,3,3] as id1, [1,2,3,1,2,3,1,2,3] as id2, stringColumn as remark) \nif(existsDatabase(\"dfs://textDB\")) dropDatabase(\"dfs://textDB\")\ndb = database(directory=\"dfs://textDB\", partitionType=VALUE, partitionScheme=[1,2,3], engine=\"PKEY\")\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"id1\",primaryKey=`id1`id2,indexes={\"remark\":\"textindex(parser=english, lowercase=true, stem=true)\"})\npt.tableInsert(t)\n\n// Search for rows containing phrase \"mike apple\" (order-insensitive), allowing up to 2 extra words before, after, or within the phrase\nselect * from pt where matchUnorderedSpan(remark, \"apple mike\", 2)\n```\n\n| id1 | id2 | remark                                         |\n| --- | --- | ---------------------------------------------- |\n| 1   | 2   | Mike likes apples.                             |\n| 2   | 1   | Mike gives Alice an apple.                     |\n| 3   | 3   | Mike traded an orange for an apple with Alice. |\n"
    },
    "matrix": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matrix.html",
        "signatures": [
            {
                "full": "matrix(X1, [X2], ...)",
                "name": "matrix",
                "parameters": [
                    {
                        "full": "X1",
                        "name": "X1"
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": "...",
                        "name": "..."
                    }
                ]
            },
            {
                "full": "matrix(dataType, rows, cols, [columnsCapacity], [defaultValue])",
                "name": "matrix",
                "parameters": [
                    {
                        "full": "dataType",
                        "name": "dataType"
                    },
                    {
                        "full": "rows",
                        "name": "rows"
                    },
                    {
                        "full": "cols",
                        "name": "cols"
                    },
                    {
                        "full": "[columnsCapacity]",
                        "name": "columnsCapacity",
                        "optional": true
                    },
                    {
                        "full": "[defaultValue]",
                        "name": "defaultValue",
                        "optional": true
                    }
                ]
            },
            {
                "full": "matrix(X)",
                "name": "matrix",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [matrix](https://docs.dolphindb.com/en/Functions/m/matrix.html)\n\n\n\n#### Syntax\n\nmatrix(X1, \\[X2], ...)\n\nor\n\nmatrix(dataType, rows, cols, \\[columnsCapacity], \\[defaultValue])\n\nor\n\nmatrix(X)\n\n#### Parameters\n\nFor the first case: **X1**, **X2**, **...** can be data objects including vector, matrix, table (without SYMBOL columns), tuple of vectors and their combination.\n\nFor the second case:\n\n* **dataType** is the data type of the matrix. Data types other than INT128, UUID, IPADDR, POINT and DURATION are supported.\n\n* **rows** is the number of rows.\n\n* **cols** is the number of cols.\n\n* **columnsCapacity** is the amount of memory (in terms of the number of columns) allocated to the matrix. When the number of columns exceeds *columnsCapacity*, the system will first allocate memory of 1.2\\~2 times of *capacity*, copy the data to the new memory space, and release the original memory.\n\n* **defaultValue** is the default value for the elements of the matrix. Without specifying *defaultValue*, all elements in the matrix are 0s for integers/doubles and null values for symbols.\n\nFor the third case: **X** is an array vector ([arrayVector](https://docs.dolphindb.com/en/Programming/DataTypesandStructures/DataForms/Vector/arrayVector.html)) and each vector in *X* must be of the same length.\n\n#### Details\n\nGenerate a matrix.\n\n#### Examples\n\n```\nx=matrix(INT,3,2, ,1);\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 1  | 1  |\n| 1  | 1  |\n\n```\ny = matrix(DECIMAL32(3),2,3)\ny \n```\n\n| #0    | #1    | #2    |\n| ----- | ----- | ----- |\n| 0.000 | 0.000 | 0.000 |\n| 0.000 | 0.000 | 0.000 |\n\n```\ns=matrix(SYMBOL,2,2, ,`T);\ns;\n```\n\n| #0 | #1 |\n| -- | -- |\n| T  | T  |\n| T  | T  |\n\n```\nmatrix(table(1 2 3 as id, 4 5 6 as value));\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nmatrix([1 2 3, 4 5 6]);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nmatrix([1 2 3, 4 5 6], 7 8 9, table(0.5 0.6 0.7 as id), 1..9$3:3);\n```\n\n| #0 | #1 | #2 | #3  | #4 | #5 | #6 |\n| -- | -- | -- | --- | -- | -- | -- |\n| 1  | 4  | 7  | 0.5 | 1  | 4  | 7  |\n| 2  | 5  | 8  | 0.6 | 2  | 5  | 8  |\n| 3  | 6  | 9  | 0.7 | 3  | 6  | 9  |\n\n```\nmatrix(`AA`BB`CC,`DD`EE`FF)\n```\n\n| #0 | #1 |\n| -- | -- |\n| AA | DD |\n| BB | EE |\n| CC | FF |\n\nError occurs when converting a table with SYMBOL columns to a matrix:\n\n```\nt = table(symbol([\"a\", \"b\"]) as sym, [1, 2] as val)\nmatrix(t)\n// output: matrix(t) => Failed to append a table object to a matrix.\n```\n\nConvert SYMBOL to STRING for matrix conversion:\n\n```\nt = table(string([\"a\", \"b\"]) as sym, [1, 2] as val)\nmatrix(t)\n```\n\n| #1 | #2 |\n| -- | -- |\n| a  | 1  |\n| b  | 2  |\n\nRelated functions: [array](https://docs.dolphindb.com/en/Functions/a/array.html) and [dict](https://docs.dolphindb.com/en/Functions/d/dict.html)\n"
    },
    "matrixRank": {
        "url": "https://docs.dolphindb.com/en/Functions/m/matrixRank.html",
        "signatures": [
            {
                "full": "matrixRank(A, [tol])",
                "name": "matrixRank",
                "parameters": [
                    {
                        "full": "A",
                        "name": "A"
                    },
                    {
                        "full": "[tol]",
                        "name": "tol",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [matrixRank](https://docs.dolphindb.com/en/Functions/m/matrixRank.html)\n\n#### Syntax\n\nmatrixRank(A, \\[tol])\n\n#### Details\n\nCalculate the rank of matrix.\n\n#### Parameters\n\n**A**is a numeric matrix. One-dimensional matrices can be represented by vectors.\n\n**tol** is a numeric scalar. Singular values less than *tol*will be treated as zero, so the rank of the matrix will be the number of singular values greater than *tol*. The default value is the minimum precision of double precision floating-point numbers, DBL\\_EPSILON = 2.22044604925e-16.\n\n#### Returns\n\nA INT scalar indicating the rank of matrix.\n\n#### Examples\n\n```\nm1 = matrix(1..4,1..4*2,3..6)\nmatrixRank(m1) \n// output: 2\n```\n\n"
    },
    "mavg": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mavg.html",
        "signatures": [
            {
                "full": "mavg(X, window|weights, [minPeriods])",
                "name": "mavg",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window|weights",
                        "name": "window|weights"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html)\n\n\n\n#### Syntax\n\nmavg(X, window|weights, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nIf *X* is a vector, return a vector of the same length as *X*. If the second parameter is:\n\n* *window*: Calculate the moving averages of *X* in a sliding window of length *window*.\n\n* *weights*: A weight vector used to alculate the moving weighted averages of *X* in a sliding window of length *weights*. The order of weights corresponds one-to-one with the data in the window. The length of *weights* (the weight vector) must be in \\[0,1024]. Return NULL for the first *(size(weights) - 1)* elements. If *weights* is specified, the parameter *minPeriods* doesn't take effect.\n\nIf *X* is a matrix/table, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.\n\n#### Returns\n\n* If *X* is a vector, return a vector of the same length as *X*.\n* If *X* is a matrix, return a matrix with the same shape as *X*.\n* If *X* is a table a table, return a table with the same schema as *X*.\n\n#### Examples\n\n```\nX = 7 4 6 0 -5 32 9 8;\nY = 7 4 6 NULL -5 32 9 8;\nweight = 2 3 5\n\nmavg(X, 4);\n// output: [,,,4.25,1.25,8.25,9,11]\n\nmavg(Y, 4);\n// output: [,,,5.67,1.67,11,12,11]\n\nmavg(Y, weight);\n// output: [,,5.6,5.2,-1.8571,18.125,13.1,13.1]\n```\n\n```\nm=matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(2020.01.06 2020.01.07 2020.01.09 2020.01.11 2020.01.12 2020.01.15, `col1`col2)\nm.setIndexedMatrix!()\nmavg(m, 3d) // equivalent to mavg(m, 3)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.01.06 | 1    | 9    |\n| 2020.01.07 | 1    | 9    |\n| 2020.01.09 | 4    |      |\n| 2020.01.11 | 4    | 10   |\n| 2020.01.12 | 8    | 10   |\n| 2020.01.15 | 6    | 2    |\n\n```\nmavg(m, 1w)\n```\n\n| label      | col1   | col2 |\n| ---------- | ------ | ---- |\n| 2020.01.06 | 1      | 9    |\n| 2020.01.07 | 1      | 9    |\n| 2020.01.09 | 2.5    | 9    |\n| 2020.01.11 | 2.5    | 9.5  |\n| 2020.01.12 | 4.3333 | 9.5  |\n| 2020.01.15 | 6      | 6    |\n\nRelated functions: [avg](https://docs.dolphindb.com/en/Functions/a/avg.html)\n"
    },
    "mavgTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mavgTopN.html",
        "signatures": [
            {
                "full": "mavgTopN(X, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mavgTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mavgTopN](https://docs.dolphindb.com/en/Functions/m/mavgTopN.html)\n\n\n\n#### Syntax\n\nmavgTopN(X, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the average of the first *top* elements.\n\n#### Returns\n\n* If *X* is a vector, return a vector of the same length as *X*.\n* If *X* is a matrix, return a matrix with the same shape as *X*.\n* If *X* is a table a table, return a table with the same schema as *X*.\n\n#### Examples\n\n```\nX = 1..7\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmavgTopN(X, S, 4, 2)\n// output: [1,1.5,2,3.5,3.5,3.5,5]\n\nX = NULL 1 2 3 4 NULL 5\nS = 3 5 1 1 5 2 4\nmavgTopN(X, S, 4, 2)\n// output: [,1,2,2.5,2.5,2.5,3]\n\nX = matrix(1..5, 6..10)\nS = 2022.01.01 2022.02.03 2022.01.23 2022.04.06 2021.12.29\nmavgTopN(X, S, 3, 2)\n```\n\n| #0  | #1  |\n| --- | --- |\n| 1   | 6   |\n| 1.5 | 6.5 |\n| 2   | 7   |\n| 2.5 | 7.5 |\n| 4   | 9   |\n\n```\nX = matrix(1..5, 6..10)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29,NULL 2022.02.03 2022.01.23 2022.04.06 NULL)\nmavgTopN(X, S, 3, 2)\n```\n\n| #0  | #1  |\n| --- | --- |\n| 1   |     |\n| 1.5 | 7   |\n| 2   | 7.5 |\n| 2.5 | 7.5 |\n| 4   | 8.5 |\n\nA table with columns code, date, close and volume.\n\n```\nt = table(take(`IBM`APPL, 20) as code, 2020.01.01 + 1..20 as date, rand(100,20) + 20 as volume, rand(10,20) + 100.0 as close)\n```\n\n| code | date       | volume | close |\n| ---- | ---------- | ------ | ----- |\n| IBM  | 2020.01.02 | 114    | 107   |\n| APPL | 2020.01.03 | 66     | 106   |\n| IBM  | 2020.01.04 | 36     | 106   |\n| APPL | 2020.01.05 | 52     | 101   |\n| IBM  | 2020.01.06 | 28     | 100   |\n| APPL | 2020.01.07 | 55     | 108   |\n| IBM  | 2020.01.08 | 54     | 106   |\n| APPL | 2020.01.09 | 103    | 106   |\n| IBM  | 2020.01.10 | 94     | 104   |\n| APPL | 2020.01.11 | 82     | 102   |\n| IBM  | 2020.01.12 | 98     | 103   |\n| APPL | 2020.01.13 | 118    | 101   |\n| IBM  | 2020.01.14 | 61     | 105   |\n| APPL | 2020.01.15 | 43     | 105   |\n| IBM  | 2020.01.16 | 41     | 104   |\n| APPL | 2020.01.17 | 111    | 106   |\n| IBM  | 2020.01.18 | 119    | 103   |\n| APPL | 2020.01.19 | 24     | 107   |\n| IBM  | 2020.01.20 | 22     | 109   |\n| APPL | 2020.01.21 | 26     | 103   |\n\nCalculate the average of the closing prices of the top 3 records with the highest trading volume in the window for each stock.\n\n```\nselect code, date, mavgTopN(close, volume, 5, 3, false) from t context by code\n```\n\n| code | date       | mavgTopN\\_close |\n| ---- | ---------- | --------------- |\n| APPL | 2020.01.03 | 106             |\n| APPL | 2020.01.05 | 103.5           |\n| APPL | 2020.01.07 | 105             |\n| APPL | 2020.01.09 | 106.6667        |\n| APPL | 2020.01.11 | 104.6667        |\n| APPL | 2020.01.13 | 103             |\n| APPL | 2020.01.15 | 103             |\n| APPL | 2020.01.17 | 104.3333        |\n| APPL | 2020.01.19 | 103             |\n| APPL | 2020.01.21 | 104             |\n| IBM  | 2020.01.02 | 107             |\n| IBM  | 2020.01.04 | 106.5           |\n| IBM  | 2020.01.06 | 104.3333        |\n| IBM  | 2020.01.08 | 106.3333        |\n| IBM  | 2020.01.10 | 105.6667        |\n| IBM  | 2020.01.12 | 104.3333        |\n| IBM  | 2020.01.14 | 104             |\n| IBM  | 2020.01.16 | 104             |\n| IBM  | 2020.01.18 | 103.3333        |\n| IBM  | 2020.01.20 | 103.6667        |\n\nRelated function: [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html)\n"
    },
    "max": {
        "url": "https://docs.dolphindb.com/en/Functions/m/max.html",
        "signatures": [
            {
                "full": "max(X)",
                "name": "max",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [max](https://docs.dolphindb.com/en/Functions/m/max.html)\n\n\n\n#### Syntax\n\nmax(X)\n\n#### Details\n\nFor one input:\n\n* If *X* is a vector, return the maximum in *X*.\n\n* If *X* is a matrix, return a vector composed of the maximum in each column of *X*.\n\n* If *X* is a table, return a table composed of the maximum in each column of *X*.\n\nFor two inputs:\n\n* If *Y* is a scalar, compare it with each element in *X*, replace the element in *X* with the larger value.\n\n* If *Y* and *X* are of the same type and length, compare the corresponding elements of them and return a result containing each larger value.\n\n**Note:**\n\nBefore version 1.30.20/2.00.8, the function `max` compares the values of temporal types by converting them into LONG values;\n\nSince version 1.30.20/2.00.8, DolphinDB has changed the handling of temporal types:\n\n* If *X* and *Y* are temporal scalars with different levels of time granularity, the coarser-grained value is converted to the finer granularity for comparison.\n\n* If *X* and/or *Y* is a vector, matrix, or table, the compared elements must be of the same temporal type.\n\nAlthough the `max` functions in DolphinDB, NumPy, and Python built-ins all return the maximum value, they differ in the following aspects:\n\n* DolphinDB supports scalars, vectors, matrices, tables, and temporal types; NumPy supports multi-dimensional arrays; and Python built-ins support any iterable.\n* DolphinDB supports comparing two parameters; Python built-in functions support comparing multiple parameters; NumPy does not support multi-argument comparisons.\n* The Python built-in `max` function allows you to specify a key to define a custom sort order.\n\nDolphinDB `max` and TA-Lib `MAX` differ in semantics. DolphinDB `max` calculates either the global maximum or element-wise maxima, whereas TA-Lib `MAX` calculates the rolling maximum over a specified window.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n**Y** (optional) is a scalar, a vector of the same length as *X* or a matrix.\n\n#### Returns\n\n* For one input:\n  * If *X* is a vector, the functions returns a scalar.\n  * If *X* is a matrix, the functions returns a vector.\n  * If *X* is a table, the functions returns a table.\n* For two inputs:\n  * If *Y* is a scalar, the function returns an object with the same dimensions as *X*, where each element is `max(X[i], Y)`.\n  * If *Y* has the same type and length as *X*, the function returns an object composed of the larger values at each corresponding position.\n\n#### Examples\n\n```\nmax(1 2 3);\n// output: 3\n\nmax(7.8 9 5.4);\n// output: 9\n\n(5 8 2 7).max();\n// output: 8\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nmax(m);\n// output: [3,6]\n```\n\n```\nmax(1 2 3, 2)\n// output: 2 2 3\n\nn = matrix(1 1 1, 5 5 5)\nn;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 5  |\n| 1  | 5  |\n| 1  | 5  |\n\n```\nmax(m, n);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 5  |\n| 2  | 5  |\n| 3  | 6  |\n\nUse with SQL SELECT to return the maximum value of a column:\n\n```\nt = table(`abb`aac`aaa as sym, 1.8 2.3 3.7 as price);\nselect max price from t;\n```\n\n| max\\_price |\n| ---------- |\n| 3.7        |\n\n`max` can be applied to strings to return the lexicographically largest string:\n\n```\nselect max sym from t;\n```\n\n| max\\_sym |\n| -------- |\n| abb      |\n\nRelated function: [mmax](https://docs.dolphindb.com/en/Functions/m/mmax.html)\n"
    },
    "maxDrawdown": {
        "url": "https://docs.dolphindb.com/en/Functions/m/maxDrawdown.html",
        "signatures": [
            {
                "full": "maxDrawdown(X, [ratio=true])",
                "name": "maxDrawdown",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ratio=true]",
                        "name": "ratio",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [maxDrawdown](https://docs.dolphindb.com/en/Functions/m/maxDrawdown.html)\n\n#### Syntax\n\nmaxDrawdown(X, \\[ratio=true])\n\n#### Details\n\nCalculate the maximum drawdown for the input *X*. Null values are ignored in calculation.\n\n#### Parameters\n\n**X** is a numeric vector, indicating the input data for calculating maximum drawdown (MDD), commonly cumulative return (or rate).\n\n**ratio** (optional) is a Boolean scalar indicating whether to express the MDD in ratio or absolute value.\n\n* true (default): Return the ratio of MDD over the peak.\n\n  ![](https://docs.dolphindb.com/en/images/mdd1.png)\n\n* false: Return the absolute value of MDD.\n\n  ![](https://docs.dolphindb.com/en/images/mdd2.png)\n\n#### Returns\n\nA scalar of the same type as *X*.\n\n#### Examples\n\nSuppose the daily returns for a portfolio are as follows:\n\n| Date       | Returns |\n| ---------- | ------- |\n| 2024-10-01 | 36      |\n| 2024-10-02 | 96      |\n| 2024-10-03 | 42      |\n| 2024-10-04 | 100     |\n| 2024-10-05 | 59      |\n| 2024-10-06 | 86      |\n| 2024-10-07 | 25      |\n| 2024-10-08 | 72      |\n\nCalculate the maximum drawdown:\n\n```\nx = [36,96,42,100,59,86,25,64,72]\n\nmaxDrawdown(x)\n// output: 0.75\nmaxDrawdown(x, false)\n// output: 75\n```\n\n"
    },
    "maxIgnoreNull": {
        "url": "https://docs.dolphindb.com/en/Functions/m/maxIgnoreNull.html",
        "signatures": [
            {
                "full": "maxIgnoreNull(X, Y)",
                "name": "maxIgnoreNull",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [maxIgnoreNull](https://docs.dolphindb.com/en/Functions/m/maxIgnoreNull.html)\n\n#### Syntax\n\nmaxIgnoreNull(X, Y)\n\n#### Details\n\nA binary scalar function that returns the maximum by comparing *X* with *Y*.\n\nDifference between `max` and `maxIgnoreNull`:\n\n* `max`: Null values are treated as the minimum value if \\*nullAsMinValueForComparison=\\*true, otherwise comparison involving null values returns NULL.\n\n* `maxIgnoreNull`: Null values are ignored in comparison and non-null maximum is returned. If both elements in *X* and *Y* are null, NULL is returned. This function is not affected by configuration parameter *nullAsMinValueForComparison*.\n\n#### Parameters\n\n**X** and **Y** can be a numeric, LITERAL or TEMPORAL scalar, pair, vector or matrix.\n\n#### Returns\n\n* If the input is a scalar, returns a scalar.\n\n* If the input is a vector, returns a vector with element-wise comparison.\n\n* If the input is a matrix, returns a matrix with element-wise comparison.\n\n* If the input is a pair, returns a pair.\n\n#### Examples\n\n```\nmaxIgnoreNull(2,matrix(1  NULL 4,-1 4  0)) \n```\n\n| #0 | #1 |\n| -- | -- |\n| 2  | 2  |\n| 2  | 4  |\n| 4  | 2  |\n\n```\nmaxIgnoreNull(matrix(10 3 NULL, 1 7 4),matrix(1  NULL 4,-1 4  0))\n```\n\n<table id=\"table_slz_glq_3bc\"><tbody><tr><td>\n\n\\#0\n\n</td><td>\n\n\\#1\n\n</td></tr><tr><td>\n\n10\n\n</td><td>\n\n1\n\n</td></tr><tr><td>\n\n3\n\n</td><td>\n\n7\n\n</td></tr><tr><td>\n\n-4\n\n</td><td>\n\n4\n\n</td></tr></tbody>\n</table>Use `minIgnoreNull` with `reduce` to calculate the minimum for matrices of the same shape stored in a tuple:\n\n```\nn1 = matrix(1 1 1, 5 5 5)\nn2 = matrix(10 11 12, 0 NULL -5)\nn3 = matrix(-1 1 NULL, -3 0 10)\nreduce(minIgnoreNull, [n1,n2,n3])\n```\n\n| #0 | #1 |\n| -- | -- |\n| 10 | 5  |\n| 11 | 5  |\n| 12 | 10 |\n\n**Related function**: [minIgnoreNull](https://docs.dolphindb.com/en/Functions/m/minIgnoreNull.html)\n\n"
    },
    "maxPositiveStreak": {
        "url": "https://docs.dolphindb.com/en/Functions/m/maxPositiveStreak.html",
        "signatures": [
            {
                "full": "maxPositiveStreak(X)",
                "name": "maxPositiveStreak",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [maxPositiveStreak](https://docs.dolphindb.com/en/Functions/m/maxPositiveStreak.html)\n\n\n\n#### Syntax\n\nmaxPositiveStreak(X)\n\n#### Details\n\nIf *X* is a vector: return the maximum value of of the sum of consecutive positive elements of *X*.\n\nIf *X* is a matrix, return the maximum value of of the sum of consecutive positive elements in each column of *X*.\n\n`maxPositiveStreak(X)` = `max(cumPositiveStreak(X))`\n\n#### Parameters\n\n**X** is a scalar/vector/matrix. The elements of *X* must be logic or integer values.\n\n#### Returns\n\nThe function returns an object of the same type and form as *X*.\n\n#### Examples\n\n```\nx=1 0 -1 1 2 2 2 1 0 -1 0 2;\ncumPositiveStreak x;\n// output: [1,0,0,1,3,5,7,8,0,0,0,2]\n\nmaxPositiveStreak x;\n// output: 8\n\ny=x$6:2;\ny;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 2  |\n| 0  | 1  |\n| -1 | 0  |\n| 1  | -1 |\n| 2  | 0  |\n| 2  | 2  |\n\n```\ncumPositiveStreak(y);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 2  |\n| 0  | 3  |\n| 0  | 0  |\n| 1  | 0  |\n| 3  | 0  |\n| 5  | 2  |\n\n```\nmaxPositiveStreak(y);\n// output: [5,3]\n```\n\nRelated function: [cumPositiveStreak](https://docs.dolphindb.com/en/Functions/c/cumPositiveStreak.html)\n"
    },
    "mbeta": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mbeta.html",
        "signatures": [
            {
                "full": "mbeta(Y, X, window, [minPeriods])",
                "name": "mbeta",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mbeta](https://docs.dolphindb.com/en/Functions/m/mbeta.html)\n\n\n\n#### Syntax\n\nmbeta(Y, X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the coefficient estimate of an ordinary-least-squares regression of *Y* on *X* in a sliding window.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\n```\nx=0.011 0.006 -0.008 0.012 -0.016 -0.023 0.018\ny=0.016 0.009 -0.012 0.022 0.003 -0.056 0.002\nmbeta(y, x, 5);\n// output: [,,,,0.818182,1.692379,1.188532]\n\nmbeta(y, x, 5, 3);\n// output: [,,1.479381,1.594701,0.818182,1.692379,1.188532]\n```\n\n```\nx1 = indexedSeries(date(2020.06.05)+1..7, x)\ny1 = indexedSeries(date(2020.06.05)+1..7, y)\nmbeta(y1, x1, 5d);\n```\n\n| label      | col1   |\n| ---------- | ------ |\n| 2020.06.06 |        |\n| 2020.06.07 | 1.4    |\n| 2020.06.08 | 1.4794 |\n| 2020.06.09 | 1.5947 |\n| 2020.06.10 | 0.8182 |\n| 2020.06.11 | 1.6924 |\n| 2020.06.12 | 1.1885 |\n\n```\nmbeta(y1, x1, 1w);\n```\n\n| label      | col1   |\n| ---------- | ------ |\n| 2020.06.06 |        |\n| 2020.06.07 | 1.4    |\n| 2020.06.08 | 1.4794 |\n| 2020.06.09 | 1.5947 |\n| 2020.06.10 | 0.8182 |\n| 2020.06.11 | 1.6924 |\n| 2020.06.12 | 1.2659 |\n\nRelated function: [beta](https://docs.dolphindb.com/en/Functions/b/beta.html)\n"
    },
    "mbetaTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mbetaTopN.html",
        "signatures": [
            {
                "full": "mbetaTopN(X, Y, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mbetaTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mbetaTopN](https://docs.dolphindb.com/en/Functions/m/mbetaTopN.html)\n\n\n\n#### Syntax\n\nmbetaTopN(X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the coefficient estimate ordinary-least-squares regressions of *Y* on *X*.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\nUsing IBM stock as an example, simulate index return rates, stock return rates, and trading volumes for six consecutive trading days:\n\n```\nsymbol = take(`IBM, 6)\ntradeDate = 2024.01.02 2024.01.03 2024.01.04 2024.01.05 2024.01.08 2024.01.09\nindexRet = [0.6, 1.1, -0.2, 0.9, 1.3, 0.4]\nstockRet = [0.9, 1.7, -0.1, 1.4, 1.9, 0.8]\ntradeVolume = [520, 860, 610, 940, 650, 880]\n\nstockDaily = table(symbol, tradeDate, indexRet, stockRet, tradeVolume)\nstockDaily;\n```\n\nOutput:\n\n| symbol | tradeDate  | indexRet | stockRet | tradeVolume |\n| ------ | ---------- | -------- | -------- | ----------- |\n| IBM    | 2024.01.02 | 0.6      | 0.9      | 520         |\n| IBM    | 2024.01.03 | 1.1      | 1.7      | 860         |\n| IBM    | 2024.01.04 | -0.2     | -0.1     | 610         |\n| IBM    | 2024.01.05 | 0.9      | 1.4      | 940         |\n| IBM    | 2024.01.08 | 1.3      | 1.9      | 650         |\n| IBM    | 2024.01.09 | 0.4      | 0.8      | 880         |\n\nOver the most recent four trading days, select the top two trading days by trading volume and use the least squares method to estimate the regression coefficient of indexRet on stockRet:\n\n```\nmbetaTopN(X=stockRet, Y=indexRet, S=tradeVolume, window=4, top=2, ascending=false)\n// Output: [ , 1.6, 1.3846, 1.5, 1.5, 1.2]\n```\n\n* stockRet is the regression independent variable, and indexRet is the regression dependent variable;\n* tradeVolume is used to select the most active trading days;\n* For the data on 2024.01.09, the two trading days with the highest trading volume in the most recent four-day window correspond to the samples (0.9, 1.4) and (0.4, 0.8);\n* Based on these two samples, the least squares estimate of the regression coefficient of indexRet on stockRet is 1.2.\n\nRelated function: [mbeta](https://docs.dolphindb.com/en/Functions/m/mbeta.html)\n"
    },
    "mcorr": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mcorr.html",
        "signatures": [
            {
                "full": "mcorr(X, Y, window, [minPeriods])",
                "name": "mcorr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mcorr](https://docs.dolphindb.com/en/Functions/m/mcorr.html)\n\n\n\n#### Syntax\n\nmcorr(X, Y, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the correlation of *X* and *Y* in a sliding window.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\n```\nx=1..8\ny=9 5 3 4 5 4 7 1\nmcorr(x,y,5);\n// output: [,,,,-0.624038,0,0.834058,-0.29173]\n\nmcorr(x,y,5,3);\n// output: [,,-0.981981,-0.834497,-0.624038,0,0.834058,-0.29173]\n\nx1 = indexedSeries(date(2020.06.05)+1..8, x)\ny1 = indexedSeries(date(2020.06.05)+1..6 join 2020.06.15 join 2020.06.16, y)\nmcorr(x1,y1,5d)\n```\n\n| label      | col1    |\n| ---------- | ------- |\n| 2020.06.06 |         |\n| 2020.06.07 | -1      |\n| 2020.06.08 | -0.982  |\n| 2020.06.09 | -0.8345 |\n| 2020.06.10 | -0.624  |\n| 2020.06.11 | 0       |\n| 2020.06.12 | 0.6325  |\n| 2020.06.13 | 0       |\n\n```\nmcorr(x1,y1,1w)\n```\n\n| label      | col1    |\n| ---------- | ------- |\n| 2020.06.06 |         |\n| 2020.06.07 | -1      |\n| 2020.06.08 | -0.982  |\n| 2020.06.09 | -0.8345 |\n| 2020.06.10 | -0.624  |\n| 2020.06.11 | -0.6116 |\n| 2020.06.12 | -0.6116 |\n| 2020.06.13 | 0       |\n\nRelated functions: [corr](https://docs.dolphindb.com/en/Functions/c/corr.html), [mmin](https://docs.dolphindb.com/en/Functions/m/mmin.html), [mmax](https://docs.dolphindb.com/en/Functions/m/mmax.html), [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html), [msum](https://docs.dolphindb.com/en/Functions/m/msum.html), [mstd](https://docs.dolphindb.com/en/Functions/m/mstd.html), [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html)\n"
    },
    "mcorrTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mcorrTopN.html",
        "signatures": [
            {
                "full": "mcorrTopN(X, Y, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mcorrTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mcorrTopN](https://docs.dolphindb.com/en/Functions/m/mcorrTopN.html)\n\n\n\n#### Syntax\n\nmcorrTopN(X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving correlation of the first *top* pairs of elements in *X* and *Y*.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\nUsing IBM stock as an example, simulate index return rates, stock return rates, and trading volumes for six consecutive trading days:\n\n```\nsymbol = take(`IBM, 6)\ntradeDate = 2024.01.02 2024.01.03 2024.01.04 2024.01.05 2024.01.08 2024.01.09\nindexRet = [0.6, 1.1, -0.2, 0.9, 1.3, 0.4]\nstockRet = [0.9, 1.6, 0.4, 0.2, 0.2, 0.4]\ntradeVolume = [520, 860, 610, 940, 650, 880]\n\nstockDaily = table(symbol, tradeDate, indexRet, stockRet, tradeVolume)\nstockDaily;\n```\n\nOutput:\n\n| symbol | tradeDate  | indexRet | stockRet | tradeVolume |\n| ------ | ---------- | -------- | -------- | ----------- |\n| IBM    | 2024.01.02 | 0.6      | 0.9      | 520         |\n| IBM    | 2024.01.03 | 1.1      | 1.6      | 860         |\n| IBM    | 2024.01.04 | -0.2     | 0.4      | 610         |\n| IBM    | 2024.01.05 | 0.9      | 0.2      | 940         |\n| IBM    | 2024.01.08 | 1.3      | 0.2      | 650         |\n| IBM    | 2024.01.09 | 0.4      | 0.4      | 880         |\n\nOver the most recent four trading days, select the top 2 trading days by trading volume and calculate the correlation between indexRet and stockRet:\n\n```\nmcorrTopN(X=indexRet, Y=stockRet, S=tradeVolume, window=4, top=2, ascending=false)\n// output: [ , 1, 1, 1, 1, -1]\n```\n\n* tradeVolume is used to select the most active trading days;\n* For the data on 2024.01.09, within the most recent four-day window, the two trading days with the highest trading volume correspond to the samples (0.9, 0.2) and (0.4, 0.4). Their correlation coefficient is -1.\n\nRelated function: [mcorr](https://docs.dolphindb.com/en/Functions/m/mcorr.html)\n"
    },
    "mcount": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mcount.html",
        "signatures": [
            {
                "full": "mcount(X, window, [minPeriods=1])",
                "name": "mcount",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods=1]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [mcount](https://docs.dolphindb.com/en/Functions/m/mcount.html)\n\n\n\n#### Syntax\n\nmcount(X, window, \\[minPeriods=1])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the number of non-null values of *X* in a sliding window.\n\n#### Returns\n\nThe result is of type INT, with the same form as the input parameters.\n\n#### Examples\n\n```\nx = 7 4 5 8 9;\nmcount(x, 3);\n// output: [1,2,3,3,3]\n\nmcount(x, 3, minPeriods=2);\n// output: [,2,3,3,3]\n\nx1 =1 2 3 NULL 5;\nmcount(x1, 3);\n// output: [1,2,3,2,2]\n\nmcount(x1, 3, minPeriods=3);\n// output: [,,3,,]\n\nm=matrix(1 2 NULL 4 5, 6 7 8 9 NULL);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 6  |\n| 2  | 7  |\n|    | 8  |\n| 4  | 9  |\n| 5  |    |\n\n```\nmcount(m,3);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 2  | 2  |\n| 2  | 3  |\n| 2  | 3  |\n| 2  | 2  |\n\n```\ns=indexedSeries(date(2020.05.26)+1..8, 3 4 9 NULL 4 6 NULL 8)\nmcount(s,4d)\n```\n\n| label      | col1 |\n| ---------- | ---- |\n| 2020.05.27 | 1    |\n| 2020.05.28 | 2    |\n| 2020.05.29 | 3    |\n| 2020.05.30 | 3    |\n| 2020.05.31 | 3    |\n| 2020.06.01 | 3    |\n| 2020.06.02 | 2    |\n| 2020.06.03 | 3    |\n\n```\nmcount(s,1w)\n```\n\n| label      | col1 |\n| ---------- | ---- |\n| 2020.05.27 | 1    |\n| 2020.05.28 | 2    |\n| 2020.05.29 | 3    |\n| 2020.05.30 | 3    |\n| 2020.05.31 | 4    |\n| 2020.06.01 | 5    |\n| 2020.06.02 | 5    |\n| 2020.06.03 | 5    |\n\nRelated functions: [count](https://docs.dolphindb.com/en/Functions/c/count.html)\n"
    },
    "mcovar": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mcovar.html",
        "signatures": [
            {
                "full": "mcovar(X, Y, window, [minPeriods])",
                "name": "mcovar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mcovar](https://docs.dolphindb.com/en/Functions/m/mcovar.html)\n\n\n\n#### Syntax\n\nmcovar(X, Y, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving covariance of *X* and *Y* in a sliding window.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\n```\nx=1..10;\ny=9 5 3 4 5 4 7 1 3 4;\nmcovar(x,y,5);\n// output: [,,,,-2.25,0,2,-1,-1.75,-1]\n\nmcovar(x, y, 5, 3);\n// output: [,,-3,-2.833333,-2.25,0,2,-1,-1.75,-1]\n\nx1 = indexedSeries(date(2020.06.05)+1..10, x)\ny1 = indexedSeries(date(2020.06.05)+1..10, y)\nmcovar(x1,y1,5d)\n```\n\n| label      | col1    |\n| ---------- | ------- |\n| 2020.06.06 |         |\n| 2020.06.07 | -2      |\n| 2020.06.08 | -3      |\n| 2020.06.09 | -2.8333 |\n| 2020.06.10 | -2.25   |\n| 2020.06.11 | 0       |\n| 2020.06.12 | 2       |\n| 2020.06.13 | -1      |\n| 2020.06.14 | -1.75   |\n| 2020.06.15 | -1      |\n\n```\nmcovar(x1,y1,1w)\n```\n\n| label      | col1    |\n| ---------- | ------- |\n| 2020.06.06 |         |\n| 2020.06.07 | -2      |\n| 2020.06.08 | -3      |\n| 2020.06.09 | -2.8333 |\n| 2020.06.10 | -2.25   |\n| 2020.06.11 | -2.4    |\n| 2020.06.12 | -1      |\n| 2020.06.13 | -0.6667 |\n| 2020.06.14 | -0.6667 |\n| 2020.06.15 | -1.6667 |\n\nRelated functions: [covar](https://docs.dolphindb.com/en/Functions/c/covar.html), [mcorr](https://docs.dolphindb.com/en/Functions/m/mcorr.html), [mstd](https://docs.dolphindb.com/en/Functions/m/mstd.html), [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html)\n"
    },
    "mcovarp": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mcovarp.html",
        "signatures": [
            {
                "full": "mcovarp(X, Y, window, [minPeriods])",
                "name": "mcovarp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mcovarp](https://docs.dolphindb.com/en/Functions/m/mcovarp.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nmcovarp(X, Y, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculates the population covariance of *X* and *Y* over a sliding window of the specified length, measured by either element count or time.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\n```\nx=1..10;\ny=9 5 3 4 5 4 7 1 3 4;\nmcovarp(x,y,5);\n// output: [,,,,-1.8,0,1.6,-0.8,-1.4,-0.8]\n\nmcovarp(x, y, 5, 3);\n// output: [,,-2,-2.13,-1.8,0,1.6,-0.8,-1.4,-0.8]\n\n\nx1 = indexedSeries(date(2026.01.05)+1..10, x)\ny1 = indexedSeries(date(2026.01.05)+1..10, y)\nmcovarp(x1,y1,5d)\n```\n\n|            | 0      |\n| ---------- | ------ |\n| 2026.01.06 | 0      |\n| 2026.01.07 | -1     |\n| 2026.01.08 | -2     |\n| 2026.01.09 | -2.125 |\n| 2026.01.10 | -1.8   |\n| 2026.01.11 | 0      |\n| 2026.01.12 | 1.6    |\n| 2026.01.13 | -0.8   |\n| 2026.01.14 | -1.4   |\n| 2026.01.15 | -0.8   |\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "mcovarpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mcovarpTopN.html",
        "signatures": [
            {
                "full": "mcovarpTopN(X, Y, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mcovarpTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mcovarpTopN](https://docs.dolphindb.com/en/Functions/m/mcovarpTopN.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nmcovarpTopN(X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the population covariance of the first *top* pairs of elements in *X* and *Y*.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\nUsing IBM stock as an example, simulate index return rates, stock return rates, and trading volumes for six consecutive trading days:\n\n```\nsymbol = take(`IBM, 6)\ntradeDate = 2024.01.02 2024.01.03 2024.01.04 2024.01.05 2024.01.08 2024.01.09\nindexRet = [0.6, 1.1, -0.2, 0.9, 1.3, 0.4]\nstockRet = [0.9, 1.7, -0.1, 1.4, 1.9, 0.8]\ntradeVolume = [520, 860, 610, 940, 650, 880]\n\nstockDaily = table(symbol, tradeDate, indexRet, stockRet, tradeVolume)\nstockDaily;\n```\n\nOutput:\n\n| symbol | tradeDate  | indexRet | stockRet | tradeVolume |\n| ------ | ---------- | -------- | -------- | ----------- |\n| IBM    | 2024.01.02 | 0.6      | 0.9      | 520         |\n| IBM    | 2024.01.03 | 1.1      | 1.7      | 860         |\n| IBM    | 2024.01.04 | -0.2     | -0.1     | 610         |\n| IBM    | 2024.01.05 | 0.9      | 1.4      | 940         |\n| IBM    | 2024.01.08 | 1.3      | 1.9      | 650         |\n| IBM    | 2024.01.09 | 0.4      | 0.8      | 880         |\n\nOver the most recent four trading days, select the top two trading days by trading volume and calculate the population covariance of stockRet and indexRet:\n\n```\nmcovarpTopN(X=indexRet, Y=stockRet, S=tradeVolume, window=4, top=2, ascending=false)\n// Output: [0, 0.1, 0.585, 0.015, 0.015, 0.075]\n```\n\n* tradeVolume is used to select the most active trading days;\n* For the data on 2024.01.09, the two trading days with the highest trading volume in the most recent four-day window correspond to the samples (0.9, 1.4) and (0.4, 0.8), whose population covariance is 0.075.\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "mcovarTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mcovarTopN.html",
        "signatures": [
            {
                "full": "mcovarTopN(X, Y, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mcovarTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mcovarTopN](https://docs.dolphindb.com/en/Functions/m/mcovarTopN.html)\n\n\n\n#### Syntax\n\nmcovarTopN(X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving covariance of the first *top* pairs of elements in *X* and *Y*.\n\n#### Returns\n\nThe result is of type DOUBLE, with the same form as the input parameters.\n\n#### Examples\n\nUsing IBM stock as an example, simulate index return rates, stock return rates, and trading volumes for six consecutive trading days:\n\n```\nsymbol = take(`IBM, 6)\ntradeDate = 2024.01.02 2024.01.03 2024.01.04 2024.01.05 2024.01.08 2024.01.09\nindexRet = [0.6, 1.1, -0.2, 0.9, 1.3, 0.4]\nstockRet = [0.9, 1.7, -0.1, 1.4, 1.9, 0.8]\ntradeVolume = [520, 860, 610, 940, 650, 880]\n\nstockDaily = table(symbol, tradeDate, indexRet, stockRet, tradeVolume)\nstockDaily;\n```\n\nOutput:\n\n| symbol | tradeDate  | indexRet | stockRet | tradeVolume |\n| ------ | ---------- | -------- | -------- | ----------- |\n| IBM    | 2024.01.02 | 0.6      | 0.9      | 520         |\n| IBM    | 2024.01.03 | 1.1      | 1.7      | 860         |\n| IBM    | 2024.01.04 | -0.2     | -0.1     | 610         |\n| IBM    | 2024.01.05 | 0.9      | 1.4      | 940         |\n| IBM    | 2024.01.08 | 1.3      | 1.9      | 650         |\n| IBM    | 2024.01.09 | 0.4      | 0.8      | 880         |\n\nOver the most recent four trading days, select the top two trading days by trading volume and calculate the covariance of stockRet and indexRet:\n\n```\nmcovarTopN(X=indexRet, Y=stockRet, S=tradeVolume, window=4, top=2, ascending=false)\n// Output: [ , 0.2, 1.17, 0.03, 0.03, 0.15]\n```\n\n* tradeVolume is used to select the most active trading days;\n* For the data on 2024.01.09, the two trading days with the highest trading volume in the most recent four-day window correspond to the samples (0.9, 1.4) and (0.4, 0.8), whose covariance is 0.15.\n\nRelated function: [mcovar](https://docs.dolphindb.com/en/Functions/m/mcovar.html)\n"
    },
    "md5": {
        "url": "https://docs.dolphindb.com/en/Functions/m/md5.html",
        "signatures": [
            {
                "full": "md5(X)",
                "name": "md5",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [md5](https://docs.dolphindb.com/en/Functions/m/md5.html)\n\n\n\n#### Syntax\n\nmd5(X)\n\n#### Details\n\nCreate an MD5 hash from STRING. The result is of data type INT128.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nAn INT128 scalar or vector.\n\n#### Examples\n\n```\na=md5(`e`f);\na;\n// output: [e1671797c52e15f763380b45e841ec32,8fa14cdd754f91cc6554c9e71929cce7]\n\ntypestr(a);\n// output: INT128\n```\n"
    },
    "mean": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mean.html",
        "signatures": [
            {
                "full": "mean(X)",
                "name": "mean",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [mean](https://docs.dolphindb.com/en/Functions/m/mean.html)\n\n\n\n#### Syntax\n\nmean(X)\n\n#### Details\n\nCalculate the average of *X*.\n\n* If *X* is a matrix, calculate the average of each column and return a vector.\n\n* If *X* is a table, calculate the average of each column and return a table.\n\nThis function is equivalent to [avg](https://docs.dolphindb.com/en/Functions/a/avg.html).\n\nThe calculation skips null values.\n\nThe DolphinDB `mean` function operates on vectors, matrices, and tables. For matrices and tables, it calculates the column mean by default. There is no concept of a \"global mean\"; if you need it, you need to flatten the data manually. NumPy's `mean` function is designed for multi-dimensional arrays. By default, it flattens the input into a one-dimensional array and computes the global mean. To compute along rows, columns, or multiple axes, you need to explicitly specify the *axis* parameter.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\n* If *X* is a vector, returns a DOUBLE scalar.\n\n* If *X* is a matrix, returns a DOUBLE vector.\n\n* If *X* is a table, returns a table.\n\n#### Examples\n\n```\nx=1 5 9;\nmean(x);\n// output: 5\n\nx=1 5 9 NULL;\nmean(x);\n// output: 5\n\navg(x);\n// output: 5\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nmean(m);\n// output: [2,5]\n```\n\nRelated center data tendency functions: [mode](https://docs.dolphindb.com/en/Functions/m/mode.html), [med](https://docs.dolphindb.com/en/Functions/m/med.html)\n"
    },
    "med": {
        "url": "https://docs.dolphindb.com/en/Functions/m/med.html",
        "signatures": [
            {
                "full": "med(X)",
                "name": "med",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [med](https://docs.dolphindb.com/en/Functions/m/med.html)\n\n\n\n#### Syntax\n\nmed(X)\n\n#### Details\n\nIf *X* is a vector, return the median of all the elements in *X*.\n\nIf *X* is a matrix, calculate the median of each column of *X* and return a vector.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\nPlease note that the data type of the result is always DOUBLE.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\nx=3 6 1 5 9;\nmed x;\n// output: 5\n\nm=matrix(1 2 10, 4 5 NULL);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 10 |    |\n\n```\nmed m;\n// output: [2,4.5]\n```\n\nRelated center data tendency functions: [mean](https://docs.dolphindb.com/en/Functions/m/mean.html) and [mode](https://docs.dolphindb.com/en/Functions/m/mode.html)\n"
    },
    "mem": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mem.html",
        "signatures": [
            {
                "full": "mem([freeUnusedBlocks=false])",
                "name": "mem",
                "parameters": [
                    {
                        "full": "[freeUnusedBlocks=false]",
                        "name": "freeUnusedBlocks",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [mem](https://docs.dolphindb.com/en/Functions/m/mem.html)\n\n\n\n#### Syntax\n\nmem(\\[freeUnusedBlocks=false])\n\n#### Details\n\nDisplay the memory usage of the current node. If *freeUnusedBlocks*=true, free unused memory blocks.\n\n#### Parameters\n\n**freeUnusedBlocks** is of DOUBLE type, with a range of 0 to 1, representing the percentage of unused memory blocks to be freed. The default value is false.\n\n#### Returns\n\nA dictionary.\n\n#### Examples\n\n```\nundef all;\nt1=table(1 2 3 as a, `x`y`z as b, 10.8 7.6 3.5 as c)\nmem();\n\n// output\nfreeBytes->492904\nallocatedBytes->8454144\n\n\nx=bigarray(INT,100000,10000000)\nmem();\n\n// output\nfreeBytes->491056\nallocatedBytes->12648448\n\n\nundef all;\nmem();\n\n// output\nfreeBytes->4687936\nallocatedBytes->12648448\n```\n"
    },
    "member": {
        "url": "https://docs.dolphindb.com/en/Functions/m/member.html",
        "signatures": [
            {
                "full": "member(X, Y)",
                "name": "member",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [member](https://docs.dolphindb.com/en/Functions/m/member.html)\n\n\n\n#### Syntax\n\nmember(X, Y) or X.Y\n\n#### Details\n\nReturn the specified member/attribute of an object.\n\n#### Parameters\n\n**X** is a table/dictionary.\n\n**Y** is a member/attribute of *X*.\n\n#### Details\n\nReturn the specified member/attribute of an object.\n\n#### Examples\n\n```\nx=1 2 3\ny=4 5 6\nt=table(x,y);\n\nt.x;\n// output: [1,2,3]\n\nt.y;\n// output: [4,5,6]\n\nt.rows();\n// output: 3\n\nt.cols();\n// output: 2\n\nt.size();\n// output: 3\n// a table's size is defined as the number of its rows\n\nd = dict(1 2 3, 4 5 6);\nd;\n/* output:\n3->6\n1->4\n2->5\n*/\n\nd.2;\n// output: 5\n```\n\nSince version 2.00.11.1/1.30.23.1, a line break can be introduced before any member access operators (.) to continue the call on the next line.\n\n```\nt = table(take(1..5,10) as a, take(6..10,10) as b, take(1..2,10) as c)\n\nt.replaceColumn!(\"a\",lpad(string(t.a),6,\"0\"))\n     .replaceColumn!(\"b\",rpad(string(t.b),6,\"0\")).add(100)\n```\n"
    },
    "memberModify!": {
        "url": "https://docs.dolphindb.com/en/Functions/m/memberModify!.html",
        "signatures": [
            {
                "full": "memberModify!(obj, function, indices, [parameters])",
                "name": "memberModify!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "function",
                        "name": "function"
                    },
                    {
                        "full": "indices",
                        "name": "indices"
                    },
                    {
                        "full": "[parameters]",
                        "name": "parameters",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [memberModify!](https://docs.dolphindb.com/en/Functions/m/memberModify!.html)\n\n\n\n#### Syntax\n\nmemberModify!(obj, function, indices, \\[parameters])\n\n#### Details\n\nModifies one or more member objects of *obj* by applying a specified function with given parameters.\n\n#### Parameters\n\n**obj** is a tuple, a dictionary with values of ANY type, or a class instance.\n\n**function** is a built-in function that accepts a mutable first parameter (e.g., `append!`).\n\n**indices** specifies which members to modify. It can be:\n\n* A scalar: Modifies a single member\n* A vector: Modifies multiple members, with each element identifying a member\n* A tuple: Modifies one or multiple members through multi-dimensional indexing, where tuple length represents indexing depth\n\n**parameters**(optional) indicates additional parameters passed to *function* after its first parameter. If *function* only takes a single parameter (*obj*), leave *parameters* unspecified or pass an empty tuple.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n\\*\\*Example 1.\\*\\*Modifying a member object in a tuple.\n\n```\na = (1 2, 3 4 5)\nmemberModify!(a, append!, 0, 3 4)\na //output:(1 2 3 4, 3 4 5)\n```\n\nTo pass a tuple as a single argument to *function*, the tuple must be enclosed in additional brackets or converted using `enlist`. Without this, each element of the tuple becomes an independent argument.\n\n```\na = ((1, `b), 3 4 5)\n\nmemberModify!(a, appendTuple!, 0, (2 `c))\n// Error: appendTuple!(X, Y, [wholistic=false]). Y must be a tuple.\n\nmemberModify!(a, appendTuple!, 0, enlist((2 `c))) //output: ((1,\"b\",2,\"c\"),[3,4,5])\n// equivalent to memberModify!(a, appendTuple!, 0, [(2 `c)])\n```\n\nWhen *function* accepts only *obj* with no additional parameters, *parameters* should be left unspecified or set as an empty tuple:\n\n```\na = (1 2, 3 4 5)\nmemberModify!(a, pop!, 0) //output: ([1],[3,4,5])\n//equivalent to memberModify!(a, pop!, 0, ())\n```\n\n\\*\\*Example 2.\\*\\*Modifying values in a dictionary.\n\n```\nd = dict(`A`B`C, (1 2, 3 4, 5 6))\nd\n/*output:\nA->[1,2]\nB->[3,4]\nC->[5,6]\n*/\n\nd.memberModify!(append!,`A`B, 3 4) \nd\n/*output:\nA->[1,2,3]\nB->[3,4,4]\nC->[5,6]\n */\n```\n\n**Example 3.** Using tuple indices\n\nCreate a tuple consisting of a table, a dictionary, and a tuple.\n\n```\nt = table(1 2 3 as val1, 4 5 6 as val2)\nd = dict(`A`B`C, (1 2, 3 4, 5 6))\nc = (t, d, [1 2 3, 4 5 6])\nc\n/*output: \n(val1 val2\n---- ----\n1    4   \n2    5   \n3    6   \n,C->[5,6]\nA->[1,2]\nB->[3,4]\n,([1,2,3],[4,5,6]))\n*/\n```\n\nTo modify a nested vector in the tuple object using `memberModify!`, use a tuple *indices* for multi-dimensional indexing:\n\n```\nc.memberModify!(append!, (2, 0), 4 5)\n/*output: \n(val1 val2\n---- ----\n1    4   \n2    5   \n3    6   \n,C->[5,6]\nA->[1,2]\nB->[3,4]\n,([1,2,3,4,5],[4,5,6]))\n*/\n```\n\nTo modify a value in the dictionary object, also use a tuple *indices*:\n\n```\nc.memberModify!(append!, (1,`B), 5 7)\nc\n/*output: \n(val1 val2\n---- ----\n1    4   \n2    5   \n3    6   \n,C->[5,6]\nA->[1,2]\nB->[3,4,5,7]\n,([1,2,3,4,5],[4,5,6]))\n*/\n```\n\n**Example 4.** Modifying members of a class instance:\n\n```\nclass A {\n    a :: INT VECTOR\n    def A() {\n        a = []\n    }\n}\n​\nv = A()\nmemberModify!(v, append!, \"a\", 1)    # Adds 1 to vector a\n//output: [1]\n​\nmemberModify!(v, append!, \"a\", 11)   # Adds 11 to vector a\n//output: [1,11]\n```\n"
    },
    "memSize": {
        "url": "https://docs.dolphindb.com/en/Functions/m/memSize.html",
        "signatures": [
            {
                "full": "memSize(obj)",
                "name": "memSize",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [memSize](https://docs.dolphindb.com/en/Functions/m/memSize.html)\n\n\n\n#### Syntax\n\nmemSize(obj)\n\n#### Details\n\nReturn the memory usage (in units of bytes) of a local or shared object.\n\n#### Parameters\n\n**obj** is an object.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\nn=100\nID=rand(100, n)\ndate=rand(2017.08.07..2017.08.11, n)\nx=rand(10.0, n)\nt=table(ID, date, x);\nshare t as tt\nmemSize(t)\n// output: 1952\n\nmemSize(tt)\n// output: 1952\n\nmemSize(t[`x])\n// output: 800\n\nmemSize(select avg(x) as avgx from t)\n// output: 280\n```\n\nRelated functions: [objs](https://docs.dolphindb.com/en/Functions/o/objs.html)\n"
    },
    "merge": {
        "url": "https://docs.dolphindb.com/en/Functions/m/merge.html",
        "signatures": [
            {
                "full": "merge(left, right, [how='inner'])",
                "name": "merge",
                "parameters": [
                    {
                        "full": "left",
                        "name": "left"
                    },
                    {
                        "full": "right",
                        "name": "right"
                    },
                    {
                        "full": "[how='inner']",
                        "name": "how",
                        "optional": true,
                        "default": "'inner'"
                    }
                ]
            }
        ],
        "markdown": "### [merge](https://docs.dolphindb.com/en/Functions/m/merge.html)\n\n\n\n#### Syntax\n\nmerge(left, right, \\[how='inner'])\n\n#### Details\n\nMerge 2 indexed series or 2 indexed matrices.\n\nThe `merge` function in DolphinDB and the `merge` function in pandas share similar core functionality, but differ in the following aspects:\n\n| Comparison Dimension   | DolphinDB merge                                                                                           | Python Pandas merge                                                                                                                |\n| ---------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| Core functionality     | Joins two indexed series or indexed matrices objects. Performs alignment and merging based on row labels. | Joins two DataFrame objects. The join is done on columns or indexes.                                                               |\n| Primary design purpose | Handles panel data and supports alignment operations for time-series or cross-sectional data.             | Implements relational database JOIN operations (e.g., inner, left, right, outer join).                                             |\n| Input objects          | *left*, *right*: must be indexed series or indexed matrices.                                              | *left*, *right*: DataFrame or named Series.                                                                                        |\n| Key parameters         | Supports *how* ('inner', 'outer', 'left', 'right', 'asof' (DolphinDB specific)).                          | Supports *how*, *on*, *left\\_on*, *right\\_on*, *left\\_index*, *right\\_index*, *sort*, *suffixes*, etc., with richer functionality. |\n\n#### Parameters\n\n**left** and **right** are both indexed series, or are both indexed matrices.\n\n**how** is a string indicating how to merge *left* and *right*. It can take the value of 'inner', 'outer', 'left', 'right', or 'asof'. The default value is 'inner'.\n\n#### Returns\n\nA matrix.\n\n#### Examples\n\n```\na =  indexed series(2012.01.01..2012.01.04, 1..4)\nb =  indexed series([2012.01.01, 2012.01.03, 2012.01.05, 2012.01.06], 5..8)\nmerge(a, b);\n```\n\n|            | series1 | series2 |\n| ---------- | ------- | ------- |\n| 2012.01.01 | 1       | 5       |\n| 2012.01.03 | 3       | 6       |\n\n```\nmerge(a, b, 'left');\n```\n\n|            | series1 | series2 |\n| ---------- | ------- | ------- |\n| 2012.01.01 | 1       | 5       |\n| 2012.01.02 | 2       |         |\n| 2012.01.03 | 3       | 6       |\n| 2012.01.04 | 4       |         |\n\n```\nm1 = matrix([1.2, 7.8, 4.6, 5.1, 9.5], [0.15, 1.26, 0.45, 1.02, 0.33]).rename!([2012.01.01, 2015.02.01, 2015.03.01, 2015.04.01, 2015.05.01], `x1`x2).setindexed matrices!()\nm2 = matrix([1.0, 2.0, 3.0, 4.0], [0.14, 0.26, 0.35, 0.48]).rename!([2015.02.01, 2015.02.16, 2015.05.01, 2015.05.02], `y1`y2).setindexed matrices!()\nm = merge(m1, m2, 'asof');\n```\n\n|            | x1  | x2   | y1 | y2   |\n| ---------- | --- | ---- | -- | ---- |\n| 2012.01.01 | 1.2 | 0.15 |    |      |\n| 2015.02.01 | 7.8 | 1.26 | 1  | 0.14 |\n| 2015.03.01 | 4.6 | 0.45 | 2  | 0.26 |\n| 2015.04.01 | 5.1 | 1.02 | 2  | 0.26 |\n| 2015.05.01 | 9.5 | 0.33 | 3  | 0.35 |\n"
    },
    "mfirst": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mfirst.html",
        "signatures": [
            {
                "full": "mfirst(X, window, [minPeriods])",
                "name": "mfirst",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mfirst](https://docs.dolphindb.com/en/Functions/m/mfirst.html)\n\n\n\n#### Syntax\n\nmfirst(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the first element of *X* in a sliding window.\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nindex = second(08:20:00)+1..7\nx = 2 1 3 NULL 6 5 4\nx = index.indexedSeries(x)\nmfirst(x,3s)\n```\n\n| label    | col1 |\n| -------- | ---- |\n| 08:20:01 | 2    |\n| 08:20:02 | 2    |\n| 08:20:03 | 2    |\n| 08:20:04 | 1    |\n| 08:20:05 | 3    |\n| 08:20:06 |      |\n| 08:20:07 | 6    |\n\n```\nm = matrix(1 5 9 0 2, 9 10 2 NULL 2)\nm.rename!((date(2020.09.08)+1..3) join 2020.09.16 join 2020.09.26, `A`B)\nm.setIndexedMatrix!()\nmfirst(m, 3d)\n```\n\n| label      | A | B |\n| ---------- | - | - |\n| 2020.09.09 | 1 | 9 |\n| 2020.09.10 | 1 | 9 |\n| 2020.09.11 | 1 | 9 |\n| 2020.09.16 | 0 |   |\n| 2020.09.26 | 2 | 2 |\n\n```\nmfirst(m, 1w)\n```\n\n| label      | A | B  |\n| ---------- | - | -- |\n| 2020.09.09 | 1 | 9  |\n| 2020.09.10 | 1 | 9  |\n| 2020.09.11 | 1 | 9  |\n| 2020.09.16 | 5 | 10 |\n| 2020.09.26 | 2 | 2  |\n\nRelated functions: [first](https://docs.dolphindb.com/en/Functions/f/first.html), [last](https://docs.dolphindb.com/en/Functions/l/last.html)\n"
    },
    "mfirstNot": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mfirstNot.html",
        "signatures": [
            {
                "full": "mfirstNot(X, window, [k=NULL], [minPeriods=1])",
                "name": "mfirstNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[k=NULL]",
                        "name": "k",
                        "optional": true,
                        "default": "NULL"
                    },
                    {
                        "full": "[minPeriods=1]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [mfirstNot](https://docs.dolphindb.com/en/Functions/m/mfirstNot.html)\n\n#### Syntax\n\nmfirstNot(X, window, \\[k=NULL], \\[minPeriods=1])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nIf *X* is a vector:\n\n* If *k* is not specified, return the first element of *X* that is not null in a sliding window.\n\n* If *k* is specified, return the first element of *X* that is neither *k* nor null in the window.\n\nIf *X* is a matrix or table, conduct the aforementioned calculation within each column of *X*. The result is a vector.\n\n#### Parameters\n\n**k** (optional) is a numeric or string scalar indicating the value to be matched.\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nmfirstNot(NULL 2 NULL 4 5, window=2)\n// output: [,2,2,4,4]\n```\n\n```\nx = matrix(1..5,2..6,3..7)\nmfirstNot(X=x, window=3, k=1, minPeriods=2)\n```\n\n<table id=\"table_amg_5bd_jbc\"><thead><tr><th>\n\n\\#0\n\n</th><th>\n\n\\#1\n\n</th><th>\n\n\\#2\n\n</th></tr></thead><tbody><tr><td>\n\n</td><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n2\n\n</td><td>\n\n3\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n2\n\n</td><td>\n\n3\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n3\n\n</td><td>\n\n4\n\n</td></tr><tr><td>\n\n3\n\n</td><td>\n\n4\n\n</td><td>\n\n5\n\n</td></tr></tbody>\n</table>```\nx=table([\"s1\", \"s2\", \"\", \"s4\", \"s5\"] as col1, [\"s1\", \"\", \"s3\", \"\", \"s5\"] as col2)\nmfirstNot(X=x, window=2)\n```\n\n<table id=\"table_fmg_5bd_jbc\"><thead><tr><th>\n\n\\#0\n\n</th><th>\n\n\\#1\n\n</th></tr></thead><tbody><tr><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\ns1\n\n</td><td>\n\ns1\n\n</td></tr><tr><td>\n\ns2\n\n</td><td>\n\ns3\n\n</td></tr><tr><td>\n\ns4\n\n</td><td>\n\ns3\n\n</td></tr><tr><td>\n\ns4\n\n</td><td>\n\ns5\n\n</td></tr></tbody>\n</table>```\nT = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.06, 2022.01.07, 2022.01.08, 2022.01.10, 2022.01.11]\nX = 1..8\nX1 = indexedSeries(T, X)\nmfirstNot(X=X1, window=3, k=1, minPeriods=1)\n```\n\n|            | #0 |\n| ---------- | -- |\n| 2022.01.01 |    |\n| 2022.01.02 | 2  |\n| 2022.01.03 | 2  |\n| 2022.01.06 | 4  |\n| 2022.01.07 | 4  |\n| 2022.01.08 | 4  |\n| 2022.01.10 | 6  |\n| 2022.01.11 | 7  |\n\nRelated function: [mfirst](https://docs.dolphindb.com/en/Functions/m/mfirst.html), [mlastNot](https://docs.dolphindb.com/en/Functions/m/mlastNot.html)\n\n"
    },
    "microsecond": {
        "url": "https://docs.dolphindb.com/en/Functions/m/microsecond.html",
        "signatures": [
            {
                "full": "microsecond(X)",
                "name": "microsecond",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html)\n\n\n\n#### Syntax\n\nmicrosecond(X)\n\n#### Details\n\nFor each element in *X*, return a number from 0 to 999999 indicating which microsecond of the second it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type TIME, TIMESTAMP, NANOTIME or NANOTIMESTAMP.\n\n#### Returns\n\nAn INT scalar or vector.\n\n#### Examples\n\n```\nmicrosecond(13:30:10.008);\n// output: 8000\n\nmicrosecond([2012.12.03 01:22:01.999999000, 2012.12.03 01:22:01.000456000, 2012.12.03 01:25:08.000000234]);\n// output: [999999,456,0]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "mifirstNot": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mifirstNot.html",
        "signatures": [
            {
                "full": "mifirstNot(X, window, [minPeriods])",
                "name": "mifirstNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mifirstNot](https://docs.dolphindb.com/en/Functions/m/mifirstNot.html)\n\n\n\n#### Syntax\n\nmifirstNot(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the index of the first non-null element of *X* in a sliding window (based on the number of elements or time).\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nv = NULL NULL 2 3 4 8 NULL 5 -2 3 -1 0 NULL\nmifirstNot(v, 3)\n// output: [,,2,1,0,0,0,0,1,0,0,0,0]\n\nm = matrix(NULL 1 2 3, 1 NULL 2 3, NULL NULL 3 4, 1 2 3 4)\nn = mifirstNot(m, 2)\nn\n```\n\n| #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- |\n|    |    |    |    |\n| 1  | 0  | -1 | 0  |\n| 0  | 1  | 1  | 0  |\n| 0  | 0  | 0  | 0  |\n\n```\nT = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.06, 2022.01.07]\nX = NULL 2 NULL 4 5\nX1 = indexedSeries(T, X)\nmifirstNot(X1, 2, 1)\n```\n\n|            | #1 |\n| ---------- | -- |\n| 2022.01.01 | -1 |\n| 2022.01.02 | 1  |\n| 2022.01.03 | 0  |\n| 2022.01.06 | 0  |\n| 2022.01.07 | 0  |\n\nRelated function: [milastNot](https://docs.dolphindb.com/en/Functions/m/milastNot.html)\n"
    },
    "migrate": {
        "url": "https://docs.dolphindb.com/en/Functions/m/migrate.html",
        "signatures": [
            {
                "full": "migrate(backupDir, [backupDBPath], [backupTableName], [newDBPath=backupDBPath], [newTableName=backupTableName], [keyPath])",
                "name": "migrate",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "[backupDBPath]",
                        "name": "backupDBPath",
                        "optional": true
                    },
                    {
                        "full": "[backupTableName]",
                        "name": "backupTableName",
                        "optional": true
                    },
                    {
                        "full": "[newDBPath=backupDBPath]",
                        "name": "newDBPath",
                        "optional": true,
                        "default": "backupDBPath"
                    },
                    {
                        "full": "[newTableName=backupTableName]",
                        "name": "newTableName",
                        "optional": true,
                        "default": "backupTableName"
                    },
                    {
                        "full": "[keyPath]",
                        "name": "keyPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html)\n\n\n\n#### Syntax\n\nmigrate(backupDir, \\[backupDBPath], \\[backupTableName], \\[newDBPath=backupDBPath], \\[newTableName=backupTableName], \\[keyPath])\n\n#### Details\n\nRestore the backup. It must be executed by a logged-in user.\n\nThe `migrate` function has the following 3 usages:\n\n* `migrate(backupDir)`: Restore the backup of all databases in this directory. The restored database name and table name are the same as the original ones.\n\n* `migrate(backupDir, backupDBPath)`: Restore the backup of the specified database in this directory. The restored database name and table name are the same as the original ones.\n\n* `migrate(backupDir, backupDBPath, backupTableName, [newDBPath], [newTableName])`: Restore the backup of the specified table of the specified database in the directory.\n\n  * If *newDBPath* and *newTableName* are not specified, the restored database name and table name are the same as the original ones.\n\n  * If *newDBPath* and *newTableName* are specified, the restored database name and table name will be *newDBPath* and *newTableName*, respectively.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory to save the backup.\n\n**backupDBPath** is a string indicating the path of a database.\n\n**backupTableName** is a string indicating a table name.\n\n**newDBPath** is a string indicating the new database name. If not specified, the default value is *backupDBPath*. To specify the parameter, make sure that the storage engine of the backup database is the same as the engine of *newDBPath*, and the *partitionScheme* must be the same (except for VALUE). For a VALUE partitioned database, the partitioning scheme of the backup database must be a subset of that of the database to be restored.\n\n**newTableName** is a string indicating the new table name. If not specified, the default value is *backupTableName*.\n\n**keyPath** (optional, Linux only) is a STRING scalar that specifies the path to the key file used for restoring an encrypted backup. The key version used for restoring the data must match the version specified during the backup. Note that when restoring an encrypted table, both the backup table and the target table must use the same encryption mode (i.e., the same *encryptMode* parameter specified during table creation).\n\n#### Returns\n\nIt returns a table containing the restored data of each table.\n\n#### Examples\n\nCreate two sample databases and back up them to the same directory:\n\n```\nbackupDir=\"/home/DolphinDB/backup\"\n\nn = 1000000\nt1 = table(rand(2012.12.01..2012.12.10, n) as date, rand(`AAPL`IBM`GOOG`MSFT, n) as sym, rand(1000.0,n) as price)\nt2 = table(rand(2012.12.01..2012.12.10, n) as date, rand(`AAPL`IBM`GOOG`MSFT, n) as sym, rand(1000,n) as qty)\ndb1 = database(directory=\"dfs://db1\", partitionType=VALUE, partitionScheme=2012.12.01..2012.12.10)\ntrades1 = db1.createPartitionedTable(t1, `trades1, `date).append!(t1)\ntrades2 = db1.createPartitionedTable(t2, `trades2, `date).append!(t2)\n\nn = 1000000\nt1 = table(rand(2012.12.01..2012.12.10, n) as date, rand(`AAPL`IBM`GOOG`MSFT, n) as sym, rand(1000.0,n) as price)\nt2 = table(rand(2012.12.01..2012.12.10, n) as date, rand(`AAPL`IBM`GOOG`MSFT, n) as sym, rand(1000,n) as qty)\ndb1 = database(directory=\"dfs://db2\", partitionType=VALUE, partitionScheme=`AAPL`IBM`GOOG`MSFT)\nquotes1 = db1.createPartitionedTable(t1, `quotes1, `sym).append!(t1)\nquotes2 = db1.createPartitionedTable(t2, `quotes2, `sym).append!(t2)\n\nbackup(backupDir=backupDir, sqlObj=<select * from trades1>, force=true)\nbackup(backupDir=backupDir, sqlObj=<select * from trades2>, force=true)\nbackup(backupDir=backupDir, sqlObj=<select * from quotes1>, force=true)\nbackup(backupDir=backupDir, sqlObj=<select * from quotes2>, force=true)\n```\n\nDelete the original database:\n\n```\ndropDatabase(\"dfs://db1\")\ndropDatabase(\"dfs://db2\")\n```\n\nExample 1. Restore all databases\n\n```\nmigrate(backupDir);\n```\n\n| dbName     | tableName | success | errorMsg |\n| ---------- | --------- | ------- | -------- |\n| dfs\\://db1 | trades1   | 1       |          |\n| dfs\\://db1 | trades2   | 1       |          |\n| dfs\\://db2 | quotes2   | 1       |          |\n| dfs\\://db2 | quotes1   | 1       |          |\n\nExample 2. Restore all tables in the database *dfs\\://db1*\n\n```\nmigrate(backupDir=backupDir, backupDBPath=\"dfs://db1\");\n```\n\n| dbName     | tableName | success | errorMsg |\n| ---------- | --------- | ------- | -------- |\n| dfs\\://db1 | trades1   | 1       |          |\n| dfs\\://db1 | trades2   | 1       |          |\n\nExample 3. Restore table trades1 in the database *dfs\\://db1*\n\nExample 3.1 When we do not specify the new database name and table name\n\n```\nmigrate(backupDir=backupDir, backupDBPath=\"dfs://db1\", backupTableName=\"trades1\");\n```\n\n| dbName     | tableName | success | errorMsg |\n| ---------- | --------- | ------- | -------- |\n| dfs\\://db1 | trades1   | 1       |          |\n\nExample 3.2 Specify the new database name and table name\n\n```\nmigrate(backupDir=backupDir, backupDBPath=\"dfs://db1\", backupTableName=\"trades1\", newDBPath=\"dfs://db3\", newTableName=\"trades\");\n```\n\n| dbName     | tableName | success | errorMsg |\n| ---------- | --------- | ------- | -------- |\n| dfs\\://db1 | trades1   | 1       |          |\n\n```\nexec count(*) from loadTable(\"dfs://db3\", \"trades\")\n// output: 1000000\n```\n\nRelated function: [backup](https://docs.dolphindb.com/en/Functions/b/backup.html)\n"
    },
    "milastNot": {
        "url": "https://docs.dolphindb.com/en/Functions/m/milastNot.html",
        "signatures": [
            {
                "full": "milastNot(X, window, [minPeriods])",
                "name": "milastNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [milastNot](https://docs.dolphindb.com/en/Functions/m/milastNot.html)\n\n\n\n#### Syntax\n\nmilastNot(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the index of the last non-null element of *X* in a sliding window (based on the number of elements or time).\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nv = NULL NULL 2 3 4 8 NULL 5 -2 3 -1 0 NULL\nmilastNot(v, 3)\n// output: [,,2,2,2,2,1,2,2,2,2,2,1]\n\nm = matrix(1 2 3 NULL, 1 2 NULL 3, 1 3 NULL NULL, 1 2 3 4)\nmilastNot(m, 2)\n```\n\n| #0 | #1 | #2 | #3 |\n| -- | -- | -- | -- |\n|    |    |    |    |\n| 1  | 1  | 1  | 1  |\n| 1  | 0  | 0  | 1  |\n| 0  | 1  | -1 | 1  |\n\n```\nT = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.06, 2022.01.07]\nX = NULL 2 NULL 4 5\nX1 = indexedSeries(T, X)\nmilastNot(X1, 2, 1)\n```\n\n|            | #0 |\n| ---------- | -- |\n| 2022.01.01 | -1 |\n| 2022.01.02 | 1  |\n| 2022.01.03 | 0  |\n| 2022.01.06 | 0  |\n| 2022.01.07 | 1  |\n\nRelated function: [mifirstNot](https://docs.dolphindb.com/en/Functions/m/mifirstNot.html)\n"
    },
    "millisecond": {
        "url": "https://docs.dolphindb.com/en/Functions/m/millisecond.html",
        "signatures": [
            {
                "full": "millisecond(X)",
                "name": "millisecond",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html)\n\n\n\n#### Syntax\n\nmillisecond(X)\n\n#### Details\n\nFor each element in *X*, return a number from 0 to 999 indicating which millisecond of the second it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type TIME, TIMESTAMP, NANOTIME or NANOTIMESTAMP.\n\n#### Returns\n\nAn INT scalar or vector.\n\n#### Examples\n\n```\nmillisecond(13:30:10.008);\n// output: 8\n\nmillisecond([2012.12.03 01:22:01.456120300, 2012.12.03 01:25:08.000234000]);\n// output: [456,0]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "mimax": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mimax.html",
        "signatures": [
            {
                "full": "mimax(X, window, [minPeriods])",
                "name": "mimax",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mimax](https://docs.dolphindb.com/en/Functions/m/mimax.html)\n\n\n\n#### Syntax\n\nmimax(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the position of the element with the largest value in *X* in a sliding window. If there are multiple elements with the identical largest value in a window, return the position of the first element from the left. Same as other aggregate functions, null values are ignored.\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nx = 1.2 2 NULL 6 -1 6\nmimax(x, 3);\n// output: [,,1,2,1,0]\n\nmimax(x, 3, 1);\n// output: [0,1,1,2,1,0]\n```\n\n```\nm=matrix(1 6 2 9 10 3, 9 10 2 6 6 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 9  |\n| 6  | 10 |\n| 2  | 2  |\n| 9  | 6  |\n| 10 | 6  |\n| 3  | 6  |\n\n```\nmimax(m,3);\n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n|    |    |\n| 1  | 1  |\n| 2  | 0  |\n| 2  | 1  |\n| 1  | 0  |\n\n```\nT = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.06, 2022.01.07, 2022.01.08, 2022.01.10, 2022.01.11]\nX = 1..8\nX1 = indexedSeries(T, X)\nmimax(X1,3)\n```\n\n|            | #0 |\n| ---------- | -- |\n| 2022.01.01 | 0  |\n| 2022.01.02 | 1  |\n| 2022.01.03 | 2  |\n| 2022.01.06 | 0  |\n| 2022.01.07 | 1  |\n| 2022.01.08 | 2  |\n| 2022.01.10 | 1  |\n| 2022.01.11 | 1  |\n\n```\nt= 2021.01.02 2021.01.05  2021.01.06  2021.01.09 2021.01.10 2021.01.12\nm=matrix(5 4 NULL -1 2 4, 3 2 8 1 0 5)\nm1=m.rename!(t, `a`b).setIndexedMatrix!()\nmimax(m1,3)\n```\n\n|            | a | b |\n| ---------- | - | - |\n| 2021.01.02 | 0 | 0 |\n| 2021.01.05 | 0 | 0 |\n| 2021.01.06 | 0 | 1 |\n| 2021.01.09 | 0 | 0 |\n| 2021.01.10 | 1 | 0 |\n| 2021.01.12 | 1 | 1 |\n\nRelated functions: [imax](https://docs.dolphindb.com/en/Functions/i/imax.html), [mimin](https://docs.dolphindb.com/en/Functions/m/mimin.html)\n"
    },
    "mimaxLast": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mimaxlast.html",
        "signatures": [
            {
                "full": "mimaxLast(X, window, [minPeriods])",
                "name": "mimaxLast",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mimaxLast](https://docs.dolphindb.com/en/Functions/m/mimaxlast.html)\n\n\n\n#### Syntax\n\nmimaxLast(X, window, \\[minPeriods])\n\n#### Parameters\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.dita) for the parameters and windowing logic.\n\n#### Details\n\nReturn the position of the element with the largest value in *X* in a sliding window. If there are multiple elements with the identical largest value in a window, return the position of the first element from the right. Same as other aggregate functions, null values are ignored.\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nx = 1.2 2 NULL -1 6 -1\nmimaxLast(x,3);\n// output: [,,1,0,2,1]\n```\n\n```\nm=matrix(3 2 4 4 2, 1 4 2 4 3);\nmimaxLast(m,3) \n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n|    |    |\n| 2  | 1  |\n| 2  | 2  |\n| 1  | 1  |\n\n```\nt=table(3 3 2 as c1, 1 4 4 as c2)\nmimaxLast(t,3)\n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n|    |    |\n| 1  | 2  |\n\n```\nx = [NULL, 2, NULL, NULL, 3.2]\ndate = [0, 1, 3,  8, 9] + 2020.01.01\nX = indexedSeries(date, x) \nmimaxLast(X, 3d)\n```\n\n|            | #0 |\n| ---------- | -- |\n| 2020.01.01 | -1 |\n| 2020.01.02 | 1  |\n| 2020.01.04 | 0  |\n| 2020.01.09 | -1 |\n| 2020.01.10 | 1  |\n\nRelated function: [mimax](https://docs.dolphindb.com/en/Functions/m/mimax.html)\n"
    },
    "mimin": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mimin.html",
        "signatures": [
            {
                "full": "mimin(X, window, [minPeriods])",
                "name": "mimin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mimin](https://docs.dolphindb.com/en/Functions/m/mimin.html)\n\n\n\n#### Syntax\n\nmimin(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the position of the element with the smallest value in *X* in a sliding window. If there are multiple elements with the identical smallest value in a window, return the position of the first element from the left. Same as other aggregate functions, null values are ignored.\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nx = 1.2 2 NULL 6 -1 -1\nmimin(x, 3);\n// output: [,,0,0,2,1]\n\nmimin(x, 3, 1);\n// output: [0,0,0,0,2,1]\n\n```\n\n```\nm=matrix(1 6 2 9 10 3, 9 10 2 6 6 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 9  |\n| 6  | 10 |\n| 2  | 2  |\n| 9  | 6  |\n| 10 | 6  |\n| 3  | 6  |\n\n```\nmimin(m,3);\n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n|    |    |\n| 0  | 2  |\n| 1  | 1  |\n| 0  | 0  |\n| 2  | 0  |\n\n```\nT = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.06, 2022.01.07, 2022.01.08, 2022.01.10, 2022.01.11]\nX = 1..8\nX1 = indexedSeries(T, X)\nmimin(X1,3)\n```\n\n|            | #0 |\n| ---------- | -- |\n| 2022.01.01 | 0  |\n| 2022.01.02 | 0  |\n| 2022.01.03 | 0  |\n| 2022.01.06 | 0  |\n| 2022.01.07 | 0  |\n| 2022.01.08 | 0  |\n| 2022.01.10 | 0  |\n| 2022.01.11 | 0  |\n\n```\nt= 2021.01.02 2021.01.05  2021.01.06  2021.01.09 2021.01.10 2021.01.12\nm=matrix(5 4 NULL -1 2 4, 3 2 8 1 0 5)\nm1=m.rename!(t, `a`b).setIndexedMatrix!()\nmimin(m1,3)\n```\n\n|            | a | b |\n| ---------- | - | - |\n| 2021.01.02 | 0 | 0 |\n| 2021.01.05 | 0 | 0 |\n| 2021.01.06 | 0 | 0 |\n| 2021.01.09 | 0 | 0 |\n| 2021.01.10 | 0 | 1 |\n| 2021.01.12 | 0 | 0 |\n\nRelated functions: [imin](https://docs.dolphindb.com/en/Functions/i/imin.html), [mimax](https://docs.dolphindb.com/en/Functions/m/mimax.html)\n"
    },
    "miminLast": {
        "url": "https://docs.dolphindb.com/en/Functions/m/miminlast.html",
        "signatures": [
            {
                "full": "miminLast(X, window, [minPeriods])",
                "name": "miminLast",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [miminLast](https://docs.dolphindb.com/en/Functions/m/miminlast.html)\n\n\n\n#### Syntax\n\nmiminLast(X, window, \\[minPeriods])\n\n#### Details\n\nReturn the position of the element with the smallest value in *X* in a sliding window. If there are multiple elements with the identical smallest value in a window, return the position of the first element from the right. Same as other aggregate functions, null values are ignored.\n\n#### Parameters\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.dita) for the parameters and windowing logic.\n\n#### Returns\n\n* Returns a vector if *X* is a vector.\n\n* Returns a matrix if *X* is a matrix.\n\n* If *X* is a table, performs the calculation on each column and returns the corresponding result.\n\n* If *X* is a tuple, performs the calculation on each vector in the tuple and returns the corresponding result.\n\n#### Examples\n\n```\nx = 1.2 2 NULL -1 6 -1\n$miminLast(x,3);\n// output: [,,0,2,1,2]\n```\n\n```\nm=matrix(3 2 2 4 2, 1 4 2 1 3);\nmiminLast(m,3)\n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n|    |    |\n| 2  | 0  |\n| 1  | 2  |\n| 2  | 1  |\n\n```\nt=table(3 2 2 as c1, 1 1 4 as c2)\nmiminLast(t,3)\n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n|    |    |\n| 2  | 1  |\n\n```\nx = [NULL, 2, NULL, NULL, 3.2]\ndate = [0, 1, 3,  8, 9] + 2020.01.01\nX = indexedSeries(date, x) \nmiminLast(X, 3d)\n```\n\n|            | #0 |\n| ---------- | -- |\n| 2020.01.01 | -1 |\n| 2020.01.02 | 1  |\n| 2020.01.04 | 0  |\n| 2020.01.09 | -1 |\n| 2020.01.10 | 1  |\n\nRelated function: [mimin](https://docs.dolphindb.com/en/Functions/m/mimin.html)\n"
    },
    "min": {
        "url": "https://docs.dolphindb.com/en/Functions/m/min.html",
        "signatures": [
            {
                "full": "min(X)",
                "name": "min",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [min](https://docs.dolphindb.com/en/Functions/m/min.html)\n\n\n\n#### Syntax\n\nmin(X)\n\n#### Details\n\nFor one input (null values will not be compared with other elements):\n\n* If *X* is a vector, return the minimum in *X*.\n\n* If *X* is a matrix, return the minimum in each column of *X* and return a vector.\n\n* If *X* is a table, return the minimum in each column of *X* and return a table.\n\nFor two inputs (null values will be compared with other elements):\n\n* If *Y* is a scalar, compare it with each element in *X*, replace the element in *X* with the smaller value.\n\n* If *Y* and *X* are of the same type and length, compare the corresponding elements of them and return a vector containing each smaller value.\n\n**Note:**\n\nBefore version 1.30.20/2.00.8, the function `min` compares the values of temporal types by converting them into LONG values. Since version 1.30.20/2.00.8, DolphinDB has changed the handling of temporal types:\n\n* If *X* and *Y* are temporal scalars with different levels of time granularity, the coarser-grained value is converted to the finer granularity for comparison.\n\n* If *X* and/or *Y* is a vector, matrix, or table, the compared elements must be of the same temporal type.\n\nDolphinDB `min` and NumPy `np.min` have similar functionality, but differ in computation model and handling of missing values:\n\n* DolphinDB supports a two-argument form for element-wise comparison, whereas NumPy does not support `np.min(x, y)`.\n* When `min` in DolphinDB takes a single argument, it computes the minimum by column for matrices/tables, while row-wise computation requires using `rowMin`. In NumPy, the computation axis can be controlled using the *axis* parameter.\n* In DolphinDB, single-argument `min` ignores NULL values by default, while in the two-argument form NULL values may participate in comparisons. In NumPy, NaN values are not ignored by default.\n\nDifference from Python TA-Lib's `MIN`: TA-Lib's `MIN(close, timeperiod=30)` is a Math Operator indicator that calculates the lowest value over a specified window and returns an array aligned with the input, with the initial lookback period filled with NaN. DolphinDB's `min(X, [Y])` is not a rolling-window indicator. The one-argument form calculates the minimum of the input data, and the two-argument form returns the smaller value element by element. Use `mmin` for a moving-window minimum.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n**Y** is an optional parameter, which can be a scalar, a vector of the same length as X or a matrix.\n\n#### Returns\n\n* For one input:\n  * If *X* is a vector, the functions returns a scalar.\n  * If *X* is a matrix, the functions returns a vector.\n  * If *X* is a table, the functions returns a table.\n* For two inputs:\n  * If *Y* is a scalar, the function returns an object with the same dimensions as *X*, where each element is `min(X[i], Y)`.\n  * If *Y* has the same type and length as *X*, the function returns an object composed of the smaller values at each corresponding position.\n\n#### Examples\n\n```\nmin(1 2 3);\n// output: 1\n\nmin(2.0 1.1 0.1 NULL);\n// output: 0.1\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nmin(m);\n// output: [1,4]\n```\n\n```\nmin(1 2 3, 2)\n// output: 1 2 2\n\nn = matrix(1 1 1, 5 5 5)\nn;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 5  |\n| 1  | 5  |\n| 1  | 5  |\n\n```\nmin(m, n);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 1  | 5  |\n| 1  | 5  |\n\nRelated function: [mmin](https://docs.dolphindb.com/en/Functions/m/mmin.html)\n"
    },
    "minIgnoreNull": {
        "url": "https://docs.dolphindb.com/en/Functions/m/minIgnoreNull.html",
        "signatures": [
            {
                "full": "minIgnoreNull(X, Y)",
                "name": "minIgnoreNull",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [minIgnoreNull](https://docs.dolphindb.com/en/Functions/m/minIgnoreNull.html)\n\n#### Syntax\n\nminIgnoreNull(X, Y)\n\n#### Details\n\nA binary scalar function that returns the minimum by comparing *X* with *Y*.\n\nDifference between `min` and `minIgnoreNull`:\n\n* `min`: Null values are treated as the minimum value if \\*nullAsMinValueForComparison=\\*true, otherwise comparison involving null values returns NULL.\n\n* `minIgnoreNull`: Null values are ignored in comparison and non-null minimum is returned. If both elements in *X* and *Y* are null, NULL is returned. This function is not affected by configuration parameter *nullAsMinValueForComparison*.\n\n#### Parameters\n\n**X** and **Y** can be a numeric, LITERAL or TEMPORAL scalar, pair, vector or matrix.\n\n#### Returns\n\n* If the input is a scalar, returns a scalar.\n\n* If the input is a vector, returns a vector with element-wise comparison.\n\n* If the input is a matrix, returns a matrix with element-wise comparison.\n\n* If the input is a pair, returns a pair.\n\n#### Examples\n\n```\nminIgnoreNull(2,matrix(1  NULL -4,-1 -4  0)) \n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | -1 |\n| 2  | -4 |\n| -4 | 0  |\n\n```\nminIgnoreNull(matrix(10 3 NULL, 1 7 4),matrix(1  NULL -4,-1 -4  0))\n```\n\n<table id=\"table_slz_glq_3bc\"><tbody><tr><td>\n\n\\#0\n\n</td><td>\n\n\\#1\n\n</td></tr><tr><td>\n\n1\n\n</td><td>\n\n-1\n\n</td></tr><tr><td>\n\n3\n\n</td><td>\n\n-4\n\n</td></tr><tr><td>\n\n-4\n\n</td><td>\n\n0\n\n</td></tr></tbody>\n</table>Use `minIgnoreNull` with `reduce` to calculate the minimum for matrices of the same shape stored in a tuple:\n\n```\nn1 = matrix(1 1 1, 5 5 5)\nn2 = matrix(10 11 12, 0 NULL -5)\nn3 = matrix(-1 1 NULL, -3 0 10)\nreduce(minIgnoreNull, [n1,n2,n3])\n```\n\n| #0 | #1 |\n| -- | -- |\n| -1 | -3 |\n| 1  | 0  |\n| 1  | -5 |\n\n**Related function**: [maxIgnoreNull](https://docs.dolphindb.com/en/Functions/m/maxIgnoreNull.html)\n\n"
    },
    "minkowski": {
        "url": "https://docs.dolphindb.com/en/Functions/m/minkowski.html",
        "signatures": [
            {
                "full": "minkowski(X, Y, p, [weights])",
                "name": "minkowski",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "p",
                        "name": "p"
                    },
                    {
                        "full": "[weights]",
                        "name": "weights",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [minkowski](https://docs.dolphindb.com/en/Functions/m/minkowski.html)\n\nFirst introduced in version: 2.00.183.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\nminkowski(X, Y, p, \\[weights])\n\n#### Details\n\nCompute the Minkowski distance between two numeric vectors (X and Y). The distance is defined as follows:\n\n![](https://docs.dolphindb.com/en/images/minkowski.png)\n\n#### Parameters\n\n**X:** A numeric vector.\n\n**Y:** A numeric vector.\n\n**p:** A numeric scalar with a value range of (0, +∞). NULL represents +∞. Special values of *p* are defined as follows:\n\n* p = 1: Manhattan distance\n* p = 2: Euclidean distance\n\n**weights** (optional): A non-negative numeric vector specifying the weights of each element in *X* and *Y*. The default value of each element is 1.\n\n**Note:**\n\n*X*, *Y*, and *weights* must have the same length.\n\n#### Returns\n\nA scalar of type DOUBLE.\n\n#### Examples\n\nAssume there are two vectors:\n\n```\nX = [1, 2]\nY = [4, 6]\n```\n\n* When p = 1, compute the Manhattan distance:\n\n  ```\n  minkowski(X,Y,p) \n  // Output: 7\n  ```\n\n* When p = 2, compute the Euclidean distance:\n\n  ```\n  minkowski(X,Y,p)  \n  // Output：5\n  ```\n\n**Related functions**\n\n[seuclidean](https://docs.dolphindb.com/en/Functions/s/seuclidean.html), [mahalanobis](https://docs.dolphindb.com/en/Functions/m/mahalanobis.html)\n"
    },
    "minute": {
        "url": "https://docs.dolphindb.com/en/Functions/m/minute.html",
        "signatures": [
            {
                "full": "minute(X)",
                "name": "minute",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [minute](https://docs.dolphindb.com/en/Functions/m/minute.html)\n\n\n\n#### Syntax\n\nminute(X)\n\n#### Details\n\nReturn the corresponding minute(s).\n\n#### Parameters\n\n**X** is an integer or temporal scalar/vector.\n\n#### Returns\n\nA scalar or vector of type MINUTE.\n\n#### Examples\n\n```\nminute 2012.12.03 01:22:01;\n// output: 01:22m\n\nminute(61);\n// output: 01:01m\n```\n\nRelated functions: [second](https://docs.dolphindb.com/en/Functions/s/second.html), [month](https://docs.dolphindb.com/en/Functions/m/month.html), [date](https://docs.dolphindb.com/en/Functions/d/date.html), [year](https://docs.dolphindb.com/en/Functions/y/year.html)\n"
    },
    "minuteOfHour": {
        "url": "https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html",
        "signatures": [
            {
                "full": "minuteOfHour(X)",
                "name": "minuteOfHour",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html)\n\n\n\n#### Syntax\n\nminuteOfHour(X)\n\n#### Details\n\nFor each element in *X*, return a number from 0 to 59 indicating which minute of the hour it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type TIME, MINUTE, SECOND, DATETIME, TIMESTAMP, NANOTIME or NANOTIMESTAMP.\n\n#### Returns\n\nAn INT scalar or vector.\n\n#### Examples\n\n```\nminuteOfHour(12:32:00);\n// output: 32\n\n minuteOfHour([2012.06.12T12:30:00,2012.10.28T12:35:00,2013.01.06T12:36:47,2013.04.06T08:02:14]);\n// output: [30,35,36,2]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "mkdir": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mkdir.html",
        "signatures": [
            {
                "full": "mkdir(directory)",
                "name": "mkdir",
                "parameters": [
                    {
                        "full": "directory",
                        "name": "directory"
                    }
                ]
            }
        ],
        "markdown": "### [mkdir](https://docs.dolphindb.com/en/Functions/m/mkdir.html)\n\n\n\n#### Syntax\n\nmkdir(directory)\n\n#### Details\n\nCreate a directory. It must be executed by a logged-in user.\n\n#### Parameters\n\n**directory** the path of the directory to be created.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nfiles(\"/home/test\");\n```\n\n| filename | isDir | fileSize | lastAccessed            | lastModified            |\n| -------- | ----- | -------- | ----------------------- | ----------------------- |\n| dir3     | 1     | 0        | 2017.06.05 08:06:39.597 | 2017.06.05 08:06:39.597 |\n\n```\nmkdir(\"/home/test/dir1\");\nmkdir(\"/home/test/dir2\");\nmkdir(\"/home/test/dir3\");\n// output: The directory [/home/test/dir3] already exists.\n```\n\n```\nfiles(\"/home/test\");\n```\n\n| filename | isDir | fileSize | lastAccessed            | lastModified            |\n| -------- | ----- | -------- | ----------------------- | ----------------------- |\n| dir1     | 1     | 0        | 2017.06.05 08:33:48.372 | 2017.06.05 08:33:48.372 |\n| dir2     | 1     | 0        | 2017.06.05 08:34:05.598 | 2017.06.05 08:34:05.598 |\n| dir3     | 1     | 0        | 2017.06.05 08:06:39.597 | 2017.06.05 08:06:39.597 |\n"
    },
    "mkurtosis": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mkurtosis.html",
        "signatures": [
            {
                "full": "mkurtosis(X, window, [biased=true], [minPeriods])",
                "name": "mkurtosis",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mkurtosis](https://docs.dolphindb.com/en/Functions/m/mkurtosis.html)\n\n\n\n#### Syntax\n\nmkurtosis(X, window, \\[biased=true], \\[minPeriods])\n\n#### Details\n\nCalculate the moving kurtosis of *X* in a sliding window.\n\n#### Parameters\n\n**biased** is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nm=matrix(1 9 3 100 3 2 1 -100 9 10000, 1 2 3 4 5 6 7 8 9 100);\nm.mkurtosis(8);\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n|                   |                   |\n|                   |                   |\n|                   |                   |\n|                   |                   |\n|                   |                   |\n|                   |                   |\n| 3.989653641279048 | 1.761904761904762 |\n| 3.989840910744778 | 1.761904761904762 |\n| 6.140237905908072 | 6.101712240467206 |\n\n```\nm.rename!(date(2020.04.06)+1..10, `col1`col2)\nm.setIndexedMatrix!()\nmkurtosis(m, 8d)\n```\n\n| label      | col1   | col2   |\n| ---------- | ------ | ------ |\n| 2020.04.07 |        |        |\n| 2020.04.08 |        |        |\n| 2020.04.09 | 1.5    | 1.5    |\n| 2020.04.10 | 2.3195 | 1.64   |\n| 2020.04.11 | 3.2251 | 1.7    |\n| 2020.04.12 | 4.163  | 1.7314 |\n| 2020.04.13 | 5.1141 | 1.75   |\n| 2020.04.14 | 3.9897 | 1.7619 |\n| 2020.04.15 | 3.9898 | 1.7619 |\n| 2020.04.16 | 6.1402 | 6.1017 |\n\n```\nmkurtosis(m, 1w)\n```\n\n| label      | col1   | col2   |\n| ---------- | ------ | ------ |\n| 2020.04.07 |        |        |\n| 2020.04.08 |        |        |\n| 2020.04.09 | 1.5    | 1.5    |\n| 2020.04.10 | 2.3195 | 1.64   |\n| 2020.04.11 | 3.2251 | 1.7    |\n| 2020.04.12 | 4.163  | 1.7314 |\n| 2020.04.13 | 5.1141 | 1.75   |\n| 2020.04.14 | 3.4937 | 1.75   |\n| 2020.04.15 | 3.4937 | 1.75   |\n| 2020.04.16 | 5.1645 | 5.145  |\n\nThe default case of kurtosis in DolphinDB is biased (*biased* = true), while in pandas and Excel it is unbiased estimation, and the kurtosis value 3 of the normal distribution is subtracted.\n\nThe following example illustrates the equivalent conversion between the two when using a sliding window:\n\n```\n// python\nm = [[1111,2], [323,9], [43,12], [51,32], [6,400]]\ndf = pandas.DataFrame(m)\ny = df.rolling(4).kurt()\n\n// dolphindb\nm=matrix(1111 323 43 51 6, 2 9 12 32 400)\nm.mkurtosis(4, false)-3\n```\n\n| #0       | #1       |\n| -------- | -------- |\n|          |          |\n|          |          |\n|          |          |\n| 2.504252 | 2.366838 |\n| 3.675552 | 3.941262 |\n\nRelated function: [kurtosis](https://docs.dolphindb.com/en/Functions/k/kurtosis.html)\n"
    },
    "mkurtosisTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mkurtosisTopN.html",
        "signatures": [
            {
                "full": "mkurtosisTopN(X, S, window, top, [biased=true], [ascending=true], [tiesMethod='latest'])",
                "name": "mkurtosisTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [mkurtosisTopN](https://docs.dolphindb.com/en/Functions/m/mkurtosisTopN.html)\n\n\n\n#### Syntax\n\nmkurtosisTopN(X, S, window, top, \\[biased=true], \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the moving kurtosis of the first *top* elements.\n\n**Return value**: DOUBLE type\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmkurtosisTopN(X, S, 6, 4)\n// output: [,,1.49,2.23,2.31,2.11,2.27]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\nmkurtosisTopN(X, S, 6, 4)\n\n/* output:\ncol1   col2\n\n\n1.5\n1.5    1.5\n1.8457 1.5\n1.5734 1.8457\n1.8457 1.2215\n1.64   2\n1.64   1.64\n1.64   1.8457\n*/\n\nsymbol = [\"A\",\"A\",\"A\",\"B\",\"A\",\"A\",\"B\",\"A\",\"A\",\"B\",\"B\",\"B\",\"A\",\"B\",\"A\",\"B\",\"B\",\"A\",\"B\",\"A\"]\ntime = temporalAdd(2023.07.05T09:30:00.000,[10,20,40,60,70,80,90,140,160,170,180,190,200,210,220,230,250,360,390,400],\"ms\")\nprice = [28.11,28.25,28.44,52.31,28.98,28.89,52.22,28.16,28.52,52.62,52.56,52.2,28.01,52.43,28.57,52.42,52.19,28.16,52.84,28.18]\nqty = [5000,400,3100,100,2400,3700,700,3700,4600,4700,3100,3300,3900,3500,3000,3000,4000,4700,2000,4400]\nBSFlag = [1,0,0,0,1,1,0,1,0,0,0,1,0,0,1,1,1,0,1,0]\nt = table(time, symbol, price, qty, BSFlag)\nselect time,symbol,mkurtosisTopN(price, qty, 8, 5) as mskewTop5price from t context by symbol\n```\n\n| time                    | symbol | mskewTop5price |\n| ----------------------- | ------ | -------------- |\n| 2023.07.05T09:30:00.010 | A      |                |\n| 2023.07.05T09:30:00.020 | A      |                |\n| 2023.07.05T09:30:00.040 | A      | 1.5            |\n| 2023.07.05T09:30:00.070 | A      | 2.0147         |\n| 2023.07.05T09:30:00.080 | A      | 1.3355         |\n| 2023.07.05T09:30:00.140 | A      | 1.2976         |\n| 2023.07.05T09:30:00.160 | A      | 1.2976         |\n| 2023.07.05T09:30:00.200 | A      | 1.2976         |\n| 2023.07.05T09:30:00.220 | A      | 2.2021         |\n| 2023.07.05T09:30:00.360 | A      | 1.656          |\n| 2023.07.05T09:30:00.400 | A      | 1.351          |\n| 2023.07.05T09:30:00.060 | B      |                |\n| 2023.07.05T09:30:00.090 | B      |                |\n| 2023.07.05T09:30:00.170 | B      | 1.5            |\n| 2023.07.05T09:30:00.180 | B      | 1.1993         |\n| 2023.07.05T09:30:00.190 | B      | 1.289          |\n| 2023.07.05T09:30:00.210 | B      | 1.7383         |\n| 2023.07.05T09:30:00.230 | B      | 1.8183         |\n| 2023.07.05T09:30:00.250 | B      | 1.8183         |\n| 2023.07.05T09:30:00.390 | B      | 1.923          |\n\nRelated function: [mkurtosis](https://docs.dolphindb.com/en/Functions/m/mkurtosis.html)\n"
    },
    "mlast": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mlast.html",
        "signatures": [
            {
                "full": "mlast(X, window, [minPeriods])",
                "name": "mlast",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mlast](https://docs.dolphindb.com/en/Functions/m/mlast.html)\n\n\n\n#### Syntax\n\nmlast(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the last element of *X* in a sliding window.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nindex = second(08:20:00)+1..7\nx = 2 1 3 NULL 6 5 4\nx = index.indexedSeries(x)\nmlast(x,3s)\n```\n\n| label    | col1 |\n| -------- | ---- |\n| 08:20:01 | 2    |\n| 08:20:02 | 1    |\n| 08:20:03 | 3    |\n| 08:20:04 |      |\n| 08:20:05 | 6    |\n| 08:20:06 | 5    |\n| 08:20:07 | 4    |\n\n```\nm = matrix(1 5 9 0 2, 9 10 2 NULL 2)\nm.rename!((date(2020.09.08)+1..3) join 2020.09.16 join 2020.09.26, `A`B)\nm.setIndexedMatrix!()\nmlast(m, 3d)\n```\n\n| label      | A | B  |\n| ---------- | - | -- |\n| 2020.09.09 | 1 | 9  |\n| 2020.09.10 | 5 | 10 |\n| 2020.09.11 | 9 | 2  |\n| 2020.09.16 | 0 |    |\n| 2020.09.26 | 2 | 2  |\n\n```\nmlast(m, 1w)\n```\n\n| label      | A | B  |\n| ---------- | - | -- |\n| 2020.09.09 | 1 | 9  |\n| 2020.09.10 | 5 | 10 |\n| 2020.09.11 | 9 | 2  |\n| 2020.09.16 | 0 |    |\n| 2020.09.26 | 2 | 2  |\n\nRelated functions: [last](https://docs.dolphindb.com/en/Functions/l/last.html), [first](https://docs.dolphindb.com/en/Functions/f/first.html)\n"
    },
    "mlastNot": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mlastNot.html",
        "signatures": [
            {
                "full": "mlastNot(X, window, [k=NULL], [minPeriods=1])",
                "name": "mlastNot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[k=NULL]",
                        "name": "k",
                        "optional": true,
                        "default": "NULL"
                    },
                    {
                        "full": "[minPeriods=1]",
                        "name": "minPeriods",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [mlastNot](https://docs.dolphindb.com/en/Functions/m/mlastNot.html)\n\n#### Syntax\n\nmlastNot(X, window, \\[k=NULL], \\[minPeriods=1])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Parameters\n\n**k** (optional) is a numeric or string scalar indicating the value to be matched.\n\n#### Details\n\nIf *X* is a vector:\n\n* If *k* is not specified, return the last element of *X* that is not null in a sliding window.\n\n* If *k* is specified, return the last element of *X* that is neither *k* nor null in the window.\n\nIf *X* is a matrix or table, conduct the aforementioned calculation within each column of *X*. The result is a matrix or table.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nmlastNot(NULL 2 NULL 4 5, 2)\n// output: [,2,2,4,5]\n```\n\n```\nmlastNot(X=matrix(1..5,2..6,3..7), window=2, k=4, minPeriods=2)\n```\n\n<table id=\"table_fct_wcd_jbc\"><thead><tr><th>\n\n\\#0\n\n</th><th>\n\n\\#1\n\n</th><th>\n\n\\#2\n\n</th></tr></thead><tbody><tr><td>\n\n</td><td>\n\n \n\n</td><td>\n\n \n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n3\n\n</td><td>\n\n3\n\n</td></tr><tr><td>\n\n3\n\n</td><td>\n\n3\n\n</td><td>\n\n5\n\n</td></tr><tr><td>\n\n3\n\n</td><td>\n\n5\n\n</td><td>\n\n6\n\n</td></tr><tr><td>\n\n5\n\n</td><td>\n\n6\n\n</td><td>\n\n7\n\n</td></tr></tbody>\n</table>```\nx=table([\"s1\", \"s2\", \"\", \"s4\", \"s5\"] as col1, [\"s1\", \"\", \"s3\", \"\", \"s5\"] as col2)\nmlastNot(X=x, window=2)\n```\n\n<table id=\"table_twv_xcd_jbc\"><thead><tr><th>\n\n\\#0\n\n</th><th>\n\n\\#1\n\n</th></tr></thead><tbody><tr><td>\n\n</td><td>\n\n \n\n</td></tr><tr><td>\n\ns2\n\n</td><td>\n\ns1\n\n</td></tr><tr><td>\n\ns2\n\n</td><td>\n\ns3\n\n</td></tr><tr><td>\n\ns4\n\n</td><td>\n\ns3\n\n</td></tr><tr><td>\n\ns5\n\n</td><td>\n\ns5\n\n</td></tr></tbody>\n</table>```\nT = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.06, 2022.01.07, 2022.01.08, 2022.01.10, 2022.01.11]\nX = 1..8\nX1 = indexedSeries(T, X)\nmlastNot(X=X1, window=3, k=1, minPeriods=1)\n```\n\n<table id=\"table_jmg_5bd_jbc\"><tbody><tr><td>\n\n</td><td>\n\n\\#0\n\n</td></tr><tr><td>\n\n2022.01.01\n\n</td><td>\n\n \n\n</td></tr><tr><td>\n\n2022.01.02\n\n</td><td>\n\n2\n\n</td></tr><tr><td>\n\n2022.01.03\n\n</td><td>\n\n2\n\n</td></tr><tr><td>\n\n2022.01.06\n\n</td><td>\n\n4\n\n</td></tr><tr><td>\n\n2022.01.07\n\n</td><td>\n\n4\n\n</td></tr><tr><td>\n\n2022.01.08\n\n</td><td>\n\n4\n\n</td></tr><tr><td>\n\n2022.01.10\n\n</td><td>\n\n6\n\n</td></tr><tr><td>\n\n2022.01.11\n\n</td><td>\n\n7\n\n</td></tr></tbody>\n</table>Related functions: [mlast](mlast.md), [mfirstNot](mfirstNot.md)\n\n"
    },
    "mLowRange": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mLowRange.html",
        "signatures": [
            {
                "full": "mLowRange(X, window, [minPeriods])",
                "name": "mLowRange",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mLowRange](https://docs.dolphindb.com/en/Functions/m/mLowRange.html)\n\n#### Syntax\n\nmLowRange(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nFor each element *Xi* in a sliding window of *X*, count the continuous nearest neighbors to its left that are larger than *Xi*. Null values are treated as the minimum values.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*.\n\n#### Returns\n\n* Returns an INT vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nx = [NULL, 3.1, NULL, 3.0, 2.9, 2.8, 3.1, NULL, 3.2]\nmLowRange(x, window=3) \n// output: [,,1,0,1,2,0,2,0]\n\nmLowRange(x, window=3, minPeriods=1) \n// output: [,0,1,0,1,2,0,2,0]\n\nmLowRange(x, window=3, minPeriods=2) \n// output: [,,,0,1,2,0,2,0]\n\ndate = [0, 1, 2, 3, 7, 8, 9, 10, 11] + 2020.01.01\nX = indexedSeries(date, x)\nmLowRange(X, 3d)\n```\n\n<table id=\"table_wpt_cmr_jbc\"><thead><tr><th>\n\n \n\n</th><th>\n\n\\#0\n\n</th></tr></thead><tbody><tr><td>\n\n2020.01.01\n\n</td><td>\n\n</td></tr><tr><td>\n\n2020.01.02\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n2020.01.03\n\n</td><td>\n\n1\n\n</td></tr><tr><td>\n\n2020.01.04\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n2020.01.08\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n2020.01.09\n\n</td><td>\n\n1\n\n</td></tr><tr><td>\n\n2020.01.10\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n2020.01.11\n\n</td><td>\n\n2\n\n</td></tr><tr><td>\n\n2020.01.12\n\n</td><td>\n\n0\n\n</td></tr></tbody>\n</table>```\nm = matrix(1 2 3 NULL, 1 2 NULL 3, 1 3 NULL NULL, 1 2 3 4)\nmLowRange(m, 2)\n```\n\n<table id=\"table_grx_dmr_jbc\"><thead><tr><th>\n\n\\#0\n\n</th><th>\n\n\\#1\n\n</th><th>\n\n\\#2\n\n</th><th>\n\n\\#3\n\n</th></tr></thead><tbody><tr><td>\n\n</td><td>\n\n</td><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\n0\n\n</td><td>\n\n0\n\n</td><td>\n\n0\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n0\n\n</td><td>\n\n1\n\n</td><td>\n\n1\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n1\n\n</td><td>\n\n0\n\n</td><td>\n\n</td><td>\n\n0\n\n</td></tr></tbody>\n</table>**Parent topic:**[Functions](../../Functions/category.md)\n"
    },
    "mmad": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mmad.html",
        "signatures": [
            {
                "full": "mmad(X, window, [useMedian=false], [minPeriods])",
                "name": "mmad",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[useMedian=false]",
                        "name": "useMedian",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mmad](https://docs.dolphindb.com/en/Functions/m/mmad.html)\n\n\n\n#### Syntax\n\nmmad(X, window, \\[useMedian=false], \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the average absolute deviation of *X* in a sliding window.\n\n#### Parameters\n\n**useMedian** is a Boolean value. The default value is false and it returns the mean absolute deviation, otherwise returns the median absolute deviation.\n\n* mean absolute deviation: mean(abs(X - mean(X)))\n\n* median absolute deviation: med(abs(X - med(X)))\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nx = 7 4 6 0 -5 32;\nmmad(x, window=3);\n// output: [,,1.11,2.22,3.78,15.33]\n\nmmad(x, window=3, useMedian=true)\n// output: [,,1,2,5,5]\n\ny = NULL NULL 2 5 1 7 -3 0\nmmad(y, window=3, minPeriods=2);\n// output: [,,,1.5,1.56,2.22,3.56,3.78]\n```\n\n```\nm=matrix(85 90 95, 185 190 195);\nm;\n```\n\n| #0 | #1  |\n| -- | --- |\n| 85 | 185 |\n| 90 | 190 |\n| 95 | 195 |\n\n```\nmmad(m, 2)\n```\n\n| #0  | #1  |\n| --- | --- |\n|     |     |\n| 2.5 | 2.5 |\n| 2.5 | 2.5 |\n\nRelated function: [mad](https://docs.dolphindb.com/en/Functions/m/mad.html)\n"
    },
    "mmax": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mmax.html",
        "signatures": [
            {
                "full": "mmax(X, window, [minPeriods])",
                "name": "mmax",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mmax](https://docs.dolphindb.com/en/Functions/m/mmax.html)\n\n\n\n#### Syntax\n\nmmax(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving maximums of *X* in a sliding window.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 2 1 3 7 6 5 4\nY = 2 1 3 NULL 6 5 4\n\nmmax(X, 3);\n// output: [,,3,7,7,7,6]\n\nmmax(Y, 3);\n// output: [,,3,3,6,6,6]\n\nmmax(Y, 3, minPeriods=1);\n// output: [2,2,3,3,6,6,6]\n```\n\n```\nm = matrix(1 5 9 0 2, 9 10 2 NULL 2)\nm.rename!(date(2020.09.08)+1..5, `A`B)\nm.setIndexedMatrix!()\nm.mmax(3d)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.09 | 1    | 9    |\n| 2020.09.10 | 5    | 10   |\n| 2020.09.11 | 9    | 10   |\n| 2020.09.12 | 9    | 10   |\n| 2020.09.13 | 9    | 2    |\n\n```\nm.mmax(1w)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.09 | 1    | 9    |\n| 2020.09.10 | 5    | 10   |\n| 2020.09.11 | 9    | 10   |\n| 2020.09.12 | 9    | 10   |\n| 2020.09.13 | 9    | 10   |\n\nRelated functions: [max](https://docs.dolphindb.com/en/Functions/m/max.html)\n"
    },
    "mmaxPositiveStreak": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mmaxPositiveStreak.html",
        "signatures": [
            {
                "full": "mmaxPositiveStreak(X, window)",
                "name": "mmaxPositiveStreak",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [mmaxPositiveStreak](https://docs.dolphindb.com/en/Functions/m/mmaxPositiveStreak.html)\n\n\n\n#### Syntax\n\nmmaxPositiveStreak(X, window)\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nObtain the maximum value of the sum of consecutive positive numbers in *X* within a sliding window of given size (based on the number of elements).\n\n#### Returns\n\nReturns an object with the same type and form as *X*.\n\n#### Examples\n\n```\nx = 1 -1 1 -2 10 3 3 9 0 6 5\nw = 5\nmmaxPositiveStreak(x, w)\n// output: [,,,,10,13,16,25,25,15,12]\n\nx = 5 NULL 3 2 1 5 10 9 NULL 9 10 -1 NULL\nw = 5\nmmaxPositiveStreak(x, w)\n// output: [,,,,6,11,21,27,25,24,19,19,19]\n\n// use the signum function to count the maximum number of consecutive positive numbers\nmmaxPositiveStreak(signum(x), w)\n// output: [,,,,3,4,5,5,4,3,2,2,2]\n```\n"
    },
    "mmed": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mmed.html",
        "signatures": [
            {
                "full": "mmed(X, window, [minPeriods])",
                "name": "mmed",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mmed](https://docs.dolphindb.com/en/Functions/m/mmed.html)\n\n\n\n#### Syntax\n\nmmed(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving median of *X* in a sliding window.\n\n#### Returns\n\nReturns an object of type DOUBLE, with the same form as *X*.\n\n#### Examples\n\n```\nX = 2 1 3 7 6 5 4\nY = 2 1 3 NULL 6 5 4\n\nmmed(X, 3);\n// output: [,,2,3,6,6,5]\n\nmmed(Y, 3);\n// output: [,,2,2,4.5,5.5,5]\n\nmmed(Y, 3, minPeriods=1);\n// output: [2,1.5,2,2,4.5,5.5,5]\n```\n\n```\nm = matrix(1 5 9 0 2, 9 10 2 NULL 2)\nm.rename!(date(2020.09.08)+1..5, `A`B)\nm.setIndexedMatrix!()\nm.mmed(3d)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.09 | 1    | 9    |\n| 2020.09.10 | 3    | 9.5  |\n| 2020.09.11 | 5    | 9    |\n| 2020.09.12 | 5    | 6    |\n| 2020.09.13 | 2    | 2    |\n\n```\nm.mmed(1w)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.09 | 1    | 9    |\n| 2020.09.10 | 3    | 9.5  |\n| 2020.09.11 | 5    | 9    |\n| 2020.09.12 | 3    | 9    |\n| 2020.09.13 | 2    | 5.5  |\n\nRelated functions: [med](https://docs.dolphindb.com/en/Functions/m/med.html)\n"
    },
    "mmin": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mmin.html",
        "signatures": [
            {
                "full": "mmin(X, window, [minPeriods])",
                "name": "mmin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mmin](https://docs.dolphindb.com/en/Functions/m/mmin.html)\n\n\n\n#### Syntax\n\nmmin(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving minimums of *X* in a sliding window.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 2 1 3 7 6 5 4\nY = 2 1 3 NULL 6 5 4\n\nmmin(X, 3);\n// output: [,,1,1,3,5,4]\n\nmmin(Y, 3);\n// output: [,,1,1,3,5,4]\n\nmmin(Y, 3, minPeriods=1);\n// output: [2,1,1,1,3,5,4]\n```\n\n```\nm = matrix(1 5 9 0 2 8 -1 5, 9 10 2 NULL -1 10 2 3)\nm.rename!(date(2020.09.10)+1..8, `A`B)\nm.setIndexedMatrix!()\nm.mmin(3d)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.11 | 1    | 9    |\n| 2020.09.12 | 1    | 9    |\n| 2020.09.13 | 1    | 2    |\n| 2020.09.14 | 0    | 2    |\n| 2020.09.15 | 0    | (1)  |\n| 2020.09.16 | 0    | (1)  |\n| 2020.09.17 | (1)  | (1)  |\n| 2020.09.18 | (1)  | 2    |\n\n```\nm.mmin(1w)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.11 | 1    | 9    |\n| 2020.09.12 | 1    | 9    |\n| 2020.09.13 | 1    | 2    |\n| 2020.09.14 | 0    | 2    |\n| 2020.09.15 | 0    | (1)  |\n| 2020.09.16 | 0    | (1)  |\n| 2020.09.17 | (1)  | (1)  |\n| 2020.09.18 | (1)  | (1)  |\n\nRelated function: [min](https://docs.dolphindb.com/en/Functions/m/min.html)\n"
    },
    "mmse": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mmse.html",
        "signatures": [
            {
                "full": "mmse(Y, X, window, [minPeriods])",
                "name": "mmse",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mmse](https://docs.dolphindb.com/en/Functions/m/mmse.html)\n\n\n\n#### Syntax\n\nmmse(Y, X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for windowing logic.\n\n#### Details\n\nReturn the coefficient estimates of *X* and mean square errors of an ordinary-least-squares regression of *Y* on *X* with intercept with a rolling window. The length of the window is given by the parameter *window*.\n\nThe mean square error (MSE) is calculated with the following formula:\n\n![](https://docs.dolphindb.com/en/images/mmse.png)\n\n#### Parameters\n\n**Y** is a vector indicating the dependent variable.\n\n**X** is a vector indicating the independent variable.\n\n**window** is an integer no smaller than 2 or a scalar of DURATION type indicating the size of the sliding window. Note: The window size is capped at 102400 when m-functions are used in the streaming engines.\n\n**minPeriods** (optional) is a positive integer indicating the minimum number of non-NULL valid observations in a window required to produce a result (otherwise the result is NULL).\n\n#### Returns\n\nIt returns a tuple with 2 vectors. The first vector is the coefficient estimates and the second vector is the mean square errors. Each vector is of the same length as *X* and *Y*.\n\n#### Examples\n\n```\nx=0.011 0.006 -0.008 0.012 -0.016 -0.023 0.018\ny=0.016 0.009 -0.012 0.022 0.003 -0.056 0.002;\n\nmmse(y, x, 5)[0];\n// output: [,,,,0.818182,1.692379,1.188532]\n\nmmse(y, x, 5)[1];\n// output: [,,,,0.000055,0.000231,0.000332]\n\nselect y, x, mmse(y,x,5,3) as `mbeta`mmse from table(x,y);\n```\n\n| y      | x      | mbeta    | mmse        |\n| ------ | ------ | -------- | ----------- |\n| 0.016  | 0.011  |          |             |\n| 0.009  | 0.006  |          |             |\n| -0.012 | -0.008 | 1.479381 | 2.806415E-8 |\n| 0.022  | 0.012  | 1.594701 | 0.000003    |\n| 0.003  | -0.016 | 0.818182 | 0.000055    |\n| -0.056 | -0.023 | 1.692379 | 0.000231    |\n| 0.002  | 0.018  | 1.188532 | 0.000332    |\n"
    },
    "mod": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mod.html",
        "signatures": [
            {
                "full": "mod(X, Y)",
                "name": "mod",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [mod](https://docs.dolphindb.com/en/Functions/m/mod.html)\n\n\n\n#### Syntax\n\nmod(X, Y)\n\n#### Details\n\n`Mod` means modulus. It returns the element-by-element remainder of *X* divided by *Y*. When *Y* is a positive integer, the modulus is always non-negative, e.g., -10 % 3 is 2. When *Y* is a negative integer, the modulus is always non-positive, e.g., -10 % -3 is -1. `mod` is often used to group data. For example, \\[5,4,3,3,5,6]%3 is \\[2,1,0,0,2,0]; data can thereby be divided into three groups.\n\n#### Parameters\n\n**X** / **Y** is a scalar/pair/vector/matrix. If *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\n* Returns an INT scalar when *X* and *Y* are both scalars.\n\n* Returns an INT vector when *X* and *Y* are both vectors.\n\n* Returns an INT matrix when *X* and *Y* are both matrices.\n\n#### Examples\n\n```\nx=1 2 3;\nx % 2;\n// output: [1,0,1]\n\n2 % x;\n// output: [0,0,2]\n\ny=4 5 6;\nx mod y;\n// output: [1,2,3]\n\nmod(y, x);\n// output: [0,1,0]\n\nm=1..6$2:3;\nm;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm mod 3;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 0  | 2  |\n| 2  | 1  | 0  |\n\n```\nx=-1 2 3;\nx%-5;\n// output: [-1,-3,-2]\n\n-1%5;\n// output: 4\n```\n"
    },
    "mode": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mode.html",
        "signatures": [
            {
                "full": "mode(X)",
                "name": "mode",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [mode](https://docs.dolphindb.com/en/Functions/m/mode.html)\n\n\n\n#### Syntax\n\nmode(X)\n\n#### Details\n\nIf *X* is a vector, calculate the most frequently occurring value in *X*.\n\nIf *X* is a matrix/table, calculate the most frequently occurring value in each column of *X* and return a vector/table.\n\nThis function counts the occurrences of unique values (keys) in *X* using a hash table. If there are multiple keys with the highest count, the function returns the first key in the hash table. Note that the hash algorithm used by this function varies for different data types, so the output results may differ.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\nDolphinDB `mode` and `scipy.stats.mode` have similar functionality, but differ in several aspects:\n\n* DolphinDB supports a single-argument form `mode(x)` for directly computing the mode of a vector/matrix/table, whereas SciPy’s `scipy.stats.mode` supports multidimensional arrays and allows specifying the computation dimension via the *axis* parameter.\n* DolphinDB `mode` returns only the mode value and does not provide frequency information, while SciPy’s `mode` returns a structured result `ModeResult(mode, count)`, including both the mode and its occurrence count.\n* In the case of multiple modes, DolphinDB returns the first key in the hash table, whereas SciPy’s `mode` by default returns the smallest mode value.\n* In DolphinDB, null values are excluded from the computation, while SciPy’s `mode` ignores or handles NaN values depending on parameters (e.g., *nan\\_policy*).\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\n* Returns an INT scalar when *X* is a scalar or vector.\n\n* Returns an INT vector when *X*is a matrix.\n\n* Returns a table when *X* is a table.\n\n#### Examples\n\n```\nmode 2;\n// output: 2\n\nmode 1 3 3 3 4 5 5;\n// output: 3\n\nmode `test;\n// output: test\n\nm=matrix(1 1 2 2 2 3, 4 4 5 6 6 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 1  | 4  |\n| 2  | 5  |\n| 2  | 6  |\n| 2  | 6  |\n| 3  | 6  |\n\n```\nmode m;\n// output: [2,6]\n```\n\nRelated functions: [mean](https://docs.dolphindb.com/en/Functions/m/mean.html) and [med](https://docs.dolphindb.com/en/Functions/m/med.html)\n"
    },
    "month": {
        "url": "https://docs.dolphindb.com/en/Functions/m/month.html",
        "signatures": [
            {
                "full": "month(X)",
                "name": "month",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [month](https://docs.dolphindb.com/en/Functions/m/month.html)\n\n\n\n#### Syntax\n\nmonth(X)\n\n#### Details\n\nReturn the corresponding month(s).\n\n#### Parameters\n\n**X** is a temporal scalar/vector.\n\n#### Returns\n\nReturns a MONTH scalar or vector.\n\n#### Examples\n\n```\nmonth(2012.12.03);\n// output: 2012.12M\n```\n\nRelated functions: [second](https://docs.dolphindb.com/en/Functions/s/second.html), [minute](https://docs.dolphindb.com/en/Functions/m/minute.html), [hour](https://docs.dolphindb.com/en/Functions/h/hour.html), [date](https://docs.dolphindb.com/en/Functions/d/date.html), [year](https://docs.dolphindb.com/en/Functions/y/year.html).\n"
    },
    "monthBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/m/monthBegin.html",
        "signatures": [
            {
                "full": "monthBegin(X, [offset], [n=1])",
                "name": "monthBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [monthBegin](https://docs.dolphindb.com/en/Functions/m/monthBegin.html)\n\n\n\n#### Syntax\n\nmonthBegin(X, \\[offset], \\[n=1])\n\nAlias: monthStart\n\n#### Details\n\nReturns the first day of the month that *X* belongs to.\n\nBy default, the function calculates period start dates based on one-month periods. When both *offset* and *n* are specified and *n* > 1, the function calculates period start dates based on n-month periods. In this case, *offset* determines how the multi-month periods are aligned. Specifically, the system first calculates the start date of the month containing *offset* and uses that date as the reference point. A new period-starting boundary is then generated every *n* months, and the function returns the first day of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**offset** is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** is a positive integer. The default value is 1.\n\n#### Returns\n\nA DATE scalar or vector.\n\n#### Examples\n\n```\nmonthBegin(2016.12.06);\n// output: 2016.12.01\n\ndate=2016.04.12 2016.04.25 2016.05.12 2016.06.28 2016.07.10 2016.07.18 2016.08.02 2016.08.16 2016.09.26 2016.09.30\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2016.05.12 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2016.06.11 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2016.07.11 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2016.08.10 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.09.09 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2016.10.09 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2016.11.08 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2016.12.08 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2017.01.07 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2017.02.06 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by monthBegin(date,2016.01.01,2);\n```\n\n| monthBegin\\_date | avg\\_price | sum\\_qty |\n| ---------------- | ---------- | -------- |\n| 2016.03.01       | 39.53      | 4100     |\n| 2016.05.01       | 29.77      | 5300     |\n| 2016.07.01       | 112.82     | 16000    |\n| 2016.09.01       | 51.835     | 13300    |\n\nRelated functions: [monthEnd](https://docs.dolphindb.com/en/Functions/m/monthEnd.html), [businessMonthBegin](https://docs.dolphindb.com/en/Functions/b/businessMonthBegin.html), [businessMonthEnd](https://docs.dolphindb.com/en/Functions/b/businessMonthEnd.html), [semiMonthBegin](https://docs.dolphindb.com/en/Functions/s/semiMonthBegin.html), [semiMonthEnd](https://docs.dolphindb.com/en/Functions/s/semiMonthEnd.html)\n"
    },
    "monthEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/m/monthEnd.html",
        "signatures": [
            {
                "full": "monthEnd(X, [offset], [n=1])",
                "name": "monthEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [monthEnd](https://docs.dolphindb.com/en/Functions/m/monthEnd.html)\n\n\n\n#### Syntax\n\nmonthEnd(X, \\[offset], \\[n=1])\n\n#### Details\n\nReturns the last day of the month that *X* belongs to.\n\nBy default, the function calculates period end dates based on one-month periods. When both *offset* and *n* are specified and *n* > 1, the function calculates period end dates based on n-month periods. In this case, *offset* determines how the multi-month periods are aligned. Specifically, the system first calculates the end date of the month containing *offset* and uses that date as the reference point. A new period-ending boundary is then generated every *n* months, and the function returns the last day of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**offset** is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** is a positive integer. The default value is 1.\n\n#### Returns\n\nA DATE scalar or vector.\n\n#### Examples\n\n```\nmonthEnd(2012.06.12);\n// output: 2012.07.31\n\ndate=2016.04.12+(1..10)*30\ntime = take(09:30:00, 10)\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2016.05.12 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2016.06.11 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2016.07.11 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2016.08.10 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.09.09 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2016.10.09 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2016.11.08 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2016.12.08 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2017.01.07 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2017.02.06 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by monthEnd(date,2016.01.31,2);\n```\n\n| monthEnd\\_date | avg\\_price | sum\\_qty |\n| -------------- | ---------- | -------- |\n| 2016.05.31     | 49.6       | 2200     |\n| 2016.07.31     | 29.49      | 4000     |\n| 2016.09.30     | 102.495    | 10000    |\n| 2016.11.30     | 112.995    | 6700     |\n| 2017.01.31     | 50.805     | 11300    |\n| 2017.03.31     | 52.38      | 4500     |\n\nRelated functions: [monthBegin](https://docs.dolphindb.com/en/Functions/m/monthBegin.html), [businessMonthBegin](https://docs.dolphindb.com/en/Functions/b/businessMonthBegin.html), [businessMonthEnd](https://docs.dolphindb.com/en/Functions/b/businessMonthEnd.html), [semiMonthBegin](https://docs.dolphindb.com/en/Functions/s/semiMonthBegin.html), [semiMonthEnd](https://docs.dolphindb.com/en/Functions/s/semiMonthEnd.html)\n"
    },
    "monthOfYear": {
        "url": "https://docs.dolphindb.com/en/Functions/m/monthOfYear.html",
        "signatures": [
            {
                "full": "monthOfYear(X)",
                "name": "monthOfYear",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html)\n\n\n\n#### Syntax\n\nmonthOfYear(X)\n\n#### Details\n\nFor each element in *X*, return a number from 1 to 12 indicating which month of the year it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, MONTH, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nAn INT scalar or vector.\n\n#### Examples\n\n```\nmonthOfYear(2012.07.02);\n// output: 7\n\nmonthOfYear([2012.06.12T12:30:00,2012.10.28T12:35:00,2013.01.06T12:36:47,2013.04.06T08:02:14]);\n// output: [6,10,1,4]\n```\n\nRelated functions: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "move": {
        "url": "https://docs.dolphindb.com/en/Functions/m/move.html",
        "signatures": [
            {
                "full": "move(X, steps)",
                "name": "move",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "steps",
                        "name": "steps"
                    }
                ]
            }
        ],
        "markdown": "### [move](https://docs.dolphindb.com/en/Functions/m/move.html)\n\n\n\n#### Syntax\n\nmove(X, steps)\n\n#### Details\n\nShifts *X* one position to the left or right. This function is a generalized form of [prev](https://docs.dolphindb.com/en/Functions/p/prev.html) and [next](https://docs.dolphindb.com/en/Functions/n/next.html).\n\n#### Parameters\n\n**X** is a vector/matrix/table.\n\n**steps** is an integer indicating how many positions to shift the elements of *X*.\n\n* If *steps* is positive, *X* is moved to the right for *steps* positions;\n* If *steps* is negative, *X* is moved to the left for *steps* positions;\n* If *steps* is 0, *X* does not move;\n* If *steps* is a DURATION, *X* must be an indexed matrix or indexed series with temporal values as its row index. For each timestamp Ti with value Xi, the shifted result is determined as follows: Find the value corresponding to time Ti − *steps* on the timeline and assign it to the current position.\n  * If a timestamp exactly equal to Ti − *steps* exists, use the value at that timestamp.\n  * If no such timestamp exists, use the value at the largest timestamp that is not later than Ti − *steps*.\n  * If no timestamp satisfies the condition, the result is NULL.\n\n#### Returns\n\nReturns an object with the same type and form as *X*.\n\n#### Examples\n\n```\nx=3 9 5 1 4 9;\nmove(x,3);\n// output: [,,,3,9,5]\n\nmove(x,-2);\n// output: [5,1,4,9,,]\n\nindex = (second(08:20:00)+1..4) join 08:21:01 join 08:21:02\nx = index.indexedSeries(x)\nmove(x,3s)\n```\n\n| label    | col1 |\n| -------- | ---- |\n| 08:20:01 |      |\n| 08:20:02 |      |\n| 08:20:03 |      |\n| 08:20:04 | 3    |\n| 08:21:01 | 1    |\n| 08:21:02 | 1    |\n\n```\nmove(x,1m)\n```\n\n| label    | col1 |\n| -------- | ---- |\n| 08:20:01 |      |\n| 08:20:02 |      |\n| 08:20:03 |      |\n| 08:20:04 |      |\n| 08:21:01 | 3    |\n| 08:21:02 | 9    |\n"
    },
    "moveChunksAcrossVolume": {
        "url": "https://docs.dolphindb.com/en/Functions/m/moveChunksAcrossVolume.html",
        "signatures": [
            {
                "full": "moveChunksAcrossVolume(srcPath, destPath, chunkIds, [isDelSrc=true])",
                "name": "moveChunksAcrossVolume",
                "parameters": [
                    {
                        "full": "srcPath",
                        "name": "srcPath"
                    },
                    {
                        "full": "destPath",
                        "name": "destPath"
                    },
                    {
                        "full": "chunkIds",
                        "name": "chunkIds"
                    },
                    {
                        "full": "[isDelSrc=true]",
                        "name": "isDelSrc",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [moveChunksAcrossVolume](https://docs.dolphindb.com/en/Functions/m/moveChunksAcrossVolume.html)\n\n**Note:** This function will be deprecated in a future version. We recommend you use the function [moveReplicas](https://docs.dolphindb.com/en/Functions/m/moveReplicas.html).\n\n\n\n#### Syntax\n\nmoveChunksAcrossVolume(srcPath, destPath, chunkIds, \\[isDelSrc=true])\n\n#### Parameters\n\n**srcPath** is a string in the format of *volumeA/CHUNKS*, indicating the source volume of the chunks.\n\n**destPath** is a string in the format of *volumeB/CHUNKS*, indicating the destination volume of the chunks.\n\n**chunkIds** is a string scalar or vector, indicating the chunk IDs to be moved.\n\n**isDelSrc** is a Boolean value indicating whether to delete the source volume after copying the chunks. The default value is true.\n\nNote: *srcPath*, *destPath*, and *chunkIds* can be obtained with function [getChunksMeta](https://docs.dolphindb.com/en/Functions/g/getChunksMeta.html).\n\n#### Details\n\nMove the chunks from the source volume to the destination volume on the same node. When *isDelSrc* = true, chunks are moved to the destination volume, otherwise they are copied. If the transfer fails, all chunks of the source volume are retained, and chunks that have been copied are removed from the destination volume.\n\n**Note:**\n\n* Chunks can only be moved within the same node.\n\n* Before moving the chunks, make sure that there is no writing process on the current node, all transactions have been completed, and all buffers have been synchronized to the disk.\n\n* The configuration parameter *volumes* must contain the volumes specified by parameters *scrPath* and *destPath*. The server must be rebooted after the configuration parameters are modified for them to take effect.\n\n* The volume specified by *destPath* must be empty.\n"
    },
    "moveHotDataToColdVolume": {
        "url": "https://docs.dolphindb.com/en/Functions/m/moveHotDataToColdVolume.html",
        "signatures": [
            {
                "full": "moveHotDataToColdVolume([checkRange=240])",
                "name": "moveHotDataToColdVolume",
                "parameters": [
                    {
                        "full": "[checkRange=240]",
                        "name": "checkRange",
                        "optional": true,
                        "default": "240"
                    }
                ]
            }
        ],
        "markdown": "### [moveHotDataToColdVolume](https://docs.dolphindb.com/en/Functions/m/moveHotDataToColdVolume.html)\n\n#### Syntax\n\nmoveHotDataToColdVolume(\\[checkRange=240])\n\n#### Parameters\n\n`checkRange` is an integer indicating the time range (in hours). The default value is 240, i.e., 10 days. If the parameter is specified, data within the range of \\[current time-hoursToColdVolumes-checkRange, current time-hoursToColdVolumes) will be migrated to *coldVolumes*.\n\n#### Details\n\nMigrate the specified data to *coldVolumes*.\n\nThe migration policy of `moveHotDataToColdVolume` is different from [setRetentionPolicy](https://docs.dolphindb.com/en/Functions/s/setRetentionPolicy.html). See [Tiered Storage](https://docs.dolphindb.com/en/Database/tiered_storage.html) for more information.\n\n"
    },
    "moveReplicas": {
        "url": "https://docs.dolphindb.com/en/Functions/m/moveReplicas.html",
        "signatures": [
            {
                "full": "moveReplicas(srcNode, destNode, chunkId, [destVolumes])",
                "name": "moveReplicas",
                "parameters": [
                    {
                        "full": "srcNode",
                        "name": "srcNode"
                    },
                    {
                        "full": "destNode",
                        "name": "destNode"
                    },
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    },
                    {
                        "full": "[destVolumes]",
                        "name": "destVolumes",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [moveReplicas](https://docs.dolphindb.com/en/Functions/m/moveReplicas.html)\n\n\n\n#### Syntax\n\nmoveReplicas(srcNode, destNode, chunkId, \\[destVolumes])\n\n#### Parameters\n\n**srcNode** is a string indicating the alias of origination node.\n\n**destNode** is a string indicating the alias of destination node.\n\n**chunkId** is a string/UUID scalar or vector indicating ID of chunks.\n\n**destVolumes** (optional) is a STRING scalar or vector indicating the dest volume(s) on the target node. The directories must be included in the configured *volumes*. If a vector is provided, replicas will preferentially be moved to the volume at the beginning of the vector.\n\n#### Details\n\nMove 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.\n\nThis command can only be executed by an administrator on a controller node.\n\nWe can check the execution status with function [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html).\n\n#### Examples\n\nMove replicas of all chunks on \"node1\" to \"node2\".\n\n```\nchunkIds=exec chunkId from pnodeRun(getChunksMeta) where node=\"node1\"\nmoveReplicas(srcNode=\"node1\",destNode=\"node2\",chunkId=chunkIds,destVolumes=\"/ddb/server/clusterDemo/data/node2/storage\");\n```\n"
    },
    "movingTopNIndex": {
        "url": "https://docs.dolphindb.com/en/Functions/m/movingTopNIndex.html",
        "signatures": [
            {
                "full": "movingTopNIndex(X, window, top, [ascending=true], [fixed=false], [tiesMethod='oldest'])",
                "name": "movingTopNIndex",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[fixed=false]",
                        "name": "fixed",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [movingTopNIndex](https://docs.dolphindb.com/en/Functions/m/movingTopNIndex.html)\n\n\n\n#### Syntax\n\nmovingTopNIndex(X, window, top, \\[ascending=true], \\[fixed=false], \\[tiesMethod='oldest'])\n\n#### Details\n\nReturns the first *top* elements of *X* after sorted within a sliding window.\n\n#### Parameters\n\n**X** is a numeric/temporal vector. Note: Starting from version 2.00.10, the null values in X do not participate in data sorting.\n\n**window** is an integer no less than 2, indicating the window size.\n\n**top** is an integer greater than 1 and no greater than *window*.\n\n**ascending** is a Boolean value indicating whether the data within a window is sorted in ascending order. True means ascending order and false means descending order.\n\n**fixed** is a Boolean value, indicating whether the length of each row in the output array vector is fixed to be *top*. The default value is false. When *fixed* = true, all rows are of the same length. For the first (*top* - 1) windows, the indices of missing elements are replaced with null values.\n\n**tiesMethod** is a string that specifies how to select elements if there are more elements with the same value than spots available in the top N after sorting *X* within a sliding window. It can be:\n\n* 'oldest': select elements starting from the earliest entry into the window;\n\n* 'latest': select elements starting from the latest entry into the window.\n\n#### Returns\n\nReturns an array vector indicating the indices of the first *top* elements of *X* after sorted within each sliding window.\n\n#### Examples\n\n```\nS = 2 5 6 1 2 4 5 6 9 0\nm1 = movingTopNIndex(X=S, window=4, top=2, ascending=true, fixed=true)\nm1;\n// output: [[00i,0],[0,1],[0,1],[3,0],[3,4],[3,4],[3,4],[4,5],[5,6],[9,6]]\n\nm2 = movingTopNIndex(X=S, window=4, top=2, ascending=false, fixed=true)\nm2;\n// output: [[00i,0],[1,0],[2,1],[2,1],[2,1],[2,5],[6,5],[7,6],[8,7],[8,7]]\n\nm3 = movingTopNIndex(X=S, window=4, top=2, ascending=true, fixed=false)\nprint m3;\n// output: [[0],[0,1],[0,1],[3,0],[3,4],[3,4],[3,4],[4,5],[5,6],[9,6]]\n\nS[m1[0]]\n// output: [,2,2,1,1,1,1,2,4,0]\n\nS[m3[0]]\n// output: [2,2,2,1,1,1,1,2,4,0]\n```\n\n```\nX = [5, 8, 1, 9, 7, 3, 1, NULL, 0, 8, 7, 7]\nmovingTopNIndex(X=X, window=4, top=2, ascending=true, fixed=true)\n// Before version 2.00.10, the null values in X are involved in data sorting.\n// output: [[00i,0],[0,1],[2,0],[2,0],[2,4],[2,5],[6,5],[7,6],[7,8],[7,8],[7,8],[8,10]]\n// As of version 2.00.10, the null values in X are ignored in data sorting.\n// output: [[00i,0],[0,1],[2,0],[2,0],[2,4],[2,5],[6,5],[6,5],[8,6],[8,6],[8,10],[8,10]]\n\nX = [2, 1, 4, 3, 4, 3, 4]\n// For the sixth window, the sorted X is 1 2 3 3 4 4.\n// As tiesMethod is not specified, the default 'oldest' is used, meaning the first occurrence of 3 (at index 3) is selected.\nmovingTopNIndex(X,6,3)\n// output: [[0],[1,0],[1,0,2],[1,0,3],[1,0,3],[1,0,3],[1,3,5]]]\n\n// As tiesMethod is set to 'latest', the latest occurrence of 3 (at index 5) is selected.\nmovingTopNIndex(X,6,3,tiesMethod=\"latest\")\n// output: [[0],[1,0],[1,0,2],[1,0,3],[1,0,3],[1,0,5],[1,3,5]]\n```\n"
    },
    "movingWindowData": {
        "url": "https://docs.dolphindb.com/en/Functions/m/movingWindowData.html",
        "signatures": [
            {
                "full": "movingWindowData(X, window, [fixed=false])",
                "name": "movingWindowData",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[fixed=false]",
                        "name": "fixed",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [movingWindowData](https://docs.dolphindb.com/en/Functions/m/movingWindowData.html)\n\n#### Syntax\n\nmovingWindowData(X, window, \\[fixed=false])\n\n#### Details\n\nReturns the elements of a window sliding over *X*.\n\n#### Parameters\n\n`X` is a vector (including tuple and array vector).\n\n`window` is an integer greater than or equal to 2. It indicates the size of a count-based window.\n\n`fixed` is a Boolean specifying whether the size of each row of the result must be fixed to *window*. When *fixed*=true, the missing elements in the first (window-1) windows are filled with null values. The default value is false.\n\n#### Returns\n\nReturns an array vector where each row indicates the elements of a window sliding over *X*.\n\n#### Examples\n\n```\nS = -1 3 -4 0 5 10 9 7\nm = movingWindowData(X=S,window=3);\nm;\n// output: [[-1],[-1,3],[-1,3,-4],[3,-4,0],[-4,0,5],[0,5,10],[5,10,9],[10,9,7]]\n\nmi = movingWindowData(X=S,window=3,fixed=true);\nmi;\n// output: [[00i,00i,-1],[00i,-1,3],[-1,3,-4],[3,-4,0],[-4,0,5],[0,5,10],[5,10,9],[10,9,7]]\n    \n// get the value of the first element in each window\nm[0]\n// output: [-1,-1,-1,3,-4,0,5,10]\n\nmi[0]\n// output: [,,-1,3,-4,0,5,10]\n\n// When X is a tuple\ns = [[-1,1], [0], [3], [5,6], [7], [8,9], [10,13]]\nm1 = movingWindowData(X=s,window=3);\nm2;\n// output: [[[-1,1]], [[-1,1], [0]], [[-1,1], [0], [3]], [[0], [3], [5,6]], [[3], [5,6], [7]], [[5,6], [7], [8,9]], [[7], [8,9], [10,13]]]\n\n// When X is an array vector\na = array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8, 9 10]);\nm2 = movingWindowData(X=a,window=3);\nm2;\n// output: [[1,2,3], [[1,2,3], [4,5]], [[1,2,3], [4,5], [6,7,8]], [[4,5], [6,7,8], [9,10]]]\n\n\n// Get the data with a sliding window of length 5 in the reactive state engine\nn = 100\nDateTime = 2023.01.01T09:00:00 + rand(10000, n).sort!()\nSecurityID = take(`600021`600022`600023`600024`600025, n)\nPrice = 1.0 + rand(1.0, n) \nt = table(1:0, `DateTime`SecurityID`Price, [TIMESTAMP, SYMBOL, DOUBLE])\ntableInsert(t, DateTime, SecurityID, Price)\noutput = table(100:0, `SecurityID`DateTime`PriceNew, [SYMBOL, DATETIME, DOUBLE[]])\n\nengine = createReactiveStateEngine(name=\"rseEngine\", metrics=[<DateTime>, <movingWindowData(Price,5)>], dummyTable=t, outputTable=output, keyColumn=`SecurityID, keepOrder=true)\nengine.append!(t)\ndropStreamEngine(`rseEngine)\n```\n\n"
    },
    "movingWindowIndex": {
        "url": "https://docs.dolphindb.com/en/Functions/m/movingWindowIndex.html",
        "signatures": [
            {
                "full": "movingWindowIndex(X, window, [fixed=false])",
                "name": "movingWindowIndex",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[fixed=false]",
                        "name": "fixed",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [movingWindowIndex](https://docs.dolphindb.com/en/Functions/m/movingWindowIndex.html)\n\n\n\n#### Syntax\n\nmovingWindowIndex(X, window, \\[fixed=false])\n\n#### Details\n\nReturns the elements of *X* within a sliding window.\n\n#### Parameters\n\n**X** is a vector (including tuple and array vector).\n\n**window** is an integer no less than 2 indicating the window size.\n\n**fixed** is a Boolean value, indicating whether the length of each row in the output array vector is fixed to be *window*. The default value is false. When *fixed* = true, all rows are of the same length. For the first (*window* - 1) windows, the indices of missing elements are filled with null values.\n\n#### Returns\n\nReturn an array vector indicating the indices of the elements of *X* within each sliding window.\n\n#### Examples\n\n```\nS = 1 2 3 4 5 6 7 8 9 0;\nm = movingWindowIndex(X=S,window=3);\nm;\n// output: [[0],[0,1],[0,1,2],[1,2,3],[2,3,4],[3,4,5],[4,5,6],[5,6,7],[6,7,8],[7,8,9]]\n\nmi = movingWindowIndex(X=S,window=3,fixed=true);\nmi;\n// output: [[,,0],[,0,1],[0,1,2],[1,2,3],[2,3,4],[3,4,5],[4,5,6],[5,6,7],[6,7,8],[7,8,9]]\n\n// obtain the first element from each window\nS[m[0]]\n// output: [1,1,1,2,3,4,5,6,7,8]\n\nS[mi[0]]\n// output: [,,1,2,3,4,5,6,7,8]\n\n\ns = [[-1,1], [0], [3], [5,6], [7], [8,9], [10,13]]\nm = movingWindowIndex(X=s,window=3);\nm;\n// output: [[0], [0,1], [0,1,2], [1,2,3], [2,3,4], [3,4,5], [4,5,6]]\n```\n"
    },
    "mpercentile": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mpercentile.html",
        "signatures": [
            {
                "full": "mpercentile(X, percent, window, [interpolation='linear'], [minPeriods])",
                "name": "mpercentile",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "percent",
                        "name": "percent"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[interpolation='linear']",
                        "name": "interpolation",
                        "optional": true,
                        "default": "'linear'"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mpercentile](https://docs.dolphindb.com/en/Functions/m/mpercentile.html)\n\n\n\n#### Syntax\n\nmpercentile(X, percent, window, \\[interpolation='linear'], \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the percentile rank of each element of *X* in a sliding window.\n\n#### Parameters\n\n**percent** is an integer or floating value between 0 and 100.\n\n**interpolation** is a string indicating the interpolation method to use if the specified percentile is between two elements in *X* (assuming the ith and (i+1)th element in the sorted *X*) . It can take the following values:\n\n* 'linear': Return ![](https://docs.dolphindb.com/en/images/linear.png), where ![](https://docs.dolphindb.com/en/images/fraction.png)\n\n* 'lower': Return ![](https://docs.dolphindb.com/en/images/lower.png)\n\n* 'higher': Return ![](https://docs.dolphindb.com/en/images/higher.png)\n\n* 'nearest': Return ![](https://docs.dolphindb.com/en/images/nearest.png) that is closest to the specified percentile\n\n* 'midpoint': Return ![](https://docs.dolphindb.com/en/images/midpoint.png)\n\nThe default value of *interpolation* is 'linear'.\n\n**minPeriods** is a positive integer indicating the minimum number of non-NULL valid observations in a window required to produce a result (otherwise the result is NULL).\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nx=2 1 3 7 6 5 4;\nmpercentile(x, percent=50, window=3);\n// output: [,,2,3,6,6,5]\n\nmpercentile(x, percent=25, window=3, interpolation=\"lower\");\n// output: [,,1,1,3,5,4]\n\nmpercentile(x, percent=75, window=3, interpolation=\"higher\")\n// output: [,,3,7,7,7,6]\n\nmpercentile(x, percent=5, window=3, interpolation=\"nearest\")\n// output: [,,1,1,3,5,4]\n\nmpercentile(x, percent=15, window=3, interpolation=\"midpoint\")\n// output: [,,1.5,2,4.5,5.5,4.5]\n\nmpercentile(x, percent=50, window=3, interpolation=\"linear\", minPeriods=1);\n// output: [2,1.5,2,3,6,6,5]\n\nm=matrix(2 1 3 7 6 5 4, 1..7);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 2  | 1  |\n| 1  | 2  |\n| 3  | 3  |\n| 7  | 4  |\n| 6  | 5  |\n| 5  | 6  |\n| 4  | 7  |\n\n```\nmpercentile(m, percent=50, window=3, interpolation=\"linear\", minPeriods=1);\n```\n\n| #0  | #1  |\n| --- | --- |\n| 2   | 1   |\n| 1.5 | 1.5 |\n| 2   | 2   |\n| 3   | 3   |\n| 6   | 4   |\n| 6   | 5   |\n| 5   | 6   |\n\n```\nm.rename!(date(2020.09.08)+1..7, `A`B)\nm.setIndexedMatrix!()\nmpercentile(m, percent=50, window=3d, interpolation=\"linear\", minPeriods=1);\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.09 | 2    | 1    |\n| 2020.09.10 | 1.5  | 1.5  |\n| 2020.09.11 | 2    | 2    |\n| 2020.09.12 | 3    | 3    |\n| 2020.09.13 | 6    | 4    |\n| 2020.09.14 | 6    | 5    |\n| 2020.09.15 | 5    | 6    |\n\n```\nmpercentile(m, percent=50, window=1w, interpolation=\"linear\", minPeriods=1);\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.09.09 | 2    | 1    |\n| 2020.09.10 | 1.5  | 1.5  |\n| 2020.09.11 | 2    | 2    |\n| 2020.09.12 | 2.5  | 2.5  |\n| 2020.09.13 | 3    | 3    |\n| 2020.09.14 | 4    | 3.5  |\n| 2020.09.15 | 4    | 4    |\n\nRelated functions: [percentile](https://docs.dolphindb.com/en/Functions/p/percentile.html)\n"
    },
    "mpercentileTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mpercentileTopN.html",
        "signatures": [
            {
                "full": "mpercentileTopN(X, S, percent, window, top, [interpolation], [ascending], [tiesMethod='oldest'])",
                "name": "mpercentileTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "percent",
                        "name": "percent"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[interpolation]",
                        "name": "interpolation",
                        "optional": true
                    },
                    {
                        "full": "[ascending]",
                        "name": "ascending",
                        "optional": true
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mpercentileTopN](https://docs.dolphindb.com/en/Functions/m/mpercentileTopN.html)\n\n#### Syntax\n\nmpercentileTopN(X, S, percent, window, top, \\[interpolation], \\[ascending], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\n* When *X*is a vector, within a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the moving percentile rank of the first *top* elements.\n\n* When *X*is a matrix or table, conduct the aforementioned calculation within each column of *X*. The result is a matrix/table with the same shape as *X*.\n\n#### Parameters\n\n**X** is a numeric vector, matrix or table.\n\n**S** is a numeric/temporal vector, matrix or table, based on which *X* are sorted.\n\n**percent** is an integer or floating value between 0 and 100.\n\n**interpolation** (optional) is a string indicating the interpolation method to use if the specified percentile is between two elements in *X* (assuming the ith and (i+1)th element in the sorted *X*) . It can take the following values:\n\n* 'linear' (default): Return Xi+ (Xi+1 - Xi)\\* fraction, where ![](https://docs.dolphindb.com/en/images/fraction.png)\n\n* 'lower': Return Xi\n\n* 'higher': Return Xi+1\n\n* 'nearest': Return Xi+1 or Xithat is closest to the specified percentile\n\n* 'midpoint': Return (Xi+1 + Xi)/2\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\nUsing IBM stock as an example, simulate trading prices and volumes for six consecutive trading days:\n\n```\nsymbol = take(`IBM, 6)\ntradeDate = 2024.01.02 2024.01.03 2024.01.04 2024.01.05 2024.01.08 2024.01.09\ntradePrice = [182.5, 183.8, 181.2, 184.6, 183.1, 185.0]\ntradeVolume = [520, 860, 610, 940, 650, 880]\n\nstockDaily = table(symbol, tradeDate, tradePrice, tradeVolume)\nstockDaily;\n```\n\nOutput:\n\n| symbol | tradeDate  | tradePrice | tradeVolume |\n| ------ | ---------- | ---------- | ----------- |\n| IBM    | 2024.01.02 | 182.5      | 520         |\n| IBM    | 2024.01.03 | 183.8      | 860         |\n| IBM    | 2024.01.04 | 181.2      | 610         |\n| IBM    | 2024.01.05 | 184.6      | 940         |\n| IBM    | 2024.01.08 | 183.1      | 650         |\n| IBM    | 2024.01.09 | 185        | 880         |\n\nExample 1: Over the most recent four trading days, select the top two trading days by trading volume and calculate the 50th percentile of trading prices for each window:\n\n```\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=50, window=4, top=2, ascending=false)\n// Output: [182.5, 183.15, 182.5, 184.2, 184.2, 184.8]\n```\n\n* For the data on 2024.01.09, within the most recent four-day window:\n\n  * tradePrice=\\[181.2, 184.6, 183.1, 185.0]\n  * tradeVolume=\\[610, 940, 650, 880]\n* Because *ascending*=false, trading volumes are sorted in descending order, and the top two trading days by trading volume are selected. Their corresponding trading prices are 184.6 and 185.0; The 50th percentile of these two prices is 184.8.\n\nExample 2: Set *interpolation* to determine how the value is chosen when the quantile falls between two observations.\n\nUsing the same trading prices and volumes, over the most recent four trade days, select the bottom two trading days by trading volume and calculate the 20th percentile of trading prices for each window:\n\n```\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=20, window=4, top=2, interpolation=\"lower\")\n// Output: [182.5, 182.5, 181.2, 181.2, 181.2, 181.2]\n​\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=20, window=4, top=2, interpolation=\"higher\")\n// Output: [182.5, 183.8, 182.5, 182.5, 183.1, 183.1]\n​\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=20, window=4, top=2, interpolation=\"nearest\")\n// Output: [182.5, 182.5, 181.2, 181.2, 181.2, 181.2]\n​\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=20, window=4, top=2, interpolation=\"midpoint\")\n// Output: [182.5, 183.15, 181.85, 181.85, 182.15, 182.15]\n​\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=20, window=4, top=2, interpolation=\"linear\")\n// Output: [182.5, 182.76, 181.46, 181.46, 181.58, 181.58]\n```\n\nUsing the data on 2024.01.09 as an example, with the default ascending order, the bottom two trading days by trading volume are selected, and their corresponding trading prices are 181.2 and 183.1:\n\n* *interpolation*=\"lower\": Takes the lower price, 181.2;\n* *interpolation*=\"higher\": Takes the higher price, 183.1;\n* *interpolation*=\"nearest\": Takes the price nearest to the quantile, 181.2;\n* *interpolation*=\"midpoint\": Takes the midpoint of the two values, 182.15;\n* *interpolation*=\"linear\": Uses linear interpolation based on position, substituting the data into Xi+ ( Xi+1 - Xi ) \\* fraction to calculate 181.2 + (183.1 - 181.2) \\* 0.2 = 181.58.\n\nExample 3: Set *tiesMethod* to determine how samples are selected when there are ties at the cutoff.\n\nThe following code simulates data for NVDA stock:\n\n```\nsymbol = take(`NVDA, 6)\ntradeDate = 2024.02.01 2024.02.02 2024.02.05 2024.02.06 2024.02.07 2024.02.08\ntradePrice = [431.2, 433.5, 432.1, 434.8, 433.0, 435.2]\ntradeVolume = [700, 900, 900, 900, 760, 900]\n\ntieCase = table(symbol, tradeDate, tradePrice, tradeVolume)\ntieCase;\n```\n\nOutput:\n\n| symbol | tradeDate  | tradePrice | tradeVolume |\n| ------ | ---------- | ---------- | ----------- |\n| NVDA   | 2024.02.01 | 431.2      | 700         |\n| NVDA   | 2024.02.02 | 433.5      | 900         |\n| NVDA   | 2024.02.05 | 432.1      | 900         |\n| NVDA   | 2024.02.06 | 434.8      | 900         |\n| NVDA   | 2024.02.07 | 433.0      | 760         |\n| NVDA   | 2024.02.08 | 435.2      | 900         |\n\nOver the most recent five trading days, select the top two trading days by trading volume, calculate the 50th percentile of trading prices for each window, and specify different *tiesMethod* values:\n\n```\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=50, window=5, top=2, ascending=false, tiesMethod=\"oldest\")\n// Output: [431.2, 432.35, 432.8, 432.8, 432.8, 432.8]\n\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=50, window=5, top=2, ascending=false, tiesMethod=\"latest\")\n// Output: [431.2, 432.35, 432.8, 433.45, 433.45, 435.0]\n\nmpercentileTopN(X=tradePrice, S=tradeVolume, percent=50, window=5, top=2, ascending=false, tiesMethod=\"all\")\n// Output: [431.2, 432.35, 432.8, 433.5, 433.5, 434.15]\n```\n\nUsing the data on 2024.02.08 as an example, tradeVolume=\\[900, 900, 900, 760, 900] in the most recent five-day window. Four trading days are tied for the highest trading volume of 900, but *top*=2 requires that only the top two ranks be retained:\n\n* *tiesMethod*=\"oldest\": Takes the two highest-volume trading days that entered the window earliest, with corresponding prices of 433.5 and 432.1;\n* *tiesMethod*=\"latest\": Takes the two highest-volume trading days that entered the window latest, with corresponding prices of 434.8 and 435.2;\n* *tiesMethod*=\"all\": Retains all trading days tied for the highest trading volume, with corresponding prices of 433.5, 432.1, 434.8, and 435.2.\n\n"
    },
    "mprod": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mprod.html",
        "signatures": [
            {
                "full": "mprod(X, window, [minPeriods])",
                "name": "mprod",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mprod](https://docs.dolphindb.com/en/Functions/m/mprod.html)\n\n\n\n#### Syntax\n\nmprod(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving products of *X* in a sliding window.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 2 1 3 7 6 5 4\nY = 2 1 3 NULL 6 5 4\n\nmprod(X, 3);\n// output: [,,6,21,126,210,120]\n\nmprod(Y, 3);\n// output: [,,6,3,18,30,120]\n\nmprod(Y, 3, minPeriods=1);\n// output: [2,2,6,3,18,30,120]\n```\n\n```\nm=matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(date(2020.04.06)+1..6, `col1`col2)\nm.setIndexedMatrix!()\nmprod(m, 3d)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.04.07 | 1    | 9    |\n| 2020.04.08 | 1    | 9    |\n| 2020.04.09 | 4    | 9    |\n| 2020.04.10 | 4    | 10   |\n| 2020.04.11 | 32   | 10   |\n| 2020.04.12 | 48   | 20   |\n\n```\nmprod(m, 1w)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.04.07 | 1    | 9    |\n| 2020.04.08 | 1    | 9    |\n| 2020.04.09 | 4    | 9    |\n| 2020.04.10 | 4    | 90   |\n| 2020.04.11 | 32   | 90   |\n| 2020.04.12 | 192  | 180  |\n\nRelated functions: [prod](https://docs.dolphindb.com/en/Functions/p/prod.html)\n"
    },
    "mr": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mr.html",
        "signatures": [
            {
                "full": "mr(ds, mapFunc, [reduceFunc], [finalFunc], [parallel=true])",
                "name": "mr",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "mapFunc",
                        "name": "mapFunc"
                    },
                    {
                        "full": "[reduceFunc]",
                        "name": "reduceFunc",
                        "optional": true
                    },
                    {
                        "full": "[finalFunc]",
                        "name": "finalFunc",
                        "optional": true
                    },
                    {
                        "full": "[parallel=true]",
                        "name": "parallel",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [mr](https://docs.dolphindb.com/en/Functions/m/mr.html)\n\n\n\n#### Syntax\n\nmr(ds, mapFunc, \\[reduceFunc], \\[finalFunc], \\[parallel=true])\n\n#### Details\n\n`mr` is a general-purpose DolphinDB function for performing MapReduce computations. When data is distributed across multiple data sources, you can first compute each data source separately, then merge the partial results, and finally apply any additional processing you need.\n\n##### What Is MapReduce\n\nMapReduce has **two core phases**. For a more detailed introduction, see [What is MapReduce](https://www.ibm.com/think/topics/mapreduce):\n\n1. map: Executes the same computation logic on each data source separately.\n2. reduce: Merges multiple map results step by step into a single result.\n\n**Note:** In addition to these two core phases, the `mr` function supports a third phase, final, which uses the *finalFunc* parameter to perform final processing on the merged result and generate the desired output.\n\n##### Applicable Scenarios\n\n* Data is spread across multiple data sources, such as multiple partitions or multiple tables.\n* Each dataset can be computed independently first and then aggregated.\n* The computation logic is the same for each individual data source.\n* You want to improve processing efficiency through parallel computing.\n\n#### Parameters\n\n**ds**: A list of data sources. This parameter must be a tuple, and each element in the tuple must be a data source object. Even if there is only one data source, you must still set it as a tuple.\n\n**mapFunc**: The computation function applied to each data source. It takes only one parameter: the data object extracted from the current data source list and made available for computation. If you want to pass multiple parameters to the map function, use [partial application](https://docs.dolphindb.com/en/Programming/FunctionalProgramming/PartialApplication.html) to transform them into a single parameter. The map function is called once for each data source. It returns either a regular object (scalar, pair, vector, matrix, table, set, or dictionary) or a tuple containing multiple regular objects.\n\n**reduceFunc**: Optional. A binary function used to merge two return values. These two return values may both come from the map function, or one of them may be the return value from the previous reduce function call. The system continues merging the result from the previous step with the return value of the next map function until it has merged the return values from all map functions.\n\n**finalFunc**: Optional. A function that generates the final output. It takes only one parameter: the output of the last reduce function call. If you specify a final function but do not specify a reduce function, the system first combines all map function results into a tuple, and then calls the final function with that tuple as input.\n\n**parallel**: Optional. Specifies whether to execute the map function in parallel. The default value is true. In general, enabling parallel execution can improve computation speed, but you may want to set this parameter to false in the following cases:\n\n* A single map computation uses a very large amount of memory.\n* Running multiple threads concurrently may cause thread-safety issues. For example, errors may occur if multiple threads write to the same file at the same time.\n\n#### Returns\n\n* If you specify *finalFunc*, mr returns the result of *finalFunc*.\n* If you do not specify *finalFunc* but do specify *reduceFunc*, mr returns the final result of *reduceFunc*.\n* If neither is specified, mr returns the aggregated results of all *mapFunc* calls as a tuple.\n\n#### Examples\n\nExample 1: Compute the global mean and variance across multiple partitions.\n\n```\n// Create a catalog and switch to it\ncreateCatalog\\(\"demo\"\\)\ngo\nuse catalog demo\n// Create a DFS database and a partitioned table in the current catalog\ncreate database mr\\_demo partitioned by VALUE\\(2024.01.01 2024.01.02 2024.01.03\\), engine='OLAP'\ngo\ncreate table mr\\_demo.pt \\(\n    date DATE,\n    id INT,\n    value DOUBLE\n\\)\npartitioned by date\ndb = database\\(\"dfs://mrDemo\", VALUE, 2024.01.01 2024.01.02 2024.01.03\\)\nschemaTb = table\\(1:0, \\`date\\`id\\`value, \\[DATE, INT, DOUBLE\\]\\)\npt = db.createPartitionedTable\\(schemaTb, \\`pt, \\`date\\)\n// Insert test data\ndata = table(\n    2024.01.01 2024.01.01 2024.01.01 2024.01.02 2024.01.02 2024.01.03 2024.01.03 as date,\n    1 2 3 4 5 6 7 as id,\n    10.0 20.0 30.0 40.0 50.0 60.0 70.0 as value\n)\ndemo.mr\\_demo.pt.append!\\(data\\)\npt.append!\\(data\\)\n// Use sqlDS to convert the query into a list of data sources\nds = sqlDS(<select * from mr_demo.pt>)\n\n// map: Computes local statistics for each partition\ndef statsMap(table){\n    x = table.value // Get the values from the value column of the table\n    return [x.size(), sum(x), sum(pow(x, 2.0))] // Compute the row count, the sum of the values, and the sum of squares of the values\n}\n\n// reduce: Adds two local statistics item by item\ndef statsReduce(x, y){\n    return [x[0] + y[0], x[1] + y[1], x[2] + y[2]]\n}\n\n// final: Computes the global mean and variance from the aggregated statistics\ndef statsFinal(result){\n    count = result[0]\n    totalSum = result[1]\n    totalSquares = result[2]\n    avg = totalSum / count\n    variance = totalSquares / count - avg * avg\n    return table(avg as mean, variance as variance)\n}\n\n// Call mr\nresult = mr(ds, statsMap, statsReduce, statsFinal)\n\n// View the result\nresult\n```\n\nThe output is as follows:\n\n| mean | variance |\n| ---- | -------- |\n| 40   | 400      |\n\nExample 2: Compute least-squares linear regression across multiple data sources.\n\nLinear regression predicts a dependent variable from one or more independent variables. Let the dependent variable be y and the independent-variable matrix be X. The goal of ordinary least squares is to find the regression coefficient beta, computed as follows:\n\n```\nbeta = (X^T X)^(-1) X^T y\n```\n\nTherefore, the key to completing the regression is to first obtain X^T X and X^T y for the entire dataset. When data is distributed across multiple data sources, you can first compute the local Xi^T Xi and Xi^T yi on each data source, and then aggregate them into the global result. Sample code:\n\n```\ndef myOLSMap(table, yColName, xColNames, intercept){\n  if(intercept)\n      x = matrix(take(1.0, table.rows()), table[xColNames])\n  else\n      x = matrix(table[xColNames])\n  xt = x.transpose();\n  return xt.dot(x), xt.dot(table[yColName])\n}\n\ndef myOLSFinal(result){\n  xtx = result[0]\n  xty = result[1]\n  return xtx.inv().dot(xty)[0]\n}\n\ndef myOLSEx(ds, yColName, xColNames, intercept){\n  return mr(ds, myOLSMap{, yColName, xColNames, intercept}, +, myOLSFinal)\n}\n```\n\n* **map**: `myOLSMap` performs the local computation for a single data source. Its inputs are:\n\n  * *table*: The data table corresponding to the current data source.\n  * *yColName*: The name of the dependent-variable column.\n  * *xColNames*: Independent variable column names.\n  * *intercept*: Specifies whether to include an intercept term.\n    This function first constructs the local independent variable matrix Xi, then returns the local statistics for the current data source: Xi^T Xi and Xi^T yi.\n\n* **reduce**: Uses `+` as the reduce function to add the results from individual data sources item by item.\n  * For example, if two partitions return (X1^T X1, X1^T y1) and (X2^T X2, X2^T y2), the reduce step produces (X1^T X1 + X2^T X2, X1^T y1 + X2^T y2).\n  * It then merges this result with the next partition result and ultimately produces the global (X^T X, X^T y).\n\n* **final**: `myOLSFinal` processes the aggregated result from the reduce phase and computes the regression coefficients using the least squares formula.\n  * *xtx*: The aggregated X^T X.\n  * *xty*: The aggregated X^T y.\n  * `xtx.inv()`: The inverse of the matrix *xtx*.\n  * `xtx.inv().dot(xty)`: Matrix multiplication, corresponding to the formula `(X^T X)^(-1) X^T y`.\n\n* `myOLSEx` wraps the `mr` function and runs the computation through the map → reduce → final workflow.\n\n**Note:** As a commonly used analysis tool, distributed least squares linear regression is already implemented in the [olsEx](https://docs.dolphindb.com/en/Functions/o/olsEx.html) function.\n"
    },
    "mrank": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mrank.html",
        "signatures": [
            {
                "full": "mrank(X, ascending, window, [ignoreNA=true], [tiesMethod='min'], [percent=false], [minPeriods])",
                "name": "mrank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "ascending",
                        "name": "ascending"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='min']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'min'"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mrank](https://docs.dolphindb.com/en/Functions/m/mrank.html)\n\n\n\n#### Syntax\n\nmrank(X, ascending, window, \\[ignoreNA=true], \\[tiesMethod='min'], \\[percent=false], \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the rank of each element of *X* in a sliding window.\n\n#### Parameters\n\n**ascending** is a Boolean value indicating whether the sorting direction is ascending.\n\n**ignoreNA** is a Boolean value indicating whether null values are ignored in ranking. The default value is true. If null values participate in the ranking, they are ranked the lowest.\n\n**tiesMethod** is a string indicating how to rank the group of records with the same value (i.e., ties):\n\n* 'min': lowest rank of the group\n\n* 'max': highest rank of the group\n\n* 'average': average rank of the group\n\n**percent** is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n#### Returns\n\nReturns a vector, matrix, or table depending on the form of input *X*.\n\n* When `percent = false`, returns an integer value indicating the element's rank within the window (starting from 0).\n* When `percent = true`, returns a floating-point value indicating the percentage, ranging from 0 to 1.\n\n#### Examples\n\n```\nX = 3 2 4 4 4 NULL 1\n\nmrank(X, ascending=false, window=3, ignoreNA=true);\n// output: [,,0,0,0,,1]\n\nmrank(X, ascending=false, window=3, ignoreNA=true, minPeriods=2);\n// output: [,1,0,0,0,,1]\n\nmrank(X, ascending=false, window=3, ignoreNA=false, tiesMethod='max');\n// output: [,,0,1,2,2,1]\n\nmrank(X, ascending=false, window=3, ignoreNA=false, tiesMethod='max', minPeriods=2);\n// output: [,1,0,1,2,2,1]\n\nmrank(X, ascending=false, window=3, ignoreNA=false, tiesMethod='min');\n// output: [,,0,0,0,2,1]\n\nmrank(X, ascending=false, window=3, ignoreNA=false, tiesMethod='min', minPeriods=3);\n// output: [,,0,0,0,,]\n\nmrank(X, ascending=false, window=3, ignoreNA=false, tiesMethod='average');\n// output: [,,0,0.5,1,2,1]\n\nmrank(X, ascending=false, window=3, ignoreNA=false, tiesMethod='average', minPeriods=2);\n// output: [,1,0,0.5,1,2,1]\n```\n\n```\nm=matrix(1 2 5 3 4, 5 4 1 2 3);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 5  |\n| 2  | 4  |\n| 5  | 1  |\n| 3  | 2  |\n| 4  | 3  |\n\n```\nmrank(m, true, 3);\n```\n\n| #0 | #1 |\n| -- | -- |\n|    |    |\n|    |    |\n| 2  | 0  |\n| 1  | 1  |\n| 1  | 2  |\n\n```\nmrank(m, true, 3, percent=true);\n```\n\n| #0     | #1     |\n| ------ | ------ |\n|        |        |\n|        |        |\n| 1      | 0.3333 |\n| 0.6667 | 0.6667 |\n| 0.6667 | 1      |\n\nWhen window is the time offset of DURATION type:\n\n```\nm=matrix([1 4 2 4 5 7 4 3 2 5])\nm.rename!(2020.01.01..2020.01.10, [`A])\nm.setIndexedMatrix!()\nmrank(m, window=3d, percent = 1)\n```\n\n| label      | A      |\n| ---------- | ------ |\n| 2020.01.01 | 1      |\n| 2020.01.02 | 1      |\n| 2020.01.03 | 0.6667 |\n| 2020.01.04 | 0.6667 |\n| 2020.01.05 | 1      |\n| 2020.01.06 | 1      |\n| 2020.01.07 | 0.3333 |\n| 2020.01.08 | 0.3333 |\n| 2020.01.09 | 0.3333 |\n| 2020.01.10 | 1      |\n\n```\nmrank(m, window=1w, percent = 1)\n```\n\n| label      | A      |\n| ---------- | ------ |\n| 2020.01.01 | 1      |\n| 2020.01.02 | 1      |\n| 2020.01.03 | 0.6667 |\n| 2020.01.04 | 0.75   |\n| 2020.01.05 | 1      |\n| 2020.01.06 | 1      |\n| 2020.01.07 | 0.4286 |\n| 2020.01.08 | 0.2857 |\n| 2020.01.09 | 0.1429 |\n| 2020.01.10 | 0.7143 |\n\nRelated functions: [rank](https://docs.dolphindb.com/en/Functions/r/rank.html)\n"
    },
    "mskew": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mskew.html",
        "signatures": [
            {
                "full": "mskew(X, window, [biased=true], [minPeriods])",
                "name": "mskew",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mskew](https://docs.dolphindb.com/en/Functions/m/mskew.html)\n\n\n\n#### Syntax\n\nmskew(X, window, \\[biased=true], \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving skewness of *X* in a sliding window.\n\n#### Parameters\n\n**biased** is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nmskew(1 2 3 10 100 4 3, 3);\n// output: [,,0,0.665469,0.693810, 0.697217,0.706851]\n```\n\n```\nm=matrix(1 6 2 9 4 5 100, 100 11 12 18 23 21 10);\nm;\n```\n\n| #0  | #1  |\n| --- | --- |\n| 1   | 100 |\n| 6   | 11  |\n| 2   | 12  |\n| 9   | 18  |\n| 4   | 23  |\n| 5   | 21  |\n| 100 | 10  |\n\n```\nmskew(m,3);\n```\n\n| #0                 | #1                 |\n| ------------------ | ------------------ |\n|                    |                    |\n|                    |                    |\n| 0.595170064139498  | 0.706802122668126  |\n| -0.172800544078651 | 0.65201211704403   |\n| 0.470330460336986  | -0.110780117654834 |\n| 0.595170064139498  | -0.239063146929565 |\n| 0.706845142811354  | -0.642723256123865 |\n\n```\nm.rename!(date(2020.04.06)+1..7, `col1`col2)\nm.setIndexedMatrix!()\nmskew(m, 3d)\n```\n\n| label      | col1    | col2    |\n| ---------- | ------- | ------- |\n| 2020.04.07 |         |         |\n| 2020.04.08 | 0       | 0       |\n| 2020.04.09 | 0.5952  | 0.7068  |\n| 2020.04.10 | -0.1728 | 0.652   |\n| 2020.04.11 | 0.4703  | -0.1108 |\n| 2020.04.12 | 0.5952  | -0.2391 |\n| 2020.04.13 | 0.7068  | -0.6427 |\n\n```\nmskew(m, 1w)\n```\n\n| label      | col1   | col2   |\n| ---------- | ------ | ------ |\n| 2020.04.07 |        |        |\n| 2020.04.08 | 0      | 0      |\n| 2020.04.09 | 0.5952 | 0.7068 |\n| 2020.04.10 | 0.2743 | 1.1373 |\n| 2020.04.11 | 0.4079 | 1.4398 |\n| 2020.04.12 | 0.3298 | 1.7107 |\n| 2020.04.13 | 2.0188 | 1.9363 |\n\nRelated function: [skew](https://docs.dolphindb.com/en/Functions/s/skew.html)\n"
    },
    "mskewTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mskewTopN.html",
        "signatures": [
            {
                "full": "mskewTopN(X, S, window, top, [biased=true], [ascending=true], [tiesMethod='latest'])",
                "name": "mskewTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [mskewTopN](https://docs.dolphindb.com/en/Functions/m/mskewTopN.html)\n\n\n\n#### Syntax\n\nmskewTopN(X, S, window, top, \\[biased=true], \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the moving skewness of the first *top* elements.\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX=1 2 3 10 100 4 3\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmskewTopN(X, S, 6, 4)\n// output: [,0,0,1.01,1.13,0.79,1.08]\n\nX = matrix(1..10, 11..20)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29 2022.01.20 2022.01.23 2022.01.22 2022.01.24 2022.01.24, NULL 2022.02.03 2022.01.23 2022.04.06 NULL 2022.02.03 2022.02.03 2022.02.05 2022.02.08 2022.02.03)\nmskewTopN(X, S, 6, 4)\n\n/* output:\ncol1  col2\n\n0\n0       0\n0       0\n0.4347  0\n-0.278  0.4347\n-0.4347 0\n0       -0.6872\n0       0\n0       0.4347\n*/\n\nsymbol = [\"A\",\"A\",\"A\",\"B\",\"A\",\"A\",\"B\",\"A\",\"A\",\"B\",\"B\",\"B\",\"A\",\"B\",\"A\",\"B\",\"B\",\"A\",\"B\",\"A\"]\ntime = temporalAdd(2023.07.03T09:30:00.000,[10,20,40,60,70,80,90,140,160,170,180,190,200,210,220,230,250,360,390,400],\"ms\")\nprice = [28.11,28.25,28.44,52.31,28.98,28.89,52.22,28.16,28.52,52.62,52.56,52.2,28.01,52.43,28.57,52.42,52.19,28.16,52.84,28.18]\nqty = [1900,3300,100,3000,3500,800,3400,4400,3900,4600,2200,2100,2300,4100,400,300,3100,2500,1000,2700]\nBSFlag = [1,0,1,1,0,0,1,0,0,0,0,1,0,1,0,0,1,1,1,1]\nt = table(time, symbol, price, qty, BSFlag)\nselect time,symbol,BSFlag,mskewTopN(price, qty, 8, 5) as mskewTop5Price from t context by symbol,BSFlag\n```\n\n| time                    | symbol | BSFlag | mskewTop5Price |\n| ----------------------- | ------ | ------ | -------------- |\n| 2023.07.03T09:30:00.020 | A      | 0      |                |\n| 2023.07.03T09:30:00.070 | A      | 0      | 0              |\n| 2023.07.03T09:30:00.080 | A      | 0      | -0.6667        |\n| 2023.07.03T09:30:00.140 | A      | 0      | 0              |\n| 2023.07.03T09:30:00.160 | A      | 0      | 0.0904         |\n| 2023.07.03T09:30:00.200 | A      | 0      | -0.0986        |\n| 2023.07.03T09:30:00.220 | A      | 0      | -0.1794        |\n| 2023.07.03T09:30:00.010 | A      | 1      |                |\n| 2023.07.03T09:30:00.040 | A      | 1      | 0              |\n| 2023.07.03T09:30:00.360 | A      | 1      | 0.6448         |\n| 2023.07.03T09:30:00.400 | A      | 1      | 1.0153         |\n| 2023.07.03T09:30:00.170 | B      | 0      |                |\n| 2023.07.03T09:30:00.180 | B      | 0      | 0              |\n| 2023.07.03T09:30:00.230 | B      | 0      | -0.4451        |\n| 2023.07.03T09:30:00.060 | B      | 1      |                |\n| 2023.07.03T09:30:00.090 | B      | 1      | 0              |\n| 2023.07.03T09:30:00.190 | B      | 1      | 0.6156         |\n| 2023.07.03T09:30:00.210 | B      | 1      | 0.5605         |\n| 2023.07.03T09:30:00.250 | B      | 1      | 0.8565         |\n| 2023.07.03T09:30:00.390 | B      | 1      | 1.3966         |\n\nRelated function: [mskew](https://docs.dolphindb.com/en/Functions/m/mskew.html)\n"
    },
    "mslr": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mslr.html",
        "signatures": [
            {
                "full": "mslr(Y, X, window, [minPeriods])",
                "name": "mslr",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mslr](https://docs.dolphindb.com/en/Functions/m/mslr.html)\n\n\n\n#### Syntax\n\nmslr(Y, X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nConduct the simple least-squares regressions of *Y* on *X* in a sliding window.\n\nThe result is a tuple of two vectors. The first vector is the intercepts and the second vector is the coefficient estimates of *X*.\n\n#### Returns\n\nReturns a tuple containing two elements: the intercept (DOUBLE) and the slope (DOUBLE).\n\n#### Examples\n\n```\nY=1 4 3 9 5 4\nX=12 31 29 88 67 76\nmslr(Y,X,4);\n// output: ([,,,0.177052,0.712557,0.15],[,,,0.101824,0.084418,0.078462])\n```\n"
    },
    "mstd": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mstd.html",
        "signatures": [
            {
                "full": "mstd(X,window,[minPeriods])",
                "name": "mstd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mstd](https://docs.dolphindb.com/en/Functions/m/mstd.html)\n\n\n\n#### Syntax\n\nmstd(X,window,\\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the standard deviation of *X* in a sliding window.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```language-python\nmstd(1 2 5 4 3, 3);\n// output: [,,2.081666,1.527525,1]\n\nmstd(1 2 5 4 3, 3, 2);\n// output: [,0.707107,2.081666,1.527525,1]\n```\n\n```language-python\nm=matrix(1 6 2 9 4 5, 11 12 18 23 21 10);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 11 |\n| 6  | 12 |\n| 2  | 18 |\n| 9  | 23 |\n| 4  | 21 |\n| 5  | 10 |\n\n```language-python\nmstd(m,3);\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n|                   |                   |\n| 2.645751311064591 | 3.78593889720018  |\n| 3.511884584284247 | 5.507570547286101 |\n| 3.605551275463989 | 2.516611478423591 |\n| 2.645751311064591 | 7                 |\n\n```language-python\nm=matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(date(2020.04.06)+1..6, `col1`col2)\nm.setIndexedMatrix!()\nmstd(m,4d)\n```\n\n| label      | col1   | col2   |\n| ---------- | ------ | ------ |\n| 2020.04.07 |        |        |\n| 2020.04.08 |        |        |\n| 2020.04.09 | 2.1213 |        |\n| 2020.04.10 | 2.1213 | 0.7071 |\n| 2020.04.11 | 2.8284 |        |\n| 2020.04.12 | 2      | 5.6569 |\n\n```language-python\nmstd(m,1w)\n```\n\n| label      | col1   | col2   |\n| ---------- | ------ | ------ |\n| 2020.04.07 |        |        |\n| 2020.04.08 |        |        |\n| 2020.04.09 | 2.1213 |        |\n| 2020.04.10 | 2.1213 | 0.7071 |\n| 2020.04.11 | 3.5119 | 0.7071 |\n| 2020.04.12 | 2.9861 | 4.3589 |\n\nRelated functions: [mmin](https://docs.dolphindb.com/en/Functions/m/mmin.html), [mmax](https://docs.dolphindb.com/en/Functions/m/mmax.html), [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html), [msum](https://docs.dolphindb.com/en/Functions/m/msum.html), [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html)\n"
    },
    "mstdp": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mstdp.html",
        "signatures": [
            {
                "full": "mstdp(X, window, [minPeriods])",
                "name": "mstdp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mstdp](https://docs.dolphindb.com/en/Functions/m/mstdp.html)\n\n\n\n#### Syntax\n\nmstdp(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the population standard deviation of *X* in a sliding window.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nmstdp(1 2 5 4 3, 3);\n// output: [,,1.699673171197595,1.247219128924647,0.816496580927726]\n\nmstdp(1 2 5 4 3, 3, 2);\n// output: [,0.5,1.699673171197595,1.247219128924647,0.816496580927726]\n\nm=matrix(1 6 2 9 4 5, 11 12 18 23 21 10);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 11 |\n| 6  | 12 |\n| 2  | 18 |\n| 9  | 23 |\n| 4  | 21 |\n| 5  | 10 |\n\n```\nmstdp(m,3);\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n|                   |                   |\n| 2.160246899469287 | 3.091206165165233 |\n| 2.867441755680875 | 4.496912521077346 |\n| 2.943920288775949 | 2.054804667656331 |\n| 2.160246899469287 | 5.715476066494082 |\n\n```\nm=matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(date(2020.04.06)+1..6, `col1`col2)\nm.setIndexedMatrix!()\nmstdp(m,4d)\n```\n\n| label      | col1  | col2 |\n| ---------- | ----- | ---- |\n| 2020.04.07 | 0     | 0    |\n| 2020.04.08 | 0     | 0    |\n| 2020.04.09 | 1.5   | 0    |\n| 2020.04.10 | 1.5   | 0.5  |\n| 2020.04.11 | 2     | 0    |\n| 2020.04.12 | 1.633 | 4    |\n\n```\nmstdp(m,1w)\n```\n\n| label      | col1   | col2  |\n| ---------- | ------ | ----- |\n| 2020.04.07 | 0      | 0     |\n| 2020.04.08 | 0      | 0     |\n| 2020.04.09 | 1.5    | 0     |\n| 2020.04.10 | 1.5    | 0.5   |\n| 2020.04.11 | 2.8674 | 0.5   |\n| 2020.04.12 | 2.586  | 3.559 |\n\nRelated function: [mstd](https://docs.dolphindb.com/en/Functions/m/mstd.html)\n"
    },
    "mstdpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mstdpTopN.html",
        "signatures": [
            {
                "full": "mstdpTopN(X, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mstdpTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mstdpTopN](https://docs.dolphindb.com/en/Functions/m/mstdpTopN.html)\n\n\n\n#### Syntax\n\nmstdpTopN(X, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the population standard deviation of the first *top* elements.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 1..7\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmstdTopN(X, S, 4, 2)\n// output: [,0.707106781186548,1.414213562373095,0.707106781186548,0.707106781186548,0.707106781186548,1.414213562373095]\n\nX = NULL 1 2 3 4 NULL 5\nS = 3 5 1 1 5 2 4\nmstdTopN(X, S, 4, 2)\n// output: [,,,0.707106781186548,0.707106781186548,0.707106781186548,]\n\nX = matrix(1..5, 6..10)\nS = 2022.01.01 2022.02.03 2022.01.23 2022.04.06 2021.12.29\nmstdTopN(X, S, 3, 2)\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n| 0.707106781186548 | 0.707106781186548 |\n| 1.414213562373095 | 1.414213562373095 |\n| 0.707106781186548 | 0.707106781186548 |\n| 1.414213562373095 | 1.414213562373095 |\n\n```\nX = matrix(1..5, 6..10)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29,NULL 2022.02.03 2022.01.23 2022.04.06 NULL)\nmstdpTopN(X, S, 3, 2)\n```\n\n| #0     | #1     |\n| ------ | ------ |\n|        |        |\n| 0.7071 |        |\n| 1.4142 | 0.7071 |\n| 0.7071 | 0.7071 |\n| 1.4142 | 0.7071 |\n\nRelated function: [mstdp](https://docs.dolphindb.com/en/Functions/m/mstdp.html)\n"
    },
    "mstdTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mstdTopN.html",
        "signatures": [
            {
                "full": "mstdTopN(X, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mstdTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mstdTopN](https://docs.dolphindb.com/en/Functions/m/mstdTopN.html)\n\n\n\n#### Syntax\n\nmstdTopN(X, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the unbiased sample standard deviation of the first *top* elements.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 1..7\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmstdTopN(X, S, 4, 2)\n// output: [,0.707106781186548,1.414213562373095,0.707106781186548,0.707106781186548,0.707106781186548,1.414213562373095]\n\nX = NULL 1 2 3 4 NULL 5\nS = 3 5 1 1 5 2 4\nmstdTopN(X, S, 4, 2)\n// output: [,,,0.707106781186548,0.707106781186548,0.707106781186548,]\n\nX = matrix(1..5, 6..10)\nS = 2022.01.01 2022.02.03 2022.01.23 2022.04.06 2021.12.29\nmstdTopN(X, S, 3, 2)\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n| 0.707106781186548 | 0.707106781186548 |\n| 1.414213562373095 | 1.414213562373095 |\n| 0.707106781186548 | 0.707106781186548 |\n| 1.414213562373095 | 1.414213562373095 |\n\n```\nX = matrix(1..5, 6..10)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29,NULL 2022.02.03 2022.01.23 2022.04.06 NULL)\nmstdTopN(X, S, 3, 2)\n```\n\n| #0     | #1     |\n| ------ | ------ |\n|        |        |\n| 0.7071 |        |\n| 1.4142 | 0.7071 |\n| 0.7071 | 0.7071 |\n| 1.4142 | 0.7071 |\n\nRelated function: [mstd](https://docs.dolphindb.com/en/Functions/m/mstd.html)\n"
    },
    "msum": {
        "url": "https://docs.dolphindb.com/en/Functions/m/msum.html",
        "signatures": [
            {
                "full": "msum(X, window, [minPeriods])",
                "name": "msum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [msum](https://docs.dolphindb.com/en/Functions/m/msum.html)\n\n\n\n#### Syntax\n\nmsum(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving sum of *X* in a sliding window.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 2 1 3 7 6 5 4\nY = 2 1 3 NULL 6 5 4\n\nmsum(X, 3);\n// output: [,,6,11,16,18,15]\n\nmsum(Y, 3);\n// output: [,,6,4,9,11,15]\n\nmsum(Y, 3, minPeriods=1);\n// output: [2,3,6,4,9,11,15]\n```\n\n```\nm = matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(date(2020.04.06)+1..6, `col1`col2)\nm.setIndexedMatrix!()\nmsum(m, 3d) // equivalent to msum(m, 3)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.04.07 | 1    | 9    |\n| 2020.04.08 | 1    | 9    |\n| 2020.04.09 | 5    | 9    |\n| 2020.04.10 | 4    | 10   |\n| 2020.04.11 | 12   | 10   |\n| 2020.04.12 | 14   | 12   |\n\n```\nmsum(m, 1w)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.04.07 | 1    | 9    |\n| 2020.04.08 | 1    | 9    |\n| 2020.04.09 | 5    | 9    |\n| 2020.04.10 | 5    | 19   |\n| 2020.04.11 | 13   | 19   |\n| 2020.04.12 | 19   | 21   |\n\nRelated functions: [sum](https://docs.dolphindb.com/en/Functions/s/sum.html)\n"
    },
    "msum2": {
        "url": "https://docs.dolphindb.com/en/Functions/m/msum2.html",
        "signatures": [
            {
                "full": "msum2(X, window, [minPeriods])",
                "name": "msum2",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [msum2](https://docs.dolphindb.com/en/Functions/m/msum2.html)\n\n\n\n#### Syntax\n\nmsum2(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the sum of squares of all elements of *X* in a sliding window (based on the number of elements or time). Please note that the return is always of DOUBLE type.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 2 1 3 7 6 5 4\nY = 2 1 3 NULL 6 5 4\n\nmsum2(X, 3)\n// output: [,,14,59,94,110,77]\n\nmsum2(Y, 3)\n// output: [,,14,10,45,61,77]\n\nmsum2(Y, 3, minPeriods=1)\n// output: [4,5,14,10,45,61,77]\n\nm = matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(date(2021.08.16)+1..6, `col1`col2)\nm.setIndexedMatrix!()\nmsum2(m, 3d)  // equivalent to msum2(m, 3)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2021.08.17 | 1    | 81   |\n| 2021.08.18 | 1    | 81   |\n| 2021.08.19 | 17   | 81   |\n| 2021.08.20 | 16   | 100  |\n| 2021.08.21 | 80   | 100  |\n| 2021.08.22 | 100  | 104  |\n\nRelated functions: [sum2](https://docs.dolphindb.com/en/Functions/s/sum2.html)\n"
    },
    "msumTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/msumTopN.html",
        "signatures": [
            {
                "full": "msumTopN(X, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "msumTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [msumTopN](https://docs.dolphindb.com/en/Functions/m/msumTopN.html)\n\n\n\n#### Syntax\n\nmsumTopN(X, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then sums up the first *top* elements.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 1..7\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmsumTopN(X, S, 4, 2)\n// output: [1,3,4,7,7,7,10]\n\nX = NULL 1 2 3 4 NULL 5\nS = 3 5 1 1 5 2 4\nmsumTopN(X, S, 4, 2)\n// output: [,1,2,5,5,5,3]\n\nX = matrix(1..5, 6..10)\nS = 2022.01.01 2022.02.03 2022.01.23 2022.04.06 2021.12.29\nmsumTopN(X, S, 3, 2)\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 6  |\n| 3  | 13 |\n| 4  | 14 |\n| 5  | 15 |\n| 8  | 18 |\n\n```\nX = matrix(1..5, 6..10)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29,NULL 2022.02.03 2022.01.23 2022.04.06 NULL)\nmsumTopN(X, S, 3, 2)\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  |    |\n| 3  | 7  |\n| 4  | 15 |\n| 5  | 15 |\n| 8  | 17 |\n\nA table with columns code, date, close and volume.\n\n```\nt = table(take(`IBM`APPL, 20) as code, 2020.01.01 + 1..20 as date, rand(100,20) + 20 as volume, rand(10,20) + 100.0 as close)\n```\n\n| code | date       | volume | close |\n| ---- | ---------- | ------ | ----- |\n| IBM  | 2020.01.02 | 50     | 107   |\n| APPL | 2020.01.03 | 55     | 100   |\n| IBM  | 2020.01.04 | 75     | 100   |\n| APPL | 2020.01.05 | 84     | 108   |\n| IBM  | 2020.01.06 | 46     | 103   |\n| APPL | 2020.01.07 | 100    | 101   |\n| IBM  | 2020.01.08 | 96     | 100   |\n| APPL | 2020.01.09 | 84     | 102   |\n| IBM  | 2020.01.10 | 60     | 107   |\n| APPL | 2020.01.11 | 40     | 103   |\n| IBM  | 2020.01.12 | 92     | 105   |\n| APPL | 2020.01.13 | 61     | 106   |\n| IBM  | 2020.01.14 | 86     | 107   |\n| APPL | 2020.01.15 | 41     | 102   |\n| IBM  | 2020.01.16 | 85     | 103   |\n| APPL | 2020.01.17 | 72     | 105   |\n| IBM  | 2020.01.18 | 46     | 108   |\n| APPL | 2020.01.19 | 25     | 100   |\n| IBM  | 2020.01.20 | 114    | 102   |\n| APPL | 2020.01.21 | 50     | 104   |\n\nCalculate the sum of the closing prices of the top 3 records with the highest trading volume in the window for each stock.\n\n```\nselect code, date, msumTopN(close, volume, 5, 3, false) from t context by code\n```\n\n| code | date       | msumTopN\\_close |\n| ---- | ---------- | --------------- |\n| APPL | 2020.01.03 | 100             |\n| APPL | 2020.01.05 | 208             |\n| APPL | 2020.01.07 | 309             |\n| APPL | 2020.01.09 | 311             |\n| APPL | 2020.01.11 | 311             |\n| APPL | 2020.01.13 | 311             |\n| APPL | 2020.01.15 | 309             |\n| APPL | 2020.01.17 | 313             |\n| APPL | 2020.01.19 | 313             |\n| APPL | 2020.01.21 | 315             |\n| IBM  | 2020.01.02 | 107             |\n| IBM  | 2020.01.04 | 207             |\n| IBM  | 2020.01.06 | 310             |\n| IBM  | 2020.01.08 | 307             |\n| IBM  | 2020.01.10 | 307             |\n| IBM  | 2020.01.12 | 305             |\n| IBM  | 2020.01.14 | 312             |\n| IBM  | 2020.01.16 | 312             |\n| IBM  | 2020.01.18 | 315             |\n| IBM  | 2020.01.20 | 314             |\n\nRelated function: [msum](https://docs.dolphindb.com/en/Functions/m/msum.html)\n"
    },
    "mTopRange": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mTopRange.html",
        "signatures": [
            {
                "full": "mTopRange(X, window, [minPeriods])",
                "name": "mTopRange",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mTopRange](https://docs.dolphindb.com/en/Functions/m/mTopRange.html)\n\n#### Syntax\n\nmTopRange(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nFor each element *Xi* in a sliding window of *X*, count the continuous nearest neighbors to its left that are smaller than *Xi*. Null values are treated as the minimum values.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*.\n\n#### Returns\n\n* Returns a vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nx = [NULL, 3.1, NULL, 3.0, 2.9, 2.8, 3.1, NULL, 3.2]\nmTopRange(x, window=3)\n// output: [,,0,1,0,0,2,0,2]\n\nmTopRange(x, window=3, minPeriods=1)\n// output: [,1,0,1,0,0,2,0,2]\n\nx = [NULL, NULL, NULL, NULL, NULL, 2, NULL, NULL, 3.2]\ndate = [0, 1, 2, 3, 7, 8, 9, 10, 11] + 2020.01.01\nX = indexedSeries(date, x) \nmTopRange(X, 3d)\n```\n\n<table id=\"table_ir1_5mr_jbc\"><thead><tr><th>\n\n \n\n</th><th>\n\n\\#0\n\n</th></tr></thead><tbody><tr><td>\n\n2020.01.01\n\n</td><td>\n\n</td></tr><tr><td>\n\n2020.01.02\n\n</td><td>\n\n</td></tr><tr><td>\n\n2020.01.03\n\n</td><td>\n\n</td></tr><tr><td>\n\n2020.01.04\n\n</td><td>\n\n</td></tr><tr><td>\n\n2020.01.08\n\n</td><td>\n\n</td></tr><tr><td>\n\n2020.01.09\n\n</td><td>\n\n1\n\n</td></tr><tr><td>\n\n2020.01.10\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n2020.01.11\n\n</td><td>\n\n0\n\n</td></tr><tr><td>\n\n2020.01.12\n\n</td><td>\n\n2\n\n</td></tr></tbody>\n</table>```\nm = matrix(1 2 3 NULL, 1 2 NULL 3, 1 3 NULL NULL, 1 2 3 4)\nmTopRange(m, 2)\n```\n\n<table id=\"table_dyy_vmr_jbc\"><thead><tr><th>\n\n\\#0\n\n</th><th>\n\n\\#1\n\n</th><th>\n\n\\#2\n\n</th><th>\n\n\\#3\n\n</th></tr></thead><tbody><tr><td>\n\n</td><td>\n\n</td><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\n1\n\n</td><td>\n\n1\n\n</td><td>\n\n1\n\n</td><td>\n\n1\n\n</td></tr><tr><td>\n\n1\n\n</td><td>\n\n0\n\n</td><td>\n\n0\n\n</td><td>\n\n1\n\n</td></tr><tr><td>\n\n0\n\n</td><td>\n\n1\n\n</td><td>\n\n</td><td>\n\n1\n\n</td></tr></tbody>\n</table>**Parent topic:**[Functions](../../Functions/category.md)\n"
    },
    "mul": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mul.html",
        "signatures": [
            {
                "full": "mul(X, Y)",
                "name": "mul",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [mul](https://docs.dolphindb.com/en/Functions/m/mul.html)\n\n\n\n#### Syntax\n\nmul(X, Y) or X\\*Y\n\n#### Details\n\nReturn the element-by-element product of *X* and *Y*.\n\n#### Parameters\n\n**X** and **Y** is a scalar/pair/vector/matrix. If one of *X* and *Y* is a pair/vector/matrix, the other must be a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\nThe data type and form of the result depend on the type and form of the input parameters:\n\n* Scalar × scalar: returns a scalar.\n\n* Vector × scalar/vector: returns a vector of the same length as the input vector.\n\n* Matrix × scalar/vector/matrix: returns a matrix with the same dimensions as the input matrix.\n\n#### Examples\n\n```\n1:2*3;\n// output: 3 : 6\n\n1:2*3:4;\n// output: 3 : 8\n\nx=1 2 3;\nx * 2;\n// output: [2,4,6]\n\ny=4 5 6;\nx * y;\n// output: [4,10,18]\n```\n\n```\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm1*2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 2  | 6  | 10 |\n| 4  | 8  | 12 |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1*m2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 12 | 10 |\n| 10 | 12 | 6  |\n"
    },
    "multinomialNB": {
        "url": "https://docs.dolphindb.com/en/Functions/m/multinomialNB.html",
        "signatures": [
            {
                "full": "multinomialNB(Y, X, [varSmoothing=1.0])",
                "name": "multinomialNB",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[varSmoothing=1.0]",
                        "name": "varSmoothing",
                        "optional": true,
                        "default": "1.0"
                    }
                ]
            }
        ],
        "markdown": "### [multinomialNB](https://docs.dolphindb.com/en/Functions/m/multinomialNB.html)\n\n\n\n#### Syntax\n\nmultinomialNB(Y, X, \\[varSmoothing=1.0])\n\n#### Details\n\nConduct the multinomial Naive Bayesian classification.\n\n#### Parameters\n\n**Y** is a vector with the same length as table *X*. Each element of labels indicates the class that the correponding row in *X* belongs to.\n\n**X** is a table indicating the training set. Each row is a sample and each column is a feature.\n\n**varSmoothing** is a positive floating number between 0 and 1 indicating the additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing).\n\n#### Returns\n\nReturn a dictionary with the following keys:\n\n* *model*: a RESOURCE data type variable. It is an internal binary resource generated by function `multinomialNB` and to be used by function [predict](https://docs.dolphindb.com/en/Functions/p/predict.html).\n\n* *modelName*: string \"multinomialNB\".\n\n* *varSmoothing*: varSmoothing parameter value.\n\n#### Examples\n\nThe dataset *iris.data* used in the following example can be downloaded from <https://archive.ics.uci.edu/ml/datasets/iris>.\n\n```\nDATA_DIR = \"C:/DolphinDB/Data\"\nt = loadText(DATA_DIR+\"/iris.data\")\nt.rename!(`col0`col1`col2`col3`col4, `sepalLength`sepalWidth`petalLength`petalWidth`class)\nt[`classType] = take(0, t.size())\nupdate t set classType = 1 where class = \"Iris-versicolor\"\nupdate t set classType = 2 where class = \"Iris-virginica\"\n\ntraining = select sepalLength, sepalWidth, petalLength, petalWidth from t\nlabels = t.classType\n\nmodel = multinomialNB(labels, training);\n\npredict(model, training);\n```\n"
    },
    "multiTableRepartitionDS": {
        "url": "https://docs.dolphindb.com/en/Functions/m/multiTableRepartitionDS.html",
        "signatures": [
            {
                "full": "multiTableRepartitionDS(query, [column], [partitionType], [partitionScheme], [local=true])",
                "name": "multiTableRepartitionDS",
                "parameters": [
                    {
                        "full": "query",
                        "name": "query"
                    },
                    {
                        "full": "[column]",
                        "name": "column",
                        "optional": true
                    },
                    {
                        "full": "[partitionType]",
                        "name": "partitionType",
                        "optional": true
                    },
                    {
                        "full": "[partitionScheme]",
                        "name": "partitionScheme",
                        "optional": true
                    },
                    {
                        "full": "[local=true]",
                        "name": "local",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [multiTableRepartitionDS](https://docs.dolphindb.com/en/Functions/m/multiTableRepartitionDS.html)\n\n\n\n#### Syntax\n\nmultiTableRepartitionDS(query, \\[column], \\[partitionType], \\[partitionScheme], \\[local=true])\n\n#### Details\n\nGenerate a tuple of data sources from multiple tables with a new partitioning design.\n\nIf *query* is metacode of SQL statements, the parameter *column* must be specified. *partitionType* and *partitionScheme* can be unspecified for a partitioned table with a COMPO domain. In this case, the data sources will be determined based on the original *partitionType* and *partitionScheme* of *column*.\n\nIf *query* is a tuple of metacode of SQL statements, *column*, *partitionType* and *partitionScheme* should be unspecified. The function returns a tuple with the same length as *query*. Each element of the result is a data source corresponding to a piece of metacode in *query*.\n\n#### Parameters\n\n**query** is metacode of SQL statements or a tuple of metacode of SQL statements.\n\n**column** is a string indicating a column name in *query*. Function `multiTableRepartitionDS` deliminates data sources based on column.\n\n**partitionType** means the type of partition. It can take the value of VALUE or RANGE.\n\n**partitionScheme** is a vector indicating the partitioning scheme. For details please refer to [DistributedComputing](https://docs.dolphindb.com/en/Database/DatabaseandDistributedComputing/DistributedComputing.html).\n\n**local** is a Boolean value indicating whether to move the data sources to the local node for computing. The default value is true.\n\n#### Returns\n\nReturns a tuple containing a data source.\n\n#### Examples\n\n```\nn=100000\ndate=rand(2019.06.01..2019.06.05,n)\nsym=rand(`AAPL`MSFT`GOOG,n)\nprice=rand(1000.0,n)\nt1=table(date,sym,price)\ndb=database(\"dfs://value\",VALUE,2019.06.01..2019.06.05)\ndb.createPartitionedTable(t1,`pt1,`date).append!(t1);\n\nn=100000\ndate=rand(2019.06.01..2019.06.05,n)\nsym=rand(`AAPL`MSFT`GOOG,n)\nprice=rand(1000.0,n)\nqty=rand(500,n)\nt2=table(date,sym,price,qty)\ndb1=database(\"\",VALUE,2019.06.01..2019.06.05)\ndb2=database(\"\",VALUE,`AAPL`MSFT`GOOG)\ndb=database(\"dfs://compo\",COMPO,[db1,db2])\ndb.createPartitionedTable(t2,`pt2,`date`sym).append!(t2);\n\npt1=loadTable(\"dfs://value\",\"pt1\")\npt2=loadTable(\"dfs://compo\",\"pt2\");\n```\n\nExample 1. Delineate data sources based on the original partitioning scheme. *column*, *partitionType* and *partitionScheme* are unspecified.\n\n```\nds=multiTableRepartitionDS(query=[<select * from pt1>,<select date,sym,price from pt2>]);\n// output: (DataSource< select [7] * from pt1 [partition = /value/20190601] >,DataSource< select [7] * from pt1 [partition = /value/20190602] >, ...... ,DataSource< select [7] date,sym,price from pt2 [partition = /compo/20190605/GOOG] >,DataSource< select [7] date,sym,price from pt2 [partition = /compo/20190605/MSFT] >)\n```\n\nExample 2. Delineate data sources based on stock symbols.\n\n```\nds=multiTableRepartitionDS(query=[<select * from pt1>,<select date,sym,price from pt2>],column=`sym, partitionType=VALUE, partitionScheme=symbol(`AAPL`MSFT`GOOG));\n// output: (DataSource< select [4] * from pt1 where sym == \"AAPL\" >,DataSource< select [4] * from pt1 where sym == \"MSFT\" >,DataSource< select [4] * from pt1 where sym == \"GOOG\" >,DataSource< select [4] date,sym,price from pt2 where sym == \"AAPL\" >,DataSource< select [4] date,sym,price from pt2 where sym == \"MSFT\" >,DataSource< select [4] date,sym,price from pt2 where sym == \"GOOG\" >)\n```\n\nExample 3. Delineate data sources based on dates.\n\n```\nds=multiTableRepartitionDS(query=[<select * from pt1>,<select date,sym,price from pt2>],column=`date,partitionType=RANGE,partitionScheme=2019.06.01 2019.06.03 2019.06.05);\n// output: (DataSource< select [4] * from pt1 where date >= 2019.06.01,date < 2019.06.03 >,DataSource< select [4] * from pt1 where date >= 2019.06.03,date < 2019.06.05 >,DataSource< select [4] date,sym,price from pt2 where date >= 2019.06.01,date < 2019.06.03 >,DataSource< select [4] date,sym,price from pt2 where date >= 2019.06.03,date < 2019.06.05 >)\n```\n\nRelated function: [repartitionDS](https://docs.dolphindb.com/en/Functions/r/repartitionDS.html)\n"
    },
    "mutualInfo": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mutualInfo.html",
        "signatures": [
            {
                "full": "mutualInfo(X, Y)",
                "name": "mutualInfo",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [mutualInfo](https://docs.dolphindb.com/en/Functions/m/mutualInfo.html)\n\n\n\n#### Syntax\n\nmutualInfo(X, Y)\n\nAlias: infoGain\n\n#### Details\n\nCalculate the mutual information of *X* and *Y*.\n\nThe calculation uses the following formula:\n\n![](https://docs.dolphindb.com/en/images/mutualInfo.png)\n\nIf *X* or *Y* is a matrix, calculate the mutual information of each column and return a vector.\n\nPlease note that the natural logarithm is used in this formula. If base is set to 2 or 10, please divide the result by log 2 or log 10.\n\n#### Parameters\n\n**X** is a scalar/vector/ matrix.\n\n**Y** is a scalar/vector/ matrix.\n\n*X* and *Y* can be integral or symbol types.\n\n#### Returns\n\nA DOUBLE scalar or vector.\n\n#### Examples\n\n```\na = [NULL,4,NULL,NULL,-82,97,NULL,56,5,-92]\nb = [NULL,53,NULL,18,97,-4,-73,NULL,NULL,24]\nmutualInfo(a, b)\n// output: 2.302585\n\nt=table(take(1..10,10000000) as id, rand(10,10000000) as x, rand(10,10000000) as y);\nmutualInfo(t.x, t.y)\n// output: 0.000004\n\nm1 = 1..12$3:4\nm2 = 1..3\nmutualInfo(m1, m2)\n// output: [1.0986, 1.0986, 1.0986, 1.0986]\n```\n\nIf *X* is a matrix, *Y* can be a vector/matrix with the same row number as *X*.\n\n```\nm1 = [27,29,NULL,56,57,-2,68,38,100,55,94,87,2,29,-5,34,32,86,-4,13,66,28,33,87,20,88,13,51,13,79]$6:5\nm2 = [44,29,44,NULL,36,57,48,71,39,6,30,NULL,42,NULL,95,55,22,93,70,27,51,24,63,45,-10,87,44,92,69,100]$6:5\nmutualInfo(m1, m2)\n```\n"
    },
    "mvar": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mvar.html",
        "signatures": [
            {
                "full": "mvar(X, window, [minPeriods])",
                "name": "mvar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html)\n\n\n\n#### Syntax\n\nmvar(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving variances of *X* in a sliding window.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nmvar(1..6, 5);\n// output: [,,,,2.5,2.5]\n\nmvar(1..6, 5, 2);\n// output: [,0.5,1,1.666667,2.5,2.5]\n```\n\n```\nm=matrix(1 6 2 9 4 5, 11 12 18 23 21 10);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 11 |\n| 6  | 12 |\n| 2  | 18 |\n| 9  | 23 |\n| 4  | 21 |\n| 5  | 10 |\n\n```\nmvar(m,3);\n```\n\n| #0                 | #1                 |\n| ------------------ | ------------------ |\n|                    |                    |\n|                    |                    |\n| 7                  | 14.333333333333314 |\n| 12.333333333333335 | 30.333333333333314 |\n| 13                 | 6.333333333333372  |\n| 7                  | 49                 |\n\n```\nm=matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(date(2020.04.06)+1..6, `col1`col2)\nm.setIndexedMatrix!()\nmvar(m,4d)\n```\n\n| label      | col1 | col2 |\n| ---------- | ---- | ---- |\n| 2020.04.07 |      |      |\n| 2020.04.08 |      |      |\n| 2020.04.09 | 4.5  |      |\n| 2020.04.10 | 4.5  | 0.5  |\n| 2020.04.11 | 8    |      |\n| 2020.04.12 | 4    | 32   |\n\n```\nmvar(m,1w)\n```\n\n| label      | col1    | col2 |\n| ---------- | ------- | ---- |\n| 2020.04.07 |         |      |\n| 2020.04.08 |         |      |\n| 2020.04.09 | 4.5     |      |\n| 2020.04.10 | 4.5     | 0.5  |\n| 2020.04.11 | 12.3333 | 0.5  |\n| 2020.04.12 | 8.9167  | 19   |\n\nRelated functions: [var](https://docs.dolphindb.com/en/Functions/v/var.html)\n"
    },
    "mvarp": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mvarp.html",
        "signatures": [
            {
                "full": "mvarp(X, window, [minPeriods])",
                "name": "mvarp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mvarp](https://docs.dolphindb.com/en/Functions/m/mvarp.html)\n\n\n\n#### Syntax\n\nmvarp(X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving population variances of *X* in a sliding window.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nmvarp(1..6, 5);\n// output: [,,,,2,2]\n\nmvarp(1..6, 5, 2);\n// output: [,0.25,0.666666666666667,1.25,2,2]\n\nm=matrix(1 6 2 9 4 5, 11 12 18 23 21 10);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 11 |\n| 6  | 12 |\n| 2  | 18 |\n| 9  | 23 |\n| 4  | 21 |\n| 5  | 10 |\n\n```\nmvarp(m,3);\n```\n\n| #0                | #1                 |\n| ----------------- | ------------------ |\n|                   |                    |\n|                   |                    |\n| 4.666666666666667 | 9.555555555555542  |\n| 8.222222222222223 | 20.22222222222221  |\n| 8.666666666666666 | 4.222222222222248  |\n| 4.666666666666667 | 32.666666666666664 |\n\n```\nm=matrix(1 NULL 4 NULL 8 6 , 9 NULL NULL 10 NULL 2)\nm.rename!(date(2020.04.06)+1..6, `col1`col2)\nm.setIndexedMatrix!()\nmvarp(m,4d)\n```\n\n| label      | col1   | col2 |\n| ---------- | ------ | ---- |\n| 2020.04.07 | 0      | 0    |\n| 2020.04.08 | 0      | 0    |\n| 2020.04.09 | 2.25   | 0    |\n| 2020.04.10 | 2.25   | 0.25 |\n| 2020.04.11 | 4      | 0    |\n| 2020.04.12 | 2.6667 | 16   |\n\n```\nmvarp(m,1w)\n```\n\n| label      | col1   | col2    |\n| ---------- | ------ | ------- |\n| 2020.04.07 | 0      | 0       |\n| 2020.04.08 | 0      | 0       |\n| 2020.04.09 | 2.25   | 0       |\n| 2020.04.10 | 2.25   | 0.25    |\n| 2020.04.11 | 8.2222 | 0.25    |\n| 2020.04.12 | 6.6875 | 12.6667 |\n\nRelated function: [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html)\n"
    },
    "mvarpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mvarpTopN.html",
        "signatures": [
            {
                "full": "mvarpTopN(X, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mvarpTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mvarpTopN](https://docs.dolphindb.com/en/Functions/m/mvarpTopN.html)\n\n\n\n#### Syntax\n\nmvarpTopN(X, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the population variance of the first *top* elements.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 1..7\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmvarpTopN(X, S, 4, 2)\n// output: [0,0.25,1,0.25,0.25,0.25,1]\n\n\nX = NULL 1 2 3 4 NULL 5\nS = 3 5 1 1 5 2 4\nmvarpTopN(X, S, 4, 2)\n// output: [,0,0,0.25,0.25,0.25,0]\n\nX = matrix(1..5, 6..10)\nS = 2022.01.01 2022.02.03 2022.01.23 2022.04.06 2021.12.29\nmvarpTopN(X, S, 3, 2)\n```\n\n| #0   | #1   |\n| ---- | ---- |\n| 0    | 0    |\n| 0.25 | 0.25 |\n| 1    | 1    |\n| 0.25 | 0.25 |\n| 1    | 1    |\n\n```\nX = matrix(1..5, 6..10)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29,NULL 2022.02.03 2022.01.23 2022.04.06 NULL)\nmvarpTopN(X, S, 3, 2)\n```\n\n| #0   | #1   |\n| ---- | ---- |\n| 0    |      |\n| 0.25 | 0    |\n| 1    | 0.25 |\n| 0.25 | 0.25 |\n| 1    | 0.25 |\n\nRelated function: [mvarp](https://docs.dolphindb.com/en/Functions/m/mvarp.html)\n"
    },
    "mvarTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mvarTopN.html",
        "signatures": [
            {
                "full": "mvarTopN(X, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mvarTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mvarTopN](https://docs.dolphindb.com/en/Functions/m/mvarTopN.html)\n\n\n\n#### Syntax\n\nmvarTopN(X, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the unbiased sample variance of the first *top* elements.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 1..7\nS = 0.3 0.5 0.1 0.1 0.5 0.2 0.4\nmvarTopN(X, S, 4, 2)\n// output: [,0.5,2,0.5,0.5,0.5,2]\n\nX = NULL 1 2 3 4 NULL 5\nS = 3 5 1 1 5 2 4\nmvarTopN(X, S, 4, 2)\n// output: [,,,0.5,0.5,0.5,]\n\nX = matrix(1..5, 6..10)\nS = 2022.01.01 2022.02.03 2022.01.23 2022.04.06 2021.12.29\nmvarTopN(X, S, 3, 2)\n```\n\n| #0  | #1  |\n| --- | --- |\n|     |     |\n| 0.5 | 0.5 |\n| 2   | 2   |\n| 0.5 | 0.5 |\n| 2   | 2   |\n\n```\nX = matrix(1..5, 6..10)\nS = matrix(2022.01.01 2022.02.03 2022.01.23 NULL 2021.12.29,NULL 2022.02.03 2022.01.23 2022.04.06 NULL)\nmvarTopN(X, S, 3, 2)\n```\n\n| #0  | #1  |\n| --- | --- |\n|     |     |\n| 0.5 |     |\n| 2   | 0.5 |\n| 0.5 | 0.5 |\n| 2   | 0.5 |\n\nRelated function: [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html)\n"
    },
    "mvccTable": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mvccTable.html",
        "signatures": [
            {
                "full": "mvccTable(X, [X1], [X2], .....)",
                "name": "mvccTable",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": ".....",
                        "name": "....."
                    }
                ]
            },
            {
                "full": "mvccTable(capacity:size, colNames, colTypes, [path], [tableName], [defaultValues], [allowNull])",
                "name": "mvccTable",
                "parameters": [
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[path]",
                        "name": "path",
                        "optional": true
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    },
                    {
                        "full": "[defaultValues]",
                        "name": "defaultValues",
                        "optional": true
                    },
                    {
                        "full": "[allowNull]",
                        "name": "allowNull",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mvccTable](https://docs.dolphindb.com/en/Functions/m/mvccTable.html)\n\n\n\n#### Syntax\n\nmvccTable(X, \\[X1], \\[X2], .....)\n\nor\n\nmvccTable(capacity:size, colNames, colTypes, \\[path], \\[tableName], \\[defaultValues], \\[allowNull])\n\n#### Parameters\n\nFor the first scenario:\n\n**X**, **X1**, **X2** ...are vectors.\n\nFor the second scenario:\n\n**capacity** is the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds *capacity*, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n**size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If size=0, create an empty table. If size>0, the initialized values are determined by *defaultValues*.\n\n**colNames** is a string vector of column names.\n\n**colTypes** is a string vector of column types.\n\n**path** is a string indicating the absolute path of the table on disk. The DFS path is not supported.\n\n**tableName** is a string indicating the name of the table on disk.\n\n**defaultValues** is a tuple that has the same length as *colNames*. It specifies the default values for all columns. If it is not specified, then the initialized values are:\n\n* false for Boolean type;\n\n* 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n\n* Null values for Literal, INT128 types.\n\n**allowNull** is a Boolean vector that has the same length as *colNames*. It specifies whether to allow null values in each column. By default, elements of the Boolean vector are all true, meaning null values are allowed.\n\n#### Details\n\nCreate an MVCC (Multi Version Concurrency Control) table. When appending, updating or deleting rows of a table, another version of the table is created so that concurrent read will not be blocked. The mvcc table is optimal for the use case with frequent read and append, but few update and delete operations.\n\nIf parameters *path* and *tableName* are specified, the table will be persisted to disk. The table on disk can be loaded into memory with function [loadMvccTable](https://docs.dolphindb.com/en/Functions/l/loadMvccTable.html).\n\n**Note:**\n\n* When *size* is set to 0, if null values are disallowed for a column, an MVCC table can be created but null values cannot be appended to the column.\n\n* The MVCC table does not support `addColumn`, `reorderColumns!`, `upsert!`, `drop`, `erase!`.\n\n**Note:**\n\n* The MVCC table does not support `addColumn`, `dropColumns!`, `replaceColumn!`, `reorderColumns!`, `upsert!`, `drop`, `erase!`.\n\n#### Examples\n\nExample1. Create an MVCC table by two methods:\n\nMethod 1:\n\n```\nid=`XOM`GS`AAPL\nx=102.1 33.4 73.6\nmvccTable(id, x);\n```\n\n| id   | x     |\n| ---- | ----- |\n| XOM  | 102.1 |\n| GS   | 33.4  |\n| AAPL | 73.6  |\n\nMethod 2:\n\n```\nmvccTable(200:10, `name`id`value, [STRING,INT,DOUBLE],\"C:/DolphinDB/Data\",\"t1\");\n```\n\n| name | id | value |\n| ---- | -- | ----- |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n\nThere will be files named *t1.tbl*, *t1.sym* and a folder named *t1* under path *C:/DolphinDB/Data*. You should delete all these files before deleting a disk table.\n\nExample 2. Create a partitioned MVCC table:\n\n```\nn=200000\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\ntrades_mvcc1 = mvccTable(n:0, colNames, colTypes)\ntrades_mvcc2 = mvccTable(n:0, colNames, colTypes)\ndb=database(, VALUE, `A`D)\ntrades = createPartitionedTable(db,table=[trades_mvcc1, trades_mvcc2], tableName=\"\", partitionColumns=`sym)\n```\n\nBefore version 2.00.10.4, the update, appending and deletion operations are not supported on partitioned MVCC tables. You can only operate on the tablets trades\\_mvcc1 and trades\\_mvcc2 to modify the partitioned MVCC table trades.\n\n```\ninsert into trades_mvcc1 values(09:30:00.001,`A,100,56.5)\ninsert into trades_mvcc2 values(09:30:01.001,`D,100,15.5)\n\ninsert into trades values(09:30:00.001,`D,100,26.5)\nError: Can't append data to a segmented table that contains external partitions.\n\nselect * from trades;\n```\n\n| time         | sym | qty | price |\n| ------------ | --- | --- | ----- |\n| 09:30:00.001 | A   | 100 | 56.5  |\n| 09:30:01.001 | D   | 100 | 15.5  |\n\nSince 2.00.10.4, the update, appending and deletion operations can be directly applied to partitioned MVCC tables.\n\n```\ninsert into trades values(09:30:00.001,`D,100,26.5)\nselect * from trades;\n```\n\n| time         | sym | qty | price |\n| ------------ | --- | --- | ----- |\n| 09:30:00.001 | A   | 100 | 56.5  |\n| 09:30:01.001 | D   | 100 | 15.5  |\n| 09:30:01.001 | D   | 100 | 26.5  |\n\n```\ndelete from trades where sym=`A\nselect * from trades;\n```\n\n| time         | sym | qty | price |\n| ------------ | :-- | :-- | :---- |\n| 09:30:01.001 | D   | 100 | 15.5  |\n| 09:30:01.001 | D   | 100 | 26.5  |\n\n```\nupdate trades set price=price*10 where sym=`D\nselect * from trades;\n```\n\n| time         | sym | qty | price |\n| :----------- | :-- | :-- | :---- |\n| 09:30:01.001 | D   | 100 | 155   |\n| 09:30:01.001 | D   | 100 | 265   |\n\nNote that when appending data to a tablet of a partitioned MVCC table, the system would not validate whether the data matches the table schema. If an out-of-scope record is appended to a tablet, it can lead to data corruption in the partitioned MVCC table. Therefore, it is more recommended to operate directly on the table instead of its tablets.\n"
    },
    "mwavg": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mwavg.html",
        "signatures": [
            {
                "full": "mwavg(Y, X, window, [minPeriods])",
                "name": "mwavg",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mwavg](https://docs.dolphindb.com/en/Functions/m/mwavg.html)\n\n\n\n#### Syntax\n\nmwavg(Y, X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving averages of *X* with *Y* as weights in a sliding window.\n\n**Note:**\n\nDifferent from `mavg` that is based on a window of size (weight) length, `mwavg` must use *X* and *Y* of the same length.\n\nThe weights in a rolling window are automatically adjusted so that the sum of weights for all non-null elements in the rolling window is 1.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\nFunction `mwavg` can be used to calculate VWAP (volume-weighted average price):\n\n```\nprice=2.1 2.2 2.3 2.5 2.6 2.8 2.7 2.5;\nvolume=10 20 10 40 10 40 10 20;\nmwavg(price, volume, 4);\n// output: [,,,2.35,2.4125,2.61,2.65,2.6875]\n\nmwavg(price, volume, 4, 2);\n// output: [,2.166667,2.2,2.35,2.4125,2.61,2.65,2.6875]\n```\n\n```\nprice1 = indexedSeries(date(2020.06.05)+1..8, price)\nvolume1 = indexedSeries(date(2020.06.05)+1..8, volume)\nmwavg(price1,volume1, 4d)\n```\n\n| label      | col1   |\n| ---------- | ------ |\n| 2020.06.06 | 2.1    |\n| 2020.06.07 | 2.1667 |\n| 2020.06.08 | 2.2    |\n| 2020.06.09 | 2.35   |\n| 2020.06.10 | 2.4125 |\n| 2020.06.11 | 2.61   |\n| 2020.06.12 | 2.65   |\n| 2020.06.13 | 2.6875 |\n\n```\nmwavg(price1,volume1, 1w)\n```\n\n| label      | col1   |\n| ---------- | ------ |\n| 2020.06.06 | 2.1    |\n| 2020.06.07 | 2.1667 |\n| 2020.06.08 | 2.2    |\n| 2020.06.09 | 2.35   |\n| 2020.06.10 | 2.3788 |\n| 2020.06.11 | 2.5077 |\n| 2020.06.12 | 2.5214 |\n| 2020.06.13 | 2.5467 |\n\nRelated functions: [wavg](https://docs.dolphindb.com/en/Functions/w/wavg.html), [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html).\n"
    },
    "mwsum": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mwsum.html",
        "signatures": [
            {
                "full": "mwsum(Y, X, window, [minPeriods])",
                "name": "mwsum",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [mwsum](https://docs.dolphindb.com/en/Functions/m/mwsum.html)\n\n\n\n#### Syntax\n\nmwsum(Y, X, window, \\[minPeriods])\n\nPlease see [mFunctions](https://docs.dolphindb.com/en/Functions/Themes/mFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving sums of *X* with *Y* as weights in a sliding window.\n\nThe weights in a rolling window are automatically adjusted so that the sum of weights for all non-null elements in the rolling window is 1.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\n```\nX = 2 1 3 7 6 5 4\nX1 = 2 1 3 NULL 6 5 4\nY = 1 0.5 1 1 2 2.1\n\nmwsum(X, Y, 3);\n// output: [,,5.5,10.5,22,29.5,24.5]\n\nmwsum(X1, Y, 3)\n// output: [,,5.5,3.5,15,22.5,24.5]\n\nmwsum(X1, Y, 3, minPeriods=1)\n// output: [2,2.5,5.5,3.5,15,22.5,24.5]\n```\n\n```\nX = 1..10;\nY = 9 5 3 4 5 4 7 1 3 4;\nX1 = indexedSeries(date(2020.06.05)+1..10, X)\nY1 = indexedSeries(date(2020.06.05)+1..10, Y)\nmwsum(X1, Y1, 5d)\n```\n\n| label      | col1 |\n| ---------- | ---- |\n| 2020.06.06 | 9    |\n| 2020.06.07 | 19   |\n| 2020.06.08 | 28   |\n| 2020.06.09 | 44   |\n| 2020.06.10 | 69   |\n| 2020.06.11 | 84   |\n| 2020.06.12 | 123  |\n| 2020.06.13 | 122  |\n| 2020.06.14 | 133  |\n| 2020.06.15 | 148  |\n\n```\nmwsum(X1, Y1, 1w)\n```\n\n| label      | col1 |\n| ---------- | ---- |\n| 2020.06.06 | 9    |\n| 2020.06.07 | 19   |\n| 2020.06.08 | 28   |\n| 2020.06.09 | 44   |\n| 2020.06.10 | 69   |\n| 2020.06.11 | 93   |\n| 2020.06.12 | 142  |\n| 2020.06.13 | 141  |\n| 2020.06.14 | 158  |\n| 2020.06.15 | 189  |\n\nRelated functions: [wsum](https://docs.dolphindb.com/en/Functions/w/wsum.html), [msum](https://docs.dolphindb.com/en/Functions/m/msum.html).\n"
    },
    "mwsumTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/m/mwsumTopN.html",
        "signatures": [
            {
                "full": "mwsumTopN(X, Y, S, window, top, [ascending=true], [tiesMethod='oldest'])",
                "name": "mwsumTopN",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='oldest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'oldest'"
                    }
                ]
            }
        ],
        "markdown": "### [mwsumTopN](https://docs.dolphindb.com/en/Functions/m/mwsumTopN.html)\n\n\n\n#### Syntax\n\nmwsumTopN(X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='oldest'])\n\nPlease see [mTopN](https://docs.dolphindb.com/en/Functions/Themes/mTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by the number of elements), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving sums of *X* with *Y* as weights.\n\n#### Returns\n\n* Returns a DOUBLE vector of the same length as the input when the input is a vector.\n\n* Returns a matrix with the same dimensions as the input when the input is a matrix.\n\n* Returns a table with the same schema as the input when the input is a table.\n\n* Returns a tuple with the corresponding structure when the input is a tuple.\n\n#### Examples\n\nUsing IBM stock as an example, simulate trading prices, trading volumes, and turnover rates for six consecutive trading days:\n\n```\nsymbol = take(`IBM, 6)\ntradeDate = 2024.01.02 2024.01.03 2024.01.04 2024.01.05 2024.01.08 2024.01.09\ntradePrice = [182.5, 183.8, 181.2, 184.6, 183.1, 185.0]\ntradeVolume = [520, 860, 610, 940, 650, 880]\nturnoverRate = [1.8, 2.6, 1.9, 3.1, 2.1, 2.8]\n\nstockDaily = table(symbol, tradeDate, tradePrice, tradeVolume, turnoverRate)\nstockDaily;\n```\n\nOutput:\n\n| symbol | tradeDate  | tradePrice | tradeVolume | turnoverRate |\n| ------ | ---------- | ---------- | ----------- | ------------ |\n| IBM    | 2024.01.02 | 182.5      | 520         | 1.8          |\n| IBM    | 2024.01.03 | 183.8      | 860         | 2.6          |\n| IBM    | 2024.01.04 | 181.2      | 610         | 1.9          |\n| IBM    | 2024.01.05 | 184.6      | 940         | 3.1          |\n| IBM    | 2024.01.08 | 183.1      | 650         | 2.1          |\n| IBM    | 2024.01.09 | 185        | 880         | 2.8          |\n\nOver the most recent four trading days, select the top two trading days by turnover rate and calculate the inner product of tradePrice and tradeVolume:\n\n```\nmwsumTopN(X=tradePrice, Y=tradeVolume, S=turnoverRate, window=4, top=2, ascending=false)\n// Output: [94,900, 252,968, 268,600, 331,592, 331,592, 336,324]\n```\n\n* turnoverRate is used to select the trading days with the highest turnover rates;\n* For the data on 2024.01.09, within the most recent 4-day window, the two trading days with the highest turnover rates correspond to the samples (184.6, 940) and (185.0, 880). Their inner product is 184.6\\*940 + 185.0\\*880 = 336,324.\n\nRelated function: [mwsum](https://docs.dolphindb.com/en/Functions/m/mwsum.html)\n"
    },
    "rad2deg": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rad2deg.html",
        "signatures": [
            {
                "full": "rad2deg(X)",
                "name": "rad2deg",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rad2deg](https://docs.dolphindb.com/en/Functions/r/rad2deg.html)\n\n\n\n#### Syntax\n\nrad2deg(X)\n\n#### Details\n\nConvert angle units from radians to degrees for each element of *X*.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n#### Returns\n\nThe data type is DOUBLE, and the data form is the same as *X*.\n\n#### Examples\n\n```\nrad2deg(pi);\n// output: 180\n```\n\nRelated function: [deg2rad](https://docs.dolphindb.com/en/Functions/d/deg2rad.html)\n"
    },
    "rand": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rand.html",
        "signatures": [
            {
                "full": "rand(X, [count])",
                "name": "rand",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[count]",
                        "name": "count",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [rand](https://docs.dolphindb.com/en/Functions/r/rand.html)\n\n\n\n#### Syntax\n\nrand(X, \\[count])\n\n#### Details\n\nReturn a random scalar/vector/matrix of the same data type as *X*.\n\n* If *X* is a scalar, *X* must be a positive numerical value. Random values are generated following a uniform distribution on \\[0, *X*).\n* If *X* is a vector, random values are drawn from the elements of *X*.\n\n#### Parameters\n\n**X** is a scalar/vector.\n\n**count**(optional) is an INT scalar/pair.\n\n* If *count* is not specified, a scalar is returned.\n* If *count* is a scalar, it specifies the length of the output vector.\n* If *count* is a tuple, it specifies the dimensions of the output matrix.\n\n#### Returns\n\nA random scalar, vector, or matrix with the same type as *X*.\n\n#### Examples\n\n```\n// generate a random scalar (without specifying count)\nrand(2)\n// output: 0\nrand(1 2 5)\n// output: 1\n\n// generate 20 random non-negative integers less than 10\nrand(10, 20);\n// output: [9,9,8,1,1,0,8,3,2,6,4,6,9,6,8,9,3,2,1,5]\n\n// generate 10 random non-negative double values less than 9.8\nrand(9.8, 10);// output: [3.653754,1.750518,0.055747,5.219222,2.473778,6.337576,7.797493,1.392241,0.149499,5.697612]\n\n// generate 3 random values drawn from vector x\nx=3 5 4 6 9;\nrand(x, 3);\n// output: [9,3,6]\n\n// generate a 2*2 random matrix less than 10\nrand(10.0, 2:2) \n```\n\n| col1   | col2   |\n| ------ | ------ |\n| 0.8233 | 1.0052 |\n| 7.1127 | 9.7578 |\n\n```\n12:35:06 + rand(100, 10);\n// output: [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]\n\nx=`IBM`C`AAPL`BABA;\nrand(x, 10);\n// output: [\"IBM\",\"BABA\",\"C\",\"AAPL\",\"IBM\",\"C\",\"BABA\",\"AAPL\",\"BABA\",\"BABA\"]\n```\n\n```\nrand(x,2:3)\n```\n\n| #0   | #1   | #2   |\n| ---- | ---- | ---- |\n| BABA | AAPL | BABA |\n| C    | AAPL | AAPL |\n"
    },
    "randBeta": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randBeta.html",
        "signatures": [
            {
                "full": "randBeta(alpha, beta, count)",
                "name": "randBeta",
                "parameters": [
                    {
                        "full": "alpha",
                        "name": "alpha"
                    },
                    {
                        "full": "beta",
                        "name": "beta"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randBeta](https://docs.dolphindb.com/en/Functions/r/randBeta.html)\n\n\n\n#### Syntax\n\nrandBeta(alpha, beta, count)\n\n#### Details\n\nReturn a vector of random values with beta distribution.\n\n#### Parameters\n\nThe shape parameters **alpha** and **bata** are positive floating numbers.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandBeta(2.31, 0.627, 2);\n// output: [0.781246, 0.951372]\n```\n"
    },
    "randBinomial": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randBinomial.html",
        "signatures": [
            {
                "full": "randBinomial(trials, p, count)",
                "name": "randBinomial",
                "parameters": [
                    {
                        "full": "trials",
                        "name": "trials"
                    },
                    {
                        "full": "p",
                        "name": "p"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randBinomial](https://docs.dolphindb.com/en/Functions/r/randBinomial.html)\n\n\n\n#### Syntax\n\nrandBinomial(trials, p, count)\n\n#### Details\n\nReturn a vector of random values with binomial distribution.\n\n#### Parameters\n\n**trials** is a positive integer.\n\n**p** is a floating number between 0 and 1.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandBinomial(2, 0.627, 2);\n// output: [1, 1]\n```\n"
    },
    "randChiSquare": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randChiSquare.html",
        "signatures": [
            {
                "full": "randChiSquare(df, count)",
                "name": "randChiSquare",
                "parameters": [
                    {
                        "full": "df",
                        "name": "df"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randChiSquare](https://docs.dolphindb.com/en/Functions/r/randChiSquare.html)\n\n\n\n#### Syntax\n\nrandChiSquare(df, count)\n\n#### Details\n\nReturn a vector of random values with chi-squared distribution.\n\n#### Parameters\n\n**df** is a positive integer indicating the degree of freedom of a chi-squared distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandChiSquare(2.31, 2);\n// output: [2.78303, 2.868523]\n```\n"
    },
    "randDiscrete": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randDiscrete.html",
        "signatures": [
            {
                "full": "randDiscrete(v, p, count)",
                "name": "randDiscrete",
                "parameters": [
                    {
                        "full": "v",
                        "name": "v"
                    },
                    {
                        "full": "p",
                        "name": "p"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randDiscrete](https://docs.dolphindb.com/en/Functions/r/randDiscrete.html)\n\n\n\n#### Syntax\n\nrandDiscrete(v, p, count)\n\n#### Details\n\nGenerate a sample of size count with random values sampling from *v* based on the specified probability distribution *p*.\n\n#### Parameters\n\n**v** is a vector/tuple indicating the sample data.\n\n**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*.\n\n**count** is a positive integer indicating the length of the output vector.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandDiscrete(1..5, [0.1, 0.1, 0.2, 0.2, 0.4], 10)\n// output: [2,3,5,2,5,5,2,1,1,2]\n\n//If the sum of p is not 1, it will be normalized automatically.\nrandDiscrete(1..5, [0.1, 0.2, 0.3, 0.4, 0.5], 5)\n// output: [5,1,2,3,5]\n\nrandDiscrete(`A`B`C`E`F, [0.1, 0.2, 0.3, 0.4, 0.5], 5)\n// output: [\"C\",\"E\",\"B\",\"C\",\"F\"]\n\n// Sample from each element in a tuple.\nrandDiscrete([[1,2], [2,3,4], 'S', 'abc'], [0.3, 0.3, 0.2, 0.1], 10)\n// output: ('S',[2,3,4],[1,2],[2,3,4],[1,2],'S','S',[2,3,4],[2,3,4],[2,3,4])\n\n// Sample from each vector in an array vector.\na = array\\(INT\\[\\], 0, 10\\).append!\\(\\[1 2 3, 4 5,6 7 8, 9 NULL\\]\\)\nrandDiscrete\\(a, \\[0.1, 0.2, 0.3, 0.4\\], 10\\)\n// output: \\[\\[9,00i\\],\\[9,00i\\],\\[9,00i\\],\\[4,5\\],\\[9,00i\\],\\[1,2,3\\],\\[9,00i\\],\\[6,7,8\\],\\[9,00i\\],\\[9,00i\\]\\]\n```\n"
    },
    "randExp": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randExp.html",
        "signatures": [
            {
                "full": "randExp(mean, count)",
                "name": "randExp",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randExp](https://docs.dolphindb.com/en/Functions/r/randExp.html)\n\n\n\n#### Syntax\n\nrandExp(mean, count)\n\n#### Details\n\nReturn a vector of random values with exponential distribution.\n\n#### Parameters\n\n**mean** is the mean of an exponential distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandExp(2.31, 2);\n// output: [0.732791, 0.732791]\n```\n"
    },
    "randF": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randF.html",
        "signatures": [
            {
                "full": "randF(numeratorDF, denominatorDF, count)",
                "name": "randF",
                "parameters": [
                    {
                        "full": "numeratorDF",
                        "name": "numeratorDF"
                    },
                    {
                        "full": "denominatorDF",
                        "name": "denominatorDF"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randF](https://docs.dolphindb.com/en/Functions/r/randF.html)\n\n\n\n#### Syntax\n\nrandF(numeratorDF, denominatorDF, count)\n\n#### Details\n\nReturn a vector of random values with F distribution.\n\n#### Parameters\n\n**numeratorDF** and **denominatorDF** are positive integers indicating degrees of freedom of an F distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandF(2.31, 0.671, 2);\n// output: [0.41508, 0.642609]\n```\n"
    },
    "randGamma": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randGamma.html",
        "signatures": [
            {
                "full": "randGamma(shape, scale, count)",
                "name": "randGamma",
                "parameters": [
                    {
                        "full": "shape",
                        "name": "shape"
                    },
                    {
                        "full": "scale",
                        "name": "scale"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randGamma](https://docs.dolphindb.com/en/Functions/r/randGamma.html)\n\n\n\n#### Syntax\n\nrandGamma(shape, scale, count)\n\n#### Details\n\nReturn a vector of random values with gamma distribution.\n\n#### Parameters\n\nThe shape parameter **shape** is a positive floating number.\n\nThe scale parameter **scale** is a positive floating number.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandGamma(2.31, 0.671, 2);\n// output: [0.784424, 0.716934]\n```\n"
    },
    "randLogistic": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randLogistic.html",
        "signatures": [
            {
                "full": "randLogistic(mean, s, count)",
                "name": "randLogistic",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "s",
                        "name": "s"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randLogistic](https://docs.dolphindb.com/en/Functions/r/randLogistic.html)\n\n\n\n#### Syntax\n\nrandLogistic(mean, s, count)\n\n#### Details\n\nReturn a vector of random values with logistic distribution.\n\n#### Parameters\n\n**mean** is the mean of a logistic distribution.\n\n**s** is the scale parameter of a logistic distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandLogistic(2.31, 0.671, 2);\n// output: [2.465462, 2.577171]\n```\n"
    },
    "randMultivariateNormal": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randMultivariateNormal.html",
        "signatures": [
            {
                "full": "randMultivariateNormal(mean, covar, count, [sampleAsRow=true])",
                "name": "randMultivariateNormal",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "covar",
                        "name": "covar"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    },
                    {
                        "full": "[sampleAsRow=true]",
                        "name": "sampleAsRow",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [randMultivariateNormal](https://docs.dolphindb.com/en/Functions/r/randMultivariateNormal.html)\n\n\n\n#### Syntax\n\nrandMultivariateNormal(mean, covar, count, \\[sampleAsRow=true])\n\nAlias: multivariateNormal\n\n#### Details\n\nReturn a matrix of random values that follow a multivariate normal distribution.\n\n#### Parameters\n\n**mean** is a vector indicating the mean of a normal distribution.\n\n**covar** is a positive definite matrix indicating the variance-covariance matrix of a multivariate normal distribution.\n\n**count** is a positive number indicating the number of samples to be generated.\n\n**sampleAsRow** (optional) is a Boolean value. The default value is true indicating each row of the result is a sample. Otherwise each column of the result is a sample.\n\n#### Returns\n\nA matrix.\n\n#### Examples\n\n```\nmultivariateNormal([2, 3], [1.0, 1.5, 1.5, 3.0]$2:2, 5);\n```\n\n| #0        | #1        |\n| --------- | --------- |\n| -0.02395  | -0.844505 |\n| -0.630637 | 0.098955  |\n| 3.001908  | 4.831809  |\n| 0.791095  | 2.01402   |\n| 1.708191  | 2.41748   |\n\n```\nmultivariateNormal([2, 3], [1.0, 1.5, 1.5, 3.0]$2:2, 5, false);\n```\n\n| #0       | #1       | #2        | #3        | #4       |\n| -------- | -------- | --------- | --------- | -------- |\n| 0.435419 | 0.138209 | -0.046187 | -1.201421 | 0.069719 |\n| 0.40163  | 0.034553 | -0.337324 | -1.008628 | 0.822161 |\n"
    },
    "randNormal": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randNormal.html",
        "signatures": [
            {
                "full": "randNormal(mean, stdev, count)",
                "name": "randNormal",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "stdev",
                        "name": "stdev"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randNormal](https://docs.dolphindb.com/en/Functions/r/randNormal.html)\n\n\n\n#### Syntax\n\nrandNormal(mean, stdev, count)\n\n#### Details\n\nReturn a vector of random values with normal distribution.\n\n#### Parameters\n\n**mean** is the mean of a normal distribution.\n\n**stdev** is the standard deviation of a normal distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandNormal(2.31, 0.671, 2);\n// output: [2.805524, 2.148019]\n```\n"
    },
    "randomForestClassifier": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randomForestClassifier.html",
        "signatures": [
            {
                "full": "randomForestClassifier(ds, yColName, xColNames, numClasses, [maxFeatures=0], [numTrees=10], [numBins=32], [maxDepth=32], [minImpurityDecrease=0.0], [numJobs=-1], [randomSeed])",
                "name": "randomForestClassifier",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "numClasses",
                        "name": "numClasses"
                    },
                    {
                        "full": "[maxFeatures=0]",
                        "name": "maxFeatures",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[numTrees=10]",
                        "name": "numTrees",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[numBins=32]",
                        "name": "numBins",
                        "optional": true,
                        "default": "32"
                    },
                    {
                        "full": "[maxDepth=32]",
                        "name": "maxDepth",
                        "optional": true,
                        "default": "32"
                    },
                    {
                        "full": "[minImpurityDecrease=0.0]",
                        "name": "minImpurityDecrease",
                        "optional": true,
                        "default": "0.0"
                    },
                    {
                        "full": "[numJobs=-1]",
                        "name": "numJobs",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[randomSeed]",
                        "name": "randomSeed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [randomForestClassifier](https://docs.dolphindb.com/en/Functions/r/randomForestClassifier.html)\n\n\n\n#### Syntax\n\nrandomForestClassifier(ds, yColName, xColNames, numClasses, \\[maxFeatures=0], \\[numTrees=10], \\[numBins=32], \\[maxDepth=32], \\[minImpurityDecrease=0.0], \\[numJobs=-1], \\[randomSeed])\n\n#### Details\n\nFit a random forest classification model. The result is a dictionary with the following keys: numClasses, minImpurityDecrease, maxDepth, numBins, numTress, maxFeatures, model, modelName and xColNames. model is a tuple with the result of the trained trees; modelName is \"Random Forest Classifier\".\n\nThe fitted model can be used as an input for function [predict](https://docs.dolphindb.com/en/Functions/p/predict.html) .\n\n#### Parameters\n\n**ds** is the data sources to be trained. It can be generated with function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**yColName** is a string indicating the category column.\n\n**xColNames** is a string scalar/vector indicating the names of the feature columns.\n\n**numClasses** is a positive integer indicating the number of categories in the category column. The value of the category column must be integers in \\[0, numClasses).\n\n**maxFeatures** (optional) is an integer or a floating number indicating the number of features to consider when looking for the best split. The default value is 0.\n\n* if *maxFeatures* is a positive integer, then consider maxFeatures features at each split.\n\n* if *maxFeatures* is 0, then sqrt(the number of feature columns) features are considered at each split.\n\n* if *maxFeatures* is a floating number between 0 and 1, then int(*maxFeatures* \\* the number of feature columns) features are considered at each split.\n\n**numTrees** (optional) is a positive integer indicating the number of trees in the random forest. The default value is 10.\n\n**numBins** (optional) is a positive integer indicating the number of bins used when discretizing continuous features. The default value is 32. Increasing numBins allows the algorithm to consider more split candidates and make fine-grained split decisions. However, it also increases computation and communication time.\n\n**maxDepth** (optional) is a positive integer indicating the maximum depth of a tree. The default value is 32.\n\n**minImpurityDecrease** (optional) a node will be split if this split induces a decrease of the Gini impurity greater than or equal to this value. The default value is 0.\n\n**numJobs** (optional) is an integer indicating the maximum number of concurrently running jobs if set to a positive number. If set to -1, all CPU threads are used. If set to another negative integer, (the number of all CPU threads + numJobs + 1) threads are used.\n\n**randomSeed** (optional) is the seed used by the random number generator.\n\n#### Returns\n\nA dictionary containing the following keys: numClasses, minImpurityDecrease, maxDepth, numBins, numTress, maxFeatures, model, modelName, and xColNames. The model key is a tuple storing the trained trees; modelName is \"Random Forest Classifier\".\n\n#### Examples\n\nFit a random forest classification model with simulated data:\n\n```\nt = table(100:0, `cls`x0`x1, [INT,DOUBLE,DOUBLE])\ncls = take(0, 50)\nx0 = norm(-1.0, 1.0, 50)\nx1 = norm(-1.0, 1.0, 50)\ninsert into t values (cls, x0, x1)\ncls = take(1, 50)\nx0 = norm(1.0, 1.0, 50)\nx1 = norm(1.0, 1.0, 50)\ninsert into t values (cls, x0, x1)\n\nmodel = randomForestClassifier(sqlDS(<select * from t>), `cls, `x0`x1, 2);\n```\n\nUse the fitted model in forecasting:\n\n```\npredict(model, t)\n```\n\nSave the fitted model to disk:\n\n```\nsaveModel(model, \"C:/DolphinDB/Data/classificationModel.txt\");\n```\n\nLoad a saved model:\n\n```\nloadModel(\"C:/DolphinDB/data/classifierModel.bin\")\n```\n"
    },
    "randomForestRegressor": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randomForestRegressor.html",
        "signatures": [
            {
                "full": "randomForestRegressor(ds, yColName, xColNames, [maxFeatures=0], [numTrees=10], [numBins=32], [maxDepth=32], [minImpurityDecrease=0.0], [numJobs=-1], [randomSeed])",
                "name": "randomForestRegressor",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[maxFeatures=0]",
                        "name": "maxFeatures",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[numTrees=10]",
                        "name": "numTrees",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[numBins=32]",
                        "name": "numBins",
                        "optional": true,
                        "default": "32"
                    },
                    {
                        "full": "[maxDepth=32]",
                        "name": "maxDepth",
                        "optional": true,
                        "default": "32"
                    },
                    {
                        "full": "[minImpurityDecrease=0.0]",
                        "name": "minImpurityDecrease",
                        "optional": true,
                        "default": "0.0"
                    },
                    {
                        "full": "[numJobs=-1]",
                        "name": "numJobs",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[randomSeed]",
                        "name": "randomSeed",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [randomForestRegressor](https://docs.dolphindb.com/en/Functions/r/randomForestRegressor.html)\n\n\n\n#### Syntax\n\nrandomForestRegressor(ds, yColName, xColNames, \\[maxFeatures=0], \\[numTrees=10], \\[numBins=32], \\[maxDepth=32], \\[minImpurityDecrease=0.0], \\[numJobs=-1], \\[randomSeed])\n\n#### Details\n\nFit a random forest regression model. The result is a dictionary with the following keys: minImpurityDecrease, maxDepth, numBins, numTress, maxFeatures, model, modelName and xColNames. model is a tuple with the result of the trained trees; modelName is \"Random Forest Regressor\".\n\nThe fitted model can be used as an input for function [predict](https://docs.dolphindb.com/en/Functions/p/predict.html) .\n\n#### Parameters\n\n**ds** is the data sources to be trained. It can be generated with function [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html).\n\n**yColName** is a string indicating the dependent variable column.\n\n**xColNames** is a string scalar/vector indicating the names of the feature columns.\n\n**maxFeatures** (optional) is an integer or a floating number indicating the number of features to consider when looking for the best split. The default value is 0.\n\n* if *maxFeatures* is a positive integer, then consider maxFeatures features at each split.\n\n* if *maxFeatures* is 0, then sqrt(the number of feature columns) features are considered at each split.\n\n* if *maxFeatures* is a floating number between 0 and 1, then int(*maxFeatures* \\* the number of feature columns) features are considered at each split.\n\n**numTrees** (optional) is a positive integer indicating the number of trees in the random forest. The default value is 10.\n\n**numBins** (optional) is a positive integer indicating the number of bins used when discretizing continuous features. The default value is 32. Increasing numBins allows the algorithm to consider more split candidates and make fine-grained split decisions. However, it also increases computation and communication time.\n\n**maxDepth** (optional) is a positive integer indicating the maximum depth of a tree. The default value is 32.\n\n**minImpurityDecrease** (optional) a node will be split if this split induces a decrease of impurity greater than or equal to this value. The default value is 0.\n\n**numJobs** (optional) is an integer indicating the maximum number of concurrently running jobs if set to a positive number. If set to -1, all CPU threads are used. If set to another negative integer, (the number of all CPU threads + numJobs + 1) threads are used.\n\n**randomSeed** (optional) is the seed used by the random number generator.\n\n#### Returns\n\nA dictionary containing the following keys: minImpurityDecrease, maxDepth, numBins, numTress, maxFeatures, model, modelName, and xColNames. The model key is a tuple storing the trained trees; modelName is \"Random Forest Regressor\".\n\n#### Examples\n\nFit a random forest regression model with simulated data:\n\n```\nx1 = rand(100.0, 100)\nx2 = rand(100.0, 100)\nb0 = 6\nb1 = 1\nb2 = -2\nerr = norm(0, 10, 100)\ny = b0 + b1 * x1 + b2 * x2 + err\nt = table(x1, x2, y)\nmodel = randomForestRegressor(sqlDS(<select * from t>), `y, `x1`x2)\nyhat=predict(model, t);\n\nplot(y, yhat, ,SCATTER);\n```\n\nSave the trained model to disk:\n\n```\nsaveModel(model, \"C:/DolphinDB/Data/regressionModel.txt\");\n```\n\nLoad a saved model:\n\n```\nmodel=loadModel(\"C:/DolphinDB/Data/regressionModel.txt\");\n```\n"
    },
    "randPoisson": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randPoisson.html",
        "signatures": [
            {
                "full": "randPoisson(mean, count)",
                "name": "randPoisson",
                "parameters": [
                    {
                        "full": "mean",
                        "name": "mean"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randPoisson](https://docs.dolphindb.com/en/Functions/r/randPoisson.html)\n\n\n\n#### Syntax\n\nrandPoisson(mean, count)\n\n#### Details\n\nReturn a vector of random values with Poisson distribution.\n\n#### Parameters\n\n**mean** is the mean of a Poisson distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandPoisson(2.31, 2);\n// output: [7, 2]\n```\n"
    },
    "randStudent": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randStudent.html",
        "signatures": [
            {
                "full": "randStudent(df, count)",
                "name": "randStudent",
                "parameters": [
                    {
                        "full": "df",
                        "name": "df"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randStudent](https://docs.dolphindb.com/en/Functions/r/randStudent.html)\n\n\n\n#### Syntax\n\nrandStudent(df, count)\n\n#### Details\n\nReturn a vector of random values with Student's t-distribution.\n\n#### Parameters\n\n**df** is a positive floating number indicating the degree of freedom of a Student's t-distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandStudent(2.31, 2);\n// output: [-0.543993, 0.375804]\n```\n"
    },
    "randUniform": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randUniform.html",
        "signatures": [
            {
                "full": "randUniform(lower, upper, count)",
                "name": "randUniform",
                "parameters": [
                    {
                        "full": "lower",
                        "name": "lower"
                    },
                    {
                        "full": "upper",
                        "name": "upper"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randUniform](https://docs.dolphindb.com/en/Functions/r/randUniform.html)\n\n\n\n#### Syntax\n\nrandUniform(lower, upper, count)\n\n#### Details\n\nReturn a vector of random values with continuous uniform distribution.\n\n#### Parameters\n\n**lower** and **upper** are numeric scalars indicating the lower bound and upper bound of a continuous uniform distribution.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandUniform(0.61, 2.31, 2);\n// output: [2.064851, 2.263172]\n```\n"
    },
    "randWeibull": {
        "url": "https://docs.dolphindb.com/en/Functions/r/randWeibull.html",
        "signatures": [
            {
                "full": "randWeibull(alpha, beta, count)",
                "name": "randWeibull",
                "parameters": [
                    {
                        "full": "alpha",
                        "name": "alpha"
                    },
                    {
                        "full": "beta",
                        "name": "beta"
                    },
                    {
                        "full": "count",
                        "name": "count"
                    }
                ]
            }
        ],
        "markdown": "### [randWeibull](https://docs.dolphindb.com/en/Functions/r/randWeibull.html)\n\n\n\n#### Syntax\n\nrandWeibull(alpha, beta, count)\n\n#### Details\n\nReturn a vector of random values with Weibull distribution.\n\n#### Parameters\n\nThe scale parameter **alpha** and the shape parameter **beta** are both positive floating numbers.\n\n**count** is the number of random values to be generated.\n\n#### Returns\n\nA DOUBLE vector of length *count*.\n\n#### Examples\n\n```\nrandWeibull(2.31,0.61, 2);\n// output: [0.524197, 0.51402]\n```\n"
    },
    "rank": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rank.html",
        "signatures": [
            {
                "full": "rank(X, [ascending=true], [groupNum], [ignoreNA=true], [tiesMethod='min'], [percent=false], [precision])",
                "name": "rank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[groupNum]",
                        "name": "groupNum",
                        "optional": true
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='min']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'min'"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[precision]",
                        "name": "precision",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [rank](https://docs.dolphindb.com/en/Functions/r/rank.html)\n\n\n\n#### Syntax\n\nrank(X, \\[ascending=true], \\[groupNum], \\[ignoreNA=true], \\[tiesMethod='min'], \\[percent=false], \\[precision])\n\n#### Details\n\nBased on the sort order specified by *ascending*, this function returns the ranking (starting from 0) of each element in *X*.\n\nIf *X* is a vector, return a vector with the same length as *X*:\n\n* If *groupNum* is specified, divide the sorted vector *X* into *groupNum* groups and return the group number (starting from 0) for each element in *X*.\n\n  * If the number of elements in *X* cannot be divided by *groupNum*, the first *mod(size(X), groupNum)* groups will hold one more element. For example, *X* has 6 elements, groupNum is specified as 4, the first and second elements of sorted vector *X* belong to group 0, the third and fourth elements belong to group 1, and the fifth and sixth elements belong to groups 2 and 3, respectively.\n\n  * If the identical elements are not divided in the same group, return the smallest group number for all identical elements.\n\n* If *ignoreNA* = true, null values are ignored and return NULL.\n\nIf *X* is a matrix/table, conduct the aforementioned calculation within each column of *X*. The result is a matrix/table with the same shape as *X*.\n\nIf *X* is a dictionary, the ranking is based on its values, and the ranks of all elements are returned.\n\n#### Parameters\n\n**X** is a vector/matrix/table/dictionary.\n\n**ascending** (optional) is a Boolean value indicating whether the sorting is in ascending order. The default value is true (ascending).\n\n**groupNum** (optional) is a positive integer indicating the number of groups to sort X into.\n\n**ignoreNA** (optional) is a Boolean value indicating whether null values are ignored.\n\n**tiesMethod** (optional) is a string indicating how to rank the group of elements with the same value (i.e., ties):\n\n* 'min' : the smallest rank value of the tie values.\n\n* 'max' : the largest rank value of the tie values.\n\n* 'average' : the average of the rank values for all ties.\n\n* 'first': Gives the first found tie value the lowest rank value, and continues with the following rank value for the next tie.\n\n**percent** (optional) is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n**precision** (optional) is an integer between \\[1, 15]. If the absolute difference between two values is no greater than 10^(-precision), the two values are considered to be equal.\n\n**Note:**\n\nIf parameter *precision* is specified, *X* must be numeric, and the *tiesMethod* cannot be specified as 'first'.\n\n#### Returns\n\nAn INT vector.\n\n#### Examples\n\nExample 1. Basic ranking (ascending/descending)\n\n```\nrank(45 16 32 21);\n// output: [3,0,2,1]\n\nrank(45 16 32 21, false);\n// output: [0,3,1,2]\n\nrank(9 1 6 1 3 3);\n// output: [5,0,4,0,2,2]\n// two identical elements have the same ranking.\n```\n\nFor floating-point numbers, the comparison precision can be controlled using the *precision* parameter. When the absolute difference between two values is no greater than 10^(-precision), they are considered equal. In the example below, after setting `precision = 6`, 1.0000001, 1.0000002, and 1.0000003 are treated as equal (all receive rank 0), while 2.0001 and 2.0002 are not equal.\n\n```\nrank(1.0000001 1.0000002 1.0000003 2.0001 2.0002)\n// output: [0,1,2,3,4]  \nrank(1.0000001 1.0000002 1.0000003 2.0001 2.0002, precision=6);  \n// output: [0,0,0,3,4]\n```\n\nExample 2. Handling duplicate values using the *tiesMethod* parameter.\n\n```\nrank(9 1 6 1 3 3);\n// output: [5,0,4,0,2,2]\n\nrank(X=1 2 2 3, tiesMethod='min');\n// output: [0,1,1,3]\n\nrank(X=1 2 2 3, tiesMethod='average');\n// output: [0,1.5,1.5,3]\n\nrank(X=1 2 2 3, tiesMethod='first');\n// output: [0,1,2,3]\n```\n\nExample 3. Specifying the *groupNum* parameter for grouped ranking\n\nNote: The sorted elements are divided into a specified number of groups, and the group index (starting from 0) for each element is returned. If the elements cannot be evenly divided, the earlier groups will contain one more element. Identical elements will be assigned the smallest group index.\n\n```\nrank(X=9 5 4 8 1 3 6 2 7, groupNum=3);\n// output: [2,1,1,2,0,0,1,0,2]\n\nrank(X=9 5 4 8 1 3 6 2 7, groupNum=6)\n// output: [5,2,1,4,0,1,2,0,3]\n\nrank(X=9 5 4 8 1 3 6 2 7, ascending=false, groupNum=3);\n// output: [0,1,1,0,2,2,1,2,0]\n\n```\n\nExample 4. Handling null values using the *ignoreNA* parameter\n\n```\nrank(1 NULL NULL 3);\n// output: [0,,,1]\n\nrank(X=1 NULL NULL 3, ignoreNA=false);\n// output: [2,0,0,3]\n```\n\nExample 5. Specifying `percent=true` to return rankings in percentage form\n\n```\nrank(45 16 32 21);  \n// output: [3,0,2,1]  \n  \nrank(45 16 32 21, percent=true);  \n// output: [1,0.25,0.75,0.5]\n```\n\nExample 6. Using the rank function in SQL queries, combined with the context by clause to rank grouped data.\n\n```\nt=table(1 1 1 2 2 2 2 as id, 3 5 4 6 2 7 1 as x)\nt\n```\n\n| id | x |\n| -- | - |\n| 1  | 3 |\n| 1  | 5 |\n| 1  | 4 |\n| 2  | 6 |\n| 2  | 2 |\n| 2  | 7 |\n| 2  | 1 |\n\n```\nselect *, rank(x) from t context by id;\n```\n\n| id | x | rank\\_x |\n| -- | - | ------- |\n| 1  | 3 | 0       |\n| 1  | 5 | 2       |\n| 1  | 4 | 1       |\n| 2  | 6 | 2       |\n| 2  | 2 | 1       |\n| 2  | 7 | 3       |\n| 2  | 1 | 0       |\n\n```\nrank(dict(`a`b`c, [4, 1, 2],true))\n// output: [2, 0, 1]\n```\n"
    },
    "ratio": {
        "url": "https://docs.dolphindb.com/en/Functions/r/ratio.html",
        "signatures": [
            {
                "full": "ratio(X, Y)",
                "name": "ratio",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [ratio](https://docs.dolphindb.com/en/Functions/r/ratio.html)\n\n\n\n#### Syntax\n\nratio(X, Y) or X\\Y\n\n#### Details\n\nReturns element-by-element ratio of *X* to *Y*. Function `ratio` always returns floating numbers. If both *X* and *Y* are integer/long, `ratio` converts them into floating numbers and then conduct division. This is different from operator [div](https://docs.dolphindb.com/en/Functions/d/div.html) (/) , which does not convert integer/long to floating numbers. Another difference with `div` is that *Y* can be negative integers when *X* is integer.\n\n#### Parameters\n\n**X** and **Y** is a scalar/pair/vector/matrix.\n\nIf *X* or *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\nA DOUBLE scalar, pair, vector, or matrix.\n\n#### Examples\n\n```\n9\\2:5;\n// output: 4.5 : 1.8\n\n11:25\\3:4;\n// output: 3.666667 : 6.25\n\nx=1 2 3;\nx \\ 2;\n// output: [0.5,1,1.5]\n\n2 \\ x;\n// output: [2,1,0.666667]\n\ny=4 5 6;\n x \\ y;\n// output: [0.25,0.4,0.5]\n\ny \\ x;\n// output: [4,2.5,2]\n\nm1=1..6$2:3;\nm1\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\n m1\\2;\n```\n\n| #0  | #1  | #2  |\n| --- | --- | --- |\n| 0.5 | 1.5 | 2.5 |\n| 1   | 2   | 3   |\n\n```\nm2=6..1$2:3;\nm2\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1\\m2;\n```\n\n| #0       | #1       | #2  |\n| -------- | -------- | --- |\n| 0.166667 | 0.75     | 2.5 |\n| 0.4      | 1.333333 | 6S  |\n\n```\n-7\\5;\n// output: -1.4\n\nx=-1 2 3;\nx\\-5;\n// output: [0.2,-0.4,-0.6]\n```\n"
    },
    "ratios": {
        "url": "https://docs.dolphindb.com/en/Functions/r/ratios.html",
        "signatures": [
            {
                "full": "ratios(X)",
                "name": "ratios",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [ratios](https://docs.dolphindb.com/en/Functions/r/ratios.html)\n\n\n\n#### Syntax\n\nratios(X)\n\n#### Details\n\nIf *X* is a vector, return X(n)\\X(n-1) by scanning *X*. The first element of the result is always null.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*. The result is a matrix with the same shape as *X*.\n\n#### Parameters\n\n**X** is a vector or a matrix.\n\n#### Returns\n\nSame data type and form as *X*.\n\n#### Examples\n\n```\nx=3 12 0 -5 32;\nratios x;\n// output: [,4,0,,-6.4]\n\nx=2 3 6 NULL 28 7;\nratios x;\n// output: [,1.5,2,,,0.25]\n\nm=matrix(100 105 109 112 108 116, 200 212 208 199 206 210);\nm;\n```\n\n| #0  | #1  |\n| --- | --- |\n| 100 | 200 |\n| 105 | 212 |\n| 109 | 208 |\n| 112 | 199 |\n| 108 | 206 |\n| 116 | 210 |\n\n```\nratios(m);\n```\n\n| #0                | #1                |\n| ----------------- | ----------------- |\n|                   |                   |\n| 1.05              | 1.06              |\n| 1.038095238095238 | 0.981132075471698 |\n| 1.027522935779817 | 0.956730769230769 |\n| 0.964285714285714 | 1.035175879396985 |\n| 1.074074074074074 | 1.019417475728155 |\n"
    },
    "rdp": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rdp.html",
        "signatures": [
            {
                "full": "rdp(pointList, epsilon)",
                "name": "rdp",
                "parameters": [
                    {
                        "full": "pointList",
                        "name": "pointList"
                    },
                    {
                        "full": "epsilon",
                        "name": "epsilon"
                    }
                ]
            }
        ],
        "markdown": "### [rdp](https://docs.dolphindb.com/en/Functions/r/rdp.html)\n\n\n\n#### Syntax\n\nrdp(pointList, epsilon)\n\n#### Details\n\nUse RDP (Ramer-Douglas-Peucker) vector compression algorithm to compress the POINT type vector.\n\n#### Parameters\n\n**pointList** is a POINT vector which cannot contain null values.\n\n**epsilon** is a non-negative DOUBLE type scalar that represents the compression threshold.\n\n#### Returns\n\nA POINT vector.\n\n#### Examples\n\n```\npt = point(1 2 3 4, 1 2 3 4)\nrdp(pt, 0.1)\n// output: [(1.0, 1.0), (4.0, 4.0)]\n​\npt = point(1 2 3 4, 1 3 3 4)\nrdp(pt, 0.1)\n// output: [(1.0, 1.0), (2.0, 3.0), (3.0, 3.0), (4.0, 4.0)]\n\ntemp = array(POINT,0)\nn=90000\nx_data = rand(10.0,n)\ny_data = rand(10.0,n)\nindex=0\ndo{\ntemp.append!(point(x_data[index], y_data[index]))\nindex += 1\n}while(index<n)\ns=rdp(temp, 0.8)\nprint(s.size())\n// output: 82002\nprint(temp.size())\n// output: 90000\n```\n"
    },
    "read!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/read!.html",
        "signatures": [
            {
                "full": "read!(handle, holder, [offset=0], [length=1])",
                "name": "read!",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "holder",
                        "name": "holder"
                    },
                    {
                        "full": "[offset=0]",
                        "name": "offset",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[length=1]",
                        "name": "length",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [read!](https://docs.dolphindb.com/en/Functions/r/read!.html)\n\n\n\n#### Syntax\n\nread!(handle, holder, \\[offset=0], \\[length=1])\n\n#### Details\n\nRead a given number of data points from the handle and save them to the holder starting from the given offset, and return the number of data points read. The type of data to read is the same as the type of the holder.\n\nThe [readBytes](https://docs.dolphindb.com/en/Functions/r/readBytes.html) function always returns a new CHAR vector. It takes some time to create a new vector buffer. To improve the performance, we can create a buffer and reuse it. `read!` is such a function that accepts an existing buffer.Another advantage of the `read!` function is that we don't need to know the exact number of bytes to read. The function returns if it reaches the end of the file or if the give number of bytes have been read. If the returned count is less than expected, it indicates the file has reached the end.\n\n#### Parameters\n\n**handle** is the handle of the file to read.\n\n**holder** is the variable that saves the data that are imported into the system.\n\n**offset** is the starting position of the holder to save the data.\n\n**length** is the number of data points to read.\n\n#### Returns\n\nThe number of data points actually read.\n\n#### Examples\n\nThis example defines a function to copy a file:\n\n```\ndef fileCopy(source, target){\ns = file(source)\nt = file(target,\"w\")\nbuf = array(CHAR,1024)\ndo{\n  numByte = s.read!(buf,0,1024)\n  t.write(buf,0, numByte)\n}while(numByte==1024)\n}\nfileCopy(\"test.txt\",\"testcopy.txt\");\n```\n"
    },
    "readBytes": {
        "url": "https://docs.dolphindb.com/en/Functions/r/readBytes.html",
        "signatures": [
            {
                "full": "readBytes(fileHandle, sizeInByte)",
                "name": "readBytes",
                "parameters": [
                    {
                        "full": "fileHandle",
                        "name": "fileHandle"
                    },
                    {
                        "full": "sizeInByte",
                        "name": "sizeInByte"
                    }
                ]
            }
        ],
        "markdown": "### [readBytes](https://docs.dolphindb.com/en/Functions/r/readBytes.html)\n\n\n\n#### Syntax\n\nreadBytes(fileHandle, sizeInByte)\n\n#### Details\n\nRead the given number of bytes from the handle. If the file reaches the end or an IO error occurs, an IOException will be raised; otherwise a buffer containing the given number of bytes will return. We must know the exact number of bytes to read before calling this function.\n\n#### Parameters\n\n**fileHandle** is the handle of the file to read.\n\n**sizeInByte** is an integer indicating the number of bytes to read.\n\n#### Returns\n\nA buffer containing the specified number of bytes.\n\n#### Examples\n\nThis example defines a function to copy a file:\n\n```\ndef fileCopy(source, target){\ns = file(source)\nlen = s.seek(0,TAIL)\ns.seek(0,HEAD)\nt = file(target,\"w\")\nif(len==0) return\ndo{\n  buf = s.readBytes(min(len,1024))\n  t.writeBytes(buf)\n  len -= buf.size()\n}while(len)\n};\nfileCopy(\"test.txt\",\"testcopy.txt\");\n```\n"
    },
    "readLine": {
        "url": "https://docs.dolphindb.com/en/Functions/r/readLine.html",
        "signatures": [
            {
                "full": "readLine(handle)",
                "name": "readLine",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    }
                ]
            }
        ],
        "markdown": "### [readLine](https://docs.dolphindb.com/en/Functions/r/readLine.html)\n\n\n\n#### Syntax\n\nreadLine(handle)\n\n#### Details\n\nRead a line from the given file. The return line doesn't include the line delimiter. If the file reaches the end, the function will return a null object which can be tested by the [isVoid](https://docs.dolphindb.com/en/Functions/i/isVoid.html) function.\n\n#### Parameters\n\n**handle** is the handle of the file to read.\n\n#### Returns\n\nThe returned line does not include the line delimiter. If the end of the file is reached, the function returns a NULL object, which can be tested with [isVoid](https://docs.dolphindb.com/en/Functions/i/isVoid.html).\n\n#### Examples\n\n```\nx=`IBM`MSFT`GOOG`YHOO`ORCL;\neachRight(writeLine, file(\"test.txt\",\"w\"), x);\n// output: [1,1,1,1,1]\n\n fin = file(\"test.txt\")\n do{\n x=fin.readLine()\n if(x.isVoid()) break\n print x\n }while(true);\n\n/* output:\nIBM\nMSFT\nGOOG\nYHOO\nORCL\n*/\n```\n\nRelated function: [writeLine](https://docs.dolphindb.com/en/Functions/w/writeLine.html)\n"
    },
    "readLines!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/readLines!.html",
        "signatures": [
            {
                "full": "readLines!(handle, holder, [offset=0], [length=1])",
                "name": "readLines!",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "holder",
                        "name": "holder"
                    },
                    {
                        "full": "[offset=0]",
                        "name": "offset",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[length=1]",
                        "name": "length",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [readLines!](https://docs.dolphindb.com/en/Functions/r/readLines!.html)\n\n\n\n#### Syntax\n\nreadLines!(handle, holder, \\[offset=0], \\[length=1])\n\n#### Details\n\nRead a number of lines from the handle and save them to holder starting from the given offset, and return the number of lines read.\n\nThe [readLines](https://docs.dolphindb.com/en/Functions/r/readLines.html) function returns a string vector for every call. It takes a certain amount of time to create a string vector, so it saves time if we can reuse the same vector as the buffer when a function call repeats. `readLines!` is such a function that accepts the existing buffer as data holder. The 2 examples below read the same amount of data for 100 times. It is faster to use `readLines!` than `readLines` .\n\n#### Parameters\n\n**handle** is the handle of the file to read.\n\n**holder** is the variable that saves the data that are imported into the system.\n\n**offset** (optional) is the starting position of the holder to save the lines.\n\n**length** (optional) is the number of lines to read.\n\n#### Returns\n\nThe number of lines actually read.\n\n#### Examples\n\n```\ntimer(100){\nfin = file(\"test.txt\")\ndo{ y=fin.readLines(1024) } while(y.size()==1024)\nfin.close()\n};\n// Time elapsed: 79.511 ms\n\ntimer(100){\nfin = file(\"test.txt\")\ny=array(STRING,1024)\ndo{ lines = fin.readLines!(y,0,1024) } while(lines==1024)\nfin.close()\n};\n// Time elapsed: 56.034 ms\n```\n"
    },
    "readLines": {
        "url": "https://docs.dolphindb.com/en/Functions/r/readLines.html",
        "signatures": [
            {
                "full": "readLines(handle, [length=1024])",
                "name": "readLines",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "[length=1024]",
                        "name": "length",
                        "optional": true,
                        "default": "1024"
                    }
                ]
            }
        ],
        "markdown": "### [readLines](https://docs.dolphindb.com/en/Functions/r/readLines.html)\n\n\n\n#### Syntax\n\nreadLines(handle, \\[length=1024])\n\n#### Details\n\nRead a given number of lines from the handle. The function returns if the handle reaches the end or the given number of lines has been read.\n\n#### Parameters\n\n**handle** is the handle of the file to read.\n\n**length** (optional) is the number of lines from the handle to read. The default number of lines to read is 1024.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ntimer(10){\nx=rand(`IBM`MSFT`GOOG`YHOO`ORCL,10240)\neachRight(writeLine, file(\"test.txt\",\"w\"),x)\nfin = file(\"test.txt\")\ndo{\n   y=fin.readLine()\n} while(!y.isVoid())\nfin.close()\n};\n// Time elapsed 277.548 ms ms\n\n\ntimer(10){\nx=rand(`IBM`MSFT`GOOG`YHOO`ORCL,10240)\nfile(\"test.txt\",\"w\").writeLines(x)\nfin = file(\"test.txt\")\ndo{\n   y=fin.readLines(1024)\n} while(y.size()==1024)\n fin.close()\n};\n// Time elapsed 28.003 ms\n```\n"
    },
    "readObject": {
        "url": "https://docs.dolphindb.com/en/Functions/r/readObject.html",
        "signatures": [
            {
                "full": "readObject(handle)",
                "name": "readObject",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    }
                ]
            }
        ],
        "markdown": "### [readObject](https://docs.dolphindb.com/en/Functions/r/readObject.html)\n\n\n\n#### Syntax\n\nreadObject(handle)\n\n#### Details\n\nCan read all data structures including scalar, vector, matrix, set, dictionary and table to the handle. It must be executed by a logged-in user.\n\n#### Parameters\n\n**handle** is the handle of the object to read.\n\n#### Returns\n\nThe content read from the file.\n\n#### Examples\n\n```\na1=10.5\na2=1..10\na3=cross(*,1..5,1..10)\na4=set(`IBM`MSFT`GOOG`YHOO)\na5=dict(a4.keys(),125.6 53.2 702.3 39.7)\na6=table(1 2 3 as id, `Jenny`Tom`Jack as name)\na7=(1 2 3, \"hello world!\", 25.6)\n\nfout=file(\"test.bin\",\"w\")\nfout.writeObject(a1)\nfout.writeObject(a2)\nfout.writeObject(a3)\nfout.writeObject(a4)\nfout.writeObject(a5)\nfout.writeObject(a6)\nfout.writeObject(a7)\nfout.close();\n```\n\nThe script above writes 7 different types of objects to a file. The script below reads out those 7 objects from the file and prints out a short description of the objects.\n\n```\nfin = file(\"test.bin\")\nfor(i in 0:7) print typestr fin.readObject()\nfin.close();\n/* output:\n DOUBLE\n FAST INT VECTOR\n INT MATRIX\n STRING SET\n STRING->DOUBLE Dictionary\n TABLE\n ANY VECTOR\n*/\n```\n"
    },
    "readRecord!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/readRecord!.html",
        "signatures": [
            {
                "full": "readRecord!(handle, holder, [offset=0], [length])",
                "name": "readRecord!",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "holder",
                        "name": "holder"
                    },
                    {
                        "full": "[offset=0]",
                        "name": "offset",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[length]",
                        "name": "length",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [readRecord!](https://docs.dolphindb.com/en/Functions/r/readRecord!.html)\n\n\n\n#### Syntax\n\nreadRecord!(handle, holder, \\[offset=0], \\[length])\n\n#### Details\n\nConvert binary files to DolphinDB data objects. DolhinDB also provides the function [writeRecord](https://docs.dolphindb.com/en/Functions/w/writeRecord.html) to covert DolphinDB data objects to binary files that can be used by other programs. The binary files should be row-based and each row should contain records with fixed data types and lengths. For example, if a binary file contains 5 data fields with the following type (length): char(1), boolean(1), short(2), int(4), long(8), and double(8), the function `readRecord!` will treat every 24 bytes as a new row. Similarly, the function `writeRecord` converts DolphinDB objects such as tables or tuples to binary files with the aforementioned format.\n\n#### Parameters\n\n**handle** is a binary file handle.\n\n**holder** is a table or a tuple with array elements of equal size.\n\n**offset** (optional) specifies the starting row position.\n\n**length** (optional) indicates the number of rows to be loaded.\n\n#### Returns\n\nThe number of rows read.\n\n#### Examples\n\n```\n// create a file handle for reading records. The binary file a.bin contains 1000 records\nf=file(\"c:/DB/a.bin\")\nt=table(1000:0, `PERMNO`PRC`VOL`SHROUT, `int`double`int`double)\nf.readRecord!(t);\n// output: 1000\n\n// similarily, we can load a binary file to a DolphinDB tuple object\nf=file(\"c:/DB/a.bin\")\nt=loop(array, [int, double, int, double], 0, 500)\n// create tuple t with 4 array elements. The size of each array is 500.\n f.readRecord!(t, 0, 500);\n// read the first 500 rows\n// output: 500\n```\n"
    },
    "rebalanceChunksAmongDataNodes": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rebalanceChunksAmongDataNodes.html",
        "signatures": [
            {
                "full": "rebalanceChunksAmongDataNodes([exec = false], [updatedBeforeDays = 7.0])",
                "name": "rebalanceChunksAmongDataNodes",
                "parameters": [
                    {
                        "full": "[exec = false]",
                        "name": "[exec = false]"
                    },
                    {
                        "full": "[updatedBeforeDays = 7.0]",
                        "name": "[updatedBeforeDays = 7.0]"
                    }
                ]
            }
        ],
        "markdown": "### [rebalanceChunksAmongDataNodes](https://docs.dolphindb.com/en/Functions/r/rebalanceChunksAmongDataNodes.html)\n\n\n\n#### Syntax\n\nrebalanceChunksAmongDataNodes(\\[exec = false], \\[updatedBeforeDays = 7.0])\n\n#### Details\n\nThis function is used to rebalance data among disks for optimal performance after a cluster is scaled up. It can only be executed on a controller by an administrator.\n\nReturn a table containing the following columns:\n\n| name       | meaning                   |\n| ---------- | ------------------------- |\n| chunkId    | the chunk ID              |\n| srcNode    | alias of source node      |\n| destNode   | alias of destination node |\n| destVolume | destination volume        |\n\nAfter invoking this function, the system will print INFO-level logs that include the disk usage rate before and after rebalancing, in the following format:\n\n```\n[rebalance] Expected change of disk usage rate is before -> after\n[rebalance] Change of disk usage rate in IP@fsid(1/disk count) is before -> after\n[rebalance] Change of disk usage rate in IP@fsid(2/disk count) is before -> after\n...\n```\n\nYou can get the status of recovery tasks by [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html) on a controller.\n\n#### Parameters\n\n**exec** (optional) is a Boolean value indicating whether to initiate data rebalancing. The default value is false, meaning that data rebalancing will not be executed and only the rebalancing plan will be returned.\n\n**updatedBeforeDays** (optional) is a non-negative floating-point number, which limits the rebalancing process to only include chunks that were updated before *updatedBeforeDays*. The default value is 7 (in days).\n\n#### Returns\n\nA table containing the following columns: srcNode, chunkId, destNode, and destVolume.\n\n#### Examples\n\n```\nrebalanceChunksAmongDataNodes()\n```\n\n| srcNode | chunkId                              | destNode | destVolume              |\n| ------- | ------------------------------------ | -------- | ----------------------- |\n| node1   | 99279094-ca12-3b87-48b6-520cbb986f39 | node2    | /home/xxx/node2/storage |\n| node1   | 45f612b8-42f5-aebd-4cef-e522b6ae1fc8 | node2    | /home/xxx/node2/storage |\n"
    },
    "rebalanceChunksWithinDataNode": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rebalanceChunksWithinDataNode.html",
        "signatures": [
            {
                "full": "rebalanceChunksWithinDataNode(nodeAlias, [exec = false], [updatedBeforeDays = 7.0])",
                "name": "rebalanceChunksWithinDataNode",
                "parameters": [
                    {
                        "full": "nodeAlias",
                        "name": "nodeAlias"
                    },
                    {
                        "full": "[exec = false]",
                        "name": "[exec = false]"
                    },
                    {
                        "full": "[updatedBeforeDays = 7.0]",
                        "name": "[updatedBeforeDays = 7.0]"
                    }
                ]
            }
        ],
        "markdown": "### [rebalanceChunksWithinDataNode](https://docs.dolphindb.com/en/Functions/r/rebalanceChunksWithinDataNode.html)\n\n\n\n#### Syntax\n\nrebalanceChunksWithinDataNode(nodeAlias, \\[exec = false], \\[updatedBeforeDays = 7.0])\n\n#### Details\n\nAfter 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 in cluster mode.\n\nStarting from 2.00.12, `rebalanceChunksWithinDataNode` is supported in the standalone mode.\n\nReturn a table containing the following columns:\n\n| name       | meaning            |\n| ---------- | ------------------ |\n| chunkId    | the chunk ID       |\n| srcVolume  | source volume      |\n| destVolume | destination volume |\n\nYou can get the status of recovery tasks by [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html) on a controller.\n\n#### Parameters\n\n**nodeAlias** is a string indicating the alias of a node.\n\n**exec** (optional) is a Boolean value indicating whether to initiate data rebalancing within a data node. The default value is false, meaning that data rebalancing will not be executed and only the rebalancing plan will be returned.\n\n**updatedBeforeDays** (optional) is a non-negative floating-point number, which limits the rebalancing process to only include chunks that were updated before *updatedBeforeDays*. The default value is 7 (in days).\n\n#### Returns\n\nA table showing the data rebalancing plan across disk volumes, containing chunkId, srcVolume, and destVolume.\n\n#### Examples\n\n```\nrebalanceChunksWithinDataNode(\"node1\")\n```\n\n| ChunkId                              | srcVolume         | destVolume        |\n| ------------------------------------ | ----------------- | ----------------- |\n| 82c6eb6c-36ee-b1b6-4a86-ca24d9faaa25 | /hdd/hdd1/volumes | /hdd/hdd2/volumes |\n"
    },
    "reciprocal": {
        "url": "https://docs.dolphindb.com/en/Functions/r/reciprocal.html",
        "signatures": [
            {
                "full": "reciprocal(X)",
                "name": "reciprocal",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [reciprocal](https://docs.dolphindb.com/en/Functions/r/reciprocal.html)\n\n\n\n#### Syntax\n\nreciprocal(X)\n\n#### Details\n\nReturn element-by-element reciprocal of *X*. The data type of the result is always DOUBLE.\n\nDolphinDB's `reciprocal` and NumPy's `numpy.reciprocal` are mathematically equivalent, but they handle integer inputs differently. NumPy preserves the integer dtype, so 1/2 evaluates to 0; whereas DolphinDB automatically performs floating-point computation and returns 0.5. For example, In Dolphindb, `reciprocal([1,2, 4])` returns \\[1,0.5,0.25], while `np.reciprocal([1, 2, 4])` returns \\[1,0,0]. If NumPy uses floating-point input data, its result is consistent with DolphinDB.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nDOUBLE data type.\n\n#### Examples\n\n```\nreciprocal(10);\n// output: 0.1\n\nreciprocal(1 2 4 8);\n// output: [1,0.5,0.25,0.125]\n\nreciprocal(1 2 4 8$2:2);\n```\n\n| #0  | #1    |\n| --- | ----- |\n| 1   | 0.25  |\n| 0.5 | 0.125 |\n"
    },
    "recursiveSplitText": {
        "url": "https://docs.dolphindb.com/en/Functions/r/recursiveSplitText.html",
        "signatures": [
            {
                "full": "recursiveSplitText(text, [maxLength=300], [chunkOverlap=20], [separators], [keepSeparator=true])",
                "name": "recursiveSplitText",
                "parameters": [
                    {
                        "full": "text",
                        "name": "text"
                    },
                    {
                        "full": "[maxLength=300]",
                        "name": "maxLength",
                        "optional": true,
                        "default": "300"
                    },
                    {
                        "full": "[chunkOverlap=20]",
                        "name": "chunkOverlap",
                        "optional": true,
                        "default": "20"
                    },
                    {
                        "full": "[separators]",
                        "name": "separators",
                        "optional": true
                    },
                    {
                        "full": "[keepSeparator=true]",
                        "name": "keepSeparator",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [recursiveSplitText](https://docs.dolphindb.com/en/Functions/r/recursiveSplitText.html)\n\nFirst introduced in versions: 3.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\nrecursiveSplitText(text, \\[maxLength=300], \\[chunkOverlap=20], \\[separators], \\[keepSeparator=true])\n\n#### Details\n\nRecursively split the text based on separators.\n\n#### Parameters\n\n**text** A LITERAL scalar representing the input text to be split into chunks.\n\n**maxLength** A positive integer indicating the maximum length of each chunk. Defaults to 300.\n\n**chunkOverlap** A non-negative integer not exceeding *maxLength*, indicating the maximum length of repetition allowed for adjacent chunks. Defaults to 20.\n\n**separators** A STRING vector representing a list of user-defined separators. Defaults to `[\"\\n\\n\", \"\\n\", \" \", \"\"]`. Regular expressions are not supported.\n\n**keepSeparator** A Boolean indicating whether to keep the separators:\n\n* true (default): Keep the separators at the beginning of the second half of the text.\n* false: Not keep the separators.\n\n#### Returns\n\nA STRING vector.\n\n#### Examples\n\n```\ntext = \"This is the first sentence. This is the second sentence containing a comma. Next is the third which is longer than the previous two and needs to be further split. The last sentence is the closing sentence.\"\nseparators = [\".\",\",\"]\n\nchunks = recursiveSplitText(text, maxLength=15, chunkOverlap=5, separators=separators, keepSeparator=true)\n```\n"
    },
    "refCount": {
        "url": "https://docs.dolphindb.com/en/Functions/r/refCount.html",
        "signatures": [
            {
                "full": "refCount(varname)",
                "name": "refCount",
                "parameters": [
                    {
                        "full": "varname",
                        "name": "varname"
                    }
                ]
            }
        ],
        "markdown": "### [refCount](https://docs.dolphindb.com/en/Functions/r/refCount.html)\n\n\n\n#### Syntax\n\nrefCount(varname)\n\n#### Details\n\nReturn the number of times a variable is referred to.\n\n#### Parameters\n\n**varname** is a string indicating a variable name.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\ndb=database(\"\",VALUE,1 2 3)\nrefCount(`db);\n// output: 1\n\ndb1=db\ndb2=db\nrefCount(`db);\n// output: 3\n```\n"
    },
    "regexCount": {
        "url": "https://docs.dolphindb.com/en/Functions/r/regexCount.html",
        "signatures": [
            {
                "full": "regexCount(str, pattern, [offset=0])",
                "name": "regexCount",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    },
                    {
                        "full": "[offset=0]",
                        "name": "offset",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [regexCount](https://docs.dolphindb.com/en/Functions/r/regexCount.html)\n\n\n\n#### Syntax\n\nregexCount(str, pattern, \\[offset=0])\n\n#### Details\n\nSearch in *str* from the *offset* position, and return an integer indicating how many times a string that matches *pattern* occurs in *str*.\n\n#### Parameters\n\n**str** is a string or a string vector.\n\n**pattern** is an ordinary string scalar or a regular expression pattern to be searched in *str*. Regular expression pattern includes character literals, metacharacters, or a combination of both.\n\n**offset** (optional) is a non-negative integer with default value of 0. This optional argument is the starting position in *str* to conduct the count operation. The first character in *str* corresponds to position 0.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\nregexCount(\"1231hsdU777_ DW#122ddd\", \"[0-9]+\");\n// output: 3\n\nregexCount(\"1231hsdU777_ DW#122ddd\", \"[0-9]+$\");\n// output: 0\n\nregexCount(\"1231hsdU777_ DW#122ddd\", \"^[0-9]+\");\n// output: 1\n\nregexCount(\"abc234 ff456\", \"[a-z]\", 3);\n// output: 2\n```\n"
    },
    "regexFind": {
        "url": "https://docs.dolphindb.com/en/Functions/r/regexFind.html",
        "signatures": [
            {
                "full": "regexFind(str, pattern, [offset])",
                "name": "regexFind",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [regexFind](https://docs.dolphindb.com/en/Functions/r/regexFind.html)\n\n\n\n#### Syntax\n\nregexFind(str, pattern, \\[offset])\n\n#### Details\n\nSearch in *str* for another string that matches *pattern* and return an integer that indicates the beginning position of the first matched substring. If no substring matches, return -1.\n\n#### Parameters\n\n**str** is a string or a string vector.\n\n**pattern** is an ordinary string scalar or a regular expression pattern to be searched in *str*. Regular expression pattern includes character literals, metacharacters, or a combination of both.\n\n**offset** (optional) is a non-negative integer with default value of 0. This optional argument is the starting position in *str*to conduct the search operation. The first character in *str* corresponds to position 0.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\nregexFind(\"1231hsdU777_ DW#122ddd\", \"[a-z]+\");\n// output: 4\n\nregexFind(\"1231hsdU777_ DW#122ddd\", \"[0-9]+\");\n// output: 0\n\nregexFind(\"1231hsdU777_ DW#122ddd\", \"[0-9]+\", 4);\n// output: 8\n```\n"
    },
    "regexFindStr": {
        "url": "https://docs.dolphindb.com/en/Functions/r/regexfindstr.html",
        "signatures": [
            {
                "full": "regexFindStr(str, pattern, [onlyFirst=true], [offset])",
                "name": "regexFindStr",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    },
                    {
                        "full": "[onlyFirst=true]",
                        "name": "onlyFirst",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [regexFindStr](https://docs.dolphindb.com/en/Functions/r/regexfindstr.html)\n\n\n\n#### Syntax\n\nregexFindStr(str, pattern, \\[onlyFirst=true], \\[offset])\n\n#### Details\n\nDifferent from `regexFind` which returns the positions of the matched strings, `regexFindStr` searches from the offset position and returns the matched substring.\n\n* When *str*is a scalar:\n\n  * If *onlyFirst*is set to true, return the first substring that matches *pattern*. Otherwise return an empty string.\n\n  * If *onlyFirst*is set to false, return a STRING vector containing all non-overlapping matches. Otherwise return an empty STRING vector.\n\n* When *str*is a vector:\n\n  * If *onlyFirst*is set to true, return the first substring that matches *pattern*for each string of *str*. Otherwise return a STRING vector of the same length as *str*, with all elements being empty strings.\n\n  * If *onlyFirst*is set to false, return a tuple containing all non-overlapping matches for each string of *str*. Otherwise return an tuple of the same length as *str*, with all elements being empty STRING vectors.\n\n#### Parameters\n\n**str** is a STRING scalar or vector, indicating the target string to be scanned.\n\n**pattern** is a string indicating the string pattern with regular expression. It can contain literals and metacharacters.\n\n**onlyFirst** (optional) is a Boolean value indicating whether to return only the first substring that matches *pattern* for each string.\n\n* true (default): Return the first match.\n\n* false: Return all non-overlapping matches.\n\n**offset** (optional) is a non-negative integer indicating the starting position for the search in *str*. The default value is 0, which is the first position of *str*.\n\n#### Returns\n\nIf *str* is a scalar and *onlyFirst* is true, returns a STRING scalar containing the first matched substring, or an empty string if no match is found. If *str* is a scalar and *onlyFirst* is false, returns a STRING vector containing all matched substrings. If *str* is a vector and *onlyFirst* is true, returns a STRING vector whose elements are the first matched substring from each corresponding element of *str*. If *str* is a vector and *onlyFirst* is false, returns a tuple whose elements are STRING vectors containing all matched substrings from each corresponding element of *str*.\n\n#### Examples\n\n```\n// when str is a scalar and onlyFirst = true\nregexFindStr('234AA(2)BBB S&P', '([A|B|C|+|-]*)', true)\n//output: AA\n\n// when str is a scalar and onlyFirst = false\nregexFindStr('234AA(2)BBB S&P', '([A|B|C|+|-]*)', false)\n//output: [\"AA\",\"BBB\"]\n\n// when str is a vector and onlyFirst = true\nregexFindStr(['234AA(2)BBBS&P', '234AA(2)BBBS&P'], '([A|B|C|+|-]*)', true)\n//output: [\"AA\",\"AA\"]\n\n// when str is a vector and onlyFirst = false\nregexFindStr(['234AA(2)BBBS&P', '234AA(2)BBBS&P'], '([A|B|C|+|-]*)', false)\n//output: ([\"AA\",\"BBB\"],[\"AA\",\"BBB\"])\n```\n"
    },
    "regexReplace": {
        "url": "https://docs.dolphindb.com/en/Functions/r/regexReplace.html",
        "signatures": [
            {
                "full": "regexReplace(str, pattern, replacement, [offset])",
                "name": "regexReplace",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    },
                    {
                        "full": "replacement",
                        "name": "replacement"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [regexReplace](https://docs.dolphindb.com/en/Functions/r/regexReplace.html)\n\n\n\n#### Syntax\n\nregexReplace(str, pattern, replacement, \\[offset])\n\n#### Details\n\nSearch in *str* for another string that matches *pattern* and and replace every occurrence of the matched string or pattern with *replacement*.\n\n#### Parameters\n\n**str** is a string or a string vector.\n\n**pattern** is an ordinary string scalar or a regular expression pattern to be searched in *str*. Regular expression pattern includes character literals, metacharacters, or a combination of both.\n\n**replacement** is a string scalar. It is used to replace pattern in *str*.\n\n**offset** (optional) is a non-negative integer with default value of 0. This optional argument is the starting position in *str* to conduct the search and replace operation. The first character in *str* corresponds to positive 0.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nregexReplace(\"abc234 ff456\", \"[a-z]\", \"z\");\n// output: zzz234 zz456\n\nregexReplace(\"abc234 ff456\", \"[a-z]+\", \"zzz\");\n// output: zzz234 zzz456\n\nregexReplace(\"abc234 ff456\", \"[0-9]+\", \"zzz\");\n// output: abczzz ffzzz\n```\n"
    },
    "registerStreamingSQL": {
        "url": "https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html",
        "signatures": [
            {
                "full": "registerStreamingSQL(query, [queryId], [logTableCacheSize])",
                "name": "registerStreamingSQL",
                "parameters": [
                    {
                        "full": "query",
                        "name": "query"
                    },
                    {
                        "full": "[queryId]",
                        "name": "queryId",
                        "optional": true
                    },
                    {
                        "full": "[logTableCacheSize]",
                        "name": "logTableCacheSize",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nregisterStreamingSQL(query, \\[queryId], \\[logTableCacheSize])\n\n#### Details\n\nThe function registers a streaming SQL query and returns a unique queryId. Then the system generates a shared stream table with the same name as queryId to write result change logs.\n\n#### Parameters\n\n**query** A STRING scalar representing the query for registering streaming SQL.\n\n**queryId** (optional) A STRING scalar representing the ID name for *query*. Must follow variable naming rules: letters, numbers, or underscores only, and start with a letter.\n\n* If the specified *queryId* already exists, the system automatically appends a timestamp to create a unique ID.\n* If not specified, the system automatically generates a unique ID.\n\n**logTableCacheSize** (optional) A positive integer indicating the maximum number of result change logs cached in memory. All logs are cached by default. Data in the cache that has not been published is retained as long as there are subscriptions. Published data is cleared according to the following rules:\n\n* If the number of logs inserted at a time does not exceed *logTableCacheSize*, old data is cleared when the total in-memory logs reach *logTableCacheSize* \\* 2.\n* If the number of logs inserted at a time does exceeds *logTableCacheSize*, old data is cleared when the total in-memory logs reach (inserted rows + *logTableCacheSize*) \\* 1.2.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\nregisterStreamingSQL(\"select avg(val) from st\",\"sql_avg\")\n\n// Get the status of streaming SQL query\ngetStreamingSQLStatus(\"sql_avg\")\n```\n\n**Related functions:** [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html), [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html)\n"
    },
    "regroup": {
        "url": "https://docs.dolphindb.com/en/Functions/r/regroup.html",
        "signatures": [
            {
                "full": "regroup(X, label, func, [byRow=true])",
                "name": "regroup",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "label",
                        "name": "label"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "[byRow=true]",
                        "name": "byRow",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [regroup](https://docs.dolphindb.com/en/Functions/r/regroup.html)\n\n\n\n#### Syntax\n\nregroup(X, label, func, \\[byRow=true])\n\n#### Details\n\nGroup the data of a matrix based on user-specified column/row labels and apply aggregation on each group.\n\n`regroup` is similar to the SQL keyword \"group by\", except that \"group by\" is applied only on *tables* whereas this function is applied on *matrices*.\n\nNote: It is recommended that the *func* parameter be specified as a built-in aggregate function as built-in functions are optimized internally for optimal performance. (see Example 2)\n\n#### Parameters\n\n**X** is a matrix.\n\n**label** is a vector indicating the column/row labels based on which the matrix is grouped and aggregated. When *byRow* = true, the length of label must match the number of rows of *X*. Otherwise, it must match the number of columns of *X*.\n\n**func** is a unary aggregate function called on each group of the matrix. It can be built-in or user-defined.\n\n**byRow** (optional) is a Boolean. The default value is true, indicating that the matrix will be grouped and aggregated by rows. False means to group and aggregate matrix by columns.\n\n#### Returns\n\nA matrix.\n\n#### Examples\n\nExample 1. Perform grouped aggregation on a matrix by row/column labels.\n\n```\nm = rand(20, 4:5)\nm;\n```\n\n| col1 | col2 | col3 | col4 | col5 |\n| ---- | ---- | ---- | ---- | ---- |\n| 11   | 6    | 6    | 10   | 4    |\n| 6    | 7    | 5    | 2    | 16   |\n| 2    | 16   | 14   | 19   | 9    |\n| 17   | 6    | 13   | 10   | 2    |\n\n```\n// by column labels\nlabel = `A`A`B`A`B\nregroup(X=m, label=label, func=firstNot, byRow=false)\n```\n\n| A  | B  |\n| -- | -- |\n| 11 | 6  |\n| 6  | 5  |\n| 2  | 14 |\n| 17 | 13 |\n\n```\n// by row labels\nlabel = 1 2 1 2\nregroup(X=m, label=label, func=firstNot, byRow=true)\n```\n\n| label | col1 | col2 | col3 | col4 | col5 |\n| ----- | ---- | ---- | ---- | ---- | ---- |\n| 1     | 11   | 6    | 6    | 10   | 4    |\n| 2     | 6    | 7    | 5    | 2    | 16   |\n\nExample 2. Compare the performance between applying a built-in function and a user-defined function.\n\n```\nm = rand(1000.0, 10000)$100:100\ndefg my_avg(v):avg(v)\n\ntimer(1000) regroup(m, take(1 2 3 4 5, 100), avg)\n// Time elapsed 176.175 ms\n\ntimer(1000) regroup(m, take(1 2 3 4 5, 100), my_avg)\n// Time elapsed 1062.553 ms\n```\n\nExample 3. Aggregate the panel data by minute\n\n```\nn=1000\ntimestamp = 09:00:00 + rand(10000, n).sort!()\nid = take(`st1`st2`st3, n)\nvol = 100 + rand(10.0, n)\nvt = table(timestamp, id, vol)\nm = exec vol from vt pivot by timestamp, id\nregroup(m, minute(m.rowNames()), avg)\n```\n"
    },
    "remoteRun": {
        "url": "https://docs.dolphindb.com/en/Functions/r/remoteRun.html",
        "signatures": [
            {
                "full": "remoteRun(conn, script, args)",
                "name": "remoteRun",
                "parameters": [
                    {
                        "full": "conn",
                        "name": "conn"
                    },
                    {
                        "full": "script",
                        "name": "script"
                    },
                    {
                        "full": "args",
                        "name": "args"
                    }
                ]
            }
        ],
        "markdown": "### [remoteRun](https://docs.dolphindb.com/en/Functions/r/remoteRun.html)\n\n\n\n#### Syntax\n\nremoteRun(conn, script, args)\n\n#### Details\n\nSend a script or function to a remote database for execution. The `remoteRun` function requires version compatibility when the local server is 3.00 or higher.\n\n#### Parameters\n\n**conn** represents a database connection.\n\n**script** is a string indicating the script to be executed on the remote node.\n\n**args** ... are the parameters for the function to be executed if *script* is a function name. It can have 0 items or multiple items.\n\n#### Returns\n\nThe execution result of *script*.\n\n#### Examples\n\nThe first use case: execute script on a remote node.\n\n```\nconn =  xdb(\"localhost\",81);\nremoteRun(conn, \"x=rand(1.0,10000000); y=x pow 2; avg y\");\n// output: 0.333254\n```\n\nThe second use case:\n\n* If *functionName* is quoted: execute a remote function on a remote node. The function is defined on the remote node, while the parameters of the function are given on the local node.\n\n  ```\n  h=xdb(\"localhost\",80);\n  x=remoteRun(h, \"sum\",1..100);\n  x;\n  // output: 5050\n  ```\n\n* If *functionName* is not quoted: execute a local function on a remote node. The parameters of the function are given on the local node.\n\nAssume on the local node we have a table \"EarningsDates\" with 2 columns: ticker and date. This table has the earnings announcement dates of 3 stocks for the 3rd quarter of 2006. There is a files *USPrices.csv* on a remote node with machine name \"localhost\" and port number 8081. It contains daily stock prices for all US stocks. We would like to get the stock prices from the remote node for all stocks in the table \"EarningsDates\" for the week after earnings announcement.\n\nOn the remote node, we import the data file to create the table \"USPrices\", and then share it across all nodes as \"sharedUSPrices\".\n\n```\nUSPrices = loadText(\"c:/DolphinDB/Data/USPrices.csv\");\nshare USPrices as USPrices;\n```\n\nWhen we create a connection to a remote node, the remote node will create a new session for this connection. This new session is completely isolated from other sessions on the remote node. This is convenient for developers as they don't have to worry about name conflicts. In this case, however, we do want to share data among multiple sessions on the same node. We can use the statement [share](https://docs.dolphindb.com/en/Programming/ProgrammingStatements/share.html) to share the objects. Currently only tables can be shared in DolphinDB.\n\nOn the local node, we create the table `EarningsDates`, and send it with the script over to the remote node. After the execution, the result is sent back to the local node.\n\n```\nEarningsDates=table(`XOM`AAPL`IBM as TICKER, 2006.10.26 2006.10.19 2006.10.17 as date)\ndef loadDailyPrice(data){\n    dateDict = dict(data.TICKER, data.date)\n    return select date, TICKER, PRC from objByName(\"sharedUSPrices\") where dateDict[TICKER]<date<=dateDict[TICKER]+7\n}\nconn = xdb(\"localhost\",8081)\nprices = conn.remoteRun(loadDailyPrice, EarningsDates);\nprices;\n```\n\n| date       | TICKER | PRC   |\n| ---------- | ------ | ----- |\n| 2006.10.27 | XOM    | 71.46 |\n| 2006.10.30 | XOM    | 70.84 |\n| 2006.10.31 | XOM    | 71.42 |\n| 2006.11.01 | XOM    | 71.06 |\n| 2006.11.02 | XOM    | 71.19 |\n| 2006.10.18 | IBM    | 89.82 |\n| 2006.10.19 | IBM    | 89.86 |\n| 2006.10.20 | IBM    | 90.48 |\n| 2006.10.23 | IBM    | 91.56 |\n| 2006.10.24 | IBM    | 91.49 |\n| 2006.10.20 | AAPL   | 79.95 |\n| 2006.10.23 | AAPL   | 81.46 |\n| 2006.10.24 | AAPL   | 81.05 |\n| 2006.10.25 | AAPL   | 81.68 |\n| 2006.10.26 | AAPL   | 82.19 |\n"
    },
    "remoteRunCompatible": {
        "url": "https://docs.dolphindb.com/en/Functions/r/remoteRunCompatible.html",
        "signatures": [
            {
                "full": "remoteRunCompatible(conn, script, args...)",
                "name": "remoteRunCompatible",
                "parameters": [
                    {
                        "full": "conn",
                        "name": "conn"
                    },
                    {
                        "full": "script",
                        "name": "script"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [remoteRunCompatible](https://docs.dolphindb.com/en/Functions/r/remoteRunCompatible.html)\n\n\n\n#### Syntax\n\nremoteRunCompatible(conn, script, args...)\n\n#### Details\n\nSend a script or function to a remote database for execution.\n\nCompared to `remoteRun`, `remoteRunCompatible` works across all database versions. The `remoteRun` function requires version compatibility when the local server is 3.00 or higher.\n\n#### Parameters\n\n**conn** represents a database connection.\n\n**script** is a string indicating the script or function name to be executed on the remote node.\n\n**args**... (optional) are the parameters for the function to be executed if *script* is a function name. It can have 0 or multiple items.\n\n#### Returns\n\nThe execution result of *script*.\n\n#### Examples\n\nThe first use case: *script* is the script.\n\nExecute script on a remote node.\n\n```\nconn =  xdb(host=\"localhost\",port=8848,userId=\"admin\",password=123456);\nremoteRunCompatible(conn, \"avg(1..100)\");\n\n// output: 50.5\n```\n\nThe second use case: *script* is a function name.\n\n* If it is quoted: execute a remote function on a remote node. The function is defined on the remote node, while the parameters of the function are given on the local node.\n\n```\n// create a function view on the remote node\ndef myAvg(x){\n  return avg(x)+2\n}\naddFunctionView(myAvg)\n\n// execute function view \"myAvg\"\nconn =  xdb(\"localhost\",8848,`admin,`123456);\nremoteRunCompatible(conn, \"myAvg\", 1..100);\n\n// output: 52.5\n```\n\n* If it is not quoted: execute a local function on a remote node. The parameters of the function are given on the local node.\n\n```\n// define function \"myAvg\" on the local node\ndef myAvg(x){\n  return avg(x)+1\n}\n\n// execute \"myAvg\" function on the remote node\nconn =  xdb(\"localhost\",8848,`admin,`123456);\nremoteRunCompatible(conn, myAvg, 1..100);\n\n// output: 51.5\n```\n\nRelated function: remoteRun\n"
    },
    "remoteRunWithCompression": {
        "url": "https://docs.dolphindb.com/en/Functions/r/remoteRunWithCompression.html",
        "signatures": [
            {
                "full": "remoteRunWithCompression(conn, script, args)",
                "name": "remoteRunWithCompression",
                "parameters": [
                    {
                        "full": "conn",
                        "name": "conn"
                    },
                    {
                        "full": "script",
                        "name": "script"
                    },
                    {
                        "full": "args",
                        "name": "args"
                    }
                ]
            }
        ],
        "markdown": "### [remoteRunWithCompression](https://docs.dolphindb.com/en/Functions/r/remoteRunWithCompression.html)\n\n#### Syntax\n\nremoteRunWithCompression(conn, script, args)\n\n#### Details\n\nThe function has the same feature and usage as the function [remoteRun](https://docs.dolphindb.com/en/Functions/r/remoteRun.html). The only difference lies in that `remoteRunWithCompression` compresses tables with more than 1,024 rows during transmission.\n\n#### Parameters\n\n**conn** is the connection handle to a remote database.\n\n**script** is the script or function to be executed.\n\n**args** are the arguments to be passed to the function if *script* is a function name. It can have 0 or multiple items.\n\n#### Returns\n\nThe execution result of *script*.\n\n"
    },
    "remove!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/remove.html",
        "signatures": [
            {
                "full": "remove!(obj, index)",
                "name": "remove!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "index",
                        "name": "index"
                    }
                ]
            }
        ],
        "markdown": "### [remove!](https://docs.dolphindb.com/en/Functions/r/remove.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nremove!(obj, index)\n\n#### Details\n\nRemoves elements at specified positions from a vector or tuple, modifying the original object in place.\n\nCompared to functions like [drop](https://docs.dolphindb.com/en/Functions/d/drop.html), [pop!](https://docs.dolphindb.com/en/Functions/p/pop!.html), [removeHead!](https://docs.dolphindb.com/en/Functions/r/removeHead!.html), and [removeTail!](https://docs.dolphindb.com/en/Functions/r/removeTail!.html), `remove!` is more flexible as it allows deleting elements at any position, while the other functions only support removing elements from the head or tail.\n\n#### Parameters\n\n**obj** is a vector/array vector/tuple/columnar tuple indicating the target object from which element(s) will be removed.\n\n**index** is an INT scalar/vector, indicating the zero-based position(s) of element(s) to remove. All indices must be within the range \\[0, obj.size()). If a vector is specified, indices must be strictly ascending.\n\n#### Returns\n\nReturns the updated vector or tuple after removal, with the same type and form as *obj*.\n\n#### Examples\n\nRemove specified elements from a regular vector.\n\n```\nv = 1..10\nremove!(v, 2)  // v becomes [1,2,4,5,6,7,8,9,10]\n\n// Continue from the previous result\nremove!(v, [1,3,5])   // v becomes [1,4,6,8,9,10]\n```\n\nRemove specified elements from an array vector.\n\n```\nav = array(DOUBLE[], 0, 10).append!([[1.1,2.2], [3.3,4.4,5.5], [6.6], [7.7,8.8,9.9,10.0]])\nremove!(av, 1)   // av becomes [[1.1,2.2], [6.6], [7.7,8.8,9.9,10.0]]\n\n// Continue from the previous result\nremove!(av, [0,2])   // av becomes [[6.6]]\n```\n\nRemove specified elements from a regular tuple.\n\n```\ntp = (1, `AAPL, 3.14, 2023.01.01)\nremove!(tp, 2)  // tp becomes (1, `AAPL, 2023.01.01)\n\n// Continue from the previous result\nremove!(tp, [0,2]) // tp becomes (`AAPL)\n```\n\nRemove specified elements from a columnar tuple.\n\n```\nctp = [[1,2,3], [4,5,6], [7,8], [9,2]].setColumnarTuple!()\nremove!(ctp, 1)\n// ctp becomes [[1,2,3], [7,8], [9,2]]\n\n// Continue from the previous result, remove multiple elements\nremove!(ctp, [0,1])\n// ctp becomes [[9,2]]\n```\n\n**Related functions:**[drop](https://docs.dolphindb.com/en/Functions/d/drop.html), [pop!](https://docs.dolphindb.com/en/Functions/p/pop!.html), [removeHead!](https://docs.dolphindb.com/en/Functions/r/removeHead!.html), and [removeTail!](https://docs.dolphindb.com/en/Functions/r/removeTail!.html)\n"
    },
    "removeCacheRulesForComputeGroup": {
        "url": "https://docs.dolphindb.com/en/Functions/r/removecacherulesforcomputegroup.html",
        "signatures": [
            {
                "full": "removeCacheRulesForComputeGroup(name, tableNames)",
                "name": "removeCacheRulesForComputeGroup",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "tableNames",
                        "name": "tableNames"
                    }
                ]
            }
        ],
        "markdown": "### [removeCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/r/removecacherulesforcomputegroup.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nremoveCacheRulesForComputeGroup(name, tableNames)\n\n#### Details\n\nRemoves cache rules from a compute group, specifying the tables for which caching should be disabled.\n\n#### Parameters\n\n**name**: A STRING scalar specifying the name of the compute group from which cache rules are removed.\n\n**tableNames**: A STRING scalar or vector specifying the tables to be removed from the compute group’s cache path. The tables are specified in the format of databaseName/tableName, for example \"dfs\\://compute\\_test/tb1\".\n\nWildcards are not supported.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nremoveCacheRulesForComputeGroup(\"cgroup1\", \"dfs://compute_test/tb1\")\n\nremoveCacheRulesForComputeGroup(\"cgroup1\", [\"dfs://compute_test/tb1\", \"dfs://compute_test/tb2\"])\n```\n\n**Related Functions:** [addCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/a/addcacherulesforcomputegroup.html), [getCacheRulesForComputeGroup](https://docs.dolphindb.com/en/Functions/g/getcacherulesforcomputegroup.html)\n"
    },
    "removeHead!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/removeHead!.html",
        "signatures": [
            {
                "full": "removeHead!(obj, n)",
                "name": "removeHead!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [removeHead!](https://docs.dolphindb.com/en/Functions/r/removeHead!.html)\n\n\n\n#### Syntax\n\nremoveHead!(obj, n)\n\n#### Details\n\nDelete the first *n* elements from a vector.\n\n#### Parameters\n\n**obj** is a vector.\n\n**n** is a positive integer indicating the number of elements at the beginning of the vector to be removed.\n\n#### Returns\n\nA vector with the same type as *obj*.\n\n#### Examples\n\n```\nx=11..20;\nx.removeHead!(3);\n// output: [14,15,16,17,18,19,20]\n```\n\n**Related functions:** [drop](https://docs.dolphindb.com/en/Functions/d/drop.html), [pop!](https://docs.dolphindb.com/en/Functions/p/pop!.html), [removeTail!](https://docs.dolphindb.com/en/Functions/r/removeTail!.html), [remove!](https://docs.dolphindb.com/en/Functions/r/remove.html)\n"
    },
    "removeIPBlackList": {
        "url": "https://docs.dolphindb.com/en/Functions/r/removeipblacklist.html",
        "signatures": [
            {
                "full": "removeIPBlackList(ips)",
                "name": "removeIPBlackList",
                "parameters": [
                    {
                        "full": "ips",
                        "name": "ips"
                    }
                ]
            }
        ],
        "markdown": "### [removeIPBlackList](https://docs.dolphindb.com/en/Functions/r/removeipblacklist.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nremoveIPBlackList(ips)\n\n#### Details\n\nRemove IP addresses from the blacklist. The blacklist feature is disabled when all IP addresses have been removed.\n\nThis function can only be executed by an administrator and takes effect on the cluster.\n\n#### Parameters\n\n**ips** is a STRING or IPADDR scalar/vector indicating one or more IP addresses.\n\n#### Examples\n\n```\naddIPBlackList([\"1.1.1.1\", \"2.2.2.2\", \"3.3.3.3\"])\nremoveIPBlackList(\"2.2.2.2\")\ngetIPBlackList()\n// output: [\"1.1.1.1\", \"3.3.3.3\"]\n```\n\nRelated functions: [addIPBlackList](https://docs.dolphindb.com/en/Functions/a/addipblacklist.html), [getIPBlackList](https://docs.dolphindb.com/en/Functions/g/getipblacklist.html)\n"
    },
    "removeIPWhiteList": {
        "url": "https://docs.dolphindb.com/en/Functions/r/removeipwhitelist.html",
        "signatures": [
            {
                "full": "removeIPWhiteList(ips)",
                "name": "removeIPWhiteList",
                "parameters": [
                    {
                        "full": "ips",
                        "name": "ips"
                    }
                ]
            }
        ],
        "markdown": "### [removeIPWhiteList](https://docs.dolphindb.com/en/Functions/r/removeipwhitelist.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nremoveIPWhiteList(ips)\n\n#### Details\n\nRemove IP addresses from the whitelist. The whitelist feature is disabled when all IP addresses have been removed.\n\nThis function can only be executed by an administrator and takes effect on the cluster.\n\n#### Parameters\n\n**ips** is a STRING or IPADDR scalar/vector indicating one or more IP addresses.\n\n#### Examples\n\n```\naddIPWhiteList([\"1.1.1.1\", \"2.2.2.2\", \"3.3.3.3\"])\nremoveIPWhiteList(\"2.2.2.2\")\ngetIPWhiteList()\n// output: [\"1.1.1.1\", \"3.3.3.3\"]\n```\n\nRelated functions: [addIPWhiteList](https://docs.dolphindb.com/en/Functions/a/addipwhitelist.html), [getIPWhiteList](https://docs.dolphindb.com/en/Functions/g/getipwhitelist.html)\n"
    },
    "removeNode": {
        "url": "https://docs.dolphindb.com/en/Functions/r/removeNode.html",
        "signatures": [
            {
                "full": "removeNode(alias, [force=false])",
                "name": "removeNode",
                "parameters": [
                    {
                        "full": "alias",
                        "name": "alias"
                    },
                    {
                        "full": "[force=false]",
                        "name": "force",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [removeNode](https://docs.dolphindb.com/en/Functions/r/removeNode.html)\n\n\n\n#### Syntax\n\nremoveNode(alias, \\[force=false])\n\n#### Details\n\n\\[Linux Only] Remove compute nodes from a cluster. It can only be executed by an administrator.\n\n#### Parameters\n\n**alias** is a STRING scalar or vector indicating the node alias(es).\n\n**force** (optional) is a BOOL scalar indicating whether to forcibly remove the nodes.\n\n* false (default): Nodes will only be removed if they are shut down.\n\n* true: Nodes will be forcibly shut down by the system and then removed. This may cause running tasks on the nodes to terminate.\n\n#### Examples\n\nRemove a compute node \"cnode1\". The node must be shut down before removal:\n\n```\nremoveNode(alias=\"cnode1\")\n```\n\nForce remove the compute nodes \"cnode2\" and \"cnode3\":\n\n```\nremoveNode(alias=`cnode2`cnode3, force=true)\n```\n"
    },
    "removeTail!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/removeTail!.html",
        "signatures": [
            {
                "full": "removeTail!(obj, n)",
                "name": "removeTail!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [removeTail!](https://docs.dolphindb.com/en/Functions/r/removeTail!.html)\n\n\n\n#### Syntax\n\nremoveTail!(obj, n)\n\n#### Details\n\nDelete the last *n* elements from a vector.\n\n#### Parameters\n\n**obj** is a vector.\n\n**n** is a positive integer indicating the number of elements at the end of the vector to be removed.\n\n#### Returns\n\nA vector with the same type as *obj*.\n\n#### Examples\n\n```\nx=11..20;\nx.removeTail!(3);\n// output: [11,12,13,14,15,16,17]\n```\n"
    },
    "removeTopicOffset": {
        "url": "https://docs.dolphindb.com/en/Functions/r/removeTopicOffset.html",
        "signatures": [
            {
                "full": "removeTopicOffset(topic)",
                "name": "removeTopicOffset",
                "parameters": [
                    {
                        "full": "topic",
                        "name": "topic"
                    }
                ]
            }
        ],
        "markdown": "### [removeTopicOffset](https://docs.dolphindb.com/en/Functions/r/removeTopicOffset.html)\n\n\n\n#### Syntax\n\nremoveTopicOffset(topic)\n\n#### Details\n\nDelete the persisted offset of the last processed message in the specified subscription topic. (The offset is persisted if the *persistOffset* parameter is enabled when calling [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html).)\n\n#### Parameters\n\n**topic** is the subscription topic returned by the [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html) function.\n"
    },
    "rename!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rename!.html",
        "signatures": [
            {
                "full": "rename!(X, Y, [Z])",
                "name": "rename!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[Z]",
                        "name": "Z",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [rename!](https://docs.dolphindb.com/en/Functions/r/rename!.html)\n\n\n\n#### Syntax\n\nrename!(X, Y, \\[Z])\n\n#### Details\n\nFor a vector, assign a new name.\n\nFor a matrix, add or change columns names or row names.\n\nFor a table, rename the columns.\n\n#### Parameters\n\n**X** is a vector, regular/indexed matrix, in-memory table, or DFS table(for OLAP engine only).\n\n* When *X* is a vector, *Y* is a string/symbol.\n* When *X* is a matrix, if *Z* is not specified, *Y* is the column lables; if *Z* is specified, *Y* is the row labels and *Z* is the column lables. Column and row labels must match the respective dimensions of *X*. *Y* and *Z* could be data of any types. Note that for an indexed matrix, *Y* and *Z* must be strictly increasing vectors, otherwise an error will be thrown.\n* When *X* is an in-memory table, *Y* and *Z* is a string scalar or vector. If *Z* is not specified, *Y* is new column names starting from the first column on the left; if *Z* is specified, *Y* is the old column names and *Z* is the corresponding new column names. Users should make sure the number of new or old column names be less than or equal to the total number of columns in the table.\n* When *X* is a DFS table, *Y* and *Z* must be a string. If *Z* is not specified, *Y* is new column names starting from the first column on the left; if *Z* is specified, *Y* is the old column names and *Z* is the corresponding new column names. Users should make sure the number of new or old column names be less than or equal to the total number of columns in the table;\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nk=3 6 9;\nk.rename!(`rk);\n// output: [3,6,9]\n\n// one way to check name is to use function stat to get the descriptive statistics of data\nstat k;\n/* output:\nMedian->6\nAvg->6\nMin->3\nStdev->3\nCount->3\nSize->3\nName->rk        // the new name for k\nMax->9\n*/\n```\n\n```\nm1=1..9$3:3;\nm1\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 4  | 7  |\n| 2  | 5  | 8  |\n| 3  | 6  | 9  |\n\n```\nm1.rename!(`col1`col2`col3);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 4    | 7    |\n| 2    | 5    | 8    |\n| 3    | 6    | 9    |\n\n```\nm1.rename!(1 2 3, `c1`c2`c3);\n```\n\n|   | c1 | c2 | c3 |\n| - | -- | -- | -- |\n| 1 | 1  | 4  | 7  |\n| 2 | 2  | 5  | 8  |\n| 3 | 3  | 6  | 9  |\n\n```\n// note the new matrix uses the name of k as its column name.\nm1 join k;\n```\n\n|   | c1 | c2 | c3 | rk |\n| - | -- | -- | -- | -- |\n| 1 | 1  | 4  | 7  | 3  |\n| 2 | 2  | 5  | 8  | 6  |\n| 3 | 3  | 6  | 9  | 9  |\n\n```\nt1=table(1..3 as x, 4..6 as y, 7..9 as z);\nt1\n```\n\n| x | y | z |\n| - | - | - |\n| 1 | 4 | 7 |\n| 2 | 5 | 8 |\n| 3 | 6 | 9 |\n\n```\nt1.rename!(`a`b);\n```\n\n**Note:** ​​If the number of columns to be renamed exceeds the number of columns in the target table, the system throws an error.\n\n| a | b | z |\n| - | - | - |\n| 1 | 4 | 7 |\n| 2 | 5 | 8 |\n| 3 | 6 | 9 |\n\n```\nt1.rename!(`aa`bb`cc);\n```\n\n| aa | bb | cc |\n| -- | -- | -- |\n| 1  | 4  | 7  |\n| 2  | 5  | 8  |\n| 3  | 6  | 9  |\n\n```\nt1.rename!(`bb`cc, `y`z);\n```\n\n| aa | y | z |\n| -- | - | - |\n| 1  | 4 | 7 |\n| 2  | 5 | 8 |\n| 3  | 6 | 9 |\n\n```\nt1=table(1..3 as x, 4..6 as y, 7..9 as z, k);\nt1\n// note the table uses the name of k as its column name.\n```\n\n| x | y | z | rk |\n| - | - | - | -- |\n| 1 | 4 | 7 | 3  |\n| 2 | 5 | 8 | 6  |\n| 3 | 6 | 9 | 9  |\n\nCreate an indexed matrix m1:\n\n```\nm = matrix(1..5, 11..15)\nm.rename!(2020.01.01..2020.01.05, `A`B)\nm1 = m.setIndexedMatrix!();\n```\n\n|            | A | B  |\n| ---------- | - | -- |\n| 2020.01.01 | 1 | 11 |\n| 2020.01.02 | 2 | 12 |\n| 2020.01.03 | 3 | 13 |\n| 2020.01.04 | 4 | 14 |\n| 2020.01.05 | 5 | 15 |\n\nRename the labels for m1:\n\n```\nm1.rename!( \"a\" + string(1..5), `A1`A2)\n```\n\n|    | A1 | A2 |\n| -- | -- | -- |\n| a1 | 1  | 11 |\n| a2 | 2  | 12 |\n| a3 | 3  | 13 |\n| a4 | 4  | 14 |\n| a5 | 5  | 15 |\n\nIf *Y* or *Z* is not strictly increasing, an error is thrown.\n\n```\nm1.rename!( \"a\" + string(4 6 2 1 3), `A1`A2)\nm1.rename!( \"a\"\"a\", `A1`A2)\n//Error: The label of an indexed matrix or series must be in strict ascending order.\n```\n"
    },
    "renameCatalog": {
        "url": "https://docs.dolphindb.com/en/Functions/r/renameCatalog.html",
        "signatures": [
            {
                "full": "renameCatalog(oldCatalog, newCatalog)",
                "name": "renameCatalog",
                "parameters": [
                    {
                        "full": "oldCatalog",
                        "name": "oldCatalog"
                    },
                    {
                        "full": "newCatalog",
                        "name": "newCatalog"
                    }
                ]
            }
        ],
        "markdown": "### [renameCatalog](https://docs.dolphindb.com/en/Functions/r/renameCatalog.html)\n\n#### Syntax\n\nrenameCatalog(oldCatalog, newCatalog)\n\n#### Details\n\nRename a catalog.\n\n#### Parameters\n\n**oldCatalog**is a string specifying the old catalog name.\n\n**newCatalog**is a string specifying the new catalog name.\n\n#### Examples\n\n```\nrenameCatalog(\"catalog1\", \"cat1\")\n```\n\n"
    },
    "renameCatalogName": {
        "url": "https://docs.dolphindb.com/en/Functions/r/renameCatalogName.html",
        "signatures": [
            {
                "full": "renameCatalogName(catalog, schema, oldName, newName)",
                "name": "renameCatalogName",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    },
                    {
                        "full": "schema",
                        "name": "schema"
                    },
                    {
                        "full": "oldName",
                        "name": "oldName"
                    },
                    {
                        "full": "newName",
                        "name": "newName"
                    }
                ]
            }
        ],
        "markdown": "### [renameCatalogName](https://docs.dolphindb.com/en/Functions/r/renameCatalogName.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nrenameCatalogName(catalog, schema, oldName, newName)\n\n#### Details\n\nModifies the name in the fully qualified name `<catalog>.<schema>.<name>`.\n\n#### Parameters\n\n**catalog** is a string specifying the catalog name.\n\n**schema** is a string specifying the schema name, which is one of \"orca\\_graph\", \"orca\\_table\", or \"orca\\_engine\".\n\n**oldName**is a string specifying the name before modification.\n\n**newName**is a string indicating the name after modification.\n\n#### Examples\n\n```\nrenameCatalogName(catalog=\"demo1\", schema=\"orca_graph\", oldName=\"factor1\", newName=\"factor2\")\n\nrenameCatalogName(catalog=\"demo2\", schema=\"orca_engine\", oldName=\"engine1\", newName=\"engine2\")\n\nrenameCatalogName(catalog=\"demo3\", schema=\"orca_table\", oldName=\"trades1\", newName=\"trades2\")\n```\n"
    },
    "renameSchema": {
        "url": "https://docs.dolphindb.com/en/Functions/r/renameSchema.html",
        "signatures": [
            {
                "full": "renameSchema(catalog, oldSchema, newSchema)",
                "name": "renameSchema",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    },
                    {
                        "full": "oldSchema",
                        "name": "oldSchema"
                    },
                    {
                        "full": "newSchema",
                        "name": "newSchema"
                    }
                ]
            }
        ],
        "markdown": "### [renameSchema](https://docs.dolphindb.com/en/Functions/r/renameSchema.html)\n\n#### Syntax\n\nrenameSchema(catalog, oldSchema, newSchema)\n\n#### Details\n\nRename a schema.\n\n#### Parameters\n\n**catalog**is a string specifying the catalog name.\n\n**oldSchema**is a string specifying the old schema name.\n\n**newSchema**is a string specifying the new schema name.\n\n#### Examples\n\n```\nrenameSchema(\"catalog1\", \"schema1\", \"schema2\")\n```\n\n"
    },
    "renameTable": {
        "url": "https://docs.dolphindb.com/en/Functions/r/renameTable.html",
        "signatures": [
            {
                "full": "renameTable(dbHandle, tableName, newTableName)",
                "name": "renameTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "newTableName",
                        "name": "newTableName"
                    }
                ]
            }
        ],
        "markdown": "### [renameTable](https://docs.dolphindb.com/en/Functions/r/renameTable.html)\n\n\n\n#### Syntax\n\nrenameTable(dbHandle, tableName, newTableName)\n\n#### Details\n\nRename a table in a DFS database.\n\n#### Parameters\n\n**dbHandle** is a DFS database handle.\n\n**tableName** is a string indicating a table name. The table can be either a DFS table or a dimension table.\n\n**newTableName** is a string indicating the new table name.\n\n#### Returns\n\nA table object containing metadata.\n\n#### Examples\n\n```\nn=1000000\nID=rand(10, n)\nx=rand(1.0, n)\nt=table(ID, x)\ndb=database(\"dfs://hashdb101\", HASH,  [INT, 2]);\npt = db.createPartitionedTable(t, `pt, `ID)\npt.append!(t)\nrenameTable(db, `pt, `pt1)\nselect count(x) from loadTable(db, `pt1);\n// output: 1000000\n```\n"
    },
    "reorderColumns!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/reorderColumns!.html",
        "signatures": [
            {
                "full": "reorderColumns!(table, reorderedColNames)",
                "name": "reorderColumns!",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "reorderedColNames",
                        "name": "reorderedColNames"
                    }
                ]
            }
        ],
        "markdown": "### [reorderColumns!](https://docs.dolphindb.com/en/Functions/r/reorderColumns!.html)\n\n\n\n#### Syntax\n\nreorderColumns!(table, reorderedColNames)\n\n#### Details\n\nChange the order of columns of an in-memory table. It modifies the original table instead of creating a new table.\n\n#### Parameters\n\n**table** is an in-memory table that is not shared.\n\n**reorderedColNames** is a string vector indicating column names. It specifies the order of columns after execution. We only need to write the names for the columns whose positions are changed and all columns before them in the new table. For example, if we switch the position of the 3th column and the 6th column, then we only need to specify the names of the first 6 columns.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nt = table(timestamp, sym, qty, price);\nt;\n```\n\n| timestamp | sym | qty  | price  |\n| --------- | --- | ---- | ------ |\n| 09:34:07  | C   | 2200 | 49.6   |\n| 09:36:42  | MS  | 1900 | 29.46  |\n| 09:36:51  | MS  | 2100 | 29.52  |\n| 09:36:59  | MS  | 3200 | 30.02  |\n| 09:32:47  | IBM | 6800 | 174.97 |\n| 09:35:26  | IBM | 5400 | 175.23 |\n| 09:34:16  | C   | 1300 | 50.76  |\n| 09:34:26  | C   | 2500 | 50.32  |\n| 09:38:12  | C   | 8800 | 51.29  |\n\n```\nreorderColumns!(t,`sym`timestamp`price`qty)\nt;\n```\n\n| sym | timestamp | price  | qty  |\n| --- | --------- | ------ | ---- |\n| C   | 09:34:07  | 49.6   | 2200 |\n| MS  | 09:36:42  | 29.46  | 1900 |\n| MS  | 09:36:51  | 29.52  | 2100 |\n| MS  | 09:36:59  | 30.02  | 3200 |\n| IBM | 09:32:47  | 174.97 | 6800 |\n| IBM | 09:35:26  | 175.23 | 5400 |\n| C   | 09:34:16  | 50.76  | 1300 |\n| C   | 09:34:26  | 50.32  | 2500 |\n| C   | 09:38:12  | 51.29  | 8800 |\n\n```\nreorderColumns!(t,`timestamp`sym);\nt;\n```\n\n| timestamp | sym | price  | qty  |\n| --------- | --- | ------ | ---- |\n| 09:34:07  | C   | 49.6   | 2200 |\n| 09:36:42  | MS  | 29.46  | 1900 |\n| 09:36:51  | MS  | 29.52  | 2100 |\n| 09:36:59  | MS  | 30.02  | 3200 |\n| 09:32:47  | IBM | 174.97 | 6800 |\n| 09:35:26  | IBM | 175.23 | 5400 |\n| 09:34:16  | C   | 50.76  | 1300 |\n| 09:34:26  | C   | 50.32  | 2500 |\n| 09:38:12  | C   | 51.29  | 8800 |\n"
    },
    "repartitionDS": {
        "url": "https://docs.dolphindb.com/en/Functions/r/repartitionDS.html",
        "signatures": [
            {
                "full": "repartitionDS(query, [column], [partitionType], [partitionScheme], [local=true])",
                "name": "repartitionDS",
                "parameters": [
                    {
                        "full": "query",
                        "name": "query"
                    },
                    {
                        "full": "[column]",
                        "name": "column",
                        "optional": true
                    },
                    {
                        "full": "[partitionType]",
                        "name": "partitionType",
                        "optional": true
                    },
                    {
                        "full": "[partitionScheme]",
                        "name": "partitionScheme",
                        "optional": true
                    },
                    {
                        "full": "[local=true]",
                        "name": "local",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [repartitionDS](https://docs.dolphindb.com/en/Functions/r/repartitionDS.html)\n\n\n\n#### Syntax\n\nrepartitionDS(query, \\[column], \\[partitionType], \\[partitionScheme], \\[local=true])\n\n#### Details\n\nRepartition a table with specified partitioning type and scheme, and return a tuple of data sources.\n\nIf *query* is metacode of SQL statements, the parameter *column* must be specified. For a partitioned table with a COMPO domain, *partitionType* and *partitionScheme* can be unspecified. In this case, the data sources will be determined based on the original *partitionType* and *partitionScheme* of *column*.\n\nIf *query* is a tuple of metacode of SQL statements, the following 3 parameters should be unspecified. The function returns a tuple with the same length as *query*. Each element of the result is a data source corresponding to a piece of metacode in *query*.\n\n#### Parameters\n\n**query** is metacode of SQL statements or a tuple of metacode of SQL statements.\n\n**column** (optional) is a string indicating a column name in query. Function `repartitionDS` deliminates data sources based on column.\n\n**partitionType** (optional) means the type of partition. It can take the value of VALUE or RANGE.\n\n**partitionScheme** (optional) is a vector indicating the partitioning scheme. For details please refer to [DistributedComputing](https://docs.dolphindb.com/en/Database/DatabaseandDistributedComputing/DistributedComputing.html).\n\n**local**(optional) is a Boolean value indicating whether to fetch the data sources to the local node for computing. The default value is true. When set to false, if `repartitionDS` is called on a compute node within a compute group, data sources are fetched to all compute nodes within the group; Otherwise data sources are fetched to all data nodes and compute nodes which are not included in any compute groups.\n\n#### Returns\n\nA tuple containing a set of data sources.\n\n#### Examples\n\n```\nn=1000000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\n\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndbID = database(, RANGE, 0 50 100)\ndb = database(\"dfs://compoDB\", COMPO, [dbDate, dbID])\npt = db.createPartitionedTable(t, `pt, `date`ID)\npt.append!(t);\n```\n\nExample 1. *query* is metacode of SQL statements. *partitionType* and *partitionScheme* are specified.\n\n```\nrepartitionDS(query=<select * from pt>,column=`date,partitionType=RANGE,partitionScheme=2017.08.07 2017.08.09 2017.08.11);\n// output: [DataSource< select [4] * from pt where date >= 2017.08.07,date < 2017.08.09 >,DataSource< select [4] * from pt where date >= 2017.08.09,date < 2017.08.11 >]\n```\n\nExample 2. *query* is metacode of SQL statements. *partitionType* and *partitionScheme* are unspecified.\n\n```\nrepartitionDS(query=<select * from pt>,column=`ID)\n// output: [DataSource< select [4] * from pt [partition = */0_50] >,DataSource< select [4] * from pt [partition = */50_100] >]\n```\n\nExample 3. *query* is a tuple of metacode of SQL statements.\n\n```\nrepartitionDS(query=[<select * from pt where id between 0:50>,<select * from pt where id between 51:100>]);\n// output: [DataSource< select [4] * from pt where id between 0 : 50 >,DataSource< select [4] * from pt where id between 51 : 100 >]\n```\n"
    },
    "repeat": {
        "url": "https://docs.dolphindb.com/en/Functions/r/repeat.html",
        "signatures": [
            {
                "full": "repeat(X, n)",
                "name": "repeat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [repeat](https://docs.dolphindb.com/en/Functions/r/repeat.html)\n\n\n\n#### Syntax\n\nrepeat(X, n)\n\n#### Details\n\nRepeats each item in string *X* *n* times to form a new string. The size of the result is the same as the size of *X*.\n\nDolphinDB's `repeat` and NumPy's `numpy.repeat` differ in the following aspects:\n\n* Supported data types: DolphinDB's `repeat` only supports string scalars or vectors, while NumPy's `numpy.repeat` supports a wide range of ndarray data types, including numeric and boolean types.\n\n* Semantic difference:\n\n  * DolphinDB's `repeat` performs content-level repetition for each string element, making it a string-level transformation; whereas NumPy's `numpy.repeat` performs element-wise replication of array elements, making it an element-level expansion. The former changes the content of each element, while the latter changes the number of elements. For example, `repeat([\"ab\", \"cd\"], 2)` in DolphinDB returns `[\"abab\",\"cdcd\"]`, while `np.repeat([\"ab\",\"cd\"], 2)` returns `['ab' 'ab' 'cd' 'cd']`.\n\n  * NumPy also supports specifying per-element repeat counts (vectorized repetition), e.g., `np.repeat([\"a\",\"b\",\"c\"], [1,2,3])`, which is not supported in DolphinDB.\n\n* Return type difference: DolphinDB returns a STRING scalar or vector, while NumPy returns an ndarray.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n**n** is a positive integer.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nrepeat(`FB, 3);\n// output: FBFBFB\n\nrepeat(`AB`CD,2);\n// output: [\"ABAB\",\"CDCD\"]\n```\n"
    },
    "replace!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/replace!.html",
        "signatures": [
            {
                "full": "replace!(X, oldValue, newValue)",
                "name": "replace!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "oldValue",
                        "name": "oldValue"
                    },
                    {
                        "full": "newValue",
                        "name": "newValue"
                    }
                ]
            }
        ],
        "markdown": "### [replace!](https://docs.dolphindb.com/en/Functions/r/replace!.html)\n\n\n\n#### Syntax\n\nreplace!(X, oldValue, newValue)\n\n#### Details\n\nPlease refer to [replace](https://docs.dolphindb.com/en/Functions/r/replace.html). The only difference between `replace` and `replace!` is that the latter assigns the result to *X* and thus changing the value of *X* after the execution.\n"
    },
    "replace": {
        "url": "https://docs.dolphindb.com/en/Functions/r/replace.html",
        "signatures": [
            {
                "full": "replace(X, oldValue, newValue)",
                "name": "replace",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "oldValue",
                        "name": "oldValue"
                    },
                    {
                        "full": "newValue",
                        "name": "newValue"
                    }
                ]
            }
        ],
        "markdown": "### [replace](https://docs.dolphindb.com/en/Functions/r/replace.html)\n\n\n\n#### Syntax\n\nreplace(X, oldValue, newValue)\n\n#### Details\n\nReplace *oldValue* with *newValue* in *X*. `replace!` is the in-place change version of `replace`.\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n**oldValue** is a scalar indicating the value to be replaced.\n\n**newValue** is a scalar of the same category as *X*, indicating the new value.\n\n#### Returns\n\nA vector or matrix with the same type as *X*.\n\n#### Examples\n\n```\nx=1 1 3;\nx=x.replace(1,2);\nx\n// output: [2,2,3]\n\nm=1..4$2:2;\nm\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 2  | 4  |\n\n```\nm=m.replace(2,1);\nm\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 1  | 4  |\n\n```\nm.replace!(1,6);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 6  | 3  |\n| 6  | 4  |\n"
    },
    "replaceColumn!": {
        "url": "https://docs.dolphindb.com/en/Functions/r/replaceColumn!.html",
        "signatures": [
            {
                "full": "replaceColumn!(table, colName, newCol)",
                "name": "replaceColumn!",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "colName",
                        "name": "colName"
                    },
                    {
                        "full": "newCol",
                        "name": "newCol"
                    }
                ]
            }
        ],
        "markdown": "### [replaceColumn!](https://docs.dolphindb.com/en/Functions/r/replaceColumn!.html)\n\n\n\n#### Syntax\n\nreplaceColumn!(table, colName, newCol)\n\n#### Details\n\n* When *table* is an in-memory table:\n  * `replaceColumn!` replaces table column(s) with the specified vector(s). The data type of the new column is the same as the data type of the specified vector. It supports replacing multiple columns at once. Note that the multi-column replacement operation is not atomic, which means in cases of system errors, some specified column replacements may succeed while others fail partway through.\n  * To update column's value without changing its data type, we can use both `replaceColumn!` and SQL statement [update](https://docs.dolphindb.com/en/Programming/SQLStatements/update.html). Only `replaceColumn!`, however, can change a column's data type.\n* When *table* is a DFS table in the OLAP engine, `replaceColumn!` only modifies the data type of the specified column(s). Note that:\n  * The SYMBOL type cannot be converted to or from other types.\n  * Except for SYMBOL, data types within the same category can be converted between each other.\n  * INTEGRAL and FLOATING types can be converted between each other.\n  * INTEGRAL, FLOATING, LITERAL, and TEMPORAL types can be converted to the STRING type.\n\n**Note:** Replacing columns of DECIMAL type is not currently supported.\n\n#### Parameters\n\n**table** is a non-shared in-memory tableor a DFS table.\n\n**colName** is a string indicating the name of the column to replace. When *table* is an in-memory table, *colName* can also be a vector of strings indicating multiple column names.\n\n**newCol** is the column values to replace with. When *table* is an in-memory table, *newCol* is a vector with the same number of elements as the rows of *table*.\n\n* When *table* is an in-memory table:\n  * If *colName* is a scalar, *newCol* is a vector with the same number of elements as the rows of *table*.\n  * If *colName* is a vector, *newCol* is a tuple containing the same number of elements as *colName*. Each tuple element is a vector with the same number of elements as the rows of *table*.\n* When *table* is a DFS table in the OLAP engine, *newCol* is only used to specify the target data type.\n\n#### Returns\n\nThe table after replacement.\n\n#### Examples\n\n```\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nt = table(timestamp, sym, qty, price)\nschema(t).colDefs;\n```\n\n| name      | typeString | typeInt | comment |\n| --------- | ---------- | ------- | ------- |\n| timestamp | SECOND     | 10      |         |\n| sym       | STRING     | 18      |         |\n| qty       | INT        | 4       |         |\n| price     | DOUBLE     | 16      |         |\n\nTo change the data type of column \"sym\" to SYMBOL:\n\n```\nsyms=symbol(exec sym from t)\nreplaceColumn!(t,`sym,syms);\nschema(t).colDefs;\n```\n\n| name      | typeString | typeInt | comment |\n| --------- | ---------- | ------- | ------- |\n| timestamp | SECOND     | 10      |         |\n| sym       | SYMBOL     | 17      |         |\n| qty       | INT        | 4       |         |\n| price     | DOUBLE     | 16      |         |\n\nTo replace columns \"price\" and \"timestamp\":\n\n```\nnewPrice =round(t.qty)\nnewTimestamp = minute(t.timestamp)\nreplaceColumn!(t, `price`timestamp, (newPrice,newTimestamp))\nschema(t).colDefs;\n```\n\n<table id=\"table_nvy_5l3_zzb\"><thead><tr><th align=\"left\">\n\nname\n\n</th><th align=\"left\">\n\ntypeString\n\n</th><th align=\"left\">\n\ntypeInt\n\n</th><th align=\"left\">\n\nextra\n\n</th><th align=\"left\">\n\ncomment\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\ntimestamp\n\n</td><td align=\"left\">\n\nMINUTE\n\n</td><td align=\"left\">\n\n9\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr><tr><td align=\"left\">\n\nsym\n\n</td><td align=\"left\">\n\nSYMBOL\n\n</td><td align=\"left\">\n\n17\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr><tr><td align=\"left\">\n\nqty\n\n</td><td align=\"left\">\n\nINT\n\n</td><td align=\"left\">\n\n4\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr><tr><td align=\"left\">\n\nprice\n\n</td><td align=\"left\">\n\nINT\n\n</td><td align=\"left\">\n\n4\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr></tbody>\n</table>```\nlogin(\"admin\",\"123456\")\nif(existsDatabase(\"dfs://replaceColumn\")){\n  dropDatabase(\"dfs://replaceColumn\")\n}\nn=10\nmonth=take(2012.06.13..2012.06.13, n);\nx=rand(1.0, n);\nt=table(month, x);\ndb=database(\"dfs://replaceColumn\", VALUE, 2012.06.13..2012.06.23)\npt = db.createPartitionedTable(t, `pt, `month);\npt.append!(t);\nschema(pt).colDefs\n```\n\n| name  | typeString | typeInt | extra | comment |\n| ----- | ---------- | ------- | ----- | ------- |\n| month | DATE       | 6       |       |         |\n| x     | DOUBLE     | 16      |       |         |\n\n```\nnewCols=int(exec x from loadTable(\"dfs://replaceColumn\",`pt))\nreplaceColumn!(loadTable(\"dfs://replaceColumn\",`pt), `x, newCols)\nschema(pt).colDefs\n```\n\n| name  | typeString | typeInt | extra | comment |\n| ----- | ---------- | ------- | ----- | ------- |\n| month | DATE       | 6       |       |         |\n| x     | INT        | 4       |       |         |\n"
    },
    "replay": {
        "url": "https://docs.dolphindb.com/en/Functions/r/replay.html",
        "signatures": [
            {
                "full": "replay(inputTables, outputTables, [dateColumn], [timeColumn], [replayRate], [absoluteRate=true], [parallelLevel=1], [sortColumns], [preciseRate=false])",
                "name": "replay",
                "parameters": [
                    {
                        "full": "inputTables",
                        "name": "inputTables"
                    },
                    {
                        "full": "outputTables",
                        "name": "outputTables"
                    },
                    {
                        "full": "[dateColumn]",
                        "name": "dateColumn",
                        "optional": true
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[replayRate]",
                        "name": "replayRate",
                        "optional": true
                    },
                    {
                        "full": "[absoluteRate=true]",
                        "name": "absoluteRate",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[parallelLevel=1]",
                        "name": "parallelLevel",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[sortColumns]",
                        "name": "sortColumns",
                        "optional": true
                    },
                    {
                        "full": "[preciseRate=false]",
                        "name": "preciseRate",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [replay](https://docs.dolphindb.com/en/Functions/r/replay.html)\n\n#### Syntax\n\nreplay(inputTables, outputTables, \\[dateColumn], \\[timeColumn], \\[replayRate], \\[absoluteRate=true], \\[parallelLevel=1], \\[sortColumns], \\[preciseRate=false])\n\n#### Details\n\nReplay one or more tables or data sources (generated by [replayDS](https://docs.dolphindb.com/en/Functions/r/replayDS.html)) to table(s) in chronological order to simulate real-time ingestion of streaming data. It is commonly used for backtesting of high-frequency trading strategies.\n\n**Note:** Out-of-order processing is not supported. You must ensure that the data is ordered.\n\n**Replay Types**\n\nBased on mappings between the input table(s) and output table(s) , there are three replay types: 1-to-1, N-to-1, and N-to-N.\n\nN-to-N replay is not simply N separate 1-to-1 replay tasks. With N 1-to-1 replays, there are N source tables each replayed to N different target tables, executed in parallel. When *inputTables* is specified as a tuple of data sources, N-to-N replay coordinates the replay of multiple data sources sequentially, which first finishes replaying the first source before starting replay of the second, and so on.\n\nIn contrast to N-to-N replay, N-to-1 replay provides ordered replay of multiple data sources into a single target table. With N-to-1 replay, the timestamp ordering across different input sources is preserved when replaying them into the target table.\n\n**Note:** For N-to-1 replay, before version 1.30.17/2.00.5, the schemata of the input tables must be the same, which is called homogeneous replay. Starting from version 1.30.17/2.00.5, replay supports inputting tables with different schemata, which is called heterogeneous replay. For heterogeneous replay, the serialized result of replayed records cannot be processed directly. The output table needs to be deserialized and data is filtered and processed by `streamFilter`.\n\n**Replay Rate**\n\n* If *replayRate* is a positive integer and *absoluteRate* = true, replay *replayRate* records per second.\n\n* If *replayRate* is a positive integer, and *absoluteRate* = false, replay at *replayRate* times the time span of the data. Note that the number of records replayed per second is the same.\n\n* If *replayRate* is negative or unspecified, replay at the maximum speed.\n\n* If *replayRate* is a positive integer and*preciseRate* = true, replay at *replayRate* times the difference between two adjacent records. Suppose two adjacent rows have a timestamp difference of *t*. If the *replayRate* is specified as 2, then during replay the two rows will be spaced by *t*/2, i.e., replaying at twice the speed.\n\n**Replay Process**\n\n1. Loading data. When parameter *inputTables* is specified as a tuple of data sources, it is first loaded from disk to memory.\n\n   Before version 1.30.21/2.00.9, only data souces with the same index are loaded and then replayed in order. Starting from version 1.30.21/2.00.9, it will be automatically sorted by timestamps before it is replayed.\n\n   **Note:**\n\n   * To improve the performance, the *parallelLevel* parameter can be specified to load data in parallel.\n\n   * Data is loaded and replayed asynchronously.\n\n2. Replaying data in batches.\n\n   Data to be replayed is loaded from the memory. Only data in the same batch is replayed in order. Therefore, please sort the input tables by the specified time column (as determined by the parameters *dateColumn* and *timeColumn*) before calling the `replay` function.\n\n   Replay one or more tables containing n records with a time span of t seconds:\n\n   | Replay Rate                                          | Batch Size                                                                        | Elapsed time (s)                            | Note                                                                                                                                                        |\n   | ---------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n   | replays specified records per second                 | *replayRate* records from one or multiple table(s) sorted by the timestamps       | n/*replayRate*                              | If the number of records loaded in one second is less than *replayRate*, all loaded data will be replayed as a batch.                                       |\n   | replays at specified times the time span of the data | *replayRate* \\*n/t records from one or multiple table(s) sorted by the timestamps | t/ *replayRate*                             | If *replayRate* \\*n/t < 1, take 1. If the number of records loaded in one second is less than replayRate\\*n/t, all loaded data will be replayed as a batch. |\n   | replays at the maximum speed                         | all loaded data                                                                   | determined by the performance of the system | For N-to-N replay, each table is replayed one by one in this case.                                                                                          |\n\n   **Note:**\n\n   * When *inputTables* is specified as data sources, (i.e., loaded from disk), the replay speed is impacted by disk I/O.\n\n   * The elapsed time of heterogeneous replay will be slightly longer than homogeneous replay.\n\n3. Writing data: Currently the system only supports writing to the output tables in a single thread.\n\n4. Terminating the replay: Use command [cancelJob](https://docs.dolphindb.com/en/Functions/c/cancelJob.html) or [cancelConsoleJob](https://docs.dolphindb.com/en/Functions/c/cancelConsoleJob.html) from a new web or console.\n\n#### Parameters\n\n**inputTables** can be:\n\n* for 1-to-1 replay, a non-partitioned in-memory table or data source;\n\n* for N-to-N/N-to-1 homogeneous replay, multiple non-partitioned in-memory tables or a tuple of data sources;\n\n* for N-to-1 heterogeneous replay, a dictionary. The key of the dictionary can be of any data type indicating the unique identifier of the input table, and the value is the table object or data source.\n\n**outputTables** can be:\n\n**Note:** Supports specifying *outputTables* as Orca stream table names in the format of \\<catalog>.orca\\_table.\\<name>.\n\n* for 1-to-1/N-to-1 homogeneous replay, a table object (a non-partitioned in-memory table/stream table) or a string scalar with the same schema of the input table.\n\n* for N-to-N replay, a string vector or tuple of table objects (non-partitioned in-memory tables/stream tables) with the same length as that of inputTables. The outputTables and inputTables are mapped one-to-one, and each pair has the same schema.\n\n* for N-to-1 heterogeneous replay, a table object (a non-partitioned in-memory table/stream table) containing at least three columns:\n\n  * The first column is of TIMESTAMP type indicating the timestamp specified by *dateColumn/timeColumn*;\n\n  * The second column is of SYMBOL or STRING type indicating the key of the dictionary specified in the *inputTables*;\n\n  * The third column must be of BLOB type that stores the serialized result of each replayed record.\n\n  * In addition, you can output the columns with the same column names and data types in the input tables.\n\n**dateColumn** and **timeColumn** (optional) is the column name of the time column. At least one of them must be specified.\n\n* for 1-to-1/N-to-1 homogeneous replay: it is a string scalar, and the time columns in the *inputTables* and *outputTables* must use the same name.\n\n* for N-to-N replay: It is a string scalar if time columns of the input tables have same column names; otherwise, it is a string vector.\n\n* for N-to-1 replay: It is a string scalar if time columns of the input tables have same column names; otherwise, it is a dictionary. The key of the dictionary is a user-defined string indicating the unique identifier of the input table, and the value is *dateColumn*/*timeColumn*.\n\nIf *dateColumn* and *timeColum* are specified as the same column or only one of them is specified, there is no restriction on the type of the specified time column.\n\nIf *dateColumn* and *timeColum* are specified as different columns, *dateColumn* must be DATE and *timeColum* can only be SECOND, TIME or NANOTIME.\n\n**replayRate** (optional) is an integer. Together with the parameter *absoluteRate*, it determines the speed of replaying data.\n\n**absoluteRate** (optional) is a Boolean value. The default value is true, indicating that the system replays *replayRate* records per second. If set to false, data is replayed at *replayRate* times the time span of the data.\n\n**parallelLevel** (optional) is a positive integer indicating the number of threads to load data sources to memory concurrently. The default value is 1. If *inputTables* is not a data source, there is no need to specify.\n\n**sortColumns** (optional) is a STRING scalar or vector of length 2. Data with the same timestamp is sorted according to the specified *sortColumns*.\n\nNote that any column in either of the input tables can be specified as a sort column. If one of the input tables doesn't contain the specified sort column, it is filled with null values and treated as the minimum values when the data is sorted.\n\n**preciseRate** (optional) is a Boolean value. The default value is false. If it is set to true, the data is replayed at *replayRate* times the time difference between two adjacent records. Note that deviation of a few milliseconds may exist.\n\n#### Examples\n\nExample 1. 1-to-1 replay:\n\n```\nn=1000\nsym = take(`IBM,n)\ntimestamp= take(temporalAdd(2012.12.06T09:30:12.000,1..500,'s'),n)\nvolume = rand(100,n)\ntrades=table(sym,timestamp,volume)\ntrades.sortBy!(`timestamp)\nshare streamTable(100:0,`sym`timestamp`volume,[SYMBOL,TIMESTAMP,INT]) as st\n```\n\nReplay 100 records per second. For 1000 records in table \"trades\", it takes about 10 seconds.\n\n```\ntimer replay(inputTables=trades, outputTables=st, dateColumn=`timestamp, timeColumn=`timestamp,replayRate=100, absoluteRate=true);\n// Time elapsed 10001.195 ms\n```\n\nReplay at 100 times the time span of the data. The difference between the start timestamp and the end timestamp in table \"trades\" is 500 seconds, and it takes about 5 seconds to replay the table.\n\n```\ntimer replay(inputTables=trades,outputTables=st,dateColumn=`timestamp,timeColumn=`timestamp,replayRate=100,absoluteRate=false);\n// Time elapsed 5001.909 ms\n```\n\nReplay at the maximum speed:\n\n```\ntimer replay(inputTables=trades,outputTables=st,dateColumn=`timestamp,timeColumn=`timestamp);\n// Time elapsed 0.974 ms\n```\n\nReplay at 100 times the difference between two adjacent records with the *preciseRate* specified. It takes about 4.99 seconds to replay the table.\n\n```\ntimer replay(inputTables=trades,outputTables=st,dateColumn=`timestamp,timeColumn=`timestamp,replayRate=100,absoluteRate=false, preciseRate=true);\n// Time elapsed 4991.177 ms\n```\n\nExample 2. N-to-N replay.\n\nThe following script replays two data sources to the join engine for asof join.\n\n```\nn=50000\nsym = rand(symbol(`IBM`APPL`MSFT`GOOG`GS),n)\ndate=take(2012.06.12..2012.06.16,n)\ntime=rand(13:00:00.000..16:59:59.999,n)\nvolume = rand(100,n)\nt1=table(sym,date,time,volume).sortBy!([`date, `time])\n\nsym = rand(symbol(`IBM`APPL`MSFT`GOOG`GS),n)\ndate=take(2012.06.12..2012.06.16,n)\ntime=rand(13:00:00.000..16:59:59.999,n)\nprice = 100 + rand(10.0,n)\nt2=table(sym,date,time,price).sortBy!([`date, `time])\n\nif(existsDatabase(\"dfs://test_stock\")){\ndropDatabase(\"dfs://test_stock\")\n}\ndb=database(\"dfs://test_stock\",VALUE,2012.06.12..2012.06.16)\npt1=db.createPartitionedTable(t1,`pt1,`date).append!(t1)\npt2=db.createPartitionedTable(t2,`pt2,`date).append!(t2)\n\nleft = table(100:0,`sym`dt`volume,[SYMBOL,TIMESTAMP,INT]) \nright = table(100:0,`sym`dt`price,[SYMBOL,TIMESTAMP,DOUBLE]) \n\nopt=table(100:0, `dt`sym`volume`price`total, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE])\najEngine=createAsofJoinEngine(name=\"ajEngine\", leftTable=left, rightTable=right, outputTable=opt, metrics=<[volume, price, volume*price]>, matchingColumn=`sym, timeColumn=`dt, useSystemTime=false, delayedTime=1)\n\nds1=replayDS(sqlObj=<select sym, concatDateTime(date, time) as dt, volume from pt1>,dateColumn=`date,timeColumn=`time,timeRepartitionSchema=[13:00:00.000, 14:00:00.000, 15:00:00.000, 16:00:00.000, 17:00:00.000])\nds2=replayDS(sqlObj=<select sym, concatDateTime(date, time) as dt, price from pt2>,dateColumn=`date,timeColumn=`time,timeRepartitionSchema=[13:00:00.000, 14:00:00.000, 15:00:00.000, 16:00:00.000, 17:00:00.000])\n\nreplay(inputTables=[ds1,ds2], outputTables=[getLeftStream(ajEngine), getRightStream(ajEngine)], dateColumn=`dt);   \n\nselect count(*) from opt\n// output: 50000\n```\n\nExample 3. N-to-1 heterogeneous replay. The output table needs to be deserialized, filtered and processed by `streamFilter`.\n\n```\nn=1000\nsym = take(`IBM`GS,n)\nmyDate=take(2021.01.02..2021.01.06, n).sort!()\nmyTime=take(09:30:00..15:59:59,n)\nvol = rand(100,n)\nt=table(sym,myDate,myTime,vol)\n\nsym = take(`IBM`GS,n)\ndate=take(2021.01.02..2021.01.06, n).sort!()\ntime=take(09:30:00..15:59:59,n)\nvol = rand(100,n)\nprice = take(10,n)+rand(1.0,n)\nt1=table(sym, date,time,vol,price)\n\n\nif(existsDatabase(\"dfs://test_stock1\")){\ndropDatabase(\"dfs://test_stock1\")\n}\ndb1=database(\"\",RANGE, 2021.01.02..2021.01.07)\ndb2=database(\"\",VALUE,`IBM`GS)\ndb=database(\"dfs://test_stock1\",COMPO,[db1, db2])\norders=db.createPartitionedTable(t,`orders,`myDate`sym)\norders.append!(t);\ntrades=db.createPartitionedTable(t1,`trades,`date`sym)\ntrades.append!(t1);\n// load data sources\nds = replayDS(sqlObj=<select * from loadTable(db, `orders)>, dateColumn=`myDate, timeColumn=`myTime)\nds.size();\nds1 = replayDS(sqlObj=<select * from loadTable(db, `trades)>, dateColumn=`date, timeColumn=`time)\nds1.size();\n\ninput_dict  = dict([\"msg1\", \"msg2\"], [ds, ds1])\ndate_dict = dict([\"msg1\", \"msg2\"], [`myDate, `date])\ntime_dict = dict([\"msg1\", \"msg2\"], [`myTime, `time])\n//subscribe to the output table of replay to ingest the data to the stream filter\nshare streamTable(100:0,`timestamp`sym`blob`vol, [DATETIME,SYMBOL, BLOB, INT]) as opt\n\nfilterOrder=table(100:0, `sym`date`time`volume, [SYMBOL, DATE, SECOND, INT])\nfilterTrades=table(100:0, `sym`date`time`volume`price, [SYMBOL, DATE, SECOND, INT, DOUBLE])\n//define the input table of stream filter\nshare streamTable(100:0,`timestamp`sym`blob`vol, [DATETIME,SYMBOL, BLOB, INT]) as streamFilter_input\n// the stream filter splits the ingested data and distributes them to table \"filterOrder\" and \"filterTrades\"\nfilter1=dict(STRING,ANY)\nfilter1['condition']=`msg1\nfilter1['handler']=filterOrder\n\nfilter2=dict(STRING,ANY)\nfilter2['condition']=`msg2\nfilter2['handler']=filterTrades\nschema=dict([\"msg1\",\"msg2\"], [filterOrder, filterTrades])\nstEngine=streamFilter(name=`streamFilter, dummyTable=streamFilter_input, filter=[filter1,filter2], msgSchema=schema)\nsubscribeTable(tableName=\"opt\", actionName=\"sub1\", offset=0, handler=stEngine, msgAsTable=true)\n\nreplay(inputTables=input_dict, outputTables=opt, dateColumn = date_dict, timeColumn=time_dict,  replayRate=100, absoluteRate=false);\n\nselect count(*) from filterOrder\n// output: 1000\n```\n\nExample 4. Automatically Recording Timestamps During Data Replay\n\nTo automatically record the timestamp of data writes during a replay, you can apply the [setStreamTableTimestamp](https://docs.dolphindb.com/en/Functions/s/setStreamTableTimestamp.html) function to the target output stream tables before starting the replay. This function records the system time at which each data row is written into the specified timestamp column during the replay.\n\nThe following example demonstrates how to set the timestamp columns using `setStreamTableTimestamp` for the output stream tables.\n\n```\n// input table\nn=50000\nsym = rand(symbol(`IBM`APPL`MSFT`GOOG`GS),n)\ndate = take(2012.06.12..2012.06.16,n)\ntime = take(13:00:00.000..16:59:59.999,n)\nvolume = rand(100,n)\ninput1 = table(sym,date,time,volume).sortBy!([`date, `time])\nsym = rand(symbol(`IBM`APPL`MSFT`GOOG`GS),n)\ndate = take(2012.06.12..2012.06.16,n)\ntime = take(13:00:00.000..16:59:59.999,n)\nprice = 100 + rand(10.0,n)\ninput2 = table(sym,date,time,price).sortBy!([`date, `time])\n// output table\nshare streamTable(100:0,`sym`date`time`volume`replaytime,[SYMBOL,DATE,TIME,INT,TIMESTAMP]) as output1\nshare streamTable(100:0,`sym`date`time`price`replaytime,[SYMBOL,DATE,TIME,DOUBLE,TIMESTAMP]) as output2\nsetStreamTableTimestamp(output1, `replaytime)\nsetStreamTableTimestamp(output2, `replaytime)\n// replay\nreplay(inputTables=[input1, input2], outputTables=[output1, output2], dateColumn=`date, timeColumn=`time)\n```\n\nCheck output1:\n\n| sym  | date       | time         | volume | replaytime              |\n| ---- | ---------- | ------------ | ------ | ----------------------- |\n| GOOG | 2012.06.12 | 13:00:00.000 | 12     | 2025.08.05 10:14:55.475 |\n| GOOG | 2012.06.12 | 13:00:00.005 | 78     | 2025.08.05 10:14:55.475 |\n| GOOG | 2012.06.12 | 13:00:00.010 | 43     | 2025.08.05 10:14:55.475 |\n| GS   | 2012.06.12 | 13:00:00.015 | 19     | 2025.08.05 10:14:55.475 |\n| MSFT | 2012.06.12 | 13:00:00.020 | 99     | 2025.08.05 10:14:55.475 |\n| …    |            |              |        |                         |\n\nCheck output2:\n\n| sym  | date       | time         | price              | replaytime              |\n| ---- | ---------- | ------------ | ------------------ | ----------------------- |\n| APPL | 2012.06.12 | 13:00:00.000 | 104.28991972325885 | 2025.08.05 10:14:55.476 |\n| MSFT | 2012.06.12 | 13:00:00.005 | 105.34384201248842 | 2025.08.05 10:14:55.476 |\n| APPL | 2012.06.12 | 13:00:00.010 | 102.77994729862654 | 2025.08.05 10:14:55.476 |\n| APPL | 2012.06.12 | 13:00:00.015 | 105.42814567712317 | 2025.08.05 10:14:55.476 |\n| APPL | 2012.06.12 | 13:00:00.020 | 108.74385016313717 | 2025.08.05 10:14:55.476 |\n| …    |            |              |                    |                         |\n\n"
    },
    "replayDS": {
        "url": "https://docs.dolphindb.com/en/Functions/r/replayDS.html",
        "signatures": [
            {
                "full": "replayDS(sqlObj, [dateColumn], [timeColumn], [timeRepartitionSchema])",
                "name": "replayDS",
                "parameters": [
                    {
                        "full": "sqlObj",
                        "name": "sqlObj"
                    },
                    {
                        "full": "[dateColumn]",
                        "name": "dateColumn",
                        "optional": true
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[timeRepartitionSchema]",
                        "name": "timeRepartitionSchema",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [replayDS](https://docs.dolphindb.com/en/Functions/r/replayDS.html)\n\n\n\n#### Syntax\n\nreplayDS(sqlObj, \\[dateColumn], \\[timeColumn], \\[timeRepartitionSchema])\n\n#### Details\n\nGenerates a tuple of data sources from a DFS table (queried by a SQL statement) based on its time columns. It can be further divided by the parameters *timeColumn* and *timeRepartitionSchema*.\n\nIt is used as the inputs of function `replay`. To replay a DFS table, the `replay` function must be conjuncted with the `replayDS` function.\n\n#### Parameters\n\n**sqlObj** is metacode with SQL statements. The table object in the SQL statement is a DFS table and must use a DATE type column as one of the partitioning columns.\n\n**dateColumn** (optional) must be a time column of the table queried by the SQL statement, based on which the data is sorted. It can be of DATE (most commonly used), MONTH or other temporal types. If *dateColumn* is specified, it must be one of the partitioning columns of the DFS table. Data sources are generated based on the time precision of the *dateColumn*, e.g., if the *dateColumn* is partitioned by day, the data source is also divided by day.\n\n**timeColumn** (optional) must be a time column of the table queried by the SQL statement, based on which the data is sorted. If *dateColumn* is of DATE type, you can further deliminate data sources by specifying *timeColumn* as SECOND, TIME or NANOTIME type.\n\n**Note:**\n\n* Currently, parameters *dateColumn* and *timeColumn* do not support DATEHOUR type.\n\n* If *dateColumn* is not specified, the first column of the table object is treated as the date column.\n\n**timeRepartitionSchema** (optional) is a vector of temporal type. If *timeColumn* is specified, *timeRepartitionSchema* deliminates multiple data sources based on *timeColumn*. For example, if timeRepartitionSchema =\\[t1, t2, t3], then there are 4 data sources within each day: \\[00:00:00.000,t1), \\[t1,t2), \\[t2,t3), and \\[t3,23:59:59.999).\n\n#### Returns\n\nA data source list of type ANY VECTOR.\n\n#### Examples\n\n```\nn=int(60*60*6.5)\nsym = take(take(`IBM,n).join(take(`GS,n)), n*2*3)\ndate=take(2021.01.04..2021.01.06, n*2*3).sort!()\ntime=take(09:30:00..15:59:59,n*2*3)\nvolume = rand(100, n*2*3)\nt=table(sym,date,time,volume)\nif(existsDatabase(\"dfs://test_stock\")){\ndropDatabase(\"dfs://test_stock\")\n}\ndb1=database(\"\",RANGE, 2021.01.04..2021.01.07)\ndb2=database(\"\",VALUE,`IBM`GS)\ndb=database(\"dfs://test_stock\",COMPO,[db1, db2])\ntrades=db.createPartitionedTable(t,`trades,`date`sym)\ntrades.append!(t);\nds = replayDS(sqlObj=<select * from loadTable(db, `trades)>, dateColumn=`date, timeColumn=`time)\nds.size();\n// output: 3\n\nds = replayDS(sqlObj=<select * from loadTable(db, `trades)>, dateColumn=`date, timeColumn=`time, timeRepartitionSchema=[11:30:00, 14:00:00])\nds.size();\n// output: 9\n```\n"
    },
    "repmat": {
        "url": "https://docs.dolphindb.com/en/Functions/r/repmat.html",
        "signatures": [
            {
                "full": "repmat(X, rowRep, colRep)",
                "name": "repmat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "rowRep",
                        "name": "rowRep"
                    },
                    {
                        "full": "colRep",
                        "name": "colRep"
                    }
                ]
            }
        ],
        "markdown": "### [repmat](https://docs.dolphindb.com/en/Functions/r/repmat.html)\n\n\n\n#### Syntax\n\nrepmat(X, rowRep, colRep)\n\n#### Details\n\nCreate a large matrix consisting of a rowRep-by-colRep tiling of copies of *X*.\n\n#### Parameters\n\n**X** is a matrix.\n\n**rowRep** and **colRep** are positive integers.\n\n#### Returns\n\nA matrix.\n\n#### Examples\n\n```\nx=matrix(1 2 3, 4 5 6);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nrepmat(x, 2, 3);\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 |\n| -- | -- | -- | -- | -- | -- |\n| 1  | 4  | 1  | 4  | 1  | 4  |\n| 2  | 5  | 2  | 5  | 2  | 5  |\n| 3  | 6  | 3  | 6  | 3  | 6  |\n| 1  | 4  | 1  | 4  | 1  | 4  |\n| 2  | 5  | 2  | 5  | 2  | 5  |\n| 3  | 6  | 3  | 6  | 3  | 6  |\n"
    },
    "resample": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resample.html",
        "signatures": [
            {
                "full": "resample(X, rule, func, [closed], [label], [origin='start_day'])",
                "name": "resample",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "rule",
                        "name": "rule"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "[closed]",
                        "name": "closed",
                        "optional": true
                    },
                    {
                        "full": "[label]",
                        "name": "label",
                        "optional": true
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    }
                ]
            }
        ],
        "markdown": "### [resample](https://docs.dolphindb.com/en/Functions/r/resample.html)\n\n\n\n#### Syntax\n\nresample(X, rule, func, \\[closed], \\[label], \\[origin='start\\_day'])\n\n#### Details\n\nApply func to *X* based on the frenquency (or the trading calendar) as specified in *rule*. Note that when *rule* is specified as the identifier of the trading calendar, data generated on a non-trading day will be calculated in the previous trading day.\n\nBoth DolphinDB’s `resample` and pandas’ `resample` are used for time series resampling and bucket-based aggregation, but their interface design and usage differ in several aspects:\n\n* DolphinDB’s `resample` adopts a functional interface, where the aggregation function is passed directly as an argument. The input object must be a matrix or series with monotonically increasing time-based row labels, and the function supports resampling rules based on built-in trading calendars.\n* pandas’ `resample` returns a Resampler object and is typically used in a chained style such as `df.resample(\"3min\").sum()` or `.agg()`. The input can use a DatetimeIndex, PeriodIndex, or TimedeltaIndex, and a time column can also be specified through the *on* or *level* parameter. This interface is more suitable for DataFrame-oriented workflows and natively supports post-resampling filling operations such as `asfreq`, `ffill`, `bfill`, and `interpolate`.\n\n#### Parameters\n\n**X** is a matrix or series with row labels. The row labels must be non-null values of temporal type, and must be increasing.\n\n**rule** is a string that can take the following values:\n\n| Values of parameter \"rule\" | Corresponding DolphinDB function |\n| -------------------------- | -------------------------------- |\n| \"B\"                        | businessDay                      |\n| \"W\"                        | weekEnd                          |\n| \"WOM\"                      | weekOfMonth                      |\n| \"LWOM\"                     | lastWeekOfMonth                  |\n| \"M\"                        | monthEnd                         |\n| \"MS\"                       | monthBegin                       |\n| \"BM\"                       | businessMonthEnd                 |\n| \"BMS\"                      | businessMonthBegin               |\n| \"SM\"                       | semiMonthEnd                     |\n| \"SMS\"                      | semiMonthBegin                   |\n| \"Q\"                        | quarterEnd                       |\n| \"QS\"                       | quarterBegin                     |\n| \"BQ\"                       | businessQuarterEnd               |\n| \"BQS\"                      | businessQuarterBegin             |\n| \"REQ\"                      | FY5253Quarter                    |\n| \"A\"                        | yearEnd                          |\n| \"AS\"                       | yearBegin                        |\n| \"BA\"                       | businessYearEnd                  |\n| \"BAS\"                      | businessYearBegin                |\n| \"RE\"                       | FY5253                           |\n| \"D\"                        | date                             |\n| \"H\"                        | hourOfDay                        |\n| \"min\"                      | minuteOfHour                     |\n| \"S\"                        | secondOfMinute                   |\n| \"L\"                        | millisecond                      |\n| \"U\"                        | microsecond                      |\n| \"N\"                        | nanosecond                       |\n| \"SA\"                       | semiannualEnd                    |\n| \"SAS\"                      | semiannualBegin                  |\n\nThe strings above can also be used with positive integers for parameter *rule*. For example, \"2M\" means the end of every two months. In addition, *rule* can also be set as the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name. Positive integers can also be used with identifiers. For example, \"2XNYS\" means every two trading days of New York Stock Exchange.\n\n**func** is an aggregate function.\n\n**closed** (optional) is a string indicating which boundary of the interval is closed.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**label** (optional) is a string indicating which boundary is used to label the interval.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**origin** (optional) is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start\\_day', 'end', 'end\\_day' or a user-defined time object. The default value is 'start\\_day'.\n\n* 'epoch': *origin* is 1970-01-01\n\n* 'start': *origin* is the first value of the timeseries\n\n* 'start\\_day': *origin* is 00:00 of the first day of the timeseries\n\n* 'end': *origin* is the last value of the timeseries\n\n* 'end\\_day': *origin* is 24:00 of the last day of the timeseries\n\n#### Returns\n\nA matrix or series with row labels.\n\n#### Examples\n\n```\nindex = [2000.01.01, 2000.01.31, 2000.02.15, 2000.02.20, 2000.03.12, 2000.04.16, 2000.05.06, 2000.08.30]\ns = indexedSeries(index, 1..8)\ns.resample(\"M\", sum);\n```\n\n|            | col1 |\n| ---------- | ---- |\n| 2000.01.31 | 3    |\n| 2000.02.29 | 7    |\n| 2000.03.31 | 5    |\n| 2000.04.30 | 6    |\n| 2000.05.31 | 7    |\n| 2000.06.30 |      |\n| 2000.07.31 |      |\n| 2000.08.31 | 8    |\n\n```\ns.resample(\"2M\", last);\n```\n\n|            | col1 |\n| ---------- | ---- |\n| 2000.01.31 | 2    |\n| 2000.03.31 | 5    |\n| 2000.05.31 | 7    |\n| 2000.07.31 |      |\n| 2000.09.30 | 8    |\n\n```\nindex = temporalAdd(2022.01.01 00:00:00,1..8,`m)\ns = indexedSeries(index, 1..8)\ns.resample(rule=`3min, func=sum);\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.01.01T00:00:00 | 3    |\n| 2022.01.01T00:03:00 | 12   |\n| 2022.01.01T00:06:00 | 21   |\n\n```\ns.resample(rule=`3min, func=sum, closed=`right);\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.01.01T00:00:00 | 6    |\n| 2022.01.01T00:03:00 | 15   |\n| 2022.01.01T00:06:00 | 15   |\n\n```\ns.resample(rule=`3min, func=sum, closed=`left,origin=`end);\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.01.01T00:02:00 | 1    |\n| 2022.01.01T00:05:00 | 9    |\n| 2022.01.01T00:08:00 | 18   |\n| 2022.01.01T00:11:00 | 8    |\n\n```\ns.resample(rule=`3min, func=sum,origin=2022.10.01 00:00:10)\n```\n\n| label               | col1 |\n| ------------------- | ---- |\n| 2022.01.01T00:00:10 | 6    |\n| 2022.01.01T00:03:10 | 15   |\n| 2022.01.01T00:06:10 | 15   |\n\nA matrix with increasing row labels can be specified.\n\n```\nm = matrix(1..5, 1..5)\n// The row labels are non-strictly increasing.\nindex = temporalAdd(2000.01.01, [1, 1, 2, 2, 3], \"d\")\nm.rename!(index, `A`B);\nm.resample(rule=`D, func=sum);\n```\n\n| label      | A | B |\n| ---------- | - | - |\n| 2000.01.02 | 3 | 3 |\n| 2000.01.03 | 7 | 7 |\n| 2000.01.04 | 5 | 5 |\n"
    },
    "resetDBDirMeta": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resetDBDirMeta.html",
        "signatures": [
            {
                "full": "resetDBDirMeta(dbDir)",
                "name": "resetDBDirMeta",
                "parameters": [
                    {
                        "full": "dbDir",
                        "name": "dbDir"
                    }
                ]
            }
        ],
        "markdown": "### [resetDBDirMeta](https://docs.dolphindb.com/en/Functions/r/resetDBDirMeta.html)\n\n\n\n#### Syntax\n\nresetDBDirMeta(dbDir)\n\n#### Details\n\nWhen transferring metadata across disk volumes, please call `resetDBDirMeta` to change the DATABASE storage path in the metadata to the destination path before transferring the metadata. This command can only be executed on the data node.\n\n**Note:**\n\n1. The transfer of metadata across volumes can only be performed on the same node;\n\n2. Before moving the metadata, make sure that there is no writing process on the current node, all transactions have been completed, and all buffers have been synchronized to the disk.\n\nThe procedures to move the metalog (including CHUNK\\_METADATA, DATABASE, IOTRAN\\_TYPE and LOG) from volume A to volume B are as follows:\n\n1. Execute command `resetDBDirMeta('volumeB/DATABASE')` and shut down the server.\n\n2. Copy the directories CHUNK\\_METADATA, DATABASE, IOTRAN\\_TYPE and LOG from VolumeA to VolumeB.\n\n3. Delete the original directories CHUNK\\_METADATA, DATABASE, IOTRAN\\_TYPE and LOG from VolumeA.\n\n4. Modify the configuration parameter *chunkMetaDir* = volumeB/CHUNK\\_METADATA and start the server.\n\n#### Parameters\n\n**dbDir** is a string in the format of \"volumeB/DATABASE\", indicating the destination directory to which the database will be moved.\n"
    },
    "resetDfsRebalanceConcurrency": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resetDfsRebalanceConcurrency.html",
        "signatures": [
            {
                "full": "resetDfsRebalanceConcurrency(newConcurrecyNum)",
                "name": "resetDfsRebalanceConcurrency",
                "parameters": [
                    {
                        "full": "newConcurrecyNum",
                        "name": "newConcurrecyNum"
                    }
                ]
            }
        ],
        "markdown": "### [resetDfsRebalanceConcurrency](https://docs.dolphindb.com/en/Functions/r/resetDfsRebalanceConcurrency.html)\n\n#### Syntax\n\nresetDfsRebalanceConcurrency(newConcurrecyNum)\n\n#### Details\n\nModify the number of workers used by the current node for chunk rebalance online. This function can only be executed by the administrator on the controller.\n\n**Note:** This function modifies the configuration parameter *dfsRebalanceConcurrency* during the current session only. To permanently modify *dfsRebalanceConcurrency*, change it in the configuration file (the default value is twice the number of all nodes except the agent).\n\n#### Parameters\n\n**newConcurrecyNum** is a positive integer that specifies the maximum number of workers allocated for chunk rebalance.\n\n#### Examples\n\n```\nresetDfsRebalanceConcurrency(2)\n```\n\nRelated functions: [getDfsRebalanceConcurrency](https://docs.dolphindb.com/en/Functions/g/getDfsRebalanceConcurrency.html)\n\n"
    },
    "resetDfsRecoveryConcurrency": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resetDfsRecoveryConcurrency.html",
        "signatures": [
            {
                "full": "resetDfsRecoveryConcurrency(newConcurrecyNum)",
                "name": "resetDfsRecoveryConcurrency",
                "parameters": [
                    {
                        "full": "newConcurrecyNum",
                        "name": "newConcurrecyNum"
                    }
                ]
            }
        ],
        "markdown": "### [resetDfsRecoveryConcurrency](https://docs.dolphindb.com/en/Functions/r/resetDfsRecoveryConcurrency.html)\n\n#### Syntax\n\nresetDfsRecoveryConcurrency(newConcurrecyNum)\n\n#### Details\n\nModify the number of workers used by the current node for chunk recovery online. This function can only be executed by the administrator on the controller.\n\n**Note:** This function modifies the configuration parameter *dfsRecoveryConcurrency* during the current session only. To permanently modify *dfsRecoveryConcurrency*, change it in the configuration file (the default value is twice the number of all nodes except the agent).\n\n#### Parameters\n\n**newConcurrecyNum** is a positive integer that specifies the maximum number of workers allocated for chunk recovery.\n\n#### Examples\n\n```\nresetDfsRecoveryConcurrency(2)\n```\n\nRelated functions: [getDfsRecoveryConcurrency](https://docs.dolphindb.com/en/Functions/g/getDfsRecoveryConcurrency.html)\n\n"
    },
    "resetPwd": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resetPwd.html",
        "signatures": [
            {
                "full": "resetPwd(userId, newPwd)",
                "name": "resetPwd",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    },
                    {
                        "full": "newPwd",
                        "name": "newPwd"
                    }
                ]
            }
        ],
        "markdown": "### [resetPwd](https://docs.dolphindb.com/en/Functions/r/resetPwd.html)\n\n\n\n#### Syntax\n\nresetPwd(userId, newPwd)\n\n#### Details\n\nReset a user's password. This can only be executed by an administrator.\n\n#### Parameters\n\n**userId** is a string indicating a user name.\n\n**newPwd** is a string indicating the new password for the user. It cannot contain space or control characters.\n\nSince DolphinDB 2.00.10.10, users can determine whether to verify the complexity of *newPwd* by setting the configuration *enhancedSecurityVerification*. If it is not specified, no verification will be applied; if it is set to true, the password must meet the following conditions:\n\n* 8-20 characters\n\n* at least 1 capital letter\n\n* at least 1 special character, including !\"#$%&'()\\*+,-./:;<=>?@\\[]^\\_\\`{|}\\~\n\n#### Examples\n\n```\nresetPwd(`AlexEdwards, `T51pm363);\n```\n"
    },
    "resetRecoveryWorkerNum": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resetRecoveryWorkerNum.html",
        "signatures": [
            {
                "full": "resetRecoveryWorkerNum(newWorkerNum)",
                "name": "resetRecoveryWorkerNum",
                "parameters": [
                    {
                        "full": "newWorkerNum",
                        "name": "newWorkerNum"
                    }
                ]
            }
        ],
        "markdown": "### [resetRecoveryWorkerNum](https://docs.dolphindb.com/en/Functions/r/resetRecoveryWorkerNum.html)\n\n#### Syntax\n\nresetRecoveryWorkerNum(newWorkerNum)\n\n#### Details\n\nModify 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.\n\n**Note:** 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).\n\n#### Parameters\n\n**newWokerNum** is a positive integer that specifies the number of worker threads used for chunk recovery.\n\n#### Examples\n\n```\nresetRecoveryWorkerNum(2)\n```\n\n"
    },
    "reshape": {
        "url": "https://docs.dolphindb.com/en/Functions/r/reshape.html",
        "signatures": [
            {
                "full": "reshape(obj, [dim])",
                "name": "reshape",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[dim]",
                        "name": "dim",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [reshape](https://docs.dolphindb.com/en/Functions/r/reshape.html)\n\n\n\n#### Syntax\n\nreshape(obj, \\[dim])\n\n#### Details\n\nChange the dimensions of a matrix and return a new matrix. If *dim* is not specified, reshape *obj* to a vector.\n\nBoth DolphinDB’s `reshape(obj, dim)` and NumPy’s `numpy.reshape(a, shape)` are used to reshape data, but their behavior differs in several aspects:\n\n* DolphinDB only supports vectors and matrices. The target dimensions are specified using a pair, and data is filled in column-major order by default, making its behavior closer to NumPy with `order=\"F\"`.\n* NumPy supports arbitrary-dimensional `ndarray` objects and fills data in row-major order by default (`order=\"C\"`). It also supports automatic dimension inference, as well as parameters such as *order* and *copy*.\n* In addition, when *dim* is omitted in DolphinDB, a matrix is flattened into a vector. In NumPy, the target shape must always be specified explicitly, and flattening is typically achieved with `reshape(-1)`.\n\n#### Parameters\n\n**obj** is a vector/matrix.\n\n**dim** (optional) is a pair of integers indicating (row dimension):(column dimension) of the result.\n\n#### Returns\n\nA reshaped matrix. If *dim* is not specified, returns a vector.\n\n#### Examples\n\n```\nx=1..6;\nx=x.reshape(3:2);\nx\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nx=x.reshape(2:3);\nx\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 1  | 4  | 6  |\n\n```\nx=x.reshape(6:1)\nx\n```\n\n| #0 |\n| -- |\n| 1  |\n| 2  |\n| 3  |\n| 4  |\n| 5  |\n| 6  |\n\n```\nx.reshape()\n// output: [1,2,3,4,5,6]\n// reshape x to a vector.\n```\n"
    },
    "residual": {
        "url": "https://docs.dolphindb.com/en/Functions/r/residual.html",
        "signatures": [
            {
                "full": "residual(Y,X,params,[intercept=true])",
                "name": "residual",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "params",
                        "name": "params"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [residual](https://docs.dolphindb.com/en/Functions/r/residual.html)\n\n\n\n#### Syntax\n\nresidual(Y,X,params,\\[intercept=true])\n\n#### Details\n\nReturn the residuals from the least squares regression of *Y* on *X*.\n\n**Note:**\n\n* For an in-memory table, the residuals can be obtained setting mode=2 in function `ols` or `wls`;\n\n* For a DFS table, the residuals can only be obtained with function `residual`.\n\n#### Parameters\n\n**Y** is the dependent variable. It is a vector.\n\n**X** is the independent variable(s). *X* can be a matrix, table or tuple. When *X* is a matrix, if the number of rows is the same as the length of *Y*, each column of *X* is a factor; If the number of columns equals the length of *Y*, each row of *X* is a factor.\n\n**params** is the regression estimator.\n\n**intercept** (optional) is a Boolean variable indicating whether to include an intercept in the regression. The default value is true, meaning that the system automatically adds a column of \"1\" to *X* to generate the intercept.\n\n#### Returns\n\nA DOUBLE vector.\n\n#### Examples\n\n```\nx1=1 3 5 7 11 16 23\nx2=2 8 11 34 56 54 100\ny=0.1 4.2 5.6 8.8 22.1 35.6 77.2\n\nparams=ols(y, x1);\nresidual(y,x1,params)\n// output: [6.634188034188036,3.976923076923078,-1.380341880341881,-4.937606837606838,-5.152136752136756,-8.545299145299146,9.404273504273504]\n\nparams1=ols(y, (x1,x2),false);\nresidual(y,(x1,x2),params1,false)\n// output: [-1.941530853763632,-2.556479729553295,-4.923597852949359,-11.809587658969416,-11.098921251860737,-4.0152525111045,13.183836820351686]\n\nx=matrix(1 4 8 2 3, 1 4 2 3 8, 1 5 1 1 5);\np1=ols(1..5, x);\nresidual(1..5, x,p1);\n// output: [-0.474770642201834,0.268348623853214,-0.123853211009174,0.598623853211011,-0.268348623853205]\n```\n"
    },
    "restore": {
        "url": "https://docs.dolphindb.com/en/Functions/r/restore.html",
        "signatures": [
            {
                "full": "restore(backupDir, dbPath, tableName, partition, [force=false], [outputTable], [parallel=false], [snapshot=false], [keyPath])",
                "name": "restore",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "partition",
                        "name": "partition"
                    },
                    {
                        "full": "[force=false]",
                        "name": "force",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[outputTable]",
                        "name": "outputTable",
                        "optional": true
                    },
                    {
                        "full": "[parallel=false]",
                        "name": "parallel",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[snapshot=false]",
                        "name": "snapshot",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyPath]",
                        "name": "keyPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [restore](https://docs.dolphindb.com/en/Functions/r/restore.html)\n\n\n\n#### Syntax\n\nrestore(backupDir, dbPath, tableName, partition, \\[force=false], \\[outputTable], \\[parallel=false], \\[snapshot=false], \\[keyPath])\n\n#### Details\n\nRestore the specified partitions from the most recent backup. Return a string vector indicating the path of restored partitions. The function must be executed by a logged-in user.\n\nNote:\n\n* To restore the partitions backed up with SQL statements, the parameter *snapshot* should not be true. Otherwise an error is raised.\n\n* When restoring the partitions backed up with SQL statements, the backup data is directly appended to the target restore table; When restoring the partitions backed up by copying files, the system only overwrites the partitions that have different data.\n\n* Make sure that the storage engine of the backup database is the same as the engine of *newDBPath*, and the partitionScheme must be the same (except for VALUE). For a VALUE partitioned database, if the configuration newValuePartitionPolicy is not set to add, the partitioning scheme of the backup database must be a subset of that of the database to be restored. For example, if the partitioning scheme of the backup database is database(\"dfs\\://xxx\", VALUE, 2017.08.07..2017.08.11), then the partitioning scheme of the target database must be VALUE-based and its range must be beyond 2017.08.07..2017.08.11.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory where the backup is kept.\n\n**dbPath** is a string indicating the path of a DFS database.\n\n**tableName** is a string indicating a DFS table name.\n\n**partition** is a string indicating the relative path of the partitions to be restored. Use \"?\" as a single wildcard and \"%\" as a wildcard that can match zero or more characters.\n\n* To restore all partitions, use \"%\".\n\n* To restore a certain partition, specify the relative path or \"%\" +\"partition name\". For example, to restore the \"20170810/50\\_100\" partition under \"dfs\\://compoDB\", specify \"/compoDB/20170807/0\\_50\" or \"%/20170807/0\\_50\" as partition path.\n\n  For versions between 1.30.16/2.00.4 - 1.30.18/2.00.6, if *chunkGranularity* is set to \"TABLE\" when creating the database, *partition* must include the physical index (which you can get with the `listTables` function) of the selected partition. For example, if the physical index of the \"/compoDB/20170807/0\\_50\" partition is 8t, then specify partition as \"/compoDB/20170807/0\\_50/8t\" to restore it.\n\n**force** (optional) is a Boolean value. The default value is false, meaning to perform an incremental recovery, i.e., only the partitions with different metadata from that of the most recent backup are restored. True means to perform a full recovery.\n\n**outputTable** (optional) is the handle to a DFS table which has the same schema as the backup table. If it is unspecified, partitions will be restored to the target table specified by *tableName*; Otherwise, partitions will be restored to *outputTable* whereas the table specified by *tableName* remains unchanged.\n\n**parallel** (optional) is a Boolean value indicating whether to restore partitions of a table in parallel. The default value is false.\n\n**snapshot** (optional) is a Boolean value indicating whether to synchronize the deletion of table/partitions in the backup to the restored database. It only takes effect when *partition* is set to \"%\". If set to true, the deleted tables/partitions in the backup are deleted in the target restore database synchronously. Note: For versions prior to 2.00.13/3.00.1, the default value for *snapshot* is true. Since version 2.00.13/3.00.1, the default value is false.\n\n**keyPath** (optional, Linux only) is a STRING scalar that specifies the path to the key file used for restoring an encrypted backup. The key version used for restoring the data must match the version specified during the backup. Note that when restoring an encrypted table, both the backup table and the target table must use the same encryption mode (i.e., the same *encryptMode* parameter specified during table creation).\n\n#### Returns\n\nA STRING vector containing the paths of the restored partitions. This function must be executed after user login.\n\n#### Examples\n\nCreate a DFS database dfs\\://compoDB\n\n```\nn=1000000\nID=rand(100, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x);\n\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndbID=database(, RANGE, 0 50 100);\ndb = database(\"dfs://compoDB\", COMPO, [dbDate, dbID]);\npt = db.createPartitionedTable(t, `pt, `date`ID)\npt.append!(t);\n```\n\nBack up the entire table pt:\n\n```\nbackup(\"/home/DolphinDB/backup\",<select * from loadTable(\"dfs://compoDB\",\"pt\")>,true);\n// output: 10\n```\n\nExample 1. Restore the entire table pt:\n\n```\nrestore(\"/home/DolphinDB/backup\",\"dfs://compoDB\",\"pt\",\"%\",true);\n// output: [\"dfs://compoDB/20170807/0_50/6F\",\"dfs://compoDB/20170807/50_100/6F\",\"dfs://compoDB/20170808/0_50/6F\",\"dfs://compoDB/20170808/50_100/6F\",\"dfs://compoDB/20170809/0_50/6F\",\"dfs://compoDB/20170809/50_100/6F\",\"dfs://compoDB/20170810/0_50/6F\",\"dfs://compoDB/20170810/50_100/6F\",\"dfs://compoDB/20170811/0_50/6F\",\"dfs://compoDB/20170811/50_100/6F\"]\n```\n\nExample 2. Restore the partitions in table pt with date=2017.08.10:\n\n```\nrestore(\"/home/DolphinDB/backup\",\"dfs://compoDB\",\"pt\",\"%20170810%\",true)\n// output: [\"dfs://compoDB/20170810/0_50/6F\",\"dfs://compoDB/20170810/50_100/6F\"]\n```\n\nExample 3. Restore the backup of table pt to table temp. Table temp has the same schema as table pt. Note that data loss may occur in table temp when using \"%\".\n\n```\ntemp=db.createPartitionedTable(t, `pt, `date`ID);\n\nrestore(\"/home/DolphinDB/backup\",\"dfs://compoDB\",\"pt\",\"%\",true,temp);\n// output: [\"dfs://compoDB/20170807/0_50/6F\",\"dfs://compoDB/20170807/50_100/6F\",\"dfs://compoDB/20170808/0_50/6F\",\"dfs://compoDB/20170808/50_100/6F\",\"dfs://compoDB/20170809/0_50/6F\",\"dfs://compoDB/20170809/50_100/6F\",\"dfs://compoDB/20170810/0_50/6F\",\"dfs://compoDB/20170810/50_100/6F\",\"dfs://compoDB/20170811/0_50/6F\",\"dfs://compoDB/20170811/50_100/6F\"]\n\nselect count(*) from temp;\n```\n\n| count   |\n| ------- |\n| 1000000 |\n\nRelated functions: [restoreDB](https://docs.dolphindb.com/en/Functions/r/restoreDB.html), [restoreTable](https://docs.dolphindb.com/en/Functions/r/restoreTable.html), [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html), [backup](https://docs.dolphindb.com/en/Functions/b/backup.html)\n"
    },
    "restoreDB": {
        "url": "https://docs.dolphindb.com/en/Functions/r/restoreDB.html",
        "signatures": [
            {
                "full": "restoreDB(backupDir, dbPath, [newDBPath], [keyPath])",
                "name": "restoreDB",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "[newDBPath]",
                        "name": "newDBPath",
                        "optional": true
                    },
                    {
                        "full": "[keyPath]",
                        "name": "keyPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [restoreDB](https://docs.dolphindb.com/en/Functions/r/restoreDB.html)\n\n\n\n#### Syntax\n\nrestoreDB(backupDir, dbPath, \\[newDBPath], \\[keyPath])\n\n#### Details\n\nRestore the backup database. Return a table where each row is the restored database and table name.\n\nSimilar to function [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html), the function can restore a database, and the difference lies in:\n\n* `migrate` can restore all databases and tables under a directory, while `restoreDB` can only restore a database.\n\n* If the names of restored database and tables are the same as the originals, the original databases and tables must be deleted before calling `migrate`, which is not required by function `restoreDB`.\n\nNote:\n\n* This function can only restore a database backed up by copying files (when dbPath is specified for function backup).\n\n* Make sure that the storage engine of the backed-up database is the same as the engine of *newDBPath*, and the *partitionScheme* (except for VALUE) must be the same. For a VALUE partitioned database, the partitioning scheme of the backup database must be a subset of that of the database to be restored.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory to save the backup.\n\n**dbPath** is a string indicating the database path.\n\n**newDBPath** (optional) is is a string indicating the new database name. The default value is *dbPath*.\n\n**keyPath** (optional, Linux only) is a STRING scalar that specifies the path to the key file used for restoring an encrypted backup. The key version used for restoring the data must match the version specified during the backup. Note that when restoring an encrypted table, both the backup table and the target table must use the same encryption mode (i.e., the same *encryptMode* parameter specified during table creation).\n\n#### Returns\n\nA table containing database names and table names, where each row indicates a restored database and table.\n\n#### Examples\n\n```\ndbName = \"dfs://compoDB2\"\nn=1000\nID=rand(\"a\"+string(1..10), n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10, n)\nt=table(ID, date, x)\ndb1 = database(, VALUE, 2017.08.07..2017.08.11)\ndb2 = database(, HASH,[INT, 20])\nif(existsDatabase(dbName)){\n     dropDatabase(dbName)\n}\ndb = database(dbName, COMPO,[ db1,db2])\n\n//create 2 tables\npt1 = db.createPartitionedTable(t, `pt1, `date`x).append!(t)\npt2 = db.createPartitionedTable(t, `pt2, `date`x).append!(t)\n\nbackupDB(backupDir, dbName)\n\nrestoreDB(backupDir, dbName)\n```\n\n| dbName          | tableName |\n| --------------- | --------- |\n| dfs\\://compoDB2 | pt1       |\n| dfs\\://compoDB2 | pt2       |\n\nRelated functions: [restore](https://docs.dolphindb.com/en/Functions/r/restore.html), [restoreTable](https://docs.dolphindb.com/en/Functions/r/restoreTable.html), [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html), [backup](https://docs.dolphindb.com/en/Functions/b/backup.html), [backupDB](https://docs.dolphindb.com/en/Functions/b/backupDB.html), [backupTable](https://docs.dolphindb.com/en/Functions/b/backupTable.html)\n"
    },
    "restoreDislocatedTablet": {
        "url": "https://docs.dolphindb.com/en/Functions/r/restoreDislocatedTablet.html",
        "signatures": [
            {
                "full": "restoreDislocatedTablet()",
                "name": "restoreDislocatedTablet",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [restoreDislocatedTablet](https://docs.dolphindb.com/en/Functions/r/restoreDislocatedTablet.html)\n\n\n\n#### Syntax\n\nrestoreDislocatedTablet()\n\n#### Details\n\nWhen *enableChunkGranularityConfig*=false (see details in [Reference *enableChunkGranularityConfig*](https://docs.dolphindb.com/en/Database/Configuration/reference.md#)) all tables in the same partition are distributed in the same node.\n\nWhen rebalancing data by function [rebalanceChunksAmongDataNodes](https://docs.dolphindb.com/en/Functions/r/rebalanceChunksAmongDataNodes.html), if the node is down, some tables in the same partition may fail to relocate, i.e., different tables under the same partition will be distributed in different nodes. Execute the function to move all tables under the same partition to one node.\n\nReturn a table containing the following columns:\n\n| name     | meaning                   |\n| -------- | ------------------------- |\n| chunkId  | the chunk ID              |\n| srcNode  | alias of source node      |\n| destNode | alias of destination node |\n\nThis function can only be executed on the controller.\n\nYou can get the status of recovery tasks by [getRecoveryTaskStatus](https://docs.dolphindb.com/en/Functions/g/getRecoveryTaskStatus.html) on a controller.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA table containing the following columns: chunkId, srcNode, and destNode.\n\n#### Examples\n\n```\nrestoreDislocatedTablet()\n```\n\n| chunkId                              | srcNode | destNode |\n| ------------------------------------ | ------- | -------- |\n| 99279094-ca12-3b87-48b6-520cbb986f39 | node1   | node2    |\n| 45f612b8-42f5-aebd-4cef-e522b6ae1fc8 | node1   | node2    |\n"
    },
    "restoreSettings": {
        "url": "https://docs.dolphindb.com/en/Functions/r/restoreSettings.html",
        "signatures": [
            {
                "full": "restoreSettings(fileName, [overwrite=false])",
                "name": "restoreSettings",
                "parameters": [
                    {
                        "full": "fileName",
                        "name": "fileName"
                    },
                    {
                        "full": "[overwrite=false]",
                        "name": "overwrite",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [restoreSettings](https://docs.dolphindb.com/en/Functions/r/restoreSettings.html)\n\n#### Syntax\n\nrestoreSettings(fileName, \\[overwrite=false])\n\n#### Details\n\nRestore settings on users, permissions, and function views with files backed up with `backupSettings` to the current cluster.\n\nThis function can only be executed by an administrator on the controller. It can be used with `backupSettings` to back up and restore user settings when migrating databases.\n\n#### Parameters\n\n**fileName**is a STRING scalar specifying the backup file path. It can be an absolute path or relative path to *\\<HomeDir>*.\n\n**overwrite**(optional) is a Boolean scalar indicating whether to overwrite the current settings with the backup setting files.\n\n* false (default): Not to overwrite the current settings. Only new users (along with permissions) and function views are added.\n\n* true: Delete current settings and overwrite with the backup files.\n\n#### Returns\n\nA vector containing all restored user names and function views.\n\n#### Examples\n\nFor a cluster with user A and B, restore permission settings on user A and C.\n\nWhen *overwrite*=false, add user C and its permission to the cluster:\n\n```\nrestoreSettings(fileName=\"/home/ddb/backup/permission.back\", overwrite=false)\n```\n\nWhen *overwrite*=true, overwrite the user settings in the cluster:\n\n```\nrestoreSettings(fileName=\"/home/ddb/backup/permission.back\", overwrite=true)\n```\n\n**Related function**: [backupSettings](https://docs.dolphindb.com/en/Functions/b/backupSettings.html)\n\n"
    },
    "restoreTable": {
        "url": "https://docs.dolphindb.com/en/Functions/r/restoreTable.html",
        "signatures": [
            {
                "full": "restoreTable(backupDir, dbPath, tableName, [newDBPath], [newTableName], [keyPath])",
                "name": "restoreTable",
                "parameters": [
                    {
                        "full": "backupDir",
                        "name": "backupDir"
                    },
                    {
                        "full": "dbPath",
                        "name": "dbPath"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[newDBPath]",
                        "name": "newDBPath",
                        "optional": true
                    },
                    {
                        "full": "[newTableName]",
                        "name": "newTableName",
                        "optional": true
                    },
                    {
                        "full": "[keyPath]",
                        "name": "keyPath",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [restoreTable](https://docs.dolphindb.com/en/Functions/r/restoreTable.html)\n\n\n\n#### Syntax\n\nrestoreTable(backupDir, dbPath, tableName, \\[newDBPath], \\[newTableName], \\[keyPath])\n\n#### Details\n\nRestore the backup database. Return a table where each row is the restored database and table name. The function is equivalent to `restore(backupDir, dbPath, tableName, force=false, parallel=true, snapshot=true)`.\n\nSimilar to function [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html), the function can restore all tables of a database, and the difference lies in:\n\n* `migrate` can restore all databases and tables under a directory, while `restoreTable` can only restore a table.\n\n* When the names of restored database and tables are the same as the originals, the original database and tables must be deleted before calling `migrate`, which is not required by function `restoreTable`.\n\nNote:\n\n* This function can only restore a database backed up by copying files (when dbPath is specified for function backup).\n\n* Make sure that the storage engine of the backed-up database is the same as the engine of *newDBPath*, and the partitionScheme (except for VALUE) must be the same. For a VALUE partitioned database, the partitioning scheme of the backup database must be a subset of that of the database to be restored.\n\n#### Parameters\n\n**backupDir** is a string indicating the directory to save the backup.\n\n**dbPath** is a string indicating the database path.\n\n**tableName** is a string indicating the table name.\n\n**newDBPath** (optional) is a string indicating the new database name. The default value is *dbPath*.\n\n**newTableName** (optional) is a string indicating the new table name. The default value is *tableName*.\n\n**keyPath** (optional, Linux only) is a STRING scalar that specifies the path to the key file used for restoring an encrypted backup. The key version used for restoring the data must match the version specified during the backup. Note that when restoring an encrypted table, both the backup table and the target table must use the same encryption mode (i.e., the same *encryptMode* parameter specified during table creation).\n\n#### Returns\n\nA table containing database names and table names.\n\n#### Examples\n\n```\ndbName = \"dfs://compoDB2\"\nn=1000\nID=rand(\"a\"+string(1..10), n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10, n)\nt=table(ID, date, x)\ndb1 = database(, VALUE, 2017.08.07..2017.08.11)\ndb2 = database(, HASH,[INT, 20])\nif(existsDatabase(dbName)){\n     dropDatabase(dbName)\n}\ndb = database(dbName, COMPO,[ db1,db2])\n\n//create 2 tables\npt1 = db.createPartitionedTable(t, `pt1, `date`x).append!(t)\npt2 = db.createPartitionedTable(t, `pt2, `date`x).append!(t)\n\nbackupDB(backupDir, dbName)\n\nrestoreTable(backupDir,\"dfs://compoDB2\",`pt1)\n```\n\n| dbName          | tableName |\n| --------------- | --------- |\n| dfs\\://compoDB2 | pt1       |\n\nRelated functions: [restore](https://docs.dolphindb.com/en/Functions/r/restore.html), [restoreDB](https://docs.dolphindb.com/en/Functions/r/restoreDB.html), [migrate](https://docs.dolphindb.com/en/Functions/m/migrate.html), [backup](https://docs.dolphindb.com/en/Functions/b/backup.html), [backupDB](https://docs.dolphindb.com/en/Functions/b/backupDB.html), [backupTable](https://docs.dolphindb.com/en/Functions/b/backupTable.html)\n"
    },
    "resubmitStreamGraph": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resubmitStreamGraph.html",
        "signatures": [
            {
                "full": "resubmitStreamGraph(name)",
                "name": "resubmitStreamGraph",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [resubmitStreamGraph](https://docs.dolphindb.com/en/Functions/r/resubmitStreamGraph.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nresubmitStreamGraph(name)\n\n#### Details\n\nResubmits a stream graph that is in one of the following states: failed, destroying, or destroyed.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Examples\n\nSuppose we have a StreamGraph “demo.orca\\_graph.indicators”, which has been destroyed by [dropStreamGraph](https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html). Resubmit it using:\n\n```\nresubmitStreamGraph(\"demo.orca_graph.indicators\")\ngetStreamGraphMeta(\"demo.orca_graph.indicators\")[\"status\"]\n// Output: [\"running\"]\n```\n"
    },
    "resumeRecovery": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resumeRecovery.html",
        "signatures": [
            {
                "full": "resumeRecovery()",
                "name": "resumeRecovery",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [resumeRecovery](https://docs.dolphindb.com/en/Functions/r/resumeRecovery.html)\n\n\n\n#### Syntax\n\nresumeRecovery()\n\n#### Details\n\nResume suspended recovery processes in \"Waiting\" status. This command can only be executed by the administrator on the controller.\n\n**Note:**\n\nFor high-availability clusters, this command must be executed on every node in the raft group.\n\nRelated command: [suspendRecovery](https://docs.dolphindb.com/en/Functions/s/suspendRecovery.html)\n\n#### Parameters\n\nNone\n"
    },
    "resumeTimerEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/r/resumeTimerEngine.html",
        "signatures": [
            {
                "full": "resumeTimerEngine(engine)",
                "name": "resumeTimerEngine",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    }
                ]
            }
        ],
        "markdown": "### [resumeTimerEngine](https://docs.dolphindb.com/en/Functions/r/resumeTimerEngine.html)\n\n\n\n#### Syntax\n\nresumeTimerEngine(engine)\n\n#### Details\n\nThis function can only be called via `useOrcaStreamEngine` and resumes execution of jobs submitted by `DStream::timerEngine`.\n\n#### Parameters\n\n**engine** A STRING scalar representing the engine name. You can provide either the fully qualified name (e.g., \"catalog\\_name.orca\\_engine.engine\\_name\"), or just the engine name (e.g., \"engine\\_name\") when the system will automatically complete it to the corresponding fully qualified name based on the current catalog setting.\n\n#### Examples\n\nSubmit the job:\n\n```\nif (!existsCatalog(\"test\")) {\n\tcreateCatalog(\"test\")\t\n}\ngo\nuse catalog test\n\n// Define the job\ndef myFunc(x,y,z){\n    writeLog(x,y,z)\n}\n\n// Define the parameter\na = \"aaa\"\nb = \"bbb\"\nc = \"ccc\"\n\n// Submit the steam graph\ng = createStreamGraph(\"timerEngineDemo\")\ng.source(\"trade\", `id`price, [INT, DOUBLE])\n .timerEngine(3, myFunc, a, b, c)\n .setEngineName(\"myJob\")\n .sink(\"result\")\ng.submit()\n```\n\nStop job execution:\n\n```\nuseOrcaStreamEngine(\"myJob\", stopTimerEngine)\n```\n\nResume job execution:\n\n```\nuseOrcaStreamEngine(\"myJob\", resumeTimerEngine)\n```\n\n**Related functions:**[DStream::timerEngine](https://docs.dolphindb.com/en/Functions/d/DStream_timerEngine.html), [stopTimerEngine](https://docs.dolphindb.com/en/Functions/s/stopTimerEngine.html)\n"
    },
    "reverse": {
        "url": "https://docs.dolphindb.com/en/Functions/r/reverse.html",
        "signatures": [
            {
                "full": "reverse(X)",
                "name": "reverse",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [reverse](https://docs.dolphindb.com/en/Functions/r/reverse.html)\n\n\n\n#### Syntax\n\nreverse(X)\n\n#### Details\n\n* If *X* is a vector or matrix, return a new vector or matrix with reverse order of the original vector or matrix.\n* If X is an ​​in-memory table​, return an in-memory table with reverse ​​row order.\n* If *X* is an ​​ordered dictionary, return an ordered dictionary where the ​​key-value pairs are in reverse order.\n\n#### Parameters\n\n**X** is a vector/matrix/in-memory table/ordered dictionary.\n\n#### Returns\n\nIf *X* is a vector or matrix, returns a new vector or matrix with elements in reverse order. If *X* is an in-memory table, returns an in-memory table with rows in reverse order. If *X* is an ordered dictionary, returns an ordered dictionary with key-value pairs in reverse order.\n\n#### Examples\n\n```\nreverse `hello `world;\n// output: [world,hello]\n\n(1..6).reverse();\n// output: [6,5,4,3,2,1]\n\nx=1..6$2:3;\nx\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nreverse(x);\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nt = table(1 2 3 as a, `x`y`z as b)\nreverse(t)\n```\n\n| a | b |\n| - | - |\n| 3 | z |\n| 2 | y |\n| 1 | x |\n\n```\nd = dict(1 2 3, `x`y`z, true)\nreverse(d)\n\n/*\noutput:\n3->z\n2->y\n1->x\n*/\n```\n"
    },
    "revoke": {
        "url": "https://docs.dolphindb.com/en/Functions/r/revoke.html",
        "signatures": [
            {
                "full": "revoke(userId|groupId,accessType,[objs])",
                "name": "revoke",
                "parameters": [
                    {
                        "full": "userId|groupId",
                        "name": "userId|groupId"
                    },
                    {
                        "full": "accessType",
                        "name": "accessType"
                    },
                    {
                        "full": "[objs]",
                        "name": "objs",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [revoke](https://docs.dolphindb.com/en/Functions/r/revoke.html)\n\n\n\n#### Syntax\n\nrevoke(userId|groupId,accessType,\\[objs])\n\n#### Details\n\n* Revokes specified access privileges to a user or a group of users that were previously granted or denied.\n\n* Removes the memory limit that was previously set for a specific user. It includes the memory limit of a query result (when *accessType* = QUERY\\_RESULT\\_MEM\\_LIMIT) and the memory limit of a task group (when *accessType* = TASK\\_GROUP\\_MEM\\_LIMIT). The memory limit will be reverted to the default memory limit configured in the system.\n\nAdministrators can grant users all privileges (*accessType*) through this command, but regular users, after having the relevant OWNER privileges, can only grant the following privileges through this command: TABLE\\_READ, TABLE\\_WRITE, TABLE\\_INSERT, TABLE\\_UPDATE, TABLE\\_DELETE, DB\\_READ, DB\\_WRITE, DB\\_INSERT, DB\\_UPDATE, DB\\_DELETE, DBOBJ\\_DELETE, DBOBJ\\_CREATE and VIEW\\_EXEC.\n\nFor the types of permissions that can be revoked, see [grant](https://docs.dolphindb.com/en/Functions/g/grant.html). Orca graph and stream table privileges: See Section 6.3 at [Orca Real-time Computing Platform](https://docs.dolphindb.com/en/Streaming/orca.md#).\n\n#### Examples\n\nRevoke the privilege of the members of the group \"production\" to read all tables in all databases:\n\n```\nrevoke(`production, TABLE_READ, \"*\")\n```\n\nRevoke the denial of the privilege of the members of the group \"research\" to write to the table dfs\\://db1/t1:\n\n```\nrevoke(`research, TABLE_WRITE, \"dfs://db1/t1\")\n```\n\nRevoke the privilege of the members of the group \"research\" to create tables in the databases dfs\\://db1 and dfs\\://db2:\n\n```\nrevoke(\"research\", DBOBJ_CREATE, [\"dfs://db1\",\"dfs://db2\"])\n```\n\nRevoke the denial of the privilege of the user \"AlexSmith\" to create or delete databases:\n\n```\nrevoke(\"AlexSmith\", DB_MANAGE)\n```\n\nRevoke the privilege of the user \"AlexSmith\" to execute script:\n\n```\nrevoke(\"AlexSmith\", SCRIPT_EXEC)\n```\n\nRevoke the denial of the privilege of the user \"AlexSmith\" to test script:\n\n```\nrevoke(\"AlexSmith\", TEST_EXEC)\n```\n\n#### Parameters\n\n**userId** | **groupId** is a string indicating a user name or a group name.\n\n**accessType** is the privilege type or memory limit.\n\n**objs** (optional) is a STRING scalar/vector indicating the objects that the priviledges specified by *accessType* applies to. \"\\*\" means all objects. When *accessType* is COMPUTE\\_GROUP\\_EXEC, *objs* must be compute group(s).\n\nSee the privilege table in [User Access Control](https://docs.dolphindb.com/en/Maintenance/UserAccessControl.html) for the values that *accessType* and *objs* can take.\n\n**Note:**\n\n* When managing privileges for shared tables, stream tables or streaming engines, *objs* must be in the format \"tableName\\@nodeAlias\" or \"nodeAlias:tableName\".\n* When managing privileges for IMOLTP databases and tables, *objs* must be in the format \"oltp\\://database/table\\@nodeAlias\" or \"oltp\\://database\\@nodeAlias\".\n"
    },
    "revokeStreamingSQL": {
        "url": "https://docs.dolphindb.com/en/Functions/r/revokeStreamingSQL.html",
        "signatures": [
            {
                "full": "revokeStreamingSQL(queryId)",
                "name": "revokeStreamingSQL",
                "parameters": [
                    {
                        "full": "queryId",
                        "name": "queryId"
                    }
                ]
            }
        ],
        "markdown": "### [revokeStreamingSQL](https://docs.dolphindb.com/en/Functions/r/revokeStreamingSQL.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nrevokeStreamingSQL(queryId)\n\n#### Details\n\nRevoke a streaming SQL query registered via `registerStreamingSQL`. Only for the queries registered by the current user.\n\n#### Parameters\n\n**queryId** (optional) A STRING scalar representing the ID name for the registered streaming SQL query.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\nregisterStreamingSQL(\"select avg(val) from st\",\"sql_avg\") \n\n// Get the status of streaming SQL query\ngetStreamingSQLStatus(\"sql_avg\")\n\n// Revoke the streaming SQL query\nrevokeStreamingSQL(\"sql_avg\")\n```\n\n**Related functions:** [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html), [getStreamingSQLStatus](https://docs.dolphindb.com/en/Functions/g/getStreamingSQLStatus.html), [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html)\n"
    },
    "revokeStreamingSQLTable": {
        "url": "https://docs.dolphindb.com/en/Functions/r/revokeStreamingSQLTable.html",
        "signatures": [
            {
                "full": "revokeStreamingSQLTable(tableName)",
                "name": "revokeStreamingSQLTable",
                "parameters": [
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [revokeStreamingSQLTable](https://docs.dolphindb.com/en/Functions/r/revokeStreamingSQLTable.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nrevokeStreamingSQLTable(tableName)\n\n#### Details\n\nRevoke a streaming SQL table declared via `declareStreamingSQLTable`.\n\n* Only the table declared by the current user can be revoked.\n\n* Before revoking a table, all streaming SQL queries registered on it must be revoked first.\n\n* This function only removes the streaming SQL feature; the table and its data remain.\n\n#### Parameters\n\n**tableName** A STRING scalar indicating the name of the declared streaming SQL table.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\nregisterStreamingSQL(\"select avg(val) from st\",\"sql_avg\")\n\n// Revoke the registered streaming SQL query\nrevokeStreamingSQL(\"sql_avg\")\n\n// Revoke the streaming SQL table\nrevokeStreamingSQLTable(`st)\n```\n\n**Related functions:** [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html), [listStreamingSQLTables](https://docs.dolphindb.com/en/Functions/l/listStreamingSQLTables.html), [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html), [revokeStreamingSQL](https://docs.dolphindb.com/en/Functions/r/revokeStreamingSQL.html)\n"
    },
    "ridge": {
        "url": "https://docs.dolphindb.com/en/Functions/r/ridge.html",
        "signatures": [
            {
                "full": "ridge(ds, yColName, xColNames, [alpha=1.0], [intercept=true], [normalize=false], [maxIter=1000], [tolerance=0.0001], [solver='svd'], [swColName])",
                "name": "ridge",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[alpha=1.0]",
                        "name": "alpha",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[normalize=false]",
                        "name": "normalize",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[maxIter=1000]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[tolerance=0.0001]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "0.0001"
                    },
                    {
                        "full": "[solver='svd']",
                        "name": "solver",
                        "optional": true,
                        "default": "'svd'"
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ridge](https://docs.dolphindb.com/en/Functions/r/ridge.html)\n\n\n\n#### Syntax\n\nridge(ds, yColName, xColNames, \\[alpha=1.0], \\[intercept=true], \\[normalize=false], \\[maxIter=1000], \\[tolerance=0.0001], \\[solver='svd'], \\[swColName])\n\n#### Details\n\nLinear least squares with l2 regularization.\n\nMinimize the following objective function:\n\n![](https://docs.dolphindb.com/en/images/ridge.png)\n\n#### Parameters\n\n**ds** is an in-memory table, or a data source, or a list of data sources.\n\n**yColName** is a string indicating the column name of the dependent variable in ds.\n\n**xColNames** is a string scalar/vector indicating the column names of the independent variables in ds.\n\n**alpha** (optional) is a floating number representing the constant that multiplies the L1-norm. The default value is 1.0.\n\n**intercept** (optional) is a Boolean value indicating whether to include the intercept in the regression. The default value is true.\n\n**normalize** (optional) is a Boolean value. If true, the regressors will be normalized before regression by subtracting the mean and dividing by the L2-norm. If *intercept*=false, this parameter will be ignored. The default value is false.\n\n**maxIter** (optional) is a positive integer indicating the maximum number of iterations. The default value is 1000.\n\n**tolerance** (optional) is a floating number. The iterations stop when the improvement in the objective function value is smaller than tolerance. The default value is 0.0001.\n\n**solver** (optional) is a string indicating the solver to use in the computation. It can be either 'svd' or 'cholesky'. It ds is a list of data sources, solver must be 'cholesky'.\n\n**swColName** (optional) is a STRING indicating a column name of *ds*. The specified column is used as the sample weight. If it is not specified, the sample weight is treated as 1.\n\n#### Returns\n\nA dictionary containing the following keys: modelName, coefficients, intercept, xColNames, and predict.\n\n#### Examples\n\n```\ny = [225.720746,-76.195841,63.089878,139.44561,-65.548346,2.037451,22.403987,-0.678415,37.884102,37.308288]\nx0 = [2.240893,-0.854096,0.400157,1.454274,-0.977278,-0.205158,0.121675,-0.151357,0.333674,0.410599]\nx1 = [0.978738,0.313068,1.764052,0.144044,1.867558,1.494079,0.761038,0.950088,0.443863,-0.103219]\nt = table(y, x0, x1);\n\nridge(t, `y, `x0`x1);\n```\n\nIf t is a DFS table, then the input should be a data source:\n\n```\nridge(sqlDS(<select * from t>), `y, `x0`x1);\n```\n"
    },
    "ridgeBasic": {
        "url": "https://docs.dolphindb.com/en/Functions/r/ridgebasic.html",
        "signatures": [
            {
                "full": "ridgeBasic(Y, X, [mode=0], [alpha=1.0], [intercept=true], [normalize=false], [maxIter=1000], [tolerance=0.0001], [solver='svd'], [swColName])",
                "name": "ridgeBasic",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[mode=0]",
                        "name": "mode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[alpha=1.0]",
                        "name": "alpha",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[normalize=false]",
                        "name": "normalize",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[maxIter=1000]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[tolerance=0.0001]",
                        "name": "tolerance",
                        "optional": true,
                        "default": "0.0001"
                    },
                    {
                        "full": "[solver='svd']",
                        "name": "solver",
                        "optional": true,
                        "default": "'svd'"
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ridgeBasic](https://docs.dolphindb.com/en/Functions/r/ridgebasic.html)\n\n\n\n#### Syntax\n\nridgeBasic(Y, X, \\[mode=0], \\[alpha=1.0], \\[intercept=true], \\[normalize=false], \\[maxIter=1000], \\[tolerance=0.0001], \\[solver='svd'], \\[swColName])\n\n#### Details\n\nPerform Ridge regression.\n\nMinimize the following objective function:\n\n![image-20230626-092438.png](https://docs.dolphindb.com/en/images/ridgeBasic.png)\n\n#### Parameters\n\n**Y** is a numeric vector indicating the dependent variable.\n\n**X** is a numeric vector/tuple/matrix/table indicating the independent variable.\n\n* When *X* is a vector/tuple, it must be of the same length as *Y*.\n\n* When *X* is a matrix/table, the number of rows must be the same as the length of *Y*.\n\n**mode**is an integer indicating the contents in the output. It can be:\n\n* 0 (default): a vector of the coefficient estimates.\n\n* 1: a table with coefficient estimates, standard error, t-statistics, and p-values.\n\n* 2: a dictionary with the following keys: ANOVA, RegressionStat, Coefficient, and Residual.\n\n<table id=\"table_n2f_fcz_21c\"><thead><tr><th align=\"left\">\n\nSource of Variance\n\n</th><th align=\"left\">\n\nDF (degree of freedom)\n\n</th><th align=\"left\">\n\nSS (sum of square)\n\n</th><th align=\"left\">\n\nMS (mean of square)\n\n</th><th align=\"left\">\n\nF (F-score)\n\n</th><th align=\"left\">\n\nSignificance\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nRegression\n\n</td><td align=\"left\">\n\np\n\n</td><td align=\"left\">\n\nsum of squares regression, SSR\n\n</td><td align=\"left\">\n\nregression mean square, MSR=SSR/R\n\n</td><td align=\"left\">\n\nMSR/MSE\n\n</td><td align=\"left\">\n\np-value\n\n</td></tr><tr><td align=\"left\">\n\nResidual\n\n</td><td align=\"left\">\n\nn-p-1\n\n</td><td align=\"left\">\n\nsum of squares error, SSE\n\n</td><td align=\"left\">\n\nmean square error, MSE=MSE/E\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr><tr><td align=\"left\">\n\nTotal\n\n</td><td align=\"left\">\n\nn-1\n\n</td><td align=\"left\">\n\nsum of squares total, SST\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n</td></tr></tbody>\n</table><table id=\"table_u2f_fcz_21c\"><thead><tr><th align=\"left\">\n\nItem\n\n</th><th align=\"left\">\n\nDescription\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nR2\n\n</td><td align=\"left\">\n\nR-squared\n\n</td></tr><tr><td align=\"left\">\n\nAdjustedR2\n\n</td><td align=\"left\">\n\nThe adjusted R-squared corrected based on the degrees of freedom by comparing the sample size to the number of terms in the regression model.\n\n</td></tr><tr><td align=\"left\">\n\nStdError\n\n</td><td align=\"left\">\n\nThe residual standard error/deviation corrected based on the degrees of freedom.\n\n</td></tr><tr><td align=\"left\">\n\nObservations\n\n</td><td align=\"left\">\n\nThe sample size.\n\n</td></tr></tbody>\n</table><table id=\"table_x2f_fcz_21c\"><thead><tr><th align=\"left\">\n\nItem\n\n</th><th align=\"left\">\n\nDescription\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nfactor\n\n</td><td align=\"left\">\n\nIndependent variables\n\n</td></tr><tr><td align=\"left\">\n\nbeta\n\n</td><td align=\"left\">\n\nEstimated regression coefficients\n\n</td></tr><tr><td align=\"left\">\n\nStdError\n\n</td><td align=\"left\">\n\nStandard error of the regression coefficients\n\n</td></tr><tr><td align=\"left\">\n\ntstat\n\n</td><td align=\"left\">\n\nt statistic, indicating the significance of the regression coefficients\n\n</td></tr></tbody>\n</table>Residual: the difference between each predicted value and the actual value.\n\n**alpha**(optional) is a floating number representing the constant that multiplies the L1-norm. The default value is 1.0.\n\n**intercept** (optional) is a Boolean value indicating whether to include the intercept in the regression. The default value is true.\n\n**normalize** (optional) is a Boolean value. If true, the regressors will be normalized before regression by subtracting the mean and dividing by the L2-norm. If *intercept*=false, this parameter will be ignored. The default value is false.\n\n**maxIter** (optional) is a positive integer indicating the maximum number of iterations. The default value is 1000.\n\n**tolerance** (optional) is a floating number. The iterations stop when the improvement in the objective function value is smaller than tolerance. The default value is 0.0001.\n\n**solver** (optional) is a string indicating the solver to use in the computation. It can be either 'svd' or 'cholesky'. It ds is a list of data sources, solver must be 'cholesky'.\n\n**swColName** (optional) is a STRING indicating a column name of *ds*. The specified column is used as the sample weight. If it is not specified, the sample weight is treated as 1.\n\n#### Returns\n\nA vector, table, or dictionary, depending on the *mode* parameter\n\n#### Examples\n\nExample 1: Set *mode*=0 to output a coefficient estimate vector.\n\n```\nY = [225.72, -76.20, 63.09, 139.45, -65.55]\nX0 = [2.24, -0.85, 0.40, 1.45, -0.98]\nX1 = [0.98, 0.31, 1.76, 0.14, 1.87]\n\ncoefficients = ridgeBasic(Y, [X0, X1], mode=0, alpha=0.5, intercept=true)\ncoefficients\n\n// Output：[7.940468476954727, 88.20426761349431, 9.380634942436586]\n```\n\nExample 2: Set *mode*=1 to output a dictionary containing ANOVA (analysis of variance), RegressionStat, Coefficient, and Residual.\n\n```\nY = [1.5, 2.3, 4.7, 3.2, 5.1]\nX = matrix([1.1, 2.2, 3.1, 2.8, 4.0], [0.5, 0.8, 1.2, 1.0, 1.5])\n\nresult = ridgeBasic(Y, X, mode=2, alpha=0.8, solver='svd')\n```\n\nView analysis of variance.\n\n```\nresult[`ANOVA]\n```\n\n| Breakdown  | DF | SS                 | MS                 | F                  | Significance       |\n| ---------- | -- | ------------------ | ------------------ | ------------------ | ------------------ |\n| Regression | 2  | 6.439542296188023  | 3.2197711480940114 | 6.3847474657971865 | 0.1354142446483848 |\n| Residual   | 2  | 1.0085821452899069 | 0.5042910726449534 |                    |                    |\n| Total      | 4  | 9.432000000000016  |                    |                    |                    |\n\nView regression statistics.\n\n```\nresult[`RegressionStat]\n```\n\n| item         | statistics         |\n| ------------ | ------------------ |\n| R2           | 0.6827334919622574 |\n| AdjustedR2   | 0.3654669839245148 |\n| StdError     | 0.7101345454524469 |\n| Observations | 5                  |\n\nView regression coefficients.\n\n```\nresult[`Coefficient]\n```\n\n| factor    | beta                | stdError          | tstat               | pvalue             |\n| --------- | ------------------- | ----------------- | ------------------- | ------------------ |\n| intercept | 0.22075506589464267 | 1.084447930898624 | 0.20356446778566378 | 0.8575265882132079 |\n| beta0     | 1.0193512860448009  | 2.662502504483437 | 0.3828545829828503  | 0.7386872800445148 |\n| beta1     | 0.44815753894708277 | 7.540425982186433 | 0.05943398158218302 | 0.9580108927931805 |\n\nView residuals.\n\n```\nresult[`Residual]\n// Output: [-0.06612025001746513, -0.5218539263508712, 0.7814669006299755, -0.32309620576716735, 0.12960348150553003]\n```\n"
    },
    "ridgeCV": {
        "url": "https://docs.dolphindb.com/en/Functions/r/ridgecv.html",
        "signatures": [
            {
                "full": "ridgeCV(ds, yColName, xColNames, [alphas], [intercept], [normalize], [maxIter], [tolerance], [solver], [swColName])",
                "name": "ridgeCV",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "yColName",
                        "name": "yColName"
                    },
                    {
                        "full": "xColNames",
                        "name": "xColNames"
                    },
                    {
                        "full": "[alphas]",
                        "name": "alphas",
                        "optional": true
                    },
                    {
                        "full": "[intercept]",
                        "name": "intercept",
                        "optional": true
                    },
                    {
                        "full": "[normalize]",
                        "name": "normalize",
                        "optional": true
                    },
                    {
                        "full": "[maxIter]",
                        "name": "maxIter",
                        "optional": true
                    },
                    {
                        "full": "[tolerance]",
                        "name": "tolerance",
                        "optional": true
                    },
                    {
                        "full": "[solver]",
                        "name": "solver",
                        "optional": true
                    },
                    {
                        "full": "[swColName]",
                        "name": "swColName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [ridgeCV](https://docs.dolphindb.com/en/Functions/r/ridgecv.html)\n\n\n\n#### Syntax\n\nridgeCV(ds, yColName, xColNames, \\[alphas], \\[intercept], \\[normalize], \\[maxIter], \\[tolerance], \\[solver], \\[swColName])\n\n#### Details\n\nPerform ridge regression using 5-fold cross-validation and return a model corresponding to the optimal parameters.\n\n#### Parameters\n\nThe `ridgeCV` function inherits all parameters of function [ridge](https://docs.dolphindb.com/en/Functions/r/ridge.html), with one added parameter, *alphas*.\n\n**alphas**(optional) is a floating-point scalar or vector that represents the coefficient multiplied by the L1 norm penalty term. The default value is \\[0.01, 0.1, 1.0].\n\n#### Returns\n\nA dictionary containing the following keys\n\n* modelName: the model name, which is \"ridgeCV\" for this method\n\n* coefficients: the regression coefficients\n\n* intercept: the intercept\n\n* xColNames: the column names of the independent variables in the data source\n\n* predict: the function used for prediction\n\n* alpha: the penalty term for cross-validation\n\n#### Examples\n\n```\ny = [225.720746,-76.195841,63.089878,139.44561,-65.548346,2.037451,22.403987,-0.678415,37.884102,37.308288]\nx0 = [2.240893,-0.854096,0.400157,1.454274,-0.977278,-0.205158,0.121675,-0.151357,0.333674,0.410599]\nx1 = [0.978738,0.313068,1.764052,0.144044,1.867558,1.494079,0.761038,0.950088,0.443863,-0.103219]\nt = table(y, x0, x1);\n\nridgeCV(t, `y, `x0`x1);\n\n/* output:\ncoefficients->[94.3410,14.2523]\npredict->coordinateDescentPredict\nmodelName->ridgeCV\nxColNames->[x0,x1]\nintercept->0.1063\nalpha->0.0100\n*/\n```\n"
    },
    "right": {
        "url": "https://docs.dolphindb.com/en/Functions/r/right.html",
        "signatures": [
            {
                "full": "right(X, n)",
                "name": "right",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [right](https://docs.dolphindb.com/en/Functions/r/right.html)\n\n\n\n#### Syntax\n\nright(X, n)\n\n#### Details\n\nReturn the last *n* characters of string *X*.\n\n#### Parameters\n\n**X** is a string scalar or vector.\n\n**n** is a positive integer.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nright(\"I love this game!\", 6);\n\n\ngame!\n```\n"
    },
    "rm": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rm.html",
        "signatures": [
            {
                "full": "rm(filename)",
                "name": "rm",
                "parameters": [
                    {
                        "full": "filename",
                        "name": "filename"
                    }
                ]
            }
        ],
        "markdown": "### [rm](https://docs.dolphindb.com/en/Functions/r/rm.html)\n\n\n\n#### Syntax\n\nrm(filename)\n\n#### Details\n\nDelete a file specified by path and name. It must be executed by a logged-in user.\n\n#### Parameters\n\n**filename** is the path and name of the file to be deleted.\n\n#### Examples\n\n```\nfiles(\"/home/test\");\n```\n\n| filename | isDir | fileSize | lastAccessed            | lastModified            |\n| -------- | ----- | -------- | ----------------------- | ----------------------- |\n| abc.txt  | 0     | 15       | 2017.06.05 08:09:47.443 | 2017.06.05 07:24:19.999 |\n| dir1     | 1     | 0        | 2017.06.05 08:06:44.836 | 2017.06.05 08:06:44.836 |\n| dir2     | 1     | 0        | 2017.06.05 08:06:42.210 | 2017.06.05 08:06:42.210 |\n| dir3     | 1     | 0        | 2017.06.05 08:06:39.597 | 2017.06.05 08:06:39.597 |\n\n```\nrm(\"/home/test/abc.txt\");\n// delete file abc.txt\n```\n\n```\nfiles(\"/home/test\");\n```\n\n| filename | isDir | fileSize | lastAccessed            | lastModified            |\n| -------- | ----- | -------- | ----------------------- | ----------------------- |\n| dir1     | 1     | 0        | 2017.06.05 08:06:44.836 | 2017.06.05 08:06:44.836 |\n| dir2     | 1     | 0        | 2017.06.05 08:06:42.210 | 2017.06.05 08:06:42.210 |\n| dir3     | 1     | 0        | 2017.06.05 08:06:39.597 | 2017.06.05 08:06:39.597 |\n"
    },
    "rmdir": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rmdir.html",
        "signatures": [
            {
                "full": "rmdir(dir, [recursive=false], [keepRootDir=false])",
                "name": "rmdir",
                "parameters": [
                    {
                        "full": "dir",
                        "name": "dir"
                    },
                    {
                        "full": "[recursive=false]",
                        "name": "recursive",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keepRootDir=false]",
                        "name": "keepRootDir",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [rmdir](https://docs.dolphindb.com/en/Functions/r/rmdir.html)\n\n\n\n#### Syntax\n\nrmdir(dir, \\[recursive=false], \\[keepRootDir=false])\n\n#### Details\n\nrmdir(directory): delete an empty directory.\n\nrmdir(directory, true): delete a non-empty directory.\n\nIt must be executed by a logged-in user.\n\n#### Parameters\n\n**directory** is the the path of the directory to be deleted.\n\n**recursive** (optional) specifies whether to delete a non-empty directory. The default value is false.\n\n**keepRootDir** (optional) is a Boolean value that specifies whether to keep the root directory. The default value is false. When it is set to true, only subdirectories and files are deleted.\n\n**Note:** If *keepRootDir*is set to true, then *recursive*must be set to true.\n\n#### Examples\n\n```\nfiles(\"/home/test\");\n```\n\n| filename | isDir | fileSize | lastAccessed            | lastModified            |\n| -------- | ----- | -------- | ----------------------- | ----------------------- |\n| dir1     | 1     | 0        | 2024.04.03 01:31:48.367 | 2024.04.03 01:31:48.367 |\n| dir2     | 1     | 0        | 2024.04.03 01:36:43.982 | 2024.04.03 01:36:43.982 |\n| dir3     | 1     | 0        | 2024.04.03 01:37:45.618 | 2024.04.03 01:37:45.618 |\n\n```\n// delete a directory. dir1 is empty, dir2 is not empty.\nrmdir(\"/home/test/dir1\");\nrmdir(\"/home/test/dir2\");\n\nFailed to remove directory [/home/test/dir2] with error code 145\n\n// Delete a directory recursively\nrmdir(\"/home/test/dir2\", true);\n\nfiles(\"/home/test\");\n```\n\n| filename | isDir | fileSize | lastAccessed            | lastModified            |\n| -------- | ----- | -------- | ----------------------- | ----------------------- |\n| dir3     | 1     | 0        | 2024.04.03 01:37:45.618 | 2024.04.03 01:37:45.618 |\n"
    },
    "rms": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rms.html",
        "signatures": [
            {
                "full": "rms(X)",
                "name": "rms",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rms](https://docs.dolphindb.com/en/Functions/r/rms.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nrms(X)\n\n#### Details\n\nCalculate the root mean square value of input *X*. Its formula is as follows:\n\n![](https://docs.dolphindb.com/en/Functions/images/rms1.png)\n\n#### Parameters\n\n**X** can be a numeric scalar, pair, vector, matrix, or table.\n\n#### Returns\n\n* If *X* is a scalar, pair, or vector, it returns a scalar.\n* If *X* is a matrix, it returns a vector, with each element representing the RMS value of a column.\n* If *X* is a table, it returns a single-row table, where each column contains the RMS value for that corresponding column.\n\n#### Examples\n\nExample 1: when *X* is a vector\n\n```\nX=[1,2,3,4,5]\nrms(X)\n// output: 3.317\n```\n\nExample 2: when *X* is a matix\n\n```\nX=matrix(1 2 3, 4 5 6)\nrms(X)\n// output: [2.160,5.066]\n```\n\nExample 3: when *X* is a table\n\n```\nX=1 2 3 4 5 6\nY=7 8 9 10 11 12\nt=table(X as val1, Y as val2)\nrms(t)\n```\n\nOutput:\n\n| **val1** | **val2** |\n| -------- | -------- |\n| 3.894    | 9.652    |\n"
    },
    "rollingPanel": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rollingPanel.html",
        "signatures": [
            {
                "full": "rollingPanel(X, window, [groupingCol])",
                "name": "rollingPanel",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[groupingCol]",
                        "name": "groupingCol",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [rollingPanel](https://docs.dolphindb.com/en/Functions/r/rollingPanel.html)\n\n\n\n#### Syntax\n\nrollingPanel(X, window, \\[groupingCol])\n\n#### Details\n\nExtract a fixed number of rows from a table with a rolling window to generate a new table. The rolling window moves by 1 row each time until it reaches the bottom of the table.\n\nIf *groupingCol* is specified, perform the aforementioned operation in each group.\n\nThe panelNumber column in the result means the index of each extraction operation, which starts from 0.\n\n#### Parameters\n\n**X** is a table.\n\n**window** is a positive integer indicating the length of the moving windows.\n\n**groupingCol** (optional) is a string scalar/vector indicating one or some columns in table *X*.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nt=table(1 1 1 1 1 2 2 2 2 2 as id, 1..10 as x);\nrollingPanel(t, 3, `id);\n```\n\n| id | x  | panelNumber |\n| -- | -- | ----------- |\n| 1  | 1  | 0           |\n| 1  | 2  | 0           |\n| 1  | 3  | 0           |\n| 1  | 2  | 1           |\n| 1  | 3  | 1           |\n| 1  | 4  | 1           |\n| 1  | 3  | 2           |\n| 1  | 4  | 2           |\n| 1  | 5  | 2           |\n| 2  | 6  | 3           |\n| 2  | 7  | 3           |\n| 2  | 8  | 3           |\n| 2  | 7  | 4           |\n| 2  | 8  | 4           |\n| 2  | 9  | 4           |\n| 2  | 8  | 5           |\n| 2  | 9  | 5           |\n| 2  | 10 | 5           |\n"
    },
    "rotateTDEKey": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rotatetdekey.html",
        "signatures": [
            {
                "full": "rotateTDEKey(masterKeyPath)",
                "name": "rotateTDEKey",
                "parameters": [
                    {
                        "full": "masterKeyPath",
                        "name": "masterKeyPath"
                    }
                ]
            }
        ],
        "markdown": "### [rotateTDEKey](https://docs.dolphindb.com/en/Functions/r/rotatetdekey.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nrotateTDEKey(masterKeyPath)\n\n#### Details\n\n\\[Linux Only] This function enables TDE key rotation of transparent data encryption. It must be executed by an administrator on the controller.\n\nIt returns true if successful. The system uses the new key to re-encrypt the table keys of all encrypted tables and updates the table header files. If an error occurs, check whether the key path is correct and if the file adheres to the required key format.\n\n#### Parameters\n\n**masterKeyPath** is a string specifying the path to the TDE key file.\n\n#### Returns\n\nReturns true if the setting succeeds.\n\n#### Examples\n\n```\nenableTDEKey(path/to/newKey)\n```\n"
    },
    "round": {
        "url": "https://docs.dolphindb.com/en/Functions/r/round.html",
        "signatures": [
            {
                "full": "round(X, [precision])",
                "name": "round",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[precision]",
                        "name": "precision",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [round](https://docs.dolphindb.com/en/Functions/r/round.html)\n\n\n\n#### Syntax\n\nround(X, \\[precision])\n\n#### Details\n\nRound a number to the specified number of digits after the decimal point with the round half up rule.\n\nIn comparison, functions [floor](https://docs.dolphindb.com/en/Functions/f/floor.html) and [ceil](https://docs.dolphindb.com/en/Functions/c/ceil.html) map a number to the largest previous or the smallest following integer, respectively.\n\nDolphinDB’s `round` uses the standard “round half up” rule, while Python’s built-in `round` and NumPy’s `numpy.round` use the half-to-even rounding rule. In addition, the *precision* parameter in DolphinDB’s `round` supports values in the range 0..10, whereas the *ndigits* parameter of Python’s built-in `round` and the *decimals* parameter of `numpy.round` support negative values.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n**precision** (optional) is an integer indicating the number of digits (up to 10) after the decimal point. The default value is 0.\n\n#### Returns\n\n* When *precision* is not specified or set to 0, the return value is of type LONG, with the same data form as X.\n* When *precision* is specified as a value greater than 0 and up to 10, the return value is of type DOUBLE, with the same data form as X.\n\n#### Examples\n\n```\nround 2.1;\n// output: 2\n\nround 2.9;\n// output: 3\n\nround -2.1;\n// output: -2\n\nround(2.154,2);\n// output: 2.15\n\nround(2.156,2);\n// output: 2.16\n\nceil 2.1;\n// output: 3\n\nceil 2.9;\n// output: 3\n\nceil -2.1;\n// output: -2\n\nfloor 2.1;\n// output: 2\n\nfloor 2.9;\n// output: 2\n\nfloor -2.1;\n// output: -3\n\nm = 1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10$2:5;\nm;\n```\n\n| #0  | #1  | #2  | #3  | #4  |\n| --- | --- | --- | --- | --- |\n| 1.1 | 3.3 | 5.5 | 7.7 | 9.9 |\n| 2.2 | 4.4 | 6.6 | 8.8 | 10  |\n\n```\nround m;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 3  | 6  | 8  | 10 |\n| 2  | 4  | 7  | 9  | 10 |\n"
    },
    "routeEvent": {
        "url": "https://docs.dolphindb.com/en/Functions/r/route_event.html",
        "signatures": [
            {
                "full": "routeEvent(event)",
                "name": "routeEvent",
                "parameters": [
                    {
                        "full": "event",
                        "name": "event"
                    }
                ]
            }
        ],
        "markdown": "### [routeEvent](https://docs.dolphindb.com/en/Functions/r/route_event.html)\n\n\n\n#### Syntax\n\nrouteEvent(event)\n\n#### Details\n\nA routed event sent by `routeEvent` goes to the front of the input queue. The engine processes all routed events before it processes the next non-routed event on the input queue.\n\n#### Parameters\n\n**event** is an event instance.\n\n#### Returns\n\nNone\n\n#### Examples\n\nDefine the events:\n\n```\nclass UpdateFactor{\n    sym :: STRING\n    factor :: DOUBLE\n    def UpdateFactor(code, val){\n        sym = code\n        factor = val\n    }\n}\n\nclass MarketData{\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def MarketData(m,c,p,q){\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n```\n\nDefine the monitor:\n\n```\n\nclass MainMonitor : CEPMonitor{\n    maxPrice :: DOUBLE\n\n    def MainMonitor(){ maxPrice = 0.0 }\n    \n    def updateMarketData(event)\n  \n    def onload(){\n        addEventListener(handler=updateMarketData, eventType='MarketData', times='all')\n    }\n\n    def updateMarketData(event){\n        print(\"MarketData: \"+event.code+\" price=\"+string(event.price))\n\n        if(event.price > maxPrice){\n            maxPrice = event.price\n\n            // emitEvent：Output to streaming table\n            emitEvent(UpdateFactor(\"maxPrice\", maxPrice))\n\n            // routeEvent: inserts a warning event at the head of the queue for priority processing\n            routeEvent(UpdateFactor(\"alert\", maxPrice))\n\n            // sendEvent: inserts an informational event at the tail of the queue for sequential processing\n            sendEvent(UpdateFactor(\"info\", maxPrice))\n        }\n    }\n}\n```\n\nCreate a streaming table to receive output events:\n\n```\nshare streamTable(array(STRING,0) as eventType, array(BLOB,0) as blobs) as simulateResult\n\nserializer = streamEventSerializer(\n    name=`simulate,\n    eventSchema=[UpdateFactor],\n    outputTable=simulateResult\n)\n\ndummy = table(array(STRING,0) as eventType, array(BLOB,0) as blobs)\n```\n\nCreate a CEP engine:\n\n```\nengine = createCEPEngine(\n    name='cep1',\n    monitors=<MainMonitor()>,\n    dummyTable=dummy,\n    eventSchema=[MarketData],\n    outputTable=serializer\n)\n```\n\n**Related functions**: [addEventListener](https://docs.dolphindb.com/en/Functions/a/add_event_listener.html), [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [appendEvent](https://docs.dolphindb.com/en/Functions/a/append_event.html), [emitEvent](https://docs.dolphindb.com/en/Functions/e/emit_event.html), [sendEvent](https://docs.dolphindb.com/en/Functions/s/send_event.html)\n"
    },
    "row": {
        "url": "https://docs.dolphindb.com/en/Functions/r/row.html",
        "signatures": [
            {
                "full": "row(obj, index)",
                "name": "row",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "index",
                        "name": "index"
                    }
                ]
            }
        ],
        "markdown": "### [row](https://docs.dolphindb.com/en/Functions/r/row.html)\n\n\n\n#### Syntax\n\nrow(obj, index)\n\n#### Details\n\nReturn one or more rows of a vector/matrix/table.\n\n#### Parameters\n\n**obj** is a vector/matrix/table.\n\n**index** is an integral scalar or pair.\n\n#### Returns\n\nOne or more rows of a vector, matrix, or table.\n\n#### Examples\n\n```\nx=matrix(1 2 3, 4 5 6);\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nrow(x,1);\n// output: [2,5]\n\nrow(x,0);\n// output: [1,4]\n\nx.row(2);\n// output: [3,6]\n\na=table(1..3 as x,`IBM`C`AAPL as y);\na\n```\n\n| x | y    |\n| - | ---- |\n| 1 | IBM  |\n| 2 | C    |\n| 3 | AAPL |\n\n```\nrow(a,1);\n/* output:\ny->C\nx->2\n*/\n\nrow(a,1:3)\n```\n\n| x | y    |\n| - | ---- |\n| 2 | C    |\n| 3 | AAPL |\n\nRelated function: [col](https://docs.dolphindb.com/en/Functions/c/col.html)\n"
    },
    "rowAlign": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowAlign.html",
        "signatures": [
            {
                "full": "rowAlign(left, right, how)",
                "name": "rowAlign",
                "parameters": [
                    {
                        "full": "left",
                        "name": "left"
                    },
                    {
                        "full": "right",
                        "name": "right"
                    },
                    {
                        "full": "how",
                        "name": "how"
                    }
                ]
            }
        ],
        "markdown": "### [rowAlign](https://docs.dolphindb.com/en/Functions/r/rowAlign.html)\n\n#### Syntax\n\nrowAlign(left, right, how)\n\n#### Details\n\nThe `rowAlign` function aligns corresponding rows from *left* and *right*based on their values. It returns a tuple containing two elements (either array vectors or columnar tuples, matching the input type). Each element in this tuple contains indices that map the aligned elements to their original positions in *left*and *right* respectively. Unmatched elements from one input are marked as -1 in the other input's returned index.\n\nThis function is typically used for aligning bid/ask prices, where *left* represents prices from one time point and *right* represents prices from a previous time point. The returned indices can be used with the `rowAt` function to extract the aligned elements from the original *left* and *right* arrays, with any unaligned elements left blank.\n\nThe alignment process for each row is illustrated in the accompanying images, where blue blocks indicate the elements not included in the output when using the \"bid\" or \"ask\" method.\n\n* *how* = \"bid\" or \"allBid\"\n\n  ![](https://docs.dolphindb.com/en/images/rowAlign_1.png)\n\n* *how* = \"ask\" or \"allAsk\":\n\n  ![](https://docs.dolphindb.com/en/images/rowAlign_2.png)\n\n#### Parameters\n\n**left**/**right** is an array vector or a columnar tuple.\n\n* *left* and *right* must be of the same data type and size (number of rows), but the number of elements in corresponding rows do not have to match. For example, if *left* has 3 rows and the first row has 5 elements, then *right* must also have 3 rows but the first row does not necessarily have 5 elements.\n\n* Data in each row of *left* and *right* must be strictly increasing/decreasing.\n\n**how** is a string indicating how *left* and *right* will be aligned. It can take the following values:\n\n| *how* (case-insensitive) | Description                                                                                                                                                     | Max. Value in the Alignment Result | Min. Value in the Alignment Result |\n| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | ---------------------------------- |\n| \"bid\"                    | *left* and *right* are bid prices sorted in strictly decreasing order. The output will only include the indices of prices that fall within the alignment range. | max(max(left), max(right))         | max(min(left), min(right))         |\n| \"allBid\"                 | *left* and *right* are bid prices sorted in strictly decreasing order. The output will include the indices of all prices from *left*and *right*.                | max(max(left), max(right))         | min(min(left), min(right))         |\n| \"ask\"                    | *left* and *right* are ask prices sorted in strictly increasing order. The output will only include the indices of prices that fall within the alignment range. | min(max(left), max(right))         | min(min(left), min(right))         |\n| \"allAsk\"                 | *left* and *right* are ask prices sorted in strictly increasing order. The output will include the indices of all prices from *left*and *right*.                | max(max(left), max(right))         | min(min(left), min(right))         |\n\n#### Returns\n\nA tuple of length 2, indicating the indices of the aligned data in the original vectors. If no value in *left/right* equals an element in *right/left*, returns -1 for that position.\n\n#### Examples\n\n```\nleft = array(DOUBLE[], 0, 5).append!([9.01 9.00 8.99 8.98 8.97, 9.00 8.98 8.97 8.96 8.95, 8.99 8.97 8.95 8.93 8.91])\nright = array(DOUBLE[], 0, 5).append!([9.02 9.01 9.00 8.99 8.98, 9.01 9.00 8.99 8.98 8.97, 9.00 8.98 8.97 8.96 8.95])\nleftIndex, rightIndex = rowAlign(left, right, \"bid\")\nleftIndex\n// output: [[-1,0,1,2,3],[-1,0,-1,1,2],[-1,0,-1,1,-1,2]]\n\nleft.rowAt(leftIndex)\n// output: [[,9.01,9.00,8.99,8.98],[,9,,8.98,8.97],[,8.99,,8.97,,8.95]]\n\nrightIndex\n// output: [[0,1,2,3,4],[0,1,2,3,4],[0,-1,1,2,3,4]]\n\nright.rowAt(rightIndex)\n// output: [[9.02,9.01,9.00,8.99,8.98],[9.01,9.00,8.99,8.98,8.97],[9.00,,8.98,8.97,8.96,8.95]]\n\n// output all bid prices in one array vector after aligning left and right\nleft.rowAt(leftIndex).nullFill(right.rowAt(rightIndex))\n// output: [[9.02,9.01,9,8.99,8.98],[9.01,9.00,8.99,8.98,8.97],[9.00,8.99,8.98,8.97,8.96,8.95]]\n\n// the bid sizes\nleftBidQty = array(INT[], 0, 5).append!([10 5 15 20 13, 12 15 20 21 18, 7 8 9 9 10])\nrightBidQty = array(INT[], 0, 5).append!([8 12 10 12 8, 10 5 15 18 13, 12 15 20 21 19])\n\n// calculate the difference in bid quantities between left and right \nleftBidQty.rowAt(leftIndex).nullFill(0) - rightBidQty.rowAt(rightIndex).nullFill(0)\n// output: [[-8,-2,-5,3,12],[-10,7,-15,-3,7],[-12,7,-15,-12,-21,-10]]\n\nleftIndex, rightIndex = rowAlign(left, right, \"allBid\")\nleftIndex\n// output: [[-1,0,1,2],[-1,-1,0,1,2],[-1,0,-1,1,2]]\n\nrightIndex\n// output: [[0,1,2,-1],[0,1,2,-1,-1],[0,-1,1,2,-1]]\n```\n\n```\nleft = array(DOUBLE[], 0, 3).append!([8.99 9.00 9.01, 8.97 8.99 9.00, 8.95 8.97 8.99])\nright = array(DOUBLE[], 0, 3).append!([9.00 9.01 9.02, 8.99 9.00 9.01, 8.97 8.98 9.00])\nleftIndex, rightIndex = rowAlign(left, right, \"ask\")\nleftIndex\n// output: [[0,1,2],[0,1,2],[0,1,-1,2]]\n \nrightIndex\n// output: [[-1,0,1],[-1,0,1],[-1,0,1,-1]]\n\nleftIndex, rightIndex = rowAlign(left, right, \"allAsk\")\nleftIndex\n// output: [[0,1,2,-1],[0,1,2,-1],[0,1,-1,2,-1]]\n \nrightIndex\n// output: [[-1,0,1,2],[-1,0,1,2],[-1,0,1,-1,2]]\n```\n\n```\nsym = `st1`st2`st3\nleft = [[3.1,2.5,2.8], [3.1,3.3], [3.2,2.9,3.3]]\nleft.setColumnarTuple!()\nright = [[3.1,2.5,2.8], [3.1,3.3], [3.2,2.9,3.3]]\nright.setColumnarTuple!()\nrowAlign(left, right, \"bid\")\n// output: [([0,1,2],[0,1],[0,1,2]), ([0,1,2],[0,1],[0,1,2])]\n```\n\n"
    },
    "rowAnd": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowAnd.html",
        "signatures": [
            {
                "full": "rowAnd(args...)",
                "name": "rowAnd",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowAnd](https://docs.dolphindb.com/en/Functions/r/rowAnd.html)\n\n\n\n#### Syntax\n\nrowAnd(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nFor each row (a vector is viewed as a one-column matrix here), return 1 if all rows of all input variables are true; otherwise return 0.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([true false false, true true true, true true true])\nrowAnd(m);\n// output: [1,0,0]\n\nt1=table(false true true true false as x, false true false true true as y)\nrowAnd(t1);\n// output: [0,1,0,1,0]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2)\nselect *  from t where rowAnd(price1>30, price2>50);\n```\n\n| sym  | price1 | price2 |\n| ---- | ------ | ------ |\n| AAPL | 49.6   | 175.23 |\n| IBM  | 30.02  | 51.29  |\n\nRelated function: [and](https://docs.dolphindb.com/en/Functions/a/and.html)\n"
    },
    "rowAt": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowAt.html",
        "signatures": [
            {
                "full": "rowAt(X, Y)",
                "name": "rowAt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            },
            {
                "full": "rowAt(X, [Y])",
                "name": "rowAt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [rowAt](https://docs.dolphindb.com/en/Functions/r/rowAt.html)\n\n\n\n#### Syntax\n\nrowAt(X, Y)\n\nrowAt(X, \\[Y])\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nRetrieve the element in each row of X based on the index specified by the corresponding element of Y. Return a vector with the same length as the number of input rows.\n\n* If *Y* is not specified, *X* must be a Boolean matrix or Boolean array vector. The `rowAt` function retrieves the row indices for each \"true\" element in *X* by row and returns an array vector (or columnar tuple) of integers. The returned result has the same number of rows as *X*. If X contains a row with only null values or \"false\" elements, `rowAt` returns null for that row.\n\n* If *Y* is a vector of integers, then each element in *Y* indicates the column index for *X* at each row. The `rowAt` function retrieves the corresponding element at each row in *X* and returns a vector of the same size as *Y*. If no element is found at the position specified by *Y*, a null value is returned. When *Y* is a Boolean matrix, *X* must be a matrix.\n\n* If *Y* is a Boolean matrix or Boolean array vector (or columnar tuple), the `rowAt` function retrieves the elements in *X* that correspond to the \"true\" values in *Y* and returns an array vector (or columnar tuple). The returned result has the same number of rows as *Y*. For any row in *Y* that contains only \"false\" elements, `rowAt` returns a null value in the output array vector for that row.\n\n* If *Y* is an array vector (or columnar tuple) of integers, then each row in *Y* indicates the column index for *X* at each row. The `rowAt` function retrieves the corresponding element(s) at each row in *X* and returns an array vector (or columnar tuple) of the same dimension as *Y*. If no element is found at the position specified by *Y*, a null value is returned.\n\n#### Parameters\n\n**X** is a matrix/array vector/columnar tuple.\n\n**Y**(optional) can be a vector of integers, a Boolean matrix, a Boolean/integral array vector or columnar tuple.\n\n#### Returns\n\nA vector with the same length as *Y*. If an index has no corresponding element or is outside the valid index range of *X*, returns NULL for that position.\n\n#### Examples\n\n```\nm = matrix(3.1 4.5 2.2, 4.2 4.3 5.1, 6.2 7.1 2.2, 1.8 6.1 5.3, 7.1 8.4 3.5)\nindex = 4 0 2\nrowAt(m, index)\n// output: [7.1,4.5,2.2]\n\ntrades = table(10:0,`time`sym`p1`p2`p3`p4`p5`vol1`vol2`vol3`vol4`vol5,[TIMESTAMP,SYMBOL,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,INT,INT,INT,INT,INT])\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 200, 180, 180, 220, 200)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.1, 32.8, 33.2, 34.3, 32.3, 150, 280, 190, 100, 220)\ninsert into trades values(2022.01.01T09:00:00, `A, 31.2, 32.6, 33.6, 35.3, 34.5, 220, 160, 130, 100, 110)\ninsert into trades values(2022.01.01T09:00:00, `A, 30.2, 32.5, 33.6, 35.3, 34.1, 200, 180, 150, 140, 120)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 180, 160, 160, 180, 200)\nselect rowAt(matrix(p1, p2, p3, p4, p5), rowImin(vol1, vol2, vol3, vol4, vol5)) as price1, rowAt(matrix(p1, p2, p3, p4, p5), rowImax(vol1, vol2, vol3, vol4, vol5)) as price2 from trades\n\n\n```\n\n| price1 | price2 |\n| ------ | ------ |\n| 33.8   | 33.3   |\n| 34.3   | 32.8   |\n| 35.3   | 31.2   |\n| 34.1   | 30.2   |\n| 33.8   | 33.1   |\n\n```\nindex = array(INT[], 0, 10).append!([0 1, 2 4, 3 4 5])\nrowAt(m, index)\n// output: [[3.1,4.2],[7.1,8.4],[5.3,3.5,]]\n\nx = array(DOUBLE[], 0, 10).append!([3.3 3.6 3.8, 3.7 3.4 3.5, 3.4 3.4 3.5])\nindex = array(INT[], 0, 10).append!([0 1, 2, 0 2])\nrowAt(x, index)\n// output: [[3.3,3.6],[3.5],[3.4,3.5]]\n```\n\nFor version 2.00.10.2 and later, when *X* is a Boolean matrix or array vector, *Y* can be unspecified, and `rowAt` returns the indices of elements that are true in each row.\n\n```\nm = matrix(true false false, false true false, true true false)\nR=rowAt(m)\nR\n// output: [[0,2],[1,2],]\ntypestr(R)  \n// output: FAST INT[] VECTOR\n\nm = matrix(3.1 4.5 2.2, 2.2 4.3 5.1, 1.2 7.1 2.2, 1.8 6.1 5.3, 1 4 3)\nrowAt(m, m>4)\n// output: [,[4.5,4.3,7.1,6.1],[5.1,5.3]]\n\nx = array(DOUBLE[], 0, 10).append!([3.3 3.6 3.8, 3.7 3.4 3.5, 3.4 3.4 3.5])\nrowAt(x, x>3.5)\n// output: [[3.6,3.8],[3.7],]\n```\n\nUse `rowAt` on a columnar tuple and an array vector:\n\n```\nx = ([1, 2, 3], [4, 5, 6]).setColumnarTuple!()\ny = fixedLengthArrayVector([1, 4], [2, 5], [3, 6])\n\nrowAt(x, x > 1)        \n// output: ([2,3],[4,5,6])\n\nrowAt(y, y>1)           \n// output: [[2,3],[4,5,6]]\n```\n\nRelated functions: [at](https://docs.dolphindb.com/en/Functions/a/at.html)\n"
    },
    "rowAvg": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowAvg.html",
        "signatures": [
            {
                "full": "rowAvg(args...)",
                "name": "rowAvg",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowAvg](https://docs.dolphindb.com/en/Functions/r/rowAvg.html)\n\n\n\n#### Syntax\n\nrowAvg(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the average of each row of the arguments. A vector is viewed as a one-column matrix here.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowAvg(m);\n// output: [3.633333,3.133333,3.7]\n\nt1=table(1..5 as x, 6..10 as y)\nt2=table(5..1 as a, 10..6 as b);\nrowAvg(t1);\n// output: [3.5,4.5,5.5,6.5,7.5]\n\nrowAvg(t1[`x], t2, take(1, 5));\n// output: [4.25,4,3.75,3.5,3.25]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2)\nselect sym,rowAvg(price1,price2) as avg from t;\n```\n\n| sym  | price1  |\n| ---- | ------- |\n| AAPL | 112.415 |\n| MS   | 40.11   |\n| IBM  | 39.92   |\n| IBM  | 40.655  |\n| C    | 100.6   |\n\nRelated function: [avg](https://docs.dolphindb.com/en/Functions/a/avg.html)\n"
    },
    "rowBeta": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowBeta.html",
        "signatures": [
            {
                "full": "rowBeta(Y, X)",
                "name": "rowBeta",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowBeta](https://docs.dolphindb.com/en/Functions/r/rowBeta.html)\n\n\n\n#### Syntax\n\nrowBeta(Y, X)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the coefficient estimate of the ordinary-least-squares regression of *Y* on *X* by row and return a vector with the same number of rows of *X*.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm1=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nm2=matrix(49.6 NULL 29.52, 50.32 51.29 26.23, NULL 74.97 23.75)\nrowBeta(m1, m2)\n// output: [-4.1667,-0.1182, -1.3374]\n\nm3=matrix(8 NULL 10, 8 NULL 4, 14 NULL NULL)\nrowBeta(m3, m2)\n// output: [0, , 1.8237]\n\na= 110 112.3 44 98\nb= 57.9 39 75 90\nc= 55 64 37 78\nx=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[a, b, c\\]\\)\ny=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[b, a, c\\]\\)\nrowBeta\\(x, y\\)\n// output: \\[0.6783, 1 , -0.3202, 1\\]\n```\n\nRelated function: [beta](https://docs.dolphindb.com/en/Functions/b/beta.html)\n"
    },
    "rowCorr": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCorr.html",
        "signatures": [
            {
                "full": "rowCorr(X, Y)",
                "name": "rowCorr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowCorr](https://docs.dolphindb.com/en/Functions/r/rowCorr.html)\n\n\n\n#### Syntax\n\nrowCorr(X, Y)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the correlation between *X* and *Y* by row and return a vector with the same number of rows of *X*. Null values are ignored in calculation.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm1=matrix(2 -1 4, 8 3 2, 9 0 1)\nm2=matrix(8 11 10, 8 17 4, 14 6 4)\nrowCorr(m1, m2)\n// output: [0.61, 0.7559, 0.9449]\n\nm3=matrix(8 NULL 10, 8 NULL 4, 14 NULL NULL)\nrowCorr(m1, m3)\n// output: [0.61, , 1]\n\na=array\\(DOUBLE\\[\\], 0, 10\\).append!\\(\\[1 2 3, 4 NULL 5, 6 7 8, NULL 3 10\\]\\);\nb=array\\(DOUBLE\\[\\], 0, 10\\).append!\\(\\[\\[1.3,1.2, 4\\], \\[1.0,1.4, 2\\], \\[1.1, 1.4, 3\\],\\[1, 4, 7\\]\\]\\);\n\nrowBeta\\(a, b\\)\n// output: \\[0.535, 1 , 0.9105, 2.3333\\]\n```\n\nRelated function: [corr](https://docs.dolphindb.com/en/Functions/c/corr.html)\n"
    },
    "rowCount": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCount.html",
        "signatures": [
            {
                "full": "rowCount(args...)",
                "name": "rowCount",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowCount](https://docs.dolphindb.com/en/Functions/r/rowCount.html)\n\n\n\n#### Syntax\n\nrowCount(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nReturn the number of non-null elements in each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL]);\nrowCount(m);\n// output: [3,3,2]\n\nt1=table(1 NULL 3 NULL 5 as x, 6..10 as y);\nt2=table(5 NULL 3 NULL 1 as a, 10..6 as b);\nrowCount(t1);\n\n// output: [2,1,2,1,2]\n\nrowCount(t1[`x], t2, 1 NULL 2 NULL NULL);\n// output: [4,1,4,1,3]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, [49.6, NULL, 29.52, NULL, 174.97] as price1, [175.23, NULL, 50.32, 51.29, 26.23] as price2);\nselect sym,rowCount(price1,price2) as count from t;\n```\n\n| sym  | count |\n| ---- | ----- |\n| AAPL | 2     |\n| MS   | 0     |\n| IBM  | 2     |\n| IBM  | 1     |\n| C    | 2     |\n\nRelated function: [rowSize](https://docs.dolphindb.com/en/Functions/r/rowSize.html), [count](https://docs.dolphindb.com/en/Functions/c/count.html)\n"
    },
    "rowCovar": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCovar.html",
        "signatures": [
            {
                "full": "rowCovar(X, Y)",
                "name": "rowCovar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowCovar](https://docs.dolphindb.com/en/Functions/r/rowCovar.html)\n\n\n\n#### Syntax\n\nrowCovar(X, Y)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the covariance between *X* and *Y* by row and return a vector with the same number of rows of *X*.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm1=matrix(2 8 9 12, 9 14 11 8,-3 NULL NULL 9)\nm2=matrix(11.2 3 5 9, 7 -10 8 5,17 12 18 9)\nrowCovar(m1, m2)\n// output: [-29.7333, -39, 3, 3.3333]\n\na= 110 112.3 44 98\nb= 57.9 39 75 90\nc= 55 64 37 78\nx=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[a, b, c\\]\\)\ny=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[b, a, c\\]\\)\n\nrowCovar\\(x, y\\)\n// output: \\[-327.9475, -327.9475, 295\\]\n```\n\n```\n//Define a random data set x\n\nx = rand(1.0, 1000000)\n\n//calculate the covariance between x and sorted x in a sliding window with a user-defined aggregate function\ntimer moving(defg(x):covar(x, sort(x)), x, 5)\n// output: 1928.888 ms\n\n//calculate with rowCovar\n\ntimer rowCovar(x[movingWindowIndex(x, 5)], x[movingTopNIndex(x, 5, 5)])\n// output: 232.407 ms\n```\n\nRelated function: [covar](https://docs.dolphindb.com/en/Functions/c/covar.html)\n"
    },
    "rowCovarp": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCovarp.html",
        "signatures": [
            {
                "full": "rowCovarp(X, Y)",
                "name": "rowCovarp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowCovarp](https://docs.dolphindb.com/en/Functions/r/rowCovarp.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nrowCovarp(X, Y)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculates the population covariance between *X* and *Y* by row and returns a vector with the same number of rows of *X*.\n\n#### Returns\n\nA vector with a length equal to the number of rows in the input parameter.\n\n#### Examples\n\n```\nm1=matrix(2 8 9 12, 9 14 11 8,-3 NULL NULL 9)\nm2=matrix(11.2 3 5 9, 7 -10 8 5,17 12 18 9)\nrowCovarp(m1, m2)\n// output: [-19.82,-19.5,1.5,2.22]\n\na= 110 112.3 44 98\nb= 57.9 39 75 90\nc= 55 64 37 78\nx=array(DOUBLE[],0, 10).append!([a, b, c])\ny=array(DOUBLE[],0, 10).append!([b, a, c])\n\nrowCovarp(x, y)\n// output: [-245.96,-245.96,221.25]\n```\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "rowCummax": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCummax.html",
        "signatures": [
            {
                "full": "rowCummax(X)",
                "name": "rowCummax",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowCummax](https://docs.dolphindb.com/en/Functions/r/rowCummax.html)\n\n\n\n#### Syntax\n\nrowCummax(X)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\n`rowCummax` calculates the cumulative maximum values in each row of *X*.\n\n#### Returns\n\nAn object with the same data type as *X*.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowCummax(m)\n/* output:\ncol1        col2    col3\n4.5         4.5     4.9\n2.6         4.8     4.8\n1.5         5.9     5.9\n*/\n\na=array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8]);\nrowCummax(a)\n// output: [[1,2,3],[4,5],[6,7,8]]\n\ntp = [[1.3,2.5,2.3], [4.1,5.3,6.2]]\ntp.setColumnarTuple!()\nrowCummax(tp)\n// output: [[1.3,2.5,2.5],[4.1,5.3,6.2]]\n```\n"
    },
    "rowCummin": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCummin.html",
        "signatures": [
            {
                "full": "rowCummax(X)",
                "name": "rowCummax",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowCummin](https://docs.dolphindb.com/en/Functions/r/rowCummin.html)\n\n\n\n#### Syntax\n\nrowCummax(X)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\n`rowCummin` calculates the cumulative minimum values in each row of *X*.\n\n#### Returns\n\nAn object with the same data type as *X*.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowCummin(m)\n/* output:\ncol1        col2    col3\n4.5         1.5     1.5\n2.6         2.6     2\n1.5         1.5     1.5\n*/\n\na=array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8]);\nrowCummin(a)\n// output: [[1,1,1],[4,4],[6,6,6]]\n\ntp = [[1.3,2.5,2.3], [4.1,5.3,6.2]]\ntp.setColumnarTuple!()\nrowCummin(tp)\n// output: [[1.3,1.3,1.3],[4.1,4.1,4.1]]\n```\n"
    },
    "rowCumprod": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCumprod.html",
        "signatures": [
            {
                "full": "rowCumprod(X)",
                "name": "rowCumprod",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowCumprod](https://docs.dolphindb.com/en/Functions/r/rowCumprod.html)\n\n\n\n#### Syntax\n\nrowCumprod(X)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\n`rowCumprod` calculates the cumulative products of the elements in each row of X.\n\n#### Returns\n\nAn object with the same data type as *X*.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowCumProd(m)\n/* output:\ncol1        col2    col3\n4.5 6.75    33.075\n2.6 12.48   24.96\n1.5 8.85    8.85\n*/\n\na=array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8]);\nrowCumProd(a)\n// output: [[1,3,6],[4,9],[6,13,21]]\n\ntp = [[1.3,2.5,2.3], [4.1,5.3,6.2]]\ntp.setColumnarTuple!()\nrowCumProd(tp)\n// output: [[1.3,3.25,7.475],[4.1,21.73,134.726]]\n```\n"
    },
    "rowCumsum": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCumsum.html",
        "signatures": [
            {
                "full": "rowCumsum(X)",
                "name": "rowCumsum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowCumsum](https://docs.dolphindb.com/en/Functions/r/rowCumsum.html)\n\n\n\n#### Syntax\n\nrowCumsum(X)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\n`rowCumsum` calculates the cumulative sum of each row of *X*.\n\n#### Returns\n\nAn object with the same data type as *X*.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowCumsum(m)\n/* output:\ncol1        col2    col3\n4.5     6       10.9\n2.6     7.4     9.4\n1.5     7.4     7.4\n*/\n\na=array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8]);\nrowCumsum(a)\n// output: [[1,3,6],[4,9],[6,13,21]]\n\ntp = [[1.3,2.5,2.3], [4.1,5.3,6.2]]\ntp.setColumnarTuple!()\nrowCumsum(tp)\n// output: [[1.3,3.8,6.1],[4.1,9.4,15.6]]\n```\n"
    },
    "rowCumwsum": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowCumwsum.html",
        "signatures": [
            {
                "full": "rowCumwsum(X, Y)",
                "name": "rowCumwsum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowCumwsum](https://docs.dolphindb.com/en/Functions/r/rowCumwsum.html)\n\n\n\n#### Syntax\n\nrowCumwsum(X, Y)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\n`rowCumwsum` calculates the cumulative weighted sum in each row of *X* with *Y* as the weights.\n\n#### Returns\n\nAn object with the same data type as *X*.\n\n#### Examples\n\n```\nm1=matrix(2 -1 4, 8 3 2, 9 0 1)\nm2=matrix(8 11 10, 8 17 4, 14 6 4)\nrowCumwsum(m1, m2)\n/* output:\ncol1        col2    col3\n16          80      206\n-11         40      40\n40          48      52\n*/\n\na= -10 12.3 4 -8\nb= 17.9 9 7.5 -4\nc= 5.5 6.4 -7 8\nx=array(DOUBLE[],0, 10).append!([a, b, c])\ny=array(DOUBLE[],0, 10).append!([b, a, c])\nrowCumwsum(x, y)\n// output: [[-179,-68.30,-38.30,-6.29],[-179,-68.30,-38.30,-6.29],[30.25,71.21,120.21,184.21]]\n\ntp1 = [[3,4,5],[4,5,6]]\ntp1.setColumnarTuple!()\n\ntp2 = [[13,41,25],[21,30,10]]\ntp2.setColumnarTuple!()\nrowCumwsum(tp1, tp2)\n// output: [[39,203,328],[84,234,294]]\n```\n"
    },
    "rowDenseRank": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowDenseRank.html",
        "signatures": [
            {
                "full": "rowDenseRank(X, [ascending=true], [ignoreNA=true], [percent=false])",
                "name": "rowDenseRank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [rowDenseRank](https://docs.dolphindb.com/en/Functions/r/rowDenseRank.html)\n\n\n\n#### Syntax\n\nrowDenseRank(X, \\[ascending=true], \\[ignoreNA=true], \\[percent=false])\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\n`rowDenseRank` can be viewed as function [denseRank](https://docs.dolphindb.com/en/Functions/d/denseRank.html) applied on rows instead of columns. It returns the consecutive rank of each element in each row.\n\n#### Parameters\n\n**X** is a matrix.\n\n**ascending** (optional) is a Boolean value indicating whether to sort in ascending order. The default value is true.\n\n**ignoreNA** (optional) is a Boolean value indicating whether null values are ignored in ranking and return NULL. When Null values participate in ranking, NULL values return 0, which is the smallest value in the result.\n\n**percent** (optional) is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n#### Returns\n\nA matrix with the same dimensions as *X*.\n\n#### Examples\n\n```\nm = matrix(1 5 8 5 9, 2 8 2 5 2, 6 5 3 3 4)\nrowDenseRank(m)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 0    | 1    | 2    |\n| 0    | 1    | 0    |\n| 2    | 0    | 1    |\n| 1    | 1    | 0    |\n| 2    | 0    | 1    |\n\n```\ny=matrix(1 3 3, 6 5 6, NULL 0 9)\nrowDenseRank(y)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 0    |      | 1    |\n| 1    | 2    | 0    |\n| 0    | 1    | 2    |\n\n```\nrowDenseRank(y, ignoreNA=false)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 2    | 0    |\n| 1    | 2    | 0    |\n| 0    | 1    | 2    |\n\nRelated function: [denseRank](https://docs.dolphindb.com/en/Functions/d/denseRank.html), [rowRank](https://docs.dolphindb.com/en/Functions/r/rowRank.html)\n"
    },
    "rowDot": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowDot.html",
        "signatures": [
            {
                "full": "rowDot(X, Y)",
                "name": "rowDot",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowDot](https://docs.dolphindb.com/en/Functions/r/rowDot.html)\n\n\n\n#### Syntax\n\nrowDot(X, Y)\n\n#### Details\n\nIf both *X* and *Y* are vectors/matrices, calculate the inner product between *X* and *Y* by row. If both *X* and *Y* are indexed matrices, calculate the inner product between rows with the same label. For other rows, return NULL.\n\nFor a vector and a matrix, the length of the vector must be the same as the number of columns of the matrix. Calculate the inner product between the vector and each row of the matrix is calculated.\n\nIf *X* and *Y* are array vectors, calculate the inner product between the corresponding rows (vectors) in *X* and *Y*, i.e., dot(X.row(i),Y.row(i)).\n\nFor a vector and an array vector, calculate the inner product between the vector and each vector in the array vector. Return NULL when *X* and *Y* are of different lengths.\n\nAs with all other aggregate functions, null values are ignored in the calculation.\n\n#### Parameters\n\n**X** and **Y** are numeric vectors/array vectors of the same length or matrices with the same dimension. If *X* and *Y* are array vectors, the vectors at the same position in *X* and *Y* must have the same length.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nrowDot(13.5 15.2 6.3, 18.6 14.8 15.5)\n// output: [251.1,224.96,97.65]\n\ns1=indexedSeries(2020.01.01..2020.01.03, 10.4 11.2 9)\ns2=indexedSeries(2020.01.01 2020.01.03 2020.01.04, 23.5 31.2 26)\nrowDot(s1,s2)\n// output: [244.4,349.44,234]\n\nm=matrix(23 56 47, 112 94 59)\nm1=matrix(11 15 89, 52 41 63)\nrowDot(m,m1)\n// output: [6077,4694,7900]\n\nm.rename!(2020.01.01..2020.01.03, `A`B)\nm.setIndexedMatrix!()\nm1.rename!(2020.01.01 2020.01.03 2020.01.04, `A`B)\nm1.setIndexedMatrix!()\nrowDot(m,m1)\n// output: [6077,NULL,3124,NULL]\n\na=array(DOUBLE[],0,10)\na.append!([[10.5, 11.8, 9],[15, NULL], [2.5, 2.2, 1.3, 1.5]])\nb=array(DOUBLE[],0,10)\nb.append!([[1.1, 1.8, 6],[5, 6.9], [3.5, 2, 3, 2.8]])\nrowDot(a,b)\n// output: [86.79,75,21.25]\n```\n\nRelated function: [dot](https://docs.dolphindb.com/en/Functions/d/dot.html)\n"
    },
    "rowEuclidean": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowEuclidean.html",
        "signatures": [
            {
                "full": "rowEuclidean(X, Y)",
                "name": "rowEuclidean",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowEuclidean](https://docs.dolphindb.com/en/Functions/r/rowEuclidean.html)\n\n\n\n#### Syntax\n\nrowEuclidean(X, Y)\n\n#### Details\n\nIf both *X* and *Y* are vectors/matrices, calculate the Euclidean distance between *X* and *Y* by row. If both *X* and *Y* are indexed matrices, calculate the Euclidean distance between rows with the same label. For other rows, return NULL.\n\nFor a vector and a matrix, the length of the vector must be the same as the number of columns of the matrix. Calculate the Euclidean distance between the vector and each row of the matrix is calculated.\n\nIf *X* and *Y* are array vectors, calculate the Euclidean distance between the corresponding rows (vectors) in *X* and *Y*, i.e., euclidean(X.row(i),Y.row(i)).\n\nFor a vector and an array vector, calculate the Euclidean distance between the vector and each vector in the array vector. Return NULL when *X* and *Y* are of different lengths.\n\nAs with all other aggregate functions, null values are ignored in the calculation.\n\n#### Parameters\n\n**X** and **Y** are numeric vectors/array vectors of the same length or matrices with the same dimension. If *X* and *Y* are array vectors, the vectors at the same position in *X* and *Y* must have the same length.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nrowEuclidean(3.6 5.2 6.3, 8.6 4.8 5.5)\n// output: [5,0.4,0.8]\n\nm=matrix(23 56 47, 112 94 59)\nm1=matrix(11 15 89, 52 41 63)\nrowEuclidean(m,m1)\n// output: [61.1882,67.0075,42.19]\n\nm.rename!(2020.01.01..2020.01.03, `A`B)\nm.setIndexedMatrix!()\nm1.rename!(2020.01.01 2020.01.03 2020.01.04, `A`B)\nm1.setIndexedMatrix!()\nrowEuclidean(m,m1)\n// output: [61.1882,NULL,36.7151,NULL]\n\na=array(INT[],0,10)\na.append!([[1, 8, 9],[15, NULL], [25, 22, 13, 15]])\nb=array(INT[],0,10)\nb.append!([[11, 18, 6],[5, 9], [5, 2, 3, 1]])\nrowEuclidean(a,b)\n// output: [14.4568,10,33.1059]\n```\n\nRelated function: [euclidean](https://docs.dolphindb.com/en/Functions/e/euclidean.html)\n"
    },
    "rowFilterAndSort": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowfilterandsort.html",
        "signatures": [
            {
                "full": "rowFilterAndSort(sortVec, filterVec, orderedFilters, args...)",
                "name": "rowFilterAndSort",
                "parameters": [
                    {
                        "full": "sortVec",
                        "name": "sortVec"
                    },
                    {
                        "full": "filterVec",
                        "name": "filterVec"
                    },
                    {
                        "full": "orderedFilters",
                        "name": "orderedFilters"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowFilterAndSort](https://docs.dolphindb.com/en/Functions/r/rowfilterandsort.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nrowFilterAndSort(sortVec, filterVec, orderedFilters, args...)\n\n#### Details\n\nFilters and sorts elements in array vectors or columnar tuples.\n\nElements of *sortVec* , *filterVec* and *args...* correspond to each other by position. This function first filters *filterVec* , then sorts *sortVec* and *filterVec* . The filtering and sorting criteria are specified by *orderedFilters* :\n\n* **Filtering** : Filters *filterVec* according to *orderedFilters* , retaining only the values specified in *orderedFilters*\n\n* **Sorting** : After filtering, sorts equal values in *sortVec* according to the order specified by *orderedFilters* based on the corresponding values in *filterVec.*\n\n#### Parameters\n\n**sortVec** is a numeric/temporal array vector or columnar tuple representing the sort-key column. *sortVec* can also be a tuple containing up to 3 array vectors or columnar tuples. The elements in each row must be ordered.\n\n**filterVec** is a STRING columnar tuple representing the filter-key column to be filtered by *orderedFilters* and used for reordering. *filterVec* can also be a tuple containing up to 3 STRING columnar tuples.\n\n**orderedFilters** is a STRING vector or tuple representing the priority order for filtering and reordering. If *filterVec* is a tuple, *orderedFilters* must also be a tuple with the same number of elements as *filterVec* .\n\n**args...** (optional) can be array vectors or columnar tuples representing additional columns to be filtered and reordered together with *sortVec* using the same sorting order. The data form of *args* must be consistent with *sortVec.*\n\n#### Returns\n\nReturns a tuple. The tuple elements are: the expanded columns of the filtered and reordered results of *sortVec* , *filterVec* and *args* .\n\n“Expanded” means that when *sortVec, filterVec* and *args* are tuples, each element of the filtered and reordered results independently becomes an element of the returned result tuple. For example, both *sortVec, filterVec* are tuples containing two elements, *args* contains three elements, and the returned result is a tuple containing 7 (=2+2+3) elements.\n\n#### Examples\n\nExample 1. Filter and sort the columnar tuples: The askPrices come from different sources (srcs). Now filter out prices from SRC3 or SRC1.For identical prices, order them with SRC3 first, followed by SRC1. The corresponding askVols are also filtered and sorted accordingly.\n\n```\norderedFilters = `SRC3`SRC1\nsrcs = [`SRC1`SRC2`SRC3`SRC1`SRC3, `SRC1`SRC3`SRC1`SRC2`SRC3`SRC1`SRC2].setColumnarTuple!(true)\naskPrices = [900 900 900 901 901, 800 800 802 802 802 803 803].setColumnarTuple!(true)\naskVols = [10 15 20 15 20, 20 15 30 40 20 15 30].setColumnarTuple!(true)\nrowFilterAndSort(askPrices, srcs, orderedFilters, askVols)\n/*\noutput: \n(([900,900,901,901],[800,800,802,802,803]),\n([\"SRC3\",\"SRC1\",\"SRC3\",\"SRC1\"],[\"SRC3\",\"SRC1\",\"SRC3\",\"SRC1\",\"SRC1\"]),\n([20,10,20,15],[15,20,20,30,15]))\n*/\n```\n\nExample 2. For a tuple of array vectors: The askPrices correspond to different times and come from different sources (srcs), each with different clearing speeds. Now filter for the quotes coming from SRC1 or SRC3, with clearing speeds of T0, T1, or T2. The results will be sorted by price priority, time priority, with sources ordered as SRC1, SRC3, and clearing speeds ordered as T0, T1, T2. The corresponding order volumes askVols will also be filtered and sorted accordingly.\n\n```\norderedFilters = [`SRC1`SRC3, `T0`T1`T2]\nsrcs = [`SRC1`SRC1`SRC3`SRC3`SRC3, `SRC3`SRC3`SRC1`SRC2`SRC3`SRC1`SRC2].setColumnarTuple!(true)\nspeeds = [`T1`T2`T0`T2`T4, `T2`T0`T1`T0`T0`T0`T1].setColumnarTuple!(true)\naskPrices = array(INT[], 0, 10).append!([900 900 900 901 901, 800 800 802 802 802 803 803])\nquoteTimes = array(SECOND[], 0, 10).append!([09:30:00 09:30:00 09:30:00 09:30:01 09:30:02, \n\t09:30:00 09:30:00 09:30:00 09:30:00 09:30:00 09:30:00 09:30:00])\naskVols = array(INT[], 0, 10).append!([10 15 20 15 20, 20 15 30 40 20 15 30])\nrowFilterAndSort([askPrices,quoteTimes], [srcs,speeds], orderedFilters, askVols)\n/*\noutput: \n([[900,900,900,901],[800,800,802,802,803]],\n[[09:30:00,09:30:00,09:30:00,09:30:01],[09:30:00,09:30:00,09:30:00,09:30:00,09:30:00]],\n([\"SRC1\",\"SRC1\",\"SRC3\",\"SRC3\"],[\"SRC3\",\"SRC3\",\"SRC1\",\"SRC2\",\"SRC3\"]),\n([\"T1\",\"T2\",\"T0\",\"T2\"],[\"T0\",\"T2\",\"T1\",\"T0\",\"T0\"]),\n[[10,15,20,15],[15,20,30,20,15]])\n*/\n```\n\n**Related Functions:** [rowMergeAndSort](https://docs.dolphindb.com/en/Functions/r/rowmergeandsort.html)\n"
    },
    "rowGmd5": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowgmd5.html",
        "signatures": [
            {
                "full": "rowGmd5(args...)",
                "name": "rowGmd5",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowGmd5](https://docs.dolphindb.com/en/Functions/r/rowgmd5.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nrowGmd5(args...)\n\n#### Details\n\nCreate an MD5 hash from each row ofX.\n\n#### Parameters\n\n**args**is a array vector/columnar tuple.\n\n#### Returns\n\nAn INT128 vector of the same length as the number of rows in *args*.\n\n#### Examples\n\n```\nxs = array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8, 9 10])\nrowGmd5(xs)\n// output: [2a1dd1e1e59d0a384c26951e316cd7e6,678157bbe4fd35371e047b4cadf9c46a,ff93cd8c0033f2ab93726d48661d1221,10986ac9310ecb2f10c3a5524eb38999]\n// The output contains four rows, each representing the MD5 hash of a row in xs. For example,   2a1dd1e1e59d0a384c26951e316cd7e6 is the MD5 hash of [1, 2, 3].\n\ngmd5(1 2 3)\n// output: 2a1dd1e1e59d0a384c26951e316cd7e6\n\nrowGmd5(xs, xs)\n// output: [50420aa84aa547ebc24dfa3ef8fffa57,de90d6c74c0b99f5656b95563a9a35b7,376579b27ec7c2f6eed7347ef0e5a15b,78bf6752e93cbca5fd1dcc3519fc6c55]\n \nys = [1 2 3, 4 5, 6 7 8, 9 10]\nys.setColumnarTuple!(true)\nrowGmd5(xs, ys)\n// output: [50420aa84aa547ebc24dfa3ef8fffa57,de90d6c74c0b99f5656b95563a9a35b7,376579b27ec7c2f6eed7347ef0e5a15b,78bf6752e93cbca5fd1dcc3519fc6c55]\n```\n\nThe output contains four rows, each representing the MD5 hash of a row in xs. For example, 2a1dd1e1e59d0a384c26951e316cd7e6 is the MD5 hash of \\[1, 2, 3].\n\nRelated functions: [gmd5](https://docs.dolphindb.com/en/Functions/g/gmd5.html)\n"
    },
    "rowGroupby": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowGroupby.html",
        "signatures": [
            {
                "full": "rowGroupby(func, funcArgs, groupingCol, [mode='tuple'], [ascending=true])",
                "name": "rowGroupby",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "groupingCol",
                        "name": "groupingCol"
                    },
                    {
                        "full": "[mode='tuple']",
                        "name": "mode",
                        "optional": true,
                        "default": "'tuple'"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [rowGroupby](https://docs.dolphindb.com/en/Functions/r/rowGroupby.html)\n\n\n\n#### Syntax\n\nrowGroupby(func, funcArgs, groupingCol, \\[mode='tuple'], \\[ascending=true])\n\n#### Details\n\nGroup the data by *groupingCol*, then calculate `func(funcArgs)` and return a scalar for each group.\n\n#### Parameters\n\n**func** is an aggregate function.\n\n**funcArgs** is the argument(s) passed to *func*. Multiple arguments can be represented in a tuple, and the dimension of each element must be consistent with *groupingCol*.\n\n**groupingCol** is a non-empty matrix or array vector indicating the grouping column(s).\n\n**mode** (optional) specifies the returned data form. It can be:\n\n* \"tuple\" (default): Return a tuple of length 2, the first element of which is an array vector that stores the grouping variables, and the second element is an array vector that stores the result of applying *funcArgs*to *func*in each group.\n\n* \"dict\": Return a dictionary with a key-value pair. 'key' stores the grouping variables and 'value' stores the result of applying *funcArgs*to *func*in each group.\n\n* \"table\": Return a table with two columns. 'key' stores the grouping variables and 'value' stores the result of applying *funcArgs*to *func*in each group.\n\n**ascending** (optional) is a Boolean value indicating whether to sort the output by *groupingCol*in ascending or descending order. The default value is true.\n\n#### Returns\n\nAs specified in *mode*, sorted by *groupingCol*in *ascending*order.\n\n#### Examples\n\nGroup data by price, and calculate the sum of qty for each group:\n\n```\nsym=`A`B\nprice = array(DOUBLE[], 0).append!([12.5 12.6 12.5 12.5 12.6, 15.5 15.5 15.5 15.3 15.3])\nqty = array(INT[], 0).append!([201 212 220 215 214, 210 213 223 219 211])\nt=table(sym,price,qty)\nt;\n```\n\n| sym | price                       | qty                        |\n| --- | --------------------------- | -------------------------- |\n| A   | \\[12.5 12.6 12.5 12.5 12.6] | \\[201, 212, 220, 215, 214] |\n| B   | \\[15.5 15.5 15.5 15.3 15.3] | \\[210, 213, 223, 219, 211] |\n\nSet *mode*='dict':\n\n```\nrowGroupby(func=sum,funcArgs=t.qty,groupingCol=t.price,mode='dict')\n\n/* output:\nkey->[[12.5,12.6],[15.3,15.5]]\nvalue->[[636,426],[430,646]]\n*/\n```\n\nSet *mode*='table':\n\n```\nrowGroupby(func=sum,funcArgs=t.qty,groupingCol=t.price,mode='table')\n```\n\n| key          | value      |\n| ------------ | ---------- |\n| \\[12.5,12.6] | \\[636,426] |\n| \\[15.3,15.5] | \\[430,646] |\n\nSet *mode*='tuple':\n\n```\nselect rowGroupby(sum, qty, price, 'tuple') as `a`b from t\n```\n\n| key          | value      |\n| ------------ | ---------- |\n| \\[12.5,12.6] | \\[636,426] |\n| \\[15.3,15.5] | \\[430,646] |\n\nSet *ascending*=false:\n\n```\nrowGroupby(func=sum,funcArgs=t.qty,groupingCol=t.price,mode='dict', ascending=false)\n\n/* output:\nvalue->[[426,636],[646,430]]\nkey->[[12.6000,12.5000],[15.5000,15.3000]]\n*/\n```\n\nExample 2. Apply `rowGroupby` on matrices:\n\n```\nm=matrix([32.5 12.6 22.5 42.5 32.6, 17.5 25.5 35.5 17.3 19.3, 17 20.1 30 13 19])\ng=matrix([1 2 2 5 4, 2 2 3 2 1, 1 3 2 3 5])\n// rowGroupby m with groupingCol=g\nrowGroupby(func=sum, funcArgs=m, groupingCol=g, mode='table')\n```\n\n| key      | value           |\n| -------- | --------------- |\n| \\[1,2]   | \\[49.5,17.5]    |\n| \\[2,3]   | \\[38.1,20.1]    |\n| \\[2,3]   | \\[52.5,35.5]    |\n| \\[2,3,5] | \\[17.3,13,42.5] |\n| \\[1,4,5] | \\[19.3,32.6,19] |\n"
    },
    "rowImax": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowImax.html",
        "signatures": [
            {
                "full": "rowImax(args...)",
                "name": "rowImax",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowImax](https://docs.dolphindb.com/en/Functions/r/rowImax.html)\n\n\n\n#### Syntax\n\nrowImax(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nReturn the index of the maximum in each row. If there are multiple maxima, return the index of the first maximum from the left. The result is a vector with the same length as the number of input rows.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5 3.2, 1.5 4.8 5.9 1.7, 4.9 2.0 NULL 5.5])\nprint rowImax(m)\n// output: [2,1,1,2]\n\ntrades = table(10:0,`time`sym`p1`p2`p3`p4`p5`vol1`vol2`vol3`vol4`vol5,[TIMESTAMP,SYMBOL,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,INT,INT,INT,INT,INT])\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 200, 180, 180, 220, 200)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.1, 32.8, 33.2, 34.3, 32.3, 150, 280, 190, 100, 220)\ninsert into trades values(2022.01.01T09:00:00, `A, 31.2, 32.6, 33.6, 35.3, 34.5, 220, 160, 130, 100, 110)\ninsert into trades values(2022.01.01T09:00:00, `A, 30.2, 32.5, 33.6, 35.3, 34.1, 200, 180, 150, 140, 120)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 180, 160, 160, 180, 200)\nselect rowAt(matrix(p1, p2, p3, p4, p5), rowImax(vol1, vol2, vol3, vol4, vol5)) as price from trades\n```\n\n| price |\n| ----- |\n| 33.3  |\n| 32.8  |\n| 31.2  |\n| 30.2  |\n| 33.1  |\n\nIf *args* is an array vector, return the index of the maximum in each row. The result is a vector.\n\n```\na = 1 8 3 8 1\nb = 5 8 1 3 6\nc =  9 5 4 7 6\nx = fixedLengthArrayVector(a, b, c)\nrowImax(x)\n// output: [2,0,2,0,1]\n```\n\nRelated functions: [imax](https://docs.dolphindb.com/en/Functions/i/imax.html)\n"
    },
    "rowImaxLast": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowimaxlast.html",
        "signatures": [
            {
                "full": "rowImaxLast(args…)",
                "name": "rowImaxLast",
                "parameters": [
                    {
                        "full": "args…",
                        "name": "args…"
                    }
                ]
            }
        ],
        "markdown": "### [rowImaxLast](https://docs.dolphindb.com/en/Functions/r/rowimaxlast.html)\n\n\n\n#### Syntax\n\nrowImaxLast(args…)\n\n#### Details\n\nReturn a vector of the same length as the number of rows of the argument. The vector contains the index of the element with the largest value in *X* in each row. If there are multiple elements with the identical largest value, return the index of the first element from the right.\n\n#### Parameters\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.dita) for the parameters and calculation rules.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5 3.2, 1.5 4.8 5.9 1.7, 4.9 2.0 NULL 5.5])\nrowImaxLast(m)\n// output: [2,1,1,2]\n\ntrades = table(10:0,`time`sym`p1`p2`p3`p4`p5`vol1`vol2`vol3`vol4`vol5,[TIMESTAMP,SYMBOL,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,INT,INT,INT,INT,INT])\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 200, 180, 180, 220, 200)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.1, 32.8, 33.2, 34.3, 32.3, 150, 280, 190, 100, 220)\ninsert into trades values(2022.01.01T09:00:00, `A, 31.2, 32.6, 33.6, 35.3, 34.5, 220, 160, 130, 100, 110)\ninsert into trades values(2022.01.01T09:00:00, `A, 30.2, 32.5, 33.6, 35.3, 34.1, 200, 180, 150, 140, 120)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 180, 160, 160, 180, 200)\n\nselect rowAt(matrix(p1, p2, p3, p4, p5), rowImaxLast(vol1, vol2, vol3, vol4, vol5)) as price from trades\n/* output:\nprice\n33.3\n32.8\n31.2\n30.2\n33.1\n*/\n```\n\nRelated function: [rowImax](https://docs.dolphindb.com/en/Functions/r/rowImax.html)\n"
    },
    "rowImin": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowImin.html",
        "signatures": [
            {
                "full": "rowImin(args...)",
                "name": "rowImin",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowImin](https://docs.dolphindb.com/en/Functions/r/rowImin.html)\n\n\n\n#### Syntax\n\nrowImin(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nReturn the index of the minimum in each row. If there are multiple minima, return the index of the first minimum from the left. The result is a vector with the same length as the number of input rows.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5 3.2, 1.5 4.8 5.9 1.7, 4.9 2.0 NULL 5.5])\nrowImin(m)\n// output: [1,2,0,1]\n\n\ntrades = table(10:0,`time`sym`p1`p2`p3`p4`p5`vol1`vol2`vol3`vol4`vol5,[TIMESTAMP,SYMBOL,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,INT,INT,INT,INT,INT])\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 200, 180, 180, 220, 200)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.1, 32.8, 33.2, 34.3, 32.3, 150, 280, 190, 100, 220)\ninsert into trades values(2022.01.01T09:00:00, `A, 31.2, 32.6, 33.6, 35.3, 34.5, 220, 160, 130, 100, 110)\ninsert into trades values(2022.01.01T09:00:00, `A, 30.2, 32.5, 33.6, 35.3, 34.1, 200, 180, 150, 140, 120)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 180, 160, 160, 180, 200)\n\nselect rowAt(matrix(p1, p2, p3, p4, p5), rowImin(vol1, vol2, vol3, vol4, vol5)) as price from trades\n```\n\n| price |\n| ----- |\n| 33.8  |\n| 34.3  |\n| 35.3  |\n| 34.1  |\n| 33.8  |\n\nIf *args* is an array vector, return the index of the minimum in each row. The result is a vector.\n\n```\na = 1 8 3 8 1\nb = 5 7 1 3 9\nc =  5 5 4 3 6\nx = fixedLengthArrayVector(a, b, c)\nrowImin(x)\n// output: [0,2,1,1,0]\n```\n\nRelated functions: [imin](https://docs.dolphindb.com/en/Functions/i/imin.html)\n"
    },
    "rowIminLast": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowiminlast.html",
        "signatures": [
            {
                "full": "rowIminLast(args…)",
                "name": "rowIminLast",
                "parameters": [
                    {
                        "full": "args…",
                        "name": "args…"
                    }
                ]
            }
        ],
        "markdown": "### [rowIminLast](https://docs.dolphindb.com/en/Functions/r/rowiminlast.html)\n\n\n\n#### Syntax\n\nrowIminLast(args…)\n\n#### Details\n\nReturn a vector of the same length as the number of rows of the argument. The vector contains the index of the element with the smallest value in *X* in each row. If there are multiple elements with the identical smallest value, return the index of the first element from the right.\n\n#### Parameters\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.dita) for the parameters and calculation rules.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5 3.2, 1.5 4.8 5.9 1.7, 4.9 2.0 NULL 5.5])\nrowIminLast(m)\n// output: [1,2,0,1]\n\ntrades = table(10:0,`time`sym`p1`p2`p3`p4`p5`vol1`vol2`vol3`vol4`vol5,[TIMESTAMP,SYMBOL,DOUBLE,DOUBLE,DOUBLE,DOUBLE,DOUBLE,INT,INT,INT,INT,INT])\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 200, 180, 180, 220, 200)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.1, 32.8, 33.2, 34.3, 32.3, 150, 280, 190, 100, 220)\ninsert into trades values(2022.01.01T09:00:00, `A, 31.2, 32.6, 33.6, 35.3, 34.5, 220, 160, 130, 100, 110)\ninsert into trades values(2022.01.01T09:00:00, `A, 30.2, 32.5, 33.6, 35.3, 34.1, 200, 180, 150, 140, 120)\ninsert into trades values(2022.01.01T09:00:00, `A, 33.2, 33.8, 33.6, 33.3, 33.1, 180, 160, 160, 180, 200)\n\nselect rowAt(matrix(p1, p2, p3, p4, p5), rowIminLast(vol1, vol2, vol3, vol4, vol5)) as price from trades\n/* output:\nprice\n33.6\n34.3\n35.3\n34.1\n33.6\n*/\n```\n\nRelated function: [rowlmin](https://docs.dolphindb.com/en/Functions/r/rowImin.html)\n"
    },
    "rowKurtosis": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowKurtosis.html",
        "signatures": [
            {
                "full": "rowKurtosis(X, [biased=true])",
                "name": "rowKurtosis",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [rowKurtosis](https://docs.dolphindb.com/en/Functions/r/rowKurtosis.html)\n\n\n\n#### Syntax\n\nrowKurtosis(X, \\[biased=true])\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nReturn the kurtosis of each row in *X*.\n\nThe calculation uses the following formula when *biased*=true:\n\n![](https://docs.dolphindb.com/en/images/kurtosisx.png)\n\n#### Parameters\n\n**biased** (optional) is a Boolean value, indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nm = [4.5 2.6 1.5 1.5 4.8, 5.9 4.9 2.0 4.0 6.3, 2 2 2 2 2, 2.1 3.4 4.2 5.5 2.3]\nrowKurtosis(m);\n// output: [1.336589711715856,1.839333299961742,2.248755164221374,1.437834622248661,1.341044189891083]\n\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL, 4.3 NULL 3.5]);\nrowKurtosis(m);\n// output: [2.270290894661423,1.499999999999941,1.499999999999972]\n\nt1=table(1..5 as x, 10..6 as y, 15..19 as z, take(3,5) as t);\nrowKurtosis(t1);\n// output: [1.417974225003112,1.676864,1.951167883478534,2.158698670898631,2.262015004030008]\n```\n\nRelated function: [kurtosis](https://docs.dolphindb.com/en/Functions/k/kurtosis.html)\n"
    },
    "rowMax": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowMax.html",
        "signatures": [
            {
                "full": "rowMax(args...)",
                "name": "rowMax",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowMax](https://docs.dolphindb.com/en/Functions/r/rowMax.html)\n\n\n\n#### Syntax\n\nrowMax(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the maximum value of each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowMax(m);\n// output: [4.9,4.8,5.9]\n\nt1=table(1..5 as x, 6..10 as y)\nt2=table(5..1 as a, 10..6 as b);\n\nrowMax(t1);\n// output: [6,7,8,9,10]\n\nrowMax(t1[`y], t2, take(8, 5));\n// output: [10,9,8,9,10]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2);\nselect sym,rowMax(price1,price2) as max from t;\n```\n\n| sym  | max    |\n| ---- | ------ |\n| AAPL | 175.23 |\n| MS   | 50.76  |\n| IBM  | 50.32  |\n| IBM  | 51.29  |\n| C    | 174.97 |\n\nRelated function: [max](https://docs.dolphindb.com/en/Functions/m/max.html)\n"
    },
    "rowMergeAndSort": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowmergeandsort.html",
        "signatures": [
            {
                "full": "rowMergeAndSort(sortVec, asc, args...)",
                "name": "rowMergeAndSort",
                "parameters": [
                    {
                        "full": "sortVec",
                        "name": "sortVec"
                    },
                    {
                        "full": "asc",
                        "name": "asc"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowMergeAndSort](https://docs.dolphindb.com/en/Functions/r/rowmergeandsort.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nrowMergeAndSort(sortVec, asc, args...)\n\n#### Details\n\nMerges multiple rows of array vectors or columnar tuples into a single row, and sorts the merged result.\n\nElements in sortVec and args are positionally correlated, and the merging and sorting of args are performed in synchronization with the order of sortVec.\n\n#### Parameters\n\n**sortVec** is an array vector or columnar tuple representing the column used for sorting after merging. *sortVec* can also be a tuple containing up to 2 columns of array vectors or columnar tuples.\n\n**asc** is a Boolean scalar or Boolean vector indicating whether the merged result is sorted in ascending order. The default value is true. If *sortVec* is a tuple, *asc* can be a Boolean vector with the same length as the number of columns in *sortVec* .\n\n**args...** (optional) can be array vectors or columnar tuples representing additional columns to be merged and reordered together with *sortVec* using the same sorting order.\n\n#### Returns\n\n* When *args* is specified, returns a tuple with the number of elements equal to the length of *args* plus 1, each element being a vector.\n\n* When *args* is not specified, returns a vector.\n\n#### Examples\n\nExample 1. Merge an array vector and sort elements in ascending order. The return value is a vector.\n\n```\naskPrices = array(INT[], 0, 10).append!([900 900 900 901 901, 800 800 802 802 802 803 803])\nrowMergeAndSort(askPrices, true)\n//output: ([800,800,802,802,802,803,803,900,900,900,901,901])\n```\n\nExample 2. Merge columnar tuples, with multiple sorting columns arranged in different orders: best ask prices in *askPrices* corresponds to different times, different order volumes, and different channels *srcs* . Now the data is merged and sorted in descending order of *askPrices* and ascending order of *quoteTimes* . The return value is a tuple.\n\n```\nsrcs = [`SRC1`SRC1`SRC3`SRC3`SRC3, `SRC3`SRC3`SRC1`SRC2`SRC3`SRC1`SRC2].setColumnarTuple!(true)\naskPrices = array(INT[], 0, 10).append!([900 900 900 901 901, 800 800 802 802 802 803 803])\nquoteTimes = array(SECOND[], 0, 10).append!([09:30:00 09:30:00 09:30:00 09:30:01 09:30:02, \n\t09:30:00 09:30:00 09:30:00 09:30:00 09:30:00 09:30:00 09:30:00])\naskVols = array(INT[], 0, 10).append!([10 15 20 15 20, 20 15 30 40 20 15 30])\nrowMergeAndSort([askPrices,quoteTimes], false true, srcs, askVols)\n/*\noutput: \n([901,901,900,900,900,803,803,802,802,802,800,800],\n[09:30:01,09:30:02,09:30:00,09:30:00,09:30:00,09:30:00,09:30:00,09:30:00,09:30:00,09:30:00,09:30:00,09:30:00],\n[\"SRC3\",\"SRC3\",\"SRC1\",\"SRC1\",\"SRC3\",\"SRC1\",\"SRC2\",\"SRC1\",\"SRC2\",\"SRC3\",\"SRC3\",\"SRC3\"],\n[15,20,10,15,20,15,30,30,40,20,20,15])\n*/\n```\n\n**Related Functions:** [rowFilterAndSort](https://docs.dolphindb.com/en/Functions/r/rowfilterandsort.html)\n"
    },
    "rowMin": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowMin.html",
        "signatures": [
            {
                "full": "rowMin(args...)",
                "name": "rowMin",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowMin](https://docs.dolphindb.com/en/Functions/r/rowMin.html)\n\n\n\n#### Syntax\n\nrowMin(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the minimum value of each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowMin(m);\n// output: [1.5,2,1.5]\n\nt1=table(1..5 as x, 6..10 as y)\nt2=table(5..1 as a, 10..6 as b);\n\nrowMin(t1);\n// output: [1,2,3,4,5]\n\nrowMin(t1[`x], t2, take(2, 5));\n// output: [1,2,2,2,1]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2);\nselect sym,rowMin(price1,price2) as min from t;\n```\n\n| sym  | min   |\n| ---- | ----- |\n| AAPL | 49.6  |\n| MS   | 29.46 |\n| IBM  | 29.52 |\n| IBM  | 30.02 |\n| C    | 26.23 |\n\nRelated function: [min](https://docs.dolphindb.com/en/Functions/m/min.html)\n"
    },
    "rowMove": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowMove.html",
        "signatures": [
            {
                "full": "rowMove(X, steps)",
                "name": "rowMove",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "steps",
                        "name": "steps"
                    }
                ]
            }
        ],
        "markdown": "### [rowMove](https://docs.dolphindb.com/en/Functions/r/rowMove.html)\n\n\n\n#### Syntax\n\nrowMove(X, steps)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nThe `rowMove` function shifts the elements in each row of *X* left or right by a specified number of steps.\n\n#### Parameters\n\n**steps** is an integer indicating the length to shift the row elements of *X*.\n\n* if *steps* is positive, the elements in each row are shifted to the right by *steps* position(s).\n\n* if *steps* is negative, the elements in each row are shifted to the left by *steps* position(s).\n\n* if *steps* is 0, *X* is not shifted.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowMove(m, 2)          \n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n|      |      | 4.5  |\n|      |      | 2.6  |\n|      |      | 1.5  |\n\n```\nrowMove(m, -2)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 4.9  |      |      |\n| 2    |      |      |\n|      |      |      |\n\n```\na=array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8]);\nrowMove(a, 2)\n// output: [[00i,00i,1],[00i,00i],[00i,00i,6]]\n\ntp = [[1.3,2.5,2.3], [4.1,5.3,6.2]]\ntp.setColumnarTuple!()\nrowMove(tp, -2)\n// output: [[2.3,00F,00F],[6.200000000000001,00F,00F]]\n```\n"
    },
    "rowNames": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowNames.html",
        "signatures": [
            {
                "full": "rowNames(X)",
                "name": "rowNames",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowNames](https://docs.dolphindb.com/en/Functions/r/rowNames.html)\n\n\n\n#### Syntax\n\nrowNames(X)\n\n#### Details\n\nReturn the row names of matrix *X*. Please check related function: [columnNames](https://docs.dolphindb.com/en/Functions/c/columnNames.html).\n\n#### Parameters\n\n**X** is a matrix.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nx=1..6$2:3;\nx\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nx.rename!(1 2, `a`b`c);\n```\n\n|   | a | b | c |\n| - | - | - | - |\n| 1 | 1 | 3 | 5 |\n| 2 | 2 | 4 | 6 |\n\n```\nrowNames x;\n// output: [1,2]\n```\n"
    },
    "rowNext": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowNext.html",
        "signatures": [
            {
                "full": "rowNext(X)",
                "name": "rowNext",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowNext](https://docs.dolphindb.com/en/Functions/r/rowNext.html)\n\n\n\n#### Syntax\n\nrowNext(X)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nFor each row in *X*, `rowNext` shifts the elements to the left for one position.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowNext(m)\n/* output:\ncol1        col2    col3\n1.5         4.9\n4.8     2\n5.9\n*/\n\na=array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8]);\nrowNext(a)\n// output: [[2,3,00i],[5,00i],[7,8,00i]]\n\ntp = [[1.3,2.5,2.3], [4.1,5.3,6.2]]\ntp.setColumnarTuple!()\nrowNext(tp)\n// output: [[2.5,2.3,00F],[5.3,6.2,00F]]\n```\n"
    },
    "rowNo": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowNo.html",
        "signatures": [
            {
                "full": "rowNo(X)",
                "name": "rowNo",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowNo](https://docs.dolphindb.com/en/Functions/r/rowNo.html)\n\n\n\n#### Syntax\n\nrowNo(X)\n\n#### Details\n\nReturn the index position of each row in a table.\n\n#### Parameters\n\n**X** is a vector.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nteam=1 1 1 1 1 2 2 2 2 2\nid=1..5 join 2..6\nx=11..20\\2\nt=table(team, id, x)\nt;\n```\n\n| team | id | x   |\n| ---- | -- | --- |\n| 1    | 1  | 5.5 |\n| 1    | 2  | 6   |\n| 1    | 3  | 6.5 |\n| 1    | 4  | 7   |\n| 1    | 5  | 7.5 |\n| 2    | 2  | 8   |\n| 2    | 3  | 8.5 |\n| 2    | 4  | 9   |\n| 2    | 5  | 9.5 |\n| 2    | 6  | 10  |\n\n```\nselect * from t where rowNo(id)%3=0;\n```\n\n| team | id | x   |\n| ---- | -- | --- |\n| 1    | 1  | 5.5 |\n| 1    | 4  | 7   |\n| 2    | 3  | 8.5 |\n| 2    | 6  | 10  |\n\n```\nupdate t set teamFirst=(rowNo(id)==0) context by team;\nt;\n```\n\n| team | id | x   | teamFirst |\n| ---- | -- | --- | --------- |\n| 1    | 1  | 5.5 | 1         |\n| 1    | 2  | 6   | 0         |\n| 1    | 3  | 6.5 | 0         |\n| 1    | 4  | 7   | 0         |\n| 1    | 5  | 7.5 | 0         |\n| 2    | 2  | 8   | 1         |\n| 2    | 3  | 8.5 | 0         |\n| 2    | 4  | 9   | 0         |\n| 2    | 5  | 9.5 | 0         |\n| 2    | 6  | 10  | 0         |\n"
    },
    "rowOr": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowOr.html",
        "signatures": [
            {
                "full": "rowOr(args...)",
                "name": "rowOr",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowOr](https://docs.dolphindb.com/en/Functions/r/rowOr.html)\n\n\n\n#### Syntax\n\nrowOr(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nFor each row (a vector is viewed as a one-column matrix here), return 1 if there are true elements in each row of the input; otherwise return 0.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([true false false, true true true, true true true])\nrowOr(m);\n// output: [1,1,1]\n\nt1=table(false true true true false as x, false true false true true as y)\nrowOr(t1);\n// output: [0,1,1,1,1]]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2)\nselect *  from t where rowOr(price1>30, price2>100);\n```\n\n| sym  | price1 | price2 |\n| ---- | ------ | ------ |\n| AAPL | 49.6   | 175.23 |\n| IBM  | 30.02  | 51.29  |\n| C    | 174.97 | 26.23  |\n\nRelated function: [or](https://docs.dolphindb.com/en/Programming/Operators/OperatorReferences/or.html)\n"
    },
    "rowPrev": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowPrev.html",
        "signatures": [
            {
                "full": "rowPrev(X)",
                "name": "rowPrev",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rowPrev](https://docs.dolphindb.com/en/Functions/r/rowPrev.html)\n\n\n\n#### Syntax\n\nrowPrev(X)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nFor each row in *X*, `rowPrev` shifts the elements to the right for one position.\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowPrev(m) \n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n|      | 4.5  | 1.5  |\n|      | 2.6  | 4.8  |\n|      | 1.5  | 5.9  |\n\n```\na=array(INT[], 0, 10).append!([1 2 3, 4 5, 6 7 8]);\nrowPrev(a)\n// output: [[00i,1,2],[00i,4],[00i,6,7]]\n\ntp = [[1.3,2.5,2.3], [4.1,5.3,6.2]]\ntp.setColumnarTuple!()\nrowPrev(tp)\n// output: [[00F,1.3,2.5],[00F,4.1,5.3]]\n```\n"
    },
    "rowProd": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowProd.html",
        "signatures": [
            {
                "full": "rowProd(args...)",
                "name": "rowProd",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowProd](https://docs.dolphindb.com/en/Functions/r/rowProd.html)\n\n\n\n#### Syntax\n\nrowProd(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the product of each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowProd(m);\n// output: [33.075,24.96,8.85]\n\nv1=1 0 2 -2 5\nv2=-8 1 2 4 2\nrowProd(v1, v2);\n// output: [-8,0,4,-8,10]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2)\nselect * from t where rowOr(price1>50, price2>50);\n```\n\n| sym  | price     |\n| ---- | --------- |\n| AAPL | 8691.408  |\n| MS   | 1495.3896 |\n| IBM  | 1485.4464 |\n| IBM  | 1539.7258 |\n| C    | 4589.4631 |\n\nRelated functions: [prod](https://docs.dolphindb.com/en/Functions/p/prod.html),\n"
    },
    "rowRank": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowRank.html",
        "signatures": [
            {
                "full": "rowRank(X, [ascending=true], [groupNum], [ignoreNA=true], [tiesMethod='min'], [percent=false], [precision])",
                "name": "rowRank",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[groupNum]",
                        "name": "groupNum",
                        "optional": true
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='min']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'min'"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[precision]",
                        "name": "precision",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [rowRank](https://docs.dolphindb.com/en/Functions/r/rowRank.html)\n\n\n\n#### Syntax\n\nrowRank(X, \\[ascending=true], \\[groupNum], \\[ignoreNA=true], \\[tiesMethod='min'], \\[percent=false], \\[precision])\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nConduct the following operation within each row of matrix *X*:\n\n* Return the position of each element in the sorted vector.\n* If *groupNum* is specified, group the elements into *groupNum* groups and return the group number each element belongs to.\n* If *ignoreNA* =true, null values return NULL.\n\nThe result is a matrix with the same shape as *X*.\n\n#### Parameters\n\n**X** is a matrix.\n\n**ascending** (optional) is a Boolean value indicating whether the sorting is in ascending order. The default value is true (ascending).\n\n**groupNum** (optional) is a positive integer indicating the number of groups to sort *X* into.\n\n**ignoreNA** (optional) is a Boolean value indicating whether null values are ignored.\n\n**tiesMethod** (optional) is a string indicating how to rank the group of elements with the same value (i.e., ties):\n\n* 'min' : the smallest rank value of the tie values.\n\n* 'max' : the largest rank value of the tie values.\n\n* 'average' : the average of the rank values for all ties.\n\n* 'first': Gives the first found tie value the lowest rank value, and continues with the following rank value for the next tie.\n\n**percent** (optional) is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n**precision** (optional) is an integer between \\[1, 15]. If the absolute difference between two values is no greater than 10^(-precision), the two values are considered to be equal.\n\n**Note:**\n\nIf parameter *precision* is specified, *X* must be numeric, and the *tiesMethod* cannot be specified as 'first'.\n\n#### Returns\n\nA matrix with the same dimensions as *X*.\n\n#### Examples\n\n```\nm=matrix(3 1 2 4 7 6 9 8 5, 9 NULL 2 3 5 6 3 2 8).transpose();\nm\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 |\n| -- | -- | -- | -- | -- | -- | -- | -- | -- |\n| 3  | 1  | 2  | 4  | 7  | 6  | 9  | 8  | 5  |\n| 9  |    | 2  | 3  | 5  | 6  | 3  | 2  | 8  |\n\n```\nm.rowRank();\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 |\n| -- | -- | -- | -- | -- | -- | -- | -- | -- |\n| 2  | 0  | 1  | 3  | 6  | 5  | 8  | 7  | 4  |\n| 7  |    | 0  | 2  | 4  | 5  | 2  | 0  | 6  |\n\n```\nm.rowRank(ascending=false);\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 |\n| -- | -- | -- | -- | -- | -- | -- | -- | -- |\n| 6  | 8  | 7  | 5  | 2  | 3  | 0  | 1  | 4  |\n| 0  |    | 6  | 4  | 3  | 2  | 4  | 6  | 1  |\n\nSpecify `percent=true` to return the ranking in fractional (percentage) form.\n\n```\nm.rowRank(percent=true)\n```\n\n| 0    | 1    | 2     | 3     | 4     | 5    | 6     | 7     | 8     |\n| ---- | ---- | ----- | ----- | ----- | ---- | ----- | ----- | ----- |\n| 0.33 | 0.11 | 0.22  | 0.44  | 0.77  | 0.67 | 1     | 0.89  | 0.56  |\n| 1    |      | 0.125 | 0.375 | 0.625 | 0.75 | 0.375 | 0.125 | 0.875 |\n\n```\nm.rowRank(groupNum=3);\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 |\n| -- | -- | -- | -- | -- | -- | -- | -- | -- |\n| 0  | 0  | 0  | 1  | 2  | 1  | 2  | 2  | 1  |\n| 2  |    | 0  | 0  | 1  | 1  | 0  | 0  | 2  |\n\n```\nm.rowRank(ignoreNA=false);\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 |\n| -- | -- | -- | -- | -- | -- | -- | -- | -- |\n| 2  | 0  | 1  | 3  | 6  | 5  | 8  | 7  | 4  |\n| 8  | 0  | 1  | 3  | 5  | 6  | 3  | 1  | 7  |\n\n```\nm.rowRank(ignoreNA=false, tiesMethod='max');\n```\n\n| #0 | #1 | #2 | #3 | #4 | #5 | #6 | #7 | #8 |\n| -- | -- | -- | -- | -- | -- | -- | -- | -- |\n| 2  | 0  | 1  | 3  | 6  | 5  | 8  | 7  | 4  |\n| 8  | 0  | 2  | 4  | 5  | 6  | 4  | 2  | 7  |\n\n```\nm.rowRank(ignoreNA=false, tiesMethod='first');\n```\n\n| col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 |\n| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |\n| 2    | 0    | 1    | 3    | 6    | 5    | 8    | 7    | 4    |\n| 8    | 0    | 1    | 3    | 5    | 6    | 4    | 2    | 7    |\n\nFor floating-point numbers, the comparison precision can be controlled using the *precision* parameter. When the absolute difference between two values is no greater than 10^(-precision), they are considered equal. In the example below, when the *precision* parameter is not specified, 1.000003 and 1.000004 are treated as unequal by default.\n\n```\nm = matrix(1.000001 1.000002 1.000003,   \n           2.000001 2.000002 2.000003,  \n           1.000001 1.000002 1.000004) \nrowRank(m);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 0    | 2    | 0    |\n| 0    | 2    | 0    |\n| 0    | 2    | 1    |\n\nAfter setting `precision = 4`, 1.000003 and 1.000004 are considered equal (both receive a rank of 0).\n\n```\nrowRank(m, precision=4)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 0    | 2    | 0    |\n| 0    | 2    | 0    |\n| 0    | 2    | 0    |\n\nRelated functions: [rowDenseRank](https://docs.dolphindb.com/en/Functions/r/rowDenseRank.html), [rank](https://docs.dolphindb.com/en/Functions/r/rank.html)\n"
    },
    "rows": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rows.html",
        "signatures": [
            {
                "full": "rows(X)",
                "name": "rows",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rows](https://docs.dolphindb.com/en/Functions/r/rows.html)\n\n\n\n#### Syntax\n\nrows(X)\n\n#### Details\n\nReturn the number of rows in *X*. Please check related function: [cols](https://docs.dolphindb.com/en/Functions/c/cols.html).\n\n#### Parameters\n\n**X** is of any data type in any data forms.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\ny=1 2 3;\nrows(y);\n// output: 3\n// a vector can be viewed as an n*1 matrix.\n\nx=1..6$2:3;\nX\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nrows X\n// output: 2\n\na=table(1..3 as x,`IBM`C`AAPL as y);\na\n```\n\n| x | y    |\n| - | ---- |\n| 1 | IBM  |\n| 2 | C    |\n| 3 | AAPL |\n\n```\n rows a;\n// output: 3\n```\n"
    },
    "rowSize": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowSize.html",
        "signatures": [
            {
                "full": "rowSize(args...)",
                "name": "rowSize",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowSize](https://docs.dolphindb.com/en/Functions/r/rowSize.html)\n\n\n\n#### Syntax\n\nrowSize(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the number of elements (null values included) of each row.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL]);\nrowSize(m);\n// output: [3,3,3]\n\nt1=table(1 NULL 3 NULL 5 as x, 6..10 as y);\nt2=table(5 NULL 3 NULL 1 as a, 10..6 as b);\nrowSize(t1);\n// output: [2,2,2,2,2]\n\nrowCount(t1[`x], t2, 1 NULL 2 NULL NULL);\n// output: [4,1,4,1,3]\n\nrowSize(t1[`x], t2, 1 NULL 2 NULL NULL);\n// output: [4,4,4,4,4]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, [49.6, NULL, 29.52, NULL, 174.97] as price1, [175.23, NULL, 50.32, 51.29, 26.23] as price2);\nselect sym,rowSize(price1,price2) as size from t;\n```\n\n| sym  | size |\n| ---- | ---- |\n| AAPL | 2    |\n| MS   | 2    |\n| IBM  | 2    |\n| IBM  | 2    |\n| C    | 2    |\n\nRelated functions: [rowCount](https://docs.dolphindb.com/en/Functions/r/rowCount.html), [size](https://docs.dolphindb.com/en/Functions/s/size.html)\n"
    },
    "rowSkew": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowSkew.html",
        "signatures": [
            {
                "full": "rowSkew(X, [biased=true])",
                "name": "rowSkew",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [rowSkew](https://docs.dolphindb.com/en/Functions/r/rowSkew.html)\n\n\n\n#### Syntax\n\nrowSkew(X, \\[biased=true])\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nReturn the skewness of each row in *X*.\n\nThe calculation uses the following formula when *biased*=true:\n\n![](https://docs.dolphindb.com/en/images/rowskewx.png)\n\n#### Parameters\n\n**biased** (optional) is a Boolean value, indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\nA DOUBLE vector.\n\n#### Examples\n\n```\nm = [4.5 2.6 1.5 1.5 4.8, 5.9 4.9 2.0 4.0 6.3, 2 2 2 2 2]\nrowSkew(m);\n// output: [-0.329206341655613,0.586870565935934,-0.707106781186563,0.595170064139497,-0.350377619697706]\n\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL, 4.3 NULL 3.5]);\nrowSkew(m);\n// output: [-1.064430070205901,0.577633692366209,0.110780117654846]\n\nt1=table(1..5 as x, 10..6 as y, take(3, 5) as z);\nrowSkew(t1);\n// output: [0.567316577993729,0.652012117044047,0.707106781186548,0.528004979218188,-0.381801774160629]\n```\n\nRelated function: [skew](https://docs.dolphindb.com/en/Functions/s/skew.html)\n"
    },
    "rowStd": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowStd.html",
        "signatures": [
            {
                "full": "rowStd(args...)",
                "name": "rowStd",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowStd](https://docs.dolphindb.com/en/Functions/r/rowStd.html)\n\n\n\n#### Syntax\n\nrowStd(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the (sample) standard deviation of each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowStd(m);\n// output: [1.858315,1.474223,3.11127]\n\nt1=table(1..5 as x, 10..6 as y, take(3, 5) as z)\nt2=table(5..1 as a, 6..10 as b, take(8, 5) as c);\n\nrowStd(t1);\n// output: [4.725816,3.785939,2.886751,2.081666,1.527525]\n\nrowStd(t1[`x], t2, 1 1 2 2 2);\n// output: [3.114482,3.04959,2.949576,3.316625,3.834058]\n\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2)\nselect sym,rowStd(price1,price2) as std from t;\n```\n\n| sym  | std        |\n| ---- | ---------- |\n| AAPL | 88.833825  |\n| MS   | 15.061374  |\n| IBM  | 14.707821  |\n| IBM  | 15.040161  |\n| C    | 105.175063 |\n\nRelated functions: [rowStdp](https://docs.dolphindb.com/en/Functions/r/rowStdp.html), [std](https://docs.dolphindb.com/en/Functions/s/std.html)\n"
    },
    "rowStdp": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowStdp.html",
        "signatures": [
            {
                "full": "rowStdp(args...)",
                "name": "rowStdp",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowStdp](https://docs.dolphindb.com/en/Functions/r/rowStdp.html)\n\n\n\n#### Syntax\n\nrowStdp(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the population standard deviation of each row.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowStdp(m);\n// output: [1.517307556898806,1.203698005684518,2.2]\n\nt1=table(1..5 as x, 10..6 as y, take(3, 5) as z)\nt2=table(5..1 as a, 6..10 as b, take(8, 5) as c);\nrowStdp(t1);\n// output: [3.858612300930075,3.091206165165235,2.357022603955159,1.699673171197595,1.247219128924648]\n\nrowStdp(t1[`x], t2, 1 1 2 2 2);\n// output: [2.785677655436824,2.727636339397171,2.638181191654584,2.966479394838265,3.42928563989645]\n\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2)\nselect sym,rowStdp(price1,price2) as stdp from t;\n```\n\n| sym  | stdp   |\n| ---- | ------ |\n| AAPL | 62.815 |\n| MS   | 10.65  |\n| IBM  | 10.4   |\n| IBM  | 10.635 |\n| C    | 74.37  |\n\nRelated functions: [rowStd](https://docs.dolphindb.com/en/Functions/r/rowStd.html), [std](https://docs.dolphindb.com/en/Functions/s/std.html)\n"
    },
    "rowSum": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowSum.html",
        "signatures": [
            {
                "full": "rowSum(args...)",
                "name": "rowSum",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowSum](https://docs.dolphindb.com/en/Functions/r/rowSum.html)\n\n\n\n#### Syntax\n\nrowSum(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the sum of each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL])\nrowSum(m);\n// output: [10.9,9.4,7.4]\n\nt1=table(1..5 as x, 6..10 as y)\nt2=table(5..1 as a, 10..6 as b);\n\nrowSum(t1);\n// output: [7,9,11,13,15]\n\nrowSum(t1[`x], t2, 1 1 2 2 2);\n// output: [17,16,16,15,14]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2)\nselect sym,rowSum(price1,price2) as priceSum from t;\n```\n\n| sym  | priceSum |\n| ---- | -------- |\n| AAPL | 224.83   |\n| MS   | 80.22    |\n| IBM  | 79.84    |\n| IBM  | 81.31    |\n| C    | 201.2    |\n\nRelated function: [sum](https://docs.dolphindb.com/en/Functions/s/sum.html)\n"
    },
    "rowSum2": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowSum2.html",
        "signatures": [
            {
                "full": "rowSum2(args...)",
                "name": "rowSum2",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowSum2](https://docs.dolphindb.com/en/Functions/r/rowSum2.html)\n\n\n\n#### Syntax\n\nrowSum2(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the sum of square of all elements in each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL]);\nrowSum2(m);\n// output: [46.51,33.8,37.06]\n\nt1=table(1..5 as x, 6..10 as y);\nt2=table(5..1 as a, 10..6 as b);\n\nrowSum2(t1);\n// output: [37,53,73,97,125]\n\nrowSum2(t1[`x], t2, 1 1 2 2 2);\n// output: [127,102,86,73,66]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2);\nselect sym,rowSum2(price1,price2) as price2Sum from t;\n```\n\n| sym  | priceSum |\n| ---- | -------- |\n| AAPL | 224.83   |\n| MS   | 80.22    |\n| IBM  | 79.84    |\n| IBM  | 81.31    |\n| C    | 201.2    |\n\nRelated function: [sum2](https://docs.dolphindb.com/en/Functions/s/sum2.html)\n"
    },
    "rowTanimoto": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowTanimoto.html",
        "signatures": [
            {
                "full": "rowTanimoto(X, Y)",
                "name": "rowTanimoto",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowTanimoto](https://docs.dolphindb.com/en/Functions/r/rowTanimoto.html)\n\n\n\n#### Syntax\n\nrowTanimoto(X, Y)\n\n#### Details\n\nIf both *X* and *Y* are vectors/matrices, calculate the tanimoto distance between *X* and *Y* by row. If both *X* and *Y* are indexed matrices, calculate the tanimoto distance between rows with the same label. For other rows, return NULL.\n\nFor a vector and a matrix, the length of the vector must be the same as the number of columns of the matrix. Calculate the tanimoto distance between the vector and each row of the matrix.\n\nIf *X* and *Y* are array vectors, calculate the tanimoto distance between the corresponding rows (vectors) in *X* and *Y*, i.e., tanimoto(X.row(i),Y.row(i)).\n\nFor a vector and an array vector, calculate the tanimoto distance between the vector and each vector in the array vector. Return NULL when *X* and *Y* are of different lengths.\n\nAs with all other aggregate functions, null values are ignored in the calculation.\n\n#### Parameters\n\n**X** and **Y** are numeric vectors/array vectors of the same length or matrices with the same dimension. If *X* and *Y* are array vectors, the vectors at the same position in *X* and *Y* must have the same length.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nrowTanimoto(3.6 5.2 6.3, 8.6 4.8 5.5)\n// output: [0.4467,0.0064,0.0181]\n\na=array(INT[],0,10)\na.append!([[1, 8, 9],[15, NULL], [25, 22, 13, 15]])\nb=array(INT[],0,10)\nb.append!([[11, 18, 6],[5, 9], [5, 2, 3, 1]])\nrowTanimoto(a,b)\n// output: [0.5,0.5714,0.8309]\n\ns1=indexedSeries(2020.01.01..2020.01.03, 10.4 11.2 9)\ns2=indexedSeries(2020.01.01 2020.01.03 2020.01.04, 23.5 31.2 26)\nrowTanimoto(s1,s2)\n// output: [0.4125,0.5337,0.5526]\n\nm=matrix(23 56 47, 112 94 59)\nm1=matrix(11 15 89, 52 41 63)\nrowTanimoto(m,m1)\n// output: [0.3812,0.4889,0.1839]\n\nm.rename!(2020.01.01..2020.01.03, `A`B)\nm.setIndexedMatrix!()\nm1.rename!(2020.01.01 2020.01.03 2020.01.04, `A`B)\nm1.setIndexedMatrix!()\nrowTanimoto(m,m1)\n// output: [0.3812,NULL,0.3014,NULL]\n```\n\nRelated function: [tanimoto](https://docs.dolphindb.com/en/Functions/t/tanimoto.html)\n"
    },
    "rowVar": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowVar.html",
        "signatures": [
            {
                "full": "rowVar(args...)",
                "name": "rowVar",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowVar](https://docs.dolphindb.com/en/Functions/r/rowVar.html)\n\n\n\n#### Syntax\n\nrowVar(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the (sample) variance of each row of the arguments.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL]);\nrowVar(m);\n// output: [3.453333,2.173333,9.68]\n\nt1=table(1..5 as x, 10..6 as y, take(3, 5) as z);\nt2=table(5..1 as a, 6..10 as b, take(8, 5) as c);\n\nrowVar(t1);\n// output: [22.333333,14.333333,8.333333,4.333333,2.333333]\n\nrowVar(t1[`x], t2, 1 1 2 2 2);\n// output: [9.7,9.3,8.7,11,14.7]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2);\nselect sym,rowVar(price1,price2) as var from t;\n```\n\n| sym  | var        |\n| ---- | ---------- |\n| AAPL | 7891.44845 |\n| MS   | 226.845    |\n| IBM  | 216.32     |\n| IBM  | 226.20645  |\n| C    | 11061.7938 |\n\nRelated functions: [rowVarp](https://docs.dolphindb.com/en/Functions/r/rowVarp.html), [varp](https://docs.dolphindb.com/en/Functions/v/varp.html)\n"
    },
    "rowVarp": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowVarp.html",
        "signatures": [
            {
                "full": "rowVarp(args...)",
                "name": "rowVarp",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowVarp](https://docs.dolphindb.com/en/Functions/r/rowVarp.html)\n\n\n\n#### Syntax\n\nrowVarp(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the population variance of each row.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([4.5 2.6 1.5, 1.5 4.8 5.9, 4.9 2.0 NULL]);\nrowVarp(m);\n// output: [2.302222222222225,1.448888888888887,4.84]\n\nt1=table(1..5 as x, 10..6 as y, take(3, 5) as z);\nt2=table(5..1 as a, 6..10 as b, take(8, 5) as c);\nrowVarp(t1);\n// output: [14.888888888888891,9.555555555555557,5.555555555555558,2.888888888888891,1.555555555555557]\n\nrowVarp(t1[`x], t2, 1 1 2 2 2);\n// output: [7.76,7.440000000000001,6.96,8.8,11.760000000000001]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2);\nselect sym,rowVarp(price1,price2) as varp from t;\n```\n\n| sym  | varp      |\n| ---- | --------- |\n| AAPL | 3945.7242 |\n| MS   | 113.4225  |\n| IBM  | 108.16    |\n| IBM  | 113.1032  |\n| C    | 5530.8969 |\n\nRelated functions: [rowVar](https://docs.dolphindb.com/en/Functions/r/rowVar.html), [varp](https://docs.dolphindb.com/en/Functions/v/varp.html)\n"
    },
    "rowWavg": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowWavg.html",
        "signatures": [
            {
                "full": "rowWavg(X, Y)",
                "name": "rowWavg",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowWavg](https://docs.dolphindb.com/en/Functions/r/rowWavg.html)\n\n\n\n#### Syntax\n\nrowWavg(X, Y)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the weighted average of *X* by row with *Y* as the weights and return a vector with the same number of rows of *X*.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm1=matrix(2 -1 4, 8 3 2, 9 0 1)\nm2=matrix(8 11 10, 8 17 4, 14 6 4)\nrowWavg(m1, m2)\n// output: [6.8667, 1.1765, 2.8889]\n\nm3=matrix(2 NULL 4, 8 NULL 2, 9 NULL NULL)\nrowWavg(m3, m2)\n// output: [6.8667, , 3.4286]\n\na= -10 12.3 -10 -8\nb= 17.9 9 7.5 -4\nc= 5.5 5.5 -7 8\n\nrowWavg(matrix(a, b, c), matrix(b, a, c))\n// output: [-24.459, 9.3899, 10.6316, -32]\n\nx=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[a, b, c\\]\\)\ny=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[b, a, c\\]\\)\nrowWavg\\(x, y\\)\n// output: \\[-3.6612, 7.0892, 14.4583\\]\n```\n\nRelated function: [wavg](https://docs.dolphindb.com/en/Functions/w/wavg.html)\n"
    },
    "rowWsum": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowWsum.html",
        "signatures": [
            {
                "full": "rowWsum(X, Y)",
                "name": "rowWsum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [rowWsum](https://docs.dolphindb.com/en/Functions/r/rowWsum.html)\n\n\n\n#### Syntax\n\nrowWsum(X, Y)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nCalculate the cumulative weighted sum of *X* by row with *Y* as the weights and return a vector with the same number of rows of *X*.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm1=matrix(2 -1 4, 8 3 2, 9 0 1)\nm2=matrix(8 11 10, 8 17 4, 14 6 4)\nrowWsum(m1, m2)\n// output: [206, 40, 52]\n\nm3=matrix(8 NULL 10, 8 NULL 4, 14 NULL NULL)\nrowWsum(m1, m3)\n// output: [206, , 48]\n\na= -10 12.3 4 -8\nb= 17.9 9 7.5 -4\nc= 5.5 6.4 -7 8\nx=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[a, b, c\\]\\)\ny=array\\(DOUBLE\\[\\],0, 10\\).append!\\(\\[b, a, c\\]\\)\n\nrowWsum\\(x, y\\)\n// output: \\[0.63, -6.3 , 184.21\\]\n```\n\nRelated function: [wsum](https://docs.dolphindb.com/en/Functions/w/wsum.html)\n"
    },
    "rowXor": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rowXor.html",
        "signatures": [
            {
                "full": "rowXor(args...)",
                "name": "rowXor",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [rowXor](https://docs.dolphindb.com/en/Functions/r/rowXor.html)\n\n\n\n#### Syntax\n\nrowXor(args...)\n\nPlease see [rowFunctions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html) for the parameters and calculation rules.\n\n#### Details\n\nFor each row, return 1 if odd number of columns are true; otherwise return 0.\n\n#### Returns\n\nA vector whose length is the same as the number of rows in the input arguments.\n\n#### Examples\n\n```\nm=matrix([true false false, true true true, true true true]);\nrowXor(m);\n// output: [1,0,0]\n\nt=table(true false false true false true as x, false true false true false true as y, false false true true false false as z);\nt;\n```\n\n| x | y | z |\n| - | - | - |\n| 1 | 0 | 0 |\n| 0 | 1 | 0 |\n| 0 | 0 | 1 |\n| 1 | 1 | 1 |\n| 0 | 0 | 0 |\n| 1 | 1 | 0 |\n\n```\nrowXor(t);\n// output: [1,1,1,1,0,0]\n\nt=table(`AAPL`MS`IBM`IBM`C as sym, 49.6 29.46 29.52 30.02 174.97 as price1, 175.23 50.76 50.32 51.29 26.23 as price2);\nselect * from t where rowXor(price1$ 30, price2$ 50);\n```\n\n| sym | price1 | price2 |\n| --- | ------ | ------ |\n| MS  | 29.46  | 50.76  |\n| IBM | 29.52  | 50.32  |\n| C   | 174.97 | 26.23  |\n\nRelated function: [xor](https://docs.dolphindb.com/en/Functions/x/xor.html)\n"
    },
    "rpad": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rpad.html",
        "signatures": [
            {
                "full": "rpad(str, length, [pattern])",
                "name": "rpad",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "length",
                        "name": "length"
                    },
                    {
                        "full": "[pattern]",
                        "name": "pattern",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [rpad](https://docs.dolphindb.com/en/Functions/r/rpad.html)\n\n\n\n#### Syntax\n\nrpad(str, length, \\[pattern])\n\n#### Details\n\nPad the right-side of a string with a specific set of characters.\n\n#### Parameters\n\n**str** is a string scalar or vector. It is the string to pad characters to (the right-hand side).\n\n**length** is a positive integer indicating the number of characters to return. If *length* is smaller than the length of *str*, the `rpad` function will truncate *str* to the size of length. If *length* exceeds **65,536**, the system automatically caps it at **65,536**.\n\n**pattern** (optional) is a string scalar. It is the string that will be padded to the right-hand side of str. If it is unspecified, the `rpad` function will pad spaces to the right-side of *str*.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nrpad(\"Hello\",2);\n// output: He\n\nrpad(`Hello, 10);\n// output: Hello\n\nrpad(`Hello, 12, `0);\n// output: Hello0000000\n```\n"
    },
    "rpc": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rpc.html",
        "signatures": [
            {
                "full": "rpc(nodeAlias, func, args, ...)",
                "name": "rpc",
                "parameters": [
                    {
                        "full": "nodeAlias",
                        "name": "nodeAlias"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args",
                        "name": "args"
                    },
                    {
                        "full": "...",
                        "name": "..."
                    }
                ]
            }
        ],
        "markdown": "### [rpc](https://docs.dolphindb.com/en/Functions/r/rpc.html)\n\n\n\n#### Syntax\n\nrpc(nodeAlias, func, args, ...)\n\n#### Details\n\nCall a local function on the specified remote node and return the result to the local node. The function can be either a built-in function or a user defined function on the local node. The system automatically serializes the function definition and the definitions of all dependent functions together with necessary local data to remote node.\n\nBoth the calling node and the remote node must be located in the same cluster. Otherwise, we need to use function [remoteRun](https://docs.dolphindb.com/en/Functions/r/remoteRun.html) .\n\nFor more details please refer to [Batch Job Management](https://docs.dolphindb.com/en/Maintenance/BatchJobManagement.html).\n\n#### Parameters\n\n**nodeAlias** is the alias of a remote node.\n\n**func** is a function. It must not be quoted. The function could be either a built-in function or a user-defined function on the local node.\n\n**args** are function arguments. It does not support dictionaries whose values are function definitions.\n\n#### Returns\n\nThe execution result of *func*.\n\n#### Examples\n\n* Remote call a user defined function:\n\n  ```\n  rpc(\"nodeA\", def(x,y):x+y, 10, 15)\n  ```\n\n* Remote call a partial application:\n\n  ```\n  rpc(\"nodeA\", getRecentJobs{10})\n  ```\n\n* Remote call a built-in function that quotes a user-defined function:\n\n  ```\n  def jobDemo(n){\n      s = 0\n      for (x in 1 : n) {\n         s += sum(sin rand(1.0, 100000000)-0.5)\n             print(\"iteration \" + x + \" \" + s)\n  }\n  return s\n  };\n  // the node \"DFS_NODE2\" is located in the same cluster as the local node.\n  rpc(\"DFS_NODE2\", submitJob, \"jobDemo3\", \"job demo\", jobDemo, 10);\n  // output: jobDemo3\n\n  rpc(\"DFS_NODE2\", getJobReturn, \"jobDemo3\")\n  // output: -3426.577521\n  ```\n"
    },
    "rshift": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rshift.html",
        "signatures": [
            {
                "full": "rshift(X, a)",
                "name": "rshift",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "a",
                        "name": "a"
                    }
                ]
            }
        ],
        "markdown": "### [rshift](https://docs.dolphindb.com/en/Functions/r/rshift.html)\n\n\n\n#### Syntax\n\nrshift(X, a) or X>>a\n\n#### Details\n\nShift bits to the right.\n\n#### Parameters\n\n**X** is an integral scalar/pair/vector/matrix.\n\n**a** is the number of bits to shift.\n\n#### Returns\n\nAn object with the same data form and type as *X*.\n\n#### Examples\n\n```\nrshift(2048, 2);\n// output: 512\n\n 1..10 >> 1;\n// output: [0,1,1,2,2,3,3,4,4,5]\n\n1:10>>1;\n// output: 0 : 5\n```\n\nRelated function: [lshift](https://docs.dolphindb.com/en/Functions/l/lshift.html)\n"
    },
    "rtrim": {
        "url": "https://docs.dolphindb.com/en/Functions/r/rtrim.html",
        "signatures": [
            {
                "full": "rtrim(X)",
                "name": "rtrim",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [rtrim](https://docs.dolphindb.com/en/Functions/r/rtrim.html)\n\n\n\n#### Syntax\n\nrtrim(X)\n\n#### Details\n\nTake a string of characters that has spaces at the end, and return the text without the spaces at the end.\n\n#### Parameters\n\n**X** is a string scalar or vector.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nrtrim(\"I love      \")+\" \"+ltrim(\"    this game!\");\n// output: I love this game!\n```\n"
    },
    "run": {
        "url": "https://docs.dolphindb.com/en/Functions/r/run.html",
        "signatures": [
            {
                "full": "run(scriptFile, [newSession=false], [clean=true])",
                "name": "run",
                "parameters": [
                    {
                        "full": "scriptFile",
                        "name": "scriptFile"
                    },
                    {
                        "full": "[newSession=false]",
                        "name": "newSession",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[clean=true]",
                        "name": "clean",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [run](https://docs.dolphindb.com/en/Functions/r/run.html)\n\n\n\n#### Syntax\n\nrun(scriptFile, \\[newSession=false], \\[clean=true])\n\n#### Details\n\nExecute a saved program. If *newSession* = false, the program runs in the current session. If *newSession* = true, the program file runs in a newly created session which will be closed after finish running the script.\n\n**Note**: It must be executed by a logged-in user. A non-administrator must meet the following conditions to execute the function: (1) Obtain the [SCRIPT\\_EXEC](https://docs.dolphindb.com/en/Functions/g/grant.html) privilege; (2) The configuration item [*strictPermissionMode*](https://docs.dolphindb.com/en/Database/Configuration/reference.html) should be set to false (default).\n\n#### Parameters\n\n**scriptFile** is the path of the script file.\n\n**newSession** indicates whether to create a new session to execute the script.\n\n**clean** indicates whether to clean the variables in the current session. The default value is true, meaning the variables will be cleaned after executing `run`.\n\n#### Examples\n\n```\nrun \"/home/DolphinDB/test.dos\";\n\nd = dict(STRING, ANY)\nd[\"TradePrice\"] = 1..1000\n// Set the clean parameter to false so that the variable d in the current session will not be cleaned\nrun(\"/home/DolphinDB/test.dos\", clean=false)\nparseExpr(\"avg(TradePrice)\",d).eval()\n# output\n500.5\n```\n"
    },
    "runExternalQuery": {
        "url": "https://docs.dolphindb.com/en/Functions/r/runexternalquery.html",
        "signatures": [
            {
                "full": "runExternalQuery(config, query, [preExecuteQueries])",
                "name": "runExternalQuery",
                "parameters": [
                    {
                        "full": "config",
                        "name": "config"
                    },
                    {
                        "full": "query",
                        "name": "query"
                    },
                    {
                        "full": "[preExecuteQueries]",
                        "name": "preExecuteQueries",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [runExternalQuery](https://docs.dolphindb.com/en/Functions/r/runexternalquery.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nrunExternalQuery(config, query, \\[preExecuteQueries])\n\n#### Details\n\nSends the specified SQL statement to a remote database, executes it there, and returns the execution result.\n\n**Note:**\n\n* Before calling this function, you must install and load the [ODBC plugin](https://docs.dolphindb.com/en/Plugins/odbc.html).\n* Supported remote databases include MySQL, PostgreSQL, SQL Server, ClickHouse, SQLite, Oracle, Hive, and GaussDB. It is also recommended to deploy the database on CentOS 7.\n\n#### Parameters\n\n**config**: A dictionary that specifies the parameters for connecting to the remote database. The key is \"connectionString\", and the value is an [ODBC connection string](https://docs.dolphindb.cn/en/Plugins/odbc.html#connect). Example: `config = dict([\"connectionString\"], [\"Dsn=MyOracleDB\"])`.\n\n**query**: A STRING scalar that specifies the SQL statement to be executed. The statement must conform to the SQL syntax of the remote database.\n\n**preExecuteQueries** (optional): A STRING vector. If certain SQL statements need to be executed before the SQL statement specified by *query*, set this parameter. The system executes the SQL statements in the order they appear in the vector, but no results are returned for these pre-executed statements.\n\n#### Returns\n\nAn in-memory table.\n\n#### Examples\n\n```\noracle_cfg = dict([\"connectionString\"], [\"Dsn=MyOracleDB\"])\n\nt1 = createExternalTable(\"t1\", \"oracle\", oracle_cfg)\n\nt2 = runExternalQuery(oracle_cfg, \"select * from t1 inner join t2 on t1.id = t2.id;\")\n\nt3 = select * from t1, t2, runExternalQuery(oracle_cfg, \"select * from t3;\") as t3;\n```\n\n**Related Function**: [createExternalTable](https://docs.dolphindb.com/en/Programming/SQLStatements/createExternalTable.html)\n"
    },
    "runScript": {
        "url": "https://docs.dolphindb.com/en/Functions/r/runScript.html",
        "signatures": [
            {
                "full": "runScript(script)",
                "name": "runScript",
                "parameters": [
                    {
                        "full": "script",
                        "name": "script"
                    }
                ]
            }
        ],
        "markdown": "### [runScript](https://docs.dolphindb.com/en/Functions/r/runScript.html)\n\n\n\n#### Syntax\n\nrunScript(script)\n\n#### Details\n\nLocally execute a script. It must be executed by a logged-in user.\n\n#### Parameters\n\n**Script** is a string indicating the script to be executed.\n\n#### Examples\n\n```\nt = table(1..100 as id,201..300 as val1)\nscript1 = 'dn = \"dfs://test\";if(existsDatabase(dn)){dropDatabase(dn)};db = database(dn,VALUE,1..10);pt = db.createPartitionedTable(t,`pt,`id).append!(t)'\nscript2 = 'select * from loadTable(\"dfs://test\",`pt)'\nrunScript(script1)\nrunScript(script2)\n```\n"
    },
    "runSQL": {
        "url": "https://docs.dolphindb.com/en/Functions/r/runsql.html",
        "signatures": [
            {
                "full": "runSQL(X, [sqlStd='ddb'], [variables])",
                "name": "runSQL",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[sqlStd='ddb']",
                        "name": "sqlStd",
                        "optional": true,
                        "default": "'ddb'"
                    },
                    {
                        "full": "[variables]",
                        "name": "variables",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [runSQL](https://docs.dolphindb.com/en/Functions/r/runsql.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nrunSQL(X, \\[sqlStd='ddb'], \\[variables])\n\n#### Details\n\nThe `runSQL` function parses and executes a script based on the specified context. It provides parameterized SQL support, allowing variables to be passed directly as parameters in SQL queries. This eliminates the need for manual string concatenation to construct SQL statements, significantly reducing the risk of SQL injection attacks and improving code maintainability.\n\n**Note**: When `runSQL` is called within a user-defined function, it cannot access the complete context. Hence, it is advisable to avoid calling `runSQL` within user-defined functions.\n\nOnly part of the functions or features of Oracle/MySQL are supported:\n\n<table id=\"table_jcg_tn5_c2c\"><thead><tr><th align=\"left\">\n\n**SQL Dialect**\n\n</th><th align=\"left\">\n\n**Features**\n\n</th><th align=\"left\">\n\n**Functions (case insensitive)**\n\n</th><th align=\"left\">\n\n**Syntax Reference**\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\nOracle\n\n</td><td align=\"left\">\n\nComment symbols: --, /\\*\\*/\n\nConcatenation operator:||\n\n</td><td align=\"left\">\n\nasciistr, concat, decode, instr, length, listagg, nvl, nvl2, rank, regexp\\_like, replace, to\\_char, to\\_date, to\\_number, trunc, wm\\_concat\n\nNote: to\\_char only accepts numeric, DATE, DATEHOUR, and DATETIME types.\n\n</td><td align=\"left\">\n\n[SQL Language Reference](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Functions.html#GUID-D079EFD3-C683-441F-977E-2C9503089982)\n\n</td></tr><tr><td align=\"left\">\n\nMySQL\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\nsysdate\n\n</td><td align=\"left\">\n\n[MySQL :: MySQL 8.0 Reference Manual :: 12 Functions and Operators](https://dev.mysql.com/doc/refman/8.0/en/functions.html)\n\n</td></tr></tbody>\n</table>**Note**: Scripts written in DolphinDB language can be correctly parsed in Oracle or MySQL mode.\n\n#### Parameters\n\n**X** is a string indicating the script to be executed. X does not support SQL DDL operations. When *sqlStd* is set to 'oracle' or 'mysql', SQL DML operations are not supported.\n\n**sqlStd** (optional) is a string that specifies the dialect for parsing. It can be ‘ddb' (default), ‘oracle’, or 'mysql’.\n\n**variables** (optional) is a dictionary for passing parameters dynamically. Keys are strings representing variable names (which can contain letters, numbers, and underscores, but must start with a letter), and values are the corresponding objects to bind to the variables.\n\n#### Returns\n\nThe query result of *X*.\n\n#### Examples\n\nExample 1: Parsing with DolphinDB syntax with *variables* specified\n\nSuppose we have the following order table t:\n\n```\nn=10\ncustomerId=\"DB00\"+string(1..5)\norderDate=2025.01.01..2025.01.10\nt=table(take(orderDate, n) as orderDate, 1..10 as orderId, take(customerId,n) as customerId, rand(1000,n) as volume)\n```\n\n| **orderDate** | **orderId** | **customerId** | **volume** |\n| ------------- | ----------- | -------------- | ---------- |\n| 2025.01.01    | 1           | DB001          | 435        |\n| 2025.01.02    | 2           | DB002          | 134        |\n| 2025.01.03    | 3           | DB003          | 483        |\n| 2025.01.04    | 4           | DB004          | 867        |\n| 2025.01.05    | 5           | DB005          | 708        |\n| 2025.01.06    | 6           | DB001          | 291        |\n| 2025.01.07    | 7           | DB002          | 663        |\n| 2025.01.08    | 8           | DB003          | 254        |\n| 2025.01.09    | 9           | DB004          | 386        |\n| 2025.01.10    | 10          | DB005          | 653        |\n\nWe want to query the orders of a specific customer (DB001) from the last 10 days (assuming the query date is 2025.01.14).\n\n```\nsql_script =\"SELECT orderId,customerId, orderDate, volume FROM t WHERE customerId==customer AND orderDate>=(date(now())- days)\"\nvariables={\"customer\":`DB001,\"days\": 10}\nre=runSQL(sql_script, , variables)\nprint(re)\n```\n\nOutput:\n\n| **orderId** | **customerId** | **orderDate** | **volume** |\n| ----------- | -------------- | ------------- | ---------- |\n| 6           | DB001          | 2025.01.06    | 291        |\n\nExample 2: Parsing with Oracle syntax\n\n```\nrunSQL(\"concat(CONCAT(`14`mysql, `22`oracle),`11`33)\", 'oracle')\n// output: [\"142211\",\"mysqloracle33\"]\n\nrunSQL(\"string(1 2 3) || string(4 5 6)\", 'oracle')\n// output: [\"14\",\"25\",\"36\"]\n\nrunSQL(\"TO_DATE('2023-05-18', 'YYYY-MM-DD')\",`oracle)\n// output: 2023.05.18\n```\n\nExample 3: Parsing with MySQL syntax\n\n```\nrunSQL(\"SYSDATE() + 1\", `mysql)\n// output: 2025.01.15\n```\n"
    },
    "accumulate": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/accumulate.html",
        "signatures": [
            {
                "full": "accumulate(func, X, [init], [assembleRule|consistent=false])",
                "name": "accumulate",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[init]",
                        "name": "init",
                        "optional": true
                    },
                    {
                        "full": "[assembleRule|consistent=false]",
                        "name": "[assembleRule|consistent=false]"
                    }
                ]
            }
        ],
        "markdown": "### [accumulate](https://docs.dolphindb.com/en/Functions/Templates/accumulate.html)\n\n\n\n#### Syntax\n\naccumulate(func, X, \\[init], \\[assembleRule|consistent=false])\n\n\\[init] \\<operator>:A X or func:A(\\[init], X), where  is not specified and the default value is used.\n\n\\[init] \\<operator>:AC X or func:AC(\\[init], X), where  is specified as C (for \"Consistent\") as an example.\n\n#### Parameters\n\n**func** is a function for iteration.\n\n**X** is data or iteration rule.\n\n**init** is the initial value to be passed to *func*.\n\n**assembleRule**(optional) indicates how the results of sub-tasks are merged into the final result. It accepts either an integer or a string, with the following options:\n\n* **0** (or \"D\"): The default value, which indicates the DolphinDB rule. This means the data type and form of the final result are determined by all sub results. If all sub results have the same data type and form, scalars will be combined into a vector, vectors into a matrix, matrices into a tuple, and dictionaries into a table. Otherwise, all sub results are combined into a tuple.\n\n* **1** (or \"C\"): The Consistent rule, which assumes all sub results match the type and form of the first sub result. This means the first sub result determines the data type and form of the final output. The system will attempt to convert any subsequent sub results that don't match the first sub result. If conversion fails, an exception is thrown. This rule should only be used when the sub results' types and forms are known to be consistent. This rule avoids having to cache and check each sub result individually, improving performance.\n\n* **2** (or \"U\"): The Tuple rule, which directly combines all sub results into a tuple without checking for consistency in their types or forms.\n\n* **3** (or \"K\"): The kdb+ rule. Like the DolphinDB rule, it checks all sub results to determine the final output. However, under the kdb+ rule, if any sub result is a vector, the final output will be a tuple. In contrast, under the DolphinDB rule, if all sub results are vectors of the same length, the final output will be a matrix. In all other cases, the output of the kdb+ rule is the same as the DolphinDB rule.\n\n**Note:**\n\n* Starting from version 2.00.15/3.00.3, the new *assembleRule* parameter has been introduced. This parameter not only incorporates all the functionality of the original *consistent* parameter but also offers additional options for combining results.\n\n  The *consistent* parameter is a boolean value that defaults to false, which is equivalent to setting *assembleRule*=\"D\". When set to true, it’s equivalent to *assembleRule*=\"C\". For backward compatibility, users can still use the *consistent* parameter. If both *assembleRule* and *consistent* are specified in the same operation, the value of *consistent* takes precedence.\n\n* *assembleRule*can also be specified after a function pattern symbol, represented by characters D/C/U/K (e.g., `sub:PU(X)`. If not specified, the default value D will be used.\n\n#### Details\n\nThe `accumulate` template applies *func* to *init* and *X* for accumulating iteration (i.e. the result of an iteration is passed forward to the next). Unlike the template `reduce` that returns only the last result, the template `accumulate` outputs result of each iteration.\n\n1. When *func* is a unary function, *X* can be a non-negative integer, a unary function or NULL. In all these cases, *init* must be specified.\n\n   The function first returns *init* as the initial value, then applies *func* iteratively until a certain condition specified in *X* is satisfied.\n\n   * If *X* is an integer, *func* iterates *X* times, outputting (*X*+1) elements. Note that when *X* is negative, it is treated as 0.\n\n   * If *X* is unspecified or NULL, the iteration continues until the next output is the same as the current one.\n\n   * If *X* is a unary function, it must return a Boolean value to determine the termination of iteration. The iteration continues until *X* returns false for the current output.\n\n2. When *func* is a binary function, *X* can be a vector, matrix or table.\n\n   The function first applies *func* to *init* and X\\[0], and then iterates over the current output and the next element in *X*. If *init* is unspecified, the first output is X\\[0].\n\n   `accumulate` is equivalent to the execution of the pseudo code below:\n\n   ```\n   result[0]=iif(init==NULL,X[0],<function>(init,X[0]));\n\n   for(i:1~size(X)-1){\n\n       result[i]=<function>(result[i-1], X[i]);\n\n   }\n\n   return result;\n   ```\n\n3. When *func* is a ternary function, *X* must be a tuple with 2 elements. The iteration rule is the same as that of a binary function.\n\n#### Examples\n\nExample 1. *func* is a unary function:\n\n```\n//define a unary function\ndef func1(x){\n    if(x<5){\n            return x*3\n    }\n    else{\n            return x+3\n    }\n}\n\n//when X is an integer, the size of the result is X + 1\naccumulate(func1, 5, 1)\n// output: [1,3,9,12,15,18]\n\n//X is a unary function \"condition\". As condition returns false during the 3rd iteration, the system stops iteration and outputs the results of the first two iterations.\ndef condition(x){\nreturn x<9\n}\naccumulate(func1, condition, 1)\n// output: [1,3,9]\n\n//when X is NULL or unspecified, define a UDF func2 for iteration.\ndef func2(x){\n    if(x<5){\n            return x*3\n    }\n    else{\n            return 6\n    }\n}\n\n//As the results of the 3rd and 4th iterations are the same, the function stops iteration and outputs the results of the first three iterations.\naccumulate(func2,NULL,1)\n// output: [1,3,9,6]\n```\n\nExample 2. When *func* is a binary function, `accumulate` on a vector:\n\n```\nx = 1 2 3;\naccumulate(add, 1 2 3);\n// output: [1,3,6]\n// equivalent to [1, 1+2, 3+3]\n\n1 +:A x;\n// output: [2,4,7]\n// equivalent to [1+1, 2+2, 4+3]\n\naccumulate(-, 2, x);\n// output: [1,-1,-4]\n// equivalent to [2-1, 1-2, -1-3]\n\naccumulate(mul, x);\n// output: [1,2,6]\n// equivalent to [1, 1*2, 2*3]\n\ndef facts(a) {return 1*:A 1..a;};\nfacts 5;\n// output: [1,2,6,24,120]\n// calculate cumulative factorization\n\ndef f1(a,b): a+log(b);\naccumulate(f1, 1..5, 0);\n// output: [0,0.693147,1.791759,3.178054,4.787492]\n// the example above calculates cumulative sum of log(1) to log(i)\n// note the result from the previous step will be given to the first parameter of the function.\n// 0+log(1)=0, 0+log(2)=0.693147, 0.693147+log(3)=1.791759, ......\n\naccumulate(f1, 1..5);\n// output: [1,1.693147,2.791759,4.178053,5.787491]\n// since the initial condition is ignored here, the data type of the first element of the input vector determines the date type of the result.\n```\n\n`accumulate` on a matrix:\n\n```\nx=1..12$3:4;\nx;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 1    | 4    | 7    | 10   |\n| 2    | 5    | 8    | 11   |\n| 3    | 6    | 9    | 12   |\n\n```\n+ :A x;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 1    | 5    | 12   | 22   |\n| 2    | 7    | 15   | 26   |\n| 3    | 9    | 18   | 30   |\n\nExample 3. When *func* is a ternary function:\n\n```\ndef fun3(x,y,z){\n  return x+y+z\n}\naccumulate(fun3,[[1,2,3],[10,10,10]],5)\n// output: [16,28,41]\n```\n\nExample 4. Compute a state column based on two flag columns.\n\nSuppose there is a table with two flag columns, flag1 and flag2. We want to construct a state column according to the following logic:\n\n* The initial value is 0;\n* When `state == 0` and `flag1 == 1`, switch the state to 1;\n* When `state == 1` and `flag2 == 1`, switch the state to 0;\n* Otherwise, keep the current state unchanged.\n\n```\nid = 1..10\nflag1 = [0, 1, 1, 0, 0, 0, 0, 0, 0, 0]\nflag2 = [0, 0, 0, 0, 0, 1, 1, 0, 0, 0]\nt = table(id, flag1, flag2)\n\ndef updateStateByFlags(state, f1, f2): iif(state==0 && f1==1, 1, iif(state==1 && f2==1, 0, state))\n\nselect *, \n    accumulate(updateStateByFlags, [flag1, flag2], 0) as state\nfrom t\n```\n\n| id | flag1 | flag2 | state |\n| -- | ----- | ----- | ----- |\n| 1  | 0     | 0     | 0     |\n| 2  | 1     | 0     | 1     |\n| 3  | 1     | 0     | 1     |\n| 4  | 0     | 0     | 1     |\n| 5  | 0     | 0     | 1     |\n| 6  | 0     | 1     | 0     |\n| 7  | 0     | 1     | 0     |\n| 8  | 0     | 0     | 0     |\n| 9  | 0     | 0     | 0     |\n| 10 | 0     | 0     | 0     |\n"
    },
    "aggrTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/aggrTopN.html",
        "signatures": [
            {
                "full": "aggrTopN(func, funcArgs, sortingCol, top, [ascending=true])",
                "name": "aggrTopN",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "sortingCol",
                        "name": "sortingCol"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [aggrTopN](https://docs.dolphindb.com/en/Functions/Templates/aggrTopN.html)\n\n\n\n#### Syntax\n\naggrTopN(func, funcArgs, sortingCol, top, \\[ascending=true])\n\n#### Parameters\n\n**func** is an aggregate function.\n\n**funcArgs** are the parameters of *func*. It can be a scalar or vector. It is a tuple if there are more than 1 parameter of *func*.\n\n**sortingCol** is a numeric/temporal vector, based on which *funcArgs* are sorted.\n\n**top** is an integer or floating-point number.\n\n* If it is an integer, select the first *top* rows of records for calculation.\n\n* If it is a floating-point number, the value should be less than 1.0 to indicate a percentage. The function will select *top* of the rows in *funcArgs* for calculation. If the result is less than 1, select the first row. If the result is not an integer, it is rounded down and at least one row is selected.\n\n**ascending** is a Boolean value indicating whether to sort the *sortingCol* in ascending order. It is an optional parameter and the default value is true.\n\n#### Details\n\nAfter sorting *funcArgs* based on *sortingCol*, `aggrTopN` applies *func* to the first *top* elements in *funcArgs*. Null values in *sortingCol* are treated as the minimum value.\n\n#### Examples\n\n**Example 1**Calculate the average of price corresponding to the top 3 records with the largest volume.\n\n```\nprice = 10.0 20.0 30.0 40.0 50.0\nvolume = 5 2 5 1 4\naggrTopN(func=avg, funcArgs=price, sortingCol=volume, top=3, ascending=false)\n// output: 30\n```\n\n**Example 2**Calculate the correlation between price and volume for the top 3 records with the largest volume. In this case, *func* is a binary aggregation function, and *funcArgs* should be passed as a tuple.\n\n```\nvolume = 2 3 4 5 3\nprice = 10.0 20.0 30.0 40.0 50.0\naggrTopN(func=corr, funcArgs=(volume, price), sortingCol=2 3 4 5 3, top=3, ascending=true)\n// output: 0.69338\n```\n\n**Example 3**\n\nCalculate the average of price corresponding to the top N records with the largest volume. Here, N can be specified either directly as an integer (`top = N`) or as a proportion (`top = N / size`).\n\n```\nprice = 10 20 30 40 50\nvolume = 1 2 3 4 5\n\n// top=3 (integer): take the first 3 rows\naggrTopN(func=avg, funcArgs=price, sortingCol=volume, top=3)\n// take [10, 20, 30], output: 20\n\n// top=0.6 (float): take the first floor(5*0.6)=3 rows\naggrTopN(func=avg, funcArgs=price, sortingCol=volume, top=0.6)\n// take [10, 20, 30], output: 20\n\n// top=0.5 (float): take the first floor(5*0.5)=2 rows (rounded down)\naggrTopN(func=avg, funcArgs=price, sortingCol=volume, top=0.5)\n// take [10, 20], output: 15\n\n// top=0.01 (float): 5*0.01=0.05, floor to 0, but at least 1 row is selected\naggrTopN(func=sum, funcArgs=price, sortingCol=volume, top=0.01)\n// take [10], output: 10\n```\n\n**Example 4**\n\nFor each stock on each day, calculate the average of the value corresponding to the smallest 40% of the factor.\n\n```\ntrade_date=sort(take(2017.01.11..2017.01.12,20))\nsecu_code=take(`600570`600000,20)\nvalue=1..20\ntb=table(trade_date,secu_code,value)  \n```\n\n| trade\\_date | secu\\_code | value |\n| ----------- | ---------- | ----- |\n| 2017.01.11  | 600570     | 1     |\n| 2017.01.11  | 600000     | 2     |\n| 2017.01.11  | 600570     | 3     |\n| 2017.01.11  | 600000     | 4     |\n| 2017.01.11  | 600570     | 5     |\n| 2017.01.11  | 600000     | 6     |\n| 2017.01.11  | 600570     | 7     |\n| 2017.01.11  | 600000     | 8     |\n| 2017.01.11  | 600570     | 9     |\n| 2017.01.11  | 600000     | 10    |\n| 2017.01.12  | 600570     | 11    |\n| 2017.01.12  | 600000     | 12    |\n| 2017.01.12  | 600570     | 13    |\n| 2017.01.12  | 600000     | 14    |\n| 2017.01.12  | 600570     | 15    |\n| 2017.01.12  | 600000     | 16    |\n| 2017.01.12  | 600570     | 17    |\n| 2017.01.12  | 600000     | 18    |\n| 2017.01.12  | 600570     | 19    |\n| 2017.01.12  | 600000     | 20    |\n\n```\nselect aggrTopN(avg, funcArgs=value, sortingCol=value, top=0.4, ascending=true) as factor_value from tb group by trade_date,secu_code\n```\n\n| trade\\_date | secu\\_code | factor\\_value |\n| ----------- | ---------- | ------------- |\n| 2017.01.11  | 600000     | 3             |\n| 2017.01.11  | 600570     | 2             |\n| 2017.01.12  | 600000     | 13            |\n| 2017.01.12  | 600570     | 12            |\n"
    },
    "byColumn": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/byColumn.html",
        "signatures": [
            {
                "full": "byColumn(func, X, [Y])",
                "name": "byColumn",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            },
            {
                "full": "func:V(X)",
                "name": "func:V",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            },
            {
                "full": "func:V(X, [Y])",
                "name": "func:V",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [byColumn](https://docs.dolphindb.com/en/Functions/Templates/byColumn.html)\n\n\n\n#### Syntax\n\nbyColumn(func, X, \\[Y])\n\nOr\n\nfunc:V(X)\n\nOr\n\nfunc:V(X, \\[Y])\n\n#### Parameters\n\n**func** is a unary function. When function with multiple parameters is specified for *func*, partial application is used to fix part of the parameters. It can be a vector function (where the input vector and output vector are of equal length) or an aggregate function.\n\n**X** is a matrix/table/tuple/array vector/columnar tuple.\n\n**Y** is a matrix/table/tuple/array vector/columnar tuple.\n\n#### Details\n\nApplies the specified function to each column of the matrix *X*.\n\nIf *func* is a unary function, apply the specified function to each column of *X*; if *func* is a binary function, apply func(Xi, Yi) to each column of *X* and *Y*.\n\n`byColumn` can be used in a reactive state engine.\n\n**Calculation rules**:\n\n* If *X*/*Y* is a matrix, table, or tuple, `byColumn` applies *func* to each column of *X*/*Y*.\n\n* If *X*/*Y* is an array vector or columnar tuple, `byRow` applies *func* to each row of the transpose of *X*/*Y*.\n\n  * If *func* is a vector function, `byColumn` returns the transpose of the result.\n\n  * If *func* is an aggregate function, `byColumn` directly returns a vector. Certain aggregate functions in DolphinDB are optimized to work natively by column, requiring no transpose of the input *X*/*Y*. These include: sum, sum2, avg, min, max, count, imax, imin, imaxLast, iminLast, prod, std, stdp, var, varp, skew, kurtosis, any, all, corr, covar, wavg, wsum, beta, euclidean, dot, tanimoto.\n\n**Return values**:\n\n* If *func* is an aggregate function\n\n  * If *X*/*Y* is a matrix, array vector, or columnar tuple, `byColumn` returns a vector of the same size as the number of columns in *X*/*Y*.\n\n  * If *X*/*Y* is a tuple, `byColumn` returns a tuple.\n\n  * If *X*/*Y* is a table, `byColumn` returns a table.\n\n* If *func* is a vector function, `byColumn` returns a result with the same form and dimension as *X*/*Y*.\n\n#### Examples\n\nWhen *func* is a unary function that does not support matrix operations, the `byColumn` function is equivalent to `each`.\n\n```\ndef myvfunc(x): var(x).log()\nm = matrix(1.1 2.3 2.1 3.5 4.2, 3.3 2.5 4.2 5.1 0, -1 3.3 2 1.7 2.3)\nbyColumn(myvfunc, m)\n// output: [0.3974329364109,1.334211281249665,0.945072533299607]\n```\n\nTo specify a function with multiple parameters for *func*:\n\n```\nbyColumn(add{2}, m)\n/* output:\ncol1 col2 col3\n3.1  5.3  1\n4.3  4.5  5.3\n4.1  6.2  4\n5.5  7.1  3.7\n6.2  2    4.3\n*/\n\nbyColumn(add{1 2 3 4 5}, m)\n/* output:\ncol1 col2 col3\n2.1  4.3  0\n4.3  4.5  5.3\n5.1  7.2  5\n7.5  9.1  5.7\n9.2  5    7.3\n*/\n```\n\nWhen *func* is a user-defined function:\n\n```\ndef my_func(x){\nreturn iif(x > 0, 1, -1)\n}\nm = matrix(3 -6 5 0, 2 -9 -4 5)\nbyColumn(my_func, m)\n/* output:\ncol1 col2\n1    1\n-1   -1\n1    -1\n-1    1\n*/\n```\n\nWhen *func* is a nested function:\n\n```\nm = matrix(1 5 3 , 7 5 2)\nbyColumn(accumulate{def (x, y):iif(x > 5, y-1, y+1), ,1}, m)\n/* output:\ncol1 col2\n2    8\n6    4\n2    3\n*/\n```\n\nIf *func* is a multivariate function, it is necessary to fix part of the parameters using partial application.\n\n```\nbyColumn(autocorr{,2},m)\n// output: [-0.05,-0.28,-0.06]\n```\n\n*X*/*Y* is a matrix.\n\n```\nm=matrix([1 3 4 2,1 2 2 1])\nmax:V(m)\n// output: [4,2]\n\ncummax:V(m)\n/* output:\ncol1\tcol2\n1\t1\n3\t2\n4\t2\n4\t2\n*/\n\nn=matrix([11 5 9 2,8 5 3 2])\ncorr:V(m,n)\n// output: [-0.09,-0.21]\n```\n\n*X*/*Y* is a table.\n\n```\nqty1 = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nqty2 = 2100 1800  6800 5400 1300 2400 8500 4100 3200\nt = table(qty1, qty2);\nmax:V(t) \n/* output:\nqty1\tqty2\n8,800\t8,500\n*/\n\ncummax:V(t) \n/* output:\nqty1\tqty2\n2,200\t2,100\n2,200\t2,100\n2,200\t6,800\n3,200\t6,800\n6,800\t6,800\n6,800\t6,800\n6,800\t8,500\n6,800\t8,500\n8,800\t8,500\n*/\n\nqty3 = 7800 5400 5300 2500 1800 2200 3900 3100 1200\nqty4 = 3200 2800 6400 8300 2300 3800 2900 1600 2900\nt1 = table(qty3, qty4);\ncorr:V(t,t1)   \n/* output:\nqty1\tqty2\n-0.7267\t0.4088\n*/\n```\n\n*X*/*Y* is a tuple.\n\n```\ntp=[1 3 4 2,1 2 2 1]\nsum:V(tp)  \n// output: (10,6) \n\ncummax:V(tp) \n// output: ([1,3,4,4],[1,2,2,2]) \n\ntp1=[11 23 14 21,10 12 32 21]\ncorr:V(tp,tp1)\n// output: (0.25,0.37)\n```\n\n*X*/*Y* is an array vector.\n\n```\na=array(INT[], 0, 10).append!([1 2 3, 4 5 4, 6 7 8, 1 9 10]);\nsum:V(a) \n// output: [12,23,25] \n\ncummax:V(a)\n// output: [[1,2,3],[4,5,4],[6,7,8],[6,9,10]]\n\nb=array(DOUBLE[], 0, 10).append!([11.8 21.2 23.9, 83.3 90.2 78.2, 86.5 52 36.5, 10.1 12.4 16.8])\ncorr:V(a,b)  \n// output: [0.95,-0.13,-0.46]\n```\n\n*X*/*Y* is a columnar tuple.\n\n```\nctp=[1 3 4 2,1 2 2 1]\nctp.setColumnarTuple!()\nsum:V(ctp) \n// output: [2,5,6,3]\n\ncummax:V(ctp)\n// output: ([1,3,4,2],[1,3,4,2])\n\nctp1=[11 23 14 21,10 12 32 21]\nctp1.setColumnarTuple!()\ncorr:V(ctp,ctp1) \n// output: [,1,-1,]\n```\n\nRelated function: [byRow](https://docs.dolphindb.com/en/Functions/Templates/byRow.html)\n"
    },
    "byRow": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/byRow.html",
        "signatures": [
            {
                "full": "byRow(func, X, [Y])",
                "name": "byRow",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            },
            {
                "full": "func:H(X)",
                "name": "func:H",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            },
            {
                "full": "func:H(X, [Y])",
                "name": "func:H",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [byRow](https://docs.dolphindb.com/en/Functions/Templates/byRow.html)\n\n\n\n#### Syntax\n\nbyRow(func, X, \\[Y])\n\nOr\n\nfunc:H(X)\n\nOr\n\nfunc:H(X, \\[Y])\n\n#### Parameters\n\n**func** is either a vector function (both input and output are vectors of equal length) or an aggregate function.\n\n**X** is a matrix/table/tuple/array vector/columnar tuple.\n\n**Y** is a matrix/table/tuple/array vector/columnar tuple.\n\nFor the arguments and calculation rules of other row-based functions, refer to [Row-Based Functions](https://docs.dolphindb.com/en/Functions/Themes/rowFunctions.html).\n\n#### Details\n\nApply the specified function to each row of a matrix.\n\nIf *func* is a unary function, apply the specified function to each row of *X*; if *func* is a binary function, apply func(Xi, Yi) to each row of *X* and *Y*.\n\n**Note**: Since version 2.00.11, `byRow` can achieve the roles of row-based functions with equivalent performance and can be applied to all row-based scenarios. For example, `byRow(sum, X)` is equivalent to `rowSum(X)`.\n\n**Calculation rules**:\n\n* If *X*/*Y* is a matrix, table, or tuple, `byRow` applies *func* to each column of the transpose of *X*/*Y*.\n\n  * If *func* is a vector function, `byRow` returns the transpose of the result of *func*.\n\n  * If *func* is an aggregate function, `byRow` directly returns a vector. Certain aggregate functions in DolphinDB are optimized to work natively by row, requiring no transpose of the input *X*/*Y*. These include: sum, sum2, avg, min, max, count, imax, imin, imaxLast, iminLast, prod, std, stdp, var, varp, skew, kurtosis, any, all, corr, covar, wavg, wsum, beta, euclidean, dot, tanimoto.\n\n* If *X*/*Y* is an array vector or columnar tuple, `byRow` applies *func* to each row of *X*/*Y*.\n\n**Return Value**:\n\n* If *func* is an aggregate function, `byRow` returns a vector of the same size as the number of rows in *X*/*Y*.\n\n* If *func* is a vector function, `byRow` returns a result with the same form and dimension as *X*/*Y*.\n\n#### Examples\n\n*X*/*Y* is a matrix.\n\n```\nm=matrix([1 3 4 2,1 2 2 1])\nmax:H(m)\n// output: [1,3,4,2]\n\ncummax:H(m) \n/* output:\ncol1\tcol2\n1\t1\n3\t3\n4\t4\n2\t2\n*/\n\nn=matrix([11 5 9 2,8 5 3 2])\ncorr:H(m,n)\n// output: [,,1,]\n```\n\n*X*/*Y* is a table.\n\n```\nqty1 = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nqty2 = 2100 1800  6800 5400 1300 2400 8500 4100 3200\nt = table(qty1, qty2);\nmax:H(t) \n// output: [2200,1900,6800,5400,6800,5400,8500,4100,8800]\n\ncummax:H(t) \n/* output:\nqty1\tqty2\n2,200\t2,200\n1,900\t1,900\n2,100\t6,800\n3,200\t5,400\n6,800\t6,800\n5,400\t5,400\n1,300\t8,500\n2,500\t4,100\n8,800\t8,800\n*/\n\nqty3 = 7800 5400 5300 2500 1800 2200 3900 3100 1200\nqty4 = 3200 2800 6400 8300 2300 3800 2900 1600 2900\nt1 = table(qty3, qty4);\ncorr:H(t,t1)   \n// output: [1,1,1,1,-1,-1,-1,-1,-1]\n```\n\n*X*/*Y* is a tuple.\n\n```\ntp=[1 3 4 2,1 2 2 1]\nsum:H(tp)  \n// output: [2,5,6,3] \n\ncummax:H(tp) \n// output: ([1,3,4,2],[1,3,4,2]) \n\ntp1=[11 23 14 21,10 12 32 21]\ncorr:H(tp,tp1) \n// output: [,1,-1,]\n```\n\n*X*/*Y* is an array vector.\n\n```\na=array(INT[], 0, 10).append!([1 2 3, 4 5 4, 6 7 8, 1 9 10]);\nsum:H(a) \n// output: [6,13,21,20] \n\ncummax:H(a)\n// output: [[1,2,3],[4,5,5],[6,7,8],[1,9,10]]\n\nb=array(DOUBLE[], 0, 10).append!([11.8 21.2 23.9, 83.3 90.2 78.2, 86.5 52 36.5, 10.1 12.4 16.8])\ncorr:H(a,b)  \n// output: [0.95,0.90,-0.97,0.82]\n```\n\n*X*/*Y* is a columnar tuple.\n\n```\nctp=[1 3 4 2,1 2 2 1]\nctp.setColumnarTuple!()\nsum:H(ctp)  \n// output: [10,6]\n\ncummax:H(ctp)\n// output: ([1,3,4,4],[1,2,2,2])\n\nctp1=[11 23 14 21,10 12 32 21]\nctp1.setColumnarTuple!()\n\ncorr:H(ctp,ctp1)\n// output: [0.25, 0.37]\n```\n\n```\nm=matrix(1 1, 2 3, 2 1);\nm;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 2    | 2    |\n| 1    | 3    | 1    |\n\n```\nbyRow(add{10 20 30},m);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 11   | 22   | 32   |\n| 11   | 23   | 31   |\n\n```\nbyRow(mode,m);\n// output: [2,1]\n```\n\n```\nb=array(DOUBLE[], 0, 10).append!([11.8 21.2 23.9, 83.3 90.2 78.2 86.5, 10.1 12.4 16.8])\nbyRow(add{100},b)\n// output: [111.8 121.2 123.9,183.3 190.2 178.2 86.5,110.1 112.4 116.8]\n\nbyRow(imax,b)\n// output: [2,1,2]\n```\n\nRelated function: [byColumn](https://docs.dolphindb.com/en/Functions/Templates/byColumn.html)\n"
    },
    "call": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/call.html",
        "signatures": [
            {
                "full": "call(func, args...)",
                "name": "call",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [call](https://docs.dolphindb.com/en/Functions/Templates/call.html)\n\n\n\n#### Syntax\n\ncall(func, args...)\n\n#### Parameters\n\n**func** is a function.\n\n**args** are the required parameters of *func*.\n\n#### Details\n\nCall a function with the specified parameters. It is often used with function [each](https://docs.dolphindb.com/en/Functions/Templates/each.html)/[peach](https://docs.dolphindb.com/en/Functions/Templates/peach.html) or [loop](https://docs.dolphindb.com/en/Functions/Templates/loop.html)/[ploop](https://docs.dolphindb.com/en/Functions/Templates/ploop.html) to call multiple functions.\n\n#### Examples\n\n```\ncall(sum, 1..10);\n// output: 55\n// equivalent to sum(1..10)\n\neach(call, [avg, sum], [0..10, 0..100]);\n// output: [5,5050]\n\neach(call{, 1..3},(sin,log));\n// note that call{, 1..3} is a partial application.\n```\n\n| sin      | log      |\n| -------- | -------- |\n| 0.841471 | 0        |\n| 0.909297 | 0.693147 |\n| 0.14112  | 1.098612 |\n\n**Related Function:** [nothrowCall](https://docs.dolphindb.com/en/Functions/Templates/nothrowcall.html)\n"
    },
    "contextby": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/contextby.html",
        "signatures": [
            {
                "full": "contextby(func, funcArgs, groupingCol, [sortingCol], [semanticFilter=1], [containArgsOfHighOrderFunc=false])",
                "name": "contextby",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "groupingCol",
                        "name": "groupingCol"
                    },
                    {
                        "full": "[sortingCol]",
                        "name": "sortingCol",
                        "optional": true
                    },
                    {
                        "full": "[semanticFilter=1]",
                        "name": "semanticFilter",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[containArgsOfHighOrderFunc=false]",
                        "name": "containArgsOfHighOrderFunc",
                        "optional": true,
                        "default": "false"
                    }
                ]
            },
            {
                "full": "func:X(funcArgs, groupingCol, [sortingCol], [semanticFilter=1])",
                "name": "func:X",
                "parameters": [
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "groupingCol",
                        "name": "groupingCol"
                    },
                    {
                        "full": "[sortingCol]",
                        "name": "sortingCol",
                        "optional": true
                    },
                    {
                        "full": "[semanticFilter=1]",
                        "name": "semanticFilter",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [contextby](https://docs.dolphindb.com/en/Functions/Templates/contextby.html)\n\n\n\n#### Syntax\n\ncontextby(func, funcArgs, groupingCol, \\[sortingCol], \\[semanticFilter=1], \\[containArgsOfHighOrderFunc=false])\n\nor\n\nfuncArg func:X groupingCol\n\nor\n\nfunc:X(funcArgs, groupingCol, \\[sortingCol], \\[semanticFilter=1])\n\n#### Details\n\nCalculates `func(funcArgs)` for each *groupingCol* group. The result is a vector of the same size as each of the input arguments other than *func*. If *func* is an aggregate function, all elements within the same group have identical result. We can use *sortingCol* to sort the within-group data before the calculation.\n\nNote: The keyword `defg` must be used to declare an aggregate function.\n\n#### Parameters\n\n**func** is a function. For the second use case, *func* can only have one parameter (*funcArg*).\n\n**funcArgs** are the parameters of *func*. It is a tuple if there are more than 1 parameter of *func*. When it is a tuple, its elements must be vectors, matrices, or tables of the same length.\n\n**groupingCol** is the grouping variable(s). It can be one or multiple vectors.\n\n**sortingCol** is an optional argument for within group sorting before applying *func*.\n\n**semanticFilter** (optional) is a positive integer indicating which columns to include in calculations when *funcArgs* is a table. The possible values are:\n\n* 0 - All columns\n* 1 (default) - Columns of FLOATING, INTEGRAL, and DECIMAL categories, excluding the COMPRESSED data type.\n* 2 - Columns of TEMPORAL category.\n* 3 - Columns of LITERAL category, excluding the BLOB data type.\n* 4 - Columns of FLOATING, INTEGRAL, DECIMAL, and TEMPORAL categories, excluding the COMPRESSED data type.\n\nThe vectors in *groupingCol*, *sortingCol* and each of the function argument in *funcArgs* all have the same size.\n\n**containArgsOfHighOrderFunc** (optional) is a BOOL scalar. When *funcArgs* is a tuple and some of its elements are also tuples, if set to true, each element of the nested tuples in *funcArgs* will be processed separately; if set to false (default), the nested tuples in *funcArgs* will be processed as a whole (vector) without expanding the nested structure.\n\n#### Examples\n\nExample 1: Define four vectors sym, price, qty, and trade\\_date, representing stock symbols, stock prices, trading volumes, and trading dates, respectively. Use `contextby` to perform grouped computation.\n\n```\nsym=`IBM`IBM`IBM`MS`MS`MS\nprice=172.12 170.32 175.25 26.46 31.45 29.43\nqty=5800 700 9000 6300 2100 5300\ntrade_date=2013.05.08 2013.05.06 2013.05.07 2013.05.08 2013.05.06 2013.05.07;\n```\n\nGroup by stock symbol and compute the average stock price within each group.\n\n```\ncontextby(avg, price, sym);\n// Equivalent to: price avg :X sym;\n// Output: [172.563,172.563,172.563,29.113,29.113,29.113]\n```\n\nSelect all stock prices that are higher than the average price of their respective stock.\n\n```\nprice at price>contextby(avg, price,sym);\n// Output: [175.25,31.45,29.43]\n```\n\nSelect the stock symbols whose prices are higher than the average price of their respective stock.\n\n```\nsym at price>contextby(avg, price,sym);\n// Output: [\"IBM\",\"MS\",\"MS\"]\n```\n\nGroup by stock symbol and compute the weighted average price within each group, using trading volume as the weight.\n\n```\ncontextby(wavg, [price, qty], sym);\n// Output: [173.856,173.856,173.856,28.374,28.374,28.374]\n```\n\nGroup by stock symbol and compute the daily price change rate relative to the previous day within each group’s time series. In the example below, *sortingCol*=trade\\_date ensures that the data in each stock group is sorted in ascending order by *trade\\_date* before computing the price change rate.\n\n```\ncontextby(ratios, price, sym, trade_date) - 1;\n// Output: [-0.01786,,0.028946,-0.100917,,-0.064229]\n```\n\nExample 2: Specify *groupingCol* as multiple vectors to perform a two-level grouping by stock symbol and trading date. Compute the cumulative trading volume for each stock on each trading day.\n\n```\nsym=`IBM`IBM`IBM`IBM`IBM`IBM`MS`MS`MS`MS`MS`MS\ndate=2020.12.01 + 0 0 0 1 1 1 0 0 0 1 1 1\nqty=5800 700 9000 1000 3500 3900 6300 2100 5300 7800 1200 4300\ncontextby(cumsum, qty, [sym,date]);\n// Output: [5800,6500,15500,1000,4500,8400,6300,8400,13700,7800,9000,13300]\n```\n\nExample 3: When *funcArgs* is a table, *semanticFilter* controls which columns are included in the computation. This example demonstrates:\n\n* *semanticFilter*=1: compute only on numeric columns;\n* *semanticFilter*=2: compute only on time columns.\n\n```\ndailyOps = table(\n    [2024.06.01, 2024.06.01, 2024.06.02, 2024.06.02] as bizDate,\n    [2024.06.01T20:00:00.000, 2024.06.01T20:05:00.000, 2024.06.02T20:00:00.000, 2024.06.02T20:05:00.000] as snapshotTime,\n    `East`East`South`South as region,\n    [\"store_101\",\"store_102\",\"store_201\",\"store_202\"] as storeId,\n    [23500.5, 19880.0, 30210.3, 28760.4] as salesAmt,\n    [128, 103, 156, 149] as orderCount\n)\ndailyOps;\n```\n\nThe original data of dailyOps is as follows::\n\n| bizDate    | snapshotTime            | region | storeId    | salesAmt | orderCount |\n| ---------- | ----------------------- | ------ | ---------- | -------- | ---------- |\n| 2024.06.01 | 2024.06.01 20:00:00.000 | East   | store\\_101 | 23500.5  | 128        |\n| 2024.06.01 | 2024.06.01 20:05:00.000 | East   | store\\_102 | 19880    | 103        |\n| 2024.06.02 | 2024.06.02 20:00:00.000 | South  | store\\_201 | 30210.3  | 156        |\n| 2024.06.02 | 2024.06.02 20:05:00.000 | South  | store\\_202 | 28760.4  | 149        |\n\nSet *semanticFilter*=1 to add 100 to the two numeric columns, salesAmt and orderCount, while keeping the other columns unchanged.\n\n```\ncontextby(add{,100}, dailyOps, dailyOps.region,,1)\n```\n\nOutput:\n\n| bizDate    | snapshotTime            | region | storeId    | salesAmt | orderCount |\n| ---------- | ----------------------- | ------ | ---------- | -------- | ---------- |\n| 2024.06.01 | 2024.06.01 20:00:00.000 | East   | store\\_101 | 23600.5  | 228        |\n| 2024.06.01 | 2024.06.01 20:05:00.000 | East   | store\\_102 | 19980    | 203        |\n| 2024.06.02 | 2024.06.02 20:00:00.000 | South  | store\\_201 | 30310.3  | 256        |\n| 2024.06.02 | 2024.06.02 20:05:00.000 | South  | store\\_202 | 28860.4  | 249        |\n\nSet *semanticFilter*=2 to add 1 day to the two time columns, bizDate and snapshotTime, while keeping the other columns unchanged.\n\n```\ncontextby(temporalAdd{,1d}, dailyOps, dailyOps.region,,2)\n```\n\nOutput:\n\n| bizDate    | snapshotTime            | region | storeId    | salesAmt | orderCount |\n| ---------- | ----------------------- | ------ | ---------- | -------- | ---------- |\n| 2024.06.02 | 2024.06.02 20:00:00.000 | East   | store\\_101 | 23500.5  | 128        |\n| 2024.06.02 | 2024.06.02 20:05:00.000 | East   | store\\_102 | 19880.0  | 103        |\n| 2024.06.03 | 2024.06.03 20:00:00.000 | South  | store\\_201 | 30210.3  | 156        |\n| 2024.06.03 | 2024.06.03 20:05:00.000 | South  | store\\_202 | 28760.4  | 149        |\n\nExample 4: Use `contextby` in SQL queries.\n\n```\nsym=`IBM`IBM`IBM`MS`MS`MS\nprice=172.12 170.32 175.25 26.46 31.45 29.43\nqty=5800 700 9000 6300 2100 5300\ntrade_date=2013.05.08 2013.05.06 2013.05.07 2013.05.08 2013.05.06 2013.05.07;\nt1=table(trade_date,sym,qty,price);\nt1;\n```\n\n| trade\\_date | sym | qty  | price  |\n| ----------- | --- | ---- | ------ |\n| 2013.05.08  | IBM | 5800 | 172.12 |\n| 2013.05.06  | IBM | 700  | 170.32 |\n| 2013.05.07  | IBM | 9000 | 175.25 |\n| 2013.05.08  | MS  | 6300 | 26.46  |\n| 2013.05.06  | MS  | 2100 | 31.45  |\n| 2013.05.07  | MS  | 5300 | 29.43  |\n\nSelect the trading records where the stock price is higher than the group’s average price.\n\n```\nselect trade_date, sym, qty, price from t1 where price > contextby(avg, price,sym);\n```\n\n| trade\\_date | sym | qty  | price  |\n| ----------- | --- | ---- | ------ |\n| 2013.05.07  | IBM | 9000 | 175.25 |\n| 2013.05.06  | MS  | 2100 | 31.45  |\n| 2013.05.07  | MS  | 5300 | 29.43  |\n\nAdd one day to all trading dates.\n\n```\ncontextby(temporalAdd{,1d}, t1, t1.sym,,2)\n```\n\n| trade\\_date | sym | qty   | price  |\n| ----------- | --- | ----- | ------ |\n| 2013.05.09  | IBM | 5,800 | 172.12 |\n| 2013.05.07  | IBM | 700   | 170.32 |\n| 2013.05.08  | IBM | 9,000 | 175.25 |\n| 2013.05.09  | MS  | 6,300 | 26.46  |\n| 2013.05.07  | MS  | 2,100 | 31.45  |\n| 2013.05.08  | MS  | 5,300 | 29.43  |\n\nExample 5: When *funcArgs* is a tuple:\n\n```\nsym=`IBM`IBM`IBM`MS`MS`MS\nprice=172.12 170.32 175.25 26.46 31.45 29.43\nqty=5800 700 9000 6300 2100 5300\ntrade_date=2013.05.08 2013.05.06 2013.05.07 2013.05.08 2013.05.06 2013.05.07;\nt = table(sym, price, qty, trade_date)\nt = select * from t order by trade_date\ndefg avgUdf(price, qty){\n    return avg(price*qty)/sum(qty)\n}\ndefg avgUdf1(price){\n    return avg(price)\n}\n// Normal\nselect contextby(func=tmoving{avgUdf1,,,3d}, funcArgs=(trade_date, price) , groupingCol=sym) from t;\n\n// Normal\nselect contextby(func=tmoving{avgUdf,,,3d}, funcArgs=(trade_date,(price, qty) ), groupingCol=sym, containArgsOfHighOrderFunc=true) from t;\n```\n\n`(trade_date, (price, qty))` is a tuple containing two elements:\n\n* The first element is trade\\_date, representing the trading date column, which is a vector.\n* The second element is (price, qty), which is itself a tuple containing two elements. If *containArgsOfHighOrderFunc*=false, (price, qty) is treated as a single unit (i.e., as one vector).\n"
    },
    "cross": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/cross.html",
        "signatures": [
            {
                "full": "cross(func, X, [Y])",
                "name": "cross",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            },
            {
                "full": "func:C(X, [Y])",
                "name": "func:C",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [cross](https://docs.dolphindb.com/en/Functions/Templates/cross.html)\n\n\n\n#### Syntax\n\ncross(func, X, \\[Y])\n\nor\n\nX \\<operator>:C Y\n\nor\n\nfunc:C(X, \\[Y])\n\n#### Parameters\n\n**func** is a binary function.\n\n**X** and **Y** can be pair/vector/matrix. They can have different data forms and sizes.\n\n**Y** is optional. If *Y* is not specified, perform `cross(func, X, X)` where *func* must be a symmetric binary function, such as [corr](https://docs.dolphindb.com/en/Functions/c/corr.html) .\n\n#### Details\n\nApply *func* to the permutation of all individual elements of *X* and *Y* and return a matrix.\n\nAssume *X* has m elements and *Y* has n elements. The template returns an m (rows) by n (columns) matrix. Below is the pseudo code for the `cross` template.\n\n```\nfor(i:0~(size(X)-1)){\nfor(j:0~(size(Y)-1)){\n  result[i,j]=<function>(X[i], Y[j]);\n}\n}\nreturn result;\n```\n\nIf *X* and *Y* are matrices, the iteration is over the columns of *X* and *Y* .\n\nIf the result of `func(X[i], Y[j])` is a scalar, the result of the `cross` template is a matrix.\n\nIf the result of `func(X[i], Y[j])` is a vector, the result of the `cross` template is a tuple with m elements. Each of the element is a tuple with n elements.\n\n**Note:** Despite the identical name, DolphinDB's `cross` is different from NumPy's [numpy.cross](https://numpy.org/doc/stable/reference/generated/numpy.cross.html). DolphinDB's `cross` applies a specified function to all element combinations of two parameters, while `numpy.cross` computes the cross product of two vectors.\n\n#### Examples\n\n`cross` with two vectors:\n\n```\nx=1 2;\ny=3 5 7;\nx+:C y;\n```\n\n| lable | 3 | 5 | 7 |\n| ----- | - | - | - |\n| 1     | 4 | 6 | 8 |\n| 2     | 5 | 7 | 9 |\n\n```\ncross(mul, x, y);\n```\n\n| lable | 3 | 5  | 7  |\n| ----- | - | -- | -- |\n| 1     | 3 | 5  | 7  |\n| 2     | 6 | 10 | 14 |\n\n```\ncross(pow, x, y);\n```\n\n| lable | 3 | 5  | 7   |\n| ----- | - | -- | --- |\n| 1     | 1 | 1  | 1   |\n| 2     | 8 | 32 | 128 |\n\n`cross` with two matrices:\n\n```\nm = 1..6$2:3;\nm;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 3    | 5    |\n| 2    | 4    | 6    |\n\n```\nn=1..4$2:2;\nn;\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 3    |\n| 2    | 4    |\n\n```\ncross(**, m, n);\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 5    | 11   |\n| 11   | 25   |\n| 17   | 39   |\n\n`cross` with a vector and a matrix:\n\n```\ndef topsum(x,n){return sum x[0:n]};\na=1..18$6:3;\na;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 7    | 13   |\n| 2    | 8    | 14   |\n| 3    | 9    | 15   |\n| 4    | 10   | 16   |\n| 5    | 11   | 17   |\n| 6    | 12   | 18   |\n\n```\nb=2 4;\na topsum :C b;\n```\n\n| 2  | 4  |\n| -- | -- |\n| 3  | 10 |\n| 15 | 34 |\n| 27 | 58 |\n\n`cross` with tuple type results:\n\n```\nx=1 2\ny=1..6$2:3\ncross(add, x, y);\n// output: (([2,3],[4,5],[6,7]),([3,4],[5,6],[7,8]))\n\nx=1 2\ny=1..6$3:2\ncross(add, x, y);\n// output: (([2,3,4],[5,6,7]),([3,4,5],[6,7,8]))\n```\n"
    },
    "each": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/each.html",
        "signatures": [
            {
                "full": "each(func, args...)",
                "name": "each",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            },
            {
                "full": "func:E(args...)",
                "name": "func:E",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [each](https://docs.dolphindb.com/en/Functions/Templates/each.html)\n\n#### Syntax\n\neach(func, args...) (apply a function to each element of the specified parameters)\n\nor\n\nF :E X (apply a function to each element of X)\n\nor\n\nX < operator > :E Y (apply an operator to each element of X and Y)\n\nor\n\nfunc:E(args...)\n\n#### Parameters\n\n**func** is a function.\n\n**args** are the required parameters of *func*.\n\n**operator** is a binary operator.\n\n**X** / **Y** can be pair/vector/matrix/table/array vector/dictionary. *X* and *Y* must have the same dimensions.\n\n#### Details\n\nApply a function (specified by *func* or *operator*) to each element of *args* / *X* / *Y*.\n\n* For matrices, calculate in each column;\n\n* For tables, calculate in each row;\n\n* For array vectors, calculate in each row;\n\n* For dictionaries, calculate each value.\n\nThe data type and form of the return value are determined by each calculation result. It returns a vector or matrix if all calculation results have the same data type and form, otherwise it returns a tuple.\n\nThe difference between `func(X)` and `func :E X` is that the former treats *X* as the one input variable while the later takes each element in *X* as an input variable. If *func* is a vector function, avoid using `:E` since element-wise operations are very slow with a large number of elements.\n\n#### Examples\n\nSuppose we need to calculate the daily compensation for 3 workers. Their working hours are stored in vector x=\\[9,6,8]. Their hourly rate is $10 under 8 hours and $20 beyond 8 hours. Consider the following function `wage`:\n\n```\nx=[9,6,8]\ndef wage(x){if(x<=8) return 10*x; else return 20*x-80}\nwage x;\n// output: The vector can't be converted to bool scalar.\n```\n\n*wage(x)* does not return a result, as x<=8, i.e., \\[9,6,8]<=8 returns a vector of conditions \\[0,1,1], not a scalar condition that is required by `if`.\n\nIn contrast, consider the following solutions:\n\n```\neach(wage, x);\n// output: [100,60,80]\n\nwage :E x;\n// output: [100,60,80]\n\ndef wage2(x){return iif(x<=8, 10*x, 20*x-80)};\n// the iif function is an element-wise conditional operation\n\nwage2(x);\n// output: [100,60,80]\n```\n\nSimilarly, `each` can also be applied to a function with more than one parameter.\n\n```\ndef addeven(x,y){if (x%2==0) return x+y; else return 0}\nx1=1 2 3\nx2=4 5 6;\neach(addeven, x1, x2);\n// output: [0,7,0]\n```\n\n`each` with a tuple:\n\n```\nt = table(1 2 3 as id, 4 5 6 as value, `IBM`MSFT`GOOG as name);\nt;\n```\n\n| id | value | name |\n| -- | ----- | ---- |\n| 1  | 4     | IBM  |\n| 2  | 5     | MSFT |\n| 3  | 6     | GOOG |\n\n```\neach(max, t[`id`value]);\n// output: [3,6]\n```\n\n`each` with matrices:\n\n```\nm=1..12$4:3;\nm;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 5    | 9    |\n| 2    | 6    | 10   |\n| 3    | 7    | 11   |\n| 4    | 8    | 12   |\n\n```\neach(add{1 2 3 4}, m);\n// add{1 2 3 4} is a partial application, which adds [1, 2, 3, 4] to each of the 3 columns\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 2    | 6    | 10   |\n| 4    | 8    | 12   |\n| 6    | 10   | 14   |\n| 8    | 12   | 16   |\n\n```\nx=1..6$2:3;\ny=6..1$2:3;\nx;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 3    | 5    |\n| 2    | 4    | 6    |\n\n```\ny;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 6    | 4    | 2    |\n| 5    | 3    | 1    |\n\n```\neach(**, x, y);\n// output: [16,24,16]\n// e.g., 24=3*4+4*3\n```\n\nWhen there are multiple objects passed in as *args / X / Y*, the function takes the element at the same position from each object as arguments for each calculation.\n\n```\nm1 = matrix(1 3 6, 4 6 8, 5 -1 3)\nm2 = matrix(3 -6 0, 2 NULL 3, 6 7 9)\neach(corr, m1, m2)\n// equal to corr(m1[0], m2[0]) join corr(m1[1], m2[1]) join corr(m1[2], m2[2])\n// output: [-0.216777, 1, -0.142857]\n```\n\n*each* supports dictionary:\n\n```\nd=dict(`a`b`c, [[1, 2, 3],[4, 5, 6], [7, 8, 9]])\neach(sum, d)\n/* output:\nb->15\nc->24\na->6\n*/\n```\n\nWhen *func* is a user-defined function that operates on dictionaries whose keys are STRINGs, the *each* template combines each dictionary and outputs a table following these rules:\n\n* The table schema is only determined by the first dictionary whose values are appended to the first row, and keys are treated as column names. The number of keys is the number of columns.\n\n* Iterate through the remaining dictionary and append each dictionary value as a new row in the table. Specifically:\n\n  * When a dictionary key matches a column name, append the corresponding value to that column.\n\n  * For any extra keys in the dictionary that don't match columns, discard those values.\n\n  * For any extra column names without matching keys, fill in missing values as NULL.\n\n```\ndays = 2023.01.01..2023.01.10\ndef mf(day) {  \n    out = dict(STRING, ANY)\n    if(day==2023.01.05){\n        out[\"v\"] = 3\n    }\n    else{\n        out[\"day\"] = day\n        out[\"v\"] = 1\n    }\n    return out\n}\neach(mf, days)\n/* output:\nv   day\n1   2023.01.01\n1   2023.01.02\n1   2023.01.03\n1   2023.01.04\n3\n1   2023.01.06\n1   2023.01.07\n1   2023.01.08\n1   2023.01.09\n1   2023.01.10\n*/\n```\n\nSince version 2.00.12/3.00.0, when *args* contain a dictionary, the `each` function can be applied to a function with more than one arguments with the dictionary as the first argument.\n\nFor example, for each value of column \"id\", use function `sumbars` to calculate the cumulative sum in the backward direction until the value is no smaller than 3. For each value of column \"id2\", calculate the cumulative sum in the backward direction until the value is no smaller than 5. Since `sumbars` is applied to each column with a different *Y* (3 and 5, respectively), a binary function must be used with `each`. The first parameter is a dictionary converted by function `transpose`, with column names as keys and column values as values. Function `sumbars` will be applied to each value of keys \"id\" and \"id2\". Subsequently, the result is converted back into a table format using the `transpose` function.\n\n```\nt = table(1..10 as id, 2..11 as id2)\nsumbars:E(t.transpose(), 3 5).transpose()\n```\n\n| id | id2 |\n| -- | --- |\n| 0  | 0   |\n| 2  | 2   |\n| 1  | 2   |\n| 1  | 1   |\n| 1  | 1   |\n| 1  | 1   |\n| 1  | 1   |\n| 1  | 1   |\n| 1  | 1   |\n| 1  | 1   |\n\nIn the example below, we use the function `call` in a partial application that applies each of `[sin, log]` to vector 1..3\n\n```\n// when \"functionName\" is empty, it will be filled with function names dynamically.\neach(call{, 1..3},(sin,log));\n```\n\n| sin      | log      |\n| -------- | -------- |\n| 0.841471 | 0        |\n| 0.909297 | 0.693147 |\n| 0.14112  | 1.098612 |\n\n#### Performance Tips\n\n* Template `peach` is recommended for tasks that take a long time to execute.\n\n  ```\n  m=rand(1,20000:5000)\n  timer f=peach(mskew{,8},m)\n  // Time elapsed: 3134.71 ms\n\n  timer f=mskew(m,8)\n  // Time elapsed: 8810.485 ms\n  ```\n\n* Template `:E (each)` is not recommended when there is a large number of elements. In those scenarios we should look for more efficient vector solutions.\n\n  ```\n  x=rand(16, 1000000);\n  timer(10){each(wage, x)};\n  // Time elapsed: 38164.9 ms\n\n  timer(10){iif(x<8,10*x,20*x-80)};\n  // Time elapsed: 81.516 ms\n  ```\n\n"
    },
    "eachLeft": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/eachLeft.html",
        "signatures": [
            {
                "full": "eachLeft(func, X, Y, [assembleRule|consistent=false])",
                "name": "eachLeft",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[assembleRule|consistent=false]",
                        "name": "[assembleRule|consistent=false]"
                    }
                ]
            },
            {
                "full": "func:L(X, Y)",
                "name": "func:L",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            },
            {
                "full": "func:LC(X, Y)",
                "name": "func:LC",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [eachLeft](https://docs.dolphindb.com/en/Functions/Templates/eachLeft.html)\n\n\n\n#### Syntax\n\neachLeft(func, X, Y, \\[assembleRule|consistent=false])\n\nfunc:L(X, Y) or X \\<operator>:L Y, where  is not specified and the default value is used.\n\nfunc:LC(X, Y) or X \\<operator>:LC Y, where  is specified as C (for \"Consistent\") as an example.\n\n#### Parameters\n\n**func** is a binary function.\n\n**X**/ **Y** is a vector/matrix/table/array vector/dictionary.\n\n**assembleRule**(optional) indicates how the results of sub-tasks are merged into the final result. It accepts either an integer or a string, with the following options:\n\n* **0** (or \"D\"): The default value, which indicates the DolphinDB rule. This means the data type and form of the final result are determined by all sub results. If all sub results have the same data type and form, scalars will be combined into a vector, vectors into a matrix, matrices into a tuple, and dictionaries into a table. Otherwise, all sub results are combined into a tuple.\n\n* **1** (or \"C\"): The Consistent rule, which assumes all sub results match the type and form of the first sub result. This means the first sub result determines the data type and form of the final output. The system will attempt to convert any subsequent sub results that don't match the first sub result. If conversion fails, an exception is thrown. This rule should only be used when the sub results' types and forms are known to be consistent. This rule avoids having to cache and check each sub result individually, improving performance.\n\n* **2** (or \"U\"): The Tuple rule, which directly combines all sub results into a tuple without checking for consistency in their types or forms.\n\n* **3** (or \"K\"): The kdb+ rule. Like the DolphinDB rule, it checks all sub results to determine the final output. However, under the kdb+ rule, if any sub result is a vector, the final output will be a tuple. In contrast, under the DolphinDB rule, if all sub results are vectors of the same length, the final output will be a matrix. In all other cases, the output of the kdb+ rule is the same as the DolphinDB rule.\n\n**Note:**\n\n* Starting from version 2.00.15/3.00.3, the new *assembleRule* parameter has been introduced. This parameter not only incorporates all the functionality of the original *consistent* parameter but also offers additional options for combining results.\n\n  The *consistent* parameter is a boolean value that defaults to false, which is equivalent to setting *assembleRule*=\"D\". When set to true, it’s equivalent to *assembleRule*=\"C\". For backward compatibility, users can still use the *consistent* parameter. If both *assembleRule* and *consistent* are specified in the same operation, the value of *consistent* takes precedence.\n\n* *assembleRule*can also be specified after a function pattern symbol, represented by characters D/C/U/K (e.g., `sub:PU(X)`. If not specified, the default value D will be used.\n\n#### Details\n\nCalculate `func(X(i),Y)` for each element of *X*.\n\n* `X(i)` is each element when *X* is a vector.\n\n* `X(i)` is each column when *X* is a matrix.\n\n* `X(i)` is each row when *X* is a table.\n\n* `X(i)` is each row when *X* is an array vector.\n\n* `X(i)` is each value when *X* is a dictionary.\n\nIf *func* supports vector operation and the input is a vector, we should use the vector function/operator directly instead of the `eachLeft` template for better performance.\n\n#### Examples\n\n`eachLeft` with 2 vectors:\n\n```\nx = 4 3 2 1\ny = 3 0 6;\nx +:L y;\n```\n\n| 4  | 3 | 2 | 1 |\n| -- | - | - | - |\n| 7  | 6 | 5 | 4 |\n| 4  | 3 | 2 | 1 |\n| 10 | 9 | 8 | 7 |\n\n```\neachLeft(pow, x, y);\n```\n\n| 4    | 3   | 2  | 1 |\n| ---- | --- | -- | - |\n| 64   | 27  | 8  | 1 |\n| 1    | 1   | 1  | 1 |\n| 4096 | 729 | 64 | 1 |\n\n`eachLeft` with a vector and a matrix:\n\n```\nx=1..6$2:3;\nx;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 3    | 5    |\n| 2    | 4    | 6    |\n\n```\nx ** :L 1 1;\n// output: [3,7,11]\n```\n\n`eachLeft` with 2 matrices:\n\n```\ny=6..1$2:3;\ny;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 6    | 4    | 2    |\n| 5    | 3    | 1    |\n\n```\nz = x **:L y;\nz;\n\n/* output:\n(#0 #1 #2\n-- -- --\n16 10 4\n,#0 #1 #2\n-- -- --\n38 24 10\n,#0 #1 #2\n-- -- --\n60 38 16\n)\n*/\n```\n\n```\ntypestr z;\nANY VECTOR\n```\n\n`eachLeft` with a dictionary and a vector:\n\n```\nd=dict(`a`b`c, [[1, 2, 3],[4, 5, 6], [7, 8, 9]])\neachLeft(add,d,10 20 30)\n/* output:\na->[11,22,33]\nb->[14,25,36]\nc->[17,28,39]\n*/\n```\n"
    },
    "eachPost": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/eachPost.html",
        "signatures": [
            {
                "full": "eachPost(func, X, [post], [assembleRule|consistent=false])",
                "name": "eachPost",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[post]",
                        "name": "post",
                        "optional": true
                    },
                    {
                        "full": "[assembleRule|consistent=false]",
                        "name": "[assembleRule|consistent=false]"
                    }
                ]
            },
            {
                "full": "func:O(X, [post])",
                "name": "func:O",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[post]",
                        "name": "post",
                        "optional": true
                    }
                ]
            },
            {
                "full": "func:OC(X, [post])",
                "name": "func:OC",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[post]",
                        "name": "post",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [eachPost](https://docs.dolphindb.com/en/Functions/Templates/eachPost.html)\n\n\n\n#### Syntax\n\neachPost(func, X, \\[post], \\[assembleRule|consistent=false])\n\nfunc:O(X, \\[post]) or X \\<operator>:O \\[post], where  is not specified and the default value is used.\n\nfunc:OC(X, \\[post]) or X \\<operator>:OC \\[post] , where  is specified as C (for \"Consistent\") as an example.\n\n#### Parameters\n\n**func** is a binary function.\n\n**X** is a vector/matrix/table. When *X* is a matrix, *post* must be a scalar or vector; when *X* is a table, *post* must be a scalar or table. When *post* is absent, the first element in the result would be NULL.\n\n**post**(optional) provides a post-value for the last element of *X*. Its type requirement depends on the form of *X*.\n\n**assembleRule**(optional) indicates how the results of sub-tasks are merged into the final result. It accepts either an integer or a string, with the following options:\n\n* **0** (or \"D\"): The default value, which indicates the DolphinDB rule. This means the data type and form of the final result are determined by all sub results. If all sub results have the same data type and form, scalars will be combined into a vector, vectors into a matrix, matrices into a tuple, and dictionaries into a table. Otherwise, all sub results are combined into a tuple.\n\n* **1** (or \"C\"): The Consistent rule, which assumes all sub results match the type and form of the first sub result. This means the first sub result determines the data type and form of the final output. The system will attempt to convert any subsequent sub results that don't match the first sub result. If conversion fails, an exception is thrown. This rule should only be used when the sub results' types and forms are known to be consistent. This rule avoids having to cache and check each sub result individually, improving performance.\n\n* **2** (or \"U\"): The Tuple rule, which directly combines all sub results into a tuple without checking for consistency in their types or forms.\n\n* **3** (or \"K\"): The kdb+ rule. Like the DolphinDB rule, it checks all sub results to determine the final output. However, under the kdb+ rule, if any sub result is a vector, the final output will be a tuple. In contrast, under the DolphinDB rule, if all sub results are vectors of the same length, the final output will be a matrix. In all other cases, the output of the kdb+ rule is the same as the DolphinDB rule.\n\n**Note:**\n\n* Starting from version 2.00.15/3.00.3, the new *assembleRule* parameter has been introduced. This parameter not only incorporates all the functionality of the original *consistent* parameter but also offers additional options for combining results.\n\n  The *consistent* parameter is a boolean value that defaults to false, which is equivalent to setting *assembleRule*=\"D\". When set to true, it’s equivalent to *assembleRule*=\"C\". For backward compatibility, users can still use the *consistent* parameter. If both *assembleRule* and *consistent* are specified in the same operation, the value of *consistent* takes precedence.\n\n* *assembleRule*can also be specified after a function pattern symbol, represented by characters D/C/U/K (e.g., `sub:PU(X)`. If not specified, the default value D will be used.\n\n#### Details\n\nApply *func* over all pairs of consecutive elements of the object. It is equivalent to: `F(X[0], X[1]), F(X[1], X[2]), ..., F(X[n], post)`.\n\n#### Examples\n\n```\nx=1..10;\neachPost(sub, x);\n// output: [-1,-1,-1,-1,-1,-1,-1,-1,-1,]\n// equivalent to [1-2, 2-3, ..., 9-10, NULL]\n\n+:O x;\n// output: [3,5,7,9,11,13,15,17,19,]\n// equivalent to [1+2, 2+3, ..., 9+10, NULL]\n\nx +:O 0;\n// output: [3,5,7,9,11,13,15,17,19,10]\n// equivalent to [1+2, 2+3, ..., 9+10, 10+0]\n\nx=1..12$3:4;\nx;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 1    | 4    | 7    | 10   |\n| 2    | 5    | 8    | 11   |\n| 3    | 6    | 9    | 12   |\n\n```\n-:O x;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| -3   | -3   | -3   |      |\n| -3   | -3   | -3   |      |\n| -3   | -3   | -3   |      |\n\n```\neachPost(\\, x, x[0]);\n```\n\n| col1 | col2     | col3     | col4 |\n| ---- | -------- | -------- | ---- |\n| 0.25 | 0.571429 | 0.7      | 10   |\n| 0.4  | 0.625    | 0.727273 | 5.5  |\n| 0.5  | 0.666667 | 0.75     | 4    |\n\n```\ndef f1(a,b){\n    return (a[`x])+(a[`y])+(b[`x])+(b[`y])\n}\n\nt = table(1 2 3 as x,2 3 4 as y)\nt1 = table(1 as x,2 as y)\neachPost(f1,t,t1)\n// output: (8,12,[10])\n```\n"
    },
    "eachPre": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/eachPre.html",
        "signatures": [
            {
                "full": "eachPre(func, X, [pre], [consistent=false])",
                "name": "eachPre",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[pre]",
                        "name": "pre",
                        "optional": true
                    },
                    {
                        "full": "[consistent=false]",
                        "name": "consistent",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [eachPre](https://docs.dolphindb.com/en/Functions/Templates/eachPre.html)\n\n\n\n#### Syntax\n\neachPre(func, X, \\[pre], \\[consistent=false])\n\n\\[pre] \\<operator>:P X or func:P(\\[pre], X), where  is not specified and the default value is used.\n\n\\[pre] \\<operator>:PC X or func:PC(\\[pre], X), where  is specified as C (for \"Consistent\") as an example.\n\n#### Parameters\n\n**func** is a binary function.\n\n**X** is a vector/matrix/table. When *X* is a matrix, *pre* must be a scalar or vector; when *X* is a table, *pre* must be a scalar or table. When *pre* is absent, the first element in the result would be NULL.\n\n**pre** (optional) provides an initial pre-value for the calculation. Its data form depends on the data form of *X*.\n\n**assembleRule**(optional) indicates how the results of sub-tasks are merged into the final result. It accepts either an integer or a string, with the following options:\n\n* **0** (or \"D\"): The default value, which indicates the DolphinDB rule. This means the data type and form of the final result are determined by all sub results. If all sub results have the same data type and form, scalars will be combined into a vector, vectors into a matrix, matrices into a tuple, and dictionaries into a table. Otherwise, all sub results are combined into a tuple.\n\n* **1** (or \"C\"): The Consistent rule, which assumes all sub results match the type and form of the first sub result. This means the first sub result determines the data type and form of the final output. The system will attempt to convert any subsequent sub results that don't match the first sub result. If conversion fails, an exception is thrown. This rule should only be used when the sub results' types and forms are known to be consistent. This rule avoids having to cache and check each sub result individually, improving performance.\n\n* **2** (or \"U\"): The Tuple rule, which directly combines all sub results into a tuple without checking for consistency in their types or forms.\n\n* **3** (or \"K\"): The kdb+ rule. Like the DolphinDB rule, it checks all sub results to determine the final output. However, under the kdb+ rule, if any sub result is a vector, the final output will be a tuple. In contrast, under the DolphinDB rule, if all sub results are vectors of the same length, the final output will be a matrix. In all other cases, the output of the kdb+ rule is the same as the DolphinDB rule.\n\n**Note:**\n\n* Starting from version 2.00.15/3.00.3, the new *assembleRule* parameter has been introduced. This parameter not only incorporates all the functionality of the original *consistent* parameter but also offers additional options for combining results.\n\n  The *consistent* parameter is a boolean value that defaults to false, which is equivalent to setting *assembleRule*=\"D\". When set to true, it’s equivalent to *assembleRule*=\"C\". For backward compatibility, users can still use the *consistent* parameter. If both *assembleRule* and *consistent* are specified in the same operation, the value of *consistent* takes precedence.\n\n* *assembleRule*can also be specified after a function pattern symbol, represented by characters D/C/U/K (e.g., `sub:PU(X)`. If not specified, the default value D will be used.\n\n#### Details\n\nApply *func* over all pairs of consecutive elements of *X*. It is equivalent to: `F(X[0], pre), F(X[1], X[0]), ..., F(X[n], X[n-1])`.\n\nThe built-in functions [ratios](https://docs.dolphindb.com/en/Functions/r/ratios.html) and [deltas](https://docs.dolphindb.com/en/Functions/d/deltas.html) are also implemented by the `eachPre` template. They are defined as:\n\n* `function deltas(a){return a[0] -:P a}`\n\n* `function ratios(a){return a[0] :P a}`\n\n#### Examples\n\n```\nx=1..10;\n\neachPre(sub, x);\n// output: [,1,1,1,1,1,1,1,1,1]\n// equivalent to [NULL, 2-1, ..., 10-9]\n\neachPre(sub, x,,assembleRule=\"U\");\n// output: (,1,1,1,1,1,1,1,1,1)\n\n-:P x;\n// output: [,1,1,1,1,1,1,1,1,1]\n// same as above\n\neachPre(+, x);\n// output: [,3,5,7,9,11,13,15,17,19]\n// equivalent to [NULL, 2+1, ..., ]\n\n0 +:P x;\n// output: [1,3,5,7,9,11,13,15,17,19]\n// equivalent to [1+0, 2+1, ..., ]\n\nx=1..12$3:4;\nx;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 1    | 4    | 7    | 10   |\n| 2    | 5    | 8    | 11   |\n| 3    | 6    | 9    | 12   |\n\n```\n- :P x;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n|      | 3    | 3    | 3    |\n|      | 3    | 3    | 3    |\n|      | 3    | 3    | 3    |\n\n```\neachPre(\\, x, x[0]);\n```\n\n| col1 | col2 | col3 | col4     |\n| ---- | ---- | ---- | -------- |\n| 1    | 4    | 1.75 | 1.428571 |\n| 1    | 2.5  | 1.6  | 1.375    |\n| 1    | 2    | 1.5  | 1.333333 |\n\n```\ndef f1(a,b){\n    return (a[`x])+(a[`y])+(b[`x])+(b[`y])\n}\n\nt = table(1 2 3 as x,2 3 4 as y)\nt1 = table(1 as x,2 as y)\neachPre(f1,t,t1)\n\n// output: ([6],8,12)\n```\n\nCompare two result combining rules.\n\n```\ntab = table(til(5) as a,`a`a`b`b`c as b)\nselect *, contextby({x,y->isNull(y) ? [x] : [y,x]}:P,a,b) as c from tab\n// Use the DolphinDB rule\na b c    \n- - -----\n0 a [0]  \n1 a [0,1]\n2 b [2]  \n3 b [2,3]\n4 c 4    \n\nselect *, contextby({x,y->isNull(y) ? [x] : [y,x]}:PU,a,b) as c from tab\n// Use the Tuple rule to output - the c column in the last row is output as a vector\na b c    \n- - -----\n0 a [0]  \n1 a [0,1]\n2 b [2]  \n3 b [2,3]\n4 c [4]  \n```\n"
    },
    "eachRight": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/eachRight.html",
        "signatures": [
            {
                "full": "eachRight(func, X, Y, [assembleRule|consistent=false])",
                "name": "eachRight",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[assembleRule|consistent=false]",
                        "name": "[assembleRule|consistent=false]"
                    }
                ]
            },
            {
                "full": "func:R(X, Y)",
                "name": "func:R",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            },
            {
                "full": "func:RC(X, Y)",
                "name": "func:RC",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [eachRight](https://docs.dolphindb.com/en/Functions/Templates/eachRight.html)\n\n\n\n#### Syntax\n\neachRight(func, X, Y, \\[assembleRule|consistent=false])\n\nfunc:R(X, Y) or X \\<operator>:R Y, where  is not specified and the default value is used.\n\nfunc:RC(X, Y) or X \\<operator>:RC Y, where  is specified as C (for \"Consistent\") as an example.\n\n#### Parameters\n\n**func** is a binary function.\n\n**X**/ **Y** is a vector/matrix/table/array vector/dictionary.\n\n**assembleRule**(optional) indicates how the results of sub-tasks are merged into the final result. It accepts either an integer or a string, with the following options:\n\n* **0** (or \"D\"): The default value, which indicates the DolphinDB rule. This means the data type and form of the final result are determined by all sub results. If all sub results have the same data type and form, scalars will be combined into a vector, vectors into a matrix, matrices into a tuple, and dictionaries into a table. Otherwise, all sub results are combined into a tuple.\n\n* **1** (or \"C\"): The Consistent rule, which assumes all sub results match the type and form of the first sub result. This means the first sub result determines the data type and form of the final output. The system will attempt to convert any subsequent sub results that don't match the first sub result. If conversion fails, an exception is thrown. This rule should only be used when the sub results' types and forms are known to be consistent. This rule avoids having to cache and check each sub result individually, improving performance.\n\n* **2** (or \"U\"): The Tuple rule, which directly combines all sub results into a tuple without checking for consistency in their types or forms.\n\n* **3** (or \"K\"): The kdb+ rule. Like the DolphinDB rule, it checks all sub results to determine the final output. However, under the kdb+ rule, if any sub result is a vector, the final output will be a tuple. In contrast, under the DolphinDB rule, if all sub results are vectors of the same length, the final output will be a matrix. In all other cases, the output of the kdb+ rule is the same as the DolphinDB rule.\n\n**Note:**\n\n* Starting from version 2.00.15/3.00.3, the new *assembleRule* parameter has been introduced. This parameter not only incorporates all the functionality of the original *consistent* parameter but also offers additional options for combining results.\n\n  The *consistent* parameter is a boolean value that defaults to false, which is equivalent to setting *assembleRule*=\"D\". When set to true, it’s equivalent to *assembleRule*=\"C\". For backward compatibility, users can still use the *consistent* parameter. If both *assembleRule* and *consistent* are specified in the same operation, the value of *consistent* takes precedence.\n\n* *assembleRule*can also be specified after a function pattern symbol, represented by characters D/C/U/K (e.g., `sub:PU(X)`. If not specified, the default value D will be used.\n\n#### Details\n\nCalculate `func(X, Y(i))` for each element of *Y*.\n\n* `Y(i)` is each element when *Y* is a vector.\n\n* `Y(i)` is each column when *Y* is a matrix.\n\n* `Y(i)` is each row when *Y* is a table.\n\n* `Y(i)` is each row when *Y* is an array vector.\n\n* `Y(i)` is each value when *Y* is a dictionary.\n\nIf the function/operator supports vector operation and the input itself is a vector, we should avoid the `eachRight` template and use the vector function/operator directly instead for better performance.\n\n#### Examples\n\n`eachRight` with 2 vectors:\n\n```\nx = 4 3 2 1\ny = 3 0 6;\neachRight(add, x, y);\n```\n\n| 3 | 0 | 6  |\n| - | - | -- |\n| 7 | 4 | 10 |\n| 6 | 3 | 9  |\n| 5 | 2 | 8  |\n| 4 | 1 | 7  |\n\n```\nx pow :R y;\n```\n\n| 3  | 0 | 6    |\n| -- | - | ---- |\n| 64 | 1 | 4096 |\n| 27 | 1 | 729  |\n| 8  | 1 | 64   |\n| 1  | 1 | 1    |\n\n`eachRight` with a matrix and a vector:\n\n```\nx=1..6$2:3;\nx;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 3    | 5    |\n| 2    | 4    | 6    |\n\n```\n1 1 ** :R x;\n// output: [3,7,11]\n```\n\n`eachRight` with 2 matrices:\n\n```\ny=6..1$3:2;\ny;\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 6    | 3    |\n| 5    | 2    |\n| 4    | 1    |\n\n```\neachRight(**, x, y);\n/* output:\n(#0\n--\n41\n56\n,#0\n--\n14\n20\n)\n*/\n```\n\n`eachRight` with a dictionary and a vector:\n\n```\nd=dict(`a`b`c, [[1, 2, 3],[4, 5, 6], [7, 8, 9]])\neachRight(add,10 20 30,d)\n/* output:\na->[11,22,33]\nb->[14,25,36]\nc->[17,28,39]\n*/\n```\n"
    },
    "groupby": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/groupby.html",
        "signatures": [
            {
                "full": "groupby(func, funcArgs, groupingCol)",
                "name": "groupby",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "groupingCol",
                        "name": "groupingCol"
                    }
                ]
            },
            {
                "full": "func:G(funcArgs, groupingCol)",
                "name": "func:G",
                "parameters": [
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "groupingCol",
                        "name": "groupingCol"
                    }
                ]
            }
        ],
        "markdown": "### [groupby](https://docs.dolphindb.com/en/Functions/Templates/groupby.html)\n\n\n\n#### Syntax\n\ngroupby(func, funcArgs, groupingCol)\n\nor\n\nfuncArg func:G groupingCol\n\nor\n\nfunc:G(funcArgs, groupingCol)\n\n#### Parameters\n\n**func** is a function. For the second use case, *func* can only have one parameter (*funcArg*).\n\n**funcArgs** is a vector or a tuple with multiple vectors specifying the arguments of *func*.\n\n**groupingCol** is a vector or a tuple with vectors of the same length indicating the grouping column(s). A grouping column and each argument in *funcArgs*are vectors of the same size.\n\n#### Details\n\nFor each group, calculate `func(funcArgs)` and return a scalar/vector/dictionary.\n\n**Return value**: A table, where the number of rows is the same as the number of groups.\n\n#### Examples\n\n```\nsym=`IBM`IBM`IBM`MS`MS`MS$symbol;\nprice=172.12 170.32 175.25 26.46 31.45 29.43;\nqty=5800 700 9000 6300 2100 5300;\ntrade_date=2013.05.08 2013.05.06 2013.05.07 2013.05.08 2013.05.06 2013.05.07;\ngroupby(avg, price, sym);\n```\n\n| sym | avg\\_price |\n| --- | ---------- |\n| IBM | 172.563333 |\n| MS  | 29.113333  |\n\n```\nprice avg :G sym;\n```\n\n| sym | avg\\_price |\n| --- | ---------- |\n| IBM | 172.563333 |\n| MS  | 29.113333  |\n\n```\n// calculate the weighted average price of each stock\ngroupby(wavg, [price, qty], sym);\n```\n\n| sym | avg\\_price |\n| --- | ---------- |\n| IBM | 173.856129 |\n| MS  | 28.373869  |\n\n```\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C$SYMBOL\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\n\ngroupby(max, price, [sym,minute(timestamp)])\n```\n\n| sym | groupingKey | max\\_price |\n| --- | ----------- | ---------- |\n| C   | 09:34m      | 50.76      |\n| C   | 09:38m      | 51.29      |\n| IBM | 09:32m      | 174.97     |\n| IBM | 09:35m      | 175.23     |\n| MS  | 09:36m      | 30.02      |\n"
    },
    "loop": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/loop.html",
        "signatures": [
            {
                "full": "loop(func, args...)",
                "name": "loop",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            },
            {
                "full": "func:U(args…)",
                "name": "func:U",
                "parameters": [
                    {
                        "full": "args…",
                        "name": "args…"
                    }
                ]
            }
        ],
        "markdown": "### [loop](https://docs.dolphindb.com/en/Functions/Templates/loop.html)\n\n\n\n#### Syntax\n\nloop(func, args...)\n\nor\n\nfunc:U(args…)\n\nor\n\nfunc:U X\n\nor\n\nX func:U Y\n\n#### Parameters\n\n**func** is a function.\n\n**args/X/Y** are the required parameters of *func*.\n\n#### Details\n\nThe `loop` template is very similar to the [each](https://docs.dolphindb.com/en/Functions/Templates/each.html) template. Their difference is about the data form and data type of the function call results.\n\n* For the `each` template, the data types and forms of the return value are determined by each calculation result. It returns a vector or matrix if all calculation results have the same data type and form, otherwise it returns a tuple.\n\n* The `loop` template always returns a tuple.\n\n#### Examples\n\nUse a matrix as the input.\n\n```\nm=matrix([1 3 4 2,1 2 2 1])\nmax:U(m) \n// output: (4,2)\nn=matrix([11 5 9 2,8 5 3 2])\nm add:U n\n// output: ([12,8,13,4],[9,7,5,3])\n```\n\nUse an array vector as the input.\n\n```\na=array(INT[], 0, 10).append!([1 2 3, 4 5 4, 6 7 8, 1 9 10]);\nsum:U(a)\n// output: (6,13,21,20)\n```\n\nUse `loop` to convert a vector to a tuple.\n\n```\na=[1,2,3,4,5]\nasis:U(a)\n// output: (1,2,3,4,5)\n```\n"
    },
    "moving": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/moving.html",
        "signatures": [
            {
                "full": "moving(func, funcArgs, window, [minPeriods])",
                "name": "moving",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [moving](https://docs.dolphindb.com/en/Functions/Templates/moving.html)\n\n\n\n#### Syntax\n\nmoving(func, funcArgs, window, \\[minPeriods])\n\n#### Parameters\n\n**func** is an aggregate function.\n\n**Note:** When using this parameter, the keyword used to define the corresponding aggregation function is `defg`. For details, refer to [Tutorial: User Defined Aggregate Functions](https://docs.dolphindb.com/en/Tutorials/udaf.html).\n\n**funcArgs** are the parameters of *func*. They can be vectors/dictionaries/tables/matrices. It is a tuple if there are more than one parameter of *func*, and all parameters must have the same size.\n\n**window** is the moving window size.\n\n**minPeriods** is a positive integer indicating the minimum number of non-NULL valid observations in a window required to produce a result. The default value is the value of *window*.\n\n#### Details\n\nApply the function/operator to a moving window of the given objects.\n\nThe `moving` template always returns a vector with the same number of elements as the number of rows in the input arguments. It starts calculating when the moving window size is reached for the first time, and the moving window is always shifted by 1 element to the right thereafter.\n\nEach of the built-in moving functions such as [msum](https://docs.dolphindb.com/en/Functions/m/msum.html), [mcount](https://docs.dolphindb.com/en/Functions/m/mcount.html) and [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html) is optimized for its specific task. Therefore, they have much better performance than the `moving` template.\n\n#### Examples\n\nCalculate the moving beta of AAPL against the market (SPY) with a 10-day moving window.\n\n```\ndate=2016.08.01..2016.08.31\ndate=date[1<=weekday(date)<=5]\naaplRet=0.0177 -0.0148 0.0125 0.0008 0.0152 0.0083 0.0041 -0.0074 -0.0006 0.0023 0.0120 -0.0009 -0.0015 -0.0013 0.0026 -0.0078 0.0031 -0.0075 -0.0043 -0.0059 -0.0011 -0.0077 0.0009\nspyRet=-0.0008 -0.0064 0.0029 0.0011 0.0082 -0.0006 0.0006 -0.0025 0.0046 -0.0009 0.0029 -0.0052 0.0019 0.0022 -0.0015 0.0000 0.0020 -0.0051 -0.0007 -0.0019 0.0049 -0.0016 -0.0028\nt=table(date, aaplRet, spyRet);\nt;\n```\n\n| date       | aaplRet | spyRet  |\n| ---------- | ------- | ------- |\n| 2016.08.01 | 0.0177  | -0.0008 |\n| 2016.08.02 | -0.0148 | -0.0064 |\n| 2016.08.03 | 0.0125  | 0.0029  |\n| 2016.08.04 | 0.0008  | 0.0011  |\n| 2016.08.05 | 0.0152  | 0.0082  |\n| 2016.08.08 | 0.0083  | -0.0006 |\n| 2016.08.09 | 0.0041  | 0.0006  |\n| 2016.08.10 | -0.0074 | -0.0025 |\n| 2016.08.11 | -0.0006 | 0.0046  |\n| 2016.08.12 | 0.0023  | -0.0009 |\n| 2016.08.15 | 0.012   | 0.0029  |\n| 2016.08.16 | -0.0009 | -0.0052 |\n| 2016.08.17 | -0.0015 | 0.0019  |\n| 2016.08.18 | -0.0013 | 0.0022  |\n| 2016.08.19 | 0.0026  | -0.0015 |\n| 2016.08.22 | -0.0078 | 0       |\n| 2016.08.23 | 0.0031  | 0.002   |\n| 2016.08.24 | -0.0075 | -0.0051 |\n| 2016.08.25 | -0.0043 | -0.0007 |\n| 2016.08.26 | -0.0059 | -0.0019 |\n| 2016.08.29 | -0.0011 | 0.0049  |\n| 2016.08.30 | -0.0077 | -0.0016 |\n| 2016.08.31 | 0.0009  | -0.0028 |\n\n```\n// calculate moving beta\nupdate t set beta=moving(beta, [aaplRet, spyRet],10);\nt;\n```\n\n| date       | aaplRet | spyRet  | beta     |\n| ---------- | ------- | ------- | -------- |\n| 2016.08.01 | 0.0177  | -0.0008 |          |\n| 2016.08.02 | -0.0148 | -0.0064 |          |\n| 2016.08.03 | 0.0125  | 0.0029  |          |\n| 2016.08.04 | 0.0008  | 0.0011  |          |\n| 2016.08.05 | 0.0152  | 0.0082  |          |\n| 2016.08.08 | 0.0083  | -0.0006 |          |\n| 2016.08.09 | 0.0041  | 0.0006  |          |\n| 2016.08.10 | -0.0074 | -0.0025 |          |\n| 2016.08.11 | -0.0006 | 0.0046  |          |\n| 2016.08.12 | 0.0023  | -0.0009 | 1.601173 |\n| 2016.08.15 | 0.012   | 0.0029  | 1.859846 |\n| 2016.08.16 | -0.0009 | -0.0052 | 1.248804 |\n| 2016.08.17 | -0.0015 | 0.0019  | 1.114282 |\n| 2016.08.18 | -0.0013 | 0.0022  | 1.064296 |\n| 2016.08.19 | 0.0026  | -0.0015 | 0.512656 |\n| 2016.08.22 | -0.0078 | 0       | 0.614963 |\n| 2016.08.23 | 0.0031  | 0.002   | 0.642491 |\n| 2016.08.24 | -0.0075 | -0.0051 | 0.70836  |\n| 2016.08.25 | -0.0043 | -0.0007 | 0.977279 |\n| 2016.08.26 | -0.0059 | -0.0019 | 1.064465 |\n| 2016.08.29 | -0.0011 | 0.0049  | 0.422221 |\n| 2016.08.30 | -0.0077 | -0.0016 | 0.793236 |\n| 2016.08.31 | 0.0009  | -0.0028 | 0.588027 |\n\nAbout the role of *minPeriods* :\n\n```\nmoving(avg, 1..4, 3);\n// output: [,,2,3]\n\nmoving(avg, 1..4, 3, 1);\n// output: [1,1.5,2,3]\n```\n\nIf the function used in the moving template has multiple parameters, they must have the same size. For functions with parameters of different sizes, such as [percentile](https://docs.dolphindb.com/en/Functions/p/percentile.html), we can use [PartialApplication](https://docs.dolphindb.com/en/Programming/FunctionalProgramming/PartialApplication.html) to generate a new function. Please see the example below:\n\n```\nmoving(percentile{,50},1..20, 10);\n// output: [,,,,,,,,,5.5,6.5,7.5,8.5,9.5,10.5,11.5,12.5,13.5,14.5,15.5]\n```\n\n#### Performance Tip\n\nWhen we calculate moving averages, we should use the built-in function of `mavg` instead of the moving template, as the built-in functions are optimized and run faster than template functions.\n\n```\nn=1000000\nx=norm(0,1, n);\ntimer mavg(x, 10);\n// Time elapsed: 3.501ms\n\ntimer moving(avg, x, 10);\n// Time elapsed: 976.03ms\n```\n"
    },
    "movingValid": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/movingvalid.html",
        "signatures": [
            {
                "full": "movingValid(func, funcArgs, window, [minPeriods], [combined=true])",
                "name": "movingValid",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[minPeriods]",
                        "name": "minPeriods",
                        "optional": true
                    },
                    {
                        "full": "[combined=true]",
                        "name": "combined",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [movingValid](https://docs.dolphindb.com/en/Functions/Templates/movingvalid.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nmovingValid(func, funcArgs, window, \\[minPeriods], \\[combined=true])\n\n#### Details\n\nConstructs a sliding window based on the most recent *window* valid(non-null) values, and calls the aggregate function *func* on each window to compute a result.\n\nIf *funcArgs* contains an array vector or a columnar tuple, the function starts from the last element of this row and backtracks along the expanded data sequence, and then takes the most recent *window* non-null elements for calculation.\n\n#### Parameters\n\n**func** is an aggregate function.\n\n**Note:** When using this parameter, the keyword used to define the corresponding aggregation function is `defg`. For details, refer to [Tutorial: User Defined Aggregate Functions](https://docs.dolphindb.com/en/Tutorials/udaf.html).\n\n**funcArgs** are the parameters of *func* . They can be vectors/array vectors/columnar tuples/dictionaries/tables/matrices. It is a tuple if there are more than one parameter of *func* , and all parameters must have the same size. If *combined* is true, the number of elements in the corresponding row of each parameter must be the same.\n\n**window** is the moving window size.\n\n**minPeriods** (optional) is an integer indicating the minimum number of non-NULL valid observations in a window required to produce a result. The default value is *window* .\n\n**combined** (optional) is an Boolean value indicating how valid values are determined when there are more than one parameter of *func* .\n\n* true(default): After expansion, only parameter combinations where the values at the same position are all non-null are considered valid values.\n\n* false: Each parameter is traced independently, and the most recent *window* valid values are taken for calculation.\n\n#### Returns\n\nA vector with the same length as the input parameter.\n\n#### Examples\n\nExample 1: Calculate the moving effective average of a vector with a window of 3.\n\n```\nx = 1 2 NULL 3 4 NULL NULL NULL 5 6 \nmovingValid(func=avg, funcArgs=x, window=3, minPeriods=3)\n// output:[,,,2,3,3,3,3,4,5]\n```\n\nExample 2: Calculate the `myFactor` at each moment based on the last 3 valid values from the array vector column.\n\n```\ndefg myFactor(x){\n    return (max(x)-min(x))*2\n}\ntimeCol = 09:30:00 + 1..13\nvalue = arrayVector(3 4 5 6 9 11 12 15 16 17 18 21 23,9 1 15 NULL NULL NULL 16 18 4 1 11 NULL 2 14 8 NULL NULL NULL 15 9 16 18 10)\nt = table(timeCol, value)\n```\n\n| timeCol  | value        |\n| -------- | ------------ |\n| 09:30:01 | \\[9, 1, 15]  |\n| 09:30:02 | \\[null]      |\n| 09:30:03 | \\[null]      |\n| 09:30:04 | \\[null]      |\n| 09:30:05 | \\[16, 18, 4] |\n| 09:30:06 | \\[1, 11]     |\n| 09:30:07 | \\[null]      |\n| 09:30:08 | \\[2, 14, 8]  |\n| 09:30:09 | \\[null]      |\n| 09:30:10 | \\[null]      |\n| 09:30:11 | \\[null]      |\n| 09:30:12 | \\[15, 9, 16] |\n| 09:30:13 | \\[18, 10]    |\n\n```\nselect movingValid(myFactor,value,3,3) from t\n```\n\nmovingValid\\_myFactor --- 28 28 28 28 28 20 20 24 24 24 24 14 16\n\nExample 3: The impact of different *minPeriods* on the results:\n\n```\nval = 1 2 4 NULL 5 NULL 7 9 10\nmovingValid(func=min, funcArgs=val, window=3, minPeriods=3)\n// output: [,,1,1,2,2,4,5,7]\nmovingValid(func=min, funcArgs=val, window=3, minPeriods=2)\n// output: [,1,1,1,2,2,4,5,7]\n```\n\nExample 4: The impact of different valid data determination methods on results in multi-parameter scenarios：\n\nWhen combined is true:\n\n```\nx = arrayVector(2 5 6 8 10 12, 10 20 30 40 NULL NULL 50 NULL NULL 60 70 80)\ny = arrayVector(2 5 6 8 10 12, 1 NULL 2 3 NULL 5 1 NULL 2 7 8 5)\nmovingValid(func=covar, funcArgs=[x,y], window=2, minPeriods=2, combined=true)\n```\n\n| x    | \\[10, 20]  | \\[30, 40, null]         | \\[null]                 | \\[50, null]             | \\[null, 60]            | \\[70, 80]              |\n| ---- | ---------- | ----------------------- | ----------------------- | ----------------------- | ---------------------- | ---------------------- |\n| y    | \\[1, null] | \\[2, 3, null]           | \\[5]                    | \\[1, null]              | \\[2, 7]                | \\[8, 5]                |\n| 窗口计算 |            | covar(\\[30,40], \\[2,3]) | covar(\\[30,40], \\[2,3]) | covar(\\[40,50], \\[3,1]) | covar(\\[50,60],\\[1,7]) | covar(\\[70,80],\\[8,5]) |\n| 结果   | null       | 5                       | 5                       | -10                     | 30                     | -15                    |\n\nWhen combined is false:\n\n```\nx = arrayVector(2 5 6 8 10 12, 10 20 30 40 NULL NULL 50 NULL NULL 60 70 80)\ny = arrayVector(2 5 6 8 10 12, 1 NULL 2 3 NULL 5 1 NULL 2 7 8 5)\nmovingValid(func=covar, funcArgs=[x,y], window=2, minPeriods=2, combined=false)\n```\n\n<table id=\"table_lvg_kgk_g3c\"><thead><tr><th>\n\nx\n\n</th><th>\n\n\\[10, 20]\n\n</th><th>\n\n\\[30, 40, null]\n\n</th><th>\n\n\\[null]\n\n</th><th>\n\n\\[50, null]\n\n</th><th>\n\n\\[null, 60]\n\n</th><th>\n\n\\[70, 80]\n\n</th></tr></thead><tbody><tr><td>\n\ny\n\n</td><td>\n\n\\[1, null]\n\n</td><td>\n\n\\[2, 3, null]\n\n</td><td>\n\n\\[5]\n\n</td><td>\n\n\\[1, null]\n\n</td><td>\n\n\\[2, 7]\n\n</td><td>\n\n\\[8, 5]\n\n</td></tr><tr><td>\n\n窗口计算\n\n</td><td>\n\n</td><td>\n\ncovar(\\[30,40], \\[2,3])\n\n</td><td>\n\ncovar(\\[30,40],\\[3,5])\n\n</td><td>\n\ncovar(\\[40,50],\\[5,1])\n\n</td><td>\n\ncovar(\\[50,60],\\[2,7])\n\n</td><td>\n\ncovar(\\[70,80],\\[8,5])\n\n</td></tr><tr><td>\n\n结果\n\n</td><td>\n\nnull\n\n</td><td>\n\n5\n\n</td><td>\n\n10\n\n</td><td>\n\n-20\n\n</td><td>\n\n25\n\n</td><td>\n\n-15\n\n</td></tr></tbody>\n</table>\n"
    },
    "nothrowCall": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/nothrowcall.html",
        "signatures": [
            {
                "full": "nothrowCall(func, args...)",
                "name": "nothrowCall",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [nothrowCall](https://docs.dolphindb.com/en/Functions/Templates/nothrowcall.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\nnothrowCall(func, args...)\n\nAlias: nothrow\n\n#### Details\n\nCalls a function with the specified parameters. The syntax is the same as [call](https://docs.dolphindb.com/en/Functions/Templates/call.html).\n\nUnlike `call`, `nothrowCall` does not throw exceptions during execution, but it will throw an exception if the number of arguments does not match.\n\n#### Parameters\n\n**func** is a function.\n\n**args** are the required parameters of *func*.\n\n#### Returns\n\nThe result depends on the return value of `func(args)`.\n\n#### Examples\n\nWhen preparing the DolphinDB system environment, you need to clean up the environment, such as removing existing stream tables. However, it is sometimes unclear whether a given stream table exists. If [dropStreamTable](https://docs.dolphindb.com/en/Functions/d/dropStreamTable.html) is called directly, an exception will be thrown when the table does not exist. In this case, `nothrowCall` can be used to ignore the exception.\n\nThe following example assumes that the stream table named orderData does not exist:\n\n```\ndropStreamTable(`orderData)\n// Throw an exception: Can't find stream table orderData\n\nnothrowCall(dropStreamTable, `orderData)\n// The function runs without throwing an exception.\n```\n\n**Related Function:** [call](https://docs.dolphindb.com/en/Functions/Templates/call.html)\n"
    },
    "nullCompare": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/nullCompare.html",
        "signatures": [
            {
                "full": "nullCompare(func, X, Y)",
                "name": "nullCompare",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [nullCompare](https://docs.dolphindb.com/en/Functions/Templates/nullCompare.html)\n\n\n\n#### Syntax\n\nnullCompare(func, X, Y)\n\n#### Parameters\n\n**func** is the operator `<`, `>`, `>=`, `<=`, or the function `between`, `in`.\n\n**X** and **Y** can be scalars, pairs, vectors, matrices, or sets. If both *X* and *Y* are vectors or matrices, they must be of the same length or dimension.\n\n**Note:**\n\n*X* and *Y* do not support the following data types currently: STRING, SYMBOL, IPADDR, UUID, BLOB, INT128.\n\n#### Details\n\nReturn a Boolean value which is the result of `func(X,Y)`. Return NULL if the calculation involves null values. This function is not affected by the configuration paramter *nullAsMinValueForComparison*.\n\n#### Examples\n\nWhen *nullAsMinValueForComparison*=true, a null value is treated as the minimum value in data comparison. Function `nullCompare`, however, returns null values, which is not affected by the configuration paramter *nullAsMinValueForComparison*.\n\n```\nNULL < 3\n# output\ntrue\n\nnullCompare(<, NULL, 3)\n# output\nNULL\n\n```\n\n```\n\nm1=matrix(1 2 NULL, NULL 8 4, 4 7 2 )\nm2 = 1..9$3:3\nm1>m2\n```\n\n| col1  | col2  | col3  |\n| ----- | ----- | ----- |\n| false | false | false |\n| false | true  | false |\n| false | false | false |\n\n```\nnullCompare(>,m1,m2)\n```\n\n| col1  | col2  | col3  |\n| ----- | ----- | ----- |\n| false |       | false |\n| false | true  | false |\n|       | false | false |\n\n```\nnullCompare(between, 4 5 NULL, 4:9)\n# output\n[1,1,]\n```\n"
    },
    "pcall": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/pcall.html",
        "signatures": [
            {
                "full": "pcall(func, args...)",
                "name": "pcall",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [pcall](https://docs.dolphindb.com/en/Functions/Templates/pcall.html)\n\n\n\n#### Syntax\n\npcall(func, args...)\n\n#### Parameters\n\n**func** is an aggregate function. The output of the function must be a vector or a table with the same length as all vectors or table columns in *args*.\n\n**args** are the arguments of *func*. Each argument must be a table, a vector or a tuple of vectors. All the vectors or table columns in *args* must have the same length.\n\n#### Details\n\nConduct parallel computing of a vector function. `pcall` divides each argument into multiple parts and conducts the calculation in parallel. If the length of the vectors or table columns of the input variables is less than 100,000, `pcall` will not conduct the calculation in parallel.\n\n#### Examples\n\n```\nx = rand(1.0, 10000000);\ntimer(10) sin(x);\n// Time elapsed: 739.561 ms\n\ntimer(10) pcall(sin, x);\n// Time elapsed: 404.56 ms\n```\n"
    },
    "pcross": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/pcross.html",
        "signatures": [
            {
                "full": "pcross(func, X, [Y])",
                "name": "pcross",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [pcross](https://docs.dolphindb.com/en/Functions/Templates/pcross.html)\n\n\n\n#### Syntax\n\npcross(func, X, \\[Y])\n\npcross is the parallel computing version of template function cross .\n"
    },
    "peach": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/peach.html",
        "signatures": [
            {
                "full": "peach(func, args...)",
                "name": "peach",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [peach](https://docs.dolphindb.com/en/Functions/Templates/peach.html)\n\n\n\n#### Syntax\n\npeach(func, args...)\n\n#### Details\n\n`peach` is the parallel computing version of template function `each`. For tasks that take a long time to finish, `peach` can save a significant amount of time over `each`. For light tasks, however, `peach` may take longer than `each` as the overhead of parallel function call is not trivial.\n\nRefer to [DistributedComputing](https://docs.dolphindb.com/en/Database/DatabaseandDistributedComputing/DistributedComputing.html) for the details of Parallel Function Call.\n\n#### Examples\n\n```\nm=rand(1,20000:5000)\ntimer f=peach(mskew{,8},m)\n// Time elapsed: 3134.71 ms\n\ntimer f=mskew(m,8)\n// Time elapsed: 8810.485 ms\n```\n"
    },
    "pivot": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/pivot.html",
        "signatures": [
            {
                "full": "pivot(func, funcArgs, rowAlignCol, colAlignCol)",
                "name": "pivot",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "rowAlignCol",
                        "name": "rowAlignCol"
                    },
                    {
                        "full": "colAlignCol",
                        "name": "colAlignCol"
                    }
                ]
            }
        ],
        "markdown": "### [pivot](https://docs.dolphindb.com/en/Functions/Templates/pivot.html)\n\n\n\n#### Syntax\n\npivot(func, funcArgs, rowAlignCol, colAlignCol)\n\n#### Parameters\n\n**func** is an aggregate function.\n\n**funcArgs** are the parameters of *func*. It is a tuple if there are more than 1 parameter of *func*.\n\n**rowAlignCol** is the grouping variable for the rows of the result.\n\n**colAlignCol** is the grouping variable for the columns of the result.\n\n*rowAlignCol*, *colAlignCol*, and each of the function argument in *funcArgs* are vectors of the same size.\n\n#### Details\n\nRearrange the results of an aggregate function as a matrix.\n\nAssume *rowAlignCol* has n unique elements and *colAlignCol* has m unique elements. The template will return an *n* (row) by m (column) matrix, with unique values of *rowAlignCol* as row labels and unique values of *colAlignCol* as column labels. For each element of the matrix, the given function is applied conditional on *rowAlignCol* and *colAlignCol* equal to corresponding values indicated by the cell's row and column labels.\n\nDifference from Python’s `pivot`: `pandas.DataFrame.pivot` only reshapes the data and does not perform aggregation, whereas DolphinDB’s `pivot` function allows multiple values per cell and applies an aggregation function to compute the result.\n\n#### Examples\n\nA trader needs to calculate the volume-weighted average prices (vwap) for each stock in every minute, and the pair-wise correlations of stock returns based on the vwap price series. The data are in a table with 4 columns: sym, price, qty, and trade\\_time.\n\nWe first use the `pivot` template to pivot the data to a vwap price matrix with the time as row label and the stock symbol as column label. Then we use the [cross](https://docs.dolphindb.com/en/Functions/Templates/cross.html) template to calculate the pairwise correlation.\n\n```\nsyms=`600300`600400`600500$SYMBOL\nsym=syms[0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 2 2]\ntime=09:40:00+1 30 65 90 130 185 195 10 40 90 140 160 190 200 5 45 80 140 170 190 210\nprice=172.12 170.32 172.25 172.55 175.1 174.85 174.5 36.45 36.15 36.3 35.9 36.5 37.15 36.9 40.1 40.2 40.25 40.15 40.1 40.05 39.95\nvolume=100 * 10 3 7 8 25 6 10 4 5 1 2 8 6 10 2 2 5 5 4 4 3\nt1=table(sym, time, price, volume);\nt1;\n```\n\n| sym    | time     | price  | volume |\n| ------ | -------- | ------ | ------ |\n| 600300 | 09:40:01 | 172.12 | 1000   |\n| 600300 | 09:40:30 | 170.32 | 300    |\n| 600300 | 09:41:05 | 172.25 | 700    |\n| 600300 | 09:41:30 | 172.55 | 800    |\n| 600300 | 09:42:10 | 175.1  | 2500   |\n| 600300 | 09:43:05 | 174.85 | 600    |\n| 600300 | 09:43:15 | 174.5  | 1000   |\n| 600400 | 09:40:10 | 36.45  | 400    |\n| 600400 | 09:40:40 | 36.15  | 500    |\n| 600400 | 09:41:30 | 36.3   | 100    |\n| 600400 | 09:42:20 | 35.9   | 200    |\n| 600400 | 09:42:40 | 36.5   | 800    |\n| 600400 | 09:43:10 | 37.15  | 600    |\n| 600400 | 09:43:20 | 36.9   | 1000   |\n| 600500 | 09:40:05 | 40.1   | 200    |\n| 600500 | 09:40:45 | 40.2   | 200    |\n| 600500 | 09:41:20 | 40.25  | 500    |\n| 600500 | 09:42:20 | 40.15  | 500    |\n| 600500 | 09:42:50 | 40.1   | 400    |\n| 600500 | 09:43:10 | 40.05  | 400    |\n| 600500 | 09:43:30 | 39.95  | 300    |\n\nAlign the data on the dimensions of time and sym, and calculate the vwap price for every minute in each minute:\n\n```\nstockprice=pivot(wavg, [t1.price, t1.volume], minute(t1.time), t1.sym)\nstockprice.round(2);\n```\n\n| label  | 600300 | 600400 | 600500 |\n| ------ | ------ | ------ | ------ |\n| 09:40m | 171.7  | 36.28  | 40.15  |\n| 09:41m | 172.41 | 36.3   | 40.25  |\n| 09:42m | 175.1  | 36.38  | 40.13  |\n| 09:43m | 174.63 | 36.99  | 40.01  |\n\nThe step above can also use the following SQL statement to get the same result:\n\n```\nstockreturn = each(ratios, stockprice)-1\nstockreturn;\n```\n\n| label  | 600300    | 600400   | 600500    |\n| ------ | --------- | -------- | --------- |\n| 09:40m |           |          |           |\n| 09:41m | 0.004108  | 0.000459 | 0.002491  |\n| 09:42m | 0.015602  | 0.002204 | -0.003037 |\n| 09:43m | -0.002677 | 0.016871 | -0.003006 |\n\nCalculate stock returns in each minute:\n\n```\ncross(corr, stockreturn, stockreturn);\n```\n\n| label  | 600300    | 600400    | 600500    |\n| ------ | --------- | --------- | --------- |\n| 600300 | 1         | -0.719182 | -0.151824 |\n| 600400 | -0.719182 | 1         | -0.577578 |\n| 600500 | -0.151824 | -0.577578 | 1         |\n\nCalculate pair-wise correlation:\n\n```\npivot(count, price, minute(time), sym);\n```\n\n| label  | 600300 | 600400 | 600500 |\n| ------ | ------ | ------ | ------ |\n| 09:40m | 2      | 2      | 2      |\n| 09:41m | 2      | 1      | 1      |\n| 09:42m | 1      | 2      | 2      |\n| 09:43m | 2      | 2      | 2      |\n\nCount the number of observations within each minute for each stock:\n\n```\npivot(last, price, minute(time), sym);\n```\n\n| label  | 600300 | 600400 | 600500 |\n| ------ | ------ | ------ | ------ |\n| 09:40m | 170.32 | 36.15  | 40.2   |\n| 09:41m | 172.55 | 36.3   | 40.25  |\n| 09:42m | 175.1  | 36.5   | 40.1   |\n| 09:43m | 174.5  | 36.9   | 39.95  |\n"
    },
    "ploop": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/ploop.html",
        "signatures": [
            {
                "full": "ploop(func, args...)",
                "name": "ploop",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [ploop](https://docs.dolphindb.com/en/Functions/Templates/ploop.html)\n\n\n\n#### Syntax\n\nploop(func, args...)\n\nploop is the parallel computing version of template function loop . Refer to  for the details of Parallel Function Call.\n"
    },
    "reduce": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/reduce.html",
        "signatures": [
            {
                "full": "reduce(func, X, [init], [assembleRule|consistent=false])",
                "name": "reduce",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[init]",
                        "name": "init",
                        "optional": true
                    },
                    {
                        "full": "[assembleRule|consistent=false]",
                        "name": "[assembleRule|consistent=false]"
                    }
                ]
            },
            {
                "full": "reduce:T(X, [init])",
                "name": "reduce:T",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[init]",
                        "name": "init",
                        "optional": true
                    }
                ]
            },
            {
                "full": "reduce:TC(X, [init])",
                "name": "reduce:TC",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[init]",
                        "name": "init",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [reduce](https://docs.dolphindb.com/en/Functions/Templates/reduce.html)\n\n\n\n#### Syntax\n\nreduce(func, X, \\[init], \\[assembleRule|consistent=false])\n\nreduce:T(X, \\[init]) or \\[init] \\<operator>:T X, where  is not specified and the default value is used.\n\nreduce:TC(X, \\[init]) or \\[init] \\<operator>:TC X, where  is specified as C (for \"Consistent\") as an example.\n\n#### Parameters\n\n**func** is a function.\n\n* When *func* is a unary function, *X* can be a non-negative integer, a unary function, or a null value. *init* must be specified, which is the parameter of *func*.\n\n* When *func* is a binary function, *X* can be vector/matrix/table. *init* is the initial value.\n\n* When *func* is a ternary function, *X* must be a tuple with 2 elements, representing the last two parameters of *func*.\n\n**assembleRule**(optional) indicates how the results of sub-tasks are merged into the final result. It accepts either an integer or a string, with the following options:\n\n* **0** (or \"D\"): The default value, which indicates the DolphinDB rule. This means the data type and form of the final result are determined by all sub results. If all sub results have the same data type and form, scalars will be combined into a vector, vectors into a matrix, matrices into a tuple, and dictionaries into a table. Otherwise, all sub results are combined into a tuple.\n\n* **1** (or \"C\"): The Consistent rule, which assumes all sub results match the type and form of the first sub result. This means the first sub result determines the data type and form of the final output. The system will attempt to convert any subsequent sub results that don't match the first sub result. If conversion fails, an exception is thrown. This rule should only be used when the sub results' types and forms are known to be consistent. This rule avoids having to cache and check each sub result individually, improving performance.\n\n* **2** (or \"U\"): The Tuple rule, which directly combines all sub results into a tuple without checking for consistency in their types or forms.\n\n* **3** (or \"K\"): The kdb+ rule. Like the DolphinDB rule, it checks all sub results to determine the final output. However, under the kdb+ rule, if any sub result is a vector, the final output will be a tuple. In contrast, under the DolphinDB rule, if all sub results are vectors of the same length, the final output will be a matrix. In all other cases, the output of the kdb+ rule is the same as the DolphinDB rule.\n\n**Note:**\n\n* Starting from version 2.00.15/3.00.3, the new *assembleRule* parameter has been introduced. This parameter not only incorporates all the functionality of the original *consistent* parameter but also offers additional options for combining results.\n\n  The *consistent* parameter is a boolean value that defaults to false, which is equivalent to setting *assembleRule*=\"D\". When set to true, it’s equivalent to *assembleRule*=\"C\". For backward compatibility, users can still use the *consistent* parameter. If both *assembleRule* and *consistent* are specified in the same operation, the value of *consistent* takes precedence.\n\n* *assembleRule*can also be specified after a function pattern symbol, represented by characters D/C/U/K (e.g., `sub:PU(X)`. If not specified, the default value D will be used.\n\n#### Details\n\nThe function of `reduce` is the same as `accumulate`. Unlike the template `accumulate` that returns result of each iteration, the template `reduce` outputs only the last result. Refer to [accumulate](https://docs.dolphindb.com/en/Functions/Templates/accumulate.html) for more information.\n\n```\nresult=<function>(init,X[0]);\nfor(i:1~size(X)){\nresult=<function>(result, X[i]);\n}\nreturn result;\n```\n\n#### Examples\n\nWhen *func* is a unary function:\n\n```\n// define a unary function\ndef func1(x){\n  if(x<5){\n          return x*3\n  }\n  else{\n          return x+3\n  }\n}\n\n// when X is an integer, iterate for X times\nreduce(func1, 5, 1)\n// output: 18\n\n// when X is a unary function condition, the 3rd iteration stops as the condition returns false\ndef condition(x){\n  return x<9\n}\nreduce(func1, condition, 1)\n// output: 9\n\n// when X is NULL or unspecified, define a UDF func2 for iteration\ndef func2(x){\n  if(x<5){\n          return x*3\n  }\n  else{\n          return 6\n  }\n}\n\n//As the results of the 3rd and 4th iterations are the same, the function stops iteration and outputs the result\nreduce(func2,NULL,1)\n// output: 6\n```\n\nWhen *func* is a binary function, and *X* is a vector:\n\n```\nreduce(mul, 1..10);\n// factorization of 10\n// output: 3628800\n\n// the corresponding accumulate template for the operation above\n*:A 1..10;\n// output: [1,2,6,24,120,720,5040,40320,362880,3628800]\n\n2 *:T 1..10;\n// output: 7257600\n\ndef f1(a,b):a+log(b);\nreduce(f1, 1..5, 0);\n// output: 4.787492\n```\n\n`reduce` on a matrix:\n\n```\nx=1..12$3:4;\nx;\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 1    | 4    | 7    | 10   |\n| 2    | 5    | 8    | 11   |\n| 3    | 6    | 9    | 12   |\n\n```\n+ :T x;\n// output: [22,26,30]\n```\n\nWhen *func* is a ternary function:\n\n```\ndef fun3(x,y,z){\n  return x+y+z\n}\nreduce(fun3,[[1,2,3],[10,10,10]],5)\n// output: 41\n```\n"
    },
    "rolling": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/rolling.html",
        "signatures": [
            {
                "full": "rolling(func, funcArgs, window, [step=1])",
                "name": "rolling",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[step=1]",
                        "name": "step",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [rolling](https://docs.dolphindb.com/en/Functions/Templates/rolling.html)\n\n\n\n#### Syntax\n\nrolling(func, funcArgs, window, \\[step=1])\n\n#### Parameters\n\n**func** is an aggregate or vectorized function.\n\n**funcArgs** are the arguments passed to *func*, which can be vectors, matrices, or tables. It is a tuple if there are more than 1 parameter of *func*, and all arguments must have the same size (the number of elements of a vector or rows of a matrix).\n\n**window** is the window size.\n\n**step** (optional) is the count or interval that windows slide. The default value is 1. If *func* is a vectorized function, *step* must be equal to *window*.\n\n#### Details\n\nThe `rolling` function applies *func* to a moving window of *funcArgs*. It starts calculating when the window size is reached for the first time, then calculates with frequency specified by *step*.\n\nSimilar to the `moving` function, windows in `rolling` function are always along rows.\n\nThe differences of `rolling` and `moving` functions lie in:\n\n* The *func* parameter in `rolling` function supports aggregate or vectorized functions, whereas *func* in `moving` function only supports aggregate functions.\n\n* When *func* is specified as an aggregate function,\n\n  * *step* can be specified in `rolling` function.\n\n  * `rolling` does not return null values of the first (*window* -1) elements.\n\n#### Examples\n\nExample 1. When *func* is a vectorized function:\n\n```\nm = matrix(3 4 6 8 5 2 0 -2, 2 9 NULL 1 3 -4 2 1, NULL 8 9 8 0 1 9 -3)\nrolling(cummax, m, 4, 4)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 3    | 2    |      |\n| 4    | 9    | 8    |\n| 6    | 9    | 9    |\n| 8    | 9    | 9    |\n| 5    | 3    | 0    |\n| 5    | 3    | 1    |\n| 5    | 3    | 9    |\n| 5    | 3    | 9    |\n\n```\nrolling(cumsum, m, 3, 3)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 3    | 2    |      |\n| 7    | 11   | 8    |\n| 13   | 11   | 17   |\n| 8    | 1    | 8    |\n| 13   | 4    | 8    |\n| 15   | 0    | 9    |\n\nExample 2. When *func* is a aggregate function:\n\n```\nrolling(sum, m, 4)\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 21   | 12   | 25   |\n| 23   | 13   | 25   |\n| 21   | 0    | 18   |\n| 15   | 2    | 18   |\n| 5    | 2    | 7    |\n\nCalculate the rolling beta of AAPL against the market (SPY) with the moving window of size 10 and frequency of 5.\n\n```\ndate=2016.08.01..2016.08.31\ndate=date[1<=weekday(date)<=5]\naaplRet=0.0177 -0.0148 0.0125 0.0008 0.0152 0.0083 0.0041 -0.0074 -0.0006 0.0023 0.0120 -0.0009 -0.0015 -0.0013 0.0026 -0.0078 0.0031 -0.0075 -0.0043 -0.0059 -0.0011 -0.0077 0.0009\nspyRet=-0.0008 -0.0064 0.0029 0.0011 0.0082 -0.0006 0.0006 -0.0025 0.0046 -0.0009 0.0029 -0.0052 0.0019 0.0022 -0.0015 0.0000 0.0020 -0.0051 -0.0007 -0.0019 0.0049 -0.0016 -0.0028\nt=table(date, aaplRet, spyRet);\nt;\n```\n\n| date       | aaplRet | spyRet  |\n| ---------- | ------- | ------- |\n| 2016.08.01 | 0.0177  | -0.0008 |\n| 2016.08.02 | -0.0148 | -0.0064 |\n| 2016.08.03 | 0.0125  | 0.0029  |\n| 2016.08.04 | 0.0008  | 0.0011  |\n| 2016.08.05 | 0.0152  | 0.0082  |\n| 2016.08.08 | 0.0083  | -0.0006 |\n| 2016.08.09 | 0.0041  | 0.0006  |\n| 2016.08.10 | -0.0074 | -0.0025 |\n| 2016.08.11 | -0.0006 | 0.0046  |\n| 2016.08.12 | 0.0023  | -0.0009 |\n| 2016.08.15 | 0.012   | 0.0029  |\n| 2016.08.16 | -0.0009 | -0.0052 |\n| 2016.08.17 | -0.0015 | 0.0019  |\n| 2016.08.18 | -0.0013 | 0.0022  |\n| 2016.08.19 | 0.0026  | -0.0015 |\n| 2016.08.22 | -0.0078 | 0       |\n| 2016.08.23 | 0.0031  | 0.002   |\n| 2016.08.24 | -0.0075 | -0.0051 |\n| 2016.08.25 | -0.0043 | -0.0007 |\n| 2016.08.26 | -0.0059 | -0.0019 |\n| 2016.08.29 | -0.0011 | 0.0049  |\n| 2016.08.30 | -0.0077 | -0.0016 |\n| 2016.08.31 | 0.0009  | -0.0028 |\n\n```\nbetas = rolling(beta, [aaplRet, spyRet], 10,5);\ndates = rolling(last, date, 10,5);\ntable(dates, betas);\n```\n\n| dates      | betas    |\n| ---------- | -------- |\n| 2016.08.12 | 1.601173 |\n| 2016.08.19 | 0.512656 |\n| 2016.08.26 | 1.064465 |\n\nIf *funcArgs* is a matrix with row labels, the row labels are retained in the output.\n\n```\nminBar = 2024.03.08T10:00:00 + 0..9\naaplClose = [170.88,170.88,170.90,171.05,171.18,171.30,171.51,171.49,171.31,171.14]\nibmClose = [150.15,150.18,150.20,150.05,150.18,150.25,150.32,150.30,150.31,150.20]\nm = matrix(aaplClose, ibmClose).rename!(minBar, `aapl`ibm)\nrolling(func=avg, funcArgs=m, window=5, step=2)\n```\n\n| label               | aapl    | ibm     |\n| :------------------ | :------ | :------ |\n| 2024.03.08T10:00:00 | 170.978 | 150.152 |\n| 2024.03.08T10:00:02 | 171.188 | 150.2   |\n| 2024.03.08T10:00:04 | 171.358 | 150.272 |\n"
    },
    "segmentby": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/segmentby.html",
        "signatures": [
            {
                "full": "segmentby(func, funcArgs, segment)",
                "name": "segmentby",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "segment",
                        "name": "segment"
                    }
                ]
            }
        ],
        "markdown": "### [segmentby](https://docs.dolphindb.com/en/Functions/Templates/segmentby.html)\n\n\n\n#### Syntax\n\nsegmentby(func, funcArgs, segment)\n\n#### Parameters\n\n**func** is a function.\n\n**funcArgs** are the parameters of *func*. It is a tuple if there are more than 1 parameter of *func*.\n\n**segment** is the grouping variable.\n\n*segment* and each of the function argument in *funcArgs* are vectors of the same size.\n\n#### Details\n\n`segmentby` is very similar to [contextby](https://docs.dolphindb.com/en/Functions/Templates/contextby.html) except for how groups are determined. With `contextby`, a group includes all elements with the same value. With `segmentby`, only a block of equal value elements counts as a group. 2 blocks of equal value elements separated by different values are treated as 2 groups.\n\n#### Examples\n\n```\nret = 0.01 -0.02 0.03 -0.04 0.03 -0.02 0.05 -0.01 0.03 -0.04 0.05 -0.04\nposition = 1 1 1 1 -1 -1 -1 -1 1 1 1 1\nt = table(ret, position);\nt;\n```\n\n| ret   | position |\n| ----- | -------- |\n| 0.01  |          |\n| -0.02 | 1        |\n| 0.03  | 1        |\n| -0.04 | 1        |\n| 0.03  | -1       |\n| -0.02 | -1       |\n| 0.05  | -1       |\n| -0.01 | -1       |\n| 0.03  | 1        |\n| -0.04 | 1        |\n| 0.05  | 1        |\n| -0.04 | 1        |\n\n```\nupdate t set cumret=contextby(cumsum, ret, position);\nt;\n```\n\n| ret   | position | cumret |\n| ----- | -------- | ------ |\n| 0.01  | 1        | 0.01   |\n| -0.02 | 1        | -0.01  |\n| 0.03  | 1        | 0.02   |\n| -0.04 | 1        | -0.02  |\n| 0.03  | -1       | 0.03   |\n| -0.02 | -1       | 0.01   |\n| 0.05  | -1       | 0.06   |\n| -0.01 | -1       | 0.05   |\n| 0.03  | 1        | 0.01   |\n| -0.04 | 1        | -0.03  |\n| 0.05  | 1        | 0.02   |\n| -0.04 | 1        | -0.02  |\n\n```\nupdate t set cumret=segmentby(cumsum, ret, position);\nt;\n```\n\n| ret   | position | cumret |\n| ----- | -------- | ------ |\n| 0.01  | 1        | 0.01   |\n| -0.02 | 1        | -0.01  |\n| 0.03  | 1        | 0.02   |\n| -0.04 | 1        | -0.02  |\n| 0.03  | -1       | 0.03   |\n| -0.02 | -1       | 0.01   |\n| 0.05  | -1       | 0.06   |\n| -0.01 | -1       | 0.05   |\n| 0.03  | 1        | 0.03   |\n| -0.04 | 1        | -0.01  |\n| 0.05  | 1        | 0.04   |\n| -0.04 | 1        | 0      |\n\nCalculate the cumulative maximum, but reset it when 0 is encountered.\n\n```\na = [1, 2, 2, 3, 2, 0, 2, 4, 5, 3, 8, 5]\nsegmentby(cummax, a, a==0)\n// output: [1, 2, 2, 3, 3, 0, 2, 4, 5, 5, 8, 8]\n```\n"
    },
    "talib": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/talib.html",
        "signatures": [
            {
                "full": "talib(func, args...)",
                "name": "talib",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [talib](https://docs.dolphindb.com/en/Functions/Templates/talib.html)\n\n\n\n#### Syntax\n\ntalib(func, args...)\n\n#### Parameters\n\n**func** is a function.\n\n**args** are the parameters of *func*.\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nRegarding null value handling, the differences between DolphinDB's built-in moving functions and Python TA-lib lie in:\n\n* DolphinDB moving functions: The calculation in the sliding window starts from the first element.\n\n* Python TA-lib: Keep the null values at the beginning of data in the output. The calculation in the sliding window starts from the first non-null value.\n\nTo process data starting with consecutive null values in the same way as Python TA-Lib, you can call DolphinDB built-in functions with the higher-order function `talib`.\n\n#### Examples\n\nSee the differences of function `talib` and DolphinDB built-in functions with the following example:\n\n```\nmsum(NULL 1 2 3 4 5 6 7 8 9, 3)\n// output: [,,3,6,9,12,15,18,21,24]\n\ntalib(msum, NULL 1 2 3 4 5 6 7 8 9, 3)\n// output: [,,,6,9,12,15,18,21,24]\n```\n"
    },
    "tmoving": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/tmoving.html",
        "signatures": [
            {
                "full": "tmoving(func, T, funcArgs, window, [excludedPeriod])",
                "name": "tmoving",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[excludedPeriod]",
                        "name": "excludedPeriod",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [tmoving](https://docs.dolphindb.com/en/Functions/Templates/tmoving.html)\n\n\n\n#### Syntax\n\ntmoving(func, T, funcArgs, window, \\[excludedPeriod])\n\n#### Parameters\n\n**func** is a function.\n\n**T** is a non-strictly increasing vector of temporal or integral type. It cannot contain null values.\n\n**funcArgs** are the parameters of *func*. They can be vectors/dictionaries/tables. It is a tuple if there are more than one parameter of *func*, and all parameters must have the same size.\n\n**window** is a scalar of positive integer or DURATION type indicating the size of the sliding window.\n\nFor each element *Ti* in *T*:\n\n* When *T* is an integral value, the range of the corresponding window is (*Ti* - window, *Ti*]\n\n* When *T* is a temporal value, the range of the corresponding window is (temporalAdd(*Ti*, -window), *Ti*]\n\n**excludedPeriod** is a pair of time values (of TIME, NANOTIME, MINUTE, and SECOND type) representing the start and end time of the period which is excluded from the calculation. When the *excludedPeriod* is set, the input *T*\n\ncannot contain the time range specified by *excludedPeriod*and must be of TIMESTAMP, NANOTIMESTAMP, TIME, and NANOTIME types. Note that *excludedPeriod* must be within a calendar day and cannot be longer than the value of (24 - *window*).\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nApply the function/operator to a sliding window of the given objects.\n\nThe `tmoving` template always returns a vector with the same number of elements as the number of rows in the input arguments.\n\nEach of the built-in tm-functions such as [tmsum](https://docs.dolphindb.com/en/Functions/t/tmsum.html), [tmcount](https://docs.dolphindb.com/en/Functions/t/tmcount.html) and [tmavg](https://docs.dolphindb.com/en/Functions/t/tmavg.html) is optimized for its specific use case. Therefore, they have much better performance than the `tmoving` template.\n\n#### Examples\n\n```\ndate=2021.08.01 2021.08.02 2021.08.02 2021.08.02 2021.08.03 2021.08.04 2021.08.05 2021.08.06 2021.08.09 2021.08.10 2021.08.14\nvalue=1..11\nt = table(date,value)\ntimer(100) select date, value, tmoving(avg,date,value,3d) from t;\n// Time elapsed: 1.995 ms\ntimer(100) select date, value, tmavg(date, value, 3d) from t;\n// Time elapsed: 0.997 ms\n```\n\nAs shown in the output, when the window slides to 2021.08.09, the range is \\[2021.08.07, 2021.08.08, 2021.08.09]. As the values in 2021.08.07 and 2021.08.08 are missing, they do not participate in the calculation.\n\n| date       | value | tmoving\\_sum |\n| ---------- | ----- | ------------ |\n| 2021.08.01 | 1     | 1            |\n| 2021.08.02 | 2     | 1.5          |\n| 2021.08.02 | 3     | 2            |\n| 2021.08.02 | 4     | 2.5          |\n| 2021.08.03 | 5     | 3            |\n| 2021.08.04 | 6     | 4            |\n| 2021.08.05 | 7     | 6            |\n| 2021.08.06 | 8     | 7            |\n| 2021.08.09 | 9     | 9            |\n| 2021.08.10 | 10    | 9.5          |\n| 2021.08.14 | 11    | 11           |\n\nThe following example specifies the *excludedPeriod* parameter. The closing hours from 11:30 to 13:00 will be excluded from the calculation.\n\n```\nexcludedPeriod=(11:30:00:13:00:00)\nts=timestamp(2023.11.01T11:21:00+1..500) join timestamp(2023.11.01T13:00:00+1..500)\nt=table(ts, rand(10.0,size(ts)) as price)\n\n// with excludedPeriod specified\nres1=select ts, tmoving(func=avg, T=ts, funcArgs=price, window=1m, excludedPeriod=excludedPeriod) from t\n// without excludedPeriod specified\nres2=select ts, tmoving(func=avg, T=ts, funcArgs=price, window=1m) from t\n\n// results for two situations\nselect * from res1 where ts between timestamp(2023.11.01T13:00:00) and timestamp(2023.11.01T13:01:00)\n\nselect * from res2 where ts between timestamp(2023.11.01T13:00:00) and timestamp(2023.11.01T13:01:00)\n```\n\nThe following example specifies multiple *funcArgs* parameters to calculate the minimum value of bond prices after reaching their peak within a 5-minute rolling window.\n\n```\ndata_time = 2023.01.01T00:00:00 + 0..5 * 3600000  \nlast_price_bond = 100 + rand(10.0, 10) \n\ndefg getMinPrice(data_time, last_price_bond){\n        maxPriceTime = atImax(last_price_bond, data_time)\n        maxPrice = max(last_price_bond)\n        newPriceList = min(iif(data_time<maxPriceTime, maxPrice, last_price_bond))\n        return min(newPriceList)\n}\ncalTime = \"5m\"\ntmoving(getMinPrice, data_time, [data_time, last_price_bond], duration(calTime))\n```\n"
    },
    "twindow": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/twindow.html",
        "signatures": [
            {
                "full": "twindow(func, funcArgs, T, range, [prevailing=false], [excludedPeriod])",
                "name": "twindow",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "range",
                        "name": "range"
                    },
                    {
                        "full": "[prevailing=false]",
                        "name": "prevailing",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[excludedPeriod]",
                        "name": "excludedPeriod",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [twindow](https://docs.dolphindb.com/en/Functions/Templates/twindow.html)\n\n\n\n#### Syntax\n\ntwindow(func, funcArgs, T, range, \\[prevailing=false], \\[excludedPeriod])\n\n#### Parameters\n\n**func** is an aggregate function.\n\n**funcArgs** is the argument(s) of *func*. If *func* has multiple parameters, *funcArgs* is a tuple.\n\n**T** is a non-strictly increasing vector of integers or temporal type.\n\n**range** is a data pair of INT or DURATION type (both boundaries are inclusive).\n\n**prevailing** can be 0/false (default), 1/true, or 2, indicating how duplicate values at window boundaries are handled. The specific windowing rules for each value are introduced in [Details](https://docs.dolphindb.com/en/Functions/Templates/twindow.html#details).\n\n**excludedPeriod** is a pair of time values (of TIME, NANOTIME, MINUTE, and SECOND type) representing the start and end time of the period which is excluded from the calculation. When the *excludedPeriod* is set, the input *T*cannot contain the time range specified by *excludedPeriod*and must be of TIMESTAMP, NANOTIMESTAMP, TIME, and NANOTIME types. Note that *excludedPeriod* must be within a calendar day and cannot be longer than the value of (24 - *range*).\n\n#### Details\n\nApply *func* over a sliding window of *funcArgs*. Each element in *funcArgs* corresponds to a window that is determined by *T* and *range*. The result has the same dimension as that of *funcArgs* (If *funcArgs* is a tuple, the result has the same dimension as that of each element in the tuple).\n\nSuppose *range* is set to d1:d2, the windows are determined based on the following rules:\n\n1. When *range* is an integral pair:\n   * *T* is a vector of integral type: For element Ti in *T*, the window range is \\[Ti+d1, Ti+d2].\n   * *T* is a vector of temporal type: *range* has the precision of *T* by default. For element Ti in *T*, the window range is \\[temporalAdd(Ti, d1, unit), temporalAdd(Ti, d2, unit)], where \"unit\" indicates the precision of *T*.\n2. When *range* is a duration pair, *T* can only be a vector of temporal type. For element Ti in *T*, the window range is \\[temporalAdd(Ti, d1), temporalAdd(Ti, d2)].\n\n**Note:**\n\nIf the left boundary exceeds the right boundary, the window is considered empty, and the result is NULL.\n\nWhen the window boundary matches multiple duplicates, the *prevailing* parameter determines whether those duplicates are included in the window.\n\n* If *prevailing* = 0/false, the window includes all duplicates.\n* If prevailing = 1/true, the calculation window includes the last record of duplicates at the left boundary and all duplicates at the right boundary.\n* If prevailing = 2,\n  * When d1 is 0, the window starts at the current record, excluding prior duplicates while including all duplicates at the right boundary.\n  * When d2 is 0, the window ends at the current record, excluding following duplicates while including duplicates at the left boundary.\n  * Note that *prevailing* and *excludedPeriod* cannot be set simultaneously.\n\nCompared with the `tmoving` function, `twindow` has more flexible windows. The`tmoving` function can be considered roughly as a special case of `twindow`, where the right boundary of the *range* parameter is 0 and *prevailing* is set to 0. However, when the window is measured by time, the range of the window is (Ti - window, Ti] or (temporalAdd(Ti, -window), Ti], where the left boundary is exclusive. The current record is included as the last element in the corresponding window, regardless of whether the following records have identical values.\n\n#### Examples\n\nThe following examples show different windowing rules when the window boundary matches multiple duplicates.\n\n* When *prevailing* = 0, the calculation window includes all duplicates.\n\n  ```\n  t1 = table(`A`A`B`B`C`C as sym, 09:56:03 09:56:07 09:56:02 09:56:05 09:56:04 09:56:06 as time, 10.6 10.7 20.6 11.6 11.7 19.6 as price)\n  select *, twindow(func=avg, funcArgs=t1.price, T=t1.time, range=2s:4s) from t1 context by sym\n  ```\n\n  | sym | time     | price | twindow\\_avg |\n  | --- | -------- | ----- | ------------ |\n  | A   | 09:56:03 | 10.6  | 10.7         |\n  | A   | 09:56:07 | 10.7  |              |\n  | B   | 09:56:02 | 20.6  | 11.6         |\n  | B   | 09:56:05 | 11.6  |              |\n  | C   | 09:56:04 | 11.7  | 19.6         |\n  | C   | 09:56:06 | 19.6  |              |\n\n  ```\n  t = 2021.01.02 2021.01.02 2021.01.06 2021.03.09 2021.03.10 2021.03.12 2021.03.12\n  x = -5 5 NULL -1 2 4 -8\n  twindow(func=min,funcArgs=x,T=t,range=0:2)\n  // output: [-5, -5, , -1, -8, -8, -8]\n  ```\n\n* When *prevailing* = 1, the calculation window only includes the last record with the identical value.\n\n  ```\n  twindow(func=min,funcArgs=x,T=t,range=0:2,prevailing=1)\n  // output: [5, 5, , -1, -8, -8, -8]\n  ```\n\n* When *prevailing* = 2 and the *range*'s left/right boundary is 0, the calculation window starts at the current record, excluding prior/following duplicates.\n\n  ```\n  twindow(func=min,funcArgs=x,T=t,range=0:2,prevailing=2)\n  // output: [-5, 5, , -1, -8, -8, -8]\n\n  twindow(func=min,funcArgs=x,T=t,range=-2:0,prevailing=2)\n  // output: [-5, -5, , -1, -1, 2, -8]\n  ```\n\nThe following example specifies the *excludedPeriod* parameter. The closing hours from 11:30 to 13:00 will be excluded from the calculation.\n\n```\nexcludedPeriod=(11:30:00:13:00:00)\nts=timestamp(2023.11.01T11:21:00+1..500) join timestamp(2023.11.01T13:00:00+1..500)\nt=table(ts, rand(10.0,size(ts)) as price)\n\n// with excludedPeriod specified\nres1=select ts, twindow(func=avg, T=ts, funcArgs=price, range=-1m:0m, excludedPeriod=excludedPeriod) from t\nselect * from res1 where ts between timestamp(2023.11.01T13:00:00) and timestamp(2023.11.01T13:01:00)\n// without excludedPeriod specified\nres2=select ts, twindow(func=avg, T=ts, funcArgs=price, range=-1m:0m) from t\nselect * from res2 where ts between timestamp(2023.11.01T13:00:00) and timestamp(2023.11.01T13:01:00)\n```\n"
    },
    "unifiedCall": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/unifiedCall.html",
        "signatures": [
            {
                "full": "unifiedCall(func, args)",
                "name": "unifiedCall",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args",
                        "name": "args"
                    }
                ]
            }
        ],
        "markdown": "### [unifiedCall](https://docs.dolphindb.com/en/Functions/Templates/unifiedCall.html)\n\n\n\n#### Syntax\n\nunifiedCall(func, args)\n\n#### Parameters\n\n**func** is a function.\n\n**args** is a tuple. Each element is a parameter of *func*.\n\n#### Details\n\nCall a function with the specified parameters. Similar to [call](https://docs.dolphindb.com/en/Functions/Templates/call.html), it can be used in [each](https://docs.dolphindb.com/en/Functions/Templates/each.html)/[peach](https://docs.dolphindb.com/en/Functions/Templates/peach.html) or [loop](https://docs.dolphindb.com/en/Functions/Templates/loop.html)/[ploop](https://docs.dolphindb.com/en/Functions/Templates/ploop.html) to call a set of functions. The difference is that the size of *args* in call function is determined by the function passed in by the parameter *func*, whereas the size of args in `unifiedCall` is always 1. All arguments of the function used in function call is assembled in a tuple for function `unifiedCall`.\n\n#### Examples\n\n```\nunifiedCall(sum, [1..10])\n// output: 55\n\nunifiedCall(add, ([1,2,3,4,5,6,7,8,9,10],2))\n// output: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n\n```\n\n```\n\neach(unifiedCall, [std, max], [[matrix(1 3 5 7 9, 1 4 7 10 13)], [0..100]]);\n```\n\n| col1   | col2 |\n| ------ | ---- |\n| 3.1623 | 100  |\n| 4.7434 | 100  |\n\n```\ndef f(a,b){return (a+2)*b}\nunifiedCall(f, (5,10))\n//output: 70\n```\n"
    },
    "window": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/window.html",
        "signatures": [
            {
                "full": "window(func, funcArgs, range)",
                "name": "window",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "funcArgs",
                        "name": "funcArgs"
                    },
                    {
                        "full": "range",
                        "name": "range"
                    }
                ]
            }
        ],
        "markdown": "### [window](https://docs.dolphindb.com/en/Functions/Templates/window.html)\n\n\n\n#### Syntax\n\nwindow(func, funcArgs, range)\n\n#### Parameters\n\n**func** is an aggregate function.\n\n**funcArgs** is the argument(s) of *func*. It is a tuple if there are more than one parameter of *func*.\n\n**range** is a pair of integers or duration values (both boundaries are inclusive).\n\nNote: If *range* is of DURATION type, *funcArgs* must be an indexed matrix or an indexed series.\n\n#### Details\n\nApply *func* over a sliding window of *funcArgs*. Each element in *funcArgs* corresponds to a window that is determined by *range*. The result has the same dimension as that of *funcArgs* (If *funcArgs* is a tuple, the result has the same dimension as that of each element in the tuple).\n\nSuppose *range* is set to d1:d2, the windows are determined based on the following rules:\n\n1. When *funcArgs* is a vector, *range* must be a pair of integers. For the ith element in *funcArgs*, the corresponding window contains elements at position \\[i+d1, i+d2].\n\n2. When *funcArgs* is an indexed series or indexed matrix:\n\n* If *funcArgs* is indexed by time, for fi (the ith element in the index of *funcArgs*), the corresponding window contains elements at index \\[temporalAdd(fi, d1), temporalAdd(fi, d2)].\n\n* If *funcArgs* is indexed by integral values, *range* must also be integral. For fi (the ith element in the index of *funcArgs*), the corresponding window contains elements at index \\[fi+d1, fi+d2].\n\nCompared with the *moving* function, the *window* function has a more flexible window. *moving* can be roughly considered as a special case of window, where the right boundary of the *range* parameter is 0. However, please note the following differences:\n\n1. When the window is based on element counts, *moving* returns null when the number of windowed elements does not satisfy the *minPeriods*, whereas `window` does not have a minimum count requirement.\n\n2. When the window is based on time, the left boundary of the window of *moving* is exclusive and the right boundary is inclusive; whereas both boundaries of the window of `window` are inclusive. In this example:\n\n   Suppose a window with the size of \"3d\" slides over an index of DATETIME type to apply calculation. For the point \"2022.01.05T09:00:00\" in the index, the range of the corresponding window in `moving` is (2022.01.02T09:00:00,2022.01.05T09:00:00], whereas it's \\[2022.01.03T09:00:00,2022.01.05T09:00:00] in `window` (with the *range* parameter specified as \"-2d:0d\").\n\n**Return value**: A vector with the same type as the first window computation result.\n\n#### Examples\n\n*funcArgs* is a vector. For the ith element of *x*, the range of the window is \\[i+1,i+3].\n\n```\nx = 5 4 NULL -1 2 4\nwindow(min, x, 1:3)\n// output: [-1, -1, -1, 2, 4, ]\n\ny = 4.8 9.6 7.1 3.3 5.9 2.7\nwindow(corr, (x, y), 1:3)\n// output: [1, 1, -0.623, -1, , ]\n```\n\n*funcArgs* is a series indexed by time. The range of the window is \\[temporalAdd(ti 1d), temporalAdd(ti, 3d)] where ti is the i-th element of t.\n\n```\nt = 2021.01.02 2021.01.05 2021.01.06 2021.01.09 2021.01.10 2021.01.12\nx1 = indexedSeries(t, x)\nwindow(min, x1, 1d:3d)\n```\n\n| label      | col1 |\n| ---------- | ---- |\n| 2021.01.02 | 4    |\n| 2021.01.05 |      |\n| 2021.01.06 | -1   |\n| 2021.01.09 | 2    |\n| 2021.01.10 | 4    |\n| 2021.01.12 |      |\n\n*funcArgs* is a matrix indexed by time. The range of the window is \\[temporalAdd(ti, 1d), temporalAdd(ti, 3d)], where ti is the ith element of t.\n\n```\nt= 2021.01.02 2021.01.05  2021.01.06  2021.01.09 2021.01.10 2021.01.12\nm=matrix(5 4 NULL -1 2 4, 3 2 8 1 0 5)\nm1=m.rename!(t, `a`b).setIndexedMatrix!()\nwindow(min, m1, 1d:3d)\n```\n\n| label      | a  | b |\n| ---------- | -- | - |\n| 2021.01.02 | 4  | 2 |\n| 2021.01.05 |    | 8 |\n| 2021.01.06 | -1 | 1 |\n| 2021.01.09 | 2  | 0 |\n| 2021.01.10 | 4  | 5 |\n| 2021.01.12 |    |   |\n\n```\nt1 = table(`A`A`B`B`C`C as sym, 09:56:03 09:56:07 09:56:02 09:56:05 09:56:04 09:56:06 as time, 10.6 10.7 20.6 11.6 11.7 19.6 as price)\nselect *, window(avg, t1.time.indexedSeries(t1.price), 2s:4s) from t1 context by sym\n```\n\n| sym | time     | price | window\\_avg |\n| --- | -------- | ----- | ----------- |\n| A   | 09:56:03 | 10.6  | 10.7        |\n| A   | 09:56:07 | 10.7  |             |\n| B   | 09:56:02 | 20.6  | 11.6        |\n| B   | 09:56:05 | 11.6  |             |\n| C   | 09:56:04 | 11.7  | 19.6        |\n| C   | 09:56:06 | 19.6  |             |\n"
    },
    "withNullFill": {
        "url": "https://docs.dolphindb.com/en/Functions/Templates/withNullFill.html",
        "signatures": [
            {
                "full": "withNullFill(func, x, y, fillValue)",
                "name": "withNullFill",
                "parameters": [
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "x",
                        "name": "x"
                    },
                    {
                        "full": "y",
                        "name": "y"
                    },
                    {
                        "full": "fillValue",
                        "name": "fillValue"
                    }
                ]
            }
        ],
        "markdown": "### [withNullFill](https://docs.dolphindb.com/en/Functions/Templates/withNullFill.html)\n\n\n\n#### Syntax\n\nwithNullFill(func, x, y, fillValue)\n\n#### Parameters\n\n**func** is a DolphinDB built-in function with two inputs, such as `+`, `-`, `*`, `/`, `\\`, `%`, `pow`, `and`, `or`, etc.\n\n**x** and **y** are vectors or matrices.\n\n**fillValue** is a scalar.\n\n#### Details\n\nIf only 1 of the elements at the same location of *x* and *y* is null, replace the null value with *fillValue* in the calculation. If both elements at the same location of *x* and *y* are null, return NULL.\n\n#### Examples\n\n```\nx = 0 1 NULL NULL 2\ny = 1 NULL 2 NULL 3;\nadd(x,y);\n// output: [1,,,,5]\n\nwithNullFill(add, x, y, 0);\n// output: [1,1,2,,5]\n\nm=matrix(1..5, y);\nm;\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 1    |\n| 2    |      |\n| 3    | 2    |\n| 4    |      |\n| 5    | 3    |\n\n```\nadd(x, m);\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 1    |\n| 3    |      |\n|      |      |\n|      |      |\n| 7    | 5    |\n\n```\nwithNullFill(add, x, m, 0);\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 1    |\n| 3    | 1    |\n| 3    | 2    |\n| 4    |      |\n| 7    | 5    |\n"
    },
    "undef": {
        "url": "https://docs.dolphindb.com/en/Functions/u/undef.html",
        "signatures": [
            {
                "full": "undef(obj, [objType=VAR])",
                "name": "undef",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[objType=VAR]",
                        "name": "objType",
                        "optional": true,
                        "default": "VAR"
                    }
                ]
            }
        ],
        "markdown": "### [undef](https://docs.dolphindb.com/en/Functions/u/undef.html)\n\n\n\n#### Syntax\n\nundef(obj, \\[objType=VAR])\n\nor\n\nundef all\n\n#### Details\n\nRelease variables or function definitions from the memory. You can also release a local variable (VAR) from the memory using \"= NULL\".\n\n#### Parameters\n\n**obj** is a string or a string vector indicating the names of objects to be undefined. To undefine all the variables in a category, use the unquoted \"all\" for *obj*.\n\n**objType** (optional) is type of objects to be undefined. The types can be: VAR (variable), SHARED (shared variable) or DEF (function definition). The default value is VAR.\n\nTo delete all user-defined objects in the system except shared variables, use \"undef all\".\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nundef all;\nx=1\nundef(`x);\nx=1\ny=2\nundef(`x`y);\nshare table(1..3 as x, 4..6 as y) as t\nundef(`t, SHARED);\n```\n\n```\ndef f(a){return a+1}\nundef(`f, DEF);\na=1\nb=2\nundef all, VAR;\n```\n"
    },
    "ungroup": {
        "url": "https://docs.dolphindb.com/en/Functions/u/ungroup.html",
        "signatures": [
            {
                "full": "ungroup(X)",
                "name": "ungroup",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [ungroup](https://docs.dolphindb.com/en/Functions/u/ungroup.html)\n\n#### Syntax\n\nungroup(X)\n\n#### Details\n\nFor table *X*, where some columns are array vectors or columnar tuples, returns the normalized table, with one row for each element of the flattened array vector or columnar tuple.\n\nIf *X* does not contain array vectors or columnar tuples or the number of rows for *X* is 0, returns *X* directly.\n\n#### Parameters\n\n**X** must be a table object.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n```\nx = array(INT[], 0).append!([1 2 3, 4 5, 6 7 8, 9 10])\nt = table(1 2 3 4 as id, x as vol)\nungroup(t)\n\n/* output:\nid vol\n-- -------\n1  1\n1  2\n1  3\n2  4\n2  5\n3  6\n3  7\n3  8\n4  9\n4  10  \n*/\n\n// create a table where the column price is a columnar tuple\nsym = `st1`st2`st3\nprice = [[3.1,2.5,2.8], [3.1,3.3], [3.2,2.9,3.3]]\nprice.setColumnarTuple!()\nt = table(sym, price)\nungroup(t)\n```\n\n| sym | price                   |\n| --- | ----------------------- |\n| st1 | \\[3.1000,2.5000,2.8000] |\n| st2 | \\[3.1000,3.3000]        |\n| st3 | \\[3.2000,2.9000,3.3000] |\n\n```\nungroup(t)\n```\n\n| sym | price |\n| --- | ----- |\n| st1 | 3.1   |\n| st1 | 2.5   |\n| st1 | 2.8   |\n| st2 | 3.1   |\n| st2 | 3.3   |\n| st3 | 3.2   |\n| st3 | 2.9   |\n| st3 | 3.3   |\n\n```\nsym = `st1`st2`st2`st1`st3`st1`st3`st2`st3\nvolume = 106 115 121 90 130 150 145 123 155;\nt = table(sym, volume);\nt;\n\nt1 = select toArray(volume) as volume_all from t group by sym;\nt1;\n```\n\n| sym | volume\\_all    |\n| --- | -------------- |\n| st1 | \\[106,90,150]  |\n| st2 | \\[115,121,123] |\n| st3 | \\[130,145,155] |\n\n```\nungroup(t1)\n```\n\n| sym | volume\\_all |\n| --- | ----------- |\n| st1 | 106         |\n| st1 | 90          |\n| st1 | 150         |\n| st2 | 115         |\n| st2 | 121         |\n| st2 | 123         |\n| st3 | 130         |\n| st3 | 145         |\n| st3 | 155         |\n\n"
    },
    "unifiedExpr": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unifiedExpr.html",
        "signatures": [
            {
                "full": "unifiedExpr(objs, optrs)",
                "name": "unifiedExpr",
                "parameters": [
                    {
                        "full": "objs",
                        "name": "objs"
                    },
                    {
                        "full": "optrs",
                        "name": "optrs"
                    }
                ]
            }
        ],
        "markdown": "### [unifiedExpr](https://docs.dolphindb.com/en/Functions/u/unifiedExpr.html)\n\n\n\n#### Syntax\n\nunifiedExpr(objs, optrs)\n\n#### Details\n\nConnect the operands in *objs* with the binary operators in *optrs* to generate metacode of a multivariate expression. You can execute the metacode with function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html).\n\n#### Parameters\n\n**objs** is a tuple with no less than 2 elements.with a length between 2 and 1024 (inclusive).\n\n**optrs** is a vector of binary operators and the length is size(objs)-1.\n\n#### Returns\n\nA metacode.\n\n#### Examples\n\n```\nunifiedExpr((1, 2), add)\n// output: <1 + 2>\n\nt=table(1..3 as price1, 4..6 as price2, 5..7 as price3)\na=sqlColAlias(unifiedExpr((sqlCol(\"price1\"), sqlCol(\"price2\"), sqlCol(\"price3\")), take(add, 2)))\nsql(select=(sqlCol(`price1),sqlCol(`price2),sqlCol(`price3),a), from=t).eval()\n```\n\n| price1 | price2 | price3 | price1\\_add |\n| ------ | ------ | ------ | ----------- |\n| 1      | 4      | 5      | 10          |\n| 2      | 5      | 6      | 13          |\n| 3      | 6      | 7      | 16          |\n\nRelated function: [binaryExpr](https://docs.dolphindb.com/en/Functions/b/binaryExpr.html)\n"
    },
    "union": {
        "url": "https://docs.dolphindb.com/en/Functions/u/union.html",
        "signatures": [
            {
                "full": "union(X, Y)",
                "name": "union",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [union](https://docs.dolphindb.com/en/Functions/u/union.html)\n\n\n\n#### Syntax\n\nunion(X, Y) or X|Y\n\n#### Details\n\nReturn the union of two sets.\n\n#### Parameters\n\n**X** and **Y** are sets.\n\n#### Returns\n\nA set.\n\n#### Examples\n\n```\nx=set([5,5,3,4]);\ny=set(8 9 9 4 6);\nx | y;\n// output: set(8,9,6,4,3,5)\n```\n"
    },
    "unionAll": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unionAll.html",
        "signatures": [
            {
                "full": "unionAll(tableA, tableB, [byColName=false])",
                "name": "unionAll",
                "parameters": [
                    {
                        "full": "tableA",
                        "name": "tableA"
                    },
                    {
                        "full": "tableB",
                        "name": "tableB"
                    },
                    {
                        "full": "[byColName=false]",
                        "name": "byColName",
                        "optional": true,
                        "default": "false"
                    }
                ]
            },
            {
                "full": "unionAll(tables, [partition=true], [byColName=false])",
                "name": "unionAll",
                "parameters": [
                    {
                        "full": "tables",
                        "name": "tables"
                    },
                    {
                        "full": "[partition=true]",
                        "name": "partition",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[byColName=false]",
                        "name": "byColName",
                        "optional": true,
                        "default": "false"
                    }
                ]
            },
            {
                "full": "unionAll(tables, tableB)",
                "name": "unionAll",
                "parameters": [
                    {
                        "full": "tables",
                        "name": "tables"
                    },
                    {
                        "full": "tableB",
                        "name": "tableB"
                    }
                ]
            }
        ],
        "markdown": "### [unionAll](https://docs.dolphindb.com/en/Functions/u/unionAll.html)\n\n\n\n#### Syntax\n\nunionAll(tableA, tableB, \\[byColName=false])\n\nor\n\nunionAll(tables, \\[partition=true], \\[byColName=false])\n\nor\n\nunionAll(tables, tableB)\n\n#### Details\n\nFor the first scenario, combine 2 tables into a single table. The result is an unpartitioned in-memory table.\n\nFor the second scenario, combine multiple tables into a single table. If *partitioned* is set to \"false\", the result is an unpartitioned in-memory table; if *partitioned* is set to \"true\", the result is a partitioned in-memory table with sequential domain. The default value is \"true\".\n\nIf *byColName* =false, all tables to be combined must have identical number of columns.\n\nIf *byColName* =true, the tables to be combined can have different number of columns. If a column does not exist in a table, it is filled with null values in the final result.\n\n#### Parameters\n\n* For the first scenario, **tableA** and **tableB** are 2 tables with the same number of columns.\n\n* For the second scenario,\n\n  * **tables** is a list of tables with the same number of columns;\n\n  * **partition** (optional) is a Boolean parameter with the default value of true.\n\n  * **byColName** (optional) is a Boolean value indicating whether the table combination is conducted along columns with the same name. If *byColName* =false, the table combination is conducted based on the order of columns regardless of column names.\n\n* For the third scenario, **tables** is a tuple where the elements represent in-memory tables with the same number of columns. tableB is also an in-memory table having the the same number of columns. This form is often used to specify the *finalFunc* parameter of the `mr` function.\n\n**Note:** The following table types are supported: `table`, `keyedTable`, `indexedTable`, `latestKeyedTable`, `latestIndexedTable`. *tableB* of the third scenario can also be a partitioned in-memory table.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nScenario 1. Combine two in-memory tables.\n\n```\nt1=table(1 2 3 as id, 11 12 13 as x)\nt2=table(4 5 6 as id, 14 15 16 as x)\nre=unionAll(t1,t2)\nre;\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 11 |\n| 2  | 12 |\n| 3  | 13 |\n| 4  | 14 |\n| 5  | 15 |\n| 6  | 16 |\n\n```\ntypestr(re);\n// output: IN-MEMORY TABLE\n```\n\nScenario 2. Combine multiple in-memory tables.\n\n```\nt1=table(1 2 3 as id, 11 12 13 as x)\nt2=table(4 5 6 as id, 14 15 16 as x)\nt3=table(7 8 as id, 17 18 as x)\nre=unionAll([t1,t2,t3])\nselect * from re;\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 11 |\n| 2  | 12 |\n| 3  | 13 |\n| 4  | 14 |\n| 5  | 15 |\n| 6  | 16 |\n| 7  | 17 |\n| 8  | 18 |\n\n```\ntypestr(re);\n// output: SEGMENTED IN-MEMORY TABLE\n```\n\nSpecifies *byColName*\n\n```\nt1=table(1 2 3 as id, 11 12 13 as x)\nt2=table(14 15 16 as x, 4 5 6 as id)\nunionAll(t1,t2,true);\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 11 |\n| 2  | 12 |\n| 3  | 13 |\n| 4  | 14 |\n| 5  | 15 |\n| 6  | 16 |\n\n```\nt1=table(1 2 3 as id, 11 12 13 as x)\nt2=table(14 15 16 as x, 4 5 6 as id)\nunionAll(t1,t2);\n```\n\n| id | x  |\n| -- | -- |\n| 1  | 11 |\n| 2  | 12 |\n| 3  | 13 |\n| 14 | 4  |\n| 15 | 5  |\n| 16 | 6  |\n\nFrom the examples above, please make sure column names and their order are identical in all tables to be combined if *byColName* is not specified (i.e., *byColName* =false).\n\n```\nt1=table(1 2 3 as id, 11 12 13 as x, 21 22 23 as y)\nt2=table(4 5 6 as id, 14 15 16 as x)\nunionAll(t1,t2,true);\n```\n\n| id | x  | y  |\n| -- | -- | -- |\n| 1  | 11 | 21 |\n| 2  | 12 | 22 |\n| 3  | 13 | 23 |\n| 4  | 14 |    |\n| 5  | 15 |    |\n| 6  | 16 |    |\n\n```\nt1=table(1 2 3 as id, 11 12 13 as x, 21 22 23 as y)\nt2=table(4 5 6 as id, 14 15 16 as x)\nunionAll(t1, t2) => The number of columns of the table to insert must be the same as that of the original table.\n```\n\nFrom the examples above, if the tables to be combined have different number of columns, we must set *byColName* =true.\n\nScenario 3: Combine multiple in-memory tables and a partitioned in-memory table. Update the partitioned in-memory table with the combination result.\n\n```\ndef testFunc(data, off){\n    return select *, price * (1-off) as `discountPrice from data\n}\nn = 100\ndates = 2021.01.01..2021.12.31\nt = table(take(dates, 365 * n).sort() as `date, `sym + take(1..n, 365 * n).sort()$STRING as `sym, round(10 + norm(0, 2, 365 * n), 2) as `price)\n\ndb = database(\"\", VALUE, 2021.01.01..2021.12.31)\ntrade = db.createPartitionedTable(table=t, tableName=\"trade\", partitionColumns=`date).append!(t)\ndb = database(\"\", RANGE, date(month(dates.first()) .. (month(dates.last()) + 1)))\noutputT=table(1:0, `date`sym`price`discountPrice, [DATE,SYMBOL,DOUBLE,DOUBLE])\nports = db.createPartitionedTable(outputT, \"ports\", `date)\n//map reduce\nmr(sqlDS(<select * from trade>), testFunc{,0.3},,unionAll{,ports})\n\nselect * from ports\n```\n"
    },
    "unloadVocab": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unloadVocab.html",
        "signatures": [
            {
                "full": "unloadVocab([vocabName])",
                "name": "unloadVocab",
                "parameters": [
                    {
                        "full": "[vocabName]",
                        "name": "vocabName",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [unloadVocab](https://docs.dolphindb.com/en/Functions/u/unloadVocab.html)\n\nFirst introduced in versions: 3.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\nunloadVocab(\\[vocabName])\n\n#### Details\n\nUnloads the specified vocabulary from memory.\n\n#### Parameters\n\n**vocabName** (optional) A STRING scalar specifying the name of the vocabulary to unload. If unspecified, all loaded vocabularies will be removed from memory.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nunloadVocab(\"vocab1\")\n```\n\nRelated functions: [loadVocab](https://docs.dolphindb.com/en/Functions/l/loadVocab.html), [tokenizeBert](https://docs.dolphindb.com/en/Functions/t/tokenizeBert.html)\n"
    },
    "unlockUser": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unlockUser.html",
        "signatures": [
            {
                "full": "unlockUser(userId)",
                "name": "unlockUser",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    }
                ]
            }
        ],
        "markdown": "### [unlockUser](https://docs.dolphindb.com/en/Functions/u/unlockUser.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nunlockUser(userId)\n\n#### Details\n\nUnlock the specified user\\*.\\* It can only be executed by administrators when the configuration parameter *enhancedSecurityVerification* is set to true.\n\n#### Parameters\n\n**userId** is a string indicating a user name.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nunlockUser(\"user1\")\n```\n\nRelated function: [lockUser](https://docs.dolphindb.com/en/Functions/l/lockUser.html)\n"
    },
    "unpack": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unpack.html",
        "signatures": [
            {
                "full": "unpack(format, buf)",
                "name": "unpack",
                "parameters": [
                    {
                        "full": "format",
                        "name": "format"
                    },
                    {
                        "full": "buf",
                        "name": "buf"
                    }
                ]
            }
        ],
        "markdown": "### [unpack](https://docs.dolphindb.com/en/Functions/u/unpack.html)\n\n\n\n#### Syntax\n\nunpack(format, buf)\n\n#### Details\n\nUnpack from the *buf* according to the format string specified by *format*. The result is a tuple with the unpacked data even if it contains exactly one item.\n\n#### Parameters\n\n**format** is a format string.\n\n* A format character may be preceded by an integral repeat count. For example, the format string '4h' means exactly the same as 'hhhh'.\n\n* Whitespace characters between formats are ignored; a count and its format must not contain whitespace though.\n\n* For the 's' format character, the count is interpreted as the length of the bytes, not a repeat count like for the other format characters; for example, '10s' means a single 10-byte string, while '10c' means 10 characters. If a count is not given, it defaults to 1. The string is truncated or padded with null bytes as appropriate to make it fit.\n\n**buf** is a bytes object of STRING or BLOB type. The size of *buf* in bytes must match the size required by the format.\n\n#### Returns\n\nIt returns a tuple with the unpacked data.\n\n#### Examples\n\n```\nres = pack(\"N\",1);\nres1 = unpack(\"N\", res);\nprint(res1)\n// output: (1)\n\nres = pack(\"3s i\", `123, 3)\nres1 = unpack(\"3s i\",  res);\nprint(res1)\n// output: (\"123\",3)\n\nres = pack(\"3s i\", `123, 3)\nres2 = unpack(\"3s i\",  blob(res));\nprint(res2)\n// output: (\"123\",3)\n```\n\nRelated function: [pack](https://docs.dolphindb.com/en/Functions/p/pack.html)\n\n#### Appendix\n\n##### Format Characters\n\nFormat mapping:\n\n| Format | C Type             | Python Type       | DolphinDB Type | Range                    |\n| ------ | ------------------ | ----------------- | -------------- | ------------------------ |\n| x      | pad byte           | no value          | VOID           |                          |\n| c      | char               | bytes of length 1 | CHAR           | -27 +1\\~27 -1            |\n| b      | signed char        | integer           | LONG           | -27 \\~27 -1              |\n| B      | unsigned char      | integer           | LONG           | 0\\~28 -1                 |\n| ?      | \\_Bool             | bool              | LONG           | -263 \\~263 -1            |\n| h      | short              | integer           | LONG           | -215 \\~215 -1            |\n| H      | unsigned short     | integer           | LONG           | 0\\~216 -1                |\n| i      | int                | integer           | LONG           | -231 \\~231 -1            |\n| I      | unsigned int       | integer           | LONG           | 0\\~232 -1                |\n| l      | long               | integer           | LONG           | -231\\~231 -1             |\n| L      | unsigned long      | integer           | LONG           | 0\\~232 -1                |\n| q      | long long          | integer           | LONG           | -263 \\~263 -1            |\n| Q      | unsigned long long | integer           | LONG           | 0\\~263 -1                |\n| n      | ssize\\_t           | integer           | LONG           | -263 \\~263 -1            |\n| N      | size\\_t            | integer           | LONG           | 0\\~263 -1                |\n| f      | float              | float             | LONG           | -3.40E+38 \\~ +3.40E+38   |\n| d      | double             | float             | LONG           | -1.79E+308 \\~ +1.79E+308 |\n| s      | char\\[]            | bytes             | STRING         |                          |\n| p      | char\\[]            | bytes             | STRING         |                          |\n| P      | void\\*             | integer           | LONG           | -263 \\~263 -1            |\n\n##### Byte Order, Size, and Alignment\n\n| Character      | Byte order    | Size     | Alignment |\n| -------------- | ------------- | -------- | --------- |\n| >              | big-endian    | standard | none      |\n| =              | native        | standard | none      |\n| <              | little-endian | standard | none      |\n| @              | native        | native   | native    |\n| !              | network       |          |           |\n| (= big-endian) | native        | none     |           |\n\nThe first character of the format string can be used to indicate the byte order, size and alignment of the packed data, see \"Appendix: Byte Order, Size and Alignment\". If the first character is not one of these characters, '@' is assumed.\n"
    },
    "unpivot": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unpivot.html",
        "signatures": [
            {
                "full": "unpivot(obj, keyColNames, valueColNames, [func])",
                "name": "unpivot",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "keyColNames",
                        "name": "keyColNames"
                    },
                    {
                        "full": "valueColNames",
                        "name": "valueColNames"
                    },
                    {
                        "full": "[func]",
                        "name": "func",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [unpivot](https://docs.dolphindb.com/en/Functions/u/unpivot.html)\n\n\n\n#### Syntax\n\nunpivot(obj, keyColNames, valueColNames, \\[func])\n\n#### Details\n\nConvert the columns specified by *valueColNames* into a single column.\n\n#### Parameters\n\n**obj** is a table.\n\n**keyColNames** is a STRING scalar/vector indicating column name(s).\n\n**valueColNames** is a vector of column names. The specified columns will be converted into a single column. Note the values in these columns must have the same data type.\n\n**func** (optional) indicates a function that is applied to *valueColNames* before they're converted into one column.\n\n#### Returns\n\nIt returns a table with columns arranged in the following order: the columns specified by *keyColNames*, the \"valueType\" column, and the \"value\" column:\n\n* The \"valueType\" column holds the results of *func*applied on the columns specified by *valueColNames*if *func*is specified, otherwise \"valueType\" holds the column names specified by *valueColNames*.\n\n* The \"value\" column holds the corresponding values of these columns.\n\n#### Examples\n\n```\nt=table(1..3 as id, 2010.01.01 + 1..3 as time, 4..6 as col1, 7..9 as col2, 10..12 as col3, `aaa`bbb`ccc as col4, `ddd`eee`fff as col5, 'a' 'b' 'c' as col6);\nt;\n```\n\n| id | time       | col1 | col2 | col3 | col4 | col5 | col6 |\n| -- | ---------- | ---- | ---- | ---- | ---- | ---- | ---- |\n| 1  | 2010.01.02 | 4    | 7    | 10   | aaa  | ddd  | 'a'  |\n| 2  | 2010.01.03 | 5    | 8    | 11   | bbb  | eee  | 'b'  |\n| 3  | 2010.01.04 | 6    | 9    | 12   | ccc  | fff  | 'c'  |\n\n```\nt.unpivot(`id, `col1`col2);\n```\n\n| id | valueType | value |\n| -- | --------- | ----- |\n| 1  | col1      | 4     |\n| 2  | col1      | 5     |\n| 3  | col1      | 6     |\n| 1  | col2      | 7     |\n| 2  | col2      | 8     |\n| 3  | col2      | 9     |\n\n```\nf = def(x): x.split(\"col\")[1];\nt.unpivot(`id, `col1`col2, f);\n```\n\n| id | valueType | value |\n| -- | --------- | ----- |\n| 1  | 1         | 4     |\n| 2  | 1         | 5     |\n| 3  | 1         | 6     |\n| 2  | 2         | 8     |\n| 3  | 2         | 9     |\n\n```\nt.unpivot(, `col1`col2);\n```\n\n| valueType | value |\n| --------- | ----- |\n| col1      | 4     |\n| col1      | 5     |\n| col1      | 6     |\n| col2      | 7     |\n| col2      | 8     |\n| col2      | 9     |\n\n```\nf = def(x): x.regexReplace(\"col\", \"var\")\nt.unpivot(`id, `col1`col2`col3, f);\n```\n\n| id | valueType | value |\n| -- | --------- | ----- |\n| 1  | var1      | 4     |\n| 2  | var1      | 5     |\n| 3  | var1      | 6     |\n| 1  | var2      | 7     |\n| 2  | var2      | 8     |\n| 3  | var2      | 9     |\n| 1  | var3      | 10    |\n| 2  | var3      | 11    |\n| 3  | var3      | 12    |\n\n```\nt.unpivot(`time, `col4`col5)\n```\n\n| time       | valueType | value |\n| ---------- | --------- | ----- |\n| 2010.01.02 | col4      | aaa   |\n| 2010.01.03 | col4      | bbb   |\n| 2010.01.04 | col4      | ccc   |\n| 2010.01.02 | col5      | ddd   |\n| 2010.01.03 | col5      | eee   |\n| 2010.01.04 | col5      | fff   |\n\n```\nt = table(1..3 as id, 2010.01.01 + 1..3 as time, 8.1 9.2 11.3 as bid1, 12.4 11.1 10.5 as bid2, 10.1 10.2 10.3 as bid3, 10.1 10.2 10.3 as bid4, 10.1 11.2 9.3 as bid5, 7.7 8.2 10.5 as ask1, 11.4 10.1 9.5 as ask2, 9.6 9.2 11.3 as ask3, 12.1 7.2 8.3 as ask4, 10.1 12.5 8.9 as ask5);\nt;\nt1 = t.unpivot(`id`time, `bid1`bid2`bid3`bid4`bid5);\nt2 = t.unpivot(, `ask1`ask2`ask3`ask4`ask5);\nre = rename!(t1, `valueType`value, `bid_type`bid_value) join rename!(t2, `valueType`value, `ask_type`ask_value)\nre;\n```\n\n| id | time       | bid\\_type | bid\\_value | ask\\_type | ask\\_value |\n| -- | ---------- | --------- | ---------- | --------- | ---------- |\n| 1  | 2010.01.02 | bid1      | 8.1        | ask1      | 8.1        |\n| 2  | 2010.01.03 | bid1      | 9.2        | ask1      | 9.2        |\n| 3  | 2010.01.04 | bid1      | 11.3       | ask1      | 11.3       |\n| 1  | 2010.01.02 | bid2      | 12.4       | ask2      | 12.4       |\n| 2  | 2010.01.03 | bid2      | 11.1       | ask2      | 11.1       |\n| 3  | 2010.01.04 | bid2      | 10.5       | ask2      | 10.5       |\n| 1  | 2010.01.02 | bid3      | 10.1       | ask3      | 10.1       |\n| 2  | 2010.01.03 | bid3      | 10.2       | ask3      | 10.2       |\n| 3  | 2010.01.04 | bid3      | 10.3       | ask3      | 10.3       |\n| 1  | 2010.01.02 | bid4      | 10.1       | ask4      | 10.1       |\n| 2  | 2010.01.03 | bid4      | 10.2       | ask4      | 10.2       |\n| 3  | 2010.01.04 | bid4      | 10.3       | ask4      | 10.3       |\n| 1  | 2010.01.02 | bid5      | 10.1       | ask5      | 10.1       |\n| 2  | 2010.01.03 | bid5      | 11.2       | ask5      | 11.2       |\n| 3  | 2010.01.04 | bid5      | 9.3        | ask5      | 9.3        |\n"
    },
    "unsubscribeStreamingSQL": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unsubscribeStreamingSQL.html",
        "signatures": [
            {
                "full": "unsubscribeStreamingSQL([server], queryId)",
                "name": "unsubscribeStreamingSQL",
                "parameters": [
                    {
                        "full": "[server]",
                        "name": "server",
                        "optional": true
                    },
                    {
                        "full": "queryId",
                        "name": "queryId"
                    }
                ]
            }
        ],
        "markdown": "### [unsubscribeStreamingSQL](https://docs.dolphindb.com/en/Functions/u/unsubscribeStreamingSQL.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nunsubscribeStreamingSQL(\\[server], queryId)\n\n#### Details\n\nUnsubscribe from the results of a specified streaming SQL query. After unsubscribing, the subscriber's real-time result table stops updating.\n\n#### Parameters\n\n**server** (optional) A STRING scalar representing the alias or remote connection handle of the node running streaming SQL query (i.e., the server where the query was registered). If not specified or an empty string, the server hosting the query is the local instance.\n\n**queryId** A STRING scalar representing the ID name for the streaming SQL query to unsubscribe.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\nregisterStreamingSQL(\"select avg(val) from st\",\"sql_avg\") \n\nsubscribeStreamingSQL(queryId=\"sql_avg\")\n// output: 52.1\n\nunsubscribeStreamingSQL(queryId=\"sql_avg\")\n```\n\n**Related functions:** [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html), [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html), [subscribeStreamingSQL](https://docs.dolphindb.com/en/Functions/s/subscribeStreamingSQL.html)\n"
    },
    "unsubscribeTable": {
        "url": "https://docs.dolphindb.com/en/Functions/u/unsubscribeTable.html",
        "signatures": [
            {
                "full": "unsubscribeTable([server], tableName, [actionName], [removeOffset=true], [raftGroup])",
                "name": "unsubscribeTable",
                "parameters": [
                    {
                        "full": "[server]",
                        "name": "server",
                        "optional": true
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[actionName]",
                        "name": "actionName",
                        "optional": true
                    },
                    {
                        "full": "[removeOffset=true]",
                        "name": "removeOffset",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [unsubscribeTable](https://docs.dolphindb.com/en/Functions/u/unsubscribeTable.html)\n\n\n\n#### Syntax\n\nunsubscribeTable(\\[server], tableName, \\[actionName], \\[removeOffset=true], \\[raftGroup])\n\n#### Details\n\nStop subscribing to data from the publisher. All messages of the topic in the message queue of the execution thread will be deleted.\n\nWhen `unsubscribeTable` is called, unprocessed messages in the queue of the stream execution thread will be deleted.\n\n#### Parameters\n\n**server** (optional) is a string indicating the alias of a server or the xdb connection to a server where the stream table is located. If it is unspecified or an empty string (\"\"), it means the local instance.\n\n**tableName** is a string indicating the name of the shared stream table to be unsubscribed on the aforementioned server.\n\n**actionName** (optional) is a string indicating the name assigned to the handler. It can have letters, digits and underscores. If actionName is specified when the subscription is initiated, it must be specified in unsubscribeTable as well.\n\n**removeOffset** (optional) is a Boolean value indicating whether to delete the offset of the latest record that has been calculated. (set *persistOffset* = true in [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html) to keep the offset of latest record.)\n\n**raftGroup** (optional) is the raft group ID specified in function `subscribeTable`. Specify it in `unsubscribeTable` to disable high availability on the subscriber.\n\n**Note:** The command `unsubscribeTable` can only be executed on the leader node if the parameter *raftGroup* is specified.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nCreate table \"trades\" on the publisher.\n\n```\nt=streamTable(100:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])\nshare t as trades\nt=NULL\n```\n\nCreate table \"trades2\" on the subscriber to stream data from table \"trades\" from the publisher:\n\n```\nt=streamTable(100:0,`date`time`sym`qty`price`exch,[DATE,TIME,SYMBOL,INT,DOUBLE,SYMBOL])\nshare t as trades2\nt=NULL\nh=xdb(\"localhost\",8902)\nsubscribeTable(server=h, tableName=\"trades\", actionName=\"sub1\", handler=trades2);\n// output: localhost:8902:node1/trades/sub1\n```\n\nTo unsubscribe from table \"trades\":\n\n```\nunsubscribeTable(h, \"trades\",\"sub1\");\n```\n"
    },
    "update!": {
        "url": "https://docs.dolphindb.com/en/Functions/u/update!.html",
        "signatures": [
            {
                "full": "update!(table, colNames, newValues, [filter])",
                "name": "update!",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "newValues",
                        "name": "newValues"
                    },
                    {
                        "full": "[filter]",
                        "name": "filter",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [update!](https://docs.dolphindb.com/en/Functions/u/update!.html)\n\n\n\n#### Syntax\n\nupdate!(table, colNames, newValues, \\[filter])\n\n#### Details\n\nUpdate columns of a table in place. If a column in *colNames* doesn't exist, create a new column; otherwise update the existing column. If a *filter* is specified, only rows satisfying the filtering condition will be updated.\n\nThis operation is parallel if the table is a partitioned table and if the parallel processing feature is enabled (when the configuration parameter *localExcutors* > 0).\n\n#### Parameters\n\n**table** is a DolphinDB table. It can be a partitioned in-memory table.\n\n**colNames** is a string scalar/vector indicating the columns to be updated.\n\n**newValues** is a piece of metacode with the operations for the specified columns. Metacode is objects or expressions within \"<\" and \">\". For details about metacode, please refer to [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n**filter** (optional) is a piece of metacode with filterting conditions.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nn=20000000\nworkDir = \"C:/DolphinDB/Data\"\nif(!exists(workDir)) mkdir(workDir)\ntrades=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)\ntrades.saveText(workDir + \"/trades.txt\");\n\ntrades = ploadText(workDir + \"/trades.txt\")\nselect top 10 * from trades;\n```\n\n| sym  | date       | price     | qty |\n| ---- | ---------- | --------- | --- |\n| MSFT | 2000.10.09 | 10.123936 | 569 |\n| IBM  | 2000.09.22 | 10.825785 | 834 |\n| MSFT | 2000.09.13 | 10.467937 | 418 |\n| IBM  | 2000.08.06 | 10.159152 | 252 |\n| IBM  | 2000.09.01 | 10.614444 | 400 |\n| MSFT | 2000.05.03 | 10.40847  | 253 |\n| MSFT | 2000.02.20 | 11.470027 | 431 |\n| YHOO | 2000.11.09 | 11.570013 | 518 |\n| GOOG | 2000.03.02 | 10.206973 | 630 |\n| C    | 2000.07.09 | 10.477621 | 287 |\n\n```\ntrades.update!(`qty, <qty+10>)\nselect top 10 * from trades;\n```\n\n| sym  | date       | price     | qty |\n| ---- | ---------- | --------- | --- |\n| MSFT | 2000.10.09 | 10.123936 | 579 |\n| IBM  | 2000.09.22 | 10.825785 | 844 |\n| MSFT | 2000.09.13 | 10.467937 | 428 |\n| IBM  | 2000.08.06 | 10.159152 | 262 |\n| IBM  | 2000.09.01 | 10.614444 | 410 |\n| MSFT | 2000.05.03 | 10.40847  | 263 |\n| MSFT | 2000.02.20 | 11.470027 | 441 |\n| YHOO | 2000.11.09 | 11.570013 | 528 |\n| GOOG | 2000.03.02 | 10.206973 | 640 |\n| C    | 2000.07.09 | 10.477621 | 297 |\n\n```\ntrades.update!(`qty`price, <[qty*2, price/2]>)\nselect top 10 * from trades;\n```\n\n| sym  | date       | price    | qty  |\n| ---- | ---------- | -------- | ---- |\n| MSFT | 2000.10.09 | 5.061968 | 1158 |\n| IBM  | 2000.09.22 | 5.412893 | 1688 |\n| MSFT | 2000.09.13 | 5.233969 | 856  |\n| IBM  | 2000.08.06 | 5.079576 | 524  |\n| IBM  | 2000.09.01 | 5.307222 | 820  |\n| MSFT | 2000.05.03 | 5.204235 | 526  |\n| MSFT | 2000.02.20 | 5.735014 | 882  |\n| YHOO | 2000.11.09 | 5.785007 | 1056 |\n| GOOG | 2000.03.02 | 5.103487 | 1280 |\n| C    | 2000.07.09 | 5.238811 | 594  |\n\n```\ntrades.update!(`qty`price, <[qty*2, price/2]>, <(sym in `IBM`MSFT`GM`GOOG) and date>=2000.07.01>)\nselect top 10 * from trades;\n```\n\n| sym  | date       | price    | qty  |\n| ---- | ---------- | -------- | ---- |\n| MSFT | 2000.10.09 | 2.530984 | 2316 |\n| IBM  | 2000.09.22 | 2.706446 | 3376 |\n| MSFT | 2000.09.13 | 2.616984 | 1712 |\n| IBM  | 2000.08.06 | 2.539788 | 1048 |\n| IBM  | 2000.09.01 | 2.653611 | 1640 |\n| MSFT | 2000.05.03 | 5.204235 | 526  |\n| MSFT | 2000.02.20 | 5.735014 | 882  |\n| YHOO | 2000.11.09 | 5.785007 | 1056 |\n| GOOG | 2000.03.02 | 5.103487 | 1280 |\n| C    | 2000.07.09 | 5.238811 | 594  |\n"
    },
    "updateLicense": {
        "url": "https://docs.dolphindb.com/en/Functions/u/updateLicense.html",
        "signatures": [
            {
                "full": "updateLicense()",
                "name": "updateLicense",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [updateLicense](https://docs.dolphindb.com/en/Functions/u/updateLicense.html)\n\n\n\n#### Syntax\n\nupdateLicense()\n\n#### Details\n\nUpdate the license without restarting the node.\n\nAfter replacing the license file, executing this function can update the license without restarting the node.\n\nThe rules for applying updated configurations are as follows:\n\n* **Effective immediately**: Updates to the expiration time (expiration) and the number of nodes (maxNodes) take effect immediately. After execution, you can use [getLicenseExpiration](https://docs.dolphindb.com/en/Functions/g/getLicenseExpiration.html) to check whether the license file has been updated.\n* **Restart required**: If configurations other than those above are modified, such as memory size (maxMemoryPerNode) or number of CPU cores (maxCoresPerNode), the DolphinDB Server must be restarted for the new license to take effect.\n\n**Note:**\n\n* The function only takes effect on the node where it is executed. For a cluster, it must be executed on all controllers, agents, and data nodes.\n\n* The license for update must satisfy the following conditions (which can be checked with function [license](https://docs.dolphindb.com/en/Functions/l/license.html)):\n\n  * The client name (clientName) and the authorization mode (authorization) of the license must be the same as the original license.\n\n  * The number of nodes (maxNodes), memory size (maxMemoryPerNode) and the number of CPU cores (maxCoresPerNode) authorized by the license cannot be smaller than the original ones.\n\n* Online update is not supported if the original authorization is site.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n\n#### Examples\n\n```\nupdateLicense()\n/* output:\nauthorization->commercial\nlicenseType->0\nmaxMemoryPerNode->32\nmaxCoresPerNode->8\nclientName->test license\nbindCPU->true\nexpiration->2022.03.01\nmaxNodes->8\nversion->\nmodules->-1\n*/\n```\n"
    },
    "updateMarketHoliday": {
        "url": "https://docs.dolphindb.com/en/Functions/u/updateMarketHoliday.html",
        "signatures": [
            {
                "full": "updateMarketHoliday(marketName, holiday)",
                "name": "updateMarketHoliday",
                "parameters": [
                    {
                        "full": "marketName",
                        "name": "marketName"
                    },
                    {
                        "full": "holiday",
                        "name": "holiday"
                    }
                ]
            }
        ],
        "markdown": "### [updateMarketHoliday](https://docs.dolphindb.com/en/Functions/u/updateMarketHoliday.html)\n\n#### Syntax\n\nupdateMarketHoliday(marketName, holiday)\n\n#### Details\n\nUpdates file of holiday dates or trading datesthe holiday calendar named *marketName* in memory online and synchronizes updates to the file in *marketHolidayDir*. If the file does not exist in memory, an error will be reported.\n\n**Note:**\n\n* It can only be executed by an administrator.\n\n* It only takes effect on the current node. In a cluster, `pnodeRun` can be used to call this function on all data/compute nodes.\n\n* If you have manually modified the trading calendar under *marketHolidayDir* and want to synchronize updates to memory without restarting the server, you can use function `loadText` to load the updated CSV file to an in-memory table and convert it to a vector (holiday), then update the holiday to memory by `updateMarketHoliday`.\n\n#### Parameters\n\n**marketName** is a STRING scalar, indicating the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name.\n\n**holiday** is a vector of DATE type, indicating weekday holidays.\n\n**holiday** is a vector of DATE type, indicating holiday dates or trading dates.\n\n* If the calendar uses holiday dates, *holiday* should be specified as the dates of weekday holidays.\n\n* If the calendar uses trading dates, *holiday* should be specified as trading dates.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\naddMarketHoliday(\"CFFEX\",2022.01.03 2022.01.05)\ntemporalAdd(2022.01.01,1,\"CFFEX\")\n// output: 2022.01.04\n\nindex = [2022.01.01, 2022.01.02, 2022.01.03, 2022.01.04]\ns = indexedSeries(index, 1..4)\ns.resample(\"CFFEX\", sum);\n```\n\n| label      | col1 |\n| ---------- | ---- |\n| 2021.12.31 | 6    |\n| 2022.01.04 | 4    |\n\n```\nupdateMarketHoliday(\"CFFEX\",2022.01.03 2022.01.04)\ntemporalAdd(2022.01.01,1,\"CFFEX\")\n// output: 2022.01.05\n```\n\nRelated functions: [addMarketHoliday](https://docs.dolphindb.com/en/Functions/a/addMarketHoliday.html), [getMarketCalendar](https://docs.dolphindb.com/en/Functions/g/getMarketCalendar.html)\n\n"
    },
    "updateMCPPrompt": {
        "url": "https://docs.dolphindb.com/en/Functions/u/updateMCPPrompt.html",
        "signatures": [
            {
                "full": "updateMCPPrompt(name, [message], [description], [extraInfo])",
                "name": "updateMCPPrompt",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[message]",
                        "name": "message",
                        "optional": true
                    },
                    {
                        "full": "[description]",
                        "name": "description",
                        "optional": true
                    },
                    {
                        "full": "[extraInfo]",
                        "name": "extraInfo",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [updateMCPPrompt](https://docs.dolphindb.com/en/Functions/u/updateMCPPrompt.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nupdateMCPPrompt(name, \\[message], \\[description], \\[extraInfo])\n\n#### Details\n\nUpdates an MCP prompt template.\n\nIf a parameter is not provided, the corresponding field is left unchanged. An empty string is ignored. Therefore, to clear the description, use a space instead of an empty string.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the prompt template.\n\n**message** is a STRING scalar indicating the content of the prompt template. It can contain the placeholder `{}`.\n\n**description** (optional) is a STRING scalar indicating the description of the prompt template.\n\n**extraInfo** (optional) is a dictionary with STRING keys and ANY or STRING values used to specify additional information. Currently support \"title\" only.\n\n#### Returns\n\nA string indicating the name of the updated MCP prompt template.\n\n#### Examples\n\n```\n// define a prompt template\naddMCPPrompt(\n  name = \"stock_summary\",\n  message = \"Summary the trend of ${stock} from ${startDate} to ${endDate}.\",\n  description = \"Generate a natural-language overview of a stock over a time period\",\n  extraInfo = {title : \"Stock Trend Summary\"}\n)\n\n// update a prompt template\nupdateMCPPrompt(\n  name = \"stock_summary\",\n  message = \"Summary the performance of ${stock} during ${startDate} to ${endDate}.\",\n  description = \"description after updating\"\n)\n```\n"
    },
    "updateMCPTool": {
        "url": "https://docs.dolphindb.com/en/Functions/u/updateMCPTool.html",
        "signatures": [
            {
                "full": "updateMCPTool(name, [func], [argNames], [argTypes], [description], [extraInfo])",
                "name": "updateMCPTool",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[func]",
                        "name": "func",
                        "optional": true
                    },
                    {
                        "full": "[argNames]",
                        "name": "argNames",
                        "optional": true
                    },
                    {
                        "full": "[argTypes]",
                        "name": "argTypes",
                        "optional": true
                    },
                    {
                        "full": "[description]",
                        "name": "description",
                        "optional": true
                    },
                    {
                        "full": "[extraInfo]",
                        "name": "extraInfo",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [updateMCPTool](https://docs.dolphindb.com/en/Functions/u/updateMCPTool.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nupdateMCPTool(name, \\[func], \\[argNames], \\[argTypes], \\[description], \\[extraInfo])\n\n#### Details\n\nUpdates an MCP tool.\n\nIf a parameter is not specified, the corresponding field remains unchanged. An empty string is treated as unspecified. To clear the field, pass a single space instead.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the tool name.\n\n**func** (optional) is a user-defined function.\n\n**argNames** (optional) is a STRING vector specifying the argument names. Pass `[]` if no parameters are required.\n\n**argTypes** (optional) is a STRING vector specifying the data types of arguments, which can be DolphinDB data types or JSON data types. Supported types include:\n\n| DolphinDB Type | JSON Type         |\n| -------------- | ----------------- |\n| STRING         | \"string\"          |\n| TEMPORAL       | \"string\"          |\n| DOUBLE         | \"number\"          |\n| BOOL           | \"boolean\"         |\n| STRING\\[]      | \"array\\<string>\"  |\n| TEMPORAL\\[]    | \"array\\<string>\"  |\n| DOUBLE\\[]      | \"array\\<number>\"  |\n| BOOL\\[]        | \"array\\<boolean>\" |\n\n**description** (optional) A STRING scalar describing the tool.\n\n**extraInfo** (optional) A dictionary where keys are strings and values are of type ANY or STRING, used to specify additional metadata. Currently, the key \"title\" is supported.\n\n#### Returns\n\nA string representing the name of the updated tool.\n\n#### Examples\n\n```\n// Define a tool\ndef myTool(x) {\n   return x * 2 + 1\n}\n\ninfo = {\n    \"title\": \"DolphinDB Tools\"\n}\n\naddMCPTool(\"myTool\", myTool, [\"a\"], [\"number\"], \"This is a tool\", info)\n\n// Update the tool \ndef myNewTool(x, y) {\n   return x * 2 + y\n}\n\nupdateMCPTool(\"myTool\", myNewTool, [\"a\",\"b\"], [\"number\",\"number\"], \" \")\n\n// Update only extra information\nnewInfo = {\n    \"title\": \"Updated Tools\"\n}\n\nupdateMCPTool(name=\"myTool\", extraInfo=newInfo)\n```\n"
    },
    "updatePKEYDeleteBitmap": {
        "url": "https://docs.dolphindb.com/en/Functions/u/updatePKEYDeleteBitmap.html",
        "signatures": [
            {
                "full": "updatePKEYDeleteBitmap(chunkId)",
                "name": "updatePKEYDeleteBitmap",
                "parameters": [
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    }
                ]
            }
        ],
        "markdown": "### [updatePKEYDeleteBitmap](https://docs.dolphindb.com/en/Functions/u/updatePKEYDeleteBitmap.html)\n\n\n\n#### Syntax\n\nupdatePKEYDeleteBitmap(chunkId)\n\n#### Details\n\nRefresh the PKEY engine's delete bitmap and clear the staging buffer when finished.\n\n#### Parameters\n\n**chunkId**is a STRING scalar or vector indicating the target chunk ID(s).\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nupdatePKEYDeleteBitmap(chunkId=\"1486f935-6f87-479c-b341-34c6a303d4f9\")\n```\n"
    },
    "updateRule": {
        "url": "https://docs.dolphindb.com/en/Functions/u/updateRule.html",
        "signatures": [
            {
                "full": "updateRule(engineName, key, rules, [add=false])",
                "name": "updateRule",
                "parameters": [
                    {
                        "full": "engineName",
                        "name": "engineName"
                    },
                    {
                        "full": "key",
                        "name": "key"
                    },
                    {
                        "full": "rules",
                        "name": "rules"
                    },
                    {
                        "full": "[add=false]",
                        "name": "add",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [updateRule](https://docs.dolphindb.com/en/Functions/u/updateRule.html)\n\n\n\n#### Syntax\n\nupdateRule(engineName, key, rules, \\[add=false])\n\n#### Details\n\nThis function updates the rule set associated with the specified key in the rule engine:\n\n* If the specified *key*does not exist in the rule engine, add the *rules*.\n\n* If the *key*already exists in the rule engine:\n\n  * If *add* is false, the existing rule set is replaced with the *rules*.\n\n  * If *add* is true, the *rules* is appended to the existing rule set.\n\n#### Parameters\n\n**engineName**is a STRING scalar indicating the engine name.\n\n**key**is a scalar of STRING or INT type that specifies the key of rule set to be updated.\n\n**rules**is a tuple of metacode indicating the rules to be updated.\n\n**add** (optional) is a boolean scalar that indicates whether the update operation should append to or overwrite the existing rules. The default value is false, meaning the existing rules will be overwritten.\n\n#### Returns\n\nReturns true if the operation succeeds; otherwise false.\n\n#### Examples\n\n```\n// create a rule engine\nx = [1, 2, NULL]\ny = [ [ < value>1 > ], [ < price<2 >, < price>6 > ], [ < value*price>10 > ] ]\nruleSets = dict(x, y)\nnames = `sym`value`price`quatity\ntypes = [INT, DOUBLE, DOUBLE, DOUBLE]\ndummy = table(10:0, names, types)\noutputNames = `sym`value`price`rule\noutputTypes = [INT, DOUBLE, DOUBLE, BOOL[]]\noutputTable = table(10:0, outputNames, outputTypes)\ntest = createRuleEngine(\"ruleEngineTest\",ruleSets,dummy ,`sym`value`price, outputTable,  \"all\",`sym)\n\ntest.append!(table(1 as sym, 0 as value, 2 as price, 3 as quatity))\ntest.append!(table(3 as sym, 6 as value, 1 as price, 3 as quatity))\n/* outputTable:\n1\t0\t2\t[false]\n3\t6\t1\t[false]\n*/\n\n// modify the rule for sym=1 to value >=0\nupdateRule(\"ruleEngineTest\", 1, [ <value >= 0>])\ntest.append!(table(1 as sym, 0 as value, 2 as price, 3 as quatity))\n/* outputTable:\n1\t0\t2\t[true]\n*/\n\n// add the rule value > 5 for sym=3  \nupdateRule(\"ruleEngineTest\",3,[<value>5>])\ntest.append!(table(3 as sym, 6 as value, 1 as price, 3 as quatity))\n/* outputTable:\n3\t6\t1\t[true]\n*/\n\n\n// create a rule engine\nx = [1, 2, NULL]\ny = [ [ < value>1 > ], [ < price<2 >, < price>6 > ], [ < value*price>10 > ] ]\nruleSets = dict(x, y)\nnames = `sym`value`price`quatity\ntypes = [INT, DOUBLE, DOUBLE, DOUBLE]\ndummy = table(10:0, names, types)\noutputNames = `sym`value`price`rule\noutputTypes = [INT, DOUBLE, DOUBLE, BOOL[]]\noutputTable = table(10:0, outputNames, outputTypes)\ntest = createRuleEngine(\"ruleEngineTest\",ruleSets,dummy ,`sym`value`price, outputTable,  \"all\",`sym)\n\ntest.append!(table(1 as sym, 0 as value, 2 as price, 3 as quatity))\ntest.append!(table(3 as sym, 6 as value, 1 as price, 3 as quatity))\n/* outputTable:\n1\t0\t2\t[false]\n3\t6\t1\t[false]\n*/\n\n// modify the rule for sym=1 to value >=0\nupdateRule(\"ruleEngineTest\", 1, [ <value >= 0>])\ntest.append!(table(1 as sym, 0 as value, 2 as price, 3 as quatity))\n/* outputTable:\n1\t0\t2\t[true]\n*/\n\n// add the rule value > 5 for sym=3  \nupdateRule(\"ruleEngineTest\",3,[<value>5>])\ntest.append!(table(3 as sym, 6 as value, 1 as price, 3 as quatity))\n/* outputTable:\n3\t6\t1\t[true]\n*/\n\n// add the rule value < 5 to the existing rule set for sym=1\nupdateRule(engineName=\"ruleEngineTest\", key=1, rules=[<value<5>], add=true)\ntest.append!(table(1 as sym, 12 as value, 1 as price, 3 as quatity))\n/* outputTable:\n1   12    1     [1,0]\n*/\n```\n"
    },
    "updateDataViewItems": {
        "url": "https://docs.dolphindb.com/en/Functions/u/update_data_view_items.html",
        "signatures": [
            {
                "full": "updateDataViewItems(engine, keys, valueNames, newValues)",
                "name": "updateDataViewItems",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "keys",
                        "name": "keys"
                    },
                    {
                        "full": "valueNames",
                        "name": "valueNames"
                    },
                    {
                        "full": "newValues",
                        "name": "newValues"
                    }
                ]
            }
        ],
        "markdown": "### [updateDataViewItems](https://docs.dolphindb.com/en/Functions/u/update_data_view_items.html)\n\n\n\n#### Syntax\n\nupdateDataViewItems(engine, keys, valueNames, newValues)\n\n#### Details\n\nUpdates the data with the specified keys from a data view engine. If the key column specified in *keys* does not exist, an error will be raised during deletion.\n\nThe `updateDataViewItems` functions can be called within a CEP engine context or outside of it.\n\n* Within a CEP engine: The system will first attempt to locate a data view engine handle with specified *engine* within the current CEP engine context. If a matching engine is found, the corresponding update operation will be performed. If no such engine, the system will then search for a data view engine with the same handle outside of the CEP engine context.\n\n* Outside a CEP engine: The system will search for and perform corresponding operation on a data view engine handle with specified *engine* only from the context outside of any CEP engine.\n\n#### Parameters\n\n**engine** is either the handle or the name of a data view engine.\n\n**keys** is a scalar, vector, or tuple, indicating the key(s) to be updated.\n\n**valueNames** is a STRING scalar or vector, indicating the columns (from the *outputTable* of `createDataViewEngine`) to be updated.\n\n**newValues** is a scalar, vector, or tuple, indicating the updated values.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nclass trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    eventTime :: TIMESTAMP\n    def trades(t, m, c, p, q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n        eventTime = now()\n    }\n}\n\nclass mainMonitor:CEPMonitor{\n    tradesTable :: ANY\n    isBusy :: BOOL\n    def mainMonitor(){\n        tradesTable = array(ANY, 0)\n        isBusy = false\n    }\n\n    def updateTrades(event)\n\n    def updateTrades2(event)\n\n    def unOnload(){\n        undef('traderDV', SHARED)\n    }\n\n    def onload(){\n        addEventListener(updateTrades, `trades, , \"all\",,,,,\"trades1\")\n        addEventListener(updateTrades2, `trades, , \"all\",,,,,\"trades2\")\n        traderDV = streamTable(array(STRING, 0) as trader, array(STRING, 0) as market, array(SYMBOL, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(INT, 0) as tradeCount, array(BOOL, 0) as busy, array(DATE, 0) as orderDate, array(TIMESTAMP, 0) as updateTime)\n        share(traderDV, 'traderDV')\n        createDataViewEngine('traderDV', objByName('traderDV'), `trader, `updateTime, true)\n    }\n\n    def updateTrades(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n\n    def updateTrades2(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\nengineCep = createCEPEngine('cep1', <mainMonitor()>, dummy, [trades], 1, 'eventTime', 10000)\ntrade1 = trades('t1', 'sz', 's001', 11.0, 10)\ngo\nappendEvent(engineCep, trade1)\n\nmonitors = getCEPEngineMonitor('cep1',\"cep1\",\"mainMonitor\")\n\nlisteners = monitors.getEventListener()\nprint(listeners)\nlisteners['trades1'].terminate()\nprint(listeners)\n```\n\n**Related functions**: [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [createDataViewEngine](https://docs.dolphindb.com/en/Functions/c/create_data_view_engine.html), [deleteDataViewItems](https://docs.dolphindb.com/en/Functions/d/delete_data_view_items.html), [dropDataViewEngine](https://docs.dolphindb.com/en/Functions/d/drop_data_view_engine.html), [getDataViewEngine](https://docs.dolphindb.com/en/Functions/g/get_data_view_engine.html)\n"
    },
    "updateStreamGraphUserTickets": {
        "url": "https://docs.dolphindb.com/en/Functions/u/update_stream_graph_user_tickets.html",
        "signatures": [
            {
                "full": "updateStreamGraphUserTickets()",
                "name": "updateStreamGraphUserTickets",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [updateStreamGraphUserTickets](https://docs.dolphindb.com/en/Functions/u/update_stream_graph_user_tickets.html)\n\n\n\n#### Syntax\n\nupdateStreamGraphUserTickets()\n\n#### Details\n\nWhen using the UDF Engine in Orca, the system automatically stores the authentication information of the user who created the stream graph. This ensures that user-defined functions in the UDF Engine inherit the same access permissions as that user.\n\nIf the authentication information becomes invalid, you can call this function to update the authentication state.\n\n#### Parameters\n\nNone\n\n#### Returns\n\nNone\n"
    },
    "upper": {
        "url": "https://docs.dolphindb.com/en/Functions/u/upper.html",
        "signatures": [
            {
                "full": "upper(X)",
                "name": "upper",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [upper](https://docs.dolphindb.com/en/Functions/u/upper.html)\n\n\n\n#### Syntax\n\nupper(X)\n\n#### Details\n\nConvert all characters in a string or a list of strings into upper cases.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nA STRING scalar/vector.\n\n#### Examples\n\n```\nx = `Ibm`C`AapL;\nx.upper();\n// output: [\"IBM\",\"C\",\"AAPL\"]\n\n(`Thl).upper();\n// output: THL\n```\n\nRelated function: [lower](https://docs.dolphindb.com/en/Functions/l/lower.html)\n"
    },
    "upsert!": {
        "url": "https://docs.dolphindb.com/en/Functions/u/upsert!.html",
        "signatures": [
            {
                "full": "upsert!(obj, newData, [ignoreNull=false], [keyColNames], [sortColumns])",
                "name": "upsert!",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "newData",
                        "name": "newData"
                    },
                    {
                        "full": "[ignoreNull=false]",
                        "name": "ignoreNull",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColNames]",
                        "name": "keyColNames",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns]",
                        "name": "sortColumns",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [upsert!](https://docs.dolphindb.com/en/Functions/u/upsert!.html)\n\n\n\n#### Syntax\n\nupsert!(obj, newData, \\[ignoreNull=false], \\[keyColNames], \\[sortColumns])\n\n#### Details\n\nInsert 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.\n\n**Note:**\n\n* 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.\n\n* If *obj* is a DFS table with duplicated \"keys\" (as specified by keyColNames), `upsert!` on rows with duplicated keys only updates the first row.\n\n* The behavior of this function is controlled by the *enableNullSafeJoin* configuration:\n  * When *enableNullSafeJoin*=true, joining on null values is allowed, and `upsert!` may update records that contain nulls.\n\n  * When enableNullSafeJoin=false, joining on null values is not allowed, and `upsert!` will not update records with nulls.\n\n#### Parameters\n\n**obj** is a keyed table, indexed table, or a DFS table.\n\n**newData** is an in-memory table.\n\n**ignoreNull** (optional) is a Boolean value. If set to true, for the null values in *newData*, the corresponding elements in *obj* are not updated. The default value is false.\n\n**keyColNames** (optional) is a STRING scalar/vector. When *obj* is a DFS table, *keyColNames* and the partitioning columns are considered as the key columns.\n\n**sortColumns** (optional) is a STRING scalar or vector. The updated partitions will be sorted on *sortColumns* (only within each partition, not across partitions).\n\n**Note:**\n\n* *sortColumns* is supported in `upsert!` only with the OLAP engine.\n* To specify *sortColumns*, *obj* must be a DFS table.\n* When *obj* is an empty table, setting *sortColumns* has no effect. That is, the system will not sort the inserted data.\n* Parameters *ignoreNull*, *keyColNames*, *sortColumns* are not supported for DFS tables in the PKEY database.\n\n#### Returns\n\nA table.\n\n#### Examples\n\n`upsert!` a keyed table:\n\n```\nsym=`A`B`C\ndate=take(2021.01.06, 3)\nx=1 2 3\ny=5 6 7\nt=keyedTable(`sym`date, sym, date, x, y)\nt;\n```\n\n| sym | date       | x | y |\n| --- | ---------- | - | - |\n| A   | 2021.01.06 | 1 | 5 |\n| B   | 2021.01.06 | 2 | 6 |\n| C   | 2021.01.06 | 3 | 7 |\n\n```\nnewData = table(`A`B`C`D as sym, take(2021.01.06, 4) as date, NULL NULL 300 400 as x, NULL 600 700 800 as y);\nnewData;\n```\n\n| sym | date       | x   | y   |\n| --- | ---------- | --- | --- |\n| A   | 2021.01.06 |     |     |\n| B   | 2021.01.06 |     | 600 |\n| C   | 2021.01.06 | 300 | 700 |\n| D   | 2021.01.06 | 400 | 800 |\n\n```\nupsert!(t, newData, ignoreNull=true)\nt;\n```\n\n| sym | date       | x   | y   |\n| --- | ---------- | --- | --- |\n| A   | 2021.01.06 | 1   | 5   |\n| B   | 2021.01.06 | 2   | 600 |\n| C   | 2021.01.06 | 300 | 700 |\n| D   | 2021.01.06 | 400 | 800 |\n\nThe example above is for the case when *ignoreNull* = true. Compare it with the following example where *ignoreNull* = false (by default).\n\n```\nsym=`A`B`C\ndate=take(2021.01.06, 3)\nx=1 2 3\ny=5 6 7\nt=keyedTable(`sym`date, sym, date, x, y)\nupsert!(t, newData)\nt;\n```\n\n| sym | date       | x   | y   |\n| --- | ---------- | --- | --- |\n| A   | 2021.01.06 |     |     |\n| B   | 2021.01.06 |     | 600 |\n| C   | 2021.01.06 | 300 | 700 |\n| D   | 2021.01.06 | 400 | 800 |\n\n`upsert!` a DFS table:\n\n```\nID=0 1 2 2\nx=0.1*0..3\nt=table(ID, x)\ndb=database(\"dfs://rangedb128\", VALUE,  0..10)\npt=db.createPartitionedTable(t, `pt, `ID)\npt.append!(t)\nselect * from pt;\n```\n\n| ID | x   |\n| -- | --- |\n| 0  | 0   |\n| 1  | 0.1 |\n| 2  | 0.2 |\n| 2  | 0.3 |\n\n```\nt1=table(1 as ID, 111 as x)\nupsert!(pt, t1, keyColNames=`ID)\nselect * from pt;\n```\n\n| ID | x   |\n| -- | --- |\n| 0  | 0   |\n| 1  | 111 |\n| 2  | 0.2 |\n| 2  | 0.3 |\n\n```\nt1=table(2 as ID, 222 as x)\nupsert!(pt, t1, keyColNames=`ID)\nselect * from pt;\n```\n\n| ID | x   |\n| -- | --- |\n| 0  | 0   |\n| 1  | 111 |\n| 2  | 222 |\n| 2  | 0.3 |\n\nUse `upsert!` to update a DFS table. If *ignoreNull* = true, the records in the target table corresponding to the null value of the new data will not be updated.\n\n```\nif(existsDatabase(\"dfs://valuedemo\")) {\n  dropDatabase(\"dfs://valuedemo\")\n}\ndb = database(\"dfs://valuedemo\", VALUE, 1..10)\nt = table(take(1..10, 100) as id, 1..100 as id2, 100..1 as value)\npt = db.createPartitionedTable(t, \"pt\", `id).append!(t)\nt2 = table( 1 2 as id, 1 2 as id2, 1 NULL as value)\nupsert!(pt, t2, true, \"id2\")\n```\n\n```\nif(existsDatabase(\"dfs://upsert\")) {\n  dropDatabase(\"dfs://upsert\")\n}\nsym=`A`B`C`A`D`B`A\ndate=take(2021.12.10,3) join take(2021.12.09, 3) join 2021.12.10\nprice=8.3 7.2 3.7 4.5 6.3 8.4 7.6\nval=10 19 13 9 19 16 10\nt=table(sym, date, price, val)\ndb=database(\"dfs://upsert\", VALUE,  `A`B`C)\npt=db.createPartitionedTable(t, `pt, `sym)\npt.append!(t)\nt1=table(`A`B`E as sym, take(2021.12.09, 3) as date, 11.1 10.5 6.9 as price, 12 9 11 as val)\nupsert!(pt, t1, keyColNames=`sym, sortColumns=`date`val)\nselect * from pt\n```\n\n| sym | date       | price | val |\n| --- | ---------- | ----- | --- |\n| A   | 2021.12.09 | 4.5   | 9   |\n| A   | 2021.12.09 | 11.1  | 12  |\n| A   | 2021.12.10 | 7.6   | 10  |\n| B   | 2021.12.09 | 10.5  | 9   |\n| B   | 2021.12.09 | 8.4   | 16  |\n| C   | 2021.12.10 | 3.7   | 13  |\n| D   | 2021.12.09 | 6.3   | 19  |\n| E   | 2021.12.09 | 6.9   | 11  |\n"
    },
    "useOrcaStreamEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/u/useOrcaStreamEngine.html",
        "signatures": [
            {
                "full": "useOrcaStreamEngine(name, func, args...)",
                "name": "useOrcaStreamEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [useOrcaStreamEngine](https://docs.dolphindb.com/en/Functions/u/useOrcaStreamEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nuseOrcaStreamEngine(name, func, args...)\n\n#### Details\n\nThis function locates the node where the specified orca stream engine is running, retrieves the stream engine object, and passes it as the first argument to the user-defined function *func*for execution.\n\nThis mechanism allows users to remotely invoke various stream engine operations from local machine, without needing to manually manage the bindings between nodes and stream engines.\n\n#### Parameters\n\n**name** is a string representing the name of the streaming egine. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_engine.engine\\_name\", or just the engine name, like \"engine\\_name\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**func**is a function to be executed on the node where the stream engine resides. This function must take at least one parameter; the system will automatically pass the stream engine object as the first argument.\n\n**args...** are additional arguments to be passed to `func`, similar to how arguments are passed in remote procedure calls ([rpc](https://docs.dolphindb.com/en/Functions/r/rpc.html)).\n\n#### Returns\n\nReturns the result of executing the user-specified function *func*.\n\n#### Examples\n\nCheck the status of the orca reactive state engine test.orca\\_engine.rse using the `getStreamEngineStateTable` function:\n\n```\nif (!existsCatalog(\"test\")) {\n\tcreateCatalog(\"test\")\n}\ngo;\nuse catalog test\n\nt = table(1..100 as id, 1..100 as value, take(09:29:00.000..13:00:00.000, 100) as timestamp)\ng = createStreamGraph(\"factor\")\nbaseStream = g.source(\"snapshot\",  1024:0, schema(t).colDefs.name, schema(t).colDefs.typeString)\n  .reactiveStateEngine([<ema(value, 100)>, <timestamp>])\n  .setEngineName(\"rse\")\n  .buffer(\"end\")\n  \ng.submit()\nuseOrcaStreamEngine(\"test.orca_engine.rse\", getStreamEngineStateTable)\n\n /*\n value ema(value, 100) timestamp\n----- --------------- ---------\n*/\n```\n\n**Related function:** [getOrcaStreamEngineMeta](https://docs.dolphindb.com/en/Functions/g/getOrcaStreamEngineMeta.html)\n"
    },
    "useOrcaStreamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/u/useOrcaStreamTable.html",
        "signatures": [
            {
                "full": "useOrcaStreamTable(name, func, args...)",
                "name": "useOrcaStreamTable",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [useOrcaStreamTable](https://docs.dolphindb.com/en/Functions/u/useOrcaStreamTable.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nuseOrcaStreamTable(name, func, args...)\n\n#### Details\n\nThis function locates the node where the specified orca stream table resides, retrieves the stream table object, and passes it as the first argument to the specified *func*for execution.\n\nThis mechanism allows users to remotely perform operations related to the stream table (e.g., `replay`, `getStreamTableFilterColumn`, etc.) from local machine without needing to manage the bindings between nodes and stream tables.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**func**is a function (built-in or user-defined) to be executed on the node where the stream table resides. This function must take at least one parameter; the system will automatically pass the stream table object as the first argument.\n\n**args…** are additional arguments to be passed to *func*, similar to how arguments are passed in remote procedure calls ([rpc](https://docs.dolphindb.com/en/Functions/r/rpc.html)).\n\n#### Returns\n\nReturns the result of executing the user-specified function *func*.\n\n#### Examples\n\nView the filter column of the stream table `demo.orca_table.transaction` using the built-in function `getStreamTableFilterColumn`:\n\n```\nuseOrcaStreamTable(\"demo.orca_table.transaction\", getStreamTableFilterColumn)\n```\n"
    },
    "uuid": {
        "url": "https://docs.dolphindb.com/en/Functions/u/uuid.html",
        "signatures": [
            {
                "full": "uuid(X)",
                "name": "uuid",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [uuid](https://docs.dolphindb.com/en/Functions/u/uuid.html)\n\n\n\n#### Syntax\n\nuuid(X)\n\n#### Details\n\nConvert STRING into UUID data type.\n\n#### Parameters\n\n**X** is a STRING scalar/vector.\n\n#### Returns\n\nA UUID scalar/vector.\n\n#### Examples\n\n```\nuuid(\"\");\n// output: 00000000-0000-0000-0000-000000000000\n\na=uuid(\"9d457e79-1bed-d6c2-3612-b0d31c1881f6\");\na;\n// output: 9d457e79-1bed-d6c2-3612-b0d31c1881f6\n\ntypestr(a);\n// output: UUID\n```\n"
    },
    "t3": {
        "url": "https://docs.dolphindb.com/en/Functions/t/t3.html",
        "signatures": [
            {
                "full": "t3(X, window, [vfactor=1.0])",
                "name": "t3",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[vfactor=1.0]",
                        "name": "vfactor",
                        "optional": true,
                        "default": "1.0"
                    }
                ]
            }
        ],
        "markdown": "### [t3](https://docs.dolphindb.com/en/Functions/t/t3.html)\n\n\n\n#### Syntax\n\nt3(X, window, \\[vfactor=1.0])\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Triple Exponential Moving Average (t3) for *X* in a sliding window of the given length.\n\nThe formula is\n\n![](https://docs.dolphindb.com/en/images/ema1.png)\n\n![](https://docs.dolphindb.com/en/images/ema2.png)\n\n![](https://docs.dolphindb.com/en/images/gd.png)\n\n![](https://docs.dolphindb.com/en/images/t3.png)\n\nDolphinDB `t3` and TA-Lib `T3` provide the same functionality, but differ in the following aspects:\n\n* Supported input types: DolphinDB `t3` supports vectors, matrices, and tables as inputs, whereas TA-Lib `T3` only supports one-dimensional arrays.\n* Default parameter values: The default value of the *vfactor* parameter is different between the two implementations.\n* Missing value handling: The two implementations handle missing values differently. For leading missing values, both preserve missing values at the beginning of the series and start the window calculation from the first non-missing value. For missing values that appear in the middle of the series, DolphinDB `t3` generally continues to calculate and return results according to its moving average rules, whereas TA-Lib may start returning NaN from that position onward for some indicators, affecting subsequent results.\n\n#### Parameters\n\n**vfactor** (optional) is a floating-point number in \\[0,1]. The default value is 1.0.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2 16.9 55.6 5.6 3.3 66 6 57\nt3(x, 3, 0.5);\n// output: [,,,,,,,,,,,,26.84,33.21]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2 15.7 18.6 13.2 19.6 20.3 22.4 11, 14 15 18 19 21 12 10 6 5.5 7 11 16 15 9.9)\nt3(x, 3, 0.8);\n```\n\n| col1  | col2  |\n| ----- | ----- |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n|       |       |\n| 20.76 | 13.47 |\n| 18.24 | 13.24 |\n\nRelated function: [tema](https://docs.dolphindb.com/en/Functions/t/tema.html)\n"
    },
    "table": {
        "url": "https://docs.dolphindb.com/en/Functions/t/table.html",
        "signatures": [
            {
                "full": "table(X, [X1], [X2], ...)",
                "name": "table",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": "...",
                        "name": "..."
                    }
                ]
            },
            {
                "full": "table(capacity:size, colNames, colTypes)",
                "name": "table",
                "parameters": [
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            }
        ],
        "markdown": "### [table](https://docs.dolphindb.com/en/Functions/t/table.html)\n\n\n\n#### Syntax\n\ntable(X, \\[X1], \\[X2], ...)\n\nor\n\ntable(capacity:size, colNames, colTypes)\n\n#### Details\n\n* For the first scenario: Converts vectors/matrices/tuples, or the combination of vectors and tuples into a table.\n* For the second scenario: Creates an empty or initialized table of fixed data types.\n\n#### Parameters\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n\n  * false for Boolean type;\n\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n\n  * Null value for Literal, INT128 types.\n\n  **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nExamples of `table(X, [X1], [X2], …..)`:\n\n```\nid=`XOM`GS`AAPL\nx=102.1 33.4 73.6\ntable(id, x);\n```\n\n| id   | x     |\n| ---- | ----- |\n| XOM  | 102.1 |\n| GS   | 33.4  |\n| AAPL | 73.6  |\n\n```\ntable(`XOM`GS`AAPL as id, 102.1 33.4 73.6 as x);\n```\n\n| id   | x     |\n| ---- | ----- |\n| XOM  | 102.1 |\n| GS   | 33.4  |\n| AAPL | 73.6  |\n\nIn the following example, table t is created from a vector x, a matrix y and a tuple z.\n\n```\nx=1..6\ny=matrix(11..16, 17..22)\nz=(101..106, 201..206)\nt=table(x,y,z)\nt.rename!(`x`y1`y2`z1`z2);\n\nt;\n```\n\n| x | y1 | y2 | z1  | z2  |\n| - | -- | -- | --- | --- |\n| 1 | 11 | 17 | 101 | 201 |\n| 2 | 12 | 18 | 102 | 202 |\n| 3 | 13 | 19 | 103 | 203 |\n| 4 | 14 | 20 | 104 | 204 |\n| 5 | 15 | 21 | 105 | 205 |\n| 6 | 16 | 22 | 106 | 206 |\n\nConvert a matrix into a table:\n\n```\nm=matrix(1 2, 3 4, 5 6);\nm;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nt=table(m).rename!(`a`b`x);\nt;\n```\n\n| a | b | x |\n| - | - | - |\n| 1 | 3 | 5 |\n| 2 | 4 | 6 |\n\nTuples with elements of the same type and equal length will be converted into multiple columns (with each element as a separate column), while tuples with mixed types or unequal element lengths will be converted into a column of type **ANY**:\n\n```\nid = 1 2 3\nval = [[1,2,3], [4,5,6],[7,8,9]]\nmetrics = [`A,[2.2 3.2], 3.2]\nt = table(id, val, metrics)\n```\n\n| **id** | **col1** | **col2** | **col3** | **metrics**  |\n| ------ | -------- | -------- | -------- | ------------ |\n| 1      | 1        | 4        | 7        | A            |\n| 2      | 2        | 5        | 8        | (\\[2.2,3.2]) |\n| 3      | 3        | 6        | 9        | 3.2          |\n\nExamples of `table(capacity:size, colNames, colTypes)`:\n\n```\ntable(100:5, `name`id`value, [STRING,INT,DOUBLE]);\n```\n\n| name | id | value |\n| ---- | -- | ----- |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n\n```\ntable(100:5, `name`id`value, `STRING`INT`DOUBLE);\n```\n\n| name | id | value |\n| ---- | -- | ----- |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n|      | 0  | 0     |\n\n```\ntable(100:1, [`value], [DOUBLE]);\n```\n\n| value |\n| ----- |\n| 0     |\n"
    },
    "tableInsert": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tableInsert.html",
        "signatures": [
            {
                "full": "tableInsert(table, args...)",
                "name": "tableInsert",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [tableInsert](https://docs.dolphindb.com/en/Functions/t/tableInsert.html)\n\n\n\n#### Syntax\n\ntableInsert(table, args...)\n\n#### Details\n\nInsert *args*... into table. Return the number of rows inserted from the operation.\n\nIf *args*... is a table, it must have the same schema as table. If *table* is a partitioned table, *args*... must be a table.\n\nIf *args*... is a tuple, it must have the same number of elements as the number of columns of *table* and each element of *args*... must have the same data type as the corresponding column of table.\n\nIf *args*... is multiple vectors or tuples, the number of its elements must be the same as the number of columns of *table* and each vector or tuple must have the same data type as the corresponding column of table.\n\nIf *args*... is a dictionary, its keys correspond to the column names of *table*. The values of *args*... must be a tuple. For this scenario *table* must be an in-memory table.\n\n#### Parameters\n\n**table** is a table object or a table name. The table can be either an in-memory table or a DFS table. In remote call, it must be a table name as we don't have the reference of a table object.\n\n**args...** can be a table/tuple/dictionary.\n\n#### Returns\n\nA scalar of type INT.\n\n#### Examples\n\n```\ncolName=[\"Name\",\"Age\"]\ncolType=[\"string\",\"int\"]\nt1=table(100:0,colName, colType);\n\nname=`Tom`Jerry`John\nage=24 25 26\nt2=table(name, age)\n\ntableInsert(t1, t2);\n// output: 3\n\nt1;\n```\n\n| Name  | Age |\n| ----- | --- |\n| Tom   | 24  |\n| Jerry | 25  |\n| John  | 26  |\n\n```\ntableInsert(t1, (`George, 29));\n// output: 1\n\nt1;\n```\n\n| Name   | Age |\n| ------ | --- |\n| Tom    | 24  |\n| Jerry  | 25  |\n| John   | 26  |\n| George | 29  |\n\n```\ntableInsert(t1, (`Frank`Henry, 31 32));\n// output: 2\n\ntableInsert(t1, `Nicole`Nancy, 28 29);\n// output: 2\n\nt1.tableInsert(dict(`Name`Age, [`Patrick, 22]));\n// output: 1\n```\n\nInsert data into a DFS table:\n\n```\ndb=database(\"dfs://db1\",RANGE,0 20 50 101)\nn=100000\nid=rand(100,n)\nval=rand(100.0,n)\nt=table(id,val)\npt=db.createPartitionedTable(t,`pt,`id).append!(t);\n\ntmp=table(rand(100,10000) as id,take(200.0,10000) as val);\n\ntableInsert(pt,tmp);\n// output: 10000\n```\n"
    },
    "tableUpsert": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tableupsert.html",
        "signatures": [
            {
                "full": "tableUpsert(obj, newData, [ignoreNull=false], [keyColNames], [sortColumns])",
                "name": "tableUpsert",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "newData",
                        "name": "newData"
                    },
                    {
                        "full": "[ignoreNull=false]",
                        "name": "ignoreNull",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[keyColNames]",
                        "name": "keyColNames",
                        "optional": true
                    },
                    {
                        "full": "[sortColumns]",
                        "name": "sortColumns",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [tableUpsert](https://docs.dolphindb.com/en/Functions/t/tableupsert.html)\n\n\n\n#### Syntax\n\ntableUpsert(obj, newData, \\[ignoreNull=false], \\[keyColNames], \\[sortColumns])\n\n#### Details\n\nInsert rows into a table if the values with the key do not already exist, or update them if they do.\n\nThe usage of `tableUpsert` and `upsert!` is consistent, with the difference being that `tableUpsert` returns the number of involved records, while `upsert!` performs an in-place modification, which is often used to chain operations.\n\n**Note:**\n\n* 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.\n\n* If *obj* is a DFS table with duplicated \"keys\" (as specified by keyColNames), `tableUpsert` on rows with duplicated keys only updates the first row.\n\n* The behavior of this function is controlled by the *enableNullSafeJoin* configuration:\n  * When *enableNullSafeJoin*=true, joining on null values is allowed, and `tableUpsert` may update records that contain nulls.\n\n  * When enableNullSafeJoin=false, joining on null values is not allowed, and `tableUpsert` will not update records with nulls.\n\n#### Parameters\n\n**obj** is a keyed table, indexed table, or a DFS table.\n\n**newData** is an in-memory table.\n\n**ignoreNull** (optional) is a Boolean value. If set to true, for the null values in *newData*, the corresponding elements in obj are not updated. The default value is false.\n\n**keyColNames** (optional) is a STRING scalar/vector. When *obj* is a DFS table, *keyColNames* are considered as the key columns.\n\n**sortColumns** (optional) is a STRING scalar or vector. The updated partitions will be sorted on *sortColumns* (only within each partition, not across partitions).\n\n**Note:**\n\n* *sortColumns* is supported in `upsert!` only with the OLAP engine.\n\n* To specify *sortColumns*, *obj* must be a DFS table.\n\n* When *obj* is an empty table, setting *sortColumns* has no effect. That is, the system will not sort the inserted data.\n\n#### Returns\n\nA LONG pair. The first element represents the number of inserted records, and the second represents the number of updated records.\n\n#### Examples\n\nUse `tableUpsert` on a keyed table:\n\n```\nsym=`A`B`C\ndate=take(2021.01.06, 3)\nx=1 2 3\ny=5 6 7\nt=keyedTable(`sym`date, sym, date, x, y)\nnewData = table(`A`B`C`D as sym1, take(2021.01.06, 4) as date1, NULL NULL 300 400 as x1, NULL 600 700 800 as y1);\ntableUpsert(t, newData, ignoreNull=true)\n// output: 1:2\n```\n\nUsed `tableUpsert` on an indexed table:\n\n```\nsym=`A`B`C\ndate=take(2021.01.06, 3)\nx=1 2 3\ny=5 6 7\nt=indexedTable(`sym`date, sym, date, x, y)\nnewData = table(`A`B`C`D as sym1, take(2021.01.06, 4) as date1, NULL NULL 300 400 as x1, NULL 600 700 800 as y1);\ntableUpsert(t, newData, ignoreNull=true)\n// output: 1:2\n```\n\nUse `tableUpsert` on a DFS table:\n\n```\nID=0 1 2 2\nx=0.1*0..3\nt=table(ID, x)\ndb=database(\"dfs://rangedb128\", VALUE,  0..10)\npt=db.createPartitionedTable(t, `pt, `ID)\npt.append!(t)\nt1=table(1 as ID, 111 as x)\ntableUpsert(pt, t1, keyColNames=`ID)\n// output: 0:1\n```\n"
    },
    "tail": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tail.html",
        "signatures": [
            {
                "full": "tail(obj, [n=1])",
                "name": "tail",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [tail](https://docs.dolphindb.com/en/Functions/t/tail.html)\n\n\n\n#### Syntax\n\ntail(obj, \\[n=1])\n\n#### Details\n\nReturn the last n element(s) of a vector, or the last n columns of a matrix, or the last n rows of a table.\n\n#### Parameters\n\n**obj** is a vector/matrix/table.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nAn object with the same data type and form as *object*.\n\n#### Examples\n\n```\nx=1..10;\ntail(x);\n// output: 10\n\ntail(x,2);\n// output: [9,10]\n\nx=1..10$2:5;\nx;\n```\n\n| #0 | #1 | #2 | #3 | #4 |\n| -- | -- | -- | -- | -- |\n| 1  | 3  | 5  | 7  | 9  |\n| 2  | 4  | 6  | 8  | 10 |\n\n```\nx.tail();\n// output: [9,10]\n\ntail(x,2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 7  | 9  |\n| 8  | 10 |\n\n```\nx=table(1..5 as a, 6..10 as b);\nx;\n```\n\n| a | b  |\n| - | -- |\n| 1 | 6  |\n| 2 | 7  |\n| 3 | 8  |\n| 4 | 9  |\n| 5 | 10 |\n\n```\ntail(x);\n/* output:\nb->10\na->5\n*/\n\nx.tail(2);\n```\n\n| a | b  |\n| - | -- |\n| 4 | 9  |\n| 5 | 10 |\n\nRelated function: [head](https://docs.dolphindb.com/en/Functions/h/head.html)\n"
    },
    "take": {
        "url": "https://docs.dolphindb.com/en/Functions/t/take.html",
        "signatures": [
            {
                "full": "take(X, n)",
                "name": "take",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [take](https://docs.dolphindb.com/en/Functions/t/take.html)\n\n\n\n#### Syntax\n\ntake(X, n)\n\n#### Details\n\n* If *X* is a scalar (*n* must also be a scalar): Generates a vector containing *n* identical values of *X*.\n\n* If *X* is a vector or a tuple:\n\n  * if *n* is a scalar: takes *n* elements from *X* sequentially. It can be left to right (if *n* > 0) or right to left (if *n* < 0). The result is a vector.\n\n  * if *n* is a vector (must be of the same length as *X*): takes *n\\[i]* copies of *X\\[i]*. If *n\\[i]* <= 0, it skips *X\\[i]*. The result is a vector.\n\n* If *X* is a matrix or table:\n\n  * if *n* is a scalar: It takes *n* rows of *X* sequentially, either from top to bottom (if *n* > 0) or bottom to top (if *n* < 0). The result is a matrix or table.\n\n  * if *n* is a vector (must be of the same length as the number of rows in *X*): takes *n\\[i]* copies of the element at the *i-th* row of *X*. If *n\\[i]* <= 0, it skips the *i-th* row and takes no elements. The result is a matrix or table.\n\n**Note:**\n\nDolphinDB `take` and [numpy.take](https://numpy.org/doc/stable/reference/generated/numpy.take.html) are both used for value retrieval. The differences are as follows:\n\n* DolphinDB `take` retrieves a specified number of elements or rows sequentially from a scalar, vector, matrix, or table. If the requested number exceeds the length of the original object, values are taken cyclically. When *n* is a vector, it specifies the repetition count for each element or row.\n\n* `numpy.take` extracts elements from an array according to indices. Its second parameter, *indices*, specifies index positions rather than the number of values to retrieve, and it also supports the *axis* and *mode* parameters.\n\n#### Parameters\n\n**X** is a scalar/vector/tuple/matrix/table.\n\n**n** is an integer or a vector of integers.\n\n#### Examples\n\n```\ntake(10,5);\n// output: [10,10,10,10,10]\n\nx=`IBM`C`AAPL`BABA;\ntake(x,10);\n// output: [\"IBM\",\"C\",\"AAPL\",\"BABA\",\"IBM\",\"C\",\"AAPL\",\"BABA\",\"IBM\",\"C\"]\n// sequentially and iteratively take 10 elements from vector x\n\nx=3 5 4 6 9;\ntake(x,3);\n// output: [3,5,4]\n\n\nx=1..3;\nx.take(10);\n// output: [1,2,3,1,2,3,1,2,3,1]\n\ntake(1 2 3, 10);\n// output: [1,2,3,1,2,3,1,2,3,1]\n\n\ntake(1,10);\n// output: [1,1,1,1,1,1,1,1,1,1]\n// an efficient way to generate a vector with default values.\n\n\nx=take(1,0);\n// return an empty INT VECTOR\n\nx;\n// output: []\n\ntypestr x;\n// output: FAST INT VECTOR\n```\n\n```\nx=1..12$3:4;\ntake(x,2);\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 1    | 4    | 7    | 10   |\n| 2    | 5    | 8    | 11   |\n\n```\ntake(x,-2);\n```\n\n| col1 | col2 | col3 | col4 |\n| ---- | ---- | ---- | ---- |\n| 2    | 5    | 8    | 11   |\n| 3    | 6    | 9    | 12   |\n\n```\ntake(1..3,2 0 2)\n// output\n[1,1,3,3]\n```\n\n```\nm=matrix(1 2 3, 4 5 6)\ntake(m,5)\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 4    |\n| 2    | 5    |\n| 3    | 6    |\n| 1    | 4    |\n| 2    | 5    |\n\n```\ntake(m, 0 2 1)\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 2    | 5    |\n| 2    | 5    |\n| 3    | 6    |\n\n```\nt=table(1 2 3 as a, 4 5 6 as b)\ntake(t,-4)\n```\n\n| a | b |\n| - | - |\n| 3 | 6 |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\ntake(t, -2 2 1)\n```\n\n| a | b |\n| - | - |\n| 2 | 5 |\n| 2 | 5 |\n| 3 | 6 |\n"
    },
    "talibNull": {
        "url": "https://docs.dolphindb.com/en/Functions/t/talibNull.html",
        "signatures": [
            {
                "full": "talibNull(args...)",
                "name": "talibNull",
                "parameters": [
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [talibNull](https://docs.dolphindb.com/en/Functions/t/talibNull.html)\n\n\n\n#### Syntax\n\ntalibNull(args...)\n\n#### Details\n\nTraverse each vector (v1, v2, …, vn) based on the index starting from 0 and return a tuple.\n\nIf all values at index i (v1\\[i], v2\\[i], ..., vn\\[i] ) are non-null values, then the elements at index 0 to index i take the null values, and values of the element after index i remain unchanged.\n\n#### Parameters\n\n**args...** consist of two or more vectors. All vectors must have the same length.\n\n#### Returns\n\nA tuple.\n\n#### Examples\n\nThe values at index 2 of all vectors are non-null. Therefore, return null values for all elements before index 2.\n\n```\ntalibNull(2 3 4 5 6, NULL 1 2 NULL 4, 7 NULL 9 10 11)\n// output: ([,,4,5,6],[,,2,,4],[,,9,10,11])\n```\n"
    },
    "tan": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tan.html",
        "signatures": [
            {
                "full": "tan(X)",
                "name": "tan",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [tan](https://docs.dolphindb.com/en/Functions/t/tan.html)\n\n\n\n#### Syntax\n\ntan(X)\n\n#### Details\n\nThe tangent function.\n\n**Note:**\n\n* DolphinDB's `tan` function accepts only one argument and supports calculations on scalars, vectors, and matrices. By contrast, NumPy's `tan` function is a generalized ufunc that supports N-dimensional arrays of any shape. You can control the output and apply conditional computation through parameters such as *out*and *where*.\n* DolphinDB `tan` and TA-Lib `TAN` provide the same functionality. The difference is that DolphinDB `tan` supportsscalars, vectors, and matrices as inputs, whereas TA-Lib `TAN` only supports one-dimensional arrays.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\ntan(0 1 2);\n// output: [0,1.557408,-2.185040]\n```\n\nRelated functions: [asin](https://docs.dolphindb.com/en/Functions/a/asin.html), [acos](https://docs.dolphindb.com/en/Functions/a/acos.html), [atan](https://docs.dolphindb.com/en/Functions/a/atan.html), [sin](https://docs.dolphindb.com/en/Functions/s/sin.html), [cos](https://docs.dolphindb.com/en/Functions/c/cos.html).\n"
    },
    "tanh": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tanh.html",
        "signatures": [
            {
                "full": "tanh(X)",
                "name": "tanh",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [tanh](https://docs.dolphindb.com/en/Functions/t/tanh.html)\n\n\n\n#### Syntax\n\ntanh(X)\n\n#### Details\n\nThe hyperbolic tangent function.\n\n**Note:** DolphinDB's `tanh` function accepts only one argument and supports calculations on scalars, vectors, and matrices. By contrast, NumPy's `tanh` function is a generalized ufunc that supports N-dimensional arrays of any shape. You can control the output and apply conditional computation through parameters such as *out* and *where*. TA-Lib's `TANH` is a Math Transform function whose *close* input and output are primarily one-dimensional arrays.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\ntanh(0 1 2);\n// output: [0,0.761594,0.964028]\n```\n"
    },
    "tanimoto": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tanimoto.html",
        "signatures": [
            {
                "full": "tanimoto(X, Y)",
                "name": "tanimoto",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [tanimoto](https://docs.dolphindb.com/en/Functions/t/tanimoto.html)\n\n\n\n#### Syntax\n\ntanimoto(X, Y)\n\n#### Details\n\nIf *X* and *Y* are scalars or vectors, return the result of their tanimoto distance.\n\nIf *X* or *Y* is a matrix, return a vector that is the result of the tanimoto distance between elements in each column. Note that if both *X* and *Y* are indexed matrices or indexed series, return the results of rows with the same label. Rows with different labels will be ignored.\n\nAs with all other aggregate functions, null values are ignored in the calculation.\n\nHere is the formula of Tanimoto similarity (similar). Tanimoto distance is calculated as 1-similar.\n\n#### Parameters\n\n**X** and **Y** are numeric scalars, or vectors/matrices of the same size.\n\n#### Returns\n\nA scalar or vector of type DOUBLE.\n\n#### Examples\n\n```\na=[10.5, 11.8, 9]\nb=[11.3, 15.1, 8.9]\ntanimoto(a,b)\n// output: 0.029706\n\ns1=indexedSeries(2020.01.01..2020.01.03, 10.4 11.2 9)\ns2=indexedSeries(2020.01.01 2020.01.03 2020.01.04, 23.5 31.2 26)\ntanimoto(s1,s2)\n// output: 0.5585\n\nm=matrix(23 56 47, 112 94 59)\nm1=matrix(11 15 89, 52 41 63)\ntanimoto(m,m1)\n// output: [0.40490.3242]\n\nm.rename!(2020.01.01..2020.01.03, `A`B)\nm.setIndexedMatrix!()\nm1.rename!(2020.01.01 2020.01.03 2020.01.04, `A`B)\nm1.setIndexedMatrix!()\ntanimoto(m,m1)\n// output: [0.5494,0.3225]\n```\n\nRelated function: [rowTanimoto](https://docs.dolphindb.com/en/Functions/r/rowTanimoto.html)\n"
    },
    "tema": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tema.html",
        "signatures": [
            {
                "full": "tema(X, window)",
                "name": "tema",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tema](https://docs.dolphindb.com/en/Functions/t/tema.html)\n\n\n\n#### Syntax\n\ntema(X, window)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Triple Exponential Moving Average (tema) for *X* in a sliding window of the given length.\n\nThe formula is:\n\n![](https://docs.dolphindb.com/en/images/ema1.png)\n\n![](https://docs.dolphindb.com/en/images/ema2.png)\n\n![](https://docs.dolphindb.com/en/images/tema.png)\n\nDifference from Python TA-Lib's `TEMA`: Both functions calculate the Triple Exponential Moving Average. TA-Lib's `TEMA` is an Overlap Studies indicator whose *timeperiod* parameter defaults to 30; its *close* input and output are primarily one-dimensional arrays. DolphinDB's `tema` uses the required *window* parameter for the window length, accepts a vector, matrix, or table, returns the same data form as *X*, and uses NULL for unfilled windows.\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\ntema(x,3);\n// output: [,,,,,,11.24444444444444]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\ntema(x,3);\n```\n\n| col1    | col2    |\n| ------- | ------- |\n|         |         |\n|         |         |\n|         |         |\n|         |         |\n|         |         |\n|         |         |\n| 11.2444 | 10.6296 |\n\nRelated functions: [ema](https://docs.dolphindb.com/en/Functions/e/ema.html), [dema](https://docs.dolphindb.com/en/Functions/d/dema.html)\n"
    },
    "temporalAdd": {
        "url": "https://docs.dolphindb.com/en/Functions/t/temporalAdd.html",
        "signatures": [
            {
                "full": "temporalAdd(obj, duration, unit)",
                "name": "temporalAdd",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "duration",
                        "name": "duration"
                    },
                    {
                        "full": "unit",
                        "name": "unit"
                    }
                ]
            }
        ],
        "markdown": "### [temporalAdd](https://docs.dolphindb.com/en/Functions/t/temporalAdd.html)\n\n\n\n#### Syntax\n\ntemporalAdd(obj, duration, unit)\n\nAlias: datetimeAdd\n\n#### Details\n\nAdd a value to a temporal variable.\n\n#### Parameters\n\n**obj** is a temporal scalar/pair/vector.\n\n**duration** is an integer.\n\n**unit** is a STRING vector.\n\n* When parameter *duration* is an integer, *unit* is:\n\n  * the unit of parameter *duration*. It can be \"ns\"(nanosecond), \"us\"(microsecond), \"ms\"( millisecond), \"s\"(second), \"m\"(minute), \"H\"(hour), \"d\"(day), \"w\"(week), \"M\"(month), \"y\"( year), or \"B\"(business day).\n\n  * the identifier of trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name. The corresponding file must be saved in *marketHolidayDir*.\n\n* When *duration* is of DURATION type, this parameter is not required.\n\n**Note:** When *unit* is \"y\" or \"M\", the result is consistent with mysql. Pandas provides an offset object *Dateoffsets* to move dates forward a given number of valid dates. When the *DateOffset* parameter is specified as months or years, the result is also consistent with *temporalAdd*.\n\n#### Returns\n\nA temporal scalar or vector.\n\n#### Examples\n\n```\ntemporalAdd(2017.01.16,1,\"d\");\n// output: 2017.01.17\n\ntemporalAdd(2017.01.16,1,\"w\");\n// output: 2017.01.23\n\ntemporalAdd(2016.12M,2,\"M\");\n// output: 2017.02M\n\ntemporalAdd(2012.07.31T13:30:10.008,-1,'M');\n// output: 2012.06.30T13:30:10.008\n\ntemporalAdd(2012.07.31T13:30:10.008,1,'y');\n// output: 2013.07.31T13:30:10.008\n\ntemporalAdd(13:30:10.008007006,100,\"ns\");\n// output: 13:30:10.008007106\n\nx=[12:23:34, 23:34:45];\ntemporalAdd(x, 10m);\n// output: [12:33:34,23:44:45]\n```\n\nAdd four business days to 2021.08.06.\n\n```\ntemporalAdd(2021.08.06, 4B)\n// output: 2021.08.12\n```\n\nAdd 2 trading days for \"date\" according to the trading calendar CFFEX.\n\n```\ndate=[2023.01.01, 2023.01.02, 2023.01.03, 2023.01.04]\ntemporalAdd(date,2,`CFFEX)\n// output: [2023.01.04,2023.01.04,2023.01.05,2023.01.06]\n```\n\n```\ntemporalAdd(datetime(2020.08.31), -2M)\n// output: 2020.06.30T00:00:00\n\n//The result is the same as setting months=2 in pandas *DateOffset*.\npd1 = pd.Timestamp(\"2020.08.31\")\nprint(pd1 -pd.offsets.DateOffset(months=2))\n// output: 2020-06-30 00:00:00\n\ntemporalAdd(datetime(2020.02.29), -1y)\n// output: 2019.02.28T00:00:00\ntemporalAdd(datetime(2020.02.29), -4y)\n// output: 2016.02.29T00:00:00\n\n//The result is the same as setting years=1 in pandas *DateOffset*.\npd1 = pd.Timestamp(\"2020.02.29\")\nprint(pd1 - pd.offsets.DateOffset(years=1))\n// output: 2019-02-28 00:00:00\n\n//The result is the same as setting years=4 in pandas *DateOffset*.\npd2 = pd.Timestamp(\"2020.02.29\")\nprint(pd2 - pd.offsets.DateOffset(years=4))\n// output: 2016-02-29 00:00:00\n```\n"
    },
    "temporalDeltas": {
        "url": "https://docs.dolphindb.com/en/Functions/t/temporalDeltas.html",
        "signatures": [
            {
                "full": "temporalDeltas(X, [unit])",
                "name": "temporalDeltas",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[unit]",
                        "name": "unit",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [temporalDeltas](https://docs.dolphindb.com/en/Functions/t/temporalDeltas.html)\n\nAlias: datetimeDeltas\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\ntemporalDeltas(X, \\[unit])\n\n#### Details\n\nFor each temporal type element *Xi* in *X*, return*Xi*-*Xi-1*, representing the time differences between elements. NULL values always return NULL during the calculation, and the first output value is always NULL.\n\nWhen the optional *unit*parameter is provided, the time differences are calculated based on the specified time unit (calendar days, business days, or trading days for a specific exchange).\n\n#### Parameters\n\n**X** is a vector or matrix of temporal values, or a table containing temporal column(s).\n\n**unit** (optional) is a string that specifies the time unit for the calculation. Valid values are:\n\n* \"d\" for calendar days\n\n* \"B\" for business days\n\n* A trading calendar identifier (e.g., \"XNYS\"), where the corresponding calendar file must be located in the directory specified by the *marketHolidayDir*configuration.\n\n**Note:** If *unit* is specified, *X* must be of type DATE.\n\n#### Returns\n\nA vector/matrix/table with the same shape as *X*.\n\n#### Examples\n\n```\ntimestamps = [2020.06.13T13:30:10.000, 2020.06.13T13:30:10.010, 2020.06.13T13:30:10.021, 2020.06.13T13:30:10.033, 2020.06.13T13:30:10.046]\ntemporalDeltas(timestamps)\n// Output: [,10,11,12,13]\n```\n\nIf *unit* is specified, *X* must be of type DATE:\n\n```\ntimes = [2019.12.31, 2020.01.03, 2020.01.10, 2020.01.15, 2020.01.17]\ntemporalDeltas(times, \"d\");\n// Output: [NULL, 3, 7, 5, 2] \n\ntemporalDeltas(times, \"B\");\n// Output: [NULL, 3, 5, 3, 2] \n\ntemporalDeltas(times, \"XNYS\");\n// Output: [NULL, 2, 5, 3, 2]\n\nsym = `A`B`C`D`E\nnum = 5 4 3 2 1\nt = table(times, sym, num)\ntemporalDeltas(t);\n\n/*\ntimes sym num\n----- --- ---\n      A   5  \n3     B   4  \n7     C   3  \n5     D   2  \n2     E   1  \n*/\n```\n"
    },
    "temporalDiff": {
        "url": "https://docs.dolphindb.com/en/Functions/t/temporalDiff.html",
        "signatures": [
            {
                "full": "temporalDiff(X, Y, [unit])",
                "name": "temporalDiff",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "[unit]",
                        "name": "unit",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [temporalDiff](https://docs.dolphindb.com/en/Functions/t/temporalDiff.html)\n\nAlias:`datetimeDiff`\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\ntemporalDiff(X, Y, \\[unit])\n\n#### Details\n\nThe `temporalDiff` function calculates the time difference between *X* and *Y*.\n\nWhen the optional *unit*parameter is provided, the time differences are calculated based on the specified time unit (calendar days, business days, or trading days for a specific exchange).\n\n#### Parameters\n\n**X** can be a temporal value, a vector or matrix of temporal values, or a table containing temporal column(s).\n\n**Y** is a scalar/vector/matrix/table matching the length or dimensions of *X*. The type of *Y* must exactly match that of *X*.\n\n**unit** (optional) is a string that specifies the time unit for the calculation. Valid values are:\n\n* \"d\" for calendar days\n* \"B\" for business days\n* A trading calendar identifier (e.g., \"XNYS\"), where the corresponding calendar file must be located in the directory specified by the *marketHolidayDir*configuration.\n\n**Note:** If *unit* is specified, *X* and *Y* must be of type DATE.\n\n#### Returns\n\nA vector/matrix/table with the same shape as *X*.\n\n#### Examples\n\n```\ntimestamps = [13:30:49,13:30:39,13:30:50,13:30:57,13:30:35]\ntemporalDiff(timestamps, 13:30:00)\n// Output: [49,39,50,57,35]\n```\n\nIf *unit* is specified, *X* and *Y* must be of type DATE.\n\n```\ndates = [2019.12.31, 2020.01.03, 2020.01.10, 2020.01.15, 2020.01.17]\n\ntemporalDiff(dates, 2019.12.30, \"d\") // Output: [1,4,11,16,18]\ntemporalDiff(dates, 2019.12.30, \"B\") // Output: [1,4,9,12,14]\ntemporalDiff(dates, 2019.12.30, \"XNYS\") // Output: [1,3,8,11,13]\n```\n"
    },
    "temporalFormat": {
        "url": "https://docs.dolphindb.com/en/Functions/t/temporalFormat.html",
        "signatures": [
            {
                "full": "temporalFormat(X, format)",
                "name": "temporalFormat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "format",
                        "name": "format"
                    }
                ]
            }
        ],
        "markdown": "### [temporalFormat](https://docs.dolphindb.com/en/Functions/t/temporalFormat.html)\n\n\n\n#### Syntax\n\ntemporalFormat(X, format)\n\nAlias: datetimeFormat\n\n#### Details\n\nConvert a DolphinDB temporal variable to a string with specified format. For details about DolphinDB temporal formats, please check the section [Parsing and Format of Temporal Variables](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/ParsingandFormatofTemporalVariables.html).\n\n#### Parameters\n\n**X** is a scalar/vector of temporal data types.\n\n**format** is a string indicating a temporal format.\n\n#### Returns\n\nA scalar or vector of type STRING.\n\n#### Examples\n\n```\ntemporalFormat(2018.02.14,\"dd-MM-yyyy\");\n// output: 14-02-2018\n\ntemporalFormat(2018.02.14,\"dd-MMM-yy\");\n// output: 14-FEB-18\n\ntemporalFormat(02:19:06,\"HH.mm.ss\");\n// output: 02.19.06\n\ntemporalFormat(2018.02.06T13:30:10.001, \"y-M-d-H-m-s-SSS\");\n// output: 2018-2-6-13-30-10-001\n\ntemporalFormat(14:19:06,\"hhmmssaa\");\n// output: 021906PM\n```\n"
    },
    "temporalParse": {
        "url": "https://docs.dolphindb.com/en/Functions/t/temporalParse.html",
        "signatures": [
            {
                "full": "temporalParse(X, format)",
                "name": "temporalParse",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "format",
                        "name": "format"
                    }
                ]
            }
        ],
        "markdown": "### [temporalParse](https://docs.dolphindb.com/en/Functions/t/temporalParse.html)\n\n\n\n#### Syntax\n\ntemporalParse(X, format)\n\nAlias: datetimeParse\n\n#### Details\n\nConvert a string with specified format to a DolphinDB temporal data type. Return NULL if it cannot decide on the data type.\n\nDolphinDB has the following temporal formats:\n\n| Format    | Meaning          | Range of value                              |\n| --------- | ---------------- | ------------------------------------------- |\n| yyyy      | year (4 digits)  | 1000-9999                                   |\n| yy        | year (2 digits)  | 00-99. (00-39: 2000-2039; 40-99: 1940-1999) |\n| MM        | month in year    | 1-12                                        |\n| MMM       | month in year    | JAN, FEB, ... DEC (case insensitive)        |\n| dd        | day in month     | 1-31                                        |\n| HH        | hour in day      | 0-23                                        |\n| hh        | hour in AM/PM    | 0-11                                        |\n| mm        | minute in hour   | 0-59                                        |\n| ss        | second in minute | 0-59                                        |\n| aa        | AM/PM marker     | AM, PM. (case-insensitive)                  |\n| SSS       | millisecond      | 0-999                                       |\n| nnnnnn    | microsecond      | 0-999999                                    |\n| nnnnnnnnn | nanosecond       | 0-999999999                                 |\n\nThe parameter format of the *temporalParse* function has 2 types of representation:\n\n* **With deliminator(s)**\n\nAny symbol or character is treated as a deliminator except the characters that are used to express a temporal format: y, M, d, H, h, m, s, a, S, and n. A deliminator in the parameter *format* should be identical as the deliminator in the input string.\n\n```\ntemporalParse(\"14-02-2018\",\"dd-MM-yyyy\");\n// output: 2018.02.14\n\ntemporalParse(\"14-02-2018\",\"dd/MM/yyyy\");\n// output: 00d\n\ntemporalParse(\"14//02//2018\",\"dd//MM//yyyy\");\n// output: 2018.02.14\n\ntemporalParse(\"14//02//2018\",\"dd/MM/yyyy\");\n// output: 00d\n\ntemporalParse(\"14//02//2018\",\"dd..MM..yyyy\");\n// output: 00d\n```\n\nWe can simplify the formats by using a single letter between deliminators for the parameter *format*. For example, we can use the format \"y/M/d\" instead of \"yyyy/MM/dd\" for \"2018/01/16\". As \"y\" may mean both \"yyyy\" and \"yy\", for this case the system decides on the format based on the number of digits between deliminators.\n\n```\ntemporalParse(\"14-02-18\",\"d-M-y\");\n// output: 2018.02.14\n\ntemporalParse(\"2018/2/6 02:33:01 PM\",\"y/M/d h:m:s a\");\n// output: 2018.02.06T14:33:01\n```\n\n\"MMM\",\"SSS\", \"nnnnnn\" and \"nnnnnnnnn\", however, cannot be simplified to a single letter.\n\n```\ntemporalParse(\"02-FEB-2018\",\"d-MMM-y\");\n// output: 2018.02.02\n\ntemporalParse(\"02-FEB-2018\",\"d-M-y\");\n// output: 00d\n\ntemporalParse(\"13:30:10.001\",\"H:m:s.SSS\");\n// output: 13:30:10.001\n\ntemporalParse(\"13:30:10.001\",\"H:m:s.S\");\n// output: Invalid temporal format: 'H:m:s.S'. Millisecond (S) must have three digits.\n\ntemporalParse(\"13:30:10.008001\",\"H:m:s.nnnnnn\");\n// output: 13:30:10.008001000\n\ntemporalParse(\"13:30:10.008001\",\"H:m:s.n\");\n// output: Invalid temporal format: 'H:m:s.n'. Nanosecond (n) must have six or nine digits.\n```\n\nThe `temporalParse` function is very flexible in interpreting the numbers between deliminators in the input string.\n\n```\ntemporalParse(\"2-4-18\",\"d-M-yy\");\n// output: 2018.04.02\n\ntemporalParse(\"2-19-6\",\"H-m-s\");\n// output: 02:19:06\n\ntemporalParse(\"002-019-006\",\"H-m-s\");\n// output: 02:19:06\n```\n\nFor millisecond, microsecond and nanosecond, however, the corresponding number of digits in the input string must be 3, 6 and 9 respectively.\n\n```\ntemporalParse(\"2018/2/6 13:30:10.001\",\"y/M/d H:m:s.SSS\");\n// output: 2018.02.06T13:30:10.001\n\ntemporalParse(\"2018/2/6 13:30:10.01\",\"y/M/d H:m:s.SSS\");\n// output: 00T\n\ntemporalParse(\"2018/2/6 13:30:10.000001\",\"y/M/d H:m:s.nnnnnn\");\n// output: 2018.02.06T13:30:10.000001000\n\ntemporalParse(\"2018/2/6 13:30:10.0000010\",\"y/M/d H:m:s.nnnnnn\");\n// output: 00N\n```\n\nIf a character that is used to express a temporal format (y, M, d, H, h, m, s, a, S, n) appears in the input string as a deliminator, we need to use \"\" before the character in parameter *format*.\n\n```\ntemporalParse(\"2013a02\", \"y\\\\aM\");\n// output: 2013.02M\n\ntemporalParse(\"2013an02\", \"y\\\\a\\\\nM\");\n// output: 2013.02M\n```\n\n* **Without deliminators**\n\nFor this reprensentation, the parameter *format* must be composed of the formats in the temporal formats table. We cannot use a single letter to represent a format in the temporal format table.\n\n```\ntemporalParse(\"20180214\",\"yyyyMMdd\");\n// output: 2018.02.14\n\ntemporalParse(\"122506\",\"MMddyy\");\n// output: 2006.12.25\n\ntemporalParse(\"155950\",\"HHmmss\");\n// output: 15:59:50\n\ntemporalParse(\"035901PM\",\"hhmmssaa\");\n// output: 15:59:01\n\ntemporalParse(\"02062018155956001000001\",\"MMddyyyyHHmmssnnnnnnnnn\");\n// output: 2018.02.06T15:59:56.001000001\n```\n\n#### Parameters\n\n**X** is a string scalar/vector to be converted to temporal data types.\n\n**format** is a string indicating a temporal format.\n\n#### Returns\n\nA temporal scalar or vector.\n"
    },
    "temporalSeq": {
        "url": "https://docs.dolphindb.com/en/Functions/t/temporalSeq.html",
        "signatures": [
            {
                "full": "temporalSeq(start, end, rule, [closed], [label], [origin='start_day'])",
                "name": "temporalSeq",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "end",
                        "name": "end"
                    },
                    {
                        "full": "rule",
                        "name": "rule"
                    },
                    {
                        "full": "[closed]",
                        "name": "closed",
                        "optional": true
                    },
                    {
                        "full": "[label]",
                        "name": "label",
                        "optional": true
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    }
                ]
            }
        ],
        "markdown": "### [temporalSeq](https://docs.dolphindb.com/en/Functions/t/temporalSeq.html)\n\n#### Syntax\n\ntemporalSeq(start, end, rule, \\[closed], \\[label], \\[origin='start\\_day'])\n\n#### Details\n\nResample the time series between start and end based on the frequency specified by *rule*.\n\n#### Parameters\n\n**start** is a temporal scalar.\n\n**end** is a temporal scalar. Its data type must be the same as *start*, and its value must be greater than *start*.\n\n**rule** is a string that can take the following values:\n\n| Values of *rule* | DolphinDB function   |\n| ---------------- | -------------------- |\n| \"B\"              | businessDay          |\n| \"W\"              | weekEnd              |\n| \"WOM\"            | weekOfMonth          |\n| \"LWOM\"           | lastWeekOfMonth      |\n| \"M\"              | monthEnd             |\n| \"MS\"             | monthBegin           |\n| \"BM\"             | businessMonthEnd     |\n| \"BMS\"            | businessMonthBegin   |\n| \"SM\"             | semiMonthEnd         |\n| \"SMS\"            | semiMonthBegin       |\n| \"Q\"              | quarterEnd           |\n| \"QS\"             | quarterBegin         |\n| \"BQ\"             | businessQuarterEnd   |\n| \"BQS\"            | businessQuarterBegin |\n| \"REQ\"            | fy5253Quarter        |\n| \"A\"              | yearEnd              |\n| \"AS\"             | yearBegin            |\n| \"BA\"             | businessYearEnd      |\n| \"BAS\"            | businessYearBegin    |\n| \"RE\"             | fy5253               |\n| \"D\"              | date                 |\n| \"H\"              | hourOfDay            |\n| \"U\"              | microsecond          |\n| \"L\"              | millisecond          |\n| \"min\"            | minuteOfHour         |\n| \"N\"              | nanosecond           |\n| \"S\"              | secondOfMinute       |\n| \"SA\"             | semiannualEnd        |\n| \"SAS\"            | semiannualBegin      |\n\nThe strings above can also be used with integers for parameter \"rule\". For example, \"2M\" means the end of every two months. In addition, *rule* can also be set as the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name.\n\n**closed** (optional) is a string indicating which boundary of the interval is closed.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**label** (optional) is a string indicating which boundary is used to label the interval.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**origin** (optional) is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start\\_day', 'end', 'end\\_day' or a user-defined time object. The default value is 'start\\_day'.\n\n* 'epoch': *origin* is 1970-01-01\n\n* 'start': *origin* is the first value of the timeseries\n\n* 'start\\_day': *origin* is 00:00 of the first day of the timeseries\n\n* 'end': *origin* is the last value of the timeseries\n\n* 'end\\_day': *origin* is 24:00 of the last day of the timeseries\n\n#### Returns\n\nA vector of temporal type.\n\n#### Examples\n\n**Example 1.** From 00:01:00 to 00:08:00, sample at 3-minute intervals, default left-closed right-open interval (*closed*='left'), default output of window left boundary (*label*='left').\n\n```\ntemporalSeq(start=2022.01.01 00:01:00,end=2022.01.01 00:08:00,rule=\"3min\")\n// output: [2022.01.01T00:00:00,2022.01.01T00:03:00,2022.01.01T00:06:00]\n```\n\n**Example 2.** Based on Example 1, set *closed*='right' for left-open right-closed interval.\n\n```\ntemporalSeq(start=2022.01.01 00:01:00, end=2022.01.01 00:08:00, rule=\"3min\", closed=`right)\n// output: [2022.01.01T00:00:00,2022.01.01T00:03:00,2022.01.01T00:06:00]\n```\n\n**Example 3.** Based on Example 2, set *label*='right' to output the right boundary of each window.\n\n```\ntemporalSeq(start=2022.01.01 00:01:00, end=2022.01.01 00:08:00, rule=\"3min\", closed=`right, label=`right)\n// output: [2022.01.01T00:03:00,2022.01.01T00:06:00,2022.01.01T00:09:00]\n```\n\n**Example 4.** Based on Example 2, set *origin*='end' to sample backward from the end time 00:08:00, with default *label*=left.\n\n```\ntemporalSeq(start=2022.01.01 00:01:00, end=2022.01.01 00:08:00, rule=\"3min\", closed=`right, origin=`end)\n// output: [2022.01.01T00:02:00,2022.01.01T00:05:00,2022.01.01T00:08:00]\n```\n\n**Example 5.** Unlike Example 4, this example sets *origin*=2022.10.01 00:00:10 to use a custom 10-second reference point, generating 00:00:10, 00:03:10, and 00:06:10.\n\n```\ntemporalSeq(start=2022.01.01 00:01:00, end=2022.01.01 00:08:00, rule=\"3min\", closed=`right, origin=2022.10.01 00:00:10)\n// output: [2022.01.01T00:00:10,2022.01.01T00:03:10,2022.01.01T00:06:10]\n```\n\n"
    },
    "tensor": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tensor.html",
        "signatures": [
            {
                "full": "tensor(X)",
                "name": "tensor",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [tensor](https://docs.dolphindb.com/en/Functions/t/tensor.html)\n\n\n\n#### Syntax\n\ntensor(X)\n\n#### Details\n\nGenerate a tensor from *X* with the following rules:\n\n| **X**                                                                                                      | **Output**                   |\n| :--------------------------------------------------------------------------------------------------------- | :--------------------------- |\n| scalar                                                                                                     | 1D tensor                    |\n| vector                                                                                                     | 1D tensor                    |\n| columnar tuple                                                                                             | 2D tensor                    |\n| matrix                                                                                                     | 2D tensor                    |\n| table (with all columns of the same type)                                                                  | 2D tensor                    |\n| tuple of vectors (each element is a vector of the same type)                                               | 2D tensor                    |\n| tuple of matrices (each element is a matrix with the same dimensions and type)                             | 3D tensor                    |\n| tuple of tuples (each element is a tuple, and each element of the sub-tuples is a vector of the same type) | 3D tensor                    |\n| n-level nested tuple                                                                                       | n-D tensor (where *n* <= 10) |\n\nNote: Tensors are mainly used with the DolphinDB plugins (such as LibTorch) for data exchange with deep learning frameworks. DolphinDB does not currently support direct storage and computation of tensors, nor direct access or modification to their elements.\n\n#### Parameters\n\n**X** can be a scalar, vector, tuple, columnar tuple, matrix or table. These data types are supported: BOOL, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE\n\n#### Returns\n\nA tensor.\n\n#### Examples\n\n```\n//generate tensor from a scalar\n/* output 1D tensor of size 1: tensor<int[1]>:\n0: int 3\n*/\n\n//from a vector\n/*tensor<int[3]>:\n0: int 1\n1: int 2\n2: int 3\n*/\n\n//from a columnar tuple\ntp = [[1.3,2.5,2.3], [4.1,5.3,5], [4.1,5.3,5]]\ntp.setColumnarTuple!()\ntensor(tp)\n\n/*tensor<double[3][3]>: \n0: double[3] [1.3, 2.5, 2.3]\n1: double[3] [4.1, 5.3, 5]\n2: double[3] [4.1, 5.3, 5] \n */\n\n//from a matrix\nm= 1..6$2:3\ntensor(m)\n\n/*tensor<int[2][3]>: \n0: int[3] [1, 3, 5]\n1: int[3] [2, 4, 6]\n*/\n\n//from a table\nt=table(1..5 as id1, 6..10 as id2)\ntensor(t)\n\n/*tensor<int[5][2]>: \n0: int[2] [1, 6]\n1: int[2] [2, 7]\n2: int[2] [3, 8]\n3: int[2] [4, 9]\n4: int[2] [5, 10]\n*/\n\n//from a tuple\ntp1 = [[1.3,2.5,2.3], [4.1,5.3,5], [4.1,5.3,5]]\ntensor(tp1)\n\n/*tensor<double[3][3]>: \n0: double[3] [1.3, 4.1, 4.1]\n1: double[3] [2.5, 5.3, 5.3]\n2: double[3] [2.3, 5, 5]\n*/\n\n//from a tuple of matrixs\nm1= 1..6$2:3\nm2=4..9$2:3\ntensor([m1,m2])\n\n/*tensor<int[2][2][3]>:\n0: int[2][3]\n1: int[2][3]\n*/\n\n//from a tuple of tuples\ntp1 = [[1.3,2.5,2.3], [4.1,5.3,5], [4.1,5.3,5]]\ntp2 = [[1.1,1.2,1.4], [1.5,1.2,1.6], [1.3,1.5,1.8]]\ntensor([tp1, tp2])\n\n/*tensor<double[2][3][3]>:\n0: double[3][3]\n1: double[3][3]\n*/\n\n//from a nested tuple\ntp1 = [[1.3,2.5,2.3], [4.1,5.3,5], [4.1,5.3,5]]\ntp2 = [[1.1,1.2,1.4], [1.5,1.2,1.6], [1.3,1.5,1.8]]\ntp3 = [[2.1,6.2,4.4], [3.5,1.9,3.6], [1.8,3.5,9.8]]\ntensor([[tp1, tp2],[tp1, tp3]])\n\n/*tensor<double[2][2][3][3]>:\n0: double[2][3][3]\n1: double[2][3][3]\n*/\n```\n"
    },
    "terminate": {
        "url": "https://docs.dolphindb.com/en/Functions/t/terminate.html",
        "signatures": [
            {
                "full": "terminate()",
                "name": "terminate",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [terminate](https://docs.dolphindb.com/en/Functions/t/terminate.html)\n\n\n\n#### Syntax\n\nterminate()\n\n#### Details\n\n`terminate` is a method of the `EventListener` class used to stop the current event listener. After it is called, the listener will no longer receive or process new events, and its callback function will not be triggered even if the matching conditions are still satisfied. It is typically used to dynamically cancel event listeners that are no longer needed during runtime, in order to avoid unnecessary resource usage or duplicate processing.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nclass trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    eventTime :: TIMESTAMP\n    def trades(t, m, c, p, q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n        eventTime = now()\n    }\n}\n\nclass mainMonitor:CEPMonitor{\n    tradesTable :: ANY\n    isBusy :: BOOL\n    def mainMonitor(){\n        tradesTable = array(ANY, 0)\n        isBusy = false\n    }\n\n    def updateTrades(event)\n\n    def updateTrades2(event)\n\n    def unOnload(){\n        undef('traderDV', SHARED)\n    }\n\n    def onload(){\n        addEventListener(updateTrades, `trades, , \"all\",,,,,\"trades1\")\n        addEventListener(updateTrades2, `trades, , \"all\",,,,,\"trades2\")\n        traderDV = streamTable(array(STRING, 0) as trader, array(STRING, 0) as market, array(SYMBOL, 0) as code, array(DOUBLE, 0) as price, array(INT, 0) as qty, array(INT, 0) as tradeCount, array(BOOL, 0) as busy, array(DATE, 0) as orderDate, array(TIMESTAMP, 0) as updateTime)\n        share(traderDV, 'traderDV')\n        createDataViewEngine('traderDV', objByName('traderDV'), `trader, `updateTime, true)\n    }\n\n    def updateTrades(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n\n    def updateTrades2(event) {\n        tradesTable.append!([event.trader, event.market, event.code, event.price, event.qty])\n        getDataViewEngine('traderDV').append!(table(event.trader as trader, string() as market, string() as code, 0.0 as price, 0 as qty, 0 as tradeCount, false as busy, date(event.eventTime) as orderDate))\n        updateDataViewItems('traderDV', event.trader, ['market', 'code', 'price', 'qty', 'tradeCount'], [event.market, event.code, event.price, event.qty, tradesTable.size()])\n    }\n}\n\ndummy = table(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs)\nengineCep = createCEPEngine('cep1', <mainMonitor()>, dummy, [trades], 1, 'eventTime', 10000)\ntrade1 = trades('t1', 'sz', 's001', 11.0, 10)\ngo\nappendEvent(engineCep, trade1)\n\nmonitors = getCEPEngineMonitor('cep1',\"cep1\",\"mainMonitor\")\n\nlisteners = monitors.getEventListener()\nprint(listeners)\n// Terminate listener\nlisteners['trades1'].terminate()\nprint(listeners)\n```\n\n**Related function**: [addEventListener](https://docs.dolphindb.com/en/Functions/a/add_event_listener.html), [getEventListener](https://docs.dolphindb.com/en/Functions/g/get_event_listener.html)\n"
    },
    "test": {
        "url": "https://docs.dolphindb.com/en/Functions/t/test.html",
        "signatures": [
            {
                "full": "test(scriptFile, [outputFile], [testMemLeaking=false])",
                "name": "test",
                "parameters": [
                    {
                        "full": "scriptFile",
                        "name": "scriptFile"
                    },
                    {
                        "full": "[outputFile]",
                        "name": "outputFile",
                        "optional": true
                    },
                    {
                        "full": "[testMemLeaking=false]",
                        "name": "testMemLeaking",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [test](https://docs.dolphindb.com/en/Functions/t/test.html)\n\n\n\n#### Syntax\n\ntest(scriptFile, \\[outputFile], \\[testMemLeaking=false])\n\n#### Details\n\nA system command for unit testing. It must be executed by a logged-in user.\n\nIf *scriptFile* is a folder, all script files in the folder will be tested.\n\nIf *outputFile* is not specified, the testing result will be displayed on screen. If *outputFile* is specified as a relative path, the testing result file will be output to \\<HomeDir>.\n\n**Note:**\n\nDolphinDB's `test` function is used to execute specified test script files and return results; `numpy.test` can find and run test cases defined within a module and its submodules; `pandas.test` is used to run the pandas test suite, verifying library functionality via pytest, with optional execution of doctests; `scipy.test` offers more parameters for fine-grained control, such as fast/slow tags, parallel execution, coverage statistics, and targeted submodule testing; `statsmodels.test` is used to verify the integrity and availability of the installed library, and is primarily intended for release builds rather than development.\n\n#### Parameters\n\n**scriptFile** is a string indicating the path of a testing script file or a folder.\n\n**outputFile** (optional) is a string indicating the path of a test result script file or a folder.\n\n**testMemLeaking** (optional) is a Boolean value indicating whether to test for memory leaks.\n\n#### Examples\n\n```\ntest(\"C:/DolphinDB/test/test1.txt\", \"C:/DolphinDB/testResult/test1.txt\");\ntest(\"C:/DolphinDB/test\");\n```\n"
    },
    "textChunkDS": {
        "url": "https://docs.dolphindb.com/en/Functions/t/textChunkDS.html",
        "signatures": [
            {
                "full": "textChunkDS(filename, chunkSize, [delimiter], [schema], [skipRows=0], [arrayDelimiter], [containHeader], [arrayMarker])",
                "name": "textChunkDS",
                "parameters": [
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "chunkSize",
                        "name": "chunkSize"
                    },
                    {
                        "full": "[delimiter]",
                        "name": "delimiter",
                        "optional": true
                    },
                    {
                        "full": "[schema]",
                        "name": "schema",
                        "optional": true
                    },
                    {
                        "full": "[skipRows=0]",
                        "name": "skipRows",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[arrayDelimiter]",
                        "name": "arrayDelimiter",
                        "optional": true
                    },
                    {
                        "full": "[containHeader]",
                        "name": "containHeader",
                        "optional": true
                    },
                    {
                        "full": "[arrayMarker]",
                        "name": "arrayMarker",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [textChunkDS](https://docs.dolphindb.com/en/Functions/t/textChunkDS.html)\n\n\n\n#### Syntax\n\ntextChunkDS(filename, chunkSize, \\[delimiter], \\[schema], \\[skipRows=0], \\[arrayDelimiter], \\[containHeader], \\[arrayMarker])\n\n#### Details\n\nTo load an extremely large text file into DolphinDB database, we can first use function `textChunkDS` to divide the text file into multiple data sources with the size of each data source specified by *chunkSize*, then use function [mr](https://docs.dolphindb.com/en/Functions/m/mr.html) to load data.\n\nWhen loading data files in DolphinDB, a random sample of the data is analyzed to determine the data type for each column. However, this sampling method does not always accurately determine the column types. It is recommend to use the `extractTextSchema` function to check the schema of the input file before loading the data. You can specify the intended data type for each column in the \"type\" field of the *schema*. For date or time columns particularly, if DolphinDB does not recognize the correct data types, you need to set the temporal type in the \"type\" field, and provide the date/time format string (e.g. \"MM/dd/yyyy\") in the \"format\" field. Refer to [Parsing and Format of Temporal Variables](https://docs.dolphindb.com/en/Programming/DataManipulation/TemporalObjects/ParsingandFormatofTemporalVariables.html) for temproal formats in DolphinDB.\n\n#### Parameters\n\n**filename** is a string indicating the input text file name with its absolute path. Currently only *.csv* files are supported.\n\n**chunkSize** is a positive integer indicating the size of a file chunk (in MB). The upper limit is `max(maxMemSize / workerNum, 2048MB)`, representing the greater of the maximum available memory per worker or 2048MB.\n\n**delimiter** (optional) is a STRING scalar indicating the table column separator. It can consist of one or more characters, with the default being a comma (',').\n\n**schema** (optional) a table. It can have the following columns, among which \"name\" and \"type\" columns are required.\n\n| Column | Data Type            | Description                    |\n| ------ | -------------------- | ------------------------------ |\n| name   | STRING scalar        | column name                    |\n| type   | STRING scalar        | data type                      |\n| format | STRING scalar        | the format of temporal columns |\n| col    | INT scalar or vector | the columns to be loaded       |\n\n**skipRows** (optional) is an integer between 0 and 1024 indicating the rows in the beginning of the text file to be ignored. The default value is 0.\n\n**arrayDelimiter** (optional) is a single character indicating the delimiter for columns holding the array vectors in the file. Since the array vectors cannot be recognized automatically, you must use the *schema* parameter to update the data type of the type column with the corresponding array vector data type before import.\n\n**containHeader** (optional) a Boolean value indicating whether the file contains a header row. The default value is null. See [loadText](https://docs.dolphindb.com/en/Functions/l/loadText.html) for the detailed determining rules.\n\n**arrayMarker** is a string containing 2 characters or a CHAR pair. These two characters represent the identifiers for the left and right boundaries of an array vector. The default identifiers are double quotes (\").\n\n* It cannot contain spaces, tabs (`\\t`), or newline characters (`\\t` or `\\n`).\n\n* It cannot contain digits or letters.\n\n* If one is a double quote (`\"`), the other must also be a double quote.\n\n* If the identifier is `'`, `\"`, or `\\`, a backslash ( \\ ) escape character should be used as appropriate. For example, `arrayMarker=\"\\\"\\\"\"`.\n\n* If *delimiter*specifies a single character, *arrayMarker* cannot contain the same character.\n\n* If *delimiter*specifies multiple characters, the left boundary of *arrayMarker* cannot be the same as the first character of *delimiter*.\n\n#### Returns\n\nA DATASOURCE tuple.\n\n#### Examples\n\nUse the following script to generate the data file of about 3.2GB:\n\n```\nn=30000000\nworkDir = \"/home/DolphinDB\"\nif(!exists(workDir)) mkdir(workDir)\ntrades=table(rand(`IBM`MSFT`GM`C`FB`GOOG`V`F`XOM`AMZN`TSLA`PG`S,n) as sym, 2000.01.01+rand(365,n) as date, 10.0+rand(2.0,n) as price1, 100.0+rand(20.0,n) as price2, 1000.0+rand(200.0,n) as price3, 10000.0+rand(2000.0,n) as price4, 10000.0+rand(3000.0,n) as price5, 10000.0+rand(4000.0,n) as price6, rand(10,n) as qty1, rand(100,n) as qty2, rand(1000,n) as qty3, rand(10000,n) as qty4, rand(10000,n) as qty5, rand(10000,n) as qty6)\ntrades.saveText(workDir + \"/trades.txt\");\n```\n\nLoad the file into a DFS database with functions `textChunkDS` and `mr`:\n\n```\ndb=database(\"dfs://db1\",VALUE, `IBM`MSFT`GM`C`FB`GOOG`V`F`XOM`AMZN`TSLA`PG`S)\npt=db.createPartitionedTable(trades,`pt,`sym)\nds=textChunkDS(workDir + \"/trades.txt\",500)\nmr(ds,append!{pt},,,false)\n```\n\n**Note:** Different data sources here may contain data in the same partition. As DolphinDB does not allow writing to the same partition simultaneously from multiple threads, we must set parameter 'parallel' of function `mr` to false, otherwise an exception might be thrown.\n"
    },
    "til": {
        "url": "https://docs.dolphindb.com/en/Functions/t/til.html",
        "signatures": [
            {
                "full": "til(n)",
                "name": "til",
                "parameters": [
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [til](https://docs.dolphindb.com/en/Functions/t/til.html)\n\n\n\n#### Syntax\n\ntil(n)\n\n#### Details\n\nReturn a vector of integral type from 0 to n-1. If n=0, return an empty vector.\n\nThe result is of the same data type as n. For example, if n is of LONG type, return a FAST LONG VECTOR.\n\n#### Parameters\n\n**n** is a non-negative integer.\n\n#### Examples\n\n```\ntil(0);\n// output: []\n\ntil(5);\n// output: [0,1,2,3,4]\n\nn = 10;\nt = table(2022.01.01 + til(n) as date, rand(10.0, n) as val);\nt;\n/* output:\ndate        val\n2022.01.01  8.403\n2022.01.02  9.424\n2022.01.03  0.4779\n2022.01.04  1.8934\n2022.01.05  9.6637\n2022.01.06  1.7993\n2022.01.07  7.1143\n2022.01.08  8.3044\n2022.01.09  2.6919\n2022.01.10  1.9294\n*/\n```\n\nRelated functions: [take](https://docs.dolphindb.com/en/Functions/t/take.html), [rand](https://docs.dolphindb.com/en/Functions/r/rand.html)\n"
    },
    "time": {
        "url": "https://docs.dolphindb.com/en/Functions/t/time.html",
        "signatures": [
            {
                "full": "time(X)",
                "name": "time",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [time](https://docs.dolphindb.com/en/Functions/t/time.html)\n\n\n\n#### Syntax\n\ntime(X)\n\n#### Details\n\nReturn the corresponding time(s) with millisecond precision. The data type of the result is TIME.\n\n#### Parameters\n\n**X** is a temporal scalar/vector.\n\n#### Returns\n\nA scalar or vector of type TIME.\n\n#### Examples\n\n```\ntime();\n// output: null\n\ntime(\"12:32:56.356\");\n// output: 12:32:56.356\n\ntime(now());\n// output: 20:49:12.564\n```\n"
    },
    "timestamp": {
        "url": "https://docs.dolphindb.com/en/Functions/t/timestamp.html",
        "signatures": [
            {
                "full": "timestamp(X)",
                "name": "timestamp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [timestamp](https://docs.dolphindb.com/en/Functions/t/timestamp.html)\n\n\n\n#### Syntax\n\ntimestamp(X)\n\n#### Details\n\nReturn the corresponding timestamp(s). The data type of the result is TIMESTAMP.\n\nSince version 2.00.12, converting MONTH into TIMESTAMP is allowed.\n\n#### Parameters\n\n**X** is a temporal scalar/vector.\n\n#### Returns\n\nA scalar or vector of type TIMESTAMP.\n\n#### Examples\n\n```\ntimestamp(2016.10.12);\n// output: 2016.10.12T00:00:00.000\n\ntimestamp(2016.10.12)+1;\n// output: 2016.10.12T00:00:00.001\n\ntimestamp(now());\n// output: 2016.10.13T20:28:45.104\n\ntimestamp(2012.01M)\n// output: 2012.01.01T00:00:00.000\n```\n"
    },
    "tmavg": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmavg.html",
        "signatures": [
            {
                "full": "tmavg(T, X, window)",
                "name": "tmavg",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmavg](https://docs.dolphindb.com/en/Functions/t/tmavg.html)\n\n\n\n#### Syntax\n\ntmavg(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving average of *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 2 -1 2 4\nm = table(T as t,X as x)\nselect *, tmavg(t, x, 3) from m\n```\n\n| t | x  | tmavg\\_t |\n| - | -- | -------- |\n| 1 | 1  | 1        |\n| 1 | 4  | 2.5      |\n| 1 | 2  | 2.3333   |\n| 2 | -1 | 1.5      |\n| 5 | 2  | 2        |\n| 6 | 4  | 3        |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = 1 4 2 -1 2 4\nm = table(T as t,X as x)\nselect *, tmavg(t, x, 3d) from m\n```\n\n| t          | x  | tmavg\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 | 1  | 1        |\n| 2021.01.02 | 4  | 2.5      |\n| 2021.01.04 | 2  | 2.3333   |\n| 2021.01.05 | -1 | 0.5      |\n| 2021.01.07 | 2  | 0.5      |\n| 2021.01.08 | 4  | 3        |\n\n```\nselect *, tmavg(t, x, 1w) from m\n```\n\n| t          | x  | tmavg\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 | 1  | 1        |\n| 2021.01.02 | 4  | 2.5      |\n| 2021.01.04 | 2  | 2.3333   |\n| 2021.01.05 | -1 | 1.5      |\n| 2021.01.07 | 2  | 1.6      |\n| 2021.01.08 | 4  | 2        |\n\nRelated functions: [mavg](https://docs.dolphindb.com/en/Functions/m/mavg.html), [avg](https://docs.dolphindb.com/en/Functions/a/avg.html)\n"
    },
    "tmavgTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmavgTopN.html",
        "signatures": [
            {
                "full": "tmavgTopN(T, X, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmavgTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmavgTopN](https://docs.dolphindb.com/en/Functions/t/tmavgTopN.html)\n\n\n\n#### Syntax\n\ntmavgTopN(T, X, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the average of the first *top* elements.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmavgTopN(T,X,S,6,4)\n// output: [2,1.5,2.3333,2.3333,2.75,3.25,3]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nS=1 5 2 3 1 1\nt=table(T as time, X as val, S as id)\nselect tmavgTopN(time,val,id,4,3) as topN from t\n```\n\n| topN   |\n| ------ |\n| 8      |\n| 3      |\n| 2      |\n| 2      |\n| 2.6666 |\n| 3      |\n\nRelated function: [tmavg](https://docs.dolphindb.com/en/Functions/t/tmavg.html)\n"
    },
    "tmbeta": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmbeta.html",
        "signatures": [
            {
                "full": "tmbeta(T, Y, X, window)",
                "name": "tmbeta",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmbeta](https://docs.dolphindb.com/en/Functions/t/tmbeta.html)\n\n\n\n#### Syntax\n\ntmbeta(T, Y, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the coefficient estimate of an ordinary-least-squares regression of *Y* on *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Details\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmbeta(t, y, x, 3) from m\n```\n\n| t | x  | y  | tmbeta\\_t |\n| - | -- | -- | --------- |\n| 1 | 1  | 2  |           |\n| 1 | 4  | 5  | 1         |\n| 1 | 2  | -3 | 1.4286    |\n| 2 | -1 | 6  | -0.3846   |\n| 5 | 2  | 9  |           |\n| 6 | 4  | 1  | -4        |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmbeta(t, y, x, 3d) from m\n```\n\n| t          | x  | y  | tmbeta\\_t |\n| ---------- | -- | -- | --------- |\n| 2021.01.02 | 1  | 2  |           |\n| 2021.01.02 | 4  | 5  | 1         |\n| 2021.01.04 | 2  | -3 | 1.4286    |\n| 2021.01.05 | -1 | 6  | -3        |\n| 2021.01.07 | 2  | 9  | 1         |\n| 2021.01.08 | 4  | 1  | -4        |\n\n```\nselect *, tmbeta(t, y, x, 1w) from m\n```\n\n| t          | x  | y  | tmbeta\\_t |\n| ---------- | -- | -- | --------- |\n| 2021.01.02 | 1  | 2  |           |\n| 2021.01.02 | 4  | 5  | 1         |\n| 2021.01.04 | 2  | -3 | 1.4286    |\n| 2021.01.05 | -1 | 6  | -0.3846   |\n| 2021.01.07 | 2  | 9  | -0.1818   |\n| 2021.01.08 | 4  | 1  | -0.4444   |\n\nRelated Functions: [mbeta](https://docs.dolphindb.com/en/Functions/m/mbeta.html), [beta](https://docs.dolphindb.com/en/Functions/b/beta.html)\n"
    },
    "tmbetaTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmbetaTopN.html",
        "signatures": [
            {
                "full": "tmbetaTopN(T, X, Y, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmbetaTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmbetaTopN](https://docs.dolphindb.com/en/Functions/t/tmbetaTopN.html)\n\n\n\n#### Syntax\n\ntmbetaTopN(T, X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the coefficient estimate ordinary-least-squares regressions of *Y* on *X*.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nY=[1, 7, 8, 9, 0, 5, 8]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X and Y do not participate in calculation\ntmbetaTopN(T,X,Y,S,6,4)\n// output: [,-0.1666,0.1279,0.1279,-0.06,0.0853,-0.1871]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nY=1 7 8 9 0 5\nS=1 5 2 3 1 1\nt=table(T as time, X as val1, Y as val2, S as id)\nselect tmbetaTopN(time,val1,val2,id,4,3) as topN from t\n```\n\n| topN    |\n| ------- |\n|         |\n|         |\n| -2      |\n| -0.5    |\n| -0.3972 |\n| -0.3442 |\n\nRelated function: [tmbeta](https://docs.dolphindb.com/en/Functions/t/tmbeta.html)\n"
    },
    "tmcorr": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmcorr.html",
        "signatures": [
            {
                "full": "tmcorr(T, X, Y, window)",
                "name": "tmcorr",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmcorr](https://docs.dolphindb.com/en/Functions/t/tmcorr.html)\n\n\n\n#### Syntax\n\ntmcorr(T, X, Y, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the correlation of *X* and *Y* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmcorr(t, y, x, 3) from m\n```\n\n| t | x  | y  | tmcorr\\_t |\n| - | -- | -- | --------- |\n| 1 | 1  | 2  |           |\n| 1 | 4  | 5  | 1         |\n| 1 | 2  | -3 | 0.5399    |\n| 2 | -1 | 6  | -0.1981   |\n| 5 | 2  | 9  |           |\n| 6 | 4  | 1  | -1        |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmcorr(t, y, x, 3d) from m\n```\n\n| t          | x  | y  | tmcorr\\_t |\n| ---------- | -- | -- | --------- |\n| 2021.01.02 | 1  | 2  |           |\n| 2021.01.02 | 4  | 5  | 1         |\n| 2021.01.04 | 2  | -3 | 0.5399    |\n| 2021.01.05 | -1 | 6  | -1        |\n| 2021.01.07 | 2  | 9  | 1         |\n| 2021.01.08 | 4  | 1  | -1        |\n\n```\nselect *, tmcorr(t, y, x, 1w) from m\n```\n\n| t          | x  | y  | tmcorr\\_t |\n| ---------- | -- | -- | --------- |\n| 2021.01.02 | 1  | 2  |           |\n| 2021.01.02 | 4  | 5  | 1         |\n| 2021.01.04 | 2  | -3 | 0.5399    |\n| 2021.01.05 | -1 | 6  | -0.1981   |\n| 2021.01.07 | 2  | 9  | -0.0726   |\n| 2021.01.08 | 4  | 1  | -0.1995   |\n\nRelated Functions: [mcorr](https://docs.dolphindb.com/en/Functions/m/mcorr.html), [corr](https://docs.dolphindb.com/en/Functions/c/corr.html)\n"
    },
    "tmcorrTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmcorrTopN.html",
        "signatures": [
            {
                "full": "tmcorrTopN(T, X, Y, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmcorrTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmcorrTopN](https://docs.dolphindb.com/en/Functions/t/tmcorrTopN.html)\n\n\n\n#### Syntax\n\ntmcorrTopN(T, X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving correlation of the first *top* pairs of elements in *X* and *Y*.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nY=[1, 7, 8, 9, 0, 5, 8]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X and Y do not participate in calculation\ntmcorrTopN(T,X,Y,S,6,4)\n// output: [,-1,0.317,0.317,-0.16329,0.3296,-0.4995]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nY=1 7 8 9 0 5\nS=1 5 2 3 1 1\nt=table(T as time, X as val1, Y as val2, S as id)\nselect tmcorrTopN(time,val1,val2,id,4,3) as topN from t\n```\n\n| topN    |\n| ------- |\n|         |\n|         |\n| -1      |\n| -0.5    |\n| -0.9413 |\n| -0.8962 |\n\nRelated function: [tmcorr](https://docs.dolphindb.com/en/Functions/t/tmcorr.html)\n"
    },
    "tmcount": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmcount.html",
        "signatures": [
            {
                "full": "tmcount(T, X, window)",
                "name": "tmcount",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmcount](https://docs.dolphindb.com/en/Functions/t/tmcount.html)\n\n\n\n#### Syntax\n\ntmcount(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the number of non-null values of *X* in a sliding window.\n\n#### Returns\n\nA vector of INT type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmcount(t, x, 3) from m\n```\n\n| t | x  | tmcount\\_t |\n| - | -- | ---------- |\n| 1 | 1  | 1          |\n| 1 | 4  | 2          |\n| 1 |    | 2          |\n| 2 | -1 | 3          |\n| 5 |    | 0          |\n| 6 | 4  | 1          |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.09\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmcount(t, x, 3d) from m\n```\n\n| t          | x  | tmcount\\_t |\n| ---------- | -- | ---------- |\n| 2021.01.02 |    | 0          |\n| 2021.01.02 | 4  | 1          |\n| 2021.01.04 |    | 1          |\n| 2021.01.05 | -1 | 1          |\n| 2021.01.07 | 2  | 2          |\n| 2021.01.09 | 4  | 2          |\n\n```\nselect *, tmcount(t, x, 1w) from m\n```\n\n| t          | x  | tmcount\\_t |\n| ---------- | -- | ---------- |\n| 2021.01.02 |    | 0          |\n| 2021.01.02 | 4  | 1          |\n| 2021.01.04 |    | 1          |\n| 2021.01.05 | -1 | 2          |\n| 2021.01.07 | 2  | 3          |\n| 2021.01.09 | 4  | 3          |\n\nRelated Functions: [mcount](https://docs.dolphindb.com/en/Functions/m/mcount.html), [count](https://docs.dolphindb.com/en/Functions/c/count.html)\n"
    },
    "tmcovar": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmcovar.html",
        "signatures": [
            {
                "full": "tmcovar(T, X, Y, window)",
                "name": "tmcovar",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmcovar](https://docs.dolphindb.com/en/Functions/t/tmcovar.html)\n\n\n\n#### Syntax\n\ntmcovar(T, X, Y, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving covariance of *X* and *Y* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmcovar(t, y, x, 3) from m\n```\n\n| t | x  | y  | tmcovar\\_t |\n| - | -- | -- | ---------- |\n| 1 | 1  | 2  |            |\n| 1 | 4  | 5  | 4.5        |\n| 1 | 2  | -3 | 3.3333     |\n| 2 | -1 | 6  | -1.6667    |\n| 5 | 2  | 9  |            |\n| 6 | 4  | 1  | -8         |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmcovar(t, y, x, 3d) from m\n```\n\n| t          | x  | y  | tmcovar\\_t |\n| ---------- | -- | -- | ---------- |\n| 2021.01.02 | 1  | 2  |            |\n| 2021.01.02 | 4  | 5  | 4.5        |\n| 2021.01.04 | 2  | -3 | 3.3333     |\n| 2021.01.05 | -1 | 6  | -13.5      |\n| 2021.01.07 | 2  | 9  | 4.5        |\n| 2021.01.08 | 4  | 1  | -8         |\n\n```\nselect *, tmcovar(t, y, x, 1w) from m\n```\n\n| t          | x  | y  | tmcovar\\_t |\n| ---------- | -- | -- | ---------- |\n| 2021.01.02 | 1  | 2  |            |\n| 2021.01.02 | 4  | 5  | 4.5        |\n| 2021.01.04 | 2  | -3 | 3.3333     |\n| 2021.01.05 | -1 | 6  | -1.6667    |\n| 2021.01.07 | 2  | 9  | -0.6       |\n| 2021.01.08 | 4  | 1  | -1.6       |\n\nRelated Functions: [mcovar](https://docs.dolphindb.com/en/Functions/m/mcovar.html), [covar](https://docs.dolphindb.com/en/Functions/c/covar.html)\n"
    },
    "tmcovarp": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmcovarp.html",
        "signatures": [
            {
                "full": "tmcovar(T, X, Y, window)",
                "name": "tmcovar",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmcovarp](https://docs.dolphindb.com/en/Functions/t/tmcovarp.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ntmcovar(T, X, Y, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculates the population covariance of *X* and *Y* over a sliding window of the specified length (measured by time).\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmcovarp(t, y, x, 3) from m\n```\n\n| t | x  | y  | tmcovarp\\_t        |\n| - | -- | -- | ------------------ |\n| 1 | 1  | 2  | 0                  |\n| 1 | 4  | 5  | 2.25               |\n| 1 | 2  | -3 | 2.2222222222222223 |\n| 2 | -1 | 6  | -1.25              |\n| 5 | 2  | 9  | 0                  |\n| 6 | 4  | 1  | -4                 |\n\n```\nT = 2026.01.02 2026.01.02  2026.01.04  2026.01.05 2026.01.07 2026.01.08\nX = 1 4 2 -1 2 4\nY = 2 5 -3 6 9 1\nm = table(T as t,X as x, Y as y)\nselect *, tmcovarp(t, y, x, 3d) from m\n```\n\n| t          | x  | y  | tmcovarp\\_t        |\n| ---------- | -- | -- | ------------------ |\n| 2026.01.02 | 1  | 2  | 0                  |\n| 2026.01.02 | 4  | 5  | 2.25               |\n| 2026.01.04 | 2  | -3 | 2.2222222222222223 |\n| 2026.01.05 | -1 | 6  | -6.75              |\n| 2026.01.07 | 2  | 9  | 2.25               |\n| 2026.01.08 | 4  | 1  | -4                 |\n\n```\nselect *, tmcovarp(t, y, x, 1w) from m\n```\n\n| t          | x  | y  | tmcovarp\\_t         |\n| ---------- | -- | -- | ------------------- |\n| 2026.01.02 | 1  | 2  | 0                   |\n| 2026.01.02 | 4  | 5  | 2.25                |\n| 2026.01.04 | 2  | -3 | 2.2222222222222223  |\n| 2026.01.05 | -1 | 6  | -1.25               |\n| 2026.01.07 | 2  | 9  | -0.48               |\n| 2026.01.08 | 4  | 1  | -1.3333333333333333 |\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "tmcovarpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmcovarpTopN.html",
        "signatures": [
            {
                "full": "tmcovarpTopN(T, X, Y, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmcovarpTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmcovarpTopN](https://docs.dolphindb.com/en/Functions/t/tmcovarpTopN.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ntmcovarpTopN(T, X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving population covariance of the first *top* pairs of elements in *X* and *Y*.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2026.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nY=[1, 7, 8, 9, 0, 5, 8]\nS = [5, 8, 1, , 1, 1, 3] \n// The null values in S are ignored in data sorting, and the corresponding elements in X and Y do not participate in calculation\ntmcovarpTopN(T,X,Y,S,6,4)\n// output: [0,-1.5,1.22,1.22,-0.75,0.875,-2]\n\nT=2026.01.03 2026.01.07 2026.01.08 2026.01.10 2026.01.11 2026.01.12\nX=8 3 1 2 5 2\nY=1 7 8 9 0 5\nS=1 5 2 3 1 1\nt=table(T as time, X as val1, Y as val2, S as id)\nselect tmcovarpTopN(time,val1,val2,id,4,3) as topN from t\n```\n\n| topN  |\n| ----- |\n| 0     |\n| 0     |\n| -0.5  |\n| -0.33 |\n| -6.44 |\n| -4.67 |\n\n**Related Function:** [covarp](https://docs.dolphindb.com/en/Functions/c/covarp.html)\n"
    },
    "tmcovarTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmcovarTopN.html",
        "signatures": [
            {
                "full": "tmcovarTopN(T, X, Y, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmcovarTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmcovarTopN](https://docs.dolphindb.com/en/Functions/t/tmcovarTopN.html)\n\n\n\n#### Syntax\n\ntmcovarTopN(T, X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving covariance of the first *top* pairs of elements in *X* and *Y*.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nY=[1, 7, 8, 9, 0, 5, 8]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X and Y do not participate in calculation\ntmcovarTopN(T,X,Y,S,6,4)\n// output: [,-3,1.8333,1.8333,-1,1.1666,-2.6666]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nY=1 7 8 9 0 5\nS=1 5 2 3 1 1\nt=table(T as time, X as val1, Y as val2, S as id)\nselect tmcovarTopN(time,val1,val2,id,4,3) as topN from t\n```\n\n| topN    |\n| ------- |\n|         |\n|         |\n| -1      |\n| -0.5    |\n| -9.6666 |\n| -7      |\n\nRelated function: [tmcovar](https://docs.dolphindb.com/en/Functions/t/tmcovar.html)\n"
    },
    "tmfirst": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmfirst.html",
        "signatures": [
            {
                "full": "tmfirst(T, X, window)",
                "name": "tmfirst",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmfirst](https://docs.dolphindb.com/en/Functions/t/tmfirst.html)\n\n\n\n#### Syntax\n\ntmfirst(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the first element of *X* in a sliding window.\n\n#### Returns\n\nA vector with the same data type as *X*.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmfirst(t, x, 3) from m\n```\n\n| t | x  | tmfirst\\_t |\n| - | -- | ---------- |\n| 1 | 1  | 1          |\n| 1 | 4  | 1          |\n| 1 |    | 1          |\n| 2 | -1 | 1          |\n| 5 |    |            |\n| 6 | 4  |            |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = 3 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmfirst(t, x, 3d) from m\n```\n\n| t          | x  | tmfirst\\_t |\n| ---------- | -- | ---------- |\n| 2021.01.02 | 3  | 3          |\n| 2021.01.02 | 4  | 3          |\n| 2021.01.04 |    | 3          |\n| 2021.01.05 | -1 |            |\n| 2021.01.07 | 2  | -1         |\n| 2021.01.08 | 4  | 2          |\n\n```\nselect *, tmfirst(t, x, 1w) from m\n```\n\n| t          | x  | tmfirst\\_t |\n| ---------- | -- | ---------- |\n| 2021.01.02 | 3  | 3          |\n| 2021.01.02 | 4  | 3          |\n| 2021.01.04 |    | 3          |\n| 2021.01.05 | -1 | 3          |\n| 2021.01.07 | 2  | 3          |\n| 2021.01.08 | 4  | 3          |\n\nRelated functions: [first](https://docs.dolphindb.com/en/Functions/f/first.html)\n"
    },
    "tmkurtosis": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmkurtosis.html",
        "signatures": [
            {
                "full": "tmkurtosis(T, X, window, [biased=true])",
                "name": "tmkurtosis",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [tmkurtosis](https://docs.dolphindb.com/en/Functions/t/tmkurtosis.html)\n\n\n\n#### Syntax\n\ntmkurtosis(T, X, window, \\[biased=true])\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the common parameters and windowing logic.\n\n#### Details\n\nCalculate the moving kurtosis of *X* in a sliding window.\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t, X as x)\nselect *, tmkurtosis(t, x, 3) from m\n```\n\n| t | x  | tmkurtosis\\_t |\n| - | -- | ------------- |\n| 1 | 1  |               |\n| 1 | 4  |               |\n| 1 |    |               |\n| 2 | -1 | 1.5           |\n| 5 |    |               |\n| 6 | 4  |               |\n\n```\nT = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.13 13:30:10)+1..6)\nX = 1 NULL 3 4 5 NULL 3 NULL 5 3\nm = table(T as t,X as x)\nselect *, tmkurtosis(t, x, 3d) from m\n```\n\n| t             | x | tmkurtosis\\_t |\n| ------------- | - | ------------- |\n| 2019.06.13T13 | 1 |               |\n| 2019.06.13T13 |   |               |\n| 2019.06.13T13 | 3 |               |\n| 2019.06.13T13 | 4 | 1.5           |\n| 2019.06.13T14 | 5 | 1.8457        |\n| 2019.06.13T15 |   | 1.8457        |\n| 2019.06.13T16 | 3 | 2.2169        |\n| 2019.06.13T17 |   | 2.2169        |\n| 2019.06.13T18 | 5 | 2.2401        |\n| 2019.06.13T19 | 3 | 2.4072        |\n\n```\nselect *, tmkurtosis(t, x, 1w) from m\n```\n\n| t             | x | tmkurtosis\\_t |\n| ------------- | - | ------------- |\n| 2019.06.13T13 | 1 |               |\n| 2019.06.13T13 |   |               |\n| 2019.06.13T13 | 3 |               |\n| 2019.06.13T13 | 4 | 1.5           |\n| 2019.06.13T14 | 5 | 1.8457        |\n| 2019.06.13T15 |   | 1.8457        |\n| 2019.06.13T16 | 3 | 2.2169        |\n| 2019.06.13T17 |   | 2.2169        |\n| 2019.06.13T18 | 5 | 2.2401        |\n| 2019.06.13T19 | 3 | 2.4072        |\n\nRelated Functions: [mkurtosis](https://docs.dolphindb.com/en/Functions/m/mkurtosis.html), [kurtosis](https://docs.dolphindb.com/en/Functions/k/kurtosis.html)\n"
    },
    "tmkurtosisTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmkurtosisTopN.html",
        "signatures": [
            {
                "full": "tmkurtosisTopN(T, X, S, window, top, [biased=true], [ascending=true], [tiesMethod='latest'])",
                "name": "tmkurtosisTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmkurtosisTopN](https://docs.dolphindb.com/en/Functions/t/tmkurtosisTopN.html)\n\n\n\n#### Syntax\n\ntmkurtosisTopN(T, X, S, window, top, \\[biased=true], \\[ascending=true], \\[tiesMethod='latest'])\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the moving kurtosis of the first *top* elements.\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..10\nX = [2, 1, 4, 3, 4, 3, 1, 5, 8, 2]\nS = [5, 8, 1, , 1, 1, 3, 2, 5 ,1]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmkurtosisTopN(T,X,S,6,4)\n// output: [,,1.5,1.5,1.2798,1.628,2,2,1.8457,1.64]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12 2023.01.13 2023.01.14 2023.01.15 2023.01.16\nX=8 3 1 2 5 2 5 4 2 6\nS=1 5 2 3 1 1 2 4 5 3\nt=table(T as time, X as val, S as id)\nselect tmkurtosisTopN(time,val,id,6,4) as topN from t\n```\n\n| topN   |\n| ------ |\n|        |\n|        |\n| 1.5    |\n| 1.5    |\n| 1.8457 |\n| 2.1852 |\n| 1.1522 |\n| 1      |\n| 1      |\n| 2.1852 |\n\nRelated function: [tmkurtosis](https://docs.dolphindb.com/en/Functions/t/tmkurtosis.html)\n"
    },
    "tmlast": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmlast.html",
        "signatures": [
            {
                "full": "tmlast(T, X, window)",
                "name": "tmlast",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmlast](https://docs.dolphindb.com/en/Functions/t/tmlast.html)\n\n\n\n#### Syntax\n\ntmlast(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nReturn the last element of *X* in a sliding window.\n\n#### Returns\n\nA vector with the same data type as *X*.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmlast(t, x, 3) from m\n```\n\n| t | x  | tmlast\\_t |\n| - | -- | --------- |\n| 1 | 1  | 1         |\n| 1 | 4  | 4         |\n| 1 |    |           |\n| 2 | -1 | -1        |\n| 5 |    |           |\n| 6 | 4  | 4         |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmlast(t, x, 3d) from m\n```\n\n| t          | x  | tmlast\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 4         |\n| 2021.01.04 |    |           |\n| 2021.01.05 | -1 | -1        |\n| 2021.01.07 | 2  | 2         |\n| 2021.01.08 | 4  | 4         |\n\n```\nselect *, tmlast(t, x, 1w) from m\n```\n\n| t          | x  | tmlast\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 4         |\n| 2021.01.04 |    |           |\n| 2021.01.05 | -1 | -1        |\n| 2021.01.07 | 2  | 2         |\n| 2021.01.08 | 4  | 4         |\n\nRelated functions: [last](https://docs.dolphindb.com/en/Functions/l/last.html)\n"
    },
    "tmLowRange": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmLowRange.html",
        "signatures": [
            {
                "full": "tmLowRange(T, X, window)",
                "name": "tmLowRange",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmLowRange](https://docs.dolphindb.com/en/Functions/t/tmLowRange.html)\n\n#### Syntax\n\ntmLowRange(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nFor each element *Xi* in a sliding window of *X*, count the continuous nearest neighbors to its left that are larger than *Xi*. Null values are treated as the minimum values.\n\nIf *X* is a matrix, conduct the aforementioned calculation within each column of *X*.\n\n#### Returns\n\nA vector of INT type.\n\n#### Examples\n\n```\nt = [0, 1, 2, 3, 7, 8, 9, 10, 11]\nx = [NULL, 3.1, NULL, 3.0, 2.9, 2.8, 3.1, NULL, 3.2]\ntmLowRange(t, x, window=3)\n// output: [,0,1,0,0,1,0,2,0]\n\ntmLowRange(t, x, window=4)\n// output: [,0,1,0,0,1,0,3,0]\n\nindex = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.13 13:30:10)+1..6)\ndata = 1 NULL 3 4 5 NULL 3 NULL 5 3\ntmLowRange(index, data, 4h)\n// output: [0,1,0,0,0,3,0,1,0,1]\n```\n\n"
    },
    "tmmax": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmmax.html",
        "signatures": [
            {
                "full": "tmmax(T, X, window)",
                "name": "tmmax",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmmax](https://docs.dolphindb.com/en/Functions/t/tmmax.html)\n\n\n\n#### Syntax\n\ntmmax(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving maximum of *X* in a sliding window.\n\n#### Returns\n\n* If *X* is an integer, a vector of LONG type is returned.\n\n* If *X* is a floating-point number, a vector of DOUBLE type is returned.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmmax(t, x, 3) from m\n```\n\n| t | x  | tmmax\\_t |\n| - | -- | -------- |\n| 1 | 1  | 1        |\n| 1 | 4  | 4        |\n| 1 |    | 4        |\n| 2 | -1 | 4        |\n| 5 |    |          |\n| 6 | 4  | 4        |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmmax(t, x, 3d) from m\n```\n\n| t          | x  | tmmax\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  | 4        |\n| 2021.01.04 |    | 4        |\n| 2021.01.05 | -1 | -1       |\n| 2021.01.07 | 2  | 2        |\n| 2021.01.08 | 4  | 4        |\n\n```\nselect *, tmmax(t, x, 1w) from m\n```\n\n| t          | x  | tmmax\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  | 4        |\n| 2021.01.04 |    | 4        |\n| 2021.01.05 | -1 | 4        |\n| 2021.01.07 | 2  | 4        |\n| 2021.01.08 | 4  | 4        |\n\nRelated functions: [mmax](https://docs.dolphindb.com/en/Functions/m/mmax.html), [max](https://docs.dolphindb.com/en/Functions/m/max.html)\n"
    },
    "tmmed": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmmed.html",
        "signatures": [
            {
                "full": "tmmed(T, X, window)",
                "name": "tmmed",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmmed](https://docs.dolphindb.com/en/Functions/t/tmmed.html)\n\n\n\n#### Syntax\n\ntmmed(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving median of *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmmed(t, x, 3) from m\n```\n\n| t | x  | tmmed\\_t |\n| - | -- | -------- |\n| 1 | 1  | 1        |\n| 1 | 4  | 2.5      |\n| 1 |    | 2.5      |\n| 2 | -1 | 1        |\n| 5 |    |          |\n| 6 | 4  | 4        |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmmed(t, x, 3d) from m\n```\n\n| t          | x  | tmmed\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  | 4        |\n| 2021.01.04 |    | 4        |\n| 2021.01.05 | -1 | -1       |\n| 2021.01.07 | 2  | 0.5      |\n| 2021.01.08 | 4  | 3        |\n\n```\nselect *, tmmed(t, x, 1w) from m\n```\n\n| t          | x  | tmmed\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  | 4        |\n| 2021.01.04 |    | 4        |\n| 2021.01.05 | -1 | 1.5      |\n| 2021.01.07 | 2  | 2        |\n| 2021.01.08 | 4  | 3        |\n\nRelated functions: [mmed](https://docs.dolphindb.com/en/Functions/m/mmed.html), [med](https://docs.dolphindb.com/en/Functions/m/med.html)\n"
    },
    "tmmin": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmmin.html",
        "signatures": [
            {
                "full": "tmmin(T, X, window)",
                "name": "tmmin",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmmin](https://docs.dolphindb.com/en/Functions/t/tmmin.html)\n\n\n\n#### Syntax\n\ntmmin(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving minimum of *X* in a sliding window.\n\n#### Returns\n\n* If *X* is an integer, a vector of LONG type is returned.\n\n* If *X* is a floating-point number, a vector of DOUBLE type is returned.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmmin(t, x, 3) from m\n```\n\n| t | x  | tmmin\\_t |\n| - | -- | -------- |\n| 1 | 1  | 1        |\n| 1 | 4  | 1        |\n| 1 |    | 1        |\n| 2 | -1 | -1       |\n| 5 |    |          |\n| 6 | 4  | 4        |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmmin(t, x, 3d) from m\n```\n\n| t          | x  | tmmin\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  | 4        |\n| 2021.01.04 |    | 4        |\n| 2021.01.05 | -1 | -1       |\n| 2021.01.07 | 2  | -1       |\n| 2021.01.08 | 4  | 2        |\n\n```\nselect *, tmmin(t, x, 1w) from m\n```\n\n| t          | x  | tmmin\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  | 4        |\n| 2021.01.04 |    | 4        |\n| 2021.01.05 | -1 | -1       |\n| 2021.01.07 | 2  | -1       |\n| 2021.01.08 | 4  | -1       |\n\nRelated functions: [mmin](https://docs.dolphindb.com/en/Functions/m/mmin.html), [min](https://docs.dolphindb.com/en/Functions/m/min.html)\n"
    },
    "tmove": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmove.html",
        "signatures": [
            {
                "full": "tmove(T, X, window)",
                "name": "tmove",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmove](https://docs.dolphindb.com/en/Functions/t/tmove.html)\n\n\n\n#### Syntax\n\ntmove(T, X, window)\n\n#### Details\n\nFor each element *T i* in *T*, return the element in *X* which is at the same position as (*T i-window*) in *T*. If there is no match of (*T i - window*) in *T*, return the corresponding element in *X* at the previous adjacent time of (*Ti - window*).\n\n#### Parameters\n\n**T** is a non-strictly increasing vector of temporal or integral type. It cannot contain null values.\n\n**X** is a vector with the same length as *T*.\n\n**window** is a positive integer or DURATION type.\n\n#### Returns\n\nA vector with the same data type as *X*.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmove(t, x, 3) from m\n```\n\n| t | x  | tmove\\_t |\n| - | -- | -------- |\n| 1 | 1  |          |\n| 1 | 4  |          |\n| 1 |    |          |\n| 2 | -1 |          |\n| 5 |    | -1       |\n| 6 | 4  | -1       |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.09\nX = 5 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmove(t, x, 3d) from m\n```\n\n| t          | x  | tmove\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 | 5  |          |\n| 2021.01.02 | 4  |          |\n| 2021.01.04 |    |          |\n| 2021.01.05 | -1 | 4        |\n| 2021.01.07 | 2  |          |\n| 2021.01.09 | 4  | -1       |\n\n```\nselect *, tmove(t, x, 1w) from m\n```\n\n| t          | x  | tmove\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 | 5  |          |\n| 2021.01.02 | 4  |          |\n| 2021.01.04 |    |          |\n| 2021.01.05 | -1 |          |\n| 2021.01.07 | 2  |          |\n| 2021.01.09 | 4  | 4        |\n\nRelated function: [move](https://docs.dolphindb.com/en/Functions/m/move.html)\n"
    },
    "tmovingWindowData": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmovingWindowData.html",
        "signatures": [
            {
                "full": "tmovingWindowData(T, X, window, [leftClosed=false])",
                "name": "tmovingWindowData",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[leftClosed=false]",
                        "name": "leftClosed",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [tmovingWindowData](https://docs.dolphindb.com/en/Functions/t/tmovingWindowData.html)\n\n#### Syntax\n\ntmovingWindowData(T, X, window, \\[leftClosed=false])\n\n#### Details\n\nReturn an array vector where each row indicates the elements of a window sliding over *X*.\n\n#### Parameters\n\n**T** is a non-strictly increasing vector of integral or temporal type.\n\n**X** is a vector of the same size as *T*.\n\n**window** is a positive integer or a DURATION value indicating the size of a time-based window.\n\n**leftClosed** (optional) is a Boolean indicating whether the left boundary of window is included. The default value is false.\n\n#### Examples\n\n```\nT = 2022.01.01T09:00:00 + 1 1 2 3 6 7 9 10 13 14\nS = 1..10\ntmovingWindowData(T, S, 3s)\n// output: [[1],[1,2],[1,2,3],[1,2,3,4],[5],[5,6],[6,7],[7,8],[9],[9,10]]\n\ntmovingWindowData(T, S, 3s, leftClosed=true)\n// output: [[1],[1,2],[1,2,3],[1,2,3,4],[4,5],[5,6],[5,6,7],[6,7,8],[8,9],[9,10]]\n\n// output the calculation result of metrics with a 10-minute sliding window in the reactive state engine\nn = 100\nDateTime = 2023.01.01T09:00:00 + rand(10000, n).sort!()\nSecurityID = take(`600021`600022`600023`600024`600025, n)\nPrice = 1.0 + rand(1.0, n) \nt = table(1:0, `DateTime`SecurityID`Price, [TIMESTAMP, SYMBOL, DOUBLE])\ntableInsert(t, DateTime, SecurityID, Price)\noutput = table(100:0, `SecurityID`DateTime`PriceNew, [SYMBOL, DATETIME, DOUBLE[]])\n\nengine = createReactiveStateEngine(name=\"rseEngine\", metrics=[<DateTime>, <tmovingWindowData(DateTime, Price,10m)>], dummyTable=t, outputTable=output, keyColumn=`SecurityID, keepOrder=true)\nengine.append!(t)\ndropStreamEngine(`rseEngine)\n```\n\n"
    },
    "tmpercentile": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmpercentile.html",
        "signatures": [
            {
                "full": "tmpercentile(T, X, percent, window, [interpolation='linear'])",
                "name": "tmpercentile",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "percent",
                        "name": "percent"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[interpolation='linear']",
                        "name": "interpolation",
                        "optional": true,
                        "default": "'linear'"
                    }
                ]
            }
        ],
        "markdown": "### [tmpercentile](https://docs.dolphindb.com/en/Functions/t/tmpercentile.html)\n\n\n\n#### Syntax\n\ntmpercentile(T, X, percent, window, \\[interpolation='linear'])\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the common parameters and windowing logic.\n\n#### Details\n\nReturn the percentile rank of each element of *X* in a sliding window.\n\n#### Parameters\n\n**percent** is an integer or floating number between 0 and 100.\n\n**interpolation** (optional) is a string indicating the interpolation method to use if the specified percentile is between two elements in *X* (assuming the i-th and (i+1)-th element in the sorted *X*) . It can take the following values:\n\n* 'linear': ![](https://docs.dolphindb.com/en/images/tmlinear.png) where ![](https://docs.dolphindb.com/en/images/tmfraction.png)\n\n* 'lower': ![](https://docs.dolphindb.com/en/images/xi.png)\n\n* 'higher': ![](https://docs.dolphindb.com/en/images/higher.png)\n\n* 'nearest': ![](https://docs.dolphindb.com/en/images/xi.png) or ![](https://docs.dolphindb.com/en/images/higher.png) that is closest to the specified percentile\n\n* 'midpoint': ![](https://docs.dolphindb.com/en/images/midpoint.png)\n\nThe default value of *interpolation* is 'linear'.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 1 2 5 6\nX = 1 4 NULL -1 NULL 4\nm = table(T as t,X as x)\nselect *, tmpercentile(t, x, 50, 3) from m\n```\n\n| t | x  | tmpercentile\\_t |\n| - | -- | --------------- |\n| 1 | 1  | 1               |\n| 1 | 4  | 2.5             |\n| 1 |    | 2.5             |\n| 2 | -1 | 1               |\n| 5 |    |                 |\n| 6 | 4  | 4               |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmpercentile(t, x, 50, 3d) from m\n```\n\n| t          | x  | tmpercentile\\_t |\n| ---------- | -- | --------------- |\n| 2021.01.02 |    |                 |\n| 2021.01.02 | 4  | 4               |\n| 2021.01.04 |    | 4               |\n| 2021.01.05 | -1 | -1              |\n| 2021.01.07 | 2  | 0.5             |\n| 2021.01.08 | 4  | 3               |\n\n```\nselect *, tmpercentile(t, x, 50, 1w) from m\n```\n\n| t          | x  | tmpercentile\\_t |\n| ---------- | -- | --------------- |\n| 2021.01.02 |    |                 |\n| 2021.01.02 | 4  | 4               |\n| 2021.01.04 |    | 4               |\n| 2021.01.05 | -1 | 1.5             |\n| 2021.01.07 | 2  | 2               |\n| 2021.01.08 | 4  | 3               |\n\nRelated Functions: [percentile](https://docs.dolphindb.com/en/Functions/p/percentile.html), [mpercentile](https://docs.dolphindb.com/en/Functions/m/mpercentile.html)\n"
    },
    "tmprod": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmprod.html",
        "signatures": [
            {
                "full": "tmprod(T, X, window)",
                "name": "tmprod",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmprod](https://docs.dolphindb.com/en/Functions/t/tmprod.html)\n\n\n\n#### Syntax\n\ntmprod(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving product of *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 3 5 8 15 15 20\nX = 5 2 4 1 2 8 9 10\nm=table(T as t, X as x)\nselect *, tmprod(t, x, 3) from m\n```\n\n| t  | x  | tmprod\\_t |\n| -- | -- | --------- |\n| 1  | 5  | 5         |\n| 1  | 2  | 10        |\n| 3  | 4  | 40        |\n| 5  | 1  | 4         |\n| 8  | 2  | 2         |\n| 15 | 8  | 8         |\n| 15 | 9  | 72        |\n| 20 | 10 | 10        |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmprod(t, x, 3d) from m\n```\n\n| t          | x  | tmprod\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 4         |\n| 2021.01.04 |    | 4         |\n| 2021.01.05 | -1 | -1        |\n| 2021.01.07 | 2  | -2        |\n| 2021.01.08 | 4  | 8         |\n\n```\nselect *, tmprod(t, x, 1w) from m\n```\n\n| t          | x  | tmprod\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 4         |\n| 2021.01.04 |    | 4         |\n| 2021.01.05 | -1 | -1        |\n| 2021.01.07 | 2  | -2        |\n| 2021.01.08 | 4  | 8         |\n\nRelated functions: [mprod](https://docs.dolphindb.com/en/Functions/m/mprod.html), [prod](https://docs.dolphindb.com/en/Functions/p/prod.html)\n"
    },
    "tmrank": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmrank.html",
        "signatures": [
            {
                "full": "tmrank(T, X, ascending, window, [ignoreNA=true], [tiesMethod='min'], [percent=false])",
                "name": "tmrank",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "ascending",
                        "name": "ascending"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[ignoreNA=true]",
                        "name": "ignoreNA",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='min']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'min'"
                    },
                    {
                        "full": "[percent=false]",
                        "name": "percent",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [tmrank](https://docs.dolphindb.com/en/Functions/t/tmrank.html)\n\n\n\n#### Syntax\n\ntmrank(T, X, ascending, window, \\[ignoreNA=true], \\[tiesMethod='min'], \\[percent=false])\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the common parameters and windowing logic.\n\n#### Details\n\nReturn the rank of each element of *X* in a sliding window.\n\n#### Parameters\n\n**ascending** is a Boolean value. The default value is true indicating the sorting direction is ascending.\n\n**ignoreNA** (optional) is a Boolean value indicating whether null values are ignored in ranking. The default value is true. If null values participate in the ranking, they are ranked the lowest.\n\n**tiesMethod** (optional) is a string indicating how to rank the group of records with the same value (i.e., ties):\n\n* \"min\": lowest rank of the group\n\n* \"max\": highest rank of the group\n\n* \"average\": average rank of the group\n\n**percent** is a Boolean value, indicating whether to display the returned rankings in percentile form. The default value is false.\n\n#### Returns\n\nA vector of INT type.\n\n#### Examples\n\n```\ntmrank(1 1 3 5 8 15 15 20, 5 2 4 1 2 8 9 10, ascending=true, window=3)\n// output: [0,0,1,0,0,0,1,0]\n\nindex = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.14 13:30:10)+1..6)\ndata = 1 NULL 3 4 5 NULL 3 NULL 5 3\n\ntmrank(index, data, ascending=true, window=4h)\n// output: [0,,1,2,0,,0,,1,0]\n\ntmrank(index, data, ascending=true, window=2d)\n// output: [0,,1,2,3,,1,,4,1]\n```\n\nRelated functions: [mrank](https://docs.dolphindb.com/en/Functions/m/mrank.html), [rank](https://docs.dolphindb.com/en/Functions/r/rank.html)\n"
    },
    "tmskew": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmskew.html",
        "signatures": [
            {
                "full": "tmskew(T, X, window, [biased=true])",
                "name": "tmskew",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [tmskew](https://docs.dolphindb.com/en/Functions/t/tmskew.html)\n\n\n\n#### Syntax\n\ntmskew(T, X, window, \\[biased=true])\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the common parameters and windowing logic.\n\n#### Details\n\nCalculate the moving skewness of *X* in a sliding window.\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\ntmskew(1 1 3 5 8 15 15 20, 5 2 4 1 2 8 9 10, 3)\n// output: [,0,-0.381801774160607,0,,,0,]\n\nindex = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.13 13:30:10)+1..6)\ndata = 1 NULL 3 4 5 NULL 3 NULL 5 3\ntmskew(index, data, 4h)\n// output: [,,,-0.3818,,,0,0,0,0.7071]\n\ntmskew(index, data, 2d)\n// output: [,,0,-0.3818,-0.4347,-0.4347,-0.37,-0.37,-0.5653,-0.4363]\n```\n\nRelated Functions: [mskew](https://docs.dolphindb.com/en/Functions/m/mskew.html), [skew](https://docs.dolphindb.com/en/Functions/s/skew.html)\n"
    },
    "tmskewTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmskewTopN.html",
        "signatures": [
            {
                "full": "tmskewTopN(T, X, S, window, top, [biased=true], [ascending=true], [tiesMethod='latest'])",
                "name": "tmskewTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmskewTopN](https://docs.dolphindb.com/en/Functions/t/tmskewTopN.html)\n\n\n\n#### Syntax\n\ntmskewTopN(T, X, S, window, top, \\[biased=true], \\[ascending=true], \\[tiesMethod='latest'])\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the moving skewness of the first *top* elements.\n\n#### Parameters\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmskewTopN(T,X,S,6,4)\n// output: [,0,0.3818,0.3818,-0.2138,-0.4933,-0.8164]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nS=1 5 2 3 1 1\nt=table(T as time, X as val, S as id)\nselect tmskewTopN(time,val,id,4,3) as topN from t\n```\n\n| topN   |\n| ------ |\n|        |\n|        |\n| 0      |\n| 0      |\n| 0.5280 |\n| 0.7071 |\n\nRelated function: [tmskew](https://docs.dolphindb.com/en/Functions/t/tmskew.html)\n"
    },
    "tmstd": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmstd.html",
        "signatures": [
            {
                "full": "tmstd(T, X, window)",
                "name": "tmstd",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmstd](https://docs.dolphindb.com/en/Functions/t/tmstd.html)\n\n\n\n#### Syntax\n\ntmstd(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nComputes the standard deviation of *X* in a sliding window.\n\n**Null value handling**\n\nNull values are ignored, and computation is performed only based on non-null values within the window.\n\n| Scenario                                                                       | Behavior                                              |\n| ------------------------------------------------------------------------------ | ----------------------------------------------------- |\n| Null values in the *X* parameter                                               | Ignored in the sample standard deviation computation. |\n| All values in the window are null, or there are fewer than two non-null values | The result is null.                                   |\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 3 5 8 15 15 20\nX = 5 2 4 1 2 8 9 10\nm=table(T as t, X as x)\nselect *, tmstd(t, x, 3) from m\n```\n\n| t  | x  | tmstd\\_t |\n| -- | -- | -------- |\n| 1  | 5  |          |\n| 1  | 2  | 2.1213   |\n| 3  | 4  | 1.5275   |\n| 5  | 1  | 2.1213   |\n| 8  | 2  |          |\n| 15 | 8  |          |\n| 15 | 9  | 0.7071   |\n| 20 | 10 |          |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmstd(t, x, 3d) from m\n```\n\n| t          | x  | tmstd\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  |          |\n| 2021.01.04 |    |          |\n| 2021.01.05 | -1 |          |\n| 2021.01.07 | 2  | 2.1213   |\n| 2021.01.08 | 4  | 1.4142   |\n\n```\nselect *, tmstd(t, x, 1w) from m\n```\n\n| t          | x  | tmstd\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  |          |\n| 2021.01.04 |    |          |\n| 2021.01.05 | -1 | 3.5355   |\n| 2021.01.07 | 2  | 2.5166   |\n| 2021.01.08 | 4  | 2.3629   |\n\nRelated Functions: [mstd](https://docs.dolphindb.com/en/Functions/m/mstd.html), [std](https://docs.dolphindb.com/en/Functions/s/std.html)\n"
    },
    "tmstdp": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmstdp.html",
        "signatures": [
            {
                "full": "tmstdp(T, X, window)",
                "name": "tmstdp",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmstdp](https://docs.dolphindb.com/en/Functions/t/tmstdp.html)\n\n\n\n#### Syntax\n\ntmstdp(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the population standard deviation of *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 3 5 8 15 15 20\nX = 5 2 4 1 2 8 9 10\nm=table(T as t, X as x)\nselect *, tmstdp(t, x, 3) from m\n```\n\n| t  | x  | tmstdp\\_t |\n| -- | -- | --------- |\n| 1  | 5  | 0         |\n| 1  | 2  | 1.5       |\n| 3  | 4  | 1.2472    |\n| 5  | 1  | 1.5       |\n| 8  | 2  | 0         |\n| 15 | 8  | 0         |\n| 15 | 9  | 0.5       |\n| 20 | 10 | 0         |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmstdp(t, x, 3d) from m\n```\n\n| t          | x  | tmstdp\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 0         |\n| 2021.01.04 |    | 0         |\n| 2021.01.05 | -1 | 0         |\n| 2021.01.07 | 2  | 1.5       |\n| 2021.01.08 | 4  | 1         |\n\n```\nselect *, tmstdp(t, x, 1w) from m\n```\n\n| t          | x  | tmstdp\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 0         |\n| 2021.01.04 |    | 0         |\n| 2021.01.05 | -1 | 2.5       |\n| 2021.01.07 | 2  | 2.0548    |\n| 2021.01.08 | 4  | 2.0463    |\n\nRelated Functions: [mstdp](https://docs.dolphindb.com/en/Functions/m/mstdp.html), [stdp](https://docs.dolphindb.com/en/Functions/s/stdp.html)\n"
    },
    "tmstdpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmstdpTopN.html",
        "signatures": [
            {
                "full": "tmstdpTopN(T, X, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmstdpTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmstdpTopN](https://docs.dolphindb.com/en/Functions/t/tmstdpTopN.html)\n\n\n\n#### Syntax\n\ntmstdpTopN(T, X, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the population standard deviation of the first *top* elements.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmstdpTopN(T,X,S,6,4)\n// output: [0,0.5,1.2472,1.2472,1.299,0.8291,1.2247]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nS=1 5 2 3 1 1\nt=table(T as time, X as val, S as id)\nselect tmstdpTopN(time,val,id,4,3) as topN from t\n```\n\n| topN   |\n| ------ |\n| 0      |\n| 0      |\n| 1      |\n| 0.8164 |\n| 1.6996 |\n| 1.4142 |\n\nRelated function: [tmstdp](https://docs.dolphindb.com/en/Functions/t/tmstdp.html)\n"
    },
    "tmstdTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmstdTopN.html",
        "signatures": [
            {
                "full": "tmstdTopN(T, X, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmstdTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmstdTopN](https://docs.dolphindb.com/en/Functions/t/tmstdTopN.html)\n\n\n\n#### Syntax\n\ntmstdTopN(T, X, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the unbiased sample standard deviation of the first *top* elements.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmstdTopN(T,X,S,6,4)\n// output: [,0.7071,1.5275,1.5275,1.5,0.9574,1.4142]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nS=1 5 2 3 1 1\nt=table(T as time, X as val, S as id)\nselect tmstdTopN(time,val,id,4,3) as topN from t\n```\n\n| topN   |\n| ------ |\n|        |\n|        |\n| 1.4142 |\n| 1      |\n| 2.0816 |\n| 1.732  |\n\nRelated function: [tmstd](https://docs.dolphindb.com/en/Functions/t/tmstd.html)\n"
    },
    "tmsum": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmsum.html",
        "signatures": [
            {
                "full": "tmsum(T, X, window)",
                "name": "tmsum",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmsum](https://docs.dolphindb.com/en/Functions/t/tmsum.html)\n\n\n\n#### Syntax\n\ntmsum(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving sum of *X* in a sliding window.\n\n#### Returns\n\n* If *X* is an integer, a vector of LONG type is returned.\n\n* If *X* is a floating-point number, a vector of DOUBLE type is returned.\n\n#### Examples\n\n```\ntmsum(1 1 3 5 8 15 15 20, 5 2 4 1 2 8 9 10, 3)\n// output: [5,7,11,5,2,8,17,10]\n\nindex = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.13 13:30:10)+1..6)\ndata = 1 NULL 3 4 5 NULL 3 NULL 5 3\ntmsum(index, data, 4h)\n// output: [1,1,4,8,13,13,16,8,8,11]\n\ntmsum(index, data, 1d)\n// output: [1,1,4,8,13,13,16,16,21,24]\n```\n\nRelated functions: [msum](https://docs.dolphindb.com/en/Functions/m/msum.html), [sum](https://docs.dolphindb.com/en/Functions/s/sum.html)\n"
    },
    "tmsum2": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmsum2.html",
        "signatures": [
            {
                "full": "tmsum2(T, X, window)",
                "name": "tmsum2",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmsum2](https://docs.dolphindb.com/en/Functions/t/tmsum2.html)\n\n\n\n#### Syntax\n\ntmsum2(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving sum of squares of all elements of *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\ntmsum2(1 1 3 5 8 15 15 20, 5 2 4 1 2 8 9 10, 3)\n// output: [25,29,45,17,4,64,145,100]\n\nindex = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.13 13:30:10)+1..6)\ndata = 1 NULL 3 4 5 NULL 3 NULL 5 3\ntmsum2(index, data, 4h)\n// output: [1,1,10,26,51,51,60,34,34,43]\n\ntmsum2(index, data, 1d)\n// output: [1,1,10,26,51,51,60,60,85,94]\n```\n\nRelated Functions: [sum2](https://docs.dolphindb.com/en/Functions/s/sum2.html)\n"
    },
    "tmsumTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmsumTopN.html",
        "signatures": [
            {
                "full": "tmsumTopN(T, X, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmsumTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmsumTopN](https://docs.dolphindb.com/en/Functions/t/tmsumTopN.html)\n\n\n\n#### Syntax\n\ntmsumTopN(T, X, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then sums up the first *top* elements.\n\n#### Returns\n\n* If *X* is an integer, a vector of LONG type is returned.\n\n* If *X* is a floating-point number, a vector of DOUBLE type is returned.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmsumTopN(T,X,S,6,4)\n// output: [2,3,7,7,11,13,12]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nS=1 5 2 3 1 1\nt=table(T as time, X as val, S as id)\nselect tmsumTopN(time,val,id,4,3) as topN from t\n```\n\n| topN |\n| ---- |\n| 8    |\n| 3    |\n| 4    |\n| 6    |\n| 8    |\n| 9    |\n\nRelated function: [tmsum](https://docs.dolphindb.com/en/Functions/t/tmsum.html)\n"
    },
    "tmTopRange": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmTopRange.html",
        "signatures": [
            {
                "full": "tmTopRange(T, X, window)",
                "name": "tmTopRange",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmTopRange](https://docs.dolphindb.com/en/Functions/t/tmTopRange.html)\n\n#### Syntax\n\ntmTopRange(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nFor each element *Xi* in a sliding window of *X*, count the continuous nearest neighbors to its left that are smaller than *Xi*. Null values are treated as the minimum values.\n\n#### Returns\n\nA vector of INT type.\n\n#### Examples\n\n```\nt = [0, 1, 2, 3, 7, 8, 9, 10, 11]\nx = [NULL, 3.1, NULL, 3.0, 2.9, 2.8, 3.1, NULL, 3.2];\ntmTopRange(t, x, window=3);\n//output: [,1,0,1,0,0,2,0,2]\n\ntmTopRange(t, x, window=4);\n// output: [,1,0,1,0,0,2,0,3]\n\nindex = take(datehour(2019.06.13 13:30:10),4) join (datehour(2019.06.13 13:30:10)+1..6)\ndata = 1 NULL 3 4 5 NULL 3 NULL 5 3\ntmTopRange(index, data, 4h)\n// output: [0,0,2,3,4,0,1,0,3,0]\n```\n\n"
    },
    "tmvar": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmvar.html",
        "signatures": [
            {
                "full": "tmvar(T, X, window)",
                "name": "tmvar",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmvar](https://docs.dolphindb.com/en/Functions/t/tmvar.html)\n\n\n\n#### Syntax\n\ntmvar(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving variance of *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 3 5 8 15 15 20\nX = 5 2 4 1 2 8 9 10\nm=table(T as t, X as x)\nselect *, tmvar(t, x, 3) from m\n```\n\n| t  | x  | tmvar\\_t |\n| -- | -- | -------- |\n| 1  | 5  |          |\n| 1  | 2  | 4.5      |\n| 3  | 4  | 2.3333   |\n| 5  | 1  | 4.5      |\n| 8  | 2  |          |\n| 15 | 8  |          |\n| 15 | 9  | 0.5      |\n| 20 | 10 |          |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmvar(t, x, 3d) from m\n```\n\n| t          | x  | tmvar\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  |          |\n| 2021.01.04 |    |          |\n| 2021.01.05 | -1 |          |\n| 2021.01.07 | 2  | 4.5      |\n| 2021.01.08 | 4  | 2        |\n\n```\nselect *, tmvar(t, x, 1w) from m\n```\n\n| t          | x  | tmvar\\_t |\n| ---------- | -- | -------- |\n| 2021.01.02 |    |          |\n| 2021.01.02 | 4  |          |\n| 2021.01.04 |    |          |\n| 2021.01.05 | -1 | 12.5     |\n| 2021.01.07 | 2  | 6.333    |\n| 2021.01.08 | 4  | 5.5833   |\n\nRelated Functions: [mvar](https://docs.dolphindb.com/en/Functions/m/mvar.html), [var](https://docs.dolphindb.com/en/Functions/v/var.html)\n"
    },
    "tmvarp": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmvarp.html",
        "signatures": [
            {
                "full": "tmvarp(T, X, window)",
                "name": "tmvarp",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmvarp](https://docs.dolphindb.com/en/Functions/t/tmvarp.html)\n\n\n\n#### Syntax\n\ntmvarp(T, X, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving population variance of *X* in a sliding window.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT = 1 1 3 5 8 15 15 20\nX = 5 2 4 1 2 8 9 10\nm=table(T as t, X as x)\nselect *, tmvarp(t, x, 3) from m\n```\n\n| t  | x  | tmvarp\\_t |\n| -- | -- | --------- |\n| 1  | 5  | 0         |\n| 1  | 2  | 2.25      |\n| 3  | 4  | 1.5556    |\n| 5  | 1  | 2.25      |\n| 8  | 2  | 0         |\n| 15 | 8  | 0         |\n| 15 | 9  | 0.25      |\n| 20 | 10 | 0         |\n\n```\nT = 2021.01.02 2021.01.02  2021.01.04  2021.01.05 2021.01.07 2021.01.08\nX = NULL 4 NULL -1 2 4\nm = table(T as t,X as x)\nselect *, tmvarp(t, x, 3d) from m\n```\n\n| t          | x  | tmvarp\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 0         |\n| 2021.01.04 |    | 0         |\n| 2021.01.05 | -1 | 0         |\n| 2021.01.07 | 2  | 2.25      |\n| 2021.01.08 | 4  | 1         |\n\n```\nselect *, tmvarp(t, x, 1w) from m\n```\n\n| t          | x  | tmvarp\\_t |\n| ---------- | -- | --------- |\n| 2021.01.02 |    |           |\n| 2021.01.02 | 4  | 0         |\n| 2021.01.04 |    | 0         |\n| 2021.01.05 | -1 | 6.25      |\n| 2021.01.07 | 2  | 4.2222    |\n| 2021.01.08 | 4  | 4.1875    |\n\nRelated Functions: [mvarp](https://docs.dolphindb.com/en/Functions/m/mvarp.html), [varp](https://docs.dolphindb.com/en/Functions/v/varp.html)\n"
    },
    "tmvarpTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmvarpTopN.html",
        "signatures": [
            {
                "full": "tmvarTopN(T, X, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmvarTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmvarpTopN](https://docs.dolphindb.com/en/Functions/t/tmvarpTopN.html)\n\n\n\n#### Syntax\n\ntmvarTopN(T, X, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the population variance of the first *top* elements.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmvarpTopN(T,X,S,6,4)\n// output: [0,0.25,1.5555,1.5555,1.6875,0.6875,1.5]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nS=1 5 2 3 1 1\nt=table(T as time, X as val, S as id)\nselect tmvarpTopN(time,val,id,4,3) as topN from t\n```\n\n| topN   |\n| ------ |\n| 0      |\n| 0      |\n| 1      |\n| 0.6666 |\n| 2.8888 |\n| 2      |\n\nRelated function: [tmvarp](https://docs.dolphindb.com/en/Functions/t/tmvarp.html)\n"
    },
    "tmvarTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmvarTopN.html",
        "signatures": [
            {
                "full": "tmvarTopN(T, X, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmvarTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmvarTopN](https://docs.dolphindb.com/en/Functions/t/tmvarTopN.html)\n\n\n\n#### Syntax\n\ntmvarTopN(T, X, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* by *S* in the order specified by *ascending*, then calculates the unbiased sample variance of the first *top* elements.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X do not participate in calculation\ntmvarTopN(T,X,S,6,4)\n// output: [,0.5,2.3333,2.3333,2.25,0.9166,2]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nS=1 5 2 3 1 1\nt=table(T as time, X as val, S as id)\nselect tmvarTopN(time,val,id,4,3) as topN from t\n```\n\n| topN   |\n| ------ |\n|        |\n|        |\n| 2      |\n| 1      |\n| 4.3333 |\n| 3      |\n\nRelated function: [tmvar](https://docs.dolphindb.com/en/Functions/t/tmvar.html)\n"
    },
    "tmwavg": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmwavg.html",
        "signatures": [
            {
                "full": "tmwavg(T, X, Y, window)",
                "name": "tmwavg",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmwavg](https://docs.dolphindb.com/en/Functions/t/tmwavg.html)\n\n\n\n#### Syntax\n\ntmwavg(T, X, Y, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving average of *X* with *Y* as weights in a sliding window.\n\nThe weights in a sliding window are automatically adjusted so that the sum of weights for all non-Null elements in the sliding window is 1.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT= 1 1 1 1 2 5 6 8 9 10\nX = 1..10\nY = double(1..10)\\10\nm = table(T as t,X as x, Y as y)\nselect *, tmwavg(t, x, y, 3) from m\n```\n\n| t  | x  | y   | tmwavg\\_t |\n| -- | -- | --- | --------- |\n| 1  | 1  | 0.1 | 1         |\n| 1  | 2  | 0.2 | 1.6667    |\n| 1  | 3  | 0.3 | 2.3333    |\n| 1  | 4  | 0.4 | 3         |\n| 2  | 5  | 0.5 | 3.6667    |\n| 5  | 6  | 0.6 | 6         |\n| 6  | 7  | 0.7 | 6.5385    |\n| 8  | 8  | 0.8 | 7.5333    |\n| 9  | 9  | 0.9 | 8.5294    |\n| 10 | 10 | 1   | 9.0741    |\n\n```\nT = 2021.01.02 2021.01.06 join 2021.01.07..2021.01.14\nX = 1..10\nY = double(1..10)\\10\nm=table(T as t,X as x, Y as y)\nselect *, tmwavg(t, y, x, 3) from m\n```\n\n| t          | x  | y   | tmwavg\\_t |\n| ---------- | -- | --- | --------- |\n| 2021.01.02 | 1  | 0.1 | 0.1       |\n| 2021.01.06 | 2  | 0.2 | 0.2       |\n| 2021.01.07 | 3  | 0.3 | 0.26      |\n| 2021.01.08 | 4  | 0.4 | 0.3222    |\n| 2021.01.09 | 5  | 0.5 | 0.4167    |\n| 2021.01.10 | 6  | 0.6 | 0.5133    |\n| 2021.01.11 | 7  | 0.7 | 0.6111    |\n| 2021.01.12 | 8  | 0.8 | 0.7095    |\n| 2021.01.13 | 9  | 0.9 | 0.8083    |\n| 2021.01.14 | 10 | 1   | 0.9074    |\n\n```\nselect *, tmwavg(t, y, x, 1w) from m\n```\n\n| t          | x  | y   | tmwavg\\_t |\n| ---------- | -- | --- | --------- |\n| 2021.01.02 | 1  | 0.1 | 0.1       |\n| 2021.01.06 | 2  | 0.2 | 0.1667    |\n| 2021.01.07 | 3  | 0.3 | 0.2333    |\n| 2021.01.08 | 4  | 0.4 | 0.3       |\n| 2021.01.09 | 5  | 0.5 | 0.3857    |\n| 2021.01.10 | 6  | 0.6 | 0.45      |\n| 2021.01.11 | 7  | 0.7 | 0.5148    |\n| 2021.01.12 | 8  | 0.8 | 0.58      |\n| 2021.01.13 | 9  | 0.9 | 0.6667    |\n| 2021.01.14 | 10 | 1   | 0.7571    |\n\nRelated functions: [wavg](https://docs.dolphindb.com/en/Functions/w/wavg.html), [mwavg](https://docs.dolphindb.com/en/Functions/m/mwavg.html)\n"
    },
    "tmwsum": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmwsum.html",
        "signatures": [
            {
                "full": "tmwsum(T, X, Y, window)",
                "name": "tmwsum",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [tmwsum](https://docs.dolphindb.com/en/Functions/t/tmwsum.html)\n\n\n\n#### Syntax\n\ntmwsum(T, X, Y, window)\n\nPlease see [tmFunctions](https://docs.dolphindb.com/en/Functions/Themes/tmFunctions.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the moving sum of *X* with *Y* as weights in a sliding window.\n\nThe weights in a sliding window are automatically adjusted so that the sum of weights for all non-null elements in the sliding window is 1.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Example\n\n```\nT = 1 1 1 1 2 5 6 8 9 10\nX = 1..10\nY = double(1..10)\\10\nm = table(T as t,X as x, Y as y)\nselect *, tmwsum(t, y, x, 3) from m\n```\n\n| t  | x  | y   | tmwsum\\_t |\n| -- | -- | --- | --------- |\n| 1  | 1  | 0.1 | 0.1       |\n| 1  | 2  | 0.2 | 0.5       |\n| 1  | 3  | 0.3 | 1.4       |\n| 1  | 4  | 0.4 | 3         |\n| 2  | 5  | 0.5 | 5.5       |\n| 5  | 6  | 0.6 | 3.6       |\n| 6  | 7  | 0.7 | 8.5       |\n| 8  | 8  | 0.8 | 11.3      |\n| 9  | 9  | 0.9 | 14.5      |\n| 10 | 10 | 1   | 24.5      |\n\n```\nT = 2021.01.02 2021.01.06 join 2021.01.07..2021.01.14\nX = 1..10\nY = double(1..10)\\10\nm=table(T as t,X as x, Y as y)\nselect *, tmwsum(t, y, x, 3) from m\n```\n\n| t          | x  | y   | tmwsum\\_t |\n| ---------- | -- | --- | --------- |\n| 2021.01.02 | 1  | 0.1 | 0.1       |\n| 2021.01.06 | 2  | 0.2 | 0.4       |\n| 2021.01.07 | 3  | 0.3 | 1.3       |\n| 2021.01.08 | 4  | 0.4 | 2.9       |\n| 2021.01.09 | 5  | 0.5 | 5         |\n| 2021.01.10 | 6  | 0.6 | 7.7       |\n| 2021.01.11 | 7  | 0.7 | 11        |\n| 2021.01.12 | 8  | 0.8 | 14.9      |\n| 2021.01.13 | 9  | 0.9 | 19.4      |\n| 2021.01.14 | 10 | 1   | 24.5      |\n\n```\nselect *, tmwsum(t, y, x, 1w) from m\n```\n\n| t          | x  | y   | tmwsum\\_t |\n| ---------- | -- | --- | --------- |\n| 2021.01.02 | 1  | 0.1 | 0.1       |\n| 2021.01.06 | 2  | 0.2 | 0.5       |\n| 2021.01.07 | 3  | 0.3 | 1.4       |\n| 2021.01.08 | 4  | 0.4 | 3         |\n| 2021.01.09 | 5  | 0.5 | 5.4       |\n| 2021.01.10 | 6  | 0.6 | 9         |\n| 2021.01.11 | 7  | 0.7 | 13.9      |\n| 2021.01.12 | 8  | 0.8 | 20.3      |\n| 2021.01.13 | 9  | 0.9 | 28        |\n| 2021.01.14 | 10 | 1   | 37.1      |\n\nRelated functions: [wsum](https://docs.dolphindb.com/en/Functions/w/wsum.html), [mwsum](https://docs.dolphindb.com/en/Functions/m/mwsum.html)\n"
    },
    "tmwsumTopN": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tmwsumTopN.html",
        "signatures": [
            {
                "full": "tmwsumTopN(T, X, Y, S, window, top, [ascending=true], [tiesMethod='latest'])",
                "name": "tmwsumTopN",
                "parameters": [
                    {
                        "full": "T",
                        "name": "T"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "S",
                        "name": "S"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    },
                    {
                        "full": "top",
                        "name": "top"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[tiesMethod='latest']",
                        "name": "tiesMethod",
                        "optional": true,
                        "default": "'latest'"
                    }
                ]
            }
        ],
        "markdown": "### [tmwsumTopN](https://docs.dolphindb.com/en/Functions/t/tmwsumTopN.html)\n\n\n\n#### Syntax\n\ntmwsumTopN(T, X, Y, S, window, top, \\[ascending=true], \\[tiesMethod='latest'])\n\nPlease see [tmTopN](https://docs.dolphindb.com/en/Functions/Themes/tmTopN.html) for the parameters and windowing logic.\n\n#### Details\n\nWithin a sliding window of given length (measured by time), the function stably sorts *X* and *Y* by *S* in the order specified by *ascending*, then calculates the moving sums of *X* with *Y* as weights.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nT=2023.01.03+1..7\nX = [2, 1, 4, 3, 4, 3, 1]\nY=[1, 7, 8, 9, 0, 5, 8]\nS = [5, 8, 1, , 1, 1, 3]\n// The null values in S are ignored in data sorting, and the corresponding elements in X and Y do not participate in calculation\ntmwsumTopN(T,X,Y,S,6,4)\n// output: [2,9,41,41,41,49,55]\n\nT=2023.01.03 2023.01.07 2023.01.08 2023.01.10 2023.01.11 2023.01.12\nX=8 3 1 2 5 2\nY=1 7 8 9 0 5\nS=1 5 2 3 1 1\nt=table(T as time, X as val1, Y as val2, S as id)\nselect tmwsumTopN(time,val1,val2,id,4,3) as topN from t\n```\n\n| topN |\n| ---- |\n| 8    |\n| 21   |\n| 29   |\n| 47   |\n| 26   |\n| 28   |\n\nRelated function: [tmwsum](https://docs.dolphindb.com/en/Functions/t/tmwsum.html)\n"
    },
    "toArray": {
        "url": "https://docs.dolphindb.com/en/Functions/t/toArray.html",
        "signatures": [
            {
                "full": "toArray(X)",
                "name": "toArray",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [toArray](https://docs.dolphindb.com/en/Functions/t/toArray.html)\n\n\n\n#### Syntax\n\ntoArray(X)\n\n#### Details\n\nUse with [GROUP BY](https://docs.dolphindb.com/en/Programming/SQLStatements/groupby.html) to aggregate grouped data into an [array vector](https://docs.dolphindb.com/en/Programming/DataTypesandStructures/DataForms/Vector/arrayVector.html). The function does not work when used alone.\n\n#### Parameters\n\n**X** is a column name or an expression on column(s).\n\n#### Returns\n\nAn array vector with the same data type as *X*.\n\n#### Examples\n\n```\nt = table(1 1 3 4 as id, 1 3 5 6 as v1)\nnew_t = select toArray(v1) as newV1 from t group by id\n/* \nid newV1\n-- -----\n1  [1,3]\n3  [5]  \n4  [6]  \n*/\n\n\nnew_t = select toArray(v1+1) as newV1 from t group by id\n/* \nid newV1\n-- -----\n1  [2,4]\n3  [6]  \n4  [7]  \n*/\n```\n\n**Related Functions:** [toColumnarTuple](https://docs.dolphindb.com/en/Functions/t/tocolumnartuple.html), [toTuple](https://docs.dolphindb.com/en/Functions/t/totuple.html)\n"
    },
    "toCharArray": {
        "url": "https://docs.dolphindb.com/en/Functions/t/toCharArray.html",
        "signatures": [
            {
                "full": "toCharArray(X)",
                "name": "toCharArray",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [toCharArray](https://docs.dolphindb.com/en/Functions/t/toCharArray.html)\n\n\n\n#### Syntax\n\ntoCharArray(X)\n\n#### Details\n\nSplit a string into a vector of the CHAR data type.\n\n#### Parameters\n\n**X** a scalar/vector of the STRING/BLOB/SYMBOL data type.\n\n#### Returns\n\n* If *X* is a scalar, return a vector.\n\n* If *X* is a vector, return an array vector.\n\n#### Examples\n\n```\nstr = \"It is great!\\n\"\nprint str.toCharArray()\n// output: ['I','t',' ','i','s',' ','g','r','e','a','t','!',10]\n\nstr1 = [\"A#\", \"B C\", \"D\\t\"]\nprint str1.toCharArray()\n// output: [['A','#'],['B',' ','C'],['D',9]]\n```\n\n```\n// Compress a vector and save it in a binary file\nx=1..100\n// A string of BLOB type uses the first 4 bytes to identify its length\ny=blob(compress(x).concat())\ndir = WORK_DIR+\"/toCharArray.bin\"\ng = file(dir, \"w\")\n// Use toCharArray to convert a string of BLOB type, only the correct data will be written to the file (except for the header)\ng.write(y.toCharArray())   // 467 bytes were written\ng.close()\n\n/* output:\ndir1 = WORK_DIR+\"/toCharArray1.bin\"\ng1 = file(dir1, \"w\")\ng1.write(y)    // 471 bytes were written\ng1.close()\n*/\n```\n\nRelated Functions: [split](https://docs.dolphindb.com/en/Functions/s/split.html)\n"
    },
    "toColumnarTuple": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tocolumnartuple.html",
        "signatures": [
            {
                "full": "toColumnarTuple(X)",
                "name": "toColumnarTuple",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [toColumnarTuple](https://docs.dolphindb.com/en/Functions/t/tocolumnartuple.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ntoColumnarTuple(X)\n\n#### Details\n\nUse with [GROUP BY](https://docs.dolphindb.com/en/Programming/SQLStatements/groupby.html) to group by and convert *X* into a columnar tuple. The function does not work when used alone.\n\n#### Parameters\n\n**X** is a column name or an expression on column(s).\n\n#### Returns\n\nA columnar tuple.\n\n#### Examples\n\n```\nt = table([`AAPL, `AAPL, `GOOG, `GOOG, `MSFT, `MSFT] as symbol, \n          [182.5, 183.2, 145.8, 146.5, 412.3, 411.8] as price)\nt\n```\n\n| symbol | price |\n| ------ | ----- |\n| AAPL   | 182.5 |\n| AAPL   | 183.2 |\n| GOOG   | 145.8 |\n| GOOG   | 146.5 |\n| MSFT   | 412.3 |\n| MSFT   | 411.8 |\n\nUse `toColumnarTuple` to group by stock and aggregate all prices. The aggregated price column is a columnar tuple.\n\n```\nresult = select toColumnarTuple(price) as prices from t group by symbol\nresult\n```\n\n| symbol | prices          |\n| ------ | --------------- |\n| AAPL   | \\[182.5, 183.2] |\n| GOOG   | \\[145.8, 146.5] |\n| MSFT   | \\[412.3, 411.8] |\n\n**Related Functions:** [toArray](https://docs.dolphindb.com/en/Functions/t/toArray.html), [toTuple](https://docs.dolphindb.com/en/Functions/t/totuple.html)\n"
    },
    "today": {
        "url": "https://docs.dolphindb.com/en/Functions/t/today.html",
        "signatures": [
            {
                "full": "today()",
                "name": "today",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [today](https://docs.dolphindb.com/en/Functions/t/today.html)\n\n\n\n#### Syntax\n\ntoday()\n\n#### Details\n\nReturn the current date.\n\n#### Parameters\n\nNone.\n\n#### Returns\n\nA scalar of type DATE.\n\n#### Examples\n\n```\ntoday();\n// output: 2019.03.30\n```\n"
    },
    "toJson": {
        "url": "https://docs.dolphindb.com/en/Functions/t/toJson.html",
        "signatures": [
            {
                "full": "toJson(X)",
                "name": "toJson",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [toJson](https://docs.dolphindb.com/en/Functions/t/toJson.html)\n\n\n\n#### Syntax\n\ntoJson(X)\n\n#### Details\n\nConvert a DolphinDB object to JSON format. The result includes 5 key-value pairs: name, form, type, size and value.\n\nFor different data forms, the maximum length of the data to be converted differs:\n\n| Data Forms | Max Length |\n| ---------- | ---------- |\n| matrix     | 300000     |\n| set        | 300000     |\n| vector     | 300000     |\n| dict       | 300000     |\n| table      | 100000     |\n\n#### Parameters\n\n**X** can be any data type.\n\n#### Returns\n\nA scalar of type STRING.\n\n#### Examples\n\n```\nx=1 2 3\ny=toJson(x)\ny;\n// output: {\"name\":\"x\",\"form\":\"vector\",\"type\":\"int\",\"size\":\"3\",\"value\":[1,2,3]}\n\nt=table(1 2 3 as id, 10 20 30 as val)\ntoJson(t);\n// output: {\"name\":\"t\",\"form\":\"table\",\"size\":\"3\",\"value\":[{\"name\":\"id\",\"form\":\"vector\",\"type\":\"int\",\"size\":\"3\",\"value\":[1,2,3]},{\"name\":\"val\",\"form\":\"vector\",\"type\":\"int\",\"size\":\"3\",\"value\":[10,20,30]}]}\n\n// The length of set exceeds 30000, and toJson can only convert the first 30000 elements\nx=set(1..400001)\ny=toJson(x)\nsize(fromJson(y))\n// output: 300000\n```\n\nRelated function: [fromJson](https://docs.dolphindb.com/en/Functions/f/fromJson.html)\n"
    },
    "tokenize": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tokenize.html",
        "signatures": [
            {
                "full": "tokenize(text, parser, [full=false], [lowercase=true], [stem=false])",
                "name": "tokenize",
                "parameters": [
                    {
                        "full": "text",
                        "name": "text"
                    },
                    {
                        "full": "parser",
                        "name": "parser"
                    },
                    {
                        "full": "[full=false]",
                        "name": "full",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[lowercase=true]",
                        "name": "lowercase",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[stem=false]",
                        "name": "stem",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [tokenize](https://docs.dolphindb.com/en/Functions/t/tokenize.html)\n\n\n\n#### Syntax\n\ntokenize(text, parser, \\[full=false], \\[lowercase=true], \\[stem=false])\n\n#### Details\n\nTokenize the input text according to the specified configurations.\n\n#### Parameters\n\n**text** is a STRING scalar specifying the text to be tokenized.\n\n**parser** is a STRING scalar specifying the tokenizer. It has no default value and must be explicitly set. Options include:\n\n* none: not tokenized\n* english: tokenizes based on spaces and punctuations\n\n**lowercase** specifies whether to convert words lowercase (without affecting the original data), which only takes effect when *parser* is set to english. The default value is true, which applies to case-insensitive scenarios.\n\n**stem** specifies whether to match English words by their stem, which only takes effect when *parser*=english and *lowercase*=true. The default value is false, indicating exact searches.\n\n**Note**: The *full* parameter is not applicable for English text.\n\n#### Returns\n\nA STRING vector containing the tokenization result.\n\n#### Examples\n\n```\ntext1 = \"The sun was shining brightly as I walked down the street, enjoying the warmth of the summer day.\"\ntokenize(text=text1, parser='english', lowercase=false, stem=true)\n// output:[\"The\",\"sun\",\"shine\",\"bright\",\"I\",\"walk\",\"down\",\"street\",\"enjoy\",\"warmth\",\"summer\",\"day\"]\n```\n"
    },
    "tokenizeBert": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tokenizeBert.html",
        "signatures": [
            {
                "full": "tokenizeBert(text, vocabName, [addSpecialTokens=true])",
                "name": "tokenizeBert",
                "parameters": [
                    {
                        "full": "text",
                        "name": "text"
                    },
                    {
                        "full": "vocabName",
                        "name": "vocabName"
                    },
                    {
                        "full": "[addSpecialTokens=true]",
                        "name": "addSpecialTokens",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [tokenizeBert](https://docs.dolphindb.com/en/Functions/t/tokenizeBert.html)\n\nFirst introduced in versions: 3.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\ntokenizeBert(text, vocabName, \\[addSpecialTokens=true])\n\n#### Details\n\nTokenizes the input *text* using the specified vocabulary. This function uses the WordPiece tokenization algorithm, designed for use with the BERT (Bidirectional Encoder Representations from Transformers) model.\n\n#### Parameters\n\n**text** A LITERAL scalar, representing the text to be tokenized.\n\n**vocabName** A STRING scalar specifying the name of the vocabulary to use.\n\n**addSpecialTokens** (optional) A boolean indicating whether to add special tokens at the beginning and end of the input text. Currently, only `[CLS]` at the beginning and `[SEP]` at the end are supported. Defaults to true.\n\n#### Returns\n\nA table with the following columns:\n\n* tokens: List of tokens.\n* input\\_ids: Corresponding token ID.\n* attention\\_mask: A mask value used for model input, currently always set to 1.\n\n#### Examples\n\n````\nloadVocab(\"/home/data/vocab.txt\", \"vocab1\")\ntokenizeBert(\"apple ```\\n—— abcd1234\", \"vocab1\", true)\n````\n\nRelated functions: [loadVocab](https://docs.dolphindb.com/en/Functions/l/loadVocab.html), [unloadVocab](https://docs.dolphindb.com/en/Functions/u/unloadVocab.html)\n"
    },
    "topRange": {
        "url": "https://docs.dolphindb.com/en/Functions/t/topRange.html",
        "signatures": [
            {
                "full": "topRange(X)",
                "name": "topRange",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [topRange](https://docs.dolphindb.com/en/Functions/t/topRange.html)\n\n\n\n#### Syntax\n\ntopRange(X)\n\n#### Details\n\nFor each element *Xi* in *X*, count the continuous nearest neighbors to its left that are smaller than *Xi*.\n\nFor each element in X, the function return the maximum length of a window to the left of *X* where it is the max/min. For example, after how many days a stock hits a new high.\n\n#### Parameters\n\n**X** is a vector/tuple/matrix/table\n\n#### Returns\n\nINT type with the same data form as *X*.\n\n#### Examples\n\n```\ntopRange([13.5, 13.6, 13.4, 13.3, 13.5, 13.9, 13.1, 20.1, 20.2, 20.3])\n// output: [0,1,0,0,2,5,0,7,8,9]\n\nm = matrix(1.5 2.6 3.2 1.4 2.5 2.2 3.7 2.0, 1.6 2.3 4.2 5.6 4.1 3.2 4.4 6.9)\ntopRange(m)\n```\n\n| #0 | #1 |\n| -- | -- |\n| 0  | 0  |\n| 1  | 1  |\n| 2  | 2  |\n| 0  | 3  |\n| 1  | 0  |\n| 0  | 0  |\n| 6  | 2  |\n| 0  | 7  |\n\n```\n//Simulate the stock price of stock A for 8 days. Use topRange to calculate after how many days the stock hit a new high\ntrades = table(take(`A, 8) as sym,  2022.01.01 + 1..8 as date, 39.70 39.72 39.80 39.78 39.83 39.92 40.00 40.03 as price)\nselect *, topRange(price) from trades\n```\n\n| id | date       | price | topRange\\_price |\n| -- | ---------- | ----- | --------------- |\n| A  | 2022.01.02 | 39.7  | 0               |\n| A  | 2022.01.03 | 39.72 | 1               |\n| A  | 2022.01.04 | 39.8  | 2               |\n| A  | 2022.01.05 | 39.78 | 0               |\n| A  | 2022.01.06 | 39.83 | 4               |\n| A  | 2022.01.07 | 39.92 | 5               |\n| A  | 2022.01.08 | 40    | 6               |\n| A  | 2022.01.09 | 40.03 | 7               |\n\nRelated function: [lowRange](https://docs.dolphindb.com/en/Functions/l/lowRange.html)\n"
    },
    "toStdJson": {
        "url": "https://docs.dolphindb.com/en/Functions/t/toStdJson.html",
        "signatures": [
            {
                "full": "toStdJson(obj)",
                "name": "toStdJson",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    }
                ]
            }
        ],
        "markdown": "### [toStdJson](https://docs.dolphindb.com/en/Functions/t/toStdJson.html)\n\n\n\n#### Syntax\n\ntoStdJson(obj)\n\n#### Details\n\nConvert a DolphinDB object to JSON format.\n\n#### Parameters\n\n**obj** cannot be of data form matrix or pair, nor can it be of data type UUID, IPADDR, INT128, COMPRESSED, or system types.\n\n#### Returns\n\nA scalar of type STRING.\n\n#### Examples\n\n```\nx=1 2 3\ntoStdJson(x);\n// output: [1, 2, 3]\n\nt=table(1 2 3 as id, 10 20 30 as val)\ntoStdJson(t);\n// output: [{\"id\": 1,\"val\": 10},{\"id\": 2,\"val\": 20},{\"id\": 3,\"val\": 30}]\n\nb = set(2012.06.13T13:30:10 2017.07.10T14:10:12)\ntoStdJson(b);\n// output: [\"2017.07.10 14:10:12\",\"2012.06.13 13:30:10\"]\n\nb = dict(int,datetime)\nb[0] = 2012.06.13 13:30:10\nb[1] = 2017.07.10 14:10:12\ntoStdJson(b);\n// output: {\"1\": \"2017.07.10 14:10:12\",\"0\": \"2012.06.13 13:30:10\"}\n\nt1=table(`x`y`z as b, 2012.06.13 13:30:10 2012.06.13 13:30:10 2012.06.13 13:30:10 as c,10.8 7.6 3.5 as F)\ntoStdJson(t1);\n// output: [{\"b\": \"x\",\"c\": \"2012.06.13 13:30:10\",\"F\": 10.8},{\"b\": \"y\",\"c\": \"2012.06.13 13:30:10\",\"F\": 7.6},{\"b\": \"z\",\"c\": \"2012.06.13 13:30:10\",\"F\": 3.5}]\n```\n\nRelated function: [toJson](https://docs.dolphindb.com/en/Functions/t/toJson.html)\n"
    },
    "toTuple": {
        "url": "https://docs.dolphindb.com/en/Functions/t/totuple.html",
        "signatures": [
            {
                "full": "toTuple(X)",
                "name": "toTuple",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [toTuple](https://docs.dolphindb.com/en/Functions/t/totuple.html)\n\nFirst introduced in version: 2.00.183.00.5\n\n\n\n#### Syntax\n\ntoTuple(X)\n\n#### Details\n\nUse with [GROUP BY](https://docs.dolphindb.com/en/Programming/SQLStatements/groupby.html) to group by and convert *X* into a tuple. The function does not work when used alone.\n\nThe [toArray](https://docs.dolphindb.com/en/Functions/t/toArray.html) function creates an array vector whose length cannot be changed in subsequent updates, whereas `toTuple` has no such restriction. This makes `toTuple` suitable for data grouping scenarios where the length may change, and is particularly well-suited for data processing that requires frequent updates or involves dynamic lengths.\n\n#### Parameters\n\n**X** is a column name or an expression on column(s).\n\n#### Returns\n\nA tuple.\n\n#### Examples\n\n```\nt = table(1 1 3 4 as id, 10.1 10.3 9.5 9.6 as price)\nselect toTuple(price) as newPrice from t group by id\n```\n\nSimulate portfolio holding data: portfolio ID, stock symbol, and position size (dynamically changing).\n\n```\nt = table([`P1, `P1, `P1, `P2, `P2, `P3, `P3, `P3, `P3] as portfolioId, \n          [`AAPL, `GOOG, `MSFT, `AAPL, `TSLA, `GOOG, `GOOG, `AMZN, `NVDA] as symbol,\n          [100, 50, 200, 150, 75, 80, 120, 90, 60] as position)\n\n// Use toTuple to group by portfolio and aggregate all held stocks and quantities into tuples (with variable length).\nresult = select toTuple(symbol) as symbols, toTuple(position) as positions from t group by portfolioId\nresult\n```\n\n| portfolioId | symbols                           | positions          |\n| ----------- | --------------------------------- | ------------------ |\n| P1          | \\['AAPL', 'GOOG', 'MSFT']         | \\[100, 50, 200]    |\n| P2          | \\['AAPL', 'TSLA']                 | \\[150, 75]         |\n| P3          | \\['GOOG', 'GOOG', 'AMZN', 'NVDA'] | \\[80, 120, 90, 60] |\n\n**Related Functions:** [toArray](https://docs.dolphindb.com/en/Functions/t/toArray.html), [toColumnarTuple](https://docs.dolphindb.com/en/Functions/t/tocolumnartuple.html)\n"
    },
    "toUTF8": {
        "url": "https://docs.dolphindb.com/en/Functions/t/toUTF8.html",
        "signatures": [
            {
                "full": "toUTF8(str, encode)",
                "name": "toUTF8",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "encode",
                        "name": "encode"
                    }
                ]
            }
        ],
        "markdown": "### [toUTF8](https://docs.dolphindb.com/en/Functions/t/toUTF8.html)\n\n\n\n#### Syntax\n\ntoUTF8(str, encode)\n\n#### Details\n\nChange the encoding of strings to UTF-8.\n\nFor the Windows version, encode can only be \"gbk\".\n\n#### Parameters\n\n**str** is a string scalar/vector.\n\n**encode** is a string indicating the original encoding name. It must use lowercase.\n\n#### Returns\n\nA scalar or vector of type STRING.\n\n#### Examples\n\n```\ntoUTF8(\"DolphinDB\",\"gbk\");\n// output: DolphinDB\n\ntoUTF8([\"hello\",\"world\"],\"euc-cn\");\n// output: [\"hello\",\"world\"]\n```\n\nRelated functions: [convertEncode](https://docs.dolphindb.com/en/Functions/c/convertEncode.html), [fromUTF8](https://docs.dolphindb.com/en/Functions/f/fromUTF8.html)\n"
    },
    "transDS!": {
        "url": "https://docs.dolphindb.com/en/Functions/t/transDS!.html",
        "signatures": [
            {
                "full": "transDS!(ds, transFunc)",
                "name": "transDS!",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "transFunc",
                        "name": "transFunc"
                    }
                ]
            }
        ],
        "markdown": "### [transDS!](https://docs.dolphindb.com/en/Functions/t/transDS!.html)\n\n\n\n#### Syntax\n\ntransDS!(ds, transFunc)\n\n#### Details\n\nApply data transforming functions to a data source or a list of data sources.\n\n#### Parameters\n\n**ds** is a data source or a list of data sources. It is the sole argument of all the functions in *transFunc*.\n\n**transFunc** is a function to be applied to *ds*.\n\n#### Examples\n\nIn the following example, the data type of column *trade\\_time* from the DFS table \"trades1\" is converted into NANOTIMESTAMP and inserted into the DFS table \"trades2\".\n\n```\ndb=database(\"dfs://stock1\",VALUE,`A`B`C`D)\nn=200000\ntrade_time=2018.01.02T06:12:03.458+1..n\nsym=rand(`A`B`C`D,n)\nqty=rand(100.0,n)\nprice=rand(100.0,n)\nt=table(trade_time,sym,qty,price)\ntrades1=db.createPartitionedTable(t,`trades1,`sym).append!(t);\n\nds=sqlDS(<select * from trades1>);\n\ndef convertNanotimestamp(t){\n   return select nanotimestamp(trade_time), sym, qty, price from t\n}\n\nds.transDS!(convertNanotimestamp);\n\ndb=database(\"dfs://stock2\",VALUE,`A`B`C`D)\nt=table(1:0,`trade_time`sym`qty`price,[NANOTIMESTAMP,SYMBOL,DOUBLE,DOUBLE])\ntrades2=db.createPartitionedTable(t,`trades2,`sym);\n\nmr(ds,append!{trades2},,,false);\n\nexec count(*) from trades2;\n// output: 200000\n```\n"
    },
    "transFreq": {
        "url": "https://docs.dolphindb.com/en/Functions/t/transFreq.html",
        "signatures": [
            {
                "full": "transFreq(X, rule, [closed], [label], [origin='start_day'])",
                "name": "transFreq",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "rule",
                        "name": "rule"
                    },
                    {
                        "full": "[closed]",
                        "name": "closed",
                        "optional": true
                    },
                    {
                        "full": "[label]",
                        "name": "label",
                        "optional": true
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    }
                ]
            }
        ],
        "markdown": "### [transFreq](https://docs.dolphindb.com/en/Functions/t/transFreq.html)\n\n\n\n#### Syntax\n\ntransFreq(X, rule, \\[closed], \\[label], \\[origin='start\\_day'])\n\n#### Details\n\nFor each element of *X*, conduct a transformation as specified with parameter *rule*. The result has the same length as *X*.\n\n#### Parameters\n\n**X** is a scalar/vector of temporal type.\n\n**rule** is a string that can take the following values:\n\n| Values of parameter \"rule\" | Corresponding DolphinDB function |\n| -------------------------- | -------------------------------- |\n| \"B\"                        | businessDay                      |\n| \"W\"                        | weekEnd                          |\n| \"WOM\"                      | weekOfMonth                      |\n| \"LWOM\"                     | lastWeekOfMonth                  |\n| \"M\"                        | monthEnd                         |\n| \"MS\"                       | monthBegin                       |\n| \"BM\"                       | businessMonthEnd                 |\n| \"BMS\"                      | businessMonthBegin               |\n| \"SM\"                       | semiMonthEnd                     |\n| \"SMS\"                      | semiMonthBegin                   |\n| \"Q\"                        | quarterEnd                       |\n| \"QS\"                       | quarterBegin                     |\n| \"BQ\"                       | businessQuarterEnd               |\n| \"BQS\"                      | businessQuarterBegin             |\n| \"A\"                        | yearEnd                          |\n| \"AS\"                       | yearBegin                        |\n| \"BA\"                       | businessYearEnd                  |\n| \"BAS\"                      | businessYearBegin                |\n| \"D\"                        | date                             |\n| \"H\"                        | hourOfDay                        |\n| \"min\"                      | minuteOfHour                     |\n| \"S\"                        | secondOfMinute                   |\n| \"L\"                        | millisecond                      |\n| \"U\"                        | microsecond                      |\n| \"N\"                        | nanosecond                       |\n| \"SA\"                       | semiannualEnd                    |\n| \"SAS\"                      | semiannualBegin                  |\n\nThe strings above can also be used with positive integers for parameter *rule*. For example, \"2M\" means the end of every two months. In addition, *rule* can also be set as the identifier of the trading calendar, e.g., the Market Identifier Code of an exchange, or a user-defined calendar name. Positive integers can also be used with identifiers. For example, \"2XNYS\" means every two trading days of New York Stock Exchange.\n\n**closed** (optional) is a string indicating which boundary of the interval is closed.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**label** (optional) is a string indicating which boundary is used to label the interval.\n\n* The default value is 'left' for all values of *rule* except for 'M', 'A', 'Q', 'BM', 'BA', 'BQ', and 'W' which all have a default of 'right'.\n\n* The default is 'right' if *origin* is 'end' or 'end\\_day'.\n\n**origin** (optional) is a string or a scalar of the same data type as *X*, indicating the timestamp where the intervals start. It can be 'epoch', start', 'start\\_day', 'end', 'end\\_day' or a user-defined time object. The default value is 'start\\_day'.\n\n* 'epoch': *origin* is 1970-01-01\n\n* 'start': *origin* is the first value of the timeseries\n\n* 'start\\_day': *origin* is 00:00 of the first day of the timeseries\n\n* 'end': *origin* is the last value of the timeseries\n\n* 'end\\_day': *origin* is 24:00 of the last day of the timeseries\n\n#### Returns\n\nAn object with the same data type and form as *X*.\n\n#### Examples\n\n```\n// Transform to semi-month end\ntransFreq(2020.11.08 2020.11.09 2020.11.18, \"SM\");\n// output: [2020.10.31,2020.10.31,2020.11.15]\n\n// Transform to quarter end\ntransFreq(2020.08.08 2020.11.18, \"Q\");\n// output: [2020.09.30,2020.12.31]\n\n// Transform to double quarter end\ntransFreq(2020.08.08 2020.11.18, \"2Q\");\n// output: [2020.09.30,2021.03.31]\n```\n\n```\ns = temporalAdd(2022.01.01 00:00:00,1..8,`m);\n\n// Align time series to 3-minute intervals, default left-closed right-open interval (closed=`left), default output of interval left boundary (label=`left)\ns.transFreq(rule=\"3min\");\n// output: [2022.01.01T00:00:00,2022.01.01T00:00:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:06:00,2022.01.01T00:06:00,2022.01.01T00:06:00]\n\n// Set closed=`right for left-open right-closed interval\ns.transFreq(rule=`3min,closed=`right);\n// output: [2022.01.01T00:00:00,2022.01.01T00:00:00,2022.01.01T00:00:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:06:00,2022.01.01T00:06:00]\n\n// Set label=`right to output interval right boundary\ns.transFreq(rule=\"3min\", label=`right);\n// output: [2022.01.01T00:03:00,2022.01.01T00:03:00,2022.01.01T00:06:00,2022.01.01T00:06:00,2022.01.01T00:06:00,2022.01.01T00:09:00,2022.01.01T00:09:00,2022.01.01T00:09:00]\n\n// Set origin=`end to align backward from the last time point in the time sequence\ns.transFreq(rule=`3min,closed=`right,origin=`end);\n// output: [2021.12.31T23:59:00,2021.12.31T23:59:00,2022.01.01T00:02:00,2022.01.01T00:02:00,2022.01.01T00:02:00,2022.01.01T00:05:00,2022.01.01T00:05:00,2022.01.01T00:05:00]\n```\n"
    },
    "transpose": {
        "url": "https://docs.dolphindb.com/en/Functions/t/transpose.html",
        "signatures": [
            {
                "full": "transpose(X)",
                "name": "transpose",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [transpose](https://docs.dolphindb.com/en/Functions/t/transpose.html)\n\n\n\n#### Syntax\n\ntranspose(X)\n\nAlias: flip\n\n#### Details\n\nThis function is used to transpose *X:*\n\n* If *X* is a tuple: return a tuple of the same length as each element of *X*. The n-th element of the result is a vector composed of the n-th element of each element of *X*.\n\n* If *X* is a matrix: return the transpose of *X*.\n\n* If *X* is a table: convert *X* into an ordered dictionary. The dictionary keys are column names. Each dictionary value is a vector of the corresponding column.\n\n* If *X* is a dictionary: convert *X* into a table. The dictionary keys must be of STRING type:\n\n  * When values are scalars or vectors of equal length, the keys of *X*serve as the column names and the cooresponding values populate the column values in the table.\n  * When the values are dictionaries, the resulting table will have the keys of X as the first column (named \"key\"). Subsequent columns will be derived from the keys of the first sub-dictionary with each row populated by corresponding values from all nested dictionaries. Missing keys in any sub-dictionary will result in null values in the table.\n    **Note:** Dictionaries with more than 32,767 keys cannot be converted into a table.\n\n* If *X* is an array vector or columnar tuple: switch data from columns to rows, or vice versa.\n\n#### Parameters\n\n**X** is a tuple/matrix/table/dictionary/array vector/columnar tuple.\n\n* If X is a tuple, all elements must be vectors of the same length.\n* If *X* is an array vector or columnar tuple, the number of elements in each row must be the same.\n\n#### Examples\n\nExample 1: transpose of a tuple:\n\n```\nx=(`A`B`C,1 2 3);\nx.transpose();\n// output: ((\"A\",1),(\"B\",2),(\"C\",3))\n```\n\nExample 2: transpose of a matrix:\n\n```\nx=1..6 $ 3:2;\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\ntranspose x;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 2  | 3  |\n| 4  | 5  | 6  |\n\nExample 3: convert a table into a dictionary:\n\n```\ntimestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nsym = `C`MS`MS`MS`IBM`IBM`C`C`C\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800\nt = table(timestamp, sym, qty, price);\nt;\n```\n\n| timestamp | sym | qty  | price  |\n| --------- | --- | ---- | ------ |\n| 09:34:07  | C   | 2200 | 49.6   |\n| 09:36:42  | MS  | 1900 | 29.46  |\n| 09:36:51  | MS  | 2100 | 29.52  |\n| 09:36:59  | MS  | 3200 | 30.02  |\n| 09:32:47  | IBM | 6800 | 174.97 |\n| 09:35:26  | IBM | 5400 | 175.23 |\n| 09:34:16  | C   | 1300 | 50.76  |\n| 09:34:26  | C   | 2500 | 50.32  |\n| 09:38:12  | C   | 8800 | 51.29  |\n\n```\ntranspose(t);\n/*\ntimestamp->[09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]\nsym->[C,MS,MS,MS,IBM,IBM,C,C,C]\nqty->[2200,1900,2100,3200,6800,5400,1300,2500,8800]\nprice->[49.6,29.46,29.52,30.02,174.97,175.23,50.76,50.32,51.29]\n*/\n```\n\nExample 4: convert a dictionary into a table:\n\n```\nz=dict(`id`val,[`a`b`c,1 2 3]);\nz;\n/*\nval->[1,2,3]\nid->[a,b,c]\n*/\ntranspose(z);\n```\n\n| val | id |\n| --- | -- |\n| 1   | a  |\n| 2   | b  |\n| 3   | c  |\n\n```\n// When the value of a dictionary contains both a scalar and a vector, the scalar will be automatically filled to match the length of the vector.\nz1=dict(`id`val,[`a,1 2 3]);\nz1;\ntranspose(z1)\n```\n\n| val | id |\n| --- | -- |\n| 1   | a  |\n| 2   | a  |\n| 3   | a  |\n\nExample 5: convert a nested dictionary into a table.\n\n```\nd = {'tag1':{'val1':2,'val2':6},'tag2':{'val2':1, 'val3':3}}\nd\n/*\ntag1->\n    val1->2\n    val2->6\n\ntag2->\n    val2->1\n    val3->3\n*/\ntranspose(d)\n```\n\n<table id=\"table_yr2_jxb_d2c\"><thead><tr><th align=\"left\">\n\nkey\n\n</th><th align=\"left\">\n\nval1\n\n</th><th align=\"left\">\n\nval2\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\ntag1\n\n</td><td align=\"left\">\n\n2\n\n</td><td align=\"left\">\n\n6\n\n</td></tr><tr><td align=\"left\">\n\ntag2\n\n</td><td align=\"left\">\n\n</td><td align=\"left\">\n\n1\n\n</td></tr></tbody>\n</table>The result shows that after converting the dictionary d into a table, it includes a \"key\" column and columns named after the keys of the first sub-dictionary \\(val1 and val2\\). The \"key\" column contains the keys \\(tag1 and tag2\\) from d, while the val1 and val2 columns hold the corresponding values from the sub-dictionaries. Since sub-dictionary tag2 lacks val1 key, the corresponding value is null. Additionally, its val3 key is excluded from the resulting table, and the corresponding value is discarded.\n"
    },
    "triggerCheckpointForIMOLTP": {
        "url": "https://docs.dolphindb.com/en/Functions/t/triggerCheckpointForIMOLTP.html",
        "signatures": [
            {
                "full": "triggerCheckpointForIMOLTP([force=false], [sync=false])",
                "name": "triggerCheckpointForIMOLTP",
                "parameters": [
                    {
                        "full": "[force=false]",
                        "name": "force",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[sync=false]",
                        "name": "sync",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [triggerCheckpointForIMOLTP](https://docs.dolphindb.com/en/Functions/t/triggerCheckpointForIMOLTP.html)\n\n#### Syntax\n\ntriggerCheckpointForIMOLTP(\\[force=false], \\[sync=false])\n\n#### Details\n\nManually trigger a checkpoint operation for IMOLTP databases.\n\n**Note**: Specify the configuration parameter *enableIMOLTPEngine* and*enableIMOLTPCheckpoint* before execution.\n\n#### Parameters\n\n**force** (optional) is a Boolean value that determines whether to force a checkpoint operation. The default value is false.\n\n**sync** (optional) is a Boolean value to determine whether to force a checkpoint to be performed asynchronously. The default value is false.\n\n#### Returns\n\nNone.\n\n"
    },
    "triggerNodeReport": {
        "url": "https://docs.dolphindb.com/en/Functions/t/triggerNodeReport.html",
        "signatures": [
            {
                "full": "triggerNodeReport(nodeAlias, [chunkId])",
                "name": "triggerNodeReport",
                "parameters": [
                    {
                        "full": "nodeAlias",
                        "name": "nodeAlias"
                    },
                    {
                        "full": "[chunkId]",
                        "name": "chunkId",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [triggerNodeReport](https://docs.dolphindb.com/en/Functions/t/triggerNodeReport.html)\n\n\n\n#### Syntax\n\ntriggerNodeReport(nodeAlias, \\[chunkId])\n\n#### Details\n\nForce the specified *nodeAlias* to report the chunk information to the controller to update the metadata maintained on the controller. If the *chunkId* is specified, only the specified chunks will be reported.\n\nWhen to use this function:\n\nThis command is used to solve the problem when the chunk information is not reported after a data node is restarted.\n\n1. Check whether the node is alive with field \"state\" returned by function `getClusterPerf`.\n\n2. Check the chunk information with fields \"replicas\" and \"replicaCount\" by calling `getClusterChunksStatus`.\n\n3. If the node is alive but the numbers of replicas do not match, you can search the corresponding chunk ID in the log of the controller. Find out the data node that has not reported and call this command on the node to trigger its report.\n\n4. If the command does not take effect, please restart the data node.\n\n#### Parameters\n\n**nodeAlias** is a STRING scalar indicating the node alias.\n\n**chunkId** (optional) is a STRING scalar or vector, specifying the chunk(s) to be reported. It only takes effect in cluster mode.\n\n#### Returns\n\nNone.\n"
    },
    "triggerPKEYCompaction": {
        "url": "https://docs.dolphindb.com/en/Functions/t/triggerPKEYCompaction.html",
        "signatures": [
            {
                "full": "triggerPKEYCompaction(chunkId, [async=true])",
                "name": "triggerPKEYCompaction",
                "parameters": [
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    },
                    {
                        "full": "[async=true]",
                        "name": "async",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [triggerPKEYCompaction](https://docs.dolphindb.com/en/Functions/t/triggerPKEYCompaction.html)\n\n\n\n#### Syntax\n\ntriggerPKEYCompaction(chunkId, \\[async=true])\n\n#### Details\n\nIn the PKEY engine, use this function to manually trigger the compaction all level files stored at level 0 for optimal reading performance.\n\n#### Parameters\n\n**chunkId** is a STRING scalar or vectorindicating the target chunk ID(s).\n\n**async**(optional) is a BOOL scalar determining whether to enable asynchronous compaction.\n\n* If true (default), return immediately after job submission.\n* If false, return after all jobs complete.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\ntriggerPKEYCompaction(chunkId=\"1486f935-6f87-479c-b341-34c6a303d4f9\", async=false)\n```\n"
    },
    "triggerTSDBCompaction": {
        "url": "https://docs.dolphindb.com/en/Functions/t/triggerTSDBCompaction.html",
        "signatures": [
            {
                "full": "triggerTSDBCompaction(chunkId, [level=0])",
                "name": "triggerTSDBCompaction",
                "parameters": [
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    },
                    {
                        "full": "[level=0]",
                        "name": "level",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [triggerTSDBCompaction](https://docs.dolphindb.com/en/Functions/t/triggerTSDBCompaction.html)\n\n\n\n#### Syntax\n\ntriggerTSDBCompaction(chunkId, \\[level=0])\n\n#### Details\n\nUse this command to manually trigger the compaction of TSDB level files at specific level for optimal reading performance.\n\n**Note**: The compaction of level 3 files can only be performed when configuration parameter *allowTSDBLevel3Compaction* is set to true and for tables with *keepDuplicates*=FIRST/LAST specified.\n\n#### Parameters\n\n**chunkId** is a STRING scalar indicating the chunk ID.\n\n**level** (optional) specifies at which level the compaction is triggered. It can be an integer in \\[-1,3].\n\n* If *level* is an integer in \\[0,3], compaction is triggered at the specified level. The default value is 0.\n* When *level* = -1, all level files are compacted into a single level file.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nThere are 2 file types in a chunk, the file chunk containing information about the database and table schema, and the tablet chunk storing data. Compaction of level files can only be conducted within a tablet chunk. Set \"type=1\" to filter the IDs of tablet chunks.\n\n```\nchunkIds = exec chunkId from getChunksMeta() where type=1\nfor (x in chunkIds) {\n    triggerTSDBCompaction(x)\n}\n```\n"
    },
    "tril": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tril.html",
        "signatures": [
            {
                "full": "tril(X, [k=0])",
                "name": "tril",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[k=0]",
                        "name": "k",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [tril](https://docs.dolphindb.com/en/Functions/t/tril.html)\n\n\n\n#### Syntax\n\ntril(X, \\[k=0])\n\n#### Details\n\nIf *k* is not specified: return the lower triangular portion of matrix *X*.\n\nIf *k* is specified: return the elements on and below the k-th diagonal of *X*.\n\n#### Parameters\n\n**X** is a matrix.\n\n**k** (optional) is an integer.\n\n#### Returns\n\nA matrix with the same data type as *X*.\n\n#### Examples\n\n```\nm=matrix(1 2 3, 4 5 6, 7 8 9);\nm;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 4    | 7    |\n| 2    | 5    | 8    |\n| 3    | 6    | 9    |\n\n```\ntril(m);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 0    | 0    |\n| 2    | 5    | 0    |\n| 3    | 6    | 9    |\n\n```\ntril(m,1);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 4    | 0    |\n| 2    | 5    | 8    |\n| 3    | 6    | 9    |\n\n```\ntril(m,-1);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 0    | 0    | 0    |\n| 2    | 0    | 0    |\n| 3    | 6    | 0    |\n\nRelated function: [triu](https://docs.dolphindb.com/en/Functions/t/triu.html)\n"
    },
    "trim": {
        "url": "https://docs.dolphindb.com/en/Functions/t/trim.html",
        "signatures": [
            {
                "full": "trim(X)",
                "name": "trim",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [trim](https://docs.dolphindb.com/en/Functions/t/trim.html)\n\n\n\n#### Syntax\n\ntrim(X)\n\n#### Details\n\nTrim all white spaces around the string.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nA scalar or vector of type STRING.\n\n#### Examples\n\n```\nx=[\"  t1\", \" t2 \"];\ntrim(x);\n// output: [\"t1\",\"t2\"]\n```\n\nRelated function: [strip](https://docs.dolphindb.com/en/Functions/s/strip.html)\n"
    },
    "trima": {
        "url": "https://docs.dolphindb.com/en/Functions/t/trima.html",
        "signatures": [
            {
                "full": "trima(X, window)",
                "name": "trima",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [trima](https://docs.dolphindb.com/en/Functions/t/trima.html)\n\n\n\n#### Syntax\n\ntrima(X, window)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Triangular Moving Average (trima) for *X* in a sliding window of the given length.\n\nThe formula is: ![](https://docs.dolphindb.com/en/images/trima.png)\n\nwhere *w1 = (window + 1)/2* (rounded up); *w2 = (window + 1)/2* (rounded down).\n\n#### Returns\n\nDOUBLE type with the same data form as *X*.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\ntrima(x,3);\n// output: [,,12.274999999999998,18.625,18.662500000000001,15.225000000000001,11.59375]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\ntrima(x,3);\n```\n\n| col1    | col2    |\n| ------- | ------- |\n|         |         |\n|         |         |\n| 12.2749 | 15.5000 |\n| 12.5499 | 17.5000 |\n| 12.5249 | 19.2500 |\n| 12.0499 | 18.2500 |\n| 11.5750 | 13.7500 |\n\nRelated functions: [sma](https://docs.dolphindb.com/en/Functions/s/sma.html), [wma](https://docs.dolphindb.com/en/Functions/w/wma.html), [trima](https://docs.dolphindb.com/en/Functions/t/trima.html)\n"
    },
    "triu": {
        "url": "https://docs.dolphindb.com/en/Functions/t/triu.html",
        "signatures": [
            {
                "full": "triu(X, [k=0])",
                "name": "triu",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[k=0]",
                        "name": "k",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [triu](https://docs.dolphindb.com/en/Functions/t/triu.html)\n\n\n\n#### Syntax\n\ntriu(X, \\[k=0])\n\n#### Details\n\nIf *k* is not specified: return the upper triangular portion of matrix *X*.\n\nIf *k* is specified: return the elements on and above the k-th diagonal of *X*.\n\nDifference from Python’s `numpy.triu`: `numpy.triu` supports arrays with at least two dimensions and applies to the last two axes for higher-dimensional arrays. DolphinDB’s `triu` only accepts matrices.\n\n#### Parameters\n\n**X** is a matrix.\n\n**k** (optional) is an integer.\n\n#### Returns\n\nA matrix with the same data type as *X*.\n\n#### Examples\n\n```\nm=matrix(1 2 3, 4 5 6, 7 8 9);\nm;\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 4    | 7    |\n| 2    | 5    | 8    |\n| 3    | 6    | 9    |\n\n```\ntriu(m);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 4    | 7    |\n| 0    | 5    | 8    |\n| 0    | 0    | 9    |\n\n```\ntriu(m,1);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 0    | 4    | 7    |\n| 0    | 0    | 8    |\n| 0    | 0    | 0    |\n\n```\ntriu(m,-1);\n```\n\n| col1 | col2 | col3 |\n| ---- | ---- | ---- |\n| 1    | 4    | 7    |\n| 2    | 5    | 8    |\n| 0    | 6    | 9    |\n\nRelated function: [tril](https://docs.dolphindb.com/en/Functions/t/tril.html)\n"
    },
    "trueRange": {
        "url": "https://docs.dolphindb.com/en/Functions/t/trueRange.html",
        "signatures": [
            {
                "full": "trueRange(high, low, close)",
                "name": "trueRange",
                "parameters": [
                    {
                        "full": "high",
                        "name": "high"
                    },
                    {
                        "full": "low",
                        "name": "low"
                    },
                    {
                        "full": "close",
                        "name": "close"
                    }
                ]
            }
        ],
        "markdown": "### [trueRange](https://docs.dolphindb.com/en/Functions/t/trueRange.html)\n\n\n\n#### Syntax\n\ntrueRange(high, low, close)\n\n#### Details\n\nReturn a vector of the same length as each of the input vectors.\n\nThe result for each position is the maximum of | *high* - *low* |, | *high* - last period *close* | and | last period *close* - *low* |.\n\n#### Parameters\n\nThe 3 parameters are numeric vectors of equal length.\n\nUsually, **high** is the highest price of the current period; **low** is the lowest price of the current period; **close** is the closing price of the current period.\n\n#### Returns\n\nA vector of DOUBLE type.\n\n#### Examples\n\n```\nsym=take(`A`B,10)\ndate=2020.01.01 2020.01.01 2020.01.02 2020.01.02 2020.01.03 2020.01.03 2020.01.04 2020.01.04 2020.01.05 2020.01.05\nhigh=[11.48,10.23,12.26,10.7,12.24,10.45,12.3,10.51,12.24,10.49]\nlow=[10.91,9.41,11.18,10,11.71,9.83,11.62,9.91,11.1,9.6]\nclose=[11.38,10.22,12.1,10.31,11.89,10.21,12.13,10.47,11.35,9.81]\nt=table(sym,date,high,low,close)\nselect sym,trueRange(high,low,close) as trange from t context by sym;\n```\n\n| sym | trange |\n| --- | ------ |\n| A   |        |\n| A   | 1.08   |\n| A   | 0.53   |\n| A   | 0.68   |\n| A   | 1.14   |\n| B   |        |\n| B   | 0.7    |\n| B   | 0.62   |\n| B   | 0.6    |\n| B   | 0.89   |\n"
    },
    "truncate": {
        "url": "https://docs.dolphindb.com/en/Functions/t/truncate.html",
        "signatures": [
            {
                "full": "truncate(dbUrl, tableName)",
                "name": "truncate",
                "parameters": [
                    {
                        "full": "dbUrl",
                        "name": "dbUrl"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    }
                ]
            }
        ],
        "markdown": "### [truncate](https://docs.dolphindb.com/en/Functions/t/truncate.html)\n\n\n\n#### Syntax\n\ntruncate(dbUrl, tableName)\n\n#### Details\n\nRemove all rows from a DFS table but keep its schema. Command `truncate` is faster than the [delete](https://docs.dolphindb.com/en/Programming/SQLStatements/delete.html) statement and the [dropPartition](https://docs.dolphindb.com/en/Functions/d/dropPartition.html) function.\n\nIt is suggested to call function [dropTable](https://docs.dolphindb.com/en/Functions/d/dropTable.html) if you want to delete the schema of the table.\n\nDifference from Python’s `scipy.stats.truncate`: `scipy.stats.truncate` is a truncated random variable distribution object. DolphinDB’s `truncate` is a database management function that clears the data of a DFS table specified by *tableName* in the database specified by *dbUrl* while preserving the table schema.\n\n#### Parameters\n\n**dbUrl** is a string indicating the DFS path of a database.\n\n**tableName** is a string indicating the table name.\n\n#### Returns\n\nNone.\n\n#### Example\n\n```\nn=1000000\nID=rand(150, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(10.0, n)\nt=table(ID, date, x)\ndbDate = database(, VALUE, 2017.08.07..2017.08.11)\ndbID = database(, RANGE, 0 50 100 150)\n\ndbName=\"dfs://compoDB\"\nif(existsDatabase(dbName)){\n\n      dropDatabase(dbName)\n}\ndb = database(dbName, COMPO, [dbDate, dbID])\npt = db.createPartitionedTable(t, `pt, `date`ID)\npt.append!(t);\n\ntruncate(dbName, `pt)\n```\n"
    },
    "tTest": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tTest.html",
        "signatures": [
            {
                "full": "tTest(X, [Y], [mu=0.0], [confLevel=0.95], [equalVar=false])",
                "name": "tTest",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    },
                    {
                        "full": "[mu=0.0]",
                        "name": "mu",
                        "optional": true,
                        "default": "0.0"
                    },
                    {
                        "full": "[confLevel=0.95]",
                        "name": "confLevel",
                        "optional": true,
                        "default": "0.95"
                    },
                    {
                        "full": "[equalVar=false]",
                        "name": "equalVar",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [tTest](https://docs.dolphindb.com/en/Functions/t/tTest.html)\n\n\n\n#### Syntax\n\ntTest(X, \\[Y], \\[mu=0.0], \\[confLevel=0.95], \\[equalVar=false])\n\n#### Details\n\nIf *Y* is not specified, conduct a one-sample t-test on *X*. If *Y* is specified, conduct a paired-sample t-test on *X* and *Y*.\n\n#### Parameters\n\n**X** is a numeric vector indicating the sample for the t-test.\n\n**Y** (optional) is a numeric vector indicating the second sample for a paired-sample t-test.\n\n**mu** (optional) is a floating number. If *Y* is not specified, *mu* is the mean value of *X* in the null hypothesis; if *Y* is specified, *mu* is the difference in the mean values of *X* and *Y* in the null hypothesis.The default value is 0.\n\n**confLevel** (optional) is a floating number between 0 and 1 indicating the confidence level of the test. The default value is 0.95.\n\n**equalVar** (optional) is a Boolean value indicating whether the variance of *X* and *Y* are the same in the null hypothesis. The default value is false.\n\n#### Returns\n\nReturn a dictionary with the following keys:\n\n* stat: a table with p-value and confidence interval under 3 alternative hypotheses.\n\n* df: degree of freedom\n\n* confLevel: confidence level\n\n* method: type of t-test used\n\n* tValue: t-stat\n\n#### Examples\n\nOne-sample t-test:\n\n```\nx = norm(10.0, 1.0, 20)\ntTest(x, , 10.0);\n\n/* output:\nstat->\nalternativeHypothesis        pValue   lowerBound upperBound\n---------------------------- -------- ---------- ----------\ntrue mean is not equal to 10 0.499649 9.68582    10.621998\ntrue mean is less than 10    0.750176 -Infinity  10.540616\ntrue mean is greater than 10 0.249824 9.767202   Infinity\n\ndf->19\nconfLevel->0.95\nmethod->One sample t-test\ntValue->0.688192\n*/\n```\n\nPaired-sample t-test with equal sample variance:\n\n```\nx = norm(10.0, 1.0, 20)\ny = norm(4.0, 1.0, 10)\ntTest(x, y, 6.0, , true);\n\n/* output:\nstat->\nalternativeHypothesis                pValue   lowerBound upperBound\n------------------------------------ -------- ---------- ----------\ndifference of mean is not equal to 6 0.438767 5.539812   7.03262\ndifference of mean is less than 6    0.780616 -Infinity  6.906078\ndifference of mean is greater than 6 0.219384 5.666354   Infinity\n\ndf->28\nconfLevel->0.95\nmethod->Two sample t-test\ntValue->0.785483\n*/\n```\n\nPaired-sample t-test with no restriction on sample variance:\n\n```\nx = norm(10.0, 1.0, 20)\ny = norm(1.0, 2.0, 10)\ntTest(x, y, 9.0);\n\n/* output:\nstat->\nalternativeHypothesis          pValue   lowerBound upperBound\n------------------------------ ----------------- ---------- ----------\ntrue difference of mean is n...0.983376 7.752967   10.271656\ntrue difference of mean is l...0.508312 -Infinity  10.04285\ntrue difference of mean is g...0.491688 7.981773   Infinity\n\ndf->12.164434\nconfLevel->0.95\nmethod->Welch two sample t-test\ntValue->0.021269\n*/\n```\n"
    },
    "tupleSum": {
        "url": "https://docs.dolphindb.com/en/Functions/t/tupleSum.html",
        "signatures": [
            {
                "full": "tupleSum(X)",
                "name": "tupleSum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [tupleSum](https://docs.dolphindb.com/en/Functions/t/tupleSum.html)\n\n\n\n#### Syntax\n\ntupleSum(X)\n\n#### Details\n\nSummarize individual results from multiple *map* calls. If each *map* call returns a tuple with *N* non-tuple objects, the input for `tupleSum` function would be a tuple of *N* tuples. Each child tuple contains *m* objects with identical data form and data type, where *m* is the number of *map* calls. If there is a single *map* call, however, `tupleSum` accepts the results of the *map* call as the input, and simply returns the input as the output.\n\nThe result of the function `tupleSum` always has the same format as the *map* call result. If the *map* call returns a tuple with at least 2 non-tuple objects, then `tupleSum` returns a tuple containing the same number of non-tuple objects.\n\n#### Parameters\n\n**X** is a tuple.\n\n#### Examples\n\n```\nx = [(1 2, 3 4, 5 6), (0.5, 0.6, 0.7)];\ntupleSum(x);\n// output: ([9,12],1.8)\n```\n\nIf the *map* call return a single non-tuple object, then *tupleSum* also returns a single non-tuple object.\n\n```\nx = [(1 2, 3 4, 5 6)];\ntupleSum(x);\n// output: [9,12]\n```\n"
    },
    "type": {
        "url": "https://docs.dolphindb.com/en/Functions/t/type.html",
        "signatures": [
            {
                "full": "type(X)",
                "name": "type",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [type](https://docs.dolphindb.com/en/Functions/t/type.html)\n\n\n\n#### Syntax\n\ntype(X)\n\n#### Details\n\nReturn an integer indicating the data type of X. Please refer to [Data Types](https://docs.dolphindb.com/en/Programming/DataTypesandStructures/DataTypes/DataTypes.html) for details.\n\n#### Parameters\n\n**X** can be any data type that the system supports.\n\n#### Returns\n\nA scalar of type INT.\n\n#### Examples\n\n```\nx=3;\nx;\n// output: 3\n\ntype(x);\n// output: 4\n// INT\n\ntype(1.2);\n// output: 16\n// DOUBLE\n\ntype(\"Hello\");\n// output: 18\n// STRING\n```\n"
    },
    "typestr": {
        "url": "https://docs.dolphindb.com/en/Functions/t/typestr.html",
        "signatures": [
            {
                "full": "typestr(X)",
                "name": "typestr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [typestr](https://docs.dolphindb.com/en/Functions/t/typestr.html)\n\n\n\n#### Syntax\n\ntypestr(X)\n\n#### Details\n\nReturn a string indicating the data type of X. Please refer to [Data Types](https://docs.dolphindb.com/en/Programming/DataTypesandStructures/DataTypes/DataTypes.html) for details.\n\n#### Parameters\n\n**X** can be any data type that the system supports.\n\n#### Returns\n\nA scalar of type STRING.\n\n#### Examples\n\n```\nx=3;\nx;\n// output: 3\n\ntypestr x;\n// output: INT\n\ntypestr 1.2;\n// output: DOUBLE\n\ntypestr `Hello;\n// output: STRING\n```\n"
    },
    "saveAsNpy": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveAsNpy.html",
        "signatures": [
            {
                "full": "saveAsNpy(obj, fileName)",
                "name": "saveAsNpy",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "fileName",
                        "name": "fileName"
                    }
                ]
            }
        ],
        "markdown": "### [saveAsNpy](https://docs.dolphindb.com/en/Functions/s/saveAsNpy.html)\n\n\n\n#### Syntax\n\nsaveAsNpy(obj, fileName)\n\n#### Details\n\nSave a vector/matrix in DolphinDB as an npy file. It must be executed by a logged-in user.\n\nNote: Null values in *obj* will be converted to negative infinity (-inf).\n\n#### Parameters\n\n**obj** is a numeric vector/matrix.\n\n**fileName** is the path and name of the output file.\n\n#### Examples\n\n```\nv = 1..1000\nv.saveAsNpy(\"C:/DolphinDB/intVec.npy\")\n\nm = (1..1000 + 0.5)$20:50\nm.saveAsNpy(\"C:/DolphinDB/doubleMat.npy\")\n```\n\nLoad files in python:\n\n```\nimport numpy as np\nv = np.load(\"C:/DolphinDB/intVec.npy\")\nm = np.load(\"C:/DolphinDB/doubleMat.npy\")\n```\n\nRelated function: [loadNpy](https://docs.dolphindb.com/en/Functions/l/loadNpy.html)\n"
    },
    "saveDatabase": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveDatabase.html",
        "signatures": [
            {
                "full": "saveDatabase(dbHandle)",
                "name": "saveDatabase",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    }
                ]
            }
        ],
        "markdown": "### [saveDatabase](https://docs.dolphindb.com/en/Functions/s/saveDatabase.html)\n\n\n\n#### Syntax\n\nsaveDatabase(dbHandle)\n\n#### Details\n\nSave a database handle. It must be executed by a logged-in user. It is used with the [database](https://docs.dolphindb.com/en/Functions/d/database.html) function.\n\nAfter we create a database for the first time, we can save the database with the command `saveDatabase`. If the database location is a folder that already contains DolphinDB table related files, then function [database](https://docs.dolphindb.com/en/Functions/d/database.html) reopens a previously created database, and there is no need to use the `saveDatabase` command to save it.\n\n#### Parameters\n\n**dbHandle** is a DolphinDB database handle.\n\n#### Examples\n\n```\ndb=database(\"C:/DolphinDB/\")\nsaveDatabase(db);\n```\n"
    },
    "saveDualPartition": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveDualPartition.html",
        "signatures": [
            {
                "full": "saveDualPartition(dbHandle1, dbHandle2, table, tableName, partitionColumn1, partitionColumn2, [compression=false])",
                "name": "saveDualPartition",
                "parameters": [
                    {
                        "full": "dbHandle1",
                        "name": "dbHandle1"
                    },
                    {
                        "full": "dbHandle2",
                        "name": "dbHandle2"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "partitionColumn1",
                        "name": "partitionColumn1"
                    },
                    {
                        "full": "partitionColumn2",
                        "name": "partitionColumn2"
                    },
                    {
                        "full": "[compression=false]",
                        "name": "compression",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [saveDualPartition](https://docs.dolphindb.com/en/Functions/s/saveDualPartition.html)\n\n\n\n#### Syntax\n\nsaveDualPartition(dbHandle1, dbHandle2, table, tableName, partitionColumn1, partitionColumn2, \\[compression=false])\n\n#### Details\n\nSave a table in the local node before sharing it to other nodes to form a dual partition database. It must be executed by a logged-in user.\n\nIt is used together with statement [share](https://docs.dolphindb.com/en/Programming/ProgrammingStatements/share.html). If the partition and a table already exist, the function will append the new data to the existing table.\n\n#### Parameters\n\n**dbHandle1** is the database handle of the first level partition.\n\n**dbHandle2** is the database handle of the second level partition.\n\n**table** is the table in memory to be saved.\n\n**tableName** is a string indicating the desired name of the saved partitioned table.\n\n**partitionColumn1** is a string indicating the partitioning column of the first level partition.\n\n**partitionColumn2** is a string indicating the partitioning column of the second level partition.\n\n**compression** (optional) is a Boolean variable. It sets the compression mode. When it is set to true, the table will be saved to disk in compression mode. The default value is false.\n\n#### Examples\n\n```\nn=1000000\nID=rand(10, n)\ndates=2017.08.07..2017.08.11\ndate=rand(dates, n)\nx=rand(1.0, n)\nt=table(ID, date, x);\n\nhdb = database(\"C:/DolphinDB/Data/dualDB\", RANGE,  0 5 10)\nvdb = database(, VALUE, dates)\nsaveDualPartition(hdb, vdb, t, `tDualPartition, `ID, `date)\n```\n"
    },
    "saveModel": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveModel.html",
        "signatures": [
            {
                "full": "saveModel(model, location)",
                "name": "saveModel",
                "parameters": [
                    {
                        "full": "model",
                        "name": "model"
                    },
                    {
                        "full": "location",
                        "name": "location"
                    }
                ]
            }
        ],
        "markdown": "### [saveModel](https://docs.dolphindb.com/en/Functions/s/saveModel.html)\n\n\n\n#### Syntax\n\nsaveModel(model, location)\n\n#### Details\n\nSave the specifications of a trained model to a file on disk.\n\n#### Parameters\n\n**model** is a dictionary of the specifications of a prediction model. It is generated by functions such as [randomForestClassifier](https://docs.dolphindb.com/en/Functions/r/randomForestClassifier.html) and [randomForestRegressor](https://docs.dolphindb.com/en/Functions/r/randomForestRegressor.html).\n\n**location** is a string indicating the absolute path and name of the output file.\n\n#### Returns\n\nA Boolean value indicating the save result.\n\n#### Examples\n\n```\nx1 = rand(100.0, 100)\nx2 = rand(100.0, 100)\nb0 = 6\nb1 = 1\nb2 = -2\nerr = norm(0, 10, 100)\ny = b0 + b1 * x1 + b2 * x2 + err\nt = table(x1, x2, y)\nmodel = randomForestRegressor(sqlDS(<select * from t>), `y, `x1`x2)\nsaveModel(model, \"C:/DolphinDB/Data/regressionModel.txt\");\n```\n"
    },
    "saveModule": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveModule.html",
        "signatures": [
            {
                "full": "saveModule(name,[moduleDir],[overwrite=false])",
                "name": "saveModule",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "[moduleDir]",
                        "name": "moduleDir",
                        "optional": true
                    },
                    {
                        "full": "[overwrite=false]",
                        "name": "overwrite",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [saveModule](https://docs.dolphindb.com/en/Functions/s/saveModule.html)\n\n\n\n#### Syntax\n\nsaveModule(name,\\[moduleDir],\\[overwrite=false]))\n\n#### Details\n\nSerialize a module (\".dos\" file) to a binary file with a file name extension of \".dom\". It must be executed by a logged-in user.\n\nThe default value of *moduleDir* is the relative directory \"modules\" that needs to be created by the user. The system searches the relative directory \"modules\" in the following order: home directory of the node, the working directory of the node, and the directory with the DolphinDB executable. Please note that in the single node mode, these 3 directory are the same by default.\n\n`saveModule` enhances the confidentiality and the security of the code.\n\n#### Parameters\n\n**name** is a string indicating the name of the module.\n\n**moduleDir** (optional) is a string indicating the directory where the module files are located.\n\n**overwrite** (optional) is a Boolean value indicating whether to overwrite the existing module dom file.\n\n#### Examples\n\nAssuming the directory \"modules\" under the node's home directory contains the module files \"ta.dos\" and \"system/log/fileLog.dos\", the following example serializes the module files to binary files.\n\n```\nsaveModule(\"ta\");\n\nsaveModule(\"system::log::fileLog\");\n```\n\nRelated command: [loadModule](https://docs.dolphindb.com/en/Functions/l/loadModule.html)\n"
    },
    "savePartition": {
        "url": "https://docs.dolphindb.com/en/Functions/s/savePartition.html",
        "signatures": [
            {
                "full": "savePartition(dbHandle, table, tableName, [compression=true])",
                "name": "savePartition",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[compression=true]",
                        "name": "compression",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [savePartition](https://docs.dolphindb.com/en/Functions/s/savePartition.html)\n\n\n\n#### Syntax\n\nsavePartition(dbHandle, table, tableName, \\[compression=true])\n\n#### Details\n\nSave a table as a partitioned DFS table. It must be executed by a logged-in user.\n\nAn empty table must be created with the function [createPartitionedTable](https://docs.dolphindb.com/en/Functions/c/createPartitionedTable.html).\n\n#### Parameters\n\n**dbHandle** is a DolphinDB database handle.\n\n**table** is the table in memory to be saved.\n\n**tableName** is a string indicating the desired name of the saved partitioned table.\n\n**compression** (optional) is a Boolean variable. It sets the compression mode. When it is set to *true*, the table will be saved to disk in compression mode. The default value is *true*.\n\n#### Examples\n\n```\nn=1000000\nID=rand(10, n)\nvalue=rand(1.0, n)\nt=table(ID, value);\n\ndb=database(\"dfs://rangedb_Trades\", RANGE,  0 5 10)\nTrades = db.createPartitionedTable(t, \"Trades\", \"ID\");\nsavePartition(db, t, `Trades)\n\nTrades=loadTable(db, `Trades)\nselect count(value) from Trades;\n// output: 1,000,000\n```\n\nIn the example above, the database db has two partitions: \\[0,5) and \\[5,10). Table t is saved as a partitioned table *Trades* with the partitioning column of *ID* in database db.\n\nWe can append another table to the table *Trades*:\n\n```\nn=500000\nID=rand(10, n)\nvalue=rand(1.0, n)\nt1=table(ID, value);\nsavePartition(db, t1, `Trades)\nTrades=loadTable(db, `Trades)\nselect count(value) from Trades;\n// output: 1,500,000\n```\n"
    },
    "saveTable": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveTable.html",
        "signatures": [
            {
                "full": "saveTable(dbHandle, table, [tableName], [append=false], [compression=false])",
                "name": "saveTable",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "[tableName]",
                        "name": "tableName",
                        "optional": true
                    },
                    {
                        "full": "[append=false]",
                        "name": "append",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[compression=false]",
                        "name": "compression",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [saveTable](https://docs.dolphindb.com/en/Functions/s/saveTable.html)\n\n\n\n#### Syntax\n\nsaveTable(dbHandle, table, \\[tableName], \\[append=false], \\[compression=false])\n\n#### Details\n\nSave a table to an unpartitioned disk table. It must be executed by a logged-in user.\n\nTo save a table to a partitioned database, use [createPartitionedTable](https://docs.dolphindb.com/en/Functions/c/createPartitionedTable.html) together with [append!](https://docs.dolphindb.com/en/Functions/a/append!.html) or [tableInsert](https://docs.dolphindb.com/en/Functions/t/tableInsert.html).\n\n**Note:** Disk tables are only used for backup or local computing. Unlike the DFS tables, disk tables do not support access control.\n\n#### Parameters\n\n**dbHandle** is a DolphinDB database handle.\n\n**table** is the table in memory to be saved.\n\n**tableName** (optional) is a string indicating the desired name for the saved table. If unspecified, the saved table has the same name as the table in memory.\n\n**append** (optional) is the appending mode. When it is set to *true*, the new table will be appended to the old table. The default value is *false*.\n\n**compression** (optional) is the compression mode. When it is set to *true*, the table will be saved to disk in compression mode. The default setting is *false*.\n\n#### Examples\n\n```\ndb=database(\"C:/DolphinDB/Data/db1\")\nt=table(take(1..10,10000000) as id, rand(10,10000000) as x, rand(10.0,10000000) as y);\n```\n\nSave table t to disk:\n\n```\nsaveTable(dbHandle=db, table=t);\n```\n\nSave table t to disk with name t1:\n\n```\nsaveTable(dbHandle=db, table=t, tableName=`t1);\n```\n\nSave table t to disk with name t2 and with appending mode:\n\n```\nsaveTable(dbHandle=db, table=t, tableName=`t2, append=true);\n```\n\nSave table t to disk with name t3 and with compression mode:\n\n```\nsaveTable(dbHandle=db, table=t, tableName=`t3, append=false, compression=true);\n```\n"
    },
    "saveText": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveText.html",
        "signatures": [
            {
                "full": "saveText(obj, filename, [delimiter=','], [append=false], [header=true], [bom=''])",
                "name": "saveText",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "[delimiter='",
                        "name": "[delimiter='"
                    },
                    {
                        "full": "']",
                        "name": "']"
                    },
                    {
                        "full": "[append=false]",
                        "name": "append",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[header=true]",
                        "name": "header",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[bom='']",
                        "name": "bom",
                        "optional": true,
                        "default": "''"
                    }
                ]
            }
        ],
        "markdown": "### [saveText](https://docs.dolphindb.com/en/Functions/s/saveText.html)\n\n\n\n#### Syntax\n\nsaveText(obj, filename, \\[delimiter=','], \\[append=false], \\[header=true], \\[bom=''])\n\n#### Details\n\nSave DolphinDB variables or data queried by SQL statement as a text file on disk. Compared with [saveTable](https://docs.dolphindb.com/en/Functions/s/saveTable.html), `saveText` requires more disk space and time.\n\n#### Parameters\n\n**obj** can be a table/matrix/vector/metacode of SQL statements. When *obj* is the metacode of SQL statements, multiple workers are allocated to read the data concurrently, and the data is written to the file with another worker. In other cases, data queries and writes are handled by the current worker.\n\n**filename** is a string indicating the absolute path and name of the output file. Currently the output file can only be saved in *.csv* format.\n\n**delimiter** (optional) is the table column separator. The system uses comma as the default delimiter.\n\n**append** (optional) is a Boolean value indicating whether to append to (true) or overwrite (false) the output file if it exists already.\n\n**header** (optional) is a BOOLEAN indicating whether to save the column names in the output file when obj is a table. The default value is true. Please note that this parameter has no effect when this command is used for appending data to an existing non-empty file (i.e., when append = true).\n\n**bom** (optional) is a case-insensitive STRING scalar that determines whether to include Byte order mark (BOM) in output CSV files. Currently, only \"UTF-8\" is supported. It defaults to ' '.\n\n#### Examples\n\n*Example 1*\n\n```\nn=20000000\nsyms=`IBM`C`MS`MSFT`JPM`ORCL`GE`EBAY`GOOG`FORD`GS\ntimestamp=09:30:00+rand(18000,n)\nsym=rand(syms,n)\nqty=100*(1+rand(100,n))\nprice=5.0+rand(100.0,n)\nt1=table(timestamp,sym,qty,price);\n\ntimer saveText(t1, \"c:/test/trades.txt\");\n// Time elapsed: 191488 ms\n```\n\n*Example 2*\n\n```\nn=100\nt1=table(1..n as id, rand(1000, n) as x)\nsaveText(t1, \"C:/DolphinDB/Data/t.csv\",,1)\nt2=table((n+1)..(2*n) as id, rand(1000, n) as x)\nsaveText(t2, \"C:/DolphinDB/Data/t.csv\",,1)\nt = loadText(\"C:/DolphinDB/Data/t.csv\")\nselect count(*) from t;\n// output: 200\n```\n\n*Example 3* Save a DFS table as a text file\n\n```\nif(existsDatabase(\"dfs://testdb\")){\n\n  dropDatabase(\"dfs://testdb\")\n}\nn=3000\nticker = rand(`MSFT`GOOG`FB`ORCL`IBM`PPT`AZH`ILM`ANZ,n);\nid = rand(`A`B`C, n)\nx=rand(1.0, n)\nt=table(ticker, id, x)\ndb=database(directory=\"dfs://testdb\", partitionType=HASH, partitionScheme=[STRING, 5])\npt = db.createPartitionedTable(t, `pt, `ticker)\npt.append!(t)\n\nsaveText(<select * from pt>, \"/home/data/pt.txt\")\n```\n"
    },
    "saveTextFile": {
        "url": "https://docs.dolphindb.com/en/Functions/s/saveTextFile.html",
        "signatures": [
            {
                "full": "saveTextFile(content, filename, [append=false], [lastModified])",
                "name": "saveTextFile",
                "parameters": [
                    {
                        "full": "content",
                        "name": "content"
                    },
                    {
                        "full": "filename",
                        "name": "filename"
                    },
                    {
                        "full": "[append=false]",
                        "name": "append",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[lastModified]",
                        "name": "lastModified",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [saveTextFile](https://docs.dolphindb.com/en/Functions/s/saveTextFile.html)\n\n\n\n#### Syntax\n\nsaveTextFile(content, filename, \\[append=false], \\[lastModified])\n\n#### Details\n\nSave strings to a file by appending or overwriting. It must be executed by a logged-in user.\n\n#### Parameters\n\n**content** is the contents to be written into the file.\n\n**filename** is a string indicating the absolute path and name of the output file. Currently the output file can only be saved in *.csv* format.\n\n**append** (optional) is a Boolean flag. True means appending while false means overwriting.\n\n**lastModified** (optional) is the previously modified time displayed in epoch time format.\n\n#### Examples\n\n```\nsaveTextFile(\"1234567890\\n0987654321\\nabcdefghijk\\n\", \"/home/test/abc.txt\", false, 1495762562671l);\n\n/* output content of file \"/home/test/abc.txt\":\n1234567890\n0987654321\nabcdefghijk\n*/\n```\n"
    },
    "scheduleJob": {
        "url": "https://docs.dolphindb.com/en/Functions/s/scheduleJob.html",
        "signatures": [
            {
                "full": "scheduleJob(jobId, jobDesc, jobFunc, scheduleTime, startDate, endDate, frequency, [days], [onComplete], [priority], [parallelism])",
                "name": "scheduleJob",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    },
                    {
                        "full": "jobDesc",
                        "name": "jobDesc"
                    },
                    {
                        "full": "jobFunc",
                        "name": "jobFunc"
                    },
                    {
                        "full": "scheduleTime",
                        "name": "scheduleTime"
                    },
                    {
                        "full": "startDate",
                        "name": "startDate"
                    },
                    {
                        "full": "endDate",
                        "name": "endDate"
                    },
                    {
                        "full": "frequency",
                        "name": "frequency"
                    },
                    {
                        "full": "[days]",
                        "name": "days",
                        "optional": true
                    },
                    {
                        "full": "[onComplete]",
                        "name": "onComplete",
                        "optional": true
                    },
                    {
                        "full": "[priority]",
                        "name": "priority",
                        "optional": true
                    },
                    {
                        "full": "[parallelism]",
                        "name": "parallelism",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [scheduleJob](https://docs.dolphindb.com/en/Functions/s/scheduleJob.html)\n\n\n\n#### Syntax\n\nscheduleJob(jobId, jobDesc, jobFunc, scheduleTime, startDate, endDate, frequency, \\[days], \\[onComplete], \\[priority], \\[parallelism])\n\n#### Details\n\nExecute a job at specified time and with specified *frequency*. Return the job ID of the scheduled job. If *jobId* is different from the job IDs of all the existing scheduled jobs, the system returns *jobId*. Otherwise, append suffix of the current date, or \"000\", \"001\", ..... or both to *jobId* until a unique scheduled job ID is found. Please use [getRecentJobs](https://docs.dolphindb.com/en/Functions/g/getRecentJobs.html) to view the recently finished scheduled jobs.\n\nThe messages produced in the execution of the scheduled job are saved in *jobId.msg*; if the scheduled job returns any value, it is saved in *jobId.object*. *jobId.msg* and *jobId.object* are saved under the folder of *batchJobs*. We can use functions [getJobMessage](https://docs.dolphindb.com/en/Functions/g/getJobMessage.html) and [getJobReturn](https://docs.dolphindb.com/en/Functions/g/getJobReturn.html) to view these 2 files respectively.\n\n#### Parameters\n\n**jobId** is a string indicating the job ID.\n\n**jobDesc** is a string indicating the job description.\n\n**jobFunc** is a function with no parameters. It is usually a partial application. Note that if the *jobFunc* is a user-defined function, it can only take scalars, pairs or regular vectors as default parameters.\n\n**scheduleTime** is a scalar/vector of MINUTE type. The minimum time interval to execute the next task is 5 minutes.\n\n**startDate** is a scalar of DATE type.\n\n**endDate** is a scalar of DATE type.\n\n**frequency** is of CHAR type. It can take one of the following 3 values: 'D' for daily, 'W' for weekly, and 'M' for monthly.\n\n**days** (optional) is an integer scalar/vector indicating which day(s) of a week or a month to run the scheduled job. This optional parameter is required if frequency=W or M. If frequency=W, days can take the following values: 0 (Sunday), 1 (Monday), ...., 5 (Firday), 6 (Saturday).\n\n**onComplete** (optional) is a callback function with 4 parameters. For details please refer to the last example below. After the scheduled job is executed (even if an error occurs), the callback function is executed. It can be used to send out emails regarding the execution.\n\n**priority** (optional) is an integer from 0 to 8 indicating the priority of the job. The default value is 4.\n\n**parallelism** (optional) is an integer from 0 to 8 indicating the maximum number of workers allocated to the job. The default value is 2.\n\n**Note**: The *priority* and *parallelism* of the job are limited by the maximum values (*maxPriority*and *maxParallelism*) set by [setMaxJobPriority](https://docs.dolphindb.com/en/Functions/s/setMaxJobPriority.html) and [setMaxJobParallelism](https://docs.dolphindb.com/en/Functions/s/setMaxJobParallelism.html), respectively. The final priority and parallelism are `min(priority, maxPriority)` and `min(parallelism, maxParallelism)`.\n\n#### Returns\n\nThe scheduled job ID. If *jobId* is different from existing scheduled job IDs, the system returns *jobId*. Otherwise, it appends the current date and suffixes such as \"000\" or \"001\" to *jobId* until a unique job ID is generated.\n\n#### Examples\n\nSchedule to run a function:\n\n```\ndef f():1+2;\nscheduleJob(jobId=`daily, jobDesc=\"Daily Job 1\", jobFunc=f, scheduleTime=17:23m, startDate=2018.01.01, endDate=2018.12.31, frequency='D');\nscheduleJob(jobId=`weekly, jobDesc=\"Weekly Job\", jobFunc=f, scheduleTime=17:30m, startDate=2018.01.01, endDate=2018.12.31, frequency='W', days=2);\n```\n\nSchedule to run a script:\n\n```\nscheduleJob(jobId=`monthly, jobDesc=\"Monthly Job 1\", jobFunc=run{\"monthlyJob.dos\"}, scheduleTime=17:23m, startDate=2018.01.01, endDate=2018.12.31, frequency='M', days=1);\n```\n\nHere we use a partial application run{\\<script>} as this parameter needs to be a function with no arguments.\n\n```\ngetJobMessage(`daily);\n\n018-02-08 17:23:27.166296 Start the job [daily]: Daily Job 1\n\n018-02-08 17:23:27.167303 The job is done.\n\n\n getJobReturn(`daily);\n\n\n```\n\nWe can schedule to run the same job multiple times a day:\n\n```\nscheduleJob(jobId=`Trading, jobDesc=\"Generate Trading Tickets\", jobFunc=run{\"TradingTickets.dos\"}, scheduleTime=[09:25m, 12:00m, 02:00m, 15:50m], startDate=2018.01.01, endDate=2018.12.31, frequency='D');\n```\n\nIn this case, each time this scheduled job is executed, the job ID is different. The job IDs for the first day is \"Trading\", \"Trading20180101000\", \"Trading001\", \"Trading002\" for the first day, and \"Trading003\", \"Trading004\", \"Trading005\", \"Trading006\" for the second day, etc.\n\nTo run the same job multiple times a day only on weekdays:\n\n```\nscheduleJob(jobId=`PnL, jobDesc=\"Calculate Profit & Loss\", jobFunc=run{\"PnL.dos\"}, scheduleTime=[12:00m, 02:00m, 14:50m], startDate=2018.01.01, endDate=2018.12.31, frequency='W', days=[1,2,3,4,5]);\n```\n\nSend an email after the execution of the scheduled job. Please install the HttpClient plugin before running the following script.\n\n```\ndef sendEmail(jobId, jobDesc, success, result){\n  desc = \"jobId=\" + jobId + \" jobDesc=\" + jobDesc\n  if(success){\n  desc += \" successful \" + result\n    res = httpClient::sendEmail('patrick.mahomes@dolphindb.com','password','andy.reid@dolphindb.com','This is a subject',desc)\n  }\n  else{\n  desc += \" with error: \" + result\n    res = httpClient::sendEmail('patrick.mahomes@dolphindb.com','password','andy.reid@dolphindb.com','This is a subject',desc)\n  }\n}\nscheduleJob(jobId=`PnL, jobDesc=\"Calculate Profit & Loss\", jobFunc=run{\"PnL.dos\"}, scheduleTime=[12:00m, 02:00m, 14:50m], startDate=2018.01.01, endDate=2018.12.31, frequency='W', days=[1,2,3,4,5], onComplete=sendEmail);\n```\n"
    },
    "schema": {
        "url": "https://docs.dolphindb.com/en/Functions/s/schema.html",
        "signatures": [
            {
                "full": "schema(table|dbHandle)",
                "name": "schema",
                "parameters": [
                    {
                        "full": "table|dbHandle",
                        "name": "table|dbHandle"
                    }
                ]
            }
        ],
        "markdown": "### [schema](https://docs.dolphindb.com/en/Functions/s/schema.html)\n\n\n\n#### Syntax\n\nschema(table|dbHandle)\n\n#### Details\n\nDisplay information about the schema of a table or a database. The function returns an unordered dictionary containing the following information (in alphabetical order):\n\n* atomic: the level at which the atomicity is guaranteed for a write transaction. It can be TRANS or CHUNK.\n* chunkGranularity: the chunk granularity which determines whether to allow concurrent writes to different tables in the same chunk. It can be TABLE or DATABASE.\n* clusterReplicationEnabled: whether asynchronous replication has been enabled.\n* colDefs: information about each column in the table:\n  * name: column name\n  * typeString: column type\n  * typeInt: the type ID\n  * extra: the scale of a DECIMAL value\n  * comment: comment on the column\n  * sensitive: whether this column is set as a sensitive column. It is returned only when table is a DFS table.\n* compressMethods: the compression methods used for specified columns of a DFS table.\n  * name: Column names\n  * compressMethods: Compression algorithm applied, including \"lz4\", \"delta\", or \"zstd\".\n* databaseDir: the directory where the database is stored.\n* databaseOwner: the database creator.\n* dbUrl: path to the distributed database where the DFS table is located. It is returned only when *table* is a DFS table.\n* encryptMode: The table encryption mode specified during table creation. It is returned only when *table* is a DFS table.\n* engineType: the storage engine type. It can be OLAP or TSDB.\n* keepDuplicates: how to deal with records with duplicate sort key values.\n* keyColumn: key column(s) of the table. It is returned only when *table* contains key column(s).\n* partitionColumnIndex: the index that indicates the positions of partitioning columns. It returns -1 for a dimension table.\n* partitionColumnName: the partitioning column names.\n* partitionColumnType: the data type ID (which can be checked at Data Types and Data Forms) of the partitioning column.\n* partitionSchema: how the partitions are organized\n* partitionSites (optional): If the parameter locations is specified for function `database`, it displays the ip:port information of the specified node.\n* partitionTypeName / partitionType: the partitioning scheme and the corresponding ID, including VALUE(1), RANGE(2), LIST(3), COMPO(4), HASH(5).\n* sortColumns: the sort columns for a table.\n* softDelete: whether soft deletion of the table has been enabled. This field will only be returned for tables in TSDB databases. Return true if soft deletion has been enabled, false otherwise.\n* sortKeyMappingFunction: the mapping functions applied to sort keys.\n* tableComment: the comment for DFS tables.\n* tableName: table name. It is returned only when *table* is a DFS table.\n* tableOwner: the table creator.\n* partitionFunction: the function applied to a column for data partitioning. It is a STRING vector with each element as a function signature. If an element is \"asis\", meaning no function is applied to that column. For example, `partitionFunction->[\"myPartitionFunc{, 6, 8}\",\"asis\"]`.\n* latestKeyCache: whether the latest value cache is enabled.\n* compressHashSortKey: whether the compression for sort columns is enabled.\n\n#### Parameters\n\n**table | dbHandle** can be a table object or a database handle.\n\n#### Returns\n\nAn unordered dictionary containing schema information.\n\n#### Examples\n\nOLAP database:\n\n```\nn=1000000\nID=rand(10, n)\nx=rand(1.0, n)\nt=table(ID, x)\ndb=database(\"dfs://rangedb101\", RANGE, 0 5 10)\npt = db.createPartitionedTable(t, `pt, `ID)\npt.append!(t)\npt=loadTable(db,`pt);\n\nschema(db);\n/* output:\ndatabaseDir->dfs://rangedb101\npartitionSchema->[0,5,10]\npartitionSites->\natomic->TRANS\nchunkGranularity->TABLE\npartitionType->2\npartitionTypeName->RANGE\npartitionColumnType->4\nclusterReplicationEnabled->1\ndatabaseOwner->admin\n*/\n```\n\nOLAP table:\n\n```\nschema(pt);\n/* output:\nchunkGranularity->TABLE\ntableOwner->admin\ncompressMethods->\nname compressMethods\n---- ---------------\nID   lz4            \nx    lz4            \n\ncolDefs->\nname typeString typeInt comment\n---- ---------- ------- -------\nID   INT        4              \nx    DOUBLE     16             \n\nchunkPath->\npartitionColumnIndex->0\npartitionColumnName->ID\npartitionColumnType->4\npartitionType->2\npartitionTypeName->RANGE\npartitionSchema->[0,5,10]\npartitionSites->\n*/\n```\n\nTSDB database:\n\n```\nn = 10000\nSecurityID = rand(`st0001`st0002`st0003`st0004`st0005, n)\nsym = rand(`A`B, n)\nTradeDate = 2022.01.01 + rand(100,n)\nTotalVolumeTrade = rand(1000..3000, n)\nTotalValueTrade = rand(100.0, n)\nschemaTable_snap = table(SecurityID, TradeDate, TotalVolumeTrade, TotalValueTrade).sortBy!(`SecurityID`TradeDate)\n\ndbPath = \"dfs://TSDB_STOCK\"\nif (existsDatabase(dbPath)){dropDatabase(dbPath)}\ndb_snap = database(dbPath, VALUE, 2022.01.01..2022.01.05, engine='TSDB')\n\nschema(db_snap)\n/* output:\ndatabaseDir->dfs://TSDB_STOCK\npartitionSchema->[2022.01.01,2022.01.02,2022.01.03,2022.01.04,2022.01.05]\npartitionSites->\nengineType->TSDB\natomic->TRANS\nchunkGranularity->TABLE\npartitionType->1\npartitionTypeName->VALUE\npartitionColumnType->6\nclusterReplicationEnabled->1\ndatabaseOwner->admin\n*/\n```\n\nTSDB table:\n\n```\ndef myHashFunc(x){\n  return hashBucket(x, 10)\n}\nsnap=createPartitionedTable(dbHandle=db_snap, table=schemaTable_snap, tableName=\"snap\", partitionColumns=`TradeDate, sortColumns=`SecurityID`TradeDate, keepDuplicates=ALL, sortKeyMappingFunction=[myHashFunc])\n\nschema(snap)\n/* output:\nengineType->TSDB\nkeepDuplicates->ALL\nchunkGranularity->TABLE\nsortColumns->[\"SecurityID\",\"TradeDate\"]\nsortKeyMappingFunction->[\"def myHashFunc(x){\n  return hashBucket(x, 10)\n}\"]\nsoftDelete->0\ntableOwner->admin\ncompressMethods->\nname             compressMethods\n---------------- ---------------\nSecurityID       lz4            \nTradeDate        lz4            \nTotalVolumeTrade lz4            \nTotalValueTrade  lz4            \n\ncolDefs->\nname             typeString typeInt extra comment\n---------------- ---------- ------- ----- -------\nSecurityID       SYMBOL     17                   \nTradeDate        DATE       6                    \nTotalVolumeTrade INT        4                    \nTotalValueTrade  DOUBLE     16                   \n\nchunkPath->\npartitionColumnIndex->1\npartitionColumnName->TradeDate\npartitionColumnType->6\npartitionType->1\npartitionTypeName->VALUE\npartitionSchema->[2022.01.01,2022.01.02,2022.01.03,2022.01.04,2022.01.05]\npartitionSites->\n*/\n```\n\nIn the following example, we use a composite strategy to partition data by “id” and “ts”, creating a measurement point table named “pt”. This table uses “ticket” and “id2” as the columns that uniquely identify a measurement point. The latest value cache is enabled and the column “value” is of IOTANY type, allowing it to store data of various types. The compression for the sort key columns is also enabled.\n\n```\ndbName = \"pt\"\nif(existsDatabase(dbName)){\n        dropDatabase(dbName)\n}\ndb1 = database(, partitionType=HASH, partitionScheme=[INT, 10])\ndb2 = database(, partitionType=VALUE, partitionScheme=2017.08.07..2017.08.11)\ndb = database(dbName, COMPO, [db1, db2], engine='IOTDB')\ncreate table \"dfs://db\".\"pt\" (\n        id INT,\n        ticket SYMBOL,\n        id2 LONG,\n        ts TIMESTAMP,\n        id3 IOTANY\n)\npartitioned by id, ts,\nsortColumns = [`ticket, `id2, `ts],\nsortKeyMappingFunction = [hashBucket{, 50}, hashBucket{, 50}],\nlatestKeyCache = true,\ncompressHashSortKey = true\nprint schema(loadTable(dbName, `pt))\n```\n\nThe output:\n\n```\n/* \nengineType->IOTDB\nkeepDuplicates->ALL\nchunkGranularity->TABLE\nsortColumns->[\"deviceId\",\"location\",\"timestamp\"]\nsortKeyMappingFunction->[\"hashBucket{, 50}\",\"hashBucket{, 50}\"]\nsoftDelete->0\ntableOwner->admin\ncompressMethods->name      compressMethods\n--------- ---------------\ndeviceId  lz4            \nlocation  lz4            \ntimestamp lz4            \nvalue     lz4            \ntableComment->\nlatestKeyCache->1\ncompressHashSortKey->0\ncolDefs->name      typeString typeInt extra comment\n--------- ---------- ------- ----- -------\ndeviceId  INT        4                    \nlocation  SYMBOL     17                   \ntimestamp TIMESTAMP  12                   \nvalue     IOTANY     41                   \nchunkPath->\npartitionColumnIndex->[0,2]\npartitionColumnName->[\"deviceId\",\"timestamp\"]\npartitionColumnType->[4,6]\npartitionType->[5,1]\npartitionTypeName->[\"HASH\",\"VALUE\"]\npartitionSchema->(20,[2017.08.07,2017.08.08,2017.08.09,2017.08.10,2017.08.11,2024.10.12])\npartitionSites->\n*/\n```\n"
    },
    "schur": {
        "url": "https://docs.dolphindb.com/en/Functions/s/schur.html",
        "signatures": [
            {
                "full": "schur(obj, [sort])",
                "name": "schur",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[sort]",
                        "name": "sort",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [schur](https://docs.dolphindb.com/en/Functions/s/schur.html)\n\n\n\n#### Syntax\n\nschur(obj, \\[sort])\n\n#### Details\n\nComputes the Schur decomposition of a square matrix.\n\nSuppose the input is the square matrix A:\n\n* If *sort* is not specified, return 2 matrices: T (Schur form of A, an upper triangular matrix) and an unitary matrix Z (the transpose matrix of Z is equal to its inverse matrix), so that A = Z\\*T\\*Z-1.\n* If *sort* is specified, the function will also return an integer indicating the number of eigenvalues that meet the sorting conditions.\n\n**Note:**\n\nDolphinDB `schur` provides the same core functionality as [scipy.linalg.schur](https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.schur.html). The difference is that `scipy.linalg.schur` also supports *output*, custom sorting functions, and additional computation control parameters.\n\n#### Parameters\n\n**obj** is a square matrix.\n\n**sort** (optional) is a string. It is used to reorder the factors according to a specified ordering of the eigenvalues. The value can be 'lhp' (eigenvalue is a negative real number), 'rhp' (eigenvalue is a positive real number), 'iuc' (the absolute value of a complex eigenvalue<=1.0), 'ouc' (the absolute value of a complex eigenvalue>1.0).\n\n#### Returns\n\nFor input square matrix A, returns matrices T and Z if *sort* is not specified, where T is the Schur form of A and Z is a unitary matrix. If *sort* is specified, the result also includes an integer indicating the number of eigenvalues that satisfy the sorting condition.\n\n#### Examples\n\n```\nm=matrix([[0,0,1],[2,1,0],[2,2,1]]);\nT,Z=schur(m)\nT;\n```\n\n| #0       | #1        | #2        |\n| -------- | --------- | --------- |\n| 2.658967 | 1.424405  | -1.929334 |\n| 0        | -0.329484 | -0.490637 |\n| 0        | 1.311789  | -0.329484 |\n\n```\nZ\n```\n\n| #0       | #1        | #2        |\n| -------- | --------- | --------- |\n| 0.727116 | -0.601562 | 0.330796  |\n| 0.528394 | 0.798019  | 0.289768  |\n| 0.438294 | 0.035904  | -0.898114 |\n\n```\nT,Z,s=schur(m, 'lhp');\nT;\n```\n\n| #0        | #1        | #2        |\n| --------- | --------- | --------- |\n| -0.329484 | 1.570974  | 2.251318  |\n| -0.40969  | -0.329484 | -0.092398 |\n| 0         | 0         | 2.658967  |\n\n```\nZ\n```\n\n| #0        | #1        | #2       |\n| --------- | --------- | -------- |\n| 0.703818  | -0.632169 | 0.324042 |\n| 0.509043  | 0.766983  | 0.390655 |\n| -0.495495 | -0.109999 | 0.861618 |\n\n```\ns\n// output: 2\nT,Z,s=schur(m, 'rhp');\n\ns;\n// output: 1\n\nm=matrix([[0,0,9],[-2,1,0],[2,2,1]]);\nT,Z,s=schur(m, 'iuc');\ns;\n// output: 0\n\nT,Z,s=schur(m, 'ouc');\ns;\n// output: 1\n```\n"
    },
    "scramClientFinal": {
        "url": "https://docs.dolphindb.com/en/Functions/s/scramClientFinal.html",
        "signatures": [
            {
                "full": "scramClientFinal(user, combinedNonce, clientProof)",
                "name": "scramClientFinal",
                "parameters": [
                    {
                        "full": "user",
                        "name": "user"
                    },
                    {
                        "full": "combinedNonce",
                        "name": "combinedNonce"
                    },
                    {
                        "full": "clientProof",
                        "name": "clientProof"
                    }
                ]
            }
        ],
        "markdown": "### [scramClientFinal](https://docs.dolphindb.com/en/Functions/s/scramClientFinal.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nscramClientFinal(user, combinedNonce, clientProof)\n\n#### Details\n\n`scramClientFinal` is a function used in the second-stage of SCRAM authentication process. It checks the validity of the combined nonce (*combinedNonce*) and the client-provided proof (*clientProof*).\n\n#### Parameters\n\n**user**is a string indicating a user name. It can only contain letters, underscores, or numbers. It cannot start with numbers. The length cannot exceed 30 characters.\n\n**combinedNonce** is the combination of the client nonce and server nonce, Base64-encoded (i.e., the *combined\\_nonce* returned by [scramClientFirst](https://docs.dolphindb.com/en/Functions/s/scramClientFirst.html)).\n\n**clientProof** is the client-generated proof, Base64-encoded.\n\n#### Returns\n\nA Base64-encoded server signature, if verification succeeds.\n\n#### Examples\n\nThe following Python script provides a complete example of how to implement SCRAM authentication for a user (\"user01\") in a Python client. The server-side operations are handled through the [DolphinDB Python API](https://docs.dolphindb.cn/en/pydoc/chap1_quickstart_landingpage.html).\n\n```\nimport dolphindb as ddb\n\n# Establish a session connection with DolphinDB\ns = ddb.session(\"183.134.101.133\", 8888)\ns.run(\"print\", 1, 2, 3)\n\n##########################\n\nimport hashlib\nimport hmac\nimport os\nimport base64\nimport hashlib\n\n\n# ------------------ Server Functions ------------------\ndef server_handle_client_first(username, client_nonce):\n  \"\"\"Handles the first authentication request, returns salt, iteration count, and combined nonce.\"\"\"\n    salt, iter_count, nonce = s.run(\"scramClientFirst\", username, client_nonce)\n\n    return {\n        \"salt\": salt,\n        \"iteration_count\": iter_count,\n        \"combined_nonce\": nonce\n    }\n\ndef server_handle_client_final(user, combined_nonce, client_proof):    \n  \"\"\"Handles the final authentication request, verifies client_proof, and returns server_signature.\"\"\"\n    return s.run(\"scramClientFinal\", user, combined_nonce, client_proof)\n\n# ------------------ Client Functions ------------------\ndef client_initiate_authentication(username):\n    \"\"\"Client initiates authentication by generating a client_nonce.\"\"\"\n    client_nonce = base64.b64encode(os.urandom(16)).decode()\n    return {\n        \"username\": username,\n        \"client_nonce\": client_nonce\n    }\n\ndef client_generate_proof(user, password, salt, iteration_count, cnonce, combined_nonce):\n    \"\"\"Generates the client_proof.\"\"\"\n    \n    # Compute SaltedPassword\n    salted_password = hashlib.pbkdf2_hmac(\n        'sha256',\n        password.encode(),\n        base64.b64decode(salt),\n        iteration_count\n    )\n    \n    # Generate keys\n    client_key = hmac.new(salted_password, b\"Client Key\", hashlib.sha256).digest()\n    stored_key = hashlib.sha256(client_key).digest()\n    server_key = hmac.new(salted_password, b\"Server Key\", hashlib.sha256).digest()\n    \n    # Construct AuthMessage\n    auth_message = (\n        f\"n={user},r={cnonce},\"  # client-first-bare\n        f\"r={combined_nonce},s={salt},i={iteration_count},\"  # server-first\n        f\"c=biws,r={combined_nonce}\"                         # client-final-without-proof\n    )\n    \n    # Compute ClientProof\n    client_signature = hmac.new(stored_key, auth_message.encode(), hashlib.sha256).digest()\n    client_proof = bytes([ck ^ cs for ck, cs in zip(client_key, client_signature)])\n    \n    return {\n        \"client_proof\": base64.b64encode(client_proof).decode(),\n        \"server_key\": server_key,\n        \"auth_message\": auth_message\n    }\n\n# ------------------ SCRAM Authentication ------------------\nif __name__ == \"__main__\":\n    \n    # Client initiates authentication\n    client_data = client_initiate_authentication(\"user01\")\n    \n    # Server processes the first request\n    server_response = server_handle_client_first(\n        client_data[\"username\"], \n        client_data[\"client_nonce\"]\n    )\n    \n    password = \"123456\"\n    \n    # Client generates proof\n    client_proof_data = client_generate_proof(\n        \"user01\",\n        password,\n        server_response[\"salt\"],\n        server_response[\"iteration_count\"],\n        client_data[\"client_nonce\"],\n        server_response[\"combined_nonce\"]\n    )\n    \n    # Server verifies and returns signature\n    # auth_sessions[server_response[\"combined_nonce\"]][\"auth_message\"] = client_proof_data[\"auth_message\"]\n    server_signature = server_handle_client_final(\n        \"user01\",\n        server_response[\"combined_nonce\"],\n        client_proof_data[\"client_proof\"]\n    )\n    \n    # Client verifies the server signature\n    computed_server_sig = hmac.new(\n        client_proof_data[\"server_key\"],\n        client_proof_data[\"auth_message\"].encode(),\n        hashlib.sha256\n    ).digest()\n    \n    # If verification passes, authentication succeeds\n    assert server_signature == base64.b64encode(computed_server_sig).decode()\n    print(\"SCRAM authentication succeeded!\")\n\n    # Check current session and user\n    print(s.run(\"getCurrentSessionAndUser()\"))\n```\n"
    },
    "scramClientFirst": {
        "url": "https://docs.dolphindb.com/en/Functions/s/scramClientFirst.html",
        "signatures": [
            {
                "full": "scramClientFirst(user, cnonce)",
                "name": "scramClientFirst",
                "parameters": [
                    {
                        "full": "user",
                        "name": "user"
                    },
                    {
                        "full": "cnonce",
                        "name": "cnonce"
                    }
                ]
            }
        ],
        "markdown": "### [scramClientFirst](https://docs.dolphindb.com/en/Functions/s/scramClientFirst.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nscramClientFirst(user, cnonce)\n\n#### Details\n\n`scramClientFirst` is a function used in the first stage of SCRAM (Salted Challenge Response Authentication Mechanism) authentication. It retrieves the server's authentication information.\n\n#### Parameters\n\n**user**is a string indicating a user name. It can only contain letters, underscores, or numbers. It cannot start with numbers. The length cannot exceed 30 characters.\n\n**cnonce** is a client-generated [nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce) (a one-time random value). It must be a 16-byte random value, encoded in base64.\n\n#### Returns\n\nA tuple containing the following elements:\n\n* salt – The base64-encoded hash salt value.\n* iterCount – The iteration count for password hashing.\n* combined\\_nonce – The base64-encoded combination of the client nonce and server nonce.\n\n**Note:**\n\nSCRAM Authentication Workflow\n\n**1. Client initiates authentication request**\n\nThe client generates a **client nonce** (a one-time random value) and sends it along with the username to the server.\n\n**2. Server responds to authentication request**\n\n* Upon receiving the request, the server uses `scramClientFirst` to generate:\n  * A **hash salt value** for encryption\n  * The **password hashing iteration count**\n  * A **server nonce**, which is combined with the client nonce\n* These details are then returned to the client.\n\n**3. Client generates authentication proof and submits final request**\n\nUsing the received data, the client converts the plaintext password into a cryptographic key and generates a **client proof**, and then sends this proof back to the server for verification.\n\n**4. Server verifies the authentication request**\n\nThe server uses `scramClientFinal` to validate the **combined nonce** and **client proof**. If successful, the server returns a **server signature** to the client.\n\n**5. Client verifies the server signature**\n\nThe client checks the server’s returned signature. If verification passes, **login succeeds**. If verification fails, the session is **terminated**.\n\n#### Examples\n\nThe following Python script provides a complete example of how to implement SCRAM authentication for a user (\"user01\") in a Python client. The server-side operations are handled through the [DolphinDB Python API](https://docs.dolphindb.cn/en/pydoc/chap1_quickstart_landingpage.html).\n\n```\nimport dolphindb as ddb\n\n# Establish a session connection with DolphinDB\ns = ddb.session(\"183.134.101.133\", 8888)\ns.run(\"print\", 1, 2, 3)\n\n##########################\n\nimport hashlib\nimport hmac\nimport os\nimport base64\nimport hashlib\n\n\n# ------------------ Server Functions ------------------\ndef server_handle_client_first(username, client_nonce):\n  \"\"\"Handles the first authentication request, returns salt, iteration count, and combined nonce.\"\"\"\n    salt, iter_count, nonce = s.run(\"scramClientFirst\", username, client_nonce)\n\n    return {\n        \"salt\": salt,\n        \"iteration_count\": iter_count,\n        \"combined_nonce\": nonce\n    }\n\ndef server_handle_client_final(user, combined_nonce, client_proof):    \n  \"\"\"Handles the final authentication request, verifies client_proof, and returns server_signature.\"\"\"\n    return s.run(\"scramClientFinal\", user, combined_nonce, client_proof)\n\n# ------------------ Client Functions ------------------\ndef client_initiate_authentication(username):\n    \"\"\"Client initiates authentication by generating a client_nonce.\"\"\"\n    client_nonce = base64.b64encode(os.urandom(16)).decode()\n    return {\n        \"username\": username,\n        \"client_nonce\": client_nonce\n    }\n\ndef client_generate_proof(user, password, salt, iteration_count, cnonce, combined_nonce):\n    \"\"\"Generates the client_proof.\"\"\"\n    \n    # Compute SaltedPassword\n    salted_password = hashlib.pbkdf2_hmac(\n        'sha256',\n        password.encode(),\n        base64.b64decode(salt),\n        iteration_count\n    )\n    \n    # Generate keys\n    client_key = hmac.new(salted_password, b\"Client Key\", hashlib.sha256).digest()\n    stored_key = hashlib.sha256(client_key).digest()\n    server_key = hmac.new(salted_password, b\"Server Key\", hashlib.sha256).digest()\n    \n    # Construct AuthMessage\n    auth_message = (\n        f\"n={user},r={cnonce},\"  # client-first-bare\n        f\"r={combined_nonce},s={salt},i={iteration_count},\"  # server-first\n        f\"c=biws,r={combined_nonce}\"                         # client-final-without-proof\n    )\n    \n    # Compute ClientProof\n    client_signature = hmac.new(stored_key, auth_message.encode(), hashlib.sha256).digest()\n    client_proof = bytes([ck ^ cs for ck, cs in zip(client_key, client_signature)])\n    \n    return {\n        \"client_proof\": base64.b64encode(client_proof).decode(),\n        \"server_key\": server_key,\n        \"auth_message\": auth_message\n    }\n\n# ------------------ SCRAM Authentication ------------------\nif __name__ == \"__main__\":\n    \n    # Client initiates authentication\n    client_data = client_initiate_authentication(\"user01\")\n    \n    # Server processes the first request\n    server_response = server_handle_client_first(\n        client_data[\"username\"], \n        client_data[\"client_nonce\"]\n    )\n    \n    password = \"123456\"\n    \n    # Client generates proof\n    client_proof_data = client_generate_proof(\n        \"user01\",\n        password,\n        server_response[\"salt\"],\n        server_response[\"iteration_count\"],\n        client_data[\"client_nonce\"],\n        server_response[\"combined_nonce\"]\n    )\n    \n    # Server verifies and returns signature\n    # auth_sessions[server_response[\"combined_nonce\"]][\"auth_message\"] = client_proof_data[\"auth_message\"]\n    server_signature = server_handle_client_final(\n        \"user01\",\n        server_response[\"combined_nonce\"],\n        client_proof_data[\"client_proof\"]\n    )\n    \n    # Client verifies the server signature\n    computed_server_sig = hmac.new(\n        client_proof_data[\"server_key\"],\n        client_proof_data[\"auth_message\"].encode(),\n        hashlib.sha256\n    ).digest()\n    \n    # If verification passes, authentication succeeds\n    assert server_signature == base64.b64encode(computed_server_sig).decode()\n    print(\"SCRAM authentication succeeded!\")\n\n    # Check current session and user\n    print(s.run(\"getCurrentSessionAndUser()\"))\n```\n"
    },
    "scs": {
        "url": "https://docs.dolphindb.com/en/Functions/s/scs.html",
        "signatures": [
            {
                "full": "scs(f, [P], [A], [b], [Aeq], [beq], [lb], [ub], [x0], [c], [eps], [alpha])",
                "name": "scs",
                "parameters": [
                    {
                        "full": "f",
                        "name": "f"
                    },
                    {
                        "full": "[P]",
                        "name": "P",
                        "optional": true
                    },
                    {
                        "full": "[A]",
                        "name": "A",
                        "optional": true
                    },
                    {
                        "full": "[b]",
                        "name": "b",
                        "optional": true
                    },
                    {
                        "full": "[Aeq]",
                        "name": "Aeq",
                        "optional": true
                    },
                    {
                        "full": "[beq]",
                        "name": "beq",
                        "optional": true
                    },
                    {
                        "full": "[lb]",
                        "name": "lb",
                        "optional": true
                    },
                    {
                        "full": "[ub]",
                        "name": "ub",
                        "optional": true
                    },
                    {
                        "full": "[x0]",
                        "name": "x0",
                        "optional": true
                    },
                    {
                        "full": "[c]",
                        "name": "c",
                        "optional": true
                    },
                    {
                        "full": "[eps]",
                        "name": "eps",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [scs](https://docs.dolphindb.com/en/Functions/s/scs.html)\n\n\n\n#### Syntax\n\nscs(f, \\[P], \\[A], \\[b], \\[Aeq], \\[beq], \\[lb], \\[ub], \\[x0], \\[c], \\[eps], \\[alpha])\n\n#### Details\n\nSolve the following optimization problem for the objective function with given constraints:\n\n![](https://docs.dolphindb.com/en/images/scs01.png)\n\nThe result is a 2-element tuple. The first element is the minimum value of the objective function. The second element is the value of x when the value of the objective function is minimized.\n\n#### Parameters\n\n**Note:** Among the following parameters, only *lb* and *ub* can be empty, while all other parameters must not contain null values.\n\n**f** is a vector of coefficients for linear terms in the quadratic programming problem. It must be of the same length as *x0*.\n\n**P** (optional) is a matrix obtained by multiplying the diagonal elements of the coefficient matrix for quadratic terms by 2. For example, to obtain matrix p, form an upper triangular matrix based on all the quadratic terms:\n\n![](https://docs.dolphindb.com/en/images/scs02.png)\n\n**A** (optional) is a coefficient matrix for linear inequality constraints. Its number of columns must be consistent with the size of x.\n\n**b** (optional) is the right-hand vector for linear inequality constraints.\n\n**Aeq** (optional) is a coefficient matrix for linear equality constraints. Its number of columns must be consistent with the size of x.\n\n**beq** (optional) is the right-hand vector for linear equality constraints.\n\n**lb** / **ub** (optional) is a scalar or a vector of the same length as x, specifying the lower/upper bounds for variables.\n\n* If *lb* or *ub* is a scalar, all variables are subject to the same lower or upper bound constraints. If *lb* or *ub* is null, there are no lower or upper bound constraints for x.\n\n* If *lb* or *ub* is a vector, the elements of x are subject to the corresponding elements of *lb* or *ub*. If a certain element in lb or ub is null, the corresponding element in x has no lower or upper bound constraint.\n\n**x0** (optional) is a vector of coefficients for absolute value inequality constraints.\n\n**c** (optional) is a non-negative number representing the right-hand constant for absolute value inequality constraints.\n\n**eps** (optional) is a positive floating-point number representing the solution precision. The default value is 1e-6, and the range is \\[1e-4, 1e-9]. A solution with higher precision can be obtained by decreasing eps. If a value beyond the range is set, it will be adjusted to the default value.\n\n**alpha** (optional) is a positive floating-point number representing the relaxation parameter. The default value is 1.5, and the range is (0,2). The solution process can be sped up by increasing alpha. If a value beyond the range is set, it will be adjusted to the default value.\n\n#### Returns\n\nA tuple with two elements. The first element is the minimum value of the objective function, and the second element is the value of x at which the objective function reaches the minimum.\n\n#### Examples\n\nFind x and y that satisfy the following constraints and minimize the objective function x2 + y2:\n\n![](https://docs.dolphindb.com/en/images/scs03.png)\n\n```\n// No linear terms in the objective function, so all coefficients are 0, and f takes the following values\nf = [0, 0];\n// Only quadratic terms x^2 and y^2 exist with coefficients as 1, so p takes the following values\nP = [2, 0, 0, 2]$2:2;\n// Coefficients and right-hand vector for absolute value inequality constraints\nx0 = [0.4, 0.6];\nc = 0.5;\n// Linear equality constraint x + y = 1, so Aeq and beq take the following values\nAeq = [1, 1]$1:2;\nbeq = [1];\n// Since x, y > 0, we have lower bounds for variables as follows:\nlb = [0, 0];\nre = scs(f=f,P=P,Aeq=Aeq,beq=beq,lb=lb,x0=x0,c=c);\nre[1]\n// output: [0.500000043984074,0.499999955746447]\n```\n\nRelated functions: [linprog](https://docs.dolphindb.com/en/Functions/l/linprog.html), [quadprog](https://docs.dolphindb.com/en/Functions/q/quadprog.html)\n"
    },
    "searchK": {
        "url": "https://docs.dolphindb.com/en/Functions/s/searchK.html",
        "signatures": [
            {
                "full": "searchK(X, k)",
                "name": "searchK",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "k",
                        "name": "k"
                    }
                ]
            }
        ],
        "markdown": "### [searchK](https://docs.dolphindb.com/en/Functions/s/searchK.html)\n\n\n\n#### Syntax\n\nsearchK(X, k)\n\n#### Details\n\nReturn the k-th smallest item ignoring null values.\n\n#### Parameters\n\n**X** is a vector.\n\n**k** is an integer indicating the k-th smallest item.\n\n#### Returns\n\nA scalar with the same data type as *X*.\n\n#### Examples\n\n```\nsearchK(1 7 3 5 3 9 6 1 NULL, 1);\n// output: 1\n\nsearchK(1 7 3 5 3 9 6 1 NULL, 2);\n// output: 1\n\nsearchK(1 7 3 5 3 9 6 1 NULL, 3);\n// output: 3\n```\n"
    },
    "seasonalEsd": {
        "url": "https://docs.dolphindb.com/en/Functions/s/seasonalEsd.html",
        "signatures": [
            {
                "full": "seasonalEsd(data, period, [hybrid], [maxAnomalies], [alpha])",
                "name": "seasonalEsd",
                "parameters": [
                    {
                        "full": "data",
                        "name": "data"
                    },
                    {
                        "full": "period",
                        "name": "period"
                    },
                    {
                        "full": "[hybrid]",
                        "name": "hybrid",
                        "optional": true
                    },
                    {
                        "full": "[maxAnomalies]",
                        "name": "maxAnomalies",
                        "optional": true
                    },
                    {
                        "full": "[alpha]",
                        "name": "alpha",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [seasonalEsd](https://docs.dolphindb.com/en/Functions/s/seasonalEsd.html)\n\n\n\n#### Syntax\n\nseasonalEsd(data, period, \\[hybrid], \\[maxAnomalies], \\[alpha])\n\n#### Details\n\nConduct anomaly detection with the Seasoned Extreme Studentized Deviate test (S-ESD).\n\nThe result is a table of anomalies. It has 2 columns: column index records the subscript of anomalies in data, and column anoms are the anomaly values.\n\n#### Parameters\n\n**data** is a numeric vector.\n\n**period** is an integer larger than 1 indicating the length of a time-series cycle.\n\n**hybrid** (optional) is a Boolean value indicating whether to use median and median absolute deviation to replace mean and standard deviation. The results are more robust if *hybrid*=true. The default value is false.\n\n**maxAnomalies** (optional) is a positive integer or a floating number between 0 and 0.5. The default value is 0.1.\n\n* If *maxAnomalies* is a positive integer, it must be smaller than the size of data. It indicates the upper bound of the number of anomalies.\n\n* If *maxAnomalies* is a floating number between 0 and 0.5, the upper bound of the number of anomalies is int(size(*data*) \\* *maxAnomalies*).\n\n**alpha** (optional) alpha is a positive number indicating the significance level of the statistical test. A larger alpha means a higher likelihood of detecting anomalies.\n\n#### Returns\n\nA table containing outliers. The table has two columns: index records the positions of outliers in the original data, and anoms records the outlier values.\n\n#### Examples\n\n```\nn = 100\ntrend = 6 * sin(1..n \\ 200)\nseasonal = sin(pi / 6 * 1..n)\nresidual = rand(1.0, n) - 0.5\ndata = trend + seasonal + residual\ndata[20 50 70] += 20;\n\nseasonalEsd(data, 12);\n```\n\n| index | anoms     |\n| ----- | --------- |\n| 50    | 22.6365   |\n| 70    | 21.141346 |\n| 20    | 19.174165 |\n"
    },
    "second": {
        "url": "https://docs.dolphindb.com/en/Functions/s/second.html",
        "signatures": [
            {
                "full": "second(X)",
                "name": "second",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [second](https://docs.dolphindb.com/en/Functions/s/second.html)\n\n\n\n#### Syntax\n\nsecond(X)\n\n#### Details\n\nReturn the corresponding second(s).\n\n#### Parameters\n\n**X** is an integer or temporal scalar/vector.\n\n#### Returns\n\nA SECOND scalar or vector.\n\n#### Examples\n\n```\nsecond 2012.12.03 01:22:01;\n// output: 01:22:01\n\nsecond(61);\n// output: 00:01:01\n```\n"
    },
    "secondOfMinute": {
        "url": "https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html",
        "signatures": [
            {
                "full": "secondOfMinute(X)",
                "name": "secondOfMinute",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html)\n\n\n\n#### Syntax\n\nsecondOfMinute(X)\n\n#### Details\n\nFor each element in *X*, return a number from 0 to 59 indicating which second of the minute it falls in.\n\n#### Parameters\n\n**X** is a scalar/vector of type TIME, SECOND, DATETIME, TIMESTAMP, NANOTIME or NANOTIMESTAMP.\n\n#### Returns\n\nAn INT scalar or vector.\n\n#### Examples\n\n```\nsecondOfMinute(12:32:00);\n// output: 0\n\nsecondOfMinute([2012.06.12T12:30:00,2012.10.28T12:35:00,2013.01.06T12:36:47,2013.04.06T08:02:14]);\n// output: [0,0,47,14]\n```\n"
    },
    "seek": {
        "url": "https://docs.dolphindb.com/en/Functions/s/seek.html",
        "signatures": [
            {
                "full": "seek(handle, offset, [mode])",
                "name": "seek",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "offset",
                        "name": "offset"
                    },
                    {
                        "full": "[mode]",
                        "name": "mode",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [seek](https://docs.dolphindb.com/en/Functions/s/seek.html)\n\n\n\n#### Syntax\n\nseek(handle, offset, \\[mode])\n\n#### Details\n\nReturn the final position of the internal cursor if no exception is raised.\n\nWhen the system reads data from a file or writes data to a file, the internal cursor moves forward. Users can manipulate the cursor manually with the `seek` function.\n\n#### Parameters\n\n**handle** must be a file handle.\n\n**offset** is an integer.\n\n**mode** (optional) must be one of the 3 positions: HEAD, CURRENT, TAIL. Default mode is CURRENT.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\n// write a function to show the length of a file\ndef fileLength(f): file(f).seek(0, TAIL)\nfileLength(\"test.txt\");\n// output: 14\n\n// move the internal cursor to the beginning of the file\nfin=file(\"test.txt\")\nfin.readLine();\n// output: Hello World!\n\nfin.seek(0, HEAD);\n// output: 0\n\nfin.readLine();\n// output: Hello World!\n```\n"
    },
    "segment": {
        "url": "https://docs.dolphindb.com/en/Functions/s/segment.html",
        "signatures": [
            {
                "full": "segment(X, [segmentOffset=true])",
                "name": "segment",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[segmentOffset=true]",
                        "name": "segmentOffset",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [segment](https://docs.dolphindb.com/en/Functions/s/segment.html)\n\n\n\n#### Syntax\n\nsegment(X, \\[segmentOffset=true])\n\n#### Details\n\nDivide a vector into groups. Each group is composed of identical values next to each other. For example, \\[1,1,2,2,1,1,1] is divided into 3 groups: \\[1,1], \\[2,2] and \\[1,1,1].\n\nReturn a vector of the same length as *X*.\n\n* If *segmentOffset*=true, each element of the result is the index(in *X*) of the first element in each group.\n* If *segmentOffset*=false, each element of the result is its group number. Group numbers start from 0.\n\n#### Parameters\n\n**X** is a vector.\n\n**segmentOffset** (optional) is a Boolean value. The default value is true.\n\n#### Returns\n\nAn INT vector whose length is the same as *X*.\n\n#### Examples\n\nExample 1.\n\n```\nx = 1 1 2 4 4 5 2 5 NULL NULL\nsegment(x);\n// output: [0,0,2,3,3,5,6,7,8,8]\n\nsegment(x, false);\n// output: [0,0,1,2,2,3,4,5,6,6]\n```\n\nExample 2.\n\n```\nx = 1 2 1 2 1 2 1 2 1 2 1 2;\ny = 0 0 1 1 1 2 2 1 1 3 3 2;\nt = table(x,y);\nselect *, cumsum(x) from t context by segment(y);\n```\n\n| y | x | cumsum\\_x |\n| - | - | --------- |\n| 0 | 1 | 1         |\n| 0 | 2 | 3         |\n| 1 | 1 | 1         |\n| 1 | 2 | 3         |\n| 1 | 1 | 4         |\n| 2 | 2 | 2         |\n| 2 | 1 | 3         |\n| 1 | 2 | 2         |\n| 1 | 1 | 3         |\n| 3 | 2 | 2         |\n| 3 | 1 | 3         |\n| 2 | 2 | 2         |\n"
    },
    "sem": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sem.html",
        "signatures": [
            {
                "full": "sem(X)",
                "name": "sem",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sem](https://docs.dolphindb.com/en/Functions/s/sem.html)\n\n\n\n#### Syntax\n\nsem(X)\n\n#### Details\n\nReturn unbiased (normalized by N-1) standard error of the mean over *X* .\n\n* If *X* is a matrix, calculate the standard error for each column and return a vector.\n\n* If *X* is a table, calculate the standard error of each column and return a table.\n\n**Note:**\n\nDolphinDB`sem`provides the same core functionality as[scipy.stats.sem](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.sem.html). The differences are as follows:\n\n* DolphinDB `sem` supports numeric vectors, matrices, and tables. For matrices and tables, it computes by column and ignores NULL.\n* `scipy.stats.sem` supports axis-based computation on arrays, and by default returns NaN when it encounters NaN. You can set *nan\\_policy*=\"omit\" to ignore NaN.\n* If the input data and missing-value handling are the same, both functions return the same results.\n\n#### Parameters\n\n**X** is a numeric vector/matrix/table.\n\n#### Returns\n\nA DOUBLE scalar, vector, or table.\n\n#### Examples\n\n```\n[1,4,9,10,20,32].sem();\n// output: 4.688046\n\n[1,4,9,10,NULL,20,32].sem();\n// output: 4.688046\n```\n"
    },
    "semiannualBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/s/semiannualBegin.html",
        "signatures": [
            {
                "full": "semiannualBegin(X, [startingMonth=1], [offset], [n=1])",
                "name": "semiannualBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[startingMonth=1]",
                        "name": "startingMonth",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [semiannualBegin](https://docs.dolphindb.com/en/Functions/s/semiannualBegin.html)\n\nFirst introduced in versions: 2.00.17, 2.00.16.33.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\nsemiannualBegin(X, \\[startingMonth=1], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first day of the semiannual period that *X* belongs to. The first months of each semiannual period is determined by *startingMonth*.\n\nBy default, each period corresponds to a half-year, and the function returns the first day of the half-year containing *X*. The months included in each half-year period are determined by the *startingMonth* parameter.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period start dates based on n half-year periods. In this case, *offset* determines how multiple half-year periods are aligned. Specifically, the system first calculates the start date of the half-year containing *offset* according to *startingMonth*, and uses that date as the reference point. A new period start boundary is then generated every *n* half-year periods, and the function returns the first day of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**startingMonth** (optional) is an integer between 1 and 12 indicating a month. The default value is 1.\n\n**offset** is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** is a positive integer. The default value is 1.\n\n#### Returns\n\nA DATE scalar or vector.\n\n#### Examples\n\n```\nsemiannualBegin(2025.08.10);\n// output: 2025.07.01\n\nsemiannualBegin(2025.10.10 10:10:10.008, 3);\n// output: 2025.09.01\n\ndate=[2024.04.20,2024.05.31,2024.07.07,2024.10.24,2024.12.20,2025.01.19,2025.04.24,2025.04.28,2025.10.06,2026.01.06]\nsym = take(`AAA,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, sym, qty, price)\n\nselect avg(price),sum(qty) from t1 group by semiannualBegin(date, 1, 2024.01.01, 2)\n```\n\n| semiannualBegin\\_date | avg\\_price | sum\\_qty |\n| --------------------- | ---------- | -------- |\n| 2024.01.01            | 62.714     | 16,200   |\n| 2025.01.01            | 81.9       | 18,000   |\n| 2026.01.01            | 52.38      | 4,500    |\n"
    },
    "semiannualEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/s/semiannualEnd.html",
        "signatures": [
            {
                "full": "semiannualEnd(X, [endingMonth=12], [offset], [n=1])",
                "name": "semiannualEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[endingMonth=12]",
                        "name": "endingMonth",
                        "optional": true,
                        "default": "12"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [semiannualEnd](https://docs.dolphindb.com/en/Functions/s/semiannualEnd.html)\n\nFirst introduced in versions: 2.00.17, 2.00.16.33.00.4, 3.00.3.1\n\n\n\n#### Syntax\n\nsemiannualEnd(X, \\[endingMonth=12], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the last day of the semiannual period that *X* belongs to. The first months of each semiannual period is determined by *endingMonth*.\n\nBy default, each period corresponds to a half-year, and the function returns the last day of the half-year containing *X*. The months included in each half-year period are determined by the *endingMonth* parameter.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period end dates based on n half-year periods. In this case, *offset* determines how multiple half-year periods are aligned. Specifically, the system first calculates the end date of the half-year containing *offset* according to *endingMonth*, and uses that date as the reference point. A new period end boundary is then generated every *n* half-year periods, and the function returns the last day of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**endingMonth** is an integer between 1 and 12 indicating a month. The default value is 1.\n\n**offset** is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** is a positive integer. The default value is 1.\n\n#### Returns\n\nA DATE scalar.\n\n#### Examples\n\n```\nsemiannualEnd(2025.08.10);\n// output: 2025.12.31\n\nsemiannualEnd(2025.10.10 10:10:10.008, 3);\n// output: 2026.03.31\n\ndate=[2024.04.20,2024.05.31,2024.07.07,2024.10.24,2024.12.20,2025.01.19,2025.04.24,2025.04.28,2025.10.06,2026.01.06]\nsym = take(`AAA,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by semiannualEnd(date, 12, 2024.01.01, 2)\n```\n\n| semiannualEnd\\_date | avg\\_price        | sum\\_qty |\n| ------------------- | ----------------- | -------- |\n| 2024.06.30          | 39.53             | 4,100    |\n| 2025.06.30          | 85.13666666666667 | 21,300   |\n| 2026.06.30          | 51.835            | 13,300   |\n"
    },
    "semiMonthBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/s/semiMonthBegin.html",
        "signatures": [
            {
                "full": "semiMonthBegin(X, [dayOfMonth=15], [offset], [n=1])",
                "name": "semiMonthBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[dayOfMonth=15]",
                        "name": "dayOfMonth",
                        "optional": true,
                        "default": "15"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [semiMonthBegin](https://docs.dolphindb.com/en/Functions/s/semiMonthBegin.html)\n\n\n\n#### Syntax\n\nsemiMonthBegin(X, \\[dayOfMonth=15], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first day of the semi-month that *X* belongs to. Suppose *X* is the d-th day of the month:\n\n* If d < *dayOfMonth*: return the first day of the month.\n\n* If d >= *dayOfMonth*: return the *dayOfMonth*-th day of the month.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period start dates based on periods consisting of *n* semi-monthly intervals. In this case, offset determines how the multi-semi-monthly periods are aligned. Specifically, the system first calculates the start date of the semi-monthly period containing *offset* according to *dayOfMonth*, and uses that date as the first period-starting boundary. Subsequent period-starting boundaries are generated every *n* semi-monthly periods, and the function returns the first day of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**dayOfMonth** (optional) is an integer between 2 and 27. The default value is 15.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA DATE scalar.\n\n#### Examples\n\n```\nsemiMonthBegin(2012.06.12);\n// output: 2012.06.01\n\nsemiMonthBegin(2012.06.24);\n// output: 2012.06.15\n\nsemiMonthBegin(2012.06.15);\n// output: 2012.06.15\n\nsemiMonthBegin(2012.06.16, 16);\n// output: 2012.06.16\n\n\ndate=2016.04.07+(1..10)*7\ntime = take(09:30:00, 10);\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2016.04.14 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2016.04.21 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2016.04.28 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2016.05.05 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.05.12 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2016.05.19 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2016.05.26 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2016.06.02 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2016.06.09 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2016.06.16 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by semiMonthBegin(date);\n```\n\n| semiMonthBegin\\_date | avg\\_price | sum\\_qty |\n| -------------------- | ---------- | -------- |\n| 2016.04.01           | 49.6       | 2200     |\n| 2016.04.15           | 29.49      | 4000     |\n| 2016.05.01           | 102.495    | 10000    |\n| 2016.05.15           | 112.995    | 6700     |\n| 2016.06.01           | 50.805     | 11300    |\n| 2016.06.15           | 52.38      | 4500     |\n"
    },
    "semiMonthEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/s/semiMonthEnd.html",
        "signatures": [
            {
                "full": "semiMonthEnd(X, [dayOfMonth=15], [offset], [n=1])",
                "name": "semiMonthEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[dayOfMonth=15]",
                        "name": "dayOfMonth",
                        "optional": true,
                        "default": "15"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [semiMonthEnd](https://docs.dolphindb.com/en/Functions/s/semiMonthEnd.html)\n\n\n\n#### Syntax\n\nsemiMonthEnd(X, \\[dayOfMonth=15], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the last day of the semi-month that *X* belongs to. Suppose *X* is the d-th day of the month:\n\n* If d < *dayOfMonth*: return the last day of the previous month.\n\n* If d >= *dayOfMonth*: return the *dayOfMonth*-th day of the current month.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period end dates based on periods consisting of *n* semi-monthly intervals. In this case, offset determines how the multi-semi-monthly periods are aligned. Specifically, the system first calculates the end date of the semi-monthly period containing *offset* according to *dayOfMonth*, and uses that date as the first period-ending boundary. Subsequent period-ending boundaries are generated every *n* semi-monthly periods, and the function returns the last day of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**dayOfMonth** (optional) is an integer between 2 and 27. The default value is 15.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA DATE scalar.\n\n#### Examples\n\n```\nsemiMonthEnd(2012.06.12);\n// output: 012.05.31\n\nsemiMonthEnd(2012.06.24);\n// output: 012.06.15\n\n\nsemiMonthEnd(2012.06.15);\n// output: 012.06.15\n\nsemiMonthEnd(2012.06.16, 16);\n// output: 012.06.16\n\n\ndate=2016.04.07+(1..10)*7\ntime = take(09:30:00, 10);\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2016.04.14 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2016.04.21 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2016.04.28 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2016.05.05 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.05.12 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2016.05.19 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2016.05.26 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2016.06.02 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2016.06.09 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2016.06.16 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by semiMonthEnd(date);\n```\n\n| semiMonthEnd\\_date | avg\\_price | sum\\_qty |\n| ------------------ | ---------- | -------- |\n| 2016.03.31         | 49.6       | 2200     |\n| 2016.04.15         | 29.49      | 4000     |\n| 2016.04.30         | 102.495    | 10000    |\n| 2016.05.15         | 112.995    | 6700     |\n| 2016.05.31         | 50.805     | 11300    |\n| 2016.06.15         | 52.38      | 4500     |\n"
    },
    "sendEvent": {
        "url": "https://docs.dolphindb.com/en/Functions/s/send_event.html",
        "signatures": [
            {
                "full": "sendEvent(event)",
                "name": "sendEvent",
                "parameters": [
                    {
                        "full": "event",
                        "name": "event"
                    }
                ]
            }
        ],
        "markdown": "### [sendEvent](https://docs.dolphindb.com/en/Functions/s/send_event.html)\n\n\n\n#### Syntax\n\nsendEvent(event)\n\n#### Details\n\nAn event sent by `sendEvent` goes to the end of the input queue. The engine processes events in the order they are sent to the input queue.\n\n#### Parameters\n\n**event** is an event instance.\n\n#### Returns\n\nNone\n\n#### Examples\n\nDefine the events:\n\n```\nclass UpdateFactor{\n    sym :: STRING\n    factor :: DOUBLE\n    def UpdateFactor(code, val){\n        sym = code\n        factor = val\n    }\n}\n\nclass MarketData{\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def MarketData(m,c,p,q){\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\n```\n\nDefine the monitor:\n\n```\n\nclass MainMonitor : CEPMonitor{\n    maxPrice :: DOUBLE\n\n    def MainMonitor(){ maxPrice = 0.0 }\n    \n    def updateMarketData(event)\n  \n    def onload(){\n        addEventListener(handler=updateMarketData, eventType='MarketData', times='all')\n    }\n\n    def updateMarketData(event){\n        print(\"MarketData: \"+event.code+\" price=\"+string(event.price))\n\n        if(event.price > maxPrice){\n            maxPrice = event.price\n\n            // emitEvent：Output to streaming table\n            emitEvent(UpdateFactor(\"maxPrice\", maxPrice))\n\n            // routeEvent: inserts a warning event at the head of the queue for priority processing\n            routeEvent(UpdateFactor(\"alert\", maxPrice))\n\n            // sendEvent: inserts an informational event at the tail of the queue for sequential processing\n            sendEvent(UpdateFactor(\"info\", maxPrice))\n        }\n    }\n}\n```\n\nCreate a streaming table to receive output events:\n\n```\nshare streamTable(array(STRING,0) as eventType, array(BLOB,0) as blobs) as simulateResult\n\nserializer = streamEventSerializer(\n    name=`simulate,\n    eventSchema=[UpdateFactor],\n    outputTable=simulateResult\n)\n\ndummy = table(array(STRING,0) as eventType, array(BLOB,0) as blobs)\n```\n\nCreate a CEP engine:\n\n```\nengine = createCEPEngine(\n    name='cep1',\n    monitors=<MainMonitor()>,\n    dummyTable=dummy,\n    eventSchema=[MarketData],\n    outputTable=serializer\n)\n```\n\n**Related functions**: [addEventListener](https://docs.dolphindb.com/en/Functions/a/add_event_listener.html), [createCEPEngine](https://docs.dolphindb.com/en/Functions/c/create_cep_engine.html), [appendEvent](https://docs.dolphindb.com/en/Functions/a/append_event.html), [emitEvent](https://docs.dolphindb.com/en/Functions/e/emit_event.html), [routeEvent](https://docs.dolphindb.com/en/Functions/r/route_event.html)\n"
    },
    "seq": {
        "url": "https://docs.dolphindb.com/en/Functions/s/seq.html",
        "signatures": [
            {
                "full": "seq(start, end)",
                "name": "seq",
                "parameters": [
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "end",
                        "name": "end"
                    }
                ]
            }
        ],
        "markdown": "### [seq](https://docs.dolphindb.com/en/Functions/s/seq.html)\n\n\n\n#### Syntax\n\nseq(start, end) or start..end\n\n#### Details\n\nReturns a vector starting from *start* and ending at *end*. The step between two adjacent elements is 1.\n\nNote: If both *start* and *end* are integral or temporal NULLs, the function returns an empty vector.\n\n#### Parameters\n\n**start** and **end** must be integers or temporal values.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nx=0..3;\nx;\n// output: [0,1,2,3]\n\n1..3+1;\n// output: [2,3,4]\n\n11..1;\n// output: [11,10,9,8,7,6,5,4,3,2,1]\n\nseq(3,1);\n// output: [3,2,1]\n\n2015.01M..2015.12M;\n// output: [2015.01M,2015.02M,2015.03M,2015.04M,2015.05M,2015.06M,2015.07M,2015.08M,2015.09M,2015.10M,2015.11M,2015.12M]\n\n2016.01.01..2016.01.07;\n// output: [2016.01.01,2016.01.02,2016.01.03,2016.01.04,2016.01.05,2016.01.06,2016.01.07]\n```\n"
    },
    "sessionWindow": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sessionWindow.html",
        "signatures": [
            {
                "full": "sessionWindow(X, sessionGap)",
                "name": "sessionWindow",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "sessionGap",
                        "name": "sessionGap"
                    }
                ]
            }
        ],
        "markdown": "### [sessionWindow](https://docs.dolphindb.com/en/Functions/s/sessionWindow.html)\n\n#### Syntax\n\nsessionWindow(X, sessionGap)\n\n#### Details\n\nThe first session window starts at the first non-null value of *X*. Sequentially check whether the difference between each element in *X* and its previous adjacent element is less than *sessionGap*. If the difference is less than *sessionGap*, the session window remains open. Otherwise, the session window ends and a new session window is started from the current element. The value of the first element in each session window is used as its identifier. This function returns the identifier of the session window to which each element in *X* belongs.\n\n**Note:**\n\n* For null values in *X*: If the first element of *X* is null, a null value is returned; otherwise, it returns the identifier of the window to which the previous non-null element belongs.\n\n* For out-of-order data: It will not be involved in the comparison and the identifier of the current window is returned directly.\n\n#### Parameters\n\n**X** is an integral or temporal vector.\n\n**sessionGap** is a positive integer indicating the gap between two sessions. Its unit is the same as the time precision of *X*.\n\n#### Returns\n\nA vector with the same data type and length as *X*.\n\n#### Examples\n\n```\nx = 1 5 6 12 13 13 15\nsessionWindow(x, 5)\n// output: [1,1,1,12,12,12,12]\n\ny = 2012.06.13 2012.06.15 2012.06.19 2012.06.26 2012.06.28\nsessionWindow(y, 5)\n// output: [2012.06.13,2012.06.13,2012.06.13,2012.06.26,2012.06.26]\n```\n\nIn the following example, for the elements 3 and 7 in the second session window (identifier 12), it returns 12 directly. The subsequent element 15 belongs to window 12 (as 15-12 < 4).\n\n```\nx = [, , 1, 12, 3, 7, 15, 19]\nsessionWindow(x, 4)\n// output: [,,1,12,12,12,12,19]\n```\n\n```\ncolTime = 2023.06.01T10:00:00.000 + 1 2 3 4 5 6 7 8 9 21 22 23 28 29 30\ncolSym = take(`A`B`C,15)\ncolVolume = [2,1,5,5,2,3,2,3,2,2,5,5,2,7,2]\nt = table(colTime as time, colSym as sym, colVolume as volume)\nt\n```\n\n| time                    | sym | volume |\n| ----------------------- | --- | ------ |\n| 2023.06.01 10:00:00.001 | A   | 2      |\n| 2023.06.01 10:00:00.002 | B   | 1      |\n| 2023.06.01 10:00:00.003 | C   | 5      |\n| 2023.06.01 10:00:00.004 | A   | 5      |\n| 2023.06.01 10:00:00.005 | B   | 2      |\n| 2023.06.01 10:00:00.006 | C   | 3      |\n| 2023.06.01 10:00:00.007 | A   | 2      |\n| 2023.06.01 10:00:00.008 | B   | 3      |\n| 2023.06.01 10:00:00.009 | C   | 2      |\n| 2023.06.01 10:00:00.021 | A   | 2      |\n| 2023.06.01 10:00:00.022 | B   | 5      |\n| 2023.06.01 10:00:00.023 | C   | 5      |\n| 2023.06.01 10:00:00.028 | A   | 2      |\n| 2023.06.01 10:00:00.029 | B   | 7      |\n| 2023.06.01 10:00:00.030 | C   | 2      |\n\nThe following example uses the higher-order function `contextby` to group the data based on \"sym\". Within each group, calculate the sum of the volumes in each session window. In this case, `sessionWinodow` uses partial application and its first argument is fixed to column \"time\".\n\n```\nselect sum(volume) from t group by contextby(sessionWindow{, 5}, time, sym) as time,sym\n```\n\n| time                    | sym | sum\\_volume |\n| ----------------------- | --- | ----------- |\n| 2023.06.01 10:00:00.001 | A   | 9           |\n| 2023.06.01 10:00:00.002 | B   | 6           |\n| 2023.06.01 10:00:00.003 | C   | 10          |\n| 2023.06.01 10:00:00.021 | A   | 2           |\n| 2023.06.01 10:00:00.022 | B   | 5           |\n| 2023.06.01 10:00:00.023 | C   | 5           |\n| 2023.06.01 10:00:00.028 | A   | 2           |\n| 2023.06.01 10:00:00.029 | B   | 7           |\n| 2023.06.01 10:00:00.030 | C   | 2           |\n\n"
    },
    "set": {
        "url": "https://docs.dolphindb.com/en/Functions/s/set.html",
        "signatures": [
            {
                "full": "set(X)",
                "name": "set",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [set](https://docs.dolphindb.com/en/Functions/s/set.html)\n\n\n\n#### Syntax\n\nset(X)\n\n#### Details\n\nReturn the corresponding set object of vector *X* .\n\n#### Parameters\n\n**X** is a vector\n\n#### Returns\n\nA set object corresponding to vector X.\n\n#### Examples\n\nFunction `set` returns a set.\n\n```\nx=set(4 5 5 2 3 11 6);\nx;\n// output: set(6,11,3,2,5,4)\n\nx.intersection(set([2,5,9]));\n// output: set(2,5)\n```\n\nIn comparison, function [distinct](https://docs.dolphindb.com/en/Functions/d/distinct.html) returns a vector.\n\n```\ndistinct(4 5 5 2 3 11 6);\n// output: [6,11,3,2,5,4]\n```\n\nUse function keys to convert sets to vectors:\n\n```\nx=set(4 5 5 2 3 11 6);\nx.keys()\n// output: [6,11,3,2,5,4]\n```\n"
    },
    "setAtomicLevel": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setAtomicLevel.html",
        "signatures": [
            {
                "full": "setAtomicLevel(dbHandle, atomic)",
                "name": "setAtomicLevel",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "atomic",
                        "name": "atomic"
                    }
                ]
            }
        ],
        "markdown": "### [setAtomicLevel](https://docs.dolphindb.com/en/Functions/s/setAtomicLevel.html)\n\n\n\n#### Syntax\n\nsetAtomicLevel(dbHandle, atomic)\n\n#### Details\n\nTo manually specify at which level concurrent writes are allowed in a distributed database.\n\n#### Parameters\n\n**dbHandle** is a distributed database handle returned by function [database](https://docs.dolphindb.com/en/Functions/d/database.html).\n\n**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'.\n\n* '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.\n\n* '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.\n\n#### Examples\n\n```\ndbPath=\"dfs://test\"\nmydb=database(dbPath, VALUE, ['AMZN','NFLX', 'NVDA'])\nmydb.schema()\n\n/* output:\ndatabaseDir->dfs://test\npartitionSchema->[NVDA,AMZN,NFLX]\npartitionSites->\npartitionTypeName->VALUE\npartitionType->1\natomic->TRANS\n*/\n\nsetAtomicLevel(mydb, `CHUNK)\nmydb.schema()\n\n/* output:\ndatabaseDir->dfs://test\npartitionSchema->[NVDA,AMZN,NFLX]\npartitionSites->\npartitionTypeName->VALUE\npartitionType->1\natomic->CHUNK\n*/\n```\n"
    },
    "setCacheEngineMemSize": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setCacheEngineMemSize.html",
        "signatures": [
            {
                "full": "setCacheEngineMemSize(memSize)",
                "name": "setCacheEngineMemSize",
                "parameters": [
                    {
                        "full": "memSize",
                        "name": "memSize"
                    }
                ]
            }
        ],
        "markdown": "### [setCacheEngineMemSize](https://docs.dolphindb.com/en/Functions/s/setCacheEngineMemSize.html)\n\n\n\n#### Syntax\n\nsetCacheEngineMemSize(memSize)\n\n#### Details\n\nModify the capacity of the OLAP cache engine online. In a cluster, this command can only be executed by the admin on a data node or compute node. Please make sure the cache engine is enabled by specifying configuration parameter *chunkCacheEngineMemSize* before execution.\n\n* Scenario: If the cache engine is enabled, the system will first write the data to the cache. Only when the amount of cached data reaches 30% of *chunkCacheEngineMemSize* will it be written to disk. If the configuration parameter is set too low, massive concurrent writes may take up the cache engine capacity quickly and cause the writing process stuck. In this case, execute the command to online modify the cache engine capacity to ensure that the writes continue.\n\n* You can obtain the real-time status of the cache engine with function `getOLAPCacheEngineSize` to check if the modification takes effect online.\n\n**Note:**\n\nThe modified configuration will expire after the cluster is rebooted. To make it permanent, please change the configuration parameter *chunkCacheEngineMemSize*.\n\nRelated function: [getOLAPCacheEngineSize](https://docs.dolphindb.com/en/Functions/g/getOLAPCacheEngineSize.html)\n\n#### Parameters\n\n**memSize** is a numeric scalar (in GB). It must be greater than 0 and less than *maxMemSize* \\* 0.5.\n"
    },
    "setChunkLastUpdateTime": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setChunkLastUpdateTime.html",
        "signatures": [
            {
                "full": "setChunkLastUpdateTime(chunkId, lastUpdateTime)",
                "name": "setChunkLastUpdateTime",
                "parameters": [
                    {
                        "full": "chunkId",
                        "name": "chunkId"
                    },
                    {
                        "full": "lastUpdateTime",
                        "name": "lastUpdateTime"
                    }
                ]
            }
        ],
        "markdown": "### [setChunkLastUpdateTime](https://docs.dolphindb.com/en/Functions/s/setChunkLastUpdateTime.html)\n\nFirst introduced in version: 2.00.163.00.3\n\n\n\n#### Syntax\n\nsetChunkLastUpdateTime(chunkId, lastUpdateTime)\n\n#### Details\n\nManually set the last update time of specified chunks (which can be checked in the lastUpdated field returned by `getClusterChunksStatus`).\n\nThis function can only be executed by administrators in standalone mode, or on the controller in cluster mode.\n\n#### Parameters\n\n**chunkId** is a STRING vector indicating the chunk(s).\n\n**lastUpdateTime** is a TIMESTAMP scalar specifying the last update time.\n\n#### Examples\n\n```\nsetChunkLastUpdateTime([\"32953d51-980c-59a1-5f43-c90bfddd5a63\",\"d957b444-be92-9296-ba4a-9d8a41682168\"], timestamp(2016.05.12T19:32:49))\n```\n"
    },
    "setColumnarTuple!": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setColumnarTuple!.html",
        "signatures": [
            {
                "full": "setColumnarTuple!(X, [on=true])",
                "name": "setColumnarTuple!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[on=true]",
                        "name": "on",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [setColumnarTuple!](https://docs.dolphindb.com/en/Functions/s/setColumnarTuple!.html)\n\n#### Syntax\n\nsetColumnarTuple!(X, \\[on=true])\n\n#### Details\n\nMarks a tuple as a columnar tuple in place, or clears the columnar tuple flag.\n\nA columnar tuple is still an ANY tuple composed of scalars or vectors, but DolphinDB interprets it using columnar rules similar to those of array vectors: each element in the tuple corresponds to one row value of a table column; if an element is a vector, that row stores an array. A regular tuple is interpreted by tuple rules, where each row is a complete ANY element when the tuple is used as a table column.\n\nFor example, when [ungroup](https://docs.dolphindb.com/en/Functions/u/ungroup.html) is applied to a table column containing vector elements, a regular tuple column is not flattened. After it is converted to a columnar tuple, `ungroup` flattens the vector elements in each row.\n\n#### Parameters\n\n**X** is a tuple composed of vectors or scalars of the same data type.\n\n**on** (optional) is a Boolean value indicating whether to mark *X* as a columnar tuple. The default value is true.\n\n* If *on* = true, converts a regular tuple to a columnar tuple.\n\n* If *on* = false, clears the columnar tuple flag and converts it to a regular tuple.\n\n#### Returns\n\nReturns the modified *X*.\n\n* If *on* = true, returns a columnar tuple.\n\n* If *on* = false, returns a regular tuple.\n\n#### Examples\n\nConvert a regular tuple to a columnar tuple.\n\n```\ntp = [[1,2,3], [4,5,6], [7,8]]\nisColumnarTuple(tp)\n// output: false\n\ntp.setColumnarTuple!()\nisColumnarTuple(tp)\n// output: true\n```\n\nWhen a regular tuple is used as a table column, each row is an ANY element. `ungroup` does not flatten the vector elements in it.\n\n```\nt = table([1,2] as id, ([10,11], 12) as v)\nungroup(t)\n```\n\n| id | v        |\n| -- | -------- |\n| 1  | \\[10,11] |\n| 2  | 12       |\n\nAfter the regular tuple is converted to a columnar tuple, `ungroup` flattens column *v* by array-vector rules.\n\n```\nt = table([1,2] as id, ([10,11], 12).setColumnarTuple!() as v)\nungroup(t)\n```\n\n| id | v  |\n| -- | -- |\n| 1  | 10 |\n| 1  | 11 |\n| 2  | 12 |\n\nClear the columnar tuple flag.\n\n```\nv = ([10,11], 12).setColumnarTuple!()\nisColumnarTuple(v)\n// output: true\n\nv.setColumnarTuple!(false)\nisColumnarTuple(v)\n// output: false\n```\n\n"
    },
    "setColumnComment": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setColumnComment.html",
        "signatures": [
            {
                "full": "setColumnComment(table, columnComments)",
                "name": "setColumnComment",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "columnComments",
                        "name": "columnComments"
                    }
                ]
            }
        ],
        "markdown": "### [setColumnComment](https://docs.dolphindb.com/en/Functions/s/setColumnComment.html)\n\n\n\n#### Syntax\n\nsetColumnComment(table, columnComments)\n\n#### Details\n\nAdd comments to columns of a DFS tableor an MVCC table. Use function [schema](https://docs.dolphindb.com/en/Functions/s/schema.html) to view column comments.\n\n#### Parameters\n\n**table** is a DFS tableor MVCC table.\n\n**columnComments** is a dictionary. Its keys are table columns and values are comments for each column.\n\n#### Examples\n\n```\nn=1000000\nsym=rand(`A`B`C`D`E`F,n)\ndate=rand(2019.06.01..2019.06.10,n)\nopen=rand(100.0,n)\nhigh=rand(200.0,n)\nclose=rand(200.0,n)\npre_close=rand(200.0,n)\nchange=rand(100.0,n)\nvol=rand(10000,n)\namount=rand(100000.0,n)\nt=table(sym,date,open,high,close,pre_close,change,vol,amount);\n\ndb1=database(\"\",VALUE,2019.06.01..2019.06.10)\ndb2=database(\"\",VALUE,`A`B`C`D`E`F)\ndb=database(\"dfs://db1\",COMPO,[db1,db2])\npt=db.createPartitionedTable(t,`pt,`date`sym).append!(t);\n\nsetColumnComment(pt,{sym:\"stock ticker\", date:\"trading date\", open:\"open price\", high:\"highest price\", low:\"lowest price\", close:\"close price\", vol:\"trading volume (shares)\", amount:\"trading volume (dollar)\"})\nschema(pt).colDefs;\n```\n\n| name   | typeString | typeInt | comment                 |\n| ------ | ---------- | ------- | ----------------------- |\n| sym    | SYMBOL     | 17      | stock ticker            |\n| date   | DATE       | 6       | trading date            |\n| open   | DOUBLE     | 16      | open price              |\n| high   | DOUBLE     | 16      | highest price           |\n| close  | DOUBLE     | 16      | close price             |\n| vol    | INT        | 4       | trading volume (shares) |\n| amount | DOUBLE     | 16      | trading volume (dollar) |\n\n```\nid=`XOM`GS`AAPL\nx=102.1 33.4 73.6\nmt = mvccTable(id, x);\nsetColumnComment(mt, {id:\"identifier\"})\nschema(mt).colDefs\n```\n\n| name | typeString | typeInt | extra | comment    |\n| ---- | ---------- | ------- | ----- | ---------- |\n| id   | STRING     | 18      |       | identifier |\n| x    | DOUBLE     | 16      |       |            |\n"
    },
    "setComputeNodeCachingDelay": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setComputeNodeCachingDelay.html",
        "signatures": [
            {
                "full": "setComputeNodeCachingDelay(delay)",
                "name": "setComputeNodeCachingDelay",
                "parameters": [
                    {
                        "full": "delay",
                        "name": "delay"
                    }
                ]
            }
        ],
        "markdown": "### [setComputeNodeCachingDelay](https://docs.dolphindb.com/en/Functions/s/setComputeNodeCachingDelay.html)\n\n\n\n#### Syntax\n\nsetComputeNodeCachingDelay(delay)\n\n#### Details\n\nModify the value of *computeNodeCachingDelay* online. This function can only be executed by an administrator on the controller.\n\n**Note:** The modified configuration is only valid for the current node, and will expire after the system restarts. To make it permanent, please set the configuration parameter *computeNodeCachingDelay.*\n\n#### Parameters\n\n**delay** is a non-negative integer indicating the time interval (in seconds).\n\n#### Examples\n\n```\nsetComputeNodeCachingDelay(580) \n```\n\n**Related Function**: [getComputeNodeCachingDelay](https://docs.dolphindb.com/en/Functions/g/getComputeNodeCachingDelay.html)\n"
    },
    "setDatabaseClusterReplicationExecutionSet": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setDatabaseClusterReplicationExecutionSet.html",
        "signatures": [
            {
                "full": "setDatabaseClusterReplicationExecutionSet(dbHandle, executionSet)",
                "name": "setDatabaseClusterReplicationExecutionSet",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "executionSet",
                        "name": "executionSet"
                    }
                ]
            }
        ],
        "markdown": "### [setDatabaseClusterReplicationExecutionSet](https://docs.dolphindb.com/en/Functions/s/setDatabaseClusterReplicationExecutionSet.html)\n\n\n\n#### Syntax\n\nsetDatabaseClusterReplicationExecutionSet(dbHandle, executionSet)\n\n#### Details\n\nSet the execution set for asynchronous replication tasks of a database. Tasks within an execution set are executed sequentially. Different execution sets are isolated and executed in parallel. This function can only be executed by an administrator on the data nodes of the master cluster for databases that have asynchronous replication enabled.\n\n#### Parameters\n\n**dbHandle** is the database handle for which to set the execution set.\n\n**executionSet** is an integer 0 or 1, representing the execution set. When asynchronous replication is enabled for the database, the default execution set is 0.\n\n#### Examples\n\n```\nsetDatabaseClusterReplicationExecutionSet(dbHandle=database(\"dfs://test\"), executionSet=1)\n```\n"
    },
    "setDatabaseForClusterReplication": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setDatabaseForClusterReplication.html",
        "signatures": [
            {
                "full": "setDatabaseForClusterReplication(dbHandle, option)",
                "name": "setDatabaseForClusterReplication",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "option",
                        "name": "option"
                    }
                ]
            }
        ],
        "markdown": "### [setDatabaseForClusterReplication](https://docs.dolphindb.com/en/Functions/s/setDatabaseForClusterReplication.html)\n\n#### Syntax\n\nsetDatabaseForClusterReplication(dbHandle, option)\n\n#### Details\n\nThis command enables/disables asynchronous replication on the specified database. It can only be executed on the data node of the master cluster.\n\n#### Parameters\n\n**dbHandle** is a database handle.\n\n**option** is a Boolean value indicating whether to enable asynchronous replication on the specified database. The default value is false.\n\nRelated functions: [getDatabaseClusterReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getDatabaseClusterReplicationStatus.html)\n\n"
    },
    "setDatanodeRestartInterval": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setdatanoderestartinterval.html",
        "signatures": [
            {
                "full": "setDatanodeRestartInterval(interval)",
                "name": "setDatanodeRestartInterval",
                "parameters": [
                    {
                        "full": "interval",
                        "name": "interval"
                    }
                ]
            }
        ],
        "markdown": "### [setDatanodeRestartInterval](https://docs.dolphindb.com/en/Functions/s/setdatanoderestartinterval.html)\n\n\n\n#### Syntax\n\nsetDatanodeRestartInterval(interval)\n\n#### Details\n\nModify *datanodeRestartInterval* online. This command can only be executed by an administrator on the controller.\n\n* If *interval*=0, the controller will not automatically restart the data/compute node.\n\n* If *interval*>0, the controller will restart the data/compute node after *datanodeRestartInterval* of offline time.\n\n**Note:** The modified configuration is only valid for the current node, and will expire after the system restarts. To make it permanent, please change the configuration parameter *datanodeRestartInterval.*\n\nRelated function: [getDatanodeRestartInterval](https://docs.dolphindb.com/en/Functions/g/getdatanoderestartinterval.html)\n\n#### Parameters\n\n**interval** is a non-negative integer (in seconds).\n"
    },
    "setDefaultCatalog": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setDefaultCatalog.html",
        "signatures": [
            {
                "full": "setDefaultCatalog(catalog)",
                "name": "setDefaultCatalog",
                "parameters": [
                    {
                        "full": "catalog",
                        "name": "catalog"
                    }
                ]
            }
        ],
        "markdown": "### [setDefaultCatalog](https://docs.dolphindb.com/en/Functions/s/setDefaultCatalog.html)\n\n#### Syntax\n\nsetDefaultCatalog(catalog)\n\n#### Details\n\nSet a default catalog for the current session. After setting a default catalog, you can refer to databases and tables without specifying the catalog name explicitly.\n\n#### Parameters\n\n**catalog** is a string specifying the catalog name. An empty string (\"\") means no default catalog is used.\n\n#### Examples\n\n```\ncreateCatalog(\"cat1\")\nsetDefaultCatalog(\"cat1\")\ngetCurrentCatalog()\n// output: cat1\n\nsetDefaultCatalog(\"\")\ngetCurrentCatalog()\n// NULL\n```\n\n"
    },
    "setDynamicConfig": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setDynamicConfig.html",
        "signatures": [
            {
                "full": "setDynamicConfig(configName, configValue)",
                "name": "setDynamicConfig",
                "parameters": [
                    {
                        "full": "configName",
                        "name": "configName"
                    },
                    {
                        "full": "configValue",
                        "name": "configValue"
                    }
                ]
            }
        ],
        "markdown": "### [setDynamicConfig](https://docs.dolphindb.com/en/Functions/s/setDynamicConfig.html)\n\n#### Syntax\n\nsetDynamicConfig(configName, configValue)\n\n#### Details\n\nModify the specified configuration parameter online.\n\n**Note:** The modified configuration is only valid for the current node, and will expire after the system restarts. To make it permanent, please change the configuration parameter in configuration file\\*.\\*\n\nThe following are supported configuration parameters (for detailed usage, see [Configuration](https://docs.dolphindb.com/en/Database/Configuration/reference.html)):\n\n*enableMultiThreadMerge*, enableNullSafeJoin, *logLevel*, *maxBlockSizeForReservedMemory*, *maxConnections*, *memLimitOfQueryResult*, *memLimitOfTaskGroupResult*, *maxMemSize*, *maxPartitionNumPerQuery*, *memLimitOfTempResult*, *OLAPCacheEngineSize*, *recoveryWorkers*, *reservedMemSize*,*dfsChunkNodeHeartBeatTimeout*, *TSDBCacheEngineSize*, *TSDBVectorIndexCacheSize*, *memLimitOfAllTempResults*.\n\n#### Parameters\n\n**configName** is a STRING scalar indicating the name of configuration parameter to be modified.\n\n**configValue** is a scalar indicating the new value to be set.\n\n#### Examples\n\n```\nsetDynamicConfig(\"maxMemSize\", 8);\nsetDynamicConfig(\"maxConnections\", 4096);\n```\n\nRelated functions: [getDynamicConfig](https://docs.dolphindb.com/en/Functions/g/getDynamicConfig.html)\n\n"
    },
    "setGpFitnessFunc": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setGpFitnessFunc.html",
        "signatures": [
            {
                "full": "setGpFitnessFunc(engine, func)",
                "name": "setGpFitnessFunc",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "func",
                        "name": "func"
                    }
                ]
            }
        ],
        "markdown": "### [setGpFitnessFunc](https://docs.dolphindb.com/en/Functions/s/setGpFitnessFunc.html)\n\n**Note:** This function is not supported by Community Edition. You can [get a trial](https://dolphindb.com/product#downloads-down) of Shark from DolphinDB official website.\n\n#### Syntax\n\nsetGpFitnessFunc(engine, func)\n\n#### Details\n\nSet fitness function for the GPLearn engine.\n\n#### Parameters\n\n**engine** is the engine object returned by `createGPLearnEngine`.\n\n**func** is the fitness function, which can be:\n\n* A FUNCTIONDEF scalar, specifying a built-in function supported by *fitnessFunc*of `createGPLearnEngine`. It must be 'mse', 'rmse', 'pearson', 'spearmanr', or 'mae'.\n\n* A user-defined function with a floating-point return value. It takes two input arguments, the first represents the factor calculation result, and the second represents the predicted value. Currently it does not support complex assignment, `if` or `for` statement. Only `return` statement can be used to return a combination of the supported fitness function and the training function. For example:\n\n  ```\n  def f(x, y){\n    return mse(x+y,y)\n  }\n  ```\n\n  A user-defined fitness function can be combined with a helper function (as shown below) to pre-process the data before calculation.\n\n  | Function                   | Num of Args |\n  | -------------------------- | ----------- |\n  | clip(X,Y,Z)                | 3           |\n  | zscore(x)                  | 1           |\n  | mad(X, \\[useMedian=false]) | 1           |\n  | med(x)                     | 1           |\n  | mean(x)                    | 1           |\n  | corr(X,Y)                  | 2           |\n\n#### Examples\n\nSet fitness function for the GPLearn engine.\n\n```\ndef f(x, y){\n  return mse(x+y,y)\n}\nsetGpFitnessFunc(engine,f)\n```\n\n"
    },
    "setHaMvccColumnDefaultValue": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setHaMvccColumnDefaultValue.html",
        "signatures": [
            {
                "full": "setHaMvccColumnDefaultValue(table, colName, defaultValue)",
                "name": "setHaMvccColumnDefaultValue",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "colName",
                        "name": "colName"
                    },
                    {
                        "full": "defaultValue",
                        "name": "defaultValue"
                    }
                ]
            }
        ],
        "markdown": "### [setHaMvccColumnDefaultValue](https://docs.dolphindb.com/en/Functions/s/setHaMvccColumnDefaultValue.html)\n\n\n\n#### Syntax\n\nsetHaMvccColumnDefaultValue(table, colName, defaultValue)\n\n#### Details\n\nSets the default values for specified columns of an HA MVCC table.\n\n**Notes:** This function must be executed on the Leader node of the Raft group that the table belongs to.\n\n#### Parameters\n\n**table** is an HA MVCC table indicating the table to modify.\n\n**colName** is a STRING scalar or vector indicating the column name(s) for which to set default values (single or multiple columns).\n\n**defaultValue** is a scalar/tuple of any type indicating the column default value(s). If *colName* is a vector, *defaultValue* must be a tuple of the same length as *colName*.\n\n#### Examples\n\n```\n// Create an haMvccTable\nschemaTb = table(1:0, `id`v, [INT, DOUBLE])\nt = haMvccTable(1:0, schemaTb, \"haT2\", 2)\n\n// Set the default value of the name column to A001\nsetHaMvccColumnDefaultValue(t, \"v\", 0.0)\n// Set the default value of the `id` column to 1, and the default value of the `value` column to 3.6\nsetHaMvccColumnDefaultValue(t, [\"id\",\"v\"], (0, 0.0))\n```\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "setHaMvccColumnNullability": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setHaMvccColumnNullability.html",
        "signatures": [
            {
                "full": "setHaMvccColumnNullability(table, colName, allowNull)",
                "name": "setHaMvccColumnNullability",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "colName",
                        "name": "colName"
                    },
                    {
                        "full": "allowNull",
                        "name": "allowNull"
                    }
                ]
            }
        ],
        "markdown": "### [setHaMvccColumnNullability](https://docs.dolphindb.com/en/Functions/s/setHaMvccColumnNullability.html)\n\n* **[setHaMvccColumnDefaultValue](https://docs.dolphindb.com/en/Functions/s/setHaMvccColumnDefaultValue.html)**\n\n\n\n#### Syntax\n\nsetHaMvccColumnNullability(table, colName, allowNull)\n\n#### Details\n\nSets whether specified columns of an HA MVCC table allow null values.\n\n**Notes:** This function must be executed on the Leader node of the Raft group that the table belongs to.\n\n#### Parameters\n\n**table** is an HA MVCC table indicating the table to modify.\n\n**colName** is a STRING scalar or vector indicating the column name(s) to set (single or multiple columns).\n\n**allowNull** is a BOOLEAN scalar or vector indicating whether to allow null values. If it is a vector, it must have the same length as *colName*.\n\n#### Examples\n\n```\nschemaTb = table(1:0, `id`v, [INT, DOUBLE])\nt = haMvccTable(1:0, schemaTb, \"haT\", 2)\n\nsetHaMvccColumnNullability(t, \"v\", false)\nsetHaMvccColumnNullability(t, [\"id\",\"v\"], [false,false])\n```\n\n**Related function**: [haMvccTable](https://docs.dolphindb.com/en/Functions/h/haMvccTable.html)\n"
    },
    "setIndexedMatrix!": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setIndexedMatrix!.html",
        "signatures": [
            {
                "full": "setIndexedMatrix!(X, [on=true])",
                "name": "setIndexedMatrix!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[on=true]",
                        "name": "on",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [setIndexedMatrix!](https://docs.dolphindb.com/en/Functions/s/setIndexedMatrix!.html)\n\n\n\n#### Syntax\n\nsetIndexedMatrix!(X, \\[on=true])\n\n#### Details\n\nSet the labels of the rows and columns of a matrix as the indexes.\n\n#### Parameters\n\n**X** is a matrix with row labels and column labels. Row labels and column labels must be monotonically increasing with no duplicate values.\n\n**on** (optional) 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.\n\n#### Returns\n\nA matrix or indexed matrix.\n\n#### Examples\n\n```\nm=matrix(1..5, 11..15)\nm.rename!(2020.01.01..2020.01.05, `A`B)\nm.setIndexedMatrix!();\n```\n\n|            | A | B  |\n| ---------- | - | -- |\n| 2020.01.01 | 1 | 11 |\n| 2020.01.02 | 2 | 12 |\n| 2020.01.03 | 3 | 13 |\n| 2020.01.04 | 4 | 14 |\n| 2020.01.05 | 5 | 15 |\n"
    },
    "setIndexedSeries!": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setIndexedSeries!.html",
        "signatures": [
            {
                "full": "setIndexedSeries!(X, [on=true])",
                "name": "setIndexedSeries!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[on=true]",
                        "name": "on",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [setIndexedSeries!](https://docs.dolphindb.com/en/Functions/s/setIndexedSeries!.html)\n\n\n\n#### Syntax\n\nsetIndexedSeries!(X, \\[on=true])\n\n#### Details\n\nConvert a single column matrix with row labels into an indexed series.\n\n#### Parameters\n\n**X** is a matrix with row labels and only one column. The row labels must be monotonically increasing with no duplicate values.\n\n**on** (optional) 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.\n\n#### Returns\n\nA vector or indexed vector.\n\n#### Examples\n\n```\ns = matrix(1..10).rename!(2012.01.01..2012.01.10, ).setIndexedSeries!();\ns;\n```\n\n|            | #0 |\n| ---------- | -- |\n| 2012.01.01 | 1  |\n| 2012.01.02 | 2  |\n| 2012.01.03 | 3  |\n| 2012.01.04 | 4  |\n| 2012.01.05 | 5  |\n| 2012.01.06 | 6  |\n| 2012.01.07 | 7  |\n| 2012.01.08 | 8  |\n| 2012.01.09 | 9  |\n| 2012.01.10 | 10 |\n"
    },
    "setIPConnectionLimit": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setIPConnectionLimit.html",
        "signatures": [
            {
                "full": "setIPConnectionLimit(IP, limit)",
                "name": "setIPConnectionLimit",
                "parameters": [
                    {
                        "full": "IP",
                        "name": "IP"
                    },
                    {
                        "full": "limit",
                        "name": "limit"
                    }
                ]
            }
        ],
        "markdown": "### [setIPConnectionLimit](https://docs.dolphindb.com/en/Functions/s/setIPConnectionLimit.html)\n\nFirst introduced in version: 2.00.17, 2.00.16.23.00.4\n\n\n\n#### Syntax\n\nsetIPConnectionLimit(IP, limit)\n\n#### Details\n\nSet the maximum number of connections allowed from each IP address to the current node.\n\nThis limit applies to API and `xdb` connections but does not affect internal connections between cluster nodes (e.g., `rpc`).\n\nThis function can only be executed by an administrator on Linux.\n\n#### Parameters\n\n**IP** is a string representing the IP address.\n\n**limit** is a positive integer specifying the connection limit. A value of -1 indicates no limit.\n\n#### Examples\n\nSet the maximum number of connections for IP address \"192.168.1.56\" to 10:\n\n```\nsetIPConnectionLimit(\"192.168.1.56\", 10);\n```\n\nRemove the connection limit for IP address \"192.168.1.56\":\n\n```\nsetIPConnectionLimit(\"192.168.1.56\", -1);\n```\n\nRelated function: [getIPConnectionLimit](https://docs.dolphindb.com/en/Functions/g/getIPConnectionLimit.html)\n"
    },
    "setLogLevel": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setLogLevel.html",
        "signatures": [
            {
                "full": "setLogLevel(logLevel)",
                "name": "setLogLevel",
                "parameters": [
                    {
                        "full": "logLevel",
                        "name": "logLevel"
                    }
                ]
            }
        ],
        "markdown": "### [setLogLevel](https://docs.dolphindb.com/en/Functions/s/setLogLevel.html)\n\n\n\n#### Syntax\n\nsetLogLevel(logLevel)\n\n#### Details\n\nSet the log level on the current node online. After setting the log level, only logs at and above the specified *logLevel* are printed.\n\nThe command can only be executed by an administrator.\n\n#### Parameters\n\n**logLevel** indicates the log level. The optional values from low to high are: DEBUG, INFO, WARNING, and ERROR.\n"
    },
    "setMaxBlockSizeForReservedMemory": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMaxBlockSizeForReservedMemory.html",
        "signatures": [
            {
                "full": "setMaxBlockSizeForReservedMemory(blockSizeKB)",
                "name": "setMaxBlockSizeForReservedMemory",
                "parameters": [
                    {
                        "full": "blockSizeKB",
                        "name": "blockSizeKB"
                    }
                ]
            }
        ],
        "markdown": "### [setMaxBlockSizeForReservedMemory](https://docs.dolphindb.com/en/Functions/s/setMaxBlockSizeForReservedMemory.html)\n\n\n\n#### Syntax\n\nsetMaxBlockSizeForReservedMemory(blockSizeKB)\n\n#### Details\n\nModify the maximum reserved memory allocated to a DolphinDB block online. This command can only be executed by the admin on the data node.\n\n**Note:** The modified configuration is only valid for the current node, and will expire after the system restarts. To make it permanent, please change the configuration parameter *maxBlockSizeForReservedMemory*.\n\n#### Parameters\n\n**blockSizeKB** is a positive integer or floating-point number (in KB).\n"
    },
    "setMaxConnections": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMaxConnections.html",
        "signatures": [
            {
                "full": "setMaxConnections(newValue)",
                "name": "setMaxConnections",
                "parameters": [
                    {
                        "full": "newValue",
                        "name": "newValue"
                    }
                ]
            }
        ],
        "markdown": "### [setMaxConnections](https://docs.dolphindb.com/en/Functions/s/setMaxConnections.html)\n\n#### Syntax\n\nsetMaxConnections(newValue)\n\n#### Details\n\nModify the maximum number of connections to the current node online. This command can only be executed by an administrator.\n\nYou can check if the modification is successful from the field *maxConnections* returned by executing function [getClusterPerf](https://docs.dolphindb.com/en/Functions/g/getClusterPerf.html) on the controller.\n\n**Note:**\n\n* The value specified by *newValue* must be greater than the current maximum number of connections, otherwise, it cannot take effect.\n\n* The modified configuration will expire after the cluster is rebooted. To make it permanent, change the configuration parameter *maxConnections*.\n\n* The function `getClusterPerf` has a delay in getting the node information.\n\n#### Parameters\n\n**newValue** is a positive integer smaller than 2^16 (65536).\n\n"
    },
    "setMaxJobParallelism": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMaxJobParallelism.html",
        "signatures": [
            {
                "full": "setMaxJobParallelism(userId, maxParallelism)",
                "name": "setMaxJobParallelism",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    },
                    {
                        "full": "maxParallelism",
                        "name": "maxParallelism"
                    }
                ]
            }
        ],
        "markdown": "### [setMaxJobParallelism](https://docs.dolphindb.com/en/Functions/s/setMaxJobParallelism.html)\n\n\n\n#### Syntax\n\nsetMaxJobParallelism(userId, maxParallelism)\n\n#### Details\n\nSpecify the maximum number of subjobs that can be concurrently executed for the jobs submitted by the user. It must be executed by a logged-in user.\n\nIf the function is not executed, the default value of *maxParallelism* is 64 for an administrator and 2 for a non-admin user.\n\n#### Parameters\n\n**userId** is a string indicating a user name.\n\n**maxParallelism** is an integer between 1 and 64.\n\n#### Examples\n\n```\nlogin(`admin,`123456)\ncreateUser(`ElonMusk, `superman)\nsetMaxJobParallelism(`ElonMusk, 64);\n```\n"
    },
    "setMaxJobPriority": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMaxJobPriority.html",
        "signatures": [
            {
                "full": "setMaxJobPriority(userId, maxPriority)",
                "name": "setMaxJobPriority",
                "parameters": [
                    {
                        "full": "userId",
                        "name": "userId"
                    },
                    {
                        "full": "maxPriority",
                        "name": "maxPriority"
                    }
                ]
            }
        ],
        "markdown": "### [setMaxJobPriority](https://docs.dolphindb.com/en/Functions/s/setMaxJobPriority.html)\n\n\n\n#### Syntax\n\nsetMaxJobPriority(userId, maxPriority)\n\n#### Details\n\nSpecify the highest priority of the jobs submitted by the user. It can only be executed by an administrator.\n\n#### Parameters\n\n**userId** is a string indicating a user name.\n\n**maxPriority** is an integer between 0 and 8.\n\n#### Examples\n\n```\nlogin(`admin,`123456)\ncreateUser(`KyleMurray, `Cardinals2020QB)\nsetMaxJobPriority(`KyleMurray, 7);\n```\n"
    },
    "setMaxMemSize": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMaxMemSize.html",
        "signatures": [
            {
                "full": "setMaxMemSize(memSizeGB, [emergencyMemSizeGB])",
                "name": "setMaxMemSize",
                "parameters": [
                    {
                        "full": "memSizeGB",
                        "name": "memSizeGB"
                    },
                    {
                        "full": "[emergencyMemSizeGB]",
                        "name": "emergencyMemSizeGB",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [setMaxMemSize](https://docs.dolphindb.com/en/Functions/s/setMaxMemSize.html)\n\n\n\n#### Syntax\n\nsetMaxMemSize(memSizeGB, \\[emergencyMemSizeGB])\n\n#### Details\n\nModify the maximum memory and emergency memory allocated to DolphinDB online. This command can only be executed by the administrator. Call `getClusterPerf().maxMemSize` to check if the modification on maximum memory has taken effect.\n\nWhen dynamically adjusting the maximum memory space (the corresponding configuration parameter is *maxMemSize*), if the user does not specify other settings, the system will automatically adjust the sizes of the reserved memory area (*reservedMemSize*) and the emergency memory area (*emergencyMemSize*) as follows:\n\n* *reservedMemSize* will be set to 5% of the provided *memSizeGB*, with a minimum of 64 MB and a maximum of 1 GB.\n* *emergencyMemSize* (if not explicitly set) will be set to 5% of *memSizeGB*, with a minimum of 256 MB and a maximum of 5 GB.\n\nFor more information on DolphinDB memory management configuration parameters and strategies, refer to the [Reference - Memory Management](https://docs.dolphindb.com/en/Database/Configuration/reference.md#).\n\n**Note:**\n\nThe modified configuration will expire after the server is rebooted. To make it permanent, please change the configuration parameter *maxMemSize* and *emergencyMemSize* (see [Memory Management](https://docs.dolphindb.com/en/Database/Configuration/reference.md#)).\n\n#### Parameters\n\n**memSizeGB** is a numeric scalar (in GB). It is greater than 0 but no greater than *maxMemoryPerNode* (specified by DolphinDB license), which can be checked with function `license`. Otherwise an error will be raised.\n\n**emergencyMemSizeGB**(optional) is a numeric scalar (in GB) used to dynamically modify the size of the emergency memory area. It must be greater than 0 and less than 50% *memSizeGB*. It must be at least 256 MB and no more than 5 GB.If not specified, the value remains unchanged from the *[emergencyMemSize](https://docs.dolphindb.com/en/Database/Configuration/reference.md#)* configuration parameter.\n"
    },
    "setMaxTransactionSize": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMaxTransactionSize.html",
        "signatures": [
            {
                "full": "setMaxTransactionSize(engine, maxSizeGB)",
                "name": "setMaxTransactionSize",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "maxSizeGB",
                        "name": "maxSizeGB"
                    }
                ]
            }
        ],
        "markdown": "### [setMaxTransactionSize](https://docs.dolphindb.com/en/Functions/s/setMaxTransactionSize.html)\n\n\n\n#### Syntax\n\nsetMaxTransactionSize(engine, maxSizeGB)\n\n#### Details\n\nModify the maximum size of a single write transaction (in GB) for the current data/compute node online. Note that the transaction size cannot exceed the corresponding cache engine size.\n\nThis command can only be executed by an administrator. For more information on DolphinDB memory management configuration parameters and strategies, refer to the [Reference - Memory Management](https://docs.dolphindb.com/en/Database/Configuration/reference.md#).\n\n**Notes:**\n\n* If the OLAP engine does not have the cache engine enabled, this function imposes no limit on write transactions for OLAP.\n* If the cache engine size for the current node has been modified online (using `[setOLAPCacheEngineSize](setOLAPCacheEngineSize.md)` or `[setTSDBCacheEngineSize](setTSDBCacheEngineSize.md)`), this function cannot set a value larger than the current cache engine size.\n* The modified configuration will expire after the server is rebooted. To permanently limit write transaction size, adjust *maxTransactionRatio* in the configuration file to control the maximum proportion of the cache engine that a write transaction can occupy.\n\n#### Parameters\n\n**engine** is a string scalar representing the corresponding storage engine. It can be \"TSDB\" or \"OLAP\".\n\n**maxSizeGB** is a numeric scalar representing the maximum size (in GB) of a write transaction.\n"
    },
    "setMemLimitOfAllTempResults": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMemLimitOfAllTempResults.html",
        "signatures": [
            {
                "full": "setMemLimitOfAllTempResults(memLimit)",
                "name": "setMemLimitOfAllTempResults",
                "parameters": [
                    {
                        "full": "memLimit",
                        "name": "memLimit"
                    }
                ]
            }
        ],
        "markdown": "### [setMemLimitOfAllTempResults](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfAllTempResults.html)\n\n\n\n#### Syntax\n\nsetMemLimitOfAllTempResults(memLimit)\n\n#### Details\n\nModify *memLimitOfAllTempResults*online. This command can only be executed by an administrator on the data node or compute node.\n\n**Note:** The modified configuration is only valid for the current node, and will expire after the system restarts. To make it permanent, please change the configuration parameter *memLimitOfAllTempResults.*\n\n#### Parameters\n\n**memLimit** is a positive number smaller than configured *maxMemSize*.\n\n#### Examples\n\n```\n`setMemLimitOfAllTempResults(3.0)`\n```\n"
    },
    "setMemLimitOfQueryResult": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMemLimitOfQueryResult.html",
        "signatures": [
            {
                "full": "setMemLimitOfQueryResult(memLimit)",
                "name": "setMemLimitOfQueryResult",
                "parameters": [
                    {
                        "full": "memLimit",
                        "name": "memLimit"
                    }
                ]
            }
        ],
        "markdown": "### [setMemLimitOfQueryResult](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfQueryResult.html)\n\n\n\n#### Syntax\n\nsetMemLimitOfQueryResult(memLimit)\n\n#### Details\n\nSet the memory limit for the result of each query online. This command can only be executed by an administrator on a data node or compute node.\n\n**Note:**\n\nThe modified configuration will expire after the cluster is rebooted. To make it permanent, please specify the configuration parameter *memLimitOfQueryResult*.\n\nRelated function: [getMemLimitOfQueryResult](https://docs.dolphindb.com/en/Functions/g/getMemLimitOfQueryResult.html)\n\n#### Parameters\n\n**memLimit** is a numeric scalar, indicating the memory limit (in GB). It must be smaller than smaller than 80% \\* *maxMemSize*.\n"
    },
    "setMemLimitOfTaskGroupResult": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMemLimitOfTaskGroupResult.html",
        "signatures": [
            {
                "full": "setMemLimitOfTaskGroupResult(memLimit)",
                "name": "setMemLimitOfTaskGroupResult",
                "parameters": [
                    {
                        "full": "memLimit",
                        "name": "memLimit"
                    }
                ]
            }
        ],
        "markdown": "### [setMemLimitOfTaskGroupResult](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfTaskGroupResult.html)\n\n\n\n#### Syntax\n\nsetMemLimitOfTaskGroupResult(memLimit)\n\n#### Details\n\nSet the memory limit of a task group sent from the current node online. This command can only be executed by an administrator on a data node or compute node.\n\n**Note:**\n\nThe modified configuration will expire after the cluster is rebooted. To make it permanent, please specify the configuration parameter *memLimitOfTaskGroupResult*.\n\nRelated function: [getMemLimitOfTaskGroupResult](https://docs.dolphindb.com/en/Functions/g/getMemLimitOfTaskGroupResult.html)\n\n#### Parameters\n\n**memLimit** is a numeric scalar, indicating the memory limit (in GB).\n"
    },
    "setMemLimitOfTempResult": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setMemLimitOfTempResult.html",
        "signatures": [
            {
                "full": "setMemLimitOfTempResult(X)",
                "name": "setMemLimitOfTempResult",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [setMemLimitOfTempResult](https://docs.dolphindb.com/en/Functions/s/setMemLimitOfTempResult.html)\n\n\n\n#### Syntax\n\nsetMemLimitOfTempResult(X)\n\n#### Details\n\nModifies the upper limit of memory usage (in GB) for each temporary result generated during a table join operation. It can only be executed by an administrator on a data node or compute node.\n\n**Note:**\n\nThe modified configuration will expire after the cluster is rebooted. To make it permanent, please change the configuration parameter *memLimitOfTempResult*.\n\n#### Parameters\n\n**X** is a positive number that is no greater than *maxMemSize*.\n"
    },
    "setOLAPCacheEngineSize": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setOLAPCacheEngineSize.html",
        "signatures": [
            {
                "full": "setOLAPCacheEngineSize(memSize)",
                "name": "setOLAPCacheEngineSize",
                "parameters": [
                    {
                        "full": "memSize",
                        "name": "memSize"
                    }
                ]
            }
        ],
        "markdown": "### [setOLAPCacheEngineSize](https://docs.dolphindb.com/en/Functions/s/setOLAPCacheEngineSize.html)\n\n\n\n#### Syntax\n\nsetOLAPCacheEngineSize(memSize)\n\nAlias: setCacheEngineMemSize\n\n#### Details\n\nModify the capacity of the OLAP cache engine online. In a cluster, this command can only be executed by the admin on a data node. Please make sure the cache engine is enabled by specifying configuration parameter *chunkCacheEngineMemSize* before execution.\n\n* Scenario: If the cache engine is enabled, the system will first write the data to the cache. Only when the amount of cached data reaches 30% of *chunkCacheEngineMemSize* will it be written to disk. If the configuration parameter is set too low, massive concurrent writes may take up the cache engine capacity quickly and cause the writing process stuck. In this case, execute the command to online modify the cache engine capacity to ensure that the writes continue.\n\n* You can obtain the real-time status of the cache engine with function `getOLAPCacheEngineSize` to check if the modification takes effect online.\n\n**Note:**\n\nThe modified configuration will expire after the cluster is rebooted. To make it permanent, please change the configuration parameter *chunkCacheEngineMemSize*.\n\nRelated function: [getOLAPCacheEngineSize](https://docs.dolphindb.com/en/Functions/g/getOLAPCacheEngineSize.html)\n\n#### Parameters\n\n**memSize** is a numeric scalar (in GB). It must be greater than 0 and less than *maxMemSize* \\* 0.5.\n"
    },
    "setOrcaCheckpointConfig": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setOrcaCheckpointConfig.html",
        "signatures": [
            {
                "full": "setOrcaCheckpointConfig(name, configMap)",
                "name": "setOrcaCheckpointConfig",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "configMap",
                        "name": "configMap"
                    }
                ]
            }
        ],
        "markdown": "### [setOrcaCheckpointConfig](https://docs.dolphindb.com/en/Functions/s/setOrcaCheckpointConfig.html)\n\n\n\n#### Syntax\n\nsetOrcaCheckpointConfig(name, configMap)\n\n#### Details\n\nDynamically modify the checkpoint configuration.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**configMap** is a dictionary specifying the detailed configuration. The keys and their settings are as shown in the table below.\n\n| key                      | Description                                                                                                                                       | Value Range                 | Default    |\n| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ---------- |\n| enable                   | Whether to enable Checkpoint                                                                                                                      | true/false                  | false      |\n| interval                 | Time interval to trigger Checkpoint, in milliseconds                                                                                              | \\[10 seconds, 1 year]       | 1 hour     |\n| timeout                  | Timeout for Checkpoint. If Checkpoint is not completed within the specified time, it will be considered failed, in milliseconds                   | \\[1 second, 1 hour]         | 10 minutes |\n| alignedTimeout           | Timeout for Barrier alignment. If alignment is not completed within the specified time, the Checkpoint will be considered failed, in milliseconds | \\[100 milliseconds, 1 hour] | 10 minutes |\n| minIntervalBetweenCkpt   | Minimum time interval between the completion of the last Checkpoint and the initiation of the next Checkpoint                                     | \\[0, 1 year]                | 0          |\n| consecutiveFailures      | Maximum number of consecutive Checkpoint failures. If exceeded, the status of the entire streaming graph will be switched to ERROR.               | \\[0, 102400]                | 3          |\n| maxConcurrentCheckpoints | Maximum number of concurrent Checkpoints allowed. Please note that allowing concurrent Checkpoints may impact running streaming jobs.             | \\[1, 102400]                | 1          |\n| maxRetainedCheckpoints   | The system will periodically clean up historical Checkpoint data. This parameter sets the maximum number of latest Checkpoints to retain.         | \\[1, 1024]                  | 3          |\n\n#### Examples\n\n```\nckptConfig = {\n    \"enable\":true,\n    \"interval\": 10000,\n    \"timeout\": 36000,\n    \"maxConcurrentCheckpoints\": 1\n};\nsetOrcaCheckpointConfig(\"streamGraph1\", ckptConfig)\n```\n"
    },
    "setPrefetchComputeNodeData": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setPrefetchComputeNodeData.html",
        "signatures": [
            {
                "full": "setPrefetchComputeNodeData(flag)",
                "name": "setPrefetchComputeNodeData",
                "parameters": [
                    {
                        "full": "flag",
                        "name": "flag"
                    }
                ]
            }
        ],
        "markdown": "### [setPrefetchComputeNodeData](https://docs.dolphindb.com/en/Functions/s/setPrefetchComputeNodeData.html)\n\n\n\n#### Syntax\n\nsetPrefetchComputeNodeData(flag)\n\n#### Details\n\nModify the value of *enableComputeNodePrefetchData* online. This function can only be executed by an administrator on the controller.\n\n**Note:** The modified configuration is only valid for the current node, and will expire after the system restarts. To make it permanent, please set the configuration parameter *enableComputeNodePrefetchData.*\n\n#### Parameters\n\n**flag**is a Boolean value.\n\n#### Examples\n\n```\nsetPrefetchComputeNodeData(false) \n```\n\n**Related Function**: [getPrefetchComputeNodeData](https://docs.dolphindb.com/en/Functions/g/getPrefetchComputeNodeData.html)\n"
    },
    "setRaftElectionTick": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setRaftElectionTick.html",
        "signatures": [
            {
                "full": "setRaftElectionTick(groupId, tickCount)",
                "name": "setRaftElectionTick",
                "parameters": [
                    {
                        "full": "groupId",
                        "name": "groupId"
                    },
                    {
                        "full": "tickCount",
                        "name": "tickCount"
                    }
                ]
            }
        ],
        "markdown": "### [setRaftElectionTick](https://docs.dolphindb.com/en/Functions/s/setRaftElectionTick.html)\n\n\n\n#### Syntax\n\nsetRaftElectionTick(groupId, tickCount)\n\n#### Details\n\nUse this command to dynamically set the configuration parameter *raftElectionTick*. *tickCount* specifies a time interval: \\[*tickCount*, 2\\**tickCount*]. After receiving the last heartbeat from the leader, if a follower does not receive the next heartbeat after a random waiting time within the specified interval, it will send a request for leader election.\n\n**Note:**\n\n* The command must be executed by the admin on all controllers within a raft group, please make sure that they all share the same *raftElectionTick* value.\n\n* The command will not modify the configuration parameter *raftElectionTick*. It will restore to the default or specified value after the server restarts.\n\nRelated Functions: [getRaftElectionTick](https://docs.dolphindb.com/en/Functions/g/getRaftElectionTick.html), [getControllerElectionTick](https://docs.dolphindb.com/en/Functions/g/getControllerElectionTick.html)\n\n#### Parameters\n\n**groupId** is a positive integer indicating the raft group ID. Currently it can only be 1, referring to the ID of the raft group composed of controllers.\n\n**tickCount** is an integer no less than 800 (in 10ms).\n"
    },
    "setRandomSeed": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setRandomSeed.html",
        "signatures": [
            {
                "full": "setRandomSeed(seed)",
                "name": "setRandomSeed",
                "parameters": [
                    {
                        "full": "seed",
                        "name": "seed"
                    }
                ]
            }
        ],
        "markdown": "### [setRandomSeed](https://docs.dolphindb.com/en/Functions/s/setRandomSeed.html)\n\n\n\n#### Syntax\n\nsetRandomSeed(seed)\n\n#### Details\n\nSet the random seed.\n\n#### Parameters\n\n**seed** is an integer indicating the random seed.\n\n#### Examples\n\n```\nsetRandomSeed(5);\nrand(10, 10);\n// output: [2,0,8,8,2,3,9,9,4,0]\n```\n"
    },
    "setReservedMemSize": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setReservedMemSize.html",
        "signatures": [
            {
                "full": "setReservedMemSize(memSizeGB)",
                "name": "setReservedMemSize",
                "parameters": [
                    {
                        "full": "memSizeGB",
                        "name": "memSizeGB"
                    }
                ]
            }
        ],
        "markdown": "### [setReservedMemSize](https://docs.dolphindb.com/en/Functions/s/setReservedMemSize.html)\n\n\n\n#### Syntax\n\nsetReservedMemSize(memSizeGB)\n\n#### Details\n\nModify the reserved memory allocated to DolphinDB online. This command can only be executed by the admin.\n\n**Note:**\n\n* The modified configuration will expire after the cluster is rebooted. To make it permanent, please change the configuration parameter *reservedMemSize*.\n* The total of the reserved memory (configured via *reservedMemSize*) and the emergency memory (configured via *emergencyMemSize*or dynamically adjusted using `setMaxMemSize`) must not exceed 50% of the current maximum memory limit, which is set via *maxMemSize*or adjusted dynamically using `setMaxMemSize`.\n\n#### Parameters\n\n**memSizeGB** is a numeric scalar (in GB). It is greater than 0 and less than *maxMemSize* \\* 0.5.\n"
    },
    "setRetentionPolicy": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setRetentionPolicy.html",
        "signatures": [
            {
                "full": "setRetentionPolicy(dbHandle, retentionHours, [retentionDimension], [hoursToColdVolume])",
                "name": "setRetentionPolicy",
                "parameters": [
                    {
                        "full": "dbHandle",
                        "name": "dbHandle"
                    },
                    {
                        "full": "retentionHours",
                        "name": "retentionHours"
                    },
                    {
                        "full": "[retentionDimension]",
                        "name": "retentionDimension",
                        "optional": true
                    },
                    {
                        "full": "[hoursToColdVolume]",
                        "name": "hoursToColdVolume",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [setRetentionPolicy](https://docs.dolphindb.com/en/Functions/s/setRetentionPolicy.html)\n\n\n\n#### Syntax\n\nsetRetentionPolicy(dbHandle, retentionHours, \\[retentionDimension], \\[hoursToColdVolume])\n\n#### Details\n\nSet 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.\n\nBoth 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.\n\nThe system will keep the data with the timestamp of the temporal partitioning column within the last *retentionHours* based on the system time: Data of the last *hoursToColdVolume* are stored in volumes; Data in \\[current time - *hoursToColdVolumes* - 10 days, 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.\n\nFor 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`.\n\n**Note:**\n\nThe function is only applied to a DFS database.\n\n#### Parameters\n\n**dbHandle** is a database handle. The data type of at least one of the partitioning columns of the database must be DATE or DATEHOUR.\n\n**retentionHours** is a positive integer indicating the number of hours that data are kept.\n\n**retentionDimension** (optional) 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.\n\n**hoursToColdVolume** (optional) 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.\n\n**Note:**\n\nMake sure that *retentionHours* - *hoursToColdVolume* > 7 \\* 24 (7 days).\n\n#### Examples\n\n```\ndb=database(\"dfs://db1\",VALUE,2019.06.01..date(now()))\nretentionHour=9*24\nhoursToColdVolume=1*24\nsetRetentionPolicy(db,retentionHour,0, hoursToColdVolume);\n\nschema(db);\n/* output:\npartitionSchema->[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,...]\npartitionSites->\npartitionTypeName->VALUE\nhoursToColdVolume->24\natomic->TRANS\ndatabaseDir->dfs://db1\nengineType->OLAP\nchunkGranularity->TABLE\nretentionDimension->0\npartitionType->1\nretentionHours->216\n*/\n```\n"
    },
    "setSessionExpiredTime": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setsessionexpiredtime.html",
        "signatures": [
            {
                "full": "setSessionExpiredTime(expire)",
                "name": "setSessionExpiredTime",
                "parameters": [
                    {
                        "full": "expire",
                        "name": "expire"
                    }
                ]
            }
        ],
        "markdown": "### [setSessionExpiredTime](https://docs.dolphindb.com/en/Functions/s/setsessionexpiredtime.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nsetSessionExpiredTime(expire)\n\n#### Details\n\nSet the maximum duration of session when strict security policy is enabled (see configuration parameter *strictSecurityPolicy*). It can only be executed by an administrator.\n\n#### Parameters\n\n**expire** is a DURATION scalar indicating the session duration.\n\n#### Examples\n\n```\nsetSessionExpiredTime(3600s)  // set session duration to 1 hour\ngetSessionExpiredTime() // output: 1H\n```\n"
    },
    "setStreamTableFilterColumn": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setStreamTableFilterColumn.html",
        "signatures": [
            {
                "full": "setStreamTableFilterColumn(streamTable, columnName)",
                "name": "setStreamTableFilterColumn",
                "parameters": [
                    {
                        "full": "streamTable",
                        "name": "streamTable"
                    },
                    {
                        "full": "columnName",
                        "name": "columnName"
                    }
                ]
            }
        ],
        "markdown": "### [setStreamTableFilterColumn](https://docs.dolphindb.com/en/Functions/s/setStreamTableFilterColumn.html)\n\n\n\n#### Syntax\n\nsetStreamTableFilterColumn(streamTable, columnName)\n\n#### Details\n\nSpecify the filtering column of a stream table. It is related to parameter *filter* in function [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html) The value of parameter *filter* is a vector. Only the rows with values of the filtering column in *filter* are published to the subscriber. A stream table can have only one filtering column.\n\n#### Parameters\n\n**streamTable** is a stream table object.\n\n**columnName** is a string indicating a column name. The column must be of type SYMBOL, STRING or INT.\n\n#### Examples\n\nIn the following example, the filter column of the stream table \"trades\" is \"symbol\". The table \"trades\\_slave\" on the same node subscribes to \"trades\" and the filter is set to \\[\"IBM\", \"GOOG\"]. Only when the column \"symbol\" is \"IBM\" or \"GOOG\", the corresponding data will be published.\n\n```\nshare streamTable(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT]) as trades\nsetStreamTableFilterColumn(trades, `symbol)\ntrades_1=table(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT])\n\nfilter=symbol(`IBM`GOOG)\n\nsubscribeTable(tableName=`trades, actionName=`trades_1, handler=append!{trades_1}, msgAsTable=true, filter=filter);\n```\n\nFor range filtering, the filter value is a pair. The streaming table trades on the publisher side only publishes data where price is greater than or equal to 1 and less than 100:\n\n```\nshare streamTable(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT]) as trades\nsetStreamTableFilterColumn(trades, `price)\ntrades_1=table(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT])\n\nsubscribeTable(tableName=\"trades\", actionName=\"trades_1\", handler=append!{trades_1}, msgAsTable=true, filter=1:100)\n```\n\nFor hash filtering, the filter value is a tuple. The streaming table trades on the publisher side applies a hash function to the symbol column to divide the data into 10 buckets (with bucket indices starting from 0), and only publishes data with bucket indices greater than or equal to 1 and less than 5:\n\n```\nshare streamTable(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT]) as trades\nsetStreamTableFilterColumn(trades, `symbol)\ntrades_1=table(10000:0,`time`symbol`price, [TIMESTAMP,SYMBOL,INT])\n\nsubscribeTable(tableName=\"trades\", actionName=\"trades_1\", handler=append!{trades_1}, msgAsTable=true, filter=(10,1:5))\n```\n"
    },
    "setStreamTableTimestamp": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setStreamTableTimestamp.html",
        "signatures": [
            {
                "full": "setStreamTableTimestamp(streamTable, columnName)",
                "name": "setStreamTableTimestamp",
                "parameters": [
                    {
                        "full": "streamTable",
                        "name": "streamTable"
                    },
                    {
                        "full": "columnName",
                        "name": "columnName"
                    }
                ]
            }
        ],
        "markdown": "### [setStreamTableTimestamp](https://docs.dolphindb.com/en/Functions/s/setStreamTableTimestamp.html)\n\n\n\n#### Syntax\n\nsetStreamTableTimestamp(streamTable, columnName)\n\n#### Details\n\nSet a time column for the stream table for recording the ingestion time of each message. The system will attach the system time of data ingestion to the column each time data is written. This helps users to measure the delay when writing real-time stream to the stream table.\n\n**Note:**\n\n* The timestamp column cannot be changed or revoked once set.\n* Tables that have been configured using this function cannot serve as the output table for a streaming engine.\n\n#### Parameters\n\n**streamTable**can be a regular, shared, persisted or HA stream table.\n\n**columnName**is a string indicating the name of the last column of the table. It must be a time column that records the system time when the message is inserted to the stream table.\n\n#### Examples\n\n```\nshare streamTable(10000:0,`time`symbol`price`timestamp, [TIMESTAMP,SYMBOL,DOUBLE,TIMESTAMP]) as trades\n// set the timestamp column for trades\nsetStreamTableTimestamp(trades, `timestamp)\n\n// insert a record and the timestamp column is automatically added\ninsert into trades values(2023.03.19T03:17:49, `A, 10.2)\n\nselect * from trades\n```\n\n| time                    | symbol | price | timestamp               |\n| ----------------------- | ------ | ----- | ----------------------- |\n| 2023.03.19 03:17:49.000 | A      | 10.2  | 2024.03.31 08:01:31.324 |\n\n```\n// HA stream table\ncolNames = `timestamp`sym`qty`price\ncolTypes = [TIMESTAMP,SYMBOL,INT,DOUBLE]\nt=table(1:0,colNames,colTypes)\nhaStreamTable(2,t,`trades,100000);\nsetStreamTableTimestamp(trades, `timestamp)\n```\n"
    },
    "setSystem": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setSystem.html",
        "signatures": [
            {
                "full": "setSystem(paramName, paramValue)",
                "name": "setSystem",
                "parameters": [
                    {
                        "full": "paramName",
                        "name": "paramName"
                    },
                    {
                        "full": "paramValue",
                        "name": "paramValue"
                    }
                ]
            }
        ],
        "markdown": "### [setSystem](https://docs.dolphindb.com/en/Functions/s/setSystem.html)\n\n\n\n#### Syntax\n\nsetSystem(paramName, paramValue)\n\n#### Details\n\nSet the following system-wide parameters:\n\n* the maximum number of rows to display for an object in console\n\n* the maximum width of a row to display for an object in console\n\n**Note:** Administrator priviledges are required.\n\n#### Parameters\n\n**paramName** is a string indicating the parameter name.\n\n**paramValue** is the corresponding parameter value.\n\n#### Examples\n\n```\nsetSystem(\"rows\", 30);\nsetSystem(\"width\", 200);\n```\n"
    },
    "setTableComment": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setTableComment.html",
        "signatures": [
            {
                "full": "setTableComment(table, comment)",
                "name": "setTableComment",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "comment",
                        "name": "comment"
                    }
                ]
            }
        ],
        "markdown": "### [setTableComment](https://docs.dolphindb.com/en/Functions/s/setTableComment.html)\n\n\n\n#### Syntax\n\nsetTableComment(table, comment)\n\n#### Details\n\nAdd comments to a DFS table. Use function [schema](https://docs.dolphindb.com/en/Functions/s/schema.html) to view table comments.\n\n#### Parameters\n\n**table** is a DFS table.\n\n**comment** is a STRING scalar for table comment, limited to 4096 bytes.\n\n#### Examples\n\n```\n// create a DFS table\ndb = database(directory=\"dfs://testDB\", partitionType=VALUE, partitionScheme=1..5)\nschemaTB = table(1..5 as id, take(`A`B`C,5) as sym, rand(10.0,5) as price)\npt = db.createPartitionedTable(table=schemaTB, tableName=\"pt\", partitionColumns=\"id\")\n// add comment \"my first pt\" to table pt\nsetTableComment(table=pt, comment=\"my first pt\")\n// check the comment with function schema\nschema(pt)[\"tableComment\"]\n// output: 'my first pt'\n```\n"
    },
    "setTableSensitiveColumn": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setTableSensitiveColumn.html",
        "signatures": [
            {
                "full": "setTableSensitiveColumn(table, colName, option, [func])",
                "name": "setTableSensitiveColumn",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "colName",
                        "name": "colName"
                    },
                    {
                        "full": "option",
                        "name": "option"
                    },
                    {
                        "full": "[func]",
                        "name": "func",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [setTableSensitiveColumn](https://docs.dolphindb.com/en/Functions/s/setTableSensitiveColumn.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nsetTableSensitiveColumn(table, colName, option, \\[func])\n\n#### Details\n\nThis function sets or unsets *colName* in *table* as a sensitive column.\n\nOnce the column is marked as sensitive, only the creator of the table, administrators, and users with the `DB_SENSITIVE_VIEW` or `TABLE_SENSITIVE_VIEW` permissions can access the plaintext data of that column. Other users can only access the data that has been de-sensitized by *func*.\n\n#### Parameters\n\n**table** is a DFS table object.\n\n**colName** is a STRING scalar indicating a column name.\n\n**option**is a Boolean value. true indicates that *colName* will be set as a sensitive column, and false means that the column will no longer be treated as sensitive.\n\n**func**(optional) is a unary function that defines the desensitization algorithm. It can only be specified when *option* is true. The default algorithm is nullification masking. If different types need to be handled, the func should define the processing logic for each type.\n\n#### Examples\n\n```\n// create database and partitioned table\nlogin(`admin,`123456)\ndb = database(directory=\"dfs://sensitive\", partitionType=VALUE, partitionScheme=1..5)\nt = table(1..5 as tag, [\"John\",\"Emily\",\"Michael\",\"James\",\"Tommy\"] as userId, format(rand(100000,5),\"000000\") as password)\npt = createPartitionedTable(dbHandle=db, table=t, tableName=\"pt\", partitionColumns=\"tag\")\npt.tableInsert(t)\n\n// set sensitive columns\ndef encryptId(str){\n    return str[0]+\"******\"\n}\nsetSensitiveColumn(table=loadTable(\"dfs://sensitive\",\"pt\"), colName=\"userId\", option=true, func=encryptId)\n\ndef encryptPw(str) {\n    return regexReplace(str, \"[0-9]+\", \"#\")\n}\nsetSensitiveColumn(table=loadTable(\"dfs://sensitive\",\"pt\"), colName=\"password\", option=true, func=encryptPw)\n\n// create user1\ncreateUser(`user1,`123456)\ngrant(userId=user1, accessType=TABLE_READ, objs=\"dfs://sensitive/pt\")\n\n// user1 reads the desensitized data\nlogin(`user1,`123456)\nselect * from loadTable(\"dfs://sensitive\",\"pt\")\n\n// grant TABLE_SENSITIVE_VIEW permission to user1\nlogin(`admin,`123456)\ngrant(userId=user1, accessType=TABLE_SENSITIVE_VIEW, objs=\"dfs://sensitive/pt\")\n\n// user1 reads plaintext data\nlogin(`user1,`123456)\nselect * from loadTable(\"dfs://sensitive\",\"pt\")\n```\n"
    },
    "setTimeoutTick": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setTimeoutTick.html",
        "signatures": [
            {
                "full": "setTimeoutTick(tick)",
                "name": "setTimeoutTick",
                "parameters": [
                    {
                        "full": "tick",
                        "name": "tick"
                    }
                ]
            }
        ],
        "markdown": "### [setTimeoutTick](https://docs.dolphindb.com/en/Functions/s/setTimeoutTick.html)\n\n\n\n#### Syntax\n\nsetTimeoutTick(tick)\n\nAlias: setDfsChunkNodeHeartBeatTimeoutTick\n\n#### Details\n\nDynamically modify the timeout period for the controller to receive a data node's heartbeat. If the heartbeat is not received within the specified period, the node is considered as offline. This command can only be executed by the admin on the controller. For a high availability cluster, it must be executed on all controllers within the raft group.\n\n**Note:**\n\nThe modified configuration will expire after the cluster is rebooted. To make it permanent, please change the configuration parameter *dfsChunkNodeHeartBeatTimeout*.\n\n#### Parameters\n\n**tick** is a positive integer (in seconds) that indicates the timeout period.\n"
    },
    "setTSDBCacheEngineSize": {
        "url": "https://docs.dolphindb.com/en/Functions/s/setTSDBCacheEngineSize.html",
        "signatures": [
            {
                "full": "setTSDBCacheEngineSize(memSize)",
                "name": "setTSDBCacheEngineSize",
                "parameters": [
                    {
                        "full": "memSize",
                        "name": "memSize"
                    }
                ]
            }
        ],
        "markdown": "### [setTSDBCacheEngineSize](https://docs.dolphindb.com/en/Functions/s/setTSDBCacheEngineSize.html)\n\n#### Syntax\n\nsetTSDBCacheEngineSize(memSize)\n\n#### Details\n\nModify the capacity of the TSDB cache engine online. In a cluster, this command can only be executed by the admin on the data node or compute node. Please make sure the cache engine is enabled by specifying configuration parameter *TSDBCacheEngineSize* before execution. You can obtain the real-time status of the TSDB cache engine with function `getTSDBCacheEngineSize` to check if the modification takes effect online.\n\n**Note:**\n\nThe modified configuration will expire after the cluster is rebooted. To make it permanent, please change the configuration parameter *TSDBCacheEngineSize*.\n\nSince version 2.00.16/3.00.3, when the cache engine memory usage reaches the set value of *TSDBCacheEngineSize*, the system will block the writes. In earlier versions, memory usage could exceed the set value by up to twice under extreme conditions.\n\nFor more details, refer to the [*TSDBCacheEngineSize* configuration setting description](https://docs.dolphindb.com/en/Database/Configuration/reference.md#).\n\nRelated function: [getTSDBCacheEngineSize](https://docs.dolphindb.com/en/Functions/g/getTSDBCacheEngineSize.html).\n\n#### Parameters\n\n**memSize** is a numeric scalar (in GB). It is greater than 0 and less than *maxMemSize* \\* 0.5.\n\n"
    },
    "seuclidean": {
        "url": "https://docs.dolphindb.com/en/Functions/s/seuclidean.html",
        "signatures": [
            {
                "full": "seuclidean(X, Y, Z)",
                "name": "seuclidean",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "Z",
                        "name": "Z"
                    }
                ]
            }
        ],
        "markdown": "### [seuclidean](https://docs.dolphindb.com/en/Functions/s/seuclidean.html)\n\nFirst introduced in version: 2.00.183.00.5, 3.00.4.3\n\n\n\n#### Syntax\n\nseuclidean(X, Y, Z)\n\n#### Details\n\nCompute the standardized Euclidean distance between two numeric vectors (X and Y). X and Y are first standardized using Z, and then [euclidean](https://docs.dolphindb.com/en/Functions/e/euclidean.html) is called. The distance is defined as follows:\n\n![](https://docs.dolphindb.com/en/images/seuclidean.png)\n\n#### Parameters\n\n**X:** A numeric vector.\n\n**Y:** A numeric vector.\n\n**Z:** A numeric vector representing the variance of each dimension, used for standardization.\n\n**Note:**\n\n*X*, *Y*, and *Z* must have the same length.\n\n#### Returns\n\nA scalar of type DOUBLE.\n\n#### Examples\n\n```\nX = [2, 5]\nY = [3, 7]\nZ = [1, 2]\n\nseuclidean(X, Y, Z)\n// Output: 1.7320508075688772\n```\n\n**Related functions**\n\n[euclidean](https://docs.dolphindb.com/en/Functions/e/euclidean.html), [minkowski](https://docs.dolphindb.com/en/Functions/m/minkowski.html), [mahalanobis](https://docs.dolphindb.com/en/Functions/m/mahalanobis.html)\n"
    },
    "shape": {
        "url": "https://docs.dolphindb.com/en/Functions/s/shape.html",
        "signatures": [
            {
                "full": "shape(X)",
                "name": "shape",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [shape](https://docs.dolphindb.com/en/Functions/s/shape.html)\n\n\n\n#### Syntax\n\nshape(X)\n\n#### Details\n\nReturns the dimension of a scalar/vector/matrix as a PAIR.\n\n**Note:**\n\nDolphinDB `shape` provides the same core functionality as [numpy.shape](https://numpy.org/doc/stable/reference/generated/numpy.shape.html). The differences are as follows:\n\n* DolphinDB `shape` returns a dimension pair in the form `rows:columns` to describe an object. It returns1:1for a scalar, `length:1` for a vector, and `rows:columns` for a matrix or table.\n* `numpy.shape` returns a tuple that gives the length of each array dimension. It returns `()` for a scalar, `(n,)` for a one-dimensional array, and `(m, n)` for a two-dimensional array.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nAn INT PAIR scalar.\n\n#### Examples\n\nDimension of a scalar is 1 by 1:\n\n```\nshape 6;\n// output: 1:1\n\ns;\n```\n\nDimension of a vector is the length of the vector by 1:\n\n```\nshape 1 5 3 7 8;\n// output: 5:1\n```\n\nDimension of a matrix:\n\n```\nm=(5 3 1 4 9 10)$3:2;\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 5  | 4  |\n| 3  | 9  |\n| 1  | 10 |\n\n```\nshape m;\n// output: 3 :2\n```\n\nDimension of a table:\n\n```\nt=table(1 2 3 as x, 4 5 6 as y);\nt;\n```\n\n| x | y |\n| - | - |\n| 1 | 4 |\n| 2 | 5 |\n| 3 | 6 |\n\n```\nshape t;\n// output: 3 :2\n```\n"
    },
    "shapiroTest": {
        "url": "https://docs.dolphindb.com/en/Functions/s/shapiroTest.html",
        "signatures": [
            {
                "full": "shapiroTest(X)",
                "name": "shapiroTest",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [shapiroTest](https://docs.dolphindb.com/en/Functions/s/shapiroTest.html)\n\n\n\n#### Syntax\n\nshapiroTest(X)\n\n#### Details\n\nConduct a Shapiro-Wilk test on *X*. Return a dictionary with the following keys:\n\n* method : \"Shapiro-Wilk normality test\"\n\n* pValue : p-value of the test\n\n* W : W-stat\n\n#### Parameters\n\n**X** is a numeric vector indicating the sample for the test.\n\n#### Returns\n\nA dictionary containing the following keys: method, pValue, and W.\n\n#### Examples\n\n```\nx = norm(0.0, 1.0, 50)\nshapiroTest(x);\n\n/* output:\nmethod->Shapiro-Wilk normality test\npValue->0.621668\nW->0.981612\n*/\n```\n"
    },
    "share": {
        "url": "https://docs.dolphindb.com/en/Functions/s/share.html",
        "signatures": [
            {
                "full": "share(table, sharedName, [database], [dbName], [partitionColumn], [readonly=false])",
                "name": "share",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "sharedName",
                        "name": "sharedName"
                    },
                    {
                        "full": "[database]",
                        "name": "database",
                        "optional": true
                    },
                    {
                        "full": "[dbName]",
                        "name": "dbName",
                        "optional": true
                    },
                    {
                        "full": "[partitionColumn]",
                        "name": "partitionColumn",
                        "optional": true
                    },
                    {
                        "full": "[readonly=false]",
                        "name": "readonly",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [share](https://docs.dolphindb.com/en/Functions/s/share.html)\n\n\n\n#### Syntax\n\nshare(table, sharedName, \\[database], \\[dbName], \\[partitionColumn], \\[readonly=false])\n\n#### Details\n\nIf only *table* and *sharedName* are specified:\n\n* When *table* is a table, it is shared across all sessions with the specified shared name. Local objects including tables are invisible to other sessions. They need to be shared before they are visible to other sessions. The shared name must be different from all regular table names on all sessions. Data of a shared stream table cannot be deleted or updated, but data of a shared table (created with `table` or `mvccTable`) can be deleted or updated. Data inserts are allowed on all types of shared tables.\n\n* When *table* is a streaming engine, a lock is applied to the engine to allow concurrent writes.\n\nIf all 5 parameters are used: populate a shard of a distributed table and share it across all sessions with a shared name. The sharding is based on the given partitioning column. Multiple `share` statements are used together to save a DFS table on multiple nodes.\n\nThe rows of a shared stream table cannot be updated or deleted. In comparison, the rows of other shared tables can be updated or deleted.\n\nNote that it is not allowed to share a stream table multiple times by modifying the shared table name.\n\n#### Parameters\n\n**table** is the table or engine to be shared across all sessions.\n\n**sharedName** is a string indicating the name to be used to refer to the shared table across all sessions, or the name of the DFS table to be shared.\n\n**database** (optional) is a database handle. When it is defined by the function [database](https://docs.dolphindb.com/en/Functions/d/database.html), it specifies the location of each partition.\n\n**dbName** (optional) is a string indicating the distributed database name.\n\n**partitionColumn** (optional) is the partitioning column of the DFS table.\n\n**readonly** (optional) is a Boolean value indicating whether to share an ordinary/keyed/indexed in-memory table as a readonly table to improve query performance. The default value is false.\n\n#### Examples\n\nExample 1: Use the `share` function to convert an in-memory table into a globally accessible shared table, allowing all sessions on the current node to access it. This is the fundamental mechanism for cross-session data sharing in DolphinDB.\n\n```\nshare(t, `sharedT);\nshare(t, `quotes, tickDB, `tickDB, `date);\n```\n\nExample 2: Create a distributed database and table using the TSDB engine, partitioned by date and sorted by time. Then use `share` to expose the table handle for shared access.\n\n```\n// Share a DFS table loaded by loadTable\nCREATE DATABASE \"dfs://valuedb\" PARTITIONED BY VALUE(2023.01.01..2023.12.31),engine=\"TSDB\"\nCREATE TABLE \"dfs://valuedb\".\"pt\"(\n    date DATE,\n    time TIME,\n    sym SYMBOL,\n    price DOUBLE\n)\nPARTITIONED BY date,\nsortColumns=`time\n\nshare(loadTable(\"dfs://valuedb\", \"pt\"), `pt)\n```\n\nExample 3: Create a streaming table as input, define an output table and share it, and then create a reactive state engine for real-time computation. Use the `go` statement to ensure that dynamically registered variables can be correctly referenced by subsequent code.\n\n```\ntrades = streamTable(1:0, `time`sym`price, [TIMESTAMP, SYMBOL, DOUBLE])\nshare table(100:0, `sym`time`factor1, [SYMBOL, TIMESTAMP, DOUBLE]) as outputTable\nengine = createReactiveStateEngine(name=\"test\", metrics=[<time>, <mavg(price, 3)>], dummyTable=trades, outputTable=outputTable, keyColumn=`sym)\n```\n\nExample 4: Use the `share` function to expose the reactive state engine, add a write lock to the engine, and allow all sessions on the current node to write to it concurrently.\n\n```\n// share engine\nshare(engine, \"test\")\n\n// define a function write1 to write to the engine\ndef write1(mutable engine) {\n  N = 10\n  for (i in 1..500) {\n      data = table(take(now(), N) as time, take(`A`B, N) as sym, rand(10.0, N) as price)\n      engine.append!(data)\n  }\n}\n// define a function write2 to write to the engine\ndef write2(mutable engine) {\n  N = 10\n  for (i in 1..500) {\n      data = table(take(now(), N) as time, take(`C`D, N) as sym, rand(10.0, N) as price)\n      engine.append!(data)\n  }\n}\n// submit jobs to write to the engine at the same time\nsubmitJob(\"j1\", \"j1\", write1, engine)\nsubmitJob(\"j2\", \"j2\", write2, engine)\n// the number of output records is 10000, which is exactly the sum of records written by write1 and write2\nselect count(*) from outputTable\n// output: 10,000\n```\n\nRelated functions: [undef](https://docs.dolphindb.com/en/Functions/u/undef.html), [Undefine Variables](https://docs.dolphindb.com/en/Programming/Objects/Variable/UndefineVariables.html)\n"
    },
    "shell": {
        "url": "https://docs.dolphindb.com/en/Functions/s/shell.html",
        "signatures": [
            {
                "full": "shell(cmd)",
                "name": "shell",
                "parameters": [
                    {
                        "full": "cmd",
                        "name": "cmd"
                    }
                ]
            }
        ],
        "markdown": "### [shell](https://docs.dolphindb.com/en/Functions/s/shell.html)\n\n\n\n#### Syntax\n\nshell(cmd)\n\n#### Details\n\nExecute an operating system command. It can only be executed by the administrator when the configuration parameter *enableShellFunction* is set to true.\n\nCall function `system()` of the corresponding operating system. If *cmd* is successfully executed, the system will return 0. For other return values, please refer to the return values of function `system()` of the corresponding operating system.\n\n#### Parameters\n\n**cmd** is a string indicating an operating system command.\n\n#### Returns\n\nReturns 0 if *cmd* is executed successfully. For other return values, see the return values of the operating system `system()` function.\n\n#### Examples\n\n```\ncmd=\"rm -rf /home/user1/test.txt\"\nshell(cmd);\n```\n"
    },
    "short": {
        "url": "https://docs.dolphindb.com/en/Functions/s/short.html",
        "signatures": [
            {
                "full": "short(X)",
                "name": "short",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [short](https://docs.dolphindb.com/en/Functions/s/short.html)\n\n\n\n#### Syntax\n\nshort(X)\n\n#### Details\n\nConvert the input to the data type of SHORT.\n\n#### Parameters\n\n**x** can be of any data type.\n\n#### Returns\n\nA SHORT object.\n\n#### Examples\n\n```\nx=short();\nx;\n// output: 00h\n\ntypestr x;\n// output: SHORT\n\nshort(`12.3);\n// output: 12\n\nshort(`120.9c);\n// output: 120\n\nshort(32767);\n// output: 32767\n```\n\n**Note:**\n\nThe range of SHORT is \\[ -215+1, 215 -1] = \\[-32767, 32767]. If *X* exceeds this range, an overflow will occur.\n\n```\nshort(32768);\n//output: null\n\nshort(65578);\n//output: 42\n\nshort(32789)\n//output: -32747\n```\n"
    },
    "shuffle!": {
        "url": "https://docs.dolphindb.com/en/Functions/s/shuffle!.html",
        "signatures": [
            {
                "full": "shuffle!(X)",
                "name": "shuffle!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [shuffle!](https://docs.dolphindb.com/en/Functions/s/shuffle!.html)\n\n\n\n#### Syntax\n\nshuffle!(X)\n\n#### Details\n\nPlease refer to [shuffle](https://docs.dolphindb.com/en/Functions/s/shuffle.html). The only difference between `shuffle` and `shuffle!` is that the latter assigns the result to *X* and thus changing the value of *X* after the execution.\n"
    },
    "shuffle": {
        "url": "https://docs.dolphindb.com/en/Functions/s/shuffle.html",
        "signatures": [
            {
                "full": "shuffle(X)",
                "name": "shuffle",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [shuffle](https://docs.dolphindb.com/en/Functions/s/shuffle.html)\n\n\n\n#### Syntax\n\nshuffle(X)\n\n#### Details\n\nReturn a new vector/matrix after taking a shuffle on the data.\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n#### Returns\n\nA new vector or matrix after data reordering.\n\n#### Examples\n\n```\nx=(1..6).shuffle();\nx;\n// output: [1,6,3,5,4,2]\n\nx.shuffle!();\n// output: [5,4,1,3,2,6]\n\n\nx=(1..6).reshape(3:2);\nx;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nx.shuffle();\n```\n\n| #0 | #1 |\n| -- | -- |\n| 5  | 3  |\n| 2  | 1  |\n| 4  | 6  |\n"
    },
    "signbit": {
        "url": "https://docs.dolphindb.com/en/Functions/s/signbit.html",
        "signatures": [
            {
                "full": "signbit(X)",
                "name": "signbit",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [signbit](https://docs.dolphindb.com/en/Functions/s/signbit.html)\n\n\n\n#### Syntax\n\nsignbit(X)\n\n#### Details\n\nDetects the sign bit of the input value.\n\n**Note:**\n\nDolphinDB `signbit` provides the same core functionality as [numpy.signbit](https://numpy.org/doc/stable/reference/generated/numpy.signbit.html).The differences are as follows:\n\n* DolphinDB `signbit` is primarily intended for floating-point or integer scalars. For complex numbers, you can use `lowDouble` and `highDouble` to check the real and imaginary parts separately.\n* `numpy.signbit` supports element-wise computation on both scalars and arrays, and also supports additional parameters such as *out*, *where*。\n\n#### Parameters\n\n**X** is a floating-point or integer scalar.\n\n#### Returns\n\ntrue if *X* is negative, false otherwise.\n\n#### Examples\n\n```\n$ signbit('a')\nfalse\n\n$ signbit(-21)\ntrue\n\n$ signbit(-2.1)\ntrue\n\n$ b=complex(10,-5)// create a complex number\n$ b\n10.0-5.0i\n$ signbit(highDouble(b)) // detect the sign bit of the imaginary number\ntrue\n$ signbit(lowDouble(b))  // detect the sign bit of the real number\nfalse\n```\n"
    },
    "signum": {
        "url": "https://docs.dolphindb.com/en/Functions/s/signum.html",
        "signatures": [
            {
                "full": "signum(X)",
                "name": "signum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [signum](https://docs.dolphindb.com/en/Functions/s/signum.html)\n\n\n\n#### Syntax\n\nsignum(X)\n\nAlias: sign\n\n#### Details\n\nReturn 1 if *X* is positive; 0 if *X* is 0; -1 if *X* is negative; NULL if *X* is null.\n\n#### Parameters\n\n**x** is a scalar/vector/matrix of numeric or Boolean value.\n\n#### Returns\n\nReturns 1 if *X* is positive, 0 if *X* is 0, -1 if *X* is negative, and NULL if an element of *X* is NULL.\n\n#### Examples\n\n```\nsignum 1 0 -1 NULL;\n// output: [1,0,-1, ]\n```\n"
    },
    "sin": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sin.html",
        "signatures": [
            {
                "full": "sin(X)",
                "name": "sin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sin](https://docs.dolphindb.com/en/Functions/s/sin.html)\n\n\n\n#### Syntax\n\nsin(X)\n\n#### Details\n\nThe sine function.\n\n**Note:** DolphinDB's `sin` function accepts only one argument and supports calculations on scalars, vectors, and matrices. By contrast, NumPy's `sin` function is a generalized ufunc that supports N-dimensional arrays of any shape. You can control the output and apply conditional computation through parameters such as *out*and *where*.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar, vector, or matrix.\n\n#### Examples\n\n```\nsin(1 2 3);\n// output: [0.841471,0.909297,0.141120]\n```\n"
    },
    "sinh": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sinh.html",
        "signatures": [
            {
                "full": "sinh(X)",
                "name": "sinh",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sinh](https://docs.dolphindb.com/en/Functions/s/sinh.html)\n\n\n\n#### Syntax\n\nsinh(X)\n\n#### Details\n\nThe hyperbolic sine function.\n\n**Note:** DolphinDB's `sinh` function accepts only one argument and supports calculations on scalars, vectors, and matrices. By contrast, NumPy's `sinh` function is a generalized ufunc that supports N-dimensional arrays of any shape. You can control the output and apply conditional computation through parameters such as *out* and *where*.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar, vector, or matrix.\n\n#### Examples\n\n```\nsinh 1 2 3;\n// output: [1.175201,3.62686,10.017875]\n```\n"
    },
    "size": {
        "url": "https://docs.dolphindb.com/en/Functions/s/size.html",
        "signatures": [
            {
                "full": "size(X)",
                "name": "size",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [size](https://docs.dolphindb.com/en/Functions/s/size.html)\n\n\n\n#### Syntax\n\nsize(X)\n\n#### Details\n\nFor a vector/matrix, `size` returns the number of elements. In comparison, `count` returns the number of non-null elements.\n\nFor an in-memory table, `size` returns the number of rows.\n\n**Note:** DolphinDB's `size` function returns the total number of the elements in the input object: for a vector or matrix, it returns the total element count; for an in-memory table, it returns the number of rows. NumPy's `size` function returns the number of array elements along a specified axis. If you do not specify the *axis* parameter, it returns the total number of elements across all dimensions; if you do specify *axis*, it returns the number of elements along that dimension.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nAn INT scalar.\n\n#### Examples\n\n```\nsize(3 NULL 5 6);\n// output: 4\n\ncount(3 NULL 5 6);\n// output: 3\n\nm=1 2 3 NULL 4 5$2:3;\nm;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 4  |\n| 2  |    | 5  |\n\n```\nsize(m);\n// output: 6\n\ncount(m);\n// output: 5\n\nt = table(1 NULL 3 as id, 3 NULL 9 as qty);\nt;\n```\n\n| id | qty |\n| -- | --- |\n| 1  | 3   |\n|    |     |\n| 3  | 9   |\n\n```\nsize(t);\n// output: 3\n\ncount(t);\n// output: 3\n```\n"
    },
    "skew": {
        "url": "https://docs.dolphindb.com/en/Functions/s/skew.html",
        "signatures": [
            {
                "full": "skew(X, [biased=true])",
                "name": "skew",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[biased=true]",
                        "name": "biased",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [skew](https://docs.dolphindb.com/en/Functions/s/skew.html)\n\n\n\n#### Syntax\n\nskew(X, \\[biased=true])\n\n#### Details\n\nReturn the skewness of *X*. The calculation skips null values.\n\nThe calculation uses the following formulas in different cases:\n\n* When *biased*=true:\n\n  ![](https://docs.dolphindb.com/en/images/rowskewx.png)\n\n* When *biased*=false:\n\n  ![](https://docs.dolphindb.com/en/images/rowskewfalse.png)\n\nIf *X* is a matrix, calculate the skewness of each column of *X* and return a vector.\n\nIf *X* is a table, calculate the skewness of each column of *X* and return a table.\n\nThe `skew` function also supports querying partitioned tables and distributed tables with bias correction.\n\n**Note:** Both DolphinDB and SciPy calculate skewness in their `skew` functions using the Fisher-Pearson coefficient, but they differ in several respects. DolphinDB ignores NULL values during computation, while SciPy allows you control this behavior explicitly through the *nan\\_policy* parameter. SciPy also provides the *keepdims* parameter, which preserves the original array dimensions after computation.\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n**biased** (optional) is a Boolean value indicating whether the result is biased. The default value is true, meaning the bias is not corrected.\n\n#### Returns\n\nA DOUBLE scalar, vector, or table.\n\n#### Examples\n\nPlease note that as the example below uses a random number generator, the result is slightly different each time it is executed.\n\n```\nx=norm(0, 1, 1000000);\nskew(x);\n// output: -0.00124\n\nx[0]=100;\nskew(x);\n// output: 0.983656\n\nm=matrix(1..10, 1 2 3 4 5 6 7 8 9 100);\nm;\n```\n\n| #0 | #1  |\n| -- | --- |\n| 1  | 1   |\n| 2  | 2   |\n| 3  | 3   |\n| 4  | 4   |\n| 5  | 5   |\n| 6  | 6   |\n| 7  | 7   |\n| 8  | 8   |\n| 9  | 9   |\n| 10 | 100 |\n\n```\nskew(m);\n// output: [0,2.630083823883674]\n```\n"
    },
    "skipClusterReplicationTask": {
        "url": "https://docs.dolphindb.com/en/Functions/s/skipClusterReplicationTask.html",
        "signatures": [
            {
                "full": "skipClusterReplicationTask(taskIds)",
                "name": "skipClusterReplicationTask",
                "parameters": [
                    {
                        "full": "taskIds",
                        "name": "taskIds"
                    }
                ]
            }
        ],
        "markdown": "### [skipClusterReplicationTask](https://docs.dolphindb.com/en/Functions/s/skipClusterReplicationTask.html)\n\n#### Syntax\n\nskipClusterReplicationTask(taskIds)\n\n#### Details\n\nSkips the specified replication tasks (usually are those caused cluster replication failure). It can only be executed by an administrator on the controller of a slave cluster.\n\nBefore a replication task is skipped, cluster replication should be stopped (with [stopClusterReplication](https://docs.dolphindb.com/en/Functions/s/stopClusterReplication.html)). The skipped task is marked as \"finished\". After the task is skipped, you can resume the cluster replication with [startClusterReplication](https://docs.dolphindb.com/en/Functions/s/startClusterReplication.html).\n\n#### Parameters\n\n**taskIds** is a scalar or vector indicating ID of asynchronous replication tasks to be skipped. Task ID can be obtained with function [getMasterReplicationStatus](https://docs.dolphindb.com/en/Functions/g/getMasterReplicationStatus.html).\n\n#### Examples\n\n```\nskipClusterReplicationTask(1);\n```\n\nRelated functions: [startClusterReplication](https://docs.dolphindb.com/en/Functions/s/startClusterReplication.html), [stopClusterReplication](https://docs.dolphindb.com/en/Functions/s/stopClusterReplication.html)\n\n"
    },
    "sleep": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sleep.html",
        "signatures": [
            {
                "full": "sleep(X)",
                "name": "sleep",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sleep](https://docs.dolphindb.com/en/Functions/s/sleep.html)\n\n\n\n#### Syntax\n\nsleep(X)\n\n#### Details\n\nPause the application for *X* milliseconds.\n\n#### Parameters\n\n**X** is a non-negative scalar.\n\n#### Examples\n\n```\nfor(s in 1:10){\n   sleep(1000)\n   print(s+\" seconds passed.\")\n};\n\n/* output:\n1 seconds passed.\n2 seconds passed.\n3 seconds passed.\n4 seconds passed.\n5 seconds passed.\n6 seconds passed.\n7 seconds passed.\n8 seconds passed.\n9 seconds passed.\n*/\n```\n"
    },
    "slice": {
        "url": "https://docs.dolphindb.com/en/Functions/s/slice.html",
        "signatures": [
            {
                "full": "slice(obj, index)",
                "name": "slice",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "index",
                        "name": "index"
                    }
                ]
            },
            {
                "full": "slice(obj, rowIndex, [colIndex])",
                "name": "slice",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "rowIndex",
                        "name": "rowIndex"
                    },
                    {
                        "full": "[colIndex]",
                        "name": "colIndex",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [slice](https://docs.dolphindb.com/en/Functions/s/slice.html)\n\n#### Syntax\n\nslice(obj, index)\n\nor\n\nslice(obj, rowIndex, \\[colIndex])\n\nwhich is equivalent to\n\nobj\\[index] or obj\\[rowIndex, colIndex]\n\n#### Details\n\nFor `slice(obj, index)`:\n\n* If *obj* is an array vector and\n\n  * *index* is a scalar, it returns a vector indicating a column;\n\n  * *index* is a vector, it returns an array vector of selected rows;\n\n  * *index* is a pair, it returns an array vector of selected columns.\n\n* If *obj* is a matrix and\n\n  * *index* is a scalar, it returns a vector indicating a column.\n\n  * *index* is a vector or a pair, it returns a matrix of selected columns.\n\n* If obj is a table and\n\n  * *index* is a scalar, it returns a dictionary indicating a row.\n\n  * *index* is a vector or a pair, it returns a table of selected rows.\n\nFor `slice(obj, rowIndex, [colIndex])`:\n\n* If *obj* is an array vector and\n\n  * *rowIndex* and *colIndex* are both scalars, it returns a vector indicating a column;\n\n  * *rowIndex* is a scalar and *colIndex* is a pair (or vise versa), it returns an array vector of selected rows and columns;\n\n  * *rowIndex* and *colIndex* are both pair, it returns an array vector of selected rows and columns.\n\n* If *obj* is a matrix and\n\n  * *rowIndex* and *colIndex* are both scalars, it returns a scalar indicating the value of specified element of the matrix.\n\n  * *rowIndex* is a scalar and *colIndex* is a pair (or vise versa), it returns a submatrix of selected rows and columns.\n\n  * *rowIndex* and *colIndex* are both vectors or pairs, it returns a submatrix of selected rows and columns.\n\n* If *obj* is a table and\n\n  * *rowIndex* and *colIndex* are both scalars, return a scalar indicating the value of specified element of the table.\n\n  * *rowIndex* is a scalar and *colIndex* is a pair (or vise versa), it returns a table of selected rows and columns.\n\n  * *rowIndex* and *colIndex* are both vectors or pairs, it returns a table of selected rows and columns.\n\n**Note:**\n\n* To get a particular row or column from a table, consider using function `col` or `row`.\n\n* When *index*, *rowIndex* or *colIndex* specifies the index range of an array vector ora matrix, if the values are not within \\[0, size(X)-1], the corresponding results are null values.\n\n#### Parameters\n\n**obj** can be an array vector,a matrix or a table.\n\n**index**, **rowIndex** and **colIndex** can be scalar/vector/pair indicating the row or column index. If *index*, *rowIndex* or *colIndex* is a pair, it indicates the range of index which is left-closed and right-open.\n\n#### Returns\n\nA vector, array vector, matrix, or table.\n\n#### Examples\n\nIf *obj* is a matrix:\n\n```\nm=1..9$3:3\nm.slice(0);\n// output: [1,2,3]\n    \nm.slice([0]);\n```\n\n| #0 |\n| -- |\n| 1  |\n| 2  |\n| 3  |\n\n```\nm.slice(0:2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nm.slice(0 2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 7  |\n| 2  | 8  |\n| 3  | 9  |\n\n```\nm.slice(0,1);\n// output: 4\n\nm.slice(0 1,0 1);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n\n```\nm.slice(1:2,1:2);\n```\n\n| #0 |\n| -- |\n| 5  |\n\nIf *obj* is a table:\n\n```\nt=table(`A`B`C as sym,2018.01.01..2018.01.03 as date,10 48 5 as val)\nt.slice(0);\n/* output:\nval->10\ndate->2018.01.01\nsym->A\nt.slice([0]);\n*/\n```\n\n| sym | date       | val |\n| --- | ---------- | --- |\n| A   | 2018.01.01 | 10  |\n\n```\nt.slice(0 1);\n```\n\n| sym | date       | val |\n| --- | ---------- | --- |\n| A   | 2018.01.01 | 10  |\n| B   | 2018.01.02 | 48  |\n\n```\nt.slice(0:1);\n```\n\n| sym | date       | val |\n| --- | ---------- | --- |\n| A   | 2018.01.01 | 10  |\n\n```\nt.slice(0,1);\n// output: 2018.01.01\n \nt.slice(0 1,0 1);\n```\n\n| sym | date       |\n| --- | ---------- |\n| A   | 2018.01.01 |\n| B   | 2018.01.02 |\n\n```\nt.slice(1:2,1:2);\n```\n\n| date       |\n| ---------- |\n| 2018.01.02 |\n\nIf *obj* is an array vector:\n\n```\nav =array(DOUBLE[], 0, 10).append!([1.0, 2.1 4.1 6.8, 0.5 2.2 2]);\nav[1] \n// output: [,4.1,2.2]\n\nav[1,1]\n// output: [4.1]\n\nav[1:3,1:3] \n// output: [[4.1,6.8],[2.2,2]]\n```\n\n"
    },
    "sliceByKey": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sliceByKey.html",
        "signatures": [
            {
                "full": "sliceByKey(table, rowKeys, [colNames], [preserveOrder=false])",
                "name": "sliceByKey",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "rowKeys",
                        "name": "rowKeys"
                    },
                    {
                        "full": "[colNames]",
                        "name": "colNames",
                        "optional": true
                    },
                    {
                        "full": "[preserveOrder=false]",
                        "name": "preserveOrder",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [sliceByKey](https://docs.dolphindb.com/en/Functions/s/sliceByKey.html)\n\n\n\n#### Syntax\n\nsliceByKey(table, rowKeys, \\[colNames], \\[preserveOrder=false])\n\n#### Details\n\nGet the rows containing the specified values of the key columns from a keyed table or an indexed table. It is faster than the corresponding SQL statement.\n\nFor a keyed table, *rowKeys* must contain values for all key columns.\n\nFor an indexed table, *rowKeys* must contain values for the first n key columns.\n\nIf *colNames* is not specified, return all columns.\n\nThe data form of the result depends on *colNames*. If *colNames* is a scalar, return a vector; if *colNames* is a vector, return an in-memory table.\n\n#### Parameters\n\n**table** is a keyed table or indexed table.\n\n**rowKeys** is a scalar/vector indicating the specified values of key columns.\n\n**colNames** (optional) is a string scalar/vector indicating the names of columns to be selected.\n\n**preserveOrder** (optional) is a Boolean scalar indicating whether the result should maintain the input order of *rowKeys*. The default is false, meaning the output may not follow the specified order.\n\n#### Returns\n\nThe returned data structure depends on *colNames*. If *colNames* is a scalar, returns a vector. If *colNames* is a vector, returns an in-memory table.\n\n#### Examples\n\n```\nt = indexedTable(`sym`side, 10000:0, `sym`side`price`qty, [SYMBOL,CHAR,DOUBLE,INT])\ninsert into t values(`IBM`MSFT`IBM, ['B','S','S'], 125.27 208.9 125.29, 1000 800 200)\na=sliceByKey(t,\"IBM\", 'price');\n\na;\n// output: [125.27,125.29]\n\ntypestr(a);\n// output: FAST DOUBLE VECTOR\n\na=sliceByKey(t,(\"IBM\",'S'));\na;\n```\n\n| sym | side | price  | qty |\n| --- | ---- | ------ | --- |\n| IBM | S    | 125.29 | 200 |\n\n```\ntypestr(a);\n// output: IN-MEMORY TABLE\n\nt1 = keyedTable(`sym`side, 10000:0, `sym`side`price`qty, [SYMBOL,CHAR,DOUBLE,INT])\ninsert into t1 values(`IBM`MSFT`IBM, ['B','S','S'], 125.27 208.9 125.29, 1000 800 200)\nsliceByKey(t1, [[\"IBM\", \"MSFT\"], ['B', 'S']]);\n```\n\n| sym  | side | price  | qty  |\n| ---- | ---- | ------ | ---- |\n| IBM  | B    | 125.27 | 1000 |\n| MSFT | S    | 208.9  | 800  |\n\nSpecify *preserveOrder*=true to return results in the input order of the key columns.\n\n```\nsliceByKey(table=t1, rowKeys=[[\"MSFT\", \"IBM\"], ['S', 'B']], preserveOrder=true); \n```\n\n| sym  | side | price  | qty  |\n| ---- | ---- | ------ | ---- |\n| MSFT | S    | 208.9  | 800  |\n| IBM  | B    | 125.27 | 1000 |\n"
    },
    "sma": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sma.html",
        "signatures": [
            {
                "full": "sma(X, window)",
                "name": "sma",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [sma](https://docs.dolphindb.com/en/Functions/s/sma.html)\n\n\n\n#### Syntax\n\nsma(X, window)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Simple Moving Average (sma) for *X* in a sliding window of the given length.\n\nThe formula is: ![](https://docs.dolphindb.com/en/images/sma.png)\n\n#### Returns\n\nA DOUBLE vector.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\nsma(x,3);\n// output: [,,12.299999999999998,12.533333333333331,12.433333333333331,12.099999999999999,11.566666666666664]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\nsma(x,3);\n```\n\n| col1    | col2    |\n| ------- | ------- |\n|         |         |\n|         |         |\n| 12.3    | 15.6667 |\n| 12.5333 | 17.3333 |\n| 12.4333 | 19.3333 |\n| 12.1    | 17.3333 |\n| 11.5667 | 14.3333 |\n\nRelated functions: [wma](https://docs.dolphindb.com/en/Functions/w/wma.html), [trima](https://docs.dolphindb.com/en/Functions/t/trima.html)\n"
    },
    "snippet": {
        "url": "https://docs.dolphindb.com/en/Functions/s/snippet.html",
        "signatures": [
            {
                "full": "snippet(X)",
                "name": "snippet",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [snippet](https://docs.dolphindb.com/en/Functions/s/snippet.html)\n\n\n\n#### Syntax\n\nsnippet(X)\n\n#### Details\n\nPrint the results.\n\n#### Parameters\n\n**X** can be data of any type.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\na = [[\"a\",\"b\"],\"c\"]\nsnippet(a)\n//output\n\"([\"a\",\"b\"],\"c\")\"\n\nsnippet(date(2023.01.01))\n//output\n\"2023.01.01\"\n```\n"
    },
    "socp": {
        "url": "https://docs.dolphindb.com/en/Functions/s/socp.html",
        "signatures": [
            {
                "full": "socp(f, [G], [h], [l], [q], [A], [b])",
                "name": "socp",
                "parameters": [
                    {
                        "full": "f",
                        "name": "f"
                    },
                    {
                        "full": "[G]",
                        "name": "G",
                        "optional": true
                    },
                    {
                        "full": "[h]",
                        "name": "h",
                        "optional": true
                    },
                    {
                        "full": "[l]",
                        "name": "l",
                        "optional": true
                    },
                    {
                        "full": "[q]",
                        "name": "q",
                        "optional": true
                    },
                    {
                        "full": "[A]",
                        "name": "A",
                        "optional": true
                    },
                    {
                        "full": "[b]",
                        "name": "b",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [socp](https://docs.dolphindb.com/en/Functions/s/socp.html)\n\n\n\n#### Syntax\n\nsocp(f, \\[G], \\[h], \\[l], \\[q], \\[A], \\[b])\n\n#### Details\n\nSolve SOCP problems and calculate the minimum of the objective function under specified constraints. The standard form of the SOCP constraint is as follows:\n\n![](https://docs.dolphindb.com/en/images/socp_11.png)\n\n*G* is as follows:\n\n![](https://docs.dolphindb.com/en/images/socp_3.png)\n\n*h* is as follows:\n\n![](https://docs.dolphindb.com/en/images/socp_4.png)\n\n#### Parameters\n\nSecond-order cone programming (SOCP) problems are subject to the constraint with the following form:\n\n![](https://docs.dolphindb.com/en/images/socp_12.png)\n\n*K* is a cone and *s* is a slack variable. The value of *s* will be determined during optimization.\n\n**f** is a numeric vector indicating the coefficient vector of the objective function.\n\n**G** (optional) is a numeric matrix indicating the coefficient matrix of the cone constraint.\n\n**h** (optional) is a numeric vector indicating the right-hand-side vector of the cone constraint.\n\n**l** (optional) is an integral scalar indicating the dimension of the non-negative quadrant constraint.\n\n**q** (optional) is a positive vector indicating the dimension size of each second-order cone constraint. The form is \\[r0,r1,…,rN-1].\n\n**A** (optional) is a numeric matrix indicating the coefficient matrix of the equality constraint.\n\n**b** (optional) is a numeric vector indicating the right-hand-side vector of the equality constraint.\n\n#### Returns\n\nA 4-element tuple:\n\n* The first element is a string indicating the state of the solution:\n* The second element is the value of x where the value of the objective function is minimized.\n* The third element is the minimum value of the objective function.\n* The fourth element is the exit code that indicates the quality of the returned solution.\n\nThe correspondence between Exicode and status descriptions is shown in the following table:\n\n| Exitcode | Description                                                             |\n| -------- | ----------------------------------------------------------------------- |\n| 0        | Optimal solution found                                                  |\n| 1        | Certificate of primal infeasibility found                               |\n| 2        | Certificate of dual infeasibility found                                 |\n| 10       | Optimal solution found subject to reduced tolerances                    |\n| 11       | Certificate of primal infeasibility found subject to reduced tolerances |\n| 12       | Certificate of dual infeasibility found subject to reduced tolerances   |\n| -1       | Maximum number of iterations reached                                    |\n| -2       | Numerical problems (unreliable search direction)                        |\n| -3       | Numerical problems (slacks or multipliers outside cone)                 |\n| -7       | Unknown problem in solver                                               |\n\n#### Examples\n\nSolve the following SOCP problem:\n\n![](https://docs.dolphindb.com/en/images/socp_5.png)\n\n```\nf = [-6, -4, -5]\nG = matrix([[16, 7, 24, -8, 8, -1, 0, -1, 0], \n[-14, 2, 7, -13, -18, 3, 0, 0, -1], \n[5, 0, -15, 12, -6, 17, 0, 0, 0]])\nh = [-3, 5, 12, -2, -14, -13, 10, 0, 0]\n\nl = 2\nq = [4,3]\n\nre = socp(f,G,h,l,q, ,)\nprint(re)\n\n// output: (\"Problem solved to optimality\",[-9.902804882871327,-1.39084684264198,26.211851780740154],-66.079042235904907)\n```\n"
    },
    "solve": {
        "url": "https://docs.dolphindb.com/en/Functions/s/solve.html",
        "signatures": [
            {
                "full": "solve(X, Y)",
                "name": "solve",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [solve](https://docs.dolphindb.com/en/Functions/s/solve.html)\n\n\n\n#### Syntax\n\nsolve(X, Y)\n\n#### Details\n\nIt generates the vector b that solves X\\*b=Y.\n\n#### Parameters\n\n**X** is a square matrix;\n\n**Y** is a vector.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\n```\nm=1..4$2:2;\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 3  |\n| 2  | 4  |\n\n```\nm.solve(7 10);\n// output: [1, 2]\n```\n"
    },
    "sort!": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sort!.html",
        "signatures": [
            {
                "full": "sort!(X, [ascending=true])",
                "name": "sort!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [sort!](https://docs.dolphindb.com/en/Functions/s/sort!.html)\n\n\n\n#### Syntax\n\nsort!(X, \\[ascending=true])\n\n#### Details\n\nSort *X* in-place in ascending/descending order.\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n**ascending** (optional) is a Boolean scalar indicating whether to sort *X* in ascending order or descending order. The default value is true (ascending order).\n\n#### Returns\n\nA sorted vector or matrix.\n\n#### Examples\n\n```\nx=9 1 5;\nsort!(x);\nx;\n// output: [1 5 9]\n\nx.sort!(0);\nx;\n// output: [9,5,1]\n```\n"
    },
    "sort": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sort.html",
        "signatures": [
            {
                "full": "sort(X, [ascending=true])",
                "name": "sort",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[ascending=true]",
                        "name": "ascending",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [sort](https://docs.dolphindb.com/en/Functions/s/sort.html)\n\n\n\n#### Syntax\n\nsort(X, \\[ascending=true])\n\nPlease refer to [sort!](https://docs.dolphindb.com/en/Functions/s/sort!.html). The only difference between sort and sort! is that the latter assigns the result to X and thus changing the value of X after the execution.\n\n#### Details\n\nReturn a sorted vector/matrix in ascending/descending order.\n\nDolphinDB `sort` differs from NumPy `numpy.sort` in the following aspects:\n\n* **Sorting order**: DolphinDB `sort` supports both ascending and descending order through the *ascending* parameter. In contrast, `numpy.sort` only provides ascending sorting by default and does not support descending order through a parameter; descending order is typically achieved by reversing the sorted result.\n* **Null value handling**: DolphinDB `sort` treats null values as the smallest values, and their positions depend on the *ascending* setting. In contrast, in `numpy.sort`, NaN values are ordered in a fixed manner (typically placed at the end).\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n**ascending** (optional) is a Boolean scalar indicating whether to sort *X* in ascending order or descending order. The default value is true (ascending order).\n\n#### Returns\n\nA sorted vector or matrix.\n\n#### Examples\n\n```\nx=9 1 5;\nx;\n// output: [9,1,5]\n\ny=sort(x);\ny;\n// output: [1,5,9]\n\nsort(x, false);\n// output: [9,5,1]\n\nx=1 4 2 5 6 3$2:3;\nx;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 2  | 6  |\n| 4  | 5  | 3  |\n\n```\nsort x;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\nThe `sort!` function change the value of input after sorting.\n\n```\nx=9 1 5;\nsort!(x);\nx;\n// output: [1 5 9];\n```\n\nRelated function: [isort](https://docs.dolphindb.com/en/Functions/i/isort.html)\n"
    },
    "sortBy!": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sortBy!.html",
        "signatures": [
            {
                "full": "sortBy!(table, sortColumns, [sortDirections])",
                "name": "sortBy!",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "sortColumns",
                        "name": "sortColumns"
                    },
                    {
                        "full": "[sortDirections]",
                        "name": "sortDirections",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [sortBy!](https://docs.dolphindb.com/en/Functions/s/sortBy!.html)\n\n\n\n#### Syntax\n\nsortBy!(table, sortColumns, \\[sortDirections])\n\n#### Details\n\nSort a table in-place based on the specified columns and directions. If the table is a partitioned table, the sorting is conducted within each partition, not on the entire table.\n\nThis operation is executed in parallel if the table is a partitioned table and the parallel processing feature is enabled (when the configuration parameter *localExcutors* > 0).\n\n#### Parameters\n\n**table** is a table object. It can be a partitioned or unpartitioned in-memory table.\n\n**sortColumns** can be a string scalar/vector indicating the columns based on which the table will be sorted. It can also be a piece of metacode with an expression.\n\n**sortDirections** (optional) is a Boolean scalar/vector indicating the sorting directions for the sorting columns. 1 means ascending and 0 means descending. If *sortColumns* is a vector and *sortDirections* is a scalar, the *sortDirections* applies to all the sorting columns.\n\n#### Returns\n\nA table.\n\n#### Examples\n\nSort an unpartitioned table:\n\n```\nn=20000000\ntrades=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);\ntrades.sortBy!(`sym`date, [0,1]);\n```\n\nSort a partitioned table:\n\n```\nworkDir = \"C:/DolphinDB/Data\"\nif(!exists(workDir)) mkdir(workDir)\ntrades.saveText(workDir + \"/trades.txt\")\ndb = database(workDir + \"/trade\",VALUE,`IBM`MSFT`GM`C`YHOO`GOOG)\ndb.loadTextEx(\"trades\",\"sym\", workDir + \"/trades.txt\")\ntrades = db.loadTable(\"trades\",`IBM`GM`YHOO,1)\ntrades.sortBy!(`date)\ntrades.sortBy!(`date, false)\ntrades.sortBy!(`date`qty, false)\ntrades.sortBy!(`date`qty, false true)\ntrades.sortBy!(<qty*price>)\ntrades.sortBy!(<[date, sym]>)\ntrades.sortBy!(<[sym, qty*price]>, true false)\n```\n"
    },
    "spawnMonitor": {
        "url": "https://docs.dolphindb.com/en/Functions/s/spawn_monitor.html",
        "signatures": [
            {
                "full": "spawnMonitor(name,handler, arguments...)",
                "name": "spawnMonitor",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "handler",
                        "name": "handler"
                    },
                    {
                        "full": "arguments...",
                        "name": "arguments..."
                    }
                ]
            }
        ],
        "markdown": "### [spawnMonitor](https://docs.dolphindb.com/en/Functions/s/spawn_monitor.html)\n\n\n\n#### Syntax\n\nspawnMonitor(name,handler, arguments...)\n\n#### Details\n\nSpawns additional monitor instances within a single monitor instance.\n\nIt implements the following steps:\n\n1. Creates a new instance of the monitor that is spawning.\n\n2. Deep copies all copyable attributes and functions from the spawning monitor instance.\n\n3. Executes the specified *handler* action in the new monitor instance.\n\n#### Parameters\n\n**Name** is a STRING scalar indicating the name of the spawned instance, which cannot be duplicate with an existing instance.\n\n**handler** is the action to be invoked to process the events monitored by this spawned instance.\n\n**arguments** is argument(s) passed to *handler*.\n\n#### Returns\n\nA monitor instance.\n\n#### Examples\n\n```\nclass NewStock {\n    code :: STRING\n    price :: DOUBLE\n    def NewStock(c, p){\n        code = c\n        price = p\n    }\n}\nclass SimpleShareSearch : CEPMonitor { \n    numberTicks :: INT\n    price :: DOUBLE\n    stockName :: STRING\n    def SimpleShareSearch(){\n        stockName = \"\"\n\t\tnumberTicks = 0\n\t\tprice = 0.0\n\t}\n    def matchTicks(newStock)\n    def spawnTicks(newStock){\n        numberTicks = numberTicks+1\n        spawnMonitor(\"MonitorOf\"+newStock.code, matchTicks, newStock)\n    }\n    // Listens for all NewStock events. When a NewStock event is detected, \n    // a new monitor instance is created by deep-copying the current monitor, and the matchTicks() method is executed.\n    // This operation deep-copies the state of the current monitor.\n    def onload() { \n        addEventListener(handler=spawnTicks, eventType=\"NewStock\", times=\"all\")\n    } \n    def processTick(ticks)\n    def matchTicks(newStock) { \n        stockName=newStock.code\n        price = newStock.price\n        addEventListener(handler=processTick, eventType=\"StockTick\", condition=<StockTick.code==stockName>,times=\"all\")\n    } \n   def processTick(ticks) { \n\t\tstr = \"StockTick event received\" + \n\t\t\t\" name = \" + ticks.code + \n\t\t\t\" Price = \" + ticks.price.string()\n\t\twriteLog(str)\n   } \n}\n```\n"
    },
    "spearmanr": {
        "url": "https://docs.dolphindb.com/en/Functions/s/spearmanr.html",
        "signatures": [
            {
                "full": "spearmanr(X, Y)",
                "name": "spearmanr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [spearmanr](https://docs.dolphindb.com/en/Functions/s/spearmanr.html)\n\n\n\n#### Syntax\n\nspearmanr(X, Y)\n\n#### Details\n\nCalculate the Spearman rank correlation coefficient of *X* and *Y*. Null values are ignored in the calculation. Spearman correlation is a non-parametric measure of the monotonicity of the relationship between two data sets. The coefficient varies between -1 and +1, where 0 means no correlation. -1 or +1 means an exact monotonic relationship.\n\nIf *X* or *Y* is a matrix, apply the function to each column and return a vector.\n\nThe differences between the DolphinDB `spearmanr` function and `scipy.stats.spearmanr` are as follows:\n\n* **Output format**: The DolphinDB `spearmanr` function returns only the correlation coefficient, while `scipy.stats.spearmanr` returns both the correlation coefficient and its corresponding p-value.\n\n* **NULL/NaN handling**: DolphinDB `spearmanr` ignores null values during calculation, whereas `scipy.stats.spearmanr` controls how NaN values are handled through the *nan\\_policy* parameter.\n\n#### Parameters\n\n**X** is a vector/ matrix.\n\n**Y** is a vector/ matrix.\n\n#### Returns\n\nIf X or Y is a vector, returns a scalar. If X or Y is a matrix, returns a vector.\n\n#### Examples\n\n```\nx=[2013.06.13, 2013.06.14, 2013.06.15]\ny=1 5 3\nspearmanr(x, y)\n// output: 0.5\n\nx = [33,21,46,-11,78,47,18,20,-5,66]\ny = [1,NULL,10,6,10,3,NULL,NULL,5,3]\nspearmanr(x, y)\n// output: 0.109109\n```\n\nIf *X* is a matrix, *Y* can be a vector/matrix with the same number of rows as *X*.\n\n```\nm1 = [34,77,35,-40,-39,-86,49,-55,15,72,NULL,-24,16,20,26,-82,80,-93,-65,99,45,90,44,46]$4:6\nm2 = [0, 25, 7, 3]\nspearmanr(m1, m2)\n// output: [0.8, -0.4, 0.5, 0.6, -0.8, 0.4]\n```\n"
    },
    "splev": {
        "url": "https://docs.dolphindb.com/en/Functions/s/splev.html",
        "signatures": [
            {
                "full": "splev(x, tck)",
                "name": "splev",
                "parameters": [
                    {
                        "full": "x",
                        "name": "x"
                    },
                    {
                        "full": "tck",
                        "name": "tck"
                    }
                ]
            }
        ],
        "markdown": "### [splev](https://docs.dolphindb.com/en/Functions/s/splev.html)\n\n#### Syntax\n\nsplev(x, tck)\n\n#### Details\n\n`splev`, short for Spline Evaluation, is used to evaluate B-spline curves or their derivatives. Given the knots and coefficients of the B-spline representation, this function calculates the values of the smooth polynomials and their derivatives. If null value is included in the input values of *x* or *tck*, it will be filled with 0.\n\n#### Parameters\n\n**x** is a vector that specifies a set of data points to obtain corresponding values on the spline.\n\n**tck** can be a tuple of length 3 or a B-spline curve object that contains a vector t of knots, the B-spline coefficients, and the degree k of the spline. It can be generated with function [splrep](https://docs.dolphindb.com/en/Functions/s/splrep.html). Note that the spline degree k must satisfy 1 <= k <= 5.\n\n#### Returns\n\ny, a DOUBLE type vector that represents the array of spline function values evaluated at points x.\n\n**Note:**\n\nIt is not recommended to use a user-defined *tck*. If it is not generated by function `splrep`, the returned y may contain random values or be filled with 0s.\n\n#### Examples\n\n```\nx = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\ny = [0, 3, 5, 6, 5, 3, 1, 2, 4, 5]\nnewx = [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5]\nt=[1,3,5,8]\ntck= splrep(x, y, t=t)\nprint(tck)\n// output: ([0,0,0,0,1,3,5,8,9,9,9,9],[0,2.234794827972243,2.999908797063527,8.195517483732592,0.982766102937427,0.416533320193195,6.868465914739519,5,0,0,0,0],3)\n\nnewy = splev(newx, tck)\nprint(newy)\n// output: [2.147514374187927,3.928180605155257,5.780093403045226,5.788551610920491,3.842319632145274,1.928386784305488,1.343262026468735,2.600266282317609,5.680148059970901,-0.902321655035049] \n```\n\nRelated function: [splrep](https://docs.dolphindb.com/en/Functions/s/splrep.html)\n\n"
    },
    "spline": {
        "url": "https://docs.dolphindb.com/en/Functions/s/spline.html",
        "signatures": [
            {
                "full": "spline(X, Y, resampleRule, [closed='left'], [origin='start_day'], [outputX=false])",
                "name": "spline",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "resampleRule",
                        "name": "resampleRule"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[origin='start_day']",
                        "name": "origin",
                        "optional": true,
                        "default": "'start_day'"
                    },
                    {
                        "full": "[outputX=false]",
                        "name": "outputX",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [spline](https://docs.dolphindb.com/en/Functions/s/spline.html)\n\n\n\n#### Syntax\n\nspline(X, Y, resampleRule, \\[closed='left'], \\[origin='start\\_day'], \\[outputX=false])\n\n#### Details\n\nResample *X* based on the specified *resampleRule*, *closed* and *origin*. Perform cubic spline interpolation on *Y* based on the resampled *X*.\n\nIf *outputX* is unspecified, return a vector of *Y* after the interpolation.\n\nIf *outputX*=true, return a tuple where the first element is the vector of resampled *X* and the second element is a vector of *Y* after the interpolation.\n\n#### Parameters\n\n**X** is a strictly increasing vector of temporal type.\n\n**Y** is a numeric vector of the same length as *X*.\n\n**resampleRule** is a string. See the parameter *rule* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html) for the optional values.\n\n**closed** and **origin** (optional) are the same as the parameters *closed* and *origin* of function [resample](https://docs.dolphindb.com/en/Functions/r/resample.html).\n\n**outputX** (optional) is a Boolean value indicating whether to output the resampled *X*. The default value is false.\n\n#### Returns\n\nIf *outputX* is not specified, returns only the interpolated vector of *Y*. If *outputX* = true, returns a tuple whose first element is the resampled vector of *X* and whose second element is the interpolated vector of *Y*.\n\n#### Examples\n\n**Example 1**\n\n```\nspline([2016.02.14 00:00:00, 2016.02.15 00:00:00, 2016.02.16 00:00:00], [1.0, 2.0, 4.0], resampleRule=`60min);\n\n// output: [1,1.0313,1.0626,1.0942,1.1262,1.1585,1.1914,1.225,1.2593,1.2944,1.3306,1.3678,1.4062,1.446,1.4871,1.5298,1.5741,1.6201,1.668,1.7178\n,1.7697,1.8237,1.8801,1.9388,2,2.0638,2.1301,2.1987,2.2697,2.3428,2.418,2.4951,2.5741,2.6548,2.7371,2.821,2.9062,2.9928,3.0806,3.1694\n,3.2593,3.35,3.4414,3.5335,3.6262,3.7192,3.8126,3.9063,4]\n```\n\n**Example 2** Different values of *closed* affect the result.\n\n```\nX = 2022.01.01T00:00:00 + [0, 3, 6, 9] * 60\nY = [1.0, 3.0, 7.0, 13.0]\n\n// closed='left' (default): 00:03 belongs to the start of [00:03, 00:06)\nspline(X, Y, `3min, closed=`left, outputX=true)\n\n// closed='right': 00:03 belongs to the end of (00:00, 00:03]\n// The starting points of resampled X differ, so the spline curve also changes\nspline(X, Y, `3min, closed=`right, outputX=true)\n```\n\n**Example 3** Different values of *origin* affect the result.\n\n```\nX = 2022.01.01T00:00:30 + (0..4) * 60\nY = [2.0, 4.0, 7.0, 11.0, 16.0]\n\n// origin='start_day' (default): align to 00:00:00 of the same day\nspline(X, Y, `1min, origin=`start_day, outputX=true)\n\n// origin='start': align to the first data point 00:00:30\nspline(X, Y, `1min, origin=`start, outputX=true)\n\n// origin=custom timestamp: align to 00:00:10\nspline(X, Y, `1min, origin=2022.01.01T00:00:10, outputX=true)\n```\n\n**Example 4** Different values of *outputX* affect the result.\n\n```\nX = [2016.02.14T00:00:00, 2016.02.15T00:00:00, 2016.02.16T00:00:00]\nY = [1.0, 2.0, 4.0]\n\n// outputX=false (default): return only the cubic spline interpolated Y vector\nspline(X, Y, `60min)\n\n// outputX=true: return a tuple; [0] is the resampled timestamp vector, [1] is the interpolated Y\nresult = spline(X, Y, `60min, outputX=true)\nresult[0]\nresult[1]\n```\n"
    },
    "split": {
        "url": "https://docs.dolphindb.com/en/Functions/s/split.html",
        "signatures": [
            {
                "full": "split(str, [delimiter])",
                "name": "split",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "[delimiter]",
                        "name": "delimiter",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [split](https://docs.dolphindb.com/en/Functions/s/split.html)\n\n\n\n#### Syntax\n\nsplit(str, \\[delimiter])\n\n#### Details\n\n* If *delimiter* is not specified, split *str* into a CHAR vector.\n\n* If *delimiter* is specified, use *delimiter* as the delimiter to split str into a CHAR vector or a STRING vector.\n\n* *str* is a scalar:\n\n  * If *delimiter* is not specified, split *str* into a CHAR vector.\n\n  * If *delimiter* is specified, use *delimiter* as the delimiter to split str into a CHAR vector or a STRING vector.\n\n* *str* is a vector: Split each element of the vector as described above. Return the results in a columnar tuple.\n\n  DolphinDB `split` and NumPy `split` are functions designed for completely different purposes: the former is used for string splitting, while the latter is used for array splitting.\n\n#### Parameters\n\n**str** is a STRING scalaror vector.\n\n**delimiter** (optional) is a CHAR or STRING scalar indicating the separator. It can consist of one or more characters, with the default being a comma (',').\n\n#### Returns\n\nA vector or columnar tuple.\n\n#### Examples\n\n```\nsplit(\"xyz 1\");\n// output: ['x','y','z',' ','1']\n\nsplit(\"xyz 1\",\" \");\n// output: [\"xyz\",\"1\"]\n\nsplit(`xyz1,`xyz);\n// output: [,\"1\"]\n\nsplit(`xyz1,`xyz)[1];\n// output: 1\n\na = split\\(\"20220101 09:00:00\" \"20220101 09:12:20\" \"20220101 10:00:00\", \" \"\\)\n// output: \\(\\[\"20220101\",\"09:00:00\"\\],\\[\"20220101\",\"09:12:20\"\\],\\[\"20220101\",\"10:00:00\"\\]\\)\n\n// access by column\na\\[0\\];\n// output: \\[\"20220101\",\"20220101\",\"20220101\"\\]\n\na\\[1\\];\n// output: \\[\"09:00:00\",\"09:12:20\",\"10:00:00\"\\]\n\n//access by row\na.row\\(0\\)\n// output: \\[\"20220101\",\"09:00:00\"\\]\n```\n"
    },
    "splrep": {
        "url": "https://docs.dolphindb.com/en/Functions/s/splrep.html",
        "signatures": [
            {
                "full": "splrep(x, y, t)",
                "name": "splrep",
                "parameters": [
                    {
                        "full": "x",
                        "name": "x"
                    },
                    {
                        "full": "y",
                        "name": "y"
                    },
                    {
                        "full": "t",
                        "name": "t"
                    }
                ]
            }
        ],
        "markdown": "### [splrep](https://docs.dolphindb.com/en/Functions/s/splrep.html)\n\n#### Syntax\n\nsplrep(x, y, t)\n\n#### Details\n\n`splrep`, short for Spline Representation, is used to find the B-spline representation of a one-dimensional curve. With a given set of data points (x\\[i], y\\[i]), it determines the degree-3 smooth spline approximation over the interval x\\[0] <= x <= x\\[size(x)-1]. If null value is included in the input values of *x*, *y*, or *t*, it will be filled with 0.\n\n#### Parameters\n\n**x** and **y** are vectors of Integral/Temporal/Floating/Decimal type that define the data points for the cubic spline curve y = f(x). Note that x and y must have the same length, and the input values of y must be in ascending order.\n\n**t** (optional) is a vector indicating the knots needed. Splines can have different polynomials on either side of the knots. The values in *t* must satisfy the Schoenberg-Whitney conditions, meaning there must exist a subset of data points x\\[j] for all j=0, 1,...,n-5 such that t\\[j] < x\\[j] < t\\[j+4].\n\n#### Returns\n\nA tuple of length 3 containing the vector of knots, the B-spline coefficients, and the degree of the spline.\n\n#### Examples\n\n```\nx = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\ny = [0, 3, 5, 6, 5, 3, 1, 2, 4, 5]\nt=[1,3,5,8]\ntck= splrep(x, y, t=t)\nprint(tck)\n// output: ([0,0,0,0,1,3,5,8,9,9,9,9],[0,2.234794827972243,2.999908797063527,8.195517483732592,0.982766102937427,0.416533320193195,6.868465914739519,5,0,0,0,0],3)\n```\n\nRelated function: [splev](https://docs.dolphindb.com/en/Functions/s/splev.html)\n\n"
    },
    "sql": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sql.html",
        "signatures": [
            {
                "full": "sql(select, from, [where], [groupBy], [groupFlag=1], [csort], [ascSort=1], [having], [orderBy], [ascOrder=1], [limit], [hint], [exec=false], [map=false], [cgroupBy])",
                "name": "sql",
                "parameters": [
                    {
                        "full": "select",
                        "name": "select"
                    },
                    {
                        "full": "from",
                        "name": "from"
                    },
                    {
                        "full": "[where]",
                        "name": "where",
                        "optional": true
                    },
                    {
                        "full": "[groupBy]",
                        "name": "groupBy",
                        "optional": true
                    },
                    {
                        "full": "[groupFlag=1]",
                        "name": "groupFlag",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[csort]",
                        "name": "csort",
                        "optional": true
                    },
                    {
                        "full": "[ascSort=1]",
                        "name": "ascSort",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[having]",
                        "name": "having",
                        "optional": true
                    },
                    {
                        "full": "[orderBy]",
                        "name": "orderBy",
                        "optional": true
                    },
                    {
                        "full": "[ascOrder=1]",
                        "name": "ascOrder",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[limit]",
                        "name": "limit",
                        "optional": true
                    },
                    {
                        "full": "[hint]",
                        "name": "hint",
                        "optional": true
                    },
                    {
                        "full": "[exec=false]",
                        "name": "exec",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[map=false]",
                        "name": "map",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[cgroupBy]",
                        "name": "cgroupBy",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [sql](https://docs.dolphindb.com/en/Functions/s/sql.html)\n\n\n\n#### Syntax\n\nsql(select, from, \\[where], \\[groupBy], \\[groupFlag=1], \\[csort], \\[ascSort=1], \\[having], \\[orderBy], \\[ascOrder=1], \\[limit], \\[hint], \\[exec=false], \\[map=false], \\[cgroupBy])\n\n#### Details\n\nCreate a SQL statement dynamically. To execute the generated SQL statement, use function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html).\n\n#### Parameters\n\n**select** is metacode indicating the columns to be selected. Each column is generated by either function [sqlCol](https://docs.dolphindb.com/en/Functions/s/sqlCol.html) or [sqlColAlias](https://docs.dolphindb.com/en/Functions/s/sqlColAlias.html) . Use a tuple to select multiple columns.\n\n**from** is a table object or table name.\n\n**where** (optional) indicates the \"where\" conditions. In case of multiple \"where\" conditions, use an ANY vector with each element corresponding to the metacode of a condition.\n\n**groupBy** (optional) indicates \"group by\" or \"context by\" column(s). In case of multiple \"group by\" columns, use an ANY vector with each element corresponding to the metacode of a column name.\n\n**groupFlag** (optional) 1 means \"group by\"; 0 means \"context by\"; 2 means \"pivot by\". The default value is 1.\n\n**csort** (optional) is metacode or a tuple of metacode that specifies the column name(s) followed by `csort`. This parameter only works when *contextBy*is specified.\n\n**ascSort**(optional) is a scalar or vector indicating whether each *csort*column is sorted in ascending or descending order. 1 (default) means ascending and 0 means descending.\n\n**having**(optional) is metacode or a tuple of metacode that specifies the `having` condition(s). This parameter only works when *contextBy*is specified.\n\n**orderBy** (optional) indicates \"order by\" column(s). In case of multiple \"order by\" columns, use a tuple with each element corresponding to the metacode of a column name.\n\n**ascOrder** (optional) is a scalar or vector indicating whether each \"order by\" column is sorted in ascending or descending order. 1 means sorting in ascending order; 0 means sorting in descending order. The default value is 1.\n\n**limit** (optional) is an integer or an integral pair indicating the number of rows to select from the result starting from the first row. If *groupBy* is specified and *groupFlag*=0, select limit rows from each group starting from the first row in each group. It corresponds to \"top\" clause in \"select\" statements.\n\n**limit** (optional) is an integer or an integer pair that specifies the range of rows to return. It corresponds to \"top\" clause in \"select\" statements.\n\n* If *limit* is an integer n, it returns the first n rows.\n\n* If *limit* is a pair \"start:end\", it returns rows from the start-th row (inclusive) to the end-th row (exclusive).\n\nIf *groupBy* is specified and *groupFlag* = 0, the *limit* is applied within each group independently.\n\n**hint** (optional) is a constant that can take the following values:\n\n* HINT\\_HASH: use Hashing algorithm to execute \"group by\" statements.\n\n* HINT\\_SNAPSHOT: query data from snapshot engine.\n\n* HINT\\_KEEPORDER: the records in the result after executing \"context by\" statements are in the same order as in the input data.\n\n**exec** indicates whether to use the exec clause. The default value is false. If set to be true, a scalar or a vector will be generated. If the \"pivot by\" is used in the exec clause, a matrix can be generated.\n\n**map**(optional) is a Boolean scalar specifying whether to use the `map` keyword. The default value is false.\n\n**cgroupBy** (optional): A CODE scalar/vector or an integer scalar, used to specify the keywords for cgroup by.\n\n* When a CODE scalar or vector is provided, it specifies the meta code of keywords used for cgroup by. A CODE vector may contain multiple elements, each representing the meta code of a keyword.\n* When an integer scalar is provided, it specifies that the last n elements of the *groupBy* parameter are used as cgroup by keywords, while the remaining elements are used as group by keywords. For example, if *groupBy* = \\[\"col1\", \"col2\", \"col3\"] and *cgroupBy* = 1, then:\n  * group by keywords: col1, col2\n  * cgroup by keywords: col3\n\n**Note:**\n\n* If *groupFlag* is 0 (context by) or 2 (pivot by), the *cgroupBy* parameter cannot be specified.\n* If *cgroupBy* is specified, the *orderBy* parameter must also be specified.\n\n#### Returns\n\nA CODE scalar.\n\n#### Examples\n\n```\nsymbol = take(`GE,6) join take(`MSFT,6) join take(`F,6)\ndate=take(take(2017.01.03,2) join take(2017.01.04,4), 18)\nprice=31.82 31.69 31.92 31.8  31.75 31.76 63.12 62.58 63.12 62.77 61.86 62.3 12.46 12.59 13.24 13.41 13.36 13.17\nvolume=2300 3500 3700 2100 1200 4600 1800 3800 6400 4200 2300 6800 4200 5600 8900 2300 6300 9600\nt1 = table(symbol, date, price, volume);\n\nt1;\n```\n\n| symbol | date       | price volume |\n| ------ | ---------- | ------------ |\n| GE     | 2017.01.03 | 31.82 2300   |\n| GE     | 2017.01.03 | 31.69 3500   |\n| GE     | 2017.01.04 | 31.92 3700   |\n| GE     | 2017.01.04 | 31.8 2100    |\n| GE     | 2017.01.04 | 31.75 1200   |\n| GE     | 2017.01.04 | 31.76 4600   |\n| MSFT   | 2017.01.03 | 63.12 1800   |\n| MSFT   | 2017.01.03 | 62.58 3800   |\n| MSFT   | 2017.01.04 | 63.12 6400   |\n| MSFT   | 2017.01.04 | 62.77 4200   |\n| MSFT   | 2017.01.04 | 61.86 2300   |\n| MSFT   | 2017.01.04 | 62.3 6800    |\n| F      | 2017.01.03 | 12.46 4200   |\n| F      | 2017.01.03 | 12.59 5600   |\n| F      | 2017.01.04 | 13.24 8900   |\n| F      | 2017.01.04 | 13.41 2300   |\n| F      | 2017.01.04 | 13.36 6300   |\n| F      | 2017.01.04 | 13.17 9600   |\n\n```\nx=5000\nwhereConditions = [<symbol=`MSFT>,<volume>x>]\nhavingCondition = <sum(volume)>200>;\n\nsql(sqlCol(\"*\"), t1);\n// output: < select * from t1 >\n\nsql(sqlCol(\"*\"), t1, whereConditions);\n// output: < select * from t1 where symbol == \"MSFT\",volume > x >\n\nsql(select=sqlColAlias(<avg(price)>), from=t1, where=whereConditions, groupBy=sqlCol(`date));\n// output: < select avg(price) as avg_price from t1 where symbol == \"MSFT\",volume > x group by date >\n\nsql(select=sqlColAlias(<avg(price)>), from=t1, groupBy=[sqlCol(`date),sqlCol(`symbol)]);\n// output: < select avg(price) as avg_price from t1 group by date,symbol >\n\nsql(select=(sqlCol(`symbol),sqlCol(`date),sqlColAlias(<cumsum(volume)>, `cumVol)), from=t1, groupBy=sqlCol(`date`symbol), groupFlag=0);\n// output: < select symbol,date,cumsum(volume) as cumVol from t1 context by date,symbol >\n\nsql(select=(sqlCol(`symbol),sqlCol(`date),sqlColAlias(<cumsum(volume)>, `cumVol)), from=t1, where=whereConditions, groupBy=sqlCol(`date), groupFlag=0);\n// output: < select symbol,date,cumsum(volume) as cumVol from t1 where symbol == \"MSFT\",volume > x context by date >\n\nsql(select=(sqlCol(`symbol),sqlCol(`date),sqlColAlias(<cumsum(volume)>, `cumVol)), from=t1, where=whereConditions, groupBy=sqlCol(`date), groupFlag=0, csort=sqlCol(`volume), ascSort=0);\n// output: < select symbol,date,cumsum(volume) as cumVol from t1 where symbol == \"MSFT\",volume > x context by date csort volume desc >\n\nsql(select=(sqlCol(`symbol),sqlCol(`date),sqlColAlias(<cumsum(volume)>, `cumVol)), from=t1, where=whereConditions, groupBy=sqlCol(`date), groupFlag=0, having=havingCondition);\n// output: < select symbol,date,cumsum(volume) as cumVol from t1 where symbol == \"MSFT\",volume > x context by date having sum(volume) > 200 >\n\nsql(select=sqlCol(\"*\"), from=t1, where=whereConditions, orderBy=sqlCol(`date), ascOrder=0);\n// output: < select * from t1 where symbol == \"MSFT\",volume > x order by date desc >\n\nsql(select=sqlCol(\"*\"), from=t1, limit=1);\n// output: < select top 1 * from t1 >\n\nsql(select=sqlCol(\"*\"), from=t1, groupBy=sqlCol(`symbol), groupFlag=0, limit=1);\n// output: < select top 1 * from t1 context by symbol >\n\nsql(select=(sqlCol(`symbol),sqlCol(`date),sqlColAlias(<cumsum(volume)>, `cumVol)), from=t1, groupBy=sqlCol(`date`symbol), groupFlag=0, hint=HINT_KEEPORDER);\n// output: < select [128] symbol,date,cumsum(volume) as cumVol from t1 context by date,symbol >\n\nwhereConditions1 = <symbol=`MSFT or volume>x>\nsql(select=sqlCol(\"*\"), from=t1, where=whereConditions1, orderBy=sqlCol(`date), ascOrder=0);\n// output: < select * from t14059d76a00000000 where symbol == \"MSFT\" or volume > x order by date desc > \n\nsql(select=sqlCol(\"*\"), from=t1, where=whereConditions, orderBy=sqlCol(`date), ascOrder=0, map=true);\n// output: < select [256] * from t17092a30500000000 where symbol == \"MSFT\",volume > x order by date desc map >\n\nsql(select=sqlColAlias(<avg(price)>), from=t1, groupBy=sqlCol(`date), groupFlag=1, cgroupBy=1, having=havingCondition, orderBy=sqlCol(`date), ascOrder=0);\n// Output: < select avg(price) as avg_price from t14094040000610000 cgroup by date having sum(volume) > 200 order by date desc >\n\nsql(select=sqlColAlias(<avg(price)>), from=t1, groupBy=[sqlCol(`date), sqlCol(`volume)], groupFlag=1, cgroupBy=1, having=havingCondition, orderBy=sqlCol(`date), ascOrder=0);\n// Output: < select avg(price) as avg_price from t14094040000610000 group by date cgroup by volume having sum(volume) > 200 order by date desc >\n\nsql(select=sqlColAlias(<avg(price)>), from=t1, groupBy=sqlCol(`date), groupFlag=1, cgroupBy=[sqlCol(`volume)], having=havingCondition, orderBy=sqlCol(`date), ascOrder=0);\n// Output: < select avg(price) as avg_price from t14094040000610000 group by date cgroup by volume having sum(volume) > 200 order by date desc >\n\nsql(select=sqlColAlias(<avg(price)>), from=t1, cgroupBy=[sqlCol(`date)], having=havingCondition, orderBy=sqlCol(`date), ascOrder=0);\n// Output: < select avg(price) as avg_price from t14094040000610000 cgroup by date having sum(volume) > 200 order by date desc >\n\n```\n\nA convenient and flexible way to generate complicated queries dynamically is to define a function that calls function `sql`.\n\n```\ndef f1(t, sym, x){\nwhereConditions=[<symbol=sym>,<volume>x>]\nreturn sql(sqlCol(\"*\"),t,whereConditions).eval()\n};\n\nf1(t1, `MSFT, 5000);\n```\n\n| symbol | date       | price volume |\n| ------ | ---------- | ------------ |\n| MSFT   | 2017.01.04 | 63.12 6400   |\n| MSFT   | 2017.01.04 | 62.3 6800    |\n\n```\nf1(t1, `F, 9000);\n```\n\n| symbol | date       | price volume |\n| ------ | ---------- | ------------ |\n| F      | 2017.01.04 | 13.17 9600   |\n\n```\ndef f2(t, sym, colNames, filterColumn, filterValue){\n whereConditions=[<symbol=sym>,expr(sqlCol(filterColumn),>,filterValue)]\n    return sql(sqlCol(colNames),t,whereConditions).eval()\n};\n```\n\n```\nf2(t1,`GE, `symbol`date`volume, `volume, 3000);\n```\n\n| symbol | date       | volume |\n| ------ | ---------- | ------ |\n| GE     | 2017.01.03 | 3500   |\n| GE     | 2017.01.04 | 3700   |\n| GE     | 2017.01.04 | 4600   |\n\n```\nf2(t1,`F, `symbol`date`volume,`price,13.2);\n```\n\n| symbol | date       | volume |\n| ------ | ---------- | ------ |\n| F      | 2017.01.04 | 8900   |\n| F      | 2017.01.04 | 2300   |\n| F      | 2017.01.04 | 6300   |\n\nSet the parameter *exec*=true and use `exec` clause with the pivot by statement to generate a matrix:\n\n```\ndate = 2020.09.21 + 0 0 0 0 1 1 1 1\nsym = `MS`MS`GS`GS`MS`MS`GS`GS$SYMBOL\nfactorNum = 1 2 1 2 1 2 1 2\nfactorValue = 1.2 -3.4 -2.5 6.3 1.1 -3.2 -2.1 5.6\nt = table(date, sym, factorNum, factorValue);\nsql(select=sqlCol(`factorValue), from=t, groupBy=[sqlCol(`date), sqlCol(`sym)], groupFlag=2, exec=true)\n\n// output: < exec factorValue from t pivot by date,sym >\n```\n"
    },
    "sqlCol": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sqlCol.html",
        "signatures": [
            {
                "full": "sqlCol(colName, [func], [alias], [qualifier])",
                "name": "sqlCol",
                "parameters": [
                    {
                        "full": "colName",
                        "name": "colName"
                    },
                    {
                        "full": "[func]",
                        "name": "func",
                        "optional": true
                    },
                    {
                        "full": "[alias]",
                        "name": "alias",
                        "optional": true
                    },
                    {
                        "full": "[qualifier]",
                        "name": "qualifier",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [sqlCol](https://docs.dolphindb.com/en/Functions/s/sqlCol.html)\n\n\n\n#### Syntax\n\nsqlCol(colName, \\[func], \\[alias], \\[qualifier])\n\n#### Details\n\nGenerate metacode for selecting one or multiple columns with or without calculations. It is generally used together with function [sql](https://docs.dolphindb.com/en/Functions/s/sql.html) and [eval](https://docs.dolphindb.com/en/Functions/e/eval.html) to generate SQL statements dynamically.\n\n#### Parameters\n\n**colName** is a string scalar/vector indicating column name(s).\n\n**func** (optional) is a unary function.\n\n**alias** (optional) is a string scalar/vector indicating column name(s) of the selected column(s) or calculation result(s).\n\n**qualifier** (optional) is a STRING scalar. It is only used in a table join operation when we need to select a column that appears in both tables and that is not a matching column. It indicates the table from which to select the column.\n\n#### Returns\n\nA CODE scalar.\n\n#### Examples\n\n```\nt = table(`GME`AMC`KOSS as symbol, 325 13.26 64 as price);\ncolName=\"symbol\";\nsql(select=sqlCol(colName), from=t).eval();\n```\n\n| symbol |\n| ------ |\n| GME    |\n| AMC    |\n| KOSS   |\n\n```\ncolName=\"price\";\nsql(select=sqlCol(colName, max, `maxPrice), from=t).eval();\n```\n\n| maxPrice |\n| -------- |\n| 325      |\n\n```\nt1 = table(1 2 3 3 as id, 7.8 4.6 5.1 0.1 as value, 4 3 2 1 as x);\nt2 = table(5 3 1 as id,  300 500 800 as qty, 44 66 88 as x) ;\nsql(select=(sqlCol(`id),sqlCol(colName=`x, alias=\"t1_x\", qualifier=\"t1\"),sqlCol(colName=`x, alias=\"t2_x\", qualifier=`t2)), from=<ej(t1,t2,`id)>).eval()\n```\n\n| id | t1\\_x | t2\\_x |\n| -- | ----- | ----- |\n| 1  | 4     | 88    |\n| 3  | 2     | 66    |\n| 3  | 1     | 66    |\n"
    },
    "sqlColAlias": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sqlColAlias.html",
        "signatures": [
            {
                "full": "sqlColAlias(colDefs, [colNames])",
                "name": "sqlColAlias",
                "parameters": [
                    {
                        "full": "colDefs",
                        "name": "colDefs"
                    },
                    {
                        "full": "[colNames]",
                        "name": "colNames",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [sqlColAlias](https://docs.dolphindb.com/en/Functions/s/sqlColAlias.html)\n\n\n\n#### Syntax\n\nsqlColAlias(colDefs, \\[colNames])\n\n#### Details\n\nUse metacode and an optional alias name to define a column. It is often used to name calculated columns.\n\n#### Parameters\n\n**colDefs** is metacode.\n\n**colNames** (optional) is a string indicating an alias name.\n\n#### Returns\n\nA CODE scalar.\n\n#### Examples\n\n```\nsqlColAlias(<x>, `y);\n// output: < x as y >\n\nsqlColAlias(<avg(PRC)>, `avgPRC);\n// output: < avg(PRC) as avgPRC >\n\nsqlColAlias(<avg(PRC)>);\n// output: < avg(PRC) as avg_PRC >\n```\n"
    },
    "sqlDelete": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sqlDelete.html",
        "signatures": [
            {
                "full": "sqlDelete(table, [where], [from])",
                "name": "sqlDelete",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "[where]",
                        "name": "where",
                        "optional": true
                    },
                    {
                        "full": "[from]",
                        "name": "from",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [sqlDelete](https://docs.dolphindb.com/en/Functions/s/sqlDelete.html)\n\n\n\n#### Syntax\n\nsqlDelete(table, \\[where], \\[from])\n\n#### Details\n\nDynamically generate a metacode of the SQL delete statement. To execute the generated metacode, please use function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html).\n\n#### Parameters\n\n**table** can be an in-memory table or a DFS table.\n\n**where** (optional) is a metacode indicating the where condition.\n\n**from** (optional) is metacode indicating the from clause, which supports specifying table joins using `ej` or `lj`.\n\n#### Returns\n\nA CODE scalar.\n\n#### Examples\n\nExample 1. Delete the records in an in-memory table\n\n```\nt1=table(`A`B`C as symbol, 10 20 30 as x)\nsqlDelete(t1, <symbol=`C>).eval()\nt1;\n```\n\n| symbol | x  |\n| ------ | -- |\n| A      | 10 |\n| B      | 20 |\n\nExample 2. Delete the records in a DFS table\n\n```\nif(existsDatabase(\"dfs://db1\")){\n    dropDatabase(\"dfs://db1\")\n}\n\nn=1000000\nt=table(take(`A`B`C`D,n) as symbol, rand(10.0, n) as value)\ndb = database(\"dfs://db1\", VALUE, `A`B`C`D)\nTrades = db.createPartitionedTable(t, \"Trades\", \"symbol\")\nTrades.append!(t)\nselect count(*) from Trades;\n\n// output: 1000000\n\nTrades=loadTable(\"dfs://db1\", \"Trades\")\nsqlDelete(Trades, <symbol=`A>).eval()\nselect count(*) from Trades;\n\n// output: 750000\n```\n\nExample 3. Delete records using table joins. The following example deletes records from t2 that have a matching id in both t1 and t2, where the flag in t1 is equal to 1.\n\n```\nt1 = table(1..5 as id, [1,2,2,1,1] as flag)\nt2 = table(3..7 as id, [100,200,100,150,100] as profit)\nsqlDelete(table=t2, where=<flag=1>, from=<ej(t2,t1,`id)>).eval()\nt2\n```\n\n| id | profit |\n| :- | :----- |\n| 3  | 100    |\n| 6  | 150    |\n| 7  | 100    |\n"
    },
    "sqlDS": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sqlDS.html",
        "signatures": [
            {
                "full": "sqlDS(sqlObj, [forcePartition=false])",
                "name": "sqlDS",
                "parameters": [
                    {
                        "full": "sqlObj",
                        "name": "sqlObj"
                    },
                    {
                        "full": "[forcePartition=false]",
                        "name": "forcePartition",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html)\n\n\n\n#### Syntax\n\nsqlDS(sqlObj, \\[forcePartition=false])\n\n#### Details\n\nCreate a list of data sources based on the input SQL metacode. If the table in the SQL metacode has n partitions, *sqlDS* generates n data sources. If the SQL metacode doesn't contain any partitioned table, *sqlDS* returns a tuple containing one data source. This function divides a large file into several partitions, each representing a subset of the data, and returns a tuple of the data source. A data source is generally represented by a code object and serves as a function call that takes metaprogramming as its parameter and returns a table.\n\n#### Parameters\n\n**sqlObj** is SQL metacode. For more details about metacode please refer to the section of [Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n**forcePartition** (optional) is a Boolean value. The default value is false. If it is set to false, the system checks if the query can be splitted into multiple child queries. If not then it won't split the query over partitions and will throw an exception. However, when it is set to true, the system splits the query over partitions and runs the query on selected partitions. Cases when a query cannot be splitted into child queries include (1) the group by columns are not partitioning columns; (2) the order by clause is specified, among others.\n\n#### Returns\n\nA tuple.\n\n#### Examples\n\n```\nn=1000000\ndate=take(2019.01.01..2019.01.03,n)\nsym = take(`C`MS`MS`MS`IBM`IBM`IBM`C`C$SYMBOL,n)\nprice= take(49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29,n)\nqty = take(2200 1900 2100 3200 6800 5400 1300 2500 8800,n)\nt=table(date, sym, price, qty)\n\ndb1=database(\"\",VALUE,2019.01.01..2019.01.03)\ndb2=database(\"\",VALUE,`C`MS`IBM)\ndb=database(\"dfs://stock\",COMPO,[db1,db2])\ntrades=db.createPartitionedTable(t,`trades,`date`sym).append!(t)\n\nds=sqlDS(<select * from trades where date=2019.01.02>);\n\ntypestr ds;\n// output: ANY VECTOR\n\nsize ds;\n// output: 3\n\nds[0];\n// output: DataSource< select [7] * from trades [partition = /stock/20190102/C] >\n\nds[1];\n// output: DataSource< select [7] * from trades [partition = /stock/20190102/IBM] >\n\nds[2];\n// output: DataSource< select [7] * from trades [partition = /stock/20190102/MS] >\n```\n"
    },
    "sqlTuple": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sqlTuple.html",
        "signatures": [
            {
                "full": "sqlTuple(colNames)",
                "name": "sqlTuple",
                "parameters": [
                    {
                        "full": "colNames",
                        "name": "colNames"
                    }
                ]
            }
        ],
        "markdown": "### [sqlTuple](https://docs.dolphindb.com/en/Functions/s/sqlTuple.html)\n\n\n\n#### Syntax\n\nsqlTuple(colNames)\n\n#### Details\n\nGenerate metacode with a tuple expression. The elements of the tuple are specified by *colNames*. `sqlTuple` is usually used with `sql` and `makeUnifiedCall` to dynamically generate SQL statements.\n\n#### Parameters\n\n**colNames** is a STRING scalar/vector indicating column names.\n\n#### Returns\n\nA CODE scalar.\n\n#### Examples\n\nIn the following example, the parameter *args* of `makeUnifiedCall` is tuple metacode generated using `sqlTuple`, and *func* is a user-defined function. The result of `makeUnifiedCall` is passed as the parameter *select* of function `sql` to generate SQL metacode `c`.\n\n```\n// Create a user-defined function\nf = def (x,y)->(x-y)/(x+y)\n\n// Create a table for query\nt = table(1.0 2.0 3.0 as qty1, 1.0 3.0 7.0 as qty2)\n\n// Generate metacode for query\nc = sql(select=makeUnifiedCall(f, sqlTuple(`qty1`qty2)), from=t)\n\n// Execute the corresponding metacode\nc.eval()\n```\n\n<table id=\"table_ssl_nwc_s1c\"><thead><tr><th align=\"left\">\n\n**\\_qty1**\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\n0\n\n</td></tr><tr><td align=\"left\">\n\n-0.2\n\n</td></tr><tr><td align=\"left\">\n\n-0.4\n\n</td></tr></tbody>\n</table>\n"
    },
    "sqlUpdate": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sqlUpdate.html",
        "signatures": [
            {
                "full": "sqlUpdate(table, updates, [from], [where], [contextBy], [csort], [ascSort], [having])",
                "name": "sqlUpdate",
                "parameters": [
                    {
                        "full": "table",
                        "name": "table"
                    },
                    {
                        "full": "updates",
                        "name": "updates"
                    },
                    {
                        "full": "[from]",
                        "name": "from",
                        "optional": true
                    },
                    {
                        "full": "[where]",
                        "name": "where",
                        "optional": true
                    },
                    {
                        "full": "[contextBy]",
                        "name": "contextBy",
                        "optional": true
                    },
                    {
                        "full": "[csort]",
                        "name": "csort",
                        "optional": true
                    },
                    {
                        "full": "[ascSort]",
                        "name": "ascSort",
                        "optional": true
                    },
                    {
                        "full": "[having]",
                        "name": "having",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [sqlUpdate](https://docs.dolphindb.com/en/Functions/s/sqlUpdate.html)\n\n\n\n#### Syntax\n\nsqlUpdate(table, updates, \\[from], \\[where], \\[contextBy], \\[csort], \\[ascSort], \\[having])\n\n#### Details\n\nDynamically generate a metacode of the SQL update statement. To execute the generated metacode, please use function [eval](https://docs.dolphindb.com/en/Functions/e/eval.html).\n\n#### Parameters\n\n**table** can be an in-memory table or a distributed table.\n\n**update** is a metacode or a tuple of metacode, indicating the updating operation.\n\n**from** (optional) is a metacode indicating the table join operation.\n\n**where** (optional) is a metacode indicating the where condition.\n\n**contextBy** (optional) is a metacode indicating the context by clause.\n\n**csort** (optional) is metacode or a tuple of metacode that specifies the column name(s) followed by `csort`. This parameter only works when *contextBy*is specified.\n\n**ascSort**(optional) is a scalar or vector indicating whether each *csort*column is sorted in ascending or descending order. 1 (default) means ascending and 0 means descending.\n\n**having**(optional) is metacode or a tuple of metacode that specifies the `having` condition(s). This parameter only works when *contextBy*is specified.\n\n#### Returns\n\nA CODE scalar.\n\n#### Examples\n\nExample 1. Update the records in an in-memory table\n\n```\nt1=table(`A`A`B`B as symbol, 2021.04.15 2021.04.16 2021.04.15 2021.04.16 as date, 12 13 21 22 as price)\nt2=table(`A`A`B`B as symbol, 2021.04.15 2021.04.16 2021.04.15 2021.04.16 as date, 10 20 30 40 as volume);\n\nsqlUpdate(t1, <price*2 as updatedPrice>).eval()\nt1;\n```\n\n| symbol | date       | price | updatedPrice |\n| ------ | ---------- | ----- | ------------ |\n| A      | 2021.04.15 | 12    | 24           |\n| A      | 2021.04.16 | 13    | 26           |\n| B      | 2021.04.15 | 21    | 42           |\n| B      | 2021.04.16 | 22    | 44           |\n\n```\nsqlUpdate(table=t1, updates=[<price*10 as updatedPrice>,<price*20 as updatedPrice2>]).eval()\nt1;\n```\n\n| symbol | date       | price | updatedPrice | updatedPrice2 |\n| ------ | ---------- | ----- | ------------ | ------------- |\n| A      | 2021.04.15 | 12    | 120          | 240           |\n| A      | 2021.04.16 | 13    | 130          | 260           |\n| B      | 2021.04.15 | 21    | 210          | 420           |\n| B      | 2021.04.16 | 22    | 220          | 440           |\n\n```\nsqlUpdate(table=t2, updates=<cumsum(volume) as cumVolume>, contextby=<symbol>).eval()\nt2;\n```\n\n| symbol | date       | volume | cumVolume |\n| ------ | ---------- | ------ | --------- |\n| A      | 2021.04.15 | 10     | 10        |\n| A      | 2021.04.16 | 20     | 30        |\n| B      | 2021.04.15 | 30     | 30        |\n| B      | 2021.04.16 | 40     | 70        |\n\n```\nsqlUpdate(table=t1, updates=<updatedPrice*volume as dollarVolume>, from=<lj(t1, t2, `symbol`date)>).eval()\nt1;\n```\n\n| symbol | date       | price | updatedPrice | dollarVolume |\n| ------ | ---------- | ----- | ------------ | ------------ |\n| A      | 2021.04.15 | 12    | 120          | 1200         |\n| A      | 2021.04.16 | 13    | 130          | 2600         |\n| B      | 2021.04.15 | 21    | 42           | 1260         |\n| B      | 2021.04.16 | 22    | 44           | 1760         |\n\n```\nsqlUpdate(table=t2,updates=<cumsum(volume) as cumVolume>,contextBy=<symbol>,csort=<volume>,ascSort=0).eval()\nt2;\n```\n\n| symbol | date       | volume | cumVolume |\n| ------ | ---------- | ------ | --------- |\n| A      | 2021.04.15 | 10     | 30        |\n| A      | 2021.04.16 | 20     | 20        |\n| B      | 2021.04.15 | 30     | 70        |\n| B      | 2021.04.16 | 40     | 40        |\n\nExample 2. Update a DFS table\n\n```\nif(existsDatabase(\"dfs://db1\")){\n    dropDatabase(\"dfs://db1\")\n}\nn=1000000\nt=table(take(`A`B`C`D,n) as symbol, rand(10.0, n) as value)\ndb = database(\"dfs://db1\", VALUE, `A`B`C`D)\nTrades = db.createPartitionedTable(t, \"Trades\", \"symbol\")\nTrades.append!(t)\nx=exec sum(value) from Trades;\n\nTrades=loadTable(\"dfs://db1\", \"Trades\")\nsqlUpdate(table=Trades, updates=<value+1 as value>, where=<symbol=`A>).eval()\ny=exec sum(value) from Trades;\n\ny-x;\n\n// output: 250000\n```\n\nExample 3: Group by store and sort by date to compute cumulative sales per store, but update only the records for stores whose monthly cumulative sales reach 50,000.\n\n```\nsales = table(\n    `store101`store101`store101`store205`store205`store205 as storeId,\n    2024.06.01 2024.06.02 2024.06.03 2024.06.01 2024.06.02 2024.06.03 as bizDate,\n    18000.0 22000.0 15000.0 16000.0 12000.0 9000.0 as salesAmt,\n    take(double(NULL), 6) as cumSalesAmt\n)\n​\nsqlUpdate(\n    table=sales,\n    updates=<cumsum(salesAmt) as cumSalesAmt>,\n    contextBy=<storeId>,\n    csort=<bizDate>,\n    having=<sum(salesAmt) >= 50000>\n).eval()\n​\nsales\n```\n\nOutput:\n\n| storeId  | bizDate    | salesAmt | cumSalesAmt |\n| -------- | ---------- | -------- | ----------- |\n| store101 | 2024.06.01 | 18,000   | 18,000      |\n| store101 | 2024.06.02 | 22,000   | 40,000      |\n| store101 | 2024.06.03 | 15,000   | 55,000      |\n| store205 | 2024.06.01 | 16,000   |             |\n| store205 | 2024.06.02 | 12,000   |             |\n| store205 | 2024.06.03 | 9,000    |             |\n\n* *having* can only be used with *contextBy*.\n* For store101, the group’s total sales amount is 55,000, which meets `sum(salesAmt) ≥ 50,000`, so cumSalesAmt is updated with the cumulative values sorted by bizDate.\n* For store205, the group’s total sales amount is 37,000, which does not meet the threshold, so this group’s records are not updated, and cumSalesAmt remains NULL.\n"
    },
    "sqrt": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sqrt.html",
        "signatures": [
            {
                "full": "sqrt(X)",
                "name": "sqrt",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sqrt](https://docs.dolphindb.com/en/Functions/s/sqrt.html)\n\n\n\n#### Syntax\n\nsqrt(X)\n\n#### Details\n\nReturn the square root of each element in *X*. The data type of the result is always DOUBLE.\n\nDifference from Python’s `numpy.sqrt`: Both functions calculate square roots. DolphinDB’s `sqrt` returns DOUBLE values, and negative inputs produce NULL values. `numpy.sqrt` is a ufunc. Negative real inputs usually return `nan`, and complex inputs can return complex results.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar, vector, or matrix.\n\n#### Examples\n\n```\nsqrt(4 16 -4 NULL);\n// output: [2,4, , ]\n\ntypestr(sqrt(4));\n// output: DOUBLE\n```\n"
    },
    "square": {
        "url": "https://docs.dolphindb.com/en/Functions/s/square.html",
        "signatures": [
            {
                "full": "square(X)",
                "name": "square",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [square](https://docs.dolphindb.com/en/Functions/s/square.html)\n\n\n\n#### Syntax\n\nsquare(X)\n\n#### Details\n\nReturn the square of *X*. The data type of the result is always DOUBLE.\n\nDifferences from Python’s `numpy.square` and `scipy.signal.square`: `numpy.square` calculates squares, is a ufunc, determines the return *dtype* according to NumPy type rules, and supports complex numbers, broadcasting, *out*, *where*, and other ufunc arguments. `scipy.signal.square` generates a periodic square-wave signal, where the input is time *t* and the duty cycle *duty*. DolphinDB’s `square` returns the square of *X* as DOUBLE values.\n\n#### Parameters\n\n**X** is a scalar/pair/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar, pair, vector, or matrix.\n\n#### Examples\n\n```\nsquare(3);\n// output: 9\n\nsquare(2 4 NULL 6);\n// output: [4,16,,36]\n\nsquare(1..4$2:2);\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 9  |\n| 4  | 16 |\n"
    },
    "startClusterReplication": {
        "url": "https://docs.dolphindb.com/en/Functions/s/startClusterReplication.html",
        "signatures": [
            {
                "full": "startClusterReplication()",
                "name": "startClusterReplication",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [startClusterReplication](https://docs.dolphindb.com/en/Functions/s/startClusterReplication.html)\n\n#### Syntax\n\nstartClusterReplication()\n\n#### Details\n\nStarts the cluster replication that was stopped due to repeated failures or by calling `stopClusterReplication`.\n\nIt can only be executed by an administrator on the controller of a master/slave cluster. The configuration parameter *replicationMode* should be specified before you execute this command.\n\n#### Parameters\n\nNone\n\n#### Examples\n\n```\nstartClusterReplication();\n```\n\nRelated functions: [stopClusterReplication](https://docs.dolphindb.com/en/Functions/s/stopClusterReplication.html), [skipClusterReplicationTask](https://docs.dolphindb.com/en/Functions/s/skipClusterReplicationTask.html)\n\n"
    },
    "startDataNode": {
        "url": "https://docs.dolphindb.com/en/Functions/s/startDataNode.html",
        "signatures": [
            {
                "full": "startDataNode(X)",
                "name": "startDataNode",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [startDataNode](https://docs.dolphindb.com/en/Functions/s/startDataNode.html)\n\n\n\n#### Syntax\n\nstartDataNode(X)\n\n#### Details\n\nStart data nodes/compute nodes on a cluster controller.\n\n#### Parameters\n\n**X** is a vector, which contains information about the data nodes/compute nodes to be started.\n\n#### Examples\n\n```\nx = [\"192.168.1.27:8506\",\"192.168.1.27:8502\",\"192.168.1.27:8527\"]\nstartDataNode(x);\n```\n"
    },
    "startHeapSample": {
        "url": "https://docs.dolphindb.com/en/Functions/s/startHeapSample.html",
        "signatures": [
            {
                "full": "startHeapSample(sampleParameter)",
                "name": "startHeapSample",
                "parameters": [
                    {
                        "full": "sampleParameter",
                        "name": "sampleParameter"
                    }
                ]
            }
        ],
        "markdown": "### [startHeapSample](https://docs.dolphindb.com/en/Functions/s/startHeapSample.html)\n\n\n\n#### Syntax\n\nstartHeapSample(sampleParameter)\n\n#### Details\n\nThis function dynamically enables heap memory sampling. It sets the TCMALLOC\\_SAMPLE\\_PARAMETER environment variable, allowing developers to monitor and analyze the program's memory usage. Only administrators can execute this function.\n\n#### Parameters\n\n**sampleParameter** is a LONG integer ranging from 1 to 524,288, indicating the approximate gap between sampling actions in bytes. The system takes one sample approximately once every *sampleParmeter* bytes of allocation. A reasonable value is 524288.\n\n#### Examples\n\nRecommended workflow for memory usage analysis:\n\n1. Enable heap memory sampling: This can be done by setting the environment variable TCMALLOC\\_SAMPLE\\_PARAMETER to a value between 1 and 524288 (recommended: 524288) before starting DolphinDB; or by dynamically enabling it using `startHeapSample`.\n2. Execute `dumpHeapSample` before and after operations that may cause memory leaks, saving to two different files. Compare these files to confirm memory allocation and usage related to the operation.\n3. Disable heap memory sampling.\n\n```\nstartHeapSample(524288)\n\ndumpHeapSample(\"/DolphinDB/Data/heap1\")\ndumpHeapSample(\"/DolphinDB/Data/heap2\")\n\nstopHeapSample()\n```\n\nRelated functions: [dumpHeapSample](https://docs.dolphindb.com/en/Functions/d/dumpHeapSample.html), [stopHeapSample](https://docs.dolphindb.com/en/Functions/s/stopHeapSample.html)\n"
    },
    "startStreamGraph": {
        "url": "https://docs.dolphindb.com/en/Functions/s/startStreamGraph.html",
        "signatures": [
            {
                "full": "startStreamGraph(name)",
                "name": "startStreamGraph",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [startStreamGraph](https://docs.dolphindb.com/en/Functions/s/startStreamGraph.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nstartStreamGraph(name)\n\n#### Details\n\nRestart the specified stream graph. After successful execution, the stream graph status will be set to running. You can check the status through `getStreamGraphMeta`.\n\nWhen using this feature, it is recommended to explicitly set the data source consumption policy (subscription.sourceOffset) via `setConfigMap` to control how data is handled during pauses.\n\n* sourceOffset = -1 (recommended): Upon restarting the stream graph, consumption resumes from the latest record in the source table. Data ingested during the pause is ignored. Suitable for scenarios where only real-time data is required and historical data during the pause can be discarded.\n* sourceOffset = -3 (default, use with caution): Upon restarting the stream graph, consumption restarts from the first record in the source table, replaying all historical data. This may consume significant resources and cause duplicate computations. Suitable for scenarios where absolute data completeness is required and the source table size is manageable.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nNone\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\n\nuse catalog orca\n\ndef callTimes(mutable call, mutable tempTable, msg) {\n    call += 1\n    price = [call]\n    volume = [call]\n    t = table(price, volume)\n    tempTable.append!(t)\n    return t\n}\nname = \"UDF\"\ng = createStreamGraph(name)\nckptConfig = {\n    \"enable\":true,\n    \"interval\": 10000,\n    \"timeout\": 36000,\n    \"maxConcurrentCheckpoints\": 1\n};\n\ng.source(\"trade\", `price`volume, [INT,INT])\n .udfEngine(callTimes,[\"price\", \"volume\"], [`cnt, `tmpTable], [433, table(128:0, [\"price\",\"volume\"], [INT, INT])])\n .setEngineName(\"udf\")\n .sink(\"output\")\ng.submit(ckptConfig)\ngo\ngetStreamGraphMeta()\nstopStreamGraph(\"UDF\")\nstartStreamGraph(\"UDF\") \n```\n\n**Related functions:** [createStreamGraph](https://docs.dolphindb.com/en/Functions/c/createStreamGraph.html), [stopStreamGraph](https://docs.dolphindb.com/en/Functions/s/stopStreamGraph.html)\n"
    },
    "startsWith": {
        "url": "https://docs.dolphindb.com/en/Functions/s/startsWith.html",
        "signatures": [
            {
                "full": "startsWith(X, str)",
                "name": "startsWith",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "str",
                        "name": "str"
                    }
                ]
            }
        ],
        "markdown": "### [startsWith](https://docs.dolphindb.com/en/Functions/s/startsWith.html)\n\n\n\n#### Syntax\n\nstartsWith(X, str)\n\n#### Details\n\nCheck if *X* starts with *str*. If yes, return true; otherwise return false.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n**str** is a string scalar.\n\n#### Returns\n\nA Boolean value.\n\n#### Examples\n\n```\nstr1=\"US product\"\nstr2=\"UK product\"\nif (startsWith(str1, \"US\")) print \"str1 is a US product.\"\nelse print \"str1 is not a US product.\"\nif (startsWith(str2, \"US\")) print \"str2 is a US product.\"\nelse print \"str2 is not a US product.\";\n\n/* output:\nstr1 is a US product.\nstr2 is not a US product.\n*/\n```\n"
    },
    "stat": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stat.html",
        "signatures": [
            {
                "full": "stat(X)",
                "name": "stat",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [stat](https://docs.dolphindb.com/en/Functions/s/stat.html)\n\n\n\n#### Syntax\n\nstat(X)\n\n#### Details\n\nReturn a dictionary about the descriptive statistics of *X* including avg(mean), max, min, count, median, and stdev.\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n#### Returns\n\nA dictionary containing statistics of X, including average, maximum, minimum, count, median, and standard deviation.\n\n#### Examples\n\n```\nx=5 7 4 3 2 1 7 8 9 NULL;\n\nstat(x);\n/* output:\nMedian->5\nAvg->5.111111\nMin->1\nStdev->2.803767\nCount->9\nSize->10\nName->x\nMax->9\n*/\n\nstats = stat(x);\nstats[`Avg];\n// output: 5.111111\n```\n"
    },
    "stateIterate": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stateIterate.html",
        "signatures": [
            {
                "full": "stateIterate(X, initial, initialWindow, iterateFunc, combineCoeff)",
                "name": "stateIterate",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "initial",
                        "name": "initial"
                    },
                    {
                        "full": "initialWindow",
                        "name": "initialWindow"
                    },
                    {
                        "full": "iterateFunc",
                        "name": "iterateFunc"
                    },
                    {
                        "full": "combineCoeff",
                        "name": "combineCoeff"
                    }
                ]
            }
        ],
        "markdown": "### [stateIterate](https://docs.dolphindb.com/en/Functions/s/stateIterate.html)\n\n\n\n#### Syntax\n\nstateIterate(X, initial, initialWindow, iterateFunc, combineCoeff)\n\nThis function can only be used as a state function in the reactive state engine.\n\n#### Details\n\nSupposing the iteration is based only on the previous result, for the k-th (k ∈ N+) record, the calculation logic is (where the column \"factor\" holds the results):\n\n* k < initialWindow: factor\\[k] = initial\\[k]\n\n* k >= initialWindow:factor\\[k] = combineCoeff\\[0] \\* X\\[k] + combineCoeff\\[1] \\* iterateFunc(factor)\\[k-1]\n\nIf *iterateFunc* is a window function, the iteration is based on multiple previous results.\n\n#### Parameters\n\n**X** is a vector. It can be a column from the engine's input table, or the result of a vectorized function with the column as its input argument.\n\n**initial** is a vector used to fill the first *initialWindow* values in the corresponding result column of the engine's output table. It can be a column from the engine's input table, or the result of a vectorized function with the column as its input argument.\n\n**initialWindow** is a positive integer determining the initial window size \\[0, *initialWindow*).\n\n**iterateFunc** is the function for iteration, whose only parameter is the column from the output table. Currently, only the following functions are supported (use partial application to specify functions with multiple parameters):\n\n* Moving functions: tmove, tmavg, tmmax, tmmin, tmsum, mavg, mmax, mmin, mcount, msum\n\n* Cumulative window functions: cumlastNot, cumfirstNot\n\n* Order-sensitive functions: ffill, move\n\n**Note:**\n\n* As the iterations are performed based on the historical data, the output for the current record is calculated based on the historical results in the output table and *X*.\n\n* When calculating with time-based moving windows, windows are determined by the current timestamp T, and the interval is (T - window, T).\n\n**combineCoeff** is a vector of length 2. The elements indicate the correlation coefficients between the result of *interateFunc* and *X*.\n\n#### Examples\n\n```\ntrade = table(take(\"A\", 6) join take(\"B\", 6) as sym,  1..12 as val0,  take(10, 12) as val1)\ntrade;\n```\n\n| sym | val0 | val1 |\n| --- | ---- | ---- |\n| A   | 1    | 10   |\n| A   | 2    | 10   |\n| A   | 3    | 10   |\n| A   | 4    | 10   |\n| A   | 5    | 10   |\n| A   | 6    | 10   |\n| B   | 7    | 10   |\n| B   | 8    | 10   |\n| B   | 9    | 10   |\n| B   | 10   | 10   |\n| B   | 11   | 10   |\n| B   | 12   | 10   |\n\nThe following example defines a reactive state streaming engine and conducts the calculation within each group of sym.\n\n* For the 1st initialWindow records, the formula is *factor\\[k]=initial\\[k]*. So the factor\\[0], factor\\[1], factor\\[2] records take the value of val1.\n\n* For the subsequent records, the formula is *factor\\[k]=0.5\\*val0\\[k]+0.5\\*msum(factor, 3)\\[k-1]*.\n\nFor the 4th record (sym=\\`A, val0=4) in the output table, there are 3 historical values in the factor column (\\[10,10,10]). Therefore, for the current record, the output is *0.5\\*4+0.5\\*msum(\\[10, 10, 10], 3)\\[2]=17*. Similarly, for the record (sym=\\`A, val0=5), the output is *0.5\\*5+0.5\\*msum(\\[10, 10, 10, 17], 3)\\[3]=21*.\n\n```\ninputTable = streamTable(1:0, `sym`val0`val1, [SYMBOL, INT, INT])\noutputTable = table(100:0, `sym`factor, [STRING, DOUBLE])\nengine = createReactiveStateEngine(name=\"rsTest\", metrics=<[stateIterate(val0, val1, 3, msum{, 3}, [0.5, 0.5])]>, dummyTable=inputTable, outputTable=outputTable, keyColumn=[\"sym\"], keepOrder=true)\n\nengine.append!(trade)\nselect * from outputTable\n```\n\n| sym | factor |\n| --- | ------ |\n| A   | 10     |\n| A   | 10     |\n| A   | 10     |\n| A   | 17     |\n| A   | 21     |\n| A   | 27     |\n| B   | 10     |\n| B   | 10     |\n| B   | 10     |\n| B   | 20     |\n| B   | 25.5   |\n| B   | 33.75  |\n"
    },
    "std": {
        "url": "https://docs.dolphindb.com/en/Functions/s/std.html",
        "signatures": [
            {
                "full": "std(X)",
                "name": "std",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [std](https://docs.dolphindb.com/en/Functions/s/std.html)\n\n\n\n#### Syntax\n\nstd(X)\n\n#### Details\n\nIf *X* is a vector, return the (unbiased) sample standard deviation of *X*.\n\nIf *X* is a matrix, calculate the (unbiased) sample standard deviation of each column of *X* and return a vector.\n\nIf *X* is a table, calculate the (unbiased) sample standard deviation of each column of *X* and return a table.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\n**Note:** The result is sample standard deviation instead of population standard deviation.\n\nDifference from Python’s `numpy.std`: `numpy.std` calculates the population standard deviation by default (*ddof*=0). DolphinDB’s `std` returns the unbiased sample standard deviation, equivalent to *ddof*=1. DolphinDB also ignores NULL values and calculates column-wise for matrices and tables.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA scalar, vector, or table.\n\n#### Examples\n\n```\nstd(1 2 3);\n// output: 1\n\nm=matrix(1 3 5 7 9, 1 4 7 10 13);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 3  | 4  |\n| 5  | 7  |\n| 7  | 10 |\n| 9  | 13 |\n\n```\nstd(m);\n// output: [3.162277660168379,4.743416490252569]\n```\n"
    },
    "stdp": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stdp.html",
        "signatures": [
            {
                "full": "stdp(X)",
                "name": "stdp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [stdp](https://docs.dolphindb.com/en/Functions/s/stdp.html)\n\n\n\n#### Syntax\n\nstdp(X)\n\n#### Details\n\nIf *X* is a vector, return the population standard deviation of *X*.\n\nIf *X* is a matrix, calculate the population standard deviation of each column and return a vector.\n\nIf *X* is a table, calculate the population standard deviation of each column and return a table.\n\nAs with all other aggregate functions, null values are not included in the calculation.\n\n#### Parameters\n\n**X** is a vector/matrix/table.\n\n#### Returns\n\nA scalar, vector, or table.\n\n#### Examples\n\n```\nstdp(1 2 3);\n// output: 0.816497\n\nm=matrix(1 3 5 7 9, 1 4 7 10 13);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 3  | 4  |\n| 5  | 7  |\n| 7  | 10 |\n| 9  | 13 |\n\n```\nstdp(m);\n// output: [2.8284,4.2426]\n```\n"
    },
    "stl": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stl.html",
        "signatures": [
            {
                "full": "stl(data, period, sWindow, [sDegree], [sJump], [tWindow], [tDegree], [tJump], [lWindow], [lDegree], [lJump], [robust], [inner], [outer])",
                "name": "stl",
                "parameters": [
                    {
                        "full": "data",
                        "name": "data"
                    },
                    {
                        "full": "period",
                        "name": "period"
                    },
                    {
                        "full": "sWindow",
                        "name": "sWindow"
                    },
                    {
                        "full": "[sDegree]",
                        "name": "sDegree",
                        "optional": true
                    },
                    {
                        "full": "[sJump]",
                        "name": "sJump",
                        "optional": true
                    },
                    {
                        "full": "[tWindow]",
                        "name": "tWindow",
                        "optional": true
                    },
                    {
                        "full": "[tDegree]",
                        "name": "tDegree",
                        "optional": true
                    },
                    {
                        "full": "[tJump]",
                        "name": "tJump",
                        "optional": true
                    },
                    {
                        "full": "[lWindow]",
                        "name": "lWindow",
                        "optional": true
                    },
                    {
                        "full": "[lDegree]",
                        "name": "lDegree",
                        "optional": true
                    },
                    {
                        "full": "[lJump]",
                        "name": "lJump",
                        "optional": true
                    },
                    {
                        "full": "[robust]",
                        "name": "robust",
                        "optional": true
                    },
                    {
                        "full": "[inner]",
                        "name": "inner",
                        "optional": true
                    },
                    {
                        "full": "[outer]",
                        "name": "outer",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [stl](https://docs.dolphindb.com/en/Functions/s/stl.html)\n\n\n\n#### Syntax\n\nstl(data, period, sWindow, \\[sDegree], \\[sJump], \\[tWindow], \\[tDegree], \\[tJump], \\[lWindow], \\[lDegree], \\[lJump], \\[robust], \\[inner], \\[outer])\n\n#### Details\n\nUse Loess method to decompose a time series into trend, seasonality and randomness. The result is a dictionary with the following keys: trend, seasonal, and residuals. Each key corresponds to a vector with the same length as data.\n\n#### Parameters\n\n**data** is a numeric vector.\n\n**period** is an integer larger than 1 indicating the length of a time-series cycle.\n\n**sWindow** is either the string \"periodic\" that means smoothing is effectively replaced by taking the mean, or an odd number no smaller than 7 indicating the span (in lags) of the loess window for seasonal extraction.\n\n**sDegree** (optional) can be 0, 1 or 2 indicating the degree of locally-fitted polynomial in seasonal extraction. The default value is 1.\n\n**sJump** (optional) is an integer greater than 1 indicating the number of elements to skip for the smoother in seasonal extraction. The default value is ceil(sWindow/10).\n\n**tWindow** (optional) is a positive odd number indicating the span (in lags) of the loess window for trend extraction. The default value is the next odd number after 1.5 \\* period / (1 - (1.5 / sWindow)).\n\n**tDegree** (optional) can be 0, 1 or 2 indicating the degree of locally-fitted polynomial in trend extraction. The default value is 1.\n\n**tJump** (optional) is an integer greater than 1 indicating the number of elements to skip for the smoother in trend extraction. The default value is ceil(sWindow/10).\n\n**lWindow** (optional) is a positive odd number indicating the the span (in lags) of the loess window of the low-pass filter used for each subseries. The default value is the next odd number after period.\n\n**lDegree** (optional) can be 0, 1 or 2 indicating the degree of locally-fitted polynomial for the subseries low-pass filter. The default value is 1.\n\n**lJump** (optional) is an integer greater than 1 indicating the number of elements to skip for the smoother in the subseries low-pass filter. The default value is ceil(sWindow/10).\n\n**robust** (optional) is a Boolean value indicating if robust fitting is used in the loess procedure. The default value is false.\n\n**inner** (optional) is a positive integer indicating the number of 'inner' (backfitting) iterations; usually very few (2) iterations suffice. If *robust*=true, the default value of *inner* is 1; if *robust*=false, the default value of *inner* is 2.\n\n**outer** (optional) is a positive integer indicating the number of 'outer' robustness iterations. If *robust*=true, the default value of *outer* is 15; if *robust*=false, the default value of *outer* is 0.\n\n#### Returns\n\nA dictionary with the following keys: trend, seasonal, and residuals. Each key corresponds to a vector with the same length as data.\n\n#### Examples\n\n```\nn = 100\ntrend = 6 * sin(1..n \\ 200)\nseasonal = sin(pi / 6 * 1..n)\nresiduals = rand(1.0, n) - 0.5\ndata = trend + seasonal + residuals\nres = stl(data, 12, \"periodic\");\n\nplot([trend, res.trend]);\n```\n\n![](https://docs.dolphindb.com/en/images/stl01.png)\n\n```\nplot([seasonal, res.seasonal]);\n```\n\n![](https://docs.dolphindb.com/en/images/stl02.png)\n"
    },
    "stopClusterReplication": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stopClusterReplication.html",
        "signatures": [
            {
                "full": "stopClusterReplication()",
                "name": "stopClusterReplication",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [stopClusterReplication](https://docs.dolphindb.com/en/Functions/s/stopClusterReplication.html)\n\n#### Syntax\n\nstopClusterReplication()\n\n#### Details\n\nStops cluster replication.\n\nIt can only be executed by an administrator on the controller.\n\n* If it is called in the master cluster, subsequent tasks will not be put in the push queue.\n\n* If it is called in the slave cluster, new tasks are no longer pulled from the master cluster, but tasks in execution are not stopped.\n\nThe configuration parameter *replicationMode* should be specified before you execute this command.\n\n#### Parameters\n\nNone\n\n#### Examples\n\n```\nstopClusterReplication();\n```\n\nRelated functions: [startClusterReplication](https://docs.dolphindb.com/en/Functions/s/startClusterReplication.html), [skipClusterReplicationTask](https://docs.dolphindb.com/en/Functions/s/skipClusterReplicationTask.html)\n\n"
    },
    "stopDataNode": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stopDataNode.html",
        "signatures": [
            {
                "full": "stopDataNode(X)",
                "name": "stopDataNode",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [stopDataNode](https://docs.dolphindb.com/en/Functions/s/stopDataNode.html)\n\n\n\n#### Syntax\n\nstopDataNode(X)\n\n#### Details\n\nStop data nodes/compute nodes on a cluster controller.\n\n#### Parameters\n\n**X** is a vector, which contains information about the data nodes/compute nodes to be stopped.\n\n#### Examples\n\n```\nx = [\"192.168.1.27:8506\",\"192.168.1.27:8502\",\"192.168.1.27:8527\"]\nstopDataNode(x);\n```\n"
    },
    "stopHeapSample": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stopHeapSample.html",
        "signatures": [
            {
                "full": "stopHeapSample()",
                "name": "stopHeapSample",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [stopHeapSample](https://docs.dolphindb.com/en/Functions/s/stopHeapSample.html)\n\n\n\n#### Syntax\n\nstopHeapSample()\n\n#### Details\n\nThis function dynamically disables heap memory sampling. Only administrators can execute this function.\n\n#### Parameters\n\nNone.\n\n#### Examples\n\nRecommended workflow for memory usage analysis:\n\n1. Enable heap memory sampling: This can be done by setting the environment variable TCMALLOC\\_SAMPLE\\_PARAMETER to a value between 1 and 524288 (recommended: 524288) before starting DolphinDB; or by dynamically enabling it using `startHeapSample`.\n2. Execute `dumpHeapSample` before and after operations that may cause memory leaks, saving to two different files. Compare these files to confirm memory allocation and usage related to the operation.\n3. Disable heap memory sampling.\n\n```\nstartHeapSample(524288)\n\ndumpHeapSample(\"/DolphinDB/Data/heap1\")\ndumpHeapSample(\"/DolphinDB/Data/heap2\")\n\nstopHeapSample()\n```\n\nRelated functions: [dumpHeapSample](https://docs.dolphindb.com/en/Functions/d/dumpHeapSample.html), [startHeapSample](https://docs.dolphindb.com/en/Functions/s/startHeapSample.html)\n"
    },
    "stopStreamGraph": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stopStreamGraph.html",
        "signatures": [
            {
                "full": "stopStreamGraph(name)",
                "name": "stopStreamGraph",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [stopStreamGraph](https://docs.dolphindb.com/en/Functions/s/stopStreamGraph.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nstopStreamGraph(name)\n\n#### Details\n\nSuspend the specified stream graph. After successful execution, the stream graph status will be set to stopped.\n\nYou can check the status through `getStreamGraphMeta`.\n\n#### Parameters\n\n**name** is a string representing the name of the stream graph. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_graph.graph\\_name\", or just the graph name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nNone\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\n\nuse catalog orca\n\ndef callTimes(mutable call, mutable tempTable, msg) {\n    call += 1\n    price = [call]\n    volume = [call]\n    t = table(price, volume)\n    tempTable.append!(t)\n    return t\n}\nname = \"UDF\"\ng = createStreamGraph(name)\nckptConfig = {\n    \"enable\":true,\n    \"interval\": 10000,\n    \"timeout\": 36000,\n    \"maxConcurrentCheckpoints\": 1\n};\n\ng.source(\"trade\", `price`volume, [INT,INT])\n .udfEngine(callTimes,[\"price\", \"volume\"], [`cnt, `tmpTable], [433, table(128:0, [\"price\",\"volume\"], [INT, INT])])\n .setEngineName(\"udf\")\n .sink(\"output\")\ng.submit(ckptConfig)\ngo\ngetStreamGraphMeta()\nstopStreamGraph(\"UDF\")\nstartStreamGraph(\"UDF\") \n```\n\n**Related functions:** [createStreamGraph](https://docs.dolphindb.com/en/Functions/c/createStreamGraph.html), [startStreamGraph](https://docs.dolphindb.com/en/Functions/s/startStreamGraph.html)\n"
    },
    "stopTimerEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stopTimerEngine.html",
        "signatures": [
            {
                "full": "stopTimerEngine(engine)",
                "name": "stopTimerEngine",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    }
                ]
            }
        ],
        "markdown": "### [stopTimerEngine](https://docs.dolphindb.com/en/Functions/s/stopTimerEngine.html)\n\n\n\n#### Syntax\n\nstopTimerEngine(engine)\n\n#### Details\n\nThis function can only be called via `useOrcaStreamEngine` and stops execution of jobs submitted by `DStream::timerEngine`.\n\n#### Parameters\n\n**engine** A STRING scalar representing the engine name. You can provide either the fully qualified name (e.g., \"catalog\\_name.orca\\_engine.engine\\_name\"), or just the engine name (e.g., \"engine\\_name\") when the system will automatically complete it to the corresponding fully qualified name based on the current catalog setting.\n\n#### Examples\n\nSubmit the job:\n\n```\nif (!existsCatalog(\"test\")) {\n\tcreateCatalog(\"test\")\t\n}\ngo\nuse catalog test\n\n// Define the job\ndef myFunc(x,y,z){\n    writeLog(x,y,z)\n}\n\n// Define the parameter\na = \"aaa\"\nb = \"bbb\"\nc = \"ccc\"\n\n// Submit the steam graph\ng = createStreamGraph(\"timerEngineDemo\")\ng.source(\"trade\", `id`price, [INT, DOUBLE])\n .timerEngine(3, myFunc, a, b, c)\n .setEngineName(\"myJob\")\n .sink(\"result\")\ng.submit()\n```\n\nStop job execution:\n\n```\nuseOrcaStreamEngine(\"myJob\", stopTimerEngine)\n```\n\nResume job execution:\n\n```\nuseOrcaStreamEngine(\"myJob\", resumeTimerEngine)\n```\n\n**Related functions:**[DStream::timerEngine](https://docs.dolphindb.com/en/Functions/d/DStream_timerEngine.html), [resumeTimerEngine](https://docs.dolphindb.com/en/Functions/r/resumeTimerEngine.html)\n"
    },
    "stopSubEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stop_subengine.html",
        "signatures": [
            {
                "full": "stopSubEngine()",
                "name": "stopSubEngine",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [stopSubEngine](https://docs.dolphindb.com/en/Functions/s/stop_subengine.html)\n\n\n\n#### Syntax\n\nstopSubEngine()\n\n#### Details\n\nTo stop event processing operations within a specific sub-engine, you can call `stopSubEngine()` in any of its monitor instances.\n\nBefore the sub-engine is stopped, the following actions occur:\n\n1. If there are spawned monitor instances, the engine will invoke the `onDestroy()` function defined in those spawned monitor instances first.\n\n2. The engine executes all `onunload()` functions (if defined) declared in the monitor instance.\n\n#### Parameters\n\nNone\n"
    },
    "streamEngineParser": {
        "url": "https://docs.dolphindb.com/en/Functions/s/streamEngineParser.html",
        "signatures": [
            {
                "full": "streamEngineParser(name, metrics, dummyTable, outputTable, keyColumn, [timeColumn], [useSystemTime=false], [snapshotDir], [snapshotIntervalInMsgCount], [raftGroup], [filter], [keepOrder], [keyPurgeFilter], [keyPurgeFreqInSecond], [triggeringPattern='perBatch'], [triggeringInterval=1000], [lastBatchOnly=false], [contextByColumn], [updateTime], [useWindowStartTime=false], [roundTime=true], [forceTriggerTime], [sessionBegin], [sessionEnd], [mergeSessionEnd=false], [closed='left'], [fill='none'], [garbageSize], [forceTriggerSessionEndTime], [keyPurgeFreqInSec=-1])",
                "name": "streamEngineParser",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "metrics",
                        "name": "metrics"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[useSystemTime=false]",
                        "name": "useSystemTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[snapshotDir]",
                        "name": "snapshotDir",
                        "optional": true
                    },
                    {
                        "full": "[snapshotIntervalInMsgCount]",
                        "name": "snapshotIntervalInMsgCount",
                        "optional": true
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[filter]",
                        "name": "filter",
                        "optional": true
                    },
                    {
                        "full": "[keepOrder]",
                        "name": "keepOrder",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFilter]",
                        "name": "keyPurgeFilter",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSecond]",
                        "name": "keyPurgeFreqInSecond",
                        "optional": true
                    },
                    {
                        "full": "[triggeringPattern='perBatch']",
                        "name": "triggeringPattern",
                        "optional": true,
                        "default": "'perBatch'"
                    },
                    {
                        "full": "[triggeringInterval=1000]",
                        "name": "triggeringInterval",
                        "optional": true,
                        "default": "1000"
                    },
                    {
                        "full": "[lastBatchOnly=false]",
                        "name": "lastBatchOnly",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[contextByColumn]",
                        "name": "contextByColumn",
                        "optional": true
                    },
                    {
                        "full": "[updateTime]",
                        "name": "updateTime",
                        "optional": true
                    },
                    {
                        "full": "[useWindowStartTime=false]",
                        "name": "useWindowStartTime",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[roundTime=true]",
                        "name": "roundTime",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[forceTriggerTime]",
                        "name": "forceTriggerTime",
                        "optional": true
                    },
                    {
                        "full": "[sessionBegin]",
                        "name": "sessionBegin",
                        "optional": true
                    },
                    {
                        "full": "[sessionEnd]",
                        "name": "sessionEnd",
                        "optional": true
                    },
                    {
                        "full": "[mergeSessionEnd=false]",
                        "name": "mergeSessionEnd",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[closed='left']",
                        "name": "closed",
                        "optional": true,
                        "default": "'left'"
                    },
                    {
                        "full": "[fill='none']",
                        "name": "fill",
                        "optional": true,
                        "default": "'none'"
                    },
                    {
                        "full": "[garbageSize]",
                        "name": "garbageSize",
                        "optional": true
                    },
                    {
                        "full": "[forceTriggerSessionEndTime]",
                        "name": "forceTriggerSessionEndTime",
                        "optional": true
                    },
                    {
                        "full": "[keyPurgeFreqInSec=-1]",
                        "name": "keyPurgeFreqInSec",
                        "optional": true,
                        "default": "-1"
                    }
                ]
            }
        ],
        "markdown": "### [streamEngineParser](https://docs.dolphindb.com/en/Functions/s/streamEngineParser.html)\n\n\n\n#### Syntax\n\nstreamEngineParser(name, metrics, dummyTable, outputTable, keyColumn, \\[timeColumn], \\[useSystemTime=false], \\[snapshotDir], \\[snapshotIntervalInMsgCount], \\[raftGroup], \\[filter], \\[keepOrder], \\[keyPurgeFilter], \\[keyPurgeFreqInSecond], \\[triggeringPattern='perBatch'], \\[triggeringInterval=1000], \\[lastBatchOnly=false], \\[contextByColumn], \\[updateTime], \\[useWindowStartTime=false], \\[roundTime=true], \\[forceTriggerTime], \\[sessionBegin], \\[sessionEnd], \\[mergeSessionEnd=false], \\[closed='left'], \\[fill='none'], \\[garbageSize], \\[forceTriggerSessionEndTime], \\[keyPurgeFreqInSec=-1])\n\n#### Details\n\nThe stream engine parser provides a unified interface for computing complex metrics over stream data. These metrics often require logic involving cross-sectional computation, stateful computation, windowing calculations over time series, table joins, and more. To handle such computational tasks, multiple streaming engines need to be combined into a pipeline. With the stream engine parser, you don't need to manually define and connect engines in a specific order. Instead, you only need to rewrite your metrics following a set of rules. The stream engine parser analyzes the metric expressions and automatically constructs a computational pipeline by combining the appropriate engines.\n\nAs the stream engine parser integrates DolphinDB's time-series, reactive state, and cross-sectional engines, it provides parameters for configuring each engine. Some parameters, like *keyColumn*, are shared across the engines. However, if you need to set different values for the shared parameters per engine, the stream engine parser cannot be used. In these cases, you'll need to manually build a cascade of engines.\n\n`streamEngineParser` returns a table object. It is the table returned by the first streaming engine in the auto-generated pipeline. Appending data to this table means that data enters the engine pipeline for processing. Note that there is no function to delete the entire pipeline at once. The engines created by the stream engine parser must be deleted individually by name (see **Arguments** -> *name*) after use.\n\nAs mentioned earlier, the parser requires metrics to be written using specific functions or syntax rules. In this way, metrics can be translated into executable logic that is mapped to the appropriate streaming engines. For metrics with user-defined functions, the stream engine parser will analyze the function body logic.\n\nWhen parsing a metric, the parser follows the following rules:\n\n1. **It looks for function signifiers indicating the engine type**\n\n   * If a metric involves cross-sectional computation, the corresponding function must be a function signifier (often a function with the `row-` prefix). For example, to compute the sorted order of elements in each row, the `rowRank` function must be used to implement this layer of logic.\n\n     Supported function signifiers for cross-sectional computation include:\n\n     ```\n     \"byRow\", \"rowAvg\", \"rowCount\", \"count\", \"rowDenseRank\",\n     \"rowMax\", \"rowMin\", \"rowProd\", \"rowRank\", \"rowSize\", \"rowSkew\", \"rowStd\", \"rowStdp\", \"rowSum\", \"rowSum2\",\n     \"rowVar\", \"rowVarp\", \"rowAnd\", \"rowOr\", \"rowXor\", \"rowKurtosis\", \"rowCorr\", \"rowCovar\",\n     \"rowBeta\", \"rowWsum\", \"rowWavg\"\n     ```\n\n     For logic not expressible with `row-` functions or must be expressed with user-defined functions, you can use the `byRow` higher-order function.\n\n   * If a metric involves windowing aggregation over time series, use the `rolling` higher-order function. For example, to calculate a rolling 3-element sum stepped by 3 elements on the \"price\" column using forward filling, specify `rolling(sum,price,3,3,`ffill`)`.\n\n     Syntax of `rolling`:\n\n     ```\n     rolling(func, funcArgs, window, [step=1], [fill='none'])\n     ```\n\n   * Built-in functions without the above function signifiers will be processed by the reactive state engine.\n\n2. **Input table schema for intermediate engines**\n\n   `streamEngineParser` allows you to specify the schema for only the input table of the first parsed engine through the *dummyTable* parameter. The intermediate processing steps are abstracted away from the user. The stream engine parser uses specific naming conventions for the *dummyTables*of intermediate engines. If you need to reference a column from an intermediate engine's *dummyTable*in *metrics*or other parameters, follow these naming conventions:\n\n   * The first column of any intermediate *dummyTable* is the time column.\n   * The next columns are the ones specified by *keyColumn*.\n   * After that come columns holding the calculation results of *metrics*. These metric columns are named \"col\\_0\\_, col\\_1\\_, col\\_2\\_,...\" and so on.\n\n**Note:**\n\n1. The output tables for time-series engines and cross-sectional engines both contain a time column. However, reactive state engines do not output a time column. When the engine pipeline generates a reactive state engine, it will automatically add a time column to that engine's *metrics*. This enables the time column to be included in the *dummyTable* passed to the next engine in the pipeline. In this scenario, if *useSystemTime* is true, the auto-added time column is named \"datetime\".\n2. Certain parameters for cross-sectional engines and reactive state engines may need column names from the intermediate *dummyTable*. For example:\n\n   * *contextByColumn* of cross-sectional engines\n   * *filter* and *keyPurgeFilter* of reactive state engines\n     To specify columns from an intermediate *dummyTable*, follow the aforementioned naming conventions, e.g., `contextByColumn = col_0_`.\n\n   To specify the time column or a key column, simply use the column name.\n\n#### Required Parameters\n\n**name** is a string specifying the prefix for the names of the engines in the parser. It can contain letters, numbers, and underscores, but must start with a letter. For example, if *name*= \"test\", the engine names will be \"test0\", \"test1\", \"test2\", etc. The number appended to each name indicates the engine's position within the parser, which is determined by the parsing results of *metrics*.\n\n**metrics** is metacode indicating the metrics to be computed by the parser. Tuples are supported. For more information, see [Functional Metaprogramming](https://docs.dolphindb.com/en/Programming/Metaprogramming/functional_meta.html).\n\n* *metrics* can include built-in or user-defined functions, like <\\[sum(qty), avg(price)]>; expressions, like <\\[avg(price1)-avg(price2)]>; computation on columns, like <\\[std(price1-price2)]>.\n\n* Functions that return multiple values are also supported, such as \\<func(price) as col1 col2> (column names are optional).\n\nThe metrics are typically complex, with multiple layers of computation logic. The parser analyzes each layer of logic and assigns it to the appropriate streaming engine (see **Details**).\n\n**dummyTable** is a table object. It must have the same schema as the stream table to which the engine subscribes. Whether it contains data or not doesn't matter.\n\n**outputTable** holds the computation results from the engine pipeline. It can be an in-memory table or a DFS table, but must be empty before calling `streamEngineParser`. The column names and data types in *outputTable*must be specified upfront. The schema of *outputTable*depends on the last engine in the pipeline:\n\n* For a time-series engine, the columns are ordered as:\n\n  1. Time column\n\n     1. The column type is either TIMESTAMP (when *useSystemTime*= true) or same type as *timeColumn*(when *useSystemTime* = false).\n\n     2. It displays window start (when *useWindowStartTime* = true) or end times (when *useWindowStartTime* = false).\n\n  2. Key column(s), if *keyColumn* is specified. They are ordered the same as in *keyColumn*.\n\n  3. Metric computation result column(s).\n\n* For a reactive state engine, the columns are ordered as:\n\n  1. Key column(s), ordered the same as in *keyColumn*.\n\n  2. Metric computation result column(s).\n\n* For a cross-sectional engine:\n\n  * If *contextByColumn* is not specified, the columns of the output table are ordered as:\n\n    1. A TIMESTAMP column with system timestamps for each computation (or the corresponding values from the *timeColumn*, if this parameter is specified).\n\n    2. Metric computation result column(s). The data types must be consistent with the metric computation results.\n\n  * If *contextByColumn* is specified, the columns of the output table are ordered as:\n\n    1. A TIMESTAMP column with system timestamps for each computation (or the corresponding values from the *timeColumn*, if this parameter is specified).\n\n    2. The column specified in *contextByColumn*.\n\n    3. Metric computation result column(s). The data types must be consistent with the metric computation results.\n\n**keyColumn** is a string scalar or vector.\n\n* For time-series engines and reactive state engines, *keyColumn* indicates the columns to group data by. If specified, computations are done per group, such as aggregations by stock.\n\n* For cross-sectional engines, *keyColumn* indicates the column holding the unique keys. The engine will use only the latest record per key for each computation.\n\n#### Optional Parameters\n\n**timeColumn** specifies the time column in the stream table to which the engine subscribes. It is required when *useSystemTime* = false.\n\n* For time-series engines and reactive state engines, *timeColumn* is can be a string scalar or a 2-element string vector. The vector specifies a DATE and a TIME/SECOND/NANOTIME column. The engine will concatenate the date and time values into a single time value for the output table. See concatDateTime() for details on the concatenated data type.\n\n* For cross-sectional engines, *timeColumn* is a string. The specified column must be of TIMESTAMP type.\n\n**useSystemTime** indicates how the engine handles time when processing data.\n\n* For cross-sectional engines, *useSystemTime*is an optional boolean parameter. If true (default), the engine will use the system time when each calculation starts and output it in the first column of the output table. If false, it will use the time values from the specified *timeColumn* instead.\n\n* For time-series engines, *useSystemTime* is an optional parameter specifying how data is windowed for processing:\n\n  * When *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 time columns in the stream 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 timestamps when the calculation occurred. Note: When *useSystemTime* = true, *timeColumn* must be left empty.\n\n  * *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.\n\nTo enable snapshot in the streaming engines, specify parameters *snapshotDir* and *snapshotIntervalInMsgCount*.\n\n**snapshotDir** is a string indicating the directory where the streaming engine snapshot is saved.\n\n* The directory must already exist, otherwise an exception is thrown.\n\n* If *snapshotDir* is specified, the system checks whether a snapshot already exists in the directory when creating a streaming engine. If it exists, the snapshot will be loaded to restore the engine state.\n\n* Multiple streaming engines can share a directory where the snapshot files are named as the engine names.\n\n* The file extension of a snapshot can be:\n\n  * *\\<engineName>.tmp*: temporary snapshot\n\n  * *\\<engineName>.snapshot*: a snapshot that is generated and flushed to disk\n\n  * *\\<engineName>.old*: if a snapshot with the same name already exists, the previous snapshot is renamed to *\\<engineName>.old*.\n\n**snapshotIntervalInMsgCount** is a positive integer indicating the number of messages to receive before the next snapshot is saved.\n\n**raftGroup** is an integer greater than 1, indicating ID of the raft group on the high-availability streaming subscriber specified by the configuration parameter *streamingRaftGroups*. Specify *raftGroup* to enable high availability on the streaming engine. When an engine is created on the leader, it is also created on each follower and the engine snapshot is synchronized to the 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.\n\nThe stream engine parser must be created on the leader of a raft group.\n\nBelow are the parameters unique to a specific type of streaming engine:\n\n* reactive state engines ([createReactiveStateEngine](https://docs.dolphindb.com/en/Functions/c/createReactiveStateEngine.html)): *filter*, *keepOrder*, *keyPurgeFilter*, *keyPurgeFreqInSecond*\n\n* cross-sectional engines ([createCrossSectionalEngine](https://docs.dolphindb.com/en/Functions/c/createCrossSectionalEngine.html)): *triggeringPattern*, *triggeringInterval*, *lastBatchOnly*, *contextByColumn*\n\n* time-series engines ([createTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createTimeSeriesEngine.html)): *updateTime*, *useWindowStartTime*, *roundTime*, \\*forceTriggerTime,\\**closed*, *fill*, *garbageSize*, *keyPurgeFreqInSec*\n\n* daily time-series engines ([createDailyTimeSeriesEngine](https://docs.dolphindb.com/en/Functions/c/createDailyTimeSeriesEngine.html)): *sessionBegin*, *sessionEnd*, *mergeSessionEnd*, *closed*, *fill*, *garbageSize*, *forceTriggerSessionEndTime*, *keyPurgeFreqInSec*\n\n**Note:** If *triggeringPattern*='keyCount', parameter *keepOrder* must be set to true.\n\n#### Returns\n\nA table object returned by the first streaming engine in the parsed pipeline. Writing to this table feeds data into the pipeline. To delete the pipeline, delete the parsed engines individually by their names. Deleting all engines with one function is not supported yet.\n\n#### Examples\n\nThis example implements Formula #1 from World Quant's 101 Alpha Factors on streaming data. The `rank` function performs a cross-sectional operation and is processed with a cross-sectional engine. `rank`'s parameters are computed using a reactive state engine which outputs to the cross-sectional engine.\n\n```\nn = 100\nsym = rand(`aaa`bbb`ccc, n)\ntime = 2021.01.01T13:30:10.008 + 1..n\nmaxIndex=rand(100.0, n)\ndata = table(sym as sym, time as time, maxIndex as maxIndex)\n\n```\n\n```\nAlpha#001formula: rank(Ts_ArgMax(SignedPower((returns<0?stddev(returns,20):close), 2), 5))-0.5\n\n//create a cross-sectional engine to calculate the rank of each stock\ndummy = table(1:0, `sym`time`maxIndex, [SYMBOL, TIMESTAMP, DOUBLE])\nresultTable = streamTable(10000:0, `time`sym`factor1, [TIMESTAMP, SYMBOL, DOUBLE])\nccsRank = createCrossSectionalAggregator(name=\"alpha1CCS\", metrics=<[sym, rank(maxIndex, percent=true) - 0.5]>,  dummyTable=dummy, outputTable=resultTable,  keyColumn=`sym, triggeringPattern='keyCount', triggeringInterval=3000, timeColumn=`time, useSystemTime=false)\n\n@state\ndef wqAlpha1TS(close){\n    ret = ratios(close) - 1\n    v = iif(ret < 0, mstd(ret, 20), close)\n    return mimax(signum(v)*v*v, 5)\n}\n\n//create a reactive state engine which outputs to the cross-sectional engine\ninput = table(1:0, `sym`time`close, [SYMBOL, TIMESTAMP, DOUBLE])\nrse = createReactiveStateEngine(name=\"alpha1\", metrics=<[time, wqAlpha1TS(close)]>, dummyTable=input, outputTable=ccsRank, keyColumn=\"sym\")\nrse.append!(data)\n\ndropStreamEngine(\"alpha1CCS\")\ndropStreamEngine(\"alpha1\")\n\n```\n\nThe computation can also be done by using the `streamEngineParser`:\n\n```\ninput = table(1:0, `sym`time`close, [SYMBOL, TIMESTAMP, DOUBLE])\nresultTable = streamTable(10000:0, `time`sym`factor1, [TIMESTAMP, SYMBOL, DOUBLE])\n\n//construc metrics\nmetrics=<[sym, rowRank(wqAlpha1TS(close), percent=true)- 0.5]>\n\nstreamEngine=streamEngineParser(name=`alpha1_parser, metrics=metrics, dummyTable=input, outputTable=resultTable, keyColumn=`sym, timeColumn=`time, triggeringPattern='keyCount', triggeringInterval=3000)\nstreamEngine.append!(data)\n\ndropStreamEngine(\"alpha1_parser0\")\ndropStreamEngine(\"alpha1_parser1\")\n\n```\n"
    },
    "streamFilter": {
        "url": "https://docs.dolphindb.com/en/Functions/s/streamFilter.html",
        "signatures": [
            {
                "full": "streamFilter(name, dummyTable, filter, [msgSchema], [timeColumn], [conditionColumn])",
                "name": "streamFilter",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "dummyTable",
                        "name": "dummyTable"
                    },
                    {
                        "full": "filter",
                        "name": "filter"
                    },
                    {
                        "full": "[msgSchema]",
                        "name": "msgSchema",
                        "optional": true
                    },
                    {
                        "full": "[timeColumn]",
                        "name": "timeColumn",
                        "optional": true
                    },
                    {
                        "full": "[conditionColumn]",
                        "name": "conditionColumn",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [streamFilter](https://docs.dolphindb.com/en/Functions/s/streamFilter.html)\n\n\n\n#### Syntax\n\nstreamFilter(name, dummyTable, filter, \\[msgSchema], \\[timeColumn], \\[conditionColumn])\n\n#### Details\n\nCreate an engine that splits the ingested stream for different handlers. Return a table object.\n\nThe engine works as follows:\n\n1. Deserialize the ingested data.\n\n   Note that this step only takes place when the ingested data is from a heterogeneous stream table, i.e., the output of heterogeneous [replay](https://docs.dolphindb.com/en/Functions/r/replay.html).\n\n2. Split the ingested stream based on the conditions as specified by *filter*.\n\n3. Ingest the split streams to the handlers as specified by *filter* in the order of their timestamps.\n\n**Note:**\n\nStarting from version 1.30.18/2.00.6, in addition to heterogeneous stream tables, `streamFilter` also supports processing data from standard stream tables.\n\n#### Parameters\n\n**name** is a STRING scalar indicating the name of the stream filter engine. It must begin with a letter and may contain letters, numbers and underscores.\n\n**dummyTable** is a table. It has the same schema as the stream table that the stream filter subscribes to. The table can be empty.\n\n**filter** is a dictionary or a tuple of dictionaries. It defines how to process the ingested data. Each dictionary can have the following key-value pairs:\n\n* 'timeRange' (optional) is a pair or a tuple of pairs. Apply it to *timeColumn* to filter for records in the specified time range. Note: When processing a standard stream table, *timeRange* must have the same data type as *timeColumn*.\n\n* 'condition':\n\n  * When processing a heterogeneous stream table: It is a STRING referring to a dictionary key from the *inputTables* of [replay](https://docs.dolphindb.com/en/Functions/r/replay.html). The engine will filter records by the specified key.\n\n  * When processing a standard stream table: It is a STRING scalar/vector indicating the value(s) from the *conditionColumn*, or metacode of one or more Boolean expressions (can contain built-in functions; cannot contain partial applications). The engine will filter records by the specified condition.\n\n* 'handler' is a unary function or a table (can be the table object returned by a streaming engine).\n\n  * If it's a function, the filter result (a table) is passed as the function's sole argument.\n\n  * If it's a table object, the filtered data are inserted into the table directly.\n\n**msgSchema** (optional) is a dictionary\n\n* When processing a heterogeneous stream table: The dictionary indicates the input tables of [replay](https://docs.dolphindb.com/en/Functions/r/replay.html). The keys are the table identifiers as specified in the *inputTables* parameter of [replay](https://docs.dolphindb.com/en/Functions/r/replay.html) and the values indicate the schema of each table. The ingested data will be parsed based on *msgSchema*.\n\n* When processing a standard stream table: Do not specify the parameter.\n\nThe following parameters are only required when processing data from *a standard stream table*:\n\n**timeColumn** (optional) is a STRING indicating the name of the temporal column in *dummyTable*. If unspecified, it takes the name of the first column in the *dummyTable*.\n\n**conditionColumn** (optional) is a STRING indicating a column (must be STRING or SYMBOL type) in *dummyTable*. If this parameter is unspecified, the \"condition\" key of filter takes no effect.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n(1) Processing a heterogeneous stream table:\n\nReplay the DFS tables \"orders\" and \"trades\" to simulate an asof join of the two streams.\n\nIf we simply perform an N-to-N replay on the two tables, it is not guaranteed that the records will be ingested to the left and right tables of the asof join engine in chronological order: It may happen that a record with a larger timestamp arrives in the left table before a record with a smaller timestamp arrives in the right table. For more information, see [replay](https://docs.dolphindb.com/en/Functions/r/replay.html).\n\nTherefore, we replay the two tables into one heterogeneous stream table to make sure all records are ordered by timestamp. The stream filter subscribes to the heterogenous stream table, splits the ingested data into two streams and distributes them to the left and right tables of the asof join engine ([createAsofJoinEngine](https://docs.dolphindb.com/en/Functions/c/createAsofJoinEngine.html)). In this way, we can make sure that the data is ingested to the left and right tables of the asof join engine in the order of the timestamps.\n\n```\n//create the \"orders\" table\nn=1000\nsym = take(take(\"IBM\",n).join(take(\"GS\",n)), n*2*3)\ndate=take(2022.01.04..2022.01.06, n*2*3).sort!()\ntimestamp1=take(2022.01.04 09:30:00.000+rand(1000,n),n) join take(2022.01.04 09:31:00.000+rand(1000,n),n)\ntimestamp2=take(2022.01.05 09:30:00.000+rand(1000,n),n) join take(2022.01.05 09:31:00.000+rand(1000,n),n)\ntimestamp3=take(2022.01.06 09:30:00.000+rand(1000,n),n) join take(2022.01.06 09:31:00.000+rand(1000,n),n)\ntimestamp=timestamp1 join timestamp2 join timestamp3\nvolume = rand(100, n*2*3)\nt=table(sym,date,timestamp,volume)\n\nif(existsDatabase(\"dfs://test_order\")){\ndropDatabase(\"dfs://test_order\")\n}\ndb1_or=database(\"\",RANGE, 2022.01.04..2022.01.07)\ndb2_or=database(\"\",VALUE,`IBM`GS)\ndb_or=database(\"dfs://test_order\",COMPO,[db1_or, db2_or])\norders=db_or.createPartitionedTable(t,`orders,`date`sym)\norders.append!(t);\nselect count(*) from orders\n// output: 6000\n\n//create the \"trades\" table\nn=2000\nsym = take(take(\"IBM\",n).join(take(\"GS\",n)), n*2*3)\ndate=take(2022.01.04..2022.01.06, n*2*3).sort!()\ntimestamp1=take(2022.01.04 09:30:00.000+rand(1000,n),n) join take(2022.01.04 09:31:00.000+rand(1000,n),n)\ntimestamp2=take(2022.01.05 09:30:00.000+rand(1000,n),n) join take(2022.01.05 09:31:00.000+rand(1000,n),n)\ntimestamp3=take(2022.01.06 09:30:00.000+rand(1000,n),n) join take(2022.01.06 09:31:00.000+rand(1000,n),n)\ntimestamp=timestamp1 join timestamp2 join timestamp3\nvolume = rand(100, n*2*3)\nprice = rand(50.0, n*3) join  rand(20.0, n*3)\n\nt=table(sym,date,timestamp,volume,price)\n\nif(existsDatabase(\"dfs://test_trades\")){\ndropDatabase(\"dfs://test_trades\")\n}\ndb1=database(\"\",RANGE, 2022.01.04..2022.01.07)\ndb2=database(\"\",VALUE,`IBM`GS)\ndb=database(\"dfs://test_trades\",COMPO,[db1, db2])\ntrades=db.createPartitionedTable(t,`trades,`date`sym)\ntrades.append!(t);\nselect count(*) from trades\n// output: 12000\n\n//generate the heterogeneous data sources and create a table as the the outputTable of replay()\nds_or = replayDS(sqlObj=<select * from loadTable(db_or, `orders)>, dateColumn=`date, timeColumn=`timestamp)\nds = replayDS(sqlObj=<select * from loadTable(db, `trades)>, dateColumn=`date, timeColumn=`timestamp)\ninput_dict=dict([\"orders\",\"trades\"], [ds_or, ds])\nshare streamTable(100:0,`timestamp`sym`blob`volume, [TIMESTAMP,SYMBOL, BLOB, INT]) as opt\n\n\n//subscribe to the output table of replay to ingest the data to the stream filter\nshare streamTable(100:0,`timestamp`sym`blob`volume, [TIMESTAMP,SYMBOL, BLOB, INT]) as streamFilterOpt\nshare streamTable(100:0, `sym`date`timestamp`volume, [SYMBOL, DATE, TIMESTAMP, INT] ) as streamOrders\nshare streamTable(100:0, `sym`date`timestamp`volume`price, [SYMBOL, DATE, TIMESTAMP, INT, DOUBLE] ) as streamTrades\nstreamOpt=table(100:0, `timestamp`sym`volume`price`result, [TIMESTAMP, SYMBOL, INT, DOUBLE, DOUBLE])\n\nfilter1=dict(STRING,ANY)\nfilter1['condition']=`orders\nfilter1['timeRange']=09:30:00.000:09:30:00.005\n\nfilter2=dict(STRING,ANY)\nfilter2['condition']=`trades\nfilter2['timeRange']=09:30:00.000:09:30:00.005\n\najEngine=createAsofJoinEngine(name=\"ajEngine\", leftTable=streamOrders, rightTable=streamTrades, outputTable=streamOpt, metrics=<[volume,price,price*volume]>, matchingColumn=`sym, useSystemTime=true)\nfilter1['handler']=getLeftStream(ajEngine)\nfilter2['handler']=getRightStream(ajEngine)\nschema=dict([\"orders\",\"trades\"], [streamOrders, streamTrades])\n\nengine=streamFilter(name=`streamFilter,dummyTable=streamFilterOpt, filter=[filter1,filter2],msgSchema=schema)\nsubscribeTable(tableName=\"opt\", actionName=\"sub1\", offset=0, handler=engine, msgAsTable=true)\n\n//replay the heterogeneous data sources and output to the table \"opt\"\nreplay(inputTables=input_dict,outputTables=opt, timeColumn=`timestamp)\n\nselect count(*) from streamOpt\n// output: 20\n\n//drop the subscription\nunsubscribeTable(tableName=\"opt\", actionName=\"sub1\")\ndropStreamEngine(`streamFilter)\ndropStreamEngine(`ajEngine)\n```\n\n(2) Processing standard stream table:\n\nIn this example, data from the standard stream table \"trades\" is ingested to the stream filter, where the records are filtered and assigned to handlers for further processing.\n\n```\nn=20\nsym = symbol(take(`A`B`C,n))\nname = string(rand(1..10,n))\ndate = temporalAdd(2012.12.06,0..(n-1),'d')\ntime = temporalAdd(09:30:00.000,0..(n-1),'ms')\nvol = 100+take(1..8,20)\nt = table(date,time,sym,name,vol)\n\nshare streamTable(100:0,`date`time`sym`name`vol,[DATE,TIME,SYMBOL,STRING,INT]) as st1\nshare streamTable(100:0,`date`time`sym`name`vol,[DATE,TIME,SYMBOL,STRING,INT]) as st2\nshare streamTable(100:0,`date`time`sym`name`vol,[DATE,TIME,SYMBOL,STRING,INT]) as st3\n\n\nshare streamTable(100:0,`time`sym`sum_vol,[TIME,SYMBOL,INT]) as output1\nshare streamTable(100:0,`time`avg_vol,[TIME,INT]) as output2\n\n// create 2 streaming engines has the handlers of the stream filter\nengine1=createTimeSeriesEngine(name=\"timeEngine\", windowSize=3, step=3, metrics=<[sum(vol)]>, dummyTable=st3, outputTable=output1, timeColumn=`time, useSystemTime=false, keyColumn=`sym, garbageSize=50)\nengine2=createReactiveStateEngine(name=\"reactiveEngine\", metrics=<[mavg(vol, 3)]>, dummyTable=st1, outputTable=output2, keyColumn=`sym)\n\n//share \"trades\" as the stream table to be subscribed by the stream filter\nshare streamTable(100:0,`date`time`sym`name`vol,[DATE,TIME,SYMBOL,STRING,INT]) as trades\n\n//set the first filter and ingest the result to engine2\nfilter1 = dict(STRING,ANY)\nfilter1['condition']=`A\nfilter1['handler']=engine2\nfilter1['timeRange']=(09:30:00.001:09:30:00.010,09:29:00.000:09:30:00.000)\n\n//set the second filter and ingest the result to st2\nfilter2 = dict(STRING,ANY)\nfilter2['handler']=st2\nfilter2['timeRange']=09:30:00.002:09:30:00.005\n\n//set the first filter and ingest the result to engine1\nfilter3 = dict(STRING,ANY)\nfilter3['condition']=`C`A\nfilter3['handler']=engine1\n\n///The stream filter subscribes to the stream table \"trades\" and distributes the ingested data based on the specified conditions\nstreamFilter2=streamFilter(name=\"streamFilterDemo\",dummyTable=trades,filter=[filter1,filter2,filter3], timeColumn=`time, conditionColumn=`sym)\nsubscribeTable(tableName=\"trades\", actionName=\"sub1\", offset=0, handler=streamFilter2, msgAsTable=true)\ntrades.append!(t)\n```\n\n```\nselect * from output1\n```\n\n| time         | sym | sum\\_vol |\n| ------------ | --- | -------- |\n| 09:30:00.003 | A   | 101      |\n| 09:30:00.003 | C   | 103      |\n| 09:30:00.006 | A   | 104      |\n| 09:30:00.006 | C   | 106      |\n| 09:30:00.009 | A   | 107      |\n| 09:30:00.009 | C   | 101      |\n| 09:30:00.012 | A   | 102      |\n| 09:30:00.012 | C   | 104      |\n| 09:30:00.015 | A   | 105      |\n| 09:30:00.015 | C   | 107      |\n| 09:30:00.018 | A   | 108      |\n\n```\nselect * from output2\n```\n\n| time         | avg\\_vol |\n| ------------ | -------- |\n| 00:00:00.001 |          |\n| 00:00:00.001 |          |\n| 00:00:00.001 | 104      |\n| 00:00:00.001 | 104      |\n\n```\nselect * from st2\n```\n\n| date       | time         | sym | name | vol |\n| ---------- | ------------ | --- | ---- | --- |\n| 2012.12.08 | 09:30:00.002 | C   | 6    | 103 |\n| 2012.12.09 | 09:30:00.003 | A   | 8    | 104 |\n| 2012.12.10 | 09:30:00.004 | B   | 10   | 105 |\n| 2012.12.11 | 09:30:00.005 | C   | 10   | 106 |\n| 2012.12.12 | 09:30:00.006 | A   | 10   | 107 |\n| 2012.12.13 | 09:30:00.007 | B   | 1    | 108 |\n| 2012.12.14 | 09:30:00.008 | C   | 3    | 101 |\n| 2012.12.15 | 09:30:00.009 | A   | 4    | 102 |\n| 2012.12.16 | 09:30:00.010 | B   | 9    | 103 |\n\n\"condition\" can also be specified as Boolean expressions to support more complex filter logic. In the example above, replace the value of \"condition\" in filter2 with a Boolean expression to filter the data based on the columns \"vol\" and \"date\".\n\n```\nfilter2 = dict(STRING,ANY)\nfilter2['condition'] = <sym==`A and 101<vol<105 and date<2012.12.15>\nfilter2['handler'] = st2\nfilter2['timeRange'] = 09:30:00.002:09:30:00.010\n\nselect * from st2\n```\n\n| date       | time         | sym | name | vol |\n| ---------- | ------------ | --- | ---- | --- |\n| 2012.12.09 | 09:30:00.003 | A   | 7    | 104 |\n"
    },
    "StreamGraph::changelogSource": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_changelogSource.html",
        "signatures": [
            {
                "full": "StreamGraph::changelogSource(name, keyColumn, colNames, colTypes, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "StreamGraph::changelogSource",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::changelogSource](https://docs.dolphindb.com/en/Functions/s/StreamGraph_changelogSource.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nStreamGraph::changelogSource(name, keyColumn, colNames, colTypes, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted keyed stream table with an internal status column. For details, see [changelogStreamTable](https://docs.dolphindb.com/en/Functions/c/changelogStreamTable.html) and [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\ng = createStreamGraph(\"streamGraph\")\ng1 = g.changelogSource(`st, `sym`time, `sym`time`qty, [SYMBOL, DATETIME, INT])\n    .timeSeriesEngine(windowSize=60, step=60, metrics=[<sum(qty) as sum_qty>], timeColumn=`time,keyColumn=`sym, updateTime=0)\n    .setEngineName(\"tse\")\n    .reactiveStateEngine([<time>, <mavg(sum_qty, 3)>], `sym)\n    .setEngineName(\"rse\")\n    .changelogSink(\"output\", `sym`time)\ng.submit() \ngo\n```\n\n**Related functions**: [changelogStreamTable](https://docs.dolphindb.com/en/Functions/c/changelogStreamTable.html), [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html),[DStream::changelogSink](https://docs.dolphindb.com/en/Functions/d/DStream_changelogSink.html)\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n"
    },
    "StreamGraph::deleteRule": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_deleteRule.html",
        "signatures": [
            {
                "full": "StreamGraph::deleteRule(engineName, key)",
                "name": "StreamGraph::deleteRule",
                "parameters": [
                    {
                        "full": "engineName",
                        "name": "engineName"
                    },
                    {
                        "full": "key",
                        "name": "key"
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::deleteRule](https://docs.dolphindb.com/en/Functions/s/StreamGraph_deleteRule.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nStreamGraph::deleteRule(engineName, key)\n\n#### Details\n\nThis function deletes the rule set associated with the specified *key* in the stream graph’s rule engine.\n\nThe core difference from the `updateRule` interface is:\n\n* Rule changes executed via `StreamGraph::updateRule` are automatically persisted by the system, ensuring that all committed rule modifications are loaded and remain effective after a service restart.\n* Rule changes made via `updateRule` only exist in memory, and the modifications will be lost after a service restart.\n\n#### Parameters\n\n**engineName** is a string representing the fully qualified name of the streaming engine, such as `\"catalog_name.orca_engine.engine_name\"`.\n\n**key**is a STRING or INT scalar indicating the key for the rule set to be deleted.\n\n#### Examples\n\n```\ncreateCatalog(\"demo\")\ngo\nuse catalog demo\n\n// Set the rule set\nx = [1, 2, NULL]\ny = [ [ < value > 1 > ], [ < price < 2 >, < price > 6 > ], [ < value*price > 10 > ] ]\nruleSets = dict(x, y)\n\n// Create and submit the stream graph\ng = createStreamGraph(\"updateRuleDemo\")\ng.source(\"trades\", 1000:0, `sym`value`price`quantity, [INT, DOUBLE, DOUBLE, DOUBLE])\n    .ruleEngine(ruleSets=ruleSets, outputColumns=[\"sym\",\"value\",\"price\"], policy=\"all\", ruleSetColumn=\"sym\")\n    .setEngineName(\"myRuleEngine\")\n    .sink(\"output\")\ng.submit()\n\n// delete the rule\ng.deleteRule(\"demo.orca_engine.myRuleEngine\",1)\n```\n\nRelated functions: [StreamGraph::updateRule](https://docs.dolphindb.com/en/Functions/s/StreamGraph_updateRule.html), [updateRule](https://docs.dolphindb.com/en/Functions/u/updateRule.html)\n"
    },
    "StreamGraph::dropGraph": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_dropGraph.html",
        "signatures": [
            {
                "full": "StreamGraph::dropGraph([includeTables])",
                "name": "StreamGraph::dropGraph",
                "parameters": [
                    {
                        "full": "[includeTables]",
                        "name": "includeTables",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::dropGraph](https://docs.dolphindb.com/en/Functions/s/StreamGraph_dropGraph.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nStreamGraph::dropGraph(\\[includeTables])\n\n#### Details\n\nDestroys the stream graph. After successful execution, the stream graph’s status is set to \"destroyed\", but the metadata record is not deleted.\n\n* If *includesTables*=true, the specified stream graph and its user-created stream tables will be deleted. Ensure that these stream tables are not referenced by other stream graphs; use `getStreamTableMeta` to check table references.\n* If false, only the stream graph itself will be deleted, leaving the associated stream tables intact.\n\nIn a cluster deployment, this function can only be executed by an administrator or a user who has the COMPUTE\\_GROUP\\_EXEC permission for the compute group that was used to create the stream graph. In a single-node deployment, permission checks are not required.\n\n#### Parameters\n\n**includesTables** (optional) is a Boolean value, indicating whether to delete user-created stream tables (e.g., source, sink) associated with the stream graph when deleting the graph. The default value is false.\n\n#### Examples\n\n```\n// Submit stream graph\ncreateCatalog(\"test\")\nuse catalog test\n\nt = table(1..100 as id, 1..100 as value, take(09:29:00.000..13:00:00.000, 100) as timestamp)\ng = createStreamGraph(\"factor\")\nbaseStream = g.source(\"snapshot\",  1024:0, schema(t).colDefs.name, schema(t).colDefs.typeString)\n  .reactiveStateEngine([<cumsum(value)>, <timestamp>])\n  .setEngineName(\"rse\")\n  .buffer(\"end\")\n  \ng.submit()\n\n// Delete stream graph\ng.dropGraph()\n```\n\nRelated functions: [dropStreamGraph](https://docs.dolphindb.com/en/Functions/d/dropStreamGraph.html), [createStreamGraph](https://docs.dolphindb.com/en/Functions/c/createStreamGraph.html)\n"
    },
    "StreamGraph::haKeyedSource": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_haKeyedSource.html",
        "signatures": [
            {
                "full": "StreamGraph::haKeyedSource(name, keyColumn, colNames, colTypes, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "StreamGraph::haKeyedSource",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::haKeyedSource](https://docs.dolphindb.com/en/Functions/s/StreamGraph_haKeyedSource.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::haKeyedSource(name, keyColumn, colNames, colTypes, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nCreates a high-availability keyed stream table.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** (optional) is a STRING scalar or vector specifying the primary key. When this parameter is set, a high-availability [keyed stream table](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) will be created, and its primary key cannot contain duplicate values.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheSize** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheSize*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\ng.haKeyedSource(\"ha_keyedTable\",`symbol, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG], 3, 50000)\n```\n"
    },
    "StreamGraph::haSource": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_haSource.html",
        "signatures": [
            {
                "full": "StreamGraph::haSource(name, colNames, colTypes, raftGroup, cacheLimit, [retentionMinutes=1440])",
                "name": "StreamGraph::haSource",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "raftGroup",
                        "name": "raftGroup"
                    },
                    {
                        "full": "cacheLimit",
                        "name": "cacheLimit"
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::haSource](https://docs.dolphindb.com/en/Functions/s/StreamGraph_haSource.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::haSource(name, colNames, colTypes, raftGroup, cacheLimit, \\[retentionMinutes=1440])\n\n#### Details\n\nCreates a high-availability stream table. For details, see [haStreamTable](https://docs.dolphindb.com/en/Functions/h/haStreamTable.html).\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**raftGroup** can be either an integer greater than 1 or a string.\n\n* Integer: represents the raft group ID.\n* String: represents a raft group alias, which must be preconfigured via *streamingRaftGroupAliases*.\n\n**cacheLimit** is a positive integer representing the maximum number of rows of the high-availability stream table to be kept in memory. If *cacheLimit*>1000, it is automatically adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer specifying for how long (in terms of minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file only keeps data in the past 24 hours.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\ng.haSource(\"ha_table\", 1:0, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG], 3, 50000)\n```\n"
    },
    "StreamGraph::keyedSource": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_keyedSource.html",
        "signatures": [
            {
                "full": "StreamGraph::keyedSource(name, keyColumn, colNames, colTypes, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "StreamGraph::keyedSource",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::keyedSource](https://docs.dolphindb.com/en/Functions/s/StreamGraph_keyedSource.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::keyedSource(name, keyColumn, colNames, colTypes, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted keyed stream table. For details, see [keyedStreamTable](https://docs.dolphindb.com/en/Functions/k/keyedStreamTable.html) and [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\ng.keyedSource(\"trade\", `symbol, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n```\n"
    },
    "StreamGraph::latestKeyedSource": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_latestKeyedSource.html",
        "signatures": [
            {
                "full": "StreamGraph::latestKeyedSource(name, keyColumn, timeColumn, colNames, colTypes, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "StreamGraph::latestKeyedSource",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "keyColumn",
                        "name": "keyColumn"
                    },
                    {
                        "full": "timeColumn",
                        "name": "timeColumn"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::latestKeyedSource](https://docs.dolphindb.com/en/Functions/s/StreamGraph_latestKeyedSource.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::latestKeyedSource(name, keyColumn, timeColumn, colNames, colTypes, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nCreates a persisted keyed stream table that retains only the latest record for each unique primary key based on a time column. For details, see [latestKeyedStreamTable](https://docs.dolphindb.com/en/Functions/l/latestKeyedStreamTable.html) and [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**keyColumn** is a string scalar or vector indicating the name of the primary key columns (which must be of INTEGRAL, TEMPORAL, LITERAL or FLOATING type).\n\n**timeColumn** specifies the time column(s) and can be either:\n\n* A string indicates a single column of integral or temporal type, or\n* A two-element vector indicates two columns that combine to form a unique timestamp: a DATE column and a TIME, SECOND, or NANOTIME column.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\ng.latestKeyedSource(\"trade\", `symbol, `time, `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n```\n"
    },
    "StreamGraph::name": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_name.html",
        "signatures": [
            {
                "full": "StreamGraph::name()",
                "name": "StreamGraph::name",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::name](https://docs.dolphindb.com/en/Functions/s/StreamGraph_name.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::name()\n\n#### Details\n\nReturns the fully qualified name (FQN) of the stream graph.\n\n**Returns:** A value of type STRING.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\nGet the fully qualified name of the stream graph g submitted in the [StreamGraph::submit](https://docs.dolphindb.com/en/Functions/s/StreamGraph_submit.html) example:\n\n```\ng.name()\n// Output: 'demo.orca_graph.indicators'\n```\n"
    },
    "StreamGraph::setConfigMap": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_setConfigMap.html",
        "signatures": [
            {
                "full": "StreamGraph::setConfigMap(dict)",
                "name": "StreamGraph::setConfigMap",
                "parameters": [
                    {
                        "full": "dict",
                        "name": "dict"
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::setConfigMap](https://docs.dolphindb.com/en/Functions/s/StreamGraph_setConfigMap.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::setConfigMap(dict)\n\n#### Details\n\nUsed to configure private stream tables and subscriptions within a stream graph.During the stream graph creation process, the system automatically adds private stream tables and subscriptions for data redistribution (shuffle). These components do not require manual declaration. To modify the runtime parameters of these auto-generated components, you can pass configuration items via `setConfigMap`.\n\n#### Parameters\n\n**dict** is a dictionary, supporting the following key-value pairs:\n\n| **Key**                   | **Type** | **Default Value** | **Description**                                                                                                      |\n| ------------------------- | -------- | ----------------- | -------------------------------------------------------------------------------------------------------------------- |\n| subscription.batchSize    | INT      | 0                 | Sets the *batchSize* parameter for all subscriptions in the stream graph.                                            |\n| subscription.throttle     | INT      | 1                 | Sets the *throttle* parameter for all subscriptions in the stream graph.                                             |\n| subscription.timeTrigger  | BOOL     | false             | Enables or disables *timeTrigger* for all subscriptions in the stream graph.                                         |\n| subscription.sourceOffset | INT      | -3                | Sets the *offset* parameter for all stream table subscriptions created by `StreamGraph::source` in the stream graph. |\n| privateTable.cacheSize    | INT      | 1000              | Sets the *cacheSize* parameter of all private stream tables with persistence enabled.                                |\n\n#### Returns\n\nA DGraph object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"orca\")\n  .setConfigMap({\n    \"subscription.throttle\": 1,\n    \"privateTable.cacheSize\": 1000\n  })\n```\n"
    },
    "StreamGraph::setLocalConfigOnce": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_setLocalConfigOnce.html",
        "signatures": [
            {
                "full": "StreamGraph::setLocalConfigOnce(dict)",
                "name": "StreamGraph::setLocalConfigOnce",
                "parameters": [
                    {
                        "full": "dict",
                        "name": "dict"
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::setLocalConfigOnce](https://docs.dolphindb.com/en/Functions/s/StreamGraph_setLocalConfigOnce.html)\n\nFirst introduced in version: 3.00.3.1\n\n\n\n#### Syntax\n\nStreamGraph::setLocalConfigOnce(dict)\n\n#### Details\n\nSet subscription configurations between adjacent nodes in the stream graph. Once this function is called, the specified configuration will override any corresponding global configuration set via `StreamGraph::setConfigMap`, or add new configurations if they were not previously defined.\n\nThe configuration takes effect only once between the calling node and its directly connected downstream node; it does not apply if the two nodes are part of a cascade.\n\n**Note:** Since operations such as `sink` and `map` do not generate new stream graph nodes, the configuration will propagate and take effect on the next actual node in the graph.\n\n#### Parameters\n\n**dict** is a dictionary, supporting the following key-value pairs:\n\n| Key                       | Type | Default Value | Description                                                                                                                                                    |\n| ------------------------- | ---- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| subscription.batchSize    | INT  | 0             | Sets the *batchSize* parameter for subscriptions between adjacent nodes in the stream graph.                                                                   |\n| subscription.throttle     | INT  | 1             | Sets the *throttle* parameter for subscriptions between adjacent nodes in the stream graph.                                                                    |\n| subscription.timeTrigger  | BOOL | false         | Sets the *timeTrigger*parameter for subscriptions between adjacent nodes in the stream graph.                                                                  |\n| subscription.sourceOffset | INT  | -3            | Sets the *offset* parameter of subscriptions between nodes created by `StreamGraph::source` and their directly connected downstream nodes in the stream graph. |\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\nThe following example sets the *batchSize* parameter for the subscription for the 1-minute K-line computation node to 100, while all other subscriptions in the stream graph retain the default *batchSize* value.\n\n```\n，if (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\n\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\nsourceStreams = g.source(\"trade\", 1024:0, `symbol`datetime`price`volume, [SYMBOL, TIMESTAMP,DOUBLE, INT])\n    .fork(2)\nstream_1min = sourceStreams[0]\n    .setLocalConfigOnce({\n      \"subscription.batchSize\": 100\n    })\n    .timeSeriesEngine(60*1000, 60*1000, <[first(price),max(price),min(price),last(price),sum(volume)]>, \"datetime\", false, \"symbol\")\n    .reactiveStateEngine(<[datetime, first_price, max_price, min_price, last_price, sum_volume, mmax(max_price, 5), mavg(sum_volume, 5)]>, `symbol)\n    .sink(\"output_1min\")\nstream_5min = sourceStreams[1]\n    .timeSeriesEngine(5*60*1000, 5*60*1000, <[first(price),max(price),min(price),last(price),sum(volume)]>, \"datetime\", false, \"symbol\")\n    .reactiveStateEngine(<[datetime, first_price, max_price, min_price, last_price, sum_volume, mmax(max_price, 5), mavg(sum_volume, 5)]>, `symbol)\n    .sink(\"output_5min\")\n```\n"
    },
    "StreamGraph::source": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_source%20.html",
        "signatures": [
            {
                "full": "StreamGraph::source(name, colNames, colTypes, [asyncWrite=true], [compress=true], [cacheSize], [retentionMinutes=1440], [flushMode=0], [preCache], [cachePurgeTimeColumn], [cachePurgeInterval], [cacheRetentionTime])",
                "name": "StreamGraph::source",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    },
                    {
                        "full": "[asyncWrite=true]",
                        "name": "asyncWrite",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[compress=true]",
                        "name": "compress",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[cacheSize]",
                        "name": "cacheSize",
                        "optional": true
                    },
                    {
                        "full": "[retentionMinutes=1440]",
                        "name": "retentionMinutes",
                        "optional": true,
                        "default": "1440"
                    },
                    {
                        "full": "[flushMode=0]",
                        "name": "flushMode",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[preCache]",
                        "name": "preCache",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeTimeColumn]",
                        "name": "cachePurgeTimeColumn",
                        "optional": true
                    },
                    {
                        "full": "[cachePurgeInterval]",
                        "name": "cachePurgeInterval",
                        "optional": true
                    },
                    {
                        "full": "[cacheRetentionTime]",
                        "name": "cacheRetentionTime",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::source](https://docs.dolphindb.com/en/Functions/s/StreamGraph_source%20.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::source(name, colNames, colTypes, \\[asyncWrite=true], \\[compress=true], \\[cacheSize], \\[retentionMinutes=1440], \\[flushMode=0], \\[preCache], \\[cachePurgeTimeColumn], \\[cachePurgeInterval], \\[cacheRetentionTime])\n\n#### Details\n\nIn Orca, the `source` interface is used to create a persistent shared stream data table and to serve it as the input node of a streaming graph.\n\nWhen the specified stream table already exists, the `source` will directly bind to the existing table and validate whether the provided schema is consistent with the table’s existing schema. If they are inconsistent, a schema conflict error will be thrown.\n\nFor details about persisted shared stream table., see [enableTableShareAndPersistence](https://docs.dolphindb.com/en/Functions/e/enableTableShareAndPersistence.html).\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**colNames** is a STRING vector of column names.\n\n**colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n**asyncWrite** (optional) is a Boolean value indicating whether persistence is enabled in asynchronous mode. The default value is true, meaning asynchronous persistence is enabled. In this case, once data is written into memory, the write is deemed complete. The data stored in memory is then persisted to disk by another thread.\n\n**compress** (optional) is a Boolean value indicating whether to save a table to disk in compression mode. The default value is true.\n\n**cacheSize** (optional) is an integer used to determine the maximum number of records to retain in memory. If set to 0 or not specified, all records will be retained. Any positive integer smaller than 1000 will automatically be adjusted to 1000.\n\n**retentionMinutes** (optional) is an integer indicating for how long (in minutes) a log file larger than 1GB will be kept after last update. The default value is 1440, which means the log file is kept for 1440 minutes, i.e., 1 day.\n\n**flushMode** (optional) is an integer indicating whether to enable synchronous disk flush. It can be 0 or 1. The persistence process first writes data from memory to the page cache, then flushes the cached data to disk. If *flushMode* is 0 (default), asynchronous disk flushing is enabled. In this case, once data is written from memory to the page cache, the flush is deemed complete and the next batch of data can be written to the table. If *flushMode* is set to 1, the current batch of data must be flushed to disk before the next batch can be written.\n\n**preCache** (optional) is an integer indicating the number of records to be loaded into memory from the persisted stream table on disk when DolphinDB restarts. If it is not specified, all records are loaded into memory when DolphinDB restarts.\n\n**cachePurgeTimeColumn** (optional) is a STRING scalar indicating the time column in the stream table.\n\n**cachePurgeInterval** (optional) is a DURATION scalar indicating the interval to trigger cache purge.\n\n**cacheRetentionTime** (optional) is a DURATION scalar indicating the retention time of cached data. Note: Since version 3.00.2/2.00.14, *cacheRetentionTime* must be smaller than *cachePurgeInterval*.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\ng = createStreamGraph(\"indicators\")\ng.source(\"trade\", `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n```\n"
    },
    "StreamGraph::sourceByName": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_sourceByName.html",
        "signatures": [
            {
                "full": "StreamGraph::sourceByName(name)",
                "name": "StreamGraph::sourceByName",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::sourceByName](https://docs.dolphindb.com/en/Functions/s/StreamGraph_sourceByName.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::sourceByName(name)\n\n#### Details\n\nReturns a submitted shared stream table object in the stream graph by name.\n\n#### Parameters\n\n**name** is a string representing the name of the Orca stream table. You can provide either the fully qualified name (FQN), such as \"trading.orca\\_table.factors\", or just the table name, like \"factors\". If only the name is given, the system will automatically complete it using the current catalog.\n\n#### Returns\n\nA DStream object.\n\n#### Examples\n\nFirst, create and submit the stream graph \"aggregation\".\n\n```\nif (!existsCatalog(\"orca\")) {\n\tcreateCatalog(\"orca\")\n}\ngo\nuse catalog orca\n\naggGraph = createStreamGraph(\"aggregation\")\naggGraph.source(\"trade\", `time`sym`price, [TIMESTAMP, SYMBOL, FLOAT])\n  .timeSeriesEngine(windowSize=60, step=60, metrics=[<sum(price) as price>], timeColumn=\"time\", keyColumn=\"sym\")\n  .sink(\"aggregated\")\naggGraph.submit()\n```\n\nIn another stream graph, use `sourceByName` to get the output stream table \"aggregated\" from the submitted \"aggregation\" stream graph.\n\n```\ndef EMA(S, N) {\n\treturn ::ewmMean(S, span = N, adjust = false)\n}\nindicatorGraph = createStreamGraph(\"indicators\")\nindicatorGraph.sourceByName(\"aggregated\")\n  .reactiveStateEngine(metrics=[<EMA(price, 20)>], keyColumn=`sym)\n  .sink(\"indicators\")\nindicatorGraph.submit()\n```\n"
    },
    "StreamGraph::str": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_str.html",
        "signatures": [
            {
                "full": "StreamGraph::str()",
                "name": "StreamGraph::str",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::str](https://docs.dolphindb.com/en/Functions/s/StreamGraph_str.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::str()\n\n#### Details\n\nOutput the topology of the streaming graph as a string.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\n// g is the streaming graph\ng.str()\n```\n"
    },
    "StreamGraph::submit": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_submit.html",
        "signatures": [
            {
                "full": "StreamGraph::submit([checkpointConfig])",
                "name": "StreamGraph::submit",
                "parameters": [
                    {
                        "full": "[checkpointConfig]",
                        "name": "checkpointConfig",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::submit](https://docs.dolphindb.com/en/Functions/s/StreamGraph_submit.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::submit(\\[checkpointConfig])\n\n#### Details\n\nSubmits a stream graph.\n\nIn a cluster deployment, this function must be run on a compute node, and the user must be an administrator or have the COMPUTE\\_GROUP\\_EXEC permission to submit the task successfully.\n\nIn a single-node deployment, permission checks are not required, and the stream graph can be submitted directly.\n\n| key                      | Description                                                                                                                                       | Value Range                 | Default    |\n| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ---------- |\n| enable                   | Whether to enable Checkpoint                                                                                                                      | true/false                  | false      |\n| interval                 | Time interval to trigger Checkpoint, in milliseconds                                                                                              | \\[10 seconds, 1 year]       | 1 hour     |\n| timeout                  | Timeout for Checkpoint. If Checkpoint is not completed within the specified time, it will be considered failed, in milliseconds                   | \\[1 second, 1 hour]         | 10 minutes |\n| alignedTimeout           | Timeout for Barrier alignment. If alignment is not completed within the specified time, the Checkpoint will be considered failed, in milliseconds | \\[100 milliseconds, 1 hour] | 10 minutes |\n| minIntervalBetweenCkpt   | Minimum time interval between the completion of the last Checkpoint and the initiation of the next Checkpoint                                     | \\[0, 1 year]                | 0          |\n| consecutiveFailures      | Maximum number of consecutive Checkpoint failures. If exceeded, the status of the entire streaming graph will be switched to ERROR.               | \\[0, 102400]                | 3          |\n| maxConcurrentCheckpoints | Maximum number of concurrent Checkpoints allowed. Please note that allowing concurrent Checkpoints may impact running streaming jobs.             | \\[1, 102400]                | 1          |\n| maxRetainedCheckpoints   | The system will periodically clean up historical Checkpoint data. This parameter sets the maximum number of latest Checkpoints to retain.         | \\[1, 1024]                  | 3          |\n\n#### Parameters\n\n**checkpointConfig**(optional) is a dictionary that specifies configuration options related to stream graph checkpoints. Available options are:\n\n#### Examples\n\nSubmit a stream graph g with custom checkpoint settings.\n\nFor more information on stream graph submission and usage, see the Orca page.\n\n```\nif (!existsCatalog(\"demo\")) {\n\tcreateCatalog(\"demo\")\n}\ngo\nuse catalog demo\n\n// Define checkpoint config\nckptConfig = {\n    \"enable\":true,\n    \"interval\": 10000,\n    \"timeout\": 36000,\n    \"maxConcurrentCheckpoints\": 1\n};\n\n// Define aggregators\naggregators = [\n    <first(price) as open>,\n    <max(price) as high>,\n    <min(price) as low>,\n    <last(price) as close>,\n    <sum(volume) as volume>\n]\nindicators = [\n    <time>,\n    <high>,\n    <low>,\n    <close>,\n    <volume>\n]\n\n// Create and configure stream graph\ng = createStreamGraph(\"indicators\") \ng.source(\"trade\", `time`symbol`price`volume, [DATETIME,SYMBOL,DOUBLE,LONG])\n    .timeSeriesEngine(windowSize=60, step=60, metrics=aggregators, timeColumn=`time, keyColumn=`symbol)\n    .buffer(\"one_min_bar\")\n    .reactiveStateEngine(metrics=indicators, keyColumn=`symbol)\n    .buffer(\"one_min_indicators\")\n\n// Submit stream graph with checkpoint config\ng.submit(ckptConfig)\n```\n\n**Related functions:** [getOrcaCheckpointConfig](https://docs.dolphindb.com/en/Functions/g/getOrcaCheckpointConfig.html), [setOrcaCheckpointConfig](https://docs.dolphindb.com/en/Functions/s/setOrcaCheckpointConfig.html).\n"
    },
    "StreamGraph::toGraphviz": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_toGraphviz.html",
        "signatures": [
            {
                "full": "StreamGraph::toGraphviz()",
                "name": "StreamGraph::toGraphviz",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::toGraphviz](https://docs.dolphindb.com/en/Functions/s/StreamGraph_toGraphviz.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nStreamGraph::toGraphviz()\n\n#### Details\n\nOutput the topology of the streaming graph in Graphviz format.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\n// g is the streaming graph\ng.toGraphviz()\n```\n"
    },
    "StreamGraph::updateRule": {
        "url": "https://docs.dolphindb.com/en/Functions/s/StreamGraph_updateRule.html",
        "signatures": [
            {
                "full": "StreamGraph::updateRule(engineName, key, rules)",
                "name": "StreamGraph::updateRule",
                "parameters": [
                    {
                        "full": "engineName",
                        "name": "engineName"
                    },
                    {
                        "full": "key",
                        "name": "key"
                    },
                    {
                        "full": "rules",
                        "name": "rules"
                    }
                ]
            }
        ],
        "markdown": "### [StreamGraph::updateRule](https://docs.dolphindb.com/en/Functions/s/StreamGraph_updateRule.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nStreamGraph::updateRule(engineName, key, rules)\n\n#### Details\n\nThis function updates the rule set associated with the specified *key* in the stream graph’s rule engine:\n\n* If the specified *key*already exists in the rule engine, update the corresponding value with *rules*;\n* If the *key*does not exist in the rule engine, add the *rules*.\n\nThe core difference from the `updateRule` interface is:\n\n* Rule changes executed via `StreamGraph::updateRule` are automatically persisted by the system, ensuring that all committed rule modifications are loaded and remain effective after a service restart.\n* Rule changes made via `updateRule` only exist in memory, and the modifications will be lost after a service restart.\n\n#### Parameters\n\n**engineName** is a string representing the fully qualified name of the streaming engine, such as `\"catalog_name.orca_engine.engine_name\"`.\n\n**key** is a scalar of STRING or INT type that specifies the key of rule set to be updated.\n\n**rules** is a tuple of metacode indicating the rules to be updated.\n\n#### Examples\n\n```\ncreateCatalog(\"demo\")\ngo\nuse catalog demo\n\n// Set the rule set\nx = [1, 2, NULL]\ny = [ [ < value > 1 > ], [ < price < 2 >, < price > 6 > ], [ < value*price > 10 > ] ]\nruleSets = dict(x, y)\n\n// Create and submit the stream graph\ng = createStreamGraph(\"updateRuleDemo\")\ng.source(\"trades\", `sym`value`price`quantity, [INT, DOUBLE, DOUBLE, DOUBLE])\n    .ruleEngine(ruleSets=ruleSets, outputColumns=[\"sym\",\"value\",\"price\"], policy=\"all\", ruleSetColumn=\"sym\")\n    .setEngineName(\"myRuleEngine\")\n    .sink(\"output\")\ng.submit()\n\n// Update the rule\ng.updateRule(\"demo.orca_engine.myRuleEngine\", 1, [<value>=0>])\n```\n\nRelated functions: [StreamGraph::deleteRule](https://docs.dolphindb.com/en/Functions/s/StreamGraph_deleteRule.html), [updateRule](https://docs.dolphindb.com/en/Functions/u/updateRule.html)\n"
    },
    "streamTable": {
        "url": "https://docs.dolphindb.com/en/Functions/s/streamTable.html",
        "signatures": [
            {
                "full": "streamTable(X, [X1], [X2], ....)",
                "name": "streamTable",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[X1]",
                        "name": "X1",
                        "optional": true
                    },
                    {
                        "full": "[X2]",
                        "name": "X2",
                        "optional": true
                    },
                    {
                        "full": "....",
                        "name": "...."
                    }
                ]
            },
            {
                "full": "streamTable(capacity:size, colNames, colTypes)",
                "name": "streamTable",
                "parameters": [
                    {
                        "full": "capacity:size",
                        "name": "capacity:size"
                    },
                    {
                        "full": "colNames",
                        "name": "colNames"
                    },
                    {
                        "full": "colTypes",
                        "name": "colTypes"
                    }
                ]
            }
        ],
        "markdown": "### [streamTable](https://docs.dolphindb.com/en/Functions/s/streamTable.html)\n\n\n\n#### Syntax\n\nstreamTable(X, \\[X1], \\[X2], ....)\n\nor\n\nstreamTable(capacity:size, colNames, colTypes)\n\n#### Details\n\nCreate a table in real-time mode to be used in streaming (also called a stream table). A table in real-time mode can handle concurrent reading and writing.\n\n#### Parameters\n\nFor the first scenario: **X**, **X1**, **X2** ... can be vectors, matrices or tuples. Each vector, each matrix column and each tuple element must have the same length. **When \\_Xk\\_is a tuple:**\n\n* If the elements of *Xk*are vectors of equal length, each element of the tuple will be treated as a column in the table.\n* If *Xk*contains elements of different types or unequal lengths, it will be treated as a single column in the table (with the column type set to ANY), and each element will correspond to the value of that column in each row.\n\nFor the second scenario:\n\n* **capacity** is a positive integer indicating the amount of memory (in terms of the number of rows) allocated to the table. When the number of rows exceeds capacity, the system will first allocate memory of 1.2\\~2 times of capacity, copy the data to the new memory space, and release the original memory. For large tables, these steps may use significant amount of memory.\n\n* **size** is an integer no less than 0 indicating the initial size (in terms of the number of rows) of the table. If *size*=0, create an empty table; If *size*>0, the initialized values are:\n\n  * false for Boolean type;\n\n  * 0 for numeric, temporal, IPADDR, COMPLEX, and POINT types;\n\n  * Null value for Literal, INT128 types.\n\n  **Note:** If *colTypes* is an array vector, *size* must be 0.\n\n* **colNames** is a STRING vector of column names.\n\n* **colTypes** is a STRING vector of data types. It can use either the reserved words for data types or corresponding strings.\n\n#### Returns\n\nA stream table object.\n\n#### Examples\n\n```\nid=`XOM`GS`AAPL\nx=102.1 33.4 73.6\nrt = streamTable(id, x);\nrt=streamTable(`XOM`GS`AAPL as id, 102.1 33.4 73.6 as x);\ncolName=[\"Name\",\"Age\"]\ncolType=[\"string\",\"int\"]\nrt = streamTable(100:10, colName, colType);\n```\n"
    },
    "streamEventSerializer": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stream_event_serializer.html",
        "signatures": [
            {
                "full": "streamEventSerializer(name, eventSchema, outputTable, [eventTimeField], [commonField])",
                "name": "streamEventSerializer",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "eventSchema",
                        "name": "eventSchema"
                    },
                    {
                        "full": "outputTable",
                        "name": "outputTable"
                    },
                    {
                        "full": "[eventTimeField]",
                        "name": "eventTimeField",
                        "optional": true
                    },
                    {
                        "full": "[commonField]",
                        "name": "commonField",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [streamEventSerializer](https://docs.dolphindb.com/en/Functions/s/stream_event_serializer.html)\n\n\n\n#### Syntax\n\nstreamEventSerializer(name, eventSchema, outputTable, \\[eventTimeField], \\[commonField])\n\n#### Details\n\nSerializes events into BLOB and writes them to a heterogeneous stream table.\n\n#### Parameters\n\n**name** is a string indicating the engine name. It consists of letters, digits, and underscores(\\_) and must start with a letter.\n\n**eventSchema** is a table or a scalar/vector of class definition of event types, indicating the data to be serialized. If it is a table, it must have the schema as follows:\n\n| Column               | Data Type | Comment                                                                                                                                            |\n| -------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |\n| eventType            | STRING    | The event type.                                                                                                                                    |\n| eventField           | STRING    | The field names (separated by comma) of the event type.                                                                                            |\n| fieldType (optional) | STRING    | Data types (separated by comma) of eventField.                                                                                                     |\n| fieldTypeId          | INT\\[]    | Data type IDs of eventField.                                                                                                                       |\n| fieldFormId          | INT\\[]    | Data form IDs of eventField (0: scalar; 1: vector; 2: pair; 3: matrix; 4: set; 5: dictionary; 6: table). Currently, only 0 and 1 can be specified. |\n\n**outputTable** is a non-partitioned in-memory table or a stream table for outputting the results. The output columns are in the following order:\n\n(1) A time column of TIMESTAMP type (if *eventTimeField* is specified);\n\n(2) A SYMBOL or STRING column indicating the events;\n\n(3) A BLOB column that stores the serialized result of each event;\n\n(4) The column(s) with the same names and data types (if *commonField* specified).\n\n**eventTimeField** (optional) is a string scalar or vector indicating the name(s) of time field for the event(s).\n\n* If all events share the same time field name, simply specify it as a single string.\n\n* If the time field varies among events, specify a vector with the same length as *eventSchema*. Each element corresponds to one time field.\n\n**commonField** (optional) is a string scalar or vector indicating the field(s) with the same name and data type. If specified, the common fields can be filtered out during subscription.\n\n#### Returns\n\nA table object.\n\n#### Examples\n\n```\nclass MarketData{\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def MarketData(m,c,p,q){\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\nclass Orders{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def Orders(t, m,c,p,q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\nclass Trades{\n    trader :: STRING\n    market :: STRING\n    code :: STRING\n    price :: DOUBLE\n    qty :: INT\n    def Trades(t, m,c,p,q){\n        trader = t\n        market = m\n        code = c\n        price = p\n        qty = q\n    }\n}\nshare streamTable(array(STRING, 0) as eventType, array(BLOB, 0) as blobs) as events\nserializer = streamEventSerializer(name=`serOutput, eventSchema=[MarketData, Orders, Trades], outputTable=events)\n```\n\nThe *eventTimeField* parameter can be used to specify the name of the time field in the event, indicating that the serializer should use this field as the event time. In this case, the first column of the output table must be a timestamp.\n\nIf filtering based on certain fields is required, the *commonField* parameter can be used to specify the relevant field names.\n\n```\n// Define the event class  \nclass MarketData{  \n    market :: STRING  \n    code :: STRING  \n    price :: DOUBLE  \n    qty :: INT  \n    timestamp :: TIMESTAMP  \n    def MarketData(m,c,p,q){  \n        market = m  \n        code = c  \n        price = p  \n        qty = q  \n        timestamp = now()  \n    }  \n}  \n  \n// Define the monitor \nclass TestMonitor: CEPMonitor {  \n    def TestMonitor(){  \n    } \n      \n    def processMarketData(event){  \n        // Send the event to the output table (serializer)  \n        emitEvent(event)  \n    }\n          \n    def onload(){  \n        // Listen for MarketData events and send them to the serializer  \n        addEventListener(handler=processMarketData, eventType=\"MarketData\", times=\"all\")  \n    }       \n  \n}  \n  \n// Create the output table  \nshare(streamTable(array(TIMESTAMP, 0) as eventTime, array(STRING, 0) as eventType, array(BLOB, 0) as blobs, array(STRING, 0) as market, array(STRING, 0) as code), `events) \n  \n// Create the serializer  \nserializer = streamEventSerializer(name=`serOutput,   \n                                 eventSchema=[MarketData],   \n                                 outputTable=events,  \n                                 eventTimeField=\"timestamp\",  \n                                 commonField=[\"market\", \"code\"])  \n  \n// Create the CEP engine  \ndummy = table(array(STRING, 0) as eventType, array(BLOB, 0) as blobs)  \nengine = createCEPEngine(name=\"testEngine\",   \n                       monitors=<TestMonitor()>,   \n                       dummyTable=dummy,   \n                       eventSchema=[MarketData],  \n                       outputTable=serializer)  \n  \n// Create and ingest events  \nmd1 = MarketData(\"SHSE\", \"000001\", 10.50, 1000)  \nmd2 = MarketData(\"SZSE\", \"000002\", 15.80, 500)  \n  \n// Ingest events through the CEP engine  \nappendEvent(engine, md1)  \nappendEvent(engine, md2)  \n  \n// Check results  \nselect * from events\n```\n\n| eventTime               | eventType  | blobs                                | market | code   |\n| ----------------------- | ---------- | ------------------------------------ | ------ | ------ |\n| 2026.04.10 19:43:13.585 | MarketData | SHSE000001%@�\\u0003���x�\\u0001       | SHSE   | 000001 |\n| 2026.04.10 19:43:13.585 | MarketData | SZSE000002������/@�\\u0001���x�\\u0001 | SZSE   | 000002 |\n"
    },
    "stretch": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stretch.html",
        "signatures": [
            {
                "full": "stretch(X, n)",
                "name": "stretch",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "n",
                        "name": "n"
                    }
                ]
            }
        ],
        "markdown": "### [stretch](https://docs.dolphindb.com/en/Functions/s/stretch.html)\n\n\n\n#### Syntax\n\nstretch(X, n)\n\n#### Details\n\n* If *X* is a vector or tuple, stretches *X* evenly to a new vector or tuple with the length of *n*.\n\n* If *X* is a matrix or table, stretches *X* evenly to a new matrix or table with *n* rows.\n\nThe difference between `stretch` and [take](https://docs.dolphindb.com/en/Functions/t/take.html) lies in:\n\n* `take` takes *n* values iteratively and sequentially from a vector, whereas `stretch` copies each element of the vector to stretch the vector to a new length *n*.\n\n#### Parameters\n\n**X** is a vector/tuple/matrix/table.\n\n**n** is a non-negative integer.\n\n#### Returns\n\nAn object with the same form as *X*.\n\n#### Examples\n\n```\nX = 1 NULL 2 3\nprint stretch(X, 10)\n// output: [1,1,1,,,,2,2,3,3]\n\nprint stretch(X, 11)\n// output: [1,1,1,,,,2,2,2,3,3]\n\nprint stretch(X, 12)\n// output: [1,1,1,,,,2,2,2,3,3,3]\n\nprint take(X, 10)\n// output: [1,,2,3,1,,2,3,1,]\n\nY=array(INT[], 0, 10).append!([1 NULL 3, 4 5, 6 NULL 8, 9 10]);\nprint stretch(Y,7)\n// output: [[1,,3],[1,,3],[4,5],[4,5],[6,,8],[6,,8],[9,10]]\n\ns=[1 2 3, 4 5 6]\nstretch(s, 5)\n// output: ([1,2,3],[1,2,3],[1,2,3],[4,5,6],[4,5,6])\n\nm=matrix(1 2 3, 4 5 6)\nstretch(m,5)\n/* output:\ncol1        col2\n1   4\n1   4\n2   5\n2   5\n3   6\n*/\n\nt=table(1 2 3 as a, 4 5 6 as b)\nstretch(t,5)\n/* output:\na   b\n1   4\n1   4\n2   5\n2   5\n3   6\n*/\n```\n"
    },
    "string": {
        "url": "https://docs.dolphindb.com/en/Functions/s/string.html",
        "signatures": [
            {
                "full": "string(X)",
                "name": "string",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [string](https://docs.dolphindb.com/en/Functions/s/string.html)\n\n\n\n#### Syntax\n\nstring(X)\n\n#### Details\n\nConvert X to a string.\n\n#### Parameters\n\n**X** can be of any data type.\n\n#### Returns\n\nThe return value has the same data form as *X*.\n\n#### Examples\n\n```\nstring()==\"\";\n// output: 1\nstring(10);\n\n// output: 10\n\ntypestr string(108.5);\n// output: STRING\n\nstring(now());\n// output: 2016.03.02T20:55:31.287\n```\n"
    },
    "stringFormat": {
        "url": "https://docs.dolphindb.com/en/Functions/s/stringFormat.html",
        "signatures": [
            {
                "full": "stringFormat(format, [args...])",
                "name": "stringFormat",
                "parameters": [
                    {
                        "full": "format",
                        "name": "format"
                    },
                    {
                        "full": "[args...]",
                        "name": "[args...]"
                    }
                ]
            }
        ],
        "markdown": "### [stringFormat](https://docs.dolphindb.com/en/Functions/s/stringFormat.html)\n\n#### Syntax\n\nstringFormat(format, \\[args...])\n\n#### Details\n\n`stringFormat` formats strings by replacing placeholders with values passed by the user. Formatting options (e.g. field width, precision, alignment) can be specified for more precise control over how the values are formatted in the output strings.\n\nTable 1. Supported data types\n\n| Type                    | Placeholder (%-formatting) | Examples of args                                             |\n| ----------------------- | -------------------------- | ------------------------------------------------------------ |\n| BOOL                    | %b                         | 1b, 0b, true, false                                          |\n| CHAR                    | %c                         | 'a', 97c                                                     |\n| SHORT                   | %h                         | 122h                                                         |\n| integer (INT)           | %i                         | 21                                                           |\n| octal                   | %o                         | 31                                                           |\n| hexadecimal (lowercase) | %x                         | 2f                                                           |\n| hexadecimal (uppercase) | %X                         | 2F                                                           |\n| LONG                    | %l                         | 25l                                                          |\n| DATE                    | %d                         | 2022.01.01                                                   |\n| MONTH                   | %M                         | 2022.05M                                                     |\n| TIME                    | %t                         | 13:00:10.706                                                 |\n| MINUTE                  | %m                         | 13:30m                                                       |\n| SECOND                  | %s                         | 13:30:10                                                     |\n| DATETIME                | %D                         | 2012.06.13 13:30:10, 2012.06.13T13:30:10                     |\n| TIMESTAMP               | %T                         | 2012.06.13 13:30:10.008, 2012.06.13T13:30:10.008             |\n| NANOTIME                | %n                         | 13:30:10.008007006                                           |\n| NANOTIMESTAMP           | %N                         | 2012.06.13 13:30:10.008007006, 2012.06.13T13:30:10.008007006 |\n| FLOAT                   | %f                         | 2.1f                                                         |\n| DOUBLE                  | %F                         | 2.1                                                          |\n| SYMBOL                  | %S                         | symbol(\\[\"aaa\", \"bbb\"])                                      |\n| STRING                  | %W                         | \"Hello\"                                                      |\n| ANY (tuple)             | %A                         | (1, 45, 'sah')                                               |\n\n**Note:** If the string contains a \"%\" character, it must be escaped by using a double percent sign (%%).\n\nYou can specify formatting options inside the placeholders like `%[(var)][#][±][0][m/*][.][n/*]type`.\n\nTable 2. The following table lists the options which can be inserted before the decimal point `.` in placeholders:\n\n<table id=\"table_klg_nr2_czb\"><thead><tr><th align=\"left\">\n\nSpecifier\n\n</th><th align=\"left\">\n\nMeaning\n\n</th><th align=\"left\">\n\nExamples\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\n*m* (a positive integer)\n\n</td><td align=\"left\">\n\n\\[Used with %f, %F or %W]For FLOAT (f) and DOUBLE (F) data types, *m* indicates the minimum total width of the output string.\n\n* If *m* is smaller than the actual total number of digits in the float number, the full float number is output directly (rounded to 6 decimal places if needed).\n* If *m* is greater than the total digits, the output string is padded with leading spaces by default.\n\nFor STRING (W) data type, *m* indicates the minimum total length of the output string. -   If m is smaller than the actual string length, the full string is output.\n\n* If m is greater than the string length, the output string is padded with leading spaces.The output string is right-alignment by default.\n\n</td><td align=\"left\">\n\n`stringFormat(\"%10f\", pi)`output: `··3.141593`\n\n`stringFormat(\"%2f\", 12345.0)`output: `12345.000000`\n\n`stringFormat(\"%10W\", \"6chars\")`output: `····6chars`\n\n</td></tr><tr><td align=\"left\">\n\n\\*\n\n</td><td align=\"left\">\n\nLike *m*, \\* indicates the minimum total width of the output string. However, \\* allows passing the width as an argument (*args*). Specify the width in the corresponding argument (*args*) in tuple format: `(width,value)`.\n\n</td><td align=\"left\">\n\n`stringFormat(\"%*f\", (10,pi))`output: `··3.141593`\n\n</td></tr><tr><td align=\"left\">\n\n0\n\n</td><td align=\"left\">\n\n*0* pads numeric values with zeros. For left-aligned fields, the zeros are padded on the right side. If *0* is not specified, the output string is padded with spaces.\n\n</td><td align=\"left\">\n\n`stringFormat(\"%010f\", pi)`output: `003.141593`\n\n</td></tr><tr><td align=\"left\">\n\n*\n\n</td><td align=\"left\">\n\n*-* left-aligns the output string within the specified field width.\n\n</td><td align=\"left\">\n\n`stringFormat(\"%-10.3f\", pi)`output: `3.142`\n\n</td></tr><tr><td align=\"left\">\n\n*\n\n</td><td align=\"left\">\n\n*+* adds a plus sign \"`+`\" before positive values.\n\n</td><td align=\"left\">\n\n`stringFormat('%+f', pi)`output: `+3.141593`\n\n</td></tr><tr><td align=\"left\">\n\n(var)\n\n</td><td align=\"left\">\n\n\\[Cannot be used with other specifiers] (var) allows you to format a string using a dictionary, where the dictionary keys act as variables in the string. To specify a key, put it in parentheses after the *%* symbol. The values in the dictionary are substituted into the string where the `%(key)type` placeholders are located.\n\n</td><td align=\"left\">\n\n`employee = {\"name\":\"Lisa Mill\", \"year\":2010} stringFormat(\"%(name)W joined the company in %(year)i\", employee)`output: \\`Lisa Mill joined the company in 2010\\`\\`\n\n</td></tr><tr><td align=\"left\">\n\n\\#\n\n</td><td align=\"left\">\n\n\\[Used with %o, %x or %X] *#* adds \"0o\" before octal values; adds \"0x\" (lower case) or \"0X\" (upper case) before hexadecimal values.\n\n</td><td align=\"left\">\n\n`stringFormat(\"%#o\", 33)`output: `0o41`\n\n`stringFormat(\"%#X\", 33)`output: `0X21`\n\n</td></tr></tbody>\n</table>Table 3. The following table lists the options which can be inserted after the decimal point `.` in placeholders \\(these options can only be used with **%f, %F** or **%W**\\):\n\n<table id=\"table_xk1_4r2_czb\"><thead><tr><th align=\"left\">\n\nSpecifier\n\n</th><th align=\"left\">\n\nMeaning\n\n</th><th align=\"left\">\n\nExamples\n\n</th></tr></thead><tbody><tr><td align=\"left\">\n\n*n* (a positive integer)\n\n</td><td align=\"left\">\n\nFor FLOAT (f) and DOUBLE (F) data types, *n* specifies the number of digits after the decimal point.-   If *n* is smaller than the number of decimal digits, the float number is rounded to *n* digits.\n\n* If *n* is greater than the number of decimal digits, zeros are padded to the right.\n\nFor STRING (W) data type, *n* specifies the string length.-   If *n* is smaller than the actual length of string, the string is truncated to *n* characters.\n\n* If *n* is greater than the actual length of string, the full string is output without padding.\n\n</td><td align=\"left\">\n\n`stringFormat(\"%10.5f\", pi)`output: `···3.14159`\n\n`stringFormat('%10.3f' , 3.1)`output: `·····3.100`\n\n`stringFormat(\"%2.10W\", \"6chars\")`output: `6chars`\n\n</td></tr><tr><td align=\"left\">\n\n\\*\n\n</td><td align=\"left\">\n\nLike *n*, \\* specifies the number of digits after the decimal point. However, \\* allows specifying the number of decimals (precision) by passing it as an argument (*args*).Specify the digits in the corresponding argument in tuple format: `([width],[precision],value)`.\n\n</td><td align=\"left\">\n\nSpecify precision: `stringFormat(\"%.*f\", (5,pi))`output: `3.14159`\n\nSpecify both the minimum field width and the precision: `stringFormat(\"%0*.*f\", (10,5,pi))`output: `···3.14159`\n\n</td></tr></tbody>\n</table>## Parameters\n\n**format** is a string containing zero or more placeholders.\n\n**args...** (optional) is one or more values to fill in the placeholder(s) in *format*. If specified, the number and data type of *args* must be consistent with the number and data types of the placeholders in *format*; if not specified, the function outputs *format* directly.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nstringFormat(\"date: %d, time: %t\", 2022.12.01, 10:12:45.065)\n// output: date: 2022.12.01, time: 10:12:45.065\n\nstringFormat(\"Students account for %i%% of our customers.\", 50)\n// output: Students account for 50% of our customers.\n\nt = datetime(now())\nstringFormat(\"The current time is %D.\", t)\n// output: The current time is 2023.01.02T20:36:03.\n\na = 7.596\nstringFormat(\"%-+10.5f\", a)\n// output: +7.59600\n\nstringFormat(\"%010.3f\", a) \n// output: 000007.596\n\nproduct = {\"item\":\"Eggs\", \"price_per_unit\":2}\nstringFormat(\"%(item)W: $ %(price_per_unit)i\", product)\n// output: Eggs: $ 2\n```\n\n"
    },
    "strip": {
        "url": "https://docs.dolphindb.com/en/Functions/s/strip.html",
        "signatures": [
            {
                "full": "strip(X)",
                "name": "strip",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [strip](https://docs.dolphindb.com/en/Functions/s/strip.html)\n\n\n\n#### Syntax\n\nstrip(X)\n\n#### Details\n\nRemoves all space, tab, new line, and carriage characters in both head and tail of a string.\n\n#### Parameters\n\n**X** is a STRING scalar/vector.\n\n#### Returns\n\nData of type STRING, in the same data form as the input parameter.\n\n#### Examples\n\n```\nx=\"\\nhello world\\t\\n\";\nx;\n\n// output: hello world\n\nstrip x;\n// output: hello world\n```\n\nRelated function: [trim](https://docs.dolphindb.com/en/Functions/t/trim.html)\n"
    },
    "strlen": {
        "url": "https://docs.dolphindb.com/en/Functions/s/strlen.html",
        "signatures": [
            {
                "full": "strlen(X)",
                "name": "strlen",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [strlen](https://docs.dolphindb.com/en/Functions/s/strlen.html)\n\n\n\n#### Syntax\n\nstrlen(X)\n\n#### Details\n\nReturn the length of each string in X.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nAn INT scalar or vector.\n\n#### Examples\n\n```\nstrlen('abcdefg');\n// output: 7\n\nstrlen(\"I am a boy.\");\n// output: 11\n\nstrlen([\"abc\",\"123456789\"]);\n// output: [3,9]\n```\n"
    },
    "strlenu": {
        "url": "https://docs.dolphindb.com/en/Functions/s/strlenu.html",
        "signatures": [
            {
                "full": "strlenu(X)",
                "name": "strlenu",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [strlenu](https://docs.dolphindb.com/en/Functions/s/strlenu.html)\n\n\n\n#### Syntax\n\nstrlenu(X)\n\n#### Details\n\nGet the length of a string encoded by Unicode.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nAn INT scalar or vector.\n\n#### Examples\n\n```\nstrlenu(\"database\")\n// output: 8\n\nstrlenu([\"database\",\"DolphinDB\"])\n// output: [8,9]\n```\n"
    },
    "strpos": {
        "url": "https://docs.dolphindb.com/en/Functions/s/strpos.html",
        "signatures": [
            {
                "full": "strpos(X, str)",
                "name": "strpos",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "str",
                        "name": "str"
                    }
                ]
            }
        ],
        "markdown": "### [strpos](https://docs.dolphindb.com/en/Functions/s/strpos.html)\n\n\n\n#### Syntax\n\nstrpos(X, str)\n\n#### Details\n\nIf *X* contains str, return the index in *X* where the first occurrence of str starts; otherwise, return -1.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n**str** is a string scalar/vector.\n\n#### Returns\n\nIf X contains str, returns the start position of str in X. Otherwise, returns -1.\n\n#### Examples\n\n```\nstrpos(\"abcdefg\",\"cd\");\n// output: 2\n\nstrpos(\"abcdefg\",\"d\");\n// output: 3\n\nstrpos(\"abcdefg\",\"ah\");\n// output: -1\n```\n"
    },
    "strReplace": {
        "url": "https://docs.dolphindb.com/en/Functions/s/strReplace.html",
        "signatures": [
            {
                "full": "strReplace(str, pattern, replacement)",
                "name": "strReplace",
                "parameters": [
                    {
                        "full": "str",
                        "name": "str"
                    },
                    {
                        "full": "pattern",
                        "name": "pattern"
                    },
                    {
                        "full": "replacement",
                        "name": "replacement"
                    }
                ]
            }
        ],
        "markdown": "### [strReplace](https://docs.dolphindb.com/en/Functions/s/strReplace.html)\n\n\n\n#### Syntax\n\nstrReplace(str, pattern, replacement)\n\n#### Details\n\nReturn a copy of *str* and replace all occurrences of *pattern* with *replacement*.\n\n#### Parameters\n\n**str** is a string scalar/vector.\n\n**pattern** and **replacement** are both string scalars.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nstrReplace(\"The ball is red.\", \"red\", \"green\");\n// output: The ball is green.\n\nstrReplace([\"The ball is red.\", \"The car is red too.\"], \"red\", \"yellow\");\n// output: [\"The ball is yellow.\",\"The car is yellow too.\"]\n```\n"
    },
    "sub": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sub.html",
        "signatures": [
            {
                "full": "sub(X, Y)",
                "name": "sub",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [sub](https://docs.dolphindb.com/en/Functions/s/sub.html)\n\n\n\n#### Syntax\n\nsub(X, Y) or X-Y\n\n#### Details\n\nReturn the result of element-by-element subtracting *Y* from *X*. If both *X* and *Y* are sets, sub returns a set by eliminating the common elements of *X* and *Y* from *X*.\n\n#### Parameters\n\n**X**/**Y** is a scalar/pair/vector/matrix/set. If one of *X* and *Y* is a pair/vector/matrix, the other is a scalar or a pair/vector/matrix of the same size.\n\n#### Returns\n\nA scalar, pair, vector, matrix, or set.\n\n#### Examples\n\n```\n4:5-2;\n// output: 2 : 3\n\n4:5-1:2;\n// output: 3 : 3\n\nx=1 2 3;\nx-1;\n// output: [0,1,2]\n\n1 sub x;\n// output: [0,-1,-2]\n\ny=4 5 6;\nsub(x,y);\n// output: [-3,-3,-3]\n\nm1=1..6$2:3;\nm1;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 1  | 3  | 5  |\n| 2  | 4  | 6  |\n\n```\nm-2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| -1 | 1  | 3  |\n| 0  | 2  | 4  |\n\n```\nm2=6..1$2:3;\nm2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| 6  | 4  | 2  |\n| 5  | 3  | 1  |\n\n```\nm1-m2;\n```\n\n| #0 | #1 | #2 |\n| -- | -- | -- |\n| -5 | -1 | 3  |\n| -3 | 1  | 5  |\n\n```\nx=set([5,3,4]);\ny=set(8 9 4 6);\nx-y;\n// output: set(3,5)\n\ny-x;\n// output: set(6,9,8)\n```\n"
    },
    "subarray": {
        "url": "https://docs.dolphindb.com/en/Functions/s/subarray.html",
        "signatures": [
            {
                "full": "subarray(X, range)",
                "name": "subarray",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "range",
                        "name": "range"
                    }
                ]
            }
        ],
        "markdown": "### [subarray](https://docs.dolphindb.com/en/Functions/s/subarray.html)\n\n\n\n#### Syntax\n\nsubarray(X, range)\n\n#### Details\n\nWhen a subset of the elements of a vector are needed in calculation, if we use script such as close\\[10:].avg(), a new vector close\\[10:] is generated with replicated data from the original vector close before the calculation is conducted. This not only consumes more memory but also takes time.\n\nFunction `subarray` generates a subarray of the original vector. It only records the pointer to the original vector together with the starting and ending positions of the subarray. As the system does not allocate a large block of memory to store the subarray, data replication does not occur. All read-only operations on vectors can be applied directly to a subarray.\n\n#### Parameters\n\n**X** is a vector/matrix.\n\n**range** is a pair of integers indicating a range. The lower bound is inclusive and the upper bound is exclusive.\n\n#### Returns\n\nA vector.\n\n#### Examples\n\nExample 1\n\n```\nx=1..100\nsubarray(x, 10:20);\n// output: [11,12,13,14,15,16,17,18,19,20]\n\n\nsubarray(x, 90:);\n// output: [91,92,93,94,95,96,97,98,99,100]\n\n\nsubarray(x, :10);\n// output: [1,2,3,4,5,6,7,8,9,10]\n```\n\nExample 2\n\n```\na=rand(1000.0,20000000);\ntimer a.subarray(0:1000000).avg();\n// Time elapsed: 2.037 ms\n\ntimer a[0:1000000].avg();\n// Time elapsed: 36.583 ms\n```\n\nExample 3. Subarrays are read-only.\n\n```\nb=a.subarray(0:1000000);\nb[0]=1;\n// output: Immutable sub vector doesn't support method set\n```\n"
    },
    "submitJob": {
        "url": "https://docs.dolphindb.com/en/Functions/s/submitJob.html",
        "signatures": [
            {
                "full": "submitJob(jobId, jobDesc, jobDef, args...)",
                "name": "submitJob",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    },
                    {
                        "full": "jobDesc",
                        "name": "jobDesc"
                    },
                    {
                        "full": "jobDef",
                        "name": "jobDef"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [submitJob](https://docs.dolphindb.com/en/Functions/s/submitJob.html)\n\n\n\n#### Syntax\n\nsubmitJob(jobId, jobDesc, jobDef, args...)\n\n#### Details\n\nSubmit a batch job to the local node and return the job ID for future reference. To submit a batch job to a remote node, please use submitJob together with [rpc](https://docs.dolphindb.com/en/Functions/r/rpc.html) or [remoteRun](https://docs.dolphindb.com/en/Functions/r/remoteRun.html). For details please refer to the section of [BatchJobManagement](https://docs.dolphindb.com/en/Maintenance/BatchJobManagement.html).\n\nNote: Do not call `submitJob` to submit asynchronous jobs within a recursive function body; otherwise, the node may crash.\n\n#### Parameters\n\n**jobId** is a string indicating the job ID.\n\n**jobDesc** is a string indicating job description.\n\n**jobDef** is a local function that defines the job. Please note that it is not the function name, and therefore it should not be quoted.\n\n**args...** is the arguments of the function. If the function has no arguments, it is unspecified.\n\n#### Returns\n\nA STRING scalar indicating the job ID.\n\n#### Examples\n\nThe following script submits a job to the local node:\n\n```\ndef jobDemo(n){\n    s = 0\n    for (x in 1 : n) {\n        s += sum(sin rand(1.0, 100000000)-0.5)\n        print(\"iteration \" + x + \" \" + s)\n    }\n    return s\n};\n\nsubmitJob(\"jobDemo1\",\"job demo\", jobDemo, 100);\n// output: jobDemo1\n\ngetJobStatus(\"jobDemo1\");\n```\n\n| node      | userID | jobId    | rootJobId                            | jobDesc  | priority | parallelism | clientIp  | clientPort | receivedTime            | startTime               | endTime | errorMsg |\n| --------- | ------ | -------- | ------------------------------------ | -------- | -------- | ----------- | --------- | ---------- | ----------------------- | ----------------------- | ------- | -------- |\n| local8848 | guest  | jobDemo1 | d1d76cad-d46f-338c-4179-21cface3ce7c | job demo | 4        | 2           | 127.0.0.1 | 62016      | 2023.12.12T17:52:01.576 | 2023.12.12T17:52:01.585 |         |          |\n\n*endTime* is empty. This means the job is still running. After the job finishes, *endTime* will have a value.\n\n```\ngetJobStatus(\"jobDemo1\");\n```\n\n| node      | userID | jobId    | rootJobId                            | jobDesc  | priority | parallelism | clientIp  | clientPort | receivedTime            | startTime               | endTime                 | errorMsg |\n| --------- | ------ | -------- | ------------------------------------ | -------- | -------- | ----------- | --------- | ---------- | ----------------------- | ----------------------- | ----------------------- | -------- |\n| local8848 | guest  | jobDemo1 | d1d76cad-d46f-338c-4179-21cface3ce7c | job demo | 4        | 2           | 127.0.0.1 | 62016      | 2023.12.12T17:52:01.576 | 2023.12.12T17:52:01.585 | 2023.12.12T17:53:23.204 |          |\n\n```\ngetJobMessage(\"jobDemo1\");\n\n/* output:\n2020-09-13 13:40:10.139269 Start the job [jobDemo1]: job demo\n2020-09-13 13:40:11.159543 iteration 1 3914.672836\n2020-09-13 13:40:12.118014 iteration 2 4263.240185\n2020-09-13 13:40:13.069435 iteration 3 4006.833021\n......\n2020-09-13 13:41:41.769256 iteration 97 -1897.963368\n2020-09-13 13:41:42.706748 iteration 98 -2455.003061\n2020-09-13 13:41:43.640253 iteration 99 924.915703\n2020-09-13 13:41:43.640253 The job is done.\n*/\n\ngetJobReturn(\"jobDemo1\");\n// output: 924.915703\n\nsubmitJob(\"jobDemo2\",, jobDemo, 10);\n// output: jobDemo2\n\ngetRecentJobs();\n```\n\n| node      | userID | jobId    | rootJobId                            | jobDesc  | priority | parallelism | clientIp  | clientPort | receivedTime            | startTime               | endTime                 | errorMsg |\n| --------- | ------ | -------- | ------------------------------------ | -------- | -------- | ----------- | --------- | ---------- | ----------------------- | ----------------------- | ----------------------- | -------- |\n| local8848 | guest  | jobDemo1 | d1d76cad-d46f-338c-4179-21cface3ce7c | job demo | 4        | 2           | 127.0.0.1 | 62016      | 2023.12.12T17:52:01.576 | 2023.12.12T17:52:01.585 | 2023.12.12T17:53:23.204 |          |\n| local8848 | guest  | jobDemo2 | def84639-5b21-c6b0-47be-986b4563e192 | jobDemo  | 4        | 2           | 127.0.0.1 | 62016      | 2023.12.12T17:57:42.325 | 2023.12.12T17:57:42.327 | 2023.12.12T17:57:49.995 |          |\n\nThe following script submits a job to a remote node:\n\nWith function `rpc` (\"DFS\\_NODE2\" is located in the same cluster as the local node):\n\n```\ndef jobDemo(n){\n    s = 0\n    for (x in 1 : n) {\n        s += sum(sin rand(1.0, 100000000)-0.5)\n        print(\"iteration \" + x + \" \" + s)\n    }\n    return s\n}\n\nrpc(\"DFS_NODE2\", submitJob, \"jobDemo3\", \"job demo\", jobDemo, 10);\n// output: jobDemo3\n\n\nrpc(\"DFS_NODE2\", getJobReturn, \"jobDemo3\");\n// output: -3426.577521\n```\n\nuse function `remoteRun` or `remoteRunWithCompression`. For example:\n\n```\nconn = xdb(\"DFS_NODE2\")\nconn.remoteRun(submitJob, \"jobDemo4\", \"job demo\", jobDemo, 10);\n// output: jobDemo4\n\nconn.remoteRun(getJobReturn, \"jobDemo4\");\n// output: 4238.832005\n```\n"
    },
    "submitJobEx": {
        "url": "https://docs.dolphindb.com/en/Functions/s/submitJobEx.html",
        "signatures": [
            {
                "full": "submitJobEx(jobId, jobDesc, priority, parallelism, jobDef, args...)",
                "name": "submitJobEx",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    },
                    {
                        "full": "jobDesc",
                        "name": "jobDesc"
                    },
                    {
                        "full": "priority",
                        "name": "priority"
                    },
                    {
                        "full": "parallelism",
                        "name": "parallelism"
                    },
                    {
                        "full": "jobDef",
                        "name": "jobDef"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [submitJobEx](https://docs.dolphindb.com/en/Functions/s/submitJobEx.html)\n\n\n\n#### Syntax\n\nsubmitJobEx(jobId, jobDesc, priority, parallelism, jobDef, args...)\n\n#### Details\n\nSubmit a batch job to the local node and return the job ID for future reference. The only difference between `submitJobEx` and [submitJob](https://docs.dolphindb.com/en/Functions/s/submitJob.html) is that we can specify parameters *priority* and *parallelism* in `submitJobEx`.\n\nNote: Do not call `submitJobEx` to submit asynchronous jobs within a recursive function body; otherwise, the node may crash.\n\n#### Parameters\n\n**jobId** is a string indicating the job ID.\n\n**jobDesc** is a string of the job description.\n\n**priority** is an integer from 0 to 9 indicating the importance of the job. 9 means the most important job.\n\n**parallelism** is a positive integer indicating the maximum number of workers allocated to the job.\n\n**jobDef** is a local function that defines the job. Please note that it is not the function name, and therefore it should not be quoted.\n\n**args...** is the arguments of the local function. If the function has no arguments, it is unspecified.\n\n#### Returns\n\nA STRING scalar indicating the job ID.\n\n#### Examples\n\n```\ndef jobDemo(n){\n    s = 0\n    for (x in 1 : n) {\n        s += sum(sin rand(1.0, 100000000)-0.5)\n        print(\"iteration \" + x + \" \" + s)\n    }\n    return s\n};\n\nsubmitJobEx(\"jobDemo1\",\"job demo\", 8, 12, jobDemo, 100);\n// output: jobDemo1\n```\n"
    },
    "submitJobEx2": {
        "url": "https://docs.dolphindb.com/en/Functions/s/submitjobex2.html",
        "signatures": [
            {
                "full": "submitJobEx2(jobId, jobDesc, priority, parallelism, onComplete, jobDef, args...)",
                "name": "submitJobEx2",
                "parameters": [
                    {
                        "full": "jobId",
                        "name": "jobId"
                    },
                    {
                        "full": "jobDesc",
                        "name": "jobDesc"
                    },
                    {
                        "full": "priority",
                        "name": "priority"
                    },
                    {
                        "full": "parallelism",
                        "name": "parallelism"
                    },
                    {
                        "full": "onComplete",
                        "name": "onComplete"
                    },
                    {
                        "full": "jobDef",
                        "name": "jobDef"
                    },
                    {
                        "full": "args...",
                        "name": "args..."
                    }
                ]
            }
        ],
        "markdown": "### [submitJobEx2](https://docs.dolphindb.com/en/Functions/s/submitjobex2.html)\n\n\n\n#### Syntax\n\nsubmitJobEx2(jobId, jobDesc, priority, parallelism, onComplete, jobDef, args...)\n\n#### Details\n\nSubmit a batch job to the local node and return the job ID for future reference. Different from `submitJobEx`, `submitJobEx2` will execute the callback function after the submitted job is finished.\n\nNote: Do not call `submitJobEx2` to submit asynchronous jobs within a recursive function body; otherwise, the node may crash.\n\n#### Parameters\n\n**jobId** is a string indicating the job ID.\n\n**jobDesc** is a string of the job description.\n\n**priority** is an integer from 0 to 9 indicating the importance of the job. 9 means the most important job.\n\n**parallelism** is a positive integer indicating the maximum number of workers allocated to the job.\n\n**onComplete** is a callback function that executes after the submitted batch job finishes (including job completion or failure). The function accepts four arguments:\n\n* jobId: Job ID.\n* jobDesc: Job description.\n* success: Whether the job has completed successfully.\n* result: Job execution result.\n\n**jobDef** is a local function that defines the job. Please note that it is not the function name, and therefore it should not be quoted.\n\n**args...** is the arguments of the local function. If the function has no arguments, it is unspecified.\n\n#### Returns\n\nA STRING scalar indicating the job ID.\n\n#### Examples\n\n```\ndef jobDemo(n){\n    s = 0\n    for (x in 1 : n) {\n        s += sum(sin rand(1.0, 100000000)-0.5)\n        print(\"iteration \" + x + \" \" + s)\n    }\n    return s\n}\n\ndef cbFunc(jobId, jobDesc, success, result){\n    desc = jobId + \" \" + jobDesc\n    if(success){\n        desc += \" successful \" + result\n    }\n    else{\n        desc += \" with error: \" + result\n    }\n    writeLog(desc)\n}\n\nsubmitJobEx2(\"jobDemo1\",\"job demo\", 8, 12, cbFunc, jobDemo, 100)\n```\n"
    },
    "subscribeStreamingSQL": {
        "url": "https://docs.dolphindb.com/en/Functions/s/subscribeStreamingSQL.html",
        "signatures": [
            {
                "full": "subscribeStreamingSQL([server], queryId,[batchSize=0],[throttle=1],[hash=-1])",
                "name": "subscribeStreamingSQL",
                "parameters": [
                    {
                        "full": "[server]",
                        "name": "server",
                        "optional": true
                    },
                    {
                        "full": "queryId",
                        "name": "queryId"
                    },
                    {
                        "full": "[batchSize=0]",
                        "name": "batchSize",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[throttle=1]",
                        "name": "throttle",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[hash=-1]",
                        "name": "hash",
                        "optional": true,
                        "default": "-1"
                    }
                ]
            }
        ],
        "markdown": "### [subscribeStreamingSQL](https://docs.dolphindb.com/en/Functions/s/subscribeStreamingSQL.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nsubscribeStreamingSQL(\\[server], queryId,\\[batchSize=0],\\[throttle=1],\\[hash=-1])\n\n#### Details\n\nSubscribe to the results of a specified streaming SQL query. The subscriber receives incremental logs and uses them to maintain a shared result table that is updated in real time, ensuring the query results stay continuously refreshed as data changes.\n\n#### Parameters\n\n**server** (optional) A STRING scalar representing the alias or remote connection handle of the node running streaming SQL query (i.e., the server where the query was registered). If not specified or an empty string, the server hosting the query is the local instance.\n\n**queryId** A STRING scalar representing the ID name for the streaming SQL query to subscribe.\n\n**batchSize** (optional) An INTEGRAL scalar which defaults to 0.\n\n* Positive integer: Process incremental logs only when the unprocessed number reaches *batchSize*.\n* Non-positive or unspecified: Process each batch of incremental logs as they arrive.\n\n**throttle** (optional) A floating point which defaults to 1 (in second), specifying the maximum interval after the last log processing. If *batchSize* is not met within this period, logs are processed again.\n\n* If *batchSize* is not specified, *throttle* has no effect even if set.\n* To set *throttle* to less than 1 second, modify the configuration parameter *subThrottle* first.\n\n**hash** (optional) A non-negative integer specifying the subscription thread that processes incoming log messages. If not specified, the system automatically assigns a thread. To process messages of multiple subscription tasks with the same thread, set their hashes to the same value.\n\n#### Returns\n\nA table containing columns of the result for the streaming SQL query.\n\n#### Examples\n\n```\nt=table(1..10 as id,rand(100,10) as val)\nshare t as st\ndeclareStreamingSQLTable(st)\nregisterStreamingSQL(\"select avg(val) from st\",\"sql_avg\") \n\nsubscribeStreamingSQL(queryId=\"sql_avg\")\n```\n\n| avg\\_val |\n| -------- |\n| 64.3     |\n\n**Related functions:** [declareStreamingSQLTable](https://docs.dolphindb.com/en/Functions/d/declareStreamingSQLTable.html), [registerStreamingSQL](https://docs.dolphindb.com/en/Functions/r/registerStreamingSQL.html), [unsubscribeStreamingSQL](https://docs.dolphindb.com/en/Functions/u/unsubscribeStreamingSQL.html)\n"
    },
    "subscribeTable": {
        "url": "https://docs.dolphindb.com/en/Functions/s/subscribeTable.html",
        "signatures": [
            {
                "full": "subscribeTable([server],tableName,[actionName],[offset=-1],handler,[msgAsTable=false],[batchSize=0],[throttle=1],[hash=-1],[reconnect=false],[filter],[persistOffset=false],[timeTrigger=false],[handlerNeedMsgId=false],[raftGroup],[userId=\"\"],[password=\"\"],[udpMulticast=false]\\)",
                "name": "subscribeTable",
                "parameters": [
                    {
                        "full": "[server]",
                        "name": "server",
                        "optional": true
                    },
                    {
                        "full": "tableName",
                        "name": "tableName"
                    },
                    {
                        "full": "[actionName]",
                        "name": "actionName",
                        "optional": true
                    },
                    {
                        "full": "[offset=-1]",
                        "name": "offset",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "handler",
                        "name": "handler"
                    },
                    {
                        "full": "[msgAsTable=false]",
                        "name": "msgAsTable",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[batchSize=0]",
                        "name": "batchSize",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[throttle=1]",
                        "name": "throttle",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[hash=-1]",
                        "name": "hash",
                        "optional": true,
                        "default": "-1"
                    },
                    {
                        "full": "[reconnect=false]",
                        "name": "reconnect",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[filter]",
                        "name": "filter",
                        "optional": true
                    },
                    {
                        "full": "[persistOffset=false]",
                        "name": "persistOffset",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[timeTrigger=false]",
                        "name": "timeTrigger",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[handlerNeedMsgId=false]",
                        "name": "handlerNeedMsgId",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[raftGroup]",
                        "name": "raftGroup",
                        "optional": true
                    },
                    {
                        "full": "[userId=\"\"]",
                        "name": "userId",
                        "optional": true,
                        "default": "\"\""
                    },
                    {
                        "full": "[password=\"\"]",
                        "name": "password",
                        "optional": true,
                        "default": "\"\""
                    },
                    {
                        "full": "[udpMulticast=false]\\",
                        "name": "udpMulticast",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [subscribeTable](https://docs.dolphindb.com/en/Functions/s/subscribeTable.html)\n\n\n\n#### Syntax\n\nsubscribeTable(\\[server],tableName,\\[actionName],\\[offset=-1],handler,\\[msgAsTable=false],\\[batchSize=0],\\[throttle=1],\\[hash=-1],\\[reconnect=false],\\[filter],\\[persistOffset=false],\\[timeTrigger=false],\\[handlerNeedMsgId=false],\\[raftGroup],\\[userId=\"\"],\\[password=\"\"],\\[udpMulticast=false]\\\\)\n\n#### Details\n\nSubscribe 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.\n\nReturn 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.\n\n* 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.\n\n* If the subscribed table is overwritten, to keep the subscription we need to cancel the subscription with command [unsubscribeTable](https://docs.dolphindb.com/en/Functions/u/unsubscribeTable.html) and then subscribe to the new table.\n\n* 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 [getCurrentSessionAndUser](https://docs.dolphindb.cn/en/Functions/g/getCurrentSessionAndUser.html)). 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. Note that since DolphinDB 2.00.10.10, users can determine whether to limit the number of failed login attempts by setting the parameter *enhancedSecurityVerification*. If it is not specified, no limit will be applied; if it is set to true, a user's account will be locked for 10 minutes if the user enters the wrong password 5 times in a minute.\n\nTo use UDP multicast in subscription, the socket buffer size must be set as appropriate. The recommended value is greater than or equal to 1 MB.\n\nHere is how to set the socket buffer size in Linux:\n\n* In the Linux terminal, run the following commands:\n\n  ```\n  sudo sysctl -w net.core.rmem_default=1048576\n  sudo sysctl -w net.core.rmem_max=1048576\n  sudo sysctl -w net.core.wmem_default=1048576\n  sudo sysctl -w net.core.wmem_max=1048576\n  ```\n\n* Alternatively, add or modify the values of *net.core.rmem\\_default*, *net.core.rmem\\_max*, *net.core.wmem\\_default* and *net.core.wmem\\_max* to 1048576 in the */etc/sysctl.conf* file, and then run `sudo sysctl -p`.\n\n**Note:** When switching between TCP and UDP, you need to use `unsubscribeTable` to cancel existing subscriptions before using `subscribeTable` to create new subscription topics.\n\n#### Parameters\n\nOnly **tableName** and **handler** are required. All the other parameters are optional.\n\n**server** represents where the stream table is located. It is a string indicating the alias, used to enable cross-node subscriptions within a cluster; or the remote connection handle (obtained via [xdb](https://docs.dolphindb.com/en/Functions/x/xdb.html)) , used to enable cross-cluster subscriptions. If it is unspecified or an empty string (\"\"), it means the local instance.\n\n**tableName** is a string indicating the name of the shared stream table on the aforementioned server.\n\n**actionName** is a string indicating subscription task name. It starts with a letter and can have letters, digits, and underscores. It must be specified if multiple subscriptions on the same node subscribe to the same stream table.\n\n**offset** is an integer indicating the starting position for the subscription, corresponding to a row in the stream table. A positive integer value indicates that the subscription begins from the specified row. Special values are defined as follows:\n\n* When *offset* = -1 (default), the subscription starts from **the current (latest) record** in the stream table and only receives new incoming data.\n* When *offset* = 0, the system subscribes starting from **the first record** in the stream table. Note that if persistence is enabled, older data may be cleaned up based on the retention policy. In such cases, setting *offset* = 0 may cause the subscription to fail, you can specify offset = [getPersistenceMeta](https://docs.dolphindb.com/en/Functions/g/getPersistenceMeta.html)(StreamTable).diskOffset to start from **the first record still retained on disk** from the persisted stream table.\n* If persistence is enabled and *offset* = -2 with *persistOffset* = true, the subscription will resume **from the next record after the last successfully processed offset**. For example, if the last processed offset is 100, consumption will resume from offset 101.\n* When *offset* = -3, the subscription begins from **the earliest availabe record**, including both in-memory and persisted data.\n\nNote: The *offset* is relative to the first row at the time the stream table was created. Memory cleanup does not affect the location of persisted data.\n\n**handler** is a unary function, binary function or a table, which is used to process the subscribed data.\n\n* If *handler* is a unary function, the only parameter of the function is the subscribed data, which can be a table or a tuple of the subscribed table columns.\n\n* The *handler* must be specified as a binary function when *handlerNeedMsgId* = true. The parameters of the function are *msgBody* and *msgId*. For more details, see parameter *handlerNeedMsgId*.\n\n* If *handler* is a table, and the subscribed data is inserted into the table directly. It supports the streaming engine, shared table (including stream table, in-memory table, keyed table, indexed table), and DFS table.\n\nNote that *handler* should be function `appendForJoin`, [getLeftStream](https://docs.dolphindb.com/en/Functions/g/getLeftStream.html) or [getRightStream](https://docs.dolphindb.com/en/Functions/g/getRightStream.html) while subscribing to a stream table for the streaming join engine.\n\n**msgAsTable** is a Boolean value indicating whether the subscribed data is ingested into *handler* as a table or as a tuple. If *msgAsTable*=true, the subscribed data is ingested into *handler* as a table and can be processed with SQL statements. The default value is false, which means the subscribed data is ingested into *handler* as a tuple of columns.\n\n**batchSize** is an integer that specifies the minimum number of unprocessed messages required to trigger message processing.\n\n* When *batchSize* > 0, it means the *handler* will process messages only when the accumulated number of unprocessed messages reaches or exceeds *batchSize*.\n* When *batchSize* is not specified or is ≤ 0, the *handler* will process messages immediately after each batch arrives.\n\n**Note:** *batchSize* is not a strict batch size, but a **trigger threshold**. When *batchSize* = n, the *handler* **may process n or more messages**, without forcibly splitting the data sent by the upstream into smaller batches. For example, if *batchSize* = 300 and the upstream publishes 400 messages at once, the *handler* will process all 400 messages at once. If the upstream publishes 200 messages multiple times, the *handler* will trigger processing once the accumulated unprocessed messages exceed 300.\n\n**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 *throttle* less than 1 second, you need to modify the configuration parameter *subThrottle* first.\n\n**hash** is a hash value (a non-negative 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.\n\n**reconnect** is a Boolean value indicating whether the subscription may be automatically resumed successfully if it is interrupted. With a successfully resubscription, the subscriber receives all streaming data since the interruption. The default value is false. If *reconnect*=true, depending on how the subscription is interrupted, we have the following 3 scenarios:\n\n* If the network is disconnected while both the publisher and the subscriber node remain on, the subscription will be automatically reconnected if the network connection is resumed.\n* If the publisher node crashes, the subscriber node will keep attempting to resubscribe after the publisher node restarts.\n  * If the publisher node adopts data persistence mode for the stream table, the publisher will first load persisted data into memory after restarting. The subscriber won't be able to successfully resubscribe until the publisher reaches the row of data where the subscription was interrupted.\n  * If the publisher node does not adopt data persistence mode for the stream table, the automatic resubscription will fail.\n* If the subscriber node crashes, even after the subscriber node restarts, it won't automatically resubscribe. For this case we need to execute \\`subscribeTable\\` again.\n\n**Note:**\n\nTo subscribe to a high-availability stream table, the parameter *reconnect* should be set to true to ensure that the new leader node can be successfully connected to in case of a leader node change.\n\n**filter** specifies the filter condition(s), which can be used in the following ways:\n\n* Used with function [setStreamTableFilterColumn](https://docs.dolphindb.com/en/Functions/s/setStreamTableFilterColumn.html) to specify the values to be filtered for the stream table. Only messages with matching values are subscribed. *filter* does not support Boolean types and can take the following forms:\n  * A vector: implements value filtering. filter messages by element values. The element type of the vector must be consistent with the type of the filtering column. Types STRING, SYMBOL, and BLOB are interchangeable.\n  * A pair: implements range filtering. The range includes the lower bound but excludes the upper bound. The filtering column does not support types FLOAT, DOUBLE, DECIMAL32/64/128, UUID, IPADDR, or INT128.\n  * A tuple: implements hash filtering. The first element is the number of buckets. The second element is a scalar indicating the bucket index (starting from 0) or a pair indicating the bucket index range (including the lower bound but excluding the upper bound). The filtering column does not support types FLOAT, DOUBLE, or DECIMAL32/64/128.\n* For flexible filtering using a user-defined function, it can be passed in the following two ways:\n  * Function: Pass a function directly. The subscribed data will be provided to the function as a table, and the function’s return value will be sent to the subscriber.\n  * String: Pass a string indicating a function name, an anonymous function, or a lambda expression.\n\n**persistOffset** is 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 [getTopicProcessedOffset](https://docs.dolphindb.com/en/Functions/g/getTopicProcessedOffset.html). The default value is false.\n\n* To subscribe to a high-availability stream table, the parameter *persistOffset* should be set to true to prevent data loss on the subscriber.\n\n* To resubscribe from the persisted offset, set *persistOffset* to true and *removeOffset* of function `unsubscribeTable` to false.\n\n**timeTrigger** is 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.\n\n**handlerNeedMsgId** is a Boolean value. The default value is false.\n\n* If it is true, the parameter *handler* must support 2 parameters: *msgBody* (the messages to be ingested into the streaming engine) and *msgId* (the ID of the last message that has been ingested into the streaming engine). You can pass the `appendMsg` function to the handler after fixing the engine parameter using partial application.\n\n* If it is false, *handler* must support just 1 parameter: *msgBody*.\n\n**raftGroup** is 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.\n\n**Note:**\n\nThe 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)\".\n\n**userId** is a string indicating a user name.\n\n**password** is a string indicating the password.\n\n**udpMulticast** (optional, Linux only) is a Boolean value indicating whether to enable UDP multicast. The default value is false. If set to true, the publisher will publish messages to a multicast channel.\n\nPerformance differences between TCP and UDP Multicast:\n\n<table id=\"table_c1m_4yy_jbc\"><thead><tr><th>\n\nProtocol\n\n</th><th>\n\nPros\n\n</th><th>\n\nCons\n\n</th><th>\n\nApplication\n\n</th></tr></thead><tbody><tr><td>\n\nTCP\n\n</td><td>\n\n* Reliable transmission\n* Data sequentiality\n* Detection and correction during transmission\n\n</td><td>\n\n* One-to-one connection, requiring significant server resources and bandwidth with multiple subscribers\n\n</td><td>\n\nSuitable for applications requiring reliable, ordered data transmission to a single recipient\n\n</td></tr><tr><td>\n\nUDP Multicast\n\n</td><td>\n\n* One-to-multiple real-time transmission\n* Lower resources and network bandwidth requirements\n\n</td><td>\n\n* High rate of packet loss\n* Unsorted data\n\n</td><td>\n\nIdeal for applications needing rapid real-time data transfer to multiple subscribers\n\n</td></tr></tbody>\n</table>**Note**:\n\n* *udpMulticast*can only be set when *reconnect*, *persisitOffset*, *timeTrigger* is false and *raftGroup*= -1.\n* The network routers or switches where the publishers and subscribers are located must support the UDP Multicast stack.\n\n#### Returns\n\nA STRING scalar indicating the subscription topic, i.e., the name of a subscription. For a regular subscription to a non-HA stream table, the topic format is host:port:nodeAlias/tableName/actionName. For a regular subscription to an HA stream table, the topic format is clusterName\\_RaftGroupId/tableName/actionName. For an HA subscription to a non-HA stream table, the topic format is host:port:nodeAlias/tableName/actionName/subscriberNode. For an HA subscription to an HA stream table, the topic format is clusterName\\_RaftGroupId/tableName/actionName/subscriberNode.\n\n#### Examples\n\nExample 1. A cluster has 2 nodes: DFS\\_NODE1 and DFS\\_NODE2. We need to specify *maxPubConnections* and *subPort* in *cluster.cfg* to enable the publish/subscribe functionality. For example:\n\n```\nmaxPubConnections=32\nDFS_NODE1.subPort=9010\nDFS_NODE1.persistenceDir=C:/DolphinDB/Data\nDFS_NODE2.subPort=9011\n```\n\nExecute the following script on DFS\\_NODE1 for the following tasks:\n\n(1) Create a shared stream table \"trades\\_stream\" with persistence in synchronous mode. At this stage table \"trades\\_stream\" has 0 rows.\n\n```\nn=20000000\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nenableTableShareAndPersistence(table=streamTable(n:0, colNames, colTypes), tableName=\"trades_stream\", asynWrite=false, cacheSize=n)\ngo\n```\n\n(2) Create a DFS table \"trades\". At this stage table \"trades\" has 0 rows.\n\n```\nif(existsDatabase(\"dfs://STREAM_TEST\")){\n     dropDatabase(\"dfs://STREAM_TEST\")\n}\ndbDate = database(\"\", VALUE, temporalAdd(date(today()),0..30,'d'))\ndbSym= database(\"\", RANGE, string('A'..'Z') join \"ZZZZ\")\ndb = database(\"dfs://STREAM_TEST\", COMPO, [dbDate, dbSym])\ncolNames = `date`time`sym`qty`price\ncolTypes = [DATE,TIME,SYMBOL,INT,DOUBLE]\ntrades = db.createPartitionedTable(table(1:0, colNames, colTypes), \"trades\", `date`sym)\n```\n\n(3) Create a local subscription to table \"trades\\_stream\". Use a function `saveTradesToDFS` to save streaming data from \"trades\\_stream\" and today's date to table \"trades\".\n\n```\ndef saveTradesToDFS(mutable dfsTrades, msg): dfsTrades.append!(select today() as date,* from msg)\nsubscribeTable(tableName=\"trades_stream\", actionName=\"trades\", offset=0, handler=saveTradesToDFS{trades}, msgAsTable=true, batchSize=100000, throttle=60)\n```\n\n(4) Create another local subscription to table \"trades\\_stream\". Calculate volume-weighted average price (vwap) with streaming data for each minute and save the result to a shared stream table \"vwap\\_stream\" with persistence in asynchronous mode.\n\n```\nn=1000000\ntmpTrades = table(n:0, colNames, colTypes)\nlastMinute = [00:00:00.000]\ncolNames = `time`sym`vwap\ncolTypes = [MINUTE,SYMBOL,DOUBLE]\nenableTableShareAndPersistence(table=streamTable(n:0, colNames, colTypes), tableName=\"vwap_stream\")\ngo\n\ndef calcVwap(mutable vwap, mutable tmpTrades, mutable lastMinute, msg){\n    tmpTrades.append!(msg)\n    curMinute = time(msg.time.last().minute()*60000l)\n    t = select wavg(price, qty) as vwap from tmpTrades where time < curMinute, time >= lastMinute[0] group by time.minute(), sym\n    if(t.size() == 0) return\n    vwap.append!(t)\n    t = select * from tmpTrades where time >= curMinute\n    tmpTrades.clear!()\n    lastMinute[0] = curMinute\n    if(t.size() > 0) tmpTrades.append!(t)\n}\nsubscribeTable(tableName=\"trades_stream\", actionName=\"vwap\", offset=0, handler=calcVwap{vwap_stream, tmpTrades, lastMinute}, msgAsTable=true, batchSize=100000, throttle=60)\n```\n\nExecute the following script on DFS\\_NODE2 to create a remote subscription to table \"trades\\_stream\". This subscription saves streaming data to a shared stream table \"trades\\_stream\\_slave\" with persistence in asynchronous mode.\n\n```\nn=20000000\ncolNames = `time`sym`qty`price\ncolTypes = [TIME,SYMBOL,INT,DOUBLE]\nenableTableShareAndPersistence(table=streamTable(n:0, colNames, colTypes), tableName=\"trades_stream_slave\", cacheSize=n)\ngo\nsubscribeTable(server=\"DFS_NODE1\", tableName=\"trades_stream\", actionName=\"slave\", offset=0, handler=trades_stream_slave)\n```\n\nExecute the following script on DFS\\_NODE1 to simulate the streaming data for 3 stocks and 10 minutes. Generate 2,000,000 records for each stock in each minute. Data in one minute are inserted into the stream table \"trades\\_stream\" in 600 blocks. There is a 100 millisecond interval between 2 blocks.\n\n```\nn=10\nticks = 2000000\nrows = ticks*3\nstartMinute = 09:30:00.000\nblocks=600\nfor(x in 0:n){\n    time = startMinute + x*60000 + rand(60000, rows)\n    indices = isort(time)\n    time = time[indices]\n    sym = array(SYMBOL,0,rows).append!(take(`IBM,ticks)).append!(take(`MSFT,ticks)).append!(take(`GOOG,ticks))[indices]\n    price = array(DOUBLE,0,rows).append!(norm(153,1,ticks)).append!(norm(91,1,ticks)).append!(norm(1106,20,ticks))[indices]\n    indices = NULL\n    blockSize = rows / blocks\n    for(y in 0:blocks){\n        range =pair(y * blockSize, (y+1)* blockSize)\n        insert into trades_stream values(subarray(time,range), subarray(sym,range), 10+ rand(100, blockSize), subarray(price,range))\n        sleep(100)\n    }\n\n    blockSize = rows % blocks\n    if(blockSize > 0){\n        range =pair(rows - blockSize, rows)\n        insert into trades_stream values(subarray(time,range), subarray(sym,range), 10+ rand(100, blockSize), subarray(price,range))\n    }\n}\n```\n\nTo check the results, run the following script on DFS\\_NODE1:\n\n```\ntrades=loadTable(\"dfs://STREAM_TEST\", `trades)\nselect count(*) from trades\n```\n\nWe expect to see a result of 60,000,000\n\n```\nselect * from vwap_stream\n```\n\nWe expect the table \"vwap\\_stream\" has 27 rows.\n\nRun the following script on DFS\\_NODE2:\n\n```\nselect count(*) from trades_stream_slave\n```\n\nWe expect to see a result of less than 60,000,000 as part of the table has been persisted to disk.\n\nExample 3. Specify *filter* as a STRING scalar indicating the user-defined function `filterFn` to filter the subscribed data.\n\n```\nst = streamTable(100:0, `sym`val, `SYMBOL`DOUBLE)\nenableTableShareAndPersistence(st, `st1, cacheSize=1000)\n\noutTable = streamTable(100:0, `sym`val, `SYMBOL`DOUBLE)\n\nfilterFn = def (msg) {\n\treturn (select * from msg where val > 50.0)\n}\n\nsubscribeTable(tableName=`st1, actionName=`testFilter, handler=tableInsert{outTable}, filter=\"filterFn\", offset=0)\n\nfor (i in 1..100) {\n\tn = 100\n\tt = table(rand(`A`B`C, n) as sym, rand(100.0, n) as val)\n\tst.append!(t)\n}\nselect * from outTable\n```\n\nSpecify *filter* as a FUNCTIONDEF scalar:\n\n```\nfilterFn = \"def (msg) { return (select * from msg where val > 50.0) }\"\nsubscribeTable(tableName=`st1, actionName=`testFilter, handler=tableInsert{outTable}, filter=filterFn, offset=0)\n```\n\nExample 3. Create stream table publisher on dnode1 of the cluster.\n\n```\nshare streamTable(10:0,`time`id`value,[TIMESTAMP,INT,DOUBLE]) as publisher\n```\n\nSubscribe to publisher using UDP multicast on dnode2 and write data to sub1:\n\n```\nsub1 = streamTable(10:0,`time`id`value,[TIMESTAMP,INT,DOUBLE])\nsubscribeTable(server=\"dnode1\",tableName=\"publisher\",actionName=\"sub1\",offset=-1,handler=append!{sub1},msgAsTable=true, udpMulticast=true)\n```\n\nWrite data to dnode1:\n\n```\npublisher.tableInsert(table(now()+1..10*1000 as time,1..10 as id, rand(100,10) as value))\n```\n\nCheck the publishing status:\n\n```\ngetStreamingStat().udpPubTables\n```\n\n| tableName | channel        | msgOffset | actions | subNum |\n| --------- | -------------- | --------- | ------- | ------ |\n| publisher | 224.1.1.1:1235 | 10        | sub1    | 1      |\n\nCheck subscription workers on dnode2:\n\n```\ngetStreamingStat().subWorkers\n```\n\n| workerId | topic | type                                  | queueDepthLimit | queueDepth | processedMsgCount | lastMsgId | failedMsgCount | lastFailedMsgId | lastFailedTimestamp | lastErrMsg | msgAsTable | batchSize | throttle | hash | filter | persistOffset | timeTrigger | handlerNeedMsgId | raftGroup |\n| -------- | ----- | ------------------------------------- | --------------- | ---------- | ----------------- | --------- | -------------- | --------------- | ------------------- | ---------- | ---------- | --------- | -------- | ---- | ------ | ------------- | ----------- | ---------------- | --------- |\n| 0        | 2     | localhost:8702: dnode1/publisher/sub1 | udp             | 10,000,000 | 0                 | 10        | 9              | 0               | -1                  |            |            | true      | 0        | 0    | 1      |               | false       | false            | false     |\n\nThe *filter* parameter is a function with one parameter fixed by partial application:\n\n```\nshare streamTable(100:0, `sym`val, `SYMBOL`DOUBLE) as st1\nshare table(100:0, `sym`val, `SYMBOL`DOUBLE) as outTable1\n\ni = 50\nsubscribeTable(tableName=`st1, actionName=`filterDemo, handler=tableInsert{outTable}, \nfilter=def (i, msg) {\nreturn (select * from msg where val > i)\n}{i}, msgAsTable=true, offset=0)\n\nfor (i in 1..100) {\nn = 100\nt = table(rand(`A`B`C, n) as sym, rand(100.0, n) as val)\nst.append!(t)\n}\nselect * from outTable\n```\n"
    },
    "substr": {
        "url": "https://docs.dolphindb.com/en/Functions/s/substr.html",
        "signatures": [
            {
                "full": "substr(X, offset, [length])",
                "name": "substr",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "offset",
                        "name": "offset"
                    },
                    {
                        "full": "[length]",
                        "name": "length",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [substr](https://docs.dolphindb.com/en/Functions/s/substr.html)\n\n\n\n#### Syntax\n\nsubstr(X, offset, \\[length])\n\n#### Details\n\nReturn a substring of *X* with the specified starting position (*offset*) and *length*. The first character of *X* corresponds to position 0. If *length* exceeds the length of X, stop at the end of X.\n\nIf *length* is not specified, return a substring of *X* from the specified starting position (*offset*) to the end of *X*.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n**offset** is a nonnegative integer.\n\n**length** (optional) is a positive integer.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nsubstr(\"This is a test\", 0, 4);\n// output: This\n\nsubstr(\"This is a test\", 5, 2);\n// output: is\n\nsubstr(\"This is a test\", 5);\n// output: is a test\n\nsubstr(\"This is a test\", 8, 100);\n// output: a test\n```\n"
    },
    "substru": {
        "url": "https://docs.dolphindb.com/en/Functions/s/substru.html",
        "signatures": [
            {
                "full": "substru(X, offset, [length])",
                "name": "substru",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "offset",
                        "name": "offset"
                    },
                    {
                        "full": "[length]",
                        "name": "length",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [substru](https://docs.dolphindb.com/en/Functions/s/substru.html)\n\n\n\n#### Syntax\n\nsubstru(X, offset, \\[length])\n\n#### Details\n\nThe only differerence between `substru` and `substr` is that `substru` can process Unicode strings.\n\nReturn a substring of *X* with the specified starting position (*offset*) and *length*. The first character of *X* corresponds to position 0. If *length* exceeds the length of *X*, stop at the end of *X*.\n\nIf *length* is not specified, return a substring of *X* from the specified starting position (*offset*) to the end of *X*.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n**offset** is a nonnegative integer.\n\n**length** (optional) is a positive integer.\n\n#### Returns\n\nA STRING scalar or vector.\n\n#### Examples\n\n```\nsubstru(\"This is a test\", 0, 4);\n// output: This\n\nsubstru(\"This is a test\", 5, 2);\n// output: is\n\nsubstru(\"This is a test\", 5);\n// output: is a test\n\nsubstru(\"This is a test\", 8, 100);\n// output: a test\n```\n"
    },
    "subtuple": {
        "url": "https://docs.dolphindb.com/en/Functions/s/subtuple.html",
        "signatures": [
            {
                "full": "subtuple(X, range)",
                "name": "subtuple",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "range",
                        "name": "range"
                    }
                ]
            }
        ],
        "markdown": "### [subtuple](https://docs.dolphindb.com/en/Functions/s/subtuple.html)\n\n\n\n#### Syntax\n\nsubtuple(X, range)\n\n#### Details\n\nCreate a read-only view of a subarray of each vector in *X* almost instantly. In contrast, it takes time to create a new tuple of vectors.\n\n#### Parameters\n\n**X** is a tuple of vectors with the same length.\n\n**range** is a pair of integers indicating a range. The lower bound is inclusive and the upper bound is exclusive.\n\n#### Returns\n\nA tuple.\n\n#### Examples\n\nExample 1:\n\n```\nx=(1..10, 11..20, 21..30, 31..40)\nsubtuple(x, 2:4);\n// output: ([3,4],[13,14],[23,24],[33,34])\n```\n\nExample 2\n\n```\nm=1000.0\nn=20000000\na=(rand(m,n), rand(m,n))\nk=10000000;\ntimer each(avg, a.subtuple(0:k));\n// Time elapsed: 30.87 ms\n\ntimer each(avg, (a[0][0:k], a[1][0:k]));\n// Time elapsed: 46.508 ms\n```\n\nExample 3. Subtuples are read-only.\n\n```\nx=(1..10, 11..20)\nsubtuple(x, 2:4)=([4, 5], [14, 15]);\n// output: Syntax Error: [line #2] Please use '==' rather than '=' as equal operator in non-sql expression.\n```\n"
    },
    "sum": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sum.html",
        "signatures": [
            {
                "full": "sum(X)",
                "name": "sum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sum](https://docs.dolphindb.com/en/Functions/s/sum.html)\n\n\n\n#### Syntax\n\nsum(X)\n\n#### Details\n\nIf *X* is a vector, calculates the sum of all the elements in *X*.\n\nIf *X* is a matrix, calculates the sum of each column of *X* and return a vector.\n\nIf *X* is a table, calculates the sum of each column of *X* and return a table.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\nIf all elements of a calculation are null values, the result is NULL.\n\n**Note:**\n\nDolphinDB `sum`, [numpy.sum](https://numpy.org/doc/stable/reference/generated/numpy.sum.html), and Python built-in [sum](https://docs.python.org/3/library/functions.html#sum) are all used for summation. The differences are as follows:\n\n* DolphinDB `sum` is an aggregate function that supports scalars, vectors, matrices, and tables. For matrices and tables, summation is performed column-wise, and NULL values are ignored.\n\n* `numpy.sum` is an array reduction function. By default, it sums all elements, and dimensions can be specified with the *axis* parameter. It also supports parameters such as *dtype*, *out*, *keepdims*, *initial*, and *where*.\n\n* Python built-in `sum` only accumulates elements in an iterable from left to right. It does not support axis-based computation and does not automatically ignore missing values.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA scalar, vector, or table.\n\n#### Examples\n\n```\nsum(1 2 3 NULL 4);\n// output: 10\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nsum(m);\n// output: [6,15]\n```\n"
    },
    "sum2": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sum2.html",
        "signatures": [
            {
                "full": "sum2(X)",
                "name": "sum2",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sum2](https://docs.dolphindb.com/en/Functions/s/sum2.html)\n\n\n\n#### Syntax\n\nsum2(X)\n\n#### Details\n\nIf *X* is a vector, return the sum of squares of all the elements in *X*.\n\nIf *X* is a matrix, calculate the sum of squares for each column of *X* and return a vector.\n\nIf *X* is a table, calculate the sum of squares for each column of *X* and return a table.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\nIf all elements of a calculation are null values, the result is NULL.\n\nPlease note that the data type of the result is always DOUBLE, even if the data type of *X* is INT or LONG.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA scalar, vector, or table.\n\n#### Examples\n\n```\nsum2(1 2 3);\n// output: 14\n\nsum2(1 NULL NULL);\n// output: 1\n\nsum2(1.5 4.6 7.8);\n// output: 84.25\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nsum2(m);\n// output: [14,77]\n```\n"
    },
    "sum3": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sum3.html",
        "signatures": [
            {
                "full": "sum3(X)",
                "name": "sum3",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sum3](https://docs.dolphindb.com/en/Functions/s/sum3.html)\n\n\n\n#### Syntax\n\nsum3(X)\n\n#### Details\n\nIf *X* is a vector, return the sum of cubes of all the elements in *X*.\n\nIf *X* is a matrix, calculate the sum of cubes for each column of *X* and return a vector.\n\nIf *X* is a table, calculate the sum of cubes for each column of *X* and return a table.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\nIf all elements of a calculation are null values, the result is NULL.\n\nPlease note that the data type of the result is always DOUBLE, even if the data type of *X* is INT or LONG.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA scalar, vector, or table.\n\n#### Examples\n\n```\nsum3(1 2 3);\n// output: 36\n\nsum3(1 NULL NULL);\n// output: 1\n\nsum3(1.5 4.6 7.8);\n// output: 575.263\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nsum3(m);\n// output: [36,405]\n```\n"
    },
    "sum4": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sum4.html",
        "signatures": [
            {
                "full": "sum4(X)",
                "name": "sum4",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [sum4](https://docs.dolphindb.com/en/Functions/s/sum4.html)\n\n\n\n#### Syntax\n\nsum4(X)\n\n#### Details\n\nIf *X* is a vector, return the sum of the fourth powers of all the elements in *X*.\n\nIf *X* is a matrix, calculate the sum of the fourth powers for each column of *X* and return a vector.\n\nIf *X* is a table, calculate the sum of the fourth powers for each column of *X* and return a table.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\nIf all elements of a calculation are null values, the result is NULL.\n\nPlease note that the data type of the result is always DOUBLE, even if the data type of X is INT or LONG.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix/table.\n\n#### Returns\n\nA scalar, vector, or table.\n\n#### Examples\n\n```\nsum4(1 2 3);\n// output: 98\n\nsum4(1 NULL NULL);\n// output: 1\n\nsum4(1.5 4.6 7.8);\n// output: 4154.3137\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nsum4(m);\n// output: [98,2177]\n```\n"
    },
    "sumbars": {
        "url": "https://docs.dolphindb.com/en/Functions/s/sumbars.html",
        "signatures": [
            {
                "full": "sumbars(X, Y)",
                "name": "sumbars",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [sumbars](https://docs.dolphindb.com/en/Functions/s/sumbars.html)\n\n\n\n#### Syntax\n\nsumbars(X, Y)\n\n#### Details\n\nFor each element X i in *X*, calculate the cumulative sum of X i in the backward direction, i.e., (X i + X i-1 + X i-2 …), until the value is no smaller than *Y*.\n\nIf the cumulative sum never exceeds *Y*, return 0.\n\n#### Parameters\n\n**X** is a vector/tuple/matrix/table whose elements must be non-negative numbers.\n\n**Y** is a scalar indicating the threshold.\n\n#### Returns\n\nAn INT vector or matrix.\n\n#### Examples\n\n```\nsumbars(1 2 3.3 2 5, 3)\n// output: [0,2,1,2,1]\n\nsumbars(matrix(5 3 6 2 3, 2 6 1 5 4), 5)\n```\n\n| col1 | col2 |\n| ---- | ---- |\n| 1    | 0    |\n| 2    | 1    |\n| 1    | 2    |\n| 2    | 1    |\n| 2    | 2    |\n\n```\n// calculate the turnover period\nid = `A`A`B`A`C`B`A`C`A`B\ntime = 2022.01.01T09:00:00 + 0..9\nvolume = 100 150 80 120 220 200 180 90 100 125\nt = table(id, time, volume)\ncapital = 300\nre = select *, sumbars(volume, capital) as period from t\nre;\n```\n\n| id | time                | volume | period |\n| -- | ------------------- | ------ | ------ |\n| A  | 2022.01.01T09:00:00 | 100    | 0      |\n| A  | 2022.01.01T09:00:01 | 150    | 0      |\n| B  | 2022.01.01T09:00:02 | 80     | 3      |\n| A  | 2022.01.01T09:00:03 | 120    | 3      |\n| C  | 2022.01.01T09:00:04 | 220    | 2      |\n| B  | 2022.01.01T09:00:05 | 200    | 2      |\n| A  | 2022.01.01T09:00:06 | 180    | 2      |\n| C  | 2022.01.01T09:00:07 | 90     | 3      |\n| A  | 2022.01.01T09:00:08 | 100    | 3      |\n| B  | 2022.01.01T09:00:09 | 125    | 3      |\n"
    },
    "summary": {
        "url": "https://docs.dolphindb.com/en/Functions/s/summary.html",
        "signatures": [
            {
                "full": "summary(X,[interpolation],[characteristic],[percentile],[precision],[partitionSampling])",
                "name": "summary",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[interpolation]",
                        "name": "interpolation",
                        "optional": true
                    },
                    {
                        "full": "[characteristic]",
                        "name": "characteristic",
                        "optional": true
                    },
                    {
                        "full": "[percentile]",
                        "name": "percentile",
                        "optional": true
                    },
                    {
                        "full": "[precision]",
                        "name": "precision",
                        "optional": true
                    },
                    {
                        "full": "[partitionSampling]",
                        "name": "partitionSampling",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [summary](https://docs.dolphindb.com/en/Functions/s/summary.html)\n\n#### Syntax\n\nsummary(X,\\[interpolation],\\[characteristic],\\[percentile],\\[precision],\\[partitionSampling])\n\n#### Details\n\n`summary` generates summary statistics for the input data. It returns an in-memory table containing the minimum, maximum, count, mean, standard deviation, and specified percentiles in ascending order.\n\n* If *X* is a table, `summary` only computes statistics for the numeric columns.\n\n* If *X* is a data source, it can only contain numeric columns, otherwise an error will occur during computation.\n\n#### Parameters\n\n**X** can be an in-memory table, DFS table or data source generated from [sqlDS](https://docs.dolphindb.com/en/Functions/s/sqlDS.html). Note that data sources with SQL metacode containing table joins are currently not supported.\n\n**interpolation** (optional) is a string indicating the interpolation method for percentiles. It can be \"linear\" (default), \"nearest\", \"lower\", \"higher\" and \"midpoint\".\n\n**characteristic** (optional) is a string scalar or vector indicating the characteristics to compute. It can be \"avg\" and/or \"std\". Default is both characteristics.\n\n**percentile** (optional) is a DOUBLE vector of percentiles to compute. Each vector element falls between 0 ang 100. The default is \\[25,50,75], which returns the 25th, 50th, and 75th percentiles.\n\n**precision** (optional) is a DOUBLE scalar greater than 0. The default value is 1e-3, which means the iteration for computing statistics will stop when the difference between the current and previous result is less than or equal to 1e-3. It is recommended to set precision between \\[1e-3, 1e-9] - small enough for adequate precision but not too small to impact performance through excessive iterations.\n\n**partitionSampling** (optional) can be a positive integer specifying the number of partitions to sample, or a float between (0, 1] specifying the sampling ratio. If not specified, statistics are computed on all partitions. When specifying *partitionSampling*, note:\n\n* For a partitioned table:\n\n  * at least one partition will always be sampled. If the sampling ratio \\* total partitions < 1, one partition is sampled.\n\n  * The sampling ratio is rounded down if the sampling ratio \\* total partitions is not an integer. E.g. if ratio=0.26 and total partitions is 10, 2 partitions are sampled.\n\n  * If *partitionSampling* (integer) > total partitions, all partitions are used.\n\n* *partitionSampling* has no effect for non-partitioned tables.\n\n#### Returns\n\nAn in-memory table containing the minimum, maximum, count, mean, standard deviation, and specified percentiles in ascending order.\n\n#### Examples\n\n```\nn=2022\ndata=1..n\nvalue=take(1..3,n)\nname=take(`APPLE`IBM`INTEL,n)\nt=table(data,value,name);\nsummary(t, precision=0.001); \n// name is not a numeric column and therefore will not be output\n\n```\n\n| name  | min | max   | nonNullCount | count | avg     | std      | percentile                |\n| ----- | --- | ----- | ------------ | ----- | ------- | -------- | ------------------------- |\n| data  | 1   | 2,022 | 2,022        | 2,022 | 1,011.5 | 583.8454 | \\[506.24,1011.50,1516.75] |\n| value | 1   | 3     | 2,022        | 2,022 | 2       | 0.8167   | \\[1.00,1.99,2.99]         |\n\n```\nn = 5000\ndata1 = take(1..5000000, n)\ndata2 = rand(10000000, n)\ndata3 = take(\"A\" + string(0..10), n)\n\nt = table(data1, data2, data3)\ndbname = \"dfs://summary\"\nif(existsDatabase(dbname)) {\n     dropDatabase(dbname)\n }\ndb = database(dbname, HASH, [INT, 10])\npt = createPartitionedTable(db, t, `pt, `data1)\npt.append!(t)\n\nds = sqlDS(<select data1,data2 from loadTable(db, `pt)>)\nquery_percentile = [25,50,75,90]\n\nds_re1 = summary(ds);\n//returns the 25th, 50th, 75th and 90th percentiles\nds_re2 = summary(ds, percentile=query_percentile, precision=0.0001);\n// the partition sampling ratio is 0.6. As there are 10 partitions in total,  6 partitions will be sampled for statistics computation\nds_re3 = summary(loadTable(db, `pt), percentile=query_percentile, precision=0.0001, partitionSampling=0.6);\n```\n\n"
    },
    "suspendRecovery": {
        "url": "https://docs.dolphindb.com/en/Functions/s/suspendRecovery.html",
        "signatures": [
            {
                "full": "suspendRecovery()",
                "name": "suspendRecovery",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [suspendRecovery](https://docs.dolphindb.com/en/Functions/s/suspendRecovery.html)\n\n\n\n#### Syntax\n\nsuspendRecovery()\n\n#### Details\n\nSuspend 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.\n\n**Note:**\n\nFor high-availability clusters, this command must be executed on every node in the raft group.\n\nRelated command: [resumeRecovery](https://docs.dolphindb.com/en/Functions/r/resumeRecovery.html)\n\n#### Parameters\n\nNone\n"
    },
    "svd": {
        "url": "https://docs.dolphindb.com/en/Functions/s/svd.html",
        "signatures": [
            {
                "full": "svd(obj, [fullMatrices=true], [computeUV=true])",
                "name": "svd",
                "parameters": [
                    {
                        "full": "obj",
                        "name": "obj"
                    },
                    {
                        "full": "[fullMatrices=true]",
                        "name": "fullMatrices",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[computeUV=true]",
                        "name": "computeUV",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [svd](https://docs.dolphindb.com/en/Functions/s/svd.html)\n\n\n\n#### Syntax\n\nsvd(obj, \\[fullMatrices=true], \\[computeUV=true])\n\n#### Details\n\nPerforms the singular decomposition of a matrix.\n\nGiven an m-by-n matrix A:\n\n* If *fullMatrices*=true, return an m-by-m matrix U (unitary matrix having left singular vectors as columns), an n-by-n matrix V (unitary matrix having right singular vectors as rows) and a vector s (singular values sorted in descending order) such that A=U\\*S\\*V. S is an m-by-n matrix with s as the diagonal elements.\n* If *fullMatrices*=false, remove the extra rows or columns of zeros from matrix S, along with the columns/rows in U and V that multiply those zeros in the expression A = U\\*S\\*V. Removing these zeros and columns/rows can improve execution time and reduce storage requirements without compromising the accuracy of the decomposition. The resulting matrix U is m-by-k, matrix V is k-by-n and matrix S is k-by-k with k=min(m,n).\n* If *computeUV*=false, only return vector s.\n\n**Note:**\n\nDolphinDB `svd` and [scipy.linalg.svd](https://docs.scipy.org/doc/scipy-1.17.0/reference/generated/scipy.linalg.svd.html) provide the same core functionality. The difference is that DolphinDB `svd` is designed for DolphinDB matrices, while SciPy operates on NumPy array-like inputs and provides additional parameters such as *overwrite\\_a*, *check\\_finite*, and *lapack\\_driver*.\n\n#### Parameters\n\n**obj** is a matrix.\n\n**fullMatrices** (optional) is a Boolean value. The default value is true.\n\n**computeUV** (optional) is a Boolean value. The default value is true.\n\n#### Returns\n\nFor an m-by-n input matrix A, returns U, s, and V depending on *fullMatrices*. If *computeUV* = false, returns only vector s.\n\n#### Examples\n\n```\nm=matrix([[2,1,0],[1,3,1],[0,1,4],[1,2,3]]);\nU,s,V=svd(m);\nU;\n```\n\n| #0        | #1       | #2        |\n| --------- | -------- | --------- |\n| -0.233976 | 0.57735  | -0.782254 |\n| -0.560464 | 0.57735  | 0.593756  |\n| -0.79444  | -0.57735 | -0.188498 |\n\n```\ns;\n// output: [6.029042,3,1.284776]\n\nV;\n```\n\n| #0        | #1        | #2        | #3        |\n| --------- | --------- | --------- | --------- |\n| -0.170577 | -0.449459 | -0.620036 | -0.620036 |\n| 0.57735   | 0.57735   | -0.57735  | 0         |\n| -0.755582 | 0.630862  | -0.12472  | -0.12472  |\n| -0.258199 | -0.258199 | -0.516398 | 0.774597  |\n\n```\nU,s,V=svd(m,fullMatrices=false);\nV;\n```\n\n| #0        | #1        | #2        | #3        |\n| --------- | --------- | --------- | --------- |\n| -0.170577 | -0.449459 | -0.620036 | -0.620036 |\n| 0.57735   | 0.57735   | -0.57735  | 0         |\n| -0.755582 | 0.630862  | -0.12472  | -0.12472  |\n"
    },
    "symbol": {
        "url": "https://docs.dolphindb.com/en/Functions/s/symbol.html",
        "signatures": [
            {
                "full": "symbol(X)",
                "name": "symbol",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [symbol](https://docs.dolphindb.com/en/Functions/s/symbol.html)\n\n\n\n#### Syntax\n\nsymbol(X)\n\n#### Details\n\nConvert *X* to a symbol vector.\n\n#### Parameters\n\n**X** is a string/symbol vector.\n\n#### Returns\n\nA SYMBOL vector.\n\n#### Examples\n\n```\nx=`XOM`y;\ntypestr(x);\n// output: STRING VECTOR\n\ny=symbol(x);\ny;\n// output: [\"XOM\",\"y\"]\n\ntypestr(y);\n// output: FAST SYMBOL VECTOR\n```\n"
    },
    "symbolCode": {
        "url": "https://docs.dolphindb.com/en/Functions/s/symbolCode.html",
        "signatures": [
            {
                "full": "symbolCode(X)",
                "name": "symbolCode",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [symbolCode](https://docs.dolphindb.com/en/Functions/s/symbolCode.html)\n\n#### Syntax\n\nsymbolCode(X)\n\n#### Details\n\nSYMBOL is a special STRING type used to store repetitive strings in DolphinDB. Internally, data of SYMBOL type is encoded into integers and stored as a dictionary. The internal encoding of an empty string is 0.\n\nFor each element in *X*, this function returns its internal encoding. The return value is of the same dimension as *X*.\n\nIt is recommended to use the SYMBOL type if there are a lot of duplicate values for a certain field such as device ID and stock symbol to improve storage efficiency.\n\n#### Parameters\n\n**X** is a vector/matrix of SYMBOL type.\n\n#### Returns\n\nAn integral vector or matrix with the same dimensions as *X*.\n\n#### Examples\n\n```\na=symbol(`IBM`APPL)\nsymbolCode(a)\n// output: [1,2]\n\nx=symbol(`MS`AMZN`AAPL`MS`IBM`AAPL)$3:2\nsymbolCode(x)\n\n/* output:\n#0 #1\n -- --\n1  1 \n2  4 \n3  3 \n*/\n```\n\n"
    },
    "symmetricDifference": {
        "url": "https://docs.dolphindb.com/en/Functions/s/symmetricDifference.html",
        "signatures": [
            {
                "full": "symmetricDifference(X, Y)",
                "name": "symmetricDifference",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [symmetricDifference](https://docs.dolphindb.com/en/Functions/s/symmetricDifference.html)\n\n\n\n#### Syntax\n\nsymmetricDifference(X, Y) or X^Y\n\n#### Details\n\nReturn the union of two sets minus the intersection of the two sets.\n\n#### Parameters\n\n**X** and **Y** are sets.\n\n#### Returns\n\nA set.\n\n#### Examples\n\n```\nx=set([5,3,4])\ny=set(8 9 4 6);\n\ny^x;\n// output: set(5,8,3,9,6)\n\nx^y;\n// output: set(8,5,3,6,9)\n```\n"
    },
    "syncDict": {
        "url": "https://docs.dolphindb.com/en/Functions/s/syncDict.html",
        "signatures": [
            {
                "full": "syncDict(keyObj, valueObj, [sharedName], [ordered=false])",
                "name": "syncDict",
                "parameters": [
                    {
                        "full": "keyObj",
                        "name": "keyObj"
                    },
                    {
                        "full": "valueObj",
                        "name": "valueObj"
                    },
                    {
                        "full": "[sharedName]",
                        "name": "sharedName",
                        "optional": true
                    },
                    {
                        "full": "[ordered=false]",
                        "name": "ordered",
                        "optional": true,
                        "default": "false"
                    }
                ]
            },
            {
                "full": "syncDict(keyType, valueType, [sharedName], [ordered=false])",
                "name": "syncDict",
                "parameters": [
                    {
                        "full": "keyType",
                        "name": "keyType"
                    },
                    {
                        "full": "valueType",
                        "name": "valueType"
                    },
                    {
                        "full": "[sharedName]",
                        "name": "sharedName",
                        "optional": true
                    },
                    {
                        "full": "[ordered=false]",
                        "name": "ordered",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [syncDict](https://docs.dolphindb.com/en/Functions/s/syncDict.html)\n\n\n\n#### Syntax\n\nsyncDict(keyObj, valueObj, \\[sharedName], \\[ordered=false])\n\nor\n\nsyncDict(keyType, valueType, \\[sharedName], \\[ordered=false])\n\n#### Details\n\nReturn a thread-safe dictionary that allows concurrent read and write by multiple threads.\n\n#### Parameters\n\n**keyObj** is a vector indicating dictionary keys.\n\n**valueObj** is a vector indicating dictionary values.\n\n**keyType** is the data type of dictionary keys. The following data categories are supported: INTEGRAL (excluding COMPRESSED), TEMPORAL, FLOATING and LITERAL.\n\n**valueType** is the data type of dictionary values. Note that COMPLEX/POINT/DECIMAL is not supported.\n\n**sharedName** (optional) is a string. If it is specified, the dictionary is shared across sessions.\n\n**ordered** (optional) is a Boolean value. The default value is false, which indicates to create a regular dictionary. True means to create an ordered dictionary. The regular dictionaries do not track the insertion order of the key-value pairs whereas the ordered dictionaries preserve the insertion order of key-value pairs.\n\n#### Returns\n\nA dictionary.\n\n#### Examples\n\nExample 1:\n\n```\nx=1 2 3\ny=4.5 7.8 4.3\nz=syncDict(x,y);\n/* output:\n3->4.3\n1->4.5\n2->7.8\n*/\n\nz=syncDict(INT,DOUBLE)\nz[5]=7.9\nz;\n// output: 5->7.9\n\nz=syncDict(SYMBOL,DOUBLE)\nz[`IBM]=237.82\nz;\n// output: IBM->237.82\n\nsyncDict(INT,DOUBLE, `sn)\nsn[5 6]=10.99 2.33\nsn[5];\n// output: 10.99\n\n// y is a vector of DECIMAL32 type. Create a dictionary z with y as values.\nx=1 3 2\ny = decimal32\\(1.23 3 3.14, 3\\)\nz=dict\\(x,y,true\\);\nz;\n/\\* output:\n1-&gt;1.230\n3-&gt;3.000\n2-&gt;3.140\n\\*/\n```\n\nIn the following example, concurrent write to dictionary z1 results in server crash.\n\n```\ndef task1(mutable d,n){\n    for(i in 0..n){\n        d[i]=i*2\n    }\n}\n\ndef task2(mutable d,n){\n    for(i in 0..n){\n        d[i]=i+1\n    }\n}\nn=10000000\n\nz1=dict(INT,INT)\njobId1=submitJob(\"task1\",,task1,z1,n)\njobId2=submitJob(\"task2\",,task2,z1,n);\n```\n\nIn comparison, concurrent write to the thread-safe dictionary z2 is allowed.\n\n```\nz2=syncDict(INT,INT)\njobId3=submitJob(\"task1\",,task1,z2,n)\njobId4=submitJob(\"task2\",,task2,z2,n)\ngetJobReturn(jobId3, true)\ngetJobReturn(jobId4, true)\nz2;\n```\n\nRelated: [array](https://docs.dolphindb.com/en/Functions/a/array.html), [matrix](https://docs.dolphindb.com/en/Functions/m/matrix.html), [dictUpdate!](https://docs.dolphindb.com/en/Functions/d/dictUpdate!.html), [dict](https://docs.dolphindb.com/en/Functions/d/dict.html)\n\nExample 2: usage of syncDict with [go](https://docs.dolphindb.com/en/Programming/ProgrammingStatements/go.html):\n\n```\nsyncDict(SYMBOL,RESOURCE,`resDict)\ngo\nresDict[`a]=10\n```\n"
    },
    "syntax": {
        "url": "https://docs.dolphindb.com/en/Functions/s/syntax.html",
        "signatures": [
            {
                "full": "syntax(X)",
                "name": "syntax",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [syntax](https://docs.dolphindb.com/en/Functions/s/syntax.html)\n\n\n\n#### Syntax\n\nsyntax(X)\n\n#### Details\n\nReturn the syntax of function/command *X*.\n\n#### Parameters\n\n**X** is a DolphinDB function/command.\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nsyntax(createPartitionedTable);\n// output: createPartitionedTable(dbHandle, table, tableName, [partitionColumns], [compressMethods])\n```\n"
    },
    "valueAtRisk": {
        "url": "https://docs.dolphindb.com/en/Functions/v/valueAtRisk.html",
        "signatures": [
            {
                "full": "valueAtRisk(returns, method, [confidenceLevel=0.95])",
                "name": "valueAtRisk",
                "parameters": [
                    {
                        "full": "returns",
                        "name": "returns"
                    },
                    {
                        "full": "method",
                        "name": "method"
                    },
                    {
                        "full": "[confidenceLevel=0.95]",
                        "name": "confidenceLevel",
                        "optional": true,
                        "default": "0.95"
                    }
                ]
            }
        ],
        "markdown": "### [valueAtRisk](https://docs.dolphindb.com/en/Functions/v/valueAtRisk.html)\n\n#### Syntax\n\nvalueAtRisk(returns, method, \\[confidenceLevel=0.95])\n\nAlias: VaR\n\n#### Details\n\nCalculate Value at Risk (VaR) to predict the minimum return within a given confidence level (e.g. 95% or 99%) over a specific time frame.\n\n#### Parameters\n\n**returns** is a numeric vector representing the returns. The element must be greater than -1 and cannot be empty.\n\n**method** is a string indicating the VaR calculation method, which can be:\n\n* 'normal': parametric method with normal distribution\n* 'logNormal': parametric method with log-normal distribution\n* 'historical': historical method\n* 'monteCarlo': Monte Carlo simulation\n\n**confidenceLevel** (optional) is a numeric scalar representing the confidence level, with a valid range of (0,1). The default value is 0.95.\n\n#### Returns\n\nA DOUBLE value indicating the absolute value of the minimum return.\n\n#### Examples\n\nCalculate VaR using historical method at a confidence level of 0.9 based on given returns:\n\n```\nreturns = [0.0, -0.0023816107391389394, -0.0028351258634076834, 0.00789570628538656, 0.0022056267475062397, -0.004515475812603498, 0.0031189325339843646, 0.010774648811452205, 0.0030816164453268957, 0.02172541561228001, 0.011106185767699728, -0.005369098699244845, -0.0096490689793588, 0.0025152212699484314, 0.017822140037111668, -0.02837536728283525, 0.018373545076599204, -0.0026401111537113003, 0.019524374522517898, -0.010800546314337627, 0.014073362622486131, -0.00398277532382243, 0.008398647051501285, 0.0024056749358184904, 0.007093080335863512, -0.005332549248384733, -0.008471915938733665, -0.0038788486165083342, -0.01308504169086584, 0.00350496242864784, 0.009036118926745962, 0.0013358223875250545, 0.0036426642608267563, 0.003974568474545581, -0.003944066366522669, -0.011969668605022311, 0.015116930499066374, 0.006931427295653037, -0.0032650627551519267, 0.003407880132851648]\nvalueAtRisk(returns, 'historical', 0.9);\n//output: 0.009764216712\n```\n\n"
    },
    "valueChanged": {
        "url": "https://docs.dolphindb.com/en/Functions/v/valueChanged.html",
        "signatures": [
            {
                "full": "valueChanged(X, [mode=\"prev\"])",
                "name": "valueChanged",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[mode=\"prev\"]",
                        "name": "mode",
                        "optional": true,
                        "default": "\"prev\""
                    }
                ]
            }
        ],
        "markdown": "### [valueChanged](https://docs.dolphindb.com/en/Functions/v/valueChanged.html)\n\n\n\n#### Syntax\n\nvalueChanged(X, \\[mode=\"prev\"])\n\n#### Details\n\nCompare each element in *X* with the element specified by mode. Return true if the value is changed, otherwise false. Return false if the compared object does not exist.\n\nFor example, for the first element of `valueChanged(X, [mode=\"prev\"])` and the last element of `valueChanged(X, [mode=\"next\"])`, the function returns false.\n\nIf *X* is a matrix/table, perform the aforementioned operation on each column and return a matrix/table.\n\n#### Parameters\n\n**X** is a vector/matrix/table/tuple of STRING, BOOL, temporal or numeric type.\n\n**mode** (optional) is a string. It can take the value of \"prev\", \"next\", \"either\" and \"both\". The default value is \"prev\".\n\n* \"prev\": the previous element\n\n* \"next\": the next element\n\n* \"either\": the previous OR the next element\n\n* \"both\": the previous AND the next element\n\n#### Returns\n\nBOOL type with the same data form as *X*.\n\n#### Examples\n\n```\nx= 1 2 2 2 2 3 NULL 3 4 8\nvalueChanged(x)\n// output: [false,true,false,false,false,true,true,true,true,true]\n\nvalueChanged(x,\"next\")\n// output: [true,false,false,false,true,true,true,true,true,false]\n\nvalueChanged(x,\"either\")\n// output: [true,true,false,false,true,true,true,true,true,true]\n\nvalueChanged(x,\"both\")\n// output: [false,false,false,false,false,true,true,true,true,false]\n\ntup=(1 2 3, `A`A`B, 2021.10.12+1 2 2)\nvalueChanged(tup)\n// output: ([false,true,true],[false,false,true],[false,true,false])\n\nm=matrix(1 2 3, 1 2 3, 1 3 3)\nvalueChanged(m)\n```\n\n| col1  | col2  | col3  |\n| ----- | ----- | ----- |\n| false | false | false |\n| true  | true  | true  |\n| true  | true  | false |\n\n```\nid= 1 2 2 2 2 3 3 4 8\nsym=`A + string(1 2 2 2 2 3 3 4 8)\nval=83.8 92.8 8.1 61.4 40.7 67.2 15.2 20.6 96.5\nt=table(id, sym, val)\nvalueChanged(t)\n```\n\n| id    | sym   | val   |\n| ----- | ----- | ----- |\n| false | false | false |\n| true  | true  | true  |\n| false | false | true  |\n| false | false | true  |\n| false | false | true  |\n| true  | true  | true  |\n| false | false | true  |\n| true  | true  | true  |\n| true  | true  | true  |\n\nRelated function: [keys](https://docs.dolphindb.com/en/Functions/k/keys.html)\n"
    },
    "values": {
        "url": "https://docs.dolphindb.com/en/Functions/v/values.html",
        "signatures": [
            {
                "full": "values(X)",
                "name": "values",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [values](https://docs.dolphindb.com/en/Functions/v/values.html)\n\n\n\n#### Syntax\n\nvalues(X)\n\n#### Details\n\nReturn all values of a dictionary, or all the columns of a table in a tuple.\n\n#### Parameters\n\n**X** is a dictionary/table.\n\n#### Returns\n\nA vector or a tuple.\n\n#### Examples\n\n```\nz=dict(`INT,`DOUBLE)\nz[5]=7.9\nz[3]=6\nz.values();\n// output: [6,7.9]\n\nt = table(1 2 3 as id, 4 5 6 as x, `IBM`MSFT`GOOG as name);\nvalues(t);\n// output: ([1,2,3],[4,5,6],[\"IBM\",\"MSFT\",\"GOOG\"])\n```\n\nRelated function: [keys](https://docs.dolphindb.com/en/Functions/k/keys.html)\n"
    },
    "vanillaOption": {
        "url": "https://docs.dolphindb.com/en/Functions/v/vanillaOption.html",
        "signatures": [
            {
                "full": "vanillaOption(settlement, maturity, evalDate, spot, strike, riskFree, divYield, volatility, isCall, style, basis, calendar, [method=\"BS\"], [kwargs], [mode=0])",
                "name": "vanillaOption",
                "parameters": [
                    {
                        "full": "settlement",
                        "name": "settlement"
                    },
                    {
                        "full": "maturity",
                        "name": "maturity"
                    },
                    {
                        "full": "evalDate",
                        "name": "evalDate"
                    },
                    {
                        "full": "spot",
                        "name": "spot"
                    },
                    {
                        "full": "strike",
                        "name": "strike"
                    },
                    {
                        "full": "riskFree",
                        "name": "riskFree"
                    },
                    {
                        "full": "divYield",
                        "name": "divYield"
                    },
                    {
                        "full": "volatility",
                        "name": "volatility"
                    },
                    {
                        "full": "isCall",
                        "name": "isCall"
                    },
                    {
                        "full": "style",
                        "name": "style"
                    },
                    {
                        "full": "basis",
                        "name": "basis"
                    },
                    {
                        "full": "calendar",
                        "name": "calendar"
                    },
                    {
                        "full": "[method=\"BS\"]",
                        "name": "method",
                        "optional": true,
                        "default": "\"BS\""
                    },
                    {
                        "full": "[kwargs]",
                        "name": "kwargs",
                        "optional": true
                    },
                    {
                        "full": "[mode=0]",
                        "name": "mode",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [vanillaOption](https://docs.dolphindb.com/en/Functions/v/vanillaOption.html)\n\n\n\n#### Syntax\n\nvanillaOption(settlement, maturity, evalDate, spot, strike, riskFree, divYield, volatility, isCall, style, basis, calendar, \\[method=\"BS\"], \\[kwargs], \\[mode=0])\n\n#### Details\n\nCalculate vanilla option prices using specified methods.\n\n#### Parameters\n\n**Note:** Scalar inputs will be automatically expanded to match the length of other vector inputs. All vector inputs must be of equal length.\n\n**settlement** is a DATE scalar or vector indicating the settlement date.\n\n**maturity** is a DATE scalar or vector indicating the maturity date.\n\n**evalDate**is a DATE scalar or vector indicating the evaluation date.\n\n**spot** is a numeric scalar or vector indicating the spot price.\n\n**strike** is a numeric scalar or vector indicating the strike price.\n\n**riskFree** is a numeric scalar or vector indicating the risk-free interest rate.\n\n**divYield** is a numeric scalar or vector indicating the dividend yield.\n\n**volatility** is a numeric scalar or vector indicating the volatility.\n\n**isCall** is a Boolean scalar or vector.\n\n* true: buy (call option)\n* false: sell (put option)\n\n**style** is a STRING scalar or vector indicating the option exercise style. It can be 'european' or 'american'.\n\n**basis**is an INT/STRING scalar or vector indicating the day-count basis. It can be:\n\n* 0/\"Thirty360US\": US (NASD) 30/360\n* 1/\"ActualActual\": actual/actual\n* 2/\"Actual360\": actual/360\n* 3/\"Actual365\": actual/365\n* 4/\"Thirty360EU\": European 30/360\n\n**calendar** is a STRING scalar or vector indicating the trading calendar(s). See [Trading Calendar](https://docs.dolphindb.com/en/Tutorials/trading_calendar.html) for more information.\n\n**method** (optional) is a STRING scalar indicating the pricing method:\n\n* 'BS' (default): Black-Scholes model (for European options only).\n* 'FDBS': Finite Difference method + Black-Scholes model.\n* 'heston': Heston model (for European options only).\n* 'FDHeston': Finite Difference method + Heston model.\n* 'PTDHeston': Piecewise Time Dependent Heston model (for European options only).\n\n**kwargs** (optional) is a dictionary specifying other required parameters. Leave it unspecified when *method*='BS'. The key-values pairs should be:\n\n* When *method*='FDBS':\n  * 'xGrid': A scalar or vector with integers greater than 1, indicating the number of spatial grids used for discretization in the finite difference method.\n  * 'tGrid': A scalar or vector with positive integers, indicating the number of time grids used for discretization in the finite difference method. *tGrid* must be greater than 0.\n  * 'dampingSteps': A scalar or vector with non-negative integers, representing the number of damping steps applied in the finite difference solution process.\n* When *method*='heston':\n  * 'theta': A numeric scalar or vector representing the long-term mean of the variance.\n  * 'kappa': A numeric scalar or vector indicating the speed of mean reversion for the variance.\n  * 'rho': A numeric scalar or vector representing the correlation coefficient between the asset price and volatility.\n  * 'sigma': A numeric scalar or vector representing the volatility of volatility.\n* When *method*='FDHeston':\n  * 'theta': A numeric scalar or vector representing the long-term mean of the variance.\n  * 'kappa': A numeric scalar or vector indicating the speed of mean reversion for the variance.\n  * 'rho': A numeric scalar or vector representing the correlation coefficient between the asset price and volatility.\n  * 'sigma': A numeric scalar or vector representing the volatility of volatility.\n  * 'xGrid': An scalar or vector with integers greater than 1, indicating the number of spatial grids used for discretization in the finite difference method.\n  * 'vGrid': An scalar or vector with integers greater than 1, indicating the number of volatility grids used for discretization in the finite difference method.\n  * 'tGrid': An scalar or vector with positive integers, indicating the number of time grids used for discretization in the finite difference method. *tGrid* must be greater than 0.\n  * 'dampingSteps': An scalar or vector with non-negative integers, representing the number of damping steps applied in the finite difference solution process.\n* When *method*='PTDHeston':\n  * 'times': A numeric vector or array indicating the time points when conditions change.\n  * 'theta': A numeric scalar or vector representing the long-term mean of the variance.\n  * 'kappa': A numeric scalar or vector indicating the speed of mean reversion for the variance.\n  * 'rho': A numeric scalar or vector representing the correlation coefficient between the asset price and volatility.\n  * 'sigma': A numeric scalar or vector representing the volatility of volatility.\n\n**mode** (optional) is an integeralscalar or vector indicating the output mode:\n\n* 0 (default): NPV (net present value) only.\n* 1: NPV and Greeks (delta, gamma, theta, vega and rho) in a nested tuple.\n* 2: NPV and Greeks (delta, gamma, theta, vega and rho) in an ordered dictionary.\n\n#### Returns\n\n* When *mode*=0, return a FLOATING scalar or vector indicating the NPV.\n* When *mode*=1, return a tuple with two tuple elements, NPV and Greeks (delta, gamma, theta, vega and rho).\n* When *mode*=2, return an ordered dictionary with keys 'npv', 'delta', 'gamma', 'theta', 'vega', and 'rho'.\n\n#### Examples\n\n```\nsettlement = 1998.05.17\nmaturity = 1999.05.17\nvalDay = 1998.05.15\nspot = 36\nstrike = 40\nriskFree = 0.06\ndividend = 0\nvolatility = 0.2\nisCall = false\nstyle = 'european'\nbasis = 3\ncalendar = 'CCFX'\n\nvanillaOption(settlement, maturity, valDay, spot, strike, riskFree, dividend, volatility, isCall, style, basis, calendar, mode=2)\n\n/* output:\nnpv->3.844299590004929\ndelta->-0.550451634430198\ngamma->0.054964980970804\ntheta->-0.005058800993712\nvega->14.246923067632348\nrho->-23.660558429492027\n*/\n```\n"
    },
    "var": {
        "url": "https://docs.dolphindb.com/en/Functions/v/var.html",
        "signatures": [
            {
                "full": "var(X)",
                "name": "var",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [var](https://docs.dolphindb.com/en/Functions/v/var.html)\n\n\n\n#### Syntax\n\nvar(X)\n\n#### Details\n\nIf *X* is a vector, return the the (unbiased) sample standard variance of *X*.\n\nIf *X* is a matrix, calculate the the (unbiased) sample standard variance of each column of *X* and return a vector.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\n**Note:**\n\nDolphinDB `var` and [numpy.var](https://numpy.org/doc/stable/reference/generated/numpy.var.html) are both used to calculate variance. The differences are as follows:\n\n* DolphinDB `var` returns the unbiased sample variance, while `numpy.var` returns the population variance by default. To obtain results consistent with DolphinDB `var`, you should specify *ddof*=1 in NumPy.\n* DolphinDB `var` automatically ignores NULL values, whereas `numpy.var` does not automatically skip NaN values, so the result may be `NaN`.\n* Regarding computation dimensions, DolphinDB `var` calculates the variance column by column for matrices, while `numpy.var` flattens the array and calculates the variance over all elements by default. You can also specify the computation dimension using the *axis* parameter.\n\n#### Parameters\n\n**X** is a scalar/vector/matrix.\n\n#### Returns\n\nA DOUBLE scalar/vector/table.\n\n#### Examples\n\n```\nvar(1 1 1);\n// output: 0\n\nvar(1 2 3);\n// output: 1\n\nm=matrix(1 3 5 7 9, 1 4 7 10 13);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 3  | 4  |\n| 5  | 7  |\n| 7  | 10 |\n| 9  | 13 |\n\n```\nvar(m);\n// output: [10,22.5]\n```\n\nRelated functions: [covar](https://docs.dolphindb.com/en/Functions/c/covar.html) and [corr](https://docs.dolphindb.com/en/Functions/c/corr.html)\n"
    },
    "varma": {
        "url": "https://docs.dolphindb.com/en/Functions/v/varma.html",
        "signatures": [
            {
                "full": "varma(ds,endogColNames,order,[exog],[trend='c'],[errorCovType='unstructured'],[measurementError=false],[enforceStationarity=true],[enforceInvertibility=true],[trendOffset=1], [maxIter=50])",
                "name": "varma",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "endogColNames",
                        "name": "endogColNames"
                    },
                    {
                        "full": "order",
                        "name": "order"
                    },
                    {
                        "full": "[exog]",
                        "name": "exog",
                        "optional": true
                    },
                    {
                        "full": "[trend='c']",
                        "name": "trend",
                        "optional": true,
                        "default": "'c'"
                    },
                    {
                        "full": "[errorCovType='unstructured']",
                        "name": "errorCovType",
                        "optional": true,
                        "default": "'unstructured'"
                    },
                    {
                        "full": "[measurementError=false]",
                        "name": "measurementError",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[enforceStationarity=true]",
                        "name": "enforceStationarity",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[enforceInvertibility=true]",
                        "name": "enforceInvertibility",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[trendOffset=1]",
                        "name": "trendOffset",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[maxIter=50]",
                        "name": "maxIter",
                        "optional": true,
                        "default": "50"
                    }
                ]
            }
        ],
        "markdown": "### [varma](https://docs.dolphindb.com/en/Functions/v/varma.html)\n\n\n\n#### Syntax\n\nvarma(ds,endogColNames,order,\\[exog],\\[trend='c'],\\[errorCovType='unstructured'],\\[measurementError=false],\\[enforceStationarity=true],\\[enforceInvertibility=true],\\[trendOffset=1], \\[maxIter=50])\n\n#### Details\n\n`varma` analyzes multivariate time series using a Vector Autoregressive Moving-Average (VARMA) model. It returns a dictionary containing the analysis results.\n\n#### Parameters\n\n* **ds** is an in-memory table or a DATASOURCE vector containing the multivariate time series to be analyzed. *ds* cannot be empty. Only if the first column of the data source is a time column, the model will automatically sort the data based on the column.\n* **endogColNames** is a STRING vector indicating the column names of the endogenous variables in *ds*.\n* **order** is a vector with two non-negative integers indicating the number of autoregressive (AR) and moving average (MA) parameters to use.\n* **exog** (optional) is a numeric matrix representing exogenous variables except the endogenous time series. Each column of the matrix represents the time series data of an exogenous variable, and the number of rows must equal the number of rows in *ds*.\n* **trend** (optional) is a string indicating the constant and trend order used in the regression. Possible values:\n  * \"c\" (default) - add constant\n  * \"ct\" - constant and treand\n  * \"ctt\" - constant, linear, and quadratic trend\n  * \"n\" - no constant or trend\n* **errorCovType** (optional) is a string scalar specifying the structure of the error term's covariance matrix. Possible values:\n  * 'unstructured' (default): Preserve the lower triangular part of the covariance matrix\n  * 'diagonal': Preserve only the diagonal part\n* **measurementError** (optional) is a boolean scalar indicating whether to assume the endogenous observations were measured with error. Default is false.\n* **enforceStationarity** (optional) is a boolean scalar indicating whether to transform AR parameters to enforce stationarity in the autoregressive component of the model. Default is true.\n* **enforceInvertibility** (optional) is a boolean scalar indicating whether to transform MA parameters to enforce invertibility in the moving average component of the model. Default is true.\n* **trendOffset** (optional) is a positive representing the offset at which time trend values start. Default is 1.\n* **maxIter** (optional) is a positive integer indicating the maximum number of iterations during fitting. Default is 50.\n\n#### Returns\n\nA dictionary containing the following keys:\n\n* params: A floating matrix of estimated parameters for the VARMA model.\n* kAr: An integer representing the order of the vector autoregressive process.\n* kMa: An integer representing the order of the vector moving average part.\n* kTrend: An integer representing the number of trend terms in the VARMA model.\n* nobs: An integer representing the number of observations in the input multivariate time series.\n* aic: A floating-point number representing the Akaike Information Criterion.\n* bic: A floating-point number representing the Bayesian Information Criterion.\n* hqic: A floating-point number representing the Hannan-Quinn Information Criterion.\n* llf: A floating-point number representing the log-likelihood value of the VARMA model.\n\n#### Examples\n\nAnalyze the multivariate time series in the *macrodata.csv* file:\n\n```\ndata = loadText(\"macrodata.csv\")\nmy_exog = matrix(DOUBLE, size(data), 1,,1)\nresult = varma(data, [`realgdp, `realcons, `realinv],[1,1],trend=\"c\", exog=my_exog)\nprint(result)\n\n/* Output:\nparams->[0.001792375138657,0.003160556421415,-0.007883363910928,-0.339419264165185,0.755250482937653,0.058642159539323,-0.133526968617148,0.32767138782651,0.042514529460363,-2.212343999390979,4.610354288385349,0.302449619489419,0.056726965953926,-0.069554043921028,-0.024169855056237,0.03072738358672,-0.056571376624308,-0.015977637956917,0.249792348549773,-0.171657812582861,-0.075503097693781,0.001792375138657,0.003160556421415,-0.007883363910928,0.007685902441147,0.003916408996852,0.005142039118261,0.030338334390003,-0.016066874864259,0.020322423082551]\nllf->1974.199528289279214\nkAr->1\nkMa->1\nkTrend->1\nnobs->202\naic->-3888.399056578558429\nbic->-3789.151025656522506\nhqic->-3848.243123697545343\n*/\n```\n"
    },
    "varp": {
        "url": "https://docs.dolphindb.com/en/Functions/v/varp.html",
        "signatures": [
            {
                "full": "varp(X)",
                "name": "varp",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [varp](https://docs.dolphindb.com/en/Functions/v/varp.html)\n\n\n\n#### Syntax\n\nvarp(X)\n\n#### Details\n\nIf *X* is a vector, return the population variance of *X*.\n\nIf *X* is a matrix, calculate the population variance of each column and return a vector.\n\nIf *X* is a table, calculate the population variance of each column and return a table.\n\nAs with all other aggregate functions, null values are ignored in the calculation.\n\n#### Parameters\n\n**X** is a vector/matrix/table.\n\n#### Returns\n\nA DOUBLE scalar/vector/table.\n\n#### Examples\n\n```\nvarp(1 1 1);\n// output: 0\n\nvarp(1 2 3);\n// output: 0.666667\n\nm=matrix(1 3 5 7 9, 1 4 7 10 13);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 1  |\n| 3  | 4  |\n| 5  | 7  |\n| 7  | 10 |\n| 9  | 13 |\n\n```\nvarp(m);\n// output: [8,18]\n```\n"
    },
    "VaR": {
        "url": "https://docs.dolphindb.com/en/Functions/v/VaR_0.html",
        "signatures": [
            {
                "full": "valueAtRisk(returns, method, [confidenceLevel=0.95])",
                "name": "valueAtRisk",
                "parameters": [
                    {
                        "full": "returns",
                        "name": "returns"
                    },
                    {
                        "full": "method",
                        "name": "method"
                    },
                    {
                        "full": "[confidenceLevel=0.95]",
                        "name": "confidenceLevel",
                        "optional": true,
                        "default": "0.95"
                    }
                ]
            }
        ],
        "markdown": "### [VaR](https://docs.dolphindb.com/en/Functions/v/VaR_0.html)\n\nAlias for [valueAtRisk](https://docs.dolphindb.com/en/Functions/v/valueAtRisk.html)\n\n\nDocumentation for the `valueAtRisk` function:\n### [valueAtRisk](https://docs.dolphindb.com/en/Functions/v/valueAtRisk.html)\n\n#### Syntax\n\nvalueAtRisk(returns, method, \\[confidenceLevel=0.95])\n\nAlias: VaR\n\n#### Details\n\nCalculate Value at Risk (VaR) to predict the minimum return within a given confidence level (e.g. 95% or 99%) over a specific time frame.\n\n#### Parameters\n\n**returns** is a numeric vector representing the returns. The element must be greater than -1 and cannot be empty.\n\n**method** is a string indicating the VaR calculation method, which can be:\n\n* 'normal': parametric method with normal distribution\n* 'logNormal': parametric method with log-normal distribution\n* 'historical': historical method\n* 'monteCarlo': Monte Carlo simulation\n\n**confidenceLevel** (optional) is a numeric scalar representing the confidence level, with a valid range of (0,1). The default value is 0.95.\n\n#### Returns\n\nA DOUBLE value indicating the absolute value of the minimum return.\n\n#### Examples\n\nCalculate VaR using historical method at a confidence level of 0.9 based on given returns:\n\n```\nreturns = [0.0, -0.0023816107391389394, -0.0028351258634076834, 0.00789570628538656, 0.0022056267475062397, -0.004515475812603498, 0.0031189325339843646, 0.010774648811452205, 0.0030816164453268957, 0.02172541561228001, 0.011106185767699728, -0.005369098699244845, -0.0096490689793588, 0.0025152212699484314, 0.017822140037111668, -0.02837536728283525, 0.018373545076599204, -0.0026401111537113003, 0.019524374522517898, -0.010800546314337627, 0.014073362622486131, -0.00398277532382243, 0.008398647051501285, 0.0024056749358184904, 0.007093080335863512, -0.005332549248384733, -0.008471915938733665, -0.0038788486165083342, -0.01308504169086584, 0.00350496242864784, 0.009036118926745962, 0.0013358223875250545, 0.0036426642608267563, 0.003974568474545581, -0.003944066366522669, -0.011969668605022311, 0.015116930499066374, 0.006931427295653037, -0.0032650627551519267, 0.003407880132851648]\nvalueAtRisk(returns, 'historical', 0.9);\n//output: 0.009764216712\n```\n\n"
    },
    "vectorAR": {
        "url": "https://docs.dolphindb.com/en/Functions/v/vectorAR.html",
        "signatures": [
            {
                "full": "vectorAR(ds, endogColNames, [exog], [trend='c'], [maxLag], [ic])",
                "name": "vectorAR",
                "parameters": [
                    {
                        "full": "ds",
                        "name": "ds"
                    },
                    {
                        "full": "endogColNames",
                        "name": "endogColNames"
                    },
                    {
                        "full": "[exog]",
                        "name": "exog",
                        "optional": true
                    },
                    {
                        "full": "[trend='c']",
                        "name": "trend",
                        "optional": true,
                        "default": "'c'"
                    },
                    {
                        "full": "[maxLag]",
                        "name": "maxLag",
                        "optional": true
                    },
                    {
                        "full": "[ic]",
                        "name": "ic",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [vectorAR](https://docs.dolphindb.com/en/Functions/v/vectorAR.html)\n\n\n\n#### Syntax\n\nvectorAR(ds, endogColNames, \\[exog], \\[trend='c'], \\[maxLag], \\[ic])\n\n#### Details\n\nAnalyze multivariate time series using the Vector Autoregression model (VAR model).\n\n#### Parameters\n\n**ds** is an in-memory table or a vector consisting of DataSource objects, containing the multivariate time series to be analyzed. *ds* cannot be empty.\n\n**endogColNames** is a STRING vector indicating the column names of the endogenous variables in *ds*. The matrix formed by *endogColNames* extracted from *ds*is the multivariate time series to be analyzed.\n\n**exog** (optional) is a numeric matrix representing exogenous variables except the endogenous time series. Each column of the matrix represents the time series data of an exogenous variable, and the number of rows must equal the number of rows in *ds*.\n\n**trend** (optional) specifies constants and trend orders used in the regression. It can be\n\n* 'c' (default) - add constant\n\n* 'ct' - constant and treand\n\n* 'ctt' - constant, linear, and quadratic trend\n\n* 'n' - no constant or trend\n\n**maxLag** (optional) is a non-negative integer representing the maximum number of lags to check for order selection. If not provided, the default value of is used, where *nobs*indicates the sample size.\n\n**ic** (optional) is a STRING scalar indicating the information criterion to use for VAR order selection. The default value is null. It can be:\n\n* 'aic': Akaike\n\n* 'bic': Bayesian/Schwarz\n\n* 'fpe': Final prediction error\n\n* 'hqic': Hannan-Quinn\n\n#### Returns\n\nA dictionary representing the analysis results of the VAR model with the following members:\n\n* params: A floating-point matrix representing the parameters obtained from fitting the VAR model.\n\n* kAr: An integer representing the order of the VAR process.\n\n* kTrend: An integer representing the number of trends in the VAR process.\n\n* nobs: An integer representing the number of observations in the VAR model analysis.\n\n* sigmaU: A floating-point matrix representing the estimated variance of the white noise process.\n\n* sigmaUMle: A floating-point matrix representing the biased maximum likelihood estimate of the noise process covariance.\n\n* aic: A floating-point scalar representing the Akaike Information Criterion.\n\n* bic: A floating-point scalar representing the Bayesian Information Criterion.\n\n* hqic: A floating-point scalar representing the Hannan-Quinn Information Criterion.\n\n* fpe: A floating-point scalar representing the Final Prediction Error Information Criterion.\n\n* llf: A floating-point scalar representing the log-likelihood value of the VAR model.\n\n#### Examples\n\nThis example uses a file named macrodata.csv, taking the *realgdp*, *realcons*, and *realinv*columns as endogenous variables, and sets the *maxlag*to 2. The VAR model is then used to analyze the multivariate time series.\n\nOutput:\n\n```\nnobs->200\nhqic->-27.789187688321\nllf->1962.570824044325\nkTrend->1\naic->-27.929339439671\nfpe->0E-12\nparams->\n#0              #1              #2             \n0.001526972352  0.005459603048  -0.023902520885\n-0.279434735873 -0.100467978082 -1.970973673795\n0.675015751748  0.268639552522  4.414162326990 \n0.033219450793  0.025738726522  0.225478953223 \n0.008221084912  -0.123173927706 0.380785849237 \n0.290457628129  0.232499435917  0.800280917529 \n-0.007320907532 0.023503761040  -0.124079061576\nsigmaU->\n#0             #1             #2            \n0.000057113648 0.000029839495 0.000224637467\n0.000029839495 0.000042830532 0.000034191732\n0.000224637467 0.000034191732 0.001567709895\nsigmaUMle->\n#0             #1             #2            \n0.000055114670 0.000028795112 0.000216775156\n0.000028795112 0.000041331464 0.000032995021\n0.000216775156 0.000032995021 0.001512840049\n\nkAr->2\nbic->-27.583016116183\n```\n"
    },
    "vectorNorm": {
        "url": "https://docs.dolphindb.com/en/Functions/v/vectorNorm.html",
        "signatures": [
            {
                "full": "vectorNorm(x, [ord], [axis], [keepDims])",
                "name": "vectorNorm",
                "parameters": [
                    {
                        "full": "x",
                        "name": "x"
                    },
                    {
                        "full": "[ord]",
                        "name": "ord",
                        "optional": true
                    },
                    {
                        "full": "[axis]",
                        "name": "axis",
                        "optional": true
                    },
                    {
                        "full": "[keepDims]",
                        "name": "keepDims",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [vectorNorm](https://docs.dolphindb.com/en/Functions/v/vectorNorm.html)\n\n\n\n#### Syntax\n\nvectorNorm(x, \\[ord], \\[axis], \\[keepDims])\n\n#### Details\n\nThe function computes a matrix or vector norm. Note that it’s not recommended to use `vectorNorm` in SQL statements.\n\n#### Parameters\n\n**x** is a vector or matrix of any numeric type except DECIMAL. It cannot be empty.\n\n**ord**(optional) is an INT, STRING or floating-point scalar indicating the order of norm. Note:\n\n* When *ord* is a string, it must be: 'inf', '-inf', 'nuc', or 'fro'.\n* When *ord* is less than 1, the result is technically not a mathematical \"norm\", but it may still be useful for various numerical purposes.\n\nThe following describes the method for computing the norm based on different *x* and *ord*:\n\n| *ord* | norm for vectors        | norm for matrices            |\n| :---- | :---------------------- | :--------------------------- |\n| None  | 2-norm                  | Frobenius norm               |\n| 0     | sum(x != 0)             | -                            |\n| -1    | sum(abs(x)^ord)^(1/ord) | min(sum(abs(x), axis=0))     |\n| 1     | sum(abs(x)^ord)^(1/ord) | max(sum(abs(x), axis=0))     |\n| -2    | sum(abs(x)^ord)^(1/ord) | 2-norm (largest sing. value) |\n| 2     | sum(abs(x)^ord)^(1/ord) | smallest singular value      |\n| inf   | max(abs(x))             | max(sum(abs(x), axis=1))     |\n| -inf  | min(abs(x))             | min(sum(abs(x), axis=1))     |\n| nuc   | -                       | nuclear norm                 |\n| fro   | -                       | Frobenius norm               |\n| other | sum(abs(x)^ord)^(1/ord) | -                            |\n\n**axis** (optional) is an integer vector or scalar indicating the direction along which to compute the norm. It cannot contain empty elements.\n\n* When *x* is a vector, *axis* can only be 0.\n* When *x* is a matrix, *axis*:\n  * Has a length of no more than 2.\n  * Cannot contain duplicate elements.\n  * Has elements with values of 0 or 1.\n\n**keepDims** (optional): A boolean scalar indicating whether the returned result should maintain the same form as *x*. The default is false.\n\n#### Returns\n\nAn INT, LONG, or DOUBLE scalar, vector, or matrix.\n\n#### Examples\n\nWhen *x* is a vector, compute norms:\n\n```\nx = 1..4\n\nvectorNorm(x) // Output: 5.477225575051661\n\nvectorNorm(x, keepDims=true) // Output: 5.477225575051661\n\nvectorNorm(x, ord=1) // Output: 10\nvectorNorm(x, ord=1, axis=0) // Output: 10 \n\nvectorNorm(x, ord=-1) // Output 0.4800000000000001\nvectorNorm(x, ord=-1, axis=0) // Output double: 10\n\nvectorNorm(x, ord=\"inf\", axis=0) //Output: 4 \nvectorNorm(x, ord=\"-inf\", axis=0) //Output: 1\n\nvectorNorm(x, ord=3) // Output: 4.641588833612778\nvectorNorm(x, ord=-20.689) // Output: 0.9999999714010688\n\nvectorNorm(x, ord=\"fro\") // throw exception\nvectorNorm(x, ord=\"nuc\") // throw exception\n```\n\nWhen *x* is a matrix, compute norms:\n\n```\nx = 1..4$2:2\n\nvectorNorm(x) // Output: 5.477225575051661\nvectorNorm(x, keepDims=true) // Output: 5.477225575051661\n\nvectorNorm(x, ord=1) // Output: 7\nvectorNorm(x, ord=1, axis=0) // Output: 3 7 \nvectorNorm(x, ord=1, axis=1) // Output: 4 6\n\nvectorNorm(x, ord=-1, axis=0) // Output: 0.6666666666666666 1.7142857142857144\nvectorNorm(x, ord=-1, axis=1) // Output: 0.75 1.3333333333333333\n\nvectorNorm(x, ord=1, axis=(0 1)) // Output: 7\nvectorNorm(x, ord=1, axis=(1 0)) // Output: 6 \n\nvectorNorm(x, ord=-1, axis=(0 1)) // Output: 3\nvectorNorm(x, ord=-1, axis=(1 0)) // Output: 4 \n\nvectorNorm(x, ord=\"inf\", axis=(0 1)) // Output: 4 \nvectorNorm(x, ord=\"inf\", axis=(1 0)) // Output: 3 \n\nvectorNorm(x, ord=\"-inf\", axis=(0 1)) // Output: 6 \nvectorNorm(x, ord=\"-inf\", axis=(1 0)) // Output: 7 \n\nvectorNorm(x, ord=\"fro\", axis=(1 0)) // Output: 5.477225575051661\nvectorNorm(x, ord=\"fro\", axis=(0 1)) // Output: 5.477225575051661\n\nvectorNorm(x, ord=-2, axis=(1 0)) // Output: 0.3659661906262574\nvectorNorm(x, ord=-2, axis=(0 1)) // Output: 0.3659661906262574\n\nvectorNorm(x, ord=2, axis=(1 0)) // Output: 5.464985704219043\nvectorNorm(x, ord=2, axis=(0 1)) // Output: 5.464985704219043\n\nvectorNorm(x, ord=\"nuc\", axis=(1 0)) // Output: 5.8309518948453\nvectorNorm(x, ord=\"nuc\", axis=(0 1)) // Output: 5.8309518948453\n\nvectorNorm(x, ord=3) // throw exception\n```\n"
    },
    "version": {
        "url": "https://docs.dolphindb.com/en/Functions/v/version.html",
        "signatures": [
            {
                "full": "version()",
                "name": "version",
                "parameters": [
                    {
                        "full": "",
                        "name": ""
                    }
                ]
            }
        ],
        "markdown": "### [version](https://docs.dolphindb.com/en/Functions/v/version.html)\n\n\n\n#### Syntax\n\nversion()\n\n#### Details\n\nThis function returns key system information about the DolphinDB server:\n\n* Version number\n\n* Release date\n\n* Operating system\n\n* CPU instruction set\n\n* Compiler version (for JIT/ABI only)\n\n#### Parameters\n\nNone\n\n#### Returns\n\nA STRING scalar.\n\n#### Examples\n\n```\nversion();\n//output: 3.00.0 2024.03.31 LINUX x86_64\n```\n"
    },
    "volumeBar": {
        "url": "https://docs.dolphindb.com/en/Functions/v/volumeBar.html",
        "signatures": [
            {
                "full": "volumeBar(X, interval, [label='seq'])",
                "name": "volumeBar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "interval",
                        "name": "interval"
                    },
                    {
                        "full": "[label='seq']",
                        "name": "label",
                        "optional": true,
                        "default": "'seq'"
                    }
                ]
            }
        ],
        "markdown": "### [volumeBar](https://docs.dolphindb.com/en/Functions/v/volumeBar.html)\n\n#### Syntax\n\nvolumeBar(X, interval, \\[label='seq'])\n\n#### Details\n\nThis function sequentially accumulates the elements in *X*, and then groups them based on the specified threshold. Once a group is determined, the accumulation starts from the next element and data grouping is performed in the same logic. It returns a vector of the same size as *X* containing the corresponding group number for each element.\n\nElements are divided into groups based on the threshold specified by *interval*.\n\n* If *interval* is positive, elements are labeled into groups when the cumulative sum is no smaller than the threshold;\n\n  * If *interval* is in (0, 1), the threshold is sum(X) \\* *interval*. Note that the threshold is converted to the same data type as *X* for comparison. For example, if *X* is an integer, then the threshold will be set at floor(sum(X) \\* *interval*).\n\n  * Otherwise, the threshold takes the value of *interval*.\n\n* If *interval* is negative, the threshold takes the value of *interval*. Elements are labeled into groups when the cumulative sum is no greater than the threshold.\n\n#### Parameters\n\n**X** is a numeric vector.\n\n**interval** is a non-zero number that represents a constant value or percentage that determines the threshold for data grouping.\n\n**label** (optional) is a string used to label the groups. It can be:\n\n* 'seq'(default): label the groups with a sequence of 0, 1, 2, 3...\n\n* 'left': label each group with the sum of all elements before the first element in the group. The first group is labeled with 0.\n\n* 'right': label each group with the sum of all elements up to and including the last element in the group.\n\n#### Returns\n\nA LONG/INT vector.\n\n#### Examples\n\n```\nX =  1 3 4 2 2 1 1 1 1 6 8\nvolumeBar(X, 4)\n// output: [0,0,1,2,2,3,3,3,3,4,5]\n\nvolumeBar(X, 4, 'left')\n// output: [0,0,4,8,8,12,12,12,12,16,22]\n\nvolumeBar(X, 4, 'right')\n// output: [4,4,8,12,12,16,16,16,16,22,30]\n\nvolumeBar(X, 0.3)\n// output: [0,0,0,0,1,1,1,1,1,1,2]\n\nX = -6 2 -4 -5 -1 3 -2 -1\nvolumeBar(X, -2)\n// output: [0,1,1,2,3,3,3,3]\n \nvolumeBar(X, -2, 'left')\n// output: [0,-6,-6,-8,-13,-13,-13,-13]\n\nvolumeBar(X, -2, 'right')\n// output: [-6,-8,-8,-13,-14,-14,-14,-14]\n\ntime = [09:30:00, 09:32:15, 09:35:00, 09:37:30, 09:40:00, 09:45:00, 09:47:30, 09:50:00, 09:55:00, 10:00:00]\nprice = [100.0, 100.1, 100.05, 99.9, 100.2, 100.15, 100.1, 100.05, 100.0, 99.95]\nvolume = [200, 800, 250, 300, 1200, 250, 180, 400, 600, 350]\nt = table(time, price, volume)\n\nselect \n    first(time) as barStartTime,\n    first(price) as open,\n    max(price) as high,\n    min(price) as low,\n    last(price) as close,\n    sum(volume) as totalVolume\nfrom t \ngroup by volumeBar(tradeVolume, 1500) as volumeBarNo\n```\n\n<table id=\"table_fvv_wwp_whc\"><thead><tr><th>\n\nvolumeBarNo\n\n</th><th>\n\nbarStartTime\n\n</th><th>\n\nopen\n\n</th><th>\n\nhigh\n\n</th><th>\n\nlow\n\n</th><th>\n\nclose\n\n</th><th>\n\ntotalVolume\n\n</th></tr></thead><tbody><tr><td>\n\n0\n\n</td><td>\n\n09:30:00\n\n</td><td>\n\n100\n\n</td><td>\n\n100.1\n\n</td><td>\n\n99.9\n\n</td><td>\n\n99.9\n\n</td><td>\n\n1,550\n\n</td></tr><tr><td>\n\n1\n\n</td><td>\n\n09:40:00\n\n</td><td>\n\n100.2\n\n</td><td>\n\n100.2\n\n</td><td>\n\n100.1\n\n</td><td>\n\n100.1\n\n</td><td>\n\n1,630\n\n</td></tr><tr><td>\n\n2\n\n</td><td>\n\n09:50:00\n\n</td><td>\n\n100.05\n\n</td><td>\n\n100.05\n\n</td><td>\n\n99.95\n\n</td><td>\n\n99.95\n\n</td><td>\n\n1,350\n\n</td></tr></tbody>\n</table>**Parent topic:**[Functions](../../Functions/category.md)\n"
    },
    "warmupComputeNodeCache": {
        "url": "https://docs.dolphindb.com/en/Functions/w/warmupcomputenodecache.html",
        "signatures": [
            {
                "full": "warmupComputeNodeCache(sqlObj, [parallelism])",
                "name": "warmupComputeNodeCache",
                "parameters": [
                    {
                        "full": "sqlObj",
                        "name": "sqlObj"
                    },
                    {
                        "full": "[parallelism]",
                        "name": "parallelism",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [warmupComputeNodeCache](https://docs.dolphindb.com/en/Functions/w/warmupcomputenodecache.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nwarmupComputeNodeCache(sqlObj, \\[parallelism])\n\n#### Details\n\nCache the specified data in the compute group.\n\n#### Parameters\n\n**sqlObj** is metacode of SQL statements indicating the data to be cached.\n\n**parallelism** (optional) is an integer indicating the maximum number of workers allocated to the job.\n\n#### Returns\n\nThe job ID.\n\n#### Examples\n\n```\nwarmupComputeNodeCache(sqlObj=<select * from loadTable(\"dfs://test\",\"pt\") where date>=2025.04.01>, parallelism=3)\n```\n"
    },
    "warmupOrcaStreamEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/w/warmupOrcaStreamEngine.html",
        "signatures": [
            {
                "full": "warmupOrcaStreamEngine(name, data)",
                "name": "warmupOrcaStreamEngine",
                "parameters": [
                    {
                        "full": "name",
                        "name": "name"
                    },
                    {
                        "full": "data",
                        "name": "data"
                    }
                ]
            }
        ],
        "markdown": "### [warmupOrcaStreamEngine](https://docs.dolphindb.com/en/Functions/w/warmupOrcaStreamEngine.html)\n\nFirst introduced in version: 3.00.3\n\n\n\n#### Syntax\n\nwarmupOrcaStreamEngine(name, data)\n\n#### Details\n\nIngest data into a stream engine without outputting results. When the next batch of data is ingested, the calculation can be sped up with the results that have already been generated.\n\nCurrently it only supports the reactive state engine, and (daily) time series engine.\n\nUnlike `[warmupStreamEngine](warmupStreamEngine.md)`, `warmupOrcaStreamEngine` can be called from any node in the cluster. Under the hood, it performs a remote call to execute `warmupStreamEngine` on the node where the engine resides.\n\n#### Parameters\n\n**name** is a string representing the name of the streaming egine. You can provide either the fully qualified name (FQN), such as \"catalog\\_name.orca\\_engine.engine\\_name\", or just the engine name, like \"engine\\_name\". If only the name is given, the system will automatically complete it using the current catalog.\n\n**data** is a table object containing the data to be used for warm-up.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nIn the example below, `warmupOrcaStreamEngine(\"rse\", t)` writes the data table `t` into the reactive state engine `rse` for warm-up, ensuring that the `<ema(value, 100)>` metric has sufficient historical data within the window during the warm-up phase.\n\n```\nif (!existsCatalog(\"test\")) {\n\tcreateCatalog(\"test\")\n}\ngo;\nuse catalog test\n\nt = table(1..100 as id, 1..100 as value, take(09:29:00.000..13:00:00.000, 100) as timestamp)\ng = createStreamGraph(\"factor\")\nbaseStream = g.source(\"snapshot\",  1024:0, schema(t).colDefs.name, schema(t).colDefs.typeString)\n  .reactiveStateEngine([<ema(value, 100)>, <timestamp>])\n  .setEngineName(\"rse\")\n  .buffer(\"end\")\n  \ng.submit()\n\nwarmupOrcaStreamEngine(\"rse\", t)\nappendOrcaStreamTable(\"snapshot\", t)\n```\n"
    },
    "warmupStreamEngine": {
        "url": "https://docs.dolphindb.com/en/Functions/w/warmupStreamEngine.html",
        "signatures": [
            {
                "full": "warmupStreamEngine(engine, msgs)",
                "name": "warmupStreamEngine",
                "parameters": [
                    {
                        "full": "engine",
                        "name": "engine"
                    },
                    {
                        "full": "msgs",
                        "name": "msgs"
                    }
                ]
            }
        ],
        "markdown": "### [warmupStreamEngine](https://docs.dolphindb.com/en/Functions/w/warmupStreamEngine.html)\n\n\n\n#### Syntax\n\nwarmupStreamEngine(engine, msgs)\n\n#### Details\n\nIngest warm-up data into a stream engine without outputting calculation results while the intermediate state is preserved. When the next batch of data is ingested, the calculation can be performed based on the intermediate state.\n\nCurrently it only supports the reactive state engine, and (daily) time series engine.\n\n#### Parameters\n\n**engine** is the table object returned from creating a stream engine.\n\n**msgs** is a table indicating the warm-up data.\n\n#### Returns\n\nNone.\n\n#### Examples\n\nThe following example shows the effect on calculation results using `warmupStreamEngine`. Create two identical reactive state engines. The engineA is injected with warm-up data, while the engineB is not.\n\n```\n// simulate data\ntrade=table(1000:0, `date`sym`price`volume, [DATE, SYMBOL, DOUBLE, INT])\nn=3000*100\ndate=take(2021.03.08, n)\nsym=take(\"A\"+string(1..3000), n)\nprice=round(rand(100.0, n), 2)\nvolume=rand(100, n)\ntable1 = table(date, sym, price, volume)\noutputTableA = table(n:0, `sym`factor1, [STRING,DOUBLE])\noutputTableB = table(n:0, `sym`factor1, [STRING,DOUBLE])\n\n// create stream engines and write data\ndropStreamEngine(\"test1\")\ndropStreamEngine(\"test2\")\nengineA = createReactiveStateEngine(\"test1\", <ema(volume, 40)>, table1, outputTableA, \"sym\")\nengineB = createReactiveStateEngine(\"test2\", <ema(volume, 40)>, table1, outputTableB, \"sym\")\nwarmupStreamEngine(engineA, table1) // warm up using warmupStreamEngine\n\n\n// write new data to both engines\ndate=take(2021.03.09, n)\nsym=take(\"A\"+string(1..3000), n)\nprice=round(rand(100.0, n), 2)\nvolume=rand(100, n)\ntable2 = table(date, sym, price, volume)\nengineA.append!(table2)\nengineB.append!(table2)\n```\n\noutputTableA:\n\n![](https://docs.dolphindb.com/en/Functions/resources/warmupStreamEngine1.png)\n\noutputTableB:\n\n![](https://docs.dolphindb.com/en/Functions/resources/warmupStreamEngine2.png)\n\nBy using `warmupStreamEngine` to ingest warm‑up data into engineA, subsequent calculations are based on the intermediate state from the warm‑up phase. Consequently, outputTableA returns non‑null data starting from the first row. Since the window size is 40, outputTableB returns null for the first 39 groups, and non‑null data starts from row 11,7001.\n"
    },
    "wavg": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wavg.html",
        "signatures": [
            {
                "full": "wavg(value, weight)",
                "name": "wavg",
                "parameters": [
                    {
                        "full": "value",
                        "name": "value"
                    },
                    {
                        "full": "weight",
                        "name": "weight"
                    }
                ]
            }
        ],
        "markdown": "### [wavg](https://docs.dolphindb.com/en/Functions/w/wavg.html)\n\n\n\n#### Syntax\n\nwavg(value, weight)\n\n#### Details\n\nCalculate the weighted average of *X* with the weight vector *Y*. Please note that the weight vector *Y* is automatically scaled such that the sum of the weights is 1.\n\n#### Parameters\n\n**value** is the value vector.\n\n**weight** is the weight vector.\n\n#### Returns\n\nA numeric scalar.\n\n#### Examples\n\n```\nwavg(2.2 1.1 3.3, 4 5 6);\n// output: 2.273333\n//  (2.2*4+1.1*5+3.3*6)/(4+5+6)\n\nwavg(1 NULL 1, 1 1 1);\n// output: 1\n```\n\nRelated function: [wsum](https://docs.dolphindb.com/en/Functions/w/wsum.html)\n"
    },
    "wc": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wc.html",
        "signatures": [
            {
                "full": "wc(X)",
                "name": "wc",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [wc](https://docs.dolphindb.com/en/Functions/w/wc.html)\n\n\n\n#### Syntax\n\nwc(X)\n\n#### Details\n\nCount the words in *X*.\n\n#### Parameters\n\n**X** is a string scalar/vector.\n\n#### Returns\n\nA scalar or vector of the INT type.\n\n#### Examples\n\n```\nwc(`apple);\n// output: 1\n\nwc(\"This is a 7th generation iphone!\");\n// output: 6\n\nwc(\"This is a 7th generation iphone!\" \"I wonder what the 8th generation looks like\");\n// output: [6,8]\n```\n"
    },
    "wcovar": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wcovar.html",
        "signatures": [
            {
                "full": "wcovar(X, Y, weights)",
                "name": "wcovar",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "weights",
                        "name": "weights"
                    }
                ]
            }
        ],
        "markdown": "### [wcovar](https://docs.dolphindb.com/en/Functions/w/wcovar.html)\n\n\n\n#### Syntax\n\nwcovar(X, Y, weights)\n\n#### Details\n\nCalculate the weighted covariance of *X* and *Y* with weights as the weight vector.\n\n#### Parameters\n\n**X**, **Y** and **weights** are vectors of the same size.\n\n#### Returns\n\nA numeric scalar.\n\n#### Examples\n\n```\nx=7 4 5 8 9 3 3 5 2 6 12 1 0 -5 32\ny=1.1 7 8 9 9 5 4 8.6 2 1 -9 -3 5 8 13\nwt=iterate(1,0.9,x.size())\nwcovar(x,y,wt);\n\n// output: 4.201899\n```\n"
    },
    "weekBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/w/weekBegin.html",
        "signatures": [
            {
                "full": "weekBegin(X, [weekday=0], [offset], [n=1])",
                "name": "weekBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[weekday=0]",
                        "name": "weekday",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [weekBegin](https://docs.dolphindb.com/en/Functions/w/weekBegin.html)\n\n\n\n#### Syntax\n\nweekBegin(X, \\[weekday=0], \\[offset], \\[n=1])\n\n#### Details\n\nCalculates the first date of the period containing the specified date(s) in *X*. By default, the period length is one week, and the period-starting day is specified by the *weekday* parameter. The default value of *weekday* is 6 (Sunday).\n\nWhen both *offset* and *n* are specified (with *n* > 1), the function calculates period start dates based on n-week periods. In this case, *offset* determines how period boundaries are aligned. Specifically, the system first calculates the start date of the period containing *offset* according to weekday. This date is then used as the reference point, and a new period-starting boundary is generated every *n* weeks. The function returns the first day of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, DATEHOUR, TIMESTAMP or NANOTIMESTAMP, specifying the input date(s) or datetime(s) for which the period first date is to be calculated.\n\n**weekday** (optional) is an integer from 0 to 6 specifies the week-starting day. 0 means Monday, 1 means Tuesday, ..., and 6 means Sunday. The default value is 0.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*.\n\nWhen *n* > 1, *offset* is used to determine the alignment reference for multi-week periods. If *offset* is not specified, the minimum value in *X* is used as the default offset.\n\n**n** (optional) is a positive integer that specifies the number of weeks in each period. The default value is 1. When *n* = 1, the function calculates period start dates based on calendar weeks and *offset* has no effect. When *n* > 1, the function calculates period start dates based on n-week periods, in which case both *offset* and *n* must be specified.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\nExample 1\n\n```\nt = table(2017.12.01..2017.12.14 as date);\nupdate t set weekday=weekday(date, false), weekBegin=weekBegin(date), weekBegin4=weekBegin(date,4);\nt;\n```\n\n| date       | weekday | weekBegin  | weekBegin4 |\n| ---------- | ------- | ---------- | ---------- |\n| 2017.12.01 | 4       | 2017.11.27 | 2017.12.01 |\n| 2017.12.02 | 5       | 2017.11.27 | 2017.12.01 |\n| 2017.12.03 | 6       | 2017.11.27 | 2017.12.01 |\n| 2017.12.04 | 0       | 2017.12.04 | 2017.12.01 |\n| 2017.12.05 | 1       | 2017.12.04 | 2017.12.01 |\n| 2017.12.06 | 2       | 2017.12.04 | 2017.12.01 |\n| 2017.12.07 | 3       | 2017.12.04 | 2017.12.01 |\n| 2017.12.08 | 4       | 2017.12.04 | 2017.12.08 |\n| 2017.12.09 | 5       | 2017.12.04 | 2017.12.08 |\n| 2017.12.10 | 6       | 2017.12.04 | 2017.12.08 |\n| 2017.12.11 | 0       | 2017.12.11 | 2017.12.08 |\n| 2017.12.12 | 1       | 2017.12.11 | 2017.12.08 |\n| 2017.12.13 | 2       | 2017.12.11 | 2017.12.08 |\n| 2017.12.14 | 3       | 2017.12.11 | 2017.12.08 |\n\nExample 2\n\n```\n t = table(2018.01.03+0..10*3 as date, 0..10 as x);\n update t set weekday=weekday(date, false), weekBegin=weekBegin(date,,2018.01.02,2);\n t;\n```\n\n| date       | x  | weekday | weekBegin  |\n| ---------- | -- | ------- | ---------- |\n| 2018.01.03 | 0  | 2       | 2018.01.01 |\n| 2018.01.06 | 1  | 5       | 2018.01.01 |\n| 2018.01.09 | 2  | 1       | 2018.01.01 |\n| 2018.01.12 | 3  | 4       | 2018.01.01 |\n| 2018.01.15 | 4  | 0       | 2018.01.15 |\n| 2018.01.18 | 5  | 3       | 2018.01.15 |\n| 2018.01.21 | 6  | 6       | 2018.01.15 |\n| 2018.01.24 | 7  | 2       | 2018.01.15 |\n| 2018.01.27 | 8  | 5       | 2018.01.15 |\n| 2018.01.30 | 9  | 1       | 2018.01.29 |\n| 2018.02.02 | 10 | 4       | 2018.01.29 |\n\nExample 3\n\n```\ndate=2012.10.02 2012.10.03 2012.10.07 2012.10.08 2012.10.12 2012.10.16 2012.10.18 2012.10.20 2012.10.25 2012.10.28\ntime=[09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2012.10.02 | 09:34:07 | MSFT | 2200 | 49.6   |\n| 2012.10.03 | 09:36:42 | MSFT | 1900 | 29.46  |\n| 2012.10.07 | 09:36:51 | MSFT | 2100 | 29.52  |\n| 2012.10.08 | 09:36:59 | MSFT | 3200 | 30.02  |\n| 2012.10.12 | 09:32:47 | MSFT | 6800 | 174.97 |\n| 2012.10.16 | 09:35:26 | MSFT | 5400 | 175.23 |\n| 2012.10.18 | 09:34:16 | MSFT | 1300 | 50.76  |\n| 2012.10.20 | 09:34:26 | MSFT | 2500 | 50.32  |\n| 2012.10.25 | 09:38:12 | MSFT | 8800 | 51.29  |\n| 2012.10.28 | 09:38:13 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by weekBegin(date, 4, 2012.10.01, 2);\n```\n\n| weekBegin\\_date | avg\\_price | sum\\_qty |\n| --------------- | ---------- | -------- |\n| 2012.09.28      | 34.65      | 9400     |\n| 2012.10.12      | 100.514    | 24800    |\n| 2012.10.26      | 52.38      | 4500     |\n\nRelated function: [weekEnd](https://docs.dolphindb.com/en/Functions/w/weekEnd.html)\n"
    },
    "weekday": {
        "url": "https://docs.dolphindb.com/en/Functions/w/weekday.html",
        "signatures": [
            {
                "full": "weekday(X, [startFromSunday=true])",
                "name": "weekday",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[startFromSunday=true]",
                        "name": "startFromSunday",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [weekday](https://docs.dolphindb.com/en/Functions/w/weekday.html)\n\n\n\n#### Syntax\n\nweekday(X, \\[startFromSunday=true])\n\n#### Details\n\nReturn integer(s) to represent of the corresponding weekday(s) of *X*.\n\nIf *startFromSunday*=true, 0 means Sunday, 1 means Monday, ..., and 6 means Saturday.\n\nIf *startFromSunday*=false, 0 means Monday, 1 means Tuesday, ..., and 6 means Sunday.\n\n#### Parameters\n\n**X** is a temporal scalar/vector.\n\n**startFromSunday** (optional) is a Boolean value indicating whether a week starts from Sunday. The default value is true. If *startFromSunday*=false, a week starts from Monday.\n\n#### Returns\n\nA scalar or vector of the INT type.\n\n#### Examples\n\n```\nweekday 2012.12.05;\n// output: 3\n\nweekday(2012.12.05, false);\n// output: 2\n\nweekday 2013.05.23T12:00:00;\n// output: 4\n\nweekday(2014.01.11T23:04:28.113);\n// output: 6\n\nweekday 2012.12.05 2012.12.06 2013.01.05;\n// output: [3,4,6]\n```\n"
    },
    "weekEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/w/weekEnd.html",
        "signatures": [
            {
                "full": "weekEnd(X, [weekday=6], [offset], [n=1])",
                "name": "weekEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[weekday=6]",
                        "name": "weekday",
                        "optional": true,
                        "default": "6"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [weekEnd](https://docs.dolphindb.com/en/Functions/w/weekEnd.html)\n\n\n\n#### Syntax\n\nweekEnd(X, \\[weekday=6], \\[offset], \\[n=1])\n\nAlias: week\n\n#### Details\n\nCalculates the end date of the period containing the specified date(s) in *X*. By default, the period length is one week, and the period-ending day is specified by the *weekday* parameter. The default value of *weekday* is 6 (Sunday).\n\nWhen both *offset* and *n* are specified (with *n* > 1), the function calculates period end dates based on n-week periods. In this case, *offset* determines how period boundaries are aligned. Specifically, the system first calculates the end date of the period containing *offset* according to weekday. This date is then used as the reference point, and a new period-ending boundary is generated every *n* weeks. The function returns the end date of the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, DATEHOUR, TIMESTAMP or NANOTIMESTAMP, specifying the input date(s) or datetime(s) for which the period end date is to be calculated.\n\n**weekday** (optional) is an integer from 0 to 6 that specifies the week-ending day. 0 means Monday, 1 means Tuesday, ..., and 6 means Sunday. The default value is 6.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*.\n\nWhen *n* > 1, *offset* is used to determine the alignment reference for multi-week periods. If *offset* is not specified, the minimum value in *X* is used as the default offset.\n\n**n** (optional) is a positive integer that specifies the number of weeks in each period. The default value is 1. When *n* = 1, the function calculates period end dates based on calendar weeks and *offset* has no effect. When *n* > 1, the function calculates period end dates based on n-week periods, in which case both *offset* and *n* must be specified.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\nExample 1\n\n```\nt = table(2017.12.01..2017.12.14 as date)\nupdate t set weekday=weekday(date, false), weekEnd=weekEnd(date), weekEnd4=weekEnd(date,4)\nt;\n```\n\n| date       | weekday | weekEnd    | weekEnd4   |\n| ---------- | ------- | ---------- | ---------- |\n| 2017.12.01 | 4       | 2017.12.04 | 2017.12.01 |\n| 2017.12.02 | 5       | 2017.12.04 | 2017.12.08 |\n| 2017.12.03 | 6       | 2017.12.04 | 2017.12.08 |\n| 2017.12.04 | 0       | 2017.12.04 | 2017.12.08 |\n| 2017.12.05 | 1       | 2017.12.11 | 2017.12.08 |\n| 2017.12.06 | 2       | 2017.12.11 | 2017.12.08 |\n| 2017.12.07 | 3       | 2017.12.11 | 2017.12.08 |\n| 2017.12.08 | 4       | 2017.12.11 | 2017.12.08 |\n| 2017.12.09 | 5       | 2017.12.11 | 2017.12.15 |\n| 2017.12.10 | 6       | 2017.12.11 | 2017.12.15 |\n| 2017.12.11 | 0       | 2017.12.11 | 2017.12.15 |\n| 2017.12.12 | 1       | 2017.12.18 | 2017.12.15 |\n| 2017.12.13 | 2       | 2017.12.18 | 2017.12.15 |\n| 2017.12.14 | 3       | 2017.12.18 | 2017.12.15 |\n\nExample 2\n\n```\nt = table(2018.01.03+0..10*3 as date, 0..10 as x)\nupdate t set weekday=weekday(date, false), weekEnd2=weekEnd(date,,2018.01.02,2)\nt;\n```\n\n| date       | x  | weekday | weekEnd2   |\n| ---------- | -- | ------- | ---------- |\n| 2018.01.03 | 0  | 2       | 2018.01.08 |\n| 2018.01.06 | 1  | 5       | 2018.01.08 |\n| 2018.01.09 | 2  | 1       | 2018.01.22 |\n| 2018.01.12 | 3  | 4       | 2018.01.22 |\n| 2018.01.15 | 4  | 0       | 2018.01.22 |\n| 2018.01.18 | 5  | 3       | 2018.01.22 |\n| 2018.01.21 | 6  | 6       | 2018.01.22 |\n| 2018.01.24 | 7  | 2       | 2018.02.05 |\n| 2018.01.27 | 8  | 5       | 2018.02.05 |\n| 2018.01.30 | 9  | 1       | 2018.02.05 |\n| 2018.02.02 | 10 | 4       | 2018.02.05 |\n\nExample 3\n\n```\ndate=2012.10.02 2012.10.03 2012.10.07 2012.10.08 2012.10.12 2012.10.16 2012.10.18 2012.10.20 2012.10.25 2012.10.28\ntime=[09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2012.10.02 | 09:34:07 | MSFT | 2200 | 49.6   |\n| 2012.10.03 | 09:36:42 | MSFT | 1900 | 29.46  |\n| 2012.10.07 | 09:36:51 | MSFT | 2100 | 29.52  |\n| 2012.10.08 | 09:36:59 | MSFT | 3200 | 30.02  |\n| 2012.10.12 | 09:32:47 | MSFT | 6800 | 174.97 |\n| 2012.10.16 | 09:35:26 | MSFT | 5400 | 175.23 |\n| 2012.10.18 | 09:34:16 | MSFT | 1300 | 50.76  |\n| 2012.10.20 | 09:34:26 | MSFT | 2500 | 50.32  |\n| 2012.10.25 | 09:38:12 | MSFT | 8800 | 51.29  |\n| 2012.10.28 | 09:38:13 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by weekEnd(date, 4, 2012.10.01, 2);\n```\n\n| weekEnd\\_date | avg\\_price | sum\\_qty |\n| ------------- | ---------- | -------- |\n| 2012.10.05    | 39.53      | 4100     |\n| 2012.10.19    | 92.1       | 18800    |\n| 2012.11.02    | 51.33      | 15800    |\n\nRelated function: [weekBegin](https://docs.dolphindb.com/en/Functions/w/weekBegin.html)\n"
    },
    "weekOfMonth": {
        "url": "https://docs.dolphindb.com/en/Functions/w/weekOfMonth.html",
        "signatures": [
            {
                "full": "weekOfMonth(X, [week=0], [weekday=0], [offset], [n=1])",
                "name": "weekOfMonth",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[week=0]",
                        "name": "week",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[weekday=0]",
                        "name": "weekday",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [weekOfMonth](https://docs.dolphindb.com/en/Functions/w/weekOfMonth.html)\n\n\n\n#### Syntax\n\nweekOfMonth(X, \\[week=0], \\[weekday=0], \\[offset], \\[n=1])\n\n#### Details\n\nIn the calendar month of *X*, suppose the \"week\"-th \"weekday\" is d.\n\n* If *X*\\<d: return the week-th \"weekday\" in the previous calendar month.\n\n* If *X*>=d: return the week-th \"weekday\" in the current calendar month.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates dates based on periods consisting of *n* months. In this case, *offset* determines how the multi-month periods are aligned. Specifically, the system first calculates the target date in the month containing *offset* according to *week* and *weekday*, and uses that date as the reference point. The result is then updated every *n* months, and the function returns the target date corresponding to the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**week** (optional) is an integer from 0 to 3 indicating the i-th week of a month. The default value is 0.\n\n**weekday** (optional) is an integer from 0 to 6. 0 means Monday, 1 means Tuesday, ..., and 6 means Sunday. The default value is 0.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\n```\nweekOfMonth(2019.11.01,2,4);\n// output: 2019.10.18\n\nweekOfMonth(2019.11.20,2,4);\n// output: 2019.11.15\n\ndate=2012.01.02 2012.02.03 2012.03.07 2012.04.08 2012.05.12 2012.06.16 2012.07.18 2012.08.20 2012.09.25 2012.10.28\ntime = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12,09:38:13]\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nselect avg(price),sum(qty) from t1 group by weekOfMonth(date,3,4,2012.01.01,2);\n```\n\n| weekOfMonth\\_date | avg\\_price | sum\\_qty |\n| ----------------- | ---------- | -------- |\n| 2011.12.23        | 39.53      | 4100     |\n| 2012.02.24        | 29.77      | 5300     |\n| 2012.04.27        | 175.1      | 12200    |\n| 2012.06.22        | 50.54      | 3800     |\n| 2012.08.24        | 51.29      | 8800     |\n| 2012.10.26        | 52.38      | 4500     |\n"
    },
    "weekOfYear": {
        "url": "https://docs.dolphindb.com/en/Functions/w/weekOfYear.html",
        "signatures": [
            {
                "full": "weekOfYear(X)",
                "name": "weekOfYear",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [weekOfYear](https://docs.dolphindb.com/en/Functions/w/weekOfYear.html)\n\n\n\n#### Syntax\n\nweekOfYear(X)\n\n#### Details\n\nReturn the week number for *X*.\n\nNote:\n\n* Each week starts on Sunday. The first week of the year has more than 4 days.\n\n* If 31 December is on a Monday, Tuesday or Wednesday, it is in week 01 of the next year. If it is on a Thursday, it is in week 53 of the year just ending; if on a Friday it is in week 52 (or 53 if the year just ending is a leap year); if on a Saturday or Sunday, it is in week 52 of the year just ending.\n\n#### Parameters\n\n**X** is a scalar/vector of type DATE, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n#### Returns\n\nA scalar or vector of the INT type.\n\n#### Examples\n\n```\nweekOfYear(2012.01.07);\n// output: 1\n\nweekOfYear(2013.01.07);\n// output: 2\n\nweekOfYear(2012.07.02);\n// output: 27\n\nweekOfYear([2012.06.12T12:30:00,2012.10.28T12:35:00,2013.01.06T12:36:47,2013.04.06T08:02:14]);\n// output: [24,43,1,14]\n```\n\nRelated function: [dayOfYear](https://docs.dolphindb.com/en/Functions/d/dayOfYear.html), [dayOfMonth](https://docs.dolphindb.com/en/Functions/d/dayOfMonth.html), [quarterOfYear](https://docs.dolphindb.com/en/Functions/q/quarterOfYear.html), [monthOfYear](https://docs.dolphindb.com/en/Functions/m/monthOfYear.html), [hourOfDay](https://docs.dolphindb.com/en/Functions/h/hourOfDay.html), [minuteOfHour](https://docs.dolphindb.com/en/Functions/m/minuteOfHour.html), [secondOfMinute](https://docs.dolphindb.com/en/Functions/s/secondOfMinute.html), [millisecond](https://docs.dolphindb.com/en/Functions/m/millisecond.html), [microsecond](https://docs.dolphindb.com/en/Functions/m/microsecond.html), [nanosecond](https://docs.dolphindb.com/en/Functions/n/nanosecond.html)\n"
    },
    "wilder": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wilder.html",
        "signatures": [
            {
                "full": "wilder(X, window)",
                "name": "wilder",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [wilder](https://docs.dolphindb.com/en/Functions/w/wilder.html)\n\n\n\n#### Syntax\n\nwilder(X, window)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Exponential Moving Average (ema) for *X* in a sliding window of the given length.\n\nDifferent from [ema](https://docs.dolphindb.com/en/Functions/e/ema.html), the function `wilder` uses Welles Wilder's Moving Average Formula, which is:\n\n![](https://docs.dolphindb.com/en/images/wilderxk.png)\n\nwhere ![](https://docs.dolphindb.com/en/images/wilderxk_name.png) is the k-th exponential moving average, n is the length of sliding window, and X\\_k is the k-th element of the vector X.\n\n#### Returns\n\nIf *X* is a vector, a vector of the same length as *X* is returned. If *X* is a matrix, the calculation is performed column-wise, and a matrix with the same dimensions as *X* is returned.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\nwilder(x,3);\n// output: [,,12.299999999999998,12.466666666666668,12.27777777777778,12.051851851851854,11.767901234567903]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\nwilder(x,3);\n```\n\n| col1    | col2    |\n| ------- | ------- |\n|         |         |\n|         |         |\n| 12.3    | 15.6667 |\n| 12.4667 | 16.7778 |\n| 12.2778 | 18.1852 |\n| 12.0519 | 16.1235 |\n| 11.7679 | 14.0823 |\n\nRelated functions: [ema](https://docs.dolphindb.com/en/Functions/e/ema.html), [gema](https://docs.dolphindb.com/en/Functions/g/gema.html), [tema](https://docs.dolphindb.com/en/Functions/t/tema.html)\n"
    },
    "winsorize!": {
        "url": "https://docs.dolphindb.com/en/Functions/w/winsorize!.html",
        "signatures": [
            {
                "full": "winsorize!(X, limit, [inclusive=true], [nanPolicy='omit'])",
                "name": "winsorize!",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "limit",
                        "name": "limit"
                    },
                    {
                        "full": "[inclusive=true]",
                        "name": "inclusive",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[nanPolicy='omit']",
                        "name": "nanPolicy",
                        "optional": true,
                        "default": "'omit'"
                    }
                ]
            }
        ],
        "markdown": "### [winsorize!](https://docs.dolphindb.com/en/Functions/w/winsorize!.html)\n\n\n\n#### Syntax\n\nwinsorize!(X, limit, \\[inclusive=true], \\[nanPolicy='omit'])\n\n#### Details\n\nWinsorize the input array. For details, see [winsorize](https://docs.dolphindb.com/en/Functions/w/winsorize.html). The exclamation mark (!) means in-place change in DolphinDB.\n"
    },
    "winsorize": {
        "url": "https://docs.dolphindb.com/en/Functions/w/winsorize.html",
        "signatures": [
            {
                "full": "winsorize(X, limit, [inclusive=true], [nanPolicy='upper'])",
                "name": "winsorize",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "limit",
                        "name": "limit"
                    },
                    {
                        "full": "[inclusive=true]",
                        "name": "inclusive",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[nanPolicy='upper']",
                        "name": "nanPolicy",
                        "optional": true,
                        "default": "'upper'"
                    }
                ]
            }
        ],
        "markdown": "### [winsorize](https://docs.dolphindb.com/en/Functions/w/winsorize.html)\n\n\n\n#### Syntax\n\nwinsorize(X, limit, \\[inclusive=true], \\[nanPolicy='upper'])\n\n#### Details\n\nReturn a winsorized version of the input array. For in-place modification, use [winsorize!](https://docs.dolphindb.com/en/Functions/w/winsorize!.html).\n\n#### Parameters\n\n**X** is a vector.\n\n**limit** is a scalar or a vector with 2 elements indicating the percentages to cut on each side of *X*, with respect to the number of unmasked data, as floats between 0 and 1. If *limit* is a scalar, it means the percentages to cut on both sides of X. If *limit* has n elements (including null values), the (n \\* limit\\[0])-th smallest element and the (n \\* limit\\[1])-th largest element are masked, and the total number of unmasked data after trimming is n \\* (1-sum(limit)). The value of one element of *limit* can be set to 0 to indicate no masking is conducted on this side.\n\n**inclusive** (optional) is a Boolean type scalar or a vector of 2 elements indicating whether the number of data being masked on each side should be truncated (true) or rounded (false).\n\n**nanPolicy** (optional) is a string indicating how to handle null values. The following options are available (default is 'upper'):\n\n* 'upper': allows null values and treats them as the largest values of *X*.\n\n* 'lower': allows null values and treats them as the smallest values of *X*.\n\n* 'raise': throws an error.\n\n* 'omit': performs the calculations without masking null values.\n\n#### Returns\n\nA vector of the same length as *X*.\n\n#### Examples\n\n```\nx = 1..10\nwinsorize(x, 0.1);\n// output: [2,2,3,4,5,6,7,8,9,9]\n\nwinsorize(x, 0.12 0.17);\n// output: [2,2,3,4,5,6,7,8,9,9]\n\nwinsorize(x, 0.12 0.17, inclusive=false);\n// output: [2,2,3,4,5,6,7,8,8,8]\n\n\nx=1..20;\nx[19:]=NULL;\nx;\n// output: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,]\n\nwinsorize(x, 0.1);\n// output: [3,3,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,18]\n\nwinsorize(x, 0.1, nanPolicy='upper');\n// output: [3,3,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,18]\n\nwinsorize(x, 0.1, nanPolicy='lower');\n// output: [2,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,17,17,2]\n```\n"
    },
    "withdrawMCPPrompts": {
        "url": "https://docs.dolphindb.com/en/Functions/w/withdrawMCPPrompts.html",
        "signatures": [
            {
                "full": "withdrawMCPPrompts([names])",
                "name": "withdrawMCPPrompts",
                "parameters": [
                    {
                        "full": "[names]",
                        "name": "names",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [withdrawMCPPrompts](https://docs.dolphindb.com/en/Functions/w/withdrawMCPPrompts.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nwithdrawMCPPrompts(\\[names])\n\n#### Details\n\nWithdraws the MCP prompt template(s).\n\n#### Parameters\n\n**name** is a STRING scalar/vector indicating the name of the prompt template.\n\n#### Returns\n\nA STRING vector indicating the name(s) of the successfully withdrawn prompt template(s).\n\n#### Examples\n\n```\nwithdrawMCPPrompts(\"stock_summary\")\n// output:[\"stock_summary\"]\n```\n"
    },
    "withdrawMCPTools": {
        "url": "https://docs.dolphindb.com/en/Functions/w/withdrawMCPTools.html",
        "signatures": [
            {
                "full": "withdrawMCPTools([names])",
                "name": "withdrawMCPTools",
                "parameters": [
                    {
                        "full": "[names]",
                        "name": "names",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [withdrawMCPTools](https://docs.dolphindb.com/en/Functions/w/withdrawMCPTools.html)\n\nFirst introduced in version: 3.00.4\n\n\n\n#### Syntax\n\nwithdrawMCPTools(\\[names])\n\n#### Details\n\nWithdraws published MCP tool(s).\n\n#### Parameters\n\n**names** (optional) is a STRING scalar or vector indicating the tool names.\n\n#### Returns\n\nA STRING vector indicating the names of withdrawn tools.\n\n#### Examples\n\n```\nwithdrawMCPTools(\"myTool\")\n```\n"
    },
    "wls": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wls.html",
        "signatures": [
            {
                "full": "wls(Y, X, W, [intercept=true], [mode=0])",
                "name": "wls",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "W",
                        "name": "W"
                    },
                    {
                        "full": "[intercept=true]",
                        "name": "intercept",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[mode=0]",
                        "name": "mode",
                        "optional": true,
                        "default": "0"
                    }
                ]
            }
        ],
        "markdown": "### [wls](https://docs.dolphindb.com/en/Functions/w/wls.html)\n\n\n\n#### Syntax\n\nwls(Y, X, W, \\[intercept=true], \\[mode=0])\n\n#### Details\n\nReturn the result of an weighted-least-squares regression of *Y* on *X*.\n\n#### Parameters\n\n**Y** is a dependent variable.\n\n**X** is an independent variable.\n\n*Y* is a vector. *X* can be a matrix, table or tuple. When *X* is a matrix, if the number of rows is equal to the length of *Y*, each column of *X* is a factor. If the number of rows is not equal to the length of *Y*, but the number of columns is equal to the length of *Y*, each row of *X* is a factor.\n\n**W** is a vector indicating the weight in which each element is a non-negative.\n\n**intercept** (optional) is a Boolean variable that indicates whether to include the intercept in regression. The default value is true. When it is true, the system automatically adds a column of \"1\" to *X* to generate the intercept.\n\n**mode** (optional) is an integer that could be 0, 1, or 2.\n\n* 0: a vector of the coefficient estimates\n\n* 1: a table with coefficient estimates, standard error, t-statistics, and p-value\n\n* 2: a dictionary with all statistics\n\nANOVA (one-way analysis of variance)\n\n| Source of Variance | DF (degree of freedom) | SS (sum of square)             | MS (mean of square)               | F (F-score) | Significance |\n| ------------------ | ---------------------- | ------------------------------ | --------------------------------- | ----------- | ------------ |\n| Regression         | p                      | sum of squares regression, SSR | regression mean square, MSR=SSR/R | MSR/MSE     | p-value      |\n| Residual           | n-p-1                  | sum of squares error, SSE      | mean square error, MSE=MSE/E      |             |              |\n| Total              | n-1                    | sum of squares total, SST      |                                   |             |              |\n\nRegressionStat (Regression statistics)\n\n| Item         | Description                                                                                                                                   |\n| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| R2           | R-squared                                                                                                                                     |\n| AdjustedR2   | The adjusted R-squared corrected based on the degrees of freedom by comparing the sample size to the number of terms in the regression model. |\n| StdError     | The residual standard error/deviation corrected based on the degrees of freedom.                                                              |\n| Observations | The sample size.                                                                                                                              |\n\nCoefficient\n\n| Item     | Description                                                             |\n| -------- | ----------------------------------------------------------------------- |\n| factor   | Independent variables                                                   |\n| beta     | Estimated regression coefficients                                       |\n| StdError | Standard error of the regression coefficients                           |\n| tstat    | t statistic, indicating the significance of the regression coefficients |\n\nResidual: the difference between each predicted value and the actual value.\n\n#### Returns\n\nReturns a value depending on the *mode* parameter.\n\n#### Examples\n\n```\nx1=1 3 5 7 11 16 23\nx2=2 8 11 34 56 54 100\ny=0.1 4.2 5.6 8.8 22.1 35.6 77.2;\nw=rand(10,7)\nwls(y, x1, w)\n\n// output: [-17.6177  4.0016]\n\nwls(y, (x1,x2), w);\n\n// output: [-17.4168  3.0481 0.2214]\n```\n\n```\nwls(y, (x1,x2), w, 1, 1);\n```\n\n| factor    | beta     | stdError | tstat   | pvalue |\n| --------- | -------- | -------- | ------- | ------ |\n| Intercept | -17.4168 | 4.8271   | -3.6081 | 0.0226 |\n| x1        | 3.0481   | 1.6232   | 1.8779  | 0.1336 |\n| x2        | 0.2214   | 0.3699   | 0.5986  | 0.5817 |\n\n```\nwls(y, (x1,x2), w,1, 2);\n\n/* output:\nCoefficient->\nfactor    beta      stdError tstat     pvalue\n--------- --------- -------- --------- --------\nintercept -10.11392 4.866583 -2.078239 0.106234\nx1        3.938138  2.061191 1.910613  0.128655\nx2        -0.088542 0.446667 -0.198227 0.852534\n\nResidual->[6.452866,3.207839,-3.002812,-5.642629,-6.147264,-12.515038,5.590914]\nRegressionStat->\nitem         statistics\n------------ ----------\nR2           0.957998\nAdjustedR2   0.936997\nStdError     17.172833\nObservations 7\n\nANOVA->\nBreakdown  DF SS           MS           F         Significance\n---------- -- ------------ ------------ --------- ------------\nRegression 2  26905.306594 13452.653297 45.616718 0.001764\nResidual   4  1179.624835  294.906209\nTotal      6  28084.931429\n*/\n```\n\n```\nx=matrix(1 4 8 2 3, 1 4 2 3 8, 1 5 1 1 5);\nw=rand(8,5)\nwls(1..5, x,w,0,1);\n```\n\n| factor | beta   | stdError | tstat   | pvalue |\n| ------ | ------ | -------- | ------- | ------ |\n| beta0  | 0.0026 | 1.4356   | 0.0018  | 0.9988 |\n| beta1  | -1     | 1.2105   | -0.8261 | 0.5605 |\n| beta2  | 0.4511 | 0.5949   | 0.7582  | 0.587  |\n| beta3  | 1.687  | 1.7389   | 0.9701  | 0.5097 |\n"
    },
    "wma": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wma.html",
        "signatures": [
            {
                "full": "wma(X, window)",
                "name": "wma",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "window",
                        "name": "window"
                    }
                ]
            }
        ],
        "markdown": "### [wma](https://docs.dolphindb.com/en/Functions/w/wma.html)\n\n\n\n#### Syntax\n\nwma(X, window)\n\nPlease see [TALib](https://docs.dolphindb.com/en/Functions/Themes/TALib.html) for the parameters and windowing logic.\n\n#### Details\n\nCalculate the Weighted Moving Average (wma) for *X* in a sliding window of the given length.\n\nThe formula is: ![](https://docs.dolphindb.com/en/images/wma.png)\n\n#### Returns\n\nA numeric result with the same form as *X*.\n\n#### Examples\n\n```\nx=12.1 12.2 12.6 12.8 11.9 11.6 11.2\nwma(x,3);\n// output: [,,12.383333333333332,12.633333333333334,12.316666666666668,11.9,11.450000000000001]\n\nx=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)\nwma(x,3);\n```\n\n| col1    | col2    |\n| ------- | ------- |\n|         |         |\n|         |         |\n| 12.3833 | 16.3333 |\n| 12.6333 | 18      |\n| 12.3167 | 19.8333 |\n| 11.9    | 16.1667 |\n| 11.45   | 12.5    |\n\nRelated functions: [sma](https://docs.dolphindb.com/en/Functions/s/sma.html), [trima](https://docs.dolphindb.com/en/Functions/t/trima.html)\n"
    },
    "write": {
        "url": "https://docs.dolphindb.com/en/Functions/w/write.html",
        "signatures": [
            {
                "full": "write(handle, object, [offset=0], [length])",
                "name": "write",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "object",
                        "name": "object"
                    },
                    {
                        "full": "[offset=0]",
                        "name": "offset",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[length]",
                        "name": "length",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [write](https://docs.dolphindb.com/en/Functions/w/write.html)\n\n\n\n#### Syntax\n\nwrite(handle, object, \\[offset=0], \\[length])\n\n#### Details\n\nConvert the specified buffer to a stream of bytes and then save to the file. The buffer could be various data types. If an error occurs, an IOException is raised. Otherwise, the function returns the number of elements (not the number of bytes) written.\n\nThe `read!` function reads a given number of elements to the buffer. For example, if the buffer is an INT vector, the function will convert the bytes from the file to INT. Both `write` and `read!` function involve the conversion between streams of bytes and multi-byte words, which is termed as endianness in computer science. The big endianness has the most significant byte in the lowest address whereas the little endianness has the least significant byte in the lowest address. The `write` function always uses the endianness of the operating system. The `read!` function can convert the endianness if the endianness of the file is different from the one of the operating system. When one uses the `file` function to open a file, there is an optional boolean argument to indicate if the file adopts the little endian format. By default, it is the endianness of the operating system.\n\n#### Parameters\n\n**handle** is a handle that points to the target file.\n\n**object** is the object to be written which can be various data types.\n\n**offset** (optional) is an integer indicating the position in *object* from which to start writing. Its default value is 0.\n\n**length**(optional) is an integer indicating the number of elements to be written. If not specified, all elements will be written starting from *offset*.\n\n#### Returns\n\nA scalar of LONG type.\n\n#### Examples\n\n```\nx=10h\ny=0h\nfile(\"test.bin\",\"w\").write(x);\n// output: 1\n\nfile(\"test.bin\",\"r\",true).read!(y);\n// output: 1\n\n// assume the file format is little endianness\ny;\n// output: 10\n\nfile(\"test.bin\",\"r\",false).read!(y);\n// output: 1\n\n// assume the file format is big endianness\ny;\n// output: 2560\n```\n"
    },
    "writeBytes": {
        "url": "https://docs.dolphindb.com/en/Functions/w/writeBytes.html",
        "signatures": [
            {
                "full": "writeBytes(handle, bytes)",
                "name": "writeBytes",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "bytes",
                        "name": "bytes"
                    }
                ]
            }
        ],
        "markdown": "### [writeBytes](https://docs.dolphindb.com/en/Functions/w/writeBytes.html)\n\n\n\n#### Syntax\n\nwriteBytes(handle, bytes)\n\n#### Details\n\nWrite the entire buffer to the file. The buffer must be a char scalar or char vector. If the operation succeeds, it returns the actual number of bytes written; otherwise, an IOException will be raised.\n\n#### Parameters\n\n**handle** is a handle object that points to the target file.\n\n**object** is a CHAR scalar/vector, indicating the object to be written.\n\n#### Returns\n\nAn integer scalar.\n\n#### Examples\n\n```\n// define a file copy function\ndef fileCopy(source, target){\n   s = file(source)\n   len = s.seek(0,TAIL)\n   s.seek(0,HEAD)\n   t = file(target,\"w\")\n   if(len==0) return\n   do{\n       buf = s.readBytes(min(len,1024))\n       t.writeBytes(buf)\n       len -= buf.size()\n   }while(len)\n};\n\nfileCopy(\"test.txt\",\"testcopy.txt\");\n```\n"
    },
    "writeLine": {
        "url": "https://docs.dolphindb.com/en/Functions/w/writeLine.html",
        "signatures": [
            {
                "full": "writeLine(handle, line, [windowsLineEnding])",
                "name": "writeLine",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "line",
                        "name": "line"
                    },
                    {
                        "full": "[windowsLineEnding]",
                        "name": "windowsLineEnding",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [writeLine](https://docs.dolphindb.com/en/Functions/w/writeLine.html)\n\n\n\n#### Syntax\n\nwriteLine(handle, line, \\[windowsLineEnding])\n\n#### Details\n\nWrite a line to the given handle. The function will automatically append a line delimiter to the string. Thus the string shouldn't end with a line delimiter. If the operation succeeds, it returns 1; otherwise, an IOException will be raised.\n\n#### Parameters\n\n**handle** is a handle object that points to the target file or socket.\n\n**line** is a STRING scalar, indicating a line of text to be written, without requiring a newline character at the end.\n\n**windowsLineEnding** (optional) is a Boolean variable that indicates whether to force the use of Windows-style line endings (\\r\\n). If the parameter is not specified, the line ending character would be:\n\n* \\r\\n if *handle* is a socket\n\n* \\n if *handle* is a file and the operation system is not Windows\n\n* \\r\\n if *handle* is a file and the operating system is Windows\n\n#### Returns\n\nThe numeric value 1.\n\n#### Examples\n\n```\nx=`IBM`MSFT`GOOG`YHOO`ORCL\neachRight(writeLine, file(\"test.txt\",\"w\"), x);\n// output: [1,1,1,1,1]\n\nfin = file(\"test.txt\")\ndo{\n   x=fin.readLine()\n   if(x.isVoid()) break\n   print x\n}\nwhile(true);\n\n/* output:\nIBM\nMSFT\nGOOG\nYHOO\nORCL\n*/\n```\n"
    },
    "writeLines": {
        "url": "https://docs.dolphindb.com/en/Functions/w/writeLines.html",
        "signatures": [
            {
                "full": "writeLines(handle, object, [offset=0], [length], [windowsLineEnding])",
                "name": "writeLines",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "object",
                        "name": "object"
                    },
                    {
                        "full": "[offset=0]",
                        "name": "offset",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[length]",
                        "name": "length",
                        "optional": true
                    },
                    {
                        "full": "[windowsLineEnding]",
                        "name": "windowsLineEnding",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [writeLines](https://docs.dolphindb.com/en/Functions/w/writeLines.html)\n\n\n\n#### Syntax\n\nwriteLines(handle, object, \\[offset=0], \\[length], \\[windowsLineEnding])\n\n#### Details\n\nWrite a given number of lines to the handle.\n\n#### Parameters\n\n**length** is the number of lines from the handle to read.\n\n#### Returns\n\nAn integer scalar indicating the number of rows written successfully.\n\n#### Examples\n\n```\ntimer(10){\n   x=rand(`IBM`MSFT`GOOG`YHOO`ORCL,10240)\n   eachRight(writeLine, file(\"test.txt\",\"w\"),x)\n   fin = file(\"test.txt\")\n   do{ y=fin.readLine() } while(!y.isVoid())\n    fin.close()\n};\n\n// Time elapsed: 277.548 ms\n\ntimer(10){\n   x=rand(`IBM`MSFT`GOOG`YHOO`ORCL,10240)\n   file(\"test.txt\",\"w\").writeLines(x)\n   fin = file(\"test.txt\")\n   do{ y=fin.readLines(1024) } while(y.size()==1024)\n   fin.close()\n};\n\n// Time elapsed: 28.003 ms\n```\n"
    },
    "writeLog": {
        "url": "https://docs.dolphindb.com/en/Functions/w/writeLog.html",
        "signatures": [
            {
                "full": "writeLog(X1, [X2, X3….Xn])",
                "name": "writeLog",
                "parameters": [
                    {
                        "full": "X1",
                        "name": "X1"
                    },
                    {
                        "full": "[X2",
                        "name": "[X2"
                    },
                    {
                        "full": "X3….Xn]",
                        "name": "X3….Xn]"
                    }
                ]
            }
        ],
        "markdown": "### [writeLog](https://docs.dolphindb.com/en/Functions/w/writeLog.html)\n\n\n\n#### Syntax\n\nwriteLog(X1, \\[X2, X3….Xn])\n\n#### Details\n\nWrite a message into the log file. It must be executed by a logged-in user.\n\n#### Parameters\n\n**X1**, **X2**, **X3** ... **Xn** are the strings to be written into the log file. Each string is a line in the log file.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nwriteLog(\"This is a message written into the log file.\")\nwriteLog(\"line1.\",\"line2.\",\"line3\");\n\n// Check the log file.\n/* output:\nSun Aug 06 16:41:05 2017 <INFO> :This is a message written into the log file.\nSun Aug 06 16:50:35 2017 <INFO> :line1.\nSun Aug 06 16:50:35 2017 <INFO> :line2.\nSun Aug 06 16:50:35 2017 <INFO> :line3\n*/\n```\n"
    },
    "writeLogLevel": {
        "url": "https://docs.dolphindb.com/en/Functions/w/writeLogLevel.html",
        "signatures": [
            {
                "full": "writeLogLevel(level, X1, [X2, X3,...,Xn])",
                "name": "writeLogLevel",
                "parameters": [
                    {
                        "full": "level",
                        "name": "level"
                    },
                    {
                        "full": "X1",
                        "name": "X1"
                    },
                    {
                        "full": "[X2",
                        "name": "[X2"
                    },
                    {
                        "full": "X3",
                        "name": "X3"
                    },
                    {
                        "full": "...",
                        "name": "..."
                    },
                    {
                        "full": "Xn]",
                        "name": "Xn]"
                    }
                ]
            }
        ],
        "markdown": "### [writeLogLevel](https://docs.dolphindb.com/en/Functions/w/writeLogLevel.html)\n\n\n\n#### Syntax\n\nwriteLogLevel(level, X1, \\[X2, X3,...,Xn])\n\n#### Details\n\nThe command writes logs of the specified level to the log files. It can only be called by an administrator.\n\n**Note:** The specified *level* must be equal to or higher than the log level configured by the *logLevel* parameter or set by the `setLogLevel` function, otherwise the logs will not be written to the log file.\n\n#### Parameters\n\n**level** indicates the log level. It accepts these values in ascending order of importance: DEBUG (0), INFO (1), WARNING (2), and ERROR (3).\n\n**X1**, **X2**, **X3**, ... **Xn** is the content to be written to the log file. Each *Xi* is a line in the log file. The following data types are supported: Logical, Integral, Temporal, Floating, Literal, and Decimal.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\nwriteLogLevel(INFO,111111111111,\"This is an INFO message\") \n// Check the log file.\n<INFO> :111111111111\n<INFO> :This is an INFO message\n```\n\nRelated functions: [writeLog](https://docs.dolphindb.com/en/Functions/w/writeLog.html), [setLogLevel](https://docs.dolphindb.com/en/Functions/s/setLogLevel.html)\n"
    },
    "writeObject": {
        "url": "https://docs.dolphindb.com/en/Functions/w/writeObject.html",
        "signatures": [
            {
                "full": "writeObject(handle, object)",
                "name": "writeObject",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "object",
                        "name": "object"
                    }
                ]
            }
        ],
        "markdown": "### [writeObject](https://docs.dolphindb.com/en/Functions/w/writeObject.html)\n\n\n\n#### Syntax\n\nwriteObject(handle, object)\n\n#### Details\n\nCan write all data structures including scalar, vector, matrix, set, dictionary and table to the handle. It must be executed by a logged-in user.\n\n#### Returns\n\nNone.\n\n#### Examples\n\n```\na1=10.5\na2=1..10\na3=cross(*,1..5,1..10)\na4=set(`IBM`MSFT`GOOG`YHOO)\na5=dict(a4.keys(),125.6 53.2 702.3 39.7)\na6=table(1 2 3 as id, `Jenny`Tom`Jack as name)\na7=(1 2 3, \"hello world!\", 25.6);\nfout=file(\"test.bin\",\"w\")\nfout.writeObject(a1)\nfout.writeObject(a2)\nfout.writeObject(a3)\nfout.writeObject(a4)\nfout.writeObject(a5)\nfout.writeObject(a6)\nfout.writeObject(a7)\nfout.close();\n```\n"
    },
    "writeRecord": {
        "url": "https://docs.dolphindb.com/en/Functions/w/writeRecord.html",
        "signatures": [
            {
                "full": "writeRecord(handle, object, [offset=0], [length])",
                "name": "writeRecord",
                "parameters": [
                    {
                        "full": "handle",
                        "name": "handle"
                    },
                    {
                        "full": "object",
                        "name": "object"
                    },
                    {
                        "full": "[offset=0]",
                        "name": "offset",
                        "optional": true,
                        "default": "0"
                    },
                    {
                        "full": "[length]",
                        "name": "length",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [writeRecord](https://docs.dolphindb.com/en/Functions/w/writeRecord.html)\n\n\n\n#### Syntax\n\nwriteRecord(handle, object, \\[offset=0], \\[length])\n\n#### Details\n\nConvert DolphinDB objects such as tables or tuples to binary files. The function returns with the number of rows written to *handle*.\n\n#### Parameters\n\n**handle** is a binary file handle.\n\n**object** is a table or a tuple with array elements of equal sizes.\n\n**offset** (optional) specifies the starting row position.\n\n**length** (optional) indicates the number of rows to be written.\n\n#### Returns\n\nAn integer scalar indicating the number of rows written to the file.\n\n#### Examples\n\n```\nt=table(1..10000 as id, 1..10000+100 as value);\n\nf1=file(\"C:/DolphinDB/a.bin\", \"w\");\nf1.writeRecord(t);\n// output: 10000\n\nf2=file(\"C:/DolphinDB/b.bin\", \"w\");\nf2.writeRecord(t, 100, 1000);\n// output: 1000\n\nf3=file(\"C:/DolphinDB/c.bin\", \"w\");\nf3.writeRecord(t, 100, 10000);\n// output: The optional argument length is invalid.\n```\n"
    },
    "wslr": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wslr.html",
        "signatures": [
            {
                "full": "wslr(Y, X, W, [mse=false])",
                "name": "wslr",
                "parameters": [
                    {
                        "full": "Y",
                        "name": "Y"
                    },
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "W",
                        "name": "W"
                    },
                    {
                        "full": "[mse=false]",
                        "name": "mse",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [wslr](https://docs.dolphindb.com/en/Functions/w/wslr.html)\n\n#### Syntax\n\nwslr(Y, X, W, \\[mse=false])\n\n#### Details\n\n`wslr` (weighted single linear regression) calculates the weighted linear regression of *Y* on *X*.\n\n**Return value**: A tuple, containing the intercept *alpha*, regression coefficients *beta*, and mean squared error *mse* (if *mse*set to true).\n\n![](https://docs.dolphindb.com/en/images/wslr1.svg)\n\n![](https://docs.dolphindb.com/en/images/wslr2.svg)\n\nwhere *n* is the number of non-empty values.\n\nComparing `wls` and `wlsr`:\n\n* `wls` returns a vector, while `wslr` returns a tuple.\n\n* `wls` is a vector function, while `wslr` is an aggregate function.\n\n* Only `wls` can be applied to DFS tables.\n\n#### Parameters\n\n**Y** is a numeric vector indicating the dependent variable.\n\n**X**is a numeric vector indicating the independent variable.\n\n**W** is a numeric vector indicating the weights, where all elements are non-negative.\n\nThe length of *Y*, *X*and *W*must be equal.\n\n**mse** (optional) is a Boolean scalar specifying whether to output the mean squared error (mse). The default value is false.\n\n#### Returns\n\nA tuple.\n\n#### Examples\n\n```\nx = [0.78,0.38,0.2,0.52,0.12,0.49,0.02,0.67,0.94,0.85]\ny = [0.11,0.63,0.19,0.36,0.02,0.35,0.98,0.07,0.55,0.43]\nw = [0.05665,0.155172,0.142857,0.236453,0.125616,0.061576,0.064039,0.051724,0.004926,0.100985]\nwslr(y,x,w)\n//output: (0.385342531009792,-0.076256407696962)\nwslr(y,x,w,true)\n//output: (0.385342531009792,-0.076256407696962,0.007842049148797)\n```\n\nSince `wls` is a vector function, it cannot be directly used with `moving` but requires a user-defined function. `wlsr`, on the other hand, can be directly combined with `moving`.\n\n```\ns = [\"001\",\"002\",\"003\",\"004\",\"005\",\"006\",\"007\",\"008\",\"009\",\"010\"]\ny = [0.2531,0.5672,0.8347,0.6436,0.699,0.3732,0.0676,0.9129,0.0167,0.755]\nx = [0.5782,0.8064,0.5035,0.7857,0.5955,0.4156,0.7609,0.093,0.6504,0.9092]\nw = [0,0.095909021199675,0.195930114343433,0.300024080233914,0.408136784222979]\n\nt = table(s,y,x)\nselect moving(wslr{,,w,true},[y,x],5,5) as `alpha`beta`mse from t\n```\n\n<table id=\"table_itl_gcs_z1c\"><thead><tr><th>\n\nalpha\n\n</th><th>\n\nbeta\n\n</th><th>\n\nmse\n\n</th></tr></thead><tbody><tr><td>\n\n</td><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\n</td><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\n</td><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\n</td><td>\n\n</td><td>\n\n</td></tr><tr><td>\n\n1.0968659790128028\n\n</td><td>\n\n-0.6117304039349463\n\n</td><td>\n\n0.0004078518285504836\n\n</td></tr><tr><td>\n\n0.14198850512877909\n\n</td><td>\n\n0.7741808484080007\n\n</td><td>\n\n0.005713017371341482\n\n</td></tr><tr><td>\n\n0.7303333678486678\n\n</td><td>\n\n-0.6250737654103594\n\n</td><td>\n\n0.01852879218352463\n\n</td></tr><tr><td>\n\n1.0082522818242372\n\n</td><td>\n\n-1.1740015481453143\n\n</td><td>\n\n0.006523442161727362\n\n</td></tr><tr><td>\n\n1.0214599029781481\n\n</td><td>\n\n-1.4342061326057263\n\n</td><td>\n\n0.002086531347398113\n\n</td></tr><tr><td>\n\n0.6657822330605759\n\n</td><td>\n\n-0.25445296261591593\n\n</td><td>\n\n0.04738923724610222\n\n</td></tr></tbody>\n</table>\n\n"
    },
    "wsum": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wsum.html",
        "signatures": [
            {
                "full": "wsum(X, Y)",
                "name": "wsum",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [wsum](https://docs.dolphindb.com/en/Functions/w/wsum.html)\n\n\n\n#### Syntax\n\nwsum(X, Y)\n\n#### Details\n\nReturn the inner product of two vectors with the same length.\n\nPlease note that the data type of the result is DOUBLE, even if both *X* and *Y* are integers.\n\n#### Parameters\n\n**X** / **Y** can be a scalar, vector, matrix or table.\n\n#### Returns\n\nA scalar/vector/table of the DOUBLE type.\n\n#### Examples\n\n```\nwsum(7 8 9, 1 2 3);\n// output: 50\n// 7*1 + 8*2 + 9*3 = 50\n```\n\nRelated function: [wavg](https://docs.dolphindb.com/en/Functions/w/wavg.html)\n"
    },
    "wsum2": {
        "url": "https://docs.dolphindb.com/en/Functions/w/wsum2.html",
        "signatures": [
            {
                "full": "wsum2(X, Y)",
                "name": "wsum2",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [wsum2](https://docs.dolphindb.com/en/Functions/w/wsum2.html)\n\n\n\n#### Syntax\n\nwsum2(X, Y)\n\n#### Details\n\n`wsum2` returns the weighted sum of squares of *X* and *Y*.\n\nPlease note that the data type of the result is DOUBLE, even if both *X* and *Y* are integers.\n\n#### Parameters\n\n**X** / **Y** can be a scalar, vector, matrix or table.\n\n#### Returns\n\nA scalar/vector/table of the DOUBLE type.\n\n#### Examples\n\n```\nwsum2(3 4 1, 1 2 3);\n// output: 44\n// 9*1 + 16*2 + 1*3 = 44\n```\n\nRelated: [wsum](https://docs.dolphindb.com/en/Functions/w/wsum.html)\n"
    },
    "xdb": {
        "url": "https://docs.dolphindb.com/en/Functions/x/xdb.html",
        "signatures": [
            {
                "full": "xdb(siteAlias, [userId], [password], [enableSSL=false])",
                "name": "xdb",
                "parameters": [
                    {
                        "full": "siteAlias",
                        "name": "siteAlias"
                    },
                    {
                        "full": "[userId]",
                        "name": "userId",
                        "optional": true
                    },
                    {
                        "full": "[password]",
                        "name": "password",
                        "optional": true
                    },
                    {
                        "full": "[enableSSL=false]",
                        "name": "enableSSL",
                        "optional": true,
                        "default": "false"
                    }
                ]
            },
            {
                "full": "xdb(host, port, [userId], [password], [enableSSL=false])",
                "name": "xdb",
                "parameters": [
                    {
                        "full": "host",
                        "name": "host"
                    },
                    {
                        "full": "port",
                        "name": "port"
                    },
                    {
                        "full": "[userId]",
                        "name": "userId",
                        "optional": true
                    },
                    {
                        "full": "[password]",
                        "name": "password",
                        "optional": true
                    },
                    {
                        "full": "[enableSSL=false]",
                        "name": "enableSSL",
                        "optional": true,
                        "default": "false"
                    }
                ]
            }
        ],
        "markdown": "### [xdb](https://docs.dolphindb.com/en/Functions/x/xdb.html)\n\n\n\n#### Syntax\n\nxdb(siteAlias, \\[userId], \\[password], \\[enableSSL=false])\n\nor\n\nxdb(host, port, \\[userId], \\[password], \\[enableSSL=false])\n\n#### Details\n\nConnect to a remote site. This remote site must be on. If the connection is successful, it returns the handle of the remote connection.\n\nSince DolphinDB 2.00.10.10, users can determine whether to limit the number of failed login attempts by setting the configuration *enhancedSecurityVerification*. If it is not specified, no limit will be applied; if it is set to true, a user's account will be blocked for 10 minutes if the password is entered wrongly 5 times in a minute.\n\n#### Parameters\n\n**siteAlias** is the alias of the remote node. It needs to be defined in configuration.\n\n**host** is the host name (IP address or website) of the remote node.\n\n**port** is an integral indicating the port number of the remote node.\n\n**userId** and **password** (optional) are based on the user's profile. They are used if the administrator has enabled [UserAccessControl](https://docs.dolphindb.com/en/Maintenance/UserAccessControl.html).\n\n**enableSSL** (optional) is a boolean value determining whether to use the SSL protocol for encrypted communication. The default value is false.\n\n#### Returns\n\nIt returns the handle of the remote connection.\n\n#### Examples\n\n```\nh2=xdb(\"local8081\");\nh2;\n// output: \"Conn[localhost:8081:1166953221]\"\n\nh21=xdb(\"localhost\",8081);\nh21;\n// output: \"Conn[localhost:8081:1441295757]\"\n\nh4=xdb(\"local8083\",\"userAdm\",\"passAdm\");\nh4;\n// output: \"Conn[localhost:8083:1166953221]\"\n\nh41=xdb(\"localhost\",8083, \"user001\",\"pass001\");\nh41;\n// output: \"Conn[localhost:8083:597793698]\"\n```\n"
    },
    "xor": {
        "url": "https://docs.dolphindb.com/en/Functions/x/xor.html",
        "signatures": [
            {
                "full": "xor(X, Y)",
                "name": "xor",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "Y",
                        "name": "Y"
                    }
                ]
            }
        ],
        "markdown": "### [xor](https://docs.dolphindb.com/en/Functions/x/xor.html)\n\n\n\n#### Syntax\n\nxor(X, Y)\n\n#### Details\n\nPair each elements in *X* and *Y* to perform the \"exclusive or\" operation.\n\n#### Parameters\n\n**X** and **Y** can be a scalar, pair, vector or matrix.\n\n#### Returns\n\nIt returns a Boolean scalar, pair, vector, matrix, or table representing the result of the logical XOR operation between *X* and *Y*.\n\n#### Examples\n\n```\n1 xor 0\n// output: 1\n\nx = 5 6 7\nx xor 0\n// output: [1,1,1]\n\nx = 1 2 3\ny = 2 1 3\nx xor y\n// output: [0,0,0]\n\ntrue xor false\n// output: 1\n```\n\nRelated function: [or](https://docs.dolphindb.com/en/Programming/Operators/OperatorReferences/or.html), [not](https://docs.dolphindb.com/en/Functions/n/not.html)\n"
    },
    "year": {
        "url": "https://docs.dolphindb.com/en/Functions/y/year.html",
        "signatures": [
            {
                "full": "year(X)",
                "name": "year",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [year](https://docs.dolphindb.com/en/Functions/y/year.html)\n\n\n\n#### Syntax\n\nyear(X)\n\n#### Details\n\nReturn the corresponding year(s).\n\n#### Parameters\n\n**X** is a temporal scalar/vector.\n\n#### Returns\n\nA scalar or vector of the INT type.\n\n#### Examples\n\n```\nyear(2012.12.03);\n// output: 2012\n\nyear(2012.12.03 2011.11.05);\n// output: [2012,2011]\n\n(2012.12.03).year();\n// output: 2012\n```\n\nRelated functions: [second](https://docs.dolphindb.com/en/Functions/s/second.html), [minute](https://docs.dolphindb.com/en/Functions/m/minute.html), [hour](https://docs.dolphindb.com/en/Functions/h/hour.html), [date](https://docs.dolphindb.com/en/Functions/d/date.html), [month](https://docs.dolphindb.com/en/Functions/m/month.html)\n"
    },
    "yearBegin": {
        "url": "https://docs.dolphindb.com/en/Functions/y/yearBegin.html",
        "signatures": [
            {
                "full": "yearBegin(X, [startingMonth=1], [offset], [n=1])",
                "name": "yearBegin",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[startingMonth=1]",
                        "name": "startingMonth",
                        "optional": true,
                        "default": "1"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [yearBegin](https://docs.dolphindb.com/en/Functions/y/yearBegin.html)\n\n\n\n#### Syntax\n\nyearBegin(X, \\[startingMonth=1], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the first day of the year that *X* belongs to and that starts in the month of *startingMonth*.\n\nBy default, each period corresponds to one year, and the function returns the first day of the year containing *X*. The starting month of the year is determined by the *startingMonth* parameter.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period start dates based on n-year periods. In this case, *offset* determines how multi-year periods are aligned. Specifically, the system first calculates the start date of the year containing *offset* according to *startingMonth*, and uses that date as the reference point. A new period start boundary is then generated every *n* years, and the function returns the first day corresponding to the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**startingMonth** (optional) is an integer between 1 and 12 indicating a month. The default value is 1.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\n```\nyearBegin(2012.06.12, 10);\n// output: 2011.10.01\n\nyearBegin(2012.06.12, 4);\n// output: 2012.04.01\n\nyearBegin(2012.06.12);\n// output: 2012.01.01\n\nyearBegin(2012.06.12, 1, 2009.04.03, 2);\n// output: 2011.01.01\n\ndate=2011.04.25+(1..10)*365\ntime = take(09:30:00, 10);\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2012.04.24 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2013.04.24 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2014.04.24 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2015.04.24 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.04.23 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2017.04.23 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2018.04.23 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2019.04.23 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2020.04.22 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2021.04.22 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by yearBegin(date, 10, 2010.10.01, 2);\n```\n\n| yearBegin\\_date | avg\\_price | sum\\_qty |\n| --------------- | ---------- | -------- |\n| 2010.10.01      | 49.6       | 2200     |\n| 2012.10.01      | 29.49      | 4000     |\n| 2014.10.01      | 102.495    | 10000    |\n| 2016.10.01      | 112.995    | 6700     |\n| 2018.10.01      | 50.805     | 11300    |\n| 2020.10.01      | 52.38      | 4500     |\n\nRelated functions: [yearEnd](https://docs.dolphindb.com/en/Functions/y/yearEnd.html), [businessYearBegin](https://docs.dolphindb.com/en/Functions/b/businessYearBegin.html), [businessYearEnd](https://docs.dolphindb.com/en/Functions/b/businessYearEnd.html)\n"
    },
    "yearEnd": {
        "url": "https://docs.dolphindb.com/en/Functions/y/yearEnd.html",
        "signatures": [
            {
                "full": "yearEnd(X, [endingMonth=12], [offset], [n=1])",
                "name": "yearEnd",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[endingMonth=12]",
                        "name": "endingMonth",
                        "optional": true,
                        "default": "12"
                    },
                    {
                        "full": "[offset]",
                        "name": "offset",
                        "optional": true
                    },
                    {
                        "full": "[n=1]",
                        "name": "n",
                        "optional": true,
                        "default": "1"
                    }
                ]
            }
        ],
        "markdown": "### [yearEnd](https://docs.dolphindb.com/en/Functions/y/yearEnd.html)\n\n\n\n#### Syntax\n\nyearEnd(X, \\[endingMonth=12], \\[offset], \\[n=1])\n\n#### Details\n\nReturn the last day of the year that *X* belongs to and that ends in the month of *endingMonth*.\n\nBy default, each period corresponds to one year, and the function returns the last day of the year containing *X*. The ending month of the year is determined by the *endingMonth* parameter.\n\nWhen both *offset* and *n* are specified and *n* > 1, the function calculates period end dates based on n-year periods. In this case, *offset* determines how multi-year periods are aligned. Specifically, the system first calculates the end date of the year containing *offset* according to *endingMonth*, and uses that date as the reference point. A new period end boundary is then generated every *n* years, and the function returns the last day corresponding to the period to which *X* belongs.\n\n#### Parameters\n\n**X** is a scalar/vector of data type DATE, DATEHOUR, DATETIME, TIMESTAMP or NANOTIMESTAMP.\n\n**endingMonth** (optional) is an integer between 1 and 12 indicating a month. The default value is 12.\n\n**offset** (optional) is a scalar of the same data type as *X*. It must be no greater than the minimum value of *X*. The default value is the minimum value of *X*.\n\n**n** (optional) is a positive integer. The default value is 1.\n\n#### Returns\n\nA scalar or vector of the DATE type.\n\n#### Examples\n\n```\nyearEnd(2012.06.12, 3);\n// output: 2013.03.31\n\nyearEnd(2012.06.12, 9);\n// output: 2012.09.30\n\nyearEnd(2012.06.12);\n// output: 2012.12.31\n\nyearEnd(2012.06.12, 12, 2009.04.03, 2);\n// output: 2013.12.31\n\ndate=2011.04.25+(1..10)*365\ntime = take(09:30:00, 10);\nsym = take(`MSFT,10)\nprice= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29 52.38\nqty = 2200 1900 2100 3200 6800 5400 1300 2500 8800 4500\nt1 = table(date, time, sym, qty, price);\n\nt1;\n```\n\n| date       | time     | sym  | qty  | price  |\n| ---------- | -------- | ---- | ---- | ------ |\n| 2012.04.24 | 09:30:00 | MSFT | 2200 | 49.6   |\n| 2013.04.24 | 09:30:00 | MSFT | 1900 | 29.46  |\n| 2014.04.24 | 09:30:00 | MSFT | 2100 | 29.52  |\n| 2015.04.24 | 09:30:00 | MSFT | 3200 | 30.02  |\n| 2016.04.23 | 09:30:00 | MSFT | 6800 | 174.97 |\n| 2017.04.23 | 09:30:00 | MSFT | 5400 | 175.23 |\n| 2018.04.23 | 09:30:00 | MSFT | 1300 | 50.76  |\n| 2019.04.23 | 09:30:00 | MSFT | 2500 | 50.32  |\n| 2020.04.22 | 09:30:00 | MSFT | 8800 | 51.29  |\n| 2021.04.22 | 09:30:00 | MSFT | 4500 | 52.38  |\n\n```\nselect avg(price),sum(qty) from t1 group by yearEnd(date, 4, 2010.04.01, 2);\n```\n\n| yearEnd\\_date | avg\\_price | sum\\_qty |\n| ------------- | ---------- | -------- |\n| 2012.04.30    | 49.6       | 2200     |\n| 2014.04.30    | 29.49      | 4000     |\n| 2016.04.30    | 102.495    | 10000    |\n| 2018.04.30    | 112.995    | 6700     |\n| 2020.04.30    | 50.805     | 11300    |\n| 2022.04.30    | 52.38      | 4500     |\n\nRelated functions: [yearBegin](https://docs.dolphindb.com/en/Functions/y/yearBegin.html), [businessYearBegin](https://docs.dolphindb.com/en/Functions/b/businessYearBegin.html), [businessYearEnd](https://docs.dolphindb.com/en/Functions/b/businessYearEnd.html)\n"
    },
    "yearFrac": {
        "url": "https://docs.dolphindb.com/en/Functions/y/yearFrac.html",
        "signatures": [
            {
                "full": "yearFrac(dayCountConvention, start, end, [referenceStart], [referenceEnd])",
                "name": "yearFrac",
                "parameters": [
                    {
                        "full": "dayCountConvention",
                        "name": "dayCountConvention"
                    },
                    {
                        "full": "start",
                        "name": "start"
                    },
                    {
                        "full": "end",
                        "name": "end"
                    },
                    {
                        "full": "[referenceStart]",
                        "name": "referenceStart",
                        "optional": true
                    },
                    {
                        "full": "[referenceEnd]",
                        "name": "referenceEnd",
                        "optional": true
                    }
                ]
            }
        ],
        "markdown": "### [yearFrac](https://docs.dolphindb.com/en/Functions/y/yearFrac.html)\n\nFirst introduced in version: 3.00.5\n\n\n\n#### Syntax\n\nyearFrac(dayCountConvention, start, end, \\[referenceStart], \\[referenceEnd])\n\n#### Details\n\nCalculates the year fraction between dates *start* and *end* using the specified day count convention. This value is commonly used in financial calculations such as interest accrual, discounting, and option pricing.\n\n#### Parameters\n\n**dayCountConvention**is a STRING scalar indicating the day count convention to use. It can be:\n\n* \"ActualActualISMA\": actual/actual (ISMA rule)\n* \"Actual360\": actual/360\n* \"Actual365\": actual/365\n* \"ActualActualISDA\": actual/actual (ISDA rule)\n\n**start**is a DATE scalar, indicating the start date of the calculation period.\n\n**end**is a DATE scalar, indicating the end date of the calculation period.\n\n**referenceStart** (optional) is a DATE scalar, indicating the start date of the standard coupon period to which the accrual interval belongs. This parameter is only applicable when *dayCountConvention* is set to \"ActualActualISMA\".\n\n**referenceEnd** (optional) is a DATE scalar, indicating the end date of the standard coupon period to which the accrual interval belongs. This parameter is only applicable when *dayCountConvention* is set to \"ActualActualISMA\".\n\n#### Returns\n\nA DOUBLE scalar.\n\n#### Examples\n\nFor instruments with fixed coupon periods (such as semi-annual coupon bonds), the ActualActualISMA day count convention requires *referenceStart* and *referenceEnd* to define the standard coupon period to which the accrual interval belongs.\n\nAssume a bond pays coupons semi-annually, with a coupon period defined as: January 1, 2025 to July 1, 2025. The year fraction for a portion of this coupon period is calculated as follows:\n\n```\nstart =  2025.02.15\nend = 2025.05.15\nreferenceStart = 2025.01.01\nreferenceEnd = 2025.07.01\nyearFrac(\"ActualActualISMA\", start, end, referenceStart, referenceEnd)\n\n// output: 0.25\n```\n"
    },
    "zigzag": {
        "url": "https://docs.dolphindb.com/en/Functions/z/zigzag.html",
        "signatures": [
            {
                "full": "zigzag(HL, [change=10], [percent=true], [retrace=false], [lastExtreme=true])",
                "name": "zigzag",
                "parameters": [
                    {
                        "full": "HL",
                        "name": "HL"
                    },
                    {
                        "full": "[change=10]",
                        "name": "change",
                        "optional": true,
                        "default": "10"
                    },
                    {
                        "full": "[percent=true]",
                        "name": "percent",
                        "optional": true,
                        "default": "true"
                    },
                    {
                        "full": "[retrace=false]",
                        "name": "retrace",
                        "optional": true,
                        "default": "false"
                    },
                    {
                        "full": "[lastExtreme=true]",
                        "name": "lastExtreme",
                        "optional": true,
                        "default": "true"
                    }
                ]
            }
        ],
        "markdown": "### [zigzag](https://docs.dolphindb.com/en/Functions/z/zigzag.html)\n\n\n\n#### Syntax\n\nzigzag(HL, \\[change=10], \\[percent=true], \\[retrace=false], \\[lastExtreme=true])\n\n#### Details\n\n`zigzag` is mainly used to filter values with smaller movements in *HL*. Only extreme points that satisfy the conditions will be output.\n\n#### Parameters\n\n**HL** is a numeric vector or a numeric matrix with two columns.\n\n**change** (optional) is the minimum threshold for extreme value movement.\n\n**percent** (optional) is a Boolean value indicating whether *change* is used as a percentage.\n\n**retrace** (optional) is a Boolean value. The default value is false.\n\n* true: *change* represents a retracement of the previous move.\n\n* false: *change* represents the change between the extreme points.\n\nNote: If *percent*=false, *retrace* can only take \"false\". Setting it to true has no effect.\n\n**lastExtreme** (optional) is a Boolean value indicating whether to output the last point if multiple consecutive points have the same value. The default value is true.\n\n#### Returns\n\nIf *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*.\n\n#### Examples\n\n```\nt = table(1.1 2.3 4.45 3.67 4.9 as `low, 1.3 2.8 4.9 3.73 6.28 as `high)\nHL = matrix(t[`low], t[`high])\nzz = zigzag(HL, change=10, percent=true, retrace=false, lastExtreme=true)\n```\n\n| 0   | 1 | 2    | 3    | 4   |\n| --- | - | ---- | ---- | --- |\n| 1.2 |   | 4.45 | 3.73 | 4.9 |\n\n```\nHL = 1.2 3 3.1 14 14.5 14.7 25.0 17.8 19 10\nzz = zigzag(HL, change=10, percent=true, retrace=false, lastExtreme=true)\n```\n\n| 0   | 1 | 2 | 3 | 4 | 5 | 6  | 7 | 8 | 9  |\n| --- | - | - | - | - | - | -- | - | - | -- |\n| 1.2 |   |   |   |   |   | 25 |   |   | 10 |\n"
    },
    "zscore": {
        "url": "https://docs.dolphindb.com/en/Functions/z/zscore.html",
        "signatures": [
            {
                "full": "zscore(X)",
                "name": "zscore",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    }
                ]
            }
        ],
        "markdown": "### [zscore](https://docs.dolphindb.com/en/Functions/z/zscore.html)\n\n\n\n#### Syntax\n\nzscore(X)\n\n#### Details\n\nIf *X* is a vector, return the zscore for all elements of *X*.\n\nIf *X* is a matrix or table, the zscore calculation is conducted within each column of *X*.\n\nAs with all aggregate functions, null values are not included in the calculation.\n\n**Note:**\n\nDolphinDB `zscore` and [scipy.stats.zscore](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.zscore.html) are both used to calculate standard scores (Z-scores). The differences are as follows:\n\n* DolphinDB `zscore` uses the sample standard deviation for calculation, while `scipy.stats.zscore` uses the population standard deviation by default. To obtain results consistent with DolphinDB `zscore`, you should specify *ddof*=1.\n* DolphinDB `zscore` automatically ignores NULL values, whereas `scipy.stats.zscore` propagates NaN values by default. To ignore missing values, you should specify *nan\\_policy*='omit'.\n* DolphinDB `zscore` supports only one parameter, *X*, while `scipy.stats.zscore` provides more flexible control over calculation behavior through parameters such as *axis*, *ddof*, and *nan\\_policy*.\n\n#### Parameters\n\n**X** is a vector/matrix/table.\n\n#### Returns\n\nIf *X* is a vector, a vector of the same length as *X* is returned. If *X* is a matrix or a table, a matrix or table with the same number of rows and columns as *X* is returned.\n\n#### Examples\n\n```\nzscore(1 2 3 4 5);\n// output: [-1.264911,-0.632456,0,0.632456,1.264911]\n\nm=matrix(1 2 3, 4 5 6);\nm;\n```\n\n| #0 | #1 |\n| -- | -- |\n| 1  | 4  |\n| 2  | 5  |\n| 3  | 6  |\n\n```\nzscore(m);\n```\n\n| #0 | #1 |\n| -- | -- |\n| -1 | -1 |\n| 0  | 0  |\n| 1  | 1  |\n"
    },
    "zTest": {
        "url": "https://docs.dolphindb.com/en/Functions/z/zTest.html",
        "signatures": [
            {
                "full": "zTest(X, [Y], [mu=0.0], [sigmaX=1.0], [sigmaY=1.0], [confLevel=0.95])",
                "name": "zTest",
                "parameters": [
                    {
                        "full": "X",
                        "name": "X"
                    },
                    {
                        "full": "[Y]",
                        "name": "Y",
                        "optional": true
                    },
                    {
                        "full": "[mu=0.0]",
                        "name": "mu",
                        "optional": true,
                        "default": "0.0"
                    },
                    {
                        "full": "[sigmaX=1.0]",
                        "name": "sigmaX",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[sigmaY=1.0]",
                        "name": "sigmaY",
                        "optional": true,
                        "default": "1.0"
                    },
                    {
                        "full": "[confLevel=0.95]",
                        "name": "confLevel",
                        "optional": true,
                        "default": "0.95"
                    }
                ]
            }
        ],
        "markdown": "### [zTest](https://docs.dolphindb.com/en/Functions/z/zTest.html)\n\n\n\n#### Syntax\n\nzTest(X, \\[Y], \\[mu=0.0], \\[sigmaX=1.0], \\[sigmaY=1.0], \\[confLevel=0.95])\n\n#### Details\n\nIf *Y* is not specified, conduct a one-sample Z-test on *X*. If *Y* is specified, conduct a paired-sample Z-test on *X* and *Y*.\n\n#### Parameters\n\n**X** is a numeric vector indicating the sample for the Z-test.\n\n**Y** (optional) is a numeric vector indicating the second sample for a paired-sample Z-test. It is optional.\n\n**mu** (optional) is a floating number. If *Y* is not specified, *mu* is the mean value of *X* in the null hypothesis; if *Y* is specified, *mu* is the difference in the mean values of *X* and *Y* in the null hypothesis. It is optional and the default value is 0.\n\n**sigmaX** (optional) is a floating number indicating the standard deviation of *X*. It is optional and the default value is 1.\n\n**sigmaY** (optional) is a floating number indicating the standard deviation of *Y*. It is optional and the default value is 1.\n\n**confLevel** (optional) is a floating number between 0 and 1 indicating the confidence level of the test. It is optional and the default value is 0.95.\n\n#### Returns\n\nA dictionary with the following keys:\n\n* stat: a table with p-value and confidence interval under 3 alternative hypotheses.\n\n* confLevel: confidence level\n\n* method: \"One sample Z-test\" if *Y* is not specified; \"Two sample Z-test\" if *Y* is specified.\n\n* zValue: Z-stat\n\n#### Examples\n\nOne-sample Z-test:\n\n```\nx = norm(5.0, 2.0, 30)\nzTest(x, , 5.0, 2.0);\n\n/* output:\nstat->\n\nalternativeHypothesis       pValue   lowerBound upperBound\n--------------------------- -------- ---------- -----------\ntrue mean is not equal to 5 0.035765 3.517659   4.949014\ntrue mean is less than 5    0.017882 -Infinity  4.833952\ntrue mean is greater than 5 0.982118 3.632721   Infinity\n\nconfLevel->0.95\nmethod->One sample z-test\nzValue->-2.099594\n*/\n```\n\nPaired-sample Z-test:\n\n```\nx = norm(5.0, 2.0, 30)\ny = norm(10.0, 3.0, 40)\nzTest(x, y, -5.0, 2.0, 3.0);\n\n/* output:\nstat->\n\n------------------------------------- -------- ---------- -----------\nalternativeHypothesis                 pValue   lowerBound upperBound\ndifference of mean is not equal to -5 0.976133 -6.191162  -3.844655\ndifference of mean is less than -5    0.488067 -Infinity  -4.033283\ndifference of mean is greater than -5 0.511933 -6.002533  Infinity\n\nconfLevel->0.95\nmethod->Two sample z-test\nzValue->-0.029917\n*/\n```\n"
    }
}
