Github user traflm commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1481#discussion_r175641075
--- Diff: core/sql/parser/sqlparser.y ---
@@ -8734,6 +8738,30 @@ datetime_value_function : TOK_CURDATE '(' ')'
$$ = new (PARSERHEAP()) Cast(uniqueId,type);
}
+/* type item */
+datetime_misc_function_used_as_default: TOK_TO_CHAR '('
value_expression ',' character_string_literal ')'
+ {
+ NAString * ves= unicodeToChar
+ (ToTokvalPlusYYText(&$3)->yytext,
+ ToTokvalPlusYYText(&$3)->yyleng,
+ (CharInfo::CharSet) (
+ ComGetNameInterfaceCharSet() //
CharInfo::UTF8
+ ),
+ PARSERHEAP());
+ //save the original text
+ NAString fullstr;
+ fullstr += "TO_CHAR(";
--- End diff --
to_char(sysdate, 'YYYYMMDD') unparse to
TO_CHAR(CAST(currrenttimestmp), 'YYYYMMDD')
Which cannot be compiled later. Given more time, I may be able to find the
right place to modify the unparse for sysdate, but the CAST is something that
very hard to make it generic. Other unparse usage place may need the CAST. So
for now, I have to keep the original text in this way.
---