Search in sources :

Example 6 with FileEndpoint

use of org.apache.apex.malhar.sql.table.FileEndpoint in project apex-malhar by apache.

the class SQLApplicationWithAPI method populateDAG.

@Override
public void populateDAG(DAG dag, Configuration conf) {
    // Source definition
    String schemaInName = conf.get("csvSchemaInName");
    String schemaIn = conf.get("csvSchemaIn");
    String sourceFile = conf.get("sourceFile");
    SQLExecEnvironment.getEnvironment().registerTable(schemaInName, new FileEndpoint(sourceFile, new CSVMessageFormat(schemaIn))).executeSQL(dag, conf.get("sql"));
}
Also used : CSVMessageFormat(org.apache.apex.malhar.sql.table.CSVMessageFormat) FileEndpoint(org.apache.apex.malhar.sql.table.FileEndpoint)

Aggregations

CSVMessageFormat (org.apache.apex.malhar.sql.table.CSVMessageFormat)6 FileEndpoint (org.apache.apex.malhar.sql.table.FileEndpoint)6 KafkaEndpoint (org.apache.apex.malhar.sql.table.KafkaEndpoint)3 LogicalPlan (com.datatorrent.stram.plan.logical.LogicalPlan)2 Endpoint (org.apache.apex.malhar.sql.table.Endpoint)2 StreamEndpoint (org.apache.apex.malhar.sql.table.StreamEndpoint)2 Test (org.junit.Test)2 CsvParser (org.apache.apex.malhar.contrib.parser.CsvParser)1 KafkaSinglePortInputOperator (org.apache.apex.malhar.kafka.KafkaSinglePortInputOperator)1 SQLExecEnvironment (org.apache.apex.malhar.sql.SQLExecEnvironment)1 MessageFormat (org.apache.apex.malhar.sql.table.MessageFormat)1