MINOR: Fix ES Req for Views (#19595)

This commit is contained in:
Mayur Singal 2025-01-29 20:07:27 +05:30 committed by ulixius9
parent 0bbe147786
commit 459e1daa69
2 changed files with 53 additions and 11 deletions

View File

@ -402,19 +402,51 @@ class ESMixin(Generic[T]):
"query": {
"bool": {
"must": [
{"term": {"service.name.keyword": service_name}},
{
"term": {
"tableType": [
TableType.View.value,
TableType.MaterializedView.value,
TableType.SecureView.value,
TableType.Dynamic.value,
"bool": {
"should": [
{"term": {"service.name.keyword": service_name}}
]
}
},
{"term": {"deleted": False}},
{"exists": {"field": "schemaDefinition"}},
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"term": {
"tableType": TableType.View.value
}
},
{
"term": {
"tableType": TableType.MaterializedView.value
}
},
{
"term": {
"tableType": TableType.SecureView.value
}
},
{
"term": {
"tableType": TableType.Dynamic.value
}
},
]
}
}
]
}
},
{"bool": {"should": [{"term": {"deleted": False}}]}},
{
"bool": {
"should": [{"exists": {"field": "schemaDefinition"}}]
}
},
]
}
}

View File

@ -244,8 +244,18 @@ class StoredProcedureLineageMixin(ABC):
"query": {
"bool": {
"must": [
{"term": {"service.name.keyword": self.service_name}},
{"term": {"deleted": False}},
{
"bool": {
"should": [
{
"term": {
"service.name.keyword": self.service_name
}
}
]
}
},
{"bool": {"should": [{"term": {"deleted": False}}]}},
]
}
}