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

add AWS sigv4 support #1663

Merged
merged 3 commits into from
May 30, 2023
Merged

Conversation

penghuo
Copy link
Collaborator

@penghuo penghuo commented May 26, 2023

Description

  1. add usage example. https://github.com/penghuo/os-sql/blob/flint-sigv4-pr/flint/docs/index.md#flint-datasource-readwrite
  2. verified in using AWS EMR and AWS OpenSearch
    2.1. switch to Java 11
    by default, EMR using Java 8. Flint Spark is compiled using Java 11.
sudo alternatives --config java

2.2 mapping emr service role in FGAC
mapping AWS service role to FGAC role in AOS security. for example, mapping arn:aws:iam::xxx:role/service-role/AmazonEMR-InstanceProfile-yyy to all_access Roles in AOS Security

2.3 test read AWS OpenSearch data

import org.apache.spark.sql.SQLContext
import org.apache.spark.sql.SQLContext._
import org.apache.spark.sql._
import org.apache.spark.sql.types._

val aos = Map("host" -> "search-mytest-00001-xxx.us-west-2.es.amazonaws.com", "port" -> "-1", "scheme" -> "https", "auth" -> "sigv4", "region" -> "us-west-2")

val sql = new SQLContext(sc)
val df = sql.read.format("flint").options(aos).schema("aInt int").load("t001")
  1. Remove scoverage plugin
    The scoverage plugin adds instrumentation code to scala source code to measure test coverage. when creating an assembly, we don't want to include this instrumentation code.
    Ignore scoverage plugin for now, will add it back later.

Issues Resolved

n/a

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Peng Huo <penghuo@gmail.com>
@penghuo penghuo self-assigned this May 26, 2023
@penghuo penghuo added Flint enhancement New feature or request labels May 26, 2023
@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Merging #1663 (5f8a033) into feature/flint (56e6520) will not change coverage.
The diff coverage is n/a.

@@               Coverage Diff                @@
##             feature/flint    #1663   +/-   ##
================================================
  Coverage            97.19%   97.19%           
  Complexity            4107     4107           
================================================
  Files                  371      371           
  Lines                10464    10464           
  Branches               706      706           
================================================
  Hits                 10170    10170           
  Misses                 287      287           
  Partials                 7        7           
Flag Coverage Δ
sql-engine 97.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Signed-off-by: Peng Huo <penghuo@gmail.com>
@penghuo penghuo marked this pull request as ready for review May 30, 2023 17:30
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

flint/docs/index.md Outdated Show resolved Hide resolved
Signed-off-by: Peng Huo <penghuo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Flint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants