-
Notifications
You must be signed in to change notification settings - Fork 151
Support cloudberry #627
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
base: madlib2-master
Are you sure you want to change the base?
Support cloudberry #627
Changes from 1 commit
76df2b9
6555f60
c725ce5
303c3fb
783958e
b5289b2
8dac48a
4546cfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,6 @@ postgres: | |
|
|
||
| greenplum: | ||
| name: Greenplum DB | ||
|
|
||
| cloudberry: | ||
| name: Cloudberry DB | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,7 @@ | |
| for port in ports: | ||
| portid_list.append(port) | ||
|
|
||
| SUPPORTED_PORTS = ('postgres', 'greenplum') | ||
| SUPPORTED_PORTS = ('postgres', 'greenplum', 'cloudberry') | ||
|
|
||
| # Global variables | ||
| portid = None # Target port ID (eg: pg90, gp40) | ||
|
|
@@ -189,7 +189,8 @@ def _run_m4_and_append(schema, maddir_mod_py, module, sqlfile, | |
| '-I' + maddir_madpack, | ||
| sqlfile] | ||
| if ( (portid == 'postgres') & | ||
| (is_rev_gte(get_rev_num(dbver), get_rev_num('14.0'))) ): | ||
| (is_rev_gte(get_rev_num(dbver), get_rev_num('14.0'))) or | ||
| (portid == 'cloudberry') ): | ||
| m4args = ['m4', | ||
| '-P', | ||
| '-DMADLIB_SCHEMA=' + schema, | ||
|
|
@@ -370,7 +371,7 @@ def _check_db_port(portid): | |
| if portid == 'postgres': | ||
| if row[0]['version'].lower().find('greenplum') < 0: | ||
| return True | ||
| elif portid == 'greenplum': | ||
| elif portid == 'greenplum' or portid == 'cloudberry': | ||
| return True | ||
| return False | ||
| # ------------------------------------------------------------------------------ | ||
|
|
@@ -1240,6 +1241,7 @@ def create_install_madlib_sqlfile(args, madpack_cmd): | |
| def get_madlib_function_drop_str(schema): | ||
|
|
||
| if ((portid == 'greenplum' and is_rev_gte(get_rev_num(dbver), get_rev_num('7.0'))) or | ||
| (portid == 'cloudberry') or | ||
| (portid == 'postgres')): | ||
| case_str = """ | ||
| CASE p.prokind | ||
|
|
@@ -1344,14 +1346,14 @@ def set_dynamic_library_path_in_database(dbver_split, madlib_library_path): | |
| (portid == 'postgres' and is_rev_gte(dbver_split, get_rev_num('13.0')))): | ||
| libdir = libdir.decode() | ||
|
|
||
| libdir = libdir.strip()+'/postgresql' | ||
| libdir = str(libdir.strip(), encoding='utf-8')+'/postgresql' | ||
|
||
| paths.append(libdir) | ||
|
|
||
| paths.append(madlib_library_path) | ||
| dynamic_library_path = ':'.join(paths) | ||
|
|
||
| if portid == 'greenplum': | ||
| if is_rev_gte(dbver_split, get_rev_num('6.0')): | ||
| if portid == 'greenplum' or portid == 'cloudberry': | ||
| if is_rev_gte(dbver_split, get_rev_num('6.0')) or portid == 'cloudberry': | ||
| ret = os.system('gpconfig -c dynamic_library_path -v \'{0}\''.format(dynamic_library_path)) | ||
| else: | ||
| ret = os.system('gpconfig -c dynamic_library_path -v \'\\{0}\''.format(dynamic_library_path)) | ||
|
|
@@ -1482,6 +1484,9 @@ def main(argv): | |
| else: | ||
| # only need the first two digits for <= 4.3.4 | ||
| dbver = '.'.join(map(str, dbver_split[:2])) | ||
| elif portid == 'cloudberry': | ||
| # Assume Cloudberry will stick to semantic versioning | ||
|
||
| dbver = str(dbver_split[0]) | ||
| elif portid == 'postgres': | ||
| if is_rev_gte(dbver_split, get_rev_num('10.0')): | ||
| # Postgres starting 10.0 uses semantic versioning. Hence, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,6 +189,8 @@ def get_dbver(con_args, portid): | |
| # for Greenplum the 3rd digit is necessary to differentiate | ||
| # 4.3.5+ from versions < 4.3.5 | ||
| match = re.search("Greenplum[a-zA-Z\s]*(\d+\.\d+\.\d+)", versionStr) | ||
| elif portid == 'cloudberry': | ||
| match = re.search("Cloudberry[a-zA-Z\s]*(\d+\.\d+\.\d+)", versionStr) | ||
|
||
| return None if match is None else match.group(1) | ||
| except Exception: | ||
| error_(this, "Failed reading database version", True) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| add_subdirectory(postgres) | ||
| add_subdirectory(greenplum) | ||
| add_subdirectory(cloudberry) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
| add_current_cloudberry_version() |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is still no Cloudberry 3.0 yet. So can remove this file?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apache MADlib should be able to build against both the REL_2_STABLE and main (3.0.0) branches. I believe it is better to keep support for Cloudberry 3.0. As main (3.0) has not released, maybe support for 3.0 can be labelled as experimental.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense. Thanks!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with ed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
| add_current_cloudberry_version() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this empty file needed?
I noticed this when I ran the Apache Release Audit tool (
mvn apache-rat:check).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In apache cloudberry, it's not needed. I will remove it.