TheerachotTle commented on issue #214:
URL: https://github.com/apache/polaris/issues/214#issuecomment-2315986730
I'm using spark 3.5.0
create catalog with POST request
```
{"name": "testcatalog", "type": "INTERNAL", "properties": {
"default-base-location": "s3://bucket/folder/"
},"storageConfigInfo": {
"roleArn": "arn:aws:iam::xxxxxxxxx:role/demo-polaris",
"storageType": "S3",
"allowedLocations": [
"s3://bucket/folder"
]
} }
```
config of spark
```
spark = SparkSession.builder \
.config("spark.jars.packages","org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.5.2,org.apache.iceberg:iceberg-aws-bundle:1.5.2,org.apache.hadoop:hadoop-aws:3.4.0,org.apache.hadoop:hadoop-common:3.4.0")
\
.config("spark.sql.extensions",
"org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions") \
.config('spark.sql.catalog.polaris.header.X-Iceberg-Access-Delegation', 'true')
\
.config("spark.sql.catalog.polaris.uri", POLARIS_URI) \
.config("spark.sql.catalog.polaris.type", "rest") \
.config("spark.sql.catalog.polaris",
"org.apache.iceberg.spark.SparkCatalog") \
.config("spark.sql.catalog.polaris.warehouse",
POLARIS_CATALOG_NAME) \
.config("spark.sql.catalog.polaris.io-impl",
"org.apache.iceberg.aws.s3.S3FileIO") \
.config("spark.hadoop.fs.s3a.impl",
"org.apache.hadoop.fs.s3a.S3AFileSystem") \
.config('spark.sql.catalog.polaris.credential',
POLARIS_CREDENTIALS) \
.config('spark.sql.catalog.polaris.scope', POLARIS_SCOPE) \
.config('spark.sql.catalog.polaris.token-refresh-enabled',
'true') \
.getOrCreate()
```
code to reproduce
```
spark.sql("USE polaris")
spark.sql("USE NAMESPACE namespace1")
spark.sql("""CREATE TABLE IF NOT EXISTS table1 (
id bigint NOT NULL COMMENT 'unique id',
data string)
USING iceberg
LOCATION "s3://bucket/folder/namespace1/table1"
""")
spark.sql("INSERT INTO table1 VALUES (1,'test')")
spark.sql("""CALL polaris.system.remove_orphan_files(
table => 'polaris.namespace1.table1'
)
""").show()
```
--
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]