如何使用Impala SQL在Impala表中更改列值?

发布于 2025-02-07 10:41:22 字数 385 浏览 2 评论 0原文

我试图使用:

UPDATE tablename SET supports = 'A B'
WHERE supports = 'A'

但是,由于我的表不是kudu表,因此我会遇到错误。

我尝试使用alter命令,但找不到任何好的文档。

使用Alter查询是否看起来像这样?

ALTER TABLE tablename ALTER [COLUMN] support
SET supports = 'A B'

I was trying to update column value of my Impala table using:

UPDATE tablename SET supports = 'A B'
WHERE supports = 'A'

However, since my table is not a Kudu table, I'm getting an error.

I tried to use ALTER command, but couldn't find any good documentation.

Using ALTER should the query look something like this?

ALTER TABLE tablename ALTER [COLUMN] support
SET supports = 'A B'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

流心雨 2025-02-14 10:41:22

为什么不重写所有数据。

Insert overwrite mytab
Select supports from mytab where supports <>'A'
Union all
Select 'A B' from 
mytab where supports ='A'

这不是一个非常有效的方法,但它将起作用。

Why not rewrite all the data.

Insert overwrite mytab
Select supports from mytab where supports <>'A'
Union all
Select 'A B' from 
mytab where supports ='A'

Not a very efficient way but it will work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文