ValidateRecord 2025.10.2.19

バンドル

org.apache.nifi | nifi-standard-nar

説明

Validates the Records of an incoming FlowFile against a given schema. All records that adhere to the schema are routed to the "valid" relationship while records that do not adhere to the schema are routed to the "invalid" relationship. It is therefore possible for a single incoming FlowFile to be split into two individual FlowFiles if some records are valid according to the schema and others are not. Any FlowFile that is routed to the "invalid" relationship will emit a ROUTE Provenance Event with the Details field populated to explain why records were invalid. In addition, to gain further explanation of why records were invalid, DEBUG-level logging can be enabled for the "org.apache.nifi.processors.standard. ValidateRecord" logger.

タグ

記録、スキーマ、検証

入力要件

REQUIRED

機密動的プロパティをサポート

false

プロパティ

プロパティ

説明

allow-extra-fields

入力データにスキーマに存在しないフィールドがある場合、このプロパティは記録が有効かどうかを判断します。trueの場合、記録はまだ有効です。Falseの場合、余分なフィールドがあるため記録は無効となります。

coerce-types

If enabled, the processor will coerce every field to the type specified in the Reader 's schema. If the value of a field cannot be coerced to the type, the field will be skipped (will not be read from the input data), thus will not appear in the output. If not enabled, then every field will appear in the output but their types may differ from what is specified in the schema. For details please see the Additional Details page of the processor's Help. This property controls how the data is read by the specified Record Reader.

invalid-record-writer

指定された場合、このController Serviceは無効な記録を書き出すために使用されます。指定されない場合、"Record Writer "プロパティで指定されたライターが、入力記録の読み取りに使用されるスキーマと共に使用されます。これは、構成された Record Writer がそのスキーマに準拠しないデータを書き込めない場合(Avro の場合)や、有効な記録を別の形式に変換している間に無効な記録を元の形式のままにしておきたい場合などに便利です。

maximum-validation-details-length

バリデーション詳細値の最大文字数を指定します。最大値を超える文字は切り捨てられます。このプロパティは、 'Validation Details Attribute Name' がセットされている場合にのみ使用されます。

record-reader

受信データの読み取りに使用するController Serviceを指定します。

record-writer

記録の書き出しに使用するController Serviceを指定します。Controller Serviceのスキーマアクセス構成にかかわらず、有効な結果を書き込むには、記録の検証に使用したスキーマを使用します。

schema-access-strategy

記録の検証に使用するスキーマの取得方法を指定します。

schema-branch

スキーマ・レジストリのプロパティでスキーマを検索する際に使用するブランチの名前を指定します。選択したスキーマ・レジストリが分岐をサポートしていない場合、この値は無視されます。

schema-name

スキーマ・レジストリのプロパティで検索するスキーマの名前を指定します。

schema-registry

スキーマレジストリで使用するController Serviceを指定します。

schema-text

Avro形式のスキーマのテキスト

schema-version

スキーマ・レジストリで検索するスキーマのバージョンを指定します。指定しない場合は、スキーマの最新バージョンが取得されます。

strict-type-checking

受信データにフィールドが正しいタイプでない記録がある場合、このプロパティはその記録の処理方法を決定します。trueの場合、記録は無効とみなされます。False の場合、記録は有効とみなされ、フィールドは正しいタイプに強制されます(可能であれば、Record Writer がサポートするタイプ強制に従って)。このプロパティは、データが検証スキーマに対してどのように検証されるかを制御します。

validation-details-attribute-name

指定すると、バリデーションエラーが発生したときに、この属性名を使用して詳細を残します。文字数はプロパティ「Maximum Validation Details Length」によって制限されます。

リレーションシップ

名前

説明

failure

何らかの理由で記録の読み取り、検証、書き込みができない場合、オリジナルの FlowFile は、このリレーションシップにルーティングされます。

invalid

スキーマに従って有効でない記録は、このリレーションシップにルーティングされます。

valid

スキーマに従って有効な記録は、このリレーションシップにルーティングされます。

属性の書き込み

名前

説明

mime.type

mime.type属性をRecord Writerで指定された MIME Typeにセットします。

record.count

リレーションシップにルーティングされた FlowFile の記録数。