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

add code limit for zeppline interpreter #1

Open
wants to merge 2 commits into
base: branch-0.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public InterpreterResult interpret(String code, InterpreterContext context) {
String generatedClassName = "C" + UUID.randomUUID().toString().replace("-", "");

try {

String res = StaticRepl.execute(generatedClassName, code);
return new InterpreterResult(InterpreterResult.Code.SUCCESS, res);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ private InterpreterResult executeSql(String dbPrefix, String sql,
List<String> sqlArray = sqlSplitter.splitSql(sql);
for (String sqlToExecute : sqlArray) {
String sqlTrimmedLowerCase = sqlToExecute.trim().toLowerCase();

if (sqlTrimmedLowerCase.startsWith("set ") ||
sqlTrimmedLowerCase.startsWith("list ") ||
sqlTrimmedLowerCase.startsWith("add ") ||
Expand Down Expand Up @@ -880,6 +881,7 @@ private InterpreterResult executeSql(String dbPrefix, String sql,
return new InterpreterResult(Code.SUCCESS);
}


private List getFirstRow(ResultSet rs) throws SQLException {
List list = new ArrayList();
ResultSetMetaData md = rs.getMetaData();
Expand Down