SteNicholas commented on code in PR #3230:
URL: https://github.com/apache/incubator-kyuubi/pull/3230#discussion_r945436302
##########
externals/kyuubi-flink-sql-engine/src/main/scala/org/apache/kyuubi/engine/flink/operation/ExecuteStatement.scala:
##########
@@ -116,17 +118,16 @@ class ExecuteStatement(
(1 to result.getPayload).foreach { page =>
if (rows.size < resultMaxRows) {
// FLINK-24461 retrieveResultPage method changes the return
type from Row to RowData
- val result = executor.retrieveResultPage(resultId,
page).asScala.toList
- result.headOption match {
- case None =>
- case Some(r) =>
- // for flink 1.14
- if (r.getClass == classOf[Row]) {
- rows ++= result.asInstanceOf[List[Row]]
- } else {
- // for flink 1.15+
- rows ++= result.map(r =>
convertToRow(r.asInstanceOf[RowData], dataTypes))
- }
+ val retrieveResultPage =
DynMethods.builder("retrieveResultPage")
+ .impl(executor.getClass, classOf[String], classOf[Int])
+ .build(executor)
+ val _page = Integer.valueOf(page)
+ if (FlinkEngineUtils.isFlinkVersionEqualTo("1.14")) {
Review Comment:
It‘s better to use the `FlinkVersion` enum here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]