gpt4 book ai didi

hadoop - 在将数据加载到HDFS/Hive中之前进行架构验证/验证

转载 作者:行者123 更新时间:2023-12-02 21:32:51 27 4
gpt4 key购买 nike

我是Hadoop生态系统的新手,在将大量数据加载到hdfs中之前,我需要Bigdata专家提出一些有关实现架构验证/验证的建议。

该方案是:

I have a huge dataset with given schema (having around 200 column-header in it). This dataset is going to be stored in Hive tables/HDFS. Before loading the data into hive table/hdfs I want to perform a schema level verification/validation on the data supplied to avoid any unwanted errors/exception while loading the data into hdfs. Like in case somebody tries to pass a data file having fewer or more number of columns in it then at the first level of verification this load fail.



达到最佳效果的最佳方法是什么?

问候,
布普什

最佳答案

由于具有文件,因此可以将它们添加到HDFS中,然后在其上运行map reduce。在这里,您将对每一行都保持关注,因此可以验证列数,其类型和任何其他验证。

当我提到jason / xml时,会使map减少以该格式标识记录的开销很小。但是,关于验证,您可以强制执行模式验证,也可以使用模式仅为字段定义特定值。因此,一旦架构准备就绪,就可以进行解析(将XML转换为Java),然后将其存储在另一个最终的HDFS位置以供进一步使用(例如HBase)。当您确定数据已验证时,可以在此之上创建Hive表。

关于hadoop - 在将数据加载到HDFS/Hive中之前进行架构验证/验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33622573/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com