This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 87aa7a887932e4d23d56e1b83a2318973c4ce2ca
Author: Jingyu Wang <[email protected]>
AuthorDate: Wed Oct 19 14:08:26 2022 -0700

    Remove obsolete partition functions and declaration in ORCA
---
 src/backend/gpopt/gpdbwrappers.cpp                 | 185 +--------------------
 .../gporca/libgpopt/include/gpopt/engine/CEngine.h |   5 -
 src/include/gpopt/gpdbwrappers.h                   |  42 -----
 3 files changed, 3 insertions(+), 229 deletions(-)

diff --git a/src/backend/gpopt/gpdbwrappers.cpp 
b/src/backend/gpopt/gpdbwrappers.cpp
index fb5654b727..d08832c8c0 100644
--- a/src/backend/gpopt/gpdbwrappers.cpp
+++ b/src/backend/gpopt/gpdbwrappers.cpp
@@ -845,54 +845,6 @@ gpdb::GetRelationPartitionKey(Relation rel)
        return nullptr;
 }
 
-#if 0
-bool
-gpdb::HasExternalPartition
-       (
-       Oid oid
-       )
-{
-       GP_WRAP_START;
-       {
-               /* catalog tables: pg_partition, pg_partition_rule */
-               return rel_has_external_partition(oid);
-       }
-       GP_WRAP_END;
-       return false;
-}
-
-
-bool
-gpdb::IsLeafPartition
-       (
-       Oid oid
-       )
-{
-       GP_WRAP_START;
-       {
-               /* catalog tables: pg_partition, pg_partition_rule */
-               return rel_is_leaf_partition(oid);
-       }
-       GP_WRAP_END;
-       return false;
-}
-
-Oid
-gpdb::GetRootPartition
-       (
-       Oid oid
-       )
-{
-       GP_WRAP_START;
-       {
-               /* catalog tables: pg_partition, pg_partition_rule */
-               return rel_partition_get_master(oid);
-       }
-       GP_WRAP_END;
-       return InvalidOid;
-}
-#endif
-
 bool
 gpdb::GetCastFunc(Oid src_oid, Oid dest_oid, bool *is_binary_coercible,
                                  Oid *cast_fn_oid, CoercionPathType *pathtype)
@@ -1125,58 +1077,6 @@ gpdb::GetOpName(Oid opno)
        GP_WRAP_END;
        return nullptr;
 }
-#if 0
-List *
-gpdb::GetPartitionAttrs
-       (
-       Oid oid
-       )
-{
-       GP_WRAP_START;
-       {
-               // return unique partition level attributes
-               /* catalog tables: pg_partition */
-               return rel_partition_keys_ordered(oid);
-       }
-       GP_WRAP_END;
-       return NIL;
-}
-
-void
-gpdb::GetOrderedPartKeysAndKinds
-       (
-       Oid oid,
-       List **pkeys,
-       List **pkinds
-       )
-{
-       GP_WRAP_START;
-       {
-               /* catalog tables: pg_partition */
-               rel_partition_keys_kinds_ordered(oid, pkeys, pkinds);
-       }
-       GP_WRAP_END;
-}
-
-PartitionNode *
-gpdb::GetParts
-       (
-       Oid relid,
-       int16 level,
-       Oid parent,
-       bool inctemplate,
-       bool includesubparts
-       )
-{
-       GP_WRAP_START;
-       {
-               /* catalog tables: pg_partition, pg_partition_rule */
-               return get_parts(relid, level, parent, inctemplate, 
includesubparts);
-       }
-       GP_WRAP_END;
-       return NULL;
-}
-#endif
 
 List *
 gpdb::GetRelationKeys(Oid relid)
@@ -1526,36 +1426,6 @@ gpdb::ListFreeDeep(List *list)
        }
        GP_WRAP_END;
 }
-#if 0
-bool
-gpdb::IsAppendOnlyPartitionTable
-       (
-       Oid root_oid
-       )
-{
-       GP_WRAP_START;
-       {
-               return rel_has_appendonly_partition(root_oid);
-       }
-       GP_WRAP_END;
-       return false;
-}
-
-bool
-gpdb::IsMultilevelPartitionUniform
-       (
-       Oid root_oid
-       )
-{
-       GP_WRAP_START;
-       {
-               /* catalog tables: pg_partition, pg_partition_rule, 
pg_constraint */
-               return rel_partitioning_is_uniform(root_oid);
-       }
-       GP_WRAP_END;
-       return false;
-}
-#endif
 
 TypeCacheEntry *
 gpdb::LookupTypeCache(Oid type_id, int flags)
@@ -1960,36 +1830,6 @@ gpdb::WalkQueryTree(Query *query, bool (*walker)(Node *, 
void *), void *context,
        return false;
 }
 
-#if 0
-bool
-gpdb::RelPartIsRoot
-       (
-       Oid relid
-       )
-{
-       GP_WRAP_START;
-       {
-               return PART_STATUS_ROOT == rel_part_status(relid);
-       }
-       GP_WRAP_END;
-       return false;
-}
-
-bool
-gpdb::RelPartIsInterior
-       (
-       Oid relid
-       )
-{
-       GP_WRAP_START;
-       {
-               return PART_STATUS_INTERIOR == rel_part_status(relid);
-       }
-       GP_WRAP_END;
-       return false;
-}
-#endif
-
 bool
 gpdb::HasSubclassSlow(Oid rel_oid)
 {
@@ -2521,21 +2361,6 @@ gpdb::EvalConstExpressions(Node *node)
        GP_WRAP_END;
        return nullptr;
 }
