GetRecordPropertyValue

✅ Azure 流分析 ✅ 构造事件流

返回与指定属性关联的记录值。

语法

GetRecordPropertyValue ( record_expression, string_expression )  

论据

record_expression

要计算为源记录的记录表达式。 record_expression可以是记录类型的列,也可以是另一个函数调用的结果。

string_expression

要计算为记录属性名称的字符串表达式。

返回类型

返回类型由记录属性类型确定,可以是 任何受支持的类型

备注

字符串表达式中的记录属性名称需要遵循使用的命名约定。

若要访问使用需要转义的字符的字段或属性,可以使用双引号: SELECT "[my][Field]" AS myField ...GetRecordPropertyValue(input.SensorReadings, "[my][Field]")

例子

在此代码示例中,“thresholds”是在输入选项卡上定义的引用数据名称。

SELECT   
    input.DeviceID,  
    thresholds.SensorName  
FROM input  
JOIN thresholds   
ON  
    input.DeviceId = thresholds.DeviceId  
WHERE  
    GetRecordPropertyValue(input.SensorReadings, thresholds.SensorName) > thresholds.Value  

请注意,可以使用点表示法访问记录属性字段。

SELECT   
    recordColumn.NestedFieldName1.NestedFieldName2  
FROM input  
  

另请参阅