You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Hang HOU (Jira)" <ji...@apache.org> on 2022/10/13 10:24:00 UTC

[jira] [Updated] (FLINK-29558) Use select count(*) from xxx; and get SQL syntax

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

Hang HOU updated FLINK-29558:
-----------------------------
    Description: 
Hi, I use flink sql to make kafka records to mysql.
so I create these 2 tables in flink sql,here is the mysql ,and I created the table in mysql before I did the insert action in flink sql.

  CREATE TABLE mysql_MyUserTable (
  id STRING,
  name STRING,
  age STRING,
  status STRING,
  PRIMARY KEY (id) NOT ENFORCED
) WITH (
   'connector' = 'jdbc',
   'url' = 'jdbc:mysql://10.19.29.170:3306/fromflink152',
   'table-name' = 'users',
   'username' = 'root',
   'password' = '29sj&170_r'
);

In mysql, I created database "fromflink152" then created the table like this way

 CREATE TABLE `users` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `name` varchar(255) DEFAULT NULL,
  `age` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
)  

After executed insert sql,I found 'select * from mysql_MyUserTable' can get correct result,but ’select count(*) from mysql_MyUserTable‘  or ’select count(id) from mysql_MyUserTable‘ ,the collect job in flink app keep restarting again and again.The exception is:
 !image-2022-10-10-15-31-34-341.png! 

So I wonder which config that I missed about the table in flink or mysql side :(



  was:
Hi, I use flink sql to make kafka records to mysql.
so I create these 2 tables in flink sql,here is the mysql ,and I created the table in mysql before I did the insert action in flink sql.

  CREATE TABLE mysql_MyUserTable (
  id STRING,
  name STRING,
  age STRING,
  status STRING,
  PRIMARY KEY (id) NOT ENFORCED
) WITH (
   'connector' = 'jdbc',
   'url' = 'jdbc:mysql://10.19.29.170:3306/fromflink152',
   'table-name' = 'users',
   'username' = 'root',
   'password' = '29sj&170_r'
);

In mysql, I created database "fromflink152" then created the table like this way

 CREATE TABLE `users` (
  `id` varchar(64) NOT NULL DEFAULT '',
  `name` varchar(255) DEFAULT NULL,
  `age` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
)  

After executed insert sql,I found select * from mysql_MyUserTable can get correct result,but select count(*) from mysql_MyUserTable  or select count(id) from mysql_MyUserTable ,zhe collect job in flink app keep restarting again and again.The exception is:
 !image-2022-10-10-15-31-34-341.png! 

So I wonder which config that I missed about the table in flink or mysql side :(




> Use select count(*) from xxx; and get SQL syntax
> ------------------------------------------------
>
>                 Key: FLINK-29558
>                 URL: https://issues.apache.org/jira/browse/FLINK-29558
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / JDBC
>    Affects Versions: 1.15.2
>         Environment: flink 1.15.2
> CentOS Linux release 7.9.2009 (Core)
> 5.7.32-log MySQL Community Server (GPL)
>            Reporter: Hang HOU
>            Priority: Major
>         Attachments: image-2022-10-10-15-31-34-341.png
>
>
> Hi, I use flink sql to make kafka records to mysql.
> so I create these 2 tables in flink sql,here is the mysql ,and I created the table in mysql before I did the insert action in flink sql.
>   CREATE TABLE mysql_MyUserTable (
>   id STRING,
>   name STRING,
>   age STRING,
>   status STRING,
>   PRIMARY KEY (id) NOT ENFORCED
> ) WITH (
>    'connector' = 'jdbc',
>    'url' = 'jdbc:mysql://10.19.29.170:3306/fromflink152',
>    'table-name' = 'users',
>    'username' = 'root',
>    'password' = '29sj&170_r'
> );
> In mysql, I created database "fromflink152" then created the table like this way
>  CREATE TABLE `users` (
>   `id` varchar(64) NOT NULL DEFAULT '',
>   `name` varchar(255) DEFAULT NULL,
>   `age` varchar(255) DEFAULT NULL,
>   `status` varchar(255) DEFAULT NULL,
>   PRIMARY KEY (`id`)
> )  
> After executed insert sql,I found 'select * from mysql_MyUserTable' can get correct result,but ’select count(*) from mysql_MyUserTable‘  or ’select count(id) from mysql_MyUserTable‘ ,the collect job in flink app keep restarting again and again.The exception is:
>  !image-2022-10-10-15-31-34-341.png! 
> So I wonder which config that I missed about the table in flink or mysql side :(



--
This message was sent by Atlassian Jira
(v8.20.10#820010)