[ 
https://issues.apache.org/jira/browse/NIFI-6914?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Purushotham Pushpavanthar updated NIFI-6914:
--------------------------------------------
    Description: 
We have a use case where Table1Trigger is set to insert a row into another 
table i.e. Insert into t1 will trigger insert into t2.
In such cases we are seeing records from t1 are mapped to t2 with no errors.
This is how Mysql bin log looks when trigger is invoked
# table_map for table t1
# table_map for table t2
# Update event on table t1
# Create event on table t2

(line numbers are added for reference)
As per this code  table name for constructing a record is extracted from line 2 
and same scope is used until next table_map bin row is seen, that said for the 
above case values are mapped to t2 though it belongs to t1.

It doesn't always seem right to tag a row to particular table based on last 
seen table_map event. Instead we should rely on _tableId_ from 
_UpdateRowsEventData, WriteRowsEventData and DeleteRowsEventData_ objects to 
map the positional row information to respective table schema.

 

  was:
We have a use case where Table1Trigger is set to insert a row into another 
table i.e. Insert into t1 will trigger insert into t2.
In such cases we are seeing records from t1 are mapped to t2 with no errors.
This is how Mysql bin log looks when trigger is invoked
# table_map for table t1
# table_map for table t2
# Update event on table t1
# Create event ontable t2

(line numbers are added for reference)
As per this code  table name for constructing a record is extracted from line 2 
and same scope is used until next table_map bin row is seen, that said for the 
above case values are mapped to t2 though it belongs to t1.

It doesn't always seem right to tag a row to particular table based on last 
seen table_map event. Instead we should rely on _tableId_ from 
_UpdateRowsEventData, WriteRowsEventData and DeleteRowsEventData_ objects to 
map the positional row information to respective table schema.

 


> CaptureChangeMySQL can't handle triggers involving multiple tables
> ------------------------------------------------------------------
>
>                 Key: NIFI-6914
>                 URL: https://issues.apache.org/jira/browse/NIFI-6914
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.10.0
>            Reporter: Purushotham Pushpavanthar
>            Assignee: Purushotham Pushpavanthar
>            Priority: Major
>
> We have a use case where Table1Trigger is set to insert a row into another 
> table i.e. Insert into t1 will trigger insert into t2.
> In such cases we are seeing records from t1 are mapped to t2 with no errors.
> This is how Mysql bin log looks when trigger is invoked
> # table_map for table t1
> # table_map for table t2
> # Update event on table t1
> # Create event on table t2
> (line numbers are added for reference)
> As per this code  table name for constructing a record is extracted from line 
> 2 and same scope is used until next table_map bin row is seen, that said for 
> the above case values are mapped to t2 though it belongs to t1.
> It doesn't always seem right to tag a row to particular table based on last 
> seen table_map event. Instead we should rely on _tableId_ from 
> _UpdateRowsEventData, WriteRowsEventData and DeleteRowsEventData_ objects to 
> map the positional row information to respective table schema.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to