protected BackendColumnIterator queryByCond(Session session, ConditionQuery query) { if (query.containsScanCondition()) { E.checkArgument(query.relations().size() == 1, "Invalid scan with multi conditions: %s", query); Relation scan = query.relations().iterator().next(); Shard shard = (Shard) scan.value(); return this.queryByRange(session, shard); } throw new NotSupportException("query: %s", query); }
protected RowIterator queryByCond(Session session, ConditionQuery query) { if (query.containsScanCondition()) { E.checkArgument(query.relations().size() == 1, "Invalid scan with multi conditions: %s", query); Relation scan = query.relations().iterator().next(); Shard shard = (Shard) scan.value(); return this.queryByRange(session, shard); } throw new NotSupportException("query: %s", query); }
public static void verifyEdgesConditionQuery(ConditionQuery query) { assert query.resultType().isEdge(); int total = query.conditions().size(); if (total == 1) { // Supported: 1.query just by edge label, 2.query with scan if (query.containsCondition(HugeKeys.LABEL) || query.containsScanCondition()) { return; } } int matched = 0; for (HugeKeys key : EdgeId.KEYS) { Object value = query.condition(key); if (value == null) { break; } matched++; } if (matched != total) { throw new BackendException( "Not supported querying edges by %s, expect %s", query.conditions(), EdgeId.KEYS[matched]); } }
protected BackendColumnIterator queryByCond(Session session, ConditionQuery query) { if (query.containsScanCondition()) { E.checkArgument(query.relations().size() == 1, "Invalid scan with multi conditions: %s", query); Relation scan = query.relations().iterator().next(); Shard shard = (Shard) scan.value(); return this.queryByRange(session, shard); } throw new NotSupportException("query: %s", query); }
public static void verifyEdgesConditionQuery(ConditionQuery query) { assert query.resultType().isEdge(); int total = query.conditions().size(); if (total == 1) { // Supported: 1.query just by edge label, 2.query with scan if (query.containsCondition(HugeKeys.LABEL) || query.containsScanCondition()) { return; } } int matched = 0; for (HugeKeys key : EdgeId.KEYS) { Object value = query.condition(key); if (value == null) { break; } matched++; } if (matched != total) { throw new BackendException( "Not supported querying edges by %s, expect %s", query.conditions(), EdgeId.KEYS[matched]); } }