初识java连接Phoenix遇到的坑

1.在一个项目中遇到java连接phoenix,需要做翻页操作。
我开始用了select * from tableName limit 1,10;发现不起作用,跟mysql语法不一样,phoenix中limit后面只能跟一位。最后经查阅,应该这样使用
select * from tableName limit 10 offset 1;
2.phoenix中向表插入数据语法:
upsert into test1 (id,id1,id2,relation,times) VALUES(‘3’,’川A00000’,’川B00000’,2,3);
注意:值不能是双引号,只能是单引号
3.phoenix中在子查询中不支持通配符
比如
SELECT id2 as car,sum(relation) from (SELECT * from test1 union ALL SELECT * from test2) a GROUP BY car;
会报错,而
SELECT id2 as car,sum(relation) from (SELECT id2,relation from test1 union ALL SELECT id2,relation from test2) a GROUP BY car;(正确的)

你可能感兴趣的:(大数据笔记)