legendtkl commented on PR #1850:
URL: 
https://github.com/apache/incubator-seatunnel/pull/1850#issuecomment-1123442069

   I have checked this manually in the following steps:
   1. download mysql driver 5.1.49 into flink lib path
   2. build the sql
   ```sql
   SET table.dml-sync = true;
   
   CREATE TABLE test (
     id INT,
     name STRING
   ) WITH (
   'connector'='jdbc',
     'url' = 'jdbc:mysql://localhost:3306/demo',
     'table-name' = 'test1',
     'username' = 'root',
     'password' = '123456'
   );
   
   CREATE TABLE print_table (
     id INT,
     name STRING
   ) WITH (
     'connector' = 'print',
     'sink.parallelism' = '1'
   );
   
   INSERT INTO print_table SELECT * FROM test;
   ```
   3. create the mysql table, and prepare data
   ```bash
   mysql> describe test1;
   +-------+------------------+------+-----+---------+----------------+
   | Field | Type             | Null | Key | Default | Extra          |
   +-------+------------------+------+-----+---------+----------------+
   | id    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
   | name  | varchar(100)     | NO   |     | NULL    |                |
   +-------+------------------+------+-----+---------+----------------+
   2 rows in set (0.03 sec)
   
   mysql> select * from test1;
   +----+------+
   | id | name |
   +----+------+
   |  2 | b    |
   |  3 | c    |
   |  4 | d    |
   |  5 | e    |
   |  6 | f    |
   |  7 | g    |
   |  8 | h    |
   |  9 | i    |
   | 10 | j    |
   | 11 | k    |
   +----+------+
   10 rows in set (0.00 sec)
   ```
   4. flink cluster local by execute `${FLINK_HOME}/bin/start-cluster.sh`
   5. submit job with seatunnel: `./bin/start-seatunnel-sql.sh --config 
./config/flink.jdbc.sql.conf.template`
   
   Output
   log in flink tm
   
![image](https://user-images.githubusercontent.com/2370761/167819274-3647f328-a39a-497f-92fd-77bcba988a36.png)
   
   


-- 
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]

Reply via email to