@ConstantFunction(name = "to_date", argTypes = {DATETIME}, returnType = DATE, isMonotonic = true)
    public static ConstantOperator toDate(ConstantOperator dateTime) {
        LocalDateTime dt = dateTime.getDatetime();
        LocalDateTime newDt = dt.truncatedTo(ChronoUnit.DAYS);
        return ConstantOperator.createDateOrNull(newDt);
    }
@Test
    public void toDate() {
        ConstantOperator result1 = ScalarOperatorFunctions
                .toDate(ConstantOperator.createDatetime(LocalDateTime.of(2001, 1, 9, 13, 4, 5)));
        assertTrue(result1.getType().isDate());
        // when transfer constantOpeartor to DateLiteral, only y/m/d will keep
        assertEquals("2001-01-09T00:00", result1.getDate().toString());

        ConstantOperator result2 = ScalarOperatorFunctions
                .toDate(ConstantOperator.createDate(LocalDateTime.of(2001, 1, 9, 14, 5, 6)));
        assertTrue(result1.compareTo(result2) == 0);
    }