Database view for Kafka Stream

David Casper
Tera Guru

I'm looking to create a DB view (materialized view) for a Kafka stream. The requirements are basic. They need to see 2-3 fields from about 11 different CI tables. Fields being 'name' and 'company'. No joins are necessary.

 

Issue I'm running into is when I add each table without joins, no results show. If I just have one table listed and only exposing the 'name' and 'company' fields it works. 

How can I get this to work correct? The other thing I tried is matching the company field from each CI table to the company on the company table. That times out when I 'Try it'

4 REPLIES 4

AshishKM
Kilo Patron
Kilo Patron

Hi @David Casper , 

Please check if all 11 CI tables are child table of cmdb_ci table then you don't need to create view.

 

The Company column in cmdb_ci table ( and child tables ) is reference to Company [ core_company ] table , so you dont need to match. So every CI has company name which is already available in Company table. 

 

-Thanks,
AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

The tables are all child tables, but we still need a view. As I mentioned in the post the goal of this is to create a materialized view in SNOW. We need a table that stores ONLY the required fields (meta data) to increase the efficiently of the kafka stream.

I don't think that DB view in ServiceNow are materialized ( i hear this word after long time, it recall my previous project). 

Instead you can create a custome table and insert the data ( and metadata ) for Kafka stream. 

 

Let me know if you found some article or docs which states that view in servicenow are materialized ( or can be configure as materialized ) 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

I'm still learning on my end as well. Have a case open with SNOW to try and get their input. Unfortunately, I'm not finding a lot of info about it.