简体   繁体   English

Hive 外部表与二进制列拼花

[英]Hive external table to parquet with binary columns

I have 1 parquet data file with schema;我有 1 个带有架构的镶木地板数据文件;

  • id integer编号 integer
  • model binary model 二进制

This file was created using pyspark and consist model identifier and dumped with pickle python library model binary.该文件是使用 pyspark 创建的,包含 model 标识符并与 pickle python 库 Z20F35E630DAF44DBFAC4C3F8D6D 一起转储。

Is it possible to create Hive external table for this parquet file and get output after select command.是否可以为此 parquet 文件创建 Hive 外部表并在 select 命令后获取 output。 Let's suppose that Hive external table got exactly same schema.假设 Hive 外部表具有完全相同的架构。

CREATE EXTERNAL TABLE default.t_model
(
id integer
, model binary
)
STORED AS PARQUET
LOCATION 'hdfs_path';

I'd done each step above but always got empty answerset.我已经完成了上面的每一步,但总是得到空的答案集。 Should I use Hive UDF for loading binary column?我应该使用 Hive UDF 来加载二进制列吗? Or should I try another data type for parquet binary column like array?或者我应该为 parquet 二进制列(如数组)尝试另一种数据类型?

Appreciate any answers, thx.感谢任何答案,谢谢。

Looks like I shouldn't use partitioned table without MSCK REPAIR TABLE command.看起来我不应该使用没有 MSCK REPAIR TABLE 命令的分区表。 With Hive binary data type everything works good.使用 Hive 二进制数据类型一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM