Skip to content

NIFI-15869 - PutBigQuery - Add Unknown Field Behavior property to handle fields absent from the BigQuery table schema#11171

Closed
pvillard31 wants to merge 1 commit into
apache:mainfrom
pvillard31:NIFI-15869
Closed

NIFI-15869 - PutBigQuery - Add Unknown Field Behavior property to handle fields absent from the BigQuery table schema#11171
pvillard31 wants to merge 1 commit into
apache:mainfrom
pvillard31:NIFI-15869

Conversation

@pvillard31
Copy link
Copy Markdown
Contributor

Summary

NIFI-15869 - PutBigQuery - Add Unknown Field Behavior property to handle fields absent from the BigQuery table schema

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

…dle fields absent from the BigQuery table schema
0BVer pushed a commit to 0BVer/nifi that referenced this pull request Apr 24, 2026
Introduces a dedicated enum for the Unmatched Field Behavior property
values, implementing DescribedValue for allowable-values integration.

Cherry-picked from apache#11171 by Pierre Villard with his
agreement to consolidate PRs on NIFI-15869.
@0BVer
Copy link
Copy Markdown
Contributor

0BVer commented Apr 24, 2026

Consolidated into #11172 with your enum cherry-picked (authorship preserved). Thanks for the pointers!

0BVer added a commit to 0BVer/nifi that referenced this pull request Apr 24, 2026
Adds an 'Unmatched Field Behavior' property with three allowable values:
- Ignore Unmatched Fields (default): preserves the existing behavior of
  silently dropping fields not present in the BigQuery table schema
- Warn on Unmatched Fields: logs a warning for affected records,
  including the table name, count, and dotted paths of unmatched fields
- Fail on Unmatched Fields: routes the FlowFile to the failure relationship

Detection happens in recordToProtoMessage() before Protobuf encoding by
comparing the incoming record map against the BigQuery TableSchema.
The recursive traversal in collectUnmatchedFields is adapted from the
approach in apache#11171 by Pierre Villard: it descends into STRUCT
fields and repeated STRUCT arrays, reporting dotted field paths
(e.g. parent.child.unexpected) to pinpoint schema drift in nested records.

Skip Invalid Rows is intentionally decoupled from Unmatched Field
Behavior. Unmatched fields signal schema drift rather than row-level
validity; when FAIL mode is selected the FlowFile is always routed to
failure regardless of Skip Invalid Rows. Tolerance is expressed through
Ignore or Warn modes instead.

The property name and behavior pattern follow PutDatabaseRecord's
Unmatched Field handling approach.

Co-authored-by: Pierre Villard <pierre.villard.fr@gmail.com>
@pvillard31
Copy link
Copy Markdown
Contributor Author

Closing this one to work in #11172.

@pvillard31 pvillard31 closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants