Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Aug 10, 2022

What changes were proposed in this pull request?

This is a follow up of #37442 that fixes the codegen of casting integrals to ANSI intervals w/ multi units. The PR removes the assert:

assert(it.startField == it.endField)

Why are the changes needed?

To make codegen consistent to interpreted code, and fix the assert.

Does this PR introduce any user-facing change?

Yes.

Before:

> select cast(dt as interval hour to second) from values(100Y) as t(dt);
java.lang.AssertionError
assertion failed

After:

> select cast(dt as interval hour to second) from values(100Y) as t(dt);
0 00:01:40.000000000

How was this patch tested?

By running new tests:

$ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z cast.sql"

@MaxGekk
Copy link
Member Author

MaxGekk commented Aug 10, 2022

The failure of ImageFileFormatSuite is not related to the changes. @HyukjinKwon @cloud-fan @gengliangwang Could you take a look at the PR, please.

@MaxGekk
Copy link
Member Author

MaxGekk commented Aug 10, 2022

Merging to master. Thank you, @cloud-fan for review.

@MaxGekk MaxGekk closed this in ee2bf78 Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants