Search in sources :

Example 61 with Row

use of com.google.cloud.automl.v1beta1.Row in project molgenis-emx2 by molgenis.

the class EvaluateExpressionsTest method evaluateValidationExpressionTestFailure.

@Test
public void evaluateValidationExpressionTestFailure() {
    String expression = "invalid input";
    Row row = new Row();
    assertFalse(evaluateValidationExpression(expression, row));
}
Also used : Row(org.molgenis.emx2.Row) Test(org.junit.Test)

Example 62 with Row

use of com.google.cloud.automl.v1beta1.Row in project molgenis-emx2 by molgenis.

the class EvaluateExpressionsTest method evaluateValidationExpressionTestSuccessNumerical.

@Test
public void evaluateValidationExpressionTestSuccessNumerical() {
    String expression = "5 + 37";
    Row row = new Row();
    assertTrue(evaluateValidationExpression(expression, row));
}
Also used : Row(org.molgenis.emx2.Row) Test(org.junit.Test)

Example 63 with Row

use of com.google.cloud.automl.v1beta1.Row in project molgenis-emx2 by molgenis.

the class EvaluateExpressionsTest method evaluateValidationExpressionTestSuccessFunctionCall.

@Test
public void evaluateValidationExpressionTestSuccessFunctionCall() {
    String expression = "today()";
    Row row = new Row();
    assertTrue(evaluateValidationExpression(expression, row));
}
Also used : Row(org.molgenis.emx2.Row) Test(org.junit.Test)

Example 64 with Row

use of com.google.cloud.automl.v1beta1.Row in project molgenis-emx2 by molgenis.

the class EvaluateExpressionsTest method evaluateValidationExpressionTestSuccessLogical.

@Test
public void evaluateValidationExpressionTestSuccessLogical() {
    String expression = "false && true";
    Row row = new Row();
    assertTrue(evaluateValidationExpression(expression, row));
}
Also used : Row(org.molgenis.emx2.Row) Test(org.junit.Test)

Example 65 with Row

use of com.google.cloud.automl.v1beta1.Row in project molgenis-emx2 by molgenis.

the class Benchmark method testCopyInAndOut.

public void testCopyInAndOut() {
    Database database = TestDatabaseFactory.getTestDatabase();
    Schema schema = database.dropCreateSchema(Benchmark.class.getSimpleName());
    int aSize = 50;
    int bSize = 100000;
    Table a = schema.create(table("TableA").add(column("ID").setPkey()));
    List<String> values = new ArrayList<>();
    Table b = schema.create(table("TableB").add(column("ID").setPkey()).add(column("ref").setType(REF_ARRAY).setRefTable("TableA")));
    // Table c =
    // schema.create(
    // table("TableC")
    // .add(column("ID").setPkey())
    // .add(column("ref").setType(MREF).setRefTable("TableA")));
    StopWatch.start("benchmark started");
    List<Row> aRows = new ArrayList<>();
    for (int i = 0; i < aSize; i++) {
        aRows.add(new Row().set("ID", "row" + i));
        values.add("row" + i);
    }
    StopWatch.start("benchmark1");
    a.insert(aRows);
    StopWatch.print("inserted primary", aSize);
    aRows.clear();
    List<Row> bRows = new ArrayList<>();
    for (int i = 0; i < bSize; i++) {
        bRows.add(new Row().set("ID", "row" + i).set("ref", values));
    }
    StopWatch.start("benchmark2 started");
    b.insert(bRows);
    StopWatch.print("inserted ref_array", bSize);
    bRows.clear();
// List<Row> cRows = new ArrayList<>();
// for (int i = 0; i < bSize; i++) {
// cRows.add(new Row().set("ID", "row" + i).set("ref", values));
// }
// StopWatch.start("benchmark3 started");
// c.insert(cRows);
// StopWatch.print("inserted mref", bSize);
// cRows.clear();
// StopWatch.print("inserted mref", bSize);
// ref_array
}
Also used : Table(org.molgenis.emx2.Table) Schema(org.molgenis.emx2.Schema) Database(org.molgenis.emx2.Database) ArrayList(java.util.ArrayList) Row(org.molgenis.emx2.Row)

Aggregations

Test (org.junit.Test)68 Row (org.molgenis.emx2.Row)43 Row (com.google.bigtable.v2.Row)22 ArrayList (java.util.ArrayList)17 ByteString (com.google.protobuf.ByteString)14 Table (org.molgenis.emx2.Table)11 Function (com.google.common.base.Function)10 Row (org.hypertrace.entity.query.service.v1.Row)10 Map (java.util.Map)9 ResultSetChunk (org.hypertrace.entity.query.service.v1.ResultSetChunk)8 Schema (org.molgenis.emx2.Schema)8 Row (com.google.api.ads.admanager.axis.v202108.Row)6 Family (com.google.bigtable.v2.Family)6 List (java.util.List)6 ByteKey (org.apache.beam.sdk.io.range.ByteKey)6 Row (com.google.api.ads.admanager.axis.v202105.Row)5 Row (com.google.api.ads.admanager.axis.v202111.Row)5 Row (com.google.api.ads.admanager.axis.v202202.Row)5 Row (com.google.api.ads.admanager.axis.v202205.Row)5 Row (com.google.api.ads.admanager.jaxws.v202105.Row)5