Search in sources :

Example 1 with ADGenDmlTranslator

use of org.apache.asterix.tools.translator.ADGenDmlTranslator in project asterixdb by apache.

the class AdmDataGen method init.

public void init() throws IOException, ParseException, AsterixException, ACIDException, MetadataException, AlgebricksException {
    FileReader aql = new FileReader(schemaFile);
    IParser parser = parserFactory.createParser(aql);
    List<Statement> statements = parser.parse();
    aql.close();
    // TODO: Need to fix how to use transactions here.
    MetadataTransactionContext mdTxnCtx = new MetadataTransactionContext(new JobId(-1));
    ADGenDmlTranslator dmlt = new ADGenDmlTranslator(mdTxnCtx, statements);
    dmlt.translate();
    typeMap = dmlt.getTypeMap();
    typeAnnotMap = dmlt.getTypeDataGenMap();
    dgCtx = new DataGeneratorContext();
}
Also used : Statement(org.apache.asterix.lang.common.base.Statement) ADGenDmlTranslator(org.apache.asterix.tools.translator.ADGenDmlTranslator) MetadataTransactionContext(org.apache.asterix.metadata.MetadataTransactionContext) FileReader(java.io.FileReader) JobId(org.apache.asterix.common.transactions.JobId) IParser(org.apache.asterix.lang.common.base.IParser)

Aggregations

FileReader (java.io.FileReader)1 JobId (org.apache.asterix.common.transactions.JobId)1 IParser (org.apache.asterix.lang.common.base.IParser)1 Statement (org.apache.asterix.lang.common.base.Statement)1 MetadataTransactionContext (org.apache.asterix.metadata.MetadataTransactionContext)1 ADGenDmlTranslator (org.apache.asterix.tools.translator.ADGenDmlTranslator)1