Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
NEUpanning committed Sep 23, 2024
1 parent e370169 commit ca71412
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions velox/functions/sparksql/DateTimeFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ struct UnixTimestampParseWithFormatFunction
const core::QueryConfig& config,
const arg_type<Varchar>* /*input*/,
const arg_type<Varchar>* format) {
legacyDateFormatter_ = config.sparkLegacyDateFormatter();
legacyFormatter_ = config.sparkLegacyDateFormatter();
if (format != nullptr) {
try {
this->format_ = detail::getDateTimeFormatter(
std::string_view(format->data(), format->size()),
legacyDateFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
legacyFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
} catch (const VeloxUserError&) {
invalidFormat_ = true;
}
Expand All @@ -252,8 +252,8 @@ struct UnixTimestampParseWithFormatFunction
if (!isConstFormat_) {
this->format_ = detail::getDateTimeFormatter(
std::string_view(format.data(), format.size()),
legacyDateFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
legacyFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
}
} catch (const VeloxUserError&) {
return false;
Expand All @@ -272,7 +272,7 @@ struct UnixTimestampParseWithFormatFunction
private:
bool isConstFormat_{false};
bool invalidFormat_{false};
bool legacyDateFormatter_{false};
bool legacyFormatter_{false};
};

// Parses unix time in seconds to a formatted string.
Expand All @@ -285,7 +285,7 @@ struct FromUnixtimeFunction {
const core::QueryConfig& config,
const arg_type<int64_t>* /*unixtime*/,
const arg_type<Varchar>* format) {
legacyDateFormatter_ = config.sparkLegacyDateFormatter();
legacyFormatter_ = config.sparkLegacyDateFormatter();
sessionTimeZone_ = getTimeZoneFromConfig(config);
if (format != nullptr) {
setFormatter(*format);
Expand All @@ -312,16 +312,16 @@ struct FromUnixtimeFunction {
FOLLY_ALWAYS_INLINE void setFormatter(const arg_type<Varchar>& format) {
formatter_ = detail::getDateTimeFormatter(
std::string_view(format.data(), format.size()),
legacyDateFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
legacyFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
maxResultSize_ = formatter_->maxResultSize(sessionTimeZone_);
}

const tz::TimeZone* sessionTimeZone_{nullptr};
std::shared_ptr<DateTimeFormatter> formatter_;
uint32_t maxResultSize_;
bool isConstantTimeFormat_{false};
bool legacyDateFormatter_{false};
bool legacyFormatter_{false};
};

template <typename T>
Expand Down Expand Up @@ -395,16 +395,16 @@ struct GetTimestampFunction {
const core::QueryConfig& config,
const arg_type<Varchar>* /*input*/,
const arg_type<Varchar>* format) {
legacyDateFormatter_ = config.sparkLegacyDateFormatter();
legacyFormatter_ = config.sparkLegacyDateFormatter();
auto sessionTimezoneName = config.sessionTimezone();
if (!sessionTimezoneName.empty()) {
sessionTimeZone_ = tz::locateZone(sessionTimezoneName);
}
if (format != nullptr) {
formatter_ = detail::getDateTimeFormatter(
std::string_view(*format),
legacyDateFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
legacyFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
isConstantTimeFormat_ = true;
}
}
Expand All @@ -416,8 +416,8 @@ struct GetTimestampFunction {
if (!isConstantTimeFormat_) {
formatter_ = detail::getDateTimeFormatter(
std::string_view(format),
legacyDateFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
legacyFormatter_ ? DateTimeFormatterType::STRICT_SIMPLE
: DateTimeFormatterType::JODA);
}
auto dateTimeResult = formatter_->parse(std::string_view(input));
// Null as result for parsing error.
Expand All @@ -440,7 +440,7 @@ struct GetTimestampFunction {
std::shared_ptr<DateTimeFormatter> formatter_{nullptr};
bool isConstantTimeFormat_{false};
const tz::TimeZone* sessionTimeZone_{tz::locateZone(0)}; // default to GMT.
bool legacyDateFormatter_{false};
bool legacyFormatter_{false};
};

template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion velox/functions/sparksql/Split.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ struct Split {
result.add_item().setNoCopy(StringView(start + pos, end - pos));
}

mutable detail::ReCache cache_;
mutable facebook::velox::functions::detail::ReCache cache_;
};
} // namespace facebook::velox::functions::sparksql

0 comments on commit ca71412

Please sign in to comment.