phoenix upsert 到 hbase 的时间戳格式?

Timestamp format for phoenix upsert into hbase?

我正在为 phoenix 编写 upsert 脚本以在 hbase 中创建记录。

CREATE TABLE IF NOT EXISTS temp.table (
id bigint(20),
created_at timestamp,
updated_at timestamp,
CONSTRAINT pk PRIMARY KEY (id)
);

当我使用 upsert 脚本时

upsert into temp.table values(1000,'2014-07-30 13:33:45','2014-07-30 13:33:45');

我收到以下错误

Error: ERROR 203 (22005): Type mismatch. TIMESTAMP and VARCHAR for 2014-07-30 13:33:45 (state=22005,code=203)

当我使用

upsert into temp.table values(1000,13907665544,13907665544);

我收到错误

Error: ERROR 203 (22005): Type mismatch. TIMESTAMP and LONG for 13907665544 (state=22005,code=203)

当列有 timestamp 时,编写 upsert 脚本的另一种形式是什么?

再次检查您的查询。你应该改变你的查询

upsert into temp.test_table(1000,'2014-07-30 13:33:45','2014-07-30 13:33:45');

upsert into temp.test_table values (1000,'2014-07-30 13:33:45','2014-07-30 13:33:45');

sqlline 版本 1.1.8

上测试

另外,我将 table 名称从 temp.table 更改为 temp.test_table,因为它给我以下错误

org.apache.phoenix.exception.PhoenixParserException: ERROR 604 (42P00): Syntax error. Mismatched input. Expecting "NAME", got "table" at line 1, column 33.