Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-444

Tajo fails to parse order by query with "is null" predicate in sort key

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: QueryMaster
    • Labels:
      None

      Description

      Prepare table like the on mentioned in TAJO-443
      Try following query:

      tajo> select score from table1 order by score is null;
      ERROR: mismatched input 'is' expecting {<EOF>, EXCEPT, INTERSECT, LIMIT, UNION, ';', ','}
      LINE 1:40 select score from table1 order by score is null
                                                         ^^
      

        Activity

        Hide
        blrunner Jaehwa Jung added a comment -

        Prafulla, thanks for your reporting.

        I found a bug about order by query as follows:

        tajo> select id, length(name) from table1 ;
        Progress: 100%, response time: 0.289 sec
        final state: QUERY_SUCCEEDED, response time: 0.289 sec
        result: hdfs://localhost:9010/tmp/tajo-blrunner/staging/q_1387765138654_0003/RESULT, 5 rows (20 B)
        id,  ?length
        -------------------------------
        1,  3
        2,  3
        3,  3
        4,  3
        5,  3
        tajo> select id, length(name) from table1 order by length(name);
        ERROR: mismatched input '(' expecting {<EOF>, EXCEPT, INTERSECT, LIMIT, UNION, ';', ','}
        LINE 1:51 select id, length(name) from table1 order by length(name)
        

        I think that it caused by order by clause settings of Tajo. Tajo just provide user to write columns on order by clause as follows:

        orderby_clause
          : ORDER BY sort_specifier_list
          ;
        
        sort_specifier_list
          : sort_specifier (COMMA sort_specifier)*
          ;
        
        sort_specifier
          : column=column_reference order=order_specification? null_order=null_ordering?
          ;
        

        SQLParser.g4 and SQLAnalyzer and SortSpec have to be updated for this issue.

        Show
        blrunner Jaehwa Jung added a comment - Prafulla, thanks for your reporting. I found a bug about order by query as follows: tajo> select id, length(name) from table1 ; Progress: 100%, response time: 0.289 sec final state: QUERY_SUCCEEDED, response time: 0.289 sec result: hdfs://localhost:9010/tmp/tajo-blrunner/staging/q_1387765138654_0003/RESULT, 5 rows (20 B) id, ?length ------------------------------- 1, 3 2, 3 3, 3 4, 3 5, 3 tajo> select id, length(name) from table1 order by length(name); ERROR: mismatched input '(' expecting { <EOF> , EXCEPT, INTERSECT, LIMIT, UNION, ';', ','} LINE 1:51 select id, length(name) from table1 order by length(name) I think that it caused by order by clause settings of Tajo. Tajo just provide user to write columns on order by clause as follows: orderby_clause : ORDER BY sort_specifier_list ; sort_specifier_list : sort_specifier (COMMA sort_specifier)* ; sort_specifier : column=column_reference order=order_specification? null_order=null_ordering? ; SQLParser.g4 and SQLAnalyzer and SortSpec have to be updated for this issue.
        Hide
        hyunsik Hyunsik Choi added a comment -

        Fixed by TAJO-501.

        Show
        hyunsik Hyunsik Choi added a comment - Fixed by TAJO-501 .

          People

          • Assignee:
            Unassigned
            Reporter:
            prafulla Prafulla T
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development