Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[KYUUBI #1579] Implement basic ability of executing statement in Flink engine #1603

Closed
wants to merge 4 commits into from

Conversation

yanghua
Copy link
Contributor

@yanghua yanghua commented Dec 21, 2021

Why are the changes needed?

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@yanghua yanghua marked this pull request as draft December 21, 2021 15:42

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils_2.12</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kyuubi uses log4j12, but this has transitive deps log4j2. We should exclude other log4j2 deps except to log4j2-core, and bridge it to sfl4j

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2.12 => ${scala_binary_version}

import java.util.stream.IntStream

import scala.collection.JavaConversions._
import scala.collection.JavaConverters.collectionAsScalaIterableConverter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaConverters is deprecated, use import scala.collection.JavaConversions._ and [util.List object].asScala

Thread.sleep(50) // slow the processing down

val result = executor.snapshotResult(sessionId, resultID, 2)
if (result.getType eq TypedResult.ResultType.PAYLOAD) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use

result.getType match {
  case TypedResult.ResultType.PAYLOAD =>
  case TypedResult.ResultType.EOS =>
}

here?


private var resultDescriptor: ResultDescriptor = _

private var columnInfos: List[ColumnInfo] = _
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List[ColumnInfo] => util.List[ColumnInfo]


foo(page)
})
} else if (result.getType eq TypedResult.ResultType.EOS) loop = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we should return a iterator and lazy fetch the next snapshot (or periodically update the snapshot), but it's ok for now, as we just tend to support the simplest query select 1 in this initial PR.

@pan3793 pan3793 changed the title [WIP][KYUUBI #1579] Implement basic ability of executing statement [KYUUBI #1579] Implement basic ability of executing statement Dec 22, 2021
@pan3793 pan3793 added the kind:feature Feature request label Dec 22, 2021
@pan3793 pan3793 added this to the v1.5.0 milestone Dec 22, 2021
@pan3793 pan3793 marked this pull request as ready for review December 22, 2021 13:58
@codecov-commenter
Copy link

Codecov Report

Merging #1603 (3670751) into master (01364e5) will decrease coverage by 0.73%.
The diff coverage is 60.46%.

❗ Current head 3670751 differs from pull request most recent head 48db76b. Consider uploading reports for the commit 48db76b to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1603      +/-   ##
============================================
- Coverage     58.96%   58.23%   -0.74%     
+ Complexity      196      163      -33     
============================================
  Files           255      257       +2     
  Lines         12663    12797     +134     
  Branches       1601     1610       +9     
============================================
- Hits           7467     7452      -15     
- Misses         4560     4719     +159     
+ Partials        636      626      -10     
Impacted Files Coverage Δ
...ine/flink/operation/FlinkSQLOperationManager.scala 9.09% <0.00%> (-0.91%) ⬇️
.../engine/flink/session/FlinkSQLSessionManager.scala 50.00% <16.66%> (-16.67%) ⬇️
...kyuubi/engine/flink/session/FlinkSessionImpl.scala 85.71% <50.00%> (-14.29%) ⬇️
...org/apache/kyuubi/engine/flink/schema/RowSet.scala 13.86% <60.00%> (+2.50%) ⬆️
...uubi/engine/flink/operation/ExecuteStatement.scala 65.15% <65.15%> (ø)
...kyuubi/engine/flink/operation/FlinkOperation.scala 42.62% <80.00%> (+3.33%) ⬆️
...cala/org/apache/kyuubi/metrics/MetricsSystem.scala 75.00% <0.00%> (-5.00%) ⬇️
...he/kyuubi/engine/spark/repl/KyuubiSparkILoop.scala 90.16% <0.00%> (-3.28%) ⬇️
...ache/kyuubi/server/api/v1/OperationsResource.scala 64.10% <0.00%> (-0.61%) ⬇️
...a/org/apache/kyuubi/metrics/MetricsConstants.scala 100.00% <0.00%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01364e5...48db76b. Read the comment docs.

@pan3793 pan3793 changed the title [KYUUBI #1579] Implement basic ability of executing statement [KYUUBI #1579] Implement basic ability of executing statement in Flink engine Dec 22, 2021
@pan3793
Copy link
Member

pan3793 commented Dec 22, 2021

Thanks, merging to master for v1.5

@pan3793 pan3793 closed this in 3673399 Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature Feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants