首页 \ 问答 \ 将多个客户端数据加载到Hadoop的最佳实践(best practice to load multiple client data into Hadoop)

将多个客户端数据加载到Hadoop的最佳实践(best practice to load multiple client data into Hadoop)

我们使用Cloudera CDH在Hadoop框架上创建POC。 我们想要将多个客户端的数据加载到Hive表中。

截至目前,我们为SQL Server上的每个客户端都有单独的数据库。 OLTP的这种基础结构将保持不变。 Hadoop将用于OLAP。 我们有一些主要维度表,每个客户端都是相同的。 所有客户端数据库都有完全相同的模式 这些表具有相同的主键值。 到目前为止,这很好,因为我们有单独的客户端数据库。 现在我们试图将多个客户端数据加载到同一个数据容器(Hive表)中。 现在,如果我们通过Sqoop作业将数据直接从多个SQL Server数据库加载到Hive中,我们将拥有多个具有相同主键值的行。 我想在Hive表中使用代理键,但Hive不支持自动增量,但可以使用UDF实现。

我们不想在运行生产数据时修改SQL Server数据。

一个。 将多个客户端数据加载到Hadoop生态系统中的标准/通用方式/解决方案是什么?

湾 如何将sql server数据库表的主键轻松映射到Hadoop Hive表?

C。 我们如何确保一个客户端永远无法看到其他客户端的数据?

谢谢


We are creating POC on Hadoop framework with Cloudera CDH. We want to load data of multiple client into Hive tables.

As of now, we have separate database for each client on SQL Server. This infrastructure will remain same for OLTP. Hadoop will be used for OLAP. We have some primary dimension tables which are same for each client. All client database has exact same schema. These tables have same primary key value. Till now, this was fine as we have separate database for client. Now we are trying to load multiple client data into same data container (Hive tables). Now we will have multiple row with same primary key value if we load data directly into Hive from multiple SQL Server databases through Sqoop job. I am thinking to use the surrogate key in Hive tables but Hive does not support auto increment but can be achieved with UDF.

We don't want to modify the SQL Server data as it's running production data.

a. What are the standard/generic way/solution to load multiple client data into Hadoop ecosystem?

b. How primary key of sql server database table can be mapped easily to Hadoop Hive table ?

c. How we can ensure that one client is never able to see the data of other client?

Thanks


原文:https://stackoverflow.com/questions/35034754
更新时间:2022-07-30 09:07

最满意答案

我记得遇到过类似的情况。

并且,正如@nulltoken所建议的那样,在尝试删除它所保存的文件之前,您必须先Dispose() Repository

using应该是最好的选择。

using (var repo = new Repository(repositoryPath))
{
  //Your repo specific implementation.
}

//Code to Delete your local temp dir

参考:从LibGit2Sharp 克隆夹具


I remember having faced a similar situation.

And, as advised by @nulltoken, you would have to Dispose() the Repository before trying to delete the files that are being held by it.

using should be the best option.

using (var repo = new Repository(repositoryPath))
{
  //Your repo specific implementation.
}

//Code to Delete your local temp dir

Reference: Clone Fixture from LibGit2Sharp

相关问答

更多
  • 在删除1.1之前,您可能希望首先将其标记为1.0。 git checkout v1.1 git tag v1.0 #tag release. use git tag -d v1.0 if v1.0 exists. git push origin v1.0 #push tag to origin 假设您可以访问源的远程存储库,则可以使用以下命令删除标记: git push origin :refs/tags/v1.1 #remove remote copy of tag g ...
  • 我认为你正在寻找assume-unchanged旗帜。 基本上,请尝试运行以下命令 git update-index --assume-unchanged 这将停止跟踪file任何本地更改。 要撤消上述命令的效果,请使用git update-index --no-assume-unchanged I think you are looking for assume-unchanged flag. Basically, try running the following command git ...
  • 我想删除使用LibGit2Sharp从远程存储库克隆的本地repo文件夹。 我在这里读到,我必须在删除之前Dispose()存储库。 LibGit2Sharp保持.git文件夹中的一些文件(主要是出于性能原因的包文件)。 调用Dispose()将释放这些句柄并释放非托管内存。 因此,依赖using语句确实是一个强烈的建议(或者,至少在完成时使用Dispose()存储库实例)。 如果你不这样做,那么当你的AppDomain卸载时,这些句柄最终将通过终结器发布,但是你将不能真正控制将要发生的“何时”。 编辑:再 ...
  • 你应该遵循的过程是: hg remove或hg forget文件 。 Mercurial不跟踪目录,因此如果从特定目录中删除所有文件,则目录本身将从Mercurial的角度不再存在。 最后,一旦跟踪了文件,就无法使用标准的rm或del命令将其删除,也无法从文件浏览器中删除它。 执行此操作将导致Mercurial将文件标记为“缺失”,这意味着它仍在被跟踪。 完成此操作后,您可以运行hg status ,它应该显示您刚刚使用R前缀删除的所有文件。 提交删除。 与任何其他修改一样,hg remove / forg ...
  • 是的,你可以这么做。 它只会删除您的本地副本。 话虽如此,更简单的方法可能是简单地将其移动到首选位置。 每个git存储库都是自包含的,并不关心它被克隆到的位置。 Yes, you can do that. It will only delete your local copy. Having said that, the easier way probably will be to simply move it to the preferred location. Each git repository i ...
  • 你需要记住git pull实际上是一个两步的过程。首先它使用fetch来检索远程文件。 然后,它将尝试进行fast-forward merge以直接在您的工作之上应用更改。 所以在遥控器上使用fetch 。 这将确保您在git仓库中设置了远程更改集。 我想说从git repo运行以下命令: ls | xargs -I'{}' git checkout -- '{}' 但是你说你在Windows机器上,所以你可能只需要循环并手动完成。 此外,这假设您的仓库的根目录中没有创建新文件。 现在,如果您确实要还原目 ...
  • 该错误是因为存储库有一个名为HEAD的分支。 由于HEAD跟踪当前工作提交,Git在名为HEAD的分支和git的当前工作提交的内部指针之间变得混乱(因此warning: refname 'HEAD' is ambiguous消息。) 你可以尝试git branch -D HEAD (删除分支的常规方法),但我不确定这是否会让git更加混乱。 The error is because the repository has a branch called HEAD. Since HEAD keeps track ...
  • 您已选择--bare选项(“Public repository,no working dir”)。 此选项不会创建工作目录。 而是选择“个人存储库”选项,该选项可创建工作目录。 You have selected the --bare option ("Public repository, no working dir"). This option does not create a working directory. Instead, choose the "Personal repository" o ...
  • 我记得遇到过类似的情况。 并且,正如@nulltoken所建议的那样,在尝试删除它所保存的文件之前,您必须先Dispose() Repository 。 using应该是最好的选择。 using (var repo = new Repository(repositoryPath)) { //Your repo specific implementation. } //Code to Delete your local temp dir 参考:从LibGit2Sharp 克隆夹具 I remember ...
  • 在找到类似的 问题并没有完全按照我想要的方式完成后, 本文提供了答案:创建一个空分支。 git checkout --orphan empty git rm -rf . git commit --allow-empty -m "An empty working directory" 当然,请确保您首先将任何重要文件提交到您的仓库。 我把这个分支称为empty ,但你可以通过checkout命令给它任何名字。 设置完成后,您可以切换到任何分支以恢复文件: git checkout master 当您需要“ ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)