Questions tagged [dolphindb]

DolphinDB is a high performance time series database. It is written in C++ and optimized for fast injection, storage, retrieval and analysis of time series data in fields such as quantitative finance, Internet of Things, real-time analytics, etc. DolphinDB runs extremely fast. It is also easy to use as the syntax of the programming language of DolphinDB is similar to SQL and Python.

764 questions
1
vote
1 answer

How to calculate the Cartesian product of two vectors in DolphinDB?

I have used the following script to generate the Cartesian product of two vectors: the columns “order_book_ids” and “trading_dates” from two tables. ordt=table(order_book_ids as id) datet=table(trading_dates as dts) tb=select id, dts from cj(ordt,…
molddd123
  • 297
  • 6
1
vote
1 answer

How to query leaf nodes using a recursive CTE in DolphinDB?

I want to traverse a tree-like data structure and query the leaf nodes. I have already written an SQL query to accomplish this task using the WITH RECURSIVE syntax. However, I am now working with DolphinDB and need to write a similar script using…
1
vote
1 answer

How to update a column through a column variable?

I want to update a column through a specific column variable. For example, I want to create a SQL update statement update t1 set col1 = col1 * 3, where t1 is a table and col1 is a column name. To make the statement work, a column object is needed,…
serendipity
  • 104
  • 5
1
vote
1 answer

How to calculate the differences between the adjacent elements from two vectors?

I want to calculate the differences between of the Nth value of the vector X and the N-1th value of the vector Y. All I know is the function delta, but it can only work within one vector. Does anyone know a better method? Thanks in advance.
1
vote
1 answer

Why are the returned minimum values displayed as zeros in DolphinDB?

DolphinDB server version: 2.00.9.1 2023.02.20; linux64 Operating environment: vscode dolphindb v2.0.921 / GUI When I queried data, I found that the returned minimum values are all zeros, as shown in the following figure. Why is this…
Polly
  • 603
  • 3
  • 13
1
vote
2 answers

How to add a column of string constants via DolphinDB metaprogramming?

My SQL statement is as follows: select col1,col2,"ABC" as col3 from .. col3 is a constant string. How to implement this SQL query via DolphinDB metaprogramming? I have tried sqlCol("ABC") or parseExpr, but they all treat "ABC" as a column name.
molddd123
  • 297
  • 6
1
vote
1 answer

How to round a floating-point value accurately in DolphinDB?

I want to round a float with round function, but the result is not what I expect. For example, the result of round(17.955, 2) is 17.95 instead of 17.96. To get the latter one, I have to add 0.0001. Why is that and How can I do?
yiniwei
  • 89
  • 5
1
vote
1 answer

How to replay data from two tables with different time column types in DolphinDB?

I want to play back data from two tables. If the time columns of the two tables are of different types, for example, TIME and NANOTIME respectively, does it affect the result? Any potential pitfalls or best practices I should be aware of? Thanks in…
serendipity
  • 104
  • 5
1
vote
1 answer

Does the Community Edition of DolphinDB support high availability?

I'm going to try the Community Edition. I want to know if this edition can support high availability. Since the community edition can only use two data/compute nodes, can I build a high-availability cluster with it?
Polly
  • 603
  • 3
  • 13
1
vote
1 answer

How to count the total number of rows in a persisted stream table?

I use the function enableTableShareAndPersistence for stream table persistence and the parameter cacheSize is set to 100000, which means at most 100000 records is kept in memory. Now I want to count the total number of rows in the stream table,…
winnie
  • 183
  • 1
  • 6
1
vote
1 answer

How to store dictionaries in a table?

I want to create a table in DolphinDB where each row is a dictionary storing the parameters for factor calculation. The dictionary is of type (STRING, ANY), where the dictionary keys are parameter names and the dictionary values are the parameter…
1
vote
1 answer

Error is reported when I pass a non-singular matrix to ols in DolphinDB

I have calculated that the determinant of a matix is not equal to 0, which means the matix is non-singular. But when passing it to the ols function, I still get an error : input singular. Any reason?
Eva Gao
  • 402
  • 1
  • 7
1
vote
1 answer

A quick way to return all the dates in a table from a database partitioned by DATE and SYMBOL

I have a table in a database partitioned by DATE and SYMBOL, and the DATE column is of the TIMESTAMP type. Is there any faster way to return all the dates in the table than the statements select distinct(date(datetime)) from t and select count(*)…
Eva Gao
  • 402
  • 1
  • 7
1
vote
1 answer

Error occurred when importing DECIMAL data with Python Api

DolphinDB server version : 2.00.9.1 2023.02.20 ; linux64 python==3.7 DDB package version : 1.30.21.1 Problem Description: I want to use ddb.tableAppender() to write a Python dataframe to a DolphinDB table. A column in the table is of type DECIMAL.…
damie
  • 412
  • 2
  • 7
1
vote
2 answers

How to join two STRING vectors of length m and n into a STRING vector of length m*n?

Here are two STRING vectors: a = `A`B`C b = `oo`pp`qq I want to combine each element of the vectors. I can do it with a two-level for loop: result = array(STRING) for(x in a){ for(y in b){ result.append!(x+y) } } But I want an…
dbaa9948
  • 189
  • 2
  • 10
1 2
3
50 51