Support Questions

Find answers, ask questions, and share your expertise

Namespace mapping issue in HBase-Phoenix Java


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 ?


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);