JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

JSQLParser not able to parse the informatica sql query.

Open Jakkani opened this issue 9 years ago • 6 comments

Reference: http://www.clearpeaks.com/blog/etl/informatica-best-practice-user-defined-join-syntax-in-the-source-qualifier-transformation

If SQL Query has "{" as mentioned in the above link, JSQL Parser throwing exception.

Jakkani avatar Jun 28 '16 09:06 Jakkani

Using {} instead of () is a very special use case. JSqlParser does only support ().

wumpz avatar Jun 28 '16 12:06 wumpz

Thanks for reply, I changed to () and run but my query length is more than 10000 characters. It is showing as ... like LANGUAGE_CODE = '$$LAN... . Please suggest.

Jakkani avatar Jun 28 '16 12:06 Jakkani

Sorry, but I dont understand what you mean. Give me a concrete example and the output and expected behaviour.

wumpz avatar Jun 28 '16 18:06 wumpz

Hello, just to know is there any limitation on query length? like max character limit 10000. i am getting the exception like below:

net.sf.jsqlparser.JSQLParserException at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:51) at com.jade.infa.util.SQLUtils.isScalarQuery(SQLUtils.java:414) at com.jade.infa.util.SQLUtils.main(SQLUtils.java:2761) Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " <S_IDENTIFIER> "W_PROJ_COST_LINE_FS "" at line 1, column 4116. Was expecting one of: "(" ... "(" ... "(" ... "(" ... "(" ...

Jakkani avatar Jun 29 '16 05:06 Jakkani

The heap is the limit. So I guess there are syntactical constructs JSqlParser does not know.

wumpz avatar Jun 29 '16 07:06 wumpz

The below query can not parse since joining condition are in Where clause. And it is showing the above error.

Select columnname1, columnaname2 from W_GL_ACCOUNT_D GL_ACCT_D_CR WHERE { W_PROJ_COST_LINE_FS INNER JOIN W_PROJECT_D ON W_PROJ_COST_LINE_FS.PROJECT_ID = W_PROJECT_D.INTEGRATION_ID AND W_PROJ_COST_LINE_FS.DATASOURCE_NUM_ID = W_PROJECT_D.DATASOURCE_NUM_ID LEFT OUTER JOIN PA_CAL ON W_PROJECT_D.PROJ_OPERATING_UNIT_ID = PA_CAL.ORG_ID } $$HINT2"

Jakkani avatar Jun 30 '16 06:06 Jakkani