Skip to content
Closed
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5456ff2
HUDI-2370
liujinhui1994 Sep 7, 2021
926c941
exclude other parquet
liujinhui1994 Sep 8, 2021
ea401bc
Merge branch 'master' into HUDI-2370
liujinhui1994 Sep 15, 2021
6697169
update spark.sql.parquet.enableVectorizedReader=true
liujinhui1994 Sep 16, 2021
4fb2b5a
Merge branch 'master' into HUDI-2370
liujinhui1994 Sep 16, 2021
dd1bc3d
TEST ci
liujinhui1994 Oct 13, 2021
8328d5b
Merge branch 'master' into HUDI-2370
liujinhui1994 Oct 13, 2021
b9cbda1
test ci
liujinhui1994 Oct 18, 2021
b4d1f3c
Merge branch 'master' into HUDI-2370
liujinhui1994 Oct 21, 2021
6357b3e
Merge remote-tracking branch 'origin/HUDI-2370' into HUDI-2370
liujinhui1994 Oct 21, 2021
30f5c98
HUDI-2370
liujinhui1994 Oct 26, 2021
9637ae9
Merge remote-tracking branch 'origin/HUDI-2370' into HUDI-2370
liujinhui1994 Oct 26, 2021
5e0672f
HUDI-2370
liujinhui1994 Oct 26, 2021
9207f2c
HUDI-2370
liujinhui1994 Oct 26, 2021
917d5ea
Merge branch 'master' into HUDI-2370
liujinhui1994 Oct 27, 2021
115d606
HUDI-2370
liujinhui1994 Oct 27, 2021
cb2d4c6
HUDI-2370
liujinhui1994 Oct 27, 2021
f6d9204
HUDI-2370
liujinhui1994 Oct 27, 2021
c665b68
HUDI-2370
liujinhui1994 Oct 27, 2021
1e344f7
HUDI-2370
liujinhui1994 Oct 29, 2021
3352417
HUDI-2370
liujinhui1994 Nov 1, 2021
03c5308
HUDI-2370
liujinhui1994 Nov 2, 2021
c17ca61
HUDI-2370
liujinhui1994 Nov 2, 2021
db2bd88
Merge branch 'master' into HUDI-2370
liujinhui1994 Nov 2, 2021
61156c4
HUDI-2370
liujinhui1994 Nov 2, 2021
a3677e6
HUDI-2370
liujinhui1994 Nov 3, 2021
624c64a
HUDI-2370
liujinhui1994 Nov 3, 2021
429f7a6
test class exception
liujinhui1994 Nov 3, 2021
ce26ca8
test class exception
liujinhui1994 Nov 3, 2021
8bd01e8
test class exception
liujinhui1994 Nov 3, 2021
7c7ffa1
test class exception
liujinhui1994 Nov 4, 2021
491b4ea
test class exception
liujinhui1994 Nov 4, 2021
4548198
test class exception
liujinhui1994 Nov 4, 2021
c646ab9
test class exception
liujinhui1994 Nov 4, 2021
f8efb1f
test class exception
liujinhui1994 Nov 5, 2021
661c2d4
test class exception
liujinhui1994 Nov 5, 2021
303a3f3
Merge branch 'master' into HUDI-2370
liujinhui1994 Dec 31, 2021
4ca8852
HUDI-2370
liujinhui1994 Jan 25, 2022
f85aeac
HUDI-2370
liujinhui1994 Jan 25, 2022
8babbfa
HUDI-2370
liujinhui1994 Jan 25, 2022
a4688a9
HUDI-2370
liujinhui1994 Jan 25, 2022
1981bf7
HUDI-2370
liujinhui1994 Jan 25, 2022
c9e4ff7
Merge branch 'master' into HUDI-2370
liujinhui1994 Jan 25, 2022
26c72bc
HUDI-2370
liujinhui1994 Feb 7, 2022
ff998e2
Merge branch 'master' into HUDI-2370
liujinhui1994 Feb 8, 2022
cce3365
HUDI-2370
liujinhui1994 Feb 9, 2022
f74353d
HUDI-2370
liujinhui1994 Feb 9, 2022
c36dc87
HUDI-2370
liujinhui1994 Feb 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions hudi-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-column</artifactId>
</dependency>

