Код: Выделить всё
error: cannot find symbol
import org.apache.spark.sql.execution.streaming.MemoryStream;
error: cannot find symbol
MemoryStream inputStream =
Код: Выделить всё
SQLContext spark = TestSparkUtils.getSparkSession().sqlContext();
MemoryStream inputStream =
new MemoryStream(
1,
TestSparkUtils.getSparkSession().sqlContext(),
Option.apply(1),
ExpressionEncoder.apply(TRANSFORM_SCHEMA));
Dataset df =
inputStream
.toDS()
.toDF(
"kafkaKey",
"t_uid",
"timestamp",
"resource_name",
"metrics",
"attributes");
Seq collection = JavaConverters.asScalaIteratorConverter(rows.iterator()).asScala().toSeq();
inputStream.addData(collection);