Github user gparai commented on a diff in the pull request: https://github.com/apache/drill/pull/581#discussion_r81438806 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java --- @@ -408,6 +411,12 @@ private LogicalExpression getDrillFunctionFromOptiqCall(RexCall call) { return first; } + } else if (functionName.equals("to_date") || functionName.equals("to_time") || functionName.equals("to_timestamp")) { + // convert ansi date format string to joda according to session option + OptionManager om = this.context.getPlannerSettings().getOptions(); + if(ToDateFormats.valueOf(om.getOption(ExecConstants.TO_DATE_FORMAT).string_val.toUpperCase()).equals(ToDateFormats.ANSI)) { + args.set(1, FunctionCallFactory.createExpression("ansi_to_joda", Arrays.asList(args.get(1)))); --- End diff -- What would happen if drill.exec.fn.to_date_format = 'ansi' query: select to_date(1234545, ansi_to_joda('dd-MM-YYYY')) from emp; Would we get select to_date(1234545, ansi_to_joda(ansi_to_joda('dd-MM-YYYY'))) from emp;?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---