Since the "::" operator is of a different syntactic type to the CAST
operator it probably makes sense to have two operators.
I often say that it is wrong to make the parser do work other than
just parsing. In the case of :: and CAST, I suspect that there are
differences in semantics. If we make
@Muhammad Gelban , since the SqlStdOperatorTable.CAST is hard coded , I
think it's difficult to replace it absolutely with a new cast function now.
Lai Zhou 于2019年6月10日周一 下午6:54写道:
> @Muhammad Gelban, I suggest you to find the the usages of an Operator
> first , if you want to define a new one
@Muhammad Gelban, I suggest you to find the the usages of an Operator
first , if you want to define a new one to replace it .
In this case, you will find that the SqlStdOperatorTable.CAST is used by
the Sql Converter, there're a few more places need attention.
You can refer to the solution of my
I created a PR [1] to support the PostgreSQL :: casting operator. The way I
did this is by creating a new 'SqlBinaryOperator' child. This new child
wraps an instance of the 'SqlCastFunction' to reuse it's
'getOperandCountRange',
'inferReturnType', 'checkOperandTypes' and 'getMonotonicity' logic,