Phoenix 建表语句
create table IF NOT EXISTS shop_day (
face_id varchar not null,
shop_key integer not null,
date_key integer not null,
business_key integer,
brand_key integer,
pv integer
CONSTRAINT pk PRIMARY key (face_id, shop_key, date_key)
);
spring 配置
spring
phoenix:
datasource:
url: jdbc:phoenix:127.0.0.1:2181
driverclassname: org.apache.phoenix.jdbc.PhoenixDriver
username:
password:
spring 代码
@Qualifier("phoenixJdbcTemplate")
@Autowired
private JdbcTemplate jdbcPhoenix;
void getFaceShopInfo() {
String sql = "select * from shop_day where face_id in('1234')";
Map<String, Object> stringObjectMap = jdbcPhoenix.queryForMap(sql);
}
#stringObjectMap 只有 face_id, shop_key, date_key 主键字段有数据,其他字段数据都是 null
在终端查询这条 sql 每个字段都有数据
0: jdbc:phoenix:> select * from shop_day where face_id in('1234');
有大佬知道是什么问题吗.