Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion axiom/sql/presto/PrestoParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ class RelationPlanner : public AstVisitor {
} else {
const auto seconds = parseDayTimeInterval(
interval->value(), interval->startField(), interval->endField());
return lp::Lit(multiplier * seconds, INTERVAL_DAY_TIME());
return lp::Lit(multiplier * seconds * 1'000, INTERVAL_DAY_TIME());
}
}

Expand Down
4 changes: 2 additions & 2 deletions axiom/sql/presto/tests/PrestoParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ TEST_F(PrestoParserTest, types) {
TEST_F(PrestoParserTest, intervalDayTime) {
auto parser = makeParser();

auto test = [&](std::string_view sql, int64_t expected) {
auto test = [&](std::string_view sql, int64_t expectedSeconds) {
SCOPED_TRACE(sql);
auto expr = parser.parseExpression(sql);

Expand All @@ -517,7 +517,7 @@ TEST_F(PrestoParserTest, intervalDayTime) {

auto value = expr->as<lp::ConstantExpr>()->value();
ASSERT_FALSE(value->isNull());
ASSERT_EQ(value->value<int64_t>(), expected);
ASSERT_EQ(value->value<int64_t>(), expectedSeconds * 1'000);
};

test("INTERVAL '2' DAY", 2 * 24 * 60 * 60);
Expand Down