Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 029e3fc

Browse files
shenh062326tdcmeehan
authored andcommitted
Add queryId to Hive temporary table names
1 parent 3127c28 commit 029e3fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,8 @@ public ConnectorTableHandle createTemporaryTable(ConnectorSession session, List<
10791079
validateColumns(storageFormat, columnHandles);
10801080

10811081
HiveStorageFormat finalStorageFormat = storageFormat;
1082-
String tableName = PRESTO_TEMPORARY_TABLE_NAME_PREFIX + finalStorageFormat.name() + "_" + randomUUID().toString().replaceAll("-", "_");
1082+
String tableName = PRESTO_TEMPORARY_TABLE_NAME_PREFIX + finalStorageFormat.name() +
1083+
"_" + session.getQueryId().replaceAll("-", "_") + "_" + randomUUID().toString().replaceAll("-", "_");
10831084
Table table = Table.builder()
10841085
.setDatabaseName(schemaName)
10851086
.setTableName(tableName)

0 commit comments

Comments
 (0)