Apache Sqoop和Spark(Apache Sqoop and Spark)
为了将大型SQL数据加载到Spark以进行转换和ML,以下哪个选项在性能方面更好。
选项1:使用Spark SQL JDBC连接器将SQLData直接加载到Spark。
选项2:使用Sqoop以csv格式将SQLData加载到HDFS,然后使用Spark从HDFS读取数据。请建议以上哪种方法将大型SQL数据加载到Spark上。
In order to load large SQL Data on to Spark for transformation & ML which of these below option is better in terms of performance.
Option 1: Use Spark SQL JDBC connector to load directly SQLData on to Spark.
Option 2: Use Sqoop to load SQLData on to HDFS in csv format and then Use Spark to read the data from HDFS.Please suggest which of the above in a good approach to load large SQL data on to Spark.
原文:https://stackoverflow.com/questions/33771776
更新时间:2023-10-05 09:10
最满意答案
sed 's/\([0-9]*\)\.\([0-9]*\) M/\1\200000/' file
sed 's/\([0-9]*\)\.\([0-9]*\) M/\1\200000/' file
相关问答
更多-
从tr(1)的手册页: SET被指定为字符串...解释的序列是: \ NNN字符,八进制值NNN(1到3个八进制数字) 对于sed(1),手册页不是那么清楚,所以一些尝试可以显示一些东西: echo -n hi |sed 's/h/t/g' |hexdump -c (0000000 t i) 简单。 然后: echo -n hi |sed 's/h//g' |hexdump -c (0000000 i) 空模式删除匹配。 再简单。 然后: echo -n hi |sed 's ...
-
将字节转换为兆字节(Converting bytes to megabytes)[2022-03-09]
传统上以兆字节表示您的第二个选项 - 1兆字节= 2 20字节。 但实际上是不正确的,因为mega意味着1 000 000.有一个新的标准名称为2 20个字节,它是mebibyte( http://en.wikipedia.org/wiki/Mebibyte ),它收集的人气。 Traditionally by megabyte we mean your second option -- 1 megabyte = 220 bytes. But it is not correct actually becau ... -
function formatBytes($bytes, $precision = 2) { $units = array('B', 'KB', 'MB', 'GB', 'TB'); $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); // Uncomment one of t ...
-
如果我理解正确,你想: 在前10行查找没有版权声明的文件,并 将版权声明添加到这些文件。 另外,你想要: 在前10行中查找具有版权声明的文件,并 更新他们对标准文本的注意。 在我看来,这两项任务可以归结为一套: 然后删除前10行中的任何现有版权声明 在文件中插入新的版权声明。 如果我们可以放心地假设你对你的问题发表评论的缩短版本的sampletext是有效的,并且应该插入到例如每个文件的第2行,那么以下应该达到第一组要求if你正在使用GNU sed: find . -type f -not -exec gr ...
-
如何在javascript中将千字节转换为兆字节[重复](how to convert kilobytes to megabytes in javascript [duplicate])[2023-08-14]
你的功能是正确的。 它只接受字节。 但是你想要做的是formatSizeUnits(4000) 。 这是错误的,预期的输出是3.91 MB因为它除以1024而不是1000.正确的方法是调用like formatSizeUnits(4000*1024) // beacuse 4000 is in KB and convert into bytes 看到下面的片段,以得到正确的答案 function formatSizeUnits(bytes){ if (bytes>=107374 ... -
最简单:保留脚本,追加 UPDATE address SET city ='Detroit' 在vim中: :g/^INSERT INTO address/normal f;F'ci'Detroit 在sed中: sed "s/\(VALUES (.*,\)'.*\?'/\1'Detroit'/g" Easiest: Keep the script, append UPDATE address SET city ='Detroit' In vim: :g/^INSERT INTO address/n ...
-
sed 's/\([0-9]*\)\.\([0-9]*\) M/\1\200000/' file sed 's/\([0-9]*\)\.\([0-9]*\) M/\1\200000/' file
-
我能想到几个选项: 添加一个表示Mb大小的列(包含所有额外的存储并保持同步问题)。 使用带有基于函数的索引的“计算列”: CREATE TABLE DS_DocumentStorage ( ... DS_FileSizeMB AS [DS_FileSize] / 1048576 ); CREATE INDEX ix_DS_FileSizeMB ON DS_DocumentStorage(DS_FileSizeMB); 注意:您应该测试执行计划,看 ...
-
如何替换linux输出中的列数据 - 可能正在使用awk sed等(How to replace a column data in linux output - may be using awk sed etc)[2022-06-10]
$ cat foo.input drwxrwxr-x 2 root root 5512 Aug 22 2013 bin lrwxrwxrwx 1 root root 7 Aug 22 2013 bin/addgroup -> busybox lrwxrwxrwx 1 root root 7 Aug 22 2013 bin/adduser -> busybox lrwxrwxrwx 1 ro ... -
使用awk你可以这样做: awk '{val=$3; for (i=4; i
相关文章
更多- Apache Sqoop 1.4.3 发布,Hadoop 数据迁移
- [Hadoop] Sqoop安装过程详解
- Apache Spark源码走读之8 -- Spark on Yarn
- Apache Spark源码走读之8 -- Spark on Yarn
- Apache Spark源码走读之10 -- 在YARN上运行SparkPi
- Apache Spark源码走读之10 -- 在YARN上运行SparkPi
- 使用Sqoop在HDFS和RDBMS之间导数据
- Apache Spark源码走读之4 -- DStream实时流数据处理
- Apache Spark源码走读之4 -- DStream实时流数据处理
- Hadoop Oozie学习笔记 Oozie不支持Sqoop问题解决
最新问答
更多- 您如何使用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)