本文整理汇总了Java中org.apache.drill.common.expression.SchemaPath.getAsUnescapedPath方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaPath.getAsUnescapedPath方法的具体用法?Java SchemaPath.getAsUnescapedPath怎么用?Java SchemaPath.getAsUnescapedPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.drill.common.expression.SchemaPath
的用法示例。
在下文中一共展示了SchemaPath.getAsUnescapedPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMongoScanSpec
import org.apache.drill.common.expression.SchemaPath; //导入方法依赖的package包/类
private MongoScanSpec createMongoScanSpec(String functionName,
SchemaPath field, Object fieldValue) throws ClassNotFoundException,
IOException {
// extract the field name
String fieldName = field.getAsUnescapedPath();
MongoCompareOp compareOp = null;
switch (functionName) {
case "equal":
compareOp = MongoCompareOp.EQUAL;
break;
case "not_equal":
compareOp = MongoCompareOp.NOT_EQUAL;
break;
case "greater_than_or_equal_to":
compareOp = MongoCompareOp.GREATER_OR_EQUAL;
break;
case "greater_than":
compareOp = MongoCompareOp.GREATER;
break;
case "less_than_or_equal_to":
compareOp = MongoCompareOp.LESS_OR_EQUAL;
break;
case "less_than":
compareOp = MongoCompareOp.LESS;
break;
case "isnull":
case "isNull":
case "is null":
compareOp = MongoCompareOp.IFNULL;
break;
case "isnotnull":
case "isNotNull":
case "is not null":
compareOp = MongoCompareOp.IFNOTNULL;
break;
}
if (compareOp != null) {
BasicDBObject queryFilter = new BasicDBObject();
if (compareOp == MongoCompareOp.IFNULL) {
queryFilter.put(fieldName,
new BasicDBObject(MongoCompareOp.EQUAL.getCompareOp(), null));
} else if (compareOp == MongoCompareOp.IFNOTNULL) {
queryFilter.put(fieldName,
new BasicDBObject(MongoCompareOp.NOT_EQUAL.getCompareOp(), null));
} else {
queryFilter.put(fieldName, new BasicDBObject(compareOp.getCompareOp(),
fieldValue));
}
return new MongoScanSpec(groupScan.getScanSpec().getDbName(), groupScan
.getScanSpec().getCollectionName(), queryFilter);
}
return null;
}