Skip to content

Commit

Permalink
Merge pull request #33 from civitaspo/normalize-default-table-name
Browse files Browse the repository at this point in the history
[athena.ctas] Use normalized table name by default
  • Loading branch information
civitaspo authored Dec 7, 2018
2 parents 0d4b714 + 6ac9f33 commit 4edf895
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Define the below options on properties (which is indicated by `-c`, `--config`).

- **select_query**: The select SQL statements or file to be executed for a new table by [`Create Table As Select`]((https://aws.amazon.com/jp/about-aws/whats-new/2018/10/athena_ctas_support/)). You can use digdag's template engine like `${...}` in the SQL query. (string, required)
- **database**: The database name for query execution context. (string, optional)
- **table**: The table name for the new table (string, default: `digdag-athena-ctas-${session_uuid}`)
- **table**: The table name for the new table (string, default: `digdag_athena_ctas_${session_uuid.replaceAll("-", "_")}`)
- **output**: Output location for data created by CTAS (string, default: `"s3://aws-athena-query-results-${AWS_ACCOUNT_ID}-<AWS_REGION>/Unsaved/${YEAR}/${MONTH}/${DAY}/${athena_query_id}/"`)
- **format**: The data format for the CTAS query results, such as `"orc"`, `"parquet"`, `"avro"`, `"json"`, or `"textfile"`. (string, default: `"parquet"`)
- **compression**: The compression type to use for `"orc"` or `"parquet"`. (string, default: `"snappy"`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AthenaCtasOperator(operatorName: String, context: OperatorContext, systemC

protected val selectQueryOrFile: String = params.get("select_query", classOf[String])
protected val database: Optional[String] = params.getOptional("database", classOf[String])
protected val table: String = params.get("table", classOf[String], s"digdag-athena-ctas-$sessionUuid")
protected val table: String = params.get("table", classOf[String], s"digdag_athena_ctas_${sessionUuid.replaceAll("-", "_")}")
protected val output: Optional[String] = params.getOptional("output", classOf[String])
protected val format: String = params.get("format", classOf[String], "parquet")
protected val compression: String = params.get("compression", classOf[String], "snappy")
Expand Down

0 comments on commit 4edf895

Please sign in to comment.