Skip to content

Commit

Permalink
Merge pull request cdapio#15484 from cdapio/encoder_access_fix
Browse files Browse the repository at this point in the history
[CDAP-20915] Use exprEnc() instead of encoder() as latter is only available in Spark 3
  • Loading branch information
tivv authored Dec 5, 2023
2 parents 1be1fa0 + 98aed90 commit 9ebd1b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public DataframeCollection(Schema schema, Dataset<Row> dataframe, JavaSparkExecu
super(sec, jsc, sqlContext, datasetContext, sinkFactory, functionCacheFactory);
this.schema = Objects.requireNonNull(schema);
this.dataframe = dataframe;
if (!Row.class.isAssignableFrom(dataframe.encoder().clsTag().runtimeClass())) {
if (!Row.class.isAssignableFrom(dataframe.exprEnc().clsTag().runtimeClass())) {
throw new IllegalArgumentException(
"Dataframe collection received dataset of " + dataframe.encoder().clsTag()
"Dataframe collection received dataset of " + dataframe.exprEnc().clsTag()
.runtimeClass());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ private OpaqueDatasetCollection(Dataset<T> dataset,
FunctionCache.Factory functionCacheFactory) {
super(sec, jsc, sqlContext, datasetContext, sinkFactory, functionCacheFactory);
this.dataset = dataset;
if (Row.class.isAssignableFrom(dataset.encoder().clsTag().runtimeClass())) {
if (Row.class.isAssignableFrom(dataset.exprEnc().clsTag().runtimeClass())) {
throw new IllegalArgumentException(
"Opaque collection received dataset of Row (" + dataset.encoder().clsTag()
"Opaque collection received dataset of Row (" + dataset.exprEnc().clsTag()
.runtimeClass() + "). DataframeCollection should be used.");
}
}
Expand Down

0 comments on commit 9ebd1b7

Please sign in to comment.