Comments (1)
Support, you can check the test case CepTest#testInsertSelectViewCep to see if it meets your needs. @zhangl0804
@Test
public void testInsertSelectViewCep() {
context.execute("DROP VIEW IF EXISTS temperature_view ");
context.execute("CREATE VIEW IF NOT EXISTS temperature_view AS " +
"SELECT " +
" * " +
"FROM " +
" temperature_source MATCH_RECOGNIZE ( " +
" PARTITION BY rack_id " +
" ORDER BY ts " +
" MEASURES " +
" A.ts as start_ts, " +
" LAST(B.ts) as end_ts, " +
" A.temperature as start_temp, " +
" LAST(B.temperature) as end_temp, " +
" AVG(B.temperature) as avg_temp " +
" ONE ROW PER MATCH " +
" AFTER MATCH SKIP TO NEXT ROW " +
" PATTERN (A B+ C) WITHIN INTERVAL '90' second " +
" DEFINE " +
" A as A.temperature < 50, " +
" B as B.temperature >=50, " +
" C as C.temperature < 50 " +
" )"
);
String sql = "INSERT INTO print_sink (rack_id, start_ts, end_ts, start_temp, end_temp, avg_temp) " +
"SELECT " +
" rack_id ," +
" start_ts ," +
" end_ts ," +
" start_temp ," +
" end_temp ," +
" avg_temp " +
"FROM" +
" temperature_view";
// variables A and B in transform are not replaced. LAST and AVG functions have also been replaced, and add CAST function.
String[][] expectedArray = {
{"temperature_source", "rack_id", "print_sink", "rack_id"},
{"temperature_source", "ts", "print_sink", "start_ts", "CAST(A.ts):TIMESTAMP(3)"},
{"temperature_source", "ts", "print_sink", "end_ts", "CAST(LAST(B.ts, 0)):TIMESTAMP(3)"},
{"temperature_source", "temperature", "print_sink", "start_temp", "A.temperature"},
{"temperature_source", "temperature", "print_sink", "end_temp", "LAST(B.temperature, 0)"},
{"temperature_source", "temperature", "print_sink", "avg_temp", "CAST(/(SUM(B.temperature), COUNT(B.temperature))):INTEGER"}
};
analyzeLineage(sql, expectedArray);
}
from flink-sql-lineage.
Related Issues (20)
- 作业级别血缘实现方案探讨
- 血缘解析 使用UUID()时血缘解析 血缘关系错误 flink版本1.14 HOT 1
- failed to deploy with docker-compose HOT 7
- [Feature]Create a universal lineage component for front-end
- mvn clean package出现错误“Failed to run task: 'yarn install' failed” HOT 1
- support flink1.16 HOT 3
- 支持flink java 打包成jar 提交运行血缘
- 当where中包含字段等于常量时,会把源字段优化成常量,导致丢失改字段的血缘关系 HOT 4
- [Discussion] 关于在flink当中添加atlasHook的实现
- PROCTIME()类型的字段血缘关系解析错误 HOT 2
- Field lineage returns an incorrect result HOT 1
- 语法中如果有window tvf会返回空 HOT 1
- main 分支测试报错 HOT 2
- [Bug]Flink cep sql column lineage parse error
- UDTF 函数使用别名时解析异常 HOT 5
- flinksql lineage result missed one column
- 为什么UT跑的都是报错呢?比如testJdbcCatalog 用例 HOT 1
- Support Flink 1.17 HOT 1
- Push lineage-flink package to the Maven Repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flink-sql-lineage.