当前位置:网站首页>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
}
}
边栏推荐
猜你喜欢
包管理工具npm- node package management相关知识 、检查包更新、NPM包上传、更换镜像、npm ERR! registry error parsing json

A brief discussion on the transformation of .NET legacy applications

华为设备配置BFD多跳检测

千人优学 | GBase 8s数据库2022年6月大学生专场实训圆满结束

【流媒体】推流与拉流简介

iframe------------frame-

Day35 LeetCode

「 每日一练,快乐水题 」1374. 生成每种字符都是奇数个的字符串

汉源高科2光12电千兆导轨式网管型工业以太网交换机双光自愈保护式以太网光交换机

WPF development through practical 】 【 automatic production management platform
随机推荐
Geoip2 - golang golang source code analysis
.NET性能优化-你应该为集合类型设置初始大小
新增指令 v-memo
开关、电机、断路器、电热偶、电表接线图大全
HCIP--BGP基础实验
Flink Yarn Per Job - 创建启动Dispatcher RM JobManager
实现fashion_minst服装图像分类
Vscode快速入门、 插件安装、插件位置、修改vscode默认引用插件的路径、在命令行总配置code、快捷键
用了TCP协议,就一定不会丢包吗?
js如何获取浏览器缩放比例
人尽皆知的云原生,到底是大势所趋还是过度炒作?
ECCV 2022 | ByteTrack: 简单高效的数据关联方法
Mysql用户管理
vscode如何能将输出从OUTPUT改为TERMINAL或者DebugConsole
Solve the docker mysql can't write Chinese
PLC working principle animation
解道7-编程技术4
训练双塔检索模型,可以不用query-doc样本了?明星机构联合发文
传感器工作原理
ACE JET NPOI