[ 
https://issues.apache.org/jira/browse/NIFI-1093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15105910#comment-15105910
 ] 

Mark Payne commented on NIFI-1093:
----------------------------------

I understand - just concerned that warning each time that this happens will 
result in an overwhelming number of warning logs (but there may be use cases 
where we do in fact want to be warned of this). So I think the option of 
warning or not is good to have.

RE: specifying which columns to validate on - I don't think I can really 
appreciate right now whether this would be helpful or not. The idea behind 
verifying that all required columns are present was simply so we can do the 
INSERT without an Integrity Constraint Violation SQLException getting thrown. 
If you think it would be helpful to have the comma-separted list of columns 
then I'm okay with it - not really much of an opinion here from me.

> ConvertJSONToSQL incorrectly detects required columns
> -----------------------------------------------------
>
>                 Key: NIFI-1093
>                 URL: https://issues.apache.org/jira/browse/NIFI-1093
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Randy Gelhausen
>             Fix For: 0.5.0
>
>
> create table device_pings(id varchar not null, ts varchar not null, bssid 
> varchar, ssid varchar, noise integer, signal integer, constraint pk primary 
> key (id, ts))
> With the example DDL above, neither SSID nor BSSID are required fields, yet 
> ConvertJSONToSQL throws an exception if the input JSON lacks those fields:
> 2015-11-01 17:47:10,373 ERROR [Timer-Driven Process Thread-6] 
> o.a.n.p.standard.ConvertJSONToSQL 
> ConvertJSONToSQL[id=a336eb2b-fc63-4118-b098-c0ded1dd5520] Failed to convert 
> StandardFlowFileRecord[uuid=5d2c05f0-982e-4feb-94b1-d9946be730d4,claim=StandardContentClaim
>  [resourceClaim=StandardResourceClaim[id=1446416358991-2, container=default, 
> section=2], offset=203306, 
> length=614],offset=0,name=1446418019645796000,size=614] to a SQL INSERT 
> statement due to org.apache.nifi.processor.exception.ProcessException: JSON 
> does not have a value for the Required column 'BSSID'; routing to failure: 
> org.apache.nifi.processor.exception.ProcessException: JSON does not have a 
> value for the Required column 'BSSID'
> 2015-11-01 17:47:10,381 ERROR [Timer-Driven Process Thread-6] 
> o.a.n.p.standard.ConvertJSONToSQL 
> ConvertJSONToSQL[id=a336eb2b-fc63-4118-b098-c0ded1dd5520] Failed to convert 
> StandardFlowFileRecord[uuid=727b8c3c-66c5-4d6a-8cdc-602da8b80132,claim=StandardContentClaim
>  [resourceClaim=StandardResourceClaim[id=1446416358991-2, container=default, 
> section=2], offset=203920, 
> length=674],offset=0,name=1446418019645796000,size=674] to a SQL INSERT 
> statement due to org.apache.nifi.processor.exception.ProcessException: JSON 
> does not have a value for the Required column 'SSID'; routing to failure: 
> org.apache.nifi.processor.exception.ProcessException: JSON does not have a 
> value for the Required column 'SSID'
> The processor has "Unmatched Field Behavior" property. Should there be an 
> additional property "Unmatched Column Behavior" property that allows SQL 
> statements to be generated from the set of columns actually available in the 
> JSON?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to