private async Task CreateTempTableAsync()

in code/KustoCopyConsole/Runner/TempTableCreatingRunner.cs [115:143]


        private async Task CreateTempTableAsync(
            TempTableRowItem tempTableItem,
            bool doesPreExist,
            CancellationToken ct)
        {
            var activity = RowItemGateway.InMemoryCache
                .ActivityMap[tempTableItem.ActivityName]
                .RowItem;
            var dbCommandClient = DbClientFactory.GetDbCommandClient(
                activity.DestinationTable.ClusterUri,
                activity.DestinationTable.DatabaseName);
            var priority = new KustoPriority(tempTableItem.GetIterationKey());

            if (doesPreExist)
            {
                await dbCommandClient.DropTableIfExistsAsync(
                    priority,
                    tempTableItem.TempTableName,
                    ct);
            }
            await dbCommandClient.CreateTempTableAsync(
                priority,
                activity.DestinationTable.TableName,
                tempTableItem.TempTableName,
                ct);

            tempTableItem = tempTableItem.ChangeState(TempTableState.Created);
            RowItemGateway.Append(tempTableItem);
        }