Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

Namespace mapping issue in HBase-Phoenix Java

Explorer

I have enabled namespacing property in hbase-site.xml , but I am unable to create schema using Java Phoenix connectivity. Error message shows that namespacing property should be enabled ( which is already the case) . Any way to specifically mention/override the hbase properties in the java program ?

2 REPLIES 2

Include the directory containing hbase-site.xml on the classpath of your Java program.

If these are the only property you need from hbase-site.xml , you can create a connection by passing the properties in props.

Properties props = new Properties();

props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true));

props.setProperty(QueryServices.IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE, Boolean.toString(false));

Connection conn = DriverManager.getConnection(getUrl(), props);