Skip to content
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

[FLINK-13437][test] Add Hive SQL E2E test #10709

Closed
wants to merge 7 commits into from

Conversation

zjuwangg
Copy link
Contributor

What is the purpose of the change

Set up a docker-based yarn-cluster and hive service using the new java based test runtime framework, add HiveConnectorITCase to cover data read/write function, including:

  1. hive data writen by Hive, read by Flink.
  2. hive data writen by Flink, read by Hive.
  3. read/write to a non-partition table.
  4. multi-format for read and write, cover textfile/orc/parquet
    Based on this PR, we can add more test such as function/view in further more.

Brief change log

  • 3488ec6 Add e2e test for hive data connector using docker based environment
  • 2f8b127 refactor hive e2e test using new java-based test framework
  • 76c6f08 add muliti format test and all data types test case
  • 31cc4b7 remote e2e bash test

Verifying this change

  • *Added integration tests for end-to-end deployment *

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable )

@zjuwangg
Copy link
Contributor Author

cc @bowenli86 @xuefuz @JingsongLi @KurtYoung @lirui-apache to have a review

@zjuwangg
Copy link
Contributor Author

It's a base work, and we can add more ITCase based on this PR.

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 27, 2019

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit e580f03 (Fri Feb 28 21:48:31 UTC 2020)

Warnings:

  • 3 pom.xml files were touched: Check for build and licensing issues.
  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 27, 2019

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

@zjuwangg
Copy link
Contributor Author

@bowenli86 @JingsongLi Do you guys have time to have a basic look?


@Override
public void before() throws Exception {
buildDockerImage();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, building the docker image will take a while for the 1st time, and will be pretty fast for later runs, correct?

* YarnClusterJobController can be used to fetch the execute log.
*/
public static class YarnClusterJobController implements JobController {
private List<String> lines;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it final

localFlinkDir = temporaryFolder.newFolder().toPath();

LOG.info("Copying distribution to {}.", localFlinkDir);
TestUtils.copyDirectory(originalFlinkDir, localFlinkDir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to copy the dist dir?

@Override
public ClusterController startCluster(int numTaskManagers) throws IOException {
if (!deployFlinkToRemote) {
yarnCluster.copyLocalFileToYarnMaster(localFlinkDir.toAbsolutePath().toString(), remoteFlinkDir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of copying the dist dir to the container, can we instead mount the dir to container when it's started, with the -v option?

nohup sudo -E -u mapred $HADOOP_PREFIX/bin/mapred historyserver 2>> /var/log/hadoop/historyserver.err >> /var/log/hadoop/historyserver.out &

hdfs dfsadmin -safemode wait
while [ $? -ne 0 ]; do hdfs dfsadmin -safemode wait; done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to retry if the command fails? I think it's a potential infinite loop if something goes wrong.

hdfs dfsadmin -safemode wait
while [ $? -ne 0 ]; do hdfs dfsadmin -safemode wait; done

hdfs dfs -chown hdfs:hadoop /
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have disabled dfs.permissions. So why we need to run these chown?

Comment on lines +154 to +162
JobSubmission.JobSubmissionBuilder jobSubmissionBuilder = new JobSubmission.JobSubmissionBuilder(testJarPath);
jobSubmissionBuilder.setParallelism(1)
.addOption("-ys", "1")
.addOption("-ytm", "1000")
.addOption("-yjm", "1000")
.addOption("-c", HiveReadWriteDataExample.class.getCanonicalName())
.addArgument("--hiveVersion", hiveVersion)
.addArgument("--sourceTable", "all_types_table")
.addArgument("--targetTable", "dest_all_types_table");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the job submission code is the same for the 2 test cases. Can we reuse it?

@bowenli86
Copy link
Member

@lirui-apache @JingsongLi can you guys help review? I can help merge once it passes

@JingsongLi
Copy link
Contributor

Thanks @zjuwangg for your great work! I will continue to working on this.

@sjwiesman
Copy link
Contributor

sjwiesman commented Jun 8, 2020

What's the status of this? With the new sql filesystem connector I suspect more flink users will rely on Hive integration. It would be good to try and get this in for 1.12.

@JingsongLi
Copy link
Contributor

What's the status of this? With the new sql filesystem connector I suspect more flink users will rely on Hive integration. It would be good to try and get this in for 1.12.

Yes, we should move on.
I plan to modify testing to sql-client but don't have enough time in 1.11, we should finish this in 1.12.

@zjuwangg
Copy link
Contributor Author

Close this comment!

@zjuwangg zjuwangg closed this Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants