in sql-gremlin/src/main/java/org/twilmes/sql/gremlin/adapter/converter/ast/nodes/select/GremlinSqlSelectSingle.java [289:318]
void applySqlFilter(SqlNode sqlNode, GraphTraversal<?, ?> graphTraversal) throws SQLException {
if (sqlNode == null) {
return;
}
if (sqlNode instanceof SqlBasicCall) {
SqlBasicCall sqlBasicCall = (SqlBasicCall) sqlNode;
if (sqlBasicCall.getOperator() instanceof SqlPrefixOperator) {
SqlPrefixOperator sqlPrefixOperator = (SqlPrefixOperator) sqlBasicCall.getOperator();
if (sqlPrefixOperator.kind.equals(SqlKind.NOT)) {
if (sqlBasicCall.getOperandList().size() == 1 && sqlBasicCall.operands.length == 1) {
GremlinSqlBinaryOperator.appendBooleanEquals(sqlMetadata, graphTraversal,
GremlinSqlFactory.createNodeCheckType(sqlBasicCall.operands[0],
GremlinSqlIdentifier.class), false);
return;
}
throw SqlGremlinError.createNotSupported(SqlGremlinError.WHERE_NOT_ONLY_BOOLEAN);
}
throw SqlGremlinError.createNotSupported(SqlGremlinError.WHERE_UNSUPPORTED_PREFIX);
}
GremlinSqlFactory.createNodeCheckType(sqlNode, GremlinSqlBasicCall.class)
.generateTraversal(graphTraversal);
return;
} else if (sqlNode instanceof SqlIdentifier) {
GremlinSqlBinaryOperator.appendBooleanEquals(sqlMetadata, graphTraversal,
GremlinSqlFactory.createNodeCheckType(sqlNode, GremlinSqlIdentifier.class), true);
return;
}
throw SqlGremlinError.createNotSupported(SqlGremlinError.WHERE_BASIC_LITERALS);
}