use of org.apache.spark.sql.hive.HiveContext in project camel by apache.
the class HiveSparkProducer method process.
@Override
public void process(Exchange exchange) throws Exception {
HiveContext hiveContext = resolveHiveContext();
String sql = exchange.getIn().getBody(String.class);
DataFrame resultFrame = hiveContext.sql(sql);
exchange.getIn().setBody(getEndpoint().isCollect() ? resultFrame.collectAsList() : resultFrame.count());
}
Aggregations