Skip to content

Commit

Permalink
use fixed scale
Browse files Browse the repository at this point in the history
  • Loading branch information
marin-ma committed Mar 13, 2024
1 parent 108239a commit 9e0f82d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions velox/functions/sparksql/DateTimeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,25 +149,23 @@ class MakeTimestampFunction : public exec::VectorFunction {
return {
exec::FunctionSignatureBuilder()
.integerVariable("precision")
.integerVariable("scale")
.returnType("timestamp")
.argumentType("integer")
.argumentType("integer")
.argumentType("integer")
.argumentType("integer")
.argumentType("integer")
.argumentType("decimal(precision, scale)")
.argumentType("decimal(precision, 6)")
.build(),
exec::FunctionSignatureBuilder()
.integerVariable("precision")
.integerVariable("scale")
.returnType("timestamp")
.argumentType("integer")
.argumentType("integer")
.argumentType("integer")
.argumentType("integer")
.argumentType("integer")
.argumentType("decimal(precision, scale)")
.argumentType("decimal(precision, 6)")
.argumentType("varchar")
.build(),
};
Expand Down
4 changes: 3 additions & 1 deletion velox/functions/sparksql/tests/DateTimeFunctionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,9 @@ TEST_F(DateTimeFunctionsTest, makeTimestampInvalid) {
"Seconds must be short decimal type but got DECIMAL(20, 6)");
VELOX_ASSERT_THROW(
testInvalidArguments(1e6, DECIMAL(16, 8)),
"Seconds fraction must have 6 digits for microseconds but got 8");
"Scalar function signature is not supported: "
"make_timestamp(INTEGER, INTEGER, INTEGER, INTEGER, INTEGER, "
"DECIMAL(16, 8)).");
// Throw if no session time zone.
setQueryTimeZone("");
VELOX_ASSERT_THROW(
Expand Down

0 comments on commit 9e0f82d

Please sign in to comment.