If you are using JWT for authentication, then you will have to pass the JWT token to the EMR cluster. You can do this by either passing the JWT token directly as a command-line argument or using a file path containing the JWT token.
To pass the JWT token directly as a command-line argument, use the following configuration when connecting to the cluster:
## Create a DataFrame.data=spark.createDataFrame([("100","2015-01-01","2015-01-01T13:51:39.340396Z"),
("101","2015-01-01","2015-01-01T12:14:58.597216Z"),
("102","2015-01-01","2015-01-01T13:51:40.417052Z"),
("103","2015-01-01","2015-01-01T13:51:40.519832Z")],["id","creation_date","last_update_time"])## Write a DataFrame as a Iceberg dataset to the Amazon S3 location.spark.sql("""CREATE TABLE IF NOT EXISTS <my_catalog>.<db_name>.<table_name> (id string, creation_date string, last_update_time string) USING iceberg location 's3://${S3_BUCKET}/${TABLE_PATH}'""")data.writeTo("<my_catalog>.<db_name>.<table_name>").append()df=spark.read.format("iceberg").load("<my_catalog>.<db_name>.<table_name")df.show()
## Create a DataFrame.valdata=Seq(("100","2015-01-01","2015-01-01T13:51:39.340396Z"),
("101","2015-01-01","2015-01-01T12:14:58.597216Z"),
("102","2015-01-01","2015-01-01T13:51:40.417052Z"),
("103","2015-01-01","2015-01-01T13:51:40.519832Z")).toDF("id","creation_date","last_update_time")## Write a DataFrame as a Iceberg dataset to the Amazon S3 location.spark.sql("""CREATE TABLE IF NOT EXISTS <my_catalog>.<db_name>.<table_name> (id string, creation_date string, last_update_time string) USING iceberg location 's3://${S3_BUCKET}/${TABLE_PATH}'""")data.writeTo("<my_catalog>.<db_name>.<table_name>").append()valdf=spark.read.format("iceberg").load("<my_catalog>.<db_name>.<table_name")df.show()
When using Spark SQL, the query retrieves the metadata from AWS Glue catalog or Hive Metastore, which provides the location of the data in S3. The access to these files is controlled by Privacera.
For running SQL commands, the cluster should have access to the AWS Glue catalog or Hive Metastore.