Examples of SchemaBuilder


Examples of org.apache.drill.exec.record.SchemaBuilder

    public void initializeBatch() {
      isLast = false;
      vectorContainer.clear();

      SchemaBuilder bldr = BatchSchema.newBuilder().setSelectionVectorMode(BatchSchema.SelectionVectorMode.NONE);
      for (VectorWrapper<?> v : incoming) {

        // add field to the output schema
        bldr.addField(v.getField());

        // allocate a new value vector
        ValueVector outgoingVector = TypeHelper.getNewVector(v.getField(), allocator);
        outgoingVector.allocateNew();
        vectorContainer.add(outgoingVector);
      }
      outSchema = bldr.build();
      doSetup(incoming, vectorContainer);
    }
View Full Code Here

Examples of org.apache.drill.exec.record.SchemaBuilder

        context.fail(new SchemaChangeException("Incoming batches for merging receiver have diffferent schemas!"));
        return IterOutcome.STOP;
      }

      // create the outgoing schema and vector container, and allocate the initial batch
      SchemaBuilder bldr = BatchSchema.newBuilder().setSelectionVectorMode(BatchSchema.SelectionVectorMode.NONE);
      int vectorCount = 0;
      for (VectorWrapper<?> v : batchLoaders[0]) {

        // add field to the output schema
        bldr.addField(v.getField());

        // allocate a new value vector
        ValueVector outgoingVector = outgoingContainer.addOrGet(v.getField());
        outgoingVector.allocateNew();
        ++vectorCount;
      }


      schema = bldr.build();
      if (schema != null && !schema.equals(schema)) {
        // TODO: handle case where one or more batches implicitly indicate schema change
        logger.debug("Initial state has incoming batches with different schemas");
      }
      outgoingContainer.buildSchema(BatchSchema.SelectionVectorMode.NONE);
View Full Code Here

Examples of org.apache.metamodel.schema.builder.SchemaBuilder

        final JsonDataContext dc = new JsonDataContext(new File("src/test/resources/documents_on_every_line.json"));
        runParseabilityTest(dc);
    }

    public void testUseAnotherSchemaBuilder() throws Exception {
        final SchemaBuilder schemaBuilder = new SingleMapColumnSchemaBuilder("sch", "tbl", "cl");
        final JsonDataContext dc = new JsonDataContext(new FileResource(
                "src/test/resources/documents_on_every_line.json"), schemaBuilder);

        final Table table = dc.getDefaultSchema().getTable(0);
        assertEquals("tbl", table.getName());
View Full Code Here

Examples of org.kohsuke.rngom.ast.builder.SchemaBuilder

        // the error handler passed to CheckingSchemaBuilder will receive additional
        // errors found during the RELAX NG restrictions check.
        // typically you'd want to pass in the same error handler,
        // as there's really no distinction between those two kinds of errors.
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(), eh);
        try {
            // run the parser
            DGrammarPattern grammar = (DGrammarPattern) p.parse(sb);
            OutputStream out = new FileOutputStream(args[1]);
            XMLOutputFactory factory = XMLOutputFactory.newInstance();
View Full Code Here

Examples of org.kohsuke.rngom.ast.builder.SchemaBuilder

    /**
     * Common part between the XML syntax and the compact syntax.
     */
    private Model loadRELAXNG(Parseable p) {
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

        try {
            DPattern out = (DPattern)p.parse(sb);
            return RELAXNGCompiler.build(out,codeModel,opt);
        } catch (IllegalSchemaException e) {
View Full Code Here

Examples of org.kohsuke.rngom.ast.builder.SchemaBuilder

        // the error handler passed to CheckingSchemaBuilder will receive additional
        // errors found during the RELAX NG restrictions check.
        // typically you'd want to pass in the same error handler,
        // as there's really no distinction between those two kinds of errors.
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),eh);
        try {
            // run the parser
            p.parse(sb);
        } catch( BuildException e ) {
            // I found that Crimson doesn't show the proper stack trace
View Full Code Here

Examples of org.kohsuke.rngom.ast.builder.SchemaBuilder

        // the error handler passed to CheckingSchemaBuilder will receive additional
        // errors found during the RELAX NG restrictions check.
        // typically you'd want to pass in the same error handler,
        // as there's really no distinction between those two kinds of errors.
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(), eh);
        try {
            // run the parser
            DGrammarPattern grammar = (DGrammarPattern) p.parse(sb);
            OutputStream out = new FileOutputStream(args[1]);
            XMLOutputFactory factory = XMLOutputFactory.newInstance();
View Full Code Here

Examples of org.kohsuke.rngom.ast.builder.SchemaBuilder

    /**
     * Common part between the XML syntax and the compact syntax.
     */
    private Model loadRELAXNG(Parseable p) {
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

        try {
            DPattern out = (DPattern)p.parse(sb);
            return RELAXNGCompiler.build(out,codeModel,opt);
        } catch (IllegalSchemaException e) {
View Full Code Here

Examples of org.kohsuke.rngom.ast.builder.SchemaBuilder

    /**
     * Common part between the XML syntax and the compact syntax.
     */
    private Model loadRELAXNG(Parseable p) {
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

        try {
            DPattern out = (DPattern)p.parse(sb);
            return RELAXNGCompiler.build(out,codeModel,opt);
        } catch (IllegalSchemaException e) {
View Full Code Here

Examples of org.kohsuke.rngom.ast.builder.SchemaBuilder

        // the error handler passed to CheckingSchemaBuilder will receive additional
        // errors found during the RELAX NG restrictions check.
        // typically you'd want to pass in the same error handler,
        // as there's really no distinction between those two kinds of errors.
        SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),eh);
        try {
            // run the parser
            p.parse(sb);
        } catch( BuildException e ) {
            // I found that Crimson doesn't show the proper stack trace
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.