Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdalbertMemSQL committed Oct 17, 2024
1 parent 8e6a99e commit 813b6e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static SingleStoreConfiguration getConfig(String table) {

@BeforeAll
public static void init() throws Exception {
String url = String.format("jdbc:singlestore://%s:%s/%s", host, port, database);
String url = String.format("jdbc:singlestore://%s:%s", host, port);
Properties connectionProps = new Properties();
connectionProps.put("user", user);
connectionProps.put("password", password);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,13 +894,20 @@ public void observeVectorJson() throws Exception {

try {
try (Statement stmt = conn.getConnection().createStatement()) {
stmt.execute("SET GLOBAL vector_type_project_format = 'JSON'");
stmt.execute("DROP TABLE IF EXISTS observeVectorJson");
stmt.execute("CREATE TABLE observeVectorJson(a VECTOR(2, I32))");
stmt.execute("INSERT INTO observeVectorJson VALUES ('[1, 2]')");
}

SchemaList schemaList = conn.getSchema();
final Exception[] observeException = new Exception[1];
SingleStoreConnection observeConn = new SingleStoreConnection(conf);
List<Record> records = new ArrayList<>();

try (Statement stmt = observeConn.getConnection().createStatement()) {
stmt.execute("SET vector_type_project_format = 'JSON'");
}

SchemaList schemaList = observeConn.getSchema();
List<Schema> schemas = schemaList.getSchemasList();
assertEquals(1, schemas.size());

Expand All @@ -920,10 +927,6 @@ public void observeVectorJson() throws Exception {
assertEquals("a", column.getName());
assertEquals(DataType.JSON, column.getType());

final Exception[] observeException = new Exception[1];
SingleStoreConnection observeConn = new SingleStoreConnection(conf);
List<Record> records = new ArrayList<>();

Thread t = new Thread(() -> {
try {
observeConn.observe(new State(8), (operation, partition, offset, row) -> {
Expand Down

0 comments on commit 813b6e2

Please sign in to comment.