@Override public List getOutputElements() { return this.processPlan.getOutputElements(); }
@Override public List getOutputElements() { return this.processPlan.getOutputElements(); }
@Override public List getOutputElements() { return this.processPlan.getOutputElements(); }
/** * @see org.teiid.query.processor.xml.PlanExecutor#getOutputElements() */ public List getOutputElements() throws TeiidComponentException { ProcessorPlan plan = resultInfo.getPlan(); return plan.getOutputElements(); }
public PlanNode getDescriptionProperties() { PlanNode props = new PlanNode(this.getClass().getSimpleName()); props.addProperty(PROP_OUTPUT_COLS, AnalysisRecord.getOutputColumnProperties(getOutputElements())); return props; }
public PlanNode getDescriptionProperties() { PlanNode props = new PlanNode(this.getClass().getSimpleName()); props.addProperty(PROP_OUTPUT_COLS, AnalysisRecord.getOutputColumnProperties(getOutputElements())); return props; }
public PlanNode getDescriptionProperties() { PlanNode props = new PlanNode(this.getClass().getSimpleName()); props.addProperty(PROP_OUTPUT_COLS, AnalysisRecord.getOutputColumnProperties(getOutputElements())); return props; }
@Test public void testXmlTableForOrdinalityAndDefaultPath() throws Exception { String sql = "select * from xmltable('/a/b' passing convert('<a><b><c>1</c></b><b>1</b><b><c>1</c></b><b>1</b></a>', xml) columns x for ordinality, c integer) as x"; //$NON-NLS-1$ List<?>[] expected = new List<?>[] { Arrays.asList(1, 1), Arrays.asList(2, null), Arrays.asList(3, 1), Arrays.asList(4, null), }; ProcessorPlan plan = process(sql, expected); assertEquals(DataTypeManager.DefaultDataClasses.INTEGER, ((Expression)plan.getOutputElements().get(0)).getType()); }
@Test public void testLongRanks() throws Exception { String sql = "select e1, row_number() over (order by e1), rank() over (order by e1), dense_rank() over (order by e1 nulls last) from pm1.g1"; List<?>[] expected = new List[] { Arrays.asList("a", 2l, 2l, 1l), Arrays.asList(null, 1l, 1l, 4l), Arrays.asList("a", 3l, 2l, 1l), Arrays.asList("c", 6l, 6l, 3l), Arrays.asList("b", 5l, 5l, 2l), Arrays.asList("a", 4l, 2l, 1l), }; FakeDataManager dataManager = new FakeDataManager(); sampleData1(dataManager); TransformationMetadata tm = RealMetadataFactory.example1(); tm.setLongRanks(true); ProcessorPlan plan = helpGetPlan(sql, tm, TestOptimizer.getGenericFinder()); assertEquals(Long.class, ((Expression)plan.getOutputElements().get(1)).getType()); assertEquals(Long.class, ((Expression)plan.getOutputElements().get(2)).getType()); assertEquals(Long.class, ((Expression)plan.getOutputElements().get(3)).getType()); helpProcess(plan, dataManager, expected); }
@Test public void testRaiseNullWithUnion() { String sql = "select b.x from (select intkey as x from bqt1.smalla where 1 = 0 union all select intnum as y from bqt1.smalla) b"; //$NON-NLS-1$ ProcessorPlan plan = TestOptimizer.helpPlan(sql, RealMetadataFactory.exampleBQTCached(), new String[]{"SELECT IntNum FROM bqt1.smalla"}); //$NON-NLS-1$ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN); assertEquals(Arrays.asList(new Object[] {new ElementSymbol("b.x")}), plan.getOutputElements()); //$NON-NLS-1$ }
throw new TeiidRuntimeException(exception); assertNotNull("Output elements are null", plan.getOutputElements()); //$NON-NLS-1$ if(DEBUG) System.out.println("\n" + plan); //$NON-NLS-1$ return plan;
assertNotNull("Output elements of process plan are null", process.getOutputElements()); //$NON-NLS-1$