Commit 64a216e9 authored by Ole Voldsæter's avatar Ole Voldsæter

changed "compute" output in anticipation of schema change

parent 0979c23b
Pipeline #14651 passed with stages
in 2 minutes and 9 seconds
......@@ -42,16 +42,16 @@
:unsupported (fn [& args] {:command "unsupported"})
:unrecognized (fn [& args] (first args))
:generate (fn [& [varname expr condition]]
{:command "compute"
:variables [varname]
:expression expr
:condition condition
:mod-varlist (conj *variables* varname)})
{:command "compute"
:variableNames [varname]
:expression expr
:condition condition
:mod-varlist (conj *variables* varname)})
:replace (fn [& [varname expr condition]]
{:command "compute"
:variables [varname]
:expression expr
:condition condition})
{:command "compute"
:variableNames [varname]
:expression expr
:condition condition})
:label_variable (fn [& [varname label]]
{:command "setVariableLabel"
:variableName varname
......
......@@ -61,16 +61,16 @@
)
(defn make-compute [varname funcname args _filter]
{:command "compute"
:variable varname
:expression {:function funcname
:isSdtlName true
:arguments (map-indexed
(fn [i arg] {:argumentName (str "EXP" (inc i))
:argumentValue arg})
args
)
"$type" "FunctionCallExpression"}
{:command "compute"
:variableNames [varname]
:expression {:function funcname
:isSdtlName true
:arguments (map-indexed
(fn [i arg] {:argumentName (str "EXP" (inc i))
:argumentValue arg})
args
)
"$type" "FunctionCallExpression"}
:condition _filter
:mod-varlist (vec (conj *variables* varname))}
)
......
......@@ -133,16 +133,16 @@
(fn [var]
(let [src (if (string? var) var (:source var))
trg (if (string? var) var (:target var))]
{:command "compute"
:variables [trg]
:expression {"$type" "functionCallExpression"
:function (get collapse-stats (-> aggregation :aggstat keyword))
:isSdtlName true
:arguments (cond-> [{"$type" "variableSymbolExpression"
:variableName src}]
(:p aggregation) (conj (:p aggregation))
)
}
{:command "compute"
:variableNames [trg]
:expression {"$type" "functionCallExpression"
:function (get collapse-stats (-> aggregation :aggstat keyword))
:isSdtlName true
:arguments (cond-> [{"$type" "variableSymbolExpression"
:variableName src}]
(:p aggregation) (conj (:p aggregation))
)
}
}
)
)
......
......@@ -86,7 +86,7 @@
:expression {"$type" "NumericConstantExpression"
:value 1}
:mod-varlist ["a"]
:variables ["a"]})
:variableNames ["a"]})
"Should be a sinple compute"
)
(is
......@@ -95,7 +95,7 @@
:condition nil
:expression {"$type" "NumericConstantExpression"
:value 1}
:variables ["a"]})
:variableNames ["a"]})
"Should be a sinple compute"
)
(is
......@@ -106,7 +106,7 @@
:expression {"$type" "NumericConstantExpression"
:value 1}
:mod-varlist ["a"]
:variables ["a"]})
:variableNames ["a"]})
"Should be a simple compute with condition"
)
(is
......@@ -169,7 +169,7 @@
:function "or"
:isSdtlName true}
:mod-varlist ["a"]
:variables ["a"]})
:variableNames ["a"]})
"Should be a complex compute with condition"
)
(is
......@@ -205,21 +205,21 @@
:variableName "a"}]
:function "agg_mean"
:isSdtlName true}
:variables ["a"]}
:variableNames ["a"]}
{:command "compute"
:expression {"$type" "functionCallExpression"
:arguments [{"$type" "variableSymbolExpression"
:variableName "c"}]
:function "agg_mean"
:isSdtlName true}
:variables ["b"]}
:variableNames ["b"]}
{:command "compute"
:expression {"$type" "functionCallExpression"
:arguments [{"$type" "variableSymbolExpression"
:variableName "d"}]
:function "agg_max"
:isSdtlName true}
:variables ["d"]})
:variableNames ["d"]})
:cellwise true
:command "collapse"
:condition nil
......@@ -389,7 +389,7 @@
:value 1}
:sourceInformation {:lineNumberStart 0
:originalSourceText "gen b=1"}
:variables ["b"]}]
:variableNames ["b"]}]
:stack ()
:variables ["a"
"b"]}
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment