Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
New: Aggregation node
Fix: Handle eval error as missing cell
Refactor: Standard format xxxManager, config, execute
  • Loading branch information
david committed Apr 7, 2020
2 parents 5c3b5ce + 35c3622 commit 8295c78
Show file tree
Hide file tree
Showing 28 changed files with 1,510 additions and 474 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
/dev-workspace/andl-try/bin
/plugins
/andl-projects/andl-ra/lib
/andl-projects/try-jexl
/andl-projects/andl-try
/Inkscape
8 changes: 5 additions & 3 deletions andl-projects/andl-ra/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SPJRUN Relational Algebra extensions for KNIME Workbench
Bundle-Name: Andl Extended Relational Algebra for KNIME Workbench
Bundle-SymbolicName: org.andl.ra;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: raselection.jar,
Expand All @@ -9,17 +9,19 @@ Bundle-ClassPath: raselection.jar,
rarename.jar,
raunion.jar,
ravalue.jar,
raaggregation.jar,
lib/commons-jexl3-3.1/commons-jexl3-3.1.jar,
lib/commons-logging-1.2/commons-logging-1.2.jar
Bundle-Activator: org.andl.ra.join.RaJoinNodePlugin
Bundle-Activator: org.andl.ra.RaNodePlugin
Bundle-Vendor: andl
Require-Bundle: org.eclipse.core.runtime,
org.knime.workbench.core,
org.knime.workbench.repository,
org.knime.base,
org.knime.core
Bundle-ActivationPolicy: lazy
Export-Package: org.andl.ra.join;
Export-Package: org.andl.ra.aggregation,
org.andl.ra.join;
uses:="org.osgi.framework,
org.eclipse.core.runtime,
org.knime.core.node.defaultnodesettings,
Expand Down
9 changes: 7 additions & 2 deletions andl-projects/andl-ra/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,26 @@ bin.includes = plugin.xml,\
rajoin.jar,\
rarename.jar,\
raunion.jar,\
ravalue.jar,\
raaggregation.jar,\
alpha.png,\
lib/commons-jexl3-3.1/commons-jexl3-3.1.jar,\
lib/commons-jexl3-3.1/commons-jexl3-3.1-javadoc.jar,\
lib/commons-logging-1.2/commons-logging-1.2.jar,\
lib/commons-logging-1.2/commons-logging-1.2-javadoc.jar,\
ravalue.jar
ravalue.jar,\
raaggregation.jar
jars.compile.order = raselection.jar,\
raprojection.jar,\
rajoin.jar,\
rarename.jar,\
raunion.jar,\
raextension.jar
ravalue.jar,\
raaggregation.jar
output.raselection.jar = bin/
output.raprojection.jar = bin/
output.rajoin.jar = bin/
output.rarename.jar = bin/
output.raunion.jar = bin/
output.ravalue.jar = bin/

4 changes: 3 additions & 1 deletion andl-projects/andl-ra/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<?eclipse version="3.0"?><plugin>

<extension point="org.knime.workbench.repository.categories">
<category after="/IO" description="Andl trial and relational algebra nodes" icon="/alpha.png" level-id="Andl" name="Andl nodes" path="/"/>
<category path="/" after="/IO" level-id="Andl" name="Andl Relational Algebra"
icon="/alpha.png" description="Andl extended relational algebra nodes" />
</extension>

<extension point="org.knime.workbench.repository.nodes">
Expand All @@ -12,6 +13,7 @@
<node category-path="/Andl" factory-class="org.andl.ra.rename.RaRenameNodeFactory"/>
<node category-path="/Andl" factory-class="org.andl.ra.union.RaUnionNodeFactory"/>
<node category-path="/Andl" factory-class="org.andl.ra.value.RaValueNodeFactory"/>
<node category-path="/Andl" factory-class="org.andl.ra.aggregation.RaAggregationNodeFactory"/>
</extension>

</plugin>
4 changes: 2 additions & 2 deletions andl-projects/andl-ra/src/org/andl/ra/RaEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.knime.core.data.DataType;
import org.knime.core.data.DoubleValue;
import org.knime.core.data.IntValue;
import org.knime.core.data.MissingCell;
import org.knime.core.data.StringValue;
//import org.knime.core.data.date.DateAndTimeCell;
//import org.knime.core.data.date.DateAndTimeValue;
Expand Down Expand Up @@ -61,8 +62,7 @@ public DataCell evaluateDataCell(DataRow row) {
try {
return getCell(_expr.evaluate(_context));
} catch (Exception e) {
// TODO: what???
return null;
return new MissingCell("Invalid expression: " + e.getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* $Revision$ $Date$ $Author$
*
*/
package org.andl.ra.projection;
package org.andl.ra;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
Expand All @@ -16,14 +16,14 @@
*
* @author andl
*/
public class RaProjectionNodePlugin extends Plugin {
public class RaNodePlugin extends Plugin {
// The shared instance.
private static RaProjectionNodePlugin plugin;
private static RaNodePlugin plugin;

/**
* The constructor.
*/
public RaProjectionNodePlugin() {
public RaNodePlugin() {
super();
plugin = this;
}
Expand Down Expand Up @@ -57,7 +57,7 @@ public void stop(final BundleContext context) throws Exception {
*
* @return Singleton instance of the Plugin
*/
public static RaProjectionNodePlugin getDefault() {
public static RaNodePlugin getDefault() {
return plugin;
}

Expand Down
5 changes: 5 additions & 0 deletions andl-projects/andl-ra/src/org/andl/ra/RaTuple.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ public class RaTuple {
public DataCell[] getCells() {
return _cells;
}

@Override
public String toString() {
return Arrays.asList(_cells).toString();
}

/**
* Creates a new RaTuple from an array of cells.
Expand Down
Loading

0 comments on commit 8295c78

Please sign in to comment.