[Developer] #570 show vector VPD effective SQL trace

This commit is contained in:
devmrko
2026-06-30 14:16:42 +09:00
parent cde5266a77
commit 188b398dcb
5 changed files with 148 additions and 3 deletions

View File

@@ -0,0 +1,26 @@
package com.cloudhandson.vpdbackoffice.service;
import static org.assertj.core.api.Assertions.assertThat;
import com.cloudhandson.vpdbackoffice.domain.protectedobject.ProtectedObject;
import org.junit.jupiter.api.Test;
class OrdsProbeServiceTest {
@Test
void buildsVectorEffectiveSqlWithVpdPredicateAndDistancePlaceholder() {
ProtectedObject object = new ProtectedObject(
5L, "ADMIN", "CB_VECTOR_SEARCH_DOCUMENTS", "cb-agent-vector/search", "Y");
String sql = OrdsProbeService.vectorEffectiveSql(
object, "INSTR(',' || UPPER(d.TECH_TAG) || ',', ',ORACLE_VPD,') > 0");
assertThat(sql)
.contains("FROM ADMIN.CB_VECTOR_SEARCH_DOCUMENTS d")
.contains("VECTOR_DISTANCE(d.embedding, TO_VECTOR(:embedding), COSINE)")
.contains("WHERE d.embedding IS NOT NULL AND (INSTR")
.contains("ORDER BY score")
.contains("ROWNUM <= LEAST(GREATEST(NVL(:row_limit, 10), 1), 100)")
.doesNotContain("Bearer", "0.10", "0.20");
}
}