flyrain commented on code in PR #199:
URL: https://github.com/apache/polaris/pull/199#discussion_r1735583139
##########
regtests/run_spark_sql.sh:
##########
@@ -36,37 +44,65 @@ fi
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:default-realm}"
-# Use local filesystem by default
-curl -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept:
application/json' -H 'Content-Type: application/json' \
- http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
- -d '{
- "catalog": {
- "name": "manual_spark",
- "type": "INTERNAL",
- "readOnly": false,
- "properties": {
- "default-base-location": "file:///tmp/polaris/"
- },
- "storageConfigInfo": {
- "storageType": "FILE",
- "allowedLocations": [
- "file:///tmp"
- ]
- }
- }
- }'
+# use local filesystem if no arguments are provided
+if [ -z "$1" ]; then
+ # create a catalog backed by the local filesystem
+ curl -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" \
+ -H 'Accept: application/json' \
+ -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
+ -d '{
+ "catalog": {
+ "name": "manual_spark",
+ "type": "INTERNAL",
+ "readOnly": false,
+ "properties": {
+ "default-base-location": "file:///tmp/polaris/"
+ },
+ "storageConfigInfo": {
+ "storageType": "FILE",
+ "allowedLocations": [
+ "file:///tmp"
+ ]
+ }
+ }
+ }'
+else
+ AWS_BASE_LOCATION=$1
+ AWS_ROLE_ARN=$2
+ # Check if AWS variables are set
+ if [ -z "${AWS_BASE_LOCATION}" ] || [ -z "${AWS_ROLE_ARN}" ]; then
+ echo "AWS_BASE_LOCATION or/and AWS_ROLE_ARN not set. Please set them to
create a catalog backed by S3."
Review Comment:
Fixed in the new commit
--
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]