1 Reply Latest reply on Jun 28, 2017 9:46 AM by Ramesh Reddy

    Getting TeiidException as :The function 'fun1(col1)' is ambiguous.  Use schema qualification.

    Kulbhushan Chaskar Master

      Hi,

       

      I am Using Teiid admin api 9.1.3 and WildFly 10.0.0 version.

       

      Without UDF function working as expected  :

      QUERY 1 :

       

      INSERT INTO vdbName1.schemaName1."tableName1"(vdbName1.schemaName1."tableName1"."col1",vdbName1.schemaName1."tableName1"."col2")

      SELECT vdbName2.schemaName2."tableName2"."col1",vdbName2.schemaName2."tableName2"."col2" from vdbName2.schemaName2.tableName2 LIMIT 0,5;

       

      But with UDF Function getting Teiid Exception :

      QUERY  2:

      INSERT INTO vdbName1.schemaName1."tableName1"(vdbName1.schemaName1."tableName1"."col1",vdbName1.schemaName1."tableName1"."col2")

      select fun1(vdbName2.schemaName2."tableName2"."col1"),vdbName2.schemaName2."tableName2"."col2" from vdbName2.schemaName2.tableName2 LIMIT 0,5

       

       

      Here fun1 is UDF function in QUERY  2.

      For  QUERY  2 (With UDF function) :

       

      I am Getting Exception as :

       

      org.teiid.jdbc.TeiidSQLException: TEIID31150 Remote org.teiid.api.exception.query.QueryResolverException: TEIID31150 The function 'fun1(vdbName2.schemaName2.tableName2.col1)' is ambiguous.  Use schema qualification.

        at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)

        at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)

        at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:723)

        at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:65)

        at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:561)

        at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135)

        at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40)

        at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79)

        at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:285)

        at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:323)

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

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.teiid.net.socket.SocketServerConnectionFactory$ShutdownHandler.invoke(SocketServerConnectionFactory.java:98)

        at com.sun.proxy.$Proxy62.read(Unknown Source)

       

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

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)

        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)

        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)

        at io.dropwizard.jersey.guava.OptionalResourceMethodDispatchAdapter$OptionalRequestDispatcher.dispatch(OptionalResourceMethodDispatchAdapter.java:37)

        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)

        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)

        at com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100)

        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)

        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)

        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)

        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)

        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)

        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)

        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)

        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:540)

        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:715)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

        at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49)

        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1515)

        at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)

        at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:295)

        at io.dropwizard.jetty.BiDiGzipFilter.doFilter(BiDiGzipFilter.java:127)

        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)

        at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:29)

        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)

        at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:44)

        at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39)

        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)

        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)

        at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:248)

        at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:211)

        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486)

        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:519)

        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)

        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:448)

        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)

        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)

        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

        at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:175)

        at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51)

        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:92)

        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

        at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:162)

        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

        at org.eclipse.jetty.server.Server.handle(Server.java:446)

        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:271)

        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:246)

        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358)

        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601)

        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532)

        at java.lang.Thread.run(Unknown Source)

      Caused by: org.teiid.core.TeiidProcessingException: TEIID31150 Remote org.teiid.api.exception.query.QueryResolverException: TEIID31150 The function 'fun1(vdbName2.schemaName2.tableName2.col1)' is ambiguous.  Use schema qualification.

        at org.teiid.query.resolver.util.ResolverVisitor.resolveFunction(ResolverVisitor.java:709)

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

        at org.teiid.query.sql.symbol.Function.acceptVisitor(Function.java:173)

        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:198)

        at org.teiid.query.sql.symbol.Function.acceptVisitor(Function.java:173)

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

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

        at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:63)

        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:342)

        at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:168)

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

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

        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.command.InsertResolver.resolveProceduralCommand(InsertResolver.java:89)

        at org.teiid.query.resolver.ProcedureContainerResolver.resolveCommand(ProcedureContainerResolver.java:143)

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

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

        at org.teiid.query.resolver.command.BatchedUpdateResolver.resolveCommand(BatchedUpdateResolver.java:48)

        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.Request.processRequest(Request.java:481)

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

        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.DQPWorkContext.runInContext(DQPWorkContext.java:282)

        at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)

        at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

        ... 1 more

       

       

       

      Thanks,

      Kulbhushan Chaskar.