kasakrisz commented on code in PR #3807:
URL: https://github.com/apache/hive/pull/3807#discussion_r1034612361
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/parser/Filter.g:
##########
@@ -141,7 +141,11 @@ binOpExpression
(
(key = Identifier op = operator value = DateLiteral)
|
+ (key = Identifier op = operator keyword = KW_DATE value =
StringLiteral)
+ |
Review Comment:
Got your point.
How about this?
```
fragment DateString
:
(Digit)(Digit)(Digit)(Digit) '-' (Digit)(Digit) '-' (Digit)(Digit)
;
DateLiteral
:
KW_DATE '\'' DateString '\'' { ExtractDate(getText()) != null }?
| DateString { ExtractDate(getText()) != null }?
;
```
* If `DATE` keyword presents let's expect a valid date in quotes.
* If `DATE` keyword does not present treat it as an unquoted date. I haven't
been able to generate a filter having a date literal represented like this so I
just added this to be backward compatible with the current solution.
* When cbo is off `DATE` keyword is not added to the filter string and the
date is in quotes. In this case date is treated as a string.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]