@Override
public HiveOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorNewTableLayout> layout)
{
checkNoRollback();
verifyJvmTimeZone();
checkArgument(!isNullOrEmpty(tableMetadata.getOwner()), "Table owner is null or empty");
HiveStorageFormat hiveStorageFormat = getHiveStorageFormat(tableMetadata.getProperties());
List<String> partitionedBy = getPartitionedBy(tableMetadata.getProperties());
Map<String, String> additionalTableParameters = tableParameterCodec.encode(tableMetadata.getProperties());
SchemaTableName schemaTableName = tableMetadata.getTable();
String schemaName = schemaTableName.getSchemaName();
String tableName = schemaTableName.getTableName();
List<HiveColumnHandle> columnHandles = getColumnHandles(connectorId, tableMetadata, ImmutableSet.copyOf(partitionedBy));
HiveOutputTableHandle result = new HiveOutputTableHandle(
connectorId,
schemaName,
tableName,
columnHandles,
session.getQueryId(),
locationService.forNewTable(session.getQueryId(), schemaName, tableName),
hiveStorageFormat,
partitionedBy,
tableMetadata.getOwner(),
additionalTableParameters);
setRollback(() -> rollbackCreateTable(result));
return result;
}