-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- support create ods table statement - support show statics statement - support hologres and hive create table client
- Loading branch information
Showing
261 changed files
with
28,068 additions
and
1,020 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## 0.4.5 | ||
新功能(new features) | ||
Core | ||
• 支持Call语法的操作,支持指标SQL的转换。 | ||
• 增加CreateDwsTable,汇总逻辑表的定义。 | ||
• ShowObjects语句对象支持Limit和Offset | ||
Transformer | ||
• 支持Maxcompute SQL到FML模型转换 | ||
• Maxcomputer转换器默认使用1.0版本类型方式 | ||
功能优化(enhancement) | ||
Core | ||
• CreateTable以及子类使用Builder模式进行重构 | ||
• ColumnDefinition使用Builder模式进行重构 | ||
• ChangeCol支持更改自定义属性。 | ||
• 新增一些常用的方法,用于判断Statement内的属性是否为空。 | ||
• 标识(Identifier)支持下划线开头,兼容ODPS表的规范。 | ||
JDBC Driver | ||
• 异常提示优化,增加requestId的请求,方便问题排查。 | ||
• 重构了底层的鉴权方式,采用Commad模式。 | ||
BugFix(bug fix) | ||
• Fixed MaxCompute Transformer1.0 时,不支持Alter语句的列类型转换。 | ||
向下兼容(compatibility) | ||
• 暂无 | ||
过期功能(deprecations) | ||
无 | ||
安全漏洞修复(vulnerability) | ||
无 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"cname": "fml.alibaba-inc.com", | ||
"public": "./docs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# FastModel Language | ||
|
||
FML(Fast Model Language) 用于维度建模领域快速构建的一门类SQL语言。主要目标是提供一套kimball维度建模理论下,结合大数据开发场景下的一种领域特定语言。 FML采用了类SQL的语言方式, 创建表语法是参考了SQL标准语法,并有自己的扩展。 | ||
FML是一种模型设计语言,期望做到设计与实现解耦,在设计过程中,不用特别考虑各个大数据引擎的实现方式。 建模引擎会根据FML定义的Schema去驱动底层各个数据引擎的执行和操作。 | ||
用户在使用FML时,并不需要特别关注底层数据引擎的细节部分,只有在实际物化(将设计的表转换为底层引擎的物理表时)阶段,建模引擎会根据物化的选择,将FML语言,转换为数据引擎可识别的SQL语法,并提交任务节点执行。具体与各个数据引擎的转换,请参考 FML Transform。 | ||
|
||
阅读更多: [https://fml.alibaba-inc.com/](https://fml.alibaba-inc.com/) | ||
|
||
### Features | ||
|
||
* 一种支持维度建模的领域特定语言,类SQL语法。 | ||
|
||
* 支持数仓规划、数据标准、标准代码、指标等数仓建设中全流程的语法定义。 | ||
|
||
* 使用Java编写,可以方便的构造语法的节点API进行模型构建。 | ||
|
||
* 支持FML语法转换到常见引擎,如MaxCompute,Hive, Hologres,Mysql, PlantUML等Transform API. | ||
|
||
* 提供基于JDBC Driver的方式,来使用FML语言来与模型引擎进行交互处理。 | ||
|
||
### Grammar Manual | ||
|
||
你可以使用FML语法,来定义维度建模模型信息,比如[表的创建](/zh-cn/model/table.md)等,FML提供了丰富的DDL语句,可以让你快速 进行建模的操作。 | ||
|
||
### Parser Example | ||
|
||
```java | ||
|
||
import com.aliyun.fastmodel.core.parser.FastModelParser; | ||
import com.aliyun.fastmodel.core.parser.FastModelParserFactory; | ||
|
||
public class HelloFML { | ||
//单例 | ||
private static final FastModelParser FAST_MODEL_PARSER = FastModelParserFactory.getInstance().get(); | ||
|
||
public static void main(String[] args) { | ||
String fml | ||
= "create dim table t_1 alias 'alias_name' (col bigint alias 'alias_name' comment 'col_comment') comment 'comment';"; | ||
CreateDimTable createDimTable = FAST_MODEL_PARSER.parseStatement(fml); | ||
//do your work | ||
} | ||
} | ||
|
||
``` | ||
|
||
### Transformer Example | ||
|
||
```java | ||
import com.aliyun.fastmodel.core.tree.BaseStatement; | ||
import com.aliyun.fastmodel.transform.api.Transformer; | ||
import com.aliyun.fastmodel.transform.api.TransformerFactory; | ||
import com.aliyun.fastmodel.transform.api.context.TransformContext; | ||
import com.aliyun.fastmodel.transform.api.dialect.DialectMeta; | ||
|
||
public class HelloFMLTransformer { | ||
public static void main(String[] args) { | ||
DialectMeta dialectMeta = | ||
Transformer < BaseStatement > statementTransformer = TransformerFactory.getInstance().get(dialectMeta); | ||
statementTransformer.transform(statement, context).getNode(); | ||
} | ||
} | ||
``` | ||
|
||
## Building FML from Source | ||
|
||
FML构建准备条件: | ||
|
||
* Unix-like environment (we use Linux, Mac OS X, Cygwin, WSL) | ||
* Git | ||
* Maven (we recommend version 3.5.0+) | ||
* Java 8 | ||
|
||
``` | ||
git clone [email protected]:base-biz/fastmodel.git | ||
cd fastmodel | ||
mvn clean package -DskipTests # this will take up to 10 minutes | ||
``` | ||
|
||
## Developing FML | ||
|
||
FML提交者使用IntelliJ IDEA来开发FML代码库,我们推荐IntelliJ IDEA开发Java工程 | ||
|
||
IDE的最小支持集包括: | ||
|
||
* 支持Java工程 | ||
* 支持Maven | ||
|
||
### IntelliJ IDEA | ||
|
||
IntelliJ IDE 支持以下插件 | ||
|
||
* IntelliJ 下载地址: [https://www.jetbrains.com/idea/](https://www.jetbrains.com/idea/) | ||
* IntelliJ ANTLR 插件地址: [https://plugins.jetbrains.com/plugin/7358-antlr-v4](https://plugins.jetbrains.com/plugin/7358-antlr-v4) | ||
|
||
## Documentation | ||
|
||
FML文档会部署在 : [https://fml.alibaba-inc.com](https://fml.alibaba-inc.com) | ||
或者可以从 `docs/` 目录查看源文件。 | ||
|
||
## Fork and Contribute | ||
|
||
当前FML处于内部开源项目,欢迎大家使用和参与并贡献它. 你可以联系我们看是否能够提供一些支持,可以从这边文章描述 | ||
[如何贡献代码](https://fml.alibaba-inc.com/#/zh-cn/how-to-contribute). | ||
|
||
## RoadMap | ||
|
||
```plantuml | ||
projectscale quarterly | ||
@startgantt | ||
Project starts 2022-03-01 | ||
[支持hologres的从sql逆向到fml模型处理] lasts 15 days | ||
[支持clickhouse sql的转换和逆向处理] lasts 30 days | ||
[支持FML元数据能力] lasts 60 days | ||
[引擎语法转换可定制] lasts 30 days | ||
[引擎语法转换可定制]->[支持clickhouse sql的转换和逆向处理] | ||
[支持hologres的从sql逆向到fml模型处理] -> [引擎语法转换可定制] | ||
@endgantt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
fastmodel-benchmarks/src/main/java/com/aliyun/fastmodel/benchmarks/Tpch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2020. Aliyun.com All right reserved. This software is the | ||
* confidential and proprietary information of Aliyun.com ("Confidential | ||
* Information"). You shall not disclose such Confidential Information and shall | ||
* use it only in accordance with the terms of the license agreement you entered | ||
* into with Aliyun.com. | ||
*/ | ||
|
||
package com.aliyun.fastmodel.benchmarks; | ||
|
||
import java.io.IOException; | ||
import java.io.UncheckedIOException; | ||
|
||
import com.google.common.io.Resources; | ||
|
||
import static com.google.common.base.Charsets.UTF_8; | ||
|
||
/** | ||
* TPCH | ||
* | ||
* @author panguanjing | ||
* @date 2020/11/23 | ||
*/ | ||
public class Tpch { | ||
|
||
public String getQuery(int i){ | ||
return getTpchQuery(i); | ||
} | ||
|
||
private String getTpchQuery(int q) { | ||
return readResource("tpch/" + q + ".sql"); | ||
} | ||
|
||
private String readResource(String name) { | ||
try { | ||
return Resources.toString( | ||
Resources.getResource(name), UTF_8); | ||
} catch (IOException e) { | ||
throw new UncheckedIOException(e); | ||
} | ||
} | ||
} |
Oops, something went wrong.