使用模式读取avro数据的hive独立元存储不起作用



我们有presto配置单元访问avro格式的s3文件的用例。当我们尝试使用独立的配置单元元存储并使用外部表读取此avro数据时,我们会遇到问题SerDeStorageSchemaReader类找不到问题

MetaException(message:org.apache.hadoop.hive.metastore.SerDeStorageSchemaReader class not found)
at org.apache.hadoop.hive.metastore.utils.JavaUtils.getClass(JavaUtils.java:54)

我们知道这个错误是因为SerDeStorageSchemaReader类在独立的元存储中不可用。

我想知道可以在不使用hive/hadoop的情况下运行hive元存储,或者还有其他选择吗?

独立配置单元不支持avro。我们需要安装完整的hadoop加hive版本,并只启动hive元存储来修复

我通过以下操作调整了Hive Standalone以使用Avro文件和S3:

  1. metastoresite.xml文件中,我添加了以下内容:

    <property>
    <name>metastore.storage.schema.reader.impl</name>
    <value>org.apache.hadoop.hive.metastore.SerDeStorageSchemaReader</value> </property>
    
  2. 我将以下jar添加到${HIVE_HOME}/lib/

  • 配置单元元存储-${metastore_VERSION}.jar(完整配置单元版本(
  • 蜂窝公用-${METASTORE_VERSION}.jar
  • hive serde-${METASTORE_VERSION}.jar
  1. 我创建了这样的表:

    如果不存在,则创建表将TABLE_xyz(col1 INT,col2 INT(WITH(format='AVRO',partitioned_by=ARRAY['col1',col2],external_location='s3a://my_bucket/path/bah',AVRO_schema_url='s3a://mybucket/AVRO_file_schema.avsc'(;

最新更新