Open lujisen opened 4 years ago
你这是修改的源码码?
汗颜,这个issue这么久过去了还没有被fix,活跃度不够呐,hbase11xsqlwriter也是同样的问题。楼上那样子改写死了,应该从hbaseConfig参数解析那里加,这样可以允许传递更多的hbase配置参数。 示例: "hbaseConfig": { "hbase.zookeeper.quorum": "bigdata-dev01,bigdata-dev02,bigdata-dev03", "zookeeper.znode.parent": "/hbase", "phoenix.schema.isNamespaceMappingEnabled": "true", "phoenix.schema.mapSystemTablesToNamespace": "true" },
cfg.connectionString = "jdbc:phoenix:" + zkQuorum + ":2181:" + znode; JSONObject hbaseCfgJson = JSON.parseObject(hbaseCfg); for (Map.Entry<String, Object> entry : hbaseCfgJson.entrySet()) { cfg.hbaseConfig.put(entry.getKey(),entry.getValue()); }
conn = DriverManager.getConnection(connStr,cfg.getHbaseConfig());
文件:HbaseSQLHelper 66行: Connection con = DriverManager.getConnection(connectionString); 修改为: Properties properties =new Properties(); properties.setProperty("phoenix.schema.isNamespaceMappingEnabled", "true"); properties.setProperty("phoenix.schema.mapSystemTablesToNamespace", "true"); Connection con = DriverManager.getConnection(connectionString,properties);