[
https://issues.apache.org/jira/browse/METRON-1382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310073#comment-16310073
]
ASF GitHub Bot commented on METRON-1382:
----------------------------------------
Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/metron/pull/884#discussion_r159495486
--- Diff:
metron-platform/metron-management/src/main/java/org/apache/metron/management/ShellFunctions.java
---
@@ -90,19 +95,19 @@ public Object apply(List<Object> args) {
@Override
public Object apply(List<Object> args, Context context) throws
ParseException {
- Map<String, StellarExecutor.VariableResult> variables = (Map<String,
StellarExecutor.VariableResult>)
context.getCapability(StellarExecutor.SHELL_VARIABLES).get();
+ Map<String, VariableResult> variables = getVariables(context);
String[] headers = {"VARIABLE", "VALUE", "EXPRESSION"};
String[][] data = new String[variables.size()][3];
int wordWrap = -1;
if(args.size() > 0) {
wordWrap = ConversionUtils.convert(args.get(0), Integer.class);
}
int i = 0;
- for(Map.Entry<String, StellarExecutor.VariableResult> kv :
variables.entrySet()) {
- StellarExecutor.VariableResult result = kv.getValue();
+ for(Map.Entry<String, VariableResult> kv : variables.entrySet()) {
+ VariableResult result = kv.getValue();
data[i++] = new String[] { toWrappedString(kv.getKey().toString(),
wordWrap)
, toWrappedString(result.getResult(),
wordWrap)
- , toWrappedString(result.getExpression(),
wordWrap)
+ ,
toWrappedString(result.getExpression().get(), wordWrap)
--- End diff --
The VariableResult.expression field is now optional. We are not always
know the expression that resulted in a value. The ShellFunctions just needed
updated to treat this as an Optional.
> Run Stellar in a Zeppelin Notebook
> ----------------------------------
>
> Key: METRON-1382
> URL: https://issues.apache.org/jira/browse/METRON-1382
> Project: Metron
> Issue Type: Improvement
> Reporter: Nick Allen
> Assignee: Nick Allen
>
> Create a Zeppelin interpreter that allows Stellar to run in a Zeppelin
> Notebook, the same way that it runs in the command-line driven REPL.
> This should include all of the Stellar "enhancements" available in the REPL
> that are not part of the core Stellar language including the following.
> * Variable assignment
> * Magics
> * Docstrings
> * Comments
> * quit
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)