代码拉取完成,页面将自动刷新
This example shows how to call the EMR Serverless API using the Java SDK.
In it, we use a new maven project with the latest preview jar for EMR Serverless.
The example below will:
SparkPi
applicationIt is intended as a high-level demo of how to call the EMR Serverless API from the Java SDK.
In the myapp
folder.
mvn install
mvn exec:java -Dexec.mainClass="com.example.myapp.App" -Dexec.args="--bucket <S3_BUCKET> --role-arn arn:aws:iam::123456789012:role/emr-serverless-job-role"
Once the job is running, you can also view Spark logs.
# View Spark logs
aws s3 ls s3://<S3_BUCKET>/emr-serverless/logs/applications/<application_id>/jobs/<job_run_id>/
Or copy the stdout to view the results.
aws s3 cp s3://<S3_BUCKET>/emr-serverless/logs/applications/<application_id>/jobs/<job_run_id>/SPARK_DRIVER/stdout.gz - | gunzip
If you like, you can build a jar and run it independently and modify the Spark job arguments as well.
mvn package
java -cp target/myapp-1.0-SNAPSHOT.jar com.example.myapp.App -h
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。