Package org.kitesdk.data

Examples of org.kitesdk.data.ColumnMapping


  @Test
  public void testBasic() {
    DatasetDescriptor desc = provider.create("default", tableName + ".TestEntity",
        new DatasetDescriptor.Builder().schemaLiteral(testEntity).build());
    ColumnMapping columnMapping = desc.getColumnMapping();
    PartitionStrategy partStrat = desc.getPartitionStrategy();
    assertEquals(9, columnMapping.getFieldMappings().size());
    assertEquals(2, partStrat.getFieldPartitioners().size());
  }
View Full Code Here


  public void testBasic() throws Exception {
    command.partitions = Lists.newArrayList(
        "email:key", "username:u", "created_at:u");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .key("email")
        .column("username", "u", "username")
        .counter("created_at", "u", "created_at")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

  public void testQualifier() throws Exception {
    command.partitions = Lists.newArrayList(
        "email:key", "username:u:n");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .key("email")
        .column("username", "u", "n")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

  public void testVersion() throws Exception {
    command.partitions = Lists.newArrayList(
        "email:key", "username:u:n", "version:version");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .version("version")
        .key("email")
        .column("username", "u", "n")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

    // longs and ints are mapped
    command.partitions = Lists.newArrayList(
        "email:key", "version:version", "username:u", "created_at:u");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .version("version")
        .key("email")
        .column("username", "u", "username")
        .column("created_at", "u", "created_at")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

  public void testCounter() throws Exception {
    command.partitions = Lists.newArrayList(
        "email:key", "username:u", "created_at:u");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .key("email")
        .column("username", "u", "username")
        .counter("created_at", "u", "created_at")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

  public void testCounterWithQualifier() throws Exception {
    command.partitions = Lists.newArrayList(
        "email:key", "username:u", "created_at:u:ts");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .key("email")
        .column("username", "u", "username")
        .counter("created_at", "u", "ts")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

  public void testKAC() throws Exception {
    command.partitions = Lists.newArrayList(
        "email:key", "username:u", "preferences:prefs");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .key("email")
        .column("username", "u", "username")
        .keyAsColumn("preferences", "prefs")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

  public void testKACWithPrefix() throws Exception {
    command.partitions = Lists.newArrayList(
        "email:key", "username:u", "preferences:prefs:p_");
    command.run();

    ColumnMapping mapping = new ColumnMapping.Builder()
        .key("email")
        .column("username", "u", "username")
        .keyAsColumn("preferences", "prefs", "p_")
        .build();
    verify(console).info(mapping.toString(true));
    verifyNoMoreInteractions(console);
  }
View Full Code Here

import org.kitesdk.data.ValidationException;

public class TestColumnMappingParser {

  public static void checkParser(ColumnMapping expected, String json) {
    ColumnMapping parsed = ColumnMappingParser.parse(json);
    Assert.assertEquals(expected, parsed);

    parsed = ColumnMappingParser.parse(expected.toString());
    Assert.assertEquals("Should reparse properly", expected, parsed);
  }
View Full Code Here

TOP

Related Classes of org.kitesdk.data.ColumnMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.