avamingli commented on code in PR #904:
URL: https://github.com/apache/cloudberry/pull/904#discussion_r1947408971
##########
src/backend/parser/parse_partition_gp.c:
##########
@@ -566,27 +566,79 @@ initPartEveryIterator(ParseState *pstate,
PartitionKeyData *partkey, const char
if (end)
{
Const *endConst;
+ Node *expr = end;
+ PartitionRangeDatum *prd = NULL;
- endConst = transformPartitionBoundValue(pstate,
-
end,
-
part_col_name,
-
part_col_typid,
-
part_col_typmod,
-
part_col_collation);
- if (endConst->constisnull)
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_TABLE_DEFINITION),
- errmsg("cannot use NULL with range partition
specification"),
- parser_errposition(pstate,
exprLocation(end))));
+ /*
+ * Infinite range bounds -- "minvalue" and "maxvalue" -- get
passed in
+ * as ColumnRefs.
+ */
+ if (IsA(expr, ColumnRef))
+ {
+ ColumnRef *cref = (ColumnRef *) expr;
+ char *cname = NULL;
- if (endInclusive)
- convert_exclusive_start_inclusive_end(endConst,
-
part_col_typid, part_col_typmod,
-
false);
- if (endConst->constisnull)
+ /*
+ * There should be a single field named either
"minvalue" or
+ * "maxvalue".
+ */
+ if (list_length(cref->fields) == 1 &&
+ IsA(linitial(cref->fields), String))
+ cname = strVal(linitial(cref->fields));
+
+ if (cname == NULL)
+ {
+ /*
+ * ColumnRef is not in the desired
single-field-name form. For
+ * consistency between all partition
strategies, let the
+ * expression transformation report any errors
rather than
Review Comment:
This is same with Postgres, you can find all the checks and cases interested
in commit cdde886d36b5a4d7ad9e1d02596f7fa1c8c129e3
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]