4 Replies Latest reply on Sep 23, 2013 12:50 AM by Rakesh Balguri

    QueryParserException while creating views in DDL

    Rakesh Balguri Expert

      Hi all,

       

      We are migrating from Teiid 8.1 to 8.5 and we are getting the QueryParserException when we are trying to deploy our VDB which contains models where we are creating a view with the metadata DDL.

       

      I had gone through the documentation and the syntax seems to be fine.

       

      Attached is the sample VDB using which we are getting the exception.

       

      The following is the view:

       

      <model visible = "true" type = "VIRTUAL" name = "customers">

           <metadata type = "DDL"><![CDATA[

                    create  view tree_definition ( symbol varchar(255), price bigdecimal CONSTRAINT INDEX(symbol)) OPTIONS (MATERIALIZED 'true') AS select stock.* from (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock

           ]]>

           </metadata>

      </model>

       

      The following is the exception:

       

      11:33:56,071 WARN  [org.teiid.RUNTIME] (teiid-async-threads - 2)  TEIID50036 VDB DynamicPortfolio.1 model "customers" metadata failed to load. Reason:TEIID30386 org.teiid.api.exception.query.QueryParserException: TEIID31100 Parsing error: Encountered ", price bigdecimal [*]CONSTRAINT[*] INDEX(" at line 2, column 84.

      Was expecting: "default" | "not" | "options" | "primary" | "unique" | "index" | "auto_increment" | "," | "(" | ")" ...