Skip to content

[KYUUBI #4806][FLINK] Support time-out incremental result fetch for Flink engine#5134

Closed
link3280 wants to merge 9 commits intoapache:masterfrom
link3280:KYUUBI-4806
Closed

[KYUUBI #4806][FLINK] Support time-out incremental result fetch for Flink engine#5134
link3280 wants to merge 9 commits intoapache:masterfrom
link3280:KYUUBI-4806

Conversation

@link3280
Copy link
Contributor

@link3280 link3280 commented Aug 7, 2023

Why are the changes needed?

As titled.

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

@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2023

Codecov Report

Merging #5134 (1563fa9) into master (14d0dab) will not change coverage.
Report is 20 commits behind head on master.
The diff coverage is 0.00%.

❗ Current head 1563fa9 differs from pull request most recent head a1b7478. Consider uploading reports for the commit a1b7478 to get more accurate results

@@          Coverage Diff           @@
##           master   #5134   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         566     566           
  Lines       31654   31703   +49     
  Branches     4124    4134   +10     
======================================
- Misses      31654   31703   +49     
Files Changed Coverage Δ
...in/scala/org/apache/kyuubi/config/KyuubiConf.scala 0.00% <0.00%> (ø)

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@link3280 link3280 changed the title [WIP][FEATURE][Flink] Implement result fetch timeout for Flink engine [WIP][FEATURE][Flink] Support incremental result fetch for Flink engine Aug 11, 2023
@link3280 link3280 added this to the v1.8.0 milestone Aug 11, 2023
@link3280 link3280 self-assigned this Aug 11, 2023
@link3280 link3280 changed the title [WIP][FEATURE][Flink] Support incremental result fetch for Flink engine [FEATURE][Flink] Support incremental result fetch for Flink engine Aug 12, 2023
@link3280
Copy link
Contributor Author

@pan3793 @bowenliang123 PTAL.

@link3280 link3280 changed the title [FEATURE][Flink] Support incremental result fetch for Flink engine [KYUUBI #4806][Flink] Support incremental result fetch for Flink engine Aug 12, 2023
@link3280 link3280 requested a review from pan3793 August 14, 2023 06:43
@pan3793 pan3793 changed the title [KYUUBI #4806][Flink] Support incremental result fetch for Flink engine [KYUUBI #4806][FLINK] Support incremental result fetch for Flink engine Aug 15, 2023
@bowenliang123 bowenliang123 changed the title [KYUUBI #4806][FLINK] Support incremental result fetch for Flink engine [KYUUBI #4806][FLINK] Support time-out incremental result fetch for Flink engine Aug 16, 2023
@bowenliang123
Copy link
Contributor

bowenliang123 commented Aug 17, 2023

If no data are fetched, a TimeoutException would be thrown.
I would prefer not to throw a TimeoutException and return an empty result set instead.
An empty result for time-out fetching is expected if the timeout config is set.

@link3280
Copy link
Contributor Author

We had a related discussion here: #4806 (comment)

@bowenliang123
Copy link
Contributor

Well, it's acceptable, while the discussion was treated as a hint for internal behaviour than for a feature for me at the time.
Let's see what others think.

@link3280
Copy link
Contributor Author

link3280 commented Aug 22, 2023

Any further comments? @pan3793

@bowenliang123 bowenliang123 requested a review from pan3793 August 22, 2023 02:08
@pan3793
Copy link
Member

pan3793 commented Aug 22, 2023

@link3280 sorry for the late response, just back to the office, will finish review today.

@link3280
Copy link
Contributor Author

@pan3793 No worries. Please take a look whenever it works for you.

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

"fetched, a TimeoutException would be thrown.")
.version("1.8.0")
.timeConf
.createOptional
Copy link
Member

Choose a reason for hiding this comment

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

what's the style for other configurations, use 0 or None to represent inf? let's algin the style

Copy link
Contributor Author

@link3280 link3280 Aug 23, 2023

Choose a reason for hiding this comment

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

I found kyuubi.operation.query.timeout uses None.

val OPERATION_QUERY_TIMEOUT: OptionalConfigEntry[Long] =
buildConf("kyuubi.operation.query.timeout")
.doc("Timeout for query executions at server-side, take effect with client-side timeout(" +
"`java.sql.Statement.setQueryTimeout`) together, a running query will be cancelled" +
" automatically if timeout. It's off by default, which means only client-side take full" +
" control of whether the query should timeout or not." +
" If set, client-side timeout is capped at this point." +
" To cancel the queries right away without waiting for task to finish," +
s" consider enabling ${OPERATION_FORCE_CANCEL.key} together.")
.version("1.2.0")
.timeConf
.checkValue(_ >= 1000, "must >= 1s if set")
.createOptional

Plus, I think 0 sometimes denotes an immediate timeout instead of an infinite timeout, thus None is a better choice.

link3280 and others added 3 commits August 23, 2023 21:06
…uubi/engine/flink/result/ResultSet.scala

Co-authored-by: Cheng Pan <pan3793@gmail.com>
…uubi/engine/flink/operation/FlinkOperation.scala

Co-authored-by: Cheng Pan <pan3793@gmail.com>
@link3280 link3280 closed this in e9ca827 Aug 24, 2023
@link3280
Copy link
Contributor Author

Merged. Thanks a lot!

@bowenliang123
Copy link
Contributor

Thanks for the efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants