From 18094a0a0f0662b0db1fd6f2eba7814fb04e5c36 Mon Sep 17 00:00:00 2001 From: Kirill Makan Date: Thu, 17 Nov 2022 14:01:55 +0100 Subject: [PATCH] fix the order_by_clause for the dot-separated col references --- CHANGELOG.md | 4 ++++ src/queryparser/__init__.py | 2 +- src/queryparser/adql/ADQLParser.g4 | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77dd4f6..afce174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.1 (2022-11-17) + +- fixed the `ORDER BY` clause for the dot-separated column references + ## 0.6.0 (2022-11-04) - bump the version of `antlr4-python3-runtime` to 4.11.1 diff --git a/src/queryparser/__init__.py b/src/queryparser/__init__.py index 43e8e6e..af8eb5f 100644 --- a/src/queryparser/__init__.py +++ b/src/queryparser/__init__.py @@ -1,5 +1,5 @@ __title__ = 'queryparser' -__version__ = '0.6.0' +__version__ = '0.6.1' __author__ = 'Gal Matijevic' __email__ = 'gmatijevic@aip.de' __license__ = 'Apache-2.0' diff --git a/src/queryparser/adql/ADQLParser.g4 b/src/queryparser/adql/ADQLParser.g4 index 609dd1a..1c1fadb 100644 --- a/src/queryparser/adql/ADQLParser.g4 +++ b/src/queryparser/adql/ADQLParser.g4 @@ -162,7 +162,7 @@ set_limit: TOP unsigned_decimal ; set_quantifier: DISTINCT | ALL ; sign: PLUS | MINUS ; signed_integer: ( sign )? unsigned_decimal ; -sort_key: column_name | unsigned_decimal ; +sort_key: value_expression| column_reference | unsigned_decimal ; sort_specification: sort_key (ordering_specification )? ; sort_specification_list: sort_specification ( COMMA sort_specification )* ; string_geometry_function: extract_coordsys ; @@ -217,4 +217,4 @@ value_expression_primary: | set_function_specification | LPAREN value_expression RPAREN ; where_clause: WHERE search_condition ; -with_query: query_name ( LPAREN column_name ( COMMA column_name )* RPAREN )? AS LPAREN ( query_specification )? RPAREN ; \ No newline at end of file +with_query: query_name ( LPAREN column_name ( COMMA column_name )* RPAREN )? AS LPAREN ( query_specification )? RPAREN ;