0
我想用艾斯波處理以下JSON消息:艾斯波訪問陣列事件propertie
{
"firstname":"John",
"lastname":"Do",
"address":[{"street":"Maplestreet","number":100,"city":"New York"}]
}
當架構的樣子:
create schema Address (street string, number int, city string);
create schema Person (firstname string, lastname string, address Address[]);
什麼是內選擇事件屬性的正確方法數組? 我曾嘗試過:
select address[0].street from Person
select address.street from Person
select address[0] from Person
select {address.street} as street from Person
但我得到空值。模式是錯誤的還是我錯過了什麼?
編輯:當我嘗試:
select * from Person
我得到的初始JSON作爲結果
EDIT2: 這是我的JRuby代碼:
address_type = {
"street" => "string",
"number" => "int",
"city" => "string"
}
epService.getEPAdministrator.getConfiguration.addEventType("Address", address_type)
person_type = {
"firstname" => "string",
"lastname" => "string",
"address" => "Address[]"
"
}
epService.getEPAdministrator.getConfiguration.addEventType("Person", person_type)
謝謝。但是當我使用select * from Person時,我會得到所有正確的輸出。這是否意味着事件對象正在以正確的方式填充?看來我不能選擇一個單獨的嵌套屬性。 – user5526698
發送到引擎的對象的類型是什麼? – goodie
好問題。我對此有點新。我用我正在使用的Jruby代碼更新了我的問題。我認爲這是一個哈希對象類型的權利? – user5526698