You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/04/08 18:10:23 UTC
[GitHub] [hudi] TeRS-K opened a new pull request #2793: [HUDI-57] Support ORC Storage
TeRS-K opened a new pull request #2793:
URL: https://github.com/apache/hudi/pull/2793
## What is the purpose of the pull request
This pull request supports ORC storage in hudi.
## Brief change log
In two separate commits:
- Implemented HoodieOrcWriter
- Added HoodieOrcConfigs
- Added AvroOrcUtils that writes Avro record **to** VectorizedRowBatch
- Used orc-core:no-hive module (`no-hive` is needed because spark-sql uses no-hive version of orc and it would become easier for spark integration)
- Implemented HoodieOrcReader
- Read Avro records **from** VectorizedRowBatch
- Implemented OrcReaderIterator
- Implemented ORC utility functions
## Verify this pull request
- Added unit tests for
- reader/writer creation
- AvroOrcUtils
- (local) Wrote a small tool that reads from ORC/Parquet files and writes to ORC/Parquet files, verified that the records in the input/output files are identical using spark.read.orc/spark.read.parquet.
- (local) Changed the HoodieTableConfig.DEFAULT_BASE_FILE_FORMAT to force the tests to run with ORC as the base format. Some changes need to be made, but I'm leaving it out of this PR to get some initial feedback on the reader/writer implementation first.
For all tests to pass with ORC as the base file format:
- Understand schema evolution in ORC (ref TestUpdateSchemaEvolution)
- Add ORC support for places that have hardcoded ParquetReader or sqlContext.read().parquet()
- Add ORC support for bootstrap op
- Hive engine integration with ORC (implement HoodieOrcInputFormat)
## Committer checklist
- [ ] Has a corresponding JIRA in PR title & commit
- [ ] Commit message is descriptive of the change
- [ ] CI is green
- [ ] Necessary doc changes done or have another open PR
- [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
n3nash commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r610913269
##########
File path: hudi-common/src/main/java/org/apache/hudi/common/util/OrcUtils.java
##########
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.util;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.avro.Schema;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.orc.storage.ql.exec.vector.BytesColumnVector;
+import org.apache.orc.storage.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hudi.avro.HoodieAvroWriteSupport;
+import org.apache.hudi.common.bloom.BloomFilter;
+import org.apache.hudi.common.bloom.BloomFilterFactory;
+import org.apache.hudi.common.bloom.BloomFilterTypeCode;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.hudi.exception.MetadataNotFoundException;
+import org.apache.orc.OrcFile;
+import org.apache.orc.OrcProto.UserMetadataItem;
+import org.apache.orc.Reader;
+import org.apache.orc.Reader.Options;
+import org.apache.orc.RecordReader;
+import org.apache.orc.TypeDescription;
+
+/**
+ * Utility functions for ORC files.
+ */
+public class OrcUtils {
Review comment:
Add corresponding test class to test all public methods
--
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:
users@infra.apache.org
[GitHub] [hudi] TeRS-K commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
TeRS-K commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r612952338
##########
File path: hudi-common/src/main/java/org/apache/hudi/common/util/AvroOrcUtils.java
##########
@@ -0,0 +1,804 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.util;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+import java.sql.Timestamp;
+import java.util.Base64;
+import java.util.Date;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.avro.Conversions;
+import org.apache.avro.LogicalType;
+import org.apache.avro.LogicalTypes;
+import org.apache.avro.Schema.Field;
+import org.apache.avro.generic.GenericData;
+import java.nio.charset.StandardCharsets;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericData.StringType;
+import org.apache.avro.util.Utf8;
+import org.apache.orc.storage.common.type.HiveDecimal;
+import org.apache.orc.storage.ql.exec.vector.BytesColumnVector;
+import org.apache.orc.storage.ql.exec.vector.ColumnVector;
+import org.apache.orc.storage.ql.exec.vector.DecimalColumnVector;
+import org.apache.orc.storage.ql.exec.vector.DoubleColumnVector;
+import org.apache.orc.storage.ql.exec.vector.ListColumnVector;
+import org.apache.orc.storage.ql.exec.vector.LongColumnVector;
+import org.apache.orc.storage.ql.exec.vector.MapColumnVector;
+import org.apache.orc.storage.ql.exec.vector.StructColumnVector;
+import org.apache.orc.storage.ql.exec.vector.TimestampColumnVector;
+import org.apache.orc.storage.ql.exec.vector.UnionColumnVector;
+import org.apache.orc.storage.serde2.io.DateWritable;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.orc.TypeDescription;
+
+/**
+ * Methods including addToVector, addUnionValue, createOrcSchema are originally from
+ * https://github.com/streamsets/datacollector.
+ * Source classes:
+ * - com.streamsets.pipeline.lib.util.avroorc.AvroToOrcRecordConverter
+ * - com.streamsets.pipeline.lib.util.avroorc.AvroToOrcSchemaConverter
+ *
+ * Changes made:
+ * 1. Flatten nullable Avro schema type when the value is not null in `addToVector`.
+ * 2. Use getLogicalType(), constants from LogicalTypes instead of getJsonProp() to handle Avro logical types.
+ */
+public class AvroOrcUtils {
+
+ private static final int MICROS_PER_MILLI = 1000;
+ private static final int NANOS_PER_MICRO = 1000;
+
+ /**
+ * Add an object (of a given ORC type) to the column vector at a given position.
+ *
+ * @param type ORC schema of the value Object.
+ * @param colVector The column vector to store the value Object.
+ * @param avroSchema Avro schema of the value Object.
+ * Only used to check logical types for timestamp unit conversion.
+ * @param value Object to be added to the column vector
+ * @param vectorPos The position in the vector where value will be stored at.
+ */
+ public static void addToVector(TypeDescription type, ColumnVector colVector, Schema avroSchema, Object value, int vectorPos) {
+
+ final int currentVecLength = colVector.isNull.length;
+ if (vectorPos >= currentVecLength) {
+ colVector.ensureSize(2 * currentVecLength, true);
+ }
+ if (value == null) {
+ colVector.isNull[vectorPos] = true;
+ colVector.noNulls = false;
+ return;
+ }
+
+ if (avroSchema.getType().equals(Schema.Type.UNION)) {
+ avroSchema = getActualSchemaType(avroSchema);
+ }
+
+ LogicalType logicalType = avroSchema != null ? avroSchema.getLogicalType() : null;
+
+ switch (type.getCategory()) {
+ case BOOLEAN:
+ LongColumnVector boolVec = (LongColumnVector) colVector;
+ boolVec.vector[vectorPos] = (boolean) value ? 1 : 0;
+ break;
+ case BYTE:
+ LongColumnVector byteColVec = (LongColumnVector) colVector;
+ byteColVec.vector[vectorPos] = (byte) value;
+ break;
+ case SHORT:
+ LongColumnVector shortColVec = (LongColumnVector) colVector;
+ shortColVec.vector[vectorPos] = (short) value;
+ break;
+ case INT:
+ // the Avro logical type could be AvroTypeUtil.LOGICAL_TYPE_TIME_MILLIS, but we will ignore that fact here
+ // since Orc has no way to represent a time in the way Avro defines it; we will simply preserve the int value
+ LongColumnVector intColVec = (LongColumnVector) colVector;
+ intColVec.vector[vectorPos] = (int) value;
+ break;
+ case LONG:
+ // the Avro logical type could be AvroTypeUtil.LOGICAL_TYPE_TIME_MICROS, but we will ignore that fact here
+ // since Orc has no way to represent a time in the way Avro defines it; we will simply preserve the long value
+ LongColumnVector longColVec = (LongColumnVector) colVector;
+ longColVec.vector[vectorPos] = (long) value;
+ break;
+ case FLOAT:
+ DoubleColumnVector floatColVec = (DoubleColumnVector) colVector;
+ floatColVec.vector[vectorPos] = (float) value;
+ break;
+ case DOUBLE:
+ DoubleColumnVector doubleColVec = (DoubleColumnVector) colVector;
+ doubleColVec.vector[vectorPos] = (double) value;
+ break;
+ case VARCHAR:
+ case CHAR:
+ case STRING:
+ BytesColumnVector bytesColVec = (BytesColumnVector) colVector;
+ byte[] bytes = null;
+
+ if (value instanceof String) {
+ bytes = ((String) value).getBytes(StandardCharsets.UTF_8);
+ } else if (value instanceof Utf8) {
+ final Utf8 utf8 = (Utf8) value;
+ bytes = utf8.getBytes();
+ } else if (value instanceof GenericData.EnumSymbol) {
+ bytes = ((GenericData.EnumSymbol) value).toString().getBytes(StandardCharsets.UTF_8);
+ } else {
+ throw new IllegalStateException(String.format(
+ "Unrecognized type for Avro %s field value, which has type %s, value %s",
+ type.getCategory().getName(),
+ value.getClass().getName(),
+ value.toString()
+ ));
+ }
+
+ if (bytes == null) {
+ bytesColVec.isNull[vectorPos] = true;
+ bytesColVec.noNulls = false;
+ } else {
+ bytesColVec.setRef(vectorPos, bytes, 0, bytes.length);
+ }
+ break;
+ case DATE:
+ LongColumnVector dateColVec = (LongColumnVector) colVector;
+ int daysSinceEpoch;
+ if (logicalType instanceof LogicalTypes.Date) {
+ daysSinceEpoch = (int) value;
+ } else if (value instanceof java.sql.Date) {
+ daysSinceEpoch = DateWritable.dateToDays((java.sql.Date) value);
+ } else if (value instanceof Date) {
+ daysSinceEpoch = DateWritable.millisToDays(((Date) value).getTime());
+ } else {
+ throw new IllegalStateException(String.format(
+ "Unrecognized type for Avro DATE field value, which has type %s, value %s",
+ value.getClass().getName(),
+ value.toString()
+ ));
+ }
+ dateColVec.vector[vectorPos] = daysSinceEpoch;
+ break;
+ case TIMESTAMP:
+ TimestampColumnVector tsColVec = (TimestampColumnVector) colVector;
+
+ long time;
+ int nanos = 0;
+
+ // The unit for Timestamp in ORC is millis, convert timestamp to millis if needed
+ if (logicalType instanceof LogicalTypes.TimestampMillis) {
+ time = (long) value;
+ } else if (logicalType instanceof LogicalTypes.TimestampMicros) {
+ final long logicalTsValue = (long) value;
+ time = logicalTsValue / MICROS_PER_MILLI;
+ nanos = NANOS_PER_MICRO * ((int) (logicalTsValue % MICROS_PER_MILLI));
+ } else if (value instanceof Timestamp) {
+ Timestamp tsValue = (Timestamp) value;
+ time = tsValue.getTime();
+ nanos = tsValue.getNanos();
+ } else if (value instanceof java.sql.Date) {
+ java.sql.Date sqlDateValue = (java.sql.Date) value;
+ time = sqlDateValue.getTime();
+ } else if (value instanceof Date) {
+ Date dateValue = (Date) value;
+ time = dateValue.getTime();
+ } else {
+ throw new IllegalStateException(String.format(
+ "Unrecognized type for Avro TIMESTAMP field value, which has type %s, value %s",
+ value.getClass().getName(),
+ value.toString()
+ ));
+ }
+
+ final long millis = time % 1000;
Review comment:
Right, it seems like we can remove this line and a couple lines below it as I don't see why millis should need to be accounted in the nanos portion.
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
n3nash commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r610911298
##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/storage/HoodieOrcWriter.java
##########
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.io.storage;
+
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_AVRO_BLOOM_FILTER_METADATA_KEY;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_BLOOM_FILTER_TYPE_CODE;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_MAX_RECORD_KEY_FOOTER;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_MIN_RECORD_KEY_FOOTER;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.avro.generic.IndexedRecord;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.orc.storage.ql.exec.vector.ColumnVector;
+import org.apache.orc.storage.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hudi.common.bloom.BloomFilter;
+import org.apache.hudi.common.bloom.HoodieDynamicBoundedBloomFilter;
+import org.apache.orc.OrcFile;
+import org.apache.orc.TypeDescription;
+import org.apache.orc.Writer;
+import org.apache.hudi.avro.HoodieAvroUtils;
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.fs.HoodieWrapperFileSystem;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieRecordPayload;
+import org.apache.hudi.common.util.AvroOrcUtils;
+
+public class HoodieOrcWriter<T extends HoodieRecordPayload, R extends IndexedRecord>
+ implements HoodieFileWriter<R> {
+ private static final AtomicLong RECORD_INDEX = new AtomicLong(1);
+
+ private final long maxFileSize;
+ private final Schema avroSchema;
+ private final List<TypeDescription> fieldTypes;
+ private final List<String> fieldNames;
+ private final VectorizedRowBatch batch;
+ private final Writer writer;
+
+ private final Path file;
+ private final HoodieWrapperFileSystem fs;
+ private final String instantTime;
+ private final TaskContextSupplier taskContextSupplier;
+
+ private HoodieOrcConfig orcConfig;
+ private String minRecordKey;
+ private String maxRecordKey;
+
+ public HoodieOrcWriter(String instantTime, Path file, HoodieOrcConfig config, Schema schema,
+ TaskContextSupplier taskContextSupplier) throws IOException {
+
+ Configuration conf = FSUtils.registerFileSystem(file, config.getHadoopConf());
+ this.file = HoodieWrapperFileSystem.convertToHoodiePath(file, conf);
+ this.fs = (HoodieWrapperFileSystem) this.file.getFileSystem(conf);
+ this.instantTime = instantTime;
+ this.taskContextSupplier = taskContextSupplier;
+
+ this.avroSchema = schema;
+ final TypeDescription orcSchema = AvroOrcUtils.createOrcSchema(avroSchema);
+ this.fieldTypes = orcSchema.getChildren();
+ this.fieldNames = orcSchema.getFieldNames();
+ this.maxFileSize = config.getMaxFileSize();
+ this.batch = orcSchema.createRowBatch();
+ OrcFile.WriterOptions writerOptions = OrcFile.writerOptions(conf)
+ .blockSize(config.getBlockSize())
+ .stripeSize(config.getStripeSize())
+ .compress(config.getCompressionKind())
+ .bufferSize(config.getBlockSize())
+ .fileSystem(fs)
+ .setSchema(orcSchema);
+ this.writer = OrcFile.createWriter(this.file, writerOptions);
+ this.orcConfig = config;
+ }
+
+ @Override
+ public void writeAvroWithMetadata(R avroRecord, HoodieRecord record) throws IOException {
+ String seqId = HoodieRecord.generateSequenceId(instantTime, taskContextSupplier.getPartitionIdSupplier().get(),
+ RECORD_INDEX.getAndIncrement());
+ HoodieAvroUtils.addHoodieKeyToRecord((GenericRecord) avroRecord, record.getRecordKey(),
+ record.getPartitionPath(), file.getName());
+ HoodieAvroUtils
+ .addCommitMetadataToRecord((GenericRecord) avroRecord, instantTime, seqId);
+
+ writeAvro(record.getRecordKey(), avroRecord);
+ }
+
+ @Override
+ public boolean canWrite() {
+ return fs.getBytesWritten(file) < maxFileSize;
+ }
+
+ @Override
+ public void writeAvro(String recordKey, IndexedRecord object) throws IOException {
+ for (int col = 0; col < batch.numCols; col++) {
+ ColumnVector colVector = batch.cols[col];
+ final String thisField = fieldNames.get(col);
+ final TypeDescription type = fieldTypes.get(col);
+
+ Object fieldValue = ((GenericRecord) object).get(thisField);
+ Schema.Field avroField = avroSchema.getField(thisField);
+ AvroOrcUtils.addToVector(type, colVector, avroField.schema(), fieldValue, batch.size);
+ }
+
+ batch.size++;
+
+ if (batch.size == batch.getMaxSize()) {
Review comment:
What is this batch size used for ? Can you please add some comments
--
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:
users@infra.apache.org
[GitHub] [hudi] TeRS-K commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
TeRS-K commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r612951608
##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/storage/HoodieOrcWriter.java
##########
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.io.storage;
+
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_AVRO_BLOOM_FILTER_METADATA_KEY;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_BLOOM_FILTER_TYPE_CODE;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_MAX_RECORD_KEY_FOOTER;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_MIN_RECORD_KEY_FOOTER;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.avro.generic.IndexedRecord;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.orc.storage.ql.exec.vector.ColumnVector;
+import org.apache.orc.storage.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hudi.common.bloom.BloomFilter;
+import org.apache.hudi.common.bloom.HoodieDynamicBoundedBloomFilter;
+import org.apache.orc.OrcFile;
+import org.apache.orc.TypeDescription;
+import org.apache.orc.Writer;
+import org.apache.hudi.avro.HoodieAvroUtils;
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.fs.HoodieWrapperFileSystem;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieRecordPayload;
+import org.apache.hudi.common.util.AvroOrcUtils;
+
+public class HoodieOrcWriter<T extends HoodieRecordPayload, R extends IndexedRecord>
+ implements HoodieFileWriter<R> {
+ private static final AtomicLong RECORD_INDEX = new AtomicLong(1);
+
+ private final long maxFileSize;
+ private final Schema avroSchema;
+ private final List<TypeDescription> fieldTypes;
+ private final List<String> fieldNames;
+ private final VectorizedRowBatch batch;
+ private final Writer writer;
+
+ private final Path file;
+ private final HoodieWrapperFileSystem fs;
+ private final String instantTime;
+ private final TaskContextSupplier taskContextSupplier;
+
+ private HoodieOrcConfig orcConfig;
+ private String minRecordKey;
+ private String maxRecordKey;
+
+ public HoodieOrcWriter(String instantTime, Path file, HoodieOrcConfig config, Schema schema,
+ TaskContextSupplier taskContextSupplier) throws IOException {
+
+ Configuration conf = FSUtils.registerFileSystem(file, config.getHadoopConf());
+ this.file = HoodieWrapperFileSystem.convertToHoodiePath(file, conf);
+ this.fs = (HoodieWrapperFileSystem) this.file.getFileSystem(conf);
+ this.instantTime = instantTime;
+ this.taskContextSupplier = taskContextSupplier;
+
+ this.avroSchema = schema;
+ final TypeDescription orcSchema = AvroOrcUtils.createOrcSchema(avroSchema);
+ this.fieldTypes = orcSchema.getChildren();
+ this.fieldNames = orcSchema.getFieldNames();
+ this.maxFileSize = config.getMaxFileSize();
+ this.batch = orcSchema.createRowBatch();
+ OrcFile.WriterOptions writerOptions = OrcFile.writerOptions(conf)
+ .blockSize(config.getBlockSize())
+ .stripeSize(config.getStripeSize())
+ .compress(config.getCompressionKind())
+ .bufferSize(config.getBlockSize())
+ .fileSystem(fs)
+ .setSchema(orcSchema);
+ this.writer = OrcFile.createWriter(this.file, writerOptions);
+ this.orcConfig = config;
+ }
+
+ @Override
+ public void writeAvroWithMetadata(R avroRecord, HoodieRecord record) throws IOException {
Review comment:
I moved part of this function to the interface since there are still some differences per file format.
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
n3nash commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r610913156
##########
File path: hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieOrcReader.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.io.storage;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.IndexedRecord;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hudi.common.bloom.BloomFilter;
+import org.apache.hudi.common.util.AvroOrcUtils;
+import org.apache.hudi.common.util.OrcReaderIterator;
+import org.apache.hudi.common.util.OrcUtils;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.orc.OrcFile;
+import org.apache.orc.Reader;
+import org.apache.orc.Reader.Options;
+import org.apache.orc.RecordReader;
+import org.apache.orc.TypeDescription;
+
+public class HoodieOrcReader<R extends IndexedRecord> implements HoodieFileReader {
Review comment:
Add corresponding test class
--
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:
users@infra.apache.org
[GitHub] [hudi] TeRS-K commented on pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
TeRS-K commented on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-816163413
The build is currently failing with error `ERROR: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit`, it doesn't seem to be related to my change. How can I trigger a rebuild?
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
n3nash commented on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-816037894
@prashantwason Can you review this ?
--
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:
users@infra.apache.org
[GitHub] [hudi] TeRS-K commented on pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
TeRS-K commented on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-819244201
@leesf
> would not sync hudi orc format table to hive metastore yet?
ORC is well-integrated with hive, so hive already has OrcInputFormat, OrcOutputFormat etc. With my latest change to the HoodieInputFormatUtils class, I was able to sync hudi orc format table to hive metastore (tested with deltastreamer).
However, we do still need to implement HoodieOrcInputFormat & HoodieRealtimeOrcInputFormat. I have done some work on that but it's not tested yet.
--
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:
users@infra.apache.org
[GitHub] [hudi] codecov-commenter commented on pull request #2793: [HUDI-764] [HUDI-765] ORC reader and writer implementation
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-825222112
# [Codecov](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2793](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e787d8e) into [master](https://codecov.io/gh/apache/hudi/commit/6786581c4842e47e1a8a8e942f54003dc151c7c6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6786581) will **decrease** coverage by `43.17%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2793 +/- ##
============================================
- Coverage 52.54% 9.36% -43.18%
+ Complexity 3707 48 -3659
============================================
Files 485 54 -431
Lines 23171 1996 -21175
Branches 2459 236 -2223
============================================
- Hits 12176 187 -11989
+ Misses 9923 1796 -8127
+ Partials 1072 13 -1059
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| hudicli | `?` | `?` | |
| hudiclient | `?` | `?` | |
| hudicommon | `?` | `?` | |
| hudiflink | `?` | `?` | |
| hudihadoopmr | `?` | `?` | |
| hudisparkdatasource | `?` | `?` | |
| hudisync | `?` | `?` | |
| huditimelineservice | `?` | `?` | |
| hudiutilities | `9.36% <ø> (-60.36%)` | `48.00 <ø> (-325.00)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...va/org/apache/hudi/utilities/IdentitySplitter.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL0lkZW50aXR5U3BsaXR0ZXIuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-2.00%)` | |
| [...va/org/apache/hudi/utilities/schema/SchemaSet.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NjaGVtYS9TY2hlbWFTZXQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-3.00%)` | |
| [...a/org/apache/hudi/utilities/sources/RowSource.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvUm93U291cmNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-4.00%)` | |
| [.../org/apache/hudi/utilities/sources/AvroSource.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQXZyb1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
| [.../org/apache/hudi/utilities/sources/JsonSource.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvblNvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-1.00%)` | |
| [...rg/apache/hudi/utilities/sources/CsvDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQ3N2REZTU291cmNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-10.00%)` | |
| [...g/apache/hudi/utilities/sources/JsonDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvbkRGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-4.00%)` | |
| [...apache/hudi/utilities/sources/JsonKafkaSource.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvbkthZmthU291cmNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-6.00%)` | |
| [...pache/hudi/utilities/sources/ParquetDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvUGFycXVldERGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-5.00%)` | |
| [...lities/schema/SchemaProviderWithPostProcessor.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NjaGVtYS9TY2hlbWFQcm92aWRlcldpdGhQb3N0UHJvY2Vzc29yLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00% <0.00%> (-4.00%)` | |
| ... and [459 more](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
n3nash commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r610913501
##########
File path: hudi-common/src/test/java/org/apache/hudi/common/util/TestAvroOrcUtils.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.util;
+
+import static org.apache.hudi.common.testutils.HoodieTestDataGenerator.AVRO_SCHEMA;
+
+import java.util.Arrays;
+import java.util.List;
+import org.apache.avro.Schema;
+import org.apache.hudi.common.testutils.HoodieCommonTestHarness;
+import org.apache.orc.TypeDescription;
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class TestAvroOrcUtils extends HoodieCommonTestHarness {
+
+ public static List<Arguments> testCreateOrcSchemaArgs() {
+ // the ORC schema is constructed in the order as AVRO_SCHEMA:
+ // TRIP_SCHEMA_PREFIX, EXTRA_TYPE_SCHEMA, MAP_TYPE_SCHEMA, FARE_NESTED_SCHEMA, TIP_NESTED_SCHEMA, TRIP_SCHEMA_SUFFIX
+ // The following types are tested:
+ // DATE, DECIMAL, LONG, INT, BYTES, ARRAY, RECORD, MAP, STRING, FLOAT, DOUBLE
+ TypeDescription orcSchema = TypeDescription.fromString("struct<"
Review comment:
Is this testing all primitive types ?
--
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:
users@infra.apache.org
[GitHub] [hudi] codecov-io edited a comment on pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-819265116
# [Codecov](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2793](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (619d75b) into [master](https://codecov.io/gh/apache/hudi/commit/6786581c4842e47e1a8a8e942f54003dc151c7c6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6786581) will **decrease** coverage by `2.67%`.
> The diff coverage is `8.67%`.
[](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2793 +/- ##
============================================
- Coverage 52.54% 49.87% -2.68%
+ Complexity 3707 3299 -408
============================================
Files 485 427 -58
Lines 23171 20354 -2817
Branches 2459 2153 -306
============================================
- Hits 12176 10151 -2025
+ Misses 9923 9353 -570
+ Partials 1072 850 -222
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| hudicli | `40.29% <ø> (ø)` | `0.00 <ø> (ø)` | |
| hudiclient | `∅ <ø> (∅)` | `0.00 <ø> (ø)` | |
| hudicommon | `48.61% <8.72%> (-2.07%)` | `0.00 <21.00> (ø)` | |
| hudiflink | `56.54% <ø> (-0.04%)` | `0.00 <ø> (ø)` | |
| hudihadoopmr | `33.27% <0.00%> (-0.18%)` | `0.00 <0.00> (ø)` | |
| hudisparkdatasource | `?` | `?` | |
| hudisync | `?` | `?` | |
| huditimelineservice | `?` | `?` | |
| hudiutilities | `69.74% <ø> (+0.01%)` | `0.00 <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...org/apache/hudi/common/util/OrcReaderIterator.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvT3JjUmVhZGVySXRlcmF0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
| [...ain/java/org/apache/hudi/common/util/OrcUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvT3JjVXRpbHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
| [...ache/hudi/hadoop/utils/HoodieInputFormatUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1oYWRvb3AtbXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaGFkb29wL3V0aWxzL0hvb2RpZUlucHV0Rm9ybWF0VXRpbHMuamF2YQ==) | `47.23% <0.00%> (-0.73%)` | `30.00 <0.00> (ø)` | |
| [...java/org/apache/hudi/common/util/AvroOrcUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvQXZyb09yY1V0aWxzLmphdmE=) | `9.11% <9.11%> (ø)` | `19.00 <19.00> (?)` | |
| [...va/org/apache/hudi/io/storage/HoodieOrcReader.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaW8vc3RvcmFnZS9Ib29kaWVPcmNSZWFkZXIuamF2YQ==) | `25.00% <25.00%> (ø)` | `1.00 <1.00> (?)` | |
| [...org/apache/hudi/common/model/HoodieFileFormat.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL21vZGVsL0hvb2RpZUZpbGVGb3JtYXQuamF2YQ==) | `100.00% <100.00%> (ø)` | `3.00 <0.00> (ø)` | |
| [...pache/hudi/io/storage/HoodieFileReaderFactory.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaW8vc3RvcmFnZS9Ib29kaWVGaWxlUmVhZGVyRmFjdG9yeS5qYXZh) | `61.53% <100.00%> (+11.53%)` | `5.00 <1.00> (+2.00)` | |
| [.../apache/hudi/sink/partitioner/BucketAssigners.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1mbGluay9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaHVkaS9zaW5rL3BhcnRpdGlvbmVyL0J1Y2tldEFzc2lnbmVycy5qYXZh) | `33.33% <0.00%> (-16.67%)` | `2.00% <0.00%> (ø%)` | |
| [...hadoop/realtime/RealtimeCompactedRecordReader.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1oYWRvb3AtbXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaGFkb29wL3JlYWx0aW1lL1JlYWx0aW1lQ29tcGFjdGVkUmVjb3JkUmVhZGVyLmphdmE=) | `64.06% <0.00%> (-8.67%)` | `13.00% <0.00%> (+1.00%)` | :arrow_down: |
| [.../java/org/apache/hudi/common/util/CommitUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvQ29tbWl0VXRpbHMuamF2YQ==) | `40.47% <0.00%> (-3.12%)` | `6.00% <0.00%> (ø%)` | |
| ... and [81 more](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
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:
users@infra.apache.org
[GitHub] [hudi] yanghua commented on pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
yanghua commented on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-816495293
> How can I trigger a rebuild?
option 1: close and reopen the PR;
option 2: push an empty commit via git command
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
n3nash commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r610909843
##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieStorageConfig.java
##########
@@ -39,10 +39,19 @@
public static final String DEFAULT_PARQUET_BLOCK_SIZE_BYTES = DEFAULT_PARQUET_FILE_MAX_BYTES;
public static final String PARQUET_PAGE_SIZE_BYTES = "hoodie.parquet.page.size";
public static final String DEFAULT_PARQUET_PAGE_SIZE_BYTES = String.valueOf(1 * 1024 * 1024);
+
public static final String HFILE_FILE_MAX_BYTES = "hoodie.hfile.max.file.size";
public static final String HFILE_BLOCK_SIZE_BYTES = "hoodie.hfile.block.size";
public static final String DEFAULT_HFILE_BLOCK_SIZE_BYTES = String.valueOf(1 * 1024 * 1024);
public static final String DEFAULT_HFILE_FILE_MAX_BYTES = String.valueOf(120 * 1024 * 1024);
+
+ public static final String ORC_FILE_MAX_BYTES = "hoodie.orc.max.file.size";
+ public static final String DEFAULT_ORC_FILE_MAX_BYTES = String.valueOf(120 * 1024 * 1024);
+ public static final String ORC_STRIPE_SIZE = "hoodie.orc.stripe.size";
Review comment:
Can you please add comments on what is the stripe size used for ?
##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieStorageConfig.java
##########
@@ -39,10 +39,19 @@
public static final String DEFAULT_PARQUET_BLOCK_SIZE_BYTES = DEFAULT_PARQUET_FILE_MAX_BYTES;
public static final String PARQUET_PAGE_SIZE_BYTES = "hoodie.parquet.page.size";
public static final String DEFAULT_PARQUET_PAGE_SIZE_BYTES = String.valueOf(1 * 1024 * 1024);
+
public static final String HFILE_FILE_MAX_BYTES = "hoodie.hfile.max.file.size";
public static final String HFILE_BLOCK_SIZE_BYTES = "hoodie.hfile.block.size";
public static final String DEFAULT_HFILE_BLOCK_SIZE_BYTES = String.valueOf(1 * 1024 * 1024);
public static final String DEFAULT_HFILE_FILE_MAX_BYTES = String.valueOf(120 * 1024 * 1024);
+
+ public static final String ORC_FILE_MAX_BYTES = "hoodie.orc.max.file.size";
+ public static final String DEFAULT_ORC_FILE_MAX_BYTES = String.valueOf(120 * 1024 * 1024);
+ public static final String ORC_STRIPE_SIZE = "hoodie.orc.stripe.size";
+ public static final String DEFAULT_ORC_STRIPE_SIZE = String.valueOf(64 * 1024 * 1024);
+ public static final String ORC_BLOCK_SIZE = "hoodie.orc.block.size";
Review comment:
Same for block size
--
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:
users@infra.apache.org
[GitHub] [hudi] prashantwason commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
prashantwason commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r611979346
##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/storage/HoodieOrcWriter.java
##########
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.io.storage;
+
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_AVRO_BLOOM_FILTER_METADATA_KEY;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_BLOOM_FILTER_TYPE_CODE;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_MAX_RECORD_KEY_FOOTER;
+import static org.apache.hudi.avro.HoodieAvroWriteSupport.HOODIE_MIN_RECORD_KEY_FOOTER;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicLong;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.avro.generic.IndexedRecord;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.orc.storage.ql.exec.vector.ColumnVector;
+import org.apache.orc.storage.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hudi.common.bloom.BloomFilter;
+import org.apache.hudi.common.bloom.HoodieDynamicBoundedBloomFilter;
+import org.apache.orc.OrcFile;
+import org.apache.orc.TypeDescription;
+import org.apache.orc.Writer;
+import org.apache.hudi.avro.HoodieAvroUtils;
+import org.apache.hudi.common.engine.TaskContextSupplier;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.fs.HoodieWrapperFileSystem;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieRecordPayload;
+import org.apache.hudi.common.util.AvroOrcUtils;
+
+public class HoodieOrcWriter<T extends HoodieRecordPayload, R extends IndexedRecord>
+ implements HoodieFileWriter<R> {
+ private static final AtomicLong RECORD_INDEX = new AtomicLong(1);
+
+ private final long maxFileSize;
+ private final Schema avroSchema;
+ private final List<TypeDescription> fieldTypes;
+ private final List<String> fieldNames;
+ private final VectorizedRowBatch batch;
+ private final Writer writer;
+
+ private final Path file;
+ private final HoodieWrapperFileSystem fs;
+ private final String instantTime;
+ private final TaskContextSupplier taskContextSupplier;
+
+ private HoodieOrcConfig orcConfig;
+ private String minRecordKey;
+ private String maxRecordKey;
+
+ public HoodieOrcWriter(String instantTime, Path file, HoodieOrcConfig config, Schema schema,
+ TaskContextSupplier taskContextSupplier) throws IOException {
+
+ Configuration conf = FSUtils.registerFileSystem(file, config.getHadoopConf());
+ this.file = HoodieWrapperFileSystem.convertToHoodiePath(file, conf);
+ this.fs = (HoodieWrapperFileSystem) this.file.getFileSystem(conf);
+ this.instantTime = instantTime;
+ this.taskContextSupplier = taskContextSupplier;
+
+ this.avroSchema = schema;
+ final TypeDescription orcSchema = AvroOrcUtils.createOrcSchema(avroSchema);
+ this.fieldTypes = orcSchema.getChildren();
+ this.fieldNames = orcSchema.getFieldNames();
+ this.maxFileSize = config.getMaxFileSize();
+ this.batch = orcSchema.createRowBatch();
+ OrcFile.WriterOptions writerOptions = OrcFile.writerOptions(conf)
+ .blockSize(config.getBlockSize())
+ .stripeSize(config.getStripeSize())
+ .compress(config.getCompressionKind())
+ .bufferSize(config.getBlockSize())
+ .fileSystem(fs)
+ .setSchema(orcSchema);
+ this.writer = OrcFile.createWriter(this.file, writerOptions);
+ this.orcConfig = config;
+ }
+
+ @Override
+ public void writeAvroWithMetadata(R avroRecord, HoodieRecord record) throws IOException {
Review comment:
Can this function be moved to the interface (default implementation in interface)? It does not look specific to ORC.
##########
File path: hudi-common/src/main/java/org/apache/hudi/common/util/AvroOrcUtils.java
##########
@@ -0,0 +1,804 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.util;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.nio.ByteBuffer;
+import java.sql.Timestamp;
+import java.util.Base64;
+import java.util.Date;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import org.apache.avro.Conversions;
+import org.apache.avro.LogicalType;
+import org.apache.avro.LogicalTypes;
+import org.apache.avro.Schema.Field;
+import org.apache.avro.generic.GenericData;
+import java.nio.charset.StandardCharsets;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericData.StringType;
+import org.apache.avro.util.Utf8;
+import org.apache.orc.storage.common.type.HiveDecimal;
+import org.apache.orc.storage.ql.exec.vector.BytesColumnVector;
+import org.apache.orc.storage.ql.exec.vector.ColumnVector;
+import org.apache.orc.storage.ql.exec.vector.DecimalColumnVector;
+import org.apache.orc.storage.ql.exec.vector.DoubleColumnVector;
+import org.apache.orc.storage.ql.exec.vector.ListColumnVector;
+import org.apache.orc.storage.ql.exec.vector.LongColumnVector;
+import org.apache.orc.storage.ql.exec.vector.MapColumnVector;
+import org.apache.orc.storage.ql.exec.vector.StructColumnVector;
+import org.apache.orc.storage.ql.exec.vector.TimestampColumnVector;
+import org.apache.orc.storage.ql.exec.vector.UnionColumnVector;
+import org.apache.orc.storage.serde2.io.DateWritable;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.orc.TypeDescription;
+
+/**
+ * Methods including addToVector, addUnionValue, createOrcSchema are originally from
+ * https://github.com/streamsets/datacollector.
+ * Source classes:
+ * - com.streamsets.pipeline.lib.util.avroorc.AvroToOrcRecordConverter
+ * - com.streamsets.pipeline.lib.util.avroorc.AvroToOrcSchemaConverter
+ *
+ * Changes made:
+ * 1. Flatten nullable Avro schema type when the value is not null in `addToVector`.
+ * 2. Use getLogicalType(), constants from LogicalTypes instead of getJsonProp() to handle Avro logical types.
+ */
+public class AvroOrcUtils {
+
+ private static final int MICROS_PER_MILLI = 1000;
+ private static final int NANOS_PER_MICRO = 1000;
+
+ /**
+ * Add an object (of a given ORC type) to the column vector at a given position.
+ *
+ * @param type ORC schema of the value Object.
+ * @param colVector The column vector to store the value Object.
+ * @param avroSchema Avro schema of the value Object.
+ * Only used to check logical types for timestamp unit conversion.
+ * @param value Object to be added to the column vector
+ * @param vectorPos The position in the vector where value will be stored at.
+ */
+ public static void addToVector(TypeDescription type, ColumnVector colVector, Schema avroSchema, Object value, int vectorPos) {
+
+ final int currentVecLength = colVector.isNull.length;
+ if (vectorPos >= currentVecLength) {
+ colVector.ensureSize(2 * currentVecLength, true);
+ }
+ if (value == null) {
+ colVector.isNull[vectorPos] = true;
+ colVector.noNulls = false;
+ return;
+ }
+
+ if (avroSchema.getType().equals(Schema.Type.UNION)) {
+ avroSchema = getActualSchemaType(avroSchema);
+ }
+
+ LogicalType logicalType = avroSchema != null ? avroSchema.getLogicalType() : null;
+
+ switch (type.getCategory()) {
+ case BOOLEAN:
+ LongColumnVector boolVec = (LongColumnVector) colVector;
+ boolVec.vector[vectorPos] = (boolean) value ? 1 : 0;
+ break;
+ case BYTE:
+ LongColumnVector byteColVec = (LongColumnVector) colVector;
+ byteColVec.vector[vectorPos] = (byte) value;
+ break;
+ case SHORT:
+ LongColumnVector shortColVec = (LongColumnVector) colVector;
+ shortColVec.vector[vectorPos] = (short) value;
+ break;
+ case INT:
+ // the Avro logical type could be AvroTypeUtil.LOGICAL_TYPE_TIME_MILLIS, but we will ignore that fact here
+ // since Orc has no way to represent a time in the way Avro defines it; we will simply preserve the int value
+ LongColumnVector intColVec = (LongColumnVector) colVector;
+ intColVec.vector[vectorPos] = (int) value;
+ break;
+ case LONG:
+ // the Avro logical type could be AvroTypeUtil.LOGICAL_TYPE_TIME_MICROS, but we will ignore that fact here
+ // since Orc has no way to represent a time in the way Avro defines it; we will simply preserve the long value
+ LongColumnVector longColVec = (LongColumnVector) colVector;
+ longColVec.vector[vectorPos] = (long) value;
+ break;
+ case FLOAT:
+ DoubleColumnVector floatColVec = (DoubleColumnVector) colVector;
+ floatColVec.vector[vectorPos] = (float) value;
+ break;
+ case DOUBLE:
+ DoubleColumnVector doubleColVec = (DoubleColumnVector) colVector;
+ doubleColVec.vector[vectorPos] = (double) value;
+ break;
+ case VARCHAR:
+ case CHAR:
+ case STRING:
+ BytesColumnVector bytesColVec = (BytesColumnVector) colVector;
+ byte[] bytes = null;
+
+ if (value instanceof String) {
+ bytes = ((String) value).getBytes(StandardCharsets.UTF_8);
+ } else if (value instanceof Utf8) {
+ final Utf8 utf8 = (Utf8) value;
+ bytes = utf8.getBytes();
+ } else if (value instanceof GenericData.EnumSymbol) {
+ bytes = ((GenericData.EnumSymbol) value).toString().getBytes(StandardCharsets.UTF_8);
+ } else {
+ throw new IllegalStateException(String.format(
+ "Unrecognized type for Avro %s field value, which has type %s, value %s",
+ type.getCategory().getName(),
+ value.getClass().getName(),
+ value.toString()
+ ));
+ }
+
+ if (bytes == null) {
+ bytesColVec.isNull[vectorPos] = true;
+ bytesColVec.noNulls = false;
+ } else {
+ bytesColVec.setRef(vectorPos, bytes, 0, bytes.length);
+ }
+ break;
+ case DATE:
+ LongColumnVector dateColVec = (LongColumnVector) colVector;
+ int daysSinceEpoch;
+ if (logicalType instanceof LogicalTypes.Date) {
+ daysSinceEpoch = (int) value;
+ } else if (value instanceof java.sql.Date) {
+ daysSinceEpoch = DateWritable.dateToDays((java.sql.Date) value);
+ } else if (value instanceof Date) {
+ daysSinceEpoch = DateWritable.millisToDays(((Date) value).getTime());
+ } else {
+ throw new IllegalStateException(String.format(
+ "Unrecognized type for Avro DATE field value, which has type %s, value %s",
+ value.getClass().getName(),
+ value.toString()
+ ));
+ }
+ dateColVec.vector[vectorPos] = daysSinceEpoch;
+ break;
+ case TIMESTAMP:
+ TimestampColumnVector tsColVec = (TimestampColumnVector) colVector;
+
+ long time;
+ int nanos = 0;
+
+ // The unit for Timestamp in ORC is millis, convert timestamp to millis if needed
+ if (logicalType instanceof LogicalTypes.TimestampMillis) {
+ time = (long) value;
+ } else if (logicalType instanceof LogicalTypes.TimestampMicros) {
+ final long logicalTsValue = (long) value;
+ time = logicalTsValue / MICROS_PER_MILLI;
+ nanos = NANOS_PER_MICRO * ((int) (logicalTsValue % MICROS_PER_MILLI));
+ } else if (value instanceof Timestamp) {
+ Timestamp tsValue = (Timestamp) value;
+ time = tsValue.getTime();
+ nanos = tsValue.getNanos();
+ } else if (value instanceof java.sql.Date) {
+ java.sql.Date sqlDateValue = (java.sql.Date) value;
+ time = sqlDateValue.getTime();
+ } else if (value instanceof Date) {
+ Date dateValue = (Date) value;
+ time = dateValue.getTime();
+ } else {
+ throw new IllegalStateException(String.format(
+ "Unrecognized type for Avro TIMESTAMP field value, which has type %s, value %s",
+ value.getClass().getName(),
+ value.toString()
+ ));
+ }
+
+ final long millis = time % 1000;
Review comment:
This does not look correct. Time is in milliseconds so time % 1000 is not microseconds.
--
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:
users@infra.apache.org
[GitHub] [hudi] codecov-commenter edited a comment on pull request #2793: [HUDI-764] [HUDI-765] ORC reader and writer implementation
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-825222112
# [Codecov](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2793](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e787d8e) into [master](https://codecov.io/gh/apache/hudi/commit/6786581c4842e47e1a8a8e942f54003dc151c7c6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6786581) will **increase** coverage by `17.14%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2793 +/- ##
=============================================
+ Coverage 52.54% 69.68% +17.14%
+ Complexity 3707 373 -3334
=============================================
Files 485 54 -431
Lines 23171 1996 -21175
Branches 2459 236 -2223
=============================================
- Hits 12176 1391 -10785
+ Misses 9923 473 -9450
+ Partials 1072 132 -940
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| hudicli | `?` | `?` | |
| hudiclient | `∅ <ø> (∅)` | `0.00 <ø> (ø)` | |
| hudicommon | `?` | `?` | |
| hudiflink | `?` | `?` | |
| hudihadoopmr | `?` | `?` | |
| hudisparkdatasource | `?` | `?` | |
| hudisync | `?` | `?` | |
| huditimelineservice | `?` | `?` | |
| hudiutilities | `69.68% <ø> (-0.04%)` | `373.00 <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...org/apache/hudi/utilities/HoodieClusteringJob.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL0hvb2RpZUNsdXN0ZXJpbmdKb2IuamF2YQ==) | `62.50% <0.00%> (-2.72%)` | `9.00% <0.00%> (ø%)` | |
| [...s/deltastreamer/HoodieMultiTableDeltaStreamer.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvSG9vZGllTXVsdGlUYWJsZURlbHRhU3RyZWFtZXIuamF2YQ==) | `78.39% <0.00%> (ø)` | `18.00% <0.00%> (ø%)` | |
| [...n/java/org/apache/hudi/cli/commands/SparkMain.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jbGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY2xpL2NvbW1hbmRzL1NwYXJrTWFpbi5qYXZh) | | | |
| [...di/sink/partitioner/delta/DeltaBucketAssigner.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1mbGluay9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaHVkaS9zaW5rL3BhcnRpdGlvbmVyL2RlbHRhL0RlbHRhQnVja2V0QXNzaWduZXIuamF2YQ==) | | | |
| [...3/internal/HoodieBulkInsertDataInternalWriter.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1zcGFyay1kYXRhc291cmNlL2h1ZGktc3BhcmszL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9odWRpL3NwYXJrMy9pbnRlcm5hbC9Ib29kaWVCdWxrSW5zZXJ0RGF0YUludGVybmFsV3JpdGVyLmphdmE=) | | | |
| [...udi/spark3/internal/HoodieWriterCommitMessage.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1zcGFyay1kYXRhc291cmNlL2h1ZGktc3BhcmszL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9odWRpL3NwYXJrMy9pbnRlcm5hbC9Ib29kaWVXcml0ZXJDb21taXRNZXNzYWdlLmphdmE=) | | | |
| [...penJ9MemoryLayoutSpecification64bitCompressed.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvanZtL09wZW5KOU1lbW9yeUxheW91dFNwZWNpZmljYXRpb242NGJpdENvbXByZXNzZWQuamF2YQ==) | | | |
| [...ain/java/org/apache/hudi/avro/HoodieAvroUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvYXZyby9Ib29kaWVBdnJvVXRpbHMuamF2YQ==) | | | |
| [.../common/table/timeline/HoodieArchivedTimeline.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3RhYmxlL3RpbWVsaW5lL0hvb2RpZUFyY2hpdmVkVGltZWxpbmUuamF2YQ==) | | | |
| [...g/apache/hudi/common/table/HoodieTableVersion.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3RhYmxlL0hvb2RpZVRhYmxlVmVyc2lvbi5qYXZh) | | | |
| ... and [421 more](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on pull request #2793: [HUDI-764] [HUDI-765] ORC reader and writer implementation
Posted by GitBox <gi...@apache.org>.
n3nash commented on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-859069045
Closing this in favor of -> https://github.com/apache/hudi/pull/2999
--
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:
users@infra.apache.org
[GitHub] [hudi] TeRS-K commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
TeRS-K commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r612933791
##########
File path: hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieOrcReader.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.io.storage;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.IndexedRecord;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hudi.common.bloom.BloomFilter;
+import org.apache.hudi.common.util.AvroOrcUtils;
+import org.apache.hudi.common.util.OrcReaderIterator;
+import org.apache.hudi.common.util.OrcUtils;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.orc.OrcFile;
+import org.apache.orc.Reader;
+import org.apache.orc.Reader.Options;
+import org.apache.orc.RecordReader;
+import org.apache.orc.TypeDescription;
+
+public class HoodieOrcReader<R extends IndexedRecord> implements HoodieFileReader {
Review comment:
HoodieOrcReader calls methods from OrcUtils and OrcReaderIterator, I think it would suffice to add unit tests to those two classes. Additionally, similar to HoodieParquetReader, which is implicitly tested in many other tests that use the merge handle, and HoodieOrcReader can be tested in this way as well once we find a way to set the base file format for running unit tests. Does this sound reasonable?
--
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:
users@infra.apache.org
[GitHub] [hudi] codecov-io commented on pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-819265116
# [Codecov](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2793](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (619d75b) into [master](https://codecov.io/gh/apache/hudi/commit/6786581c4842e47e1a8a8e942f54003dc151c7c6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6786581) will **decrease** coverage by `1.09%`.
> The diff coverage is `8.72%`.
[](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2793 +/- ##
============================================
- Coverage 52.54% 51.45% -1.10%
+ Complexity 3707 3101 -606
============================================
Files 485 393 -92
Lines 23171 18584 -4587
Branches 2459 1911 -548
============================================
- Hits 12176 9562 -2614
+ Misses 9923 8222 -1701
+ Partials 1072 800 -272
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| hudicli | `40.29% <ø> (ø)` | `0.00 <ø> (ø)` | |
| hudiclient | `∅ <ø> (∅)` | `0.00 <ø> (ø)` | |
| hudicommon | `48.61% <8.72%> (-2.07%)` | `0.00 <21.00> (ø)` | |
| hudiflink | `56.54% <ø> (-0.04%)` | `0.00 <ø> (ø)` | |
| hudihadoopmr | `?` | `?` | |
| hudisparkdatasource | `?` | `?` | |
| hudisync | `?` | `?` | |
| huditimelineservice | `?` | `?` | |
| hudiutilities | `69.74% <ø> (+0.01%)` | `0.00 <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...org/apache/hudi/common/util/OrcReaderIterator.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvT3JjUmVhZGVySXRlcmF0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
| [...ain/java/org/apache/hudi/common/util/OrcUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvT3JjVXRpbHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
| [...java/org/apache/hudi/common/util/AvroOrcUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvQXZyb09yY1V0aWxzLmphdmE=) | `9.11% <9.11%> (ø)` | `19.00 <19.00> (?)` | |
| [...va/org/apache/hudi/io/storage/HoodieOrcReader.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaW8vc3RvcmFnZS9Ib29kaWVPcmNSZWFkZXIuamF2YQ==) | `25.00% <25.00%> (ø)` | `1.00 <1.00> (?)` | |
| [...org/apache/hudi/common/model/HoodieFileFormat.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL21vZGVsL0hvb2RpZUZpbGVGb3JtYXQuamF2YQ==) | `100.00% <100.00%> (ø)` | `3.00 <0.00> (ø)` | |
| [...pache/hudi/io/storage/HoodieFileReaderFactory.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaW8vc3RvcmFnZS9Ib29kaWVGaWxlUmVhZGVyRmFjdG9yeS5qYXZh) | `61.53% <100.00%> (+11.53%)` | `5.00 <1.00> (+2.00)` | |
| [.../apache/hudi/sink/partitioner/BucketAssigners.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1mbGluay9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaHVkaS9zaW5rL3BhcnRpdGlvbmVyL0J1Y2tldEFzc2lnbmVycy5qYXZh) | `33.33% <0.00%> (-16.67%)` | `2.00% <0.00%> (ø%)` | |
| [.../java/org/apache/hudi/common/util/CommitUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvQ29tbWl0VXRpbHMuamF2YQ==) | `40.47% <0.00%> (-3.12%)` | `6.00% <0.00%> (ø%)` | |
| [...java/org/apache/hudi/sink/StreamWriteFunction.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1mbGluay9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaHVkaS9zaW5rL1N0cmVhbVdyaXRlRnVuY3Rpb24uamF2YQ==) | `77.77% <0.00%> (-2.74%)` | `22.00% <0.00%> (ø%)` | |
| [...g/apache/hudi/common/model/WriteOperationType.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL21vZGVsL1dyaXRlT3BlcmF0aW9uVHlwZS5qYXZh) | `50.00% <0.00%> (-1.43%)` | `2.00% <0.00%> (ø%)` | |
| ... and [112 more](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash closed pull request #2793: [HUDI-764] [HUDI-765] ORC reader and writer implementation
Posted by GitBox <gi...@apache.org>.
n3nash closed pull request #2793:
URL: https://github.com/apache/hudi/pull/2793
--
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:
users@infra.apache.org
[GitHub] [hudi] TeRS-K closed pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
TeRS-K closed pull request #2793:
URL: https://github.com/apache/hudi/pull/2793
--
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:
users@infra.apache.org
[GitHub] [hudi] codecov-io edited a comment on pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#issuecomment-819265116
# [Codecov](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2793](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (619d75b) into [master](https://codecov.io/gh/apache/hudi/commit/6786581c4842e47e1a8a8e942f54003dc151c7c6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6786581) will **decrease** coverage by `0.99%`.
> The diff coverage is `8.67%`.
[](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2793 +/- ##
============================================
- Coverage 52.54% 51.55% -1.00%
- Complexity 3707 3729 +22
============================================
Files 485 489 +4
Lines 23171 23753 +582
Branches 2459 2554 +95
============================================
+ Hits 12176 12246 +70
- Misses 9923 10427 +504
- Partials 1072 1080 +8
```
| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| hudicli | `40.29% <ø> (ø)` | `0.00 <ø> (ø)` | |
| hudiclient | `∅ <ø> (∅)` | `0.00 <ø> (ø)` | |
| hudicommon | `48.61% <8.72%> (-2.07%)` | `0.00 <21.00> (ø)` | |
| hudiflink | `56.54% <ø> (-0.04%)` | `0.00 <ø> (ø)` | |
| hudihadoopmr | `33.27% <0.00%> (-0.18%)` | `0.00 <0.00> (ø)` | |
| hudisparkdatasource | `71.33% <ø> (ø)` | `0.00 <ø> (ø)` | |
| hudisync | `45.70% <ø> (ø)` | `0.00 <ø> (ø)` | |
| huditimelineservice | `64.36% <ø> (ø)` | `0.00 <ø> (ø)` | |
| hudiutilities | `69.74% <ø> (+0.01%)` | `0.00 <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2793?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...org/apache/hudi/common/util/OrcReaderIterator.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvT3JjUmVhZGVySXRlcmF0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
| [...ain/java/org/apache/hudi/common/util/OrcUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvT3JjVXRpbHMuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
| [...ache/hudi/hadoop/utils/HoodieInputFormatUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1oYWRvb3AtbXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaGFkb29wL3V0aWxzL0hvb2RpZUlucHV0Rm9ybWF0VXRpbHMuamF2YQ==) | `47.23% <0.00%> (-0.73%)` | `30.00 <0.00> (ø)` | |
| [...java/org/apache/hudi/common/util/AvroOrcUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvQXZyb09yY1V0aWxzLmphdmE=) | `9.11% <9.11%> (ø)` | `19.00 <19.00> (?)` | |
| [...va/org/apache/hudi/io/storage/HoodieOrcReader.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaW8vc3RvcmFnZS9Ib29kaWVPcmNSZWFkZXIuamF2YQ==) | `25.00% <25.00%> (ø)` | `1.00 <1.00> (?)` | |
| [...org/apache/hudi/common/model/HoodieFileFormat.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL21vZGVsL0hvb2RpZUZpbGVGb3JtYXQuamF2YQ==) | `100.00% <100.00%> (ø)` | `3.00 <0.00> (ø)` | |
| [...pache/hudi/io/storage/HoodieFileReaderFactory.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaW8vc3RvcmFnZS9Ib29kaWVGaWxlUmVhZGVyRmFjdG9yeS5qYXZh) | `61.53% <100.00%> (+11.53%)` | `5.00 <1.00> (+2.00)` | |
| [.../apache/hudi/sink/partitioner/BucketAssigners.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1mbGluay9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaHVkaS9zaW5rL3BhcnRpdGlvbmVyL0J1Y2tldEFzc2lnbmVycy5qYXZh) | `33.33% <0.00%> (-16.67%)` | `2.00% <0.00%> (ø%)` | |
| [...hadoop/realtime/RealtimeCompactedRecordReader.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1oYWRvb3AtbXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvaGFkb29wL3JlYWx0aW1lL1JlYWx0aW1lQ29tcGFjdGVkUmVjb3JkUmVhZGVyLmphdmE=) | `64.06% <0.00%> (-8.67%)` | `13.00% <0.00%> (+1.00%)` | :arrow_down: |
| [.../java/org/apache/hudi/common/util/CommitUtils.java](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL3V0aWwvQ29tbWl0VXRpbHMuamF2YQ==) | `40.47% <0.00%> (-3.12%)` | `6.00% <0.00%> (ø%)` | |
| ... and [21 more](https://codecov.io/gh/apache/hudi/pull/2793/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
--
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:
users@infra.apache.org
[GitHub] [hudi] TeRS-K commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
TeRS-K commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r612937436
##########
File path: hudi-common/src/test/java/org/apache/hudi/common/util/TestAvroOrcUtils.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.util;
+
+import static org.apache.hudi.common.testutils.HoodieTestDataGenerator.AVRO_SCHEMA;
+
+import java.util.Arrays;
+import java.util.List;
+import org.apache.avro.Schema;
+import org.apache.hudi.common.testutils.HoodieCommonTestHarness;
+import org.apache.orc.TypeDescription;
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class TestAvroOrcUtils extends HoodieCommonTestHarness {
+
+ public static List<Arguments> testCreateOrcSchemaArgs() {
+ // the ORC schema is constructed in the order as AVRO_SCHEMA:
+ // TRIP_SCHEMA_PREFIX, EXTRA_TYPE_SCHEMA, MAP_TYPE_SCHEMA, FARE_NESTED_SCHEMA, TIP_NESTED_SCHEMA, TRIP_SCHEMA_SUFFIX
+ // The following types are tested:
+ // DATE, DECIMAL, LONG, INT, BYTES, ARRAY, RECORD, MAP, STRING, FLOAT, DOUBLE
+ TypeDescription orcSchema = TypeDescription.fromString("struct<"
Review comment:
This is testing all avro types that can be converted to. I'm not sure what would be a good test for this as there are so many types, as well as edge cases that are easier to discover with real world datasets. Many of the unit tests uses the reader/writer implicitly, which is largely how I've been testing the ORC reader/writer and catching bugs.
Open to suggestions on how to test AvroOrcUtils. :)
--
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:
users@infra.apache.org
[GitHub] [hudi] n3nash commented on a change in pull request #2793: [HUDI-57] Support ORC Storage
Posted by GitBox <gi...@apache.org>.
n3nash commented on a change in pull request #2793:
URL: https://github.com/apache/hudi/pull/2793#discussion_r610913343
##########
File path: hudi-common/src/main/java/org/apache/hudi/common/util/OrcReaderIterator.java
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.util;
+
+import java.util.List;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericData;
+import org.apache.avro.generic.GenericData.Record;
+import org.apache.orc.storage.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hudi.exception.HoodieIOException;
+
+import org.apache.orc.RecordReader;
+import org.apache.orc.TypeDescription;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+/**
+ * This class wraps a ORC reader and provides an iterator based api to read from an ORC file.
+ */
+public class OrcReaderIterator<T> implements Iterator<T> {
Review comment:
Corresponding test class
--
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:
users@infra.apache.org