Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Namespace mapping issue in HBase-Phoenix Java

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
Highlighted

Re: Namespace mapping issue in HBase-Phoenix Java

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

Highlighted

Re: Namespace mapping issue in HBase-Phoenix Java

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);
Don't have an account?
Coming from Hortonworks? Activate your account here