热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.hadoop.hive.metastore.ObjectStore.makeQueryFilterString()方法的使用及代码示例

本文整理了Java中org.apache.hadoop.hive.metastore.ObjectStore.makeQueryFilterString()方法的一些代

本文整理了Java中org.apache.hadoop.hive.metastore.ObjectStore.makeQueryFilterString()方法的一些代码示例,展示了ObjectStore.makeQueryFilterString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectStore.makeQueryFilterString()方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.ObjectStore
类名称:ObjectStore
方法名:makeQueryFilterString

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 params) throws MetaException {
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 params = new HashMap<>();
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 params = new HashMap<>();
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 params = new HashMap<>();
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 params)
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 params) throws MetaException {
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 params) throws MetaException {
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 params) throws MetaException {
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 params) throws MetaException {
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 listMPartitionsByFilterNoTxn(MTable mtable, String dbName,
String tableName, FilterParser parser, short maxParts)
throws MetaException, NoSuchObjectException {
List mparts = null;
LOG.debug("Executing listMPartitionsByFilterNoTxn");
Map params = new HashMap();
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) query.executeWithMap(params);
LOG.debug("Done executing query for listMPartitionsByFilterNoTxn");
pm.retrieveAll(mparts);
return mparts;
}

代码示例来源:origin: org.spark-project.hive/hive-metastore

dbName = HiveStringUtils.normalizeIdentifier(dbName);
Map params = new HashMap();
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 params = new HashMap<>();
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 params = new HashMap();
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 params = new HashMap<>();
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 params = new HashMap();
String jdoFilter = makeQueryFilterString(
table.getDbName(), table, tree, params, isValidatedFilter);
if (jdoFilter == null) {

代码示例来源:origin: org.apache.hive/hive-standalone-metastore

Map params = new HashMap<>();
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 params = new HashMap();
String jdoFilter = makeQueryFilterString(
table.getDbName(), table, tree, params, isValidatedFilter);
if (jdoFilter == null) {

推荐阅读
author-avatar
拍友2602923913
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有