Description
Hello,
I'm facing an issue with Apache Calcite when trying to use the different SqlDialect available.
I am building a Spark-app in Scala using Maven, so in my pom.xml, I define the Calcite dependency as
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>1.26.0</version>
</dependency>
In my scala app, I import the dialect as import org.apache.calcite.sql.dialect.{PrestoSqlDialect, MysqlSqlDialect, SparkSqlDialect}
Then, when I want to use a dialect, I write val dialect = MysqlSqlDialect.DEFAULT. But, this returns the error java.lang.NoSuchFieldError: EMPTY_CONTEXT
However, when I used val dialect = SqlDialect.DatabaseProduct.MYSQL.getDialect, it works fine. (However, it does not work for SqlDialect.DatabaseProduct.SPARK.getDialect either, for example).
My issue is that I do not want to use the MySqlDialect but rather the Spark and Presto ones. Unfortunately, both of them return the same error java.lang.NoSuchFieldError: EMPTY_CONTEXT.
I don't understand what is happening. I am not defining EMPTY_CONTEXT anywhere in my own code. It is defined in the Calcite code for every dialect, e.g. here for MySqlDialect.
Since I'm using the latest version of Apache Calcite (1.26.0), I should be able to use this code. What am I missing?
Thanks a mil!
PS: I have also posted this question on StackOverflow: https://stackoverflow.com/questions/66457177/using-any-sqldialect-in-apache-calcite-returns-java-lang-nosuchfielderror-empty