Don’t think this is easy task to implement on your own (see here). I suggest to leverage python integration in KNIME and use sql-metadata library to do this. See here:
Hi @Benakesh_yadav , as @ipazin says, there is no “out of the box” solution for this, and python is your best bet.
However, I have a (currently private) component that uses the python sqlparse library and the some additional KNIME processing using Column Expressions and I believe it can achieve what you are wanting to do.
I haven’t released it publicly because it is still experimental, although I’ve been using it on my own projects for the past year.
Let me know if you are able to use python, and can install sqlparse (e.g pip install sqlparse or equivalent), and this is of interest to you, I’ll see if I can put it into a form that is suitable for public releasing.
btw, which version of KNIME are you using? My component is currently using KNIME 5.3.3, but if you need an earlier version, I’ll have to port it backwards as some nodes may have changed.
It uses my SQL Statement Inspector component, which as I mentioned before is experimental, so please don’t rely on it without doing your own testing!
To use this component, you must have Column Expressions and the Python Extension installed, and also have the sqlparse python library installed in your python environment.
There are two outport ports. The upper presents a list of all the “tokens” (component parts) found in the SQL statement, along with the categories that it determines the token belongs to.
The lower port is a list of all table names/view names found in the statement, so your example:
select * from tableA inner join tableB on col1=col2