-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[bug](iceberg) use split file format for iceberg scan #65760
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
Open
zhangstar333
wants to merge
4
commits into
apache:master
Choose a base branch
from
zhangstar333:format_type
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...thirdparties/docker-compose/iceberg/scripts/create_preinstalled_scripts/iceberg/run31.sql
This file contains hidden or 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,33 @@ | ||
| -- Bootstrap an Iceberg table whose active snapshot contains both Parquet and ORC data files. | ||
| -- This script is sourced on every Iceberg container start, so keep it repeatable. | ||
|
|
||
| CREATE DATABASE IF NOT EXISTS demo.test_db; | ||
| USE demo.test_db; | ||
|
|
||
| DROP TABLE IF EXISTS mixed_file_format; | ||
|
|
||
| CREATE TABLE mixed_file_format ( | ||
| id INT, | ||
| source STRING | ||
| ) | ||
| USING iceberg | ||
| TBLPROPERTIES ( | ||
| 'format-version' = '2', | ||
| 'write.format.default' = 'parquet' | ||
| ); | ||
|
|
||
| -- The first snapshot's data files are Parquet. | ||
| INSERT INTO mixed_file_format VALUES | ||
| (1, 'parquet'), | ||
| (2, 'parquet'), | ||
| (3, 'parquet'); | ||
|
|
||
| -- Change only the format for subsequent writes. The Parquet files above remain | ||
| -- referenced by the current snapshot, while this append produces ORC files. | ||
| ALTER TABLE mixed_file_format | ||
| SET TBLPROPERTIES ('write.format.default' = 'orc'); | ||
|
|
||
| INSERT INTO mixed_file_format VALUES | ||
| (4, 'orc'), | ||
| (5, 'orc'), | ||
| (6, 'orc'); | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
12 changes: 12 additions & 0 deletions
12
regression-test/data/external_table_p0/iceberg/test_iceberg_mixed_file_formats.out
This file contains hidden or 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,12 @@ | ||
| -- This file is automatically generated. You should know what you did if you want to edit this | ||
| -- !mixed_file_formats_files -- | ||
| orc 3 | ||
| parquet 3 | ||
|
|
||
| -- !mixed_file_formats_data -- | ||
| 1 parquet | ||
| 2 parquet | ||
| 3 parquet | ||
| 4 orc | ||
| 5 orc | ||
| 6 orc |
56 changes: 56 additions & 0 deletions
56
regression-test/suites/external_table_p0/iceberg/test_iceberg_mixed_file_formats.groovy
This file contains hidden or 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("test_iceberg_mixed_file_formats", "p0,external,iceberg,external_docker,external_docker_iceberg") { | ||
| String enabled = context.config.otherConfigs.get("enableIcebergTest") | ||
| if (enabled == null || !enabled.equalsIgnoreCase("true")) { | ||
| logger.info("disable iceberg test.") | ||
| return | ||
| } | ||
|
|
||
| String catalogName = "test_iceberg_mixed_file_formats" | ||
| String restPort = context.config.otherConfigs.get("iceberg_rest_uri_port") | ||
| String minioPort = context.config.otherConfigs.get("iceberg_minio_port") | ||
| String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") | ||
|
|
||
| sql """drop catalog if exists ${catalogName}""" | ||
| sql """ | ||
| CREATE CATALOG ${catalogName} PROPERTIES ( | ||
| 'type' = 'iceberg', | ||
| 'iceberg.catalog.type' = 'rest', | ||
| 'uri' = 'http://${externalEnvIp}:${restPort}', | ||
| 's3.access_key' = 'admin', | ||
| 's3.secret_key' = 'password', | ||
| 's3.endpoint' = 'http://${externalEnvIp}:${minioPort}', | ||
| 's3.region' = 'us-east-1' | ||
| ) | ||
| """ | ||
| sql """switch ${catalogName}""" | ||
| sql """ set parallel_pipeline_task_num = 1; """ | ||
| order_qt_mixed_file_formats_files """ | ||
| SELECT lower(file_format), sum(record_count) | ||
| FROM test_db.mixed_file_format\$files | ||
| GROUP BY lower(file_format) | ||
| ORDER BY 1 | ||
| """ | ||
|
|
||
| order_qt_mixed_file_formats_data """ | ||
| SELECT id, source | ||
| FROM test_db.mixed_file_format | ||
| ORDER BY id | ||
| """ | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.