@@ -673,11 +673,11 @@ struct IsDaylightSavings {
673673};
674674
675675// ----------------------------------------------------------------------
676- // Extract local time of a given timestamp given its timezone
676+ // Extract local timestamp of a given timestamp given its timezone
677677
678678template <typename Duration, typename Localizer>
679- struct LocalTime {
680- explicit LocalTime (const FunctionOptions* options, Localizer&& localizer)
679+ struct LocalTimestamp {
680+ explicit LocalTimestamp (const FunctionOptions* options, Localizer&& localizer)
681681 : localizer_(std::move(localizer)) {}
682682
683683 template <typename T, typename Arg0>
@@ -1344,8 +1344,8 @@ Result<TypeHolder> ResolveAssumeTimezoneOutput(KernelContext* ctx,
13441344 return timestamp (in_type.unit (), AssumeTimezoneState::Get (ctx).timezone );
13451345}
13461346
1347- Result<TypeHolder> ResolveLocalTimeOutput (KernelContext* ctx,
1348- const std::vector<TypeHolder>& args) {
1347+ Result<TypeHolder> ResolveLocalTimestampOutput (KernelContext* ctx,
1348+ const std::vector<TypeHolder>& args) {
13491349 const auto & in_type = checked_cast<const TimestampType&>(*args[0 ]);
13501350 return timestamp (in_type.unit ());
13511351}
@@ -1807,11 +1807,13 @@ const FunctionDoc is_dst_doc{
18071807 " An error is returned if the values do not have a defined timezone." ),
18081808 {" values" }};
18091809
1810- const FunctionDoc local_time_doc {
1810+ const FunctionDoc local_timestamp_doc {
18111811 " Convert timestamp to a timezone-naive local time timestamp" ,
1812- (" LocalTime converts a timestamp to a local time of timestamps timezone\n "
1813- " and removes timezone metadata. If input is in UTC or doesn't have\n "
1814- " timezone metadata, it is returned as is.\n "
1812+ (" LocalTimestamp converts timezone-aware timestamp to local timestamp\n "
1813+ " of the given timestamp's timezone and removes timezone metadata.\n "
1814+ " Alternative name for this timestamp is also wall clock time.\n "
1815+ " If input is in UTC or without timezone, then unchanged input values\n "
1816+ " without timezone metadata are returned.\n "
18151817 " Null values emit null." ),
18161818 {" values" }};
18171819const FunctionDoc floor_temporal_doc{
@@ -1831,9 +1833,8 @@ const FunctionDoc ceil_temporal_doc{
18311833const FunctionDoc round_temporal_doc{
18321834 " Round temporal values to the nearest multiple of specified time unit" ,
18331835 (" Null values emit null.\n "
1834- " If timezone is not given then timezone naive timestamp in UTC are\n "
1835- " returned. An error is returned if the values have a defined timezone\n "
1836- " but it cannot be found in the timezone database." ),
1836+ " An error is returned if the values have a defined timezone but it\n "
1837+ " cannot be found in the timezone database." ),
18371838 {" timestamps" },
18381839 " RoundTemporalOptions" };
18391840
@@ -2000,11 +2001,12 @@ void RegisterScalarTemporalUnary(FunctionRegistry* registry) {
20002001 is_dst_doc);
20012002 DCHECK_OK (registry->AddFunction (std::move (is_dst)));
20022003
2003- auto local_time =
2004- UnaryTemporalFactory<LocalTime, TemporalComponentExtract, TimestampType>::Make<
2005- WithTimestamps>(" local_time" , OutputType::Resolver (ResolveLocalTimeOutput),
2006- local_time_doc);
2007- DCHECK_OK (registry->AddFunction (std::move (local_time)));
2004+ auto local_timestamp =
2005+ UnaryTemporalFactory<LocalTimestamp, TemporalComponentExtract, TimestampType>::Make<
2006+ WithTimestamps>(" local_timestamp" ,
2007+ OutputType::Resolver (ResolveLocalTimestampOutput),
2008+ local_timestamp_doc);
2009+ DCHECK_OK (registry->AddFunction (std::move (local_timestamp)));
20082010
20092011 // Temporal rounding functions
20102012 // Note: UnaryTemporalFactory will not correctly resolve OutputType(FirstType) to
0 commit comments