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/11/05 14:26:26 UTC

[GitHub] [hudi] nsivabalan opened a new pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

nsivabalan opened a new pull request #3930:
URL: https://github.com/apache/hudi/pull/3930


   - Adding parquet data block with inline read support.
   - Added a config hoodie.table.log.block.type to determine the log block type. If not set, we will fallback to determining log block type based on base file format. if set, we will use the config value.
   - Added some minimal tests to ensure adding a parquet data block and reading it using AbstractLogRecordScanner works fine.
   
   Pending items:
   - where to store the configs for new parquet data block. we need index configs, and parquet write configs too. Don't think we can reuse existing ones its purpose is different. Once have consensus, will have to fix the configs for the same.
   - Added only inline read support in this patch. Wanted to understand if we need to support the older way (read entire content and then deserialize records). 
   - Add more end to end tests to test parquet data blocks.
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Added integration tests for end-to-end.*
     - *Added HoodieClientWriteTest to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## 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.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot removed a comment on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961940855


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 33a74848def8b64ed7df6bc9490970d16f013457 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] vinothchandar commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
vinothchandar commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-962196824


   @nsivabalan we should push this back a bit and may be even @codope can review this and take over? this is not directly related to metadata table right. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961942957


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3167",
       "triggerID" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 33a74848def8b64ed7df6bc9490970d16f013457 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3167) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot removed a comment on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961940855






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961940855






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot removed a comment on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961942957


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3167",
       "triggerID" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 33a74848def8b64ed7df6bc9490970d16f013457 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3167) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] prashantwason commented on a change in pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
prashantwason commented on a change in pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#discussion_r748696391



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTable.java
##########
@@ -702,16 +703,21 @@ public HoodieFileFormat getLogFileFormat() {
     return metaClient.getTableConfig().getLogFileFormat();
   }
 
-  public HoodieLogBlockType getLogDataBlockFormat() {
-    switch (getBaseFileFormat()) {

Review comment:
       I think this config is not required. 
   
   For a dataset with a PARQUET file format, an inline log block format of PARQUET makes sense. Mix and match of base file format and inline log format does not seem to make writing data or query engine side faster.
   
   So we can have a config - useInlineFiles() - when enabled, the  inline file format will be format and it will have the same format as the base file format. This needs to be fixed for the dataset so can be from table config.

##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieParquetDataBlock.java
##########
@@ -0,0 +1,168 @@
+/*
+ * 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.table.log.block;
+
+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.fs.inline.InLineFSUtils;
+import org.apache.hudi.common.fs.inline.InLineFileSystem;
+import org.apache.hudi.common.model.HoodieLogFile;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.hudi.io.storage.HoodieAvroParquetConfig;
+import org.apache.hudi.io.storage.HoodieParquetReader;
+import org.apache.hudi.io.storage.HoodieParquetStreamWriter;
+
+import org.apache.avro.Schema;
+import org.apache.avro.generic.IndexedRecord;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.Path;
+import org.apache.parquet.avro.AvroSchemaConverter;
+import org.apache.parquet.hadoop.ParquetWriter;
+import org.apache.parquet.hadoop.metadata.CompressionCodecName;
+
+import javax.annotation.Nonnull;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * HoodieParquetDataBlock contains a list of records serialized using Parquet.
+ */
+public class HoodieParquetDataBlock extends HoodieDataBlock {
+
+  public HoodieParquetDataBlock(@Nonnull Map<HeaderMetadataType, String> logBlockHeader,
+                                @Nonnull Map<HeaderMetadataType, String> logBlockFooter,
+                                @Nonnull Option<HoodieLogBlockContentLocation> blockContentLocation, @Nonnull Option<byte[]> content,
+                                FSDataInputStream inputStream, boolean readBlockLazily) {
+    super(logBlockHeader, logBlockFooter, blockContentLocation, content, inputStream, readBlockLazily);
+  }
+
+  public HoodieParquetDataBlock(HoodieLogFile logFile, FSDataInputStream inputStream, Option<byte[]> content,
+                                boolean readBlockLazily, long position, long blockSize, long blockEndpos, Schema readerSchema,
+                                Map<HeaderMetadataType, String> header, Map<HeaderMetadataType, String> footer) {
+    super(content, inputStream, readBlockLazily,
+        Option.of(new HoodieLogBlockContentLocation(logFile, position, blockSize, blockEndpos)), readerSchema, header,
+        footer);
+  }
+
+  public HoodieParquetDataBlock(@Nonnull List<IndexedRecord> records, @Nonnull Map<HeaderMetadataType, String> header) {
+    super(records, header, new HashMap<>());
+  }
+
+  @Override
+  public HoodieLogBlockType getBlockType() {
+    return HoodieLogBlockType.PARQUET_DATA_BLOCK;
+  }
+
+  @Override
+  protected byte[] serializeRecords() throws IOException {
+    // TODO: Need to decide from where to fetch all config values required below. We can't re-use index config as the purpose is different.

Review comment:
       I think the configs here should match the configs for the dataset base file format. 
   
   Under what case would the user want separate configs for base file and inline log blocks?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] danny0405 commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
danny0405 commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-971259381


   Hi @nsivabalan , do you want this patch into release 0.10.0, you can tag it with `release-blocker` if you think it is necessary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961940855






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] nsivabalan commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
nsivabalan commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-962647042


   agreed. will remove from release blocker.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961940855


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 33a74848def8b64ed7df6bc9490970d16f013457 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] nsivabalan closed pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
nsivabalan closed pull request #3930:
URL: https://github.com/apache/hudi/pull/3930


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot commented on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961990658


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3167",
       "triggerID" : "33a74848def8b64ed7df6bc9490970d16f013457",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 33a74848def8b64ed7df6bc9490970d16f013457 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=3167) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [hudi] hudi-bot removed a comment on pull request #3930: [HUDI-431] [WIP] Adding parquet data block with inline read support

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #3930:
URL: https://github.com/apache/hudi/pull/3930#issuecomment-961940855






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org