-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
bp #41020
- Loading branch information
Showing
6 changed files
with
161 additions
and
13 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
docker/thirdparties/docker-compose/iceberg/scripts/create_preinstalled_scripts/run06.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,25 @@ | ||
use paimon; | ||
create database if not exists test_paimon_spark; | ||
use test_paimon_spark; | ||
|
||
drop table if exists test_tb_mix_format; | ||
create table test_tb_mix_format ( | ||
id int, | ||
value int, | ||
par string | ||
) PARTITIONED BY (par) TBLPROPERTIES ( | ||
'primary-key' = 'id, par', | ||
'bucket'=1000, | ||
'file.format'='orc' | ||
); | ||
-- orc format in partition a | ||
insert into test_tb_mix_format values (1,1,'a'),(2,1,'a'),(3,1,'a'),(4,1,'a'),(5,1,'a'),(6,1,'a'),(7,1,'a'),(8,1,'a'),(9,1,'a'),(10,1,'a'); | ||
-- update some data, these splits will be readed by jni | ||
insert into test_tb_mix_format values (1,2,'a'),(2,2,'a'),(3,2,'a'),(4,2,'a'),(5,2,'a'); | ||
-- parquet format in partition b | ||
alter table test_tb_mix_format set TBLPROPERTIES ('file.format'='parquet'); | ||
insert into test_tb_mix_format values (1,1,'b'),(2,1,'b'),(3,1,'b'),(4,1,'b'),(5,1,'b'),(6,1,'b'),(7,1,'b'),(8,1,'b'),(9,1,'b'),(10,1,'b'); | ||
-- update some data, these splits will be readed by jni | ||
insert into test_tb_mix_format values (1,2,'b'),(2,2,'b'),(3,2,'b'),(4,2,'b'),(5,2,'b'); | ||
-- delete foramt in table properties, doris should get format by file name | ||
alter table test_tb_mix_format unset TBLPROPERTIES ('file.format'); |
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
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
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
45 changes: 45 additions & 0 deletions
45
regression-test/data/external_table_p0/paimon/paimon_tb_mix_format.out
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,45 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !order -- | ||
1 2 a | ||
2 2 a | ||
3 2 a | ||
4 2 a | ||
5 2 a | ||
6 1 a | ||
7 1 a | ||
8 1 a | ||
9 1 a | ||
10 1 a | ||
1 2 b | ||
2 2 b | ||
3 2 b | ||
4 2 b | ||
5 2 b | ||
6 1 b | ||
7 1 b | ||
8 1 b | ||
9 1 b | ||
10 1 b | ||
|
||
-- !order -- | ||
1 2 a | ||
2 2 a | ||
3 2 a | ||
4 2 a | ||
5 2 a | ||
6 1 a | ||
7 1 a | ||
8 1 a | ||
9 1 a | ||
10 1 a | ||
1 2 b | ||
2 2 b | ||
3 2 b | ||
4 2 b | ||
5 2 b | ||
6 1 b | ||
7 1 b | ||
8 1 b | ||
9 1 b | ||
10 1 b | ||
|
56 changes: 56 additions & 0 deletions
56
regression-test/suites/external_table_p0/paimon/paimon_tb_mix_format.groovy
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,56 @@ | ||
// 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. | ||
|
||
suite("paimon_tb_mix_format", "p0,external,doris,external_docker,external_docker_doris") { | ||
|
||
logger.info("start paimon test") | ||
String enabled = context.config.otherConfigs.get("enablePaimonTest") | ||
if (enabled == null || !enabled.equalsIgnoreCase("true")) { | ||
logger.info("disabled paimon test") | ||
return | ||
} | ||
|
||
try { | ||
String catalog_name = "paimon_tb_mix_format" | ||
String minio_port = context.config.otherConfigs.get("iceberg_minio_port") | ||
String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") | ||
|
||
sql """drop catalog if exists ${catalog_name}""" | ||
sql """CREATE CATALOG ${catalog_name} PROPERTIES ( | ||
'type'='paimon', | ||
'warehouse' = 's3://warehouse/wh/', | ||
"s3.access_key" = "admin", | ||
"s3.secret_key" = "password", | ||
"s3.endpoint" = "http://${externalEnvIp}:${minio_port}", | ||
"s3.region" = "us-east-1" | ||
);""" | ||
|
||
logger.info("catalog " + catalog_name + " created") | ||
sql """switch ${catalog_name};""" | ||
logger.info("switched to catalog " + catalog_name) | ||
sql """use test_paimon_spark;""" | ||
|
||
sql """set force_jni_scanner=true""" | ||
qt_order """ select * from test_tb_mix_format order by par,id; """ | ||
|
||
sql """set force_jni_scanner=false""" | ||
qt_order """ select * from test_tb_mix_format order by par,id; """ | ||
} finally { | ||
sql """set force_jni_scanner=false""" | ||
} | ||
|
||
} |