我在Bigtable中有一个计数器表。在BigQuery中读取计数器数据的正确方法是什么?
当我使用BigQuery读取行时,所有单元格值在转换为Integer时显示为0。
SELECT integer (daily.column.cell.value) FROM rtda.counters
以下是使用hbase shell的示例输出:
hbase(main):019:0> get_counter 'counters','20110101','daily:clicks'
COUNTER VALUE = 8
我将列族编码设置为字节类型。 bq show rtda.counters
输出:
Last modified Schema Type Total
URIs Expiration Labels
----------------- ---------------------------------- ---------- ------------ ------------ --------
10 May 11:10:38 |- rowkey: string EXTERNAL 1
+- daily: record
| +- column: record (repeated)
| | |- name: string
| | +- cell: record (repeated)
| | | |- timestamp: timestamp
| | | |- value: bytes
+- weekly: record
| +- column: record (repeated)
| | |- name: string
| | +- cell: record (repeated)
| | | |- timestamp: timestamp
| | | |- value: bytes
+- monthly: record
| +- column: record (repeated)
| | |- name: string
| | +- cell: record (repeated)
| | | |- timestamp: timestamp
| | | |- value: bytes