当前位置:网站首页>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
}
}
边栏推荐
猜你喜欢

美国爱荷华州立大学| Improving Distantly Supervised Relation Extraction by Natural Language Inference(通过自然语言推理改进远程监督关系提取)

实现fashion_minst服装图像分类

【实战 已完结】WPF开发自动化生产管理平台

Electrical diagram of power supply system

JMeter的基本使用

Digital twins help visualize the construction of smart cities

汇编语言中b和bl关键字的区别

HCIP--BGP基础实验

广东省数字经济发展指引 1.0之建成数据安全保障体系

HCIP--路由策略实验
随机推荐
信息学奥赛一本通(1256:献给阿尔吉侬的花束)
奥特学园ROS笔记--7(289-325节)
浅议.NET遗留应用改造
典型相关分析CCA计算过程
传感器工作原理
callback prototype __proto__
.NET性能优化-你应该为集合类型设置初始大小
The Orsay in Informatics (1256: Bouquet for Algernon)
C# Barrier类
模糊查询like用法实例(Bee)
C语言中变量在内存中的保存与访问
go——垃圾回收机制(GC)
信息系统项目管理师必背核心考点(五十八)变更管理的主要角色
Informatics Olympiad All-in-One (1260: [Example 9.4] Intercepting Missiles (Noip1999))
新增指令 v-memo
Common tools and test methods for interface testing (Introduction)
框架设计:PC 端单页多页框架如何设计与落地
2022年金九银十,Android面试中高频必问的问题汇总
KDD 2022 | 深度图神经网络中的特征过相关:一个新视角
go——内存分配机制