<!-- Spark -->
<dependency>
<groupId>org.apache.spark</groupId>
Expand All @@ -224,6 +229,16 @@
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.binary.version}</artifactId>
<exclusions>
<exclusion>
<artifactId>parquet-column</artifactId>
<groupId>org.apache.parquet</groupId>
</exclusion>
<exclusion>
<artifactId>parquet-hadoop</artifactId>
<groupId>org.apache.parquet</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
Expand Down
9 changes: 9 additions & 0 deletions hudi-client/hudi-client-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-avro</artifactId>
<version>${parquet.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-column</artifactId>
<version>${parquet.version}</version>
<scope>compile</scope>
</dependency>

<!-- Dropwizard Metrics -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
import org.apache.avro.Schema;
import org.apache.avro.generic.IndexedRecord;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.parquet.avro.AvroSchemaConverter;
import org.apache.parquet.schema.Types;

import java.io.IOException;

Expand All @@ -41,6 +44,8 @@

public class HoodieFileWriterFactory {

private static final Logger LOG = LogManager.getLogger(HoodieFileWriterFactory.class);

public static <T extends HoodieRecordPayload, R extends IndexedRecord, I, K, O> HoodieFileWriter<R> getFileWriter(
String instantTime, Path path, HoodieTable<T, I, K, O> hoodieTable, HoodieWriteConfig config, Schema schema,
TaskContextSupplier taskContextSupplier) throws IOException {
Expand All @@ -67,6 +72,10 @@ private static <T extends HoodieRecordPayload, R extends IndexedRecord> HoodieFi
String instantTime, Path path, HoodieWriteConfig config, Schema schema, HoodieTable hoodieTable,
TaskContextSupplier taskContextSupplier, boolean populateMetaFields, boolean enableBloomFilter) throws IOException {
Option<BloomFilter> filter = enableBloomFilter ? Option.of(createBloomFilter(config)) : Option.empty();

LOG.error("--123" + SystemUtils.getClassLocation(AvroSchemaConverter.class));
LOG.error("--123" + SystemUtils.getClassLocation(Types.class));

HoodieAvroWriteSupport writeSupport = new HoodieAvroWriteSupport(new AvroSchemaConverter(hoodieTable.getHadoopConf()).convert(schema), schema, filter);

HoodieAvroParquetConfig parquetConfig = new HoodieAvroParquetConfig(writeSupport, config.getParquetCompressionCodec(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* 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.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;

/**
* system util.
*/
public class SystemUtils {

public static URL getClassLocation(final Class<?> cls) {

if (cls == null) {
throw new IllegalArgumentException("null input: cls");
}

URL result = null;
final String clsAsResource = cls.getName().replace('.', '/').concat(".class");

final ProtectionDomain pd = cls.getProtectionDomain();

if (pd != null) {
final CodeSource cs = pd.getCodeSource();
if (cs != null) {
result = cs.getLocation();
}

if (result != null) {
if ("file".equals(result.getProtocol())) {
try {
if (result.toExternalForm().endsWith(".jar") || result.toExternalForm().endsWith(".zip")) {
result = new URL("jar:".concat(result.toExternalForm()).concat("!/").concat(clsAsResource));
} else if (new File(result.getFile()).isDirectory()) {
result = new URL(result, clsAsResource);
}
} catch (MalformedURLException ignore) {
System.out.println("-W");
}
}
}
}

if (result == null) {
final ClassLoader clsLoader = cls.getClassLoader();
result = clsLoader != null ? clsLoader.getResource(clsAsResource) : ClassLoader.getSystemResource(clsAsResource);
}
return result;
}
}
5 changes: 5 additions & 0 deletions hudi-client/hudi-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<artifactId>parquet-avro</artifactId>
</dependency>

<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-column</artifactId>
</dependency>

<!-- Hoodie - Test -->
<dependency>
<groupId>org.apache.hudi</groupId>
Expand Down
15 changes: 15 additions & 0 deletions hudi-client/hudi-spark-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.binary.version}</artifactId>
<exclusions>
<exclusion>
<artifactId>parquet-column</artifactId>
<groupId>org.apache.parquet</groupId>
</exclusion>
<exclusion>
<artifactId>parquet-hadoop</artifactId>
<groupId>org.apache.parquet</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
Expand All @@ -65,6 +75,11 @@
<artifactId>parquet-avro</artifactId>
</dependency>

<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-column</artifactId>
</dependency>

<!-- Hoodie - Test -->
<dependency>
<groupId>org.apache.hudi</groupId>
Expand Down
5 changes: 5 additions & 0 deletions hudi-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@
<artifactId>parquet-avro</artifactId>
</dependency>

<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-column</artifactId>
</dependency>

<!-- ORC -->
<dependency>
<groupId>org.apache.orc</groupId>
Expand Down
104 changes: 104 additions & 0 deletions hudi-common/src/main/java/org/apache/hudi/crypot/kms/InMemoryKMS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
* 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.crypot.kms;

import org.apache.hadoop.conf.Configuration;
import org.apache.hudi.common.config.ConfigProperty;
import org.apache.parquet.crypto.KeyAccessDeniedException;
import org.apache.parquet.crypto.ParquetCryptoRuntimeException;
import org.apache.parquet.crypto.keytools.KeyToolkit;
import org.apache.parquet.crypto.keytools.KmsClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

/**
* This is a mock class, built for testing only. Don't use it as an example of KmsClient implementation.
* (org.apache.parquet.crypto.keytools.samples.VaultClient is the sample implementation).
*/
public class InMemoryKMS implements KmsClient {
private static final Logger LOG = LoggerFactory.getLogger(InMemoryKMS.class);

private static final ConfigProperty<String> KEY_LIST_PROPERTY_NAME = ConfigProperty
.key("hoodie.parquet.encryption.key.list")
.noDefaultValue()
.withDocumentation("hudi parquet encryption key list, example: keyName_1:value_1, keyName_2:value_2");

private static Map<String,byte[]> masterKeyMap;

@Override
public synchronized void initialize(Configuration configuration, String kmsInstanceID, String kmsInstanceURL, String accessToken) {
// Parse master keys
String[] masterKeys = configuration.getTrimmedStrings(KEY_LIST_PROPERTY_NAME.key());
if (null == masterKeys || masterKeys.length == 0) {
throw new ParquetCryptoRuntimeException("No encryption key list");
}
masterKeyMap = parseKeyList(masterKeys);
}

private static Map<String, byte[]> parseKeyList(String[] masterKeys) {

Map<String,byte[]> keyMap = new HashMap<>();

int nKeys = masterKeys.length;
for (int i = 0; i < nKeys; i++) {
String[] parts = masterKeys[i].split(":");
String keyName = parts[0].trim();
if (parts.length != 2) {
throw new IllegalArgumentException("Key '" + keyName + "' is not formatted correctly");
}
String key = parts[1].trim();
try {
byte[] keyBytes = Base64.getDecoder().decode(key);
keyMap.put(keyName, keyBytes);
} catch (IllegalArgumentException e) {
LOG.warn("Could not decode key '" + keyName + "'!");
throw e;
}
}
return keyMap;
}

@Override
public synchronized String wrapKey(byte[] keyBytes, String masterKeyIdentifier)
throws KeyAccessDeniedException, UnsupportedOperationException {

byte[] masterKey = masterKeyMap.get(masterKeyIdentifier);
if (null == masterKey) {
throw new ParquetCryptoRuntimeException("Key not found: " + masterKeyIdentifier);
}
byte[] add = masterKeyIdentifier.getBytes(StandardCharsets.UTF_8);
return KeyToolkit.encryptKeyLocally(keyBytes, masterKey, add);
}

@Override
public synchronized byte[] unwrapKey(String wrappedKey, String masterKeyIdentifier)
throws KeyAccessDeniedException, UnsupportedOperationException {
byte[] masterKey = masterKeyMap.get(masterKeyIdentifier);
if (null == masterKey) {
throw new ParquetCryptoRuntimeException("Key not found: " + masterKeyIdentifier);
}
byte[] add = masterKeyIdentifier.getBytes(StandardCharsets.UTF_8);
return KeyToolkit.decryptKeyLocally(wrappedKey, masterKey, add);
}
}
16 changes: 16 additions & 0 deletions hudi-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.binary.version}</artifactId>
<exclusions>
<exclusion>
<artifactId>parquet-column</artifactId>
<groupId>org.apache.parquet</groupId>
</exclusion>
<exclusion>
<artifactId>parquet-hadoop</artifactId>
<groupId>org.apache.parquet</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
Expand All @@ -190,6 +200,12 @@
<version>${parquet.version}</version>
</dependency>

<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-column</artifactId>
<version>${parquet.version}</version>
</dependency>

<!-- Avro -->
<dependency>
<groupId>org.apache.avro</groupId>
Expand Down
8 changes: 7 additions & 1 deletion hudi-flink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<properties>
<main.basedir>${project.parent.basedir}</main.basedir>
<parquet.version>1.11.1</parquet.version>
<parquet.version>1.12.0</parquet.version>
</properties>

<build>
Expand Down Expand Up @@ -155,6 +155,12 @@
<artifactId>flink-parquet_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>parquet-hadoop</artifactId>
<groupId>org.apache.parquet</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand Down
5 changes: 5 additions & 0 deletions hudi-hadoop-mr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
<artifactId>parquet-avro</artifactId>
</dependency>

<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-column</artifactId>
</dependency>

<!-- Hadoop -->
<dependency>
<groupId>org.apache.hadoop</groupId>
Expand Down
Loading