Java Code Examples for org.apache.flink.table.catalog.stats.CatalogColumnStatistics#UNKNOWN

The following examples show how to use org.apache.flink.table.catalog.stats.CatalogColumnStatistics#UNKNOWN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HiveCatalog.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public CatalogColumnStatistics getTableColumnStatistics(ObjectPath tablePath) throws TableNotExistException, CatalogException {
	Table hiveTable = getHiveTable(tablePath);
	try {
		if (!isTablePartitioned(hiveTable)) {
			List<ColumnStatisticsObj> columnStatisticsObjs = client.getTableColumnStatistics(
					hiveTable.getDbName(), hiveTable.getTableName(), getFieldNames(hiveTable.getSd().getCols()));
			return new CatalogColumnStatistics(HiveStatsUtil.createCatalogColumnStats(columnStatisticsObjs));
		} else {
			// TableColumnStats of partitioned table is unknown, the behavior is same as HIVE
			return CatalogColumnStatistics.UNKNOWN;
		}
	} catch (TException e) {
		throw new CatalogException(String.format("Failed to get table column stats of table %s",
												tablePath.getFullName()), e);
	}
}
 
Example 2
Source File: HiveCatalog.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public CatalogColumnStatistics getTableColumnStatistics(ObjectPath tablePath) throws TableNotExistException, CatalogException {
	Table hiveTable = getHiveTable(tablePath);
	try {
		if (!isTablePartitioned(hiveTable)) {
			List<ColumnStatisticsObj> columnStatisticsObjs = client.getTableColumnStatistics(
					hiveTable.getDbName(), hiveTable.getTableName(), getFieldNames(hiveTable.getSd().getCols()));
			return new CatalogColumnStatistics(HiveStatsUtil.createCatalogColumnStats(columnStatisticsObjs, hiveVersion));
		} else {
			// TableColumnStats of partitioned table is unknown, the behavior is same as HIVE
			return CatalogColumnStatistics.UNKNOWN;
		}
	} catch (TException e) {
		throw new CatalogException(String.format("Failed to get table column stats of table %s",
												tablePath.getFullName()), e);
	}
}
 
Example 3
Source File: GenericInMemoryCatalog.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CatalogColumnStatistics getTableColumnStatistics(ObjectPath tablePath) throws TableNotExistException {
	checkNotNull(tablePath);

	if (!tableExists(tablePath)) {
		throw new TableNotExistException(getName(), tablePath);
	}

	CatalogColumnStatistics result = tableColumnStats.get(tablePath);
	return result != null ? result.copy() : CatalogColumnStatistics.UNKNOWN;
}
 
Example 4
Source File: GenericInMemoryCatalog.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CatalogColumnStatistics getPartitionColumnStatistics(ObjectPath tablePath, CatalogPartitionSpec partitionSpec)
		throws PartitionNotExistException {
	checkNotNull(tablePath);
	checkNotNull(partitionSpec);

	if (!partitionExists(tablePath, partitionSpec)) {
		throw new PartitionNotExistException(getName(), tablePath, partitionSpec);
	}

	CatalogColumnStatistics result = partitionColumnStats.get(tablePath).get(partitionSpec);
	return result != null ? result.copy() : CatalogColumnStatistics.UNKNOWN;
}
 
Example 5
Source File: GenericInMemoryCatalog.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CatalogColumnStatistics getTableColumnStatistics(ObjectPath tablePath) throws TableNotExistException {
	checkNotNull(tablePath);

	if (!tableExists(tablePath)) {
		throw new TableNotExistException(getName(), tablePath);
	}

	CatalogColumnStatistics result = tableColumnStats.get(tablePath);
	return result != null ? result.copy() : CatalogColumnStatistics.UNKNOWN;
}
 
Example 6
Source File: GenericInMemoryCatalog.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public CatalogColumnStatistics getPartitionColumnStatistics(ObjectPath tablePath, CatalogPartitionSpec partitionSpec)
		throws PartitionNotExistException {
	checkNotNull(tablePath);
	checkNotNull(partitionSpec);

	if (!partitionExists(tablePath, partitionSpec)) {
		throw new PartitionNotExistException(getName(), tablePath, partitionSpec);
	}

	CatalogColumnStatistics result = partitionColumnStats.get(tablePath).get(partitionSpec);
	return result != null ? result.copy() : CatalogColumnStatistics.UNKNOWN;
}
 
Example 7
Source File: KuduCatalog.java    From bahir-flink with Apache License 2.0 4 votes vote down vote up
@Override
public CatalogColumnStatistics getTableColumnStatistics(ObjectPath tablePath) throws CatalogException {
    return CatalogColumnStatistics.UNKNOWN;
}
 
Example 8
Source File: KuduCatalog.java    From bahir-flink with Apache License 2.0 4 votes vote down vote up
@Override
public CatalogColumnStatistics getPartitionColumnStatistics(ObjectPath tablePath, CatalogPartitionSpec partitionSpec) throws CatalogException {
    return CatalogColumnStatistics.UNKNOWN;
}
 
Example 9
Source File: AbstractJdbcCatalog.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public CatalogColumnStatistics getTableColumnStatistics(ObjectPath tablePath) throws TableNotExistException, CatalogException {
	return CatalogColumnStatistics.UNKNOWN;
}
 
Example 10
Source File: AbstractJdbcCatalog.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public CatalogColumnStatistics getPartitionColumnStatistics(ObjectPath tablePath, CatalogPartitionSpec partitionSpec) throws PartitionNotExistException, CatalogException {
	return CatalogColumnStatistics.UNKNOWN;
}