@Override public void visit(WindowFunction obj) { preVisitVisitor(obj); visitNode(obj.getFunction()); visitNode(obj.getWindowSpecification()); postVisitVisitor(obj); }
@Override public void visit(WindowFunction obj) { preVisitVisitor(obj); visitNode(obj.getFunction()); visitNode(obj.getWindowSpecification()); postVisitVisitor(obj); }
@Override public void visit(WindowFunction obj) { preVisitVisitor(obj); visitNode(obj.getFunction()); visitNode(obj.getWindowSpecification()); postVisitVisitor(obj); }
@Override public void visit(WindowFunction windowFunction) { append(windowFunction.getFunction()); append(SPACE); append(OVER); append(SPACE); append(windowFunction.getWindowSpecification()); }
@Override public void visit(WindowFunction windowFunction) { append(windowFunction.getFunction()); append(SPACE); append(OVER); append(SPACE); append(windowFunction.getWindowSpecification()); }
@Override public void visit(WindowFunction windowFunction) { append(windowFunction.getFunction()); append(SPACE); append(OVER); append(SPACE); append(windowFunction.getWindowSpecification()); }
org.teiid.language.WindowFunction translate(WindowFunction windowFunction) { org.teiid.language.WindowFunction result = new org.teiid.language.WindowFunction(); result.setFunction(translate(windowFunction.getFunction())); WindowSpecification ws = new WindowSpecification(); ws.setOrderBy(translate(windowFunction.getWindowSpecification().getOrderBy(), false)); List<Expression> partition = windowFunction.getWindowSpecification().getPartition(); if (partition != null) { ArrayList<org.teiid.language.Expression> partitionList = translateExpressionList(partition); ws.setPartition(partitionList); } result.setWindowSpecification(ws); return result; }
private void addPartitionCount(int i, WindowFunction wf) { WindowFunction wf2 = new WindowFunction(); wf2.setFunction(new AggregateSymbol(AggregateSymbol.Type.COUNT.name(), false, null)); //clone the partitioning if any WindowSpecification clone = wf.getWindowSpecification().clone(); clone.setOrderBy(null); wf2.setWindowSpecification(clone); WindowSpecificationInfo wsi2 = getOrCreateWindowSpecInfo(clone); WindowFunctionInfo wfi2 = createWindowFunctionInfo(wf2); wfi2.outputIndex = i; wfi2.primaryFunction = wf; wsi2.functions.add(wfi2); }
private void addPartitionCount(int i, WindowFunction wf) { WindowFunction wf2 = new WindowFunction(); wf2.setFunction(new AggregateSymbol(AggregateSymbol.Type.COUNT.name(), false, null)); //clone the partitioning if any WindowSpecification clone = wf.getWindowSpecification().clone(); clone.setOrderBy(null); wf2.setWindowSpecification(clone); WindowSpecificationInfo wsi2 = getOrCreateWindowSpecInfo(clone); WindowFunctionInfo wfi2 = createWindowFunctionInfo(wf2); wfi2.outputIndex = i; wfi2.primaryFunction = wf; wsi2.functions.add(wfi2); }
org.teiid.language.WindowFunction translate(WindowFunction windowFunction) { org.teiid.language.WindowFunction result = new org.teiid.language.WindowFunction(); result.setFunction(translate(windowFunction.getFunction())); WindowSpecification ws = new WindowSpecification(); ws.setOrderBy(translate(windowFunction.getWindowSpecification().getOrderBy(), false)); List<Expression> partition = windowFunction.getWindowSpecification().getPartition(); if (partition != null) { ArrayList<org.teiid.language.Expression> partitionList = translateExpressionList(partition); ws.setPartition(partitionList); } WindowFrame frame = windowFunction.getWindowSpecification().getWindowFrame(); if (frame != null) { org.teiid.language.WindowFrame resultFrame = new org.teiid.language.WindowFrame(frame.getMode()); resultFrame.setStart(translate(frame.getStart())); resultFrame.setEnd(translate(frame.getEnd())); ws.setWindowFrame(resultFrame); } result.setWindowSpecification(ws); return result; }
org.teiid.language.WindowFunction translate(WindowFunction windowFunction) { org.teiid.language.WindowFunction result = new org.teiid.language.WindowFunction(); result.setFunction(translate(windowFunction.getFunction())); WindowSpecification ws = new WindowSpecification(); ws.setOrderBy(translate(windowFunction.getWindowSpecification().getOrderBy(), false)); List<Expression> partition = windowFunction.getWindowSpecification().getPartition(); if (partition != null) { ArrayList<org.teiid.language.Expression> partitionList = translateExpressionList(partition); ws.setPartition(partitionList); } WindowFrame frame = windowFunction.getWindowSpecification().getWindowFrame(); if (frame != null) { org.teiid.language.WindowFrame resultFrame = new org.teiid.language.WindowFrame(frame.getMode()); resultFrame.setStart(translate(frame.getStart())); resultFrame.setEnd(translate(frame.getEnd())); ws.setWindowFrame(resultFrame); } result.setWindowSpecification(ws); return result; }
if (ex instanceof WindowFunction) { WindowFunction wf = (WindowFunction)ex; WindowSpecification ws = wf.getWindowSpecification(); if (wf.getFunction().isRowValueFunction()) {
if (ex instanceof WindowFunction) { WindowFunction wf = (WindowFunction)ex; WindowSpecification ws = wf.getWindowSpecification(); if (wf.getFunction().isRowValueFunction()) {
WindowSpecification spec = windowFunction.getWindowSpecification(); if (spec.getPartition() == null) { return null;
&& windowFunction.getWindowSpecification().getOrderBy() != null && !(windowFunction.getFunction().isAnalytical())) { markInvalid(windowFunction, "Window function order by with aggregate not supported by source"); //$NON-NLS-1$ return; if (windowFunction.getWindowSpecification().getWindowFrame() != null) { if (!this.caps.supportsCapability(Capability.WINDOW_FUNCTION_FRAME_CLAUSE)) { markInvalid(windowFunction, "Window function frame clause not supported by source"); //$NON-NLS-1$ OrderBy orderBy = windowFunction.getWindowSpecification().getOrderBy(); if (orderBy != null) { for (OrderByItem item : orderBy.getOrderByItems()) { if (!CapabilitiesUtil.checkElementsAreSearchable(windowFunction.getWindowSpecification().getPartition(), metadata, SupportConstants.Element.SEARCHABLE_COMPARE)) { markInvalid(windowFunction, "not all source columns support search type"); //$NON-NLS-1$
&& windowFunction.getWindowSpecification().getOrderBy() != null && !(windowFunction.getFunction().isAnalytical())) { markInvalid(windowFunction, "Window function order by with aggregate not supported by source"); //$NON-NLS-1$ return; if (windowFunction.getWindowSpecification().getWindowFrame() != null) { if (!this.caps.supportsCapability(Capability.WINDOW_FUNCTION_FRAME_CLAUSE)) { markInvalid(windowFunction, "Window function frame clause not supported by source"); //$NON-NLS-1$ OrderBy orderBy = windowFunction.getWindowSpecification().getOrderBy(); if (orderBy != null) { for (OrderByItem item : orderBy.getOrderByItems()) { if (!CapabilitiesUtil.checkElementsAreSearchable(windowFunction.getWindowSpecification().getPartition(), metadata, SupportConstants.Element.SEARCHABLE_COMPARE)) { markInvalid(windowFunction, "not all source columns support search type"); //$NON-NLS-1$
case DENSE_RANK: case ROW_NUMBER: if (windowFunction.getWindowSpecification().getOrderBy() == null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.ranking_requires_order_by", windowFunction), windowFunction); //$NON-NLS-1$ case XMLAGG: case STRING_AGG: if (windowFunction.getWindowSpecification().getOrderBy() != null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.window_order_by", windowFunction), windowFunction); //$NON-NLS-1$ case LAST_VALUE: case FIRST_VALUE: if (windowFunction.getWindowSpecification().getOrderBy() == null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.value_requires_order_by", windowFunction), windowFunction); //$NON-NLS-1$ case LEAD: case LAG: if (windowFunction.getWindowSpecification().getOrderBy() == null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.value_requires_order_by", windowFunction), windowFunction); //$NON-NLS-1$ if (windowFunction.getFunction().getOrderBy() != null || (windowFunction.getFunction().isDistinct() && windowFunction.getWindowSpecification().getOrderBy() != null)) { handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0042", new Object[] {windowFunction.getFunction(), windowFunction}), windowFunction); //$NON-NLS-1$ if (windowFunction.getWindowSpecification().getPartition() != null) { validateSortable(windowFunction.getWindowSpecification().getPartition());
&& windowFunction.getWindowSpecification().getOrderBy() != null && !windowFunction.getFunction().isAnalytical()) { markInvalid(windowFunction, "Window function order by with aggregate not supported by source"); //$NON-NLS-1$ OrderBy orderBy = windowFunction.getWindowSpecification().getOrderBy(); if (orderBy != null) { for (OrderByItem item : orderBy.getOrderByItems()) { if (!CapabilitiesUtil.checkElementsAreSearchable(windowFunction.getWindowSpecification().getPartition(), metadata, SupportConstants.Element.SEARCHABLE_COMPARE)) { markInvalid(windowFunction, "not all source columns support search type"); //$NON-NLS-1$
WindowSpecification spec = windowFunction.getWindowSpecification(); if (spec.getPartition() == null) { return null;
WindowSpecification spec = windowFunction.getWindowSpecification(); if (spec.getPartition() == null) { return null;