James Taylor created PHOENIX-1617: ------------------------------------- Summary: Date literals and CURRENT_DATE() calls do not work in VIEW definition Key: PHOENIX-1617 URL: https://issues.apache.org/jira/browse/PHOENIX-1617 Project: Phoenix Issue Type: Bug Reporter: James Taylor
The following will not work correct: {code} CREATE TABLE t (k INTEGER, v1 DATE); CREATE VIEW v AS SELECT * FROM t WHERE v1 < CURRENT_DATE()-1; {code} There are two issues: date literals do not round trip correctly from ParseNode -> Expression -> String. We need to output them as TO_DATE(<date as string>). Until we have a way to represent TIME and TIMESTAMP(PHOENIX-688 or PHOENIX-653), we're stuck. The CURRENT_DATE built-in has a similar issue. We end up turning it into a date literal, but instead we should have a CurrentDateExpression that evaluates to a literal, but which let's us roundtrip the ParseNode from an Expression to a String correctly. -- This message was sent by Atlassian JIRA (v6.3.4#6332)