Hi Jariv,

are you sure you want to join two columns of Purchase: *Purchase.Product_ID
= Purchase.ID*?
If that's the cause of the exception, the error message could be improved.

Cordialement / Best Regards,
*Thomas Rebele, PhD* | R&D Developer | Germany | www.tibco.com


On Mon, Aug 16, 2021 at 10:58 PM Jariv Narup <jariv.g.na...@gmail.com>
wrote:

> Hi Team,
>    I am getting the following exception while trying to parse a SQL
> statement into its tokens. Is this expected behavior? If not, what would
> you suggest to work around this problem. The particulars are given below:
>
> *Issue:*
> *Method threw 'java.lang.RuntimeException' exception. Cannot evaluate
> org.apache.calcite.sql.SqlJoin.toString().*
>
> *Where:*
> This happens when I use the following API (it is visible on the "from"
> value):
>
>         SqlParser.Config parserConfig = SqlParser.config();
>         parserConfig
>                 .withCaseSensitive(false)
>                 .withLex(Lex.ORACLE);
>         SqlParser parser = SqlParser.create(sqlString, parserConfig);
> >>> [Line with the issue]        *SqlNode sqlNode = parser.parseStmt();*
>
>
> *Debugger Image:*
> [image: image.png]
> *Version In Use:*
> I am using the following maven GAVs
> -org.apache.calcite:calcite-babel:1.27.0, so my assumption is that I am at
> the latest.
>
> *SQL Statement with the issue:*
>
> *SELECT Purchase.Purchase_Date, Products.Product_Name FROM Purchase JOIN
> Products ON Purchase.Product_ID = Purchase.ID WHERE Purchase.Quantity > 10*
>
> I would appreciate any help on this.
>
> Thanks - Jariv
>

Reply via email to