Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cast timestamp to decimal is unsupported #1281

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ object CometCast {
Compatible()
case DataTypes.StringType => Compatible()
case DataTypes.DateType => Compatible()
case _: DecimalType => Compatible()
case _ => Unsupported
}
}
Expand Down
7 changes: 5 additions & 2 deletions spark/src/test/scala/org/apache/comet/CometCastSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,11 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
castTest(generateTimestamps(), DataTypes.DoubleType)
}

test("cast TimestampType to DecimalType(10,2)") {
castTest(generateTimestamps(), DataTypes.TimestampType)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andygrove This test case introduced in #356 looks incorrect. Could you please take a look?

test("cast TimestampType to DecimalType(10,2) is unsupported") {
castFallbackTest(
generateTimestamps(),
DataTypes.createDecimalType(10, 2),
"Unsupported cast from TimestampType to DecimalType(10,2)")
}

test("cast TimestampType to StringType") {
Expand Down
Loading