Examples of Schema


Examples of org.apache.hadoop.zebra.types.Schema

            + "; found in file: " + version);
      }
      comparator = WritableUtils.readString(in);
      String logicalStr = WritableUtils.readString(in);
      try {
        logical = new Schema(logicalStr);
      }
      catch (Exception e) {
        ;
        throw new IOException("Schema build failed :" + e.getMessage());
      }
View Full Code Here

Examples of org.apache.hivemind.schema.Schema

        List l = md.getConfigurationPoints();
        assertEquals(1, l.size());
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) l.get(0);

        Schema schema = cpd.getContributionsSchema();

        assertNotNull(schema.getLocation());

        l = schema.getElementModel();
        assertEquals(2, l.size());

        ElementModel em = (ElementModel) l.get(0);

        assertEquals("foo1", em.getElementName());
View Full Code Here

Examples of org.apache.kafka.common.protocol.types.Schema

    private Schema schema;
    private Struct struct;

    @Before
    public void setup() {
        this.schema = new Schema(new Field("int8", Type.INT8),
                                 new Field("int16", Type.INT16),
                                 new Field("int32", Type.INT32),
                                 new Field("int64", Type.INT64),
                                 new Field("string", Type.STRING),
                                 new Field("bytes", Type.BYTES),
                                 new Field("array", new ArrayOf(Type.INT32)),
                                 new Field("struct", new Schema(new Field("field", Type.INT32))));
        this.struct = new Struct(this.schema).set("int8", (byte) 1)
                                             .set("int16", (short) 1)
                                             .set("int32", (int) 1)
                                             .set("int64", (long) 1)
                                             .set("string", "1")
View Full Code Here

Examples of org.apache.lenya.xml.Schema

        }
    }

    protected void validate(Document xml) throws Exception {
        ResourceType resourceType = getSourceDocument().getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xml, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here

Examples of org.apache.metamodel.schema.Schema

            "/dependencies/dependency/version",
            "/dependencies/dependency/scope" });
    DataContext dc = new XmlSaxDataContext(new File(
        "src/test/resources/xml_input_flatten_tables.xml"), tableDef);

    final Schema schema = dc.getDefaultSchema();
    assertEquals("Schema[name=/dependencies]", schema.toString());
    assertEquals("[/dependency]", Arrays.toString(schema.getTableNames()));

    final Table table = schema.getTableByName("/dependency");
    assertEquals("[row_id, /artifactId, /groupId, /version, /scope]",
        Arrays.toString(table.getColumnNames()));

    // perform a regular query
    DataSet ds = dc.query().from(table).select(table.getColumns())
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.Schema

public class SalesOrderProcessingExtension implements JPAEdmExtension {

  @Override
  public void extendJPAEdmSchema(final JPAEdmSchemaView view) {
    Schema edmSchema = view.getEdmSchema();
    edmSchema.getComplexTypes().add(getComplexType());
  }
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Schema

            schemaName = Schemas.getNewTableSchema((JDBCConfiguration)
                repos.getConfiguration());

        // if no given and adapting or defaulting missing info, use template
        SchemaGroup group = repos.getSchemaGroup();
        Schema schema = null;
        if (given == null) {
            schema = group.getSchema(schemaName);
            if (schema == null)
                schema = group.addSchema(schemaName);
            given = def.get(schema);
        }

        String fullName;
        int dotIdx = given.lastIndexOf('.');
        if (dotIdx == -1)
            fullName = (schemaName == null) ? given : schemaName + "." + given;
        else {
            fullName = given;
            schema = null;
            schemaName = given.substring(0, dotIdx);
            given = given.substring(dotIdx + 1);
        }

        // look for named table using full name and findTable, which allows
        // the dynamic schema factory to create the table if needed
        Table table = group.findTable(fullName);
        if (table != null)
            return table;
        if (!adapt)
            throw new MetaDataException(_loc.get("bad-table", given, context));

        // named table doesn't exist; create it
        if (schema == null) {
            schema = group.getSchema(schemaName);
            if (schema == null)
                schema = group.addSchema(schemaName);
        }
        table = schema.getTable(given);
        if (table == null)
            table = schema.addTable(given);
        return table;
    }
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.schema.Schema

        assertNotNull(Utils.getSchemaFromString(Utils.getSchemaFromString("name:bytearray,links:{(missing:chararray)}").toString()));
    }

    @Test
    public void testSchemaSerializationPlusBase64() throws Exception {
        Schema schemaFromString = Utils.getSchemaFromString("name:bytearray,links:{(missing:chararray)}");
        Schema schemaSaved = IOUtils.deserializeFromBase64(IOUtils.serializeToBase64(schemaFromString));
        assertEquals(schemaFromString.toString(), schemaSaved.toString());
    }
View Full Code Here

Examples of org.apache.s4.schema.Schema

        long eventTime = -1;
        String streamName = eventWrapper.getStreamName();
        String fieldName = eventClockStreamsMap.get(streamName);
        if (fieldName != null) {
            Object event = eventWrapper.getEvent();
            Schema schema = schemaContainer.getSchema(event.getClass());
            Property property = schema.getProperties().get(fieldName);
            if (property != null
                    && (property.getType().equals(Long.TYPE) || property
                            .getType().equals(Long.class))) {
                try {
                    eventTime = (Long) property.getGetterMethod().invoke(event);
View Full Code Here

Examples of org.apache.sqoop.schema.Schema

  public static Schema restoreSchemna(JSONObject jsonObject) {
    String name = (String)jsonObject.get(NAME);
    String note = (String)jsonObject.get(NOTE);
    java.util.Date date = new java.util.Date((Long)jsonObject.get(CREATION_DATE));

    Schema schema = new Schema(name)
      .setNote(note)
      .setCreationDate(date);

    JSONArray columnsArray = (JSONArray)jsonObject.get(COLUMNS);
    for (Object obj : columnsArray) {
      schema.addColumn(restoreColumn((JSONObject)obj));
    }

    return schema;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.