wangqinghuan opened a new pull request, #20448:
URL: https://github.com/apache/flink/pull/20448

   This pr introduces an explainLineage function to get field-level lineage 
relationship about Flink SQL task.
   For example,
   ```
   create table src (a String,b String, c String) with ( 'connector' = 
'COLLECTION');
   create table des (a String,b String, c String) with ( 'connector' = 
'COLLECTION');
   insert into des select * from src;
   ```
   The above SQL statements can infer field lineage like
   ```
   {
     "tables": [
       {
         "name": "`default_catalog`.`default_database`.`src`",
         "columns": [
           {
             "name": "a",
             "type": "STRING"
           },
           {
             "name": "b",
             "type": "STRING"
           },
           {
             "name": "c",
             "type": "STRING"
           }
         ],
         "options": {
           "connector": "COLLECTION"
         }
       },
       {
         "name": "`default_catalog`.`default_database`.`des`",
         "columns": [
           {
             "name": "a",
             "type": "STRING"
           },
           {
             "name": "b",
             "type": "STRING"
           },
           {
             "name": "c",
             "type": "STRING"
           }
         ],
         "options": {
           "connector": "COLLECTION"
         }
       }
     ],
     "relations": [
       {
         "srcTable": "`default_catalog`.`default_database`.`src`",
         "tgtTable": "`default_catalog`.`default_database`.`des`",
         "srcTableColName": "a",
         "tgtTableColName": "a"
       },
       {
         "srcTable": "`default_catalog`.`default_database`.`src`",
         "tgtTable": "`default_catalog`.`default_database`.`des`",
         "srcTableColName": "b",
         "tgtTableColName": "b"
       },
       {
         "srcTable": "`default_catalog`.`default_database`.`src`",
         "tgtTable": "`default_catalog`.`default_database`.`des`",
         "srcTableColName": "c",
         "tgtTableColName": "c"
       }
     ]
   }
   ```
   


-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to