Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-29558

Use select count(*) from xxx; and get SQL syntax

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.15.3
    • 1.17.0
    • Table SQL / Planner
    • flink 1.15.2
      CentOS Linux release 7.9.2009 (Core)
      5.7.32-log MySQL Community Server (GPL)

    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' = '******'
      );

      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:

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

      Attachments

        1. image-2022-10-10-15-31-34-341.png
          96 kB
          StarBoy1005
        2. image-2022-10-19-17-55-14-700.png
          122 kB
          jiabao.sun
        3. image-2022-11-03-18-16-12-127.png
          48 kB
          StarBoy1005
        4. screenshot-1.png
          117 kB
          StarBoy1005
        5. screenshot-2.png
          206 kB
          StarBoy1005

        Issue Links

          Activity

            People

              lincoln.86xy lincoln lee
              StarBoy1005 StarBoy1005
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: