如何从hive表中读取多行列值?具有换行符和空格的列
I have following Hive table so when i run select query on col3 it will return result like..
col3
opt-91092019
nullopt-287211
所以 null 被追加到列值中,并且最后有 2 个空格。 所以我希望输出
col3
opt-91092019
opt-287211
没有任何额外的字符。
|------+------+--------+------------------+-------+------|
|row1: | col1 | col2 | col3(multi-line) | col4 | col5 |
|------+------+--------+------------------+-------+------|
| | | | opt-91092019 | | |
|row2: | A | S | opt-287211 | abcd | hft |
| | | | opt-7123872 | | |
|------+------+--------+------------------+-------+------|
|row3: | B | R | opt-26725rfe | pore | hft2 |
|------+------+--------+------------------+-------+------|
|row4: | C | Q | single-line1 | ertfd | hft3 |
|------+------+--------+------------------+-------+------|
|row5: | D | P | single-line2 | bcde4 | hft4 |
|------+------+--------+------------------+-------+------|
I have following Hive table so when i run select query on col3 it will return result like..
col3
opt-91092019
nullopt-287211
so null is append to the column value and at the end 2 spaces are there.
so I want output as
col3
opt-91092019
opt-287211
without any extra character.
|------+------+--------+------------------+-------+------|
|row1: | col1 | col2 | col3(multi-line) | col4 | col5 |
|------+------+--------+------------------+-------+------|
| | | | opt-91092019 | | |
|row2: | A | S | opt-287211 | abcd | hft |
| | | | opt-7123872 | | |
|------+------+--------+------------------+-------+------|
|row3: | B | R | opt-26725rfe | pore | hft2 |
|------+------+--------+------------------+-------+------|
|row4: | C | Q | single-line1 | ertfd | hft3 |
|------+------+--------+------------------+-------+------|
|row5: | D | P | single-line2 | bcde4 | hft4 |
|------+------+--------+------------------+-------+------|
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论