Re: best way to query hbase dynamic columns

2015-02-20 Thread Steven Phillips
The combination of kvgen and flatten would be the best approach. kvgen returns a repeated map, flatten will convert the repeated map into separate single maps. You can then aggregate or filter on the key or value. One problem with this, however, is that in this particular example, it looks like yo

Re: best way to query hbase dynamic columns

2015-02-20 Thread Carol McDonald
I did use kvgen, but not sure how. The price value is a long , how can I calculate an average for this , when the column names are variable? 0: jdbc:drill:> select convert_from(row_key, 'UTF8') as tid, kvgen(t.price) as price from dfs.`/tables/trades_flat` t limit 5; +++ |

Day of week from Date data type

2015-02-20 Thread Andries Engelbrecht
Recently got this question on how to extract the day of the week from date. Here is one method. select datecolumn, to_char(datecolumn, 'E') from base_table limit 10; +++ |date| EXPR$1 | +++ | 2015-02-01 | Sun| | 2015-02-01 | Sun

Re: best way to query hbase dynamic columns

2015-02-20 Thread Ted Dunning
Would kvgen work on t.price? On Thu, Feb 19, 2015 at 12:59 PM, Carol McDonald wrote: > What is the best way to query an hbase table that has dynamic column names > ? For example this table is similar to the opentsdb table, the rowkey is a > stocksymbol followed by the date and hour , the Price