wypoon commented on code in PR #12117:
URL: https://github.com/apache/iceberg/pull/12117#discussion_r1931429938
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/functions/SparkFunctions.java:
##########
@@ -30,14 +30,19 @@ public class SparkFunctions {
private SparkFunctions() {}
private static final Map<String, UnboundFunction> FUNCTIONS =
- ImmutableMap.of(
- "iceberg_version", new IcebergVersionFunction(),
- "years", new YearsFunction(),
- "months", new MonthsFunction(),
- "days", new DaysFunction(),
- "hours", new HoursFunction(),
- "bucket", new BucketFunction(),
- "truncate", new TruncateFunction());
+ new ImmutableMap.Builder<String, UnboundFunction>()
+ .put("iceberg_version", new IcebergVersionFunction())
+ .put("years", new YearsFunction())
+ .put("year", new YearsFunction())
+ .put("months", new MonthsFunction())
+ .put("month", new MonthsFunction())
+ .put("days", new DaysFunction())
+ .put("day", new DaysFunction())
+ .put("hours", new HoursFunction())
+ .put("hour", new HoursFunction())
Review Comment:
That's a good point. Let me update the javadoc of those functions to add
examples with the singular form.
The functions also have `name()` methods that return the plural form. I'm
not sure if we should change the name though. For now, my thinking is to leave
the name alone, but just to support using the singular form (and documenting
the use in javadoc). If there is a doc page that should be updated, I'll be
happy to update it if you let me know.
--
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]