Re: What is the suggested way to validate SQL?

2020-01-09 Thread Fabian Hueske
Hi all, Yes, I agree. It would be good to have dedicated methods to check the validity of SQL queries. I would propose to have two validation methods: 1. syntactic and semantic validation of a SQL query, i.e., SQL keywords, catalog information, types in expressions and functions, etc. This is a

Re: What is the suggested way to validate SQL?

2020-01-08 Thread godfrey he
hi kaibo, As we discuss offline, I think it's a clean way that flink-table provides an interface (or a tool) to do the sql validation for platform users. `tEnv.sqlUpdate` or `tEnv.explain(false)` is a temporary solution which contains too many unrelated logic (just consider the functionality

Re: What is the suggested way to validate SQL?

2020-01-08 Thread Arvid Heise
A common approach is to add the connector jar as test dependencies and have a smoke test that just starts the job with a temporary external system spawned with docker. I usually use test containers [1]. Then you simply need to execute the integration tests in your IDE and usually can even debug

Re: What is the suggested way to validate SQL?

2019-12-30 Thread Kaibo Zhou
Hi, Jingsong, Thank you very much for your suggestion. I verified that use `tEnv.sqlUpdate("xxx")` and `tEnv.explain(false)` to do validation, it works. But this method needs the connector jar, which is very inconvenient to use. Hi, Danny, Many thanks for providing very useful explanations.

Re: What is the suggested way to validate SQL?

2019-12-30 Thread Danny Chan
Hi, Kaibo Zhou ~ There are several phrases that a SQL text get to execution graph what can be run with Flink runtime: 1. Sql Parse: parse the sql text to AST(sql node tree) 2. Sql node(row type) validation, this includes the tables/schema inference 3. Sql-to-rel conversion, convert the sql

Re: What is the suggested way to validate SQL?

2019-12-29 Thread Jingsong Li
Hi Kaibo, > Validate SQL syntax not need to depend on connector jar At present, sql function strongly need jar dependent support too , but the overall approach is still under discussion, and there is no clear plan at present. But you are right, it really important for platform users. Another way

What is the suggested way to validate SQL?

2019-12-27 Thread Kaibo Zhou
Hi, As a platform user, I want to integrate Flink SQL with the platform. The usage scenario is:users register table/udf to catalog service, and then write SQL scripts like: "insert into xxx select from xxx" through Web SQLEditor, the platform need to validate the SQL script after each time the