From 5a86da2825b858d37d3ec587b31817b7ce6c31d8 Mon Sep 17 00:00:00 2001 From: Akinori Hiratani Date: Sat, 14 Dec 2019 21:17:43 +0900 Subject: [PATCH] Add conversion of hyphen into underscore before setting STAGING_DATASET_ID --- src/main/scala/com/spotify/spark/bigquery/BigQueryClient.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/com/spotify/spark/bigquery/BigQueryClient.scala b/src/main/scala/com/spotify/spark/bigquery/BigQueryClient.scala index 880e08b..c32b36a 100644 --- a/src/main/scala/com/spotify/spark/bigquery/BigQueryClient.scala +++ b/src/main/scala/com/spotify/spark/bigquery/BigQueryClient.scala @@ -146,7 +146,7 @@ private[bigquery] class BigQueryClient(conf: Configuration) { private def stagingDataset(location: String): DatasetReference = { // Create staging dataset if it does not already exist val prefix = conf.get(STAGING_DATASET_PREFIX, STAGING_DATASET_PREFIX_DEFAULT) - conf.setIfUnset(STAGING_DATASET_ID, prefix + location.toLowerCase) + conf.setIfUnset(STAGING_DATASET_ID, prefix + location.toLowerCase.replaceAll("-", "_")) val datasetId = conf.get(STAGING_DATASET_ID) try { bigquery.datasets().get(projectId, datasetId).execute()