-#if 0
-SelectedParts *
-gpdb::RunStaticPartitionSelection
-       (
-       PartitionSelector *ps
-       )
-{
-       GP_WRAP_START;
-       {
-               return static_part_selection(ps);
-       }
-       GP_WRAP_END;
-       return NULL;
-}
-#endif
 
 #ifdef FAULT_INJECTOR
 FaultInjectorType_e
@@ -2598,13 +2423,9 @@ register_mdcache_invalidation_callbacks(void)
                CONSTROID,                /* pg_constraint */
                OPEROID,                  /* pg_operator */
                OPFAMILYOID,      /* pg_opfamily */
-#if 0
-               PARTOID,                        /* pg_partition */
-               PARTRULEOID,            /* pg_partition_rule */
-#endif
-               STATRELATTINH, /* pg_statistics */
-               TYPEOID,           /* pg_type */
-               PROCOID,           /* pg_proc */
+               STATRELATTINH,    /* pg_statistics */
+               TYPEOID,                  /* pg_type */
+               PROCOID,                  /* pg_proc */
 
                /*
                 * lookup_type_cache() will also access pg_opclass, via 
GetDefaultOpClass(),
diff --git a/src/backend/gporca/libgpopt/include/gpopt/engine/CEngine.h 
b/src/backend/gporca/libgpopt/include/gpopt/engine/CEngine.h
index 7d5d214994..4256439474 100644
--- a/src/backend/gporca/libgpopt/include/gpopt/engine/CEngine.h
+++ b/src/backend/gporca/libgpopt/include/gpopt/engine/CEngine.h
@@ -193,11 +193,6 @@ private:
                                                  CEnfdProp::EPropEnforcingType 
epetRewindability,
                                                  CEnfdProp::EPropEnforcingType 
epetPropagation);
 
-       // check if partition propagation resolver is passed an empty part
-       // propagation spec
-       static BOOL FCheckReqdPartPropagation(CPhysical *pop,
-                                                                               
  CEnfdPartitionPropagation *pepp);
-
        // unrank the plan with the given 'plan_id' from the memo
        CExpression *PexprUnrank(ULLONG plan_id);
 
diff --git a/src/include/gpopt/gpdbwrappers.h b/src/include/gpopt/gpdbwrappers.h
index 625ff71dc2..9b05d81dea 100644
--- a/src/include/gpopt/gpdbwrappers.h
+++ b/src/include/gpopt/gpdbwrappers.h
@@ -313,27 +313,6 @@ RegProcedure GetOpFunc(Oid opno);
 // operator name
 char *GetOpName(Oid opno);
 
-#if 0
-       // parts of a partitioned table
-       bool IsLeafPartition(Oid oid);
-
-       // partition table has an external partition
-       bool HasExternalPartition(Oid oid);
-
-       // find the oid of the root partition given partition oid belongs to
-       Oid GetRootPartition(Oid oid);
-       
-       // partition attributes
-       List *GetPartitionAttrs(Oid oid);
-
-       // get partition keys and kinds ordered by partition level
-       void GetOrderedPartKeysAndKinds(Oid oid, List **pkeys, List **pkinds);
-
-       /* GPDB_12_MERGE_FIXME: mergings stats not yet implemented with new 
partitioning implementation */
-       // parts of a partitioned table
-       //PartitionNode *GetParts(Oid relid, int16 level, Oid parent, bool 
inctemplate, bool includesubparts);
-#endif
-
 // keys of the relation with the given oid
 List *GetRelationKeys(Oid relid);
 
@@ -427,14 +406,6 @@ void ListFree(List *list);
 // deep free of a list
 void ListFreeDeep(List *list);
 
-#if 0
-       // does a partition table have an appendonly child
-       bool IsAppendOnlyPartitionTable(Oid root_oid);
-
-       // does a multi-level partitioned table have uniform partitioning 
hierarchy
-       bool IsMultilevelPartitionUniform(Oid root_oid);
-#endif
-
 // lookup type cache
 TypeCacheEntry *LookupTypeCache(Oid type_id, int flags);
 
@@ -542,14 +513,6 @@ Node *MutateExpressionTree(Node *node, Node 
*(*mutator)(Node *, void *), void *c
 Node *MutateQueryOrExpressionTree(Node *node, Node *(*mutator)(Node *, void 
*), void *context,
                                                                  int flags);
 
-#if 0
-       // check whether the part with the given oid is the root of a partition 
table
-       bool RelPartIsRoot(Oid relid);
-       
-       // check whether the part with the given oid is an interior subpartition
-       bool RelPartIsInterior(Oid relid);
-#endif
-
 bool RelIsPartitioned(Oid relid);
 
 bool IndexIsPartitioned(Oid relid);
@@ -702,11 +665,6 @@ Expr *TransformArrayConstToArrayExpr(Const *constant);
 // transform array Const to an ArrayExpr
 Node *EvalConstExpressions(Node *node);
 
-#if 0
-       // static partition selection given a PartitionSelector node
-       SelectedParts *RunStaticPartitionSelection(PartitionSelector *ps);
-#endif
-
 #ifdef FAULT_INJECTOR
 // simple fault injector used by COptTasks.cpp to inject GPDB fault
 FaultInjectorType_e InjectFaultInOptTasks(const char *fault_name);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to