-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bug fix] Avoid
invalid lambda deserialization
exception by wrappin…
…g ClickHouseStatement
- Loading branch information
1 parent
d5db4a9
commit 21c7aab
Showing
5 changed files
with
125 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
.../org/apache/flink/connector/clickhouse/internal/converter/ClickHouseStatementWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package org.apache.flink.connector.clickhouse.internal.converter; | ||
|
||
import ru.yandex.clickhouse.ClickHousePreparedStatement; | ||
|
||
import java.math.BigDecimal; | ||
import java.sql.Date; | ||
import java.sql.SQLException; | ||
import java.sql.Timestamp; | ||
|
||
/** Wrapper class for ClickHousePreparedStatement. */ | ||
public class ClickHouseStatementWrapper { | ||
public final ClickHousePreparedStatement statement; | ||
|
||
public ClickHouseStatementWrapper(ClickHousePreparedStatement statement) { | ||
this.statement = statement; | ||
} | ||
|
||
public void addBatch() throws SQLException { | ||
statement.addBatch(); | ||
} | ||
|
||
public int[] executeBatch() throws SQLException { | ||
return statement.executeBatch(); | ||
} | ||
|
||
public void close() throws SQLException { | ||
statement.close(); | ||
} | ||
|
||
public void setBoolean(int parameterIndex, boolean x) throws SQLException { | ||
statement.setBoolean(parameterIndex, x); | ||
} | ||
|
||
public void setByte(int parameterIndex, byte x) throws SQLException { | ||
statement.setByte(parameterIndex, x); | ||
} | ||
|
||
public void setShort(int parameterIndex, short x) throws SQLException { | ||
statement.setShort(parameterIndex, x); | ||
} | ||
|
||
public void setInt(int parameterIndex, int x) throws SQLException { | ||
statement.setInt(parameterIndex, x); | ||
} | ||
|
||
public void setLong(int parameterIndex, long x) throws SQLException { | ||
statement.setLong(parameterIndex, x); | ||
} | ||
|
||
public void setFloat(int parameterIndex, float x) throws SQLException { | ||
statement.setFloat(parameterIndex, x); | ||
} | ||
|
||
public void setDouble(int parameterIndex, double x) throws SQLException { | ||
statement.setDouble(parameterIndex, x); | ||
} | ||
|
||
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { | ||
statement.setBigDecimal(parameterIndex, x); | ||
} | ||
|
||
public void setString(int parameterIndex, String x) throws SQLException { | ||
statement.setString(parameterIndex, x); | ||
} | ||
|
||
public void setBytes(int parameterIndex, byte[] x) throws SQLException { | ||
statement.setBytes(parameterIndex, x); | ||
} | ||
|
||
public void setDate(int parameterIndex, Date x) throws SQLException { | ||
statement.setDate(parameterIndex, x); | ||
} | ||
|
||
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { | ||
statement.setTimestamp(parameterIndex, x); | ||
} | ||
|
||
public void setArray(int parameterIndex, Object[] array) throws SQLException { | ||
statement.setArray(parameterIndex, array); | ||
} | ||
|
||
public void setObject(int parameterIndex, Object x) throws SQLException { | ||
statement.setObject(parameterIndex, x); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters