Skip to content

Conversation

@ryanbald
Copy link

What changes were proposed in this pull request?

When finding the widest common type of a sequence of data types where the beginning of the sequence consists solely of DateType/Timestamp and Numeric types and the following data type in the sequence is a StringType, the widest common type becomes StringType (which was not the case prior, as an AnalysisException was raised).

How was this patch tested?

Added one test of Coalesce type coercion with the specific sequence of data types mentioned above and added onto a test of Union type coercion with a similar sequence of data types.

Please state that the contribution is your original work and that you license the work to the project under the project’s open source license.

…n a sequence of data types, the widest type is String
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

}

private def findWiderCommonType(types: Seq[DataType]): Option[DataType] = {
var awaitingString = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should make a pass of all dataTypes here, and see whether there exists StringType and all other dataTypes can be promoted to StringType, under that case we can default return StringType instead of None, WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants