Skip to content

Commit

Permalink
Merge pull request #32 from civitaspo/develop
Browse files Browse the repository at this point in the history
v0.1.1
  • Loading branch information
civitaspo authored Dec 7, 2018
2 parents e28fca2 + 0d4b714 commit 39fb536
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.1.1 (2018-12-07)
==================

* [Fix] `athena.ctas>` Skip removing objects if removable targets do not exist.

0.1.0 (2018-10-20)
==================

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ _export:
repositories:
- https://jitpack.io
dependencies:
- pro.civitaspo:digdag-operator-athena:0.1.0
- pro.civitaspo:digdag-operator-athena:0.1.1
athena:
auth_method: profile

Expand Down Expand Up @@ -145,7 +145,7 @@ Define the below options on properties (which is indicated by `-c`, `--config`).
- **table_mode**: Specify the expected behavior of CTAS results. Available values are `"default"`, `"empty"`, `"data_only"`. See the below explanation of the behaviour. (string, default: `"default"`)
- `"default"`: Do not do any care. This option require the least IAM privileges for digdag, but the behaviour depends on Athena.
- `"empty_table"`: Create a new empty table with the same schema as the select query results.
- `"data_only"`:
- `"data_only"`: Create a new table with data by CTAS, but drop this after CTAS execution. The table created by CTAS is an external table, so the data is left even if the table is dropped.
- **save_mode**: Specify the expected behavior of CTAS. Available values are `"none"`, `"error_if_exists"`, `"ignore"`, `"overwrite"`. See the below explanation of the behaviour. (string, default: `"overwrite"`)
- `"none"`: Do not do any care. This option require the least IAM privileges for digdag, but the behaviour depends on Athena.
- `"error_if_exists"`: Raise error if the distination table or location exists.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'pro.civitaspo'
version = '0.1.0'
version = '0.1.1'

def digdagVersion = '0.9.27'
def awsSdkVersion = "1.11.372"
Expand Down
2 changes: 1 addition & 1 deletion example/example.dig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _export:
- file://${repos}
# - https://jitpack.io
dependencies:
- pro.civitaspo:digdag-operator-athena:0.1.0
- pro.civitaspo:digdag-operator-athena:0.1.1
athena:
auth_method: profile
value: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class AthenaCtasOperator(operatorName: String, context: OperatorContext, systemC
protected def rmObjects(location: String): Unit = {
val uri: AmazonS3URI = AmazonS3URI(location)
val keys: Seq[String] = withS3(_.listObjectsV2(uri.getBucket, uri.getKey)).getObjectSummaries.asScala.map(_.getKey)
if (keys.isEmpty) return
val r: DeleteObjectsResult = withS3(_.deleteObjects(new DeleteObjectsRequest(uri.getBucket).withKeys(keys: _*)))
r.getDeletedObjects.asScala.foreach(o => logger.info(s"Deleted: s3://${uri.getBucket}/${o.getKey}"))
}
Expand Down

0 comments on commit 39fb536

Please sign in to comment.