Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix-#1449][ClickHouse] fix ClickHouse source null pointer problem #1450

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ public class ClickhouseInputFormat extends JdbcInputFormat {

@Override
public void openInternal(InputSplit inputSplit) {
JdbcInputSplit jdbcInputSplit = (JdbcInputSplit) inputSplit;
initMetric(jdbcInputSplit);
if (!canReadData(jdbcInputSplit)) {
currentJdbcInputSplit = (JdbcInputSplit) inputSplit;
initMetric(currentJdbcInputSplit);
if (!canReadData(currentJdbcInputSplit)) {
LOG.warn(
"Not read data when the start location are equal to end location, start = {}, end = {}",
jdbcInputSplit.getStartLocation(),
jdbcInputSplit.getEndLocation());
currentJdbcInputSplit.getStartLocation(),
currentJdbcInputSplit.getEndLocation());
hasNext = false;
return;
}

String querySQL = null;
try {
dbConn = getConnection();
querySQL = buildQuerySql(jdbcInputSplit);
querySQL = buildQuerySql(currentJdbcInputSplit);
jdbcConf.setQuerySql(querySQL);
executeQuery(jdbcInputSplit.getStartLocation());
executeQuery(currentJdbcInputSplit.getStartLocation());
// 增量任务
needUpdateEndLocation =
jdbcConf.isIncrement() && !jdbcConf.isPolling() && !jdbcConf.isUseMaxFunc();
Expand Down