Search in sources :

Example 1 with TransformDefinition

use of alluxio.table.common.transform.TransformDefinition in project alluxio by Alluxio.

the class AlluxioCatalogTest method getTransformPlanTransformedLayout.

@Test
public void getTransformPlanTransformedLayout() throws Exception {
    String dbName = "testdb";
    TestDatabase.genTable(1, 1, false);
    mCatalog.attachDatabase(NoopJournalContext.INSTANCE, TestUdbFactory.TYPE, "connect_URI", TestDatabase.TEST_UDB_NAME, dbName, Collections.emptyMap(), false);
    String tableName = TestDatabase.getTableName(0);
    ServerConfiguration.set(PropertyKey.MASTER_HOSTNAME, "localhost");
    final TransformDefinition transformDefinition = TransformDefinition.parse("file.count.max=100;file.parquet.compression=uncompressed");
    List<TransformPlan> plans = mCatalog.getTransformPlan(dbName, tableName, transformDefinition);
    assertEquals(1, plans.size());
    alluxio.job.plan.transform.PartitionInfo transformedPartitionInfo = TransformActionUtils.generatePartitionInfo(plans.get(0).getTransformedLayout());
    assertEquals("uncompressed", transformedPartitionInfo.getSerdeProperties().get("file.parquet.compression"));
}
Also used : TransformDefinition(alluxio.table.common.transform.TransformDefinition) TransformPlan(alluxio.table.common.transform.TransformPlan) Test(org.junit.Test)

Example 2 with TransformDefinition

use of alluxio.table.common.transform.TransformDefinition in project alluxio by Alluxio.

the class CompactActionTest method parse.

public CompactAction parse(String definition) {
    TransformDefinition transformDefinition = TransformDefinition.parse(definition);
    final List<TransformAction> actions = transformDefinition.getActions();
    assertEquals(1, actions.size());
    final TransformAction action = actions.get(0);
    assertEquals(CompactAction.class, action.getClass());
    return (CompactAction) action;
}
Also used : TransformDefinition(alluxio.table.common.transform.TransformDefinition)

Aggregations

TransformDefinition (alluxio.table.common.transform.TransformDefinition)2 TransformPlan (alluxio.table.common.transform.TransformPlan)1 Test (org.junit.Test)1