Skip to content
Snippets Groups Projects
Commit ba48e43f authored by Julien Lopez's avatar Julien Lopez
Browse files

Fix in RToQIR

parent 191065da
No related branches found
No related tags found
No related merge requests found
......@@ -222,10 +222,8 @@ public final class QIRInterface {
if (value instanceof REnvironment) {
REnvironment env = (REnvironment) value;
final Object queryId = env.get("queryId");
if (queryId != null) { // The object is a query
final int qid = ((Long) queryId).intValue();
return normalize(RContext.queries.get(qid), RContext.envs.get(qid));
}
if (queryId != null) // The object is a query
return normalize(RContext.queries.get((Integer) queryId), RContext.envs.get((Integer) queryId));
final String tableName = (String) env.get("tableName");
final String schemaName = (String) env.get("schemaName");
final String dbName = (String) env.get("dbName");
......@@ -291,7 +289,9 @@ public final class QIRInterface {
}
if (value instanceof RPromise) {
final RPromise fun = (RPromise) value;
return RToQIRType(src, fun.getValue());
if (fun.isEvaluated())
return RToQIRType(src, fun.getValue());
return RToQIRType(src, fun.getClosure().eval(fun.getFrame()));
}
throw new RuntimeException("Unsupported value: " + value);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment