snuyanzin commented on code in PR #25763:
URL: https://github.com/apache/flink/pull/25763#discussion_r1881881908
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/inference/strategies/ToTimestampLtzTypeStrategy.java:
##########
@@ -23,19 +23,54 @@
import org.apache.flink.table.types.DataType;
import org.apache.flink.table.types.inference.CallContext;
import org.apache.flink.table.types.inference.TypeStrategy;
+import org.apache.flink.table.types.logical.LogicalTypeRoot;
+import java.util.List;
import java.util.Optional;
/** Type strategy of {@code TO_TIMESTAMP_LTZ}. */
@Internal
public class ToTimestampLtzTypeStrategy implements TypeStrategy {
+ private static final int DEFAULT_PRECISION = 3;
+
@Override
public Optional<DataType> inferType(CallContext callContext) {
- if (callContext.isArgumentLiteral(1)) {
- final int precision = callContext.getArgumentValue(1,
Integer.class).get();
- return Optional.of(DataTypes.TIMESTAMP_LTZ(precision));
+ List<DataType> argumentTypes = callContext.getArgumentDataTypes();
Review Comment:
can you add tests for this logic
i guess somewhere in `org.apache.flink.table.types.inference` package
for instance `TypeStrategiesTest` or other class if other fits better
--
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]