Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/20850#discussion_r175445800
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/GenerateUnsafeProjection.scala
---
@@ -111,27 +111,27 @@ object GenerateUnsafeProjection extends
CodeGenerator[Seq[Expression], UnsafePro
s"""
// Remember the current cursor so that we can calculate how
many bytes are
// written later.
- final int $tmpCursor = $bufferHolder.cursor;
- ${writeStructToBuffer(ctx, input.value, t.map(_.dataType),
bufferHolder)}
- $rowWriter.setOffsetAndSize($index, $tmpCursor,
$bufferHolder.cursor - $tmpCursor);
+ final int $tmpCursor = $rowWriter.cursor();
--- End diff --
Yeah, I agree with you. I will internalize this code that are frequently
used.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]