Skip to content

Commit

Permalink
[SPARK-38199][SQL] Delete the unused dataType specified in the defi…
Browse files Browse the repository at this point in the history
…nition of `IntervalColumnAccessor`

### What changes were proposed in this pull request?
SPARK-30066 introduce `IntervalColumnAccessor` and it  accepts 2 constructor parameters: `buffer` and `dataType`, but the `dataType` was ignored because the parameter passed to `BasicColumnAccessor` is alway `CALENDAR_INTERVAL`, so this pr delete the unused `dataType`.

### Why are the changes needed?
Clear class definition of `IntervalColumnAccessor`.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA

Closes apache#35507 from LuciferYang/SPARK-38199.

Authored-by: yangjie01 <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
  • Loading branch information
LuciferYang authored and MaxGekk committed Feb 15, 2022
1 parent ea1f922 commit a9a792b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private[columnar] class BinaryColumnAccessor(buffer: ByteBuffer)
extends BasicColumnAccessor[Array[Byte]](buffer, BINARY)
with NullableColumnAccessor

private[columnar] class IntervalColumnAccessor(buffer: ByteBuffer, dataType: CalendarIntervalType)
private[columnar] class IntervalColumnAccessor(buffer: ByteBuffer)
extends BasicColumnAccessor[CalendarInterval](buffer, CALENDAR_INTERVAL)
with NullableColumnAccessor

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object GenerateColumnAccessor extends CodeGenerator[Seq[DataType], ColumnarItera
val createCode = dt match {
case t if CodeGenerator.isPrimitiveType(dt) =>
s"$accessorName = new $accessorCls(ByteBuffer.wrap(buffers[$index]).order(nativeOrder));"
case NullType | StringType | BinaryType =>
case NullType | StringType | BinaryType | CalendarIntervalType =>
s"$accessorName = new $accessorCls(ByteBuffer.wrap(buffers[$index]).order(nativeOrder));"
case other =>
s"""$accessorName = new $accessorCls(ByteBuffer.wrap(buffers[$index]).order(nativeOrder),
Expand Down

0 comments on commit a9a792b

Please sign in to comment.