ouyangwulin created FLINK-40144:
-----------------------------------

             Summary: Avoid query database when only get table column
                 Key: FLINK-40144
                 URL: https://issues.apache.org/jira/browse/FLINK-40144
             Project: Flink
          Issue Type: Improvement
          Components: Connectors / JDBC
            Reporter: ouyangwulin


The {{SELECT *}} here doesn't actually read the table data yet, because the 
code only calls:

‘

PreparedStatement ps = conn.prepareStatement(sql);
ResultSetMetaData metaData = ps.getMetaData();

’

 

without actually calling {{{}executeQuery(){}}}. However, the driver may still 
send {{prepare}} or {{describe}} requests to the database. Semantically, the 
SQL remains a full table scan, and the behavior regarding execution plans and 
different JDBC drivers is not entirely clear.



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

Reply via email to