Skip to content

Commit

Permalink
DRILL-8272: Skip MAP column without children when creating parquet ta…
Browse files Browse the repository at this point in the history
…bles (#2613)
  • Loading branch information
vvysotskyi authored and jnturton committed Jul 31, 2022
1 parent c0194ad commit f9b88d3
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
package org.apache.drill.exec.store;

import org.apache.drill.exec.expr.holders.*;
import org.apache.drill.exec.planner.physical.WriterPrel;
import org.apache.drill.exec.record.MaterializedField;
import org.apache.drill.exec.store.EventBasedRecordWriter.FieldConverter;
import org.apache.drill.exec.vector.BitVector;
import org.apache.drill.exec.vector.BitVector.Accessor;
Expand Down Expand Up @@ -96,4 +98,9 @@ public FieldConverter getNewRepeatedDictConverter(int fieldId, String fieldName,
public void postProcessing() throws IOException {
// no op
}

@Override
public boolean supportsField(MaterializedField field) {
return !field.getName().equalsIgnoreCase(WriterPrel.PARTITION_COMPARATOR_FIELD);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.drill.exec.planner.physical.WriterPrel;

<@pp.dropOutputFile />
<@pp.changeOutputFile name="org/apache/drill/exec/store/EventBasedRecordWriter.java" />
Expand All @@ -27,7 +26,6 @@
import org.apache.drill.shaded.guava.com.google.common.collect.Maps;

import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.exec.planner.physical.WriterPrel;
import org.apache.drill.exec.record.VectorAccessible;
import org.apache.drill.exec.record.VectorWrapper;
import org.apache.drill.exec.vector.complex.impl.UnionReader;
Expand Down Expand Up @@ -81,7 +79,7 @@ private void initFieldWriters() throws IOException {
try {
int fieldId = 0;
for (VectorWrapper w : batch) {
if (w.getField().getName().equalsIgnoreCase(WriterPrel.PARTITION_COMPARATOR_FIELD)) {
if (!recordWriter.supportsField(w.getField())) {
continue;
}
FieldReader reader = w.getValueVector().getReader();
Expand Down Expand Up @@ -178,4 +176,4 @@ public static FieldConverter getConverter(RecordWriter recordWriter, int fieldId
}
throw new UnsupportedOperationException();
}
}
}
Loading

0 comments on commit f9b88d3

Please sign in to comment.