@Nullable @Override public String toDruidExpression(RexNode rexNode, RelDataType rowType, DruidQuery query
    ) {
      final RexCall call = (RexCall) rexNode;
      final String arg0 = DruidExpressions.toDruidExpression(call.getOperands().get(0), rowType, query);
      if (arg0 == null) {
        return null;
      }
      if (SqlTypeUtil.isDatetime((call.getOperands().get(0).getType()))) {
        // Timestamp is represented as long internally no need to any thing here
        return DruidExpressions.functionCall("div", ImmutableList.of(arg0, DruidExpressions.numberLiteral(1000)));
      }
      // dealing with String type
      final String format = call.getOperands().size() == 2 ? DruidExpressions
          .toDruidExpression(call.getOperands().get(1), rowType, query) : DEFAULT_TS_FORMAT;
      return DruidExpressions
          .functionCall("unix_timestamp", ImmutableList.of(arg0, DruidExpressions.stringLiteral(format)));
    }
Expression operator conversion form Hive TO_DATE operator to Druid Date cast.
ql/src/java/org/apache/hadoop/hive/ql/parse/DruidSqlOperatorConverter.java