Hi,
So I've trying to connect Calcite with Apache Phoenix. Code given below:
*public Frameworks.ConfigBuilder configPhoenix() {*
* SchemaPlus rootSchema = Frameworks.createRootSchema(true);*
* DataSource dataSource =
JdbcSchema.dataSource("jdbc:phoenix:<ip>:<port>:/hbase-unsecure",
"org.apache.phoenix.jdbc.PhoenixDriver", null, null);*
* JdbcSchema schema = JdbcSchema.create(rootSchema, "hbase-unsecure",
dataSource, null, "hbase-unsecure");*
* for (String table : schema.getTableNames()) {*
* logger.info <http://logger.info>(table);*
* rootSchema.add(table, schema.getTable(table));*
* }*
* return Frameworks.newConfigBuilder().defaultSchema(rootSchema);*
* }*
*public static void main(String[] args) throws Exception {*
*FrameworkConfig config = configPhoenix().build();RelBuilder builder =
RelBuilder.create(config);*
*}*
Unfortunately I'm getting following error:
*Exception in thread "main" java.lang.RuntimeException:
java.sql.SQLException: Cannot create PoolableConnectionFactory
(java.lang.VerifyError: class com.google.protobuf.LiteralByteString
overrides final method toString.(Ljava/lang/String;)Ljava/lang/String;)*
* at
org.apache.calcite.adapter.jdbc.JdbcUtils$DialectPool.get(JdbcUtils.java:97)*
* at
org.apache.calcite.adapter.jdbc.JdbcSchema.createDialect(JdbcSchema.java:184)*
* at org.apache.calcite.adapter.jdbc.JdbcSchema.create(JdbcSchema.java:120)*
* at org.apache.calcite.adapter.jdbc.JdbcSchema.create(JdbcSchema.java:107)*
I presume this is happening because Protobuf 3+ jar is present in classpath
for use by Calcite while Phoenix actually requires Protobuf 2.5.0.
So could someone tell me whether I'm doing something wrong here or if not,
then , how to handle this?
Regards,
Rakesh