作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在Spark Dataset中将整个列的大小写更改为小写
Desired Input
+------+--------------------+
|ItemID| Category name|
+------+--------------------+
| ABC|BRUSH & BROOM HAN...|
| XYZ|WHEEL BRUSH PARTS...|
+------+--------------------+
Desired Output
+------+--------------------+
|ItemID| Category name|
+------+--------------------+
| ABC|brush & broom han...|
| XYZ|wheel brush parts...|
+------+--------------------+
collectAsList()
和
toString()
,这对于非常大的数据集来说是缓慢而复杂的过程。
最佳答案
使用lower
中的org.apache.spark.sql.functions
函数
例如:
df.select($"q1Content", lower($"q1Content")).show
+--------------------+--------------------+
| q1Content| lower(q1Content)|
+--------------------+--------------------+
|What is the step ...|what is the step ...|
|What is the story...|what is the story...|
|How can I increas...|how can i increas...|
|Why am I mentally...|why am i mentally...|
|Which one dissolv...|which one dissolv...|
|Astrology: I am a...|astrology: i am a...|
| Should I buy tiago?| should i buy tiago?|
|How can I be a go...|how can i be a go...|
|When do you use ...|when do you use ...|
|Motorola (company...|motorola (company...|
|Method to find se...|method to find se...|
|How do I read and...|how do i read and...|
|What can make Phy...|what can make phy...|
|What was your fir...|what was your fir...|
|What are the laws...|what are the laws...|
|What would a Trum...|what would a trum...|
|What does manipul...|what does manipul...|
|Why do girls want...|why do girls want...|
|Why are so many Q...|why are so many q...|
|Which is the best...|which is the best...|
+--------------------+--------------------+
关于java - 如何将整列的大小写更改为小写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43500827/
我正在使用 DMatrix 结构来分配动态大小的矩阵,我在其中使用 L2 范数通过归一化列向量重复覆盖每一列。 // a is some DMatrix of arbitrary size let c
我表中的当前数据是: a b --------- -1 5 -11 2 -5 32 我的要求是将a列的所有数据都转换成负值。 但是如何选择整列将正值更新为负值呢? 最佳答案
我是一名优秀的程序员,十分优秀!