pull/6831/merge
Onur Tirtir 2025-06-24 10:45:01 -07:00 committed by GitHub
commit 656aa03589
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 26 deletions

View File

@ -424,38 +424,14 @@ IsOuterJoinExpr(Node *node)
bool bool
SafeToPushdownWindowFunction(Query *query, StringInfo *errorDetail) SafeToPushdownWindowFunction(Query *query, StringInfo *errorDetail)
{ {
ListCell *windowClauseCell = NULL;
List *windowClauseList = query->windowClause;
/*
* We need to check each window clause separately if there is a partition by clause
* and if it is partitioned on the distribution column.
*/
foreach(windowClauseCell, windowClauseList)
{
WindowClause *windowClause = lfirst(windowClauseCell);
if (!windowClause->partitionClause)
{
if (errorDetail)
{
*errorDetail = makeStringInfo();
appendStringInfoString(*errorDetail,
"Window functions without PARTITION BY on distribution "
"column is currently unsupported");
}
return false;
}
}
if (!WindowPartitionOnDistributionColumn(query)) if (!WindowPartitionOnDistributionColumn(query))
{ {
if (errorDetail) if (errorDetail)
{ {
*errorDetail = makeStringInfo(); *errorDetail = makeStringInfo();
appendStringInfoString(*errorDetail, appendStringInfoString(*errorDetail,
"Window functions with PARTITION BY list missing distribution " "Window functions should have a PARTITION BY clause list "
"column is currently unsupported"); "that contains distribution column");
} }
return false; return false;
} }