[ https://issues.apache.org/jira/browse/CALCITE-2211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16404023#comment-16404023 ]
Eyal Segal commented on CALCITE-2211: ------------------------------------- We don't use Calcite to read from MySql directly. We created an adapter based on the CSV adapter that creates several "tables" from different data sources and uses Calcite as the final join. We don't use Calcite directly over the data sources since in most cases it doesn't send the filter to the DB (I think you guys call it "push down"). This is the stack trace: Caused by: org.apache.calcite.runtime.CalciteContextException: From line 15, column 29 to line 15, column 49: Cannot apply '=' to arguments of type '<BIGINT> = <OTHER>'. Supported form(s): '<COMPARABLE_TYPE> = <COMPARABLE_TYPE>' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_151] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_151] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_151] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_151] at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:803) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:788) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4712) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlCallBinding.newValidationSignatureError(SqlCallBinding.java:284) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.type.ComparableOperandTypeChecker.checkOperandTypes(ComparableOperandTypeChecker.java:66) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlOperator.checkOperandTypes(SqlOperator.java:659) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlOperator.validateOperands(SqlOperator.java:432) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlOperator.deriveType(SqlOperator.java:509) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlBinaryOperator.deriveType(SqlBinaryOperator.java:144) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5438) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit(SqlValidatorImpl.java:5425) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:138) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl(SqlValidatorImpl.java:1606) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType(SqlValidatorImpl.java:1591) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereOrOn(SqlValidatorImpl.java:3916) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validateJoin(SqlValidatorImpl.java:3021) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2966) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3216) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:947) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:928) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:226) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:903) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:613) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:552) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:264) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:230) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:781) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:640) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:610) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:221) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:603) ~[calcite-core-1.15.0.jar:1.15.0] at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638) ~[avatica-core-1.10.0.jar:1.10.0] at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149) ~[avatica-core-1.10.0.jar:1.10.0] ... 44 more > Type of BigInteger should be BIGINT > ----------------------------------- > > Key: CALCITE-2211 > URL: https://issues.apache.org/jira/browse/CALCITE-2211 > Project: Calcite > Issue Type: Bug > Affects Versions: 1.15.0 > Reporter: Eyal Segal > Assignee: Julian Hyde > Priority: Major > > Vertica DB returns BigInteger values as BigInteger. It seems that > JavaToSqlTypeConversionRules doesn't support mapping between BigInteger to > BIGINT. -- This message was sent by Atlassian JIRA (v7.6.3#76005)