cloud-fan commented on code in PR #36663: URL: https://github.com/apache/spark/pull/36663#discussion_r902350436
########## sql/catalyst/src/main/java/org/apache/spark/sql/connector/expressions/GeneralScalarExpression.java: ########## @@ -196,6 +196,90 @@ * <li>Since version: 3.4.0</li> * </ul> * </li> + * <li>Name: <code>DATE_ADD</code> + * <ul> + * <li>SQL semantic: <code>DATE_ADD(start_date, num_days)</code></li> + * <li>Since version: 3.4.0</li> + * </ul> + * </li> + * <li>Name: <code>DATE_DIFF</code> + * <ul> + * <li>SQL semantic: <code>DATE_DIFF(end_date, start_date)</code></li> + * <li>Since version: 3.4.0</li> + * </ul> + * </li> + * <li>Name: <code>TRUNC</code> + * <ul> + * <li>SQL semantic: <code>TRUNC(date, format)</code></li> + * <li>Since version: 3.4.0</li> + * </ul> + * </li> + * <li>Name: <code>SECOND</code> + * <ul> + * <li>SQL semantic: <code>SECOND(timestamp, timezone)</code></li> + * <li>Since version: 3.4.0</li> + * </ul> + * </li> + * <li>Name: <code>MINUTE</code> + * <ul> + * <li>SQL semantic: <code>MINUTE(timestamp, timezone)</code></li> + * <li>Since version: 3.4.0</li> + * </ul> + * </li> + * <li>Name: <code>HOUR</code> + * <ul> + * <li>SQL semantic: <code>HOUR(timestamp, timezone)</code></li> + * <li>Since version: 3.4.0</li> + * </ul> + * </li> + * <li>Name: <code>MONTH</code> Review Comment: I'm surprised if the EXTRACT function has different performance than field extraction functions. They are semantically doing the same thing, right? The principle here is to not define push-able functions that are semantically equal to each other. Keep in mind that this is API, and it's better to have less/simpler APIs but the same abilities. I think adding a single `EXTRACT` function to the pushdown API is better than adding a bunch of the field extraction functions. clickhouse data source can translate EXTRACT function to field extraction functions when generating SQL string -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
