2 Replies Latest reply on Mar 22, 2017 12:50 PM by Ivan Chan

    Getting error when doing inner join between integer and varchar columns

    Ivan Chan Apprentice

      I used to be able to do inner join between integer and vachar columns without using CAST function in Teiid 8.12.3.  But it doesn't work in Teiid 9.1.1 anymore.  And I got the following error:

       

      Caused by: org.teiid.api.exception.query.QueryResolverException: TEIID31172 Could not resolve expressions being compared to a common type excluding character conversions: JS_JNDI_DS_Foodmart_public_salary.employee_id = JDBC_DS_SugarCrm_public_users.id

              at org.teiid.query.resolver.util.ResolverVisitor.resolveCompareCriteria(ResolverVisitor.java:999)

              at org.teiid.query.resolver.util.ResolverVisitor.visit(ResolverVisitor.java:249)

              at org.teiid.query.sql.lang.CompareCriteria.acceptVisitor(CompareCriteria.java:130)

              at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:54)

              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:61)

              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.postVisitVisitor(SimpleQueryResolver.java:223)

              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:135)

              at org.teiid.query.sql.lang.CompareCriteria.acceptVisitor(CompareCriteria.java:130)

              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:63)

              at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:76)

              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:595)

              at org.teiid.query.sql.lang.JoinPredicate.acceptVisitor(JoinPredicate.java:179)

              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:63)

              at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:76)

              at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:187)

              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:618)

              at org.teiid.query.sql.lang.From.acceptVisitor(From.java:146)

              at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:63)

              at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:237)

              at org.teiid.query.resolver.command.SimpleQueryResolver.resolveCommand(SimpleQueryResolver.java:70)

              at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:281)

              at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:127)

              at org.teiid.dqp.internal.process.Request.resolveCommand(Request.java:283)

              at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:413)

              at org.teiid.dqp.internal.process.PreparedStatementRequest.generatePlan(PreparedStatementRequest.java:119)

              at org.teiid.dqp.internal.process.Request.processRequest(Request.java:481)

              at org.teiid.dqp.internal.process.PreparedStatementRequest.processRequest(PreparedStatementRequest.java:294)

              at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:655)

              at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:338)

              at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)

              at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:275)

              at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:313)

              at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:245)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:498)

              at org.teiid.transport.LocalServerConnection$1$1.call(LocalServerConnection.java:203)

              at java.util.concurrent.FutureTask.run(FutureTask.java:266)

              at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)

              at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:266)

              at org.teiid.transport.LocalServerConnection$1.invoke(LocalServerConnection.java:201)

              at com.sun.proxy.$Proxy196.executeRequest(Unknown Source)

              at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:689)

              at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:555)

              ... 6 more

       

      Is it expected behavior?

       

      Thanks,

       

      Ivan