leo.zhi created FLINK-31235:
-------------------------------

             Summary: Flink Jdbc Connector can not push down where condition
                 Key: FLINK-31235
                 URL: https://issues.apache.org/jira/browse/FLINK-31235
             Project: Flink
          Issue Type: Bug
    Affects Versions: 1.14.0
            Reporter: leo.zhi


when we use flink 1.13/1.14/1.15, I found out that every time I query 
tidb(mysql) , it will load the whole table without the where condiditon.

 

Below table has 1 milion records, it takes 15 minuetes to load and return one 
record.

I dont know why, and it is very appreciated for the help :)

For example:

val env: StreamExecutionEnvironment = 
StreamExecutionEnvironment.getExecutionEnvironment

env.setRuntimeMode(RuntimeExecutionMode.BATCH)

val tEnv: StreamTableEnvironment = StreamTableEnvironment.create(env)

tEnv.executeSql(
s"""
|CREATE TABLE table(
| ID varchar(50) NOT NULL,
| CreateTime Timestamp NOT NULL
|) with (
| 'connector' = 'jdbc',
| 'url' = 
'jdbc:mysql://xxxx:3306/xx?tinyInt1isBit=false&transformedBitIsBoolean=false',
| 'username' = '',
| 'password' = '',
| 'table-name' = 'Service',
| 'driver' = 'com.mysql.cj.jdbc.Driver'
|)
""".stripMargin)

val query: Table = tEnv.sqlQuery("select * from table where ID = '00011'")

query.print()



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

Reply via email to