当前位置:网站首页>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
}
}
边栏推荐
猜你喜欢
Use the TCP protocol, we won't lost package?
数字孪生助力智慧城市可视化建设
Informatics Olympiad All-in-One (1259: [Example 9.3] Find the longest non-descending sequence)
Helm基础知识
SublimeText3 安装、配置项、包管理、常用必备插件、常用快捷键以及修改
X 2 Earn必须依靠旁氏启动?GameFi的出路在哪?(下)
"A daily practice, happy water problem" 1374. Generate a string with an odd number of each character
Electrical diagram of power supply system
信息学奥赛一本通(1258:【例9.2】数字金字塔)
go——垃圾回收机制(GC)
随机推荐
Tencent YunMeng every jie: I experienced by cloud native authors efficiency best practices case
[21 Days Learning Challenge] Bubble Sort and Insertion Sort
go——垃圾回收机制(GC)
2022年金九银十,Android面试中高频必问的问题汇总
OP analysis and design
封装和包、访问修饰权限
js how to get the browser zoom ratio
快速构建电脑软件系统 、超好用经典的网页推荐汇总
用户之声 | 大学生的“课外学堂”
Implement fashion_minst clothing image classification
y85.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶、pushgateway和prometheus存储(十六)
实现fashion_minst服装图像分类
Wiring diagrams of switches, motors, circuit breakers, thermocouples, and meters
解道8-编程技术5
博客主页rrs代码
性能测试 - 理论
MSTP与STP
Li Mu hands-on learning deep learning V2-bert and code implementation
信息学奥赛一本通(1260:【例9.4】拦截导弹(Noip1999))
二叉搜索树的实现