[HUDI-4098] Support HMS for flink HudiCatalog (#6082)
* [HUDI-4098]Support HMS for flink HudiCatalog
This commit is contained in:
@@ -23,6 +23,7 @@ import org.apache.avro.Schema;
|
||||
import org.apache.avro.Schema.Field;
|
||||
import org.apache.avro.SchemaCompatibility;
|
||||
import org.apache.avro.generic.IndexedRecord;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.FileSystem;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
|
||||
@@ -261,6 +262,11 @@ public class TableSchemaResolver {
|
||||
}
|
||||
}
|
||||
|
||||
public static MessageType convertAvroSchemaToParquet(Schema schema, Configuration hadoopConf) {
|
||||
AvroSchemaConverter avroSchemaConverter = new AvroSchemaConverter(hadoopConf);
|
||||
return avroSchemaConverter.convert(schema);
|
||||
}
|
||||
|
||||
private Schema convertParquetSchemaToAvro(MessageType parquetSchema) {
|
||||
AvroSchemaConverter avroSchemaConverter = new AvroSchemaConverter(metaClient.getHadoopConf());
|
||||
return avroSchemaConverter.convert(parquetSchema);
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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.exception;
|
||||
|
||||
/**
|
||||
* Exception thrown for Hoodie Catalog errors.
|
||||
*/
|
||||
public class HoodieCatalogException extends RuntimeException {
|
||||
|
||||
public HoodieCatalogException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public HoodieCatalogException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public HoodieCatalogException(String message, Throwable t) {
|
||||
super(message, t);
|
||||
}
|
||||
|
||||
public HoodieCatalogException(Throwable t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user