Database view for Kafka Stream

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 01:33 PM - edited 04-10-2024 02:00 PM
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'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 06:34 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 05:55 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 06:27 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 11:13 AM
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.