Skip to content

Commit

Permalink
issue-1641 (byzer-org#1642)
Browse files Browse the repository at this point in the history
  • Loading branch information
allwefantasy authored Dec 30, 2021
1 parent b973a0a commit 7e4ce80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,17 @@ class ModelList(format: String, path: String, option: Map[String, String])(spark

override def explain: DataFrame = {

val items = MLMapping.getAllETNames
val rows = sparkSession.sparkContext.parallelize(items.toSeq.sorted, 1)
sparkSession.createDataFrame(rows.map { algName =>
val items = MLMapping.getAllETNames.toSeq.sorted.map{algName=>
val sqlAlg = ModelSelfExplain.findAlg(algName).get
Row.fromSeq(Seq(algName, sqlAlg.modelType.humanFriendlyName,
sqlAlg.coreCompatibility.map(f => f.coreVersion).mkString(","),
sqlAlg.doc.doc, sqlAlg.doc.docType.docType
)
)
},
}

val rows = sparkSession.sparkContext.parallelize(items, 1)
sparkSession.createDataFrame(rows,
StructType(Seq(
StructField(name = "name", dataType = StringType),
StructField(name = "algType", dataType = StringType),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--%comparator=tech.mlsql.it.IgnoreResultComparator

!show et;
!lastCommand named ets;
select * from ets where name="JsonExpandExt" as output;
!assert output ''' :name == "JsonExpandExt" ''' "output should be JsonExpandExt";

0 comments on commit 7e4ce80

Please sign in to comment.