-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Fail to create table with partition description with MAXVALUE in Greenplum like syntax #795
Comments
Hi, @xinhuitian welcome!🎊 Thanks for taking the time to point this out.🙌 |
Reproduce it on main branch, besides the CREATE TABLE test_partition2 (
name character varying,
last_modified_date timestamp without time zone
)
WITH (appendoptimized=true, orientation=column, compresslevel=1)
DISTRIBUTED BY (name)
PARTITION BY RANGE (last_modified_date)
(
PARTITION partition_202411 START (MINVALUE) INCLUSIVE END ('2024-12-01 00:00:00') EXCLUSIVE,
PARTITION partition_max START ('2024-12-01 00:00:00') INCLUSIVE END (MAXVALUE)
);
ERROR: cannot use column reference in partition bound expression
LINE 9: PARTITION partition_202411 START (MINVALUE) INCLUSIVE EN.. |
The value of right boundary is always treat as exclusive. What's the exact meaning of |
Good point. |
Oh..I just found that the case: PARTITION partition_max START ('2024-12-01 00:00:00') INCLUSIVE END (MAXVALUE) INCLUSIVE clause is for START ('2024-12-01 00:00:00'), not for END (MAXVALUE). But your concern should be considered if it was. |
Previously, the simplified partition creation syntax in GPDB did not properly handle MAXVALUE as a boundary value for subpartitions. The fix allows users to define subpartitions with MAXVALUE boundaries using the simplified partition creation syntax, maintaining compatibility with existing partition functionality. During the fix, it was also identified that MINVALUE has a similar issue. However, addressing MINVALUE is more complex due to the current implementation of the START/EVERY/END grammar, which only considers the end boundary situation. A broader refactor of the partition creation logic may be required to properly support MINVALUE in subpartition definitions. Fixes: apache#795 Authored-by: Zhang Mingli [email protected]
Hi, all I have a fix for the MAXVALUE in #904. As said there: I think we first fix this one, then create a new one to track MINVALUE. |
Previously, the simplified partition creation syntax in GPDB did not properly handle MAXVALUE as a boundary value for subpartitions. The fix allows users to define subpartitions with MAXVALUE boundaries using the simplified partition creation syntax, maintaining compatibility with existing partition functionality. During the fix, it was also identified that MINVALUE has a similar issue. However, addressing MINVALUE is more complex due to the current implementation of the START/EVERY/END grammar, which only considers the end boundary situation. A broader refactor of the partition creation logic may be required to properly support MINVALUE in subpartition definitions. Fixes: #795 Authored-by: Zhang Mingli [email protected]
Apache Cloudberry version
1.6.0
What happened
Hello, I'm currently testing cb with the bootcamp 000-cbdb-sandbox docker file.
When I run a query similar as the below one:
I got the following error:
Split it to another query works fine:
Seems like MAXVALUE in the first query is parsed to a column ref. Seems like a bug here?
What you think should happen instead
Correctly process this kind of query without error, be more compatible with Greenplum syntax
How to reproduce
run such query:
Operating System
cbdb-1.6.0:rockylinux9 docker image running on Debian GNU/Linux 9 (stretch)
Anything else
Every time
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: