简体   繁体   English

从Azure Comos DB查询并使用Data Factory保存到Azure表存储

[英]Query from Azure Comos DB and save to Azure Table Storage using Data Factory

I want to save C._ts+C.ttl as one entity in my Azure Table Storage. 我想将C._ts + C.ttl保存为Azure表存储中的一个实体 I do the following query in my Copy Activity: 我在“复制活动”中执行以下查询:

"typeProperties": {
        "source": {
            "type": "DocumentDbCollectionSource",
            "query": {
                "value": "@concat('SELECT (C.ts+C.ttl) FROM C WHERE (C.ttl+C._ts)<= ', string(pipeline().parameters.bufferdays))",
                "type": "Expression"
            },
            "nestingSeparator": "."
        },

I dont want to copy all the fields from my source ie CosmosDB to my sink ie Table Storage. 希望所有的领域从我的来源即CosmosDB复制到我的水槽即表存储。 I just want to store the result of this query as one value . 我只想将此查询的结果存储为一个值 How can I do that? 我怎样才能做到这一点?

According to my test, I presume the null value you queried because of that the collection level ttl affects each document , but will not generate ttl property within document. 根据我的测试,我假设您查询的null值是因为收集级别ttl影响每个文档,但不会在文档内生成ttl属性。

So when you execute SELECT c.ttl,c._ts FROM c , just get below result. 因此,当您执行SELECT c.ttl,c._ts FROM c ,只会得到以下结果。

在此处输入图片说明

Document level ttl is not defined, just follow collection level ttl . 未定义文档级别ttl ,仅遵循集合级别ttl

在此处输入图片说明

You need to bulk add ttl property into per document so that you could transfer _ts+ttl caculator results. 您需要将ttl属性批量添加到每个文档中,以便可以传输_ts+ttl caculator结果。

Your Copy Activity settings looks good , just add an alias in SQL, or set the name of the field via column mapping. 您的“复制活动”设置看起来不错,只需在SQL中添加别名,或通过列映射设置字段名称。

Hope it helps you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Azure Data Factory将文件内容从Azure存储复制到Azure SQL Db - Copying file contents from Azure Storage to Azure SQL Db using Azure Data Factory 将 Azure blob 存储文件名保存到 Sql 表 - Azure 数据工厂 - Save Azure blob storage filename to Sql table - Azure Data Factory Azure数据工厂:将数据从表存储移动到SQL Azure - Azure Data Factory: Moving data from Table Storage to SQL Azure Azure 数据工厂表存储转换错误 - Azure Data Factory Table Storage Conversion Error 在Azure数据工厂中动态选择存储表 - Dynamic selection of storage table in azure data factory 如何为昨天的记录指定 Azure 数据工厂源(Azure 表存储)的查询 - How to specify query for Azure Data Factory Source (Azure Table Storage) for yesterday's records Azure 数据工厂 - 查找活动:使用 In 运算符过滤 Azure 表存储查询 - Azure Data Factory - Lookup Activity: Filtering Azure Table Storage query with In operator 使用Azure Data Factory将Azure cosmos db中的json数据复制到Azure sql - Copy json data from Azure cosmos db to Azure sql using Azure Data Factory 更新 Azure 数据工厂中的 Azure 表存储字段 - Updating Azure Table Storage Field in Azure Data Factory 不从Azure数据工厂中的Azure表存储源加载所有列 - Not Loading all columns from Azure Table Storage Source in Azure Data Factory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM