Skip to content

Commit be0be04

Browse files
committed
fix the comments for time transformer
1 parent 472002e commit be0be04

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/iceberg/transform.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,25 @@ class ICEBERG_EXPORT Transform : public util::Formattable {
111111

112112
/// \brief Creates a shared singleton instance of the Year transform.
113113
///
114-
/// Extracts the year portion from a date or timestamp.
114+
/// Extracts the number of years from a date or timestamp since the epoch.
115115
/// \return A shared pointer to the Year transform.
116116
static std::shared_ptr<Transform> Year();
117117

118118
/// \brief Creates a shared singleton instance of the Month transform.
119119
///
120-
/// Extracts the month portion from a date or timestamp.
120+
/// Extracts the number of months from a date or timestamp since the epoch.
121121
/// \return A shared pointer to the Month transform.
122122
static std::shared_ptr<Transform> Month();
123123

124124
/// \brief Creates a shared singleton instance of the Day transform.
125125
///
126-
/// Extracts the day portion from a date or timestamp.
126+
/// Extracts the number of days from a date or timestamp since the epoch.
127127
/// \return A shared pointer to the Day transform.
128128
static std::shared_ptr<Transform> Day();
129129

130130
/// \brief Creates a shared singleton instance of the Hour transform.
131131
///
132-
/// Extracts the hour portion from a timestamp.
132+
/// Extracts the number of hours from a timestamp since the epoch.
133133
/// \return A shared pointer to the Hour transform.
134134
static std::shared_ptr<Transform> Hour();
135135

src/iceberg/transform_function.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,14 @@ class ICEBERG_EXPORT TruncateTransform : public TransformFunction {
100100
int32_t width_;
101101
};
102102

103-
/// \brief Year transform that extracts the year component from timestamp inputs.
103+
/// \brief Year transform that extracts the number of years from timestamp inputs since
104+
/// the epoch.
104105
class ICEBERG_EXPORT YearTransform : public TransformFunction {
105106
public:
106107
/// \param source_type Must be a timestamp type.
107108
explicit YearTransform(std::shared_ptr<Type> const& source_type);
108109

109-
/// \brief Extract a date or timestamp year, as years from 1970.
110+
/// \brief Extract the number of years since the epoch.
110111
Result<Literal> Transform(const Literal& literal) override;
111112

112113
/// \brief Returns INT32 as the output type.
@@ -119,13 +120,14 @@ class ICEBERG_EXPORT YearTransform : public TransformFunction {
119120
std::shared_ptr<Type> const& source_type);
120121
};
121122

122-
/// \brief Month transform that extracts the month component from timestamp inputs.
123+
/// \brief Month transform that extracts the number of months from timestamp inputs since
124+
/// the epoch.
123125
class ICEBERG_EXPORT MonthTransform : public TransformFunction {
124126
public:
125127
/// \param source_type Must be a timestamp type.
126128
explicit MonthTransform(std::shared_ptr<Type> const& source_type);
127129

128-
/// \brief Extract a date or timestamp month, as months from 1970-01-01.
130+
/// \brief Extract the number of months since the epoch.
129131
Result<Literal> Transform(const Literal& literal) override;
130132

131133
/// \brief Returns INT32 as the output type.
@@ -138,13 +140,14 @@ class ICEBERG_EXPORT MonthTransform : public TransformFunction {
138140
std::shared_ptr<Type> const& source_type);
139141
};
140142

141-
/// \brief Day transform that extracts the day of the month from timestamp inputs.
143+
/// \brief Day transform that extracts the number of days from timestamp inputs since the
144+
/// epoch.
142145
class ICEBERG_EXPORT DayTransform : public TransformFunction {
143146
public:
144147
/// \param source_type Must be a timestamp type.
145148
explicit DayTransform(std::shared_ptr<Type> const& source_type);
146149

147-
/// \brief Extract a date or timestamp day, as days from 1970-01-01.
150+
/// \brief Extract the number of days since the epoch.
148151
Result<Literal> Transform(const Literal& literal) override;
149152

150153
/// \brief Return the result type of a day transform.
@@ -161,13 +164,14 @@ class ICEBERG_EXPORT DayTransform : public TransformFunction {
161164
std::shared_ptr<Type> const& source_type);
162165
};
163166

164-
/// \brief Hour transform that extracts the hour component from timestamp inputs.
167+
/// \brief Hour transform that extracts the number of hours from timestamp inputs since
168+
/// the epoch.
165169
class ICEBERG_EXPORT HourTransform : public TransformFunction {
166170
public:
167171
/// \param source_type Must be a timestamp type.
168172
explicit HourTransform(std::shared_ptr<Type> const& source_type);
169173

170-
/// \brief Extract a timestamp hour, as hours from 1970-01-01 00:00:00.
174+
/// \brief Extract the number of hours since the epoch.
171175
Result<Literal> Transform(const Literal& literal) override;
172176

173177
/// \brief Returns INT32 as the output type.

0 commit comments

Comments
 (0)