Skip to content

Commit

Permalink
[#9614] Add temporary getter + setter functions for WrappedPinotPrepa…
Browse files Browse the repository at this point in the history
…redStatement maxRows
  • Loading branch information
ga-ram committed Feb 13, 2023
1 parent d3440f6 commit f40b797
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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'";
Expand Down Expand Up @@ -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;
}
}

0 comments on commit f40b797

Please # to comment.