protected function getItemKeyByEventId(Identifier $eventId, array $context = []): ?array
    {
        $tableName = $this->getTableNameForRead($context);
        $params = [
            'TableName'                 => $tableName,
            'IndexName'                 => EventStoreTable::GSI_EVENT_ID_NAME,
            'Limit'                     => 1,
            'ExpressionAttributeNames'  => [
                '#hash' => EventStoreTable::GSI_EVENT_ID_HASH_KEY_NAME,
            ],
            'ExpressionAttributeValues' => [
                ':v_hash' => ['S' => (string)$eventId],
            ],
            'KeyConditionExpression'    => '#hash = :v_hash',
        ];

        try {
            $response = $this->client->query($params);
        } catch (\Throwable $e) {
            if ($e instanceof AwsException) {
                $errorName = $e->getAwsErrorCode() ?: ClassUtils::getShortName($e);
                if ('ProvisionedThroughputExceededException' === $errorName) {
                    $code = Code::RESOURCE_EXHAUSTED;
                } else {
                    $code = Code::UNAVAILABLE;
                }
            } else {
                $errorName = ClassUtils::getShortName($e);
                $code = Code::INTERNAL;
            }

            throw new EventStoreOperationFailed(
                sprintf(
                    '%s on IndexQuery [%s] on DynamoDb table [%s].',
                    $errorName,
                    EventStoreTable::GSI_EVENT_ID_NAME,
                    $tableName
                ),
                $code,
                $e
            );
        }

        if (!isset($response['Items']) || empty($response['Items'])) {
            return null;
        }

        $item = array_pop($response['Items']);
        return [
            EventStoreTable::HASH_KEY_NAME  => ['S' => $item[EventStoreTable::HASH_KEY_NAME]['S']],
            EventStoreTable::RANGE_KEY_NAME => ['N' => (string)$item[EventStoreTable::RANGE_KEY_NAME]['N']],
        ];
    }