-
Notifications
You must be signed in to change notification settings - Fork 3.7k
branch-2.1: [Fix](ORC) Not push down fixed char type in orc reader #45484 #45525
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
Merged
Merged
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
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
16 changes: 16 additions & 0 deletions
16
...ties/docker-compose/hive/scripts/data/multi_catalog/orc_predicate/orc_predicate_table.hql
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,16 @@ | ||
| CREATE DATABASE IF NOT EXISTS multi_catalog; | ||
| USE multi_catalog; | ||
|
|
||
| create table fixed_char_table ( | ||
| i int, | ||
| c char(2) | ||
| ) stored as orc; | ||
|
|
||
| insert into fixed_char_table values(1,'a'),(2,'b '), (3,'cd'); | ||
|
|
||
| create table type_changed_table ( | ||
| id int, | ||
| name string | ||
| ) stored as orc; | ||
| insert into type_changed_table values (1, 'Alice'), (2, 'Bob'), (3, 'Charlie'); | ||
| ALTER TABLE type_changed_table CHANGE COLUMN id id STRING; |
9 changes: 9 additions & 0 deletions
9
docker/thirdparties/docker-compose/hive/scripts/data/multi_catalog/orc_predicate/run.sh
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,9 @@ | ||
| #!/bin/bash | ||
| set -x | ||
|
|
||
| CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" | ||
|
|
||
| # create table | ||
| hive -f "${CUR_DIR}"/orc_predicate_table.hql | ||
|
|
||
|
|
29 changes: 29 additions & 0 deletions
29
regression-test/data/external_table_p0/hive/test_hive_orc_predicate.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,29 @@ | ||
| -- This file is automatically generated. You should know what you did if you want to edit this | ||
| -- !predicate_fixed_char1 -- | ||
| 1 a | ||
|
|
||
| -- !predicate_fixed_char2 -- | ||
|
|
||
| -- !predicate_changed_type1 -- | ||
| 1 Alice | ||
|
|
||
| -- !predicate_changed_type2 -- | ||
| 2 Bob | ||
|
|
||
| -- !predicate_changed_type3 -- | ||
| 3 Charlie | ||
|
|
||
| -- !predicate_fixed_char1 -- | ||
| 1 a | ||
|
|
||
| -- !predicate_fixed_char2 -- | ||
|
|
||
| -- !predicate_changed_type1 -- | ||
| 1 Alice | ||
|
|
||
| -- !predicate_changed_type2 -- | ||
| 2 Bob | ||
|
|
||
| -- !predicate_changed_type3 -- | ||
| 3 Charlie | ||
|
|
50 changes: 50 additions & 0 deletions
50
regression-test/suites/external_table_p0/hive/test_hive_orc_predicate.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,50 @@ | ||
| // 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_hive_orc_predicate", "p0,external,hive,external_docker,external_docker_hive") { | ||
|
|
||
| String enabled = context.config.otherConfigs.get("enableHiveTest") | ||
| if (enabled == null || !enabled.equalsIgnoreCase("true")) { | ||
| logger.info("disable Hive test.") | ||
| return; | ||
| } | ||
|
|
||
| for (String hivePrefix : ["hive2", "hive3"]) { | ||
| try { | ||
| String hms_port = context.config.otherConfigs.get(hivePrefix + "HmsPort") | ||
| String catalog_name = "${hivePrefix}_test_predicate" | ||
| String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") | ||
|
|
||
| sql """drop catalog if exists ${catalog_name}""" | ||
| sql """create catalog if not exists ${catalog_name} properties ( | ||
| "type"="hms", | ||
| 'hive.metastore.uris' = 'thrift://${externalEnvIp}:${hms_port}' | ||
| );""" | ||
| sql """use `${catalog_name}`.`multi_catalog`""" | ||
|
|
||
| qt_predicate_fixed_char1 """ select * from fixed_char_table where c = 'a';""" | ||
| qt_predicate_fixed_char2 """ select * from fixed_char_table where c = 'a ';""" | ||
|
|
||
| qt_predicate_changed_type1 """ select * from type_changed_table where id = '1';""" | ||
| qt_predicate_changed_type2 """ select * from type_changed_table where id = '2';""" | ||
| qt_predicate_changed_type3 """ select * from type_changed_table where id = '3';""" | ||
|
|
||
| sql """drop catalog if exists ${catalog_name}""" | ||
| } finally { | ||
| } | ||
| } | ||
| } |
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.