Allow overriding temporary table name generation
The currently generated name is 43-char length, which is too long in
certain circumstances (databases).
@@ -297,7 +297,7 @@ public class BaseJdbcClient
}
String catalog = connection.getCatalog();
- String temporaryName = "tmp_presto_" + UUID.randomUUID().toString().replace("-", "");
+ String temporaryName = generateTemporaryTableName();
StringBuilder sql = new StringBuilder()
.append("CREATE TABLE ")
.append(quoted(catalog, schema, temporaryName))
@@ -337,6 +337,11 @@ public class BaseJdbcClient
}
}
+ protected String generateTemporaryTableName()
+ {
+ return "tmp_presto_" + UUID.randomUUID().toString().replace("-", "");
+ }
+
@Override
public void commitCreateTable(JdbcOutputTableHandle handle)
{
