问题:
这是我写的创建表索引
create table "ct"."calllog"(
id varchar primary key,
"caller"."call1" varchar,
"caller"."call2" varchar,
"caller"."calltime" varchar,
"caller"."duration" varchar
)column_encoded_bytes=0;
显示创建成功
却查找不出数据
hbase中有数据
原因
创建好表连接之后,在hbase中创建了一个ct.calllog表,没有使用我原有的表,后来我发现,phoenix使用的是默认的命名空间,而我默认的命名空间中没有创建的这个表,所以给我重新创建了一个这表,
解决办法
在hbase中的hbase-site.xml配置文件中添加上配置,开启phoenix命名空间的自动映射
<property>
<name>phoenix.schema.isNamespaceMappingEnabled</name>
<value>true</value>
</property>
在/opt/module/phoenix/bin/hbase-site.xml配置文件中也要添加这个配置
然后分发给所有的节点,最后重启就正常了查到数据了