[ https://issues.apache.org/jira/browse/HAWQ-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15174873#comment-15174873 ]
ASF GitHub Bot commented on HAWQ-455: ------------------------------------- Github user hsyuan commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/387#discussion_r54669793 --- Diff: src/backend/commands/tablecmds.c --- @@ -13758,6 +13758,24 @@ ATPExecPartAdd(AlteredTableInfo *tab, errhint("use a named partition"), errOmitLocation(true))); + PartitionElem *pElem = (PartitionElem *) pc2->arg1; + Node *pStoreAttr = pElem->storeAttr; + if (pStoreAttr && ((AlterPartitionCmd *)pStoreAttr)->arg1) + { + List *pWithList = (List *)(((AlterPartitionCmd *)pStoreAttr)->arg1); + GpPolicy *parentPolicy = GpPolicyFetch(CurrentMemoryContext, RelationGetRelid(rel)); + int bucketnum = parentPolicy->bucketnum; + int child_bucketnum = GetRelOpt_bucket_num_fromOptions(pWithList, bucketnum); + + if (child_bucketnum != bucketnum) + ereport(ERROR, + (errcode(ERRCODE_GP_FEATURE_NOT_SUPPORTED), + errmsg("distribution policy for partition%s " --- End diff -- The other parts of this file use the same format. %s here in fact contains "", so no need to add quotes here. > Disable creating partition tables with non uniform bucket schema > ----------------------------------------------------------------- > > Key: HAWQ-455 > URL: https://issues.apache.org/jira/browse/HAWQ-455 > Project: Apache HAWQ > Issue Type: Improvement > Components: DDL > Reporter: Haisheng Yuan > Assignee: Lei Chang > > HAWQ user should not be able to create partition tables with non uniform > bucket schema so that don't make orca trip up when it queries across a single > partition. Or else the user should see an error message. -- This message was sent by Atlassian JIRA (v6.3.4#6332)