Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-22968

CONVERT function returns error "Failed to parse query"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 3.0
    • None
    • sql
    • Docs Required, Release Notes Required

    Description

      Steps:
      1.

      create table tmp_table_from (key_field INT PRIMARY KEY,field1 VARCHAR);
      

      2.

      insert into tmp_table_from (key_field, field1) values (1, '2017-11-09');
      

      3.

      create table tmp_table_to (key_field INT PRIMARY KEY,field1 DATE);
      

      4.

      insert into tmp_table_to (key_field, field1) values (1, (select CONVERT(field1, DATE) from tmp_table_from where key_field = 1));
      

      Expected:
      All queries passed.
      Actual:
      Erorr on step 4:

      // Some comments here
      Failed to parse query: Incorrect syntax near the keyword 'DATE' at line 1, column 81,
      

      The similar error for types: TIME, TIMESTAMP, DATE,

      But for VARCHAR there is a different error:

      insert into tmp_table_to (key_field, field1) values (1, (select CONVERT(field1, VARCHAR) from tmp_table_from where key_field = 1));
      
      
      Failed to parse query: Encountered ")" at line 1, column 88, 
      

      Comments:
      The DOC for GG8 https://www.gridgain.com/docs/latest/sql-reference/system-functions#convert (didn't find for GG9)

      Calcite link https://calcite.apache.org/docs/reference.html#conversion

      Attachments

        Activity

          People

            Unassigned Unassigned
            lunigorn Igor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: