Dwrite commented on code in PR #4916:
URL: https://github.com/apache/calcite/pull/4916#discussion_r3214383713
##########
babel/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -197,17 +197,31 @@ SqlCreate SqlCreateTable(Span s, boolean replace) :
void InfixCast(List<Object> list, ExprContext exprContext, Span s) :
{
final SqlDataTypeSpec dt;
+ SqlNode e, p;
}
{
<INFIX_CAST> {
checkNonQueryExpression(exprContext);
}
dt = DataType() {
- list.add(
- new SqlParserUtil.ToTreeListItem(SqlLibraryOperators.INFIX_CAST,
- s.pos()));
- list.add(dt);
+ SqlNode leftOperand = (SqlNode) list.remove(list.size() - 1);
Review Comment:
I think the current name InfixCast is more appropriate because the added
logic is strictly to prevent the 'greedy' consumption of subscripts by the type
specification. Since we are essentially fixing the precedence of the ::
operator rather than introducing a standalone field access rule, keeping the
original name ensures clarity for future maintenance.
--
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]