Comments (5)
We can remove cycles by introducing some total order to the cycle like the dead lock prevention in DB.
We are now planning to implement an option to use file names order for the use and another option to remove all the edges in the cycle.
from alphasql.
Automatically removing cycles can ignore problems of SQL files.
It is simpler to make nodes depend only on create table statements, and if parallel execution is undesirable, write a script file to execute sequentially.
When the above simple rule implemented, we can ignore the possibility of cycles (in anyway, the type checking fails with cycle even now)
- create table with unique name
- only use existing resources
The cycle free property of this algorithm is proved by simple induction even for functions and variables.
When modifying existing scripts, we should be cautious about cycles, but dag
command teaches us when it happens.
from alphasql.
Also, we can always remove cycles by refactoring SQL files to separate depended resources as a new file because all the resources can be generated by another SQL.
This can be viewed as an example of DIP (dependency inversion principle).
from alphasql.
From v0.6.0, we only resolve dependencies between table references and create table statements.
from alphasql.
Making dependency of INSERT on CREATE, UPDATE on INSERT, and other DMLs on UPDATE for the preprocessing context is a little bit complex, and the order of dependency is not always reasonable. Also, coding rules to prevent cycles will be more complex than the current resolution algorithm.
We can express arbitrary dependencies as written in #5 by using dummy tables.
from alphasql.
Related Issues (20)
- Verbose log problem
- Support for `_TABLE_SUFFIX` HOT 1
- Support FIFO
- Add --with-tables option HOT 2
- Add warning when side effects and their targets are not in the same script HOT 1
- Add --warning-as-error option
- Filter temporary tables from referenced tables list because they are local
- Implement model dependency resolution
- Implement Warning for queries without create disposition
- Documentation for options
- Implement function schema reader
- Implement parameter type reader
- alphacheck should ignore tables and functions
- Support scripting HOT 1
- create view statements are not recognized HOT 4
- some sql with `declare` does not generate any references (although it should) HOT 1
- How to build/test AlphaSQL? HOT 2
- The same name for table, UDF, TVF should not be allowed
- Type not found: INTEGER
- required tables are not in EXTERNAL_REQUIRED_TABLES if the tables are created with recursive DDL HOT 1
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 alphasql.