shari-haran opened a new issue, #10723:
URL: https://github.com/apache/iceberg/issues/10723

   ### Query engine
   
   Create table - Athena
   Access Data - Glue Spark
   
   ### Question
   
   I have created a "bucket-abc-east" in east region and a second bucket 
"bucket-def-west" in west region. I have also setup a replication from east 
bucket to west and have established the multi region access point with an alias 
mr51f8zsfw1.mrap. I tested the mrap using cloudshell and it is working as 
expected
   
   Glue Catalog East (called iceberg): I created a glue database called iceberg 
in east with dummy customer table in east 1 through Athena.
   Glue Catalog West (called icebergwest): I created a glue database called 
icebergwest in west and populated this database by setting up a glue cralwer in 
west.
   
   
   Table Create Code from Athena: 
   create table iceberg.customer (name string, id int) partitioned by (id) 
location 's3://bucket-abc-east/' tblproperties ('table_type' = 'ICEBERG')
   
   Table Insert Code from Athena:
   insert into customer values ('AWS',1)
   
   I'm writing a simple glue job in "west" region with the below code.
   
   import pyspark
   from pyspark.context import SparkContext
   from pyspark.sql.session import SparkSession
   from awsglue.context import GlueContext
   
   import sys
   from awsglue.transforms import *
   from awsglue.utils import getResolvedOptions
   from awsglue.job import Job
   
   
   spark = SparkSession.builder \
   .config(f"spark.sql.catalog.glue_catalog", 
"org.apache.iceberg.spark.SparkCatalog") \
   .config(f"spark.sql.catalog.glue_catalog.catalog-impl", 
"org.apache.iceberg.aws.glue.GlueCatalog") \
   .config(f"spark.sql.catalog.glue_catalog.io-impl", 
"org.apache.iceberg.aws.s3.S3FileIO") \
   
.config(f"spark.sql.extensions","org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions")
 \
   .config(f"spark.sql.catalog.glue_catalog.type","glue") \
   .config(f"spark.sql.catalog.glue_catalog.warehouse","s3://bucket-abc-east/") 
\
   .config(f"spark.sql.catalog.glue_catalog.s3.use-arn-region-enabled","false") 
\
   
.config(f"spark.sql.catalog.test.s3.access-points.bucket-abc-east","arn:aws:s3::123456789012:accesspoint/mr51f8zsfw1.mrap")
 \
   
.config(f"spark.sql.catalog.test.s3.access-points.bucket-abc-east","arn:aws:s3::123456789012:accesspoint/mr51f8zsfw1.mrap")
 \
   .enableHiveSupport().getOrCreate()
   
   spark.sql("SHOW DATABASES").show()
   spark.sql("use icebergwest")
   spark.sql("SHOW TABLES").show()
   spark.sql("select * from glue_catalog.iceberg.customer").show()
   
   Question: 
   1. If I comment out the statment "spark.sql("select * from 
glue_catalog.iceberg.customer").show()" then the glue job works fine without 
any issues.
   2. If I run the code with select statement then I'm getting the below 2 type 
of errors.
   
   Error Category: UNCLASSIFIED_ERROR; An error occurred while calling 
o111.sql. The Spark SQL phase analysis failed with an internal error. Please, 
fill a bug report in, and provide the full stack trace.
   
   Error Category: S3_ERROR; An error occurred while calling o111.sql. The 
bucket you are attempting to access must be addressed using the specified 
endpoint. Please send all future requests to this endpoint. (Service: S3, 
Status Code: 301, Request ID: TKS038XPJ2HRX2YH, Extended Request ID: 
Q9KPK76mp1rXpIWljrdjw9kUlb/LS3JckP6YUxXR1mGHDcIz189Ty9R8q28x8PH2wjq6bDSL9eM=)
   
   
   I read through most of the articles but I couldn't find a detailed solution 
to fix this unfortunately


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to