当前位置: 首页>>代码示例>>Java>>正文


Java SchemaTablePrefix.getTableName方法代码示例

本文整理汇总了Java中com.facebook.presto.spi.SchemaTablePrefix.getTableName方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaTablePrefix.getTableName方法的具体用法?Java SchemaTablePrefix.getTableName怎么用?Java SchemaTablePrefix.getTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.presto.spi.SchemaTablePrefix的用法示例。


在下文中一共展示了SchemaTablePrefix.getTableName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listTableColumns

import com.facebook.presto.spi.SchemaTablePrefix; //导入方法依赖的package包/类
@Override
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
{
    requireNonNull(prefix, "prefix is null");
    if (prefix.getSchemaName() != null && !prefix.getSchemaName().equals(SCHEMA_NAME)) {
        return ImmutableMap.of();
    }

    ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder();

    List<SchemaTableName> tableNames;
    if (prefix.getTableName() == null) {
        tableNames = listTables(session, prefix.getSchemaName());
    }
    else {
        tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
    }

    for (SchemaTableName tableName : tableNames) {
        JmxTableHandle tableHandle = getTableHandle(session, tableName);
        columns.put(tableName, tableHandle.getTableMetadata().getColumns());
    }
    return columns.build();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:25,代码来源:JmxMetadata.java

示例2: getViews

import com.facebook.presto.spi.SchemaTablePrefix; //导入方法依赖的package包/类
@Override
public Map<SchemaTableName, ConnectorViewDefinition> getViews(ConnectorSession session, SchemaTablePrefix prefix)
{
    ImmutableMap.Builder<SchemaTableName, ConnectorViewDefinition> views = ImmutableMap.builder();
    List<SchemaTableName> tableNames;
    if (prefix.getTableName() != null) {
        tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
    }
    else {
        tableNames = listViews(session, prefix.getSchemaName());
    }

    for (SchemaTableName schemaTableName : tableNames) {
        Optional<Table> table = metastore.getTable(schemaTableName.getSchemaName(), schemaTableName.getTableName());
        if (table.isPresent() && HiveUtil.isPrestoView(table.get())) {
            views.put(schemaTableName, new ConnectorViewDefinition(
                    schemaTableName,
                    Optional.ofNullable(table.get().getOwner()),
                    decodeViewData(table.get().getViewOriginalText())));
        }
    }

    return views.build();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:25,代码来源:HiveMetadata.java

示例3: listTableColumns

import com.facebook.presto.spi.SchemaTablePrefix; //导入方法依赖的package包/类
@Override
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
{
    checkNotNull(prefix, "prefix is null");
    log.debug("Called listTableColumns on %s.%s", prefix.getSchemaName(), prefix.getTableName());

    ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> columns = ImmutableMap.builder();

    // NOTE: prefix.getTableName or prefix.getSchemaName can be null
    List<SchemaTableName> tableNames;
    if (prefix.getSchemaName() != null && prefix.getTableName() != null) {
        tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
    }
    else {
        tableNames = listTables(session, null);
    }

    for (SchemaTableName tableName : tableNames) {
        ConnectorTableMetadata tableMetadata = getTableMetadata(tableName);
        if (tableMetadata != null) {
            columns.put(tableName, tableMetadata.getColumns());
        }
    }
    return columns.build();
}
 
开发者ID:qubole,项目名称:presto-kinesis,代码行数:26,代码来源:KinesisMetadata.java

示例4: listTables

import com.facebook.presto.spi.SchemaTablePrefix; //导入方法依赖的package包/类
public List<SchemaTableName> listTables(SchemaTablePrefix prefix)
{
    log.info("List all tables with prefix " + prefix.toString());
    List<SchemaTableName> tables = new ArrayList<>();
    String dbPrefix = prefix.getSchemaName();
    log.debug("listTables dbPrefix: " + dbPrefix);
    String tblPrefix = prefix.getTableName();
    log.debug("listTables tblPrefix: " + tblPrefix);

    // if dbPrefix not mean to match all
    String tblName;
    String dbName;
    if (dbPrefix != null) {
        if (tblPrefix != null) {
            tblName = tblPrefix;
            dbName = dbPrefix;
        }
        else {
            MetaProto.StringListType stringListType = metaClient.listTables(dbPrefix);
            log.info("record size: " + stringListType.getStrCount());
            if (stringListType.getStrCount() == 0) {
                return tables;
            }
            for (int i = 0; i < stringListType.getStrCount(); i++) {
                tblName = stringListType.getStr(0);
                dbName = dbPrefix;
                log.debug("listTables tableName: " + formName(dbName, tblName));
                tables.add(new SchemaTableName(dbName, tblName));
            }
        }
    }
    return tables;
}
 
开发者ID:dbiir,项目名称:paraflow,代码行数:34,代码来源:MetaDataQuery.java

示例5: listTableColumns

import com.facebook.presto.spi.SchemaTablePrefix; //导入方法依赖的package包/类
@Override
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix)
{
    ImmutableMap.Builder<SchemaTableName, List<ColumnMetadata>> tableColumns = ImmutableMap.builder();
    for (String schemaName : getSchemaNames(session, prefix.getSchemaName())) {
        for (TpchTable<?> tpchTable : TpchTable.getTables()) {
            if (prefix.getTableName() == null || tpchTable.getTableName().equals(prefix.getTableName())) {
                ConnectorTableMetadata tableMetadata = getTableMetadata(schemaName, tpchTable);
                tableColumns.put(new SchemaTableName(schemaName, tpchTable.getTableName()), tableMetadata.getColumns());
            }
        }
    }
    return tableColumns.build();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:15,代码来源:TpchMetadata.java

示例6: listTables

import com.facebook.presto.spi.SchemaTablePrefix; //导入方法依赖的package包/类
private List<SchemaTableName> listTables(ConnectorSession session, SchemaTablePrefix prefix)
{
    if (prefix.getSchemaName() == null || prefix.getTableName() == null) {
        return listTables(session, prefix.getSchemaName());
    }
    return ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName()));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:HiveMetadata.java


注:本文中的com.facebook.presto.spi.SchemaTablePrefix.getTableName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。