From 80e82f8d0d733bb176ac167edc7df71851f8e2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Kokosi=C5=84ski?= Date: Tue, 28 Mar 2017 10:52:44 +0200 Subject: [PATCH] Make mutable table suffix shorter Pull request: https://github.com/prestodb/tempto/pull/214 --- .../internal/fulfillment/table/TableNameGenerator.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tempto-core/src/main/java/com/teradata/tempto/internal/fulfillment/table/TableNameGenerator.java b/tempto-core/src/main/java/com/teradata/tempto/internal/fulfillment/table/TableNameGenerator.java index ee56ee6a..ee9c95fe 100644 --- a/tempto-core/src/main/java/com/teradata/tempto/internal/fulfillment/table/TableNameGenerator.java +++ b/tempto-core/src/main/java/com/teradata/tempto/internal/fulfillment/table/TableNameGenerator.java @@ -14,7 +14,7 @@ package com.teradata.tempto.internal.fulfillment.table; -import java.util.UUID; +import static org.apache.commons.lang3.RandomStringUtils.random; public class TableNameGenerator { @@ -22,17 +22,11 @@ public class TableNameGenerator public String generateMutableTableNameInDatabase(String baseTableName) { - String tableSuffix = randomUUID().replace("-", ""); - return MUTABLE_TABLE_NAME_PREFIX + baseTableName + "_" + tableSuffix; + return MUTABLE_TABLE_NAME_PREFIX + baseTableName + "_" + random(8); } public boolean isMutableTableName(String tableNameInDatabase) { return tableNameInDatabase.startsWith(MUTABLE_TABLE_NAME_PREFIX); } - - private String randomUUID() - { - return UUID.randomUUID().toString(); - } }