Skip to content

Commit

Permalink
Merge pull request #55300 from ClickHouse/backport/23.3/54844
Browse files Browse the repository at this point in the history
Backport #54844 to 23.3: Fix "Invalid number of rows in Chunk" in MaterializedPostgreSQL
  • Loading branch information
robot-ch-test-poll1 committed Oct 7, 2023
2 parents 1919fe0 + 98ff514 commit 8ac8483
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Storages/PostgreSQL/MaterializedPostgreSQLConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,20 @@ void MaterializedPostgreSQLConsumer::readTupleData(
insertDefaultValue(buffer, column_idx);
break;
}
case 'b': /// Binary data.
{
LOG_WARNING(log, "We do not yet process this format of data, will insert default value");
insertDefaultValue(buffer, column_idx);
break;
}
default:
{
LOG_WARNING(log, "Unexpected identifier: {}. This is a bug! Please report an issue on github", identifier);
chassert(false);

insertDefaultValue(buffer, column_idx);
break;
}
}
};

Expand All @@ -281,6 +295,10 @@ void MaterializedPostgreSQLConsumer::readTupleData(
}
catch (...)
{
LOG_ERROR(log,
"Got error while receiving value for column {}, will insert default value. Error: {}",
column_idx, getCurrentExceptionMessage(true));

insertDefaultValue(buffer, column_idx);
/// Let's collect only the first exception.
/// This delaying of error throw is needed because
Expand Down

0 comments on commit 8ac8483

Please sign in to comment.