当前位置:网站首页>apache calcite中关于model文件配置
apache calcite中关于model文件配置
2022-08-02 20:34:00 【码大哈的园子】
apache calcite(版本: 1.27.0)中关于model文件配置
1.配置样例
{
"version": "1.0",
"defaultSchema": "SALES",
"schemas": [
{
"name": "SALES",
"type": "custom",
"factory": "org.apache.calcite.adapter.csv.CsvSchemaFactory",
"operand": {
"directory": "sales"
}
}
]
}
version:Schema模型版本号。 必需,必须具有值“1.0”。
defaultSchema:将成为使用此模型的 Calcite 连接的默认模式的模式名称。可选,区分大小写。 如果指定,则此模型中必须有一个具有此名称的模式。
2.部分源码
public class JsonRoot {
/** Schema model version number. Required, must have value "1.0". */
public final String version;
/** Name of the schema that will become the default schema for connections * to Calcite that use this model. * * <p>Optional, case-sensitive. If specified, there must be a schema in this * model with this name. */
public final @Nullable String defaultSchema;
/** List of schema elements. * * <p>The list may be empty. */
public final List<JsonSchema> schemas = new ArrayList<>();
@JsonCreator
public JsonRoot(
@JsonProperty(value = "version", required = true) String version,
@JsonProperty("defaultSchema") @Nullable String defaultSchema) {
this.version = requireNonNull(version, "version");
this.defaultSchema = defaultSchema;
}
}
public abstract class JsonSchema {
/** Name of the schema. * * <p>Required. * * @see JsonRoot#defaultSchema */
public final String name;
/** SQL path that is used to resolve functions used in this schema. * * <p>May be null, or a list, each element of which is a string or a * string-list. * * <p>For example, * * <blockquote><pre>path: [ ['usr', 'lib'], 'lib' ]</pre></blockquote> * * <p>declares a path with two elements: the schema '/usr/lib' and the schema * '/lib'. Most schemas are at the top level, and for these you can use a * string. */
public final @Nullable List<Object> path;
/** * List of tables in this schema that are materializations of queries. * * <p>The list may be empty. */
public final List<JsonMaterialization> materializations = new ArrayList<>();
public final List<JsonLattice> lattices = new ArrayList<>();
/** Whether to cache metadata (tables, functions and sub-schemas) generated * by this schema. Default value is {@code true}. * * <p>If {@code false}, Calcite will go back to the schema each time it needs * metadata, for example, each time it needs a list of tables in order to * validate a query against the schema.</p> * * <p>If {@code true}, Calcite will cache the metadata the first time it reads * it. This can lead to better performance, especially if name-matching is * case-insensitive * (see {@link org.apache.calcite.config.Lex#caseSensitive}).</p> * * <p>Tables, functions and sub-schemas explicitly created in a schema are * not affected by this caching mechanism. They always appear in the schema * immediately, and are never flushed.</p> */
public final @Nullable Boolean cache;
/** Whether to create lattices in this schema based on queries occurring in * other schemas. Default value is {@code false}. */
public final @Nullable Boolean autoLattice;
protected JsonSchema(String name, @Nullable List<Object> path, @Nullable Boolean cache,
@Nullable Boolean autoLattice) {
this.name = name;
this.path = path;
this.cache = cache;
this.autoLattice = autoLattice;
}
public abstract void accept(ModelHandler handler);
public void visitChildren(ModelHandler modelHandler) {
}
/** Built-in schema types. */
public enum Type {
MAP,
JDBC,
CUSTOM
}
}
边栏推荐
猜你喜欢
随机推荐
快速构建电脑软件系统 、超好用经典的网页推荐汇总
Day35 LeetCode
.NET性能优化-你应该为集合类型设置初始大小
How the sensor works
Xcode13.1运行工程报错fatal error: ‘IFlyMSC/IFly.h‘ file not found的问题
Wiring diagrams of switches, motors, circuit breakers, thermocouples, and meters
力扣每日一题-第46天-344. 反转字符串
Solve the docker mysql can't write Chinese
特拉维夫大学 | Efficient Long-Text Understanding with Short-Text Models(使用短文本模型进行高效的长文本理解)
Day35 LeetCode
李沐动手学深度学习V2-bert和代码实现
信息学奥赛一本通(1259:【例9.3】求最长不下降序列)
Li Mu hands-on deep learning V2-BERT pre-training and code implementation
有效解决MySQL报错:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/YES)
php 单引号 双引号 -> => return echo
iframe------------frame-
setup syntax sugar defineProps defineEmits defineExpose
一次线上事故,我顿悟了异步的精髓
Vscode快速入门、 插件安装、插件位置、修改vscode默认引用插件的路径、在命令行总配置code、快捷键
C primer plus学习笔记 —— 9、联合&枚举&typdef