将主键和外键添加到Databricks上的SQL表

发布于 2025-01-27 15:47:29 字数 482 浏览 3 评论 0 原文

我是Databricks的新手,当我想通过添加主要或FK来更改SQL表时,我会收到一个荒谬的错误,似乎无法调试它。

%sql
ALTER TABLE samples_abp215dsdp ADD CONSTRAINT PRIMARY (SampleID);

这是错误消息:

Error in SQL statement: ParseException: 
mismatched input '(' expecting {'CHECK', 'FOREIGN', 'PRIMARY', 'UNIQUE'}(line 1, pos 55)

== SQL ==
ALTER TABLE samples_abp215dsdp ADD CONSTRAINT PRIMARY (SampleID)
------------------------------------------------------^^^

任何帮助将不胜感激。

I'm new to Databricks and when I want to alter my SQL tables by adding primary or FK, I get an absurd error that can't seem to debug it.

%sql
ALTER TABLE samples_abp215dsdp ADD CONSTRAINT PRIMARY (SampleID);

here is the error message:

Error in SQL statement: ParseException: 
mismatched input '(' expecting {'CHECK', 'FOREIGN', 'PRIMARY', 'UNIQUE'}(line 1, pos 55)

== SQL ==
ALTER TABLE samples_abp215dsdp ADD CONSTRAINT PRIMARY (SampleID)
------------------------------------------------------^^^

any help will be appreciated.

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

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

发布评论

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

评论(1

韶华倾负 2025-02-03 15:47:29

火花没有任何主要钥匙的概念。因为火花是计算引擎而不是数据库。

2022 有新功能。请关注下面的列表:

  • Unity目录(似乎它将存在于Hive Metastore旁边,并且可以迁移)
  • 控制Metastore,Unity Creations等。从管理员控制台,
  • “创建create cluster”(类似于SQL端点)中的CPU群集,其中指定需要多少cpus
  • 数据谱系
  • 增量共享
  • delta:primary键
  • delta:外键
  • 更新的合作伙伴与许多新合作伙伴连接加入
  • Notebooks UI:转换向导:Select,Drop,Drop,Drop,Drop,Drop,Drop,drops ,来自DropList等的Groupby等)
  • 新的全局搜索
  • 工作服务与GIT
  • 作业监控
  • 维修和重新运行的任务失败的任务并通过任务之间的值
  • SQL Workfrows中的值SQL Wiew
  • create Create Create create create create tables通过wizard
  • delta live tables in ga
  • serverless dbsql dbsql
  • private链接(to vnet to vnet)以及ExpressRoute)和加密
  • ML:LightGBM,Auto ML ML中的先知模型和文本功能
  • :与Azure Mysql,Azure SQL和CosmosDB
  • ML:功能商店集成ML:功能存储:功能商店:时间点插入时间点:基于时间基于时间的SPLITS
  • ML:功能商店API:功能商店API API API API API:
  • ML:具有高可用性SLA ML的无服务器模型服务(启用服务按钮)
  • :一键单击模型部署到

2023 中:

  • delta:Identity Command列
  • Delta:动态检查点和增量限制,以限制阅读/写入操作。 adls

参考此 link

spark do not have any concept of primary key. As spark is computation engine not database.

There are new features coming in 2022. Follow below list:

  • Unity catalog (seems that it will exists next to hive metastore and it will be possible to migrate)
  • Control metastore, unity creations etc. from admin console,
  • CPU clusters in "create cluster" (similar to SQL endpoints) where you specify how much cpus is needed
  • Data lineage
  • Delta sharing
  • Delta: primary keys
  • Delta: foreign keys
  • Updated partner connect with many new partners joining
  • Notebooks UI: transformations wizards (like select, drop, groupby from droplist etc.)
  • New global search
  • Integration of job service with git
  • Jobs monitoring
  • Repair and rerun failed tasks and pass values between tasks
  • SQL workflows in SQL view
  • create table enhanced via wizard
  • Delta live tables in GA
  • Serverless DBSQL
  • Private links (to VNET and to ExpressRoute) and encryption
  • ML: LightGBM, Prophet Models and Text Feature in Auto ML
  • ML: Feature store integration with Azure MySQL, Azure SQL and CosmosDB
  • ML: Feature store: point in time joins, time-based splits
  • ML: Feature store API
  • ML: Serverless model serving (enable serving button) with high availability SLA
  • ML: one click model deployment into registry

In 2023:

  • Delta: identity column
  • Delta: dynamic checkpoints and incremental commits to limit read/write operations with ADLS

Refer this link

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