函数分类
DolphinDB 的函数按照功能可以分为以下类别:
数据操作
- 数据类型与转换:array, arrayVector, bigarray, blob, bool, cast, ceil, char, complex, date, datehour, datetime, decimal32, decimal64, decimal128, decimalFormat, decimalMultiply, deg2rad, dict, double, duration, enlist, fixedLengthArrayVector, floor, form, format, fromJson, fromStdJson, hex, highDouble, highLong, indexedSeries, int, int128, ipaddr, isIndexedMatrix, isIndexedSeries, isOrderedDict, long, lowDouble, lowLong, makeKey, makeSortedKey, matrix, minute, month, nanotime, nanotimestamp, pair, parseInt, parseInteger, parsejsonTable, point, rad2deg, reverse, round, second, seq, set, setIndexedMatrix!, setIndexedSeries!, short, string, subtuple, symbol, symbolCode, syncDict, temporalFormat, temporalParse, tensor, time, timestamp, toJson, toStdJson, transpose/flip, type, typestr, uuid
- 生成: eye, panel, rollingPanel, seq, stretch, take, til
- 追加:append!/push!, appendTuple!
- 删除、清理:clear!, drop, dropna, erase!, pop!, removeHead!, removeTail!
- 查找:at, binsrch, cell, cells, col, eachAt(@), find, first, firstHit, firstNot, head, ifirstHit, ifirstNot, ilastNot, last, lastNot, loc, milastNot, row, searchK, slice, sliceByKey, subarray, tail
- 排序:denseRank, isort, isort!, isortTop, isSorted, rank, sort, sort!, sortBy!
- 空值查找、填充:bfill!, ffill, ffill!, fill!, hasNull, ifNull, ifValid, interpolate, isNanInf, isNothing, isNull, isValid, isVoid, lfill, lfill!, nanInfFill, nullFill, nullFill!
- 替换:replace, replace!
- 移动:lshift, move, next, nextState, prev, prevState, rshift
- 合并:concatMatrix, join, join!, merge, union, unionAll
- 分割:cut
- 过滤:conditionalFilter
- 对齐:align
- 展开、重组:flatten, regroup, reshape, shuffle, shuffle!, ungroup
- 分组:bar, bucket, cutPoints, dailyAlignedBar, digitize, groups, segment, volumeBar
- 加载:loadNpy, loadNpz, loadRecord, loadTable, loadText, loadTextEx, ploadText
- 编码转换:base64Decode, base64Encode, compress, decodeShortGenomeSeq, decompress, encodeShortGenomeSeq, genShortGenomeSeq, oneHot, pack, rdp, unpack
- 累积窗口:cumavg, cumbeta, cumcorr, cumcount, cumcovar, cumfirstNot, cumlastNot, cummax, cummed, cummin, cumnunique, cumpercentile, cumPositiveStreak, cumprod, cumrank, cumstd, cumstdp, cumsum, cumsum2, cumsum3, cumsum4, cumvar, cumvarp, cumwavg, cumwsum, dynamicGroupCumsum, dynamicGroupCumcount
- m 系列:mavg, mbeta, mcorr, mcount, mcovar, mfirst, mfirstNot, mifirstNot, milastNot, mimax, mimin, mkurtosis, mlast, mlastNot, mLowRange, mmad, mmax, mmaxPositiveStreak, mmed, mmin, mmse, movingTopNIndex, movingWindowIndex, mpercentile, mprod, mrank, mskew, mslr, mstd, mstdp, msum, msum2, mTopRange, mvar, mvarp, mwavg, mwsum
- tm 系列:tmavg, tmbeta, tmcorr, tmcount, tmcovar, tmfirst, tmkurtosis, tmlast, tmLowRange, tmmax, tmmed, tmmin, tmpercentile, tmprod, tmrank, tmskew, tmstd, tmstdp, tmsum, tmsum2, tmTopRange, tmvar, tmvarp, tmwavg, tmwsum
- mTopN:mavgTopN, mbetaTopN, mcorrTopN, mcovarTopN, mpercentileTopN, mstdpTopN, mstdTopN, msumTopN, mvarpTopN, mvarTopN, mwsumTopN,
- row 系列:rowAlign, rowAnd, rowAt, rowAvg, rowBeta, rowCorr, rowCount, rowCovar, rowDenseRank, rowDot, rowEuclidean, rowImax, rowImin, rowKurtosis, rowMax, rowMin, rowMove, rowNext, rowOr, rowPrev, rowProd, rowRank, rowSize, rowSkew, rowStd, rowStdp, rowSum, rowSum2, rowTanimoto, rowVar, rowVarp, rowWavg, rowWsum, rowXor
- TA-lib 系列:dema, ema, gema, kama, linearTimeTrend, ma, sma, t3, tema, trima, wilder, wma
- 字符串:charAt, concat, convertEncode, crc32, endsWith, fromUTF8, ilike, initcap, isAlNum, isAlpha, isDigit, isLower, isNumeric, isSpace, isTitle, isUpper, left, like, lower, lpad, ltrim, md5, regexCount, regexFind, regexFindStr, regexReplace, repeat, right, rpad, rtrim, split, startsWith, stringFormat, strip, strlen, strlenu, strpos, strReplace, substr, substru, toCharArray, toUTF8, trim, upper
- 时间处理:addMarketHoliday, asFreq, businessDay, businessMonthBegin, businessMonthEnd, businessQuarterBegin, businessQuarterEnd, businessYearBegin, businessYearEnd, concatDateTime, convertTZ, date, dayOfMonth, dayOfWeek, dayOfYear, daysInMonth, fy5253, fy5253Quarter, getMarketCalendar, gmtime, hour, hourOfDay, isLeapYear, isMonthEnd, isMonthStart, isQuarterEnd, isQuarterStart, isYearEnd, isYearStart, lastWeekOfMonth, localtime, microsecond, millisecond, minuteOfHour, month, monthBegin, monthEnd, monthOfYear, nanosecond, now, quarterBegin, quarterEnd, secondOfMinute, semiMonthBegin, semiMonthEnd, temporalAdd, temporalSeq, today, transFreq, updateMarketHoliday, weekBegin, weekday, weekEnd, weekOfMonth, weekOfYear, year, yearBegin, yearEnd
数据库/数据表
- 库表操作:addColumn, addFunctionView, addRangePartitions, addValuePartitions, backup, backupDB, backupTable, cacheDS!, cacheDSNow, cachedTable, checkBackup, clearAllTSDBSymbolBaseCache, clearDSCache!, clearDSCacheNow, columnNames, createDimensionTable, createDistributedInMemoryTable, createIPCInMemoryTable, createPartitionedTable, createTable, database, disableActivePartition, disableQueryMonitor, disableTSDBAsyncSorting, dropColumns!, dropDatabase, dropDistributedInMemoryTable, dropFunctionView, dropIPCInMemoryTable, dropPartition, dropTable, enableActivePartition, enableQueryMonitor, enableTSDBAsyncSorting, existsDatabase, existsPartition, existsTable, extractTextSchema, flushOLAPCache, flushTSDBCache, getAllDBGranularity, getAllDBs, getBackupList, getBackupMeta, getBackupStatus, getChunkPath, getChunksMeta, getClusterChunksStatus, getClusterDFSDatabases, getClusterDFSTables, getConfigure/getConfig, getDFSDatabases, getDFSTablesByDatabase, getFunctionViews, getLevelFileIndexCacheStatus, getMemLimitOfQueryResult, getMemLimitOfTaskGroupResult, getOLAPCacheEngineSize, getOLAPCacheEngineStat, getOLAPCachedSymbolBaseMemSize, getRecoveryTaskStatus, getRecoveryWorkerNum, getRedoLogGCStat, getTables, getTablet, getTabletsMeta, getTransactionStatus, getTSDBCachedSymbolBaseMemSize, getTSDBCacheEngineSize, getTSDBCompactionTaskStatus, getTSDBMetaData, getUnresolvedTxn, imr, indexedTable, keyedTable, latestIndexedTable, latestKeyedTable, loadBackup, loadDistributedInMemoryTable, loadIPCInMemoryTable, loadMvccTable, loadTableBySQL, migrate, mr, multiTableRepartitionDS, mvccTable, purgeCacheEngine, registerSnapshotEngine, rename!, renameTable, reorderColumns!, repartitionDS, replaceColumn!, replay, replayDS, resetRecoveryWorkerNum, restore, restoreDB, restoreTable, rowNames, rowNo, saveDatabase, saveDualPartition, savePartition, saveTable, schema, setAtomicLevel, setColumnComment, setMaxBlockSizeForReservedMemory, setMaxConnections, setMaxMemSize, setMemLimitOfQueryResult, setMemLimitOfTaskGroupResult, setMemLimitOfTempResult, setOLAPCacheEngineSize, setReservedMemSize, setTableComment, setTSDBCacheEngineSize, sqlDS, table, tableInsert, tableUpsert, textChunkDS, transDS!, triggerTSDBCompaction, truncate, tupleSum, unregisterSnapshotEngine, update!, upsert!
- catalog相关操作:createCatalog, createSchema, dropCatalog, dropSchema, existsCatalog, getAllCatalogs, getCurrentCatalog, getSchemaByCatalog, renameCatalog, renameSchema, setDefaultCatalog
- 集群操作:addNode, addVolumes, cancelRecoveryTask, copyReplicas, deleteReplicas, getActiveMaster, getActiveMaster, getConnections, getDatabaseClusterReplicationStatus, getMasterReplicationStatus, getNodeAlias, getNodeHost, getNodePort, getNodeType, getRecentSlaveReplicationInfo, getSlaveReplicationStatus, getSlaveReplicationQueueStatus, isControllerInitialized, isDataNodeInitialized, moveChunksAcrossVolume, moveReplicas, pnodeRun, rebalanceChunksAmongDataNodes, rebalanceChunksWithinDataNode, remoteRun, remoteRunCompatible, remoteRunWithCompression, removeNode, resetDBDirMeta, restoreDislocatedTablet, resumeRecovery, rpc, setDatabaseForClusterReplication, setTimeoutTick, skipClusterReplicationTask, startClusterReplication, startDataNode, stopClusterReplication, stopDataNode, suspendRecovery, triggerNodeReport, xdb
SQL
- 关键字:alter, any/all, between, case, cgroup by, coalesce, context by, create, delete, distinct, drop, exec, exists, group by, having, [HINT_EXPLAIN], in, insert into, interval, is null, like/LIKE, limit, map, nullIf, order by, partition, pivot by, sample, select, SQL Trace, top, union/union all, unpivot, update, where, with
- 表连接:aj, cj, ej, fj (full join), inner join, lj (left join), lsj (left semi join), pj, pwj, right join, sej, wj
- 状态查看:getCompletedQueries, getQueryStatus, getRunningQueries, getTraces, setTraceMode, viewTraceInfo
数学和统计
- 数学:abs, acos, acosh, add, asin, asinh, atan, atanh, cbrt, clip, clip!, cos, cosh, cholesky, derivative, diag, div, det, eig, exp, exp2, expm1, gram, gramSchmidt, integral, inverse, intersection, iterate, log, log1p, log2, log10, lu, mod, mul, neg, pow, ratio, reciprocal, repmat, sin, sinh, sqrt, square, sub, symmetricDifference, svd, tan, tanh, tril, triu, schur, signbit, signum, qr
- 统计:atImax, atImin, avg, contextSum, contextSum2, count, covar, covarMatrix, crossStat, cumnunique, demean, dot, ewmCov, ewmMean, ewmStd, ewmVar, gaussianKde, gaussianKdePredict, imax, imin, kurtosis, mad, max, maxIgnoreNull, med, mean, min, minIgnoreNull, mode, mmed, nunique, percentChange, percentile, percentileRank, prod, quantile, quantileSeries, sem, skew, std, stdp, summary, sum, sum2, sum3, sum4, stat, var, varp, wavg, wc, wcovar, wsum
- 相关性:acf, autocorr, corr, corrMatrix, distance, ewmCorr, euclidean, kendall, mutualInfo, rowEuclidean, rowTanimoto, spearmanr, tanimoto
- 序列分析:isMonotonicIncreasing/isMonotonic, isMonotonicDecreasing, isPeak, isValley, zigzag
- 机器学习:adaBoostClassifier, adaBoostRegressor, beta, elasticNet, elasticNetCV, gaussianNB, glm, gmm, kmeans, knn, lasso, lassoBasic, lassoCV, logisticRegression, mmse, msl, multinomialNB, ols, olsEx, piecewiseLinFit, poly1d, polyFit, polynomial, predict, pwlfPredict, randomForestClassifier, randomForestRegressor, residual, ridge, ridgeBasic, vectorAR, wls
- 分布与假设检验:adfuller, anova, cdfBeta, cdfBinomial, cdfChiSquare, cdfExp, cdfF, cdfGamma, cdfKolmogorov, cdfLogistic, cdfNormal, cdfPoisson, cdfStudent, cdfUniform, cdfWeibull, cdfZipf, chiSquareTest, coint, esd, fTest, invBeta, invBinomial, invChiSquare, invExp, invF, invGamma, invLogistic, invNormal, invStudent, invPoisson, invUniform, invWeibull, ksTest, mannWhitneyUTest, manova, norm/normal, rand, randBeta, randBinomial, randChiSquare, randDiscrete, randExp, randF, randGamma, randLogistic, randMultivariateNormal, randNormal, randPoisson, randStudent, randUniform, randWeibull, seasonalEsd, shapiroTest, tTest, zTest
- 数据处理:all, any, asis, asof, bucketCount, coevent, cols, copy, contextCount, countNanInf, cumPositiveStreak, deltas, dictUpdate!,distinct, dynamicGroupCumcount, dynamicGroupCumsum, hashBucket, iif, imaxLast, iminLast, isDuplicated,keys, linearTimeTrend, lowerBound, lowRange, mask, maxPositiveStreak, mimaxLast, miminLast, mmaxPositiveStreak, pca, ratios, resample, rowImaxLast, rowIminLast, rows, sessionWindow, shape, size, stl, sumbars, talibNull, tmove, topRange, valueChanged, values, winsorize!, winsorize, zscore
- 插值: cubicSpline, cubicSplinePredict, dividedDifference, kroghInterpolate, loess, neville, spline, splrep, splev
- 优化:brute, brentq, fmin, fminBFGS, fminLBFGSB, fminNCG, fminSLSQP, linprog, osqp, qclp, quadprog, scs, solve, socp
- 金融分析:bondAccrInt, bondConvexity, bondDirtyPrice, bondDuration, nss, condValueAtRisk, nsspredict, trueRange, valueAtRisk
运算符
流数据
- 流表操作:appendForJoin, appendMsg, clearTablePersistence, disableTablePersistence, dropStreamTable, enableTablePersistence, enableTableShareAndPersistence, existsStreamTable, existsSubscriptionTopic, getStreamTables, haStreamTable, keyedStreamTable, removeTopicOffset, setStreamTableFilterColumn, setStreamTableTimestamp, share, subscribeTable, unsubscribeTable, streamTable
- 计算引擎:createAnomalyDetectionEngine, createAsofJoinEngine, createCrossSectionalEngine, createDailyTimeSeriesEngine, createDualOwnershipReactiveStateEngine, createEquiJoinEngine/ createEqualJoinEngine, createLeftSemiJoinEngine, createLookupJoinEngine, createNarrowReactiveStateEngine, createOrderBookSnapshotEngine, createReactiveStateEngine, createRuleEngine, createSessionWindowEngine, createTimeSeriesEngine, createWindowJoinEngine, streamEngineParser
- 工具函数:addMetrics, addReactiveMetrics, conditionalIterate, dropStreamEngine/ dropAggregator, getLeftStream/getRightStream, getPersistenceMeta, getReactiveMetrics, getSnapshotMsgId, getStreamEngine/getAggregator, getStreamEngineStat/getAggregatorStat, getStreamingLeader, getStreamingRaftGroups, getStreamingStat, getStreamTableFilterColumn, getSubscriptionTopic, getTopicProcessedOffset, stateIterate, warmupStreamEngine
元编程
高阶函数
accumulate (:A), aggrTopN, all, any, byColumn (:V), byRow (:H), call, contextby (:X), cross (:C)/pcross, each (:E), eachLeft (:L), eachPost (:O), eachPre (:P), eachRight (:R), groupby (:G), loop (:U) / ploop, moving, nullCompare, pcall, pivot, reduce (:T), rolling, rowGroupby, segmentby, talib, tmoving, twindow, unifiedCall, window, withNullFill
权限与安全
addAccessControl, addGroupMember, backupSettings, changePwd, createGroup, createUser, deleteGroup, deleteGroupMember, deleteUser, deny, getAuthenticatedUsers, getGroupAccess, getGroupList, getGroupsByUserId, getUserAccess, getUserList, getUsersByGroupId, grant, isLoggedIn, login, logout, resetPwd, restoreSettings, revoke
文件系统
cleanOutdateLogFiles, close, exists, fflush, file, files, loadModel, mkdir, read!, readBytes, readLine, readLines, readLines!, readObject, readRecord!, rm, rmdir, saveAsNpy, saveModel, saveText, saveTextFile, seek, write, writeBytes, writeLine, writeLines, writeLog, writeLogLevel, writeObject, writeRecord
系统管理
cancelConsoleJob, cancelJob, closeSessions, defined, defs, deleteScheduledJob, disableResourceTracking, dumpHeapSample, enableResourceTracking, evalTimer, getClusterPerf, getConsoleJobs, getCurrentSessionAndUser, getDatanodeRestartInterval, getDynamicConfig, getJobMessage, getJobReturn, getJobStat, getJobStatus, getLicenseExpiration, getLicenseServerResourceInfo, getMachineFingerprint, getMemLimitOfAllTempResults, getPerf, getRecentJobs, getRegisteredNodeInfo, getScheduledJobs, getSessionMemoryStat, getSupportBundle, getTSDBDataStat, getTSDBTableIndexCacheStatus, getUserHardwareUsage, getUserTableAccessRecords, imtForceGCRedolog, imtUpdateChunkVersionOnDataNode, installPlugin, license, listRemotePlugins, loadModule, loadModuleFromScript, loadPlugin, member, module, objByName, objs, partial, pipeline, refCount, saveModule, scheduleJob, setDatanodeRestartInterval, setDynamicConfig, setLogLevel, setMaxJobParallelism, setMaxJobPriority, setMemLimitOfAllTempResults, setRandomSeed, setRetentionPolicy, setSystem, startHeapSample,stopHeapSample, submitJob, submitJobEx, submitJobEx2, syntax, timer, undef, updateLicense, use, version