protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); for (String s : set.range(tableName, caseSensitive)) { for (Function function : schema.getFunctions(s)) { if (function instanceof TableMacro && function.getParameters().isEmpty()) { final Table table = ((TableMacro) function).apply(ImmutableList.of()); return tableEntry(tableName, table); } } } return null; }
protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( ImmutableSortedMap.Builder<String, Table> builder) { ImmutableSortedMap<String, Table> explicitTables = builder.build(); final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); for (String s : set.iterable()) { // explicit table wins. if (explicitTables.containsKey(s)) { continue; } for (Function function : schema.getFunctions(s)) { if (function instanceof TableMacro && function.getParameters().isEmpty()) { final Table table = ((TableMacro) function).apply(ImmutableList.of()); builder.put(s, table); } } } }
protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); for (String s : set.range(tableName, caseSensitive)) { for (Function function : schema.getFunctions(s)) { if (function instanceof TableMacro && function.getParameters().isEmpty()) { final Table table = ((TableMacro) function).apply(ImmutableList.of()); return tableEntry(tableName, table); } } } return null; }
protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( ImmutableSortedMap.Builder<String, Table> builder) { ImmutableSortedMap<String, Table> explicitTables = builder.build(); final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); for (String s : set.iterable()) { // explicit table wins. if (explicitTables.containsKey(s)) { continue; } for (Function function : schema.getFunctions(s)) { if (function instanceof TableMacro && function.getParameters().isEmpty()) { final Table table = ((TableMacro) function).apply(ImmutableList.of()); builder.put(s, table); } } } }
protected void addImplicitSubSchemaToBuilder( ImmutableSortedMap.Builder<String, CalciteSchema> builder) { ImmutableSortedMap<String, CalciteSchema> explicitSubSchemas = builder.build(); final long now = System.currentTimeMillis(); final SubSchemaCache subSchemaCache = implicitSubSchemaCache.get(now); for (String name : subSchemaCache.names.iterable()) { if (explicitSubSchemas.containsKey(name)) { // explicit sub-schema wins. continue; } builder.put(name, subSchemaCache.cache.getUnchecked(name)); } }
protected TableEntry getImplicitTable(String tableName, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet implicitTableNames = implicitTableCache.get(now); for (String tableName2 : implicitTableNames.range(tableName, caseSensitive)) { final Table table = schema.getTable(tableName2); if (table != null) { return tableEntry(tableName2, table); } } return null; }
protected void addImplicitTypeNamesToBuilder(ImmutableSortedSet.Builder<String> builder) { // Add implicit types, case-sensitive. final long now = System.currentTimeMillis(); final NameSet set = implicitTypeCache.get(now); builder.addAll(set.iterable()); }
protected void addImplicitFuncNamesToBuilder( ImmutableSortedSet.Builder<String> builder) { // Add implicit functions, case-sensitive. final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); builder.addAll(set.iterable()); }
protected TypeEntry getImplicitType(String name, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet implicitTypeNames = implicitTypeCache.get(now); for (String typeName : implicitTypeNames.range(name, caseSensitive)) { final RelProtoDataType type = schema.getType(typeName); if (type != null) { return typeEntry(name, type); } } return null; }
protected void addImplicitFunctionsToBuilder( ImmutableList.Builder<Function> builder, String name, boolean caseSensitive) { // Add implicit functions, case-insensitive. final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); for (String name2 : set.range(name, caseSensitive)) { final Collection<Function> functions = schema.getFunctions(name2); if (functions != null) { builder.addAll(functions); } } }
protected TableEntry getImplicitTable(String tableName, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet implicitTableNames = implicitTableCache.get(now); for (String tableName2 : implicitTableNames.range(tableName, caseSensitive)) { final Table table = schema.getTable(tableName2); if (table != null) { return tableEntry(tableName2, table); } } return null; }
protected TypeEntry getImplicitType(String name, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet implicitTypeNames = implicitTypeCache.get(now); for (String typeName : implicitTypeNames.range(name, caseSensitive)) { final RelProtoDataType type = schema.getType(typeName); if (type != null) { return typeEntry(name, type); } } return null; }
protected void addImplicitFunctionsToBuilder( ImmutableList.Builder<Function> builder, String name, boolean caseSensitive) { // Add implicit functions, case-insensitive. final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); for (String name2 : set.range(name, caseSensitive)) { final Collection<Function> functions = schema.getFunctions(name2); if (functions != null) { builder.addAll(functions); } } }
protected void addImplicitSubSchemaToBuilder( ImmutableSortedMap.Builder<String, CalciteSchema> builder) { ImmutableSortedMap<String, CalciteSchema> explicitSubSchemas = builder.build(); final long now = System.currentTimeMillis(); final SubSchemaCache subSchemaCache = implicitSubSchemaCache.get(now); for (String name : subSchemaCache.names.iterable()) { if (explicitSubSchemas.containsKey(name)) { // explicit sub-schema wins. continue; } builder.put(name, subSchemaCache.cache.getUnchecked(name)); } }
protected void addImplicitFuncNamesToBuilder( ImmutableSortedSet.Builder<String> builder) { // Add implicit functions, case-sensitive. final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); builder.addAll(set.iterable()); }
protected void addImplicitTableToBuilder( ImmutableSortedSet.Builder<String> builder) { // Add implicit tables, case-sensitive. final long now = System.currentTimeMillis(); final NameSet set = implicitTableCache.get(now); builder.addAll(set.iterable()); }