You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by 潘明文 <pa...@163.com> on 2022/02/15 03:30:31 UTC

Position for 'cf.content' not found in row

HI,
   Could you help me the below issue,Thanks!
  This is my source code:
SparkConf sparkConf = new SparkConf(true);
sparkConf.setAppName(ESTest.class.getName());

SparkSession spark = null;
sparkConf.setMaster("local[*]");
sparkConf.set("spark.cleaner.ttl", "3600");
sparkConf.set("es.nodes", "10.12.65.10");
sparkConf.set("es.port", "9200");
sparkConf.set("es.nodes.discovery", "false");
sparkConf.set("es.nodes.wan.only", "true");
spark = SparkSession.builder().config(sparkConf).getOrCreate();

Dataset<Row> df1 = JavaEsSparkSQL.esDF(spark, "index");
df1.printSchema();
df1.show();


elasticsearch index:


When run the job has below issue:
Caused by: org.elasticsearch.hadoop.EsHadoopIllegalStateException:Position for 'cf.content' not found in row; typically this is caused by a mapping inconsistency
at org.elasticsearch.spark.sql.RowValueReader$class.addToBuffer(RowValueReader.scala:60)
at org.elasticsearch.spark.sql.ScalaRowValueReader.addToBuffer(ScalaEsRowValueReader.scala:32)
at org.elasticsearch.spark.sql.ScalaRowValueReader.addToMap(ScalaEsRowValueReader.scala:118)
at org.elasticsearch.hadoop.serialization.ScrollReader.map(ScrollReader.java:1047)
at org.elasticsearch.hadoop.serialization.ScrollReader.read(ScrollReader.java:889)
at org.elasticsearch.hadoop.serialization.ScrollReader.readHitAsMap(ScrollReader.java:602)
at org.elasticsearch.hadoop.serialization.ScrollReader.readHit(ScrollReader.java:426)
... 34 more




Thanks.