pvillard31 commented on code in PR #11172: URL: https://github.com/apache/nifi/pull/11172#discussion_r3136262499
########## nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/UnmatchedFieldBehavior.java: ########## @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.nifi.processors.gcp.bigquery; + +import org.apache.nifi.components.DescribedValue; + +/** + * Strategy applied when an incoming record contains a field that does not exist in the + * target BigQuery table schema. The BigQuery Storage Write API does not surface this condition + * because NiFi drops unknown fields client-side before encoding to Protobuf; this enum allows + * operators to opt in to logging or failure semantics. + */ +public enum UnmatchedFieldBehavior implements DescribedValue { + + IGNORE("Ignore Unmatched Fields", "Ignore Unmatched Fields", + "Any record field that does not map to a BigQuery table column is silently ignored."), + WARN("Warn on Unmatched Fields", "Warn on Unmatched Fields", + "Any record field that does not map to a BigQuery table column is ignored, but a warning is logged per affected record."), + FAIL("Fail on Unmatched Fields", "Fail on Unmatched Fields", """ + If a record contains a field that does not map to a BigQuery table column, the FlowFile is routed to failure; \ + or the affected record is dropped when Skip Invalid Rows is true."""); Review Comment: ```suggestion FAIL("Fail on Unmatched Fields", "Fail on Unmatched Fields", """ If a record contains a field that does not map to a BigQuery table column, the FlowFile is routed to the failure relationship. \ This decision is independent of Skip Invalid Rows, which only governs row-level serialization failures."""); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
