[FLINK-38964][table] Reuse Calcite's SqlValidatorImpl#maybeCast
#27461
+21
−61
SqlValidatorImpl#maybeCast
#27461