From f40b7978da31b8b7c136019fb1f919ca37581968 Mon Sep 17 00:00:00 2001 From: ga-ram Date: Tue, 10 Jan 2023 10:38:55 +0900 Subject: [PATCH] [#9614] Add temporary getter + setter functions for WrappedPinotPreparedStatement maxRows --- .../WrappedPinotPreparedStatement.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/commons-pinot/src/main/java/com/navercorp/pinpoint/common/pinot/datasource/WrappedPinotPreparedStatement.java b/commons-pinot/src/main/java/com/navercorp/pinpoint/common/pinot/datasource/WrappedPinotPreparedStatement.java index 6226f2186b68..a8577a027e98 100644 --- a/commons-pinot/src/main/java/com/navercorp/pinpoint/common/pinot/datasource/WrappedPinotPreparedStatement.java +++ b/commons-pinot/src/main/java/com/navercorp/pinpoint/common/pinot/datasource/WrappedPinotPreparedStatement.java @@ -36,7 +36,7 @@ public class WrappedPinotPreparedStatement extends PinotPreparedStatement { // Temporary variables for fillStatementWithParameters(). TODO: remove these when Pinot driver is fixed. private String query; private final String[] parameters; - private final int maxRows = Integer.MAX_VALUE; + private int maxRows = Integer.MAX_VALUE; public WrappedPinotPreparedStatement(PinotConnection connection, String query) { super(connection, query); @@ -94,7 +94,8 @@ private String fillStatementWithParameters() throws SQLException { return sb.toString(); } - /* temporary setter functions to redirect mybatis parameter setting to temporary variables this.query and this.parameters TODO: remove these when Pinot driver is fixed */ + /* temporary setter + getter functions to redirect mybatis parameter setting to temporary variables this.query, this.parameters, and this.maxRows + TODO: remove these when Pinot driver is fixed */ public void setNull(int parameterIndex, int sqlType) throws SQLException { this.validateState(); this.parameters[parameterIndex - 1] = "'NULL'"; @@ -165,4 +166,20 @@ public void clearParameters() throws SQLException { this.parameters[i] = null; } } + + public int getFetchSize() throws SQLException { + return this.maxRows; + } + + public void setFetchSize(int rows) throws SQLException { + this.maxRows = rows; + } + + public int getMaxRows() throws SQLException { + return this.maxRows; + } + + public void setMaxRows(int max) throws SQLException { + this.maxRows = max; + } }