本文整理了Java中org.apache.hadoop.hive.metastore.ObjectStore.makeQueryFilterString()
方法的一些代码示例,展示了ObjectStore.makeQueryFilterString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectStore.makeQueryFilterString()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.ObjectStore
类名称:ObjectStore
方法名:makeQueryFilterString
[英]Makes a JDO query filter string for tables or partitions.
[中]为表或分区生成JDO查询筛选器字符串。
代码示例来源:origin: apache/hive
/**
* Makes a JDO query filter string.
* Makes a JDO query filter string for tables or partitions.
* @param dbName Database name.
* @param mtable Table. If null, the query returned is over tables in a database.
* If not null, the query returned is over partitions in a table.
* @param filter The filter from which JDOQL filter will be made.
* @param params Parameters for the filter. Some parameters may be added here.
* @return Resulting filter.
*/
private String makeQueryFilterString(String catName, String dbName, MTable mtable, String filter,
Map
ExpressionTree tree = (filter != null && !filter.isEmpty())
? PartFilterExprUtil.getFilterParser(filter).tree : ExpressionTree.EMPTY_TREE;
return makeQueryFilterString(catName, dbName, convertToTable(mtable), tree, params, true);
}
代码示例来源:origin: apache/hive
dbName = normalizeIdentifier(dbName);
Map
String queryFilterString = makeQueryFilterString(catName, dbName, null, filter, params);
query = pm.newQuery(MTable.class);
query.declareImports("import java.lang.String");
代码示例来源:origin: apache/hive
String queryFilterString = makeQueryFilterString(catName, dbName, mtable, filter, params);
Query query = pm.newQuery(
"select partitionName from org.apache.hadoop.hive.metastore.model.MPartition "
代码示例来源:origin: apache/hive
private Integer getNumPartitionsViaOrmFilter(Table table, ExpressionTree tree, boolean isValidatedFilter)
throws MetaException {
Map
String jdoFilter = makeQueryFilterString(table.getCatName(), table.getDbName(), table, tree,
params, isValidatedFilter);
if (jdoFilter == null) {
assert !isValidatedFilter;
return null;
}
Query query = pm.newQuery(
"select count(partitionName) from org.apache.hadoop.hive.metastore.model.MPartition"
);
query.setFilter(jdoFilter);
String parameterDeclaration = makeParameterDeclarationStringObj(params);
query.declareParameters(parameterDeclaration);
Long result = (Long) query.executeWithMap(params);
query.closeAll();
return result.intValue();
}
/**
代码示例来源:origin: apache/hive
Map
String jdoFilter =
makeQueryFilterString(table.getCatName(), table.getDbName(), table, tree, params, isValidatedFilter);
if (jdoFilter == null) {
assert !isValidatedFilter;
代码示例来源:origin: edu.berkeley.cs.shark/hive-metastore
private String makeTableQueryFilterString(String filter,
Map
throws MetaException {
return makeQueryFilterString(null, filter, params);
}
代码示例来源:origin: edu.berkeley.cs.shark/hive-metastore
/**
* Makes a JDO query filter string
* if mtable is not null, generates the query to filter over partitions in a table.
* if mtable is null, generates the query to filter over tables in a database
*/
private String makeQueryFilterString(MTable mtable, String filter,
Map
FilterParser parser =
(filter != null && filter.length() != 0) ? getFilterParser(filter) : null;
return makeQueryFilterString(mtable, parser, params);
}
代码示例来源:origin: org.spark-project.hive/hive-metastore
/**
* Makes a JDO query filter string.
* Makes a JDO query filter string for tables or partitions.
* @param dbName Database name.
* @param mtable Table. If null, the query returned is over tables in a database.
* If not null, the query returned is over partitions in a table.
* @param filter The filter from which JDOQL filter will be made.
* @param params Parameters for the filter. Some parameters may be added here.
* @return Resulting filter.
*/
private String makeQueryFilterString(String dbName, MTable mtable, String filter,
Map
ExpressionTree tree = (filter != null && !filter.isEmpty())
? getFilterParser(filter).tree : ExpressionTree.EMPTY_TREE;
return makeQueryFilterString(dbName, convertToTable(mtable), tree, params, true);
}
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
/**
* Makes a JDO query filter string.
* Makes a JDO query filter string for tables or partitions.
* @param dbName Database name.
* @param mtable Table. If null, the query returned is over tables in a database.
* If not null, the query returned is over partitions in a table.
* @param filter The filter from which JDOQL filter will be made.
* @param params Parameters for the filter. Some parameters may be added here.
* @return Resulting filter.
*/
private String makeQueryFilterString(String catName, String dbName, MTable mtable, String filter,
Map
ExpressionTree tree = (filter != null && !filter.isEmpty())
? PartFilterExprUtil.getFilterParser(filter).tree : ExpressionTree.EMPTY_TREE;
return makeQueryFilterString(catName, dbName, convertToTable(mtable), tree, params, true);
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
/**
* Makes a JDO query filter string.
* Makes a JDO query filter string for tables or partitions.
* @param dbName Database name.
* @param mtable Table. If null, the query returned is over tables in a database.
* If not null, the query returned is over partitions in a table.
* @param filter The filter from which JDOQL filter will be made.
* @param params Parameters for the filter. Some parameters may be added here.
* @return Resulting filter.
*/
private String makeQueryFilterString(String dbName, MTable mtable, String filter,
Map
ExpressionTree tree = (filter != null && !filter.isEmpty())
? getFilterParser(filter).tree : ExpressionTree.EMPTY_TREE;
return makeQueryFilterString(dbName, convertToTable(mtable), tree, params, true);
}
代码示例来源:origin: edu.berkeley.cs.shark/hive-metastore
private List
String tableName, FilterParser parser, short maxParts)
throws MetaException, NoSuchObjectException {
List
LOG.debug("Executing listMPartitionsByFilterNoTxn");
Map
String queryFilterString = makeQueryFilterString(mtable, parser, params);
Query query = pm.newQuery(MPartition.class,
queryFilterString);
if( maxParts >= 0 ) {
//User specified a row limit, set it on the Query
query.setRange(0, maxParts);
}
LOG.debug("JDOQL filter is " + queryFilterString);
params.put("t1", tableName.trim());
params.put("t2", dbName.trim());
String parameterDeclaration = makeParameterDeclarationStringObj(params);
query.declareParameters(parameterDeclaration);
query.setOrdering("partitionName ascending");
mparts = (List
LOG.debug("Done executing query for listMPartitionsByFilterNoTxn");
pm.retrieveAll(mparts);
return mparts;
}
代码示例来源:origin: org.spark-project.hive/hive-metastore
dbName = HiveStringUtils.normalizeIdentifier(dbName);
Map
String queryFilterString = makeQueryFilterString(dbName, null, filter, params);
Query query = pm.newQuery(MTable.class);
query.declareImports("import java.lang.String");
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
dbName = normalizeIdentifier(dbName);
Map
String queryFilterString = makeQueryFilterString(catName, dbName, null, filter, params);
query = pm.newQuery(MTable.class);
query.declareImports("import java.lang.String");
代码示例来源:origin: org.apache.hadoop.hive/hive-metastore
makeQueryFilterString(mtable, filter, params);
代码示例来源:origin: org.spark-project.hive/hive-metastore
String queryFilterString = makeQueryFilterString(dbName, mtable, filter, params);
Query query = pm.newQuery(
"select partitionName from org.apache.hadoop.hive.metastore.model.MPartition "
代码示例来源:origin: com.facebook.presto.hive/hive-apache
dbName = HiveStringUtils.normalizeIdentifier(dbName);
Map
String queryFilterString = makeQueryFilterString(dbName, null, filter, params);
Query query = pm.newQuery(MTable.class);
query.declareImports("import java.lang.String");
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
private Integer getNumPartitionsViaOrmFilter(Table table, ExpressionTree tree, boolean isValidatedFilter)
throws MetaException {
Map
String jdoFilter = makeQueryFilterString(table.getCatName(), table.getDbName(), table, tree,
params, isValidatedFilter);
if (jdoFilter == null) {
assert !isValidatedFilter;
return null;
}
Query query = pm.newQuery(
"select count(partitionName) from org.apache.hadoop.hive.metastore.model.MPartition"
);
query.setFilter(jdoFilter);
String parameterDeclaration = makeParameterDeclarationStringObj(params);
query.declareParameters(parameterDeclaration);
Long result = (Long) query.executeWithMap(params);
query.closeAll();
return result.intValue();
}
代码示例来源:origin: org.spark-project.hive/hive-metastore
short maxParts, boolean isValidatedFilter) throws MetaException {
Map
String jdoFilter = makeQueryFilterString(
table.getDbName(), table, tree, params, isValidatedFilter);
if (jdoFilter == null) {
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
Map
String jdoFilter =
makeQueryFilterString(table.getCatName(), table.getDbName(), table, tree, params, isValidatedFilter);
if (jdoFilter == null) {
assert !isValidatedFilter;
代码示例来源:origin: com.facebook.presto.hive/hive-apache
short maxParts, boolean isValidatedFilter) throws MetaException {
Map
String jdoFilter = makeQueryFilterString(
table.getDbName(), table, tree, params, isValidatedFilter);
if (jdoFilter == null) {