Hi,
Could someone kindly help me with the problem I'm facing in my previous
email? I've been sitting on this for some time now and would really like to
solve it.
For what it's worth, these are the dependencies I'm using,
*<dependencies>*
* <!-- https://mvnrepository.com/artifact/org.apache.calcite/calcite-core
<https://mvnrepository.com/artifact/org.apache.calcite/calcite-core> -->*
* <dependency>*
* <groupId>org.apache.calcite</groupId>*
* <artifactId>calcite-core</artifactId>*
* <version>1.19.0</version>*
* </dependency>*
* <!-- https://mvnrepository.com/artifact/org.apache.phoenix/phoenix-core
<https://mvnrepository.com/artifact/org.apache.phoenix/phoenix-core> -->*
* <dependency>*
* <groupId>org.apache.phoenix</groupId>*
* <artifactId>phoenix-core</artifactId>*
* <version>5.0.0.3.0.1.0-187</version>*
* </dependency>*
* </dependencies>*
* <repositories>*
* <repository>*
* <id>Hortonworks Repository</id>*
* <url>http://repo.hortonworks.com/content/repositories/releases/
<http://repo.hortonworks.com/content/repositories/releases/></url>*
* </repository>*
* </repositories>*

Waiting for you response.
Regards,
Rakesh.

On Tue, Apr 16, 2019 at 7:03 PM Rakesh Nair <[email protected]>
wrote:

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

Reply via email to