public OIndexIdentifier copy() { OIndexIdentifier result = new OIndexIdentifier(-1); result.type = type; result.indexNameString = indexNameString; result.indexName = indexName.copy(); return result; }
public OFromItem copy() { OFromItem result = new OFromItem(-1); if (rids != null) { result.rids = rids.stream().map(r -> r.copy()).collect(Collectors.toList()); } if (inputParams != null) { result.inputParams = inputParams.stream().map(r -> r.copy()).collect(Collectors.toList()); } result.cluster = cluster == null ? null : cluster.copy(); result.clusterList = clusterList == null ? null : clusterList.copy(); result.index = index == null ? null : index.copy(); result.metadata = metadata == null ? null : metadata.copy(); result.statement = statement == null ? null : statement.copy(); result.inputParam = inputParam == null ? null : inputParam.copy(); result.identifier = identifier == null ? null : identifier.copy(); result.functionCall = functionCall == null ? null : functionCall.copy(); result.modifier = modifier == null ? null : modifier.copy(); return result; }
if (clusterList != null ? !clusterList.equals(oFromItem.clusterList) : oFromItem.clusterList != null) return false; if (index != null ? !index.equals(oFromItem.index) : oFromItem.index != null) return false; if (metadata != null ? !metadata.equals(oFromItem.metadata) : oFromItem.metadata != null)
private void handleIndexAsTarget(OSelectExecutionPlan result, QueryPlanningInfo info, OIndexIdentifier indexIdentifier, Set<String> filterClusters, OCommandContext ctx, boolean profilingEnabled) { String indexName = indexIdentifier.getIndexName(); OIndex<?> index = ctx.getDatabase().getMetadata().getIndexManager().getIndex(indexName); if (index == null) { switch (indexIdentifier.getType()) { case INDEX: OBooleanExpression keyCondition = null;
final public OIndexIdentifier IndexIdentifier() throws ParseException { OIndexIdentifier jjtn000 = new OIndexIdentifier(JJTINDEXIDENTIFIER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtn000.jjtSetFirstToken(getToken(1));Token token; try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { jjtn000.jjtSetLastToken(getToken(0)); {if (true) return jjtn000;} } catch (Throwable jjte000) { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtn000.jjtSetLastToken(getToken(0));
index = new OIndexIdentifier(-1); index.deserialize(fromResult.getProperty("index"));
@Override public OResult next() { if (executed) { throw new IllegalStateException(); } long begin = profilingEnabled ? System.nanoTime() : 0; try { OIndex<?> idx = ctx.getDatabase().getMetadata().getIndexManager().getIndex(target.getIndexName()); long size = idx.getSize(); executed = true; OResultInternal result = new OResultInternal(); result.setProperty(alias, size); return result; } finally { count += (System.nanoTime() - begin); } }
@Override public int hashCode() { int result = rids != null ? rids.hashCode() : 0; result = 31 * result + (inputParams != null ? inputParams.hashCode() : 0); result = 31 * result + (cluster != null ? cluster.hashCode() : 0); result = 31 * result + (clusterList != null ? clusterList.hashCode() : 0); result = 31 * result + (index != null ? index.hashCode() : 0); result = 31 * result + (metadata != null ? metadata.hashCode() : 0); result = 31 * result + (statement != null ? statement.hashCode() : 0); result = 31 * result + (inputParam != null ? inputParam.hashCode() : 0); result = 31 * result + (identifier != null ? identifier.hashCode() : 0); result = 31 * result + (functionCall != null ? functionCall.hashCode() : 0); result = 31 * result + (modifier != null ? modifier.hashCode() : 0); return result; }
result.setProperty("index", index.serialize());
return false; String indexName = indexIdentifier.getIndexName(); OIndex<?> index = ctx.getDatabase().getMetadata().getIndexManager().getIndex(indexName); if (index == null) { switch (indexIdentifier.getType()) { case INDEX: OBooleanExpression keyCondition = null;
String indexName = item.getIndex().getIndexName(); OIndex<?> idx = db.getMetadata().getIndexManager().getIndex(indexName); if (idx == null) {
@Override public int hashCode() { int result = targetClass != null ? targetClass.hashCode() : 0; result = 31 * result + (targetClusterName != null ? targetClusterName.hashCode() : 0); result = 31 * result + (targetCluster != null ? targetCluster.hashCode() : 0); result = 31 * result + (targetIndex != null ? targetIndex.hashCode() : 0); result = 31 * result + (insertBody != null ? insertBody.hashCode() : 0); result = 31 * result + (returnStatement != null ? returnStatement.hashCode() : 0); result = 31 * result + (selectStatement != null ? selectStatement.hashCode() : 0); result = 31 * result + (selectInParentheses ? 1 : 0); result = 31 * result + (selectWithFrom ? 1 : 0); result = 31 * result + (unsafe ? 1 : 0); return result; }
private void handleIndexAsTarget(OSelectExecutionPlan result, OIndexIdentifier indexIdentifier, OCommandContext ctx, boolean profilingEnabled) { String indexName = indexIdentifier.getIndexName(); OIndex<?> index = ctx.getDatabase().getMetadata().getIndexManager().getIndex(indexName); if (index == null) { switch (indexIdentifier.getType()) { case INDEX:
@Override public OInsertStatement copy() { OInsertStatement result = new OInsertStatement(-1); result.targetClass = targetClass == null ? null : targetClass.copy(); result.targetClusterName = targetClusterName == null ? null : targetClusterName.copy(); result.targetCluster = targetCluster == null ? null : targetCluster.copy(); result.targetIndex = targetIndex == null ? null : targetIndex.copy(); result.insertBody = insertBody == null ? null : insertBody.copy(); result.returnStatement = returnStatement == null ? null : returnStatement.copy(); result.selectStatement = selectStatement == null ? null : selectStatement.copy(); result.selectInParentheses = selectInParentheses; result.selectWithFrom = selectWithFrom; result.unsafe = unsafe; return result; }
@Override public OResult next() { if (!hasNext()) { throw new IllegalStateException(); } //TODO OIndex<?> index = ctx.getDatabase().getMetadata().getIndexManager().getIndex(targetIndex.getIndexName()); if (index == null) { throw new OCommandExecutionException("Index not found: " + targetIndex); } List<OInsertSetExpression> setExps = body.getSetExpressions(); if (body.getContent() != null) { throw new OCommandExecutionException("Invalid expression: INSERT INTO INDEX:... CONTENT ..."); } int count; if (setExps != null) { count = handleSet(setExps, index, ctx); } else { count = handleKeyValues(body.getIdentifierList(), body.getValueExpressions(), index, ctx); } executed = true; OResultInternal result = new OResultInternal(); result.setProperty("count", count); return result; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OInsertStatement that = (OInsertStatement) o; if (selectInParentheses != that.selectInParentheses) return false; if (selectWithFrom != that.selectWithFrom) return false; if (unsafe != that.unsafe) return false; if (targetClass != null ? !targetClass.equals(that.targetClass) : that.targetClass != null) return false; if (targetClusterName != null ? !targetClusterName.equals(that.targetClusterName) : that.targetClusterName != null) return false; if (targetCluster != null ? !targetCluster.equals(that.targetCluster) : that.targetCluster != null) return false; if (targetIndex != null ? !targetIndex.equals(that.targetIndex) : that.targetIndex != null) return false; if (insertBody != null ? !insertBody.equals(that.insertBody) : that.insertBody != null) return false; if (returnStatement != null ? !returnStatement.equals(that.returnStatement) : that.returnStatement != null) return false; if (selectStatement != null ? !selectStatement.equals(that.selectStatement) : that.selectStatement != null) return false; return true; }
public OInsertExecutionPlanner(OInsertStatement statement) { this.targetClass = statement.getTargetClass() == null ? null : statement.getTargetClass().copy(); this.targetClusterName = statement.getTargetClusterName() == null ? null : statement.getTargetClusterName().copy(); this.targetCluster = statement.getTargetCluster() == null ? null : statement.getTargetCluster().copy(); this.targetIndex = statement.getTargetIndex() == null ? null : statement.getTargetIndex().copy(); this.insertBody = statement.getInsertBody() == null ? null : statement.getInsertBody().copy(); this.returnStatement = statement.getReturnStatement() == null ? null : statement.getReturnStatement().copy(); this.selectStatement = statement.getSelectStatement() == null ? null : statement.getSelectStatement().copy(); }