Skip to content
Closed
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
9 changes: 7 additions & 2 deletions docs/interpreter/livy.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,21 @@ Example: `spark.master` to `livy.spark.master`
<td>URL where livy server is running</td>
</tr>
<tr>
<td>zeppelin.livy.spark.maxResult</td>
<td>zeppelin.livy.spark.sql.maxResult</td>
<td>1000</td>
<td>Max number of Spark SQL result to display.</td>
</tr>
<tr>
<td>zeppelin.livy.spark.sql.truncateResult</td>
<td>true</td>
<td>Whether to truncate long strings in SQL display.</td>
</tr>
<tr>
<td>zeppelin.livy.displayAppInfo</td>
<td>false</td>
<td>Whether to display app info</td>
</tr>
<tr>
<tr>
<td>livy.spark.driver.cores</td>
<td></td>
<td>Driver cores. ex) 1, 2.</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public InterpreterResult interpret(String line, InterpreterContext interpreterCo
line.replaceAll("\"", "\\\\\"")
.replaceAll("\\n", " ")
+ "\").show(" +
property.get("zeppelin.livy.spark.sql.maxResult") + ")",
property.get("zeppelin.livy.spark.sql.maxResult") + "," +
property.get("zeppelin.livy.spark.sql.truncateResult") + ")",
interpreterContext, userSessionMap);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error will be displayed in frontend if I set invalid value for zeppelin.livy.spark.sql.truncateResult ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be an exception thrown. I don't think every property must be checked for validity in an explicit way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of exception do you see in frontend ? If user set an invalid value like 'F' and if the exception in frontend doesn't imply that, then it might be better to verify the property in method open(), otherwise it is hard to figure out what is wrong.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see whether zeppelin.livy.spark.sql.maxResult or any other property is validated in any place. What's special about zeppelin.livy.spark.sql.truncateResult? Moreover, in my opinion, if user doesn't read documentation, and sets something completely wrong - it is his own problem.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spektom I hate to be the bearer of bad news but Zeppelin is being adopted by many Enterprises and unforuantely in most cases I agree that it's the users problem. But if you are going to be committing to software that is going to be used by large enterprises then I would expect validation to occur. I am actually going to raise these issues with my Hadoop vendor.


if (res.code() == InterpreterResult.Code.SUCCESS) {
Expand Down
6 changes: 6 additions & 0 deletions livy/src/main/resources/interpreter-setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
"defaultValue": "1000",
"description": "Max number of Spark SQL result to display."
},
"zeppelin.livy.spark.sql.truncateResult": {
"envName": "ZEPPELIN_LIVY_TRUNCATERESULT",
"propertyName": "zeppelin.livy.spark.sql.truncateResult",
"defaultValue": "true",
"description": "Truncate long strings in SQL display."
},
"zeppelin.livy.concurrentSQL": {
"propertyName": "zeppelin.livy.concurrentSQL",
"defaultValue": "false",
Expand Down