teiid SVN: r2968 - in trunk: engine/src/main/java/org/teiid/query/optimizer/relational/rules and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-04 16:26:05 -0500 (Fri, 04 Mar 2011)
New Revision: 2968
Modified:
trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
Log:
TEIID-1494 expanding the optional join logic to work more broadly
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2011-03-04 18:03:55 UTC (rev 2967)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml 2011-03-04 21:26:05 UTC (rev 2968)
@@ -217,32 +217,54 @@
<section id="optional_join">
<title>Optional Join</title>
<para>The optional join hint indicates to the
- optimizer that a join clause should be omitted if none of its
- columns are used in either user criteria or output columns in
- the result. This hint is typically only used in view layers
+ optimizer that a joined table should be omitted if none of its
+ columns are used by the output of the user query or in a meaningful way to construct the results of the user query. This hint is typically only used in view layers
containing multi-source joins.</para>
<para>
- The optional join hint is applied as a comment on a join clause.
+ The optional join hint is applied as a comment on a join clause. It can be applied in both ANSI and non-ANSI joins. With non-ANSI joins an entire joined table may be marked as optional.
<example>
<title>Example Optional Join Hint</title>
- <programlisting>select a.column1, b.column2 from a inner join /*+ optional */ b on a.key = b.key</programlisting>
+ <programlisting language="SQL">select a.column1, b.column2 from a, /*+ optional */ b WHERE a.key = b.key</programlisting>
+ <para>Suppose this example defines a view layer X.
+ If X is queried in such a way as to not need b.column2, then the
+ optional join hint will cause b to be omitted from the query
+ plan. The result would be the same as if X were defined as:
+ </para>
+ <programlisting language="SQL">select a.column1 from a</programlisting>
</example>
+ <example>
+ <title>Example ANSI Optional Join Hint</title>
+ <programlisting>select a.column1, b.column2, c.column3 from /*+ optional */ (a inner join b ON a.key = b.key) INNER JOIN c ON a.key = c.key</programlisting>
+ <para>In this example the ANSI join syntax allows for the join of a and b to be marked as optional. Suppose this example defines a view layer X. Only if both column a.column1 and b.column2 are not needed, e.g. "SELECT column3 FROM X" will the join be removed.</para>
+ </example>
</para>
- <para> Suppose that the preceding example defined a view layer X.
- If X is queried in such a way as to not need b.column2, then the
- optional join hint will cause b to be omitted from the query
- plan. The result would be the same as if X were defined as:
+ <para>
+ The optional join hint will not remove a bridging table that is still required.
+ <example>
+ <title>Example Briding Table</title>
+ <programlisting language="SQL">select a.column1, b.column2, c.column3 from /*+ optional */ a, b, c WHERE ON a.key = b.key AND a.key = c.key</programlisting>
+ <para>Suppose this example defines a view layer X. If b.column2 or c.column3 are solely required by a query to X, then the join on a be removed.
+ However if a.column1 or both b.column2 and c.column3 are needed, then the optional join hint will not take effect.</para>
+ </example>
</para>
- <programlisting>select a.column1 from a</programlisting>
<tip>
- <para>When a join clause is omitted via the optional join hint, the relevant join criteria
+ <para>When a join clause is omitted via the optional join hint, the relevant criteria
is not applied. Thus it is possible that the query results may
not have the same cardinality or even the same row values as
when the join is fully applied.</para>
<para>Left/right outer joins where the inner side values are not used
and whose rows under go a distinct operation will automatically be
- treated as an optional join and does not require a hint.</para>
+ treated as an optional join and do not require a hint.
+ <example>
+ <title>Example Unnecessary Optional Join Hint</title>
+ <programlisting language="SQL">select a.column1, b.column2 from a LEFT OUTER JOIN /*+optional*/ b ON a.key = b.key</programlisting>
+ </example>
+ </para>
</tip>
+ <warning><para>
+ A simple SELECT COUNT(*) ... against a view where all join tables are marked as optional will not return a meaningful result.
+ </para>
+ </warning>
</section>
<section id="partitioned_union">
<title>Partitioned Union</title>
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2011-03-04 18:03:55 UTC (rev 2967)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2011-03-04 21:26:05 UTC (rev 2968)
@@ -36,7 +36,6 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.metadata.SupportConstants;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
import org.teiid.query.optimizer.relational.OptimizerRule;
@@ -44,7 +43,6 @@
import org.teiid.query.optimizer.relational.plantree.NodeConstants;
import org.teiid.query.optimizer.relational.plantree.NodeEditor;
import org.teiid.query.optimizer.relational.plantree.PlanNode;
-import org.teiid.query.resolver.util.ResolverUtil;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.OrderBy;
@@ -509,7 +507,6 @@
}
// Gather elements from correlated subquery references;
- // currently only for SELECT or PROJECT nodes
for (SymbolMap refs : node.getAllReferences()) {
for (Expression expr : refs.asMap().values()) {
AggregateSymbolCollectorVisitor.getAggregates(expr, requiredSymbols, requiredSymbols);
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-03-04 18:03:55 UTC (rev 2967)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-03-04 21:26:05 UTC (rev 2968)
@@ -25,6 +25,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -40,6 +41,7 @@
import org.teiid.query.optimizer.relational.plantree.NodeEditor;
import org.teiid.query.optimizer.relational.plantree.PlanNode;
import org.teiid.query.sql.LanguageObject;
+import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.JoinType;
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.GroupSymbol;
@@ -62,26 +64,51 @@
CommandContext context) throws QueryPlannerException,
QueryMetadataException,
TeiidComponentException {
-
- List<PlanNode> joinNodes = NodeEditor.findAllNodes(plan, NodeConstants.Types.JOIN);
- HashSet<PlanNode> removedNodes = new HashSet<PlanNode>();
- for (PlanNode planNode : joinNodes) {
- if (removedNodes.contains(planNode)) {
+ List<PlanNode> projectNodes = NodeEditor.findAllNodes(plan, NodeConstants.Types.PROJECT);
+ HashSet<PlanNode> skipNodes = new HashSet<PlanNode>();
+ for (PlanNode projectNode : projectNodes) {
+ if (projectNode.getChildCount() == 0 || projectNode.getProperty(NodeConstants.Info.INTO_GROUP) != null) {
continue;
}
- Set<GroupSymbol> groups = GroupsUsedByElementsVisitor.getGroups((Collection<? extends LanguageObject>)planNode.getProperty(NodeConstants.Info.OUTPUT_COLS));
- List<PlanNode> removed = removeJoin(groups, planNode, planNode.getFirstChild());
- if (removed != null) {
- removedNodes.addAll(removed);
- continue;
+ PlanNode groupNode = NodeEditor.findNodePreOrder(projectNode, NodeConstants.Types.GROUP, NodeConstants.Types.SOURCE | NodeConstants.Types.JOIN);
+ if (groupNode != null) {
+ projectNode = groupNode;
}
- removed = removeJoin(groups, planNode, planNode.getLastChild());
- if (removed != null) {
- removedNodes.addAll(removed);
+ Set<GroupSymbol> requiredForOptional = getRequiredGroupSymbols(projectNode.getFirstChild());
+ boolean done = false;
+ while (!done) {
+ done = true;
+ List<PlanNode> joinNodes = NodeEditor.findAllNodes(projectNode, NodeConstants.Types.JOIN, NodeConstants.Types.SOURCE);
+ for (PlanNode planNode : joinNodes) {
+ if (skipNodes.contains(planNode)) {
+ continue;
+ }
+ if (!planNode.getExportedCorrelatedReferences().isEmpty()) {
+ skipNodes.add(planNode);
+ continue;
+ }
+ Set<GroupSymbol> required = getRequiredGroupSymbols(planNode);
+
+ List<PlanNode> removed = removeJoin(required, requiredForOptional, planNode, planNode.getFirstChild(), analysisRecord);
+ if (removed != null) {
+ skipNodes.addAll(removed);
+ done = false;
+ continue;
+ }
+ removed = removeJoin(required, requiredForOptional, planNode, planNode.getLastChild(), analysisRecord);
+ if (removed != null) {
+ skipNodes.addAll(removed);
+ done = false;
+ }
+ }
}
- }
+ }
return plan;
}
+
+ private Set<GroupSymbol> getRequiredGroupSymbols(PlanNode planNode) {
+ return GroupsUsedByElementsVisitor.getGroups((Collection<? extends LanguageObject>)planNode.getProperty(NodeConstants.Info.OUTPUT_COLS));
+ }
/**
* remove the optional node if possible
@@ -89,14 +116,42 @@
* @throws TeiidComponentException
* @throws QueryMetadataException
*/
- private List<PlanNode> removeJoin(Set<GroupSymbol> groups, PlanNode joinNode, PlanNode optionalNode) throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
- if (!Collections.disjoint(optionalNode.getGroups(), groups)) {
+ private List<PlanNode> removeJoin(Set<GroupSymbol> required, Set<GroupSymbol> requiredForOptional, PlanNode joinNode, PlanNode optionalNode, AnalysisRecord record) throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
+ boolean correctFrame = false;
+ boolean isOptional = optionalNode.hasBooleanProperty(NodeConstants.Info.IS_OPTIONAL);
+ if (isOptional) {
+ required = requiredForOptional;
+ correctFrame = true;
+ //prevent bridge table removal
+ HashSet<GroupSymbol> joinGroups = new HashSet<GroupSymbol>();
+ PlanNode parentNode = joinNode;
+ while (parentNode.getType() != NodeConstants.Types.PROJECT) {
+ PlanNode current = parentNode;
+ parentNode = parentNode.getParent();
+ if (current.getType() != NodeConstants.Types.SELECT && current.getType() != NodeConstants.Types.JOIN) {
+ continue;
+ }
+ Set<GroupSymbol> currentGroups = current.getGroups();
+ if (current.getType() == NodeConstants.Types.JOIN) {
+ currentGroups = GroupsUsedByElementsVisitor.getGroups((List<Criteria>)current.getProperty(NodeConstants.Info.JOIN_CRITERIA));
+ }
+ if (!Collections.disjoint(currentGroups, optionalNode.getGroups()) && !optionalNode.getGroups().containsAll(currentGroups)) {
+ //we're performing a join
+ boolean wasEmpty = joinGroups.isEmpty();
+ boolean modified = joinGroups.addAll(current.getGroups());
+ if (!wasEmpty && modified) {
+ return null;
+ }
+ }
+ }
+ }
+ if (!Collections.disjoint(optionalNode.getGroups(), required)) {
return null;
}
JoinType jt = (JoinType)joinNode.getProperty(NodeConstants.Info.JOIN_TYPE);
- if (!optionalNode.hasBooleanProperty(NodeConstants.Info.IS_OPTIONAL) &&
+ if (!isOptional &&
(jt != JoinType.JOIN_LEFT_OUTER || optionalNode != joinNode.getLastChild() || useNonDistinctRows(joinNode.getParent()))) {
return null;
}
@@ -105,7 +160,46 @@
joinNode.removeChild(optionalNode);
joinNode.getFirstChild().setProperty(NodeConstants.Info.OUTPUT_COLS, joinNode.getProperty(NodeConstants.Info.OUTPUT_COLS));
NodeEditor.removeChildNode(parentNode, joinNode);
+ if (record != null && record.recordDebug()) {
+ record.println("Removing join node since " + (isOptional?"it was marked as optional ":"it will not affect the results") + joinNode); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ while (parentNode.getType() != NodeConstants.Types.PROJECT) {
+ PlanNode current = parentNode;
+ parentNode = parentNode.getParent();
+ if (correctFrame) {
+ if (current.getType() == NodeConstants.Types.SELECT) {
+ if (!Collections.disjoint(current.getGroups(), optionalNode.getGroups())) {
+ current.getFirstChild().setProperty(NodeConstants.Info.OUTPUT_COLS, current.getProperty(NodeConstants.Info.OUTPUT_COLS));
+ NodeEditor.removeChildNode(parentNode, current);
+ }
+ } else if (current.getType() == NodeConstants.Types.JOIN) {
+ if (!Collections.disjoint(current.getGroups(), optionalNode.getGroups())) {
+ List<Criteria> crits = (List<Criteria>) current.getProperty(NodeConstants.Info.JOIN_CRITERIA);
+ if (crits != null && !crits.isEmpty()) {
+ for (Iterator<Criteria> iterator = crits.iterator(); iterator.hasNext();) {
+ Criteria criteria = iterator.next();
+ if (!Collections.disjoint(GroupsUsedByElementsVisitor.getGroups(criteria), optionalNode.getGroups())) {
+ iterator.remove();
+ }
+ }
+ if (crits.isEmpty()) {
+ JoinType joinType = (JoinType) current.getProperty(NodeConstants.Info.JOIN_TYPE);
+ if (joinType == JoinType.JOIN_INNER) {
+ current.setProperty(NodeConstants.Info.JOIN_TYPE, JoinType.JOIN_CROSS);
+ }
+ }
+ }
+ }
+ }
+ } else if (current.getType() != NodeConstants.Types.JOIN) {
+ break;
+ }
+ if (current.getType() == NodeConstants.Types.JOIN) {
+ current.getGroups().removeAll(optionalNode.getGroups());
+ }
+ }
+
return NodeEditor.findAllNodes(optionalNode, NodeConstants.Types.JOIN);
}
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-03-04 18:03:55 UTC (rev 2967)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-03-04 21:26:05 UTC (rev 2968)
@@ -27,7 +27,7 @@
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.unittest.FakeMetadataFactory;
-
+@SuppressWarnings("nls")
public class TestOptionalJoins {
@Test public void testOptionalJoinNode1() {
@@ -37,6 +37,42 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
+ @Test public void testOptionalJoinNode1WithPredicate() {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT pm1.g1.e1 FROM pm1.g1, /* optional */ pm1.g2 WHERE pm1.g1.e1 = pm1.g2.e1", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT pm1.g1.e1 FROM pm1.g1"} ); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
+
+ @Test public void testOptionalJoinNode1WithJoinCriteria() {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT pm1.g3.e1 FROM (pm1.g1 CROSS JOIN /* optional */ pm1.g2) INNER JOIN pm1.g3 ON pm1.g1.e1 = pm1.g3.e1 AND pm1.g2.e1 = pm1.g3.e1", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT g_1.e1 FROM pm1.g1 AS g_0, pm1.g3 AS g_1 WHERE g_0.e1 = g_1.e1"} ); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
+
+ @Test public void testOptionalJoinNodeNonAnsiWithHaving() {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT e1 FROM (SELECT pm1.g1.e1, max(pm1.g2.e2) FROM pm1.g1, /* optional */ pm1.g2 WHERE pm1.g1.e1 = pm1.g2.e1 GROUP BY pm1.g1.e1) x", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT pm1.g1.e1 FROM pm1.g1"} ); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 1, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 0, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
@Test public void testOptionalJoinNode1_1() {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT pm1.g1.e1,pm2.g2.e1 FROM pm1.g1, /* optional */ pm2.g2", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
new String[] {"SELECT pm1.g1.e1 FROM pm1.g1", "SELECT pm2.g2.e1 FROM pm2.g2"} ); //$NON-NLS-1$//$NON-NLS-2$
@@ -507,4 +543,40 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
+ @Test public void testOptionalJoinNodeStarTransitiveAnsi() throws Exception {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT g3.e1 FROM ( /* optional */ pm1.g1 as g1 makedep INNER JOIN /* optional */ pm2.g2 ON g1.e1 = pm2.g2.e1) makedep INNER JOIN /* optional */ pm2.g3 ON g1.e1 = pm2.g3.e1", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT g_0.e1 FROM pm2.g3 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
+
+ @Test public void testOptionalJoinNodeStarNonAnsi() throws Exception {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT g3.e1 FROM /* optional */ pm1.g1 as g1, /* optional */ pm2.g2, /* optional */ pm2.g3 WHERE g1.e1 = pm2.g2.e1 AND g1.e1 = pm2.g3.e1", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT g_0.e1 FROM pm2.g3 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
+
+ @Test public void testOptionalJoinNodeBridgeNonAnsi() throws Exception {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT g3.e1 FROM /* optional */ pm1.g1 as g1 makedep, pm2.g2, /* optional */ pm2.g3 WHERE g1.e1 = pm2.g2.e1 AND g1.e1 = pm2.g3.e1", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT g_1.e1 AS c_0, g_0.e1 AS c_1 FROM pm2.g2 AS g_0, pm2.g3 AS g_1 WHERE g_1.e1 = g_0.e1 ORDER BY c_0, c_1", "SELECT g_0.e1 AS c_0 FROM pm1.g1 AS g_0 WHERE (g_0.e1 IN (<dependent values>)) AND (g_0.e1 IN (<dependent values>)) ORDER BY c_0"}, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 1, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // Join
+ 1, // MergeJoin
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 0, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
}
13 years, 10 months
teiid SVN: r2967 - in trunk/console/src/main: java/org/teiid/rhq/plugin and 2 other directories.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2011-03-04 13:03:55 -0500 (Fri, 04 Mar 2011)
New Revision: 2967
Modified:
trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/AbstractDeployer.java
trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/RemoteDeployer.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-1217 - Added version parameter to the VDB Deploy Via URL operation as well as file deployment.
Modified: trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2011-03-04 17:34:03 UTC (rev 2966)
+++ trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java 2011-03-04 18:03:55 UTC (rev 2967)
@@ -65,7 +65,8 @@
private static ManagedComponent mc = null;
private static final Log LOG = LogFactory.getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
- private static final String VDB_EXT = ".vdb"; //$NON-NLS-1$
+ public static final String VDB_EXT = ".vdb"; //$NON-NLS-1$
+ public static final String DYNAMIC_VDB_EXT = "-vdb.xml"; //$NON-NLS-1$
//Session metadata fields
private static final String SECURITY_DOMAIN = "securityDomain"; //$NON-NLS-1$
@@ -154,10 +155,8 @@
Object resultObject = new Object();
if (metric.equals(PluginConstants.ComponentType.VDB.Metrics.ERROR_COUNT)) {
- // TODO remove version parameter after AdminAPI is changed
resultObject = getErrorCount(connection, (String) valueMap.get(VDB.NAME));
} else if (metric.equals(PluginConstants.ComponentType.VDB.Metrics.STATUS)) {
- // TODO remove version parameter after AdminAPI is changed
resultObject = getVDBStatus(connection, (String) valueMap.get(VDB.NAME));
} else if (metric.equals(PluginConstants.ComponentType.VDB.Metrics.QUERY_COUNT)) {
resultObject = new Double(getQueryCount(connection).doubleValue());
@@ -244,15 +243,22 @@
} else if (operationName.equals(Platform.Operations.DEPLOY_VDB_BY_URL)) {
String vdbUrl = (String) valueMap.get(Operation.Value.VDB_URL);
String deployName = (String) valueMap.get(Operation.Value.VDB_DEPLOY_NAME);
-
- // add vdb extension if missing
- if (!deployName.endsWith(VDB_EXT)) {
- deployName = deployName + VDB_EXT;
+ Object vdbVersion = valueMap.get(Operation.Value.VDB_VERSION);
+ //strip off vdb extension if user added it
+ if (deployName.endsWith(VDB_EXT)){
+ deployName = deployName.substring(0, deployName.lastIndexOf(VDB_EXT));
}
-
+ if (vdbVersion!=null){
+ deployName = deployName + "." + ((Integer)vdbVersion).toString() + VDB_EXT; //$NON-NLS-1$
+ }
+ //add vdb extension if there was no version
+ if (!deployName.endsWith(VDB_EXT) && !deployName.endsWith(DYNAMIC_VDB_EXT)){
+ deployName = deployName + VDB_EXT;
+ }
+
try {
URL url = new URL(vdbUrl);
- DeploymentUtils.deployArchive(deployName, connection.getDeploymentManager(), url, false);
+ DeploymentUtils.deployArchive( deployName, connection.getDeploymentManager(), url, false);
} catch (Exception e) {
final String msg = "Exception executing operation: " + Platform.Operations.DEPLOY_VDB_BY_URL; //$NON-NLS-1$
LOG.error(msg, e);
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2011-03-04 17:34:03 UTC (rev 2966)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java 2011-03-04 18:03:55 UTC (rev 2967)
@@ -47,6 +47,7 @@
import org.jboss.profileservice.spi.NoSuchDeploymentException;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationTemplate;
import org.rhq.core.domain.content.PackageDetailsKey;
@@ -87,6 +88,7 @@
import org.teiid.rhq.plugin.util.DeploymentUtils;
import org.teiid.rhq.plugin.util.PluginConstants;
import org.teiid.rhq.plugin.util.ProfileServiceUtil;
+import org.teiid.rhq.plugin.util.PluginConstants.Operation;
/**
* This class implements required RHQ interfaces and provides common logic used
@@ -794,7 +796,35 @@
protected void createContentBasedResource(
CreateResourceReport createResourceReport) {
+
+ Property versionProp = createResourceReport.getPackageDetails().getDeploymentTimeConfiguration().get(Operation.Value.VDB_VERSION);
+ String name = createResourceReport.getPackageDetails().getKey().getName();
+ name = name.substring(name.lastIndexOf(File.separatorChar)+1);
+ String userSpecifiedName = createResourceReport.getUserSpecifiedResourceName();
+ String deployName = (userSpecifiedName !=null ? userSpecifiedName : name);
+
+ if (versionProp!=null){
+
+ Integer vdbVersion = ((PropertySimple)versionProp).getIntegerValue();
+ //strip off vdb extension if user added it
+ if (deployName.endsWith(DQPManagementView.VDB_EXT)){
+ deployName = deployName.substring(0, deployName.lastIndexOf(DQPManagementView.VDB_EXT));
+ }
+ if (vdbVersion!=null){
+ deployName = deployName + "." + ((Integer)vdbVersion).toString() + DQPManagementView.VDB_EXT; //$NON-NLS-1$
+ }
+ //add vdb extension if there was no version
+ if (!deployName.endsWith(DQPManagementView.VDB_EXT) && !deployName.endsWith(DQPManagementView.DYNAMIC_VDB_EXT)){
+ deployName = deployName + DQPManagementView.VDB_EXT;
+ }
+
+ //null out version
+ PropertySimple nullVersionProperty = new PropertySimple(Operation.Value.VDB_VERSION, null);
+ createResourceReport.getPackageDetails().getDeploymentTimeConfiguration().put(nullVersionProperty);
+ createResourceReport.setUserSpecifiedResourceName(deployName);
+ }
+
getDeployer().deploy(createResourceReport, createResourceReport.getResourceType());
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2011-03-04 17:34:03 UTC (rev 2966)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java 2011-03-04 18:03:55 UTC (rev 2967)
@@ -104,6 +104,7 @@
} else if (name.equals(Platform.Operations.DEPLOY_VDB_BY_URL)) {
valueMap.put(Operation.Value.VDB_URL, configuration.getSimple(Operation.Value.VDB_URL).getStringValue());
valueMap.put(Operation.Value.VDB_DEPLOY_NAME, configuration.getSimple(Operation.Value.VDB_DEPLOY_NAME).getStringValue());
+ valueMap.put(Operation.Value.VDB_VERSION, configuration.getSimple(Operation.Value.VDB_VERSION).getIntegerValue());
}
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/AbstractDeployer.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/AbstractDeployer.java 2011-03-04 17:34:03 UTC (rev 2966)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/AbstractDeployer.java 2011-03-04 18:03:55 UTC (rev 2967)
@@ -26,7 +26,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
-import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.content.PackageDetailsKey;
import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
import org.rhq.core.domain.resource.CreateResourceStatus;
@@ -56,9 +55,9 @@
ResourcePackageDetails details = createResourceReport.getPackageDetails();
PackageDetailsKey key = details.getKey();
- archiveFile = prepareArchive(key, resourceType);
+ archiveFile = prepareArchive(createResourceReport.getUserSpecifiedResourceName(), key, resourceType);
- String archiveName = key.getName();
+ String archiveName = archiveFile.getName();
if (!DeploymentUtils.hasCorrectExtension(archiveName, resourceType)) {
createResourceReport.setStatus(CreateResourceStatus.FAILURE);
@@ -66,11 +65,6 @@
return;
}
- // abortIfApplicationAlreadyDeployed(resourceType, archiveFile);
-
- Configuration deployTimeConfig = details.getDeploymentTimeConfiguration();
- @SuppressWarnings( { "ConstantConditions" })
-
DeploymentManager deploymentManager = this.profileServiceConnection.getDeploymentManager();
DeploymentUtils.deployArchive(deploymentManager, archiveFile, false);
@@ -102,25 +96,10 @@
protected abstract File prepareArchive(PackageDetailsKey key,
ResourceType resourceType);
+
+ protected abstract File prepareArchive(String userSpecifiedName, PackageDetailsKey key,
+ ResourceType resourceType);
protected abstract void destroyArchive(File archive);
-
- // private void abortIfApplicationAlreadyDeployed(ResourceType resourceType,
- // File archiveFile) throws Exception {
- // String archiveFileName = archiveFile.getName();
- // KnownDeploymentTypes deploymentType =
- // ConversionUtils.getDeploymentType(resourceType);
- // String deploymentTypeString = deploymentType.getType();
- // ManagementView managementView =
- // profileServiceConnection.getManagementView();
- // managementView.load();
- // Set<ManagedDeployment> managedDeployments =
- // managementView.getDeploymentsForType(deploymentTypeString);
- // for (ManagedDeployment managedDeployment : managedDeployments) {
- // if (managedDeployment.getSimpleName().equals(archiveFileName))
- // throw new IllegalArgumentException("An application named '" +
- // archiveFileName
- // + "' is already deployed.");
- // }
- // }
+
}
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/RemoteDeployer.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/RemoteDeployer.java 2011-03-04 17:34:03 UTC (rev 2966)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/deployer/RemoteDeployer.java 2011-03-04 18:03:55 UTC (rev 2967)
@@ -61,7 +61,7 @@
}
@Override
- protected File prepareArchive(PackageDetailsKey key, ResourceType resourceType) {
+ protected File prepareArchive(String userSpecifedName, PackageDetailsKey key, ResourceType resourceType) {
//we're running in the agent. During the development of this functionality, there was
//a time when the deployment only worked from within the JBossAS server home.
//Further investigation never confirmed the problem again but since we have access to
@@ -71,12 +71,9 @@
try {
File tempDir = createTempDirectory("teiid-deploy-content", null, getServerTempDirectory());
- File archiveFile = new File(key.getName());
+ //The userSpecifiedName is used in case we renamed the file to add version.
+ File contentCopy = new File(tempDir, userSpecifedName);
- //this is to ensure that we only get the filename part no matter whether the key contains
- //full path or not.
- File contentCopy = new File(tempDir, archiveFile.getName());
-
os = new BufferedOutputStream(new FileOutputStream(contentCopy));
ContentContext contentContext = resourceContext.getContentContext();
ContentServices contentServices = contentContext.getContentServices();
@@ -137,4 +134,11 @@
return tmpDir;
}
+
+ @Override
+ protected File prepareArchive(PackageDetailsKey key,
+ ResourceType resourceType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-03-04 17:34:03 UTC (rev 2966)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-03-04 18:03:55 UTC (rev 2967)
@@ -159,10 +159,12 @@
description="Deploy a VDB using a URL">
<parameters>
<c:simple-property displayName="VDB URL" name="vdbUrl"
- type="file" required="true" description="The URL of the VDB's source file" />
- <c:simple-property displayName="VDB Deploy File Name"
+ type="file" required="true" description="The URL of the VDB's source file." />
+ <c:simple-property displayName="VDB File Name"
name="vdbDeployName" type="string" required="true"
- description="The deployment file name to use. Must match the VDB Name you are deploying." />
+ description="The name of the VDB to deploy." />
+ <c:simple-property displayName="VDB Version" name="vdbVersion"
+ type="integer" required="false" description="The version to use for the deployed VDB. Leave blank to use the default version as determined by the deployer, overwrite a current version, or use the VDB file name version (i.e. vdbname.{version}.vdb). The version parameter is not applicable for deployment of dynamic VDBs." />
</parameters>
</operation>
@@ -560,7 +562,14 @@
<content name="vdb" displayName="VDB File" category="deployable"
isCreationType="true">
- </content>
+ <configuration>
+ <c:group name="deployment" displayName="Deployment Options">
+ <c:simple-property displayName="VDB Version" name="vdbVersion"
+ type="integer" required="false"
+ description="The version to use for the deployed VDB. Leave blank to use the default version as determined by the deployer, overwrite a current version, or use the VDB file name version (i.e. vdbname.{version}.vdb). The version parameter is not applicable for deployment of dynamic VDBs." />
+ </c:group>
+ </configuration>
+ </content>
<resource-configuration>
<c:group name="general" displayName="General"
13 years, 10 months
teiid SVN: r2966 - in trunk/engine/src: test/java/org/teiid/dqp/internal/process and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-04 12:34:03 -0500 (Fri, 04 Mar 2011)
New Revision: 2966
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
Log:
TEIID-1473 adding engine compensation for non-pushed limits
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2011-03-04 17:12:16 UTC (rev 2965)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2011-03-04 17:34:03 UTC (rev 2966)
@@ -196,9 +196,8 @@
int limit = -1;
if (getParent() instanceof LimitNode) {
LimitNode parent = (LimitNode)getParent();
- limit = parent.getLimit() + parent.getOffset();
- if (limit < parent.getLimit()) {
- limit = -1; //guard against overflow
+ if (parent.getLimit() > 0) {
+ limit = parent.getLimit() + parent.getOffset();
}
}
tupleSource = getDataManager().registerRequest(getContext(), atomicCommand, modelName, connectorBindingId, getID(), limit);
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-03-04 17:12:16 UTC (rev 2965)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-03-04 17:34:03 UTC (rev 2966)
@@ -44,21 +44,26 @@
import org.teiid.dqp.internal.process.AbstractWorkItem.ThreadState;
import org.teiid.dqp.service.AutoGenDataService;
import org.teiid.dqp.service.FakeBufferService;
+import org.teiid.query.optimizer.TestOptimizer;
+import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
+import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
import org.teiid.query.unittest.FakeMetadataFactory;
public class TestDQPCore {
private DQPCore core;
+ private AutoGenDataService agds;
@Before public void setUp() throws Exception {
+ agds = new AutoGenDataService();
DQPWorkContext context = FakeMetadataFactory.buildWorkContext(FakeMetadataFactory.exampleBQT());
context.getVDB().getModel("BQT3").setVisible(false); //$NON-NLS-1$
context.getVDB().getModel("VQT").setVisible(false); //$NON-NLS-1$
ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
context.getVDB().addAttchment(ConnectorManagerRepository.class, repo);
- Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(new AutoGenDataService());
+ Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(agds);
core = new DQPCore();
core.setBufferService(new FakeBufferService());
@@ -167,6 +172,23 @@
helpExecute(sql, "a"); //$NON-NLS-1$
}
+ @Test public void testLimitCompensation() throws Exception {
+ String sql = "SELECT * FROM VQT.SmallA_2589g LIMIT 1, 1"; //$NON-NLS-1$
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.ROW_LIMIT, true);
+ agds.setCaps(caps);
+ ResultsMessage rm = helpExecute(sql, "a"); //$NON-NLS-1$
+ //we test for > 0 here because the autogen service doesn't obey the limit
+ assertTrue(rm.getResults().length > 0);
+ }
+
+ @Test public void testLimitCompensation1() throws Exception {
+ String sql = "SELECT * FROM VQT.SmallA_2589g LIMIT 1, 1"; //$NON-NLS-1$
+ ResultsMessage rm = helpExecute(sql, "a"); //$NON-NLS-1$
+ assertEquals(1, rm.getResults().length);
+ }
+
+
/**
* Tests whether an exception result is sent when an exception occurs
* @since 4.3
Modified: trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2011-03-04 17:12:16 UTC (rev 2965)
+++ trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2011-03-04 17:34:03 UTC (rev 2966)
@@ -58,6 +58,10 @@
super("FakeConnector","FakeConnector"); //$NON-NLS-1$ //$NON-NLS-2$
caps = TestOptimizer.getTypicalCapabilities();
}
+
+ public void setCaps(SourceCapabilities caps) {
+ this.caps = caps;
+ }
public void setRows(int rows) {
this.rows = rows;
13 years, 10 months
teiid SVN: r2965 - trunk/engine/src/main/java/org/teiid/query/processor/relational.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-04 12:12:16 -0500 (Fri, 04 Mar 2011)
New Revision: 2965
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
Log:
TEIID-1473 adding engine compensation for non-pushed limits
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2011-03-04 17:08:11 UTC (rev 2964)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2011-03-04 17:12:16 UTC (rev 2965)
@@ -197,6 +197,9 @@
if (getParent() instanceof LimitNode) {
LimitNode parent = (LimitNode)getParent();
limit = parent.getLimit() + parent.getOffset();
+ if (limit < parent.getLimit()) {
+ limit = -1; //guard against overflow
+ }
}
tupleSource = getDataManager().registerRequest(getContext(), atomicCommand, modelName, connectorBindingId, getID(), limit);
}
13 years, 10 months
teiid SVN: r2964 - in trunk/engine/src: main/java/org/teiid/query/function and 7 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-04 12:08:11 -0500 (Fri, 04 Mar 2011)
New Revision: 2964
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/LimitNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java
trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java
Log:
TEIID-1473 adding engine compensation for non-pushed limits
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -118,7 +118,7 @@
this.bufferService = bufferService;
}
- public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID) throws TeiidComponentException, TeiidProcessingException {
+ public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID, int limit) throws TeiidComponentException, TeiidProcessingException {
RequestWorkItem workItem = requestMgr.getRequestWorkItem((RequestID)context.getProcessorID());
if(CoreConstants.SYSTEM_MODEL.equals(modelName) || CoreConstants.SYSTEM_ADMIN_MODEL.equals(modelName)) {
@@ -126,9 +126,13 @@
}
AtomicRequestMessage aqr = createRequest(context.getProcessorID(), command, modelName, connectorBindingId, nodeID);
+ if (limit > 0) {
+ aqr.setFetchSize(Math.min(limit, aqr.getFetchSize()));
+ throw new AssertionError();
+ }
ConnectorManagerRepository cmr = workItem.getDqpWorkContext().getVDB().getAttachment(ConnectorManagerRepository.class);
ConnectorWork work = cmr.getConnectorManager(aqr.getConnectorName()).registerRequest(aqr);
- return new DataTierTupleSource(aqr, workItem, work, this);
+ return new DataTierTupleSource(aqr, workItem, work, this, limit);
}
/**
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -80,6 +80,8 @@
private boolean[] convertToDesiredRuntimeType;
private Class<?>[] schema;
+ private int limit = -1;
+
// Data state
private int index;
private int rowsProcessed;
@@ -93,11 +95,12 @@
private volatile ResultsFuture<AtomicResultsMessage> futureResult;
private volatile boolean running;
- public DataTierTupleSource(AtomicRequestMessage aqr, RequestWorkItem workItem, ConnectorWork cwi, DataTierManagerImpl dtm) {
+ public DataTierTupleSource(AtomicRequestMessage aqr, RequestWorkItem workItem, ConnectorWork cwi, DataTierManagerImpl dtm, int limit) {
this.aqr = aqr;
this.workItem = workItem;
this.cwi = cwi;
this.dtm = dtm;
+ this.limit = limit;
List<SingleElementSymbol> symbols = this.aqr.getCommand().getProjectedSymbols();
this.schema = new Class[symbols.size()];
this.convertToDesiredRuntimeType = new boolean[symbols.size()];
@@ -224,6 +227,11 @@
receiveResults(results);
}
if (index < arm.getResults().length) {
+ if (limit-- == 0) {
+ this.done = true;
+ arm = null;
+ return null;
+ }
return correctTypes(this.arm.getResults()[index++]);
}
arm = null;
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -920,16 +920,10 @@
StringBuffer translated = new StringBuffer(str.length());
for(int i=0; i<str.length(); i++) {
char c = str.charAt(i);
- boolean matched = false;
- for(int j=0; j<in.length(); j++) {
- char inChar = in.charAt(j);
- if(c == inChar) {
- translated.append(out.charAt(j));
- matched = true;
- break;
- }
- }
- if(! matched) {
+ int j = in.indexOf(c);
+ if (j >= 0) {
+ translated.append(out.charAt(j));
+ } else {
translated.append(c);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/processor/ProcessorDataManager.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -32,7 +32,7 @@
public interface ProcessorDataManager {
- TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID)
+ TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID, int limit)
throws TeiidComponentException, TeiidProcessingException;
/**
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/AccessNode.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -22,8 +22,7 @@
package org.teiid.query.processor.relational;
-import static org.teiid.query.analysis.AnalysisRecord.PROP_MODEL_NAME;
-import static org.teiid.query.analysis.AnalysisRecord.PROP_SQL;
+import static org.teiid.query.analysis.AnalysisRecord.*;
import java.util.ArrayList;
import java.util.Collections;
@@ -194,7 +193,12 @@
private void registerRequest(Command atomicCommand)
throws TeiidComponentException, TeiidProcessingException {
- tupleSource = getDataManager().registerRequest(getContext(), atomicCommand, modelName, connectorBindingId, getID());
+ int limit = -1;
+ if (getParent() instanceof LimitNode) {
+ LimitNode parent = (LimitNode)getParent();
+ limit = parent.getLimit() + parent.getOffset();
+ }
+ tupleSource = getDataManager().registerRequest(getContext(), atomicCommand, modelName, connectorBindingId, getID(), limit);
}
protected boolean processCommandsIndividually() {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/BatchedUpdateNode.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -114,7 +114,7 @@
}
if (!commandsToExecute.isEmpty()) {
BatchedUpdateCommand command = new BatchedUpdateCommand(commandsToExecute);
- tupleSource = getDataManager().registerRequest(getContext(), command, modelName, null, getID());
+ tupleSource = getDataManager().registerRequest(getContext(), command, modelName, null, getID(), -1);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/LimitNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/LimitNode.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/LimitNode.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -56,6 +56,12 @@
TeiidComponentException,
TeiidProcessingException {
TupleBatch batch = null; // Can throw BlockedException
+
+ if (limit == 0) {
+ this.terminateBatches();
+ return pullBatch();
+ }
+
// If we haven't reached the offset, then skip rows/batches
if (offsetPhase) {
while (rowCounter <= offset) {
@@ -107,13 +113,14 @@
}
public void open() throws TeiidComponentException, TeiidProcessingException {
- super.open();
limit = -1;
if (limitExpr != null) {
Integer limitVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(limitExpr, Collections.emptyList());
limit = limitVal.intValue();
}
-
+ if (limit == 0) {
+ return;
+ }
if (offsetExpr != null) {
Integer offsetVal = (Integer)new Evaluator(Collections.emptyMap(), getDataManager(), getContext()).evaluate(offsetExpr, Collections.emptyList());
offset = offsetVal.intValue();
@@ -121,6 +128,7 @@
offset = 0;
}
offsetPhase = offset > 0;
+ super.open();
}
public void reset() {
@@ -163,5 +171,13 @@
public Expression getOffsetExpr() {
return offsetExpr;
}
+
+ public int getLimit() {
+ return limit;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/ProjectIntoNode.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -228,7 +228,7 @@
}
private void registerRequest(Command command) throws TeiidComponentException, TeiidProcessingException {
- tupleSource = getDataManager().registerRequest(getContext(), command, this.modelName, null, getID());
+ tupleSource = getDataManager().registerRequest(getContext(), command, this.modelName, null, getID(), -1);
}
private void closeRequest() {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -23,7 +23,6 @@
package org.teiid.query.processor.relational;
import org.teiid.api.exception.query.ExpressionEvaluationException;
-import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.sql.lang.Command;
@@ -49,29 +48,11 @@
}
/**
- * Assuming there are no elements in the criteria, evaluate the criteria.
- * A null value for criteria is considered to be always true.
- * @param criteria
- * @return true if the criteria always evaluate to true (e.g. 1 = 1); false otherwise.
- * @throws TeiidComponentException
- * @throws BlockedException
- * @throws TeiidComponentException
- * @throws ExpressionEvaluationException
- * @since 4.2
- */
- private static boolean evaluateCriteria(Criteria criteria) throws TeiidComponentException, ExpressionEvaluationException {
- if(criteria == null) {
- return true;
- }
- return Evaluator.evaluate(criteria);
- }
-
- /**
* Decides whether a command needs to be executed.
* <br/><b>NOTE: This method has a side-effect.</b> If the criteria of this command always evaluate to true,
* and the simplifyCriteria flag is true, then the command criteria are set to null.
* @param command
- * @param simplifyCriteria wheter to simplify the criteria of the command if they always evaluate to true
+ * @param simplifyCriteria whether to simplify the criteria of the command if they always evaluate to true
* @return true if this command should be executed by the connector; false otherwise.
* @throws TeiidComponentException
* @throws ExpressionEvaluationException
@@ -89,7 +70,7 @@
if (limit != null && limit.getRowLimit() instanceof Constant) {
Constant rowLimit = (Constant)limit.getRowLimit();
- if (new Integer(0).equals(rowLimit.getValue())) {
+ if (Integer.valueOf(0) == rowLimit.getValue()) {
return false;
}
}
@@ -117,7 +98,7 @@
// If there are elements present in the criteria,
// then we don't know the result, so assume we need to execute
return true;
- } else if(evaluateCriteria(criteria)) {
+ } else if(Evaluator.evaluate(criteria)) {
if (simplifyCriteria) {
query.setCriteria(null);
}
@@ -146,7 +127,7 @@
}
if(!EvaluatableVisitor.isFullyEvaluatable(criteria, false)) {
return true;
- } else if(evaluateCriteria(criteria)) {
+ } else if(Evaluator.evaluate(criteria)) {
if (simplifyCriteria) {
update.setCriteria(null);
}
@@ -163,7 +144,7 @@
}
if(!EvaluatableVisitor.isFullyEvaluatable(criteria, false)) {
return true;
- } else if(evaluateCriteria(criteria)) {
+ } else if(Evaluator.evaluate(criteria)) {
if (simplifyCriteria) {
delete.setCriteria(null);
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -134,13 +134,13 @@
Create create = new Create();
create.setElementSymbolsAsColumns(withCommand.getColumns());
create.setTable(withCommand.getGroupSymbol());
- this.root.getDataManager().registerRequest(getContext(), create, TempMetadataAdapter.TEMP_MODEL.getID(), null, 0);
+ this.root.getDataManager().registerRequest(getContext(), create, TempMetadataAdapter.TEMP_MODEL.getID(), null, 0, -1);
}
while (true) {
TupleBatch batch = withProcessor.nextBatch();
Insert insert = new Insert(withCommand.getGroupSymbol(), withCommand.getColumns(), null);
insert.setTupleSource(new CollectionTupleSource(batch.getTuples().iterator()));
- this.root.getDataManager().registerRequest(getContext(), insert, TempMetadataAdapter.TEMP_MODEL.getID(), null, 0);
+ this.root.getDataManager().registerRequest(getContext(), insert, TempMetadataAdapter.TEMP_MODEL.getID(), null, 0, -1);
if (batch.getTerminationFlag()) {
break;
}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -162,7 +162,7 @@
CommandContext context,
Command command,
String modelName,
- String connectorBindingId, int nodeID)
+ String connectorBindingId, int nodeID, int limit)
throws TeiidComponentException, TeiidProcessingException {
TempTableStore tempTableStore = context.getTempTableStore();
@@ -172,7 +172,7 @@
return result;
}
}
- return this.processorDataManager.registerRequest(context, command, modelName, connectorBindingId, nodeID);
+ return this.processorDataManager.registerRequest(context, command, modelName, connectorBindingId, nodeID, -1);
}
TupleSource registerRequest(CommandContext context, String modelName, Command command) throws TeiidComponentException, TeiidProcessingException {
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -54,8 +54,10 @@
private DataTierTupleSource info;
private AutoGenDataService connectorManager = new AutoGenDataService();
private RequestWorkItem workItem;
+ private int limit = -1;
@Before public void setUp() {
+ limit = -1;
connectorManager = new AutoGenDataService();
}
@@ -103,7 +105,7 @@
request = new AtomicRequestMessage(original, workContext, nodeId);
request.setCommand(command);
request.setConnectorName("FakeConnectorID"); //$NON-NLS-1$
- info = new DataTierTupleSource(request, workItem, connectorManager.registerRequest(request), dtm);
+ info = new DataTierTupleSource(request, workItem, connectorManager.registerRequest(request), dtm, limit);
}
@Test public void testDataTierTupleSource() throws Exception {
@@ -122,6 +124,23 @@
assertNull(workItem.getConnectorRequest(request.getAtomicRequestID()));
}
+ @Test public void testDataTierTupleSourceLimit() throws Exception {
+ limit = 1;
+ helpSetup(1);
+ for (int i = 0; i < 1;) {
+ try {
+ info.nextTuple();
+ i++;
+ } catch (BlockedException e) {
+ Thread.sleep(50);
+ }
+ }
+ assertNotNull(workItem.getConnectorRequest(request.getAtomicRequestID()));
+ assertNull(info.nextTuple());
+ info.closeSource();
+ assertNull(workItem.getConnectorRequest(request.getAtomicRequestID()));
+ }
+
@Test public void testPartialResults() throws Exception {
helpSetup(1);
connectorManager.throwExceptionOnExecute = true;
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourcePlanToProcessConverter.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -70,7 +70,7 @@
setMustRegisterCommands(false);
}
- public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID) throws org.teiid.core.TeiidComponentException {
+ public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID, int limit) throws org.teiid.core.TeiidComponentException {
assertNotNull(connectorBindingId);
Collection<ElementSymbol> elements = ElementCollectorVisitor.getElements(command, true, true);
@@ -80,7 +80,7 @@
fail("Query Contains a MultiSourceElement -- MultiSource expansion did not happen"); //$NON-NLS-1$
}
}
- return super.registerRequest(context, command, modelName, connectorBindingId, nodeID);
+ return super.registerRequest(context, command, modelName, connectorBindingId, nodeID, limit);
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/query/processor/FakeDataManager.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -108,7 +108,7 @@
// does nothing?
}
- public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID)
+ public TupleSource registerRequest(CommandContext context, Command command, String modelName, String connectorBindingId, int nodeID, int limit)
throws TeiidComponentException {
LogManager.logTrace(LOG_CONTEXT, new Object[]{"Register Request:", command, ",processorID:", context.getProcessorID(), ",model name:", modelName,",TupleSourceID nodeID:",new Integer(nodeID)}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Modified: trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/query/processor/HardcodedDataManager.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -117,13 +117,13 @@
}
/**
- * @see org.teiid.query.processor.ProcessorDataManager#registerRequest(CommandContext, org.teiid.query.sql.lang.Command, java.lang.String, String, int)
+ * @see org.teiid.query.processor.ProcessorDataManager#registerRequest(CommandContext, org.teiid.query.sql.lang.Command, java.lang.String, String, int, int)
* @since 4.2
*/
public TupleSource registerRequest(CommandContext context,
Command command,
String modelName,
- String connectorBindingId, int nodeID) throws TeiidComponentException {
+ String connectorBindingId, int nodeID, int limit) throws TeiidComponentException {
if(modelName != null && validModels != null && ! validModels.contains(modelName)) {
throw new TeiidComponentException("Detected query against invalid model: " + modelName + ": " + command); //$NON-NLS-1$//$NON-NLS-2$
Modified: trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/query/processor/TestProcedureRelational.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -726,7 +726,7 @@
@Override
public TupleSource registerRequest(CommandContext context,
Command command, String modelName,
- String connectorBindingId, int nodeID)
+ String connectorBindingId, int nodeID, int limit)
throws TeiidComponentException {
if (command instanceof StoredProcedure) {
StoredProcedure proc = (StoredProcedure)command;
@@ -738,7 +738,7 @@
});
}
return super.registerRequest(context, command, modelName,
- connectorBindingId, nodeID);
+ connectorBindingId, nodeID, limit);
}
};
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestBatchedUpdateNode.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -211,7 +211,7 @@
this.numExecutedCommands = numExecutedCommands;
}
public Object lookupCodeValue(CommandContext context,String codeTableName,String returnElementName,String keyElementName,Object keyValue) throws BlockedException,TeiidComponentException {return null;}
- public TupleSource registerRequest(CommandContext context,Command command,String modelName,String connectorBindingId, int nodeID) throws TeiidComponentException {
+ public TupleSource registerRequest(CommandContext context,Command command,String modelName,String connectorBindingId, int nodeID, int limit) throws TeiidComponentException {
assertEquals("myProcessorID", context.getProcessorID()); //$NON-NLS-1$
assertEquals("myModelName", modelName); //$NON-NLS-1$
assertEquals(1, nodeID);
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestLimitNode.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -22,23 +22,18 @@
package org.teiid.query.processor.relational;
+import static org.junit.Assert.*;
+
import java.util.Arrays;
import java.util.List;
+import org.junit.Test;
import org.teiid.common.buffer.TupleBatch;
-import org.teiid.query.processor.relational.LimitNode;
-import org.teiid.query.processor.relational.RelationalNode;
import org.teiid.query.sql.symbol.Constant;
-import junit.framework.TestCase;
-
-
-/**
- * @since 4.3
- */
-public class TestLimitNode extends TestCase {
+public class TestLimitNode {
- public void testLimitInFirstBatch() throws Exception {
+ @Test public void testLimitInFirstBatch() throws Exception {
LimitNode node = getLimitNode(40, new FakeRelationalNode(2, getRows(100), 50));
TupleBatch batch = node.nextBatch();
@@ -49,7 +44,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testLimitAtBatchSize() throws Exception {
+ @Test public void testLimitAtBatchSize() throws Exception {
LimitNode node = getLimitNode(50, new FakeRelationalNode(2, getRows(100), 50));
TupleBatch batch = node.nextBatch();
@@ -60,7 +55,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testLimitInSecondBatch() throws Exception {
+ @Test public void testLimitInSecondBatch() throws Exception {
LimitNode node = getLimitNode(55, new FakeRelationalNode(2, getRows(100), 50));
TupleBatch batch = node.nextBatch();
@@ -77,7 +72,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testLimitMultipleOfBatchSize() throws Exception {
+ @Test public void testLimitMultipleOfBatchSize() throws Exception {
LimitNode node = getLimitNode(100, new FakeRelationalNode(2, getRows(150), 50));
TupleBatch batch = node.nextBatch();
@@ -94,7 +89,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testLimitProducesMultipleBatches() throws Exception {
+ @Test public void testLimitProducesMultipleBatches() throws Exception {
LimitNode node = getLimitNode(130, new FakeRelationalNode(2, getRows(300), 50));
TupleBatch batch = node.nextBatch();
@@ -119,7 +114,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testLimitGetsNoRows() throws Exception {
+ @Test public void testLimitGetsNoRows() throws Exception {
LimitNode node = getLimitNode(100, new FakeRelationalNode(2, getRows(0), 50));
TupleBatch batch = node.nextBatch();
@@ -128,7 +123,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testZeroLimit() throws Exception {
+ @Test public void testZeroLimit() throws Exception {
LimitNode node = getLimitNode(0, new FakeRelationalNode(2, getRows(100), 50));
TupleBatch batch = node.nextBatch();
@@ -141,7 +136,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testOffsetInFirstBatch() throws Exception {
+ @Test public void testOffsetInFirstBatch() throws Exception {
LimitNode node = getOffsetNode(49, new FakeRelationalNode(2, getRows(100), 50));
// batch 1
TupleBatch batch = node.nextBatch();
@@ -161,7 +156,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testOffsetAtBatchSize() throws Exception {
+ @Test public void testOffsetAtBatchSize() throws Exception {
LimitNode node = getOffsetNode(50, new FakeRelationalNode(2, getRows(100), 50));
TupleBatch batch = node.nextBatch();
@@ -173,7 +168,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testOffsetInSecondBatch() throws Exception {
+ @Test public void testOffsetInSecondBatch() throws Exception {
LimitNode node = getOffsetNode(55, new FakeRelationalNode(2, getRows(100), 50));
// batch 1
TupleBatch batch = node.nextBatch();
@@ -185,7 +180,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testOffsetMultipleOfBatchSize() throws Exception {
+ @Test public void testOffsetMultipleOfBatchSize() throws Exception {
LimitNode node = getOffsetNode(100, new FakeRelationalNode(2, getRows(300), 50));
TupleBatch batch = node.nextBatch();
@@ -197,7 +192,7 @@
assertFalse(batch.getTerminationFlag());
}
- public void testOffsetGreaterThanRowCount() throws Exception {
+ @Test public void testOffsetGreaterThanRowCount() throws Exception {
LimitNode node = getOffsetNode(100, new FakeRelationalNode(2, getRows(10), 50));
TupleBatch batch = node.nextBatch();
@@ -206,7 +201,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testOffsetNoRows() throws Exception {
+ @Test public void testOffsetNoRows() throws Exception {
LimitNode node = getOffsetNode(100, new FakeRelationalNode(2, getRows(0), 50));
TupleBatch batch = node.nextBatch();
@@ -215,7 +210,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testZeroOffset() throws Exception {
+ @Test public void testZeroOffset() throws Exception {
LimitNode node = getOffsetNode(0, new FakeRelationalNode(2, getRows(100), 50));
TupleBatch batch = node.nextBatch();
@@ -233,7 +228,7 @@
assertTrue(batch.getTerminationFlag());
}
- public void testOffsetWithoutLimit() throws Exception {
+ @Test public void testOffsetWithoutLimit() throws Exception {
LimitNode node = new LimitNode(1, null, new Constant(new Integer(10)));
node.addChild(new FakeRelationalNode(2, getRows(10), 50));
node.open();
@@ -266,7 +261,7 @@
return node;
}
- public void testClone() {
+ @Test public void testClone() {
LimitNode node = new LimitNode(1, new Constant(new Integer(-1)), null);
LimitNode clone = (LimitNode)node.clone();
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java 2011-03-04 02:34:26 UTC (rev 2963)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestProjectIntoNode.java 2011-03-04 17:08:11 UTC (rev 2964)
@@ -132,7 +132,7 @@
this.expectedBatchSize = expectedBatchSize;
}
public Object lookupCodeValue(CommandContext context,String codeTableName,String returnElementName,String keyElementName,Object keyValue) throws BlockedException,TeiidComponentException {return null;}
- public TupleSource registerRequest(CommandContext context,Command command,String modelName,String connectorBindingId, int nodeID) throws TeiidComponentException, TeiidProcessingException {
+ public TupleSource registerRequest(CommandContext context,Command command,String modelName,String connectorBindingId, int nodeID, int limit) throws TeiidComponentException, TeiidProcessingException {
callCount++;
int batchSize = 1;
13 years, 10 months
teiid SVN: r2963 - in trunk: engine/src/main/java/org/teiid/dqp/internal/process and 3 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-03 21:34:26 -0500 (Thu, 03 Mar 2011)
New Revision: 2963
Modified:
trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
Log:
TEIID-1493 changing the listener logic to prevent unnecessary cache clearing and updating docs
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2011-03-03 21:36:25 UTC (rev 2962)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2011-03-04 02:34:26 UTC (rev 2963)
@@ -330,8 +330,8 @@
<para>
Setting the version can either be done in the vdb.xml, which is useful for dynamic vdbs, or through a naming convention of the deployment file - vdbname.version.vdb, e.g. marketdata.2.vdb.
- The deployer is responsible for choosing an appropriate version number. If the version number is same as an existing VDB existing connections to the
- previous VDB will remain valid and any new connections will be made to the new VDB - note that the new VDB may be able to use cache entries of the previous VDB.
+ The deployer is responsible for choosing an appropriate version number. If there is alreay a VDB name/version that matches the current deployment, then connections to the
+ previous VDB will be terminated and its cache entries will be flushed. Any new connections will then be made to the new VDB.
</para>
<para>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-03-03 21:36:25 UTC (rev 2962)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-03-04 02:34:26 UTC (rev 2963)
@@ -550,7 +550,7 @@
}
private void clearPlanCache(String vdbName, int version){
- LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.Clearing_prepared_plan_cache")); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.getString("DQPCore.Clearing_prepared_plan_cache_for_vdb", vdbName, version)); //$NON-NLS-1$
this.prepPlanCache.clearForVDB(vdbName, version);
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-03-03 21:36:25 UTC (rev 2962)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-03-04 02:34:26 UTC (rev 2963)
@@ -834,6 +834,7 @@
DQPCore.Unable_to_load_metadata_for_VDB_name__{0},_version__{1}=Unable to load metadata for VDB name= {0}, version= {1}
DQPCore.Unknown_query_metadata_exception_while_registering_query__{0}.=Unknown query metadata exception while registering query: {0}.
DQPCore.Clearing_prepared_plan_cache=Clearing prepared plan cache
+DQPCore.Clearing_prepared_plan_cache_for_vdb=Clearing prepared plan cache for vdb {0}.{1}
DQPCore.clearing_resultset_cache=Clearing the resultset cache for vdb {0}.{1}
DQPCore.The_request_has_been_closed.=The request {0} has been closed.
DQPCore.The_atomic_request_has_been_cancelled=The atomic request {0} has been canceled.
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-03-03 21:36:25 UTC (rev 2962)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-03-04 02:34:26 UTC (rev 2963)
@@ -32,9 +32,11 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Properties;
+import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -78,6 +80,7 @@
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidRuntimeException;
+import org.teiid.core.util.LRUCache;
import org.teiid.deployers.VDBLifeCycleListener;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
@@ -102,6 +105,7 @@
import org.teiid.transport.ODBCSocketListener;
import org.teiid.transport.SocketConfiguration;
import org.teiid.transport.SocketListener;
+import org.teiid.vdb.runtime.VDBKey;
@ManagementObject(name="RuntimeEngineDeployer", isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
@@ -214,14 +218,19 @@
// add vdb life cycle listeners
this.vdbRepository.addListener(new VDBLifeCycleListener() {
-
+
+ private Set<VDBKey> recentlyRemoved = Collections.newSetFromMap(new LRUCache<VDBKey, Boolean>(10000));
+
@Override
public void removed(String name, int version) {
-
+ recentlyRemoved.add(new VDBKey(name, version));
}
@Override
public void added(String name, int version) {
+ if (!recentlyRemoved.remove(new VDBKey(name, version))) {
+ return;
+ }
// terminate all the previous sessions
try {
Collection<SessionMetadata> sessions = sessionService.getActiveSessions();
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2011-03-03 21:36:25 UTC (rev 2962)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2011-03-04 02:34:26 UTC (rev 2963)
@@ -31,6 +31,7 @@
import java.util.NavigableMap;
import java.util.Properties;
import java.util.concurrent.ConcurrentSkipListMap;
+import java.util.concurrent.CopyOnWriteArrayList;
import org.jboss.deployers.spi.DeploymentException;
import org.teiid.adminapi.AdminException;
@@ -60,7 +61,7 @@
private MetadataStore systemStore;
private MetadataStore odbcStore;
private boolean odbcEnabled = false;
- private List<VDBLifeCycleListener> listeners = new ArrayList<VDBLifeCycleListener>();
+ private List<VDBLifeCycleListener> listeners = new CopyOnWriteArrayList<VDBLifeCycleListener>();
private SystemFunctionManager systemFunctionManager;
public void addVDB(VDBMetaData vdb, MetadataStoreGroup stores, LinkedHashMap<String, Resource> visibilityMap, UDFMetaData udf, ConnectorManagerRepository cmr) throws DeploymentException {
@@ -157,7 +158,7 @@
this.odbcEnabled = true;
}
- public synchronized boolean removeVDB(String vdbName, int vdbVersion) {
+ public boolean removeVDB(String vdbName, int vdbVersion) {
VDBKey key = new VDBKey(vdbName, vdbVersion);
CompositeVDB removed = this.vdbRepo.remove(key);
if (removed != null) {
@@ -214,11 +215,11 @@
}
}
- public synchronized void addListener(VDBLifeCycleListener listener) {
+ public void addListener(VDBLifeCycleListener listener) {
this.listeners.add(listener);
}
- public synchronized void removeListener(VDBLifeCycleListener listener) {
+ public void removeListener(VDBLifeCycleListener listener) {
this.listeners.remove(listener);
}
13 years, 10 months
teiid SVN: r2962 - in trunk/engine/src: test/java/org/teiid/cache and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-03 16:36:25 -0500 (Thu, 03 Mar 2011)
New Revision: 2962
Modified:
trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java
trunk/engine/src/test/java/org/teiid/cache/TestDefaultCache.java
Log:
TEIID-1492 fixing default cache entry removal
Modified: trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java 2011-03-03 19:32:23 UTC (rev 2961)
+++ trunk/engine/src/main/java/org/teiid/cache/DefaultCache.java 2011-03-03 21:36:25 UTC (rev 2962)
@@ -24,9 +24,9 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@@ -71,7 +71,7 @@
protected Map<String, Cache> children = new ConcurrentHashMap<String, Cache>();
protected String name;
protected long ttl;
- protected LinkedHashSet<ExpirationEntry<K, V>> expirationQueue = new LinkedHashSet<ExpirationEntry<K, V>>();
+ protected Set<ExpirationEntry<K, V>> expirationQueue;
public DefaultCache(String name) {
this(name, DEFAULT_MAX_SIZE_TOTAL, DEFAULT_MAX_SIZE_TOTAL);
@@ -83,12 +83,14 @@
protected boolean removeEldestEntry(java.util.Map.Entry<K, ExpirationEntry<K, V>> eldest) {
if (super.removeEldestEntry(eldest)) {
Iterator<ExpirationEntry<K, V>> iter = expirationQueue.iterator();
- return validate(iter.next()) != null;
+ if (validate(iter.next()) != null) {
+ DefaultCache.this.remove(eldest.getKey());
+ }
}
return false;
}
};
-
+ this.expirationQueue = Collections.newSetFromMap(new LRUCache<ExpirationEntry<K, V>, Boolean>(maxEntries));
this.name = name;
this.ttl = ttl;
}
@@ -147,10 +149,13 @@
}
public V put(K key, V value, Long timeToLive) {
+ if (this.map.getSpaceLimit() == 0) {
+ return null;
+ }
synchronized (map) {
ExpirationEntry<K, V> entry = new ExpirationEntry<K, V>(getExpirationTime(ttl, timeToLive), key, value);
+ ExpirationEntry<K, V> result = map.put(key, entry);
expirationQueue.add(entry);
- ExpirationEntry<K, V> result = map.put(key, entry);
if (result != null) {
return result.value;
}
@@ -160,10 +165,9 @@
public V remove(K key) {
synchronized (map) {
- ExpirationEntry<K, V> entry = new ExpirationEntry<K, V>(-1, key, null);
- ExpirationEntry<K, V> result = map.put(key, entry);
+ ExpirationEntry<K, V> result = map.remove(key);
if (result != null) {
- expirationQueue.remove(entry);
+ expirationQueue.remove(result);
return result.value;
}
return null;
@@ -225,4 +229,12 @@
}
}
+ Set<ExpirationEntry<K, V>> getExpirationQueue() {
+ return expirationQueue;
+ }
+
+ LRUCache<K, ExpirationEntry<K, V>> getCacheMap() {
+ return map;
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/cache/TestDefaultCache.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/cache/TestDefaultCache.java 2011-03-03 19:32:23 UTC (rev 2961)
+++ trunk/engine/src/test/java/org/teiid/cache/TestDefaultCache.java 2011-03-03 21:36:25 UTC (rev 2962)
@@ -43,5 +43,29 @@
//preferred to purge 2 instead of 3
assertNotNull(cache.get(3));
}
+
+ @Test public void testExpirationAtMaxSize() throws Exception {
+ DefaultCache<Integer, Integer> cache = new DefaultCache<Integer, Integer>("foo", 2, 70);
+ cache.put(1, 1);
+ cache.put(2, 2);
+ cache.put(3, 3);
+ assertEquals(2, cache.getCacheMap().size());
+ assertEquals(2, cache.getExpirationQueue().size());
+ Thread.sleep(100);
+ cache.put(4, 4);
+ cache.put(5, 5);
+ cache.get(4);
+ cache.put(6, 6);
+ assertEquals(2, cache.getCacheMap().size());
+ assertEquals(2, cache.getExpirationQueue().size());
+ assertNotNull(cache.get(4));
+ assertNotNull(cache.get(6));
+ }
+
+ @Test public void testZeroSize() throws Exception {
+ DefaultCache<Integer, Integer> cache = new DefaultCache<Integer, Integer>("foo", 0, 70);
+ cache.put(1, 1);
+ assertEquals(0, cache.size());
+ }
}
13 years, 10 months
teiid SVN: r2961 - in trunk/engine/src: test/java/org/teiid/query/optimizer and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-03 14:32:23 -0500 (Thu, 03 Mar 2011)
New Revision: 2961
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
Log:
TEIID-1471 fixing a regression in optional join removal
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-03-03 19:29:04 UTC (rev 2960)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2011-03-03 19:32:23 UTC (rev 2961)
@@ -103,6 +103,7 @@
// remove the parent node and move the sibling node upward
PlanNode parentNode = joinNode.getParent();
joinNode.removeChild(optionalNode);
+ joinNode.getFirstChild().setProperty(NodeConstants.Info.OUTPUT_COLS, joinNode.getProperty(NodeConstants.Info.OUTPUT_COLS));
NodeEditor.removeChildNode(parentNode, joinNode);
return NodeEditor.findAllNodes(optionalNode, NodeConstants.Types.JOIN);
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-03-03 19:29:04 UTC (rev 2960)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestOptionalJoins.java 2011-03-03 19:32:23 UTC (rev 2961)
@@ -500,4 +500,11 @@
});
}
+ @Test public void testOptionalJoinNodeStar() throws Exception {
+ ProcessorPlan plan = TestOptimizer.helpPlan("SELECT g2.e1 FROM /* optional */ ( /* optional */ pm1.g1 as g1 makedep INNER JOIN /* optional */ pm2.g2 ON g1.e1 = pm2.g2.e1) makedep INNER JOIN /* optional */ pm2.g3 ON g1.e1 = pm2.g3.e1", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
+ new String[] {"SELECT g_0.e1 FROM pm2.g2 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
+
+ TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
+ }
+
}
13 years, 10 months
teiid SVN: r2960 - in trunk/engine/src/main: resources/org/teiid/query and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-03 14:29:04 -0500 (Thu, 03 Mar 2011)
New Revision: 2960
Modified:
trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
Log:
TEIID-1483 updating several validation messages
Modified: trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java 2011-03-02 20:41:34 UTC (rev 2959)
+++ trunk/engine/src/main/java/org/teiid/query/validator/UpdateValidator.java 2011-03-03 19:29:04 UTC (rev 2960)
@@ -426,9 +426,9 @@
}
if (query.getFrom().getClauses().size() > 1 || (!(query.getFrom().getClauses().get(0) instanceof UnaryFromClause))) {
- String warning = QueryPlugin.Util.getString("ERR.015.012.0009", query.getFrom());
- updateReport.handleValidationWarning(warning); //$NON-NLS-1$
- deleteReport.handleValidationWarning(warning); //$NON-NLS-1$
+ String warning = QueryPlugin.Util.getString("ERR.015.012.0009", query.getFrom()); //$NON-NLS-1$
+ updateReport.handleValidationWarning(warning);
+ deleteReport.handleValidationWarning(warning);
updateInfo.isSimple = false;
}
List<GroupSymbol> allGroups = query.getFrom().getGroups();
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-03-02 20:41:34 UTC (rev 2959)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-03-03 19:29:04 UTC (rev 2960)
@@ -168,7 +168,7 @@
ERR.015.012.0006 = The updatable view query must not use aggregates or grouping.
ERR.015.012.0007 = The updatable view query has a non-updatable expression {0} for view column {1}.
ERR.015.012.0008 = The updatable view query cannot use SELECT DISTINCT.
-ERR.015.012.0009 = The updatable view query has a join, pass-through processing will not be used for UPDATE/DELETE operations.
+ERR.015.012.0009 = The updatable view query has a FROM clause that is not a single table, pass-through processing will not be used for UPDATE/DELETE operations.
ERR.015.012.0010 = The updatable view query does not project the column {0}, which is required to make {1} a target of INSERT operations.
ERR.015.012.0011 = There must be exactly one projected symbol in the subcommand of an IN clause.
ERR.015.012.0012 = An AssignmentStatement cannot change the value of a {0} or {1} variable.
@@ -177,7 +177,7 @@
ERR.015.012.0015 = The query defining an updatable view has no valid target for INSERTs.
ERR.015.012.0016 = Variable {0} not assigned any value in this procedure.
ERR.015.012.0017 = Variables declared the procedure''s DeclareStatement cannot be one of the special variables: {0}, {1} and {2}.
-ERR.015.012.0018 = Inherent INSERT is not possible on a view defined by a UNION.
+ERR.015.012.0018 = Inherent INSERT is not possible on a view defined by a non-partitioned UNION.
ERR.015.012.0019 = Translate/HasCriteria cannot be used in a non-update procedure.
ERR.015.012.0021 = Element being translated in the WITH clause not among the elements on the ON clause of the TranslateCriteria.
ERR.015.012.0022 = Unable to translate criteria on the update command against the virtual group, the element {0} is mapped to an aggregate symbol in the virtual group''s query transform, and cannot be translated.
13 years, 10 months
teiid SVN: r2959 - in trunk: connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-03-02 15:41:34 -0500 (Wed, 02 Mar 2011)
New Revision: 2959
Removed:
trunk/common-core/src/main/resources/org/teiid/bqt/
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java
Log:
TEIID-1059: changing bitadd support
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java 2011-03-02 20:28:34 UTC (rev 2958)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java 2011-03-02 20:41:34 UTC (rev 2959)
@@ -84,7 +84,6 @@
registerFunctionModifier(SourceSystemFunctions.RAND, new AliasModifier("random")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("uppercase")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new AliasModifier("day")); //$NON-NLS-1$
- registerFunctionModifier("bitadd", new AliasModifier("bit_add")); //$NON-NLS-1$ //$NON-NLS-2$
registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory()));
supportedFunctions.add(SourceSystemFunctions.ABS);
@@ -118,7 +117,7 @@
public List<FunctionMethod> getPushDownFunctions(){
List<FunctionMethod> pushdownFunctions = new ArrayList<FunctionMethod>();
- pushdownFunctions.add(new FunctionMethod(INGRES + '.' + "bitadd", "bitadd", INGRES, //$NON-NLS-1$ //$NON-NLS-2$
+ pushdownFunctions.add(new FunctionMethod(INGRES + '.' + "bit_add", "bit_add", INGRES, //$NON-NLS-1$ //$NON-NLS-2$
new FunctionParameter[] {
new FunctionParameter("integer1", DataTypeManager.DefaultDataTypes.INTEGER, ""), //$NON-NLS-1$ //$NON-NLS-2$
new FunctionParameter("integer2", DataTypeManager.DefaultDataTypes.INTEGER, "")}, //$NON-NLS-1$ //$NON-NLS-2$
13 years, 10 months