雪花上不彻底更改列类型

发布于 2025-02-07 01:44:42 字数 436 浏览 3 评论 0原文

我在Snowfflake中有视线。 当前,其中一列是地理类型,由于几何形状,我无法在数据集上运行任何查询。 我想将特定列的类型更改为VARCHAR,以加载数据,而无需永久更改。 我试图使用Alter_table:

ALTER TABLE "TABLES"."FBN"."TABLE" ALTER COLUMN "GEOMETRY" TYPE VARCHAR

但是似乎应该永久更改数据,因为我获得了我没有特权操作的错误:

SQL access control error: Insufficient privileges to operate on view 'TABLE'

我想在阅读表格时更改数据的类型,以便我可以下载数据及之后修复了地理业。 我的最终目标是永久更改列类型,以便我可以阅读数据。

I have view in snowfflake.
Currently, one of the columns is geography type and it I cannot run any query on the dataset due to invalid geometry.
I want to change the type of the specific column to varchar just in order to load the data, without permanently change it.
I have tried to use ALTER_TABLE :

ALTER TABLE "TABLES"."FBN"."TABLE" ALTER COLUMN "GEOMETRY" TYPE VARCHAR

but seems like that suppose to change data permanently, as I get error that I don't have privileges to operate this:

SQL access control error: Insufficient privileges to operate on view 'TABLE'

I want to change the type of data just when I read the table so I can download the data and after that fix the geoemtry.
My end goal here is to change column type no permanently so I can read the data.

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

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

发布评论

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

评论(1

白云悠悠 2025-02-14 01:44:42

有机会使用谓词下降来使其起作用:

SELECT *
FROM view_name
WHERE TRY_TO_GEOGRAPHY("GEOMETRY") IS NOT NULL;
-- WHERE TRY_TO_GEOGRAPHY("GEOMETRY"::VARIANT) IS NOT NULL;

There is a chance to use predicate pushdown to make it work:

SELECT *
FROM view_name
WHERE TRY_TO_GEOGRAPHY("GEOMETRY") IS NOT NULL;
-- WHERE TRY_TO_GEOGRAPHY("GEOMETRY"::VARIANT) IS NOT NULL;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文