Skip to content

Commit

Permalink
Fix alter distributed (#295)
Browse files Browse the repository at this point in the history
Co-authored-by: djklim87 <klim@manticoresearch.com>
  • Loading branch information
djklim87 and djklim87 committed May 20, 2024
1 parent a0a50fc commit 1354c47
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Plugin/AlterDistributedTable/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ public function run(): Task {
$taskFn = static function (Payload $payload, Client $manticoreClient): TaskResult {

$hasTable = false;
$allDistributedTables = array_column(
iterator_to_array($manticoreClient->getAllTables(['distributed'])),
0
);

foreach ($allDistributedTables as $table) {
if ($table === $payload->table) {
foreach (iterator_to_array($manticoreClient->getAllTables()) as $tableInfo) {
if ($tableInfo[0] === $payload->table) {
if ($tableInfo[1] !== 'distributed') {
throw ManticoreSearchResponseError::create("Table $payload->table should be distributed");
}
$hasTable = true;
break;
}
Expand Down

0 comments on commit 1354c47

Please sign in to comment.