Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ISSUE#1641 Fix !show et; error in distribute mode #1642

Merged
merged 1 commit into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";