@Nullable @Override public String toDruidExpression(RexNode rexNode, RelDataType rowType, DruidQuery query
    ) {
      final RexCall call = (RexCall) rexNode;
      if (call.getOperands().size() < 1 || call.getOperands().size() > 2) {
        throw new IllegalStateException("form_unixtime() requires 1 or 2 argument, got " + call.getOperands().size());
      }
      final String arg = DruidExpressions.toDruidExpression(call.getOperands().get(0), rowType, query);
      if (arg == null) {
        return null;
      }

      final String numMillis = DruidQuery.format("(%s * '1000')", arg);
      final String format =
          call.getOperands().size() == 1 ? DruidExpressions.stringLiteral(DEFAULT_TS_FORMAT) : DruidExpressions
              .toDruidExpression(call.getOperands().get(1), rowType, query);
      return DruidExpressions.functionCall("timestamp_format",
          ImmutableList.of(numMillis, format, DruidExpressions.stringLiteral(TimeZone.getTimeZone("UTC").getID()))
      );
    }
Expression operator conversion form Hive TO_DATE operator to Druid Date cast.
ql/src/java/org/apache/hadoop/hive/ql/parse/DruidSqlOperatorConverter.java