-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20871][SQL] limit logging of Janino code #18658
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
Changes from 2 commits
803166c
52b20f3
2997ded
252f8ea
c42dc46
a795db2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1037,25 +1037,25 @@ object CodeGenerator extends Logging { | |
| )) | ||
| evaluator.setExtendedClass(classOf[GeneratedClass]) | ||
|
|
||
| lazy val formatted = CodeFormatter.format(code) | ||
|
|
||
| logDebug({ | ||
| // Only add extra debugging info to byte code when we are going to print the source code. | ||
| evaluator.setDebuggingInformation(true, true, false) | ||
| s"\n$formatted" | ||
| s"\n${CodeFormatter.format(code)}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest dropping the string concatenation with
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }) | ||
|
|
||
| try { | ||
| evaluator.cook("generated.java", code.body) | ||
| recordCompilationStats(evaluator) | ||
| } catch { | ||
| case e: JaninoRuntimeException => | ||
| val msg = s"failed to compile: $e\n$formatted" | ||
| val msg = s"failed to compile: $e" | ||
| logError(msg, e) | ||
| logInfo(s"\n${CodeFormatter.format(code, 1000)}") | ||
|
||
| throw new JaninoRuntimeException(msg, e) | ||
| case e: CompileException => | ||
| val msg = s"failed to compile: $e\n$formatted" | ||
| val msg = s"failed to compile: $e" | ||
| logError(msg, e) | ||
| logInfo(s"\n${CodeFormatter.format(code, 1000)}") | ||
|
||
| throw new CompileException(msg, e.getLocation) | ||
| } | ||
| evaluator.getClazz().newInstance().asInstanceOf[GeneratedClass] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can
maxLinesjust be an optional argument rather than declare two methods? this is an internal method so its signature is OK to change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen I can make that change. Is there any need to scaladoc the maxLines param? Or is the function definition easy enough to follow?