I don't have the ostb table to test , but for byte number conversion something like
convert_from(row_key , 'BIGINT_BE') https://cwiki.apache.org/confluence/display/DRILL/SQL+Functions The following table provides the data types that you use with the CONVERT_TO and CONVERT_FROM functions: *Type**Input Type**Output Type*BOOLEAN_BYTEbytes(1)booleanTINYINT_BEbytes(1) tinyintTINYINTbytes(1)tinyintSMALLINT_BEbytes(2)smallintSMALLINTbytes(2) smallintINT_BEbytes(4)intINTbytes(4)intBIGINT_BEbytes(8)bigintBIGINTbytes(8) bigintFLOATbytes(4)float (float4)DOUBLEbytes(8)double (float8)INT_HADOOPV bytes(1-9)intBIGINT_HADOOPVbytes(1-9)bigintDATE_EPOCH_BEbytes(8)date DATE_EPOCHbytes(8)dateTIME_EPOCH_BEbytes(8)timeTIME_EPOCHbytes(8)timeUTF8 bytesvarcharUTF16bytesvar16charUINT8bytes(8)uint8 On Tue, Apr 21, 2015 at 11:38 AM, Christopher Matta <[email protected]> wrote: > I’m trying to use Drill to query time-series data stored in OpenTSDB > <http://opentsdb.net/>. The row keys are supposed to be byte array encoded > according to this schema: > http://opentsdb.net/docs/build/html/user_guide/backends/hbase.html > > When trying to do a simple CONVERT_FROM I get the following results: > > 0: jdbc:drill:zk=172.16.1.175:5181,172.16.1.1> select > CONVERT_FROM(row_key, 'UTF8') from tsdb limit 100; > +------------+ > | EXPR$0 | > +------------+ > | U5p | > | U5p! | > | U5p" | > | U5p% | > | U5p& | > | U5p* | > | U5"� | > | U5"�! | > > Which is a long way off of what’s described in the opentsdb schema page. > > Any tips for properly querying this kind of data? > > Chris Matta > [email protected] > 215-701-3146 > >
