-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21153] Use project instead of expand in tumbling windows #18364
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,17 +152,21 @@ object TimeWindow { | |
| } | ||
|
|
||
| /** | ||
| * Expression used internally to convert the TimestampType to Long without losing | ||
| * Expression used internally to convert the TimestampType to Long and back without losing | ||
| * precision, i.e. in microseconds. Used in time windowing. | ||
| */ | ||
| case class PreciseTimestamp(child: Expression) extends UnaryExpression with ExpectsInputTypes { | ||
| override def inputTypes: Seq[AbstractDataType] = Seq(TimestampType) | ||
| override def dataType: DataType = LongType | ||
| case class PreciseTimestampConversion( | ||
| child: Expression, | ||
| fromType: DataType, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The from type should just come from the child right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. expectsInputTypes does implicit casting at times
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we shouldn't be using it then? This is a purely internal expression?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is purely internal used for microsecond precision access of Timestamps |
||
| toType: DataType) extends UnaryExpression with ExpectsInputTypes { | ||
| override def inputTypes: Seq[AbstractDataType] = Seq(fromType) | ||
| override def dataType: DataType = toType | ||
| override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { | ||
| val eval = child.genCode(ctx) | ||
| ev.copy(code = eval.code + | ||
| s"""boolean ${ev.isNull} = ${eval.isNull}; | ||
| |${ctx.javaType(dataType)} ${ev.value} = ${eval.value}; | ||
| """.stripMargin) | ||
| } | ||
| override def nullSafeEval(input: Any): Any = input | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existing: There is a comment above that says "not correct"?