本文整理匯總了Java中org.apache.calcite.util.Compatible類的典型用法代碼示例。如果您正苦於以下問題:Java Compatible類的具體用法?Java Compatible怎麽用?Java Compatible使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Compatible類屬於org.apache.calcite.util包,在下文中一共展示了Compatible類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: CachingCalciteSchema
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/**
* Creates a CachingCalciteSchema.
*/
CachingCalciteSchema(CalciteSchema parent, Schema schema, String name) {
super(parent, schema, name);
this.implicitSubSchemaCache =
new AbstractCached<SubSchemaCache>() {
public SubSchemaCache build() {
return new SubSchemaCache(CachingCalciteSchema.this,
Compatible.INSTANCE.navigableSet(
ImmutableSortedSet.copyOf(COMPARATOR,
CachingCalciteSchema.this.getSchema().getSubSchemaNames())));
}
};
this.implicitTableCache =
new AbstractCached<NavigableSet<String>>() {
public NavigableSet<String> build() {
return Compatible.INSTANCE.navigableSet(
ImmutableSortedSet.copyOf(COMPARATOR,
CachingCalciteSchema.this.getSchema().getTableNames()));
}
};
this.implicitFunctionCache =
new AbstractCached<NavigableSet<String>>() {
public NavigableSet<String> build() {
return Compatible.INSTANCE.navigableSet(
ImmutableSortedSet.copyOf(COMPARATOR,
CachingCalciteSchema.this.getSchema().getFunctionNames()));
}
};
}
示例2: getSubSchemaMap
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/**
* Returns a collection of sub-schemas, both explicit (defined using
* {@link #add(String, org.apache.calcite.schema.Schema)}) and implicit
* (defined using {@link org.apache.calcite.schema.Schema#getSubSchemaNames()}
* and {@link Schema#getSubSchema(String)}).
*/
public final NavigableMap<String, CalciteSchema> getSubSchemaMap() {
// Build a map of implicit sub-schemas first, then explicit sub-schemas.
// If there are implicit and explicit with the same name, explicit wins.
final ImmutableSortedMap.Builder<String, CalciteSchema> builder =
new ImmutableSortedMap.Builder<>(COMPARATOR);
builder.putAll(subSchemaMap);
addImplicitSubSchemaToBuilder(builder);
return Compatible.INSTANCE.navigableMap(builder.build());
}
示例3: getTableNames
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/**
* Returns the set of all table names. Includes implicit and explicit tables
* and functions with zero parameters.
*/
public final NavigableSet<String> getTableNames() {
final ImmutableSortedSet.Builder<String> builder =
new ImmutableSortedSet.Builder<>(COMPARATOR);
// Add explicit tables, case-sensitive.
builder.addAll(tableMap.keySet());
// Add implicit tables, case-sensitive.
addImplicitTableToBuilder(builder);
return Compatible.INSTANCE.navigableSet(builder.build());
}
示例4: getFunctionNames
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/**
* Returns the list of function names in this schema, both implicit and
* explicit, never null.
*/
public final NavigableSet<String> getFunctionNames() {
final ImmutableSortedSet.Builder<String> builder =
new ImmutableSortedSet.Builder<>(COMPARATOR);
// Add explicit functions, case-sensitive.
builder.addAll(functionMap.keySet());
// Add implicit functions, case-sensitive.
addImplicitFuncNamesToBuilder(builder);
return Compatible.INSTANCE.navigableSet(builder.build());
}
示例5: getTableMap
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
@Override protected Map<String, Table> getTableMap() {
if (!discoverTables) {
return ImmutableMap.of();
}
if (tableMap == null) {
final DruidConnectionImpl connection = new DruidConnectionImpl(url, coordinatorUrl);
Set<String> tableNames = connection.tableNames();
tableMap = Compatible.INSTANCE.asMap(
ImmutableSet.copyOf(tableNames),
CacheBuilder.newBuilder()
.build(new CacheLoader<String, Table>() {
@Override public Table load(@Nonnull String tableName) throws Exception {
final Map<String, SqlTypeName> fieldMap = new LinkedHashMap<>();
final Set<String> metricNameSet = new LinkedHashSet<>();
final Map<String, List<ComplexMetric>> complexMetrics = new HashMap<>();
connection.metadata(tableName, DruidTable.DEFAULT_TIMESTAMP_COLUMN,
null, fieldMap, metricNameSet, complexMetrics);
return DruidTable.create(DruidSchema.this, tableName, null,
fieldMap, metricNameSet, DruidTable.DEFAULT_TIMESTAMP_COLUMN,
complexMetrics);
}
}));
}
return tableMap;
}
示例6: getSubSchemaMap
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/** Returns a collection of sub-schemas, both explicit (defined using
* {@link #add(String, org.apache.calcite.schema.Schema)}) and implicit
* (defined using {@link org.apache.calcite.schema.Schema#getSubSchemaNames()}
* and {@link Schema#getSubSchema(String)}). */
public final NavigableMap<String, CalciteSchema> getSubSchemaMap() {
// Build a map of implicit sub-schemas first, then explicit sub-schemas.
// If there are implicit and explicit with the same name, explicit wins.
final ImmutableSortedMap.Builder<String, CalciteSchema> builder =
new ImmutableSortedMap.Builder<>(NameSet.COMPARATOR);
builder.putAll(subSchemaMap.map());
addImplicitSubSchemaToBuilder(builder);
return Compatible.INSTANCE.navigableMap(builder.build());
}
示例7: getTableNames
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/** Returns the set of all table names. Includes implicit and explicit tables
* and functions with zero parameters. */
public final NavigableSet<String> getTableNames() {
final ImmutableSortedSet.Builder<String> builder =
new ImmutableSortedSet.Builder<>(NameSet.COMPARATOR);
// Add explicit tables, case-sensitive.
builder.addAll(tableMap.map().keySet());
// Add implicit tables, case-sensitive.
addImplicitTableToBuilder(builder);
return Compatible.INSTANCE.navigableSet(builder.build());
}
示例8: getFunctionNames
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/** Returns the list of function names in this schema, both implicit and
* explicit, never null. */
public final NavigableSet<String> getFunctionNames() {
final ImmutableSortedSet.Builder<String> builder =
new ImmutableSortedSet.Builder<>(NameSet.COMPARATOR);
// Add explicit functions, case-sensitive.
builder.addAll(functionMap.map().keySet());
// Add implicit functions, case-sensitive.
addImplicitFuncNamesToBuilder(builder);
return Compatible.INSTANCE.navigableSet(builder.build());
}
示例9: getTableNames
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
@Override
public NavigableSet<String> getTableNames() {
return Compatible.INSTANCE.navigableSet(ImmutableSortedSet.<String>of());
}
示例10: getLatticeMap
import org.apache.calcite.util.Compatible; //導入依賴的package包/類
/**
* Returns a collection of lattices.
* <p/>
* <p>All are explicit (defined using {@link #add(String, Lattice)}).
*/
public final NavigableMap<String, LatticeEntry> getLatticeMap() {
return Compatible.INSTANCE.immutableNavigableMap(latticeMap);
}