felixcheung commented on a change in pull request #3301: ZEPPELIN-3975. Add
limit local property for SparkInterpreter and JdbcInterpreter
URL: https://github.com/apache/zeppelin/pull/3301#discussion_r253290767
##########
File path: jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
##########
@@ -721,8 +721,10 @@ private InterpreterResult executeSql(String propertyKey,
String sql,
statement = connection.createStatement();
// fetch n+1 rows in order to indicate there's more rows available
(for large selects)
- statement.setFetchSize(getMaxResult());
- statement.setMaxRows(maxRows);
+ statement.setFetchSize(Integer.parseInt(interpreterContext
+ .getLocalProperties().getOrDefault("limit", "" +
getMaxResult())));
Review comment:
nit: I think this pattern of int -> string -> int is a bit odd, perhaps
helper func can help here
`Integer.parseInt(interpreterContext
.getLocalProperties().getOrDefault("limit", "" +
getMaxResult()`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services