}
public static void validateWindowDefForWFn(TableFuncDef tFnDef, WindowFunctionDef wFnDef)
throws WindowingException
{
WindowDef tWindow = tFnDef.getWindow();
WindowDef fWindow = wFnDef.getWindow();
PartitionDef tPart = tWindow == null ? null : tWindow.getPartDef();
PartitionDef fPart = fWindow == null ? null : fWindow.getPartDef();
if ( !TranslateUtils.isCompatible(tPart, fPart))
{
throw new WindowingException(
sprintf("Window Function '%s' has an incompatible partition clause", wFnDef.getSpec()));
}
OrderDef tOrder = tWindow == null ? null : tWindow.getOrderDef();
OrderDef fOrder = fWindow == null ? null : fWindow.getOrderDef();
if ( !TranslateUtils.isCompatible(tOrder, fOrder))
{
throw new WindowingException(
sprintf("Window Function '%s' has an incompatible order clause", wFnDef.getSpec()));
}