-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[NewFeature] Support ExternalCatalogResource to simplify external table manage operation. #4559
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
Conversation
ebc6c96 to
c4344cb
Compare
| * CREATE EXTERNAL RESOURCE "odbc_mysql" | ||
| * PROPERTIES | ||
| * ( | ||
| * "type" = "external_catalog", [required] |
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.
The current hierarchy is:
Resource -> external_catalog -> odbc_catalog
But I think it can be simplified as:
Resource -> odbc_catalog
So the "type" is "odbc_catalog", and "odbc_type" is "mysql".
| try { | ||
| // resource name | ||
| adler32.update(externalCatalogResourceName.getBytes(charsetName)); | ||
| // name |
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.
the following host, port maybe null. we need to check them or use getxxx() methods.
…le operation. Fix apache#4556 1. Add new Resource ExternalCatalogResource ``` create external resource "odbc" properties ( "type" = "external_catalog", (required) "user" = "test",(required) "password" = "", (required) "host" = "192.168.0.1", (required) "port" = "8086", (required) "type" = "oracle" , (optinal,only odbc exteranl table use) "driver" = "Oracle 19 ODBC driver" (optional,only odbc exteranl table use) ) ``` 2.After create ExternalCatalogResource, can create external table like: ``` CREATE TABLE `test_mysql` ( `k1` tinyint(4) NOT NULL, `k2` smallint(6) NOT NULL, `k3` int(11) NOT NULL, `k4` bigint(20) NOT NULL, `k5` decimal(9,3) NOT NULL, `k6` char(5) NOT NULL, `k10` date DEFAULT NULL, `k11` datetime DEFAULT NULL, `k7` varchar(20) NOT NULL, `k8` double NOT NULL, `k9` float NOT NULL ) ENGINE=MYSQL PROPERTIES ( "external_catalog_resource" = "odbc", "database" = "test", "table" = "test" ); ```
c4344cb to
e6c3685
Compare
e6c3685 to
4c94d85
Compare
morningman
left a comment
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.
LGTM
…ug. apache#56083 (apache#5646) picked from apache#56083 related issue: apache#4559 Co-authored-by: James <lijibing@selectdb.com>
Fix #4556
2.After create ExternalCatalogResource, can create external table like:
Proposed changes
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
Types of changes
What types of changes does your code introduce to Doris?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.