Using CASE statements within transformations cause an NPE in Teiid Designer JBDS Perspective

Solution Verified - Updated -

Issue

  • NullPointerException when using a CASE statement in a transformation
  • Receiving below NPE when attempting to validate a transformation:
java.lang.NullPointerException
at org.teiid.query.resolver.util.ResolverVisitor.findWithImplicitConversions(ResolverVisitor.java:562)
at org.teiid.query.resolver.util.ResolverVisitor.resolveFunction(ResolverVisitor.java:505)
at org.teiid.query.resolver.util.ResolverVisitor.visit(ResolverVisitor.java:351)
at org.teiid.query.sql.symbol.Function.acceptVisitor(Function.java:182)
at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:52)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:140)
at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.postVisitVisitor(SimpleQueryResolver.java:221)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:284)
at org.teiid.query.sql.symbol.Function.acceptVisitor(Function.java:182)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:193)
at org.teiid.query.sql.symbol.CaseExpression.acceptVisitor(CaseExpression.java:142)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:268)
at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:83)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:153)
at org.teiid.query.sql.symbol.AliasSymbol.acceptVisitor(AliasSymbol.java:103)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:433)
at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:169)
at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:239)
at org.teiid.query.resolver.command.SimpleQueryResolver.resolveCommand(SimpleQueryResolver.java:106)
at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:294)
at org.teiid.query.resolver.QueryResolver.resolveWithBindingMetadata(QueryResolver.java:229)
at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:161)
at com.metamatrix.modeler.transformation.validation.TransformationValidator.resolveCommand(TransformationValidator.java:431)
at com.metamatrix.modeler.transformation.validation.TransformationValidator.validateSql(TransformationValidator.java:344)
at com.metamatrix.query.internal.ui.sqleditor.component.QueryDisplayComponent.validateSql(QueryDisplayComponent.java:253)
at com.metamatrix.query.internal.ui.sqleditor.component.QueryDisplayComponent.setText(QueryDisplayComponent.java:175)
at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.setTextInTransaction(SqlEditorPanel.java:420)
at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel$4.run(SqlEditorPanel.java:464)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.setText(SqlEditorPanel.java:470)
at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.setText(SqlEditorPanel.java:495)
at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.validate(SqlEditorPanel.java:526)
at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanelWrapper.validate(SqlEditorPanelWrapper.java:136)
at com.metamatrix.modeler.transformation.ui.editors.sqleditor.actions.Validate.doRun(Validate.java:47)
at com.metamatrix.ui.actions.AbstractAction$1.run(AbstractAction.java:537)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at com.metamatrix.ui.actions.AbstractAction.run(AbstractAction.java:540)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
  • Receiving below NPE when attempting to validate a transformation:
java.lang.NullPointerException
    at org.teiid.query.resolver.util.ResolverUtil.getConversion(ResolverUtil.java:280)
    at org.teiid.query.resolver.util.ResolverUtil.convertExpression(ResolverUtil.java:225)
    at org.teiid.query.resolver.util.ResolverVisitor.resolveCompareCriteria(ResolverVisitor.java:664)
    at org.teiid.query.resolver.util.ResolverVisitor.visit(ResolverVisitor.java:303)
    at org.teiid.query.sql.lang.CompareCriteria.acceptVisitor(CompareCriteria.java:123)
    at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:52)
    at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:140)
    at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.postVisitVisitor(SimpleQueryResolver.java:221)
    at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:212)
    at org.teiid.query.sql.lang.CompareCriteria.acceptVisitor(CompareCriteria.java:123)
    at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
    at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:425)
    at org.teiid.query.sql.symbol.SearchedCaseExpression.acceptVisitor(SearchedCaseExpression.java:115)
    at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
    at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:268)
    at org.teiid.query.sql.symbol.ExpressionSymbol.acceptVisitor(ExpressionSymbol.java:83)
    at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
    at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:153)
    at org.teiid.query.sql.symbol.AliasSymbol.acceptVisitor(AliasSymbol.java:103)
    at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
    at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:72)
    at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:433)
    at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:169)
    at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:61)
    at org.teiid.query.resolver.command.SimpleQueryResolver$QueryResolverVisitor.visit(SimpleQueryResolver.java:239)
    at org.teiid.query.resolver.command.SimpleQueryResolver.resolveCommand(SimpleQueryResolver.java:106)
    at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:294)
    at org.teiid.query.resolver.QueryResolver.resolveWithBindingMetadata(QueryResolver.java:229)
    at org.teiid.query.resolver.QueryResolver.resolveCommand(QueryResolver.java:161)
    at com.metamatrix.modeler.transformation.validation.TransformationValidator.resolveCommand(TransformationValidator.java:431)
    at com.metamatrix.modeler.transformation.validation.TransformationValidator.validateSql(TransformationValidator.java:344)
    at com.metamatrix.query.internal.ui.sqleditor.component.QueryDisplayComponent.validateSql(QueryDisplayComponent.java:253)
    at com.metamatrix.query.internal.ui.sqleditor.component.QueryDisplayComponent.setText(QueryDisplayComponent.java:175)
    at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.setTextInTransaction(SqlEditorPanel.java:420)
    at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel$4.run(SqlEditorPanel.java:464)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.setText(SqlEditorPanel.java:470)
    at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.setText(SqlEditorPanel.java:495)
    at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanel.validate(SqlEditorPanel.java:526)
    at com.metamatrix.modeler.transformation.ui.editors.sqleditor.SqlEditorPanelWrapper.validate(SqlEditorPanelWrapper.java:136)
    at com.metamatrix.modeler.transformation.ui.editors.sqleditor.actions.Validate.doRun(Validate.java:47)
    at com.metamatrix.ui.actions.AbstractAction$1.run(AbstractAction.java:537)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at com.metamatrix.ui.actions.AbstractAction.run(AbstractAction.java:540)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1384)

Environment

  • JBoss Developer Studio (JBDS) 4.1.2
  • Teiid Designer 7.4.1
  • CASE statements used within a transformation

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In