public function current()
    {
        if (count($this->castRows) > 0) {
            $row = array_shift($this->castRows);
        } else {
            $row = $this->schema->castRow($this->dataSource->getNextLine());
            foreach ($this->schema->fields() as $field) {
                if ($field->unique()) {
                    if (!array_key_exists($field->name(), $this->uniqueFieldValues)) {
                        $this->uniqueFieldValues[$field->name()] = [];
                    }
                    $value = $row[$field->name()];
                    if (in_array($value, $this->uniqueFieldValues[$field->name()])) {
                        throw new DataSourceException('field must be unique', $this->currentLine);
                    } else {
                        $this->uniqueFieldValues[$field->name()][] = $value;
                    }
                }
            }
        }

        return $row;
    }