ovis-hpc / sos

sos pre-release stable.
https://github.com/ovis-hpc/sos/wiki
Other
4 stars 7 forks source link

Is there a DataSet.select call that supports 'unique' or 'distinct'? #10

Closed oceandlr closed 5 years ago

oceandlr commented 5 years ago

Is there a select call that supports something like: select distinct 'job_id' from.....

I would like to see how many unique job_id's I have in my dataset. Is there a better option than: In [8]: src.select(['jobid'],from = ['meminfo_E5-2698'],order_by = 'job_id')

In [9]: dst = src.get_results()

In [10]: myset = set(dst.array('job_id'))

In [11]: print(myset) set([0.0, 5078835.0])

tom95858 commented 5 years ago

Set the 'unique' keyword parameter to True to return only the 1st result if the index contains duplicates. For example: src.select(['jobid'], from = ['meminfo_E5-2698'], order_by = 'job_id', unique = True)

ovis-hpc commented 5 years ago

ok ill give that a try -- thanks!