forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature](jdbc catalog) support db2 jdbc catalog (apache#31627)
- Loading branch information
Showing
25 changed files
with
998 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
# 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. | ||
|
||
DOCKER_DB2_EXTERNAL_PORT=50000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
version: '3' | ||
|
||
services: | ||
doris--db2_11: | ||
image: ibmcom/db2:11.5.0.0a | ||
ports: | ||
- ${DOCKER_DB2_EXTERNAL_PORT}:50000 | ||
privileged: true | ||
healthcheck: | ||
test: ["CMD-SHELL", "su - db2inst1 -c \"db2 connect to doris && db2 'select 1 from sysibm.sysdummy1'\""] | ||
interval: 20s | ||
timeout: 60s | ||
retries: 10 | ||
volumes: | ||
- ./init:/docker-entrypoint-initdb.d | ||
environment: | ||
- LICENSE=accept | ||
- DBNAME=doris | ||
- DB2INSTANCE=db2inst1 | ||
- DB2INST1_PASSWORD=123456 | ||
- TZ=Asia/Shanghai | ||
restart: always | ||
networks: | ||
- doris--db2_network | ||
db2-hello-world: | ||
image: hello-world | ||
depends_on: | ||
doris--db2_11: | ||
condition: service_healthy | ||
networks: | ||
- doris--db2_network | ||
networks: | ||
doris--db2_network: | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 168.50.0.0/24 |
18 changes: 18 additions & 0 deletions
18
docker/thirdparties/docker-compose/db2/init/01-drop-schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- 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. | ||
|
||
drop schema doris_test restrict; |
18 changes: 18 additions & 0 deletions
18
docker/thirdparties/docker-compose/db2/init/02-create-schema.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- 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. | ||
|
||
create schema doris_test; |
40 changes: 40 additions & 0 deletions
40
docker/thirdparties/docker-compose/db2/init/03-create-table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- 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. | ||
|
||
CREATE TABLE doris_test.sample_table ( | ||
id_column INT GENERATED ALWAYS AS IDENTITY, | ||
numeric_column NUMERIC, | ||
decimal_column DECIMAL(31, 10), | ||
decfloat_column DECFLOAT, | ||
float_column FLOAT, | ||
real_column REAL, | ||
double_column DOUBLE, | ||
double_precision_column DOUBLE PRECISION, | ||
smallint_column SMALLINT, | ||
int_column INT, | ||
bigint_column BIGINT, | ||
varchar_column VARCHAR(255), | ||
varcharphic_column VARGRAPHIC(50), | ||
long_varchar_column LONG VARCHAR , | ||
long_varcharphic_column LONG VARGRAPHIC, | ||
char_varying_column CHAR VARYING(255), | ||
char_column CHAR(255), | ||
date_column DATE, | ||
timestamp_column TIMESTAMP, | ||
time_column TIME, | ||
clob_column CLOB | ||
); |
150 changes: 150 additions & 0 deletions
150
docker/thirdparties/docker-compose/db2/init/04-insert.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
-- 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. | ||
|
||
-- Insert normal data | ||
INSERT INTO doris_test.sample_table ( | ||
numeric_column, | ||
decimal_column, | ||
decfloat_column, | ||
float_column, | ||
real_column, | ||
double_column, | ||
double_precision_column, | ||
smallint_column, | ||
int_column, | ||
bigint_column, | ||
varchar_column, | ||
varcharphic_column, | ||
long_varchar_column, | ||
long_varcharphic_column, | ||
char_varying_column, | ||
char_column, | ||
date_column, | ||
timestamp_column, | ||
time_column, | ||
clob_column | ||
) VALUES ( | ||
123, | ||
1234567890.1234567890, | ||
1.234567890, | ||
12345.6789, | ||
12345.6789, | ||
1234567890.1234567890, | ||
1234567890.1234567890, | ||
123, | ||
12345, | ||
123456789012345, | ||
'Varchar text', | ||
'Varcharphic text', | ||
'Long varchar text', | ||
'Long varcharphic text', | ||
'Char varying text', | ||
'Char text', | ||
'2024-01-24', | ||
'2024-01-24-12.34.56.789000', | ||
'12:34:56', | ||
'Sample CLOB text' | ||
); | ||
|
||
-- Insert null data | ||
INSERT INTO doris_test.sample_table ( | ||
numeric_column, | ||
decimal_column, | ||
decfloat_column, | ||
float_column, | ||
real_column, | ||
double_column, | ||
double_precision_column, | ||
smallint_column, | ||
int_column, | ||
bigint_column, | ||
varchar_column, | ||
varcharphic_column, | ||
long_varchar_column, | ||
long_varcharphic_column, | ||
char_varying_column, | ||
char_column, | ||
date_column, | ||
timestamp_column, | ||
time_column, | ||
clob_column | ||
) VALUES ( | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null | ||
); | ||
|
||
INSERT INTO doris_test.sample_table ( | ||
numeric_column, | ||
decimal_column, | ||
decfloat_column, | ||
float_column, | ||
real_column, | ||
double_column, | ||
double_precision_column, | ||
smallint_column, | ||
int_column, | ||
bigint_column, | ||
varchar_column, | ||
varcharphic_column, | ||
long_varchar_column, | ||
long_varcharphic_column, | ||
char_varying_column, | ||
char_column, | ||
date_column, | ||
timestamp_column, | ||
time_column, | ||
clob_column | ||
) VALUES ( | ||
123, | ||
1234567890.1234567890, | ||
1.234567890, | ||
12345.6789, | ||
12345.6789, | ||
1234567890.1234567890, | ||
1234567890.1234567890, | ||
123, | ||
12345, | ||
123456789012345, | ||
'中文一', | ||
'中文二', | ||
'中文三', | ||
'中文四', | ||
'中文五', | ||
'中文六', | ||
'2024-01-24', | ||
'2024-01-24-12.34.56.789000', | ||
'12:34:56', | ||
'中文七' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.