openinx commented on a change in pull request #3248:
URL: https://github.com/apache/iceberg/pull/3248#discussion_r727058479
##########
File path:
spark/src/main/java/org/apache/iceberg/spark/data/SparkOrcValueWriters.java
##########
@@ -267,28 +152,39 @@ public void nonNullWrite(int rowId, int column,
SpecializedGetters data, ColumnV
growColumnVector(cv.child, cv.childCount);
// Add each element
for (int e = 0; e < cv.lengths[rowId]; ++e) {
- writer.write((int) (e + cv.offsets[rowId]), e, value, cv.child);
+ writer.write((int) (e + cv.offsets[rowId]),
fieldGetter.getFieldOrNull(value, e), cv.child);
}
}
@Override
public Stream<FieldMetrics<?>> metrics() {
return writer.metrics();
}
+
+ @Override
+ public Class<?> getJavaClass() {
+ return ArrayData.class;
+ }
}
- private static class MapWriter implements SparkOrcValueWriter {
- private final SparkOrcValueWriter keyWriter;
- private final SparkOrcValueWriter valueWriter;
+ private static class MapWriter implements OrcValueWriter<MapData> {
+ private final OrcValueWriter keyWriter;
+ private final OrcValueWriter valueWriter;
+ private final SparkOrcWriter.FieldGetter keyFieldGetter;
+ private final SparkOrcWriter.FieldGetter valueFieldGetter;
- MapWriter(SparkOrcValueWriter keyWriter, SparkOrcValueWriter valueWriter) {
+ MapWriter(OrcValueWriter<?> keyWriter, OrcValueWriter<?> valueWriter,
List<TypeDescription> orcTypes) {
Review comment:
Nit: same comment as the
https://github.com/apache/iceberg/pull/3248/files#r727053434
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]