-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Enable only Hadoop 3.1 testing version for S3 Select JSON tests #13486
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
+516
−129
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
58 changes: 58 additions & 0 deletions
58
plugin/trino-hive-hadoop2/bin/run_hive_s3_select_json_tests.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,58 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Similar to run_hive_s3_tests.sh, but has only Amazon S3 Select JSON tests. This is in a separate file as the JsonSerDe | ||
| # class is only available in Hadoop 3.1 version, and so we would only test JSON pushdown against the 3.1 version. | ||
|
|
||
| set -euo pipefail -x | ||
|
|
||
| . "${BASH_SOURCE%/*}/common.sh" | ||
|
|
||
| abort_if_not_gib_impacted | ||
|
|
||
| check_vars S3_BUCKET S3_BUCKET_ENDPOINT \ | ||
| AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY | ||
|
|
||
| cleanup_hadoop_docker_containers | ||
| start_hadoop_docker_containers | ||
|
|
||
| test_directory="$(date '+%Y%m%d-%H%M%S')-$(uuidgen | sha1sum | cut -b 1-6)-s3select-json" | ||
|
|
||
| # insert AWS credentials | ||
| deploy_core_site_xml core-site.xml.s3-template \ | ||
| AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY S3_BUCKET_ENDPOINT | ||
|
|
||
| # create test tables | ||
| # can't use create_test_tables because the first table is created with different commands | ||
| table_path="s3a://${S3_BUCKET}/${test_directory}/trino_s3select_test_external_fs_json/" | ||
| exec_in_hadoop_master_container hadoop fs -mkdir -p "${table_path}" | ||
| exec_in_hadoop_master_container /docker/files/hadoop-put.sh /docker/files/test_table.json{,.gz,.bz2} "${table_path}" | ||
| exec_in_hadoop_master_container sudo -Eu hive beeline -u jdbc:hive2://localhost:10000/default -n hive -e " | ||
| CREATE EXTERNAL TABLE trino_s3select_test_external_fs_json(col_1 bigint, col_2 bigint) | ||
| ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe' | ||
| LOCATION '${table_path}'" | ||
|
|
||
| stop_unnecessary_hadoop_services | ||
|
|
||
| # restart hive-metastore to apply S3 changes in core-site.xml | ||
| docker exec "$(hadoop_master_container)" supervisorctl restart hive-metastore | ||
| retry check_hadoop | ||
|
|
||
| # run product tests | ||
| pushd "${PROJECT_ROOT}" | ||
| set +e | ||
| ./mvnw ${MAVEN_TEST:--B} -pl :trino-hive-hadoop2 test -P test-hive-hadoop2-s3-select-json \ | ||
| -DHADOOP_USER_NAME=hive \ | ||
| -Dhive.hadoop2.metastoreHost=localhost \ | ||
| -Dhive.hadoop2.metastorePort=9083 \ | ||
| -Dhive.hadoop2.databaseName=default \ | ||
| -Dhive.hadoop2.s3.awsAccessKey="${AWS_ACCESS_KEY_ID}" \ | ||
| -Dhive.hadoop2.s3.awsSecretKey="${AWS_SECRET_ACCESS_KEY}" \ | ||
| -Dhive.hadoop2.s3.writableBucket="${S3_BUCKET}" \ | ||
| -Dhive.hadoop2.s3.testDirectory="${test_directory}" | ||
| EXIT_CODE=$? | ||
| set -e | ||
| popd | ||
|
|
||
| cleanup_hadoop_docker_containers | ||
|
|
||
| exit "${EXIT_CODE}" |
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
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.
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.
This is unnecessary complexity for ci.yml and quite an overhead if all we want is to run a test method under some configs only.
This perhaps could be done more simply
hive-tests-${{ matrix.config }}.shso they populate some config-related profilewould that work?
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.
Hi, not sure I follow - so in this PR, I've defined a new profile in pom.xml to run the JSON test:
This test is now excluded from the Hive S3 tests profile.
In ci.yml, I initially had the following:
But switched it to the following based on Jan's feedback to be consistent with the other tests.
Are you referring to switching back to the first approach or something else?
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.
I am not convinced we need a separate run of tests, do we?
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.
Shall I remove the
Run Hive S3 Select JSON Testsstep and add it toRun Hive S3 Testsstep, like this: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.
Yes, that would make sense to do.