The ADM parser inside Asterix is composed by two different components:
These two classes belong to the package:
org.apache.asterix.runtime.operators.file
The Parser is loaded through a factory (AdmSchemafullRecordParserFactory) by
org.apache.asterix.external.dataset.adapter.FileSystemBasedAdapter extends AbstractDatasourceAdapter
The ADM format allows two different kinds of datatype:
A primitive datatype allows to write the actual value of the field without extra markup:
{ name : "Diego", age : 23 }
while the datatypes with constructor require to specify first the type of the value and then a string with the serialized value
{ center : point3d("P2.1,3,8.5") }
In order to add a new datatype the steps are:
To add new datatype or change the tokens definition you have to change ONLY the file adm.grammar located in asterix-runtime/src/main/resources/adm.grammar The lexer will be generated from that definition file during each maven building.
The maven configuration in located in asterix-runtime/pom.xml
Author: Diego Giorgini - diegogiorgini@gmail.com
6 December 2012