流式引入策略命令Streaming ingestion policy command

可以对表设置流式引入策略,以允许流式引入到此表中。Streaming ingestion policy can be set on a table to allow streaming ingestion into this table. 也可以在数据库级别设置策略,以便将相同的设置应用于当前表和未来的表。The policy can also be set at the database level to apply the same setting to both current and future tables.

有关详细信息,请参阅流式引入For more information, see Streaming ingestion. 若要了解有关流式引入策略的详细信息,请参阅流式引入策略To learn more about the streaming ingestion policy, see Streaming ingestion policy.

显示策略Display the policy

.show policy streamingingestion 命令显示数据库或表的流式引入策略。The .show policy streamingingestion command shows the streaming ingestion policy of the database or table.

语法Syntax

.show {database|table} <entity name> policy streamingingestion.show {database|table} <entity name> policy streamingingestion

返回Returns

此命令返回包含以下列的表:This command returns a table with the following columns:

Column 类型Type 说明Description
PolicyNamePolicyName string 策略名称 - StreamingIngestionPolicyThe policy name - StreamingIngestionPolicy
EntityNameEntityName string 数据库或表名称Database or table name
策略Policy string 流式引入策略对象streaming ingestion policy object

示例Examples

.show database DB1 policy streamingingestion

.show table T1 policy streamingingestion
PolicyNamePolicyName EntityNameEntityName 策略Policy ChildEntitiesChildEntities EntityTypeEntityType
StreamingIngestionPolicyStreamingIngestionPolicy DB1DB1 {"IsEnabled": true, "HintAllocatedRate": null}{"IsEnabled": true, "HintAllocatedRate": null}

更改策略Change the policy

.alter[-merge] policy streamingingestion 系列命令提供修改数据库或表的流式引入策略的方法。The .alter[-merge] policy streamingingestion family of commands provides means for modifying streaming ingestion policy of the database or table.

语法Syntax

备注

  • 如果先前未在实体上定义策略,则无需更改策略的其他属性或将属性设置为默认值,即可更改流式引入的启用/禁用状态。Allows changing enabled/disabled state of streaming ingestion without modifying other properties of the policy or setting the properties to default values if the policy wasn't previously defined on the entity.

  • 允许替换实体上的整个流式引入策略。Allows replacing the entire streaming ingestion policy on the entity. 流式引入策略对象必须包含所有必需的属性。streaming ingestion policy object must include all mandatory properties.

  • 允许只替换实体上流式引入策略的指定属性。Allows replacing only specified properties of the streaming ingestion policy on the entity. 流式引入策略对象可以包含部分或不包含强制性属性。Streaming ingestion policy object can include some or none of the mandatory properties.

返回Returns

此命令修改表或数据库 streamingingestion 策略对象,然后返回相应的 .show policy streamingingestion 命令的输出。The command modifies the table or database streamingingestion policy object, and then returns the output of the corresponding .show policy streamingingestion command.

示例Examples

.alter database DB1 policy streamingingestion enable

.alter table T1 policy streamingingestion disable

.alter database DB1 policy streamingingestion '{"IsEnabled": true, "HintAllocatedRate": 2.1}'

.alter table T1 policy streamingingestion '{"IsEnabled": true}'

.alter-merge database DB1 policy streamingingestion '{"IsEnabled": false}'

.alter-merge table T1 policy streamingingestion '{"HintAllocatedRate": 1.5}'

删除策略Delete the policy

.delete policy streamingingestion 命令从数据库或表中删除流式引入策略。The .delete policy streamingingestion command deletes the streamingingestion policy from the database or table.

语法Syntax

.delete {database|table} <entity name> policy streamingingestion.delete {database|table} <entity name> policy streamingingestion

返回Returns

此命令删除表或数据库 streamingestion 策略对象,然后返回相应的 .show policy streamingingestion 命令的输出。The command deletes the table or database streamingingestion policy object and then returns the output of the corresponding .show policy streamingingestion command.

示例Examples

.delete database DB1 policy streamingingestion

.delete table T1 policy streamingingestion

流式引入策略对象Streaming ingestion policy object

在管理命令的输入和输出中,流式引入策略对象是 JSON 格式的字符串,其中包括以下属性。In input and output of management commands, streaming ingestion policy object is a JSON-formatted string that includes the following properties.

属性Property 类型Type 说明Description 必需/可选Required/Optional
IsEnabledIsEnabled bool 实体是否启用了流式引入Is streaming ingestion enabled for the entity 必须Required
HintAllocatedRateHintAllocatedRate double 数据流入量的估计速率(Gb/小时)Estimated rate of data ingresses in Gb/hour 可选Optional