MaxGekk commented on a change in pull request #32366:
URL: https://github.com/apache/spark/pull/32366#discussion_r621240549
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnType.scala
##########
@@ -257,6 +257,65 @@ private[columnar] object LONG extends
NativeColumnType(LongType, 8) {
}
}
+private[columnar] object YEAR_MONTH_INTERVAL extends
NativeColumnType(YearMonthIntervalType, 4) {
+ override def append(v: Int, buffer: ByteBuffer): Unit = {
+ buffer.putInt(v)
+ }
+
+ override def append(row: InternalRow, ordinal: Int, buffer: ByteBuffer):
Unit = {
+ buffer.putInt(row.getInt(ordinal))
+ }
+
+ override def extract(buffer: ByteBuffer): Int = {
+ ByteBufferHelper.getInt(buffer)
+ }
+
+ override def extract(buffer: ByteBuffer, row: InternalRow, ordinal: Int):
Unit = {
+ row.setInt(ordinal, ByteBufferHelper.getInt(buffer))
+ }
+
+ override def setField(row: InternalRow, ordinal: Int, value: Int): Unit = {
+ row.setInt(ordinal, value)
+ }
+
+ override def getField(row: InternalRow, ordinal: Int): Int =
row.getInt(ordinal)
+
+
+ override def copyField(from: InternalRow, fromOrdinal: Int,
+ to: InternalRow, toOrdinal: Int): Unit = {
Review comment:
```suggestion
override def copyField(
from: InternalRow,
fromOrdinal: Int,
to: InternalRow,
toOrdinal: Int): Unit = {
```
See rules for indentations at
https://github.com/databricks/scala-style-guide#spacing-and-indentation
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/ColumnType.scala
##########
@@ -257,6 +257,65 @@ private[columnar] object LONG extends
NativeColumnType(LongType, 8) {
}
}
+private[columnar] object YEAR_MONTH_INTERVAL extends
NativeColumnType(YearMonthIntervalType, 4) {
+ override def append(v: Int, buffer: ByteBuffer): Unit = {
+ buffer.putInt(v)
+ }
+
+ override def append(row: InternalRow, ordinal: Int, buffer: ByteBuffer):
Unit = {
+ buffer.putInt(row.getInt(ordinal))
+ }
+
+ override def extract(buffer: ByteBuffer): Int = {
+ ByteBufferHelper.getInt(buffer)
+ }
+
+ override def extract(buffer: ByteBuffer, row: InternalRow, ordinal: Int):
Unit = {
+ row.setInt(ordinal, ByteBufferHelper.getInt(buffer))
+ }
+
+ override def setField(row: InternalRow, ordinal: Int, value: Int): Unit = {
+ row.setInt(ordinal, value)
+ }
+
+ override def getField(row: InternalRow, ordinal: Int): Int =
row.getInt(ordinal)
+
+
+ override def copyField(from: InternalRow, fromOrdinal: Int,
+ to: InternalRow, toOrdinal: Int): Unit = {
+ to.setInt(toOrdinal, from.getInt(fromOrdinal))
+ }
+}
+
+private[columnar] object DAY_TIME_INTERVAL extends
NativeColumnType(DayTimeIntervalType, 8) {
+ override def append(v: Long, buffer: ByteBuffer): Unit = {
+ buffer.putLong(v)
+ }
+
+ override def append(row: InternalRow, ordinal: Int, buffer: ByteBuffer):
Unit = {
+ buffer.putLong(row.getLong(ordinal))
+ }
+
+ override def extract(buffer: ByteBuffer): Long = {
+ ByteBufferHelper.getLong(buffer)
+ }
+
+ override def extract(buffer: ByteBuffer, row: InternalRow, ordinal: Int):
Unit = {
+ row.setLong(ordinal, ByteBufferHelper.getLong(buffer))
+ }
+
+ override def setField(row: InternalRow, ordinal: Int, value: Long): Unit = {
+ row.setLong(ordinal, value)
+ }
+
+ override def getField(row: InternalRow, ordinal: Int): Long =
row.getLong(ordinal)
+
+ override def copyField(from: InternalRow, fromOrdinal: Int,
+ to: InternalRow, toOrdinal: Int): Unit = {
Review comment:
Fix indentation, please
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]