[storm] Query result in dict object.
Gerald Me
gerald at igarment.net
Mon May 7 05:57:26 UTC 2018
I can run sql select statment using store.execute() And I get a ResultSet. How can I get a dictionary object instead of a tuple list?
I know I can get the column names from the result set cursor description. Then map the cursor column name with the tuple, is there a build in method which do this already?
I can
result = store.execute(‘Select * from a_table’)
fields = [ f[0] for f in result._raw_cursor.description ]
for data in result:
record = dict(zip(fields, data))
By the way, is there any document on how to use Expr?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/storm/attachments/20180507/0ffdd74d/attachment.html>
More information about the storm
mailing list