Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can I get the timeseries_id after cs_create #27

Closed
amutu opened this issue Apr 8, 2014 · 6 comments
Closed

how can I get the timeseries_id after cs_create #27

amutu opened this issue Apr 8, 2014 · 6 comments

Comments

@amutu
Copy link

amutu commented Apr 8, 2014

in the doc:
function cs_create(table_name text, timestamp_id text, timeseries_id text default null, autoupdate bool default false) returns void

there is a param timestamp_id,but after the cs created,where can I find which column I pass as timeseries_id.User need this column when use table_get().

@amutu
Copy link
Author

amutu commented Apr 8, 2014

the "argument data type" of the \df table_get can get the timeseries_id name and type,but user must parse the argument data type,it is not friendly.If there is some system table/view like information_schema which user can query the cs information,it will be better.

@knizhnik
Copy link
Owner

knizhnik commented Apr 8, 2014

Sorry, there is no function in IMCS which returns name of timeseries identifier and timestamp fields.
In all use cases which I have considered, it is obvious, for example if we have Quote table, then "Symbol" is the only column which can be identifier of timeseries and "Day" - the only column which can be used as timestamp.

Unfortunately I do not understand you second comment. What do you mean by "argument data type"? TABLE_get should be given value of timeseries identifier (i.e. "ABB" in case of Quote table and "Symbol" used as timeseries ID). Why "user must parse the argument data type"?

@amutu
Copy link
Author

amutu commented Apr 8, 2014

Sometimes it is obvious,but most time you shoud know the content of the table or understand the business of the data and then it become obvious.for complex system with many people involved,it is difficult for maintenance.

for the second comment ,see this:
=> \df crashlog_get

              List of functions
 Schema      |     Name     |     Result data type      |                                                         
                                       Argument data types                                                        
                                        |  Type  

-----------------+--------------+---------------------------+---------------------------------------------------------

--------------------------------------------+--------
u_client | crashlog_get | crashlog_timeseries | clientversion integer, from_ts timestamp without time zo
ne DEFAULT NULL::timestamp without time zone, till_ts timestamp without time zone DEFAULT NULL::timestamp without time
zone, limit_ts bigint DEFAULT NULL::bigint | normal
u_client | crashlog_get | SETOF crashlog_timeseries | ids integer[], from_ts timestamp without time zone DEFAU
LT NULL::timestamp without time zone, till_ts timestamp without time zone DEFAULT NULL::timestamp without time zone, l
imit_ts bigint DEFAULT NULL::bigint | normal
(2 rows)

if I want to get "clientversion integer",I must parse the
"clientversion integer, from_ts timestamp without time zo
ne DEFAULT NULL::timestamp without time zone, till_ts timestamp without time zone DEFAULT NULL::timestamp without time
zone, limit_ts bigint DEFAULT NULL::bigint "

@knizhnik
Copy link
Owner

knizhnik commented Apr 8, 2014

What actually do you want to know: just names of timeseries ID and timestamp columns?
Will it be enough to add two generated functions:
function TABLE_timestamp() returns varchar;
function TABLE_timeseries_id() returns varchar;

@amutu
Copy link
Author

amutu commented Apr 8, 2014

Ye,that's enough,if user want more info,he can use the system table get more.
thanks a lot!

@knizhnik
Copy link
Owner

knizhnik commented Apr 8, 2014

I have added TABLE_timestamp() and TABLE_id() functions (revision 56)